diff options
620 files changed, 9081 insertions, 12240 deletions
diff --git a/.gitignore b/.gitignore index 50784a43df04..25df1065c1ec 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,7 @@ # the build directories /*/unxlng?? /*/unxlng??.pro -/*/wntmsci?? -/*/wntmsci??.pro +/*/wntmsc??? +/*/wntmsc???.pro +/*/unxmac?? +/*/unxmac??.pro diff --git a/dbaccess/JunitTest_dbaccess_unoapi.mk b/dbaccess/JunitTest_dbaccess_unoapi.mk new file mode 100644 index 000000000000..14929775648e --- /dev/null +++ b/dbaccess/JunitTest_dbaccess_unoapi.mk @@ -0,0 +1,49 @@ +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen@canonical.com> +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_JunitTest_JunitTest,dbaccess_unoapi)) + +$(eval $(call gb_JunitTest_set_defs,dbaccess_unoapi,\ + $$(DEFS) \ + -Dorg.openoffice.test.arg.sce=$(SRCDIR)/dbaccess/qa/unoapi/dbaccess.sce \ + -Dorg.openoffice.test.arg.xcl=$(SRCDIR)/dbaccess/qa/unoapi/knownissues.xcl \ + -Dorg.openoffice.test.arg.tdoc=$(SRCDIR)/dbaccess/qa/unoapi/testdocuments \ +)) + +$(eval $(call gb_JunitTest_add_jars,dbaccess_unoapi,\ + $(OUTDIR)/bin/OOoRunner.jar \ + $(OUTDIR)/bin/ridl.jar \ + $(OUTDIR)/bin/test.jar \ + $(OUTDIR)/bin/unoil.jar \ + $(OUTDIR)/bin/jurt.jar \ +)) + +$(eval $(call gb_JunitTest_add_classes,dbaccess_unoapi,\ + org.openoffice.test.UnoApiTest \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/reportdesign/qa/complex/makefile.mk b/dbaccess/Makefile index 9d1b7667c125..a79aff831024 100755..100644 --- a/reportdesign/qa/complex/makefile.mk +++ b/dbaccess/Makefile @@ -25,34 +25,14 @@ # #************************************************************************* -PRJ=..$/.. +ifeq ($(strip $(SOLARENV)),) +$(error No environment set!) +endif -PRJNAME = reportdesign -PACKAGE = complex -TARGET = rptdesigntest +gb_PARTIALBUILD := T +GBUILDDIR := $(SOLARENV)/gbuild +include $(GBUILDDIR)/gbuild.mk -# --- Settings ----------------------------------------------------- +$(eval $(call gb_Module_make_global_targets,$(shell ls $(dir $(realpath $(firstword $(MAKEFILE_LIST))))/Module*.mk))) -.INCLUDE : settings.mk - -# --- Files -------------------------------------------------------- - -JARFILES = ridl.jar jurt.jar unoil.jar juh.jar OOoRunner.jar - -JAVAFILES = ReportDesignerTest.java - -# --- Targets ------------------------------------------------------ - -.INCLUDE : target.mk - -# JAVADEBUG=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8502,suspend=y -JAVADEBUG= - -MYSQL_CONNECTOR=$(PWD)$/mysql-connector-java-5.0.6-bin.jar -CLASSPATH!:=$(CLASSPATH)$(PATH_SEPERATOR)$(MYSQL_CONNECTOR) - -run: ALLTAR - $(PERL) mysql-connector-exists.pl $(MYSQL_CONNECTOR) -# @echo $(CLASSPATH) -# @echo $(VCSID) - @java $(JAVADEBUG) -cp $(CLASSPATH) -DVCSID=$(VCSID) -DCWS_WORK_STAMP=$(CWS_WORK_STAMP) -DUPDMINOR=$(UPDMINOR) org.openoffice.Runner -ini runner.props +# vim: set noet sw=4 ts=4: diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk new file mode 100644 index 000000000000..df8996cba3a0 --- /dev/null +++ b/dbaccess/Module_dbaccess.mk @@ -0,0 +1,34 @@ +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# The Initial Developer of the Original Code is +# Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen@canonical.com> +# Portions created by the Initial Developer are Copyright (C) 2010 the +# Initial Developer. All Rights Reserved. +# +# Major Contributor(s): +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +$(eval $(call gb_Module_Module,dbaccess)) + +$(eval $(call gb_Module_add_subsequentcheck_targets,dbaccess,\ + JunitTest_dbaccess_unoapi \ +)) + +# vim: set noet ts=4 sw=4: diff --git a/dbaccess/inc/AsyncronousLink.hxx b/dbaccess/inc/AsyncronousLink.hxx index 93faab850163..3fff1f7deb20 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 64ad54844912..000000000000 --- 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/ToolBoxHelper.hxx b/dbaccess/inc/ToolBoxHelper.hxx index e95e40a0f4a1..280d523a8ca0 100644 --- a/dbaccess/inc/ToolBoxHelper.hxx +++ b/dbaccess/inc/ToolBoxHelper.hxx @@ -43,7 +43,6 @@ namespace dbaui { class DBACCESS_DLLPUBLIC OToolBoxHelper { - sal_Bool m_bIsHiContrast;// true when the toolbox is in hi contrast mode sal_Int16 m_nSymbolsSize; // shows the toolbox large or small bitmaps ToolBox* m_pToolBox; // our toolbox (may be NULL) public: @@ -62,7 +61,7 @@ namespace dbaui @param _bHiContast <TRUE/> when in high contrast mode. */ - virtual ImageList getImageList(sal_Int16 _eSymbolsSize,sal_Bool _bHiContast) const = 0; + virtual ImageList getImageList(sal_Int16 _eSymbolsSize) const = 0; /** only the member will be set, derived classes can overload this function and do what need to be done. @param _pTB @@ -72,13 +71,12 @@ namespace dbaui */ virtual void setToolBox(ToolBox* _pTB); - inline ToolBox* getToolBox() const { return m_pToolBox; } + inline ToolBox* getToolBox() const { return m_pToolBox; } /** checks if the toolbox needs a new imagelist. */ void checkImageList(); - inline sal_Bool isToolBoxHiContrast() const { return m_bIsHiContrast; } protected: DECL_LINK(ConfigOptionsChanged, SvtMiscOptions*); DECL_LINK(SettingsChanged, VclWindowEvent* ); diff --git a/dbaccess/inc/dataview.hxx b/dbaccess/inc/dataview.hxx index e3026f15ce56..813faa4a8dd4 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 22d1ceb11368..29094bee1882 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 c273a67edcbd..96ff91e7d0e8 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 100644 index 000000000000..1b8627f66326 --- /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 75e146ec2a05..a4d24359cebc 100644 --- a/dbaccess/inc/singledoccontroller.hxx +++ b/dbaccess/inc/dbsubcomponentcontroller.hxx @@ -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,14 +93,6 @@ 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 @@ -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 510e554e93f6..3dad26798ec1 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 f8b0502574e0..c0c9f8fb9517 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 : TRANSLATIONS:translations 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,7 @@ 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 383cc119c814..543714657d31 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 4c964e82dc06..f8a57b8f6efb 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 909bf39d1707..6052c308dbdf 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,83 +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 = ".component:DB/DataSourceBrowser"; 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[] @@ -164,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()) @@ -173,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(); @@ -186,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 3bba8fa45001..aa74ea87a3f6 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 53527e356f78..7f88028f72c9 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 7c3db7f6020d..1facca3d8497 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 f74d5af8d8f0..ae5d131c1e20 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 d6bfa804eafa..0941bd318d47 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 02fb820f3fd4..b22671fa2f18 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 @@ -653,15 +627,14 @@ public class DatabaseDocument extends TestCase implements com.sun.star.document. " oEvent.EventName = \"OnLoad\"\n" + " oEvent.Source = ThisComponent\n" + "\n" + - " oCallback.documentEventOccured( oEvent )\n" + + " oCallback.documentEventOccurred( oEvent )\n" + "End Sub\n"; XModel databaseDoc = impl_createDocWithMacro( libName, moduleName, eventHandlerCode ); final String documentURL = databaseDoc.getURL(); // 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 2b1b9342edcb..588755a8c29c 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 c686be886bba..9f77559eab0b 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 81a651fd5696..e78f6859fb88 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 002d0395b791..ad78eb37718b 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 5a13f6724d1f..90531b29f9ed 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 ); @@ -97,56 +101,31 @@ public class RowSet extends ComplexTestCase for (int i = 0; m_resultSet.next(); ++i) { int pos = m_resultSet.getRow(); - // final int val = m_row.getInt(1); -// log.println("Clone Move(" + m_id +") before i: " + (i+1) + " Pos: " + pos + " Val: " + val); testPosition(m_resultSet, m_row, i + 1, "clone move(" + m_id + ")"); -// val = m_row.getInt(1); -// log.println("Clone Move(" + m_id +") after i: " + (i+1) + " Pos: " + pos + " Val: " + val); 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()); } } @@ -156,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) @@ -166,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 @@ -200,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)); @@ -224,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 @@ -282,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); } // -------------------------------------------------------------------------------------------------------- @@ -301,7 +275,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("testSequentialPositining failed: " + e, false); + fail("testSequentialPositining failed: " + e); } } @@ -313,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); } } @@ -343,7 +317,7 @@ public class RowSet extends ComplexTestCase } catch (Exception e) { - assure("test3 failed: " + e, false); + fail("test3 failed: " + e); } } @@ -370,17 +344,16 @@ 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 { - // final XRow _row = (XRow)UnoRuntime.queryInterface(XRow.class,_resultSet); _resultSet.beforeFirst(); final int numberOfThreads = 10; @@ -389,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(); } @@ -400,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 @@ -552,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(); @@ -592,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(); } @@ -614,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); @@ -644,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) @@ -685,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 @@ -699,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 @@ -713,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)); // ..................................................................................................... @@ -728,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 @@ -748,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); @@ -773,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 @@ -794,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); @@ -844,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"); @@ -876,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()); } } // -------------------------------------------------------------------------------------------------------- @@ -893,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()); } } @@ -904,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) @@ -918,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)); } } @@ -939,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()); } } @@ -958,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 @@ -972,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()); } } @@ -1002,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 c4569986a5d7..2f1d642c19b3 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 bb3636100849..89d107ed5bb1 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 b8dae3f6f350..f2cbdf988b38 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 fc772b158f5f..536d66025deb 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 c5fa408ff273..000000000000 --- 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 56a24c0292fc..760f94a294fa 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.cxx b/dbaccess/source/core/api/BookmarkSet.cxx index 5a88c248befd..f9cf63233a67 100644 --- a/dbaccess/source/core/api/BookmarkSet.cxx +++ b/dbaccess/source/core/api/BookmarkSet.cxx @@ -43,11 +43,9 @@ using namespace ::dbtools; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -// using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -// using namespace ::cppu; using namespace ::osl; void OBookmarkSet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter) @@ -133,7 +131,6 @@ void SAL_CALL OBookmarkSet::insertRow( const ORowSetRow& _rInsertRow,const conne void SAL_CALL OBookmarkSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& /*_xTable*/ ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OBookmarkSet::updateRow" ); - // OCacheSet::updateRow( _rInsertRow,_rOrginalRow,_xTable); Reference<XRowUpdate> xUpdRow(m_xRowLocate,UNO_QUERY); if(!xUpdRow.is()) ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_NO_XROWUPDATE ), SQL_GENERAL_ERROR, *this ); @@ -205,8 +202,6 @@ void OBookmarkSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xParamet break; case DataType::CHAR: case DataType::VARCHAR: - //case DataType::DECIMAL: - //case DataType::NUMERIC: _xParameter->updateString(nPos,_rValue); break; case DataType::BIGINT: diff --git a/dbaccess/source/core/api/BookmarkSet.hxx b/dbaccess/source/core/api/BookmarkSet.hxx index 7e9a199d6c79..1b7b8052c285 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/CRowSetColumn.cxx b/dbaccess/source/core/api/CRowSetColumn.cxx index 883ec1b7b1b2..161525667d1b 100644 --- a/dbaccess/source/core/api/CRowSetColumn.cxx +++ b/dbaccess/source/core/api/CRowSetColumn.cxx @@ -55,10 +55,7 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaDa ::cppu::IPropertyArrayHelper* ORowSetColumn::createArrayHelper( ) const { - const sal_Int32 nDerivedProperties = 21; - Sequence< Property> aDerivedProperties( nDerivedProperties ); - Property* pDesc = aDerivedProperties.getArray(); - sal_Int32 nPos = 0; + BEGIN_PROPERTY_SEQUENCE(21) DECL_PROP1( CATALOGNAME, ::rtl::OUString, READONLY ); DECL_PROP1( DISPLAYSIZE, sal_Int32, READONLY ); @@ -81,12 +78,13 @@ ORowSetColumn::ORowSetColumn( const Reference < XResultSetMetaData >& _xMetaDa DECL_PROP1( TYPE, sal_Int32, READONLY ); DECL_PROP1( TYPENAME, ::rtl::OUString, READONLY ); DECL_PROP2( VALUE, Any, READONLY, BOUND ); - OSL_ENSURE( nPos == nDerivedProperties, "ORowSetColumn::createArrayHelper: inconsistency!" ); + + END_PROPERTY_SEQUENCE() Sequence< Property > aRegisteredProperties; describeProperties( aRegisteredProperties ); - return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDerivedProperties, aRegisteredProperties ), sal_False ); + return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDescriptor, aRegisteredProperties ), sal_False ); } ::cppu::IPropertyArrayHelper& ORowSetColumn::getInfoHelper() diff --git a/dbaccess/source/core/api/CRowSetDataColumn.cxx b/dbaccess/source/core/api/CRowSetDataColumn.cxx index c31cc17b6ec2..2aa99a9ff767 100644 --- a/dbaccess/source/core/api/CRowSetDataColumn.cxx +++ b/dbaccess/source/core/api/CRowSetDataColumn.cxx @@ -42,7 +42,6 @@ using namespace comphelper; using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; -// using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; @@ -78,10 +77,7 @@ ORowSetDataColumn::~ORowSetDataColumn() // comphelper::OPropertyArrayUsageHelper ::cppu::IPropertyArrayHelper* ORowSetDataColumn::createArrayHelper( ) const { - const sal_Int32 nDerivedProperties = 21; - Sequence< Property> aDerivedProperties( nDerivedProperties ); - Property* pDesc = aDerivedProperties.getArray(); - sal_Int32 nPos = 0; + BEGIN_PROPERTY_SEQUENCE(21) DECL_PROP1( CATALOGNAME, ::rtl::OUString, READONLY ); DECL_PROP1( DISPLAYSIZE, sal_Int32, READONLY ); @@ -104,12 +100,13 @@ ORowSetDataColumn::~ORowSetDataColumn() DECL_PROP1( TYPE, sal_Int32, READONLY ); DECL_PROP1( TYPENAME, ::rtl::OUString, READONLY ); DECL_PROP1( VALUE, Any, BOUND ); - OSL_ENSURE( nPos == nDerivedProperties, "ORowSetDataColumn::createArrayHelper: inconsistency!" ); + + END_PROPERTY_SEQUENCE() Sequence< Property > aRegisteredProperties; describeProperties( aRegisteredProperties ); - return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDerivedProperties, aRegisteredProperties ), sal_False ); + return new ::cppu::OPropertyArrayHelper( ::comphelper::concatSequences( aDescriptor, aRegisteredProperties ), sal_False ); } // cppu::OPropertySetHelper @@ -256,10 +253,8 @@ sdbcx::ObjectType ORowSetDataColumns::createObject(const ::rtl::OUString& _rName void SAL_CALL ORowSetDataColumns::disposing(void) { - // clear_NoDispose(); ORowSetDataColumns_BASE::disposing(); m_aColumns = NULL; - // m_aColumns.clear(); } void ORowSetDataColumns::assign(const ::rtl::Reference< ::connectivity::OSQLColumns>& _rColumns,const ::std::vector< ::rtl::OUString> &_rVector) diff --git a/dbaccess/source/core/api/CacheSet.cxx b/dbaccess/source/core/api/CacheSet.cxx index 2ebed10c0479..932652961109 100644 --- a/dbaccess/source/core/api/CacheSet.cxx +++ b/dbaccess/source/core/api/CacheSet.cxx @@ -61,18 +61,17 @@ using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -// using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::io; -// using namespace ::cppu; 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) { @@ -139,11 +138,11 @@ OCacheSet::~OCacheSet() } catch(Exception&) { - OSL_ENSURE(0,"Exception occured"); + OSL_FAIL("Exception occurred"); } catch(...) { - OSL_ENSURE(0,"Unknown Exception occured"); + OSL_FAIL("Unknown Exception occurred"); } DBG_DTOR(OCacheSet,NULL); @@ -219,7 +218,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow ,::std::list< sal_Int32>& _rOrgValues) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OCacheSet::fillParameters" ); - // use keys and indexes for excat postioning + // use keys and indexes for exact positioning // first the keys Reference<XPropertySet> xSet(_xTable,UNO_QUERY); const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xSet); @@ -273,7 +272,7 @@ void OCacheSet::fillParameters( const ORowSetRow& _rRow _sCondition.append(aAnd); _rOrgValues.push_back(nCheckCount); - } // if(xPrimaryKeyColumns.is() && xPrimaryKeyColumns->hasByName(aColumnName)) + } ::std::vector< Reference<XNameAccess> >::const_iterator aIndexEnd = aAllIndexColumns.end(); for( ::std::vector< Reference<XNameAccess> >::const_iterator aIndexIter = aAllIndexColumns.begin(); aIndexIter != aIndexEnd;++aIndexIter) @@ -336,7 +335,7 @@ void SAL_CALL OCacheSet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetR setParameter(i,xParameter,*aIter,m_xSetMetaData->getColumnType(i),m_xSetMetaData->getScale(i)); ++i; } - } // for(ORowVector< ORowSetValue >::Vector::const_iterator aIter = _rInsertRow->get().begin()+1; aIter != aEnd;++aIter) + } ::std::list< sal_Int32>::const_iterator aOrgValueEnd = aOrgValues.end(); for(::std::list< sal_Int32>::const_iterator aOrgValue = aOrgValues.begin(); aOrgValue != aOrgValueEnd;++aOrgValue,++i) { @@ -360,7 +359,7 @@ void SAL_CALL OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connecti ::rtl::OUString aQuote = getIdentifierQuoteString(); static ::rtl::OUString aAnd(RTL_CONSTASCII_USTRINGPARAM(" AND ")); - // use keys and indexes for excat postioning + // use keys and indexes for exact positioning // first the keys const Reference<XNameAccess> xPrimaryKeyColumns = getPrimaryKeyColumns_throw(xSet); // second the indexes @@ -392,7 +391,7 @@ void SAL_CALL OCacheSet::deleteRow(const ORowSetRow& _rDeleteRow ,const connecti aSql.setLength(aSql.getLength()-5); - // now create end execute the prepared statement + // now create and execute the prepared statement Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql.makeStringAndClear())); Reference< XParameters > xParameter(xPrep,UNO_QUERY); sal_Int32 i = 1; @@ -678,7 +677,7 @@ bool OCacheSet::isResultSetChanged() const void OCacheSet::reset(const Reference< XResultSet>& /*_xDriverSet*/) { - OSL_ENSURE(0,"Illegal call!"); + OSL_FAIL("Illegal call!"); } void OCacheSet::mergeColumnValues(sal_Int32 i_nColumnIndex,ORowSetValueVector::Vector& /*io_aInsertRow*/,ORowSetValueVector::Vector& /*io_aRow*/,::std::vector<sal_Int32>& o_aChangedColumns) diff --git a/dbaccess/source/core/api/CacheSet.hxx b/dbaccess/source/core/api/CacheSet.hxx index 42f5d290edd5..961a0147e55b 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/FilteredContainer.cxx b/dbaccess/source/core/api/FilteredContainer.cxx index 4befdc824b03..d9ead8aa4f79 100644 --- a/dbaccess/source/core/api/FilteredContainer.cxx +++ b/dbaccess/source/core/api/FilteredContainer.cxx @@ -189,7 +189,7 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std } else { - // for wildcard search : remove all table filters which are a wildcard expression and build a WilCard + // for wildcard search : remove all table filters which are a wildcard expression and build a WildCard // for them ::std::vector< WildCard > aWildCardTableFilter; Sequence< ::rtl::OUString > aNonWildCardTableFilter = _tableFilter; @@ -311,12 +311,11 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std { // build sorted versions of the filter sequences, so the visibility decision is faster Sequence< ::rtl::OUString > aTableFilter(_rTableFilter); - sal_Int32 nTableFilterLen = aTableFilter.getLength(); - // for wildcard search : remove all table filters which are a wildcard expression and build a WilCard + // for wildcard search : remove all table filters which are a wildcard expression and build a WildCard // for them ::std::vector< WildCard > aWCSearch; - nTableFilterLen = createWildCardVector(aTableFilter,aWCSearch); + createWildCardVector(aTableFilter,aWCSearch); try { @@ -460,7 +459,7 @@ sal_Int32 createWildCardVector(Sequence< ::rtl::OUString >& _rTableFilter, ::std switch ( nFilterMode ) { default: - OSL_ENSURE( sal_False, "OTableContainer::getAllTableTypeFilter: unknown TableTypeFilterMode!" ); + OSL_FAIL( "OTableContainer::getAllTableTypeFilter: unknown TableTypeFilterMode!" ); case FILTER_MODE_MIX_ALL: _rFilter.realloc( 3 ); _rFilter[0] = sView; diff --git a/dbaccess/source/core/api/HelperCollections.cxx b/dbaccess/source/core/api/HelperCollections.cxx index b47449330aa0..acc2d3ef337f 100644 --- a/dbaccess/source/core/api/HelperCollections.cxx +++ b/dbaccess/source/core/api/HelperCollections.cxx @@ -97,7 +97,7 @@ namespace dbaccess if(aIter != m_aColumns->get().end()) return connectivity::sdbcx::ObjectType(*aIter,UNO_QUERY); - OSL_ENSURE(0,"Column not found in collection!"); + OSL_FAIL("Column not found in collection!"); } return NULL; } @@ -109,6 +109,7 @@ namespace dbaccess OSQLTables::iterator aIter = m_aTables.find(_rName); OSL_ENSURE(aIter != m_aTables.end(),"Table not found!"); OSL_ENSURE(aIter->second.is(),"Table is null!"); + (void)aIter; return connectivity::sdbcx::ObjectType(m_aTables.find(_rName)->second,UNO_QUERY); } return NULL; diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index 0d4c3147efb6..a749729e4c88 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) @@ -133,7 +135,7 @@ OKeySet::~OKeySet() } catch(...) { - OSL_ENSURE(0,"Unknown Exception occured"); + OSL_FAIL("Unknown Exception occurred"); } m_xComposer = 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) ); @@ -176,7 +178,7 @@ void OKeySet::findTableColumnsMatching_throw( const Any& i_aTable, ::rtl::OUString sUpdateTableName( i_rUpdateTableName ); if ( sUpdateTableName.getLength() == 0 ) { - OSL_ENSURE( false, "OKeySet::findTableColumnsMatching_throw: This is a fallback only - it won't work when the table has an alias name." ); + OSL_FAIL( "OKeySet::findTableColumnsMatching_throw: This is a fallback only - it won't work when the table has an alias name." ); // If i_aTable originates from a query composer, and is a table which appears with an alias in the SELECT statement, // then the below code will not produce correct results. // For instance, imagine a "SELECT alias.col FROM table AS alias". Now i_aTable would be the table named @@ -288,15 +290,12 @@ void OKeySet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::O for(SelectColumnsMetaData::iterator aPosIter = (*m_pForeignColumnNames).begin();aPosIter != aPosEnd;++aPosIter) { // look for columns not in the source columns to use them as filter as well - // if ( !xSourceColumns->hasByName(aPosIter->first) ) - { if ( aFilter.getLength() ) aFilter.append(aAnd); aFilter.append(::dbtools::quoteName( aQuote,sSelectTableName)); aFilter.append(s_sDot); aFilter.append(::dbtools::quoteName( aQuote,aPosIter->second.sRealName)); aFilter.append(s_sParam); - } } break; } @@ -327,7 +326,7 @@ void OKeySet::executeStatement(::rtl::OUStringBuffer& io_aFilter,const ::rtl::OU for(;pAnd != pAndEnd;++pAnd) { ::rtl::OUString sValue; - if ( !(pAnd->Value >>= sValue) || !(sValue.equalsAscii("?") || sValue.matchAsciiL(":",1,0)) ) + if ( !(pAnd->Value >>= sValue) || !(sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("?")) || sValue.matchAsciiL(":",1,0)) ) { // we have a criteria which has to be taken into account for updates m_aFilterColumns.push_back(pAnd->Name); } @@ -519,7 +518,6 @@ void SAL_CALL OKeySet::updateRow(const ORowSetRow& _rInsertRow ,const ORowSetRow SelectColumnsMetaData::const_iterator aEnd = m_pColumnNames->end(); for(;aIter != aEnd;++aIter,++i) { - //if(xKeyColumns.is() && xKeyColumns->hasByName(aIter->first)) if ( m_pKeyColumnNames->find(aIter->first) != m_pKeyColumnNames->end() ) { sKeyCondition.append(::dbtools::quoteName( aQuote,aIter->second.sRealName)); @@ -768,7 +766,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString } catch(Exception&) { - OSL_ENSURE(0,"Could not execute GeneratedKeys() stmt"); + OSL_FAIL("Could not execute GeneratedKeys() stmt"); } } @@ -827,7 +825,7 @@ void OKeySet::executeInsert( const ORowSetRow& _rInsertRow,const ::rtl::OUString } catch(SQLException&) { - OSL_ENSURE(0,"Could not fetch with MAX() "); + OSL_FAIL("Could not fetch with MAX() "); } } } @@ -933,8 +931,8 @@ void OKeySet::copyRowValue(const ORowSetRow& _rInsertRow,ORowSetRow& _rKeyRow,sa SelectColumnsMetaData::const_iterator aPosEnd = (*m_pKeyColumnNames).end(); for(;aPosIter != aPosEnd;++aPosIter,++aIter) { + impl_convertValue_throw(_rInsertRow,aPosIter->second); *aIter = (_rInsertRow->get())[aPosIter->second.nPosition]; - impl_convertValue_throw(_rKeyRow,aPosIter->second); aIter->setTypeKind(aPosIter->second.nType); } } @@ -979,7 +977,7 @@ void SAL_CALL OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivit aSql.append(::dbtools::quoteName( aQuote,aIter->second.sRealName)); if((_rDeleteRow->get())[aIter->second.nPosition].isNull()) { - OSL_ENSURE(0,"can a primary key be null"); + OSL_FAIL("can a primary key be null"); aSql.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" IS NULL"))); } else @@ -1331,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 3ee20477f63a..10e9f2166827 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 9433df191294..bf9969470594 100644 --- a/dbaccess/source/core/api/OptimisticSet.cxx +++ b/dbaccess/source/core/api/OptimisticSet.cxx @@ -1,3 +1,4 @@ + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * @@ -7,9 +8,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: OptimisticSet.cxx,v $ - * $Revision: 1.73 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -103,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) @@ -125,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); @@ -200,7 +199,6 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow TSQLStatements aIndexConditions; TSQLStatements aSql; - // sal_Int32 i = 1; // here we build the condition part for the update statement SelectColumnsMetaData::const_iterator aIter = m_pColumnNames->begin(); SelectColumnsMetaData::const_iterator aEnd = m_pColumnNames->end(); @@ -257,10 +255,8 @@ void SAL_CALL OptimisticSet::updateRow(const ORowSetRow& _rInsertRow ,const ORow sSql.append(s_sSET); sSql.append(aSqlIter->second); ::rtl::OUStringBuffer& rCondition = aKeyConditions[aSqlIter->first]; - bool bAddWhere = true; if ( rCondition.getLength() ) { - bAddWhere = false; sSql.appendAscii(" WHERE "); sSql.append( rCondition ); } @@ -393,7 +389,6 @@ void SAL_CALL OptimisticSet::deleteRow(const ORowSetRow& _rDeleteRow,const conne TSQLStatements aIndexConditions; TSQLStatements aSql; - // sal_Int32 i = 1; // here we build the condition part for the update statement SelectColumnsMetaData::const_iterator aIter = m_pColumnNames->begin(); SelectColumnsMetaData::const_iterator aEnd = m_pColumnNames->end(); @@ -430,7 +425,7 @@ void OptimisticSet::executeDelete(const ORowSetRow& _rDeleteRow,const ::rtl::OUS { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OptimisticSet::executeDelete" ); - // now create end execute the prepared statement + // now create and execute the prepared statement Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(i_sSQL)); Reference< XParameters > xParameter(xPrep,UNO_QUERY); diff --git a/dbaccess/source/core/api/OptimisticSet.hxx b/dbaccess/source/core/api/OptimisticSet.hxx index 3dc4ad4f0e73..75cb3fdfd612 100644 --- a/dbaccess/source/core/api/OptimisticSet.hxx +++ b/dbaccess/source/core/api/OptimisticSet.hxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: KeySet.hxx,v $ - * $Revision: 1.30 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -79,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/PrivateRow.hxx b/dbaccess/source/core/api/PrivateRow.hxx index 211ec7e9bea9..e03e8dcdc363 100644 --- a/dbaccess/source/core/api/PrivateRow.hxx +++ b/dbaccess/source/core/api/PrivateRow.hxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: OptimisticSet.cxx,v $ - * $Revision: 1.73 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index d035d1480648..54d791283ad6 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -230,7 +230,7 @@ ORowSet::~ORowSet() { if ( !m_rBHelper.bDisposed && !m_rBHelper.bInDispose ) { - OSL_ENSURE(0, "Please check who doesn't dispose this component!"); + OSL_FAIL("Please check who doesn't dispose this component!"); osl_incrementInterlockedCount( &m_refCount ); dispose(); } @@ -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; @@ -560,7 +560,7 @@ void ORowSet::freeResources( bool _bComplete ) // free all clones connectivity::OWeakRefArray::iterator aEnd = m_aClones.end(); - for (connectivity::OWeakRefArray::iterator i = m_aClones.begin(); aEnd != i; i++) + for (connectivity::OWeakRefArray::iterator i = m_aClones.begin(); aEnd != i; ++i) { Reference< XComponent > xComp(i->get(), UNO_QUERY); if (xComp.is()) @@ -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) @@ -1233,7 +1235,7 @@ void ORowSet::impl_setDataColumnsWriteable_throw() impl_restoreDataColumnsWriteable_throw(); TDataColumns::iterator aIter = m_aDataColumns.begin(); m_aReadOnlyDataColumns.resize(m_aDataColumns.size(),false); - ::std::bit_vector::iterator aReadIter = m_aReadOnlyDataColumns.begin(); + ::std::vector<bool, std::allocator<bool> >::iterator aReadIter = m_aReadOnlyDataColumns.begin(); for(;aIter != m_aDataColumns.end();++aIter,++aReadIter) { sal_Bool bReadOnly = sal_False; @@ -1247,7 +1249,7 @@ void ORowSet::impl_setDataColumnsWriteable_throw() void ORowSet::impl_restoreDataColumnsWriteable_throw() { TDataColumns::iterator aIter = m_aDataColumns.begin(); - ::std::bit_vector::iterator aReadIter = m_aReadOnlyDataColumns.begin(); + ::std::vector<bool, std::allocator<bool> >::iterator aReadIter = m_aReadOnlyDataColumns.begin(); for(;aReadIter != m_aReadOnlyDataColumns.end();++aIter,++aReadIter) { (*aIter)->setPropertyValue(PROPERTY_ISREADONLY,makeAny((sal_Bool)*aReadIter )); @@ -1483,7 +1485,7 @@ void SAL_CALL ORowSet::executeWithCompletion( const Reference< XInteractionHandl } catch(Exception&) { - DBG_ERROR("ORowSet::executeWithCompletion: caught an unexpected exception type while filling in the parameters!"); + OSL_FAIL("ORowSet::executeWithCompletion: caught an unexpected exception type while filling in the parameters!"); } // we're done with the parameters, now for the real execution @@ -1579,7 +1581,7 @@ void ORowSet::setStatementResultSetType( const Reference< XPropertySet >& _rxSta sal_Int32 nResultSetConcurrency( _nDesiredResultSetConcurrency ); // there *might* be a data source setting which tells use to be more defensive with those settings - // #i15113# / 2005-02-10 / frank.schoenheit@sun.com + // #i15113# sal_Bool bRespectDriverRST = sal_False; Any aSetting; if ( getDataSourceSetting( ::dbaccess::getDataSource( m_xActiveConnection ), "RespectDriverResultSetType", aSetting ) ) @@ -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,21 +1801,19 @@ 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(); } // get the locale - // ConfigManager* pConfigMgr = ConfigManager::GetConfigManager(); Locale aLocale = SvtSysLocale().GetLocaleData().getLocale(); - // pConfigMgr->GetDirectConfigProperty(ConfigManager::LOCALE) >>= aLocale; // get the numberformatTypes OSL_ENSURE(m_xActiveConnection.is(),"No ActiveConnection"); @@ -1823,7 +1825,6 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi ::rtl::Reference< ::connectivity::OSQLColumns> aColumns = new ::connectivity::OSQLColumns(); ::std::vector< ::rtl::OUString> aNames; ::rtl::OUString aDescription; - sal_Int32 nFormatKey = 0; const ::std::map<sal_Int32,sal_Int32>& rKeyColumns = m_pCache->getKeyColumns(); if(!m_xColumns.is()) @@ -1874,7 +1875,7 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi try { - nFormatKey = 0; + sal_Int32 nFormatKey = 0; if(m_xNumberFormatTypes.is()) nFormatKey = ::dbtools::getDefaultNumberFormat(pColumn,m_xNumberFormatTypes,aLocale); @@ -1928,8 +1929,6 @@ void ORowSet::execute_NoApprove_NoNewConn(ResettableMutexGuard& _rClearForNotifi if(!xColumn.is()) { // no column found so we could look at the position i - //bReFetchName = sal_True; - //sColumnLabel = ::rtl::OUString(); Reference<XIndexAccess> xIndexAccess(m_xColumns,UNO_QUERY); if(xIndexAccess.is() && i <= xIndexAccess->getCount()) { @@ -2122,7 +2121,7 @@ void ORowSet::notifyRowSetAndClonesRowDelete( const Any& _rBookmark ) onDeleteRow( _rBookmark ); // notify the clones connectivity::OWeakRefArray::iterator aEnd = m_aClones.end(); - for (connectivity::OWeakRefArray::iterator i = m_aClones.begin(); aEnd != i; i++) + for (connectivity::OWeakRefArray::iterator i = m_aClones.begin(); aEnd != i; ++i) { Reference< XUnoTunnel > xTunnel(i->get(),UNO_QUERY); if(xTunnel.is()) @@ -2140,7 +2139,7 @@ void ORowSet::notifyRowSetAndClonesRowDeleted( const Any& _rBookmark, sal_Int32 onDeletedRow( _rBookmark, _nPos ); // notify the clones connectivity::OWeakRefArray::iterator aEnd = m_aClones.end(); - for (connectivity::OWeakRefArray::iterator i = m_aClones.begin(); aEnd != i; i++) + for (connectivity::OWeakRefArray::iterator i = m_aClones.begin(); aEnd != i; ++i) { Reference< XUnoTunnel > xTunnel(i->get(),UNO_QUERY); if(xTunnel.is()) @@ -2218,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&) { @@ -2282,7 +2281,6 @@ sal_Bool ORowSet::impl_initComposer_throw( ::rtl::OUString& _out_rCommandToExecu { // append a "0=1" filter // don't simply overwrite an existent filter, this would lead to problems if this existent // filter contains paramters (since a keyset may add parameters itself) - // 2003-12-12 - #23418# - fs@openoffice.org m_xComposer->setElementaryQuery( m_xComposer->getQuery( ) ); m_xComposer->setFilter( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "0 = 1" ) ) ); } @@ -2641,7 +2639,6 @@ void SAL_CALL ORowSet::clearWarnings( ) throw (SQLException, RuntimeException) void ORowSet::doCancelModification( ) { - //OSL_ENSURE( isModification(), "ORowSet::doCancelModification: invalid call (no cache!)!" ); if ( isModification() ) { // read-only flag restored @@ -2678,8 +2675,8 @@ void ORowSet::checkUpdateIterator() m_pCache->setUpdateIterator(m_aCurrentRow); m_aCurrentRow = m_pCache->m_aInsertRow; m_bModified = sal_True; - } // if(!m_bModified && !m_bNew) - else if ( m_bNew ) // here we are modifing a value + } + else if ( m_bNew ) // here we are modifying a value m_bModified = sal_True; } @@ -2707,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 @@ -2756,9 +2753,6 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo ::std::vector< ::rtl::OUString> aNames; ::rtl::OUString aDescription; - // ConfigManager* pConfigMgr = ConfigManager::GetConfigManager(); - // Locale aLocale; - // pConfigMgr->GetDirectConfigProperty(ConfigManager::LOCALE) >>= aLocale; Locale aLocale = SvtSysLocale().GetLocaleData().getLocale(); if ( rParent.m_pColumns ) @@ -2801,7 +2795,7 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_HELPTEXT,xColumn->getPropertyValue(PROPERTY_HELPTEXT)); pColumn->setFastPropertyValue_NoBroadcast(PROPERTY_ID_CONTROLDEFAULT,xColumn->getPropertyValue(PROPERTY_CONTROLDEFAULT)); - } // for(sal_Int32 i=1;pIter != pEnd ;++pIter,++i) + } } Reference<XDatabaseMetaData> xMeta = rParent.m_xActiveConnection->getMetaData(); m_pColumns = new ORowSetDataColumns(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers(), @@ -2810,7 +2804,6 @@ ORowSetClone::ORowSetClone( const ::comphelper::ComponentContext& _rContext, ORo sal_Int32 nRT = PropertyAttribute::READONLY | PropertyAttribute::TRANSIENT; // sdb.RowSet Properties - // registerProperty(PROPERTY_CURSORNAME, PROPERTY_ID_CURSORNAME, PropertyAttribute::READONLY, &m_aDataSourceName, ::getCppuType(reinterpret_cast< ::rtl::OUString*>(NULL))); registerMayBeVoidProperty(PROPERTY_ACTIVE_CONNECTION,PROPERTY_ID_ACTIVE_CONNECTION, PropertyAttribute::MAYBEVOID|PropertyAttribute::READONLY, &rParent.m_aActiveConnection, ::getCppuType(reinterpret_cast< Reference< XConnection >* >(NULL))); registerProperty(PROPERTY_RESULTSETCONCURRENCY, PROPERTY_ID_RESULTSETCONCURRENCY, PropertyAttribute::READONLY, &m_nResultSetConcurrency,::getCppuType(reinterpret_cast< sal_Int32*>(NULL))); registerProperty(PROPERTY_RESULTSETTYPE, PROPERTY_ID_RESULTSETTYPE, PropertyAttribute::READONLY, &m_nResultSetType, ::getCppuType(reinterpret_cast< sal_Int32*>(NULL))); @@ -2942,7 +2935,6 @@ void SAL_CALL ORowSetClone::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,c void ORowSetClone::doCancelModification( ) { - //OSL_ENSURE( sal_False, "ORowSetClone::doCancelModification: invalid call!" ); } sal_Bool ORowSetClone::isModification( ) diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index b686bc65a0e5..891d4a2f18ae 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -100,8 +100,8 @@ namespace dbaccess */ ORowSetValueVector m_aPrematureParamValues; ORowSetValueVector m_aParameterValueForCache; - ::std::bit_vector m_aParametersSet; - ::std::bit_vector m_aReadOnlyDataColumns; + ::std::vector<bool> m_aParametersSet; + ::std::vector<bool> m_aReadOnlyDataColumns; ::cppu::OInterfaceContainerHelper m_aRowsetListeners; ::cppu::OInterfaceContainerHelper m_aApproveListeners; @@ -179,7 +179,7 @@ namespace dbaccess m_xActiveConnection points to a valid SDB-level connection @throws com::sun::star::sdb::SQLException - if an database-related error occured + if an database-related error occurred @throws com::sun::star::uno::RuntimeException if any of the components involved throws a com::sun::star::uno::RuntimeException diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx index f27dc80b5a64..7adb83248310 100644 --- a/dbaccess/source/core/api/RowSetBase.cxx +++ b/dbaccess/source/core/api/RowSetBase.cxx @@ -240,7 +240,7 @@ const ORowSetValue& ORowSetBase::impl_getValue(sal_Int32 columnIndex) RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::impl_getValue" ); if ( m_bBeforeFirst || m_bAfterLast ) { - OSL_ENSURE(0,"ORowSetBase::getValue: Illegal call here (we're before first or after last)!"); + OSL_FAIL("ORowSetBase::getValue: Illegal call here (we're before first or after last)!"); ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); } @@ -382,7 +382,7 @@ Reference< ::com::sun::star::io::XInputStream > SAL_CALL ORowSetBase::getBinaryS if ( m_bBeforeFirst || m_bAfterLast ) { - OSL_ENSURE(0,"ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!"); + OSL_FAIL("ORowSetBase::getBinaryStream: Illegal call here (we're before first or after last)!"); ::dbtools::throwSQLException( DBACORE_RESSTRING( RID_STR_CURSOR_BEFORE_OR_AFTER ), SQL_INVALID_CURSOR_POSITION, *m_pMySelf ); } @@ -453,7 +453,7 @@ Reference< XArray > SAL_CALL ORowSetBase::getArray( sal_Int32 /*columnIndex*/ ) Any SAL_CALL ORowSetBase::getBookmark( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getBookmark" ); - DBG_TRACE2("DBACCESS ORowSetBase::getBookmark() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::getBookmark() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); @@ -471,16 +471,16 @@ Any SAL_CALL ORowSetBase::getBookmark( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL ORowSetBase::moveToBookmark( const Any& bookmark ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::moveToBookmark" ); - DBG_TRACE2("DBACCESS ORowSetBase::moveToBookmark(Any) Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::moveToBookmark(Any) Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); OSL_ENSURE(bookmark.hasValue(),"ORowSetBase::moveToBookmark bookmark has no value!"); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); if(!bookmark.hasValue() || m_nResultSetType == ResultSetType::FORWARD_ONLY) { if(bookmark.hasValue()) - OSL_ENSURE(0,"MoveToBookmark is not possible when we are only forward"); + OSL_FAIL("MoveToBookmark is not possible when we are only forward"); else - OSL_ENSURE(0,"Bookmark is not valid"); + OSL_FAIL("Bookmark is not valid"); throwFunctionSequenceException(*m_pMySelf); } @@ -516,14 +516,14 @@ sal_Bool SAL_CALL ORowSetBase::moveToBookmark( const Any& bookmark ) throw(SQLEx // - IsNew aNotifier.fire( ); } - DBG_TRACE2("DBACCESS ORowSetBase::moveToBookmark(Any) = %i Clone = %i\n",bRet,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::moveToBookmark(Any) = %i Clone = %i\n",bRet,m_bClone); return bRet; } sal_Bool SAL_CALL ORowSetBase::moveRelativeToBookmark( const Any& bookmark, sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::moveRelativeToBookmark" ); - DBG_TRACE2("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) Clone = %i\n",rows,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) Clone = %i\n",rows,m_bClone); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -560,7 +560,7 @@ sal_Bool SAL_CALL ORowSetBase::moveRelativeToBookmark( const Any& bookmark, sal_ // RowCount/IsRowCountFinal fireRowcount(); } - DBG_TRACE3("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) = %i Clone = %i\n",rows,bRet,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::moveRelativeToBookmark(Any,%i) = %i Clone = %i\n",rows,bRet,m_bClone); return bRet; } @@ -608,7 +608,7 @@ sal_Int32 SAL_CALL ORowSetBase::findColumn( const ::rtl::OUString& columnName ) ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::MutexGuard aGuard( m_aColumnsMutex ); - // it is possible to save some time her when we remember the names - position relation in a map + // it is possible to save some time here when we remember the names - position relation in a map return m_pColumns ? m_pColumns->findColumn(columnName) : sal_Int32(0); } @@ -633,7 +633,7 @@ Reference< XNameAccess > SAL_CALL ORowSetBase::getColumns( ) throw(RuntimeExcep sal_Bool SAL_CALL ORowSetBase::next( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::next" ); - DBG_TRACE2("DBACCESS ORowSetBase::next() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::next() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkCache(); @@ -675,7 +675,7 @@ sal_Bool SAL_CALL ORowSetBase::next( ) throw(SQLException, RuntimeException) // - RowCount/IsRowCountFinal fireRowcount(); } - DBG_TRACE3("DBACCESS ORowSetBase::next() = %i Clone = %i ID = %i\n",bRet,m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::next() = %i Clone = %i ID = %i\n",bRet,m_bClone,osl_getThreadIdentifier(NULL)); return bRet; } @@ -686,7 +686,7 @@ sal_Bool SAL_CALL ORowSetBase::isBeforeFirst( ) throw(SQLException, RuntimeExce ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - DBG_TRACE2("DBACCESS ORowSetBase::isBeforeFirst() = %i Clone = %i\n",m_bBeforeFirst,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::isBeforeFirst() = %i Clone = %i\n",m_bBeforeFirst,m_bClone); return m_bBeforeFirst; } @@ -697,7 +697,7 @@ sal_Bool SAL_CALL ORowSetBase::isAfterLast( ) throw(SQLException, RuntimeExcept ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); - DBG_TRACE2("DBACCESS ORowSetBase::isAfterLast() = %i Clone = %i\n",m_bAfterLast,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::isAfterLast() = %i Clone = %i\n",m_bAfterLast,m_bClone); return m_bAfterLast; } @@ -711,7 +711,7 @@ sal_Bool ORowSetBase::isOnFirst() sal_Bool SAL_CALL ORowSetBase::isFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isFirst" ); - DBG_TRACE2("DBACCESS ORowSetBase::isFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::isFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); @@ -726,7 +726,7 @@ sal_Bool SAL_CALL ORowSetBase::isFirst( ) throw(SQLException, RuntimeException) positionCache( MOVE_NONE_REFRESH_ONLY ); sal_Bool bIsFirst = m_pCache->isFirst(); - DBG_TRACE2("DBACCESS ORowSetBase::isFirst() = %i Clone = %i\n",bIsFirst,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::isFirst() = %i Clone = %i\n",bIsFirst,m_bClone); return bIsFirst; } @@ -739,7 +739,7 @@ sal_Bool ORowSetBase::isOnLast() sal_Bool SAL_CALL ORowSetBase::isLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::isLast" ); - DBG_TRACE2("DBACCESS ORowSetBase::isLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::isLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); @@ -758,14 +758,14 @@ sal_Bool SAL_CALL ORowSetBase::isLast( ) throw(SQLException, RuntimeException) positionCache( MOVE_NONE_REFRESH_ONLY ); sal_Bool bIsLast = m_pCache->isLast(); - DBG_TRACE2("DBACCESS ORowSetBase::isLast() = %i Clone = %i\n",bIsLast,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::isLast() = %i Clone = %i\n",bIsLast,m_bClone); return bIsLast; } void SAL_CALL ORowSetBase::beforeFirst( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::beforeFirst" ); - DBG_TRACE2("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -801,13 +801,13 @@ void SAL_CALL ORowSetBase::beforeFirst( ) throw(SQLException, RuntimeException) // to be done _after_ the notifications! m_aOldRow->clearRow(); } - DBG_TRACE2("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::beforeFirst() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } void SAL_CALL ORowSetBase::afterLast( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::afterLast" ); - DBG_TRACE2("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -841,14 +841,14 @@ void SAL_CALL ORowSetBase::afterLast( ) throw(SQLException, RuntimeException) fireRowcount(); } } - DBG_TRACE2("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::afterLast() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } sal_Bool SAL_CALL ORowSetBase::move( ::std::mem_fun_t<sal_Bool,ORowSetBase>& _aCheckFunctor, ::std::mem_fun_t<sal_Bool,ORowSetCache>& _aMovementFunctor) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::move" ); - DBG_TRACE2("DBACCESS ORowSetBase::move() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::move() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkPositioningAllowed(); @@ -888,14 +888,14 @@ sal_Bool SAL_CALL ORowSetBase::move( ::std::mem_fun_t<sal_Bool,ORowSetBase>& // - RowCount/IsRowCountFinal fireRowcount(); } - DBG_TRACE2("DBACCESS ORowSetBase::move() = %i Clone = %i\n",bRet,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::move() = %i Clone = %i\n",bRet,m_bClone); return bRet; } sal_Bool SAL_CALL ORowSetBase::first( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::first" ); - DBG_TRACE2("DBACCESS ORowSetBase::first() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::first() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::std::mem_fun_t<sal_Bool,ORowSetBase> ioF_tmp(&ORowSetBase::isOnFirst); ::std::mem_fun_t<sal_Bool,ORowSetCache> F_tmp(&ORowSetCache::first); return move(ioF_tmp,F_tmp); @@ -904,7 +904,7 @@ sal_Bool SAL_CALL ORowSetBase::first( ) throw(SQLException, RuntimeException) sal_Bool SAL_CALL ORowSetBase::last( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::last" ); - DBG_TRACE2("DBACCESS ORowSetBase::last() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::last() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::std::mem_fun_t<sal_Bool,ORowSetBase> ioL_tmp(&ORowSetBase::isOnLast); ::std::mem_fun_t<sal_Bool,ORowSetCache> L_tmp(&ORowSetCache::last); return move(ioL_tmp,L_tmp); @@ -913,7 +913,7 @@ sal_Bool SAL_CALL ORowSetBase::last( ) throw(SQLException, RuntimeException) sal_Int32 SAL_CALL ORowSetBase::getRow( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::getRow" ); - DBG_TRACE2("DBACCESS ORowSetBase::getRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::getRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::osl::MutexGuard aGuard( *m_pMutex ); checkCache(); @@ -943,14 +943,14 @@ sal_Int32 ORowSetBase::impl_getRow() } nPos = m_pCache->getRow(); } - DBG_TRACE3("DBACCESS ORowSetBase::impl_getRow() = %i Clone = %i ID = %i\n",nPos,m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::impl_getRow() = %i Clone = %i ID = %i\n",nPos,m_bClone,osl_getThreadIdentifier(NULL)); return nPos; } sal_Bool SAL_CALL ORowSetBase::absolute( sal_Int32 row ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::absolute" ); - DBG_TRACE2("DBACCESS ORowSetBase::absolute(%i) Clone = %i\n",row,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::absolute(%i) Clone = %i\n",row,m_bClone); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); checkPositioningAllowed(); @@ -989,14 +989,14 @@ sal_Bool SAL_CALL ORowSetBase::absolute( sal_Int32 row ) throw(SQLException, Run // - RowCount/IsRowCountFinal fireRowcount(); } - DBG_TRACE3("DBACCESS ORowSetBase::absolute(%i) = %i Clone = %i\n",row,bRet,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::absolute(%i) = %i Clone = %i\n",row,bRet,m_bClone); return bRet; } sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::relative" ); - DBG_TRACE2("DBACCESS ORowSetBase::relative(%i) Clone = %i\n",rows,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::relative(%i) Clone = %i\n",rows,m_bClone); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -1045,14 +1045,14 @@ sal_Bool SAL_CALL ORowSetBase::relative( sal_Int32 rows ) throw(SQLException, Ru // - RowCount/IsRowCountFinal fireRowcount(); } - DBG_TRACE3("DBACCESS ORowSetBase::relative(%i) = %i Clone = %i\n",rows,bRet,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::relative(%i) = %i Clone = %i\n",rows,bRet,m_bClone); return bRet; } sal_Bool SAL_CALL ORowSetBase::previous( ) throw(SQLException, RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::previous" ); - DBG_TRACE2("DBACCESS ORowSetBase::previous() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::previous() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); ::connectivity::checkDisposed(m_rBHelper.bDisposed); ::osl::ResettableMutexGuard aGuard( *m_pMutex ); @@ -1085,7 +1085,7 @@ sal_Bool SAL_CALL ORowSetBase::previous( ) throw(SQLException, RuntimeException } else { - DBG_ERROR( "ORowSetBase::previous: inconsistency!" ); + OSL_FAIL( "ORowSetBase::previous: inconsistency!" ); // we should never reach this place, as we should not get into this whole branch if m_bBeforeFirst // was |true| from the beginning movementFailed(); @@ -1098,17 +1098,16 @@ sal_Bool SAL_CALL ORowSetBase::previous( ) throw(SQLException, RuntimeException // - RowCount/IsRowCountFinal fireRowcount(); } - DBG_TRACE2("DBACCESS ORowSetBase::previous() = %i Clone = %i\n",bRet,m_bClone); + OSL_TRACE("DBACCESS ORowSetBase::previous() = %i Clone = %i\n",bRet,m_bClone); return bRet; } void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const ORowSetRow& _rOldValues, ::osl::ResettableMutexGuard& _rGuard ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::setCurrentRow" ); - DBG_TRACE2("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); m_bBeforeFirst = m_pCache->isBeforeFirst(); m_bAfterLast = m_pCache->isAfterLast(); - //m_pCache->resetInsertRow(sal_True); if(!(m_bBeforeFirst || m_bAfterLast)) { @@ -1136,7 +1135,6 @@ void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const OR OSL_ENSURE(rRow.is() ,"Invalid size of vector!"); #endif // the cache could repositioned so we need to adjust the cache - // #104144# OJ if ( _bMoved && m_aCurrentRow.isNull() ) { positionCache( MOVE_NONE_REFRESH_ONLY ); @@ -1165,7 +1163,7 @@ void ORowSetBase::setCurrentRow( sal_Bool _bMoved, sal_Bool _bDoNotify, const OR // - cursorMoved notifyAllListenersCursorMoved( _rGuard ); - DBG_TRACE2("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::setCurrentRow() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } void ORowSetBase::checkPositioningAllowed() throw( SQLException, RuntimeException ) @@ -1192,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); } } @@ -1270,7 +1271,7 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow) return; RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::firePropertyChange" ); - DBG_TRACE2("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); OSL_ENSURE(m_pColumns,"Columns can not be NULL here!"); #if OSL_DEBUG_LEVEL > 1 sal_Bool bNull; @@ -1282,14 +1283,14 @@ void ORowSetBase::firePropertyChange(const ORowSetRow& _rOldRow) try { TDataColumns::iterator aEnd = m_aDataColumns.end(); - for(TDataColumns::iterator aIter = m_aDataColumns.begin();aIter != aEnd;++aIter,++i) // #104278# OJ ++i inserted + for(TDataColumns::iterator aIter = m_aDataColumns.begin();aIter != aEnd;++aIter,++i) (*aIter)->fireValueChange(_rOldRow.is() ? (_rOldRow->get())[i+1] : ::connectivity::ORowSetValue()); } catch(Exception&) { - OSL_ENSURE(0,"firePropertyChange: Exception"); + OSL_FAIL("firePropertyChange: Exception"); } - DBG_TRACE2("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::firePropertyChange() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } void ORowSetBase::firePropertyChange(sal_Int32 _nPos,const ::connectivity::ORowSetValue& _rOldValue) @@ -1335,7 +1336,7 @@ void ORowSetBase::fireProperty( sal_Int32 _nProperty, sal_Bool _bNew, sal_Bool _ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::positionCache" ); - DBG_TRACE2("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); sal_Bool bSuccess = sal_False; if ( m_aBookmark.hasValue() ) @@ -1384,8 +1385,9 @@ void ORowSetBase::positionCache( CursorMoveDirection _ePrepareForDirection ) } } OSL_ENSURE( bSuccess, "ORowSetBase::positionCache: failed!" ); + (void)bSuccess; - DBG_TRACE2("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::positionCache() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } void ORowSetBase::checkCache() @@ -1399,7 +1401,7 @@ void ORowSetBase::checkCache() void ORowSetBase::movementFailed() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ORowSetBase::movementFailed" ); - DBG_TRACE2("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); m_aOldRow->clearRow(); m_aCurrentRow = m_pCache->getEnd(); m_bBeforeFirst = m_pCache->isBeforeFirst(); @@ -1407,7 +1409,7 @@ void ORowSetBase::movementFailed() m_aBookmark = Any(); m_aCurrentRow.setBookmark(m_aBookmark); OSL_ENSURE(m_bBeforeFirst || m_bAfterLast,"BeforeFirst or AfterLast is wrong!"); - DBG_TRACE2("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); + OSL_TRACE("DBACCESS ORowSetBase::movementFailed() Clone = %i ID = %i\n",m_bClone,osl_getThreadIdentifier(NULL)); } ORowSetRow ORowSetBase::getOldRow(sal_Bool _bWasNew) diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx index 3710a0e0c108..2a5157d594f2 100644 --- a/dbaccess/source/core/api/RowSetCache.cxx +++ b/dbaccess/source/core/api/RowSetCache.cxx @@ -62,6 +62,7 @@ #include <connectivity/sqlparse.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <algorithm> @@ -89,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 ) @@ -126,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; @@ -173,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 @@ -186,7 +188,6 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, } catch(const Exception&) { - // DBG_UNHANDLED_EXCEPTION(); } m_pCacheSet = NULL; m_xCacheSet.clear(); @@ -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); @@ -264,12 +265,9 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs, // need to check if we could handle this select clause bAllKeysFound = bAllKeysFound && (nTablesCount == 1 || checkJoin(xConnection,_xAnalyzer,aUpdateTableName)); - // || !(comphelper::hasProperty(PROPERTY_CANUPDATEINSERTEDROWS,xProp) && any2bool(xProp->getPropertyValue(PROPERTY_CANUPDATEINSERTEDROWS))) - - // oj removed because keyset uses only the next// || (xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_RESULTSETTYPE) && comphelper::getINT32(xProp->getPropertyValue(PROPERTY_RESULTSETTYPE)) == ResultSetType::FORWARD_ONLY) 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; @@ -306,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; @@ -333,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; @@ -369,9 +367,8 @@ ORowSetCache::~ORowSetCache() DBG_DTOR(ORowSetCache,NULL); } -void ORowSetCache::setMaxRowSize(sal_Int32 _nSize) +void ORowSetCache::setFetchSize(sal_Int32 _nSize) { - if(_nSize == m_nFetchSize) return; @@ -413,7 +410,7 @@ void ORowSetCache::setMaxRowSize(sal_Int32 _nSize) m_aMatrixIter = m_pMatrix->end(); m_aMatrixEnd = m_pMatrix->end(); - // now adjust their positions because a resize invalid all iterators + // now adjust their positions because a resize invalidates all iterators ::std::vector<sal_Int32>::const_iterator aIter = aPositions.begin(); ::std::map<sal_Int32,sal_Bool>::const_iterator aPosChangeIter = aCacheIterToChange.begin(); for( aCacheIter = m_aCacheIterators.begin(); @@ -463,7 +460,6 @@ Any lcl_getBookmark(ORowSetValue& i_aValue,OCacheSet* i_pCacheSet) // ::com::sun::star::sdbcx::XRowLocate Any ORowSetCache::getBookmark( ) { - if(m_bAfterLast) throwFunctionSequenceException(m_xSet.get()); @@ -512,7 +508,6 @@ sal_Bool ORowSetCache::moveRelativeToBookmark( const Any& bookmark, sal_Int32 ro { m_nPosition = m_pCacheSet->getRow() + rows; absolute(m_nPosition); - // for(sal_Int32 i=0;i<rows && m_aMatrixIter != m_pMatrix->end();++i,++m_aMatrixIter) ; bRet = m_aMatrixIter != m_pMatrix->end() && (*m_aMatrixIter).is(); } @@ -656,27 +651,21 @@ sal_Bool ORowSetCache::isBeforeFirst( ) sal_Bool ORowSetCache::isAfterLast( ) { - return m_bAfterLast; } sal_Bool ORowSetCache::isFirst( ) { - return m_nPosition == 1; // ask resultset for } sal_Bool ORowSetCache::isLast( ) { - // return m_bRowCountFinal ? (m_nPosition==m_nRowCount) : m_pCacheSet->isLast(); - return m_nPosition == m_nRowCount; } sal_Bool ORowSetCache::beforeFirst( ) { - - if(!m_bBeforeFirst) { m_bAfterLast = sal_False; @@ -691,8 +680,6 @@ sal_Bool ORowSetCache::beforeFirst( ) sal_Bool ORowSetCache::afterLast( ) { - - if(!m_bAfterLast) { m_bBeforeFirst = sal_False; @@ -764,7 +751,6 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos } bCheck = m_pCacheSet->next(); } - // m_nStartPos = _nNewStartPos; // we have to read one row forward to enshure that we know when we are on last row // but only when we don't know it already if(!m_bRowCountFinal) @@ -784,12 +770,10 @@ sal_Bool ORowSetCache::fillMatrix(sal_Int32& _nNewStartPos,sal_Int32 _nNewEndPos sal_Bool ORowSetCache::moveWindow() { - sal_Bool bRet = sal_True; sal_Int32 nDiff = (sal_Int32)(m_nFetchSize*0.5 -0.5); sal_Int32 nNewStartPos = (m_nPosition - nDiff); - // sal_Int32 nNewEndPos = (m_nPosition+m_nFetchSize*0.5); sal_Int32 nNewEndPos = nNewStartPos + m_nFetchSize; if ( m_nPosition <= m_nStartPos ) @@ -808,7 +792,6 @@ sal_Bool ORowSetCache::moveWindow() if ( nNewStartPos < 1 ) { bCheck = m_pCacheSet->first(); - // aEnd = m_pMatrix->begin() + (sal_Int32)(m_nFetchSize*0.5); OSL_ENSURE((nNewEndPos - m_nStartPos - nNewStartPos) < (sal_Int32)m_pMatrix->size(),"Position is behind end()!"); aEnd = m_pMatrix->begin() + (nNewEndPos - m_nStartPos - nNewStartPos); aIter = aEnd; @@ -864,8 +847,8 @@ sal_Bool ORowSetCache::moveWindow() } } else - { // normaly this should never happen - OSL_ENSURE(0,"What the hell is happen here!"); + { // normally this should never happen + OSL_FAIL("What the hell is happen here!"); return sal_False; } } @@ -944,9 +927,6 @@ sal_Bool ORowSetCache::moveWindow() sal_Bool bCheck = m_pCacheSet->absolute(nPos); bCheck = fill(aIter,aEnd,nPos,bCheck); // refill the region wew don't need anymore -// // we know that this is the current maximal rowcount here -// if ( !m_bRowCountFinal && bCheck ) -// m_nRowCount = std::max(nPos,m_nRowCount); // we have to read one row forward to enshure that we know when we are on last row // but only when we don't know it already sal_Bool bOk = sal_True; @@ -973,7 +953,6 @@ sal_Bool ORowSetCache::moveWindow() { // the end was reached before end() so we can set the start before nNewStartPos m_nStartPos += (aIter - m_pMatrix->begin()); - // m_nStartPos = (aIter - m_pMatrix->begin()); ::std::rotate(m_pMatrix->begin(),aIter,m_pMatrix->end()); // now correct the iterator in our iterator vector rotateCacheIterator( (sal_Int16)( aIter - m_pMatrix->begin() ) ); @@ -1250,7 +1229,7 @@ sal_Bool ORowSetCache::insertRow(::std::vector< Any >& o_aBookmarks) } else { - OSL_ENSURE(0,"There must be a bookmark after the row was inserted!"); + OSL_FAIL("There must be a bookmark after the row was inserted!"); } } return bRet; @@ -1273,7 +1252,7 @@ void ORowSetCache::cancelRowModification() { if ( aCacheIter->second.pRowSet->isInsertRow() && aCacheIter->second.aIterator == m_aInsertRow ) aCacheIter->second.aIterator = m_pMatrix->end(); - } // for(;aCacheIter != aCacheEnd;++aCacheIter) + } resetInsertRow(sal_False); } @@ -1313,7 +1292,6 @@ bool ORowSetCache::deleteRow( ) if(isAfterLast() || isBeforeFirst()) throw SQLException(DBACORE_RESSTRING(RID_STR_NO_DELETEROW),NULL,SQLSTATE_GENERAL,1000,Any() ); - // m_pCacheSet->absolute(m_nPosition); m_pCacheSet->deleteRow(*m_aMatrixIter,m_aUpdateTable); if ( !m_pCacheSet->rowDeleted() ) return false; @@ -1340,7 +1318,7 @@ void ORowSetCache::cancelRowUpdates( ) m_bNew = m_bModified = sal_False; if(!m_nPosition) { - OSL_ENSURE(0,"cancelRowUpdates:Invalid positions pos == 0"); + OSL_FAIL("cancelRowUpdates:Invalid positions pos == 0"); ::dbtools::throwFunctionSequenceException(NULL); } @@ -1348,7 +1326,7 @@ void ORowSetCache::cancelRowUpdates( ) m_pCacheSet->fillValueRow(*m_aMatrixIter,m_nPosition); else { - OSL_ENSURE(0,"cancelRowUpdates couldn't position right with absolute"); + OSL_FAIL("cancelRowUpdates couldn't position right with absolute"); ::dbtools::throwFunctionSequenceException(NULL); } } @@ -1376,7 +1354,6 @@ void ORowSetCache::moveToInsertRow( ) ORowSetCacheIterator ORowSetCache::createIterator(ORowSetBase* _pRowSet) { - ORowSetCacheIterator_Helper aHelper; aHelper.aIterator = m_pMatrix->end(); aHelper.pRowSet = _pRowSet; @@ -1392,7 +1369,7 @@ void ORowSetCache::deleteIterator(const ORowSetBase* _pRowSet) { m_aCacheIterators.erase(aCacheIter); aCacheIter = m_aCacheIterators.begin(); - } // if ( aCacheIter->second.pRowSet == _pRowSet ) + } else ++aCacheIter; } @@ -1466,10 +1443,10 @@ sal_Bool ORowSetCache::checkInnerJoin(const ::connectivity::OSQLParseNode *pNode { bOk = checkInnerJoin(pNode->getChild(1),_xConnection,_sUpdateTableName); } - else if ((SQL_ISRULE(pNode,search_condition) || SQL_ISRULE(pNode,boolean_term)) && // AND/OR-Verknuepfung: + else if ((SQL_ISRULE(pNode,search_condition) || SQL_ISRULE(pNode,boolean_term)) && // AND/OR link pNode->count() == 3) { - // nur AND Verknpfung zulassen + // only allow an AND link if ( SQL_ISTOKEN(pNode->getChild(1),AND) ) bOk = checkInnerJoin(pNode->getChild(0),_xConnection,_sUpdateTableName) && checkInnerJoin(pNode->getChild(2),_xConnection,_sUpdateTableName); @@ -1477,7 +1454,7 @@ sal_Bool ORowSetCache::checkInnerJoin(const ::connectivity::OSQLParseNode *pNode else if (SQL_ISRULE(pNode,comparison_predicate)) { // only the comparison of columns is allowed - DBG_ASSERT(pNode->count() == 3,"checkInnerJoin: Fehler im Parse Tree"); + OSL_ENSURE(pNode->count() == 3,"checkInnerJoin: Fehler im Parse Tree"); if (!(SQL_ISRULE(pNode->getChild(0),column_ref) && SQL_ISRULE(pNode->getChild(2),column_ref) && pNode->getChild(1)->getNodeType() == SQL_NODE_EQUAL)) @@ -1568,7 +1545,7 @@ void ORowSetCache::clearInsertRow() aIter->setBound(sal_False); aIter->setModified(sal_False); aIter->setNull(); - } // for(;aIter != (*m_aInsertRow)->end();++aIter) + } } } @@ -1579,7 +1556,6 @@ ORowSetMatrix::iterator ORowSetCache::calcPosition() const return ( nValue < 0 || nValue >= static_cast<sal_Int32>(m_pMatrix->size()) ) ? m_pMatrix->end() : (m_pMatrix->begin() + nValue); } - TORowSetOldRowHelperRef ORowSetCache::registerOldRow() { TORowSetOldRowHelperRef pRef = new ORowSetOldRowHelper(ORowSetRow()); @@ -1612,7 +1588,7 @@ sal_Bool ORowSetCache::reFillMatrix(sal_Int32 _nNewStartPos,sal_Int32 _nNewEndPo sal_Int32 nNewSt = _nNewStartPos; sal_Bool bRet = fillMatrix(nNewSt,_nNewEndPos); m_nStartPos = nNewSt - 1; - rotateCacheIterator(static_cast<sal_Int16>(m_nFetchSize+1)); // forces that every iterator will be set to null + rotateCacheIterator(static_cast<sal_Int16>(m_nFetchSize+1)); // forces every iterator to null return bRet; } diff --git a/dbaccess/source/core/api/RowSetCache.hxx b/dbaccess/source/core/api/RowSetCache.hxx index dedf04ead36b..ba1aaa937996 100644 --- a/dbaccess/source/core/api/RowSetCache.hxx +++ b/dbaccess/source/core/api/RowSetCache.hxx @@ -90,7 +90,6 @@ namespace dbaccess ORowSetMatrix* m_pInsertMatrix; // represent the rows which should be inserted normally this is only one ORowSetMatrix::iterator m_aInsertRow; // represent a insert row - // ORowSetRow m_aInsertRow; // present the row that should be inserted sal_Int32 m_nLastColumnIndex; // the last column ask for, used for wasNull() connectivity::OSQLTable m_aUpdateTable; // used for updates/deletes and inserts @@ -155,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(); @@ -164,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 ec2ce273be59..f050ee195b18 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -63,6 +63,7 @@ #include <unotools/syslocale.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <unotools/configmgr.hxx> #include <unotools/sharedunocomponent.hxx> @@ -578,7 +579,7 @@ void SAL_CALL OSingleSelectQueryComposer::appendGroupByColumn( const Reference< ::rtl::OUString OSingleSelectQueryComposer::composeStatementFromParts( const ::std::vector< ::rtl::OUString >& _rParts ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::composeStatementFromParts" ); - DBG_ASSERT( _rParts.size() == (size_t)SQLPartCount, "OSingleSelectQueryComposer::composeStatementFromParts: invalid parts array!" ); + OSL_ENSURE( _rParts.size() == (size_t)SQLPartCount, "OSingleSelectQueryComposer::composeStatementFromParts: invalid parts array!" ); ::rtl::OUStringBuffer aSql( m_aPureSelectSQL ); for ( SQLPart eLoopParts = Where; eLoopParts != SQLPartCount; incSQLPart( eLoopParts ) ) @@ -625,7 +626,7 @@ void SAL_CALL OSingleSelectQueryComposer::setElementaryQuery( const ::rtl::OUStr catch( const Exception& e ) { (void)e; - DBG_ERROR( "OSingleSelectQueryComposer::setElementaryQuery: there should be no error anymore for the additive statement!" ); + OSL_FAIL( "OSingleSelectQueryComposer::setElementaryQuery: there should be no error anymore for the additive statement!" ); // every part of the additive statement should have passed other tests already, and should not // be able to cause any errors ... me thinks } @@ -703,7 +704,7 @@ void OSingleSelectQueryComposer::setSingleAdditiveClause( SQLPart _ePart, const catch( const Exception& e ) { (void)e; - DBG_ERROR( "OSingleSelectQueryComposer::setSingleAdditiveClause: there should be no error anymore for the additive statement!" ); + OSL_FAIL( "OSingleSelectQueryComposer::setSingleAdditiveClause: there should be no error anymore for the additive statement!" ); // every part of the additive statement should have passed other tests already, and should not // be able to cause any errors ... me thinks } @@ -789,7 +790,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr aSQL.append( STR_WHERE ); // preserve the original WHERE clause - // #i102234# / 2009-06-02 / frank.schoenheit@sun.com + // #i102234# ::rtl::OUString sOriginalWhereClause = getSQLPart( Where, m_aSqlIterator, sal_False ); if ( sOriginalWhereClause.getLength() ) { @@ -810,7 +811,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) thr // normalize the statement so that it doesn't contain any application-level features anymore ::rtl::OUString sError; const ::std::auto_ptr< OSQLParseNode > pStatementTree( m_aSqlParser.parseTree( sError, sSQL, false ) ); - DBG_ASSERT( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!" ); + OSL_ENSURE( pStatementTree.get(), "OSingleSelectQueryComposer::getColumns: could not parse the column retrieval statement!" ); if ( pStatementTree.get() ) if ( !pStatementTree->parseNodeToExecutableStatement( sSQL, m_xConnection, m_aSqlParser, NULL ) ) break; @@ -990,7 +991,6 @@ sal_Bool OSingleSelectQueryComposer::setORCriteria(OSQLParseNode* pCondition, OS { // Ist das erste Element wieder eine OR-Verknuepfung? // Dann rekursiv absteigen ... - //if (!i && SQL_ISRULE(pCondition->getChild(i),search_condition)) if (SQL_ISRULE(pCondition->getChild(i),search_condition)) bResult = setORCriteria(pCondition->getChild(i), _rIterator, rFilters, xFormatter); else @@ -1016,7 +1016,7 @@ sal_Bool OSingleSelectQueryComposer::setANDCriteria( OSQLParseNode * pCondition, if (SQL_ISRULE(pCondition,boolean_primary)) { // this should not occur - DBG_ERROR("boolean_primary in And-Criteria"); + OSL_FAIL("boolean_primary in And-Criteria"); return sal_False; } // Das erste Element ist (wieder) eine AND-Verknuepfung @@ -1042,9 +1042,7 @@ sal_Bool OSingleSelectQueryComposer::setANDCriteria( OSQLParseNode * pCondition, ::rtl::OUString aColumnName; - // pCondition->parseNodeToStr(aValue,m_xMetaData, xFormatter, m_aLocale,static_cast<sal_Char>(m_sDecimalSep.toChar())); pCondition->parseNodeToStr( aValue, m_xConnection, NULL ); - // pCondition->getChild(0)->parseNodeToStr(aColumnName,m_xMetaData, xFormatter, m_aLocale,static_cast<sal_Char>(m_sDecimalSep.toChar())); pCondition->getChild(0)->parseNodeToStr( aColumnName, m_xConnection, NULL ); // don't display the column name @@ -1063,22 +1061,22 @@ 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; } else if (SQL_ISRULE(pCondition,in_predicate)) { - OSL_ENSURE( false, "OSingleSelectQueryComposer::setANDCriteria: in_predicate not implemented!" ); + OSL_FAIL( "OSingleSelectQueryComposer::setANDCriteria: in_predicate not implemented!" ); } else if (SQL_ISRULE(pCondition,all_or_any_predicate)) { - OSL_ENSURE( false, "OSingleSelectQueryComposer::setANDCriteria: all_or_any_predicate not implemented!" ); + OSL_FAIL( "OSingleSelectQueryComposer::setANDCriteria: all_or_any_predicate not implemented!" ); } else if (SQL_ISRULE(pCondition,between_predicate)) { - OSL_ENSURE( false, "OSingleSelectQueryComposer::setANDCriteria: between_predicate not implemented!" ); + OSL_FAIL( "OSingleSelectQueryComposer::setANDCriteria: between_predicate not implemented!" ); } rFilter.push_back(aItem); @@ -1124,7 +1122,7 @@ sal_Int32 OSingleSelectQueryComposer::getPredicateType(OSQLParseNode * _pPredica nPredicate = SQLFilterOperator::GREATER_EQUAL; break; default: - OSL_ENSURE(0,"Wrong NodeType!"); + OSL_FAIL("Wrong NodeType!"); } return nPredicate; } @@ -1133,7 +1131,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon ::std::vector < PropertyValue >& rFilter, const Reference< ::com::sun::star::util::XNumberFormatter > & xFormatter) const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setComparsionPredicate" ); - DBG_ASSERT(SQL_ISRULE(pCondition, comparison_predicate),"setComparsionPredicate: pCondition ist kein ComparsionPredicate"); + OSL_ENSURE(SQL_ISRULE(pCondition, comparison_predicate),"setComparsionPredicate: pCondition ist kein ComparsionPredicate"); if (SQL_ISRULE(pCondition->getChild(0), column_ref) || SQL_ISRULE(pCondition->getChild(pCondition->count()-1), column_ref)) { @@ -1314,7 +1312,7 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon const ::rtl::OUString* pEnd = pBegin + aNames.getLength(); if(!aTable.getLength()) - { // we don't found a table name, now we must search every table for this column + { // we haven't found a table name, now we must search every table for this column for(;pBegin != pEnd;++pBegin) { Reference<XColumnsSupplier> xColumnsSupp; @@ -1322,10 +1320,6 @@ sal_Bool OSingleSelectQueryComposer::setComparsionPredicate(OSQLParseNode * pCon if(xColumnsSupp.is() && xColumnsSupp->getColumns()->hasByName(aColumnName)) { -// Reference<XPropertySet> xTableProp(xColumnsSupp,UNO_QUERY); -// xTableProp->getPropertyValue(PROPERTY_CATALOGNAME) >>= aCatalog; -// xTableProp->getPropertyValue(PROPERTY_SCHEMANAME) >>= aSchema; -// xTableProp->getPropertyValue(PROPERTY_NAME) >>= aTable; aTable = *pBegin; break; } @@ -1799,7 +1793,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC switch(_ePart) { default: - OSL_ENSURE( 0, "OSingleSelectQueryComposer::getKeyWord: Invalid enum value!" ); + OSL_FAIL( "OSingleSelectQueryComposer::getKeyWord: Invalid enum value!" ); // no break, fallback to WHERE case Where: sKeyword = STR_WHERE; @@ -1837,7 +1831,7 @@ Sequence< Sequence< PropertyValue > > OSingleSelectQueryComposer::getStructuredC F_tmp = TGetParseNode(&OSQLParseTreeIterator::getSimpleOrderTree); break; default: - OSL_ENSURE(0,"Invalid enum value!"); + OSL_FAIL("Invalid enum value!"); } ::rtl::OUString sRet = getStatementPart( F_tmp, _rIterator ); diff --git a/dbaccess/source/core/api/StaticSet.cxx b/dbaccess/source/core/api/StaticSet.cxx index 0093f673d2b9..f76303f41299 100644 --- a/dbaccess/source/core/api/StaticSet.cxx +++ b/dbaccess/source/core/api/StaticSet.cxx @@ -45,11 +45,9 @@ using namespace connectivity; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -// using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -// using namespace ::cppu; using namespace ::osl; void OStaticSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 /*_nPosition*/) @@ -104,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 ) { @@ -123,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 d69dfca465ec..82b152161a31 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/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx index 4ed9dcdfcc65..d2b724f68a04 100644 --- a/dbaccess/source/core/api/TableDeco.cxx +++ b/dbaccess/source/core/api/TableDeco.cxx @@ -35,6 +35,7 @@ #include "core_resource.hxx" #include "core_resource.hrc" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <cppuhelper/typeprovider.hxx> #include <comphelper/enumhelper.hxx> @@ -186,7 +187,7 @@ void ODBTableDecorator::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, con switch(_nHandle) { case PROPERTY_ID_PRIVILEGES: - OSL_ENSURE(0,"Property is readonly!"); + OSL_FAIL("Property is readonly!"); case PROPERTY_ID_FILTER: case PROPERTY_ID_ORDER: case PROPERTY_ID_APPLYFILTER: @@ -325,7 +326,7 @@ void ODBTableDecorator::getFastPropertyValue(Any& _rValue, sal_Int32 _nHandle) c } break; default: - OSL_ENSURE(0,"Invalid Handle for table"); + OSL_FAIL("Invalid Handle for table"); } } @@ -427,9 +428,6 @@ void SAL_CALL ODBTableDecorator::rename( const ::rtl::OUString& _rNewName ) thro Reference<XRename> xRename(m_xTable,UNO_QUERY); if(xRename.is()) { -// ::rtl::OUString sOldName; -// Reference<XPropertySet> xProp(m_xTable,UNO_QUERY); -// xProp->getPropertyValue(PROPERTY_NAME) >>= sOldName; xRename->rename(_rNewName); } else // not supported @@ -539,7 +537,7 @@ Sequence< sal_Int8 > ODBTableDecorator::getUnoTunnelImplementationId() void ODBTableDecorator::fillPrivileges() const { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTableDecorator::fillPrivileges" ); - // somebody is asking for the privileges an we do not know them, yet + // somebody is asking for the privileges and we do not know them, yet m_nPrivileges = 0; try { @@ -563,7 +561,7 @@ void ODBTableDecorator::fillPrivileges() const catch(const SQLException& e) { (void)e; - DBG_ERROR("ODBTableDecorator::ODBTableDecorator : could not collect the privileges !"); + OSL_FAIL("ODBTableDecorator::ODBTableDecorator : could not collect the privileges !"); } } @@ -574,7 +572,7 @@ Reference< XPropertySet > SAL_CALL ODBTableDecorator::createDataDescriptor( ) t ::connectivity::checkDisposed(OTableDescriptor_BASE::rBHelper.bDisposed); Reference< XDataDescriptorFactory > xFactory( m_xTable, UNO_QUERY ); - DBG_ASSERT( xFactory.is(), "ODBTableDecorator::createDataDescriptor: invalid table!" ); + OSL_ENSURE( xFactory.is(), "ODBTableDecorator::createDataDescriptor: invalid table!" ); Reference< XColumnsSupplier > xColsSupp; if ( xFactory.is() ) xColsSupp = xColsSupp.query( xFactory->createDataDescriptor() ); diff --git a/dbaccess/source/core/api/View.cxx b/dbaccess/source/core/api/View.cxx index 9557f195aaa0..56148298960d 100644 --- a/dbaccess/source/core/api/View.cxx +++ b/dbaccess/source/core/api/View.cxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: View.cxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/dbaccess/source/core/api/WrappedResultSet.cxx b/dbaccess/source/core/api/WrappedResultSet.cxx index b1bd9a71056e..794015333d6d 100644 --- a/dbaccess/source/core/api/WrappedResultSet.cxx +++ b/dbaccess/source/core/api/WrappedResultSet.cxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: BookmarkSet.cxx,v $ - * $Revision: 1.21 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -46,11 +43,9 @@ using namespace ::dbtools; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::sdbc; -// using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; -// using namespace ::cppu; using namespace ::osl; void WrappedResultSet::construct(const Reference< XResultSet>& _xDriverSet,const ::rtl::OUString& i_sRowSetFilter) @@ -192,8 +187,6 @@ void WrappedResultSet::updateColumn(sal_Int32 nPos,Reference< XRowUpdate > _xPar break; case DataType::CHAR: case DataType::VARCHAR: - //case DataType::DECIMAL: - //case DataType::NUMERIC: _xParameter->updateString(nPos,_rValue); break; case DataType::BIGINT: diff --git a/dbaccess/source/core/api/WrappedResultSet.hxx b/dbaccess/source/core/api/WrappedResultSet.hxx index ae8332eee052..8765a183afb7 100644 --- a/dbaccess/source/core/api/WrappedResultSet.hxx +++ b/dbaccess/source/core/api/WrappedResultSet.hxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: BookmarkSet.hxx,v $ - * $Revision: 1.11 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -47,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/column.cxx b/dbaccess/source/core/api/column.cxx index 9afc4b370cac..bcb19b18b847 100644 --- a/dbaccess/source/core/api/column.cxx +++ b/dbaccess/source/core/api/column.cxx @@ -147,7 +147,7 @@ void SAL_CALL OColumn::setName( const ::rtl::OUString& _rName ) throw(::com::sun void OColumn::fireValueChange(const ::connectivity::ORowSetValue& /*_rOldValue*/) { - DBG_ERROR( "OColumn::fireValueChange: not implemented!" ); + OSL_FAIL( "OColumn::fireValueChange: not implemented!" ); } void OColumn::registerProperty( const ::rtl::OUString& _rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void* _pPointerToMember, const Type& _rMemberType ) diff --git a/dbaccess/source/core/api/columnsettings.cxx b/dbaccess/source/core/api/columnsettings.cxx index ca978e39a796..985a252cdb57 100644 --- a/dbaccess/source/core/api/columnsettings.cxx +++ b/dbaccess/source/core/api/columnsettings.cxx @@ -132,7 +132,7 @@ namespace dbaccess return !bHidden; } } - OSL_ENSURE( false, "OColumnSettings::isDefaulted: illegal property handle!" ); + OSL_FAIL( "OColumnSettings::isDefaulted: illegal property handle!" ); return sal_False; } diff --git a/dbaccess/source/core/api/definitioncolumn.cxx b/dbaccess/source/core/api/definitioncolumn.cxx index 46d5de5615ef..2709369adab9 100644 --- a/dbaccess/source/core/api/definitioncolumn.cxx +++ b/dbaccess/source/core/api/definitioncolumn.cxx @@ -469,10 +469,7 @@ Sequence< ::rtl::OUString > OTableColumnDescriptorWrapper::getSupportedServiceNa if ( nId & HAS_AUTOINCREMENT_CREATION ) ++nHaveOptionally; - const sal_Int32 nPropertyCount( nHaveAlways + nHaveOptionally ); - Sequence< Property > aTableDescProperties( nPropertyCount ); - Property* pDesc = aTableDescProperties.getArray(); - sal_Int32 nPos = 0; + BEGIN_PROPERTY_SEQUENCE( nHaveAlways + nHaveOptionally ) DECL_PROP0_BOOL( ISAUTOINCREMENT ); DECL_PROP0_BOOL( ISCURRENCY ); @@ -499,12 +496,12 @@ Sequence< ::rtl::OUString > OTableColumnDescriptorWrapper::getSupportedServiceNa DECL_PROP0_BOOL( ISROWVERSION ); } - OSL_ENSURE( nPos == nPropertyCount, "OTableColumnDescriptorWrapper::createArrayHelper: something went wrong!" ); + END_PROPERTY_SEQUENCE() if ( !m_bIsDescriptor ) { - for ( Property* prop = aTableDescProperties.getArray(); - prop != aTableDescProperties.getArray() + aTableDescProperties.getLength(); + for ( Property* prop = aDescriptor.getArray(); + prop != aDescriptor.getArray() + aDescriptor.getLength(); ++prop ) { @@ -516,7 +513,7 @@ Sequence< ::rtl::OUString > OTableColumnDescriptorWrapper::getSupportedServiceNa Sequence< Property > aBaseProperties; describeProperties( aBaseProperties ); - Sequence< Property > aAllProperties( ::comphelper::concatSequences( aTableDescProperties, aBaseProperties ) ); + Sequence< Property > aAllProperties( ::comphelper::concatSequences( aDescriptor, aBaseProperties ) ); return new ::cppu::OPropertyArrayHelper( aAllProperties, sal_False ); } diff --git a/dbaccess/source/core/api/query.cxx b/dbaccess/source/core/api/query.cxx index 30bd7b701d38..ac2201841fbe 100644 --- a/dbaccess/source/core/api/query.cxx +++ b/dbaccess/source/core/api/query.cxx @@ -39,6 +39,7 @@ #include <cppuhelper/queryinterface.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <comphelper/propagg.hxx> #include <comphelper/sequence.hxx> @@ -101,7 +102,7 @@ OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition ODataSettings::registerPropertiesFor(this); osl_incrementInterlockedCount(&m_refCount); - DBG_ASSERT(m_xCommandDefinition.is(), "OQuery::OQuery : invalid CommandDefinition object !"); + OSL_ENSURE(m_xCommandDefinition.is(), "OQuery::OQuery : invalid CommandDefinition object !"); if ( m_xCommandDefinition.is() ) { try @@ -110,14 +111,14 @@ OQuery::OQuery( const Reference< XPropertySet >& _rxCommandDefinition } catch(Exception&) { - OSL_ENSURE(sal_False, "OQueryDescriptor_Base::OQueryDescriptor_Base: caught an exception!"); + OSL_FAIL("OQueryDescriptor_Base::OQueryDescriptor_Base: caught an exception!"); } m_xCommandDefinition->addPropertyChangeListener(::rtl::OUString(), this); // m_xCommandDefinition->addPropertyChangeListener(PROPERTY_NAME, this); m_xCommandPropInfo = m_xCommandDefinition->getPropertySetInfo(); } - DBG_ASSERT(m_xConnection.is(), "OQuery::OQuery : invalid connection !"); + OSL_ENSURE(m_xConnection.is(), "OQuery::OQuery : invalid connection !"); osl_decrementInterlockedCount(&m_refCount); } @@ -180,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(); } @@ -238,7 +239,7 @@ void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) thro { MutexGuard aGuard(m_aMutex); - DBG_ASSERT(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(), + OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(), "OQuery::propertyChange : where did this call come from ?"); if (m_eDoingCurrently == SETTING_PROPERTIES) @@ -257,7 +258,7 @@ void SAL_CALL OQuery::propertyChange( const PropertyChangeEvent& _rSource ) thro } else { - DBG_ERROR("OQuery::propertyChange : my CommandDefinition has more properties than I do !"); + OSL_FAIL("OQuery::propertyChange : my CommandDefinition has more properties than I do !"); } } @@ -269,7 +270,7 @@ void SAL_CALL OQuery::disposing( const EventObject& _rSource ) throw (RuntimeExc MutexGuard aGuard(m_aMutex); (void)_rSource; - DBG_ASSERT(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(), + OSL_ENSURE(_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinition, UNO_QUERY).get(), "OQuery::disposing : where did this call come from ?"); m_xCommandDefinition->removePropertyChangeListener(::rtl::OUString(), this); @@ -307,7 +308,7 @@ void OQuery::setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle, const Any& _r { // the base class holds the property values itself, but we have to forward this to our CommandDefinition m_eDoingCurrently = SETTING_PROPERTIES; - OAutoActionReset(this); + OAutoActionReset aAutoReset(this); m_xCommandDefinition->setPropertyValue(sAggPropName, _rValue); if ( PROPERTY_ID_COMMAND == _nHandle ) diff --git a/dbaccess/source/core/api/querycontainer.cxx b/dbaccess/source/core/api/querycontainer.cxx index 12f83abf28fd..6aac55d0bbf1 100644 --- a/dbaccess/source/core/api/querycontainer.cxx +++ b/dbaccess/source/core/api/querycontainer.cxx @@ -46,6 +46,7 @@ #include <connectivity/dbexception.hxx> #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/enumhelper.hxx> #include <comphelper/uno3.hxx> #include <comphelper/property.hxx> @@ -241,8 +242,8 @@ void SAL_CALL OQueryContainer::elementInserted( const ::com::sun::star::containe // nothing to do, we're inserting via an "appendByDescriptor" return; - DBG_ASSERT(sElementName.getLength(), "OQueryContainer::elementInserted : invalid name !"); - DBG_ASSERT(m_aDocumentMap.find(sElementName) == m_aDocumentMap.end(), "OQueryContainer::elementInserted : oops .... we're inconsistent with our master container !"); + OSL_ENSURE(sElementName.getLength(), "OQueryContainer::elementInserted : invalid name !"); + OSL_ENSURE(m_aDocumentMap.find(sElementName) == m_aDocumentMap.end(), "OQueryContainer::elementInserted : oops .... we're inconsistent with our master container !"); if (!sElementName.getLength() || hasByName(sElementName)) return; @@ -257,8 +258,8 @@ void SAL_CALL OQueryContainer::elementRemoved( const ::com::sun::star::container ::rtl::OUString sAccessor; _rEvent.Accessor >>= sAccessor; { - DBG_ASSERT(sAccessor.getLength(), "OQueryContainer::elementRemoved : invalid name !"); - DBG_ASSERT(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(), "OQueryContainer::elementRemoved : oops .... we're inconsistent with our master container !"); + OSL_ENSURE(sAccessor.getLength(), "OQueryContainer::elementRemoved : invalid name !"); + OSL_ENSURE(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(), "OQueryContainer::elementRemoved : oops .... we're inconsistent with our master container !"); if ( !sAccessor.getLength() || !hasByName(sAccessor) ) return; } @@ -274,8 +275,8 @@ void SAL_CALL OQueryContainer::elementReplaced( const ::com::sun::star::containe { MutexGuard aGuard(m_aMutex); - DBG_ASSERT(sAccessor.getLength(), "OQueryContainer::elementReplaced : invalid name !"); - DBG_ASSERT(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(), "OQueryContainer::elementReplaced : oops .... we're inconsistent with our master container !"); + OSL_ENSURE(sAccessor.getLength(), "OQueryContainer::elementReplaced : invalid name !"); + OSL_ENSURE(m_aDocumentMap.find(sAccessor) != m_aDocumentMap.end(), "OQueryContainer::elementReplaced : oops .... we're inconsistent with our master container !"); if (!sAccessor.getLength() || !hasByName(sAccessor)) return; @@ -316,8 +317,8 @@ Reference< XVeto > SAL_CALL OQueryContainer::approveRemoveElement( const Contain void SAL_CALL OQueryContainer::disposing( const ::com::sun::star::lang::EventObject& _rSource ) throw(::com::sun::star::uno::RuntimeException) { if (_rSource.Source.get() == Reference< XInterface >(m_xCommandDefinitions, UNO_QUERY).get()) - { // our "master container" (with the command definitions) is beeing disposed - DBG_ERROR("OQueryContainer::disposing : nobody should dispose the CommandDefinition container before disposing my connection !"); + { // our "master container" (with the command definitions) is being disposed + OSL_FAIL("OQueryContainer::disposing : nobody should dispose the CommandDefinition container before disposing my connection !"); dispose(); } else diff --git a/dbaccess/source/core/api/querydescriptor.cxx b/dbaccess/source/core/api/querydescriptor.cxx index b06a87abebcf..8a03f3fd9ced 100644 --- a/dbaccess/source/core/api/querydescriptor.cxx +++ b/dbaccess/source/core/api/querydescriptor.cxx @@ -257,7 +257,7 @@ void OQueryDescriptor_Base::columnDropped(const ::rtl::OUString& /*_sName*/) Reference< XPropertySet > OQueryDescriptor_Base::createColumnDescriptor() { - OSL_ENSURE( false, "OQueryDescriptor_Base::createColumnDescriptor: called why?" ); + OSL_FAIL( "OQueryDescriptor_Base::createColumnDescriptor: called why?" ); return NULL; } diff --git a/dbaccess/source/core/api/resultcolumn.cxx b/dbaccess/source/core/api/resultcolumn.cxx index 89db5a7942a9..7949cef634ce 100644 --- a/dbaccess/source/core/api/resultcolumn.cxx +++ b/dbaccess/source/core/api/resultcolumn.cxx @@ -272,7 +272,7 @@ void OResultColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) const rValue <<= m_xMetaData->getColumnTypeName(m_nPos); break; default: - OSL_ENSURE( false, "OResultColumn::getFastPropertyValue: unknown property handle!" ); + OSL_FAIL( "OResultColumn::getFastPropertyValue: unknown property handle!" ); break; } } diff --git a/dbaccess/source/core/api/resultset.cxx b/dbaccess/source/core/api/resultset.cxx index 6d0669b874e7..a6d3e23d4e67 100644 --- a/dbaccess/source/core/api/resultset.cxx +++ b/dbaccess/source/core/api/resultset.cxx @@ -50,7 +50,6 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; -//using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -269,7 +268,7 @@ void OResultSet::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& xSet->setPropertyValue(PROPERTY_FETCHSIZE, rValue); break; default: - DBG_ERROR("unknown Property"); + OSL_FAIL("unknown Property"); } } diff --git a/dbaccess/source/core/api/statement.cxx b/dbaccess/source/core/api/statement.cxx index ebdc129d8c20..251facd240a9 100644 --- a/dbaccess/source/core/api/statement.cxx +++ b/dbaccess/source/core/api/statement.cxx @@ -113,7 +113,7 @@ Any OStatementBase::queryInterface( const Type & rType ) throw (RuntimeException Reference< XGeneratedResultSet > xGRes(m_xAggregateAsSet, UNO_QUERY); if ( ::getCppuType( (const Reference< XGeneratedResultSet > *)0 ) == rType && xGRes.is() ) aIface = ::cppu::queryInterface(rType,static_cast< XGeneratedResultSet * >( this )); - } // if ( !aIface.hasValue() ) + } if ( !aIface.hasValue() ) { Reference< XPreparedBatchExecution > xGRes(m_xAggregateAsSet, UNO_QUERY); diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx index 58194f3babfd..5cbe805d1740 100644 --- a/dbaccess/source/core/api/table.cxx +++ b/dbaccess/source/core/api/table.cxx @@ -37,6 +37,7 @@ #include "CIndexes.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <cppuhelper/typeprovider.hxx> #include <comphelper/enumhelper.hxx> #include <comphelper/container.hxx> @@ -91,8 +92,8 @@ ODBTable::ODBTable(connectivity::sdbcx::OCollection* _pTables { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "ODBTable::ODBTable" ); DBG_CTOR(ODBTable, NULL); - DBG_ASSERT(getMetaData().is(), "ODBTable::ODBTable : invalid conn !"); - DBG_ASSERT(_rName.getLength(), "ODBTable::ODBTable : name !"); + OSL_ENSURE(getMetaData().is(), "ODBTable::ODBTable : invalid conn !"); + OSL_ENSURE(_rName.getLength(), "ODBTable::ODBTable : name !"); // TODO : think about collecting the privileges here, as we can't ensure that in getFastPropertyValue, where // we do this at the moment, the statement needed can be supplied by the connection (for example the SQL-Server // ODBC driver does not allow more than one statement per connection, and in getFastPropertyValue it's more diff --git a/dbaccess/source/core/api/tablecontainer.cxx b/dbaccess/source/core/api/tablecontainer.cxx index 827fbf2cf465..128595fea054 100644 --- a/dbaccess/source/core/api/tablecontainer.cxx +++ b/dbaccess/source/core/api/tablecontainer.cxx @@ -98,7 +98,7 @@ namespace } catch(Exception) { - OSL_ENSURE( 0, "lcl_isPropertySetDefaulted: Exception caught!" ); + OSL_FAIL( "lcl_isPropertySetDefaulted: Exception caught!" ); } } return ( pIter == pEnd ); @@ -130,7 +130,6 @@ OTableContainer::OTableContainer(::cppu::OWeakObject& _rParent, OTableContainer::~OTableContainer() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::OTableContainer" ); - // dispose(); DBG_DTOR(OTableContainer, NULL); } @@ -266,8 +265,8 @@ Reference< XPropertySet > OTableContainer::createDescriptor() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::createDescriptor" ); Reference< XPropertySet > xRet; - // frist we have to look if the master tables does support this - // and if then create a table object as well with the master tables + // first we have to look if the master tables support this + // and if so then create a table object as well with the master tables Reference<XColumnsSupplier > xMasterColumnsSup; Reference<XDataDescriptorFactory> xDataFactory(m_xMasterContainer,UNO_QUERY); if ( xDataFactory.is() && m_xMetaData.is() ) @@ -480,7 +479,7 @@ void SAL_CALL OTableContainer::disposing() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "api", "Ocke.Janssen@sun.com", "OTableContainer::disposing" ); OFilteredContainer::disposing(); - // say our listeners goobye + // say goodbye to our listeners m_xTableDefinitions = NULL; m_pTableMediator = NULL; } diff --git a/dbaccess/source/core/api/viewcontainer.cxx b/dbaccess/source/core/api/viewcontainer.cxx index 075bb806f095..7cae5e38e1ce 100644 --- a/dbaccess/source/core/api/viewcontainer.cxx +++ b/dbaccess/source/core/api/viewcontainer.cxx @@ -89,7 +89,6 @@ OViewContainer::OViewContainer(::cppu::OWeakObject& _rParent OViewContainer::~OViewContainer() { - // dispose(); DBG_DTOR(OViewContainer, NULL); } @@ -125,8 +124,8 @@ ObjectType OViewContainer::createObject(const ::rtl::OUString& _rName) Reference< XPropertySet > OViewContainer::createDescriptor() { Reference< XPropertySet > xRet; - // frist we have to look if the master tables does support this - // and if then create a table object as well with the master tables + // first we have to look if the master tables support this + // and if so then create a table object as well with the master tables Reference<XColumnsSupplier > xMasterColumnsSup; Reference<XDataDescriptorFactory> xDataFactory(m_xMasterContainer,UNO_QUERY); if(xDataFactory.is()) diff --git a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx index 24b4716159ed..2a5d15388a65 100644 --- a/dbaccess/source/core/dataaccess/ComponentDefinition.cxx +++ b/dbaccess/source/core/dataaccess/ComponentDefinition.cxx @@ -35,6 +35,7 @@ #include "module_dba.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/sequence.hxx> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -151,7 +152,7 @@ OComponentDefinition::OComponentDefinition( const Reference< XInterface >& _rxCo registerProperties(); m_pImpl->m_aProps.aTitle = _rElementName; - DBG_ASSERT(m_pImpl->m_aProps.aTitle.getLength() != 0, "OComponentDefinition::OComponentDefinition : invalid name !"); + OSL_ENSURE(m_pImpl->m_aProps.aTitle.getLength() != 0, "OComponentDefinition::OComponentDefinition : invalid name !"); } IMPLEMENT_IMPLEMENTATION_ID(OComponentDefinition); @@ -254,7 +255,7 @@ OColumn* OComponentDefinition::createColumn(const ::rtl::OUString& _rName) const aFind->second->addPropertyChangeListener(::rtl::OUString(),m_xColumnPropertyListener.getRef()); return new OTableColumnWrapper( aFind->second, aFind->second, true ); } - OSL_ENSURE( false, "OComponentDefinition::createColumn: is this a valid case?" ); + OSL_FAIL( "OComponentDefinition::createColumn: is this a valid case?" ); // This here is the last place creating a OTableColumn, and somehow /me thinks it is not needed ... return new OTableColumn( _rName ); } diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx b/dbaccess/source/core/dataaccess/ContentHelper.cxx index fb6bf98877fc..dd3082aa157f 100644 --- a/dbaccess/source/core/dataaccess/ContentHelper.cxx +++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx @@ -89,7 +89,7 @@ void SAL_CALL OContentHelper::disposing() { ::osl::MutexGuard aGuard(m_aMutex); - // say our listeners goobye + // say goodbye to our listeners EventObject aEvt(*this); m_aContentListeners.disposeAndClear(aEvt); @@ -181,7 +181,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma Sequence< Property > Properties; if ( !( aCommand.Argument >>= Properties ) ) { - OSL_ENSURE( sal_False, "Wrong argument type!" ); + OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -201,7 +201,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma Sequence< PropertyValue > aProperties; if ( !( aCommand.Argument >>= aProperties ) ) { - OSL_ENSURE( sal_False, "Wrong argument type!" ); + OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -213,7 +213,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma if ( !aProperties.getLength() ) { - OSL_ENSURE( sal_False, "No properties!" ); + OSL_FAIL( "No properties!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -242,7 +242,7 @@ Any SAL_CALL OContentHelper::execute( const Command& aCommand, sal_Int32 /*Comma // Unsupported command ////////////////////////////////////////////////////////////////// - OSL_ENSURE( sal_False, "Content::execute - unsupported command!" ); + OSL_FAIL( "Content::execute - unsupported command!" ); ucbhelper::cancelCommandExecution( makeAny( UnsupportedCommandException( @@ -307,12 +307,12 @@ void SAL_CALL OContentHelper::removePropertiesChangeListener( const Sequence< :: // XPropertyContainer void SAL_CALL OContentHelper::addProperty( const ::rtl::OUString& /*Name*/, sal_Int16 /*Attributes*/, const Any& /*DefaultValue*/ ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException) { - DBG_ERROR( "OContentHelper::addProperty: not implemented!" ); + OSL_FAIL( "OContentHelper::addProperty: not implemented!" ); } void SAL_CALL OContentHelper::removeProperty( const ::rtl::OUString& /*Name*/ ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException) { - DBG_ERROR( "OContentHelper::removeProperty: not implemented!" ); + OSL_FAIL( "OContentHelper::removeProperty: not implemented!" ); } // XInitialization @@ -324,7 +324,7 @@ void SAL_CALL OContentHelper::initialize( const Sequence< Any >& _aArguments ) t for(;pBegin != pEnd;++pBegin) { *pBegin >>= aValue; - if ( aValue.Name.equalsAscii("Parent") ) + if ( aValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Parent")) ) { m_xParentContainer.set(aValue.Value,UNO_QUERY); } @@ -363,24 +363,27 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue { // Read-only property! aRet[ n ] <<= IllegalAccessException( - rtl::OUString::createFromAscii( - "Property is read-only!" ), + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Property is read-only!") + ), static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) ) { // Read-only property! aRet[ n ] <<= IllegalAccessException( - rtl::OUString::createFromAscii( - "Property is read-only!" ), + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Property is read-only!") + ), static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) ) { // Read-only property! aRet[ n ] <<= IllegalAccessException( - rtl::OUString::createFromAscii( - "Property is read-only!" ), + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Property is read-only!") + ), static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) ) @@ -404,7 +407,7 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue } catch( const Exception& ) { - OSL_ENSURE( sal_False, "OContentHelper::setPropertyValues('Title'): caught an exception while renaming!" ); + OSL_FAIL( "OContentHelper::setPropertyValues('Title'): caught an exception while renaming!" ); } } else @@ -415,8 +418,9 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue else { aRet[ n ] <<= IllegalTypeException( - rtl::OUString::createFromAscii( - "Property value has wrong type!" ), + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("Property value has wrong type!") + ), static_cast< cppu::OWeakObject * >( this ) ); } } @@ -424,17 +428,15 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue else { aRet[ n ] <<= Exception( - rtl::OUString::createFromAscii( - "No property set for storing the value!" ), + ::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("No property set for storing the value!") + ), static_cast< cppu::OWeakObject * >( this ) ); } } if ( nChanged > 0 ) { - // @@@ Save changes. -// storeData(); - notifyDataSourceModified(); aGuard.clear(); aChanges.realloc( nChanged ); @@ -486,27 +488,27 @@ Reference< XRow > OContentHelper::getPropertyValues( const Sequence< Property >& { // Append all Core Properties. xRow->appendString ( - Property( rtl::OUString::createFromAscii( "ContentType" ), + Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")), -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), PropertyAttribute::BOUND | PropertyAttribute::READONLY ), getContentType() ); xRow->appendString ( - Property( rtl::OUString::createFromAscii( "Title" ), + Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" )), -1, getCppuType( static_cast< const rtl::OUString * >( 0 ) ), PropertyAttribute::BOUND ), m_pImpl->m_aProps.aTitle ); xRow->appendBoolean( - Property( rtl::OUString::createFromAscii( "IsDocument" ), + Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsDocument")), -1, getCppuBooleanType(), PropertyAttribute::BOUND | PropertyAttribute::READONLY ), m_pImpl->m_aProps.bIsDocument ); xRow->appendBoolean( - Property( rtl::OUString::createFromAscii( "IsFolder" ), + Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")), -1, getCppuBooleanType(), PropertyAttribute::BOUND diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx index 5d31055d2cc2..fc754bb084d0 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.cxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx @@ -64,6 +64,7 @@ #include <sfx2/signaturestate.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/errcode.hxx> #include <tools/urlobj.hxx> #include <unotools/sharedunocomponent.hxx> @@ -440,9 +441,9 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >& { // some kind of default DBG_CTOR(ODatabaseModelImpl,NULL); - m_sConnectURL = ::rtl::OUString::createFromAscii("jdbc:"); + m_sConnectURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jdbc:")); m_aTableFilter.realloc(1); - m_aTableFilter[0] = ::rtl::OUString::createFromAscii("%"); + m_aTableFilter[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")); impl_construct_nothrow(); } @@ -680,7 +681,7 @@ void SAL_CALL ODatabaseModelImpl::disposing( const ::com::sun::star::lang::Event } else { - OSL_ENSURE( false, "ODatabaseModelImpl::disposing: where does this come from?" ); + OSL_FAIL( "ODatabaseModelImpl::disposing: where does this come from?" ); } } @@ -777,7 +778,7 @@ const Reference< XNumberFormatsSupplier > & ODatabaseModelImpl::getNumberFormats m_xNumberFormatsSupplier.set( m_aContext.createComponentWithArguments( "com.sun.star.util.NumberFormatsSupplier", aArguments ), UNO_QUERY_THROW ); - DBG_ASSERT(m_xNumberFormatsSupplier.is(), "ODatabaseModelImpl::getNumberFormatsSupplier : could not instantiate the formats supplier !"); + OSL_ENSURE(m_xNumberFormatsSupplier.is(), "ODatabaseModelImpl::getNumberFormatsSupplier : could not instantiate the formats supplier !"); } return m_xNumberFormatsSupplier; } @@ -1004,7 +1005,7 @@ Reference< XModel > ODatabaseModelImpl::createNewModel_deliverOwnership( bool _b // However, in case that the document is implicitly created by asking the data source for the document, // then nobody would call the doc's attachResource. So, we do it here, to ensure it's in a proper // state, fires all events, and so on. - // #i105505# / 2009-10-02 / frank.schoenheit@sun.com + // #i105505# xModel->attachResource( xModel->getURL(), m_aMediaDescriptor.getPropertyValues() ); } @@ -1413,7 +1414,7 @@ sal_Bool ODatabaseModelImpl::hasTrustedScriptingSignature( sal_Bool /*bAllowUITo void ODatabaseModelImpl::showBrokenSignatureWarning( const Reference< XInteractionHandler >& /*_rxInteraction*/ ) const { - OSL_ENSURE( false, "ODatabaseModelImpl::showBrokenSignatureWarning: signatures can't be broken - we do not support them!" ); + OSL_FAIL( "ODatabaseModelImpl::showBrokenSignatureWarning: signatures can't be broken - we do not support them!" ); } void ODatabaseModelImpl::storageIsModified() diff --git a/dbaccess/source/core/dataaccess/ModelImpl.hxx b/dbaccess/source/core/dataaccess/ModelImpl.hxx index d18f820bff47..804e2f976acf 100644 --- a/dbaccess/source/core/dataaccess/ModelImpl.hxx +++ b/dbaccess/source/core/dataaccess/ModelImpl.hxx @@ -564,7 +564,7 @@ public: { return getMutex(); } - inline ::rtl::Reference< ODatabaseModelImpl > getImpl( GuardAccess ) + inline ::rtl::Reference< ODatabaseModelImpl > getImpl( GuardAccess ) const { return m_pImpl; } @@ -573,7 +573,7 @@ public: inline void checkDisposed() const { if ( !m_pImpl.is() ) - throw ::com::sun::star::lang::DisposedException( ::rtl::OUString::createFromAscii( "Component is already disposed." ), getThis() ); + throw ::com::sun::star::lang::DisposedException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Component is already disposed.")), getThis() ); } inline void lockModify() diff --git a/dbaccess/source/core/dataaccess/SharedConnection.cxx b/dbaccess/source/core/dataaccess/SharedConnection.cxx index 6c18633de23e..87ad268e9e49 100644 --- a/dbaccess/source/core/dataaccess/SharedConnection.cxx +++ b/dbaccess/source/core/dataaccess/SharedConnection.cxx @@ -38,7 +38,6 @@ namespace dbaccess using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::container; -// using namespace ::com::sun::star::reflection; using namespace connectivity; DBG_NAME(OSharedConnection) diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx index a7d17634a81d..6e330a1f6cf8 100644 --- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx +++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx @@ -36,6 +36,7 @@ #include "core_resource.hrc" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/sequence.hxx> #include <comphelper/enumhelper.hxx> #include <comphelper/extract.hxx> @@ -70,7 +71,7 @@ void OBookmarkContainer::dispose() { MutexGuard aGuard(m_rMutex); - // say our listeners goobye + // say goodbye to our listeners EventObject aEvt(*this); m_aContainerListeners.disposeAndClear(aEvt); @@ -97,7 +98,7 @@ OBookmarkContainer::~OBookmarkContainer() // XServiceInfo ::rtl::OUString SAL_CALL OBookmarkContainer::getImplementationName( ) throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OBookmarkContainer"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OBookmarkContainer")); } sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) @@ -110,7 +111,7 @@ sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _r Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aReturn(1); - aReturn.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.DefinitionContainer"); + aReturn.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DefinitionContainer")); return aReturn; } @@ -329,7 +330,7 @@ void OBookmarkContainer::implRemove(const ::rtl::OUString& _rName) if (m_aBookmarks.end() == aMapPos) { - DBG_ERROR("OBookmarkContainer::implRemove: inconsistence!"); + OSL_FAIL("OBookmarkContainer::implRemove: inconsistence!"); return; } @@ -348,7 +349,7 @@ void OBookmarkContainer::implAppend(const ::rtl::OUString& _rName, const ::rtl:: void OBookmarkContainer::implReplace(const ::rtl::OUString& _rName, const ::rtl::OUString& _rNewLink) { MutexGuard aGuard(m_rMutex); - DBG_ASSERT(checkExistence(_rName), "OBookmarkContainer::implReplace : invalid name !"); + OSL_ENSURE(checkExistence(_rName), "OBookmarkContainer::implReplace : invalid name !"); m_aBookmarks[_rName] = _rNewLink; } diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx b/dbaccess/source/core/dataaccess/commanddefinition.cxx index 8ab8abe30755..e96da41181ea 100644 --- a/dbaccess/source/core/dataaccess/commanddefinition.cxx +++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx @@ -115,7 +115,7 @@ IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP ::rtl::OUString OCommandDefinition::getImplementationName_static( ) throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OCommandDefinition"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OCommandDefinition")); } ::rtl::OUString SAL_CALL OCommandDefinition::getImplementationName( ) throw(RuntimeException) diff --git a/dbaccess/source/core/dataaccess/connection.cxx b/dbaccess/source/core/dataaccess/connection.cxx index 89840f11e2cb..294606788c8f 100644 --- a/dbaccess/source/core/dataaccess/connection.cxx +++ b/dbaccess/source/core/dataaccess/connection.cxx @@ -54,6 +54,7 @@ #include <connectivity/dbexception.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <comphelper/extract.hxx> #include <comphelper/uno3.hxx> #include <comphelper/sequence.hxx> @@ -88,7 +89,7 @@ namespace dbaccess rtl::OUString OConnection::getImplementationName( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::getImplementationName" ); - return rtl::OUString::createFromAscii("com.sun.star.comp.dbaccess.Connection"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dbaccess.Connection")); } sal_Bool OConnection::supportsService( const ::rtl::OUString& _rServiceName ) throw (RuntimeException) @@ -321,7 +322,7 @@ OConnection::OConnection(ODatabaseSource& _rDB _rxORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.reflection.ProxyFactory"))),UNO_QUERY); Reference<XAggregation> xAgg = xProxyFactory->createProxy(_rxMaster.get()); setDelegation(xAgg,m_refCount); - DBG_ASSERT(m_xConnection.is(), "OConnection::OConnection : invalid master connection !"); + OSL_ENSURE(m_xConnection.is(), "OConnection::OConnection : invalid master connection !"); } catch(const Exception&) { @@ -683,7 +684,7 @@ Reference< XInterface > SAL_CALL OConnection::createInstance( const ::rtl::OUStr RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "OConnection::createInstance" ); Reference< XServiceInfo > xRet; if ( ( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER == _sServiceSpecifier ) - || ( _sServiceSpecifier.equalsAscii( "com.sun.star.sdb.SingleSelectQueryAnalyzer" ) ) + || ( _sServiceSpecifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sdb.SingleSelectQueryAnalyzer" ) ) ) ) { xRet = new OSingleSelectQueryComposer( getTables(),this, m_aContext ); diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index 16d578588f0d..9d4c6ecbfaac 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -160,7 +160,7 @@ namespace dbaccess { Reference<util::XCloseable> xCloseable(xModel,UNO_QUERY_THROW); xCloseable->close(sal_False); - } // if ( !xModel->getControllers()->hasMoreElements() ) + } } catch(const CloseVetoException&) { @@ -407,7 +407,7 @@ void ODatabaseContext::setTransientProperties(const ::rtl::OUString& _sURL, ODat const PropertyValue* pPropsEnd = rSessionPersistentProps.getConstArray() + rSessionPersistentProps.getLength(); for ( ; pProp != pPropsEnd; ++pProp ) { - if ( pProp->Name.equalsAscii( "AuthFailedPassword" ) ) + if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "AuthFailedPassword" ) ) ) { OSL_VERIFY( pProp->Value >>= sAuthFailedPassword ); } @@ -487,7 +487,7 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl } // additionally, remember the "failed password", which is not available as property - // #i86178# / 2008-02-19 / frank.schoenheit@sun.com + // #i86178# aRememberProps.put( "AuthFailedPassword", _rModelImpl.m_sFailedPassword ); ::rtl::OUString sDocumentURL( _rModelImpl.getURL() ); @@ -497,7 +497,7 @@ void ODatabaseContext::storeTransientProperties( ODatabaseModelImpl& _rModelImpl } else if ( m_aDatabaseObjects.find( _rModelImpl.m_sName ) != m_aDatabaseObjects.end() ) { - OSL_ENSURE( false, "ODatabaseContext::storeTransientProperties: a database document register by name? This shouldn't happen anymore!" ); + OSL_FAIL( "ODatabaseContext::storeTransientProperties: a database document register by name? This shouldn't happen anymore!" ); // all the code should have been changed so that registration is by URL only m_aDatasourceProperties[ _rModelImpl.m_sName ] = aRememberProps.getPropertyValues(); } @@ -698,7 +698,7 @@ void ODatabaseContext::registerDatabaseDocument( ODatabaseModelImpl& _rModelImpl setTransientProperties( sURL, _rModelImpl ); } else - OSL_ENSURE( false, "ODatabaseContext::registerDatabaseDocument: already have an object registered for this URL!" ); + OSL_FAIL( "ODatabaseContext::registerDatabaseDocument: already have an object registered for this URL!" ); } void ODatabaseContext::revokeDatabaseDocument( const ODatabaseModelImpl& _rModelImpl ) diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx b/dbaccess/source/core/dataaccess/databasedocument.cxx index f6dea5f99b3c..500a503bbda0 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.cxx +++ b/dbaccess/source/core/dataaccess/databasedocument.cxx @@ -85,6 +85,7 @@ #include <unotools/saveopt.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/errcode.hxx> #include <tools/urlobj.hxx> @@ -96,8 +97,6 @@ #define MAP_LEN(x) x, sizeof(x) - 1 -#define MAP_LEN(x) x, sizeof(x) - 1 - using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::frame; @@ -207,7 +206,7 @@ ODatabaseDocument::ODatabaseDocument(const ::rtl::Reference<ODatabaseModelImpl>& { // if the previous incarnation of the DatabaseDocument already had an URL, then creating this incarnation // here is effectively loading the document. - // #i105505# / 2009-10-01 / frank.schoenheit@sun.com + // #i105505# m_aViewMonitor.onLoadedDocument(); } } @@ -555,7 +554,7 @@ namespace // TODO: clarify: anything else to care for? Both the sub componbents with and without model // should support the XModifiable interface, so I think nothing more is needed here. - OSL_ENSURE( false, "lcl_hasAnyModifiedSubComponent_throw: anything left to do here?" ); + OSL_FAIL( "lcl_hasAnyModifiedSubComponent_throw: anything left to do here?" ); } return isAnyModified; @@ -802,7 +801,7 @@ void SAL_CALL ODatabaseDocument::disconnectController( const Reference< XControl if ( bLastControllerGone && !bIsClosing ) { // if this was the last view, close the document as a whole - // #i51157# / 2006-03-16 / frank.schoenheit@sun.com + // #i51157# try { close( sal_True ); @@ -1056,7 +1055,7 @@ void ODatabaseDocument::impl_storeAs_throw( const ::rtl::OUString& _rURL, const Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const ::rtl::OUString& _rURL ) const { Reference < ::com::sun::star::ucb::XSimpleFileAccess > xTempAccess; - m_pImpl->m_aContext.createComponent( ::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ) ,xTempAccess); + m_pImpl->m_aContext.createComponent( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")) ,xTempAccess); Reference< io::XStream > xStream = xTempAccess->openFileReadWrite( _rURL ); Reference< io::XTruncate > xTruncate(xStream,UNO_QUERY); if ( xTruncate.is() ) @@ -1293,18 +1292,18 @@ void SAL_CALL ODatabaseDocument::notifyDocumentEvent( const ::rtl::OUString& _Ev Sequence< PropertyValue > SAL_CALL ODatabaseDocument::getPrinter( ) throw (RuntimeException) { - DBG_ERROR( "ODatabaseDocument::getPrinter: not supported!" ); + OSL_FAIL( "ODatabaseDocument::getPrinter: not supported!" ); return Sequence< PropertyValue >(); } void SAL_CALL ODatabaseDocument::setPrinter( const Sequence< PropertyValue >& /*aPrinter*/ ) throw (IllegalArgumentException, RuntimeException) { - DBG_ERROR( "ODatabaseDocument::setPrinter: not supported!" ); + OSL_FAIL( "ODatabaseDocument::setPrinter: not supported!" ); } void SAL_CALL ODatabaseDocument::print( const Sequence< PropertyValue >& /*xOptions*/ ) throw (IllegalArgumentException, RuntimeException) { - DBG_ERROR( "ODatabaseDocument::print: not supported!" ); + OSL_FAIL( "ODatabaseDocument::print: not supported!" ); } void ODatabaseDocument::impl_reparent_nothrow( const WeakReference< XNameAccess >& _rxContainer ) @@ -1670,7 +1669,7 @@ void ODatabaseDocument::disposing() if ( !m_pImpl.is() ) { // this means that we're already disposed - DBG_ASSERT( ODatabaseDocument_OfficeDocument::rBHelper.bDisposed, "ODatabaseDocument::disposing: no impl anymore, but not yet disposed!" ); + OSL_ENSURE( ODatabaseDocument_OfficeDocument::rBHelper.bDisposed, "ODatabaseDocument::disposing: no impl anymore, but not yet disposed!" ); return; } @@ -1696,7 +1695,7 @@ void ODatabaseDocument::disposing() // SYNCHRONIZED -> ::osl::ClearableMutexGuard aGuard( m_aMutex ); - DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" ); + OSL_ENSURE( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" ); // normally, nobody should explicitly dispose, but only XCloseable::close the document. And upon // closing, our controllers are closed, too @@ -1711,7 +1710,7 @@ void ODatabaseDocument::disposing() // the security warning, again. m_pImpl->resetMacroExecutionMode(); - // similar argueing for our ViewMonitor + // similar arguing for our ViewMonitor m_aViewMonitor.reset(); // tell our Impl to forget us @@ -1719,7 +1718,7 @@ void ODatabaseDocument::disposing() // now, at the latest, the controller array should be empty. Controllers are // expected to listen for our disposal, and disconnect then - DBG_ASSERT( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" ); + OSL_ENSURE( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" ); impl_disposeControllerFrames_nothrow(); aKeepAlive.push_back( m_xModuleManager ); @@ -1760,7 +1759,7 @@ rtl::OUString ODatabaseDocument::getImplementationName( ) throw(RuntimeExceptio rtl::OUString ODatabaseDocument::getImplementationName_static( ) throw(RuntimeException) { - return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseDocument"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.ODatabaseDocument")); } Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames( ) throw (RuntimeException) @@ -1939,7 +1938,7 @@ Reference< XController2 > SAL_CALL ODatabaseDocument::createDefaultViewControlle Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( const ::rtl::OUString& _ViewName, const Sequence< PropertyValue >& _Arguments, const Reference< XFrame >& _Frame ) throw (IllegalArgumentException, Exception, RuntimeException) { - if ( !_ViewName.equalsAscii( "Default" ) && !_ViewName.equalsAscii( "Preview" ) ) + if ( !_ViewName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Default" ) ) && !_ViewName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Preview" ) ) ) throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); if ( !_Frame.is() ) throw IllegalArgumentException( ::rtl::OUString(), *this, 3 ); @@ -1953,7 +1952,7 @@ Reference< XController2 > SAL_CALL ODatabaseDocument::createViewController( cons ::comphelper::NamedValueCollection aInitArgs( _Arguments ); aInitArgs.put( "Frame", _Frame ); - if ( _ViewName.equalsAscii( "Preview" ) ) + if ( _ViewName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Preview" ) ) ) aInitArgs.put( "Preview", sal_Bool( sal_True ) ); Reference< XInitialization > xInitController( xController, UNO_QUERY_THROW ); xInitController->initialize( aInitArgs.getWrappedPropertyValues() ); @@ -1991,7 +1990,6 @@ uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHel } catch(uno::Exception) { - // ni } uno::Reference< frame::XUntitledNumbers > xNumberedControllers; @@ -2003,7 +2001,7 @@ uno::Reference< frame::XUntitledNumbers > ODatabaseDocument::impl_getUntitledHel xNumberedControllers.set(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW); pHelper->setOwner (xThis); - //pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : ")); + //pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : "))); m_aNumberedControllers.insert(TNumberedController::value_type(sModuleId,xNumberedControllers)); } diff --git a/dbaccess/source/core/dataaccess/databasedocument.hxx b/dbaccess/source/core/dataaccess/databasedocument.hxx index a032251f8efa..a00019e28dae 100644 --- a/dbaccess/source/core/dataaccess/databasedocument.hxx +++ b/dbaccess/source/core/dataaccess/databasedocument.hxx @@ -146,7 +146,7 @@ private: //============================================================ //= ODatabaseDocument //============================================================ -typedef ::comphelper::WeakComponentImplHelper17 < ::com::sun::star::frame::XModel2 +typedef ::comphelper::PartialWeakComponentImplHelper17 < ::com::sun::star::frame::XModel2 , ::com::sun::star::util::XModifiable , ::com::sun::star::frame::XStorable , ::com::sun::star::document::XEventBroadcaster @@ -292,7 +292,7 @@ private: // Do NOT create those documents directly, always use ODatabaseModelImpl::getModel. Reason is that // ODatabaseDocument requires clear ownership, and in turn lifetime synchronisation with the ModelImpl. // If you create a ODatabaseDocument directly, you might easily create a leak. - // #i50905# / 2005-06-20 / frank.schonheit@sun.com + // #i50905# protected: virtual void SAL_CALL disposing(); diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx b/dbaccess/source/core/dataaccess/databaseregistrations.cxx index 83b6d482b769..e2a521b71d23 100644 --- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx +++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx @@ -67,19 +67,19 @@ namespace dbaccess static const ::rtl::OUString& getConfigurationRootPath() { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii("org.openoffice.Office.DataAccess/RegisteredNames"); + static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/RegisteredNames")); return s_sNodeName; } const ::rtl::OUString& getLocationNodeName() { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii( "Location" ); + static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("Location")); return s_sNodeName; } const ::rtl::OUString& getNameNodeName() { - static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii( "Name" ); + static ::rtl::OUString s_sNodeName(RTL_CONSTASCII_USTRINGPARAM("Name")); return s_sNodeName; } diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 092432d7e487..6e74d20f7aec 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -74,6 +74,7 @@ #include <cppuhelper/typeprovider.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/urlobj.hxx> #include <typelib/typedescription.hxx> #include <unotools/confignode.hxx> @@ -152,7 +153,7 @@ FlushNotificationAdapter::FlushNotificationAdapter( const Reference< XFlushable ,m_aListener( _rxListener ) { DBG_CTOR( FlushNotificationAdapter, NULL ); - DBG_ASSERT( _rxBroadcaster.is(), "FlushNotificationAdapter::FlushNotificationAdapter: invalid flushable!" ); + OSL_ENSURE( _rxBroadcaster.is(), "FlushNotificationAdapter::FlushNotificationAdapter: invalid flushable!" ); osl_incrementInterlockedCount( &m_refCount ); { @@ -160,7 +161,7 @@ FlushNotificationAdapter::FlushNotificationAdapter( const Reference< XFlushable _rxBroadcaster->addFlushListener( this ); } osl_decrementInterlockedCount( &m_refCount ); - DBG_ASSERT( m_refCount == 1, "FlushNotificationAdapter::FlushNotificationAdapter: broadcaster isn't holding by hard ref!?" ); + OSL_ENSURE( m_refCount == 1, "FlushNotificationAdapter::FlushNotificationAdapter: broadcaster isn't holding by hard ref!?" ); } //------------------------------------------------------------ @@ -203,7 +204,7 @@ void SAL_CALL FlushNotificationAdapter::disposing( const EventObject& Source ) t } OAuthenticationContinuation::OAuthenticationContinuation() - :m_bRemberPassword(sal_True), // TODO: a meaningfull default + :m_bRemberPassword(sal_True), // TODO: a meaningful default m_bCanSetUserName(sal_True) { } @@ -215,12 +216,12 @@ sal_Bool SAL_CALL OAuthenticationContinuation::canSetRealm( ) throw(RuntimeExce void SAL_CALL OAuthenticationContinuation::setRealm( const ::rtl::OUString& /*Realm*/ ) throw(RuntimeException) { - DBG_ERROR("OAuthenticationContinuation::setRealm: not supported!"); + OSL_FAIL("OAuthenticationContinuation::setRealm: not supported!"); } sal_Bool SAL_CALL OAuthenticationContinuation::canSetUserName( ) throw(RuntimeException) { - // we alwas allow this, even if the database document is read-only. In this case, + // we always allow this, even if the database document is read-only. In this case, // it's simply that the user cannot store the new user name. return m_bCanSetUserName; } @@ -259,7 +260,7 @@ sal_Bool SAL_CALL OAuthenticationContinuation::canSetAccount( ) throw(RuntimeEx void SAL_CALL OAuthenticationContinuation::setAccount( const ::rtl::OUString& ) throw(RuntimeException) { - DBG_ERROR("OAuthenticationContinuation::setAccount: not supported!"); + OSL_FAIL("OAuthenticationContinuation::setAccount: not supported!"); } Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getRememberAccountModes( RememberAuthentication& _reDefault ) throw(RuntimeException) @@ -272,7 +273,7 @@ Sequence< RememberAuthentication > SAL_CALL OAuthenticationContinuation::getReme void SAL_CALL OAuthenticationContinuation::setRememberAccount( RememberAuthentication /*Remember*/ ) throw(RuntimeException) { - DBG_ERROR("OAuthenticationContinuation::setRememberAccount: not supported!"); + OSL_FAIL("OAuthenticationContinuation::setRememberAccount: not supported!"); } /** The class OSharedConnectionManager implements a structure to share connections. @@ -316,7 +317,7 @@ class OSharedConnectionManager : public OConnectionHelper_BASE typedef ::std::map< Reference< XConnection >,TConnectionMap::iterator> TSharedConnectionMap;// holds the shared connections ::osl::Mutex m_aMutex; - TConnectionMap m_aConnections; // remeber the master connection in conjunction with the digest + TConnectionMap m_aConnections; // remember the master connection in conjunction with the digest TSharedConnectionMap m_aSharedConnection; // the shared connections with conjunction with an iterator into the connections map Reference< XProxyFactory > m_xProxyFactory; @@ -378,14 +379,13 @@ Reference<XConnection> OSharedConnectionManager::getConnection( const rtl::OUStr aInfoCopy[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableFilter")); aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableFilter; aInfoCopy[nPos].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TableTypeFilter")); - aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableTypeFilter; // #22377# OJ + aInfoCopy[nPos++].Value <<= _pDataSource->m_pImpl->m_aTableTypeFilter; ::rtl::OUString sUser = user; ::rtl::OUString sPassword = password; if ((0 == sUser.getLength()) && (0 == sPassword.getLength()) && (0 != _pDataSource->m_pImpl->m_sUser.getLength())) { // ease the usage of this method. data source which are intended to have a user automatically // fill in the user/password combination if the caller of this method does not specify otherwise - // 86951 - 05/08/2001 - frank.schoenheit@germany.sun.com sUser = _pDataSource->m_pImpl->m_sUser; if (0 != _pDataSource->m_pImpl->m_aPassword.getLength()) sPassword = _pDataSource->m_pImpl->m_aPassword; @@ -602,7 +602,7 @@ rtl::OUString ODatabaseSource::getImplementationName( ) throw(RuntimeException) rtl::OUString ODatabaseSource::getImplementationName_static( ) throw(RuntimeException) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::getImplementationName_static" ); - return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseSource"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.ODatabaseSource")); } Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames( ) throw (RuntimeException) @@ -680,13 +680,13 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::O sal_Int32 nArgPos = 0; if (sUser.getLength()) { - aUserPwd[ nArgPos ].Name = ::rtl::OUString::createFromAscii("user"); + aUserPwd[ nArgPos ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user")); aUserPwd[ nArgPos ].Value <<= sUser; ++nArgPos; } if (sPwd.getLength()) { - aUserPwd[ nArgPos ].Name = ::rtl::OUString::createFromAscii("password"); + aUserPwd[ nArgPos ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password")); aUserPwd[ nArgPos ].Value <<= sPwd; } Reference< XDriver > xDriver; @@ -698,7 +698,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const ::rtl::O } catch( const Exception& ) { - DBG_ERROR( "ODatabaseSource::buildLowLevelConnection: got a strange exception while analyzing the error!" ); + OSL_FAIL( "ODatabaseSource::buildLowLevelConnection: got a strange exception while analyzing the error!" ); } if ( !xDriver.is() || !xDriver->acceptsURL( m_pImpl->m_sConnectURL ) ) { @@ -859,7 +859,7 @@ sal_Bool ODatabaseSource::convertFastPropertyValue(Any & rConvertedValue, Any & } break; default: - DBG_ERROR( "ODatabaseSource::convertFastPropertyValue: unknown or readonly Property!" ); + OSL_FAIL( "ODatabaseSource::convertFastPropertyValue: unknown or readonly Property!" ); } } return bModified; @@ -876,9 +876,9 @@ namespace } }; - /** sets a new set of property values at a given property bag instance + /** sets a new set of property values for a given property bag instance - The methods takes a property bag, and a sequence of property values to set at this bag. + The method takes a property bag, and a sequence of property values to set for this bag. Upon return, every property which is not part of the given sequence is <ul><li>removed from the bag, if it's a removeable property</li> <li><em>or</em>reset to its default value, if it's not a removeable property</li> @@ -887,7 +887,7 @@ namespace @param _rxPropertyBag the property bag to operate on @param _rAllNewPropertyValues - the new property values to set at the bag + the new property values to set for the bag */ void lcl_setPropertyValues_resetOrRemoveOther( const Reference< XPropertyAccess >& _rxPropertyBag, const Sequence< PropertyValue >& _rAllNewPropertyValues ) { @@ -920,7 +920,7 @@ namespace continue; // this property is not to be set, but currently exists in the bag. - // -> Remove, respectively default, it + // -> Remove it, or reset it to the default. if ( ( pExistentProperty->Attributes & PropertyAttribute::REMOVEABLE ) != 0 ) xPropertyContainer->removeProperty( pExistentProperty->Name ); else @@ -952,7 +952,7 @@ void ODatabaseSource::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const break; case PROPERTY_ID_USER: rValue >>= m_pImpl->m_sUser; - // if the user name changed, reset the password + // if the user name has changed, reset the password m_pImpl->m_aPassword = ::rtl::OUString(); break; case PROPERTY_ID_PASSWORD: @@ -1031,7 +1031,7 @@ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) con Sequence< PropertyValue > aValues( m_pImpl->m_xSettings->getPropertyValues() ); // transform them so that only property values which fulfill certain - // criterions survive + // criteria survive Sequence< PropertyValue > aNonDefaultOrUserDefined( aValues.getLength() ); const PropertyValue* pCopyEnd = ::std::remove_copy_if( aValues.getConstArray(), @@ -1064,7 +1064,7 @@ void ODatabaseSource::getFastPropertyValue( Any& rValue, sal_Int32 nHandle ) con rValue <<= m_pImpl->m_aLayoutInformation; break; default: - DBG_ERROR("unknown Property"); + OSL_FAIL("unknown Property"); } } } @@ -1116,7 +1116,7 @@ Reference< XConnection > SAL_CALL ODatabaseSource::connectWithCompletion( const if (!_rxHandler.is()) { - DBG_ERROR("ODatabaseSource::connectWithCompletion: invalid interaction handler!"); + OSL_FAIL("ODatabaseSource::connectWithCompletion: invalid interaction handler!"); return getConnection(m_pImpl->m_sUser, m_pImpl->m_aPassword,_bIsolated); } @@ -1201,7 +1201,7 @@ Reference< XConnection > ODatabaseSource::buildIsolatedConnection(const rtl::OUS RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", "ODatabaseSource::buildIsolatedConnection" ); Reference< XConnection > xConn; Reference< XConnection > xSdbcConn = buildLowLevelConnection(user, password); - DBG_ASSERT( xSdbcConn.is(), "ODatabaseSource::buildIsolatedConnection: invalid return value of buildLowLevelConnection!" ); + OSL_ENSURE( xSdbcConn.is(), "ODatabaseSource::buildIsolatedConnection: invalid return value of buildLowLevelConnection!" ); // buildLowLevelConnection is expected to always succeed if ( xSdbcConn.is() ) { @@ -1351,7 +1351,7 @@ void SAL_CALL ODatabaseSource::flushed( const EventObject& /*rEvent*/ ) throw (R // XFlushListener at the embedded connection (which needs to provide the XFlushable functionality). // Then, when the connection is flushed, we commit both the database storage and our main storage. // - // #i55274# / 2005-09-30 / frank.schoenheit@sun.com + // #i55274# OSL_ENSURE( m_pImpl->isEmbeddedDatabase(), "ODatabaseSource::flushed: no embedded database?!" ); sal_Bool bWasModified = m_pImpl->m_bModified; diff --git a/dbaccess/source/core/dataaccess/definitioncontainer.cxx b/dbaccess/source/core/dataaccess/definitioncontainer.cxx index ef3c8af0a61b..f7645349e79d 100644 --- a/dbaccess/source/core/dataaccess/definitioncontainer.cxx +++ b/dbaccess/source/core/dataaccess/definitioncontainer.cxx @@ -37,6 +37,7 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <comphelper/sequence.hxx> #include <comphelper/enumhelper.hxx> #include <comphelper/extract.hxx> @@ -46,6 +47,7 @@ #include <com/sun/star/sdb/ErrorCondition.hpp> #include <comphelper/types.hxx> #include <ucbhelper/contentidentifier.hxx> +#include <o3tl/compat_functional.hxx> using namespace ::com::sun::star::uno; @@ -78,9 +80,9 @@ ODefinitionContainer_Impl::const_iterator ODefinitionContainer_Impl::find( TCont return ::std::find_if( m_aDefinitions.begin(), m_aDefinitions.end(), - ::std::compose1( + ::o3tl::compose1( ::std::bind2nd( ::std::equal_to< TContentPtr >(), _pDefinition ), - ::std::select2nd< NamedDefinitions::value_type >() + ::o3tl::select2nd< NamedDefinitions::value_type >() ) ); } @@ -90,9 +92,9 @@ ODefinitionContainer_Impl::iterator ODefinitionContainer_Impl::find( TContentPtr return ::std::find_if( m_aDefinitions.begin(), m_aDefinitions.end(), - ::std::compose1( + ::o3tl::compose1( ::std::bind2nd( ::std::equal_to< TContentPtr >(), _pDefinition ), - ::std::select2nd< NamedDefinitions::value_type >() + ::o3tl::select2nd< NamedDefinitions::value_type >() ) ); } @@ -135,7 +137,7 @@ void SAL_CALL ODefinitionContainer::disposing() MutexGuard aGuard(m_aMutex); - // say our listeners goobye + // say goodbye to our listeners EventObject aEvt(*this); m_aApproveListeners.disposeAndClear(aEvt); m_aContainerListeners.disposeAndClear(aEvt); @@ -496,7 +498,7 @@ namespace } catch( const Exception& ) { - OSL_ENSURE( sal_False, "lcl_ensureName: caught an exception while obtaining the current name!" ); + OSL_FAIL( "lcl_ensureName: caught an exception while obtaining the current name!" ); } // set the new name @@ -511,7 +513,7 @@ namespace } catch( const Exception& ) { - OSL_ENSURE( sal_False, "lcl_ensureName: caught an exception!" ); + OSL_FAIL( "lcl_ensureName: caught an exception!" ); } return false; } @@ -530,11 +532,11 @@ void ODefinitionContainer::implAppend(const ::rtl::OUString& _rName, const Refer ODefinitionContainer_Impl::const_iterator aFind = rDefinitions.find( _rName ); if ( aFind == rDefinitions.end() ) { - // ensure that the new object thas the proper name. + // ensure that the new object has the proper name. // Somebody could create an object with name "foo", and insert it as "bar" // into a container. In this case, we need to ensure that the object name // is also "bar" - // #i44786# / 2005-03-11 / frank.schoenheit@sun.com + // #i44786# lcl_ensureName( _rxNewObject, _rName ); ::rtl::Reference< OContentHelper > pContent = OContentHelper::getImplementation( _rxNewObject ); @@ -556,13 +558,13 @@ void ODefinitionContainer::implAppend(const ::rtl::OUString& _rName, const Refer } catch(Exception&) { - DBG_ERROR("ODefinitionContainer::implAppend: caught something !"); + OSL_FAIL("ODefinitionContainer::implAppend: caught something !"); } } void ODefinitionContainer::implReplace(const ::rtl::OUString& _rName, const Reference< XContent >& _rxNewObject) { - DBG_ASSERT(checkExistence(_rName), "ODefinitionContainer::implReplace : invalid name !"); + OSL_ENSURE(checkExistence(_rName), "ODefinitionContainer::implReplace : invalid name !"); Documents::iterator aFind = m_aDocumentMap.find(_rName); removeObjectListener(aFind->second); diff --git a/dbaccess/source/core/dataaccess/documentcontainer.cxx b/dbaccess/source/core/dataaccess/documentcontainer.cxx index 498882f5885e..bdec740dc305 100644 --- a/dbaccess/source/core/dataaccess/documentcontainer.cxx +++ b/dbaccess/source/core/dataaccess/documentcontainer.cxx @@ -186,7 +186,7 @@ Reference< XInterface > SAL_CALL ODocumentContainer::createInstanceWithArguments { MutexGuard aGuard(m_aMutex); - // extrat known arguments + // extract known arguments ::rtl::OUString sName, sPersistentName, sURL, sMediaType, sDocServiceName; Reference< XCommandProcessor > xCopyFrom; Reference< XConnection > xConnection; @@ -421,7 +421,7 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { - OSL_ENSURE( sal_False, "Wrong argument type!" ); + OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -467,7 +467,7 @@ Any SAL_CALL ODocumentContainer::execute( const Command& aCommand, sal_Int32 Com InsertCommandArgument arg; if ( !( aCommand.Argument >>= arg ) ) { - OSL_ENSURE( sal_False, "Wrong argument type!" ); + OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -566,13 +566,12 @@ Reference< XComponent > SAL_CALL ODocumentContainer::loadComponentFromURL( const xComp.set(xContent->execute(aCommand,xContent->createCommandIdentifier(),Reference< XCommandEnvironment >()),UNO_QUERY); } } - catch(NoSuchElementException) + catch(const NoSuchElementException&) { throw IllegalArgumentException(); } - catch(WrappedTargetException e) + catch(const WrappedTargetException&) { - // throw IllegalArgumentException(); throw; } return xComp; @@ -679,7 +678,7 @@ void SAL_CALL ODocumentContainer::replaceByHierarchicalName( const ::rtl::OUStri if ( xUnoTunnel.is() ) pContent = reinterpret_cast<OContentHelper*>(xUnoTunnel->getSomething(OContentHelper::getUnoTunnelImplementationId())); } - catch(Exception) + catch(const Exception&) { } return pContent; @@ -752,8 +751,6 @@ void SAL_CALL ODocumentContainer::removeByName( const ::rtl::OUString& _rName ) // do the removal implRemove(_rName); - // disposeComponent(xContent); // no dispose here, the object may be inserted again under a different name - notifyByName( aGuard, _rName, NULL, NULL, E_REMOVED, ContainerListemers ); } diff --git a/dbaccess/source/core/dataaccess/documentdefinition.cxx b/dbaccess/source/core/dataaccess/documentdefinition.cxx index 305a01363177..49c331b2b572 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.cxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.cxx @@ -34,6 +34,7 @@ #include "sdbcoretools.hxx" #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <comphelper/property.hxx> #include <comphelper/sequence.hxx> #include <comphelper/mediadescriptor.hxx> @@ -219,7 +220,6 @@ namespace dbaccess if ( !m_bInChangingState && nNewState == EmbedStates::RUNNING && nOldState == EmbedStates::ACTIVE && m_pDefinition ) { m_bInChangingState = true; - //m_pDefinition->save(sal_False); m_bInChangingState = false; } } @@ -339,13 +339,13 @@ namespace dbaccess inline LifetimeCoupler( const Reference< XInterface >& _rxClient, const Reference< XComponent >& _rxActor ) :m_xClient( _rxClient ) { - DBG_ASSERT( _rxActor.is(), "LifetimeCoupler::LifetimeCoupler: this will crash!" ); + OSL_ENSURE( _rxActor.is(), "LifetimeCoupler::LifetimeCoupler: this will crash!" ); osl_incrementInterlockedCount( &m_refCount ); { _rxActor->addEventListener( this ); } osl_decrementInterlockedCount( &m_refCount ); - DBG_ASSERT( m_refCount, "LifetimeCoupler::LifetimeCoupler: the actor is not holding us by hard ref - this won't work!" ); + OSL_ENSURE( m_refCount, "LifetimeCoupler::LifetimeCoupler: the actor is not holding us by hard ref - this won't work!" ); } virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (RuntimeException); @@ -683,7 +683,7 @@ namespace } catch ( Exception& ) { - DBG_ERROR( "PreserveVisualAreaSize::PreserveVisualAreaSize: caught an exception!" ); + OSL_FAIL( "PreserveVisualAreaSize::PreserveVisualAreaSize: caught an exception!" ); } } } @@ -698,7 +698,7 @@ namespace } catch ( Exception& ) { - DBG_ERROR( "PreserveVisualAreaSize::~PreserveVisualAreaSize: caught an exception!" ); + OSL_FAIL( "PreserveVisualAreaSize::~PreserveVisualAreaSize: caught an exception!" ); } } } @@ -717,7 +717,7 @@ namespace public: inline LayoutManagerLock( const Reference< XController >& _rxController ) { - DBG_ASSERT( _rxController.is(), "LayoutManagerLock::LayoutManagerLock: this will crash!" ); + OSL_ENSURE( _rxController.is(), "LayoutManagerLock::LayoutManagerLock: this will crash!" ); Reference< XFrame > xFrame( _rxController->getFrame() ); try { @@ -730,7 +730,7 @@ namespace } catch( Exception& ) { - DBG_ERROR( "LayoutManagerLock::LayoutManagerLock: caught an exception!" ); + OSL_FAIL( "LayoutManagerLock::LayoutManagerLock: caught an exception!" ); } } @@ -744,7 +744,7 @@ namespace } catch( Exception& ) { - DBG_ERROR( "LayoutManagerLock::~LayoutManagerLock: caught an exception!" ); + OSL_FAIL( "LayoutManagerLock::~LayoutManagerLock: caught an exception!" ); } } }; @@ -853,7 +853,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons if ( lcl_extractOpenMode( pIter->Value, nOpenMode ) ) continue; - if ( pIter->Name.equalsAscii( "MacroExecutionMode" ) ) + if ( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MacroExecutionMode" ) ) ) { sal_Int16 nMacroExecMode( !aDocumentMacroMode ? MacroExecMode::USE_CONFIG : *aDocumentMacroMode ); OSL_VERIFY( pIter->Value >>= nMacroExecMode ); @@ -874,7 +874,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons // However, it is possible to programmatically load forms/reports, without actually // loading the database document into a frame. In this case, the user will be asked // here and now. - // #i87741# / 2008-05-05 / frank.schoenheit@sun.com + // #i87741# // allow the command arguments to downgrade the macro execution mode, but not to upgrade // it @@ -935,7 +935,7 @@ Any ODocumentDefinition::onCommandOpenSomething( const Any& _rOpenArgument, cons sal_Int16( nOpenMode ) ) ), _rxEnvironment ); // Unreachable - DBG_ERROR( "unreachable" ); + OSL_FAIL( "unreachable" ); } OSL_ENSURE( m_pImpl->m_aProps.sPersistentName.getLength(), @@ -1003,9 +1003,9 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co { Any aRet; - sal_Bool bOpen = aCommand.Name.equalsAscii( "open" ); - sal_Bool bOpenInDesign = aCommand.Name.equalsAscii( "openDesign" ); - sal_Bool bOpenForMail = aCommand.Name.equalsAscii( "openForMail" ); + sal_Bool bOpen = aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "open" ) ); + sal_Bool bOpenInDesign = aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "openDesign" ) ); + sal_Bool bOpenForMail = aCommand.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "openForMail" ) ); if ( bOpen || bOpenInDesign || bOpenForMail ) { // opening the document involves a lot of VCL code, which is not thread-safe, but needs the SolarMutex locked. @@ -1024,7 +1024,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co bool bActivateObject = true; if ( bOpenForMail ) { - OSL_ENSURE( false, "ODocumentDefinition::execute: 'openForMail' should not be used anymore - use the 'Hidden' parameter instead!" ); + OSL_FAIL( "ODocumentDefinition::execute: 'openForMail' should not be used anymore - use the 'Hidden' parameter instead!" ); bActivateObject = false; } @@ -1062,7 +1062,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co aCommand.Argument >>= aIni; if ( aIni.getLength() != 2 ) { - OSL_ENSURE( sal_False, "Wrong argument type!" ); + OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -1088,7 +1088,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co aCommand.Argument >>= aIni; if ( !aIni.getLength() ) { - OSL_ENSURE( sal_False, "Wrong argument count!" ); + OSL_FAIL( "Wrong argument count!" ); ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( rtl::OUString(), @@ -1208,7 +1208,7 @@ void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const R // Check, if all required properties were set. if ( !_sURL.getLength() || m_xEmbeddedObject.is() ) { - OSL_ENSURE( sal_False, "Content::onCommandInsert - property value missing!" ); + OSL_FAIL( "Content::onCommandInsert - property value missing!" ); Sequence< rtl::OUString > aProps( 1 ); aProps[ 0 ] = PROPERTY_URL; @@ -1238,7 +1238,7 @@ void ODocumentDefinition::onCommandInsert( const ::rtl::OUString& _sURL, const R ,aEmpty),UNO_QUERY); lcl_resetFormsToEmptyDataSource( m_xEmbeddedObject ); - // #i57669# / 2005-12-01 / frank.schoenheit@sun.com + // #i57669# Reference<XEmbedPersist> xPersist(m_xEmbeddedObject,UNO_QUERY); if ( xPersist.is() ) @@ -1345,7 +1345,7 @@ sal_Bool ODocumentDefinition::save(sal_Bool _bApprove) } catch(Exception&) { - OSL_ENSURE(0,"ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!"); + OSL_FAIL("ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!"); } return sal_True; } @@ -1454,7 +1454,7 @@ sal_Bool ODocumentDefinition::saveAs() } catch(Exception&) { - OSL_ENSURE(0,"ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!"); + OSL_FAIL("ODocumentDefinition::save: caught an Exception (tried to let the InteractionHandler handle it)!"); } return sal_True; } @@ -1509,9 +1509,9 @@ sal_Bool ODocumentDefinition::objectSupportsEmbeddedScripts() const bool bAllowDocumentMacros = !m_pImpl->m_pDataSource || ( m_pImpl->m_pDataSource->determineEmbeddedMacros() == ODatabaseModelImpl::eSubDocumentMacros ); - // if *any* of the objects of the database document already has macros, we continue to allow it - // to have them, until the user did a migration. - // If there are no macros, yet, we don't allow to create them + // if *any* of the objects of the database document already has macros, we + // continue to allow it to have them, until the user does a migration. + // If there are no macros, we don't allow them to be created. return bAllowDocumentMacros; } @@ -1651,7 +1651,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_ sDocumentService = GetDocumentServiceFromMediaType( getContentType(), m_aContext, aClassID ); // check if we are not a form and // the com.sun.star.report.pentaho.SOReportJobFactory is not present. - if ( !m_bForm && !sDocumentService.equalsAscii("com.sun.star.text.TextDocument")) + if ( !m_bForm && !sDocumentService.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("com.sun.star.text.TextDocument"))) { // we seem to be a "new style" report, check if report extension is present. Reference< XContentEnumerationAccess > xEnumAccess( m_aContext.getLegacyServiceFactory(), UNO_QUERY ); @@ -1757,8 +1757,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_ lcl_putLoadArgs( aExistentMediaDesc, optional_bool(), optional_bool() ); // don't put _bSuppressMacros and _bReadOnly here - if the document was already // loaded, we should not tamper with its settings. - // #i88977# / 2008-05-05 / frank.schoenheit@sun.com - // #i86872# / 2008-03-13 / frank.schoenheit@sun.com + // #i88977# #i86872# xModel->attachResource( xModel->getURL(), aExistentMediaDesc.getPropertyValues() ); } @@ -1770,7 +1769,7 @@ void ODocumentDefinition::loadEmbeddedObject( const Reference< XConnection >& i_ } // set the OfficeDatabaseDocument instance as parent of the embedded document - // #i40358# / 2005-01-19 / frank.schoenheit@sun.com + // #i40358# Reference< XChild > xDepdendDocAsChild( getComponent(), UNO_QUERY ); if ( xDepdendDocAsChild.is() ) { @@ -2054,7 +2053,7 @@ bool ODocumentDefinition::prepareClose() // suspend the controller. Embedded objects are not allowed to raise // own UI at their own discretion, instead, this has always to be triggered // by the embedding component. Thus, we do the suspend call here. - // #i49370# / 2005-06-09 / frank.schoenheit@sun.com + // #i49370# Reference< util::XCloseable > xComponent( impl_getComponent_throw( false ) ); if ( !xComponent.is() ) diff --git a/dbaccess/source/core/dataaccess/documentdefinition.hxx b/dbaccess/source/core/dataaccess/documentdefinition.hxx index d7109efa2582..d45b25181db1 100644 --- a/dbaccess/source/core/dataaccess/documentdefinition.hxx +++ b/dbaccess/source/core/dataaccess/documentdefinition.hxx @@ -374,7 +374,7 @@ private: ODocumentDefinition& m_rDocumentDefinition; const ::com::sun::star::uno::Any m_aOldValue; const ::com::sun::star::uno::Any m_aNewValue; - mutable ::osl::ResettableMutexGuard& m_rClearForNotify; + ::osl::ResettableMutexGuard& m_rClearForNotify; void impl_fireEvent_throw( const sal_Bool i_bVetoable ); }; diff --git a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx index 35262dd70038..ab44de2c27bf 100644 --- a/dbaccess/source/core/dataaccess/documenteventexecutor.cxx +++ b/dbaccess/source/core/dataaccess/documenteventexecutor.cxx @@ -101,7 +101,7 @@ namespace dbaccess xDispProv.set( xController->getFrame(), UNO_QUERY ); if ( !xDispProv.is() ) { - OSL_ENSURE( false, "lcl_dispatchScriptURL_throw: no controller/frame? How should I dispatch?" ); + OSL_FAIL( "lcl_dispatchScriptURL_throw: no controller/frame? How should I dispatch?" ); return; } @@ -118,7 +118,7 @@ namespace dbaccess Reference< XDispatch > xDispatch( xDispProv->queryDispatch( aScriptURL, ::rtl::OUString(), 0 ) ); if ( !xDispatch.is() ) { - OSL_ENSURE( false, "lcl_dispatchScriptURL_throw: no dispatcher for the script URL!" ); + OSL_FAIL( "lcl_dispatchScriptURL_throw: no dispatcher for the script URL!" ); return; } @@ -163,7 +163,7 @@ namespace dbaccess Reference< XEventsSupplier > xEventsSupplier( m_pData->xDocument.get(), UNO_QUERY ); if ( !xEventsSupplier.is() ) { - OSL_ENSURE( false, "DocumentEventExecutor::documentEventOccured: no document anymore, but still being notified?" ); + OSL_FAIL( "DocumentEventExecutor::documentEventOccurred: no document anymore, but still being notified?" ); return; } @@ -176,7 +176,7 @@ namespace dbaccess { // this is worth an assertion: We are listener at the very same document which we just asked // for its events. So when EventName is fired, why isn't it supported by xDocEvents? - OSL_ENSURE( false, "DocumentEventExecutor::documentEventOccured: an unsupported event is notified!" ); + OSL_FAIL( "DocumentEventExecutor::documentEventOccurred: an unsupported event is notified!" ); return; } @@ -199,7 +199,7 @@ namespace dbaccess bool bNonEmptyScript = sScript.getLength() != 0; OSL_ENSURE( bDispatchScriptURL && bNonEmptyScript, - "DocumentEventExecutor::documentEventOccured: invalid/unsupported script descriptor" ); + "DocumentEventExecutor::documentEventOccurred: invalid/unsupported script descriptor" ); if ( bDispatchScriptURL && bNonEmptyScript ) { diff --git a/dbaccess/source/core/dataaccess/documentevents.cxx b/dbaccess/source/core/dataaccess/documentevents.cxx index 208b2486c459..e24c2bf59113 100644 --- a/dbaccess/source/core/dataaccess/documentevents.cxx +++ b/dbaccess/source/core/dataaccess/documentevents.cxx @@ -38,6 +38,7 @@ #include <algorithm> #include <functional> +#include <o3tl/compat_functional.hxx> namespace dbaccess { @@ -223,7 +224,7 @@ namespace dbaccess m_pData->rEventsData.begin(), m_pData->rEventsData.end(), aNames.getArray(), - ::std::select1st< DocumentEventsData::value_type >() + ::o3tl::select1st< DocumentEventsData::value_type >() ); return aNames; } diff --git a/dbaccess/source/core/dataaccess/intercept.cxx b/dbaccess/source/core/dataaccess/intercept.cxx index 7fe1d9089bbc..31317422288a 100644 --- a/dbaccess/source/core/dataaccess/intercept.cxx +++ b/dbaccess/source/core/dataaccess/intercept.cxx @@ -160,7 +160,7 @@ void SAL_CALL OInterceptor::dispatch( const URL& _URL,const Sequence<PropertyVal while( nInd < aNewArgs.getLength() ) { - if ( aNewArgs[nInd].Name.equalsAscii( "SaveTo" ) ) + if ( aNewArgs[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "SaveTo" ) ) ) { aNewArgs[nInd].Value <<= sal_True; break; @@ -171,12 +171,12 @@ void SAL_CALL OInterceptor::dispatch( const URL& _URL,const Sequence<PropertyVal if ( nInd == aNewArgs.getLength() ) { aNewArgs.realloc( nInd + 1 ); - aNewArgs[nInd].Name = ::rtl::OUString::createFromAscii( "SaveTo" ); + aNewArgs[nInd].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SaveTo")); aNewArgs[nInd].Value <<= sal_True; } Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch( - _URL, ::rtl::OUString::createFromAscii( "_self" ), 0 ); + _URL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 ); if ( xDispatch.is() ) xDispatch->dispatch( _URL, aNewArgs ); } @@ -204,7 +204,7 @@ IMPL_LINK( OInterceptor, OnDispatch, void*, _pDispatcher ) if ( m_pContentHolder && m_pContentHolder->prepareClose() && m_xSlaveDispatchProvider.is() ) { Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch( - pHelper->aURL, ::rtl::OUString::createFromAscii( "_self" ), 0 ); + pHelper->aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 ); if ( xDispatch.is() ) { Reference< ::com::sun::star::document::XEventBroadcaster> xEvtB(m_pContentHolder->getComponent(),UNO_QUERY); diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx index 1a71fc0a3f65..afb2040874b6 100644 --- a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx +++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx @@ -119,7 +119,7 @@ DataSupplier_Impl::~DataSupplier_Impl() while ( it != end ) { delete (*it); - it++; + ++it; } } diff --git a/dbaccess/source/core/inc/View.hxx b/dbaccess/source/core/inc/View.hxx index 44fac5088991..a2dedc5a8d57 100644 --- a/dbaccess/source/core/inc/View.hxx +++ b/dbaccess/source/core/inc/View.hxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: View.hxx,v $ - * $Revision: 1.3 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/dbaccess/source/core/inc/column.hxx b/dbaccess/source/core/inc/column.hxx index a65e967cc4c4..b6e533a81a35 100644 --- a/dbaccess/source/core/inc/column.hxx +++ b/dbaccess/source/core/inc/column.hxx @@ -62,7 +62,7 @@ #include <cppuhelper/propshlp.hxx> #include <osl/diagnose.h> -#include <hash_map> +#include <boost/unordered_map.hpp> namespace dbaccess { @@ -157,7 +157,7 @@ namespace dbaccess //= general columns map, could be used for readonly access //= no appending and dropping is supported //============================================================ - typedef ::std::hash_map<rtl::OUString, OColumn*, ::comphelper::UStringMixHash, ::comphelper::UStringMixEqual> OColumnMap; + typedef ::boost::unordered_map<rtl::OUString, OColumn*, ::comphelper::UStringMixHash, ::comphelper::UStringMixEqual> OColumnMap; typedef ::std::vector<OColumn*> OColumnArray; class OContainerMediator; diff --git a/dbaccess/source/core/inc/table.hxx b/dbaccess/source/core/inc/table.hxx index 8c2d1eda7c14..63ebe2213306 100644 --- a/dbaccess/source/core/inc/table.hxx +++ b/dbaccess/source/core/inc/table.hxx @@ -143,7 +143,6 @@ namespace dbaccess DECLARE_SERVICE_INFO(); // com::sun::star::beans::XPropertySet - // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const; // ::com::sun::star::sdbcx::XRename, diff --git a/dbaccess/source/core/misc/ContainerMediator.cxx b/dbaccess/source/core/misc/ContainerMediator.cxx index cd1dd3c2907c..417d49c9c372 100644 --- a/dbaccess/source/core/misc/ContainerMediator.cxx +++ b/dbaccess/source/core/misc/ContainerMediator.cxx @@ -75,7 +75,7 @@ OContainerMediator::OContainerMediator( const Reference< XContainer >& _xContain } catch(Exception&) { - OSL_ENSURE(sal_False, "OContainerMediator::OContainerMediator: caught an exception!"); + OSL_FAIL("OContainerMediator::OContainerMediator: caught an exception!"); } osl_decrementInterlockedCount( &m_refCount ); } @@ -223,7 +223,7 @@ void OContainerMediator::notifyElementCreated( const ::rtl::OUString& _sName, co && aFind->second->getDefinition().is() ) { - OSL_ENSURE( false, "OContainerMediator::notifyElementCreated: is this really a valid case?" ); + OSL_FAIL( "OContainerMediator::notifyElementCreated: is this really a valid case?" ); return; } diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx index bb1fc1cf59b2..c8e1e9091555 100644 --- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx +++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx @@ -119,7 +119,7 @@ uno::Any DatabaseDataProvider::queryInterface(uno::Type const & type) throw (uno //------------------------------------------------------------------------------ rtl::OUString DatabaseDataProvider::getImplementationName_Static( ) throw(uno::RuntimeException) { - return rtl::OUString::createFromAscii("com.sun.star.comp.chart2.data.DatabaseDataProvider"); + return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.chart2.data.DatabaseDataProvider")); } // ----------------------------------------------------------------------------- // ------------------------------------------------------------------------- @@ -173,26 +173,25 @@ void SAL_CALL DatabaseDataProvider::initialize(const uno::Sequence< uno::Any > & // chart2::data::XDataProvider: ::sal_Bool SAL_CALL DatabaseDataProvider::createDataSourcePossible(const uno::Sequence< beans::PropertyValue > & _aArguments) throw (uno::RuntimeException) { - //::osl::ResettableMutexGuard aClearForNotifies(m_aMutex); const beans::PropertyValue* pArgIter = _aArguments.getConstArray(); const beans::PropertyValue* pArgEnd = pArgIter + _aArguments.getLength(); for(;pArgIter != pArgEnd;++pArgIter) { - if ( pArgIter->Name.equalsAscii("DataRowSource") ) + if ( pArgIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DataRowSource")) ) { ::com::sun::star::chart::ChartDataRowSource eRowSource = ::com::sun::star::chart::ChartDataRowSource_COLUMNS; pArgIter->Value >>= eRowSource; if ( eRowSource != ::com::sun::star::chart::ChartDataRowSource_COLUMNS ) return sal_False; - } // if ( pArgIter->Name.equalsAscii("DataRowSource") ) - else if ( pArgIter->Name.equalsAscii("CellRangeRepresentation") ) + } + else if ( pArgIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CellRangeRepresentation")) ) { ::rtl::OUString sRange; pArgIter->Value >>= sRange; - if ( !sRange.equalsAscii("all") ) + if ( !sRange.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("all")) ) return sal_False; } - else if ( pArgIter->Name.equalsAscii("FirstCellAsLabel") ) + else if ( pArgIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FirstCellAsLabel")) ) { sal_Bool bFirstCellAsLabel = sal_True; pArgIter->Value >>= bFirstCellAsLabel; @@ -241,7 +240,7 @@ uno::Reference< chart2::data::XDataSource > SAL_CALL DatabaseDataProvider::creat { } } - if ( !bRet ) // no command set or an error occured, use Internal data handler + if ( !bRet ) // no command set or an error occurred, use Internal data handler { uno::Reference< lang::XInitialization> xIni(m_xInternal,uno::UNO_QUERY); if ( xIni.is() ) diff --git a/dbaccess/source/core/misc/dsntypes.cxx b/dbaccess/source/core/misc/dsntypes.cxx index 39c29c4f4925..ebd2e7c9717d 100644 --- a/dbaccess/source/core/misc/dsntypes.cxx +++ b/dbaccess/source/core/misc/dsntypes.cxx @@ -35,6 +35,7 @@ #include "dbamiscres.hrc" #include <unotools/confignode.hxx> #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/wldcrd.hxx> #include <osl/file.hxx> #include "dbastrings.hrc" @@ -51,7 +52,6 @@ namespace dbaccess using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; - //using namespace ::com::sun::star::sdbc; namespace { @@ -72,7 +72,7 @@ DBG_NAME(ODsnTypeCollection) ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xFactory) :m_aDriverConfig(_xFactory) ,m_xFactory(_xFactory) -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ,m_nLivingIterators(0) #endif { @@ -86,7 +86,7 @@ ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< : m_aDsnTypesDisplayNames.push_back(m_aDriverConfig.getDriverTypeDisplayName(*pIter)); } - DBG_ASSERT(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(), + OSL_ENSURE(m_aDsnTypesDisplayNames.size() == m_aDsnPrefixes.size(), "ODsnTypeCollection::ODsnTypeCollection : invalid resources !"); } @@ -94,7 +94,7 @@ ODsnTypeCollection::ODsnTypeCollection(const ::com::sun::star::uno::Reference< : ODsnTypeCollection::~ODsnTypeCollection() { DBG_DTOR(ODsnTypeCollection,NULL); - DBG_ASSERT(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still living iterator objects!"); + OSL_ENSURE(0 == m_nLivingIterators, "ODsnTypeCollection::~ODsnTypeCollection : there are still living iterator objects!"); } //------------------------------------------------------------------------- String ODsnTypeCollection::getTypeDisplayName(const ::rtl::OUString& _sURL) const @@ -173,7 +173,7 @@ bool ODsnTypeCollection::isConnectionUrlRequired(const ::rtl::OUString& _sURL) c sRet = *aIter; sOldPattern = *aIter; } - } // for(;aIter != aEnd;++aIter) + } return sRet.GetChar(sRet.Len()-1) == '*'; } // ----------------------------------------------------------------------------- @@ -203,7 +203,7 @@ String ODsnTypeCollection::getDatasourcePrefixFromMediaType(const ::rtl::OUStrin if ( !sFileExtension.getLength() && _sExtension.getLength() ) sFallbackURL = *pIter; } - } // for(;pIter != pEnd;++pIter ) + } if ( !sURL.Len() && sFallbackURL.Len() ) sURL = sFallbackURL; @@ -239,7 +239,7 @@ void ODsnTypeCollection::extractHostNamePort(const ::rtl::OUString& _rDsn,String if ( _rsHostname.Len() ) _rsHostname = _rsHostname.GetToken(_rsHostname.GetTokenCount('@') - 1,'@'); _sDatabaseName = sUrl.GetToken(sUrl.GetTokenCount(':') - 1,':'); - } // if ( _rDsn.matchIgnoreAsciiCaseAsciiL("jdbc:oracle:thin:",sizeof("jdbc:oracle:thin:")-1) ) + } else if ( _rDsn.matchIgnoreAsciiCaseAsciiL("sdbc:address:ldap:",sizeof("sdbc:address:ldap:")-1) ) { lcl_extractHostAndPort(sUrl,_sDatabaseName,_nPortNumber); @@ -334,7 +334,7 @@ bool ODsnTypeCollection::isEmbeddedDatabase( const ::rtl::OUString& _sURL ) cons if ( sEmbeddedDatabaseURL.getLength() ) aInstalled.getNodeValue(s_sValue + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")) + sEmbeddedDatabaseURL + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/URL"))) >>= sEmbeddedDatabaseURL; } - } // if ( aInstalled.isValid() ) + } if ( !sEmbeddedDatabaseURL.getLength() ) sEmbeddedDatabaseURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:embedded:hsqldb")); return sEmbeddedDatabaseURL; @@ -359,7 +359,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const String& _rDsn) const if (STRING_NOTFOUND == nSeparator) { // there should be at least one such separator - DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the colon !"); + OSL_FAIL("ODsnTypeCollection::implDetermineType : missing the colon !"); return DST_UNKNOWN; } // find first : @@ -382,7 +382,7 @@ DATASOURCE_TYPE ODsnTypeCollection::determineType(const String& _rDsn) const if (STRING_NOTFOUND == nSeparator) { // at the moment only jdbc is allowed to have just one separator - DBG_ERROR("ODsnTypeCollection::implDetermineType : missing the second colon !"); + OSL_FAIL("ODsnTypeCollection::implDetermineType : missing the second colon !"); return DST_UNKNOWN; } @@ -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; } @@ -530,7 +530,7 @@ void ODsnTypeCollection::fillPageIds(const ::rtl::OUString& _sURL,::std::vector< { sOldPattern = *aIter; } - } // for(sal_Int32 i = 0;aIter != aEnd;++aIter,++i) + } return sOldPattern; } // ----------------------------------------------------------------------------- @@ -566,7 +566,7 @@ ODsnTypeCollection::TypeIterator::TypeIterator(const ODsnTypeCollection* _pConta :m_pContainer(_pContainer) ,m_nPosition(_nInitialPos) { - DBG_ASSERT(m_pContainer, "ODsnTypeCollection::TypeIterator::TypeIterator : invalid container!"); + OSL_ENSURE(m_pContainer, "ODsnTypeCollection::TypeIterator::TypeIterator : invalid container!"); #ifdef DBG_UTIL ++const_cast<ODsnTypeCollection*>(m_pContainer)->m_nLivingIterators; #endif @@ -593,19 +593,19 @@ ODsnTypeCollection::TypeIterator::~TypeIterator() //------------------------------------------------------------------------- String ODsnTypeCollection::TypeIterator::getDisplayName() const { - DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(), "ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!"); + OSL_ENSURE(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(), "ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!"); return m_pContainer->m_aDsnTypesDisplayNames[m_nPosition]; } // ----------------------------------------------------------------------------- ::rtl::OUString ODsnTypeCollection::TypeIterator::getURLPrefix() const { - DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnPrefixes.size(), "ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!"); + OSL_ENSURE(m_nPosition < (sal_Int32)m_pContainer->m_aDsnPrefixes.size(), "ODsnTypeCollection::TypeIterator::getDisplayName : invalid position!"); return m_pContainer->m_aDsnPrefixes[m_nPosition]; } //------------------------------------------------------------------------- const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator++() { - DBG_ASSERT(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(), "ODsnTypeCollection::TypeIterator::operator++ : invalid position!"); + OSL_ENSURE(m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size(), "ODsnTypeCollection::TypeIterator::operator++ : invalid position!"); if (m_nPosition < (sal_Int32)m_pContainer->m_aDsnTypesDisplayNames.size()) ++m_nPosition; return *this; @@ -614,7 +614,7 @@ const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operat //------------------------------------------------------------------------- const ODsnTypeCollection::TypeIterator& ODsnTypeCollection::TypeIterator::operator--() { - DBG_ASSERT(m_nPosition >= 0, "ODsnTypeCollection::TypeIterator::operator-- : invalid position!"); + OSL_ENSURE(m_nPosition >= 0, "ODsnTypeCollection::TypeIterator::operator-- : invalid position!"); if (m_nPosition >= 0) --m_nPosition; return *this; diff --git a/dbaccess/source/core/misc/services.cxx b/dbaccess/source/core/misc/services.cxx index 189e4f1e36e4..14173af33978 100644 --- a/dbaccess/source/core/misc/services.cxx +++ b/dbaccess/source/core/misc/services.cxx @@ -64,8 +64,8 @@ namespace dba{ //*************************************************************************************** // -// Die vorgeschriebene C-Api muss erfuellt werden! -// Sie besteht aus drei Funktionen, die von dem Modul exportiert werden muessen. +// The prescribed C api must be complied with +// It consists of three functions which must be exported by the module. // extern "C" void SAL_CALL createRegistryInfo_DBA() { @@ -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/recovery/dbdocrecovery.cxx b/dbaccess/source/core/recovery/dbdocrecovery.cxx index f1e897764457..42040e4b7ae2 100644 --- a/dbaccess/source/core/recovery/dbdocrecovery.cxx +++ b/dbaccess/source/core/recovery/dbdocrecovery.cxx @@ -110,7 +110,7 @@ namespace dbaccess const sal_Int32 nEqualSignPos = i_rIniLine.indexOf( sal_Unicode( '=' ) ); if ( nEqualSignPos < 1 ) { - OSL_ENSURE( false, "lcl_extractCompDesc: invalid map file entry - unexpected pos of '='" ); + OSL_FAIL( "lcl_extractCompDesc: invalid map file entry - unexpected pos of '='" ); return false; } o_rStorName = i_rIniLine.copy( 0, nEqualSignPos ); @@ -118,7 +118,7 @@ namespace dbaccess const sal_Int32 nCommaPos = i_rIniLine.lastIndexOf( sal_Unicode( ',' ) ); if ( nCommaPos != i_rIniLine.getLength() - 2 ) { - OSL_ENSURE( false, "lcl_extractCompDesc: invalid map file entry - unexpected pos of ','" ); + OSL_FAIL( "lcl_extractCompDesc: invalid map file entry - unexpected pos of ','" ); return false; } o_rCompDesc.sName = i_rIniLine.copy( nEqualSignPos + 1, nCommaPos - nEqualSignPos - 1 ); @@ -199,7 +199,7 @@ namespace dbaccess ENSURE_OR_THROW( i_rStorage.is(), "invalid storage" ); if ( !i_rStorage->hasByName( lcl_getObjectMapStreamName() ) ) { // nothing to do, though suspicious - OSL_ENSURE( false, "lcl_readObjectMap_throw: if there's no map file, then there's expected to be no storage, too!" ); + OSL_FAIL( "lcl_readObjectMap_throw: if there's no map file, then there's expected to be no storage, too!" ); return; } @@ -232,7 +232,7 @@ namespace dbaccess continue; // the only section we support so far is "storages" - if ( !sCurrentSection.equalsAscii( "storages" ) ) + if ( !sCurrentSection.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "storages" ) ) ) { bCurrentSectionIsKnownToBeUnsupported = true; continue; @@ -252,7 +252,7 @@ namespace dbaccess const Reference< XModifiable > xModify( i_rSubComponent, UNO_QUERY ); if ( !xModify.is() ) { - OSL_ENSURE( false, "lcl_markModified: unhandled case!" ); + OSL_FAIL( "lcl_markModified: unhandled case!" ); return; } @@ -398,7 +398,7 @@ namespace dbaccess message.append( "' not found in '" ); message.append( ::rtl::OUStringToOString( SubComponentRecovery::getComponentsStorageName( eComponentType ), RTL_TEXTENCODING_ASCII_US ) ); message.append( "', but required per map file!" ); - OSL_ENSURE( false, message.makeStringAndClear() ); + OSL_FAIL( message.makeStringAndClear() ); #endif continue; } diff --git a/dbaccess/source/core/recovery/makefile.mk b/dbaccess/source/core/recovery/makefile.mk index c13334bbc9d9..e92af230894a 100644 --- a/dbaccess/source/core/recovery/makefile.mk +++ b/dbaccess/source/core/recovery/makefile.mk @@ -6,10 +6,6 @@ # # OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ -# -# $Revision: 1.10.2.3 $ -# # This file is part of OpenOffice.org. # # OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/dbaccess/source/core/recovery/settingsimport.cxx b/dbaccess/source/core/recovery/settingsimport.cxx index 8ef984f585ee..397c97eeb34c 100644 --- a/dbaccess/source/core/recovery/settingsimport.cxx +++ b/dbaccess/source/core/recovery/settingsimport.cxx @@ -118,7 +118,7 @@ namespace dbaccess o_rLocalName = i_rElementName.copy( nSeparatorPos + 1 ); } - OSL_ENSURE( o_rNamespace.equalsAscii( "config" ), "SettingsImport::split: unexpected namespace!" ); + OSL_ENSURE( o_rNamespace.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "config" ) ), "SettingsImport::split: unexpected namespace!" ); // our recovery file is kind of hand-made, so there shouldn't be anything else than "config". // If there is, then just ignore it ... } @@ -155,14 +155,14 @@ namespace dbaccess ::rtl::OUString sLocalName; split( i_rElementName, sNamespace, sLocalName ); - if ( sLocalName.equalsAscii( "config-item-set" ) ) + if ( sLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "config-item-set" ) ) ) return new ConfigItemSetImport( m_rSettings ); #if OSL_DEBUG_LEVEL > 0 ::rtl::OString sMessage( "unknown (or unsupported at this place) element name '" ); sMessage += ::rtl::OUStringToOString( i_rElementName, RTL_TEXTENCODING_UTF8 ); sMessage += "', ignoring"; - OSL_ENSURE( false, sMessage.getStr() ); + OSL_FAIL( sMessage.getStr() ); #endif return new IgnoringSettingsImport; } @@ -184,7 +184,7 @@ namespace dbaccess //-------------------------------------------------------------------- ::rtl::Reference< SettingsImport > ConfigItemImport::nextState( const ::rtl::OUString& i_rElementName ) { - OSL_ENSURE( false, "ConfigItemImport::nextState: unexpected: this class is responsible for child-less items only!" ); + OSL_FAIL( "ConfigItemImport::nextState: unexpected: this class is responsible for child-less items only!" ); (void)i_rElementName; return new IgnoringSettingsImport; } @@ -220,7 +220,7 @@ namespace dbaccess o_rValue <<= nValue; else { - OSL_ENSURE( false, "ConfigItemImport::getItemValue: could not convert an int value!" ); + OSL_FAIL( "ConfigItemImport::getItemValue: could not convert an int value!" ); } } else if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_BOOLEAN ) ) @@ -230,7 +230,7 @@ namespace dbaccess o_rValue <<= nValue; else { - OSL_ENSURE( false, "ConfigItemImport::getItemValue: could not convert a boolean value!" ); + OSL_FAIL( "ConfigItemImport::getItemValue: could not convert a boolean value!" ); } } else if ( ::xmloff::token::IsXMLToken( rItemType, ::xmloff::token::XML_STRING ) ) @@ -243,7 +243,7 @@ namespace dbaccess ::rtl::OString sMessage( "ConfigItemImport::getItemValue: unsupported item type '" ); sMessage += ::rtl::OUStringToOString( rItemType, RTL_TEXTENCODING_UTF8 ); sMessage += "', ignoring"; - OSL_ENSURE( false, sMessage.getStr() ); + OSL_FAIL( sMessage.getStr() ); } #endif } @@ -270,16 +270,16 @@ namespace dbaccess ::rtl::OUString sLocalName; split( i_rElementName, sNamespace, sLocalName ); - if ( sLocalName.equalsAscii( "config-item-set" ) ) + if ( sLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "config-item-set" ) ) ) return new ConfigItemSetImport( m_aChildSettings ); - if ( sLocalName.equalsAscii( "config-item" ) ) + if ( sLocalName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "config-item" ) ) ) return new ConfigItemImport( m_aChildSettings ); #if OSL_DEBUG_LEVEL > 0 ::rtl::OString sMessage( "unknown element name '" ); sMessage += ::rtl::OUStringToOString( i_rElementName, RTL_TEXTENCODING_UTF8 ); sMessage += "', ignoring"; - OSL_ENSURE( false, sMessage.getStr() ); + OSL_FAIL( sMessage.getStr() ); #endif return new IgnoringSettingsImport; } diff --git a/dbaccess/source/core/recovery/subcomponentrecovery.cxx b/dbaccess/source/core/recovery/subcomponentrecovery.cxx index c579e014e657..3ec74ecbb93d 100644 --- a/dbaccess/source/core/recovery/subcomponentrecovery.cxx +++ b/dbaccess/source/core/recovery/subcomponentrecovery.cxx @@ -118,7 +118,7 @@ namespace dbaccess break; } - OSL_ENSURE( false, "lcl_getComponentStorageBaseName: unimplemented case!" ); + OSL_FAIL( "lcl_getComponentStorageBaseName: unimplemented case!" ); static const ::rtl::OUString s_sFallback; return s_sFallback; } @@ -335,13 +335,13 @@ namespace dbaccess if ( m_aStates.empty() ) { - if ( i_Name.equalsAscii( "office:settings" ) ) + if ( i_Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "office:settings" ) ) ) { pNewState = new OfficeSettingsImport( m_aSettings ); } else { - OSL_ENSURE( false, "SettingsDocumentHandler::startElement: invalid settings file!" ); + OSL_FAIL( "SettingsDocumentHandler::startElement: invalid settings file!" ); // Yes, that's not correct. Somebody could, in theory, give us a document which starts with "foo:settings", // where "foo" is mapped to the proper namespace URL. // However, there's no need to bother with this. The "recovery" sub storage we're recovering from is @@ -390,7 +390,7 @@ namespace dbaccess //-------------------------------------------------------------------- void SAL_CALL SettingsDocumentHandler::processingInstruction( const ::rtl::OUString& i_Target, const ::rtl::OUString& i_Data ) throw (SAXException, RuntimeException) { - OSL_ENSURE( false, "SettingsDocumentHandler::processingInstruction: unexpected ..." ); + OSL_FAIL( "SettingsDocumentHandler::processingInstruction: unexpected ..." ); (void)i_Target; (void)i_Data; } @@ -429,7 +429,7 @@ namespace dbaccess break; } - OSL_ENSURE( false, "SubComponentRecovery::getComponentsStorageName: unimplemented case!" ); + OSL_FAIL( "SubComponentRecovery::getComponentsStorageName: unimplemented case!" ); static const ::rtl::OUString s_sFallback; return s_sFallback; } @@ -466,7 +466,7 @@ namespace dbaccess default: // TODO - OSL_ENSURE( false, "SubComponentRecoverys::saveToRecoveryStorage: unimplemented case!" ); + OSL_FAIL( "SubComponentRecoverys::saveToRecoveryStorage: unimplemented case!" ); break; } @@ -496,17 +496,17 @@ namespace dbaccess switch ( m_eType ) { case TABLE: - m_aCompDesc.bForEditing = sModuleIdentifier.equalsAscii( "com.sun.star.sdb.TableDesign" ); + m_aCompDesc.bForEditing = sModuleIdentifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sdb.TableDesign" ) ); break; case QUERY: - m_aCompDesc.bForEditing = sModuleIdentifier.equalsAscii( "com.sun.star.sdb.QueryDesign" ); + m_aCompDesc.bForEditing = sModuleIdentifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sdb.QueryDesign" ) ); break; case REPORT: - if ( sModuleIdentifier.equalsAscii( "com.sun.star.report.ReportDefinition" ) ) + if ( sModuleIdentifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.report.ReportDefinition" ) ) ) { - // it's an SRB report desginer + // it's an SRB report designer m_aCompDesc.bForEditing = true; break; } @@ -517,14 +517,14 @@ namespace dbaccess break; default: - if ( sModuleIdentifier.equalsAscii( "com.sun.star.sdb.RelationDesign" ) ) + if ( sModuleIdentifier.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.sdb.RelationDesign" ) ) ) { m_eType = RELATION_DESIGN; m_aCompDesc.bForEditing = true; } else { - OSL_ENSURE( false, "SubComponentRecovery::impl_identifyComponent_throw: couldn't classify the given sub component!" ); + OSL_FAIL( "SubComponentRecovery::impl_identifyComponent_throw: couldn't classify the given sub component!" ); } break; } @@ -692,7 +692,7 @@ namespace dbaccess xSubComponent = impl_recoverQueryDesign_throw( i_rRecoveryStorage, i_rComponentName, i_bForEditing ); break; default: - OSL_ENSURE( false, "SubComponentRecovery::recoverFromStorage: unimplemented case!" ); + OSL_FAIL( "SubComponentRecovery::recoverFromStorage: unimplemented case!" ); break; } return xSubComponent; diff --git a/dbaccess/source/core/recovery/subcomponents.hxx b/dbaccess/source/core/recovery/subcomponents.hxx index 75dd161c09a9..28e751d0693c 100644 --- a/dbaccess/source/core/recovery/subcomponents.hxx +++ b/dbaccess/source/core/recovery/subcomponents.hxx @@ -35,7 +35,7 @@ #include <rtl/ustring.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <map> //........................................................................ @@ -78,7 +78,7 @@ namespace dbaccess }; // ------------------------------------------------------------------- - typedef ::std::hash_map< ::rtl::OUString, SubComponentDescriptor, ::rtl::OUStringHash > MapStringToCompDesc; + typedef ::boost::unordered_map< ::rtl::OUString, SubComponentDescriptor, ::rtl::OUStringHash > MapStringToCompDesc; typedef ::std::map< SubComponentType, MapStringToCompDesc > MapCompTypeToCompDescs; diff --git a/dbaccess/source/core/resource/makefile.mk b/dbaccess/source/core/resource/makefile.mk index 293b92b5e4cf..35a54c6cccdb 100644 --- a/dbaccess/source/core/resource/makefile.mk +++ b/dbaccess/source/core/resource/makefile.mk @@ -41,7 +41,10 @@ SRS1NAME=core_strings SRC1FILES= \ strings.src \ -SLOFILES= $(SLO)$/core_resource.obj \ +EXCEPTIONSFILES= \ + $(SLO)$/core_resource.obj + +SLOFILES= $(EXCEPTIONSFILES) # --- Targets ---------------------------------- diff --git a/dbaccess/source/core/resource/strings.src b/dbaccess/source/core/resource/strings.src index dc7023ca6fba..1a572c8a151f 100644 --- a/dbaccess/source/core/resource/strings.src +++ b/dbaccess/source/core/resource/strings.src @@ -32,6 +32,7 @@ String RID_STR_TRIED_OPEN_TABLE { Text [ en-US ] = "Tried to open the table $name$."; }; + String RID_STR_CONNECTION_INVALID { Text [ en-US ] = "No connection could be established."; @@ -47,7 +48,6 @@ String RID_STR_NEED_CONFIG_WRITE_ACCESS Text [ en-US ] = "You have no write access to the configuration data the object is based on."; }; - String RID_STR_COULDNOTCONNECT_UNSPECIFIED { Text [ en-US ] = "The connection to the external data source could not be established. An unknown error occurred. The driver is probably defective."; @@ -77,106 +77,132 @@ String RID_STR_DATASOURCE_NOT_STORED { Text [ en-US ] = "The data source was not saved. Please use the interface XStorable to save the data source."; }; + String RID_STR_ONLY_QUERY { Text [ en-US ] = "The given command is not a SELECT statement.\nOnly queries are allowed."; }; + String RID_STR_NO_VALUE_CHANGED { Text [ en-US ] = "No values were modified."; }; + String RID_STR_NO_XROWUPDATE { Text [ en-US ] = "Values could not be inserted. The XRowUpdate interface is not supported by ResultSet."; }; + String RID_STR_NO_XRESULTSETUPDATE { Text [ en-US ] = "Values could not be inserted. The XResultSetUpdate interface is not supported by ResultSet."; }; + String RID_STR_NO_UPDATE_MISSING_CONDITION { Text [ en-US ] = "Values could not be modified, due to a missing condition statement."; }; + String RID_STR_NO_COLUMN_ADD { Text [ en-US ] = "The adding of columns is not supported."; }; + String RID_STR_NO_COLUMN_DROP { Text [ en-US ] = "The dropping of columns is not supported."; }; + String RID_STR_NO_CONDITION_FOR_PK { Text [ en-US ] = "The WHERE condition could not be created for the primary key."; }; + String RID_STR_COLUMN_UNKNOWN_PROP { Text [ en-US ] = "The column does not support the property '%value'."; }; + String RID_STR_COLUMN_NOT_SEARCHABLE { Text [ en-US ] = "The column is not searchable!"; }; + String RID_STR_NOT_SEQUENCE_INT8 { Text [ en-US ] = "The value of the columns is not of the type Sequence<sal_Int8>."; }; + String RID_STR_COLUMN_NOT_VALID { Text [ en-US ] = "The column is not valid."; }; + String RID_STR_COLUMN_MUST_VISIBLE { Text [ en-US ] = "The column '%name' must be visible as a column."; }; + String RID_STR_NO_XQUERIESSUPPLIER { Text [ en-US ] = "The interface XQueriesSupplier is not available."; }; + String RID_STR_NOT_SUPPORTED_BY_DRIVER { Text [ en-US ] = "The driver does not support this function."; }; + String RID_STR_NO_ABS_ZERO { Text [ en-US ] = "An 'absolute(0)' call is not allowed."; }; + String RID_STR_NO_RELATIVE { Text [ en-US ] = "Relative positioning is not allowed in this state."; }; + String RID_STR_NO_REFESH_AFTERLAST { Text [ en-US ] = "A row cannot be refreshed when the ResultSet is positioned after the last row."; }; + String RID_STR_NO_MOVETOINSERTROW_CALLED { Text [ en-US ] = "A new row cannot be inserted when the ResultSet is not first moved to the insert row."; }; + String RID_STR_NO_UPDATEROW { Text [ en-US ] = "A row cannot be modified in this state"; }; + String RID_STR_NO_DELETEROW { Text [ en-US ] = "A row cannot be deleted in this state."; }; + String RID_STR_NO_TABLE_RENAME { Text [ en-US ] = "The driver does not support table renaming."; }; + String RID_STR_NO_ALTER_COLUMN_DEF { Text [ en-US ] = "The driver does not support the modification of column descriptions."; }; + String RID_STR_COLUMN_ALTER_BY_NAME { Text [ en-US ] = "The driver does not support the modification of column descriptions by changing the name."; }; + String RID_STR_COLUMN_ALTER_BY_INDEX { Text [ en-US ] = "The driver does not support the modification of column descriptions by changing the index."; }; + String RID_STR_FILE_DOES_NOT_EXIST { Text[ en-US ] = "The file \"$file$\" does not exist."; @@ -200,7 +226,6 @@ String RID_STR_CONFLICTING_NAMES String RID_STR_COMMAND_LEADING_TO_ERROR { Text [ en-US ] = "The SQL command leading to this error is:\n\n$command$"; - }; String RID_STR_STATEMENT_WITHOUT_RESULT_SET @@ -247,79 +272,99 @@ String RID_NO_SUCH_DATA_SOURCE { Text [ en-US ] = "Error accessing data source '$name$':\n$error$"; }; + String RID_STR_NO_SUB_FOLDER { Text [ en-US ] = "There exists no folder named \"$folder$\"."; }; + String RID_STR_NO_DELETE_BEFORE_AFTER { Text [ en-US ] = "Cannot delete the before-first or after-last row."; }; + String RID_STR_NO_DELETE_INSERT_ROW { Text [ en-US ] = "Cannot delete the insert-row."; }; + String RID_STR_RESULT_IS_READONLY { Text [ en-US ] = "Result set is read only."; }; + String RID_STR_NO_DELETE_PRIVILEGE { Text [ en-US ] = "DELETE privilege not available."; }; + String RID_STR_ROW_ALREADY_DELETED { Text [ en-US ] = "Current row is already deleted."; }; + String RID_STR_UPDATE_FAILED { - Text [ en-US ] = "Current row could be updated."; + Text [ en-US ] = "Current row could not be updated."; }; + //------------------------------------------------------------------------- + String RID_STR_NO_INSERT_PRIVILEGE { Text [ en-US ] = "INSERT privilege not available."; }; + String RID_STR_INTERNAL_ERROR { Text [ en-US ] = "Internal error: no statement object provided by the database driver."; }; + String RID_STR_EXPRESSION1 { Text [ en-US ] = "Expression1"; }; + String RID_STR_NO_SQL_COMMAND { Text [ en-US ] = "No SQL command was provided."; }; + String RID_STR_INVALID_INDEX { Text [ en-US ] = "Invalid column index."; }; + String RID_STR_INVALID_CURSOR_STATE { Text [ en-US ] = "Invalid cursor state."; }; + String RID_STR_CURSOR_BEFORE_OR_AFTER { Text [ en-US ] = "The cursor points to before the first or after the last row."; }; + String RID_STR_NO_BOOKMARK_BEFORE_OR_AFTER { Text [ en-US ] = "The rows before the first and after the last row don't have a bookmark."; }; + String RID_STR_NO_BOOKMARK_DELETED { Text [ en-US ] = "The current row is deleted, and thus doesn't have a bookmark."; }; + String RID_STR_NO_EMBEDDING { Text [ en-US ] = "Embedding of database documents is not supported."; }; + String RID_STR_CONNECTION_REQUEST { Text [ en-US ] = "A connection for the following URL was requested \"$name$\"."; }; + String RID_STR_MISSING_EXTENSION { Text [ en-US ] = "The extension is not installed."; diff --git a/dbaccess/source/ext/adabas/ANewDb.cxx b/dbaccess/source/ext/adabas/ANewDb.cxx index 3fc0d952cf40..38311fde9076 100644 --- a/dbaccess/source/ext/adabas/ANewDb.cxx +++ b/dbaccess/source/ext/adabas/ANewDb.cxx @@ -87,7 +87,7 @@ Reference< XInterface > SAL_CALL OAdabasCreateDialog::Create(const Reference< XM //------------------------------------------------------------------------- ::rtl::OUString OAdabasCreateDialog::getImplementationName_Static() throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.adabasui.AdabasCreateDialog"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.adabasui.AdabasCreateDialog")); } //------------------------------------------------------------------------- @@ -100,7 +100,7 @@ Reference< XInterface > SAL_CALL OAdabasCreateDialog::Create(const Reference< XM ::comphelper::StringSequence OAdabasCreateDialog::getSupportedServiceNames_Static() throw(RuntimeException) { ::comphelper::StringSequence aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.AdabasCreationDialog"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.AdabasCreationDialog")); return aSupported; } diff --git a/dbaccess/source/ext/adabas/Acomponentmodule.cxx b/dbaccess/source/ext/adabas/Acomponentmodule.cxx index cab3b7170bc2..6f153937fe2f 100644 --- a/dbaccess/source/ext/adabas/Acomponentmodule.cxx +++ b/dbaccess/source/ext/adabas/Acomponentmodule.cxx @@ -32,7 +32,7 @@ #include <tools/resmgr.hxx> #include <svl/solar.hrc> #include <comphelper/sequence.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #define ENTER_MOD_METHOD() \ ::osl::MutexGuard aGuard(s_aMutex); \ @@ -90,12 +90,12 @@ namespace COMPMOD_NAMESPACE // note that this method is not threadsafe, which counts for the whole class ! if (!m_pRessources && !m_bInitialized) { - DBG_ASSERT(m_sFilePrefix.Len(), "OModuleImpl::getResManager: no resource file prefix!"); + OSL_ENSURE(m_sFilePrefix.Len(), "OModuleImpl::getResManager: no resource file prefix!"); // create a manager with a fixed prefix ByteString aMgrName = m_sFilePrefix; m_pRessources = ResMgr::CreateResMgr(aMgrName.GetBuffer()); - DBG_ASSERT(m_pRessources, + OSL_ENSURE(m_pRessources, (ByteString("OModuleImpl::getResManager: could not create the resource manager (file name: ") += aMgrName += ByteString(")!")).GetBuffer()); @@ -205,7 +205,7 @@ namespace COMPMOD_NAMESPACE { if (!s_pImplementationNames) { - OSL_ASSERT("OModule::revokeComponent : have no class infos ! Are you sure called this method at the right time ?"); + OSL_FAIL("OModule::revokeComponent : have no class infos ! Are you sure called this method at the right time ?"); return; } OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, @@ -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_ASSERT("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::createFromAscii("/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_ASSERT("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) @@ -296,7 +248,7 @@ namespace COMPMOD_NAMESPACE if (!s_pImplementationNames) { - OSL_ASSERT("OModule::getComponentFactory : have no class infos ! Are you sure called this method at the right time ?"); + OSL_FAIL("OModule::getComponentFactory : have no class infos ! Are you sure called this method at the right time ?"); return NULL; } OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, diff --git a/dbaccess/source/ext/adabas/Acomponentmodule.hxx b/dbaccess/source/ext/adabas/Acomponentmodule.hxx index 8ac75326a56e..7625ca26e810 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 5ba64ae9c5c7..0438e4ae00dd 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.cxx +++ b/dbaccess/source/ext/adabas/AdabasNewDb.cxx @@ -107,7 +107,6 @@ namespace adabasui catch(Exception&) { OSL_ASSERT(0); - // showError(::dbtools::SQLExceptionInfo(e),this,); } } void SAL_CALL ODatabaseCreator::onTerminated() @@ -121,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 ) ) @@ -214,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); } @@ -342,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)); @@ -428,7 +427,7 @@ IMPL_LINK( OAdabasNewDbDlg, ImplOKHdl, OKButton*, /*EMPTYARG*/ ) } - BOOL bOk = FALSE; + sal_Bool bOk = sal_False; { // we need url @@ -452,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; @@ -503,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*/ ) @@ -690,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 9ab36e88060c..224c175ccd3f 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/AdabasNewDb.src b/dbaccess/source/ext/adabas/AdabasNewDb.src index 33915b06266b..9a3eebb3e9de 100644 --- a/dbaccess/source/ext/adabas/AdabasNewDb.src +++ b/dbaccess/source/ext/adabas/AdabasNewDb.src @@ -51,7 +51,8 @@ ModalDialog DLG_ADABAS_NEWDB Pos = MAP_APPFONT ( 12 , 6) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 10 ) ; Text[ en-US ] = "Database ~name"; -}; + }; + Edit ET_DATABASENAME { Border = TRUE ; @@ -66,26 +67,28 @@ ModalDialog DLG_ADABAS_NEWDB Pos = MAP_APPFONT ( 6 , 3 + MOVE_Y) ; Size = MAP_APPFONT ( WIN_X - 12 , 8 ) ; Text[ en-US ] = "User settings"; -}; + }; FixedText FT_CONUSR { Pos = MAP_APPFONT ( 12 , 31 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 10 ) ; Text[ en-US ] = "~Control user"; -}; + }; + FixedText FT_SYSUSR { Pos = MAP_APPFONT ( 12 , 14 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 10 ) ; Text[ en-US ] = "~Administrator"; -}; + }; + FixedText FT_DOMAIN_USR { Pos = MAP_APPFONT ( 12 , 48 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 10 ) ; Text[ en-US ] = "~Domain user"; -}; + }; Edit ET_SYSUSR { @@ -103,7 +106,7 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_SYSPWD ; Text[ en-US ] = "P~assword..."; -}; + }; Edit ET_CONUSR { @@ -121,7 +124,8 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_CONPWD ; Text[ en-US ] = "~Password..."; -}; + }; + Edit ET_DOMAIN_USR { Pos = MAP_APPFONT ( 77 + ADJUST_X, 47 + MOVE_Y) ; @@ -140,7 +144,7 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_DOMAINPWD ; Text[ en-US ] = "Passwo~rd..."; -}; + }; FixedImage BMP_CON { @@ -148,12 +152,14 @@ ModalDialog DLG_ADABAS_NEWDB Size = MAP_APPFONT ( 20 , 20 ) ; HelpID = HID_DLG_ADABAS_CON_PWD ; }; + FixedImage BMP_SYS { Pos = MAP_APPFONT ( 240 , 11 + MOVE_Y) ; Size = MAP_APPFONT ( 20 , 20 ) ; HelpID = HID_DLG_ADABAS_SYS_PWD ; }; + FixedImage BMP_DOMAIN { Pos = MAP_APPFONT ( 240 , 44 + MOVE_Y) ; @@ -166,7 +172,7 @@ ModalDialog DLG_ADABAS_NEWDB Pos = MAP_APPFONT ( 12 , 13 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 10 ) ; Text[ en-US ] = "~Backup file"; -}; + }; Edit ET_RESTORE { @@ -184,7 +190,7 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_PBRESTORE ; Text[ en-US ] = "..."; -}; + }; /* DEVSPACE positions */ FixedLine FL_DBSETTINGS @@ -192,28 +198,28 @@ ModalDialog DLG_ADABAS_NEWDB Pos = MAP_APPFONT ( 6 , 70 + MOVE_Y) ; Size = MAP_APPFONT ( WIN_X - 12 , 8 ) ; Text[ en-US ] = "Database settings"; -}; + }; FixedText FT_SYSDEVSPACE { Pos = MAP_APPFONT ( 12 , 83 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 8 ) ; Text[ en-US ] = "S~YSDEVSPACE"; -}; + }; FixedText FT_TRANSACTIONLOG { Pos = MAP_APPFONT ( 12 , 99 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 8 ) ; Text[ en-US ] = "TRANSACTI~ONLOG"; -}; + }; FixedText FT_DATADEVSPACE { Pos = MAP_APPFONT ( 12 , 116 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 8 ) ; Text[ en-US ] = "DATAD~EVSPACE"; -}; + }; Edit ET_SYSDEVSPACE { @@ -231,7 +237,7 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_PBSYSDEVSPACE ; Text[ en-US ] = "..."; -}; + }; Edit ET_TRANSACTIONLOG { @@ -249,7 +255,7 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_PBTRANSACTIONLOG ; Text[ en-US ] = "..."; -}; + }; Edit ET_DATADEVSPACE { @@ -260,7 +266,6 @@ ModalDialog DLG_ADABAS_NEWDB HelpID = HID_DLG_ADABAS_DATADEVSPACE ; }; - PushButton PB_DATADEVSPACE { Pos = MAP_APPFONT ( WIN_X - 24, 114 + MOVE_Y) ; @@ -268,14 +273,16 @@ ModalDialog DLG_ADABAS_NEWDB TabStop = TRUE ; HelpID = HID_DLG_ADABAS_PBDATADEVSPACE ; Text[ en-US ] = "..."; -}; + }; + /* DEVSPACE sizes */ FixedText FT_TRANSACTIONLOG_SIZE { Pos = MAP_APPFONT ( 12 , 133 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 8 ) ; Text[ en-US ] = "Transaction ~file (MB)"; -}; + }; + NumericField NF_TRANSACTIONLOG_SIZE { Pos = MAP_APPFONT ( 77 + ADJUST_X, 131 + MOVE_Y) ; @@ -283,15 +290,17 @@ ModalDialog DLG_ADABAS_NEWDB Border = TRUE ; TabStop = TRUE ; Spin = TRUE ; -StrictFormat = TRUE; + StrictFormat = TRUE; HelpID = HID_DLG_ADABAS_TRANSACTIONLOG_SIZE ; }; + FixedText FT_DATADEVSPACE_SIZE { Pos = MAP_APPFONT ( 12 , 150 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 8 ) ; Text[ en-US ] = "Data~base size (MB)"; -}; + }; + NumericField NF_DATADEVSPACE_SIZE { Pos = MAP_APPFONT ( 77 + ADJUST_X, 148 + MOVE_Y) ; @@ -299,15 +308,17 @@ StrictFormat = TRUE; Border = TRUE ; TabStop = TRUE ; Spin = TRUE ; -StrictFormat = TRUE; + StrictFormat = TRUE; HelpID = HID_DLG_ADABAS_DATADEVSPACE_SIZE ; }; + FixedText FT_CACHE_SIZE { Pos = MAP_APPFONT ( 12 , 167 + MOVE_Y) ; Size = MAP_APPFONT ( 64 + ADJUST_X, 8 ) ; Text[ en-US ] = "Data ~buffer size (MB)"; -}; + }; + NumericField NF_CACHE_SIZE { Pos = MAP_APPFONT ( 77 + ADJUST_X, 165 + MOVE_Y) ; @@ -315,14 +326,16 @@ StrictFormat = TRUE; Border = TRUE ; TabStop = TRUE ; Spin = TRUE ; -StrictFormat = TRUE; + StrictFormat = TRUE; HelpID = HID_DLG_ADABAS_CACHE_SIZE ; }; + FixedLine FL_END { Pos = MAP_APPFONT ( 0 , WIN_Y - 24 + MOVE_Y) ; Size = MAP_APPFONT ( WIN_X , 1 ) ; }; + OKButton PB_OK { Pos = MAP_APPFONT ( WIN_X - 112, WIN_Y - 20 + MOVE_Y) ; @@ -330,6 +343,7 @@ StrictFormat = TRUE; TabStop = TRUE ; DefButton = TRUE ; }; + CancelButton PB_CANCEL { Pos = MAP_APPFONT ( WIN_X - 56 , WIN_Y - 20+ MOVE_Y) ; @@ -340,26 +354,29 @@ StrictFormat = TRUE; String STR_BACKUPFILE_LOAD { Text[ en-US ] = "Backup file information"; -}; + }; Text[ en-US ] = "Create New Adabas D Database"; }; Image CHECK_GREEN { - ImageBitmap = Bitmap { File = "nu07.bmp"; }; + ImageBitmap = Bitmap { File = "nu07.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; + Image UNCHECK_RED { - ImageBitmap = Bitmap { File = "nu08.bmp"; }; + ImageBitmap = Bitmap { File = "nu08.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; + Image DEFAULT_BLUE { - ImageBitmap = Bitmap { File = "nu09.bmp"; }; + ImageBitmap = Bitmap { File = "nu09.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; + /* Fehlermeldungen beim Erstellen einer Adabas DB */ String STR_ADABAS_NO_PARAM_SET @@ -376,6 +393,7 @@ String STR_ADABAS_NO_SYSTEM_TABLES { Text[ en-US ] = "An error occurred as the system tables were being created."; }; + String STR_ADABAS_NO_BACKUP_FILE { Text[ en-US ] = "The backup file entered does not exist."; @@ -390,10 +408,12 @@ String STR_NO_SAME_USER { Text[ en-US ] = "The administrator and the control user cannot have the same name!"; }; + String STR_DEVSPACE_NO_FILE { Text[ en-US ] = "No name has been entered for the $name$ file!"; }; + String STR_NO_PERMISSION { Text[ en-US ] = "You have to have administrator rights to create a new database!"; @@ -423,11 +443,12 @@ String STR_ADABAS_CREATEPARAM_FILE { Text [ en-US ] = "Creating database configuration file." ; }; + String STR_ADABAS_START_DATABASE { Text [ en-US ] = "Starting database for the first time." ; - }; + String STR_ADABAS_DB_EXISTS { Text[ en-US ] = "The name entered already exists."; @@ -452,4 +473,3 @@ String STR_ADABAS_PASSWORD_ILLEGAL { Text[ en-US ] = "Spaces are not permitted in the password. Please enter a new password."; }; - diff --git a/dbaccess/source/ext/adabas/Aservices.cxx b/dbaccess/source/ext/adabas/Aservices.cxx index 62f7f87d183d..8ff5aef57489 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_ASSERT("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 000000000000..e547a0cffd4e --- /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 db9c0a52f288..926e49f5f1a5 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 9630d7e06768..f0e1c69934bc 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 e23310ac92f3..8dbbe7abc3ff 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 000000000000..a74e94510aeb --- /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_services.cxx b/dbaccess/source/ext/macromigration/dbmm_services.cxx index f1dd54aa312f..f691f181523d 100644 --- a/dbaccess/source/ext/macromigration/dbmm_services.cxx +++ b/dbaccess/source/ext/macromigration/dbmm_services.cxx @@ -41,15 +41,8 @@ namespace dbmm static void initializeModule() { - static bool bInitialized( false ); - if ( !bInitialized ) - { - ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); - if ( !bInitialized ) - { - createRegistryInfo_MacroMigrationDialogService(); - } - } + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + createRegistryInfo_MacroMigrationDialogService(); } //........................................................................ diff --git a/dbaccess/source/ext/macromigration/dbmm_types.cxx b/dbaccess/source/ext/macromigration/dbmm_types.cxx index ee0c32b7eef7..e85026ae5ec1 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 9742dcdfec71..5d1d9db39f8b 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 ); @@ -339,6 +347,7 @@ TabPage TP_SUMMARY { Text [ en-US ] = "The migration was successful. Below is a log of the actions which have been taken to your document."; }; + String STR_UNSUCCESSFUL { Text [ en-US ] = "The migration was not successful. Examine the migration log below for details."; @@ -443,10 +452,12 @@ String STR_INVALID_NUMBER_ARGS { Text [ en-US ] = "Invalid number of initialization arguments. Expected 1."; }; + 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 { Text [ en-US ] = "Not applicable to read-only documents."; diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index 4054f67189c0..c1c55fd6dad7 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(); } @@ -271,7 +271,7 @@ namespace dbmm break; default: - OSL_ENSURE( false, "MacroMigrationDialog::enterState: unhandled state!" ); + OSL_FAIL( "MacroMigrationDialog::enterState: unhandled state!" ); } } @@ -296,7 +296,7 @@ namespace dbmm case STATE_SUMMARY: break; default: - OSL_ENSURE( false, "MacroMigrationDialog::prepareLeaveCurrentState: unhandled state!" ); + OSL_FAIL( "MacroMigrationDialog::prepareLeaveCurrentState: unhandled state!" ); } return sal_True; @@ -535,7 +535,7 @@ namespace dbmm if ( !xController->suspend( sal_True ) ) { // ouch. There shouldn't be any modal dialogs and such, so there // really is no reason why suspending shouldn't work. - OSL_ENSURE( false, "MacroMigrationDialog::impl_reloadDocument_nothrow: could not suspend a controller!" ); + OSL_FAIL( "MacroMigrationDialog::impl_reloadDocument_nothrow: could not suspend a controller!" ); // ignoring this would be at the cost of a crash (potentially) // so, we cannot continue here. throw CloseVetoException(); diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.hxx b/dbaccess/source/ext/macromigration/macromigrationdialog.hxx index a4a6852909d0..9bda822366b2 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 41898091c26a..b71330f17ef5 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/migrationengine.cxx b/dbaccess/source/ext/macromigration/migrationengine.cxx index ec884adb3474..e85f60379514 100644 --- a/dbaccess/source/ext/macromigration/migrationengine.cxx +++ b/dbaccess/source/ext/macromigration/migrationengine.cxx @@ -215,7 +215,7 @@ namespace dbmm break; } - OSL_ENSURE( false, "lcl_getScriptsSubStorageName: illegal type!" ); + OSL_FAIL( "lcl_getScriptsSubStorageName: illegal type!" ); static ::rtl::OUString s_sEmpty; return s_sEmpty; } @@ -250,7 +250,7 @@ namespace dbmm return true; } } - OSL_ENSURE( false, "lcl_getScriptTypeFromLanguage: unknown language!" ); + OSL_FAIL( "lcl_getScriptTypeFromLanguage: unknown language!" ); return false; } @@ -333,7 +333,7 @@ namespace dbmm bool bCausedByNewStyleReport = ( _rDocument.eType == eReport ) && ( aError.isExtractableTo( ::cppu::UnoType< WrongFormatException >::get() ) ) - && ( lcl_getMimeType_nothrow( _rDocument.xCommandProcessor ).equalsAscii( "application/vnd.sun.xml.report" ) ); + && ( lcl_getMimeType_nothrow( _rDocument.xCommandProcessor ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.sun.xml.report" ) ) ); if ( bCausedByNewStyleReport ) { @@ -1020,7 +1020,7 @@ namespace dbmm { if ( m_aSubDocs.empty() ) { - OSL_ENSURE( false, "MigrationEngine_Impl::migrateAll: no forms/reports found!" ); + OSL_FAIL( "MigrationEngine_Impl::migrateAll: no forms/reports found!" ); // The whole migration wizard is not expected to be called when there are no forms/reports // with macros, not to mention when there are no forms/reports at all. return false; @@ -1163,7 +1163,7 @@ namespace dbmm aProgressMixer.registerPhase( PHASE_PYTHON, 1 ); aProgressMixer.registerPhase( PHASE_JAVA, 1 ); aProgressMixer.registerPhase( PHASE_BASIC, 5 ); - // more weight than then others, assuming that usually, there are much more Basic macros than any other scripts + // more weight than the others, assuming that usually, there are many more Basic macros than any other scripts aProgressMixer.registerPhase( PHASE_DIALOGS, 1 ); bool bSuccess = impl_checkScriptStorageStructure_nothrow( aSubDocument ); @@ -1223,7 +1223,7 @@ namespace dbmm const ::rtl::OUString& _rSourceLibName, const Reference< XNameAccess >& _rxTargetContainer ) { // The new library name is composed from the prefix, the base name, and the old library name. - const ::rtl::OUString sPrefix( ::rtl::OUString::createFromAscii( _rDocument.eType == eForm ? "Form_" : "Report_" ) ); + const ::rtl::OUString sPrefix = (_rDocument.eType == eForm)?rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Form_")): rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Report_")); ::rtl::OUString sBaseName( _rDocument.sHierarchicalName.copy( _rDocument.sHierarchicalName.lastIndexOf( '/' ) + 1 ) ); @@ -1232,8 +1232,8 @@ namespace dbmm // The bug requesting to change this is #i95409#. // Unfortunately, the storage implementation does not complain if you use invalid characters/names, but instead // it silently accepts them, and produces garbage in the file (#i95408). - // So, until especially the former is fixed, we need to strip the name from all invalid characters. - // #i95865# / 2008-11-06 / frank.schoenheit@sun.com + // So, until especially the former is fixed, we need to strip all invalid characters from the name. + // #i95865# // The general idea is to replace invalid characters with '_'. However, since "valid" essentially means // ASCII only, this implies that for a lot of languages, we would simply replace everything with '_', @@ -1639,7 +1639,7 @@ namespace dbmm || !_rScriptType.getLength() ) { - OSL_ENSURE( false, + OSL_FAIL( "MigrationEngine_Impl::impl_adjustScriptLibrary_nothrow: no or unknown script type!" ); m_rLogger.logRecoverable( MigrationError( ERR_UNKNOWN_SCRIPT_TYPE, @@ -1657,7 +1657,7 @@ namespace dbmm ScriptType eScriptType = eBasic; if ( !lcl_getScriptTypeFromLanguage( sScriptLanguage, eScriptType ) ) { - OSL_ENSURE( false, + OSL_FAIL( "MigrationEngine_Impl::impl_adjustScriptLibrary_nothrow: unknown script language!" ); m_rLogger.logRecoverable( MigrationError( ERR_UNKNOWN_SCRIPT_LANGUAGE, @@ -1668,7 +1668,7 @@ namespace dbmm ::rtl::OUString sLocation = xUri->getParameter( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "location" ) ) ); - if ( !sLocation.equalsAscii( "document" ) ) + if ( !sLocation.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "document" ) ) ) { // only document libraries must be migrated, of course return false; @@ -1678,7 +1678,7 @@ namespace dbmm sal_Int32 nLibModuleSeparator = sScriptName.indexOf( '.' ); if ( nLibModuleSeparator < 0 ) { - OSL_ENSURE( false, + OSL_FAIL( "MigrationEngine_Impl::impl_adjustScriptLibrary_nothrow: invalid/unknown location format!" ); m_rLogger.logRecoverable( MigrationError( ERR_UNKNOWN_SCRIPT_NAME_FORMAT, diff --git a/dbaccess/source/ext/macromigration/migrationlog.cxx b/dbaccess/source/ext/macromigration/migrationlog.cxx index d5b391532863..e2396be224e3 100644 --- a/dbaccess/source/ext/macromigration/migrationlog.cxx +++ b/dbaccess/source/ext/macromigration/migrationlog.cxx @@ -215,7 +215,7 @@ namespace dbmm DocumentLogs::const_iterator docPos = m_pData->aDocumentLogs.find( _nDocID ); if ( docPos == m_pData->aDocumentLogs.end() ) { - OSL_ENSURE( false, "MigrationLog::getNewLibraryName: document is not known!" ); + OSL_FAIL( "MigrationLog::getNewLibraryName: document is not known!" ); return s_sEmptyString; } @@ -231,7 +231,7 @@ namespace dbmm return lib->sNewName; } - OSL_ENSURE( false, "MigrationLog::getNewLibraryName: doc is known, but library isn't!" ); + OSL_FAIL( "MigrationLog::getNewLibraryName: doc is known, but library isn't!" ); return s_sEmptyString; } @@ -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 ) ) ); @@ -433,7 +433,7 @@ namespace dbmm DocumentLogs::const_iterator docPos = m_pData->aDocumentLogs.find( _nDocID ); if ( docPos == m_pData->aDocumentLogs.end() ) { - OSL_ENSURE( false, "MigrationLog::movedAnyLibrary: document is not known!" ); + OSL_FAIL( "MigrationLog::movedAnyLibrary: document is not known!" ); return false; } return !docPos->second.aMovedLibraries.empty(); diff --git a/dbaccess/source/ext/macromigration/progresscapture.cxx b/dbaccess/source/ext/macromigration/progresscapture.cxx index a151edee2a58..869983c14c02 100644 --- a/dbaccess/source/ext/macromigration/progresscapture.cxx +++ b/dbaccess/source/ext/macromigration/progresscapture.cxx @@ -128,7 +128,7 @@ namespace dbmm //-------------------------------------------------------------------- void SAL_CALL ProgressCapture::reset( ) throw (RuntimeException) { - OSL_ENSURE( false, "ProgressCapture::reset: not implemented!" ); + OSL_FAIL( "ProgressCapture::reset: not implemented!" ); } //........................................................................ diff --git a/dbaccess/source/ext/macromigration/rangeprogressbar.hxx b/dbaccess/source/ext/macromigration/rangeprogressbar.hxx index 6ecaabac6981..502dd86a4471 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 a6eb5b7b073b..000000000000 --- a/dbaccess/source/filter/migration/cfgimport.cxx +++ /dev/null @@ -1,1183 +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.equalsAscii("OldConfiguration") && (aValue.Value >>= aOldConfigValues) ) - { - const NamedValue* configValues = aOldConfigValues.getConstArray(); - const NamedValue* configValuesEnd = configValues + aOldConfigValues.getLength(); - for(;configValues != configValuesEnd;++configValues) - { - if ( configValues->Name.equalsAscii("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; // enth"alt den Funktionsnamen, nur wenn eFunctionType != FKT_NONE gesetzt - - 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::createFromAscii( "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.equalsAscii( "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.equalsAscii( "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.equalsAscii( "Script" ) ; ++events) - ; - if ( events != eventsEnd && (events->Value >>= sScript) ) - bReport = sScript.equalsAscii("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 them 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.equalsAscii("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.equalsAscii("org.openoffice.Office.DataAccess") ) - m_aStack.push(TElementStack::value_type(aName,0)); - else*/ - if ( aName.equalsAscii("DataSources") ) - m_aStack.push(TElementStack::value_type(aName,DATASOURCES)); - else if ( aName.equalsAscii("DataSourceSettings") ) - m_aStack.push(TElementStack::value_type(aName,DATASOURCESETTINGS)); - else if ( aName.equalsAscii("Tables") ) - m_aStack.push(TElementStack::value_type(aName,TABLES)); - else if ( aName.equalsAscii("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.equalsAscii("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.equalsAscii("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.equalsAscii("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::createFromAscii("com.sun.star.io.ObjectInputStream")),UNO_QUERY); - Reference< XInputStream> xMarkInStream = Reference< XInputStream >(m_xORB->createInstance(::rtl::OUString::createFromAscii("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 fcccadae42b0..000000000000 --- 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 a5c256488ebc..000000000000 --- 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 7bb53208d9d0..000000000000 --- a/dbaccess/source/filter/migration/makefile.mk +++ /dev/null @@ -1,74 +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) -# SHL1LIBS= $(SLB)$/$(TARGET).lib -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 000000000000..23b3a5c1a776 --- /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 715e58000ec2..11f0b667abd8 100644 --- a/dbaccess/source/filter/xml/dbloader2.cxx +++ b/dbaccess/source/filter/xml/dbloader2.cxx @@ -122,7 +122,7 @@ public: // static methods static ::rtl::OUString getImplementationName_Static() throw( ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbflt.DBTypeDetection"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbflt.DBTypeDetection")); } static Sequence< ::rtl::OUString> getSupportedServiceNames_Static(void) throw( ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > @@ -168,7 +168,7 @@ DBTypeDetection::DBTypeDetection(const Reference< XMultiServiceFactory >& _rxFac { ::rtl::OUString sMediaType; xStorageProperties->getPropertyValue( INFO_MEDIATYPE ) >>= sMediaType; - if ( sMediaType.equalsAscii(MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII) || sMediaType.equalsAscii(MIMETYPE_VND_SUN_XML_BASE_ASCII) ) + if ( sMediaType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII)) || sMediaType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(MIMETYPE_VND_SUN_XML_BASE_ASCII)) ) { if ( bStreamFromDescr && sURL.compareTo( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:stream" ) ), 14 ) != COMPARE_EQUAL ) { @@ -231,7 +231,7 @@ Sequence< ::rtl::OUString > SAL_CALL DBTypeDetection::getSupportedServiceNames(v Sequence< ::rtl::OUString > DBTypeDetection::getSupportedServiceNames_Static(void) throw( ) { Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExtendedTypeDetection"); + aSNS.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExtendedTypeDetection")); return aSNS; } // ------------------------------------------------------------------------- @@ -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: @@ -262,7 +262,7 @@ public: // static methods static ::rtl::OUString getImplementationName_Static() throw( ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbflt.DBContentLoader2"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbflt.DBContentLoader2")); } static Sequence< ::rtl::OUString> getSupportedServiceNames_Static(void) throw( ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > @@ -330,7 +330,7 @@ Sequence< ::rtl::OUString > SAL_CALL DBContentLoader::getSupportedServiceNames(v Sequence< ::rtl::OUString > DBContentLoader::getSupportedServiceNames_Static(void) throw( ) { Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.frame.FrameLoader"); + aSNS.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.FrameLoader")); return aSNS; } @@ -349,12 +349,12 @@ namespace URL aURL; aURL.Complete = _rURL; xTransformer->parseStrict( aURL ); - bDoesAllow = aURL.Arguments.equalsAscii( "Interactive" ); + bDoesAllow = aURL.Arguments.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Interactive" ) ); } } catch( const Exception& ) { - OSL_ENSURE( sal_False, "lcl_urlAllowsInteraction: caught an exception while analyzing the URL!" ); + OSL_FAIL( "lcl_urlAllowsInteraction: caught an exception while analyzing the URL!" ); } return bDoesAllow; } @@ -626,7 +626,7 @@ IMPL_LINK( DBContentLoader, OnStartTableWizard, void*, /*NOTINTERESTEDIN*/ ) } catch(const Exception&) { - OSL_ENSURE(sal_False, "caught an exception while starting the table wizard!"); + OSL_FAIL("caught an exception while starting the table wizard!"); } m_xMySelf = NULL; return 0L; @@ -643,17 +643,17 @@ extern "C" void SAL_CALL writeDBLoaderInfo2(void* pRegistryKey) Reference< XRegistryKey> xKey(reinterpret_cast< XRegistryKey*>(pRegistryKey)); // register content loader for dispatch - ::rtl::OUString aImpl = ::rtl::OUString::createFromAscii("/"); + ::rtl::OUString aImpl(RTL_CONSTASCII_USTRINGPARAM("/")); aImpl += ::dbaxml::DBContentLoader::getImplementationName_Static(); ::rtl::OUString aImpltwo = aImpl; - aImpltwo += ::rtl::OUString::createFromAscii("/UNO/Loader"); + aImpltwo += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/Loader")); Reference< XRegistryKey> xNewKey = xKey->createKey( aImpltwo ); aImpltwo = aImpl; - aImpltwo += ::rtl::OUString::createFromAscii("/Loader"); + aImpltwo += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/Loader")); Reference< XRegistryKey > xLoaderKey = xKey->createKey( aImpltwo ); - xNewKey = xLoaderKey->createKey( ::rtl::OUString::createFromAscii("Pattern") ); - xNewKey->setAsciiValue( ::rtl::OUString::createFromAscii("private:factory/sdatabase") ); + xNewKey = xLoaderKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pattern")) ); + xNewKey->setAsciiValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:factory/sdatabase")) ); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/filter/xml/makefile.mk b/dbaccess/source/filter/xml/makefile.mk index 6c6091c5f69e..33ff074b8012 100644 --- a/dbaccess/source/filter/xml/makefile.mk +++ b/dbaccess/source/filter/xml/makefile.mk @@ -103,7 +103,6 @@ SHL1STDLIBS+= \ SHL1DEPN= SHL1LIBS=$(LIB1TARGET) SHL1IMPLIB= i$(SHL1TARGET) -# SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1VERSIONMAP=$(SOLARENV)/src/component.map SHL1DEF= $(MISC)$/$(SHL1TARGET).def @@ -112,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/xmlColumn.cxx b/dbaccess/source/filter/xml/xmlColumn.cxx index ba826ebdc721..47b9126acdd5 100644 --- a/dbaccess/source/filter/xml/xmlColumn.cxx +++ b/dbaccess/source/filter/xml/xmlColumn.cxx @@ -92,7 +92,7 @@ OXMLColumn::OXMLColumn( ODBFilter& rImport m_sHelpMessage = sValue; break; case XML_TOK_COLUMN_VISIBILITY: - m_bHidden = !sValue.equalsAscii("visible"); + m_bHidden = !sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("visible")); break; case XML_TOK_COLUMN_TYPE_NAME: sType = sValue; @@ -101,10 +101,9 @@ OXMLColumn::OXMLColumn( ODBFilter& rImport case XML_TOK_COLUMN_DEFAULT_VALUE: if ( sValue.getLength() && sType.getLength() ) m_aDefaultValue <<= sValue; - // SvXMLUnitConverter::convertAny(m_aDefaultValue,sType,sValue); break; case XML_TOK_COLUMN_VISIBLE: - m_bHidden = sValue.equalsAscii("false"); + m_bHidden = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("false")); break; case XML_TOK_DEFAULT_CELL_STYLE_NAME: m_sCellStyleName = sValue; @@ -152,7 +151,7 @@ void OXMLColumn::EndElement() pAutoStyle->FillPropertySet(xProp); } } - } // if ( m_sStyleName.getLength() ) + } if ( m_sCellStyleName.getLength() ) { const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles(); @@ -169,7 +168,7 @@ void OXMLColumn::EndElement() } } - } // if ( xFac.is() && m_sName.getLength() ) + } else if ( m_sCellStyleName.getLength() ) { const SvXMLStylesContext* pAutoStyles = GetOwnImport().GetAutoStyles(); diff --git a/dbaccess/source/filter/xml/xmlConnectionData.cxx b/dbaccess/source/filter/xml/xmlConnectionData.cxx index 25ec65a48c7b..3695f24c6590 100644 --- a/dbaccess/source/filter/xml/xmlConnectionData.cxx +++ b/dbaccess/source/filter/xml/xmlConnectionData.cxx @@ -99,7 +99,7 @@ SvXMLImportContext* OXMLConnectionData::CreateChildContext( if ( !m_bFoundOne ) { m_bFoundOne = true; - OSL_ENSURE(0,"Not supported yet!"); + OSL_FAIL("Not supported yet!"); } break; } diff --git a/dbaccess/source/filter/xml/xmlDataSource.cxx b/dbaccess/source/filter/xml/xmlDataSource.cxx index b2e87883a62b..b13ec0b730e7 100644 --- a/dbaccess/source/filter/xml/xmlDataSource.cxx +++ b/dbaccess/source/filter/xml/xmlDataSource.cxx @@ -146,13 +146,13 @@ OXMLDataSource::OXMLDataSource( ODBFilter& rImport, break; case XML_TOK_BOOLEAN_COMPARISON_MODE: aProperty.Name = PROPERTY_BOOLEANCOMPARISONMODE; - if ( sValue.equalsAscii("equal-integer") ) + if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("equal-integer")) ) aProperty.Value <<= sal_Int32(0); - else if ( sValue.equalsAscii("is-boolean") ) + else if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("is-boolean")) ) aProperty.Value <<= sal_Int32(1); - else if ( sValue.equalsAscii("equal-boolean") ) + else if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("equal-boolean")) ) aProperty.Value <<= sal_Int32(2); - else if ( sValue.equalsAscii("equal-use-only-zero") ) + else if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("equal-use-only-zero")) ) aProperty.Value <<= sal_Int32(3); break; case XML_TOK_USE_CATALOG: diff --git a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx index 5aac0f307824..ad1b238ee836 100644 --- a/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx +++ b/dbaccess/source/filter/xml/xmlDataSourceInfo.cxx @@ -131,7 +131,7 @@ OXMLDataSourceInfo::OXMLDataSourceInfo( ODBFilter& rImport aProperty.Name = INFO_THOUSANDSDELIMITER; aProperty.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); rImport.addInfo(aProperty); - } // if ( !bFoundThousand ) + } } if ( XML_TOK_FONT_CHARSET == _nToken && !bFoundCharset ) { diff --git a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx index 8e5f2652244f..c004e7b62534 100644 --- a/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx +++ b/dbaccess/source/filter/xml/xmlDataSourceSetting.cxx @@ -73,7 +73,7 @@ OXMLDataSourceSetting::OXMLDataSourceSetting( ODBFilter& rImport switch( rTokenMap.Get( nPrefix, sLocalName ) ) { case XML_TOK_DATA_SOURCE_SETTING_IS_LIST: - m_bIsList = sValue.equalsAscii("true"); + m_bIsList = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("true")); break; case XML_TOK_DATA_SOURCE_SETTING_TYPE: { @@ -220,7 +220,7 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx } case TypeClass_HYPER: { - OSL_ENSURE(sal_False, "OXMLDataSourceSetting::convertString: 64-bit integers not implemented yet!"); + OSL_FAIL("OXMLDataSourceSetting::convertString: 64-bit integers not implemented yet!"); } break; case TypeClass_DOUBLE: @@ -241,7 +241,7 @@ Any OXMLDataSourceSetting::convertString(const ::com::sun::star::uno::Type& _rEx aReturn <<= _rReadCharacters; break; default: - OSL_ENSURE(sal_False, "OXMLDataSourceSetting::convertString: invalid type class!"); + OSL_FAIL("OXMLDataSourceSetting::convertString: invalid type class!"); } return aReturn; diff --git a/dbaccess/source/filter/xml/xmlDocuments.cxx b/dbaccess/source/filter/xml/xmlDocuments.cxx index 99e981a581d7..259425f2aff0 100644 --- a/dbaccess/source/filter/xml/xmlDocuments.cxx +++ b/dbaccess/source/filter/xml/xmlDocuments.cxx @@ -105,7 +105,6 @@ SvXMLImportContext* OXMLDocuments::CreateChildContext( GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); pContext = new OXMLComponent( GetOwnImport(), nPrefix, rLocalName,xAttrList,m_xContainer,m_sComponentServiceName ); break; - // case XML_TOK_QUERY_COLLECTION: case XML_TOK_COMPONENT_COLLECTION: GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); pContext = new OXMLHierarchyCollection( GetOwnImport(), nPrefix, rLocalName,xAttrList,m_xContainer,m_sCollectionServiceName,m_sComponentServiceName ); diff --git a/dbaccess/source/filter/xml/xmlExport.cxx b/dbaccess/source/filter/xml/xmlExport.cxx index 40e2341cdecc..6ca38bb37f89 100644 --- a/dbaccess/source/filter/xml/xmlExport.cxx +++ b/dbaccess/source/filter/xml/xmlExport.cxx @@ -118,13 +118,13 @@ namespace dbaxml //--------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODBExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.sdb.XMLSettingsExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdb.XMLSettingsExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL ODBExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } @@ -137,13 +137,13 @@ namespace dbaxml //--------------------------------------------------------------------- ::rtl::OUString SAL_CALL ODBFullExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.sdb.XMLFullExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sdb.XMLFullExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > SAL_CALL ODBFullExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } @@ -179,7 +179,7 @@ namespace dbaxml return s_sTypeInteger; default: - OSL_ENSURE( false, "lcl_implGetPropertyXMLType: unsupported value type!" ); + OSL_FAIL( "lcl_implGetPropertyXMLType: unsupported value type!" ); return s_sTypeDouble; } } @@ -241,36 +241,32 @@ ODBExport::ODBExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt16 m_xExportHelper = new SvXMLExportPropertyMapper(GetTableStylesPropertySetMapper()); m_xColumnExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetColumnStylesPropertySetMapper()); - //UniReference < XMLPropertySetMapper > xCellStylesPropertySetMapper = new XMLPropertySetMapper(OXMLHelper::GetCellStylesPropertySetMapper(),m_xPropHdlFactory); - //m_xCellExportHelper = new OSpecialHanldeXMLExportPropertyMapper(xCellStylesPropertySetMapper); - //m_xCellExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetCellStylesPropertySetMapper()); - //m_xCellExportHelper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); m_xCellExportHelper = new OSpecialHanldeXMLExportPropertyMapper(GetCellStylesPropertySetMapper()); m_xRowExportHelper = new OSpecialHanldeXMLExportPropertyMapper(OXMLHelper::GetRowStylesPropertySetMapper()); GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TABLE_TABLE, - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME )), m_xExportHelper.get(), - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX )); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX ))); GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TABLE_COLUMN, - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME )), m_xColumnExportHelper.get(), - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX )); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX ))); GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TABLE_CELL, - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME )), m_xCellExportHelper.get(), - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX )); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX ))); GetAutoStylePool()->AddFamily( XML_STYLE_FAMILY_TABLE_ROW, - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME ), + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME )), m_xRowExportHelper.get(), - rtl::OUString::createFromAscii( XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX )); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX ))); } // ----------------------------------------------------------------------------- IMPLEMENT_SERVICE_INFO1_STATIC( ODBExport, "com.sun.star.comp.sdb.DBExportFilter", "com.sun.star.document.ExportFilter") @@ -408,15 +404,15 @@ void ODBExport::exportDataSource() { sal_Int32 nValue = 0; aValue >>= nValue; - if ( sValue.equalsAscii("0") ) + if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("0")) ) sValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("equal-integer")); - else if ( sValue.equalsAscii("1") ) + else if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("1")) ) sValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("is-boolean")); - else if ( sValue.equalsAscii("2") ) + else if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("2")) ) sValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("equal-boolean")); - else if ( sValue.equalsAscii("3") ) + else if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("3")) ) sValue = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("equal-use-only-zero")); - if ( sValue.equalsAscii("equal-integer") ) + if ( sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("equal-integer")) ) continue; eToken = XML_BOOLEAN_COMPARISON_MODE; } @@ -574,7 +570,7 @@ void ODBExport::exportConnectionData() sURL.append(sal_Unicode('/')); AddAttribute(XML_NAMESPACE_XLINK,XML_HREF,GetRelativeReference(sURL.makeStringAndClear())); - } // if ( sOrigUrl == sFileName ) + } else AddAttribute(XML_NAMESPACE_XLINK,XML_HREF,sOrigUrl); AddAttribute(XML_NAMESPACE_DB,XML_MEDIA_TYPE,m_aTypeCollection.getMediaType(sValue)); @@ -595,7 +591,6 @@ void ODBExport::exportConnectionData() } catch(const Exception&) { - // nii } SvXMLElementExport aFileBasedDB(*this,XML_NAMESPACE_DB, XML_FILE_BASED_DATABASE, sal_True, sal_True); } @@ -744,7 +739,7 @@ void ODBExport::exportDataSourceSettings() pSequenceIterator.reset( new OSequenceIterator< Any >( aIter->Value ) ); break; default: - OSL_ENSURE(sal_False, "unsupported sequence type !"); + OSL_FAIL("unsupported sequence type !"); break; } if ( pSequenceIterator.get() ) @@ -1234,9 +1229,9 @@ void ODBExport::exportAutoStyle(XPropertySet* _xProp) } } ++aItr; - } // while ( aItr != aEnd ) + } - } // if ( !aPropStates.empty() ) + } if ( XML_STYLE_FAMILY_TABLE_CELL == pExportHelper[i].second.second ) ::std::copy( m_aCurrentPropertyStates.begin(), m_aCurrentPropertyStates.end(), ::std::back_inserter( aPropStates )); if ( !aPropStates.empty() ) @@ -1289,7 +1284,7 @@ void ODBExport::_ExportAutoStyles() } } // ----------------------------------------------------------------------------- -void ODBExport::_ExportStyles(BOOL bUsed) +void ODBExport::_ExportStyles(sal_Bool bUsed) { SvXMLExport::_ExportStyles(bUsed); } @@ -1330,7 +1325,7 @@ void ODBExport::GetViewSettings(Sequence<PropertyValue>& aProps) } catch(Exception) { - OSL_ENSURE(0,"ODBExport::GetViewSettings: Exception catched!"); + OSL_FAIL("ODBExport::GetViewSettings: Exception catched!"); } } } @@ -1357,7 +1352,7 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps) } catch(Exception) { - OSL_ENSURE(0,"Could not access layout information from the data source!"); + OSL_FAIL("Could not access layout information from the data source!"); } } } @@ -1388,7 +1383,7 @@ void ODBExport::GetConfigurationSettings(Sequence<PropertyValue>& aProps) GetMM100UnitConverter().convertNumber(aBuffer, getINT32(_rValue)); break; default: - OSL_ENSURE(0,"ODBExport::implConvertAny: Invalid type"); + OSL_FAIL("ODBExport::implConvertAny: Invalid type"); } return aBuffer.makeStringAndClear(); diff --git a/dbaccess/source/filter/xml/xmlExport.hxx b/dbaccess/source/filter/xml/xmlExport.hxx index 7e957cf554a0..8dc662f85705 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/xmlHelper.cxx b/dbaccess/source/filter/xml/xmlHelper.cxx index 99807b88a5b6..4854bdce71fd 100644 --- a/dbaccess/source/filter/xml/xmlHelper.cxx +++ b/dbaccess/source/filter/xml/xmlHelper.cxx @@ -91,34 +91,6 @@ UniReference < XMLPropertySetMapper > OXMLHelper::GetTableStylesPropertySetMappe { static const XMLPropertyMapEntry s_aTableStylesProperties[] = { - //MAP_CONST( PROPERTY_FONTNAME, XML_NAMESPACE_STYLE, XML_FONT_NAME, XML_TYPE_STRING, 0 ), - //MAP_CONST( PROPERTY_TEXTCOLOR, XML_NAMESPACE_FO, XML_COLOR, XML_TYPE_COLOR, 0 ), - //MAP_CONST( PROPERTY_TEXTLINECOLOR, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, 0 ), - - //MAP_CONST( PROPERTY_TEXTRELIEF, XML_NAMESPACE_STYLE, XML_FONT_RELIEF, XML_TYPE_TEXT_FONT_RELIEF|MID_FLAG_MULTI_PROPERTY, 0 ), - //MAP_CONST( PROPERTY_TEXTEMPHASIS, XML_NAMESPACE_STYLE, XML_TEXT_EMPHASIZE, XML_TYPE_CONTROL_TEXT_EMPHASIZE, 0 ), - //MAP_CONST( PROPERTY_FONTCHARWIDTH, XML_NAMESPACE_STYLE, XML_FONT_CHAR_WIDTH, XML_TYPE_NUMBER16, 0 ), - //MAP_CONST( PROPERTY_FONTCHARSET, XML_NAMESPACE_STYLE, XML_FONT_CHARSET, XML_TYPE_TEXT_FONTENCODING, 0 ), - //MAP_CONST( PROPERTY_FONTFAMILY, XML_NAMESPACE_STYLE, XML_FONT_FAMILY_GENERIC, XML_TYPE_TEXT_FONTFAMILY, 0 ), - //MAP_CONST( PROPERTY_FONTHEIGHT, XML_NAMESPACE_FO, XML_FONT_SIZE, XML_TYPE_MEASURE16, 0 ), - //MAP_CONST( PROPERTY_FONTKERNING, XML_NAMESPACE_STYLE, XML_LETTER_KERNING, XML_TYPE_BOOL, 0 ), - // - //MAP_CONST( PROPERTY_FONTORIENTATION, XML_NAMESPACE_STYLE, XML_ROTATION_ANGLE, XML_TYPE_ROTATION_ANGLE, 0 ), - //MAP_CONST( PROPERTY_FONTPITCH, XML_NAMESPACE_STYLE, XML_FONT_PITCH, XML_TYPE_TEXT_FONTPITCH, 0 ), - //MAP_CONST( PROPERTY_FONTSLANT, XML_NAMESPACE_FO, XML_FONT_STYLE, XML_TYPE_TEXT_POSTURE, 0 ), - //MAP_CONST_ASCII( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_STYLE, XML_TYPE_TEXT_CROSSEDOUT_STYLE|MID_FLAG_MERGE_PROPERTY, 0), - //MAP_CONST_ASCII( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_TYPE, XML_TYPE_TEXT_CROSSEDOUT_TYPE|MID_FLAG_MERGE_PROPERTY, 0), - //MAP_CONST_ASCII( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_WIDTH, XML_TYPE_TEXT_CROSSEDOUT_WIDTH|MID_FLAG_MERGE_PROPERTY, 0), - //MAP_CONST_ASCII( "CharStrikeout", XML_NAMESPACE_STYLE, XML_TEXT_LINE_THROUGH_TEXT, XML_TYPE_TEXT_CROSSEDOUT_TEXT|MID_FLAG_MERGE_PROPERTY, 0), - //MAP_CONST( PROPERTY_FONTSTYLENAME, XML_NAMESPACE_STYLE, XML_FONT_STYLE_NAME, XML_TYPE_STRING, 0 ), - //MAP_CONST_ASCII( "CharUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_STYLE, XML_TYPE_TEXT_UNDERLINE_STYLE|MID_FLAG_MERGE_PROPERTY, 0 ), - //MAP_CONST_ASCII( "CharUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_TYPE, XML_TYPE_TEXT_UNDERLINE_TYPE|MID_FLAG_MERGE_PROPERTY, 0 ), - //MAP_CONST_ASCII( "CharUnderline", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_WIDTH, XML_TYPE_TEXT_UNDERLINE_WIDTH|MID_FLAG_MERGE_PROPERTY, 0 ), - //MAP_CONST_ASCII( "CharUnderlineColor", XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_COLOR|MID_FLAG_MULTI_PROPERTY, 0 ), - //MAP_CONST_ASCII( "CharUnderlineHasColor",XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_COLOR, XML_TYPE_TEXT_UNDERLINE_HASCOLOR|MID_FLAG_MERGE_ATTRIBUTE, 0 ), - //MAP_CONST( PROPERTY_FONTWEIGHT, XML_NAMESPACE_FO, XML_FONT_WEIGHT, XML_TYPE_TEXT_WEIGHT, 0 ), - //MAP_CONST( PROPERTY_FONTWIDTH, XML_NAMESPACE_STYLE, XML_FONT_WIDTH, XML_TYPE_FONT_WIDTH, 0 ), - //MAP_CONST( PROPERTY_FONTWORDLINEMODE, XML_NAMESPACE_STYLE, XML_TEXT_UNDERLINE_MODE, XML_TYPE_TEXT_LINE_MODE, 0 ), MAP_END() }; UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); diff --git a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx index d132f7666151..4b3639d1300f 100644 --- a/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx +++ b/dbaccess/source/filter/xml/xmlHierarchyCollection.cxx @@ -109,7 +109,7 @@ OXMLHierarchyCollection::OXMLHierarchyCollection( ODBFilter& rImport } catch(Exception&) { - OSL_ENSURE(0,"OXMLHierarchyCollection::OXMLHierarchyCollection -> exception catched"); + OSL_FAIL("OXMLHierarchyCollection::OXMLHierarchyCollection -> exception catched"); } } } @@ -144,9 +144,6 @@ SvXMLImportContext* OXMLHierarchyCollection::CreateChildContext( switch( rTokenMap.Get( nPrefix, rLocalName ) ) { -// case XML_TOK_QUERY: -// pContext = new OXMLQuery( GetOwnImport(), nPrefix, rLocalName,xAttrList,m_xContainer ); -// break; case XML_TOK_COMPONENT: GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); pContext = new OXMLComponent( GetOwnImport(), nPrefix, rLocalName,xAttrList,m_xContainer,m_sComponentServiceName ); @@ -155,7 +152,6 @@ SvXMLImportContext* OXMLHierarchyCollection::CreateChildContext( GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); pContext = new OXMLColumn( GetOwnImport(), nPrefix, rLocalName,xAttrList,m_xContainer,m_xTable); break; - // case XML_TOK_QUERY_COLLECTION: case XML_TOK_COMPONENT_COLLECTION: GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP ); pContext = new OXMLHierarchyCollection( GetOwnImport(), nPrefix, rLocalName,xAttrList,m_xContainer,m_sCollectionServiceName,m_sComponentServiceName); diff --git a/dbaccess/source/filter/xml/xmlQuery.cxx b/dbaccess/source/filter/xml/xmlQuery.cxx index 6c35f416b5c2..dd083f616e33 100644 --- a/dbaccess/source/filter/xml/xmlQuery.cxx +++ b/dbaccess/source/filter/xml/xmlQuery.cxx @@ -78,7 +78,7 @@ OXMLQuery::OXMLQuery( ODBFilter& rImport m_sCommand = sValue; break; case XML_TOK_ESCAPE_PROCESSING: - m_bEscapeProcessing = sValue.equalsAscii("true"); + m_bEscapeProcessing = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("true")); break; } } @@ -145,7 +145,7 @@ void OXMLQuery::setProperties(Reference< XPropertySet > & _xProp ) } catch(Exception&) { - OSL_ENSURE(0,"OXMLTable::EndElement -> exception catched"); + OSL_FAIL("OXMLTable::EndElement -> exception catched"); } } //---------------------------------------------------------------------------- diff --git a/dbaccess/source/filter/xml/xmlStyleImport.cxx b/dbaccess/source/filter/xml/xmlStyleImport.cxx index 67ea8c5bc77e..2e1fb2db2bfc 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.cxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.cxx @@ -43,10 +43,9 @@ #include <comphelper/extract.hxx> #include <xmloff/xmlprcon.hxx> #include <xmloff/xmluconv.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "xmlfilter.hxx" #include "xmlHelper.hxx" -#include <tools/debug.hxx> #define XML_LINE_LEFT 0 @@ -121,7 +120,7 @@ void OTableStyleContext::FillPropertySet( pStyle = PTR_CAST(SvXMLNumFormatContext,pMyStyles-> FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True)); else { - DBG_ERROR("not possible to get style"); + OSL_FAIL("not possible to get style"); } } if ( pStyle ) @@ -129,7 +128,6 @@ void OTableStyleContext::FillPropertySet( uno::Any aNumberFormat; m_nNumberFormat = pStyle->GetKey(); aNumberFormat <<= m_nNumberFormat; - //rPropSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_NUMBERFORMAT)), aNumberFormat); AddProperty(CTF_DB_NUMBERFORMAT, aNumberFormat); } } @@ -147,7 +145,7 @@ void OTableStyleContext::SetDefaults() void OTableStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& rValue) { sal_Int32 nIndex(static_cast<OTableStylesContext *>(pStyles)->GetIndex(nContextID)); - DBG_ASSERT(nIndex != -1, "Property not found in Map"); + OSL_ENSURE(nIndex != -1, "Property not found in Map"); XMLPropertyState aPropState(nIndex, rValue); GetProperties().push_back(aPropState); // has to be insertes in a sort order later } diff --git a/dbaccess/source/filter/xml/xmlStyleImport.hxx b/dbaccess/source/filter/xml/xmlStyleImport.hxx index 16bea01cc12b..87c93c793c02 100644 --- a/dbaccess/source/filter/xml/xmlStyleImport.hxx +++ b/dbaccess/source/filter/xml/xmlStyleImport.hxx @@ -51,7 +51,6 @@ namespace dbaxml ::rtl::OUString sPageStyle; const rtl::OUString sNumberFormat; SvXMLStylesContext* pStyles; - // std::vector<ScXMLMapContent> aMaps; com::sun::star::uno::Any aConditionalFormat; sal_Int32 m_nNumberFormat; sal_Bool bConditionalFormatCreated : 1; diff --git a/dbaccess/source/filter/xml/xmlTable.cxx b/dbaccess/source/filter/xml/xmlTable.cxx index a64a3ac40360..21958d06a28e 100644 --- a/dbaccess/source/filter/xml/xmlTable.cxx +++ b/dbaccess/source/filter/xml/xmlTable.cxx @@ -93,10 +93,10 @@ OXMLTable::OXMLTable( ODBFilter& _rImport m_sStyleName = sValue; break; case XML_TOK_APPLY_FILTER: - m_bApplyFilter = sValue.equalsAscii("true"); + m_bApplyFilter = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("true")); break; case XML_TOK_APPLY_ORDER: - m_bApplyOrder = sValue.equalsAscii("true"); + m_bApplyOrder = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("true")); break; } } @@ -186,7 +186,7 @@ void OXMLTable::setProperties(uno::Reference< XPropertySet > & _xProp ) } catch(Exception&) { - OSL_ENSURE(0,"OXMLTable::EndElement -> exception catched"); + OSL_FAIL("OXMLTable::EndElement -> exception catched"); } } // ----------------------------------------------------------------------------- @@ -219,7 +219,7 @@ void OXMLTable::EndElement() } catch(Exception&) { - OSL_ENSURE(0,"OXMLQuery::EndElement -> exception catched"); + OSL_FAIL("OXMLQuery::EndElement -> exception catched"); } } diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index 25c48491af22..5814c969eb92 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -66,6 +66,7 @@ #include <unotools/moduleoptions.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/mimeconfighelper.hxx> #include <comphelper/documentconstants.hxx> @@ -124,8 +125,8 @@ namespace dbaxml (void)ex; OSL_ASSERT(0); } - } // if ( s_bFirstTime ) - } // if ( m_eWhat == E_JAVA ) + } + } else if ( m_eWhat == E_CALC ) { static bool s_bFirstTime = true; @@ -199,7 +200,7 @@ namespace dbaxml if ( m_aTypeCollection.needsJVM(sURL) ) { pCreatorThread = new FastLoader(m_xFactory,FastLoader::E_JAVA); - } // if ( m_aTypeCollection.needsJVM(sURL) ) + } else if ( sURL.matchIgnoreAsciiCaseAsciiL("sdbc:calc:",10,0) ) { pCreatorThread = new FastLoader(m_xFactory,FastLoader::E_CALC); @@ -217,8 +218,8 @@ namespace dbaxml } }; } - sal_Char __READONLY_DATA sXML_np__db[] = "_db"; - sal_Char __READONLY_DATA sXML_np___db[] = "__db"; + sal_Char const sXML_np__db[] = "_db"; + sal_Char const sXML_np___db[] = "__db"; using namespace ::com::sun::star::util; /// read a component (file + filter version) @@ -228,9 +229,9 @@ sal_Int32 ReadThroughComponent( const uno::Reference<XMultiServiceFactory> & rFactory, const uno::Reference< XDocumentHandler >& _xFilter ) { - DBG_ASSERT(xInputStream.is(), "input stream missing"); - DBG_ASSERT(xModelComponent.is(), "document missing"); - DBG_ASSERT(rFactory.is(), "factory missing"); + OSL_ENSURE(xInputStream.is(), "input stream missing"); + OSL_ENSURE(xModelComponent.is(), "document missing"); + OSL_ENSURE(rFactory.is(), "factory missing"); RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "dbaxml", "oj", "ReadThroughComponent" ); @@ -241,15 +242,15 @@ sal_Int32 ReadThroughComponent( // get parser uno::Reference< XParser > xParser( rFactory->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser") ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))), UNO_QUERY ); - DBG_ASSERT( xParser.is(), "Can't create parser" ); + OSL_ENSURE( xParser.is(), "Can't create parser" ); if( !xParser.is() ) return 1; RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter - DBG_ASSERT( _xFilter.is(), "Can't instantiate filter component." ); + OSL_ENSURE( _xFilter.is(), "Can't instantiate filter component." ); if( !_xFilter.is() ) return 1; @@ -276,7 +277,7 @@ sal_Int32 ReadThroughComponent( aError += ','; aError += ByteString::CreateFromInt32( r.ColumnNumber ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); return 1; } #else @@ -311,8 +312,8 @@ sal_Int32 ReadThroughComponent( const uno::Reference<XMultiServiceFactory> & rFactory, const uno::Reference< XDocumentHandler >& _xFilter) { - DBG_ASSERT( xStorage.is(), "Need storage!"); - DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!"); + OSL_ENSURE( xStorage.is(), "Need storage!"); + OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!"); if ( xStorage.is() ) { @@ -450,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 { @@ -607,7 +608,7 @@ const SvXMLTokenMap& ODBFilter::GetDocElemTokenMap() const { if ( !m_pDocElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_OFFICE, XML_SETTINGS, XML_TOK_DOC_SETTINGS }, { XML_NAMESPACE_OOO, XML_SETTINGS, XML_TOK_DOC_SETTINGS }, @@ -629,7 +630,7 @@ const SvXMLTokenMap& ODBFilter::GetDatabaseElemTokenMap() const { if ( !m_pDatabaseElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_DATASOURCE, XML_TOK_DATASOURCE }, { XML_NAMESPACE_DB, XML_FORMS, XML_TOK_FORMS}, @@ -649,7 +650,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceElemTokenMap() const { if ( !m_pDataSourceElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_CONNECTION_RESOURCE, XML_TOK_CONNECTION_RESOURCE}, { XML_NAMESPACE_DB, XML_SUPPRESS_VERSION_COLUMNS, XML_TOK_SUPPRESS_VERSION_COLUMNS}, @@ -700,7 +701,7 @@ const SvXMLTokenMap& ODBFilter::GetLoginElemTokenMap() const { if ( !m_pLoginElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_USER_NAME, XML_TOK_USER_NAME}, { XML_NAMESPACE_DB, XML_IS_PASSWORD_REQUIRED, XML_TOK_IS_PASSWORD_REQUIRED}, @@ -717,7 +718,7 @@ const SvXMLTokenMap& ODBFilter::GetDatabaseDescriptionElemTokenMap() const { if ( !m_pDatabaseDescriptionElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_FILE_BASED_DATABASE, XML_TOK_FILE_BASED_DATABASE}, { XML_NAMESPACE_DB, XML_SERVER_DATABASE, XML_TOK_SERVER_DATABASE}, @@ -732,7 +733,7 @@ const SvXMLTokenMap& ODBFilter::GetDataSourceInfoElemTokenMap() const { if ( !m_pDataSourceInfoElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_ADDITIONAL_COLUMN_STATEMENT,XML_TOK_ADDITIONAL_COLUMN_STATEMENT}, { XML_NAMESPACE_DB, XML_ROW_RETRIEVING_STATEMENT, XML_TOK_ROW_RETRIEVING_STATEMENT}, @@ -758,7 +759,7 @@ const SvXMLTokenMap& ODBFilter::GetDocumentsElemTokenMap() const { if ( !m_pDocumentsElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_COMPONENT, XML_TOK_COMPONENT}, { XML_NAMESPACE_DB, XML_COMPONENT_COLLECTION, XML_TOK_COMPONENT_COLLECTION}, @@ -778,7 +779,7 @@ const SvXMLTokenMap& ODBFilter::GetComponentElemTokenMap() const { if ( !m_pComponentElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_HREF }, { XML_NAMESPACE_XLINK, XML_TYPE, XML_TOK_TYPE }, @@ -797,7 +798,7 @@ const SvXMLTokenMap& ODBFilter::GetQueryElemTokenMap() const { if ( !m_pQueryElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_COMMAND, XML_TOK_COMMAND }, { XML_NAMESPACE_DB, XML_ESCAPE_PROCESSING, XML_TOK_ESCAPE_PROCESSING }, @@ -821,7 +822,7 @@ const SvXMLTokenMap& ODBFilter::GetColumnElemTokenMap() const { if ( !m_pColumnElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DB, XML_NAME, XML_TOK_COLUMN_NAME }, { XML_NAMESPACE_DB, XML_STYLE_NAME, XML_TOK_COLUMN_STYLE_NAME }, @@ -846,10 +847,8 @@ SvXMLImportContext* ODBFilter::CreateStylesContext(sal_uInt16 _nPrefix,const ::r { pContext = new OTableStylesContext(*this, _nPrefix, rLocalName, xAttrList, bIsAutoStyle); if (bIsAutoStyle) - //xAutoStyles = pContext; SetAutoStyles((SvXMLStylesContext*)pContext); else - //xStyles = pContext; SetStyles((SvXMLStylesContext*)pContext); } return pContext; diff --git a/dbaccess/source/filter/xml/xmlservices.cxx b/dbaccess/source/filter/xml/xmlservices.cxx index 95464c7d6896..a70c1d9c4981 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 e7edf6004423..000000000000 --- 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 82f46a60a96e..000000000000 --- 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/dsntypes.hxx b/dbaccess/source/inc/dsntypes.hxx index b781c1b77316..45b09601364c 100644 --- a/dbaccess/source/inc/dsntypes.hxx +++ b/dbaccess/source/inc/dsntypes.hxx @@ -122,7 +122,7 @@ protected: ::connectivity::DriversConfig m_aDriverConfig; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xFactory; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 sal_Int32 m_nLivingIterators; /// just for debugging reasons, counts the living iterators #endif diff --git a/dbaccess/source/inc/registrationhelper.hxx b/dbaccess/source/inc/registrationhelper.hxx index dd02ed5226a3..940fb7fe6fca 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/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index 0b64bca252ef..fc523aceb650 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -202,7 +202,7 @@ namespace sdbtools || ( _rName.indexOf( (sal_Unicode)96 ) >= 0 ) // || ( _rName.indexOf( (sal_Unicode)145 ) >= 0 ) // || ( _rName.indexOf( (sal_Unicode)146 ) >= 0 ) // - || ( _rName.indexOf( (sal_Unicode)180 ) >= 0 ) // #86621# removed unparsable chars + || ( _rName.indexOf( (sal_Unicode)180 ) >= 0 ) // removed unparsable chars ) return ErrorCondition::DB_QUERY_NAME_WITH_QUOTES; diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx index 4d6357a88d1b..47fb343a14ac 100644 --- a/dbaccess/source/sdbtools/connection/tablename.cxx +++ b/dbaccess/source/sdbtools/connection/tablename.cxx @@ -212,7 +212,7 @@ namespace sdbtools //-------------------------------------------------------------------- namespace { - /** translates a CopmositionType into a EComposeRule + /** translates a CompositionType into a EComposeRule @throws IllegalArgumentException if the given value does not denote a valid CompositionType */ diff --git a/dbaccess/source/sdbtools/misc/sdbt_services.cxx b/dbaccess/source/sdbtools/misc/sdbt_services.cxx index dcea32927e21..cc0847be8d60 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_ASSERT("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 e4565b27e9f3..000000000000 --- 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 a08cb3227a28..000000000000 --- 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 cbb3686c4a5c..7906623eb327 100644 --- a/dbaccess/source/shared/makefile.mk +++ b/dbaccess/source/shared/makefile.mk @@ -32,11 +32,8 @@ LIBTARGET=NO TARGET=shared LIB1TARGET=$(SLB)$/dbushared.lib LIB2TARGET=$(SLB)$/fltshared.lib -LIB3TARGET=$(SLB)$/cfgshared.lib LIB4TARGET=$(SLB)$/sdbtshared.lib -#ENABLE_EXCEPTIONS=TRUE - # --- Settings ---------------------------------- .INCLUDE : settings.mk @@ -46,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 @@ -63,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 56246cee507a..69a6879fa508 100644 --- a/dbaccess/source/shared/registrationhelper.cxx +++ b/dbaccess/source/shared/registrationhelper.cxx @@ -83,7 +83,7 @@ void OModuleRegistration::revokeComponent(const ::rtl::OUString& _rImplementatio { if (!s_pImplementationNames) { - OSL_ENSURE(sal_False, "OModuleRegistration::revokeComponent : have no class infos ! Are you sure called this method at the right time ?"); + OSL_FAIL("OModuleRegistration::revokeComponent : have no class infos ! Are you sure called this method at the right time ?"); return; } OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, @@ -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::createFromAscii("/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) @@ -174,7 +126,7 @@ uno::Reference< uno::XInterface > OModuleRegistration::getComponentFactory( if (!s_pImplementationNames) { - OSL_ENSURE(sal_False, "OModuleRegistration::getComponentFactory : have no class infos ! Are you sure called this method at the right time ?"); + OSL_FAIL("OModuleRegistration::getComponentFactory : have no class infos ! Are you sure called this method at the right time ?"); return NULL; } OSL_ENSURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 68d5aac5fa33..ee242ea29d33 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -78,8 +78,8 @@ #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> #include <com/sun/star/container/XHierarchicalName.hpp> /** === end UNO includes === **/ -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/string.hxx> #include <svl/urihelper.hxx> @@ -194,7 +194,7 @@ namespace DatabaseObjectContainer = ::com::sun::star::sdb::application::Database Sequence< ::rtl::OUString> OApplicationController::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.application.DefaultViewController"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.application.DefaultViewController")); return aSupported; } //------------------------------------------------------------------------- @@ -336,7 +336,7 @@ OApplicationController::~OApplicationController() { if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) { - OSL_ENSURE(0,"Please check who doesn't dispose this component!"); + OSL_FAIL("Please check who doesn't dispose this component!"); // increment ref count to prevent double call of Dtor osl_incrementInterlockedCount( &m_refCount ); dispose(); @@ -473,7 +473,7 @@ sal_Bool OApplicationController::Construct(Window* _pParent) } catch(Exception&) { - DBG_ERROR("OApplicationController::Construct : the construction of UnoDataBrowserView failed !"); + OSL_FAIL("OApplicationController::Construct : the construction of UnoDataBrowserView failed !"); } if ( !bSuccess ) @@ -483,10 +483,6 @@ sal_Bool OApplicationController::Construct(Window* _pParent) return sal_False; } - DBG_ASSERT( 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( ); @@ -508,7 +504,7 @@ void SAL_CALL OApplicationController::disposing(const EventObject& _rSource) thr Reference<XConnection> xCon(_rSource.Source, UNO_QUERY); if ( xCon.is() ) { - DBG_ASSERT( m_xDataSourceConnection == xCon, + OSL_ENSURE( m_xDataSourceConnection == xCon, "OApplicationController::disposing: which connection does this come from?" ); if ( getContainer() && getContainer()->getElementType() == E_TABLE ) @@ -1119,7 +1115,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa const PropertyValue* pEnd = pIter + aArgs.getLength(); for( ; pIter != pEnd ; ++pIter) { - if ( pIter->Name.equalsAscii("FormatStringId") ) + if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FormatStringId")) ) { SotFormatStringId nFormatId = 0; if ( pIter->Value >>= nFormatId ) @@ -1276,7 +1272,7 @@ void OApplicationController::Execute(sal_uInt16 _nId, const Sequence< PropertyVa case ID_NEW_TABLE_DESIGN: break; default: - OSL_ENSURE(0,"illegal switch call!"); + OSL_FAIL("illegal switch call!"); } if ( bAutoPilot ) getContainer()->PostUserEvent( LINK( this, OApplicationController, OnCreateWithPilot ), reinterpret_cast< void* >( eType ) ); @@ -1697,7 +1693,7 @@ namespace case E_NONE: break; default: - OSL_ENSURE(0,"Invalid ElementType!"); + OSL_FAIL("Invalid ElementType!"); break; } return sToolbar; @@ -1931,7 +1927,7 @@ Reference< XComponent > OApplicationController::openElementWithArguments( const break; default: - OSL_ENSURE( false, "OApplicationController::openElement: illegal object type!" ); + OSL_FAIL( "OApplicationController::openElement: illegal object type!" ); break; } return xRet; @@ -2039,7 +2035,7 @@ Reference< XComponent > OApplicationController::newElement( ElementType _eType, break; default: - OSL_ENSURE( false, "OApplicationController::newElement: illegal type!" ); + OSL_FAIL( "OApplicationController::newElement: illegal type!" ); break; } @@ -2278,7 +2274,7 @@ void OApplicationController::showPreviewFor(const ElementType _eType,const ::rtl return; default: - OSL_ENSURE( false, "OApplicationController::showPreviewFor: unexpected element type!" ); + OSL_FAIL( "OApplicationController::showPreviewFor: unexpected element type!" ); break; } } @@ -2340,7 +2336,7 @@ void OApplicationController::onDeleteEntry() nId = SID_DB_APP_REPORT_DELETE; break; default: - OSL_ENSURE(0,"Invalid ElementType!"); + OSL_FAIL("Invalid ElementType!"); break; } executeChecked(nId,Sequence<PropertyValue>()); @@ -2500,9 +2496,6 @@ sal_Int8 OApplicationController::queryDrop( const AcceptDropEvent& _rEvt, const nAction = DND_ACTION_NONE; } } - /*else - nAction = nActionAskedFor & DND_ACTION_COPYMOVE; - */ } return nAction; } @@ -2517,7 +2510,7 @@ sal_Int8 OApplicationController::executeDrop( const ExecuteDropEvent& _rEvt ) OApplicationView* pView = getContainer(); if ( !pView || pView->getElementType() == E_NONE ) { - DBG_ERROR("OApplicationController::executeDrop: what the hell did queryDrop do?"); + OSL_FAIL("OApplicationController::executeDrop: what the hell did queryDrop do?"); // queryDrop shoud not have allowed us to reach this situation .... return DND_ACTION_NONE; } @@ -2654,7 +2647,7 @@ IMPL_LINK( OApplicationController, OnFirstControllerConnected, void*, /**/ ) if ( !m_xModel.is() ) { - OSL_ENSURE( false, "OApplicationController::OnFirstControllerConnected: too late!" ); + OSL_FAIL( "OApplicationController::OnFirstControllerConnected: too late!" ); } // if we have forms or reports which contain macros/scripts, then show a warning @@ -2718,11 +2711,11 @@ sal_Bool SAL_CALL OApplicationController::attachModel(const Reference< XModel > Reference< XOfficeDatabaseDocument > xOfficeDoc( _rxModel, UNO_QUERY ); if ( !xOfficeDoc.is() && _rxModel.is() ) { - DBG_ERROR( "OApplicationController::attachModel: invalid model!" ); + OSL_FAIL( "OApplicationController::attachModel: invalid model!" ); return sal_False; } - DBG_ASSERT( !( m_xModel.is() && ( m_xModel != _rxModel ) ), + OSL_ENSURE( !( m_xModel.is() && ( m_xModel != _rxModel ) ), "OApplicationController::attachModel: missing implementation: setting a new model while we have another one!" ); // at least: remove as property change listener from the old model/data source @@ -2853,7 +2846,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer const NamedValue* pEnd = pIter + aCurrentSelection.getLength(); for(;pIter != pEnd;++pIter) { - if ( pIter->Name.equalsAscii("Type") ) + if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Type")) ) { sal_Int32 nType = 0; pIter->Value >>= nType; @@ -2861,7 +2854,7 @@ void SAL_CALL OApplicationController::removeSelectionChangeListener( const Refer throw IllegalArgumentException(); eType = static_cast< ElementType >( nType ); } - else if ( pIter->Name.equalsAscii("Selection") ) + else if ( pIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Selection")) ) pIter->Value >>= aSelection; } @@ -2977,7 +2970,7 @@ Any SAL_CALL OApplicationController::getSelection( ) throw (RuntimeException) case E_FORM: aCurrentSelection[0].Type = DatabaseObjectContainer::FORMS; break; case E_REPORT: aCurrentSelection[0].Type = DatabaseObjectContainer::REPORTS; break; default: - OSL_ENSURE( false, "OApplicationController::getSelection: unexpected current element type!" ); + OSL_FAIL( "OApplicationController::getSelection: unexpected current element type!" ); break; } } diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index fd484c686616..8067846c2c1e 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/AppControllerDnD.cxx b/dbaccess/source/ui/app/AppControllerDnD.cxx index b89f72956344..7e8f56972e0f 100644 --- a/dbaccess/source/ui/app/AppControllerDnD.cxx +++ b/dbaccess/source/ui/app/AppControllerDnD.cxx @@ -51,7 +51,6 @@ #include <com/sun/star/sdbcx/XViewsSupplier.hpp> #include <com/sun/star/sdb/XQueryDefinitionsSupplier.hpp> #include <com/sun/star/sdbcx/XDrop.hpp> -#include <tools/debug.hxx> #include <tools/urlobj.hxx> #include <unotools/ucbhelper.hxx> #include "dlgsave.hxx" @@ -91,6 +90,7 @@ #include <sfx2/docfilt.hxx> #include <svtools/fileview.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "defaultobjectnamecheck.hxx" #include <osl/mutex.hxx> #include "subcomponentmanager.hxx" @@ -173,7 +173,7 @@ void OApplicationController::deleteTables(const ::std::vector< ::rtl::OUString>& if(e.TargetException >>= aSql) aErrorInfo = aSql; else - OSL_ENSURE(sal_False, "OApplicationController::implDropTable: something strange happended!"); + OSL_FAIL("OApplicationController::implDropTable: something strange happended!"); } catch( const Exception& ) { @@ -211,7 +211,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec // The list of elements to delete is allowed to contain related elements: A given element may // be the ancestor or child of another element from the list. // We want to ensure that ancestors get deleted first, so we normalize the list in this respect. - // #i33353# - 2004-09-27 - fs@openoffice.org + // #i33353# ::std::set< ::rtl::OUString > aDeleteNames; // Note that this implicitly uses ::std::less< ::rtl::OUString > a comparison operation, which // results in lexicographical order, which is exactly what we need, because "foo" is *before* @@ -265,7 +265,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec // now that we removed the element, care for all it's child elements // which may also be a part of the list - // #i33353# - 2004-09-27 - fs@openoffice.org + // #i33353# OSL_ENSURE( aThisRound->getLength() - 1 >= 0, "OApplicationController::deleteObjects: empty name?" ); ::rtl::OUStringBuffer sSmallestSiblingName( *aThisRound ); sSmallestSiblingName.append( (sal_Unicode)( '/' + 1) ); @@ -294,7 +294,7 @@ void OApplicationController::deleteObjects( ElementType _eType, const ::std::vec if ( e.TargetException >>= aSql ) showError( SQLExceptionInfo( e.TargetException ) ); else - OSL_ENSURE( sal_False, "OApplicationController::deleteObjects: something strange happended!" ); + OSL_FAIL( "OApplicationController::deleteObjects: something strange happended!" ); } catch( const Exception& ) { @@ -568,7 +568,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc if ( CommandType::QUERY == nCommandType || CommandType::COMMAND == nCommandType ) { - // read all nescessary data + // read all necessary data ::rtl::OUString sCommand; sal_Bool bEscapeProcessing = sal_True; @@ -586,7 +586,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc bValidDescriptor = (0 != sCommand.getLength()); if (!bValidDescriptor) { - DBG_ERROR("OApplicationController::paste: invalid descriptor!"); + OSL_FAIL("OApplicationController::paste: invalid descriptor!"); return sal_False; } @@ -637,7 +637,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc if (!bSuccess) { - DBG_ERROR("OApplicationController::paste: could not extract the source query object!"); + OSL_FAIL("OApplicationController::paste: could not extract the source query object!"); // TODO: maybe this is worth an error message to be displayed to the user .... return sal_False; } @@ -648,7 +648,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc Reference< XSingleServiceFactory > xQueryFactory(xDestQueries, UNO_QUERY); if (!xQueryFactory.is()) { - DBG_ERROR("OApplicationController::paste: invalid destination query container!"); + OSL_FAIL("OApplicationController::paste: invalid destination query container!"); return sal_False; } @@ -680,7 +680,7 @@ sal_Bool OApplicationController::paste( ElementType _eType,const ::svx::ODataAcc // create a new object Reference< XPropertySet > xNewQuery(xQueryFactory->createInstance(), UNO_QUERY); - DBG_ASSERT(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); + OSL_ENSURE(xNewQuery.is(), "OApplicationController::paste: invalid object created by factory!"); if (xNewQuery.is()) { // initialize diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 906607406e3a..5d90d8a7c104 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -75,6 +75,7 @@ #include <svx/dbaexchange.hxx> #include <toolkit/unohlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/urlobj.hxx> #include <unotools/bootstrap.hxx> #include <vcl/mnemonic.hxx> @@ -226,7 +227,7 @@ void OApplicationController::openDialog( const ::rtl::OUString& _sServiceName ) Reference< ::com::sun::star::awt::XWindow> xWindow = getTopMostContainerWindow(); if ( !xWindow.is() ) { - DBG_ASSERT( getContainer(), "OApplicationController::Construct: have no view!" ); + OSL_ENSURE( getContainer(), "OApplicationController::Construct: have no view!" ); if ( getContainer() ) xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent()); } @@ -291,7 +292,7 @@ void OApplicationController::refreshTables() } catch(const Exception&) { - OSL_ENSURE(0,"Could not refresh tables!"); + OSL_FAIL("Could not refresh tables!"); } getContainer()->getDetailView()->clearPages(sal_False); @@ -451,7 +452,7 @@ namespace case DatabaseObject::FORM: eType = E_FORM; break; case DatabaseObject::REPORT: eType = E_REPORT; break; default: - OSL_ENSURE( false, "lcl_objectType2ElementType: unsupported object type!" ); + OSL_FAIL( "lcl_objectType2ElementType: unsupported object type!" ); // this should have been caught earlier } return eType; @@ -750,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 d89c495e5106..b10ee6afd78f 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; } // ----------------------------------------------------------------------------- @@ -193,7 +193,7 @@ namespace { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); - } // if( bForeground || bFont ) + } if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); @@ -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); @@ -254,7 +254,7 @@ OAppDetailPageHelper::~OAppDetailPageHelper() } catch(Exception) { - OSL_ENSURE(0,"Exception thrown while disposing preview frame!"); + OSL_FAIL("Exception thrown while disposing preview frame!"); } for (int i=0; i < E_ELEMENT_TYPE_COUNT; ++i) @@ -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); } } // ----------------------------------------------------------------------------- @@ -374,7 +374,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForControl( const Control& _r return; } } - OSL_ENSURE( false, "OAppDetailPageHelper::describeCurrentSelectionForControl: invalid control!" ); + OSL_FAIL( "OAppDetailPageHelper::describeCurrentSelectionForControl: invalid control!" ); } // ----------------------------------------------------------------------------- @@ -430,7 +430,7 @@ void OAppDetailPageHelper::describeCurrentSelectionForType( const ElementType _e } break; default: - OSL_ENSURE( false, "OAppDetailPageHelper::describeCurrentSelectionForType: unexpected type!" ); + OSL_FAIL( "OAppDetailPageHelper::describeCurrentSelectionForType: unexpected type!" ); break; } @@ -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) @@ -543,13 +543,11 @@ sal_Bool OAppDetailPageHelper::isCutAllowed() // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isCopyAllowed() { - //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- sal_Bool OAppDetailPageHelper::isPasteAllowed() { - //int nPos = getVisibleControlIndex(); return sal_True; } // ----------------------------------------------------------------------------- @@ -604,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; } // ----------------------------------------------------------------------------- @@ -623,8 +621,7 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon ImageProvider aImageProvider( _xConnection ); createTree( pTreeView, - aImageProvider.getDefaultImage( DatabaseObject::TABLE, false ), - aImageProvider.getDefaultImage( DatabaseObject::TABLE, true ) + aImageProvider.getDefaultImage( DatabaseObject::TABLE ) ); pTreeView->notifyHiContrastChanged(); @@ -637,17 +634,17 @@ 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, USHORT& _rHighContrastImageId ) +void OAppDetailPageHelper::getElementIcons( ElementType _eType, sal_uInt16& _rImageId) { ImageProvider aImageProvider; - _rImageId = _rHighContrastImageId = 0; + _rImageId = 0; sal_Int32 nDatabaseObjectType( 0 ); switch(_eType ) @@ -656,11 +653,10 @@ void OAppDetailPageHelper::getElementIcons( ElementType _eType, USHORT& _rImageI case E_REPORT: nDatabaseObjectType = DatabaseObject::REPORT; break; case E_QUERY: nDatabaseObjectType = DatabaseObject::QUERY; break; default: - OSL_ENSURE( sal_False, "OAppDetailPageHelper::GetElementIcons: invalid element type!" ); + OSL_FAIL( "OAppDetailPageHelper::GetElementIcons: invalid element type!" ); return; } - _rImageId = aImageProvider.getDefaultImageResourceID( nDatabaseObjectType, false ); - _rHighContrastImageId = aImageProvider.getDefaultImageResourceID( nDatabaseObjectType, true ); + _rImageId = aImageProvider.getDefaultImageResourceID( nDatabaseObjectType ); } // ----------------------------------------------------------------------------- @@ -668,43 +664,41 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA { OSL_ENSURE(E_TABLE != _eType,"E_TABLE isn't allowed."); - USHORT nHelpId = 0, nImageId = 0, nImageIdH = 0; + sal_uInt16 nImageId = 0; + rtl::OString sHelpId; ImageProvider aImageProvider; - Image aFolderImage, aFolderImageHC; + Image aFolderImage; switch( _eType ) { case E_FORM: - nHelpId = HID_APP_FORM_TREE; - aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM, false ); - aFolderImageHC = aImageProvider.getFolderImage( DatabaseObject::FORM, true ); + sHelpId = HID_APP_FORM_TREE; + aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM ); break; case E_REPORT: - nHelpId = HID_APP_REPORT_TREE; - aFolderImage = aImageProvider.getFolderImage( DatabaseObject::REPORT, false ); - aFolderImageHC = aImageProvider.getFolderImage( DatabaseObject::REPORT, true ); + sHelpId = HID_APP_REPORT_TREE; + aFolderImage = aImageProvider.getFolderImage( DatabaseObject::REPORT ); break; case E_QUERY: - nHelpId = HID_APP_QUERY_TREE; - aFolderImage = aImageProvider.getFolderImage( DatabaseObject::QUERY, false ); - aFolderImageHC = aImageProvider.getFolderImage( DatabaseObject::QUERY, true ); + sHelpId = HID_APP_QUERY_TREE; + aFolderImage = aImageProvider.getFolderImage( DatabaseObject::QUERY ); break; default: - OSL_ENSURE(0,"Illegal call!"); + OSL_FAIL("Illegal call!"); } - getElementIcons( _eType, nImageId, nImageIdH ); + getElementIcons( _eType, nImageId ); if ( !m_pLists[_eType] ) { - m_pLists[_eType] = createSimpleTree( nHelpId, aFolderImage, aFolderImageHC ); + m_pLists[_eType] = createSimpleTree( sHelpId, aFolderImage ); } if ( m_pLists[_eType] ) { if ( !m_pLists[_eType]->GetEntryCount() && _xContainer.is() ) { - fillNames( _xContainer, _eType, nImageId, nImageIdH, NULL ); + fillNames( _xContainer, _eType, nImageId, NULL ); - m_pLists[_eType]->SelectAll(FALSE); + m_pLists[_eType]->SelectAll(sal_False); } setDetailPage(m_pLists[_eType]); } @@ -718,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(); @@ -726,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(); @@ -750,7 +744,7 @@ namespace // ----------------------------------------------------------------------------- void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, const USHORT _nHighContrastImageId, 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!" ); @@ -773,47 +767,41 @@ 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, _nHighContrastImageId, pEntry ); + fillNames( xSubElements, _eType, _nImageId, pEntry ); } else { pEntry = pList->InsertEntry( *pIter, _pParent ); Image aImage = Image( ModuleRes( _nImageId ) ); - pList->SetExpandedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL ); - pList->SetCollapsedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL ); - - Image aHCImage = Image( ModuleRes( _nHighContrastImageId ) ); - pList->SetExpandedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST ); - pList->SetCollapsedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST ); + pList->SetExpandedEntryBmp( pEntry, aImage ); + pList->SetCollapsedEntryBmp( pEntry, aImage ); } } } } // ----------------------------------------------------------------------------- -DBTreeListBox* OAppDetailPageHelper::createSimpleTree( ULONG _nHelpId, const Image& _rImage, const Image& _rImageHC ) +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); - return createTree( pTreeView, _rImage, _rImageHC ); + pTreeView->SetHelpId( _sHelpId ); + return createTree( pTreeView, _rImage ); } // ----------------------------------------------------------------------------- -DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, const Image& _rImage, const Image& _rImageHC ) +DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, const Image& _rImage ) { 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); _pTreeView->SetDefaultCollapsedEntryBmp( _rImage ); - _pTreeView->SetDefaultCollapsedEntryBmp( _rImageHC, BMP_COLOR_HIGHCONTRAST ); _pTreeView->SetDefaultExpandedEntryBmp( _rImage ); - _pTreeView->SetDefaultExpandedEntryBmp( _rImageHC, BMP_COLOR_HIGHCONTRAST ); _pTreeView->SetDoubleClickHdl(LINK(this, OAppDetailPageHelper, OnEntryDoubleClick)); _pTreeView->SetEnterKeyHdl(LINK(this, OAppDetailPageHelper, OnEntryDoubleClick)); @@ -872,7 +860,7 @@ void OAppDetailPageHelper::elementReplaced(ElementType _eType pEntry = lcl_findEntry(*pTreeView,_rOldName,pTreeView->First()); break; default: - OSL_ENSURE(0,"Invalid element type"); + OSL_FAIL("Invalid element type"); } OSL_ENSURE(pEntry,"Do you know that the name isn't existence!"); if ( pEntry ) @@ -905,26 +893,22 @@ SvLBoxEntry* OAppDetailPageHelper::elementAdded(ElementType _eType,const ::rtl:: } } - USHORT nImageId = 0, nImageIdH = 0; - getElementIcons( _eType, nImageId, nImageIdH ); + 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 ) ); - fillNames( xContainer, _eType, nImageId, nImageIdH, pRet ); + pRet = pTreeView->InsertEntry( _rName, pEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + fillNames( xContainer, _eType, nImageId, pRet ); } else { pRet = pTreeView->InsertEntry( _rName, pEntry ); Image aImage = Image( ModuleRes( nImageId ) ); - pTreeView->SetExpandedEntryBmp( pRet, aImage, BMP_COLOR_NORMAL ); - pTreeView->SetCollapsedEntryBmp( pRet, aImage, BMP_COLOR_NORMAL ); - - Image aHCImage = Image( ModuleRes( nImageIdH ) ); - pTreeView->SetExpandedEntryBmp( pRet, aHCImage, BMP_COLOR_HIGHCONTRAST ); - pTreeView->SetCollapsedEntryBmp( pRet, aHCImage, BMP_COLOR_HIGHCONTRAST ); + pTreeView->SetExpandedEntryBmp( pRet, aImage ); + pTreeView->SetCollapsedEntryBmp( pRet, aImage ); } } return pRet; @@ -961,7 +945,7 @@ void OAppDetailPageHelper::elementRemoved( ElementType _eType,const ::rtl::OUStr } break; default: - OSL_ENSURE(0,"Invalid element type"); + OSL_FAIL("Invalid element type"); } if ( !pTreeView->GetEntryCount() ) showPreview(NULL); @@ -1007,8 +991,7 @@ IMPL_LINK( OAppDetailPageHelper, OnDeleteEntry, void*, /*NOINTERESTEDIN*/ ) // ----------------------------------------------------------------------------- void OAppDetailPageHelper::Resize() { - ////////////////////////////////////////////////////////////////////// - // Abmessungen parent window + // parent window dimension Size aOutputSize( GetOutputSize() ); long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); @@ -1047,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 ) { @@ -1145,12 +1128,6 @@ void OAppDetailPageHelper::showPreview(const Reference< XContent >& _xContent) { m_aPreview.Hide(); m_aDocumentInfo.Hide(); - - // Why the below code? It might have side effects, as the tree view needs to know - // its current selection for other purposes than the preview, too. -// DBTreeListBox* pTreeView = getCurrentView(); -// if ( pTreeView ) -// pTreeView->clearCurrentSelection(); } } catch( const Exception& ) @@ -1177,9 +1154,9 @@ void OAppDetailPageHelper::showPreview( const ::rtl::OUString& _sDataSourceName, m_xFrame = Reference < XFrame > ( getBorderWin().getView()->getORB()->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame")) ), UNO_QUERY ); m_xFrame->initialize( m_xWindow ); - // work-around for #150518#: no layout manager (and thus no toolbars) in the preview + // no layout manager (and thus no toolbars) in the preview // Must be called after initialize ... but before any other call to this frame. - // Otherwhise frame throws "life time exceptions" as e.g. NON_INITIALIZED + // Otherwise frame throws "life time exceptions" as e.g. NON_INITIALIZED Reference< XPropertySet > xFrameProps( m_xFrame, UNO_QUERY_THROW ); xFrameProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ), makeAny(Reference< XLayoutManager >()) ); @@ -1278,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 ) { @@ -1314,34 +1291,25 @@ void OAppDetailPageHelper::DataChanged( const DataChangedEvent& rDCEvt ) void OAppDetailPageHelper::ImplInitSettings() { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - if( true ) - { Font aFont; aFont = rStyleSettings.GetFieldFont(); aFont.SetColor( rStyleSettings.GetWindowTextColor() ); SetPointFont( aFont ); m_aTBPreview.SetPointFont( aFont ); - } - if( true ) - { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); m_aBorder.SetTextColor( rStyleSettings.GetFieldTextColor() ); m_aBorder.SetTextFillColor(); m_aTBPreview.SetTextColor( rStyleSettings.GetFieldTextColor() ); m_aTBPreview.SetTextFillColor(); - } // if( true ) - if( true ) - { SetBackground( rStyleSettings.GetFieldColor() ); m_aBorder.SetBackground( rStyleSettings.GetFieldColor() ); m_aFL.SetBackground( rStyleSettings.GetFieldColor() ); m_aDocumentInfo.SetBackground( rStyleSettings.GetFieldColor() ); m_aTBPreview.SetBackground( rStyleSettings.GetFieldColor() ); m_pTablePreview->SetBackground( rStyleSettings.GetFieldColor() ); - } // if( true ) } // ----------------------------------------------------------------------------- OPreviewWindow::OPreviewWindow(Window* _pParent) @@ -1350,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() ) { @@ -1377,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; @@ -1428,7 +1396,7 @@ void OPreviewWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal { SetTextColor( rStyleSettings.GetFieldTextColor() ); SetTextFillColor(); - } // if( bForeground || bFont ) + } if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index cb4a79970fca..69a050c8e2ea 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, USHORT& _rHighContrastImageId ); + void getElementIcons( ElementType _eType, sal_uInt16& _rImageId); /** fills the names in the listbox @param _xContainer @@ -128,15 +128,12 @@ namespace dbaui the type of elements which are being filled @param _nImageId the resource id of the image to use for non-container entries - @param _nHighContrastImageId - the resource id of the high contrast image to use for non-container entries @param _pParent The parent of the entries to be inserted. */ void fillNames( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, - const USHORT _nHighContrastImageId, + const sal_uInt16 _nImageId, SvLBoxEntry* _pParent ); /** sets the detail page @@ -150,24 +147,20 @@ namespace dbaui The newly created DBTreeListBox @param _rImage the resource id of the default icon - @param _rImageHC - the resource id of the default icon (HC version) @return The new tree. */ - DBTreeListBox* createTree( DBTreeListBox* _pTreeView, const Image& _rImage, const Image& _rImageHC ); + DBTreeListBox* createTree( DBTreeListBox* _pTreeView, const Image& _rImage ); /** creates the tree and sets all HandleCallbacks @param _nHelpId The help id of the control @param _nCollapsedBitmap - The image to use for tree entries. - @param _rImageHC The image to use in high contrast mode. @return The new tree. */ - DBTreeListBox* createSimpleTree( ULONG _nHelpId, const Image& _rImage, const Image& _rImageHC ); + DBTreeListBox* createSimpleTree( const rtl::OString& _sHelpId, const Image& _rImage); DECL_LINK( OnEntryDoubleClick, SvTreeListBox* ); DECL_LINK( OnEntrySelChange, void* ); @@ -351,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 4003c14e854c..a2259654a858 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "AppDetailView.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "dbu_app.hrc" #include "AppView.hxx" @@ -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 ) { @@ -138,7 +138,7 @@ void OCreationList::PreparePaint( SvLBoxEntry* _pEntry ) void OCreationList::SelectSearchEntry( const void* _pEntry ) { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); - DBG_ASSERT( pEntry, "OCreationList::SelectSearchEntry: invalid entry!" ); + OSL_ENSURE( pEntry, "OCreationList::SelectSearchEntry: invalid entry!" ); if ( pEntry ) setCurrentEntryInvalidate( pEntry ); @@ -148,11 +148,11 @@ 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 ) ); - DBG_ASSERT( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); - DBG_ASSERT( pEntry == GetCurEntry(), "OCreationList::ExecuteSearchEntry: SelectSearchEntry should have been called before!" ); + OSL_ENSURE( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); + OSL_ENSURE( pEntry == GetCurEntry(), "OCreationList::ExecuteSearchEntry: SelectSearchEntry should have been called before!" ); if ( pEntry ) onSelected( pEntry ); @@ -168,7 +168,7 @@ Rectangle OCreationList::GetFocusRect( SvLBoxEntry* _pEntry, long _nLine ) SvLBoxItem* pBitmapItem = _pEntry->GetFirstItem( SV_ITEM_ID_LBOXCONTEXTBMP ); SvLBoxTab* pTab = pBitmapItem ? GetTab( _pEntry, pBitmapItem ) : NULL; SvViewDataItem* pItemData = pBitmapItem ? GetViewDataItem( _pEntry, pBitmapItem ) : NULL; - DBG_ASSERT( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" ); + OSL_ENSURE( pTab && pItemData, "OCreationList::GetFocusRect: could not find the first bitmap item!" ); if ( pTab && pItemData ) aRect.Left() = pTab->GetPos() - pItemData->aSize.Width() / 2; @@ -212,7 +212,7 @@ void OCreationList::MouseButtonDown( const MouseEvent& rMEvt ) { SvTreeListBox::MouseButtonDown( rMEvt ); - DBG_ASSERT( !m_pMouseDownEntry, "OCreationList::MouseButtonDown: I missed some mouse event!" ); + OSL_ENSURE( !m_pMouseDownEntry, "OCreationList::MouseButtonDown: I missed some mouse event!" ); m_pMouseDownEntry = GetCurEntry(); if ( m_pMouseDownEntry ) { @@ -234,14 +234,14 @@ void OCreationList::MouseMove( const MouseEvent& rMEvt ) if ( m_pMouseDownEntry ) { // we're currently in a "mouse down" phase - DBG_ASSERT( IsMouseCaptured(), "OCreationList::MouseMove: inconsistence (1)!" ); + OSL_ENSURE( IsMouseCaptured(), "OCreationList::MouseMove: inconsistence (1)!" ); if ( pEntry == m_pMouseDownEntry ) { setCurrentEntryInvalidate( m_pMouseDownEntry ); } else { - DBG_ASSERT( ( GetCurEntry() == m_pMouseDownEntry ) || !GetCurEntry(), + OSL_ENSURE( ( GetCurEntry() == m_pMouseDownEntry ) || !GetCurEntry(), "OCreationList::MouseMove: inconsistence (2)!" ); setCurrentEntryInvalidate( NULL ); } @@ -274,7 +274,7 @@ void OCreationList::MouseButtonUp( const MouseEvent& rMEvt ) if ( m_pMouseDownEntry ) { - DBG_ASSERT( IsMouseCaptured(), "OCreationList::MouseButtonUp: hmmm .... no mouse captured, but an active entry?" ); + OSL_ENSURE( IsMouseCaptured(), "OCreationList::MouseButtonUp: hmmm .... no mouse captured, but an active entry?" ); ReleaseMouse(); InvalidateEntry( m_pMouseDownEntry ); @@ -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 ); @@ -315,7 +315,7 @@ void OCreationList::updateHelpText() // ----------------------------------------------------------------------------- void OCreationList::onSelected( SvLBoxEntry* _pEntry ) const { - DBG_ASSERT( _pEntry, "OCreationList::onSelected: invalid entry!" ); + OSL_ENSURE( _pEntry, "OCreationList::onSelected: invalid entry!" ); URL aCommand; aCommand.Complete = reinterpret_cast< TaskEntry* >( _pEntry->GetUserData() )->sUNOCommand; m_rTaskWindow.getDetailView()->getBorderWin().getView()->getAppController().executeChecked( aCommand, Sequence< PropertyValue >() ); @@ -346,7 +346,7 @@ void OCreationList::KeyInput( const KeyEvent& rKEvt ) { InvalidateEntry( pNewCurrent ); CallEventListeners( VCLEVENT_LISTBOX_SELECT, pNewCurrent ); - } // if ( pNewCurrent ) + } updateHelpText(); } } @@ -409,8 +409,6 @@ void OTasksWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_B m_aHelpText.SetTextFillColor(); m_aDescription.SetTextColor( rStyleSettings.GetFieldTextColor() ); m_aDescription.SetTextFillColor(); - //m_aFL.SetTextColor( rStyleSettings.GetFieldTextColor() ); - //m_aFL.SetTextFillColor(); } if( bBackground ) @@ -426,18 +424,13 @@ 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 ) { String sText = ModuleRes(_nId); - // calulate the size of the text field - // Size aHelpTextSize = m_aHelpText.GetSizePixel(); - // Size aHelpTextPixelSize = LogicToPixel( aHelpTextSize, MAP_APPFONT ); - // Rectangle aPrimaryRect( Point(0,0), aHelpTextSize ); - // Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT | TEXT_DRAW_WORDBREAK ) ); m_aHelpText.SetText(sText); } else @@ -458,8 +451,8 @@ IMPL_LINK(OTasksWindow, OnEntrySelectHdl, SvTreeListBox*, /*_pTreeBox*/) void OTasksWindow::Resize() { DBG_CHKTHIS(OTasksWindow,NULL); - ////////////////////////////////////////////////////////////////////// - // Abmessungen parent window + + // parent window dimension Size aOutputSize( GetOutputSize() ); long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); @@ -471,9 +464,6 @@ void OTasksWindow::Resize() m_aCreation.SetPosSizePixel( Point(0, 0), Size(nHalfOutputWidth - n6PPT, nOutputHeight) ); // i77897 make the m_aHelpText a little bit smaller. (-5) sal_Int32 nNewWidth = nOutputWidth - nHalfOutputWidth - aFLSize.Width() - 5; - // m_aHelpText.SetBackground( MAKE_SALCOLOR( 0xe0, 0xe0, 0xe0 ) ); - // Wallpaper aLightGray(Color(0xe0, 0xe0, 0xe0)); - // m_aHelpText.SetBackground( aLightGray ); m_aDescription.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, 0), Size(nNewWidth, nOutputHeight) ); Size aDesc = m_aDescription.CalcMinimumSize(); m_aHelpText.SetPosSizePixel( Point(nHalfOutputWidth + n6PPT, aDesc.Height() ), Size(nNewWidth, nOutputHeight - aDesc.Height() - n6PPT) ); @@ -488,9 +478,16 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) try { - Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(getDetailView()->getBorderWin().getView()->getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),UNO_QUERY); - Reference<XUIConfigurationManager> xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.OfficeDatabaseDocument"))); - Reference<XImageManager> xImageMgr(xUIConfigMgr->getImageManager(),UNO_QUERY); + Reference< XModuleUIConfigurationManagerSupplier > xModuleCfgMgrSupplier( + getDetailView()->getBorderWin().getView()->getORB()->createInstance( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.ModuleUIConfigurationManagerSupplier" ) ) + ) , + UNO_QUERY + ); + Reference< XUIConfigurationManager > xUIConfigMgr = xModuleCfgMgrSupplier->getUIConfigurationManager( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sdb.OfficeDatabaseDocument" ) ) + ); + Reference< XImageManager > xImageMgr( xUIConfigMgr->getImageManager(), UNO_QUERY ); // copy the commands so we can use them with the config managers Sequence< ::rtl::OUString > aCommands( _rList.size() ); @@ -499,24 +496,21 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) for ( TaskEntryList::const_iterator pCopyTask = _rList.begin(); pCopyTask != aEnd; ++pCopyTask, ++pCommands ) *pCommands = pCopyTask->sUNOCommand; - Sequence< Reference< XGraphic> > aImages = xImageMgr->getImages( ImageType::SIZE_DEFAULT | ImageType::COLOR_NORMAL, aCommands ); - Sequence< Reference< XGraphic> > aHCImages = xImageMgr->getImages( ImageType::SIZE_DEFAULT | ImageType::COLOR_HIGHCONTRAST, aCommands ); + Sequence< Reference< XGraphic> > aImages = xImageMgr->getImages( + ImageType::SIZE_DEFAULT | ImageType::COLOR_NORMAL , + aCommands + ); const Reference< XGraphic >* pImages( aImages.getConstArray() ); - const Reference< XGraphic >* pHCImages( aHCImages.getConstArray() ); - for ( TaskEntryList::const_iterator pTask = _rList.begin(); pTask != aEnd; ++pTask, ++pImages, ++pHCImages ) + for ( TaskEntryList::const_iterator pTask = _rList.begin(); pTask != aEnd; ++pTask, ++pImages ) { SvLBoxEntry* pEntry = m_aCreation.InsertEntry( pTask->sTitle ); pEntry->SetUserData( reinterpret_cast< void* >( new TaskEntry( *pTask ) ) ); Image aImage = Image( *pImages ); - m_aCreation.SetExpandedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL ); - m_aCreation.SetCollapsedEntryBmp( pEntry, aImage, BMP_COLOR_NORMAL ); - - Image aHCImage = Image( *pHCImages ); - m_aCreation.SetExpandedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST ); - m_aCreation.SetCollapsedEntryBmp( pEntry, aHCImage, BMP_COLOR_HIGHCONTRAST ); + m_aCreation.SetExpandedEntryBmp( pEntry, aImage ); + m_aCreation.SetCollapsedEntryBmp( pEntry, aImage ); } } catch(Exception&) @@ -524,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(); @@ -611,7 +605,6 @@ void OApplicationDetailView::ImplInitSettings( sal_Bool bFont, sal_Bool bForegro if( bBackground ) SetBackground( rStyleSettings.GetFieldColor() ); - //SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetDialogColor() ) ); m_aHorzSplitter.SetBackground( rStyleSettings.GetDialogColor() ); m_aHorzSplitter.SetFillColor( rStyleSettings.GetDialogColor() ); m_aHorzSplitter.SetTextFillColor(rStyleSettings.GetDialogColor() ); @@ -704,7 +697,6 @@ const TaskPaneData& OApplicationDetailView::impl_getTaskPaneData( ElementType _e OSL_ENSURE( ( _eType >= 0 ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OApplicationDetailView::impl_getTaskPaneData: illegal element type!" ); TaskPaneData& rData = m_aTaskPaneData[ _eType ]; -// if ( rData.aTasks.empty() ) //oj: do not check, otherwise extensions will only be visible after a reload. impl_fillTaskPaneData( _eType, rData ); @@ -746,7 +738,7 @@ void OApplicationDetailView::impl_fillTaskPaneData( ElementType _eType, TaskPane break; default: - OSL_ENSURE( false, "OApplicationDetailView::impl_fillTaskPaneData: illegal element type!" ); + OSL_FAIL( "OApplicationDetailView::impl_fillTaskPaneData: illegal element type!" ); } MnemonicGenerator aAllMnemonics( m_aExternalMnemonics ); diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index ef2001ab65fb..df890bbafb4b 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); @@ -171,7 +171,6 @@ namespace dbaui OApplicationDetailView(OAppBorderWindow& _rParent,PreviewMode _ePreviewMode); virtual ~OApplicationDetailView(); // window overloads - // virtual void Resize(); virtual void GetFocus(); /** creates the tables page diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 939d174b23e9..c6c3f2e480a2 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -53,34 +53,32 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent) struct CategoryDescriptor { - USHORT nLabelResId; + sal_uInt16 nLabelResId; ElementType eType; - USHORT nImageResId; - USHORT nImageResIdHC; + sal_uInt16 nImageResId; } aCategories[] = { - { RID_STR_TABLES_CONTAINER, E_TABLE, IMG_TABLEFOLDER_TREE_L, IMG_TABLEFOLDER_TREE_LHC }, - { RID_STR_QUERIES_CONTAINER, E_QUERY, IMG_QUERYFOLDER_TREE_L, IMG_QUERYFOLDER_TREE_LHC }, - { RID_STR_FORMS_CONTAINER, E_FORM, IMG_FORMFOLDER_TREE_L, IMG_FORMFOLDER_TREE_LHC }, - { RID_STR_REPORTS_CONTAINER, E_REPORT, IMG_REPORTFOLDER_TREE_L,IMG_REPORTFOLDER_TREE_LHC } + { RID_STR_TABLES_CONTAINER, E_TABLE, IMG_TABLEFOLDER_TREE_L }, + { RID_STR_QUERIES_CONTAINER, E_QUERY, IMG_QUERYFOLDER_TREE_L }, + { RID_STR_FORMS_CONTAINER, E_FORM, IMG_FORMFOLDER_TREE_L }, + { RID_STR_REPORTS_CONTAINER, E_REPORT, IMG_REPORTFOLDER_TREE_L } }; for ( size_t i=0; i < SAL_N_ELEMENTS(aCategories); ++i) { SvxIconChoiceCtrlEntry* pEntry = InsertEntry( - String( ModuleRes( aCategories[i].nLabelResId ) ), - Image( ModuleRes( aCategories[i].nImageResId ) ), - Image( ModuleRes( aCategories[i].nImageResIdHC ) ) ); + String( ModuleRes( aCategories[i].nLabelResId ) ) , + Image( ModuleRes( aCategories[i].nImageResId ) ) ); if ( pEntry ) 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 e8b0393dec54..36475115d972 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.cxx +++ b/dbaccess/source/ui/app/AppSwapWindow.cxx @@ -58,7 +58,6 @@ OApplicationSwapWindow::OApplicationSwapWindow( Window* _pParent, OAppBorderWind ,m_rBorderWin( _rBorderWindow ) { DBG_CTOR(OApplicationSwapWindow,NULL); -// SetCompoundControl( TRUE ); ImplInitSettings( sal_True, sal_True, sal_True ); @@ -66,7 +65,6 @@ OApplicationSwapWindow::OApplicationSwapWindow( Window* _pParent, OAppBorderWind m_aIconControl.setControlActionListener( &m_rBorderWin.getView()->getAppController() ); m_aIconControl.SetHelpId(HID_APP_SWAP_ICONCONTROL); m_aIconControl.Show(); - //m_aIconControl.Enable(TRUE); } // ----------------------------------------------------------------------------- OApplicationSwapWindow::~OApplicationSwapWindow() @@ -126,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); @@ -153,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; } @@ -169,7 +167,7 @@ bool OApplicationSwapWindow::onContainerSelected( ElementType _eType ) if ( _eType != E_NONE ) m_eLastType = _eType; return true; - } // if ( m_rBorderWin.getView()->getAppController().onContainerSelect( _eType ) ) + } PostUserEvent( LINK( this, OApplicationSwapWindow, ChangeToLastSelected ) ); return false; @@ -178,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 ) @@ -198,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 bc5cd2abb1df..89d535806bd9 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 f0166e49d69a..e2473432e8cc 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) @@ -77,8 +77,7 @@ void OTitleWindow::setChildWindow(Window* _pChild) // ----------------------------------------------------------------------------- void OTitleWindow::Resize() { - ////////////////////////////////////////////////////////////////////// - // Abmessungen parent window + // parent window dimension Size aOutputSize( GetOutputSize() ); long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); @@ -101,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 8f230d9d9e1c..ab1719977f23 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 17a16c5ea2b4..4974a3ef6333 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(); @@ -101,8 +101,7 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev // ----------------------------------------------------------------------------- OAppBorderWindow::~OAppBorderWindow() { - ////////////////////////////////////////////////////////////////////// - // Childs zerstoeren + // destroy children if ( m_pPanel ) { m_pPanel->Hide(); @@ -127,8 +126,7 @@ void OAppBorderWindow::GetFocus() // ----------------------------------------------------------------------------- void OAppBorderWindow::Resize() { - ////////////////////////////////////////////////////////////////////// - // Abmessungen parent window + // parent window dimension Size aOutputSize( GetOutputSize() ); long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); @@ -185,10 +183,6 @@ void OAppBorderWindow::ImplInitSettings() if( true ) SetBackground( rStyleSettings.GetDialogColor() ); - - /*SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) ); - SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); - SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );*/ } // ----------------------------------------------------------------------------- OApplicationView* OAppBorderWindow::getView() const @@ -313,11 +307,11 @@ long OApplicationView::PreNotify( NotifyEvent& rNEvt ) { const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); // give the pane the chance to intercept mnemonic accelerators - // #i34790# - 2004-09-30 - fs@openoffice.org + // #i34790# if ( getPanel() && getPanel()->interceptKeyInput( *pKeyEvent ) ) return 1L; // and ditto the detail view - // #i72799# - 2006-12-20 / frank.schoenheit@sun.com + // #i72799# if ( getDetailView() && getDetailView()->interceptKeyInput( *pKeyEvent ) ) return 1L; } @@ -601,9 +595,6 @@ void OApplicationView::ImplInitSettings() if( true ) SetBackground( rStyleSettings.GetFieldColor() ); - /*SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetDialogColor() ) ); - SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); - SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() );*/ } //----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index 2dec9005f847..431f434fcea3 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"; }; @@ -312,43 +296,53 @@ String RID_STR_REPORTS_HELP_TEXT_WIZARD { Text [ en-US ] = "The wizard will guide you through the steps necessary to create a report." ; }; + String RID_STR_FORMS_HELP_TEXT { Text [ en-US ] = "Create a form by specifying the record source, controls, and control properties." ; }; + String RID_STR_REPORT_HELP_TEXT { Text [ de ] ="Erstellen Sie einen Bericht, indem Sie die Datensatzquelle, Steuerelemente und Steuerelementeigenschaften angeben." ; Text [ en-US ] = "Create a report by specifying the record source, controls, and control properties." ; }; + String RID_STR_FORMS_HELP_TEXT_WIZARD { Text [ en-US ] = "The wizard will guide you through the steps necessary to create a form." ; }; + String RID_STR_QUERIES_HELP_TEXT { Text [ en-US ] = "Create a query by specifying the filters, input tables, field names, and properties for sorting or grouping." ; }; + String RID_STR_QUERIES_HELP_TEXT_SQL { Text [ en-US ] = "Create a query entering an SQL statement directly." ; }; + String RID_STR_QUERIES_HELP_TEXT_WIZARD { Text [ en-US ] = "The wizard will guide you through the steps necessary to create a query." ; }; + String RID_STR_TABLES_HELP_TEXT_DESIGN { Text [ en-US ] = "Create a table by specifying the field names and properties, as well as the data types." ; }; + String RID_STR_TABLES_HELP_TEXT_WIZARD { Text [ en-US ] = "Choose from a selection of business and personal table samples, which you customize to create a table." ; }; + String RID_STR_VIEWS_HELP_TEXT_DESIGN { Text [ en-US ] = "Create a view by specifying the tables and field names you would like to have visible." ; }; + String RID_STR_VIEWS_HELP_TEXT_WIZARD { Text [ en-US ] = "Opens the view wizard" ; @@ -358,28 +352,34 @@ String STR_DATABASE { Text [ en-US ] = "Database" ; }; + String STR_TASKS { Text [ en-US ] = "Tasks" ; }; + String STR_DESCRIPTION { Text [ en-US ] = "Description" ; }; + String STR_PREVIEW { Text [ en-US ] = "Preview" ; }; + String STR_DISABLEPREVIEW { Text [ en-US ] = "Disable Preview" ; }; + QueryBox APP_SAVEMODIFIED { Buttons = WB_YES_NO_CANCEL ; DefButton = WB_DEF_YES ; Message [ en-US ] = "The database has been modified.\nDo you want to save the changes?" ; }; + QueryBox APP_CLOSEDOCUMENTS { Buttons = WB_YES_NO ; @@ -394,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; @@ -404,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; @@ -414,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; @@ -423,6 +420,7 @@ Menu RID_MENU_APP_PREVIEW }; }; }; + String RID_STR_FORM { Text [ en-US ] = "Form"; @@ -432,10 +430,12 @@ String RID_STR_REPORT { Text [ en-US ] = "Report"; }; + String STR_FRM_LABEL { Text [ en-US ] = "F~orm name" ; }; + String STR_RPT_LABEL { Text [ en-US ] = "~Report name" ; @@ -466,10 +466,12 @@ String RID_STR_EMBEDDED_DATABASE { Text [ en-US ] = "Embedded database"; }; + String RID_STR_NO_DIFF_CAT { Text [ en-US ] = "You cannot select different categories."; }; + String RID_STR_UNSUPPORTED_OBJECT_TYPE { Text [ en-US ] = "Unsupported object type found ($type$)."; diff --git a/dbaccess/source/ui/app/makefile.mk b/dbaccess/source/ui/app/makefile.mk index a7097b4330e1..658456f4135b 100644 --- a/dbaccess/source/ui/app/makefile.mk +++ b/dbaccess/source/ui/app/makefile.mk @@ -40,19 +40,19 @@ TARGET=app # --- Files -------------------------------------------------------- EXCEPTIONSFILES=\ - $(SLO)$/AppDetailView.obj \ $(SLO)$/AppController.obj \ $(SLO)$/AppControllerDnD.obj \ $(SLO)$/AppControllerGen.obj \ $(SLO)$/AppDetailPageHelper.obj \ + $(SLO)$/AppDetailView.obj \ + $(SLO)$/AppIconControl.obj \ $(SLO)$/AppSwapWindow.obj \ $(SLO)$/AppTitleWindow.obj \ - $(SLO)$/AppView.obj \ + $(SLO)$/AppView.obj \ $(SLO)$/subcomponentmanager.obj SLOFILES =\ - $(SLO)$/AppIconControl.obj \ $(EXCEPTIONSFILES) SRS1NAME=$(TARGET) diff --git a/dbaccess/source/ui/app/subcomponentmanager.cxx b/dbaccess/source/ui/app/subcomponentmanager.cxx index 641051f20d49..9b6d612b1b4c 100644 --- a/dbaccess/source/ui/app/subcomponentmanager.cxx +++ b/dbaccess/source/ui/app/subcomponentmanager.cxx @@ -45,7 +45,6 @@ #include <vcl/svapp.hxx> #include <osl/mutex.hxx> -#include <hash_map> #include <algorithm> #include <functional> @@ -180,7 +179,7 @@ namespace dbaui //.............................................................................................................. struct SelectSubComponent : public ::std::unary_function< SubComponentDescriptor, Reference< XComponent > > { - Reference< XComponent > operator()( const SubComponentDescriptor _desc ) const + Reference< XComponent > operator()( const SubComponentDescriptor &_desc ) const { if ( _desc.xModel.is() ) return _desc.xModel.get(); diff --git a/dbaccess/source/ui/browser/bcommon.src b/dbaccess/source/ui/browser/bcommon.src index 8c79179eda20..d5b8401b4e8c 100644 --- a/dbaccess/source/ui/browser/bcommon.src +++ b/dbaccess/source/ui/browser/bcommon.src @@ -32,4 +32,3 @@ String RID_STR_TBL_TITLE { Text [ en-US ] = "Table #" ; }; - diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index 66e774b22a53..7b4293318712 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -95,6 +95,7 @@ #include <svx/svxdlg.hxx> #include <tools/color.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <vcl/waitobj.hxx> @@ -133,7 +134,7 @@ using namespace ::svt; DBG_UNHANDLED_EXCEPTION(); \ } \ -#define DO_SAFE( action, message ) try { action; } catch(Exception&) { DBG_ERROR(message); } ; +#define DO_SAFE( action, message ) try { action; } catch(Exception&) { OSL_FAIL(message); } ; //.................................................................. namespace dbaui @@ -282,7 +283,7 @@ SbaXDataBrowserController::FormControllerImpl::~FormControllerImpl() //------------------------------------------------------------------ Reference< runtime::XFormOperations > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getFormOperations() throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getFormOperations: not supported!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::getFormOperations: not supported!" ); return NULL; } @@ -314,27 +315,27 @@ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addChildController( //------------------------------------------------------------------ Reference< runtime::XFormControllerContext > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getContext() throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getContext: no support!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::getContext: no support!!" ); return NULL; } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContext( const Reference< runtime::XFormControllerContext >& /*_context*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::setContext: no support!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::setContext: no support!!" ); } //------------------------------------------------------------------ Reference< XInteractionHandler > SAL_CALL SbaXDataBrowserController::FormControllerImpl::getInteractionHandler() throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::getInteractionHandler: no support!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::getInteractionHandler: no support!!" ); return NULL; } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setInteractionHandler( const Reference< XInteractionHandler >& /*_interactionHandler*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::setInteractionHandler: no support!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::setInteractionHandler: no support!!" ); } //------------------------------------------------------------------ @@ -353,19 +354,19 @@ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setParent( const Re //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::dispose( ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::dispose: no, you do *not* want to do this!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::dispose: no, you do *not* want to do this!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addEventListener( const Reference< XEventListener >& /*xListener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addEventListener: no support!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addEventListener: no support!!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeEventListener( const Reference< XEventListener >& /*aListener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeEventListener: no support!!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeEventListener: no support!!" ); } //------------------------------------------------------------------ @@ -404,73 +405,73 @@ Reference< XEnumeration > SAL_CALL SbaXDataBrowserController::FormControllerImpl //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addModifyListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addModifyListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeModifyListener( const Reference< XModifyListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeModifyListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeModifyListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener( const Reference< XConfirmDeleteListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addConfirmDeleteListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener( const Reference< XConfirmDeleteListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeConfirmDeleteListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener( const Reference< XSQLErrorListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addSQLErrorListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener( const Reference< XSQLErrorListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeSQLErrorListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener( const Reference< XRowSetApproveListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addRowSetApproveListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener( const Reference< XRowSetApproveListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeRowSetApproveListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addDatabaseParameterListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeDatabaseParameterListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::addParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::addParameterListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::addParameterListener: no support!" ); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::removeParameterListener( const Reference< XDatabaseParameterListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SbaXDataBrowserController::FormControllerImpl::removeParameterListener: no support!" ); + OSL_FAIL( "SbaXDataBrowserController::FormControllerImpl::removeParameterListener: no support!" ); } //------------------------------------------------------------------ @@ -503,7 +504,7 @@ Sequence< ::rtl::OUString > SAL_CALL SbaXDataBrowserController::FormControllerIm //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & /*Model*/) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !"); } //------------------------------------------------------------------ @@ -515,7 +516,7 @@ Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL SbaXDataBrowse //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContainer(const Reference< ::com::sun::star::awt::XControlContainer > & /*_Container*/) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setContainer : invalid call, can't change my container !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::setContainer : invalid call, can't change my container !"); } //------------------------------------------------------------------ @@ -540,13 +541,13 @@ Sequence< Reference< ::com::sun::star::awt::XControl > > SAL_CALL SbaXDataBrowse //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::autoTabOrder(void) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::autoTabOrder : nothing to do (always have only one control) !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::autoTabOrder : nothing to do (always have only one control) !"); } //------------------------------------------------------------------ void SAL_CALL SbaXDataBrowserController::FormControllerImpl::activateTabOrder(void) throw( RuntimeException ) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::activateTabOrder : nothing to do (always have only one control) !"); + OSL_FAIL("SbaXDataBrowserController::FormControllerImpl::activateTabOrder : nothing to do (always have only one control) !"); } //------------------------------------------------------------------ @@ -738,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() ) { @@ -764,7 +785,7 @@ void SbaXDataBrowserController::initFormatter() { // create a new formatter m_xFormatter = Reference< ::com::sun::star::util::XNumberFormatter > ( - getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); + getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY); if (m_xFormatter.is()) m_xFormatter->attachNumberFormatsSupplier(xSupplier); } @@ -808,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(); @@ -850,7 +872,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) } catch(Exception&) { - DBG_ERROR("SbaXDataBrowserController::Construct : the construction of UnoDataBrowserView failed !"); + OSL_FAIL("SbaXDataBrowserController::Construct : the construction of UnoDataBrowserView failed !"); } if (!bSuccess) @@ -874,7 +896,7 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) // set the callbacks for the grid control SbaGridControl* pVclGrid = getBrowserView()->getVclControl(); - DBG_ASSERT(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !"); + OSL_ENSURE(pVclGrid, "SbaXDataBrowserController::Construct : have no VCL control !"); pVclGrid->SetMasterListener(this); // -------------------------- @@ -935,14 +957,14 @@ void SbaXDataBrowserController::RemoveColumnListener(const Reference< XPropertyS Reference< XRowSet > SbaXDataBrowserController::CreateForm() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::CreateForm" ); - return Reference< XRowSet > (getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.form.component.Form")), UNO_QUERY); + return Reference< XRowSet > (getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.Form"))), UNO_QUERY); } //------------------------------------------------------------------------------ Reference< ::com::sun::star::form::XFormComponent > SbaXDataBrowserController::CreateGridModel() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::CreateGridModel" ); - return Reference< ::com::sun::star::form::XFormComponent > (getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.form.component.GridControl")), UNO_QUERY); + return Reference< ::com::sun::star::form::XFormComponent > (getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.GridControl"))), UNO_QUERY); } // ------------------------------------------------------------------------- @@ -1067,7 +1089,7 @@ void SAL_CALL SbaXDataBrowserController::focusLost(const FocusEvent& e) throw( R if (xCommitable.is()) xCommitable->commit(); else - OSL_ENSURE(sal_False, "SbaXDataBrowserController::focusLost : why is my control not commitable ?"); + OSL_FAIL("SbaXDataBrowserController::focusLost : why is my control not commitable ?"); } // ------------------------------------------------------------------------- @@ -1206,34 +1228,16 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t } - // the filter or the sort criterias have changed ? -> update our parser - if (evt.PropertyName.equals(PROPERTY_ACTIVECOMMAND)) - { - // if (m_xParser.is()) - //DO_SAFE( m_xParser->setElementaryQuery(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new query to my parser !" ); - } - else if (evt.PropertyName.equals(PROPERTY_FILTER)) + if (evt.PropertyName.equals(PROPERTY_FILTER)) { - // if ( m_xParser.is() && m_xParser->getFilter() != ::comphelper::getString(evt.NewValue)) - //{ - // DO_SAFE( m_xParser->setFilter(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" ); - //} InvalidateFeature(ID_BROWSER_REMOVEFILTER); } else if (evt.PropertyName.equals(PROPERTY_HAVING_CLAUSE)) { - //if ( m_xParser.is() && m_xParser->getHavingClause() != ::comphelper::getString(evt.NewValue)) - //{ - // DO_SAFE( m_xParser->setHavingClause(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new filter to my parser !" ); - //} InvalidateFeature(ID_BROWSER_REMOVEFILTER); } else if (evt.PropertyName.equals(PROPERTY_ORDER)) { - //if ( m_xParser.is() && m_xParser->getOrder() != ::comphelper::getString(evt.NewValue)) - //{ - // DO_SAFE( m_xParser->setOrder(::comphelper::getString(evt.NewValue)), "SbaXDataBrowserController::propertyChange : could not forward the new order to my parser !" ); - //} InvalidateFeature(ID_BROWSER_REMOVEFILTER); } @@ -1259,7 +1263,7 @@ void SbaXDataBrowserController::modified(const ::com::sun::star::lang::EventObje void SbaXDataBrowserController::elementInserted(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementInserted" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementInserted: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xNewColumn(evt.Element,UNO_QUERY); if ( xNewColumn.is() ) @@ -1270,7 +1274,7 @@ void SbaXDataBrowserController::elementInserted(const ::com::sun::star::containe void SbaXDataBrowserController::elementRemoved(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementRemoved" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementRemoved: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xOldColumn(evt.Element,UNO_QUERY); if ( xOldColumn.is() ) @@ -1281,7 +1285,7 @@ void SbaXDataBrowserController::elementRemoved(const ::com::sun::star::container void SbaXDataBrowserController::elementReplaced(const ::com::sun::star::container::ContainerEvent& evt) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::elementReplaced" ); - DBG_ASSERT(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), + OSL_ENSURE(Reference< XInterface >(evt.Source, UNO_QUERY).get() == Reference< XInterface >(getControlModel(), UNO_QUERY).get(), "SbaXDataBrowserController::elementReplaced: where did this come from (not from the grid model)?!"); Reference< XPropertySet > xOldColumn(evt.ReplacedElement,UNO_QUERY); if ( xOldColumn.is() ) @@ -1296,7 +1300,7 @@ void SbaXDataBrowserController::elementReplaced(const ::com::sun::star::containe sal_Bool SbaXDataBrowserController::suspend(sal_Bool /*bSuspend*/) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::suspend" ); - DBG_ASSERT(m_nPendingLoadFinished == 0, "SbaXDataBrowserController::suspend : there shouldn't be a pending load !"); + OSL_ENSURE(m_nPendingLoadFinished == 0, "SbaXDataBrowserController::suspend : there shouldn't be a pending load !"); m_aAsyncGetCellFocus.CancelCall(); m_aAsyncDisplayError.CancelCall(); @@ -1424,7 +1428,7 @@ IMPL_LINK( SbaXDataBrowserController, OnAsyncDisplayError, void*, /* _pNotIntere //------------------------------------------------------------------------------ void SbaXDataBrowserController::errorOccured(const ::com::sun::star::sdb::SQLErrorEvent& aEvent) throw( RuntimeException ) { - RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::errorOccured" ); + RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::errorOccurred" ); ::osl::MutexGuard aGuard( getMutex() ); SQLExceptionInfo aInfo( aEvent.Reason ); @@ -1433,7 +1437,7 @@ void SbaXDataBrowserController::errorOccured(const ::com::sun::star::sdb::SQLErr if ( m_nFormActionNestingLevel ) { - OSL_ENSURE( !m_aCurrentError.isValid(), "SbaXDataBrowserController::errorOccured: can handle one error per transaction only!" ); + OSL_ENSURE( !m_aCurrentError.isValid(), "SbaXDataBrowserController::errorOccurred: can handle one error per transaction only!" ); m_aCurrentError = aInfo; } else @@ -1450,19 +1454,12 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for if (aEvent.Source != getRowSet()) { // not my data source -> allow anything - DBG_ERROR("SbaXDataBrowserController::approveParameter : invalid event source !"); + OSL_FAIL("SbaXDataBrowserController::approveParameter : invalid event source !"); return sal_True; } Reference< ::com::sun::star::container::XIndexAccess > xParameters = aEvent.Parameters; SolarMutexGuard aSolarGuard; - // this may be executed in a non-main thread and we want to use vcl ... - Window* pParent = Application::GetDefDialogParent(); - // don't use the content as parent if it isn't visible - // (and don't use NULL as parent : this may be displayed in the beamer and really shouldn't be task-local) - // 69297 - FS - 25.10.99 - if (getBrowserView() && getBrowserView()->IsVisible()) - pParent = getBrowserView(); // default handling: instantiate an interaction handler and let it handle the parameter request try @@ -1495,7 +1492,7 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for Sequence< PropertyValue > aFinalValues = pParamValues->getValues(); if (aFinalValues.getLength() != aRequest.Parameters->getCount()) { - DBG_ERROR("SbaXDataBrowserController::approveParameter: the InteractionHandler returned nonsense!"); + OSL_FAIL("SbaXDataBrowserController::approveParameter: the InteractionHandler returned nonsense!"); setLoadingCancelled(); return sal_False; } @@ -1504,18 +1501,18 @@ sal_Bool SbaXDataBrowserController::approveParameter(const ::com::sun::star::for { Reference< XPropertySet > xParam; ::cppu::extractInterface(xParam, aRequest.Parameters->getByIndex(i)); - DBG_ASSERT(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); + OSL_ENSURE(xParam.is(), "SbaXDataBrowserController::approveParameter: one of the parameters is no property set!"); if (xParam.is()) { #ifdef DBG_UTIL ::rtl::OUString sName; xParam->getPropertyValue(PROPERTY_NAME) >>= sName; - DBG_ASSERT(sName.equals(pFinalValues->Name), "SbaXDataBrowserController::approveParameter: suspicious value names!"); + OSL_ENSURE(sName.equals(pFinalValues->Name), "SbaXDataBrowserController::approveParameter: suspicious value names!"); #endif try { xParam->setPropertyValue(PROPERTY_VALUE, pFinalValues->Value); } catch(Exception&) { - DBG_ERROR("SbaXDataBrowserController::approveParameter: setting one of the properties failed!"); + OSL_FAIL("SbaXDataBrowserController::approveParameter: setting one of the properties failed!"); } } } @@ -1540,7 +1537,7 @@ sal_Bool SbaXDataBrowserController::approveReset(const ::com::sun::star::lang::E void SbaXDataBrowserController::resetted(const ::com::sun::star::lang::EventObject& rEvent) throw( RuntimeException ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::resetted" ); - DBG_ASSERT(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); + OSL_ENSURE(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); (void)rEvent; setCurrentModified( sal_False ); } @@ -1600,7 +1597,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const try { Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); - OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString::createFromAscii( "AllowInserts" ) ) >>= bAllowInsertions ); + OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowInserts")) ) >>= bAllowInsertions ); } catch( const Exception& ) { @@ -1619,7 +1616,7 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const try { Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); - OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString::createFromAscii( "AllowDeletes" ) ) >>= bAllowDeletions ); + OSL_VERIFY( xRowSetProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowDeletes")) ) >>= bAllowDeletions ); OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ROWCOUNT ) >>= nRowCount ); OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ISNEW ) >>= bInsertionRow ); } @@ -1736,9 +1733,9 @@ FeatureState SbaXDataBrowserController::GetState(sal_uInt16 nId) const break; // no datasource -> no edit mode sal_Int32 nDataSourcePrivileges = ::comphelper::getINT32(xDataSourceSet->getPropertyValue(PROPERTY_PRIVILEGES)); - sal_Bool bInsertAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::INSERT) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowInserts"))); - sal_Bool bUpdateAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::UPDATE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowUpdates"))); - sal_Bool bDeleteAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::DELETE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString::createFromAscii("AllowDeletes"))); + sal_Bool bInsertAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::INSERT) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowInserts")))); + sal_Bool bUpdateAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::UPDATE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowUpdates")))); + sal_Bool bDeleteAllowedAndPossible = ((nDataSourcePrivileges & ::com::sun::star::sdbcx::Privilege::DELETE) != 0) && ::comphelper::getBOOL(xDataSourceSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AllowDeletes")))); if (!bInsertAllowedAndPossible && !bUpdateAllowedAndPossible && !bDeleteAllowedAndPossible) break; // no insert/update/delete -> no edit mode @@ -1788,7 +1785,7 @@ void SbaXDataBrowserController::applyParserOrder(const ::rtl::OUString& _rOldOrd Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY); if (!m_xLoadable.is()) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::applyParserOrder: invalid row set!"); + OSL_FAIL("SbaXDataBrowserController::applyParserOrder: invalid row set!"); return; } @@ -1806,7 +1803,6 @@ void SbaXDataBrowserController::applyParserOrder(const ::rtl::OUString& _rOldOrd if (!bSuccess) { xFormSet->setPropertyValue(PROPERTY_ORDER, makeAny(_rOldOrder)); - //DO_SAFE( _xParser->setOrder(_rOldOrder), "SbaXDataBrowserController::applyParserOrder: could not restore the old order of my parser !" ); try { @@ -1831,7 +1827,7 @@ void SbaXDataBrowserController::applyParserFilter(const ::rtl::OUString& _rOldFi Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY); if (!m_xLoadable.is()) { - OSL_ENSURE(sal_False, "SbaXDataBrowserController::applyParserFilter: invalid row set!"); + OSL_FAIL("SbaXDataBrowserController::applyParserFilter: invalid row set!"); return; } @@ -1872,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) @@ -1912,12 +1933,8 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) { DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ); String aFilter; - if(!aDlg.Execute()) - { - //m_xParser->setFilter(sOldVal); - //m_xParser->setHavingClause(sOldHaving); - 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 @@ -1926,7 +1943,6 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) String aOrder; if(!aDlg.Execute()) { - //m_xParser->setOrder(sOldVal); return; // if so we don't need to actualize the grid } aDlg.BuildOrderPart(); @@ -1969,11 +1985,11 @@ void SbaXDataBrowserController::ExecuteSearch() RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::ExecuteSearch" ); // calculate the control source of the active field Reference< ::com::sun::star::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); - DBG_ASSERT(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have an ::com::sun::star::form::XGrid interface !"); + OSL_ENSURE(xGrid.is(), "SbaXDataBrowserController::ExecuteSearch : the control should have an ::com::sun::star::form::XGrid interface !"); Reference< ::com::sun::star::form::XGridPeer > xGridPeer(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY); Reference< ::com::sun::star::container::XIndexContainer > xColumns = xGridPeer->getColumns(); - DBG_ASSERT(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !"); + OSL_ENSURE(xGridPeer.is() && xColumns.is(), "SbaXDataBrowserController::ExecuteSearch : invalid peer !"); sal_Int16 nViewCol = xGrid->getCurrentColumnPosition(); sal_Int16 nModelCol = getBrowserView()->View2ModelPos(nViewCol); @@ -1987,14 +2003,14 @@ void SbaXDataBrowserController::ExecuteSearch() Reference< XInterface > xCurControl(xColControls->getByIndex(nViewCol),UNO_QUERY); ::rtl::OUString aInitialText; if (IsSearchableControl(xCurControl, &aInitialText)) - sInitialText = (const sal_Unicode*)aInitialText; + sInitialText = aInitialText; // prohibit the synchronization of the grid's display with the cursor's position Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!"); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_False))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("AlwaysShowCursor"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("CursorColor"), makeAny(sal_Int32(COL_LIGHTRED))); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!"); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_False))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), makeAny(sal_Int32(COL_LIGHTRED))); Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS(::dbtools::getNumberFormats(::dbtools::getConnection(m_xRowSet), sal_True,getORB())); @@ -2006,7 +2022,7 @@ void SbaXDataBrowserController::ExecuteSearch() aContextNames.push_back( String::CreateFromAscii("Standard") ); pDialog = pFact->CreateFmSearchDialog(getBrowserView(), sInitialText, aContextNames, 0, LINK(this, SbaXDataBrowserController, OnSearchContextRequest)); } - DBG_ASSERT( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); + OSL_ENSURE( pDialog, "SbaXDataBrowserController::ExecuteSearch: could not get the search dialog!" ); if ( pDialog ) { pDialog->SetActiveField( sActiveField ); @@ -2017,9 +2033,9 @@ void SbaXDataBrowserController::ExecuteSearch() } // restore the grid's normal operating state - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("AlwaysShowCursor"), ::comphelper::makeBoolAny(sal_Bool(sal_False))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("CursorColor"), Any()); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AlwaysShowCursor")), ::comphelper::makeBoolAny(sal_Bool(sal_False))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CursorColor")), Any()); } //------------------------------------------------------------------------------ @@ -2047,7 +2063,7 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property } catch(Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } break; case SID_FM_DELETEROWS: @@ -2119,7 +2135,6 @@ void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< Property // should be intercepted by GetState. Normally. // Unfortunately ID_BROWSER_PASTE is a 'fast call' slot, which means it may be executed without checking if it is // enabled. This would be really deadly herein if the current cell has no controller ... - // (FS - 13.04.99 - #64694#) return; Edit& rEdit = (Edit&)xCurrentController->GetWindow(); @@ -2381,7 +2396,7 @@ sal_Bool SbaXDataBrowserController::SaveModified(sal_Bool bAskFor) } catch(Exception&) { - DBG_ERROR("SbaXDataBrowserController::SaveModified : could not save the current record !"); + OSL_FAIL("SbaXDataBrowserController::SaveModified : could not save the current record !"); bResult = sal_False; } @@ -2524,9 +2539,9 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p // check all grid columns for their control source Reference< ::com::sun::star::container::XIndexAccess > xModelColumns(getFormComponent(), UNO_QUERY); - DBG_ASSERT(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !"); + OSL_ENSURE(xModelColumns.is(), "SbaXDataBrowserController::OnSearchContextRequest : there is a grid control without columns !"); // the case 'no columns' should be indicated with an empty container, I think ... - DBG_ASSERT(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !"); + OSL_ENSURE(xModelColumns->getCount() >= xPeerContainer->getCount(), "SbaXDataBrowserController::OnSearchContextRequest : impossible : have more view than model columns !"); String sFieldList; for (sal_Int32 nViewPos=0; nViewPos<xPeerContainer->getCount(); ++nViewPos) @@ -2535,15 +2550,15 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p if (!xCurrentColumn.is()) continue; - // can we use this column control fo searching ? + // can we use this column control for searching ? if (!IsSearchableControl(xCurrentColumn)) continue; sal_uInt16 nModelPos = getBrowserView()->View2ModelPos((sal_uInt16)nViewPos); Reference< XPropertySet > xCurrentColModel(xModelColumns->getByIndex(nModelPos),UNO_QUERY); - ::rtl::OUString aName = ::comphelper::getString(xCurrentColModel->getPropertyValue(PROPERTY_CONTROLSOURCE)); + String aName = ::comphelper::getString(xCurrentColModel->getPropertyValue(PROPERTY_CONTROLSOURCE)); - sFieldList += (const sal_Unicode*)aName; + sFieldList += aName; sFieldList += ';'; pContext->arrFields.push_back(xCurrentColumn); @@ -2555,7 +2570,7 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p // if the cursor is in a mode other than STANDARD -> reset Reference< XPropertySet > xCursorSet(pContext->xCursor, UNO_QUERY); - DBG_ASSERT(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)), + OSL_ENSURE(xCursorSet.is() && !::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISMODIFIED)), "SbaXDataBrowserController::OnSearchContextRequest : please do not call for cursors with modified rows !"); if (xCursorSet.is() && ::comphelper::getBOOL(xCursorSet->getPropertyValue(PROPERTY_ISNEW))) { @@ -2569,17 +2584,17 @@ IMPL_LINK(SbaXDataBrowserController, OnSearchContextRequest, FmSearchContext*, p IMPL_LINK(SbaXDataBrowserController, OnFoundData, FmFoundRecordInformation*, pInfo) { Reference< ::com::sun::star::sdbcx::XRowLocate > xCursor(getRowSet(), UNO_QUERY); - DBG_ASSERT(xCursor.is(), "SbaXDataBrowserController::OnFoundData : shit happens. sometimes. but this is simply impossible !"); + OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnFoundData : shit happens. sometimes. but this is simply impossible !"); // move the cursor xCursor->moveToBookmark(pInfo->aPosition); // let the grid snyc it's display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!"); - Any aOld = xModelSet->getPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron")); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), aOld); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnFoundData : no model set ?!"); + Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron"))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), aOld); // and move to the field Reference< ::com::sun::star::container::XIndexAccess > aColumnControls(getBrowserView()->getGridControl()->getPeer(), UNO_QUERY); @@ -2610,7 +2625,7 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio try { - DBG_ASSERT(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : shit happens. sometimes. but this is simply impossible !"); + OSL_ENSURE(xCursor.is(), "SbaXDataBrowserController::OnCanceledNotFound : shit happens. sometimes. but this is simply impossible !"); // move the cursor xCursor->moveToBookmark(pInfo->aPosition); } @@ -2621,12 +2636,12 @@ IMPL_LINK(SbaXDataBrowserController, OnCanceledNotFound, FmFoundRecordInformatio try { - // let the grid snyc it's display with the cursor + // let the grid snyc its display with the cursor Reference< XPropertySet > xModelSet(getControlModel(), UNO_QUERY); - DBG_ASSERT(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!"); - Any aOld = xModelSet->getPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron")); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), ::comphelper::makeBoolAny(sal_Bool(sal_True))); - xModelSet->setPropertyValue(::rtl::OUString::createFromAscii("DisplayIsSynchron"), aOld); + OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::OnCanceledNotFound : no model set ?!"); + Any aOld = xModelSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron"))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), ::comphelper::makeBoolAny(sal_Bool(sal_True))); + xModelSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DisplayIsSynchron")), aOld); } catch( const Exception& ) { @@ -2708,22 +2723,7 @@ 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; -/* - const Reference<XMultiServiceFactory> xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY); - if ( xFactory.is() ) - m_xParser.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY); -*/ - } -/* - // initialize the parser with the current sql-statement of the form - if ( m_xParser.is() ) - { - m_xParser->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND))); - m_xParser->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER))); - m_xParser->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE))); - m_xParser->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER))); } -*/ } catch(Exception&) { @@ -2754,21 +2754,11 @@ void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/) throw( R RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaui", "Ocke.Janssen@sun.com", "SbaXDataBrowserController::unloaded" ); m_xParser.clear(); InvalidateAll(); - // do this asynchron, there are other listeners reacting on this message ... + // do this asynchronously, there are other listeners reacting on this message ... // (it's a little hack : the grid columns are listening to this event, too, and their bound field may // change as a reaction on that event. as we have no chance to be notified of this change (which is // the one we're interested in) we give them time to do what they want to before invalidating our // bound-field-dependent slots .... - /* - try - { - ::comphelper::disposeComponent(m_xParser); - } - catch(Exception&) - { - OSL_ENSURE(0,"Exception thrown by dispose"); - } - */ } //------------------------------------------------------------------------------ @@ -2802,7 +2792,7 @@ void SbaXDataBrowserController::enterFormAction() //------------------------------------------------------------------------------ void SbaXDataBrowserController::leaveFormAction() { - DBG_ASSERT( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" ); + OSL_ENSURE( m_nFormActionNestingLevel > 0, "SbaXDataBrowserController::leaveFormAction : invalid call !" ); if ( --m_nFormActionNestingLevel > 0 ) return; @@ -2838,7 +2828,7 @@ sal_Bool SbaXDataBrowserController::isValidCursor() const { bIsValid = m_xParser.is(); } - } // if ( !bIsValid ) + } return bIsValid; } @@ -2927,7 +2917,7 @@ void LoadFormHelper::implDispose() void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); - DBG_ASSERT(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); + OSL_ENSURE(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); if (m_eState == STARTED) m_eState = LOADED; } @@ -2936,7 +2926,7 @@ void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& void SAL_CALL LoadFormHelper::unloaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); - DBG_ERROR("LoadFormHelper::unloaded : shouldn't be called !"); + OSL_FAIL("LoadFormHelper::unloaded : shouldn't be called !"); implDispose(); } diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 6929a9ee162b..337cd3b01177 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -41,13 +41,13 @@ #include <com/sun/star/form/XLoadable.hpp> #include <com/sun/star/awt/XControlContainer.hpp> #include "UITools.hxx" +#include <osl/diagnose.h> using namespace dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::form; -// using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; @@ -105,7 +105,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont // create the (UNO-) control m_xGrid = new SbaXGridControl(getORB()); - DBG_ASSERT(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !"); + OSL_ENSURE(m_xGrid.is(), "UnoDataBrowserView::Construct : could not create a grid control !"); // in design mode (for the moment) m_xGrid->setDesignMode(sal_True); @@ -123,7 +123,7 @@ void UnoDataBrowserView::Construct(const Reference< ::com::sun::star::awt::XCont m_pVclControl = NULL; getVclControl(); - DBG_ASSERT(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); + OSL_ENSURE(m_pVclControl != NULL, "UnoDataBrowserView::Construct : no real grid control !"); } catch(Exception&) { @@ -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 c0e3157bfb75..ff4817eba056 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 21b4fc2d2172..0273c7f5a746 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/dbloader.cxx b/dbaccess/source/ui/browser/dbloader.cxx index bb4ae9b35b28..244347057906 100644 --- a/dbaccess/source/ui/browser/dbloader.cxx +++ b/dbaccess/source/ui/browser/dbloader.cxx @@ -93,7 +93,7 @@ public: // static methods static ::rtl::OUString getImplementationName_Static() throw( ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.DBContentLoader"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.DBContentLoader")); } static Sequence< ::rtl::OUString> getSupportedServiceNames_Static(void) throw( ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > @@ -161,8 +161,8 @@ Sequence< ::rtl::OUString > SAL_CALL DBContentLoader::getSupportedServiceNames(v Sequence< ::rtl::OUString > DBContentLoader::getSupportedServiceNames_Static(void) throw( ) { Sequence< ::rtl::OUString > aSNS( 2 ); - aSNS.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.frame.FrameLoader"); - aSNS.getArray()[1] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.ContentLoader"); + aSNS.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.FrameLoader")); + aSNS.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ContentLoader")); return aSNS; } // ------------------------------------------------------------------------- @@ -171,17 +171,17 @@ extern "C" void SAL_CALL writeDBLoaderInfo(void* pRegistryKey) Reference< XRegistryKey> xKey(reinterpret_cast< XRegistryKey*>(pRegistryKey)); // register content loader for dispatch - ::rtl::OUString aImpl = ::rtl::OUString::createFromAscii("/"); + ::rtl::OUString aImpl(RTL_CONSTASCII_USTRINGPARAM("/")); aImpl += DBContentLoader::getImplementationName_Static(); ::rtl::OUString aImpltwo = aImpl; - aImpltwo += ::rtl::OUString::createFromAscii("/UNO/Loader"); + aImpltwo += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/Loader")); Reference< XRegistryKey> xNewKey = xKey->createKey( aImpltwo ); aImpltwo = aImpl; - aImpltwo += ::rtl::OUString::createFromAscii("/Loader"); + aImpltwo += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/Loader")); Reference< XRegistryKey > xLoaderKey = xKey->createKey( aImpltwo ); - xNewKey = xLoaderKey->createKey( ::rtl::OUString::createFromAscii("Pattern") ); - xNewKey->setAsciiValue( ::rtl::OUString::createFromAscii(".component:DB*") ); + xNewKey = xLoaderKey->createKey( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Pattern")) ); + xNewKey->setAsciiValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".component:DB*")) ); } // ----------------------------------------------------------------------- @@ -229,7 +229,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: // if a data source browser is loaded without its tree pane, then we assume it to be a // table data view, effectively. In this case, we need to adjust the module identifier. - // 2008-02-05 / i85879 / frank.schoenheit@sun.com + // #i85879# ::comphelper::NamedValueCollection aLoadArgs( rArgs ); if ( sComponentURL == URL_COMPONENT_DATASOURCEBROWSER ) @@ -307,7 +307,7 @@ void SAL_CALL DBContentLoader::load(const Reference< XFrame > & rFrame, const :: try { Reference<XInitialization > xIni(xController,UNO_QUERY); - PropertyValue aFrame(::rtl::OUString::createFromAscii("Frame"),0,makeAny(rFrame),PropertyState_DIRECT_VALUE); + PropertyValue aFrame(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Frame")),0,makeAny(rFrame),PropertyState_DIRECT_VALUE); Sequence< Any > aInitArgs(m_aArgs.getLength()+1); Any* pBegin = aInitArgs.getArray(); diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index b0afe70a5fe1..12ce3ed3925a 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 26c7860a474e..f9fe22be550b 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -33,7 +33,7 @@ #include "browserids.hxx" #include "listviewitems.hxx" #include "imageprovider.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbtreeview.hxx" #include "dbtreelistbox.hxx" #include "dbu_brw.hrc" @@ -50,7 +50,7 @@ namespace dbaui // ----------------------------------------------------------------------------- SbaTableQueryBrowser::EntryType SbaTableQueryBrowser::getChildType( SvLBoxEntry* _pEntry ) const { - DBG_ASSERT(isContainer(_pEntry), "SbaTableQueryBrowser::getChildType: invalid entry!"); + OSL_ENSURE(isContainer(_pEntry), "SbaTableQueryBrowser::getChildType: invalid entry!"); switch (getEntryType(_pEntry)) { case etTableContainer: @@ -125,7 +125,7 @@ void SbaTableQueryBrowser::select(SvLBoxEntry* _pEntry, sal_Bool _bSelect) m_pTreeModel->InvalidateEntry(_pEntry); } else { - DBG_ERROR("SbaTableQueryBrowser::select: invalid entry!"); + OSL_FAIL("SbaTableQueryBrowser::select: invalid entry!"); } } @@ -145,7 +145,7 @@ sal_Bool SbaTableQueryBrowser::isSelected(SvLBoxEntry* _pEntry) const if (pTextItem) return static_cast<OBoldListboxString*>(pTextItem)->isEmphasized(); else { - DBG_ERROR("SbaTableQueryBrowser::isSelected: invalid entry!"); + OSL_FAIL("SbaTableQueryBrowser::isSelected: invalid entry!"); } return sal_False; } @@ -157,7 +157,7 @@ void SbaTableQueryBrowser::SelectionChanged() InvalidateFeature(ID_BROWSER_INSERTCOLUMNS); InvalidateFeature(ID_BROWSER_INSERTCONTENT); InvalidateFeature(ID_BROWSER_FORMLETTER); - } // if ( !m_bShowMenu ) + } InvalidateFeature(ID_BROWSER_COPY); InvalidateFeature(ID_BROWSER_CUT); } @@ -200,7 +200,7 @@ sal_Int32 SbaTableQueryBrowser::getDatabaseObjectType( EntryType _eType ) default: break; } - OSL_ENSURE( false, "SbaTableQueryBrowser::getDatabaseObjectType: folder types and 'Unknown' not allowed here!" ); + OSL_FAIL( "SbaTableQueryBrowser::getDatabaseObjectType: folder types and 'Unknown' not allowed here!" ); return DatabaseObject::TABLE; } @@ -224,31 +224,27 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() ::std::auto_ptr< ImageProvider > pImageProvider( getImageProviderFor( pEntryLoop ) ); // the images for this entry - Image aImage, aImageHC; + Image aImage; if ( pData->eType == etDatasource ) - { - aImage = pImageProvider->getDatabaseImage( false ); - aImageHC = pImageProvider->getDatabaseImage( true ); - } + aImage = pImageProvider->getDatabaseImage(); else { bool bIsFolder = !isObject( pData->eType ); if ( bIsFolder ) { sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); - aImage = pImageProvider->getFolderImage( nObjectType, false ); - aImageHC = pImageProvider->getFolderImage( nObjectType, true ); + aImage = pImageProvider->getFolderImage( nObjectType ); } else { sal_Int32 nObjectType( getDatabaseObjectType( pData->eType ) ); - pImageProvider->getImages( GetEntryText( pEntryLoop ), nObjectType, aImage, aImageHC ); + pImageProvider->getImages( GetEntryText( pEntryLoop ), nObjectType, aImage ); } } // 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 ) ) @@ -256,10 +252,8 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() SvLBoxContextBmp* pContextBitmapItem = static_cast< SvLBoxContextBmp* >( pItem ); - pContextBitmapItem->SetBitmap1( aImage, BMP_COLOR_NORMAL ); - pContextBitmapItem->SetBitmap2( aImage, BMP_COLOR_NORMAL ); - pContextBitmapItem->SetBitmap1( aImageHC, BMP_COLOR_HIGHCONTRAST ); - pContextBitmapItem->SetBitmap2( aImageHC, BMP_COLOR_HIGHCONTRAST ); + pContextBitmapItem->SetBitmap1( aImage ); + pContextBitmapItem->SetBitmap2( aImage ); break; } diff --git a/dbaccess/source/ui/browser/dsbrowserDnD.cxx b/dbaccess/source/ui/browser/dsbrowserDnD.cxx index 9497d08f5076..3baafb3e860f 100644 --- a/dbaccess/source/ui/browser/dsbrowserDnD.cxx +++ b/dbaccess/source/ui/browser/dsbrowserDnD.cxx @@ -51,6 +51,7 @@ #include <svtools/treelist.hxx> #include <svx/dataaccessdescriptor.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <functional> // ......................................................................... @@ -137,7 +138,7 @@ namespace dbaui EntryType eEntryType = getEntryType( pHitEntry ); if (!isContainer(eEntryType)) { - DBG_ERROR("SbaTableQueryBrowser::executeDrop: what the hell did queryDrop do?"); + OSL_FAIL("SbaTableQueryBrowser::executeDrop: what the hell did queryDrop do?"); // queryDrop shoud not have allowed us to reach this situation .... return DND_ACTION_NONE; } @@ -278,7 +279,7 @@ namespace dbaui if ( pData->xConnection.is() ) { - DBG_ASSERT( impl_isDataSourceEntry( pEntryLoop ), "SbaTableQueryBrowser::clearTreeModel: no data source entry, but a connection?" ); + OSL_ENSURE( impl_isDataSourceEntry( pEntryLoop ), "SbaTableQueryBrowser::clearTreeModel: no data source entry, but a connection?" ); // connections are to be stored *only* at the data source entries impl_releaseConnection( pData->xConnection ); } diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 6526592112fc..898f78cd3ebe 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; } @@ -154,7 +154,7 @@ void SbaExternalSourceBrowser::modified(const ::com::sun::star::lang::EventObjec void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::URL& aURL, const Sequence< ::com::sun::star::beans::PropertyValue>& aArgs) throw(::com::sun::star::uno::RuntimeException) { const ::com::sun::star::beans::PropertyValue* pArguments = aArgs.getConstArray(); - if (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AddGridColumn"))) + if (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AddGridColumn")))) { // search the argument describing the column to create ::rtl::OUString sControlType; @@ -163,21 +163,21 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U sal_uInt16 i; for ( i = 0; i < aArgs.getLength(); ++i, ++pArguments ) { - if (pArguments->Name.equals(::rtl::OUString::createFromAscii("ColumnType"))) + if (pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnType")))) { sal_Bool bCorrectType = pArguments->Value.getValueType().equals(::getCppuType((const ::rtl::OUString*)0)); OSL_ENSURE(bCorrectType, "invalid type for argument \"ColumnType\" !"); if (bCorrectType) sControlType = ::comphelper::getString(pArguments->Value); } - else if (pArguments->Name.equals(::rtl::OUString::createFromAscii("ColumnPosition"))) + else if (pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnPosition")))) { sal_Bool bCorrectType = pArguments->Value.getValueType().equals(::getCppuType((const sal_Int16*)0)); OSL_ENSURE(bCorrectType, "invalid type for argument \"ColumnPosition\" !"); if (bCorrectType) nControlPos = ::comphelper::getINT16(pArguments->Value); } - else if (pArguments->Name.equals(::rtl::OUString::createFromAscii("ColumnProperties"))) + else if (pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnProperties")))) { sal_Bool bCorrectType = pArguments->Value.getValueType().equals(::getCppuType((const Sequence< ::com::sun::star::beans::PropertyValue>*)0)); OSL_ENSURE(bCorrectType, "invalid type for argument \"ColumnProperties\" !"); @@ -185,12 +185,12 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U aControlProps = *(Sequence< ::com::sun::star::beans::PropertyValue>*)pArguments->Value.getValue(); } else - OSL_ENSURE(sal_False, ((ByteString("SbaExternalSourceBrowser::dispatch(AddGridColumn) : unknown argument (") += ByteString((const sal_Unicode*)pArguments->Name, gsl_getSystemTextEncoding()).GetBuffer()) += ") !").GetBuffer()); + OSL_FAIL(((ByteString("SbaExternalSourceBrowser::dispatch(AddGridColumn) : unknown argument (") += ByteString((const sal_Unicode*)pArguments->Name, gsl_getSystemTextEncoding()).GetBuffer()) += ") !").GetBuffer()); } if (!sControlType.getLength()) { - OSL_ENSURE(sal_False, "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnType) !"); - sControlType = ::rtl::OUString::createFromAscii("TextField"); + OSL_FAIL("SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnType) !"); + sControlType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextField")); } OSL_ENSURE(aControlProps.getLength(), "SbaExternalSourceBrowser::dispatch(AddGridColumn) : missing argument (ColumnProperties) !"); @@ -200,7 +200,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U Reference< XPropertySetInfo > xNewColProperties; if (xNewCol.is()) xNewColProperties = xNewCol->getPropertySetInfo(); - // set it's properties + // set its properties if (xNewColProperties.is()) { const ::com::sun::star::beans::PropertyValue* pControlProps = aControlProps.getConstArray(); @@ -213,8 +213,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U } catch(Exception&) { - OSL_ENSURE(sal_False, - ( ByteString("SbaExternalSourceBrowser::dispatch : could not set a column property (") + OSL_FAIL(( ByteString("SbaExternalSourceBrowser::dispatch : could not set a column property (") += ByteString(pControlProps->Name.getStr(), (sal_uInt16)pControlProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US) += ByteString(")!")).GetBuffer()); } @@ -232,20 +231,20 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U // append the column xColContainer->insertByIndex(nControlPos, makeAny(xNewCol)); } - else if (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/ClearView"))) + else if (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/ClearView")))) { ClearView(); } - else if (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AttachToForm"))) + else if (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AttachToForm")))) { if (!m_pDataSourceImpl) return; Reference< XRowSet > xMasterForm; - // search the arguments for he master form + // search the arguments for the master form for (sal_uInt16 i=0; i<aArgs.getLength(); ++i, ++pArguments) { - if ((pArguments->Name.equals(::rtl::OUString::createFromAscii("MasterForm"))) && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE)) + if ((pArguments->Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MasterForm")))) && (pArguments->Value.getValueTypeClass() == TypeClass_INTERFACE)) { xMasterForm = Reference< XRowSet > (*(Reference< XInterface > *)pArguments->Value.getValue(), UNO_QUERY); break; @@ -253,7 +252,7 @@ void SAL_CALL SbaExternalSourceBrowser::dispatch(const ::com::sun::star::util::U } if (!xMasterForm.is()) { - OSL_ENSURE(sal_False, "SbaExternalSourceBrowser::dispatch(FormSlots/AttachToForm) : please specify a form to attach to as argument !"); + OSL_FAIL("SbaExternalSourceBrowser::dispatch(FormSlots/AttachToForm) : please specify a form to attach to as argument !"); return; } @@ -272,22 +271,22 @@ Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaExternalSourceBrows m_bInQueryDispatch = sal_True; - if ( (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AttachToForm"))) + if ( (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AttachToForm")))) // attach a new external form - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/AddGridColumn"))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/AddGridColumn")))) // add a column to the grid - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/ClearView"))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/ClearView")))) // clear the grid ) xReturn = (::com::sun::star::frame::XDispatch*)this; if ( !xReturn.is() - && ( (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToFirst"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToPrev"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToNext"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToLast"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/moveToNew"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:FormSlots/undoRecord"))) + && ( (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToFirst")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToPrev")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToNext")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToLast")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/moveToNew")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FormSlots/undoRecord")))) ) ) { @@ -300,7 +299,7 @@ Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaExternalSourceBrows m_xUrlTransformer->parseStrict( aNewUrl ); // set a new mark - aNewUrl.Mark = ::rtl::OUString::createFromAscii("DB/FormGridView"); + aNewUrl.Mark = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DB/FormGridView")); // this controller is instantiated when somebody dispatches the ".component:DB/FormGridView" in any // frame, so we use "FormGridView" as mark that a dispatch request came from this view @@ -425,7 +424,7 @@ void SbaExternalSourceBrowser::Attach(const Reference< XRowSet > & xMaster) } catch(Exception&) { - OSL_ENSURE(sal_False, "SbaExternalSourceBrowser::Attach : couldn't restore the cursor position !"); + OSL_FAIL("SbaExternalSourceBrowser::Attach : couldn't restore the cursor position !"); } } diff --git a/dbaccess/source/ui/browser/formadapter.cxx b/dbaccess/source/ui/browser/formadapter.cxx index 2a02d3827f56..913a491b0c0f 100644 --- a/dbaccess/source/ui/browser/formadapter.cxx +++ b/dbaccess/source/ui/browser/formadapter.cxx @@ -31,6 +31,7 @@ #include "formadapter.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/types.hxx> #include <comphelper/enumhelper.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -192,7 +193,7 @@ void SbaXFormAdapter::AttachForm(const Reference< ::com::sun::star::sdbc::XRowSe if (xNewMaster == m_xMainForm) return; - DBG_ASSERT(xNewMaster.get() != static_cast< ::com::sun::star::sdbc::XRowSet* >(this), "SbaXFormAdapter::AttachForm : invalid argument !"); + OSL_ENSURE(xNewMaster.get() != static_cast< ::com::sun::star::sdbc::XRowSet* >(this), "SbaXFormAdapter::AttachForm : invalid argument !"); if (m_xMainForm.is()) { @@ -1078,52 +1079,52 @@ IMPLEMENT_LISTENER_ADMINISTRATION(SbaXFormAdapter, form, SubmitListener, m_aSubm // ------------------------------------------------------------------------- sal_Bool SAL_CALL SbaXFormAdapter::getGroupControl() throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroupControl : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroupControl : not supported !"); return sal_False; } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::setGroupControl(sal_Bool /*GroupControl*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::setGroupControl : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::setGroupControl : not supported !"); } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::setControlModels(const Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*Controls*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::setControlModels : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::setControlModels : not supported !"); } // ------------------------------------------------------------------------- Sequence< Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL SbaXFormAdapter::getControlModels() throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getControlModels : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getControlModels : not supported !"); return Sequence< Reference< ::com::sun::star::awt::XControlModel > >(); } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::setGroup(const Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*_rGroup*/, const ::rtl::OUString& /*GroupName*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::setGroup : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::setGroup : not supported !"); } // ------------------------------------------------------------------------- sal_Int32 SAL_CALL SbaXFormAdapter::getGroupCount() throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroupCount : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroupCount : not supported !"); return 0; } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::getGroup(sal_Int32 /*nGroup*/, Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*_rGroup*/, ::rtl::OUString& /*Name*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroup : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroup : not supported !"); } // ------------------------------------------------------------------------- void SAL_CALL SbaXFormAdapter::getGroupByName(const ::rtl::OUString& /*Name*/, Sequence< Reference< ::com::sun::star::awt::XControlModel > >& /*_rGroup*/) throw( RuntimeException ) { - DBG_ERROR("SAL_CALL SbaXFormAdapter::getGroupByName : not supported !"); + OSL_FAIL("SAL_CALL SbaXFormAdapter::getGroupByName : not supported !"); } // ::com::sun::star::lang::XComponent @@ -1188,7 +1189,7 @@ void SAL_CALL SbaXFormAdapter::removeEventListener(const Reference< ::com::sun:: void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any& aValue) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, RuntimeException ) { Reference< ::com::sun::star::beans::XFastPropertySet > xSet(m_xMainForm, UNO_QUERY); - DBG_ASSERT(xSet.is(), "SAL_CALL SbaXFormAdapter::setFastPropertyValue : have no master form !"); + OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::setFastPropertyValue : have no master form !"); if (m_nNamePropHandle == nHandle) { @@ -1221,7 +1222,7 @@ void SAL_CALL SbaXFormAdapter::setFastPropertyValue(sal_Int32 nHandle, const Any Any SAL_CALL SbaXFormAdapter::getFastPropertyValue(sal_Int32 nHandle) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, RuntimeException ) { Reference< ::com::sun::star::beans::XFastPropertySet > xSet(m_xMainForm, UNO_QUERY); - DBG_ASSERT(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !"); + OSL_ENSURE(xSet.is(), "SAL_CALL SbaXFormAdapter::getFastPropertyValue : have no master form !"); if (m_nNamePropHandle == nHandle) return makeAny(m_sName); @@ -1315,7 +1316,7 @@ Sequence< Any > SAL_CALL SbaXFormAdapter::getPropertyValues(const Sequence< ::rt // search for (and fake) the NAME property const ::rtl::OUString* pNames = aPropertyNames.getConstArray(); Any* pValues = aReturn.getArray(); - DBG_ASSERT(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); + OSL_ENSURE(aReturn.getLength() == aPropertyNames.getLength(), "SAL_CALL SbaXFormAdapter::getPropertyValues : the main form returned an invalid-length sequence !"); for (sal_Int32 i=0; i<aPropertyNames.getLength(); ++i, ++pNames, ++pValues) if (pNames->equals(PROPERTY_NAME)) { @@ -1497,7 +1498,7 @@ void SbaXFormAdapter::implInsert(const Any& aElement, sal_Int32 nIndex, const :: if (sal::static_int_cast< sal_uInt32 >(nIndex) > m_aChildren.size()) nIndex = m_aChildren.size(); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::implInsert : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::implInsert : inconsistent container state !"); m_aChildren.insert(m_aChildren.begin() + nIndex, xElement); m_aChildNames.insert(m_aChildNames.begin() + nIndex, sName); @@ -1616,7 +1617,7 @@ void SAL_CALL SbaXFormAdapter::removeByIndex(sal_Int32 _rIndex) throw( ::com::su Reference< ::com::sun::star::form::XFormComponent > xAffected = *(m_aChildren.begin() + _rIndex); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::removeByIndex : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::removeByIndex : inconsistent container state !"); m_aChildren.erase(m_aChildren.begin() + _rIndex); m_aChildNames.erase(m_aChildNames.begin() + _rIndex); @@ -1675,7 +1676,7 @@ void SAL_CALL SbaXFormAdapter::replaceByIndex(sal_Int32 _rIndex, const Any& Elem Reference< ::com::sun::star::form::XFormComponent > xOld = *(m_aChildren.begin() + _rIndex); - DBG_ASSERT(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::replaceByIndex : inconsistent container state !"); + OSL_ENSURE(m_aChildren.size() == m_aChildNames.size(), "SAL_CALL SbaXFormAdapter::replaceByIndex : inconsistent container state !"); *(m_aChildren.begin() + _rIndex) = xElement; *(m_aChildNames.begin() + _rIndex) = sName; @@ -1750,7 +1751,7 @@ void SAL_CALL SbaXFormAdapter::propertyChange(const ::com::sun::star::beans::Pro if(aIter != m_aChildren.end()) { sal_Int32 nPos = aIter - m_aChildren.begin(); - DBG_ASSERT(*(m_aChildNames.begin() + nPos) == ::comphelper::getString(evt.OldValue), "SAL_CALL SbaXFormAdapter::propertyChange : object has a wrong name !"); + OSL_ENSURE(*(m_aChildNames.begin() + nPos) == ::comphelper::getString(evt.OldValue), "SAL_CALL SbaXFormAdapter::propertyChange : object has a wrong name !"); *(m_aChildNames.begin() + nPos) = ::comphelper::getString(evt.NewValue); } } diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index 6bac728cad62..706d58400c2d 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -35,8 +35,8 @@ #include <vcl/svapp.hxx> #include <toolkit/helper/vclunohelper.hxx> #include "dataview.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "dbustrings.hrc" #include <vcl/stdtext.hxx> #include <cppuhelper/typeprovider.hxx> @@ -64,7 +64,8 @@ #include <rtl/ustring.hxx> #include <rtl/logfile.hxx> #include <algorithm> -#include <hash_map> +#include <o3tl/compat_functional.hxx> +#include <boost/unordered_map.hpp> #include <cppuhelper/implbase1.hxx> #include <limits> @@ -90,7 +91,7 @@ using namespace ::comphelper; #define LAST_USER_DEFINED_FEATURE ( ::std::numeric_limits< sal_uInt16 >::max() ) // ------------------------------------------------------------------------- -typedef ::std::hash_map< sal_Int16, sal_Int16 > CommandHashMap; +typedef ::boost::unordered_map< sal_Int16, sal_Int16 > CommandHashMap; typedef ::std::list< DispatchInformation > DispatchInfoList; @@ -151,7 +152,7 @@ void UserDefinedFeatures::execute( const URL& _rFeatureURL, const Sequence< Prop if ( xDispatch == xController ) { - OSL_ENSURE( false, "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" ); + OSL_FAIL( "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" ); xDispatch.clear(); } @@ -209,7 +210,7 @@ OGenericUnoController::OGenericUnoController(const Reference< XMultiServiceFacto try { - m_xUrlTransformer = Reference< XURLTransformer > (_rM->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer")), UNO_QUERY); + m_xUrlTransformer = Reference< XURLTransformer > (_rM->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY); } catch(Exception&) { @@ -232,7 +233,7 @@ OGenericUnoController::OGenericUnoController() ,m_bReadOnly(sal_False) ,m_bCurrentlyModified(sal_False) { - OSL_ENSURE( false, "OGenericUnoController::OGenericUnoController: illegal call!" ); + OSL_FAIL( "OGenericUnoController::OGenericUnoController: illegal call!" ); // This ctor only exists because the MSVC compiler complained about an unresolved external // symbol. It should not be used at all. Since using it yields strange runtime problems, // we simply abort here. @@ -262,14 +263,14 @@ sal_Bool OGenericUnoController::Construct(Window* /*pParent*/) fillSupportedFeatures(); // create the database context - DBG_ASSERT(getORB().is(), "OGenericUnoController::Construct need a service factory!"); + OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!"); try { m_xDatabaseContext = Reference< XNameAccess >(getORB()->createInstance(SERVICE_SDB_DATABASECONTEXT), UNO_QUERY); } catch(Exception&) { - DBG_ERROR("OGenericUnoController::Construct: could not create (or start listening at) the database context!"); + OSL_FAIL("OGenericUnoController::Construct: could not create (or start listening at) the database context!"); } if (!m_xDatabaseContext.is()) @@ -308,12 +309,6 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen { xFrame.set(aValue.Value,UNO_QUERY_THROW); } - /* #i42316# - else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "ReadOnly" ) ) ) - { - aValue.Value >>= m_bReadOnly; - } - */ else if ( ( *pIter >>= aValue ) && ( 0 == aValue.Name.compareToAscii( "Preview" ) ) ) { aValue.Value >>= m_bPreview; @@ -330,7 +325,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen Window* pParentWin = pParentComponent ? pParentComponent->GetWindow() : NULL; if (!pParentWin) { - throw IllegalArgumentException( ::rtl::OUString::createFromAscii( "Parent window is null" ), *this, 1 ); + throw IllegalArgumentException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Parent window is null")), *this, 1 ); } m_aInitParameters.assign( aArguments ); @@ -338,10 +333,10 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen ODataView* pView = getView(); if ( !pView ) - throw RuntimeException( ::rtl::OUString::createFromAscii( "unable to create a view" ), *this ); + 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(); } @@ -483,7 +478,6 @@ namespace // #i67882# is the bug which was caused by the real fix which we did in framework // #i68216# is the bug which requests to fix the code in Draw which relies on // framework's implementation details - // 2006-08-07 / frank.schoenheit@sun.com if ( !!_rFeatureState.sTitle ) _out_rStates.push_back( makeAny( *_rFeatureState.sTitle ) ); if ( !!_rFeatureState.bChecked ) @@ -545,7 +539,6 @@ void OGenericUnoController::ImplBroadcastFeatureState(const ::rtl::OUString& _rF // it is possible that listeners are registered or revoked while // we are notifying them, so we must use a copy of m_arrStatusListener, not // m_arrStatusListener itself - // #121276# / 2005-05-19 / frank.schoenheit@sun.com Dispatch aNotifyLoop( m_arrStatusListener ); DispatchIterator iterSearch = aNotifyLoop.begin(); DispatchIterator iterEnd = aNotifyLoop.end(); @@ -619,7 +612,7 @@ void OGenericUnoController::InvalidateFeature_Impl() ::rtl::OString sMessage( "OGenericUnoController::InvalidateFeature_Impl: feature id " ); sMessage += ::rtl::OString::valueOf( aNextFeature.nId ); sMessage += ::rtl::OString( " has been invalidated, but is not supported!" ); - OSL_ENSURE( false, sMessage.getStr() ); + OSL_FAIL( sMessage.getStr() ); } #endif if ( m_aSupportedFeatures.end() != aFeaturePos ) @@ -642,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; @@ -674,7 +679,7 @@ void OGenericUnoController::InvalidateAll() void OGenericUnoController::InvalidateAll_Impl() { // --------------------------------- - // invalidate all aupported features + // invalidate all supported features for ( SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.begin(); aIter != m_aSupportedFeatures.end(); @@ -684,7 +689,7 @@ void OGenericUnoController::InvalidateAll_Impl() { ::osl::MutexGuard aGuard( m_aFeatureMutex); - DBG_ASSERT(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!"); + OSL_ENSURE(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!"); m_aFeaturesToInvalidate.pop_front(); if(!m_aFeaturesToInvalidate.empty()) m_aAsyncInvalidateAll.Call(); @@ -768,12 +773,12 @@ void OGenericUnoController::setMasterDispatchProvider(const Reference< XDispatch void OGenericUnoController::dispatch(const URL& _aURL, const Sequence< PropertyValue >& aArgs) throw(RuntimeException) { SolarMutexGuard aSolarGuard; - // Since the fix for #123967#, the SolarMutex is not locked anymore when the framework calls into + // The SolarMutex is not locked anymore when the framework calls into // here. So, lock it ourself. The real solution would be to lock it only in the places // where it's needed, but a) this might turn out difficult, since we then also need to care // for locking in the proper order (SolarMutex and m_aMutex), and b) this would be too many places // for the time frame of the fix. - // #i52602# / frank.schoenheit@sun.com / 2005-07-29 + // #i52602# #ifdef TIMELOG ::rtl::OString sLog( "OGenericUnoController::dispatch( '" ); @@ -793,12 +798,12 @@ void OGenericUnoController::addStatusListener(const Reference< XStatusListener > if ( m_xUrlTransformer.is() ) m_xUrlTransformer->parseStrict( aParsedURL ); - // remeber the listener together with the URL + // remember the listener together with the URL m_arrStatusListener.insert( m_arrStatusListener.end(), DispatchTarget( aParsedURL, aListener ) ); // initially broadcast the state ImplBroadcastFeatureState( aParsedURL.Complete, aListener, sal_True ); - // force the new state to be broadcasted to the new listener + // force the new state to be broadcast to the new listener } // ----------------------------------------------------------------------- @@ -920,7 +925,7 @@ void OGenericUnoController::implDescribeSupportedFeature( const sal_Char* _pAsci sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup ) { #ifdef DBG_UTIL - DBG_ASSERT( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" ); + OSL_ENSURE( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" ); #endif OSL_PRECOND( _nFeatureId < FIRST_USER_DEFINED_FEATURE, "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" ); @@ -1162,7 +1167,7 @@ Reference< XFrame > SAL_CALL OGenericUnoController::getFrame(void) throw( Runtim // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OGenericUnoController::attachModel(const Reference< XModel > & /*xModel*/) throw( RuntimeException ) { - OSL_ENSURE( false, "OGenericUnoController::attachModel: not supported!" ); + OSL_FAIL( "OGenericUnoController::attachModel: not supported!" ); return sal_False; } @@ -1293,7 +1298,7 @@ namespace pReturn = "sbasic"; else { - OSL_ENSURE( sal_False, "lcl_getModuleHelpModuleName: no installed module found" ); + OSL_FAIL( "lcl_getModuleHelpModuleName: no installed module found" ); } } } @@ -1314,7 +1319,7 @@ namespace void OGenericUnoController::openHelpAgent(rtl::OUString const& _suHelpStringURL ) { rtl::OUString suURL(_suHelpStringURL); - rtl::OUString sLanguage = rtl::OUString::createFromAscii("Language="); + rtl::OUString sLanguage(RTL_CONSTASCII_USTRINGPARAM("Language=")); if (suURL.indexOf(sLanguage) == -1) { AppendConfigToken(suURL, sal_False /* sal_False := add '&' */ ); @@ -1325,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 ) @@ -1494,7 +1499,7 @@ sal_uInt16 OGenericUnoController::registerCommandURL( const ::rtl::OUString& _rC ++nFeatureId; if ( nFeatureId == LAST_USER_DEFINED_FEATURE ) { - OSL_ENSURE( false, "OGenericUnoController::registerCommandURL: no more space for user defined features!" ); + OSL_FAIL( "OGenericUnoController::registerCommandURL: no more space for user defined features!" ); return 0L; } @@ -1565,12 +1570,22 @@ Sequence< ::sal_Int16 > SAL_CALL OGenericUnoController::getSupportedCommandGroup ::std::transform( aCmdHashMap.begin(), aCmdHashMap.end(), aCommandGroups.getArray(), - ::std::select1st< CommandHashMap::value_type >() + ::o3tl::select1st< CommandHashMap::value_type >() ); return aCommandGroups; } +namespace +{ + //Current c++0x draft (apparently) has std::identity, but not operator() + template<typename T> struct SGI_identity : public std::unary_function<T,T> + { + T& operator()(T& x) const { return x; } + const T& operator()(const T& x) const { return x; } + }; +} + // ----------------------------------------------------------------------------- Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableDispatchInformation( ::sal_Int16 CommandGroup ) throw (RuntimeException) { @@ -1592,7 +1607,7 @@ Sequence< DispatchInformation > SAL_CALL OGenericUnoController::getConfigurableD ::std::transform( aInformationList.begin(), aInformationList.end(), aInformation.getArray(), - ::std::identity< DispatchInformation >() + SGI_identity< DispatchInformation >() ); return aInformation; diff --git a/dbaccess/source/ui/browser/makefile.mk b/dbaccess/source/ui/browser/makefile.mk index a7dbd7413d78..4d0cbc8f8517 100644 --- a/dbaccess/source/ui/browser/makefile.mk +++ b/dbaccess/source/ui/browser/makefile.mk @@ -37,25 +37,25 @@ TARGET=browser # --- Files -------------------------------------------------------- EXCEPTIONSFILES=\ - $(SLO)$/genericcontroller.obj \ - $(SLO)$/dsbrowserDnD.obj \ - $(SLO)$/dataview.obj \ - $(SLO)$/dbexchange.obj \ - $(SLO)$/dbloader.obj \ - $(SLO)$/sbagrid.obj \ - $(SLO)$/formadapter.obj \ - $(SLO)$/brwview.obj \ - $(SLO)$/brwctrlr.obj \ - $(SLO)$/unodatbr.obj \ - $(SLO)$/sbamultiplex.obj \ + $(SLO)$/AsyncronousLink.obj \ + $(SLO)$/brwctrlr.obj \ + $(SLO)$/brwview.obj \ + $(SLO)$/dataview.obj \ + $(SLO)$/dbexchange.obj \ + $(SLO)$/dbloader.obj \ + $(SLO)$/dbtreemodel.obj \ + $(SLO)$/dbtreeview.obj \ + $(SLO)$/dsEntriesNoExp.obj \ + $(SLO)$/dsbrowserDnD.obj \ $(SLO)$/exsrcbrw.obj \ - $(SLO)$/dbtreemodel.obj \ - $(SLO)$/dsEntriesNoExp.obj \ - $(SLO)$/dbtreeview.obj + $(SLO)$/formadapter.obj \ + $(SLO)$/genericcontroller.obj \ + $(SLO)$/sbagrid.obj \ + $(SLO)$/sbamultiplex.obj \ + $(SLO)$/unodatbr.obj SLOFILES =\ - $(EXCEPTIONSFILES)\ - $(SLO)$/AsyncronousLink.obj + $(EXCEPTIONSFILES) SRS1NAME=$(TARGET) SRC1FILES = sbabrw.src \ diff --git a/dbaccess/source/ui/browser/sbabrw.src b/dbaccess/source/ui/browser/sbabrw.src index 747a2d7ac8cf..eebcc013788d 100644 --- a/dbaccess/source/ui/browser/sbabrw.src +++ b/dbaccess/source/ui/browser/sbabrw.src @@ -33,7 +33,6 @@ #ifndef DBACCESS_UI_BROWSER_ID_HXX #include "browserids.hxx" #endif -// #include <sfx2/sfx.hrc> #ifndef _GLOBLMN_HRC #include <svx/globlmn.hrc> #endif @@ -43,14 +42,12 @@ QueryBox QUERY_BRW_SAVEMODIFIED { Buttons = WB_YES_NO_CANCEL ; DefButton = WB_DEF_YES ; - /* ### ACHTUNG: Neuer Text in Resource? Soll der genderte Datensatz gespeichert werden? : Soll der genderte Datensatz gespeichert werden? */ Message [ en-US ] = "The current record has been changed.\nDo you want to save the changes?" ; }; QueryBox QUERY_BRW_DELETE_ROWS { Buttons = WB_YES_NO ; - /* ### ACHTUNG: Neuer Text in Resource? Sollen die selektierten Daten gelscht werden? : Sollen die selektierten Daten gelscht werden? */ Message [ en-US ] = "Do you want to delete the selected data?" ; }; @@ -63,6 +60,7 @@ String SBA_BROWSER_SETTING_ORDER { Text [ en-US ] = "Error setting the sort criteria"; }; + String SBA_BROWSER_SETTING_FILTER { Text [ en-US ] = "Error setting the filter criteria"; @@ -140,13 +138,13 @@ QueryBox QUERY_BRW_DELETE_QUERY_CONFIRM { Buttons = WB_YES_NO ; Message [ en-US ] = "The query already exists. Do you want to delete it?" ; - }; +}; QueryBox QUERY_CONNECTION_LOST { Buttons = WB_YES_NO ; Message [ en-US ] = "The connection to the database has been lost. Do you want to reconnect?" ; - }; +}; String STR_OPENTABLES_WARNINGS { @@ -161,22 +159,22 @@ String STR_OPENTABLES_WARNINGS_DETAILS String STR_CONNECTING_DATASOURCE { Text [ en-US ] = "Connecting to \"$name$\" ..."; - }; +}; String STR_LOADING_QUERY { Text [ en-US ] = "Loading query $name$ ..."; - }; +}; String STR_LOADING_TABLE { Text [ en-US ] = "Loading table $name$ ..."; - }; +}; String STR_NO_TABLE_FORMAT_INSIDE { Text [ en-US ] = "No table format could be found." ; - }; +}; String STR_COULDNOTCONNECT_DATASOURCE { @@ -190,16 +188,13 @@ 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 1652ed46b094..d80a80281ae3 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -110,6 +110,7 @@ #include <vcl/stdtext.hxx> #include "UITools.hxx" #include "TokenWriter.hxx" +#include <osl/diagnose.h> using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; @@ -160,16 +161,16 @@ Reference< XInterface > SAL_CALL SbaXGridControl::Create(const Reference<XMultiS //------------------------------------------------------------------------------ ::rtl::OUString SbaXGridControl::getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.dbu.SbaXGridControl"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dbu.SbaXGridControl")); } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString> SbaXGridControl::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(3); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.form.control.InteractionGridControl"); - aSupported[1] = ::rtl::OUString::createFromAscii("com.sun.star.form.control.GridControl"); - aSupported[2] = ::rtl::OUString::createFromAscii("com.sun.star.awt.UnoControl"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.control.InteractionGridControl")); + aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.control.GridControl")); + aSupported[2] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.UnoControl")); return aSupported; } DBG_NAME(SbaXGridControl ); @@ -251,14 +252,11 @@ void SAL_CALL SbaXGridControl::createPeer(const Reference< ::com::sun::star::awt { FmXGridControl::createPeer(rToolkit, rParentPeer); - DBG_ASSERT(/*(0 == m_nPeerCreationLevel) && */!mbCreatingPeer, "FmXGridControl::createPeer : recursion!"); + OSL_ENSURE(!mbCreatingPeer, "FmXGridControl::createPeer : recursion!"); // see the base class' createPeer for a comment on this - // 14.05.2001 - 86836 - frank.schoenheit@germany.sun.com // TODO: why the hell this whole class does not use any mutex? -// if (0 == m_nPeerCreationLevel) - { Reference< ::com::sun::star::frame::XDispatch > xDisp(getPeer(), UNO_QUERY); for ( StatusMultiplexerArray::iterator aIter = m_aStatusMultiplexer.begin(); aIter != m_aStatusMultiplexer.end(); @@ -267,7 +265,6 @@ void SAL_CALL SbaXGridControl::createPeer(const Reference< ::com::sun::star::awt if ((*aIter).second && (*aIter).second->getLength()) xDisp->addStatusListener((*aIter).second, (*aIter).first); } - } } //--------------------------------------------------------------------------------------- @@ -423,10 +420,10 @@ Any SAL_CALL SbaXGridPeer::queryInterface(const Type& _rType) throw (RuntimeExce //--------------------------------------------------------------------------------------- Reference< ::com::sun::star::frame::XDispatch > SAL_CALL SbaXGridPeer::queryDispatch(const ::com::sun::star::util::URL& aURL, const ::rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags) throw( RuntimeException ) { - if ( (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/BrowserAttribs"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/RowHeight"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/ColumnAttribs"))) - || (aURL.Complete.equals(::rtl::OUString::createFromAscii(".uno:GridSlots/ColumnWidth"))) + if ( (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/BrowserAttribs")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/RowHeight")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/ColumnAttribs")))) + || (aURL.Complete.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:GridSlots/ColumnWidth")))) ) { return (::com::sun::star::frame::XDispatch*)this; @@ -463,13 +460,13 @@ IMPL_LINK( SbaXGridPeer, OnDispatchEvent, void*, /*NOTINTERESTEDIN*/ ) SbaXGridPeer::DispatchType SbaXGridPeer::classifyDispatchURL( const URL& _rURL ) { DispatchType eURLType = dtUnknown; - if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/BrowserAttribs" ) ) + if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/BrowserAttribs" ) ) ) eURLType = dtBrowserAttribs; - else if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/RowHeight" ) ) + else if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/RowHeight" ) ) ) eURLType = dtRowHeight; - else if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/ColumnAttribs" ) ) + else if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/ColumnAttribs" ) ) ) eURLType = dtColumnAttribs; - else if ( _rURL.Complete.equalsAscii( ".uno:GridSlots/ColumnWidth" ) ) + else if ( _rURL.Complete.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:GridSlots/ColumnWidth" ) ) ) eURLType = dtColumnWidth; return eURLType; } @@ -509,17 +506,17 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa const PropertyValue* pArgs = aArgs.getConstArray(); for (sal_uInt16 i=0; i<aArgs.getLength(); ++i, ++pArgs) { - if (pArgs->Name == ::rtl::OUString::createFromAscii("ColumnViewPos")) + if (pArgs->Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnViewPos"))) { nColId = pGrid->GetColumnIdFromViewPos(::comphelper::getINT16(pArgs->Value)); break; } - if (pArgs->Name == ::rtl::OUString::createFromAscii("ColumnModelPos")) + if (pArgs->Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnModelPos"))) { nColId = pGrid->GetColumnIdFromModelPos(::comphelper::getINT16(pArgs->Value)); break; } - if (pArgs->Name == ::rtl::OUString::createFromAscii("ColumnId")) + if (pArgs->Name == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ColumnId"))) { nColId = ::comphelper::getINT16(pArgs->Value); break; @@ -547,7 +544,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa case dtColumnAttribs: { - DBG_ASSERT(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); + OSL_ENSURE(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); if (nColId != -1) break; pGrid->SetColAttrs(nColId); @@ -556,7 +553,7 @@ void SAL_CALL SbaXGridPeer::dispatch(const URL& aURL, const Sequence< PropertyVa case dtColumnWidth: { - DBG_ASSERT(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); + OSL_ENSURE(nColId != -1, "SbaXGridPeer::dispatch : invalid parameter !"); if (nColId != -1) break; pGrid->SetColWidth(nColId); @@ -675,10 +672,6 @@ void SbaGridHeader::MouseButtonDown( const MouseEvent& _rMEvt ) // the base class will start a column move here, which we don't want to allow // (at the moment. If we store relative positions with the columns, we can allow column moves ....) -// sal_uInt16 nPos(0); -// sal_uInt16 nHitTest = ImplHitTest( _rMEvt.GetPosPixel(), mnMouseOff, nPos ); -// if (!nHitTest & HEAD_HITTEST_DIVIDER) -// return; } FmGridHeader::MouseButtonDown(_rMEvt); @@ -818,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); @@ -863,7 +856,7 @@ void SbaGridControl::PreExecuteRowContextMenu(sal_uInt16 nRow, PopupMenu& rMenu) rMenu.InsertItem(ID_BROWSER_ROWHEIGHT, aNewItems.GetItemText(ID_BROWSER_ROWHEIGHT), 0, nPos++); rMenu.SetHelpId(ID_BROWSER_ROWHEIGHT, aNewItems.GetHelpId(ID_BROWSER_ROWHEIGHT)); rMenu.InsertSeparator(nPos++); - } // if (!IsReadOnlyDB()) + } if ( GetSelectRowCount() > 0 ) { @@ -958,7 +951,7 @@ void SbaGridControl::SetRowHeight() } catch(Exception&) { - OSL_ENSURE(0,"setPropertyValue: PROPERTY_ROW_HEIGHT throws a exception"); + OSL_FAIL("setPropertyValue: PROPERTY_ROW_HEIGHT throws a exception"); } } } @@ -994,13 +987,13 @@ void SbaGridControl::SetBrowserAttrs() try { PropertyValue aArg; - aArg.Name = ::rtl::OUString::createFromAscii("IntrospectedObject"); + aArg.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IntrospectedObject")); aArg.Value <<= xGridModel; Sequence< Any > aDialogArgs(1); aDialogArgs[0] <<= aArg; Reference< XInterface > xDialog = getServiceManager()->createInstanceWithArguments( - ::rtl::OUString::createFromAscii("com.sun.star.form.ControlFontDialog"), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.ControlFontDialog")), aDialogArgs ); if (!xDialog.is()) @@ -1116,11 +1109,11 @@ Reference< XPropertySet > SbaGridControl::getField(sal_uInt16 nModelPos) xEmptyReturn.set(xCol->getPropertyValue(PROPERTY_BOUNDFIELD),UNO_QUERY); } else - OSL_ENSURE(0,"SbaGridControl::getField getColumns returns NULL or ModelPos is > than count!"); + OSL_FAIL("SbaGridControl::getField getColumns returns NULL or ModelPos is > than count!"); } catch(Exception&) { - OSL_ENSURE(0,"SbaGridControl::getField Exception occured!"); + OSL_FAIL("SbaGridControl::getField Exception occurred!"); } return xEmptyReturn; @@ -1206,14 +1199,14 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) // check which kind of dragging has to be initiated if ( bHitHandle // the handle column // AND - && ( GetSelectRowCount() // at least one row is selected - // OR - || ( (nRow >= 0) // a row below the header - && !bCurrentRowVirtual // we aren't appending a new record - && (nRow != GetCurrentPos()) // a row which is not the current one - ) // OR - || ( (0 == GetSelectRowCount()) // no rows selected - && (-1 == nRow) // hit the header + && ( GetSelectRowCount() // at least one row is selected + // OR + || ( (nRow >= 0) // a row below the header + && !bCurrentRowVirtual // we aren't appending a new record + && (nRow != GetCurrentPos()) // a row which is not the current one + ) // OR + || ( (0 == GetSelectRowCount()) // no rows selected + && (-1 == nRow) // hit the header ) ) ) @@ -1273,7 +1266,7 @@ void SbaGridControl::Command(const CommandEvent& rEvt) void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) { Reference< XPropertySet > xDataSource(getDataSource(), UNO_QUERY); - DBG_ASSERT(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); + OSL_ENSURE(xDataSource.is(), "SbaGridControl::DoColumnDrag : invalid data source !"); Reference< XPropertySet > xAffectedCol; Reference< XPropertySet > xAffectedField; @@ -1296,7 +1289,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) } catch(Exception&) { - DBG_ERROR("SbaGridControl::DoColumnDrag : something went wrong while getting the column"); + OSL_FAIL("SbaGridControl::DoColumnDrag : something went wrong while getting the column"); } if (0 == sField.getLength()) return; @@ -1309,7 +1302,7 @@ void SbaGridControl::DoColumnDrag(sal_uInt16 nColumnPos) // ----------------------------------------------------------------------- void SbaGridControl::CopySelectedRowsToClipboard() { - DBG_ASSERT( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); + OSL_ENSURE( GetSelectRowCount() > 0, "SbaGridControl::CopySelectedRowsToClipboard: invalid call!" ); implTransferSelectedRows( (sal_Int16)FirstSelectedRow(), true ); } @@ -1323,7 +1316,7 @@ void SbaGridControl::DoRowDrag( sal_Int16 nRowPos ) void SbaGridControl::implTransferSelectedRows( sal_Int16 nRowPos, bool _bTrueIfClipboardFalseIfDrag ) { Reference< XPropertySet > xForm( getDataSource(), UNO_QUERY ); - DBG_ASSERT( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); + OSL_ENSURE( xForm.is(), "SbaGridControl::implTransferSelectedRows: invalid form!" ); // build the sequence of numbers of selected rows Sequence< Any > aSelectedRows; @@ -1379,7 +1372,7 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos) } catch(Exception&) { - DBG_ERROR("SbaGridControl::DoFieldDrag : could not retrieve the cell's contents !"); + OSL_FAIL("SbaGridControl::DoFieldDrag : could not retrieve the cell's contents !"); return; } @@ -1397,8 +1390,6 @@ void SbaGridControl::DoFieldDrag(sal_uInt16 nColumnPos, sal_Int16 nRowPos) { switch (_aType.mnSotId) { -// case SOT_FORMAT_RTF: // RTF data descriptions -// case SOT_FORMATSTR_ID_HTML: // HTML data descriptions case SOT_FORMATSTR_ID_DBACCESS_TABLE: // table descriptor case SOT_FORMATSTR_ID_DBACCESS_QUERY: // query descriptor case SOT_FORMATSTR_ID_DBACCESS_COMMAND: // SQL command @@ -1540,7 +1531,7 @@ sal_Int8 SbaGridControl::ExecuteDrop( const BrowserExecuteDropEvent& rEvt ) if (IsCurrentAppending()) --nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one - DBG_ASSERT((nCol != BROWSER_INVALIDID) && (nRow < nCorrectRowCount), "SbaGridControl::Drop : dropped on an invalid position !"); + OSL_ENSURE((nCol != BROWSER_INVALIDID) && (nRow < nCorrectRowCount), "SbaGridControl::Drop : dropped on an invalid position !"); // AcceptDrop should have caught this // from now we work with ids instead of positions diff --git a/dbaccess/source/ui/browser/sbagrid.src b/dbaccess/source/ui/browser/sbagrid.src index 1362944d5847..b3fd77757364 100644 --- a/dbaccess/source/ui/browser/sbagrid.src +++ b/dbaccess/source/ui/browser/sbagrid.src @@ -102,10 +102,12 @@ String STR_QRY_TITLE { Text [ en-US ] = "Query #" ; }; + String STR_TBL_TITLE { Text [ en-US ] = "Table #" ; }; + String STR_VIEW_TITLE { Text [ en-US ] = "View #" ; @@ -122,7 +124,7 @@ String STR_NO_COLUMNNAME_MATCHING Text [ en-US ] = "No matching column names were found."; }; -String STR_ERROR_OCCURED_WHILE_COPYING +String STR_ERROR_OCCURRED_WHILE_COPYING { Text [ en-US ] = "An error occurred. Do you want to continue copying?"; }; @@ -136,4 +138,3 @@ String STR_DATASOURCE_GRIDCONTROL_DESC { Text [ en-US ] = "Shows the selected table or query."; }; - diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index f963afecab31..216afb3caf2c 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> @@ -122,9 +123,9 @@ #include <svx/algitem.hxx> #include <svx/dataaccessdescriptor.hxx> #include <svx/databaseregistrationui.hxx> -#include <svx/gridctrl.hxx> #include <toolkit/unohlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <tools/multisel.hxx> #include <tools/urlobj.hxx> #include <unotools/confignode.hxx> @@ -207,13 +208,13 @@ void SafeRemovePropertyListener(const Reference< XPropertySet > & xSet, const :: // ------------------------------------------------------------------------- ::rtl::OUString SbaTableQueryBrowser::getImplementationName_Static() throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ODatasourceBrowser"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ODatasourceBrowser")); } //------------------------------------------------------------------------- ::comphelper::StringSequence SbaTableQueryBrowser::getSupportedServiceNames_Static() throw(RuntimeException) { ::comphelper::StringSequence aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.DataSourceBrowser"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DataSourceBrowser")); return aSupported; } //------------------------------------------------------------------------- @@ -250,7 +251,7 @@ SbaTableQueryBrowser::~SbaTableQueryBrowser() DBG_DTOR(SbaTableQueryBrowser,NULL); if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) { - OSL_ENSURE(0,"Please check who doesn't dispose this component!"); + OSL_FAIL("Please check who doesn't dispose this component!"); // increment ref count to prevent double call of Dtor osl_incrementInterlockedCount( &m_refCount ); dispose(); @@ -369,12 +370,12 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) xDatabaseRegistrations->addDatabaseRegistrationsListener( this ); // the collator for the string compares - m_xCollator = Reference< XCollator >( getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.i18n.Collator" ) ), UNO_QUERY_THROW ); + m_xCollator = Reference< XCollator >( getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.Collator")) ), UNO_QUERY_THROW ); m_xCollator->loadDefaultCollator( Application::GetSettings().GetLocale(), 0 ); } catch(Exception&) { - DBG_ERROR("SbaTableQueryBrowser::Construct: could not create (or start listening at) the database context!"); + OSL_FAIL("SbaTableQueryBrowser::Construct: could not create (or start listening at) the database context!"); } // some help ids if (getBrowserView() && getBrowserView()->getVclControl()) @@ -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& ) { - DBG_ERROR("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,13 +737,14 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::std::vector< NamedValue > aInitialValues; ::std::vector< ::rtl::OUString > aCopyProperties; + Any aDefault; switch(nType) { case DataType::BIT: case DataType::BOOLEAN: { - aCurrentModelType = ::rtl::OUString::createFromAscii("CheckBox"); + aCurrentModelType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CheckBox")); aInitialValues.push_back( NamedValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "VisualEffect" ) ), makeAny( VisualEffect::FLAT ) ) ); sDefaultProperty = PROPERTY_DEFAULTSTATE; @@ -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; @@ -628,7 +766,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: case DataType::BINARY: case DataType::VARBINARY: case DataType::LONGVARBINARY: - aCurrentModelType = ::rtl::OUString::createFromAscii("TextField"); + aCurrentModelType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TextField")); sDefaultProperty = PROPERTY_DEFAULTTEXT; break; @@ -637,12 +775,12 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: bFormattedIsNumeric = sal_False; // NO break! default: - aCurrentModelType = ::rtl::OUString::createFromAscii("FormattedField"); + aCurrentModelType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormattedField")); sDefaultProperty = PROPERTY_EFFECTIVEDEFAULT; if ( xSupplier.is() ) - aInitialValues.push_back( NamedValue( ::rtl::OUString::createFromAscii( "FormatsSupplier" ), makeAny( xSupplier ) ) ); - aInitialValues.push_back( NamedValue( ::rtl::OUString::createFromAscii( "TreatAsNumber" ), makeAny( (sal_Bool)bFormattedIsNumeric ) ) ); + aInitialValues.push_back( NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormatsSupplier")), makeAny( xSupplier ) ) ); + aInitialValues.push_back( NamedValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TreatAsNumber")), makeAny( (sal_Bool)bFormattedIsNumeric ) ) ); aCopyProperties.push_back( PROPERTY_FORMATKEY ); 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() ) @@ -904,7 +1041,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv { if ( _rEvent.FeatureURL.Complete == aLoop->second.aURL.Complete) { - DBG_ASSERT( xSource.get() == aLoop->second.xDispatcher.get(), "SbaTableQueryBrowser::statusChanged: inconsistent!" ); + OSL_ENSURE( xSource.get() == aLoop->second.xDispatcher.get(), "SbaTableQueryBrowser::statusChanged: inconsistent!" ); // update the enabled state aLoop->second.bEnabled = _rEvent.IsEnabled; @@ -942,7 +1079,7 @@ void SAL_CALL SbaTableQueryBrowser::statusChanged( const FeatureStateEvent& _rEv } } - DBG_ASSERT(aLoop != m_aExternalFeatures.end(), "SbaTableQueryBrowser::statusChanged: don't know who sent this!"); + OSL_ENSURE(aLoop != m_aExternalFeatures.end(), "SbaTableQueryBrowser::statusChanged: don't know who sent this!"); } // ------------------------------------------------------------------------- @@ -955,7 +1092,7 @@ void SbaTableQueryBrowser::checkDocumentDataSource() if (!bKnownDocDataSource) { if (NULL != pDataSourceEntry) - { // at least the data source is know + { // at least the data source is known if (NULL != pContainerEntry) bKnownDocDataSource = sal_True; // assume we know it. // TODO: should we expand the object container? This may be too expensive just for checking .... @@ -1006,7 +1143,6 @@ namespace if ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) { _rDisplayName = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); - // _rDisplayName = aURL.getName(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); _rUniqueId = aURL.GetMainURL( INetURLObject::NO_DECODE ); return true; } @@ -1036,11 +1172,11 @@ namespace // ------------------------------------------------------------------------- String SbaTableQueryBrowser::getDataSourceAcessor( SvLBoxEntry* _pDataSourceEntry ) const { - DBG_ASSERT( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); + OSL_ENSURE( _pDataSourceEntry, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry!" ); DBTreeListUserData* pData = static_cast< DBTreeListUserData* >( _pDataSourceEntry->GetUserData() ); - DBG_ASSERT( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); - DBG_ASSERT( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); + OSL_ENSURE( pData, "SbaTableQueryBrowser::getDataSourceAcessor: invalid entry data!" ); + OSL_ENSURE( pData->eType == etDatasource, "SbaTableQueryBrowser::getDataSourceAcessor: entry does not denote a data source!" ); return pData->sAccessor.Len() ? pData->sAccessor : GetEntryText( _pDataSourceEntry ); } @@ -1061,7 +1197,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS String sDisplayName, sDataSourceId; bool bIsDataSourceURL = getDataSourceDisplayName_isURL( _rDataSource, sDisplayName, sDataSourceId ); // the display name may differ from the URL for readability reasons - // #i33699# - 2004-09-24 - fs@openoffice.org + // #i33699# FilterByEntryDataId aFilter( sDataSourceId ); SvLBoxEntry* pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); @@ -1073,7 +1209,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS // add new entries to the list box model implAddDatasource( _rDataSource, _rxConnection ); pDataSource = m_pTreeView->getListBox().GetEntryPosByName( sDisplayName, NULL, &aFilter ); - DBG_ASSERT( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); + OSL_ENSURE( pDataSource, "SbaTableQueryBrowser::getObjectEntry: hmm - did not find it again!" ); } } if (_ppDataSourceEntry) @@ -1145,11 +1281,10 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::rtl::OUString& _rDataS } catch(Exception&) { - DBG_ERROR("SbaTableQueryBrowser::populateTree: could not fill the tree"); + OSL_FAIL("SbaTableQueryBrowser::populateTree: could not fill the tree"); } } } - // m_pTreeView->getListBox().Expand(pCommandType); } while ( nIndex >= 0 ); } @@ -1177,7 +1312,7 @@ SvLBoxEntry* SbaTableQueryBrowser::getObjectEntry(const ::svx::ODataAccessDescri void SbaTableQueryBrowser::connectExternalDispatches() { Reference< XDispatchProvider > xProvider( getFrame(), UNO_QUERY ); - DBG_ASSERT(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); + OSL_ENSURE(xProvider.is(), "SbaTableQueryBrowser::connectExternalDispatches: no DispatchProvider !"); if (xProvider.is()) { if ( m_aExternalFeatures.empty() ) @@ -1211,12 +1346,12 @@ void SbaTableQueryBrowser::connectExternalDispatches() ) { feature->second.xDispatcher = xProvider->queryDispatch( - feature->second.aURL, ::rtl::OUString::createFromAscii("_parent"), FrameSearchFlag::PARENT + feature->second.aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_parent")), FrameSearchFlag::PARENT ); if ( feature->second.xDispatcher.get() == static_cast< XDispatch* >( this ) ) { - OSL_ENSURE( sal_False, "SbaTableQueryBrowser::connectExternalDispatches: this should not happen anymore!" ); + OSL_FAIL( "SbaTableQueryBrowser::connectExternalDispatches: this should not happen anymore!" ); // (nowadays, the URLs aren't in our SupportedFeatures list anymore, so we should // not supply a dispatcher for this) feature->second.xDispatcher.clear(); @@ -1308,7 +1443,7 @@ void SAL_CALL SbaTableQueryBrowser::disposing( const EventObject& _rSource ) thr DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(pDSLoop->GetUserData()); if ( pData && pData->xConnection == xCon ) { - // we set the conenction to null to avoid a second disposing of the connection + // we set the connection to null to avoid a second disposing of the connection pData->xConnection.clear(); closeConnection(pDSLoop,sal_False); break; @@ -1340,7 +1475,7 @@ void SbaTableQueryBrowser::implRemoveStatusListeners() } catch (Exception&) { - DBG_ERROR("SbaTableQueryBrowser::implRemoveStatusListeners: could not remove a status listener!"); + OSL_FAIL("SbaTableQueryBrowser::implRemoveStatusListeners: could not remove a status listener!"); } } } @@ -1365,7 +1500,7 @@ sal_Bool SAL_CALL SbaTableQueryBrowser::select( const Any& _rSelection ) throw ( } catch(const Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::select: could not extract the descriptor!"); + OSL_FAIL("SbaTableQueryBrowser::select: could not extract the descriptor!"); } // check the precense of the props we need @@ -1428,7 +1563,7 @@ void SbaTableQueryBrowser::attachFrame(const Reference< ::com::sun::star::frame: Reference< XFrame > xCurrentFrame( getFrame() ); if ( xCurrentFrame.is() ) { - m_xCurrentFrameParent = xCurrentFrame->findFrame(::rtl::OUString::createFromAscii("_parent"),FrameSearchFlag::PARENT); + m_xCurrentFrameParent = xCurrentFrame->findFrame(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_parent")),FrameSearchFlag::PARENT); if ( m_xCurrentFrameParent.is() ) m_xCurrentFrameParent->addFrameActionListener((::com::sun::star::frame::XFrameActionListener*)this); @@ -1685,7 +1820,6 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const aReturn.bEnabled = aReturn.bEnabled && getBrowserView()->getVclControl()->GetSelectRowCount(); // disabled for native queries which are not saved within the database - // 67706 - 23.08.99 - FS Reference< XPropertySet > xDataSource(getRowSet(), UNO_QUERY); try { @@ -1699,7 +1833,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const } catch(DisposedException&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::GetState: object already disposed!"); + OSL_FAIL("SbaTableQueryBrowser::GetState: object already disposed!"); } catch( const Exception& ) { @@ -1722,7 +1856,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const case CommandType::COMMAND: sTitle = String(ModuleRes(STR_QRY_TITLE)); break; default: - DBG_ASSERT(sal_False, "SbaTableQueryBrowser::GetState: unknown command type!"); + OSL_FAIL("SbaTableQueryBrowser::GetState: unknown command type!"); } ::rtl::OUString aName; xProp->getPropertyValue(PROPERTY_COMMAND) >>= aName; @@ -1750,7 +1884,7 @@ FeatureState SbaTableQueryBrowser::GetState(sal_uInt16 nId) const { aReturn.bEnabled = m_aCurrentFrame.isActive(); break; - } // if ( getBrowserView()->getVclControl()->GetSelectRowCount() ) + } else aReturn.bEnabled = pControl->canCopyCellText(pControl->GetCurRow(), pControl->GetCurColumnId()); break; @@ -1875,7 +2009,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue if ( !pGrid->IsAllSelected() ) { // transfer the selected rows only if not all rows are selected // (all rows means the whole table) - // i3832 - 03.04.2002 - fs@openoffice.org + // #i3832# if (pSelection != NULL) { aSelection.realloc(pSelection->GetSelectCount()); @@ -1898,11 +2032,11 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue } catch(DisposedException&) { - OSL_ENSURE(0,"Object already disposed!"); + OSL_FAIL("Object already disposed!"); } catch(Exception&) { - DBG_ERROR("SbaTableQueryBrowser::Execute(ID_BROWSER_?): could not clone the cursor!"); + OSL_FAIL("SbaTableQueryBrowser::Execute(ID_BROWSER_?): could not clone the cursor!"); } Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY); @@ -1980,16 +2114,16 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb ImageProvider aImageProvider; if (!_rQueryImage) - _rQueryImage = aImageProvider.getFolderImage( DatabaseObject::QUERY, isHiContrast() ); + _rQueryImage = aImageProvider.getFolderImage( DatabaseObject::QUERY ); if (!_rTableImage) - _rTableImage = aImageProvider.getFolderImage( DatabaseObject::TABLE, isHiContrast() ); + _rTableImage = aImageProvider.getFolderImage( DatabaseObject::TABLE ); if (!_rDbImage) - _rDbImage = aImageProvider.getDatabaseImage( isHiContrast() ); + _rDbImage = aImageProvider.getDatabaseImage(); // add the entry for the data source // special handling for data sources denoted by URLs - we do not want to display this ugly URL, do we? - // #i33699# - 2004-09-24 - fs@openoffice.org + // #i33699# String sDSDisplayName, sDataSourceId; getDataSourceDisplayName_isURL( _rDbName, sDSDisplayName, sDataSourceId ); @@ -2007,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 @@ -2017,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 ); } } @@ -2068,7 +2202,7 @@ void SbaTableQueryBrowser::populateTree(const Reference<XNameAccess>& _xNameAcce } catch(Exception&) { - DBG_ERROR("SbaTableQueryBrowser::populateTree: could not fill the tree"); + OSL_FAIL("SbaTableQueryBrowser::populateTree: could not fill the tree"); } } @@ -2077,15 +2211,13 @@ SvLBoxEntry* SbaTableQueryBrowser::implAppendEntry( SvLBoxEntry* _pParent, const { ::std::auto_ptr< ImageProvider > pImageProvider( getImageProviderFor( _pParent ) ); - Image aImage, aImageHC; - pImageProvider->getImages( _rName, getDatabaseObjectType( _eEntryType ), aImage, aImageHC ); + Image aImage; + pImageProvider->getImages( _rName, getDatabaseObjectType( _eEntryType ), aImage ); SvLBoxEntry* pNewEntry = m_pTreeView->getListBox().InsertEntry( _rName, _pParent, _eEntryType == etQueryContainer , LIST_APPEND, _pUserData ); - m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImage, BMP_COLOR_NORMAL ); - m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImage, BMP_COLOR_NORMAL ); - m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImageHC, BMP_COLOR_HIGHCONTRAST ); - m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImageHC, BMP_COLOR_HIGHCONTRAST ); + m_pTreeView->getListBox().SetExpandedEntryBmp( pNewEntry, aImage ); + m_pTreeView->getListBox().SetCollapsedEntryBmp( pNewEntry, aImage ); return pNewEntry; } @@ -2167,7 +2299,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) if(e.TargetException >>= aSql) aInfo = aSql; else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::OnExpandEntry: something strange happended!"); + OSL_FAIL("SbaTableQueryBrowser::OnExpandEntry: something strange happended!"); } catch( const Exception& ) { @@ -2178,7 +2310,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) } else return 0L; - // 0 indicates that an error occured + // 0 indicates that an error occurred } else { // we have to expand the queries or bookmarks @@ -2195,7 +2327,7 @@ IMPL_LINK(SbaTableQueryBrowser, OnExpandEntry, SvLBoxEntry*, _pParent) //------------------------------------------------------------------------------ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) { - DBG_ASSERT(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); + OSL_ENSURE(_pEntry, "SbaTableQueryBrowser::ensureEntryObject: invalid argument!"); if (!_pEntry) return sal_False; @@ -2257,7 +2389,7 @@ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) bSuccess = pEntryData->xContainer.is(); } else { - DBG_ERROR("SbaTableQueryBrowser::ensureEntryObject: no XQueryDefinitionsSupplier interface!"); + OSL_FAIL("SbaTableQueryBrowser::ensureEntryObject: no XQueryDefinitionsSupplier interface!"); } } catch( const Exception& ) @@ -2269,7 +2401,7 @@ sal_Bool SbaTableQueryBrowser::ensureEntryObject( SvLBoxEntry* _pEntry ) break; default: - DBG_ERROR("SbaTableQueryBrowser::ensureEntryObject: ooops ... missing some implementation here!"); + OSL_FAIL("SbaTableQueryBrowser::ensureEntryObject: ooops ... missing some implementation here!"); // TODO ... break; } @@ -2294,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; @@ -2629,7 +2766,7 @@ bool SbaTableQueryBrowser::implSelect( SvLBoxEntry* _pEntry ) if(e.TargetException >>= aSql) showError(SQLExceptionInfo(aSql)); else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::implSelect: something strange happended!"); + OSL_FAIL("SbaTableQueryBrowser::implSelect: something strange happended!"); // reset the values xRowSetProps->setPropertyValue(PROPERTY_DATASOURCENAME,Any()); xRowSetProps->setPropertyValue(PROPERTY_ACTIVE_CONNECTION,Any()); @@ -2830,7 +2967,7 @@ void SAL_CALL SbaTableQueryBrowser::elementReplaced( const ContainerEvent& _rEve } else if (xNames.get() == m_xDatabaseContext.get()) { // a datasource has been replaced in the context - DBG_ERROR("SbaTableQueryBrowser::elementReplaced: no support for replaced data sources!"); + OSL_FAIL("SbaTableQueryBrowser::elementReplaced: no support for replaced data sources!"); // very suspicious: the database context should not allow to replace data source, only to register // and revoke them } @@ -2869,8 +3006,8 @@ void SbaTableQueryBrowser::impl_releaseConnection( SharedConnection& _rxConnecti // ------------------------------------------------------------------------- void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) { - DBG_ASSERT( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); + OSL_ENSURE( _pDSEntry, "SbaTableQueryBrowser::disposeConnection: invalid entry (NULL)!" ); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::disposeConnection: invalid entry (not top-level)!" ); if ( _pDSEntry ) { @@ -2883,8 +3020,8 @@ void SbaTableQueryBrowser::disposeConnection( SvLBoxEntry* _pDSEntry ) // ------------------------------------------------------------------------- void SbaTableQueryBrowser::closeConnection(SvLBoxEntry* _pDSEntry,sal_Bool _bDisposeConnection) { - DBG_ASSERT(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); + OSL_ENSURE(_pDSEntry, "SbaTableQueryBrowser::closeConnection: invalid entry (NULL)!"); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::closeConnection: invalid entry (not top-level)!"); // if one of the entries of the given DS is displayed currently, unload the form if (m_pCurrentlyDisplayed && (m_pTreeView->getListBox().GetRootLevelParent(m_pCurrentlyDisplayed) == _pDSEntry)) @@ -2968,11 +3105,11 @@ void SbaTableQueryBrowser::unloadAndCleanup( sal_Bool _bDisposeConnection ) if(e.TargetException >>= aSql) showError(SQLExceptionInfo(aSql)); else - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::unloadAndCleanup: something strange happended!"); + OSL_FAIL("SbaTableQueryBrowser::unloadAndCleanup: something strange happended!"); } catch(Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::unloadAndCleanup: could not reset the form"); + OSL_FAIL("SbaTableQueryBrowser::unloadAndCleanup: could not reset the form"); } } @@ -3133,7 +3270,7 @@ void SbaTableQueryBrowser::impl_initialize() } catch( const Exception& ) { - OSL_ENSURE( sal_False, "SbaTableQueryBrowser::impl_initialize: a connection parent which does not have a 'Name'!??" ); + OSL_FAIL( "SbaTableQueryBrowser::impl_initialize: a connection parent which does not have a 'Name'!??" ); } } } @@ -3170,7 +3307,7 @@ void SbaTableQueryBrowser::impl_initialize() } catch(const Exception&) { - OSL_ENSURE(sal_False, "SbaTableQueryBrowser::impl_initialize: could not set the update related names!"); + OSL_FAIL("SbaTableQueryBrowser::impl_initialize: could not set the update related names!"); } } @@ -3249,7 +3386,7 @@ sal_Bool SbaTableQueryBrowser::getExistentConnectionFor( SvLBoxEntry* _pAnyEntry return _rConnection.is(); } -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 // ----------------------------------------------------------------------------- bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const { @@ -3260,7 +3397,7 @@ bool SbaTableQueryBrowser::impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const // ----------------------------------------------------------------------------- sal_Bool SbaTableQueryBrowser::ensureConnection( SvLBoxEntry* _pDSEntry, void* pDSData, SharedConnection& _rConnection ) { - DBG_ASSERT( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); + OSL_ENSURE( impl_isDataSourceEntry( _pDSEntry ), "SbaTableQueryBrowser::ensureConnection: this entry does not denote a data source!" ); if(_pDSEntry) { DBTreeListUserData* pTreeListData = static_cast<DBTreeListUserData*>(pDSData); @@ -3299,7 +3436,7 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa { SvLBoxEntry* pLHS = static_cast<SvLBoxEntry*>(_pSortData->pLeft); SvLBoxEntry* pRHS = static_cast<SvLBoxEntry*>(_pSortData->pRight); - DBG_ASSERT(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); + OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); // we want the table entry and the end so we have to do a check if (isContainer(pRHS)) @@ -3329,13 +3466,13 @@ IMPL_LINK( SbaTableQueryBrowser, OnTreeEntryCompare, const SvSortData*, _pSortDa if ( ( eLeft == etQueryContainer ) && ( eRight == etTableContainer ) ) return COMPARE_LESS; - OSL_ENSURE( false, "SbaTableQueryBrowser::OnTreeEntryCompare: unexpected case!" ); + OSL_FAIL( "SbaTableQueryBrowser::OnTreeEntryCompare: unexpected case!" ); return COMPARE_EQUAL; } SvLBoxString* pLeftTextItem = static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); SvLBoxString* pRightTextItem = static_cast<SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - DBG_ASSERT(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); + OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); String sLeftText = pLeftTextItem->GetText(); String sRightText = pRightTextItem->GetText(); @@ -3485,7 +3622,7 @@ Any SbaTableQueryBrowser::getCurrentSelection( Control& _rControl ) const break; default: - OSL_ENSURE( false, "SbaTableQueryBrowser::getCurrentSelection: invalid (unexpected) object type!" ); + OSL_FAIL( "SbaTableQueryBrowser::getCurrentSelection: invalid (unexpected) object type!" ); break; } @@ -3500,7 +3637,7 @@ sal_Bool SbaTableQueryBrowser::implGetQuerySignature( ::rtl::OUString& _rCommand try { - // ontain the dss (data source signature) of the form + // contain the dss (data source signature) of the form ::rtl::OUString sDataSourceName; ::rtl::OUString sCommand; sal_Int32 nCommandType = CommandType::COMMAND; @@ -3570,14 +3707,6 @@ void SbaTableQueryBrowser::clearGridColumns(const Reference< XNameContainer >& _ } } // ----------------------------------------------------------------------------- -sal_Bool SbaTableQueryBrowser::isHiContrast() const -{ - sal_Bool bRet = sal_False; - if ( m_pTreeView ) - bRet = m_pTreeView->getListBox().GetSettings().GetStyleSettings().GetHighContrastMode(); - return bRet; -} -// ----------------------------------------------------------------------------- void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) { if ( m_bShowMenu ) @@ -3614,7 +3743,7 @@ void SbaTableQueryBrowser::loadMenu(const Reference< XFrame >& _xFrame) sTitle = aURL.getBase(INetURLObject::LAST_SEGMENT,true,INetURLObject::DECODE_WITH_CHARSET); if ( sName.getLength() ) { - sName += ::rtl::OUString::createFromAscii(" - "); + sName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" - ")); sName += sTitle; sTitle = sName; } @@ -3655,7 +3784,6 @@ void SbaTableQueryBrowser::postReloadForm() { InitializeGridModel(getFormComponent()); LoadFinished(sal_True); - //updateTitle(); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index 094b1c6f4271..36c89d858be5 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -73,7 +73,6 @@ void OColumnControlWindow::ActivateAggregate( EControlType eType ) { case tpFormat: case tpDefault: -// case tpAutoIncrement: case tpColumnName: break; default: @@ -87,7 +86,6 @@ void OColumnControlWindow::DeactivateAggregate( EControlType eType ) { case tpFormat: case tpDefault: -// case tpAutoIncrement: case tpColumnName: break; default: @@ -95,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 353fba74e3e1..c30b36782582 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -36,7 +36,6 @@ #include "FieldDescControl.hxx" #include "FieldControls.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include "TableDesignHelpBar.hxx" #include <vcl/scrbar.hxx> @@ -71,6 +70,7 @@ #include <memory> #include "dbu_control.hrc" #include "dbu_tbl.hrc" +#include <osl/diagnose.h> using namespace dbaui; @@ -312,7 +312,7 @@ String OFieldDescControl::BoolStringUI(const String& rPersistentString) const static String aOne('1'); static String aNone(ModuleRes(STR_VALUE_NONE)); - // FS - 66161 - 14.05.1999 - aeltere Versionen haben eventuell einen sprachabhaengigen String als Default gespeichert + // aeltere Versionen haben eventuell einen sprachabhaengigen String als Default gespeichert if (rPersistentString.Equals(aYes) || rPersistentString.Equals(aNo)) return rPersistentString; @@ -410,7 +410,6 @@ void OFieldDescControl::CheckScrollBars() { m_pVertScroll->Show(); m_pVertScroll->SetRangeMax(nActive - nLastVisible); -// m_pVertScroll->SetThumbPos(0); m_pVertScroll->SetPosSizePixel( Point(nNewHWidth, 0), Size(nVScrollWidth, szOverallSize.Height()) ); } @@ -425,7 +424,6 @@ void OFieldDescControl::CheckScrollBars() { m_pHorzScroll->Show(); m_pHorzScroll->SetRangeMax((lMaxXPosition - lMaxXAvailable + HSCROLL_STEP - 1 )/HSCROLL_STEP); -// m_pHorzScroll->SetThumbPos(0); m_pHorzScroll->SetPosSizePixel( Point(0, nNewVHeight), Size(bNeedVScrollBar ? nNewHWidth : szOverallSize.Width(), nHScrollHeight) ); } @@ -516,7 +514,7 @@ sal_Int32 OFieldDescControl::GetMaxControlHeight() const const Size aTemp( ppAggregates[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); if ( aTemp.Height() > aHeight.Height() ) aHeight.Height() = aTemp.Height(); - } // if ( ppAggregates[i] ) + } } return aHeight.Height(); @@ -816,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}, @@ -1070,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)); @@ -1081,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) ); @@ -1089,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; } @@ -1194,7 +1192,7 @@ void OFieldDescControl::SetPosSize( Control** ppControl, long nRow, sal_uInt16 n case 4: aSize.Width() = CONTROL_WIDTH_4; break; - } // switch( nCol ) + } } @@ -1426,7 +1424,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) break; default: - OSL_ENSURE(0,"Unknown type"); + OSL_FAIL("Unknown type"); } m_pPreviousType = pFieldType; } @@ -1520,7 +1518,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if( pNumType ) { - OSL_ENSURE(sal_False, "OFieldDescControl::DisplayData: invalid num type!"); + OSL_FAIL("OFieldDescControl::DisplayData: invalid num type!"); } if( pLength ) @@ -1537,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(); @@ -1710,7 +1708,7 @@ void OFieldDescControl::SaveData( OFieldDescription* pFieldDescr ) catch(const Exception&) { } - } // if ( sDefault.getLength() ) + } else pFieldDescr->SetControlDefault(Any()); @@ -1761,7 +1759,7 @@ void OFieldDescControl::GetFocus() void OFieldDescControl::implFocusLost(Window* _pWhich) { DBG_CHKTHIS(OFieldDescControl,NULL); - DBG_ASSERT(!_pWhich || IsChild(_pWhich), "OFieldDescControl::implFocusLost : invalid window !"); + OSL_ENSURE(!_pWhich || IsChild(_pWhich), "OFieldDescControl::implFocusLost : invalid window !"); ////////////////////////////////////////////////////////////////////// // Das aktive Control merken @@ -1907,7 +1905,7 @@ String OFieldDescControl::getControlDefault( const OFieldDescription* _pFieldDes Reference<XPropertySet> xFormSet = xNumberFormatter->getNumberFormatsSupplier()->getNumberFormats()->getByKey(nFormatKey); OSL_ENSURE(xFormSet.is(),"XPropertySet is null!"); ::rtl::OUString sFormat; - xFormSet->getPropertyValue(::rtl::OUString::createFromAscii("FormatString")) >>= sFormat; + xFormSet->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormatString"))) >>= sFormat; if ( !bTextFormat ) { diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 0687b61d7b8e..df2ac9b6e4b6 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -33,7 +33,6 @@ #include <svtools/editbrowsebox.hxx> #include <com/sun/star/beans/XPropertySet.hpp> -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include "TableConnectionData.hxx" #include "TableConnection.hxx" @@ -45,7 +44,7 @@ #include "RelControliFace.hxx" #include "dbu_control.hrc" #include "dbaccess_helpid.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <algorithm> @@ -75,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(); @@ -108,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(); @@ -134,7 +133,7 @@ namespace dbaui DBG_NAME(ORelationControl) //------------------------------------------------------------------------ ORelationControl::ORelationControl( OTableListBoxControl* pParent ,const OJoinTableView::OTableWindowMap* _pTableMap) - :EditBrowseBox( pParent, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE, WB_TABSTOP | /*WB_3DLOOK | */WB_BORDER | BROWSER_AUTOSIZE_LASTCOL) + :EditBrowseBox( pParent, EBBF_SMART_TAB_TRAVEL | EBBF_NOROWPICTURE, WB_TABSTOP | WB_BORDER | BROWSER_AUTOSIZE_LASTCOL) ,m_pTableMap(_pTableMap) ,m_pBoxControl(pParent) ,m_xSourceDef( NULL ) @@ -189,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() @@ -228,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(); @@ -268,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; @@ -301,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: // ????????? @@ -334,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 ); @@ -372,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 @@ -401,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(); @@ -496,7 +495,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent // ----------------------------------------------------------------------------- void OTableListBoxControl::fillListBoxes() { - DBG_ASSERT( !m_pTableMap->empty(), "OTableListBoxControl::fillListBoxes: no table window!"); + OSL_ENSURE( !m_pTableMap->empty(), "OTableListBoxControl::fillListBoxes: no table window!"); OTableWindow* pInitialLeft = NULL; OTableWindow* pInitialRight = NULL; @@ -518,7 +517,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent pInitialRight = aIter->second; m_strCurrentRight = aIter->first; } - } // for(;aIter != m_pTableMap->end();++aIter) + } if ( !pInitialRight ) { @@ -583,7 +582,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent OTableWindow* pLoop = NULL; if( aFind != m_pTableMap->end() ) pLoop = aFind->second; - DBG_ASSERT(pLoop != NULL, "ORelationDialog::OnTableChanged : ungueltiger Eintrag in ListBox !"); + OSL_ENSURE(pLoop != NULL, "ORelationDialog::OnTableChanged : ungueltiger Eintrag in ListBox !"); // da ich die ListBoxen selber mit eben diesen Tabellennamen, mit denen ich sie jetzt vergleiche, gefuellt habe, // MUSS ich strSelected finden if (pListBox == &m_lmbLeftTable) @@ -637,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(); } } @@ -668,7 +667,6 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent { _pTableSeparator->SetZOrder(&m_lmbRightTable, WINDOW_ZORDER_BEHIND); m_pRC_Tables->SetZOrder(_pTableSeparator, WINDOW_ZORDER_BEHIND); - //aDlgPoint = m_pTableSeparator->GetPosPixel() + Point(0,aSize.Height()) + LogicToPixel( Point(0,6), MAP_APPFONT ); _pTableSeparator->SetPosPixel(Point(0,m_aFL_InvolvedFields.GetPosPixel().Y())); const Size aSize = _pTableSeparator->GetSizePixel(); aDlgPoint.Y() = _pTableSeparator->GetPosPixel().Y() + aSize.Height(); @@ -693,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 991dca50d804..afb6fa777352 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/TableGrantCtrl.src b/dbaccess/source/ui/control/TableGrantCtrl.src index 8da72a1f9fe1..8b870e4927b6 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.src +++ b/dbaccess/source/ui/control/TableGrantCtrl.src @@ -53,6 +53,7 @@ String STR_TABLE_PRIV_ALTER { Text [ en-US ] = "Alter structure"; }; + String STR_TABLE_PRIV_SELECT { Text [ en-US ] = "Read data"; @@ -67,30 +68,3 @@ String STR_TABLE_PRIV_DROP { Text [ en-US ] = "Drop structure"; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index bd72946958ca..cc092ccfe3b3 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -36,6 +36,7 @@ #include <svl/itemset.hxx> #include <svl/stritem.hxx> +#include <osl/diagnose.h> //........................................................................ namespace dbaui @@ -73,7 +74,7 @@ namespace dbaui OCharsetDisplay::const_iterator aFind = m_aCharSets.findIanaName( _rIanaName ); if (aFind == m_aCharSets.end()) { - DBG_ERROR( "CharSetListBox::SelectEntryByIanaName: unknown charset falling back to system language!" ); + OSL_FAIL( "CharSetListBox::SelectEntryByIanaName: unknown charset falling back to system language!" ); aFind = m_aCharSets.findEncoding( RTL_TEXTENCODING_DONTKNOW ); } @@ -89,7 +90,7 @@ namespace dbaui // in our settings, there was an encoding selected which is not valid for the current // data source type // This is worth at least an assertion. - DBG_ERROR( "CharSetListBox::SelectEntryByIanaName: invalid character set!" ); + OSL_FAIL( "CharSetListBox::SelectEntryByIanaName: invalid character set!" ); sDisplayName = String(); } @@ -98,13 +99,13 @@ 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() ) { OCharsetDisplay::const_iterator aFind = m_aCharSets.findDisplayName( GetSelectEntry() ); - DBG_ASSERT( aFind != m_aCharSets.end(), "CharSetListBox::StoreSelectedCharSet: could not translate the selected character set!" ); + OSL_ENSURE( aFind != m_aCharSets.end(), "CharSetListBox::StoreSelectedCharSet: could not translate the selected character set!" ); if ( aFind != m_aCharSets.end() ) { _rSet.Put( SfxStringItem( _nItemId, (*aFind).getIanaName() ) ); diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 43f8ae2e6a57..d649647e70b0 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -31,6 +31,7 @@ #include "curledit.hxx" #include <vcl/svapp.hxx> +#include <osl/diagnose.h> //......................................................................... namespace dbaui @@ -40,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) @@ -63,7 +64,7 @@ OConnectionURLEdit::~OConnectionURLEdit() //------------------------------------------------------------------------- void OConnectionURLEdit::SetTextNoPrefix(const String& _rText) { - DBG_ASSERT(GetSubEdit(), "OConnectionURLEdit::SetTextNoPrefix: have no current type, not changing the text!"); + OSL_ENSURE(GetSubEdit(), "OConnectionURLEdit::SetTextNoPrefix: have no current type, not changing the text!"); if (GetSubEdit()) GetSubEdit()->SetText(_rText); } @@ -143,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 381c7036677f..fe9da7403ab3 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)); @@ -155,7 +157,7 @@ void DBTreeListBox::RequestingChilds( SvLBoxEntry* pParent ) { if (!m_aPreExpandHandler.Call(pParent)) { - // an error occured. The method calling us will reset the entry flags, so it can't be expanded again. + // an error occurred. The method calling us will reset the entry flags, so it can't be expanded again. // But we want that the user may do a second try (i.e. because he misstypes a password in this try), so // we have to reset these flags controlling the expand ability PostUserEvent(LINK(this, DBTreeListBox, OnResetEntry), pParent); @@ -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) @@ -403,20 +405,18 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt ) // is used by the document will raise a similar bug once somebody discovers it. // If this is the case, we should discuss a real solution with the framework (SFX) and the // applications. - // - // 2002-12-02 - 105831 - fs@openoffice.org } if ( !bHandled ) 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; @@ -428,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 @@ -469,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 ) { @@ -501,23 +501,23 @@ 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 ) { lcl_adjustMenuItemIDs( *pPopup, _rCommandController ); continue; - } // if ( pPopup ) + } - 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 ); @@ -533,30 +533,28 @@ namespace } void lcl_insertMenuItemImages( Menu& _rMenu, IController& _rCommandController ) { - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - const BOOL bHiContrast = rSettings.GetHighContrastMode(); uno::Reference< frame::XController > xController = _rCommandController.getXController(); 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 ) { lcl_insertMenuItemImages( *pPopup, _rCommandController ); continue; - } // if ( pPopup ) + } if ( xFrame.is() ) - _rMenu.SetItemImage(nId,framework::GetImageFromURL(xFrame,aCommand,FALSE,bHiContrast)); + _rMenu.SetItemImage(nId,framework::GetImageFromURL(xFrame,aCommand,sal_False)); } } // ========================================================================= @@ -602,14 +600,14 @@ namespace //-------------------------------------------------------------------- void SAL_CALL SelectionSupplier::addSelectionChangeListener( const Reference< XSelectionChangeListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SelectionSupplier::removeSelectionChangeListener: no support!" ); + OSL_FAIL( "SelectionSupplier::removeSelectionChangeListener: no support!" ); // API bug: this should be a NoSupportException } //-------------------------------------------------------------------- void SAL_CALL SelectionSupplier::removeSelectionChangeListener( const Reference< XSelectionChangeListener >& /*_Listener*/ ) throw (RuntimeException) { - OSL_ENSURE( false, "SelectionSupplier::removeSelectionChangeListener: no support!" ); + OSL_FAIL( "SelectionSupplier::removeSelectionChangeListener: no support!" ); // API bug: this should be a NoSupportException } } @@ -669,7 +667,7 @@ PopupMenu* DBTreeListBox::CreateContextMenu( void ) break; default: - DBG_ERROR( "DBTreeListBox::CreateContextMenu: unexpected return value of the interceptor call!" ); + OSL_FAIL( "DBTreeListBox::CreateContextMenu: unexpected return value of the interceptor call!" ); case ContextMenuInterceptorAction_IGNORED: break; @@ -694,13 +692,13 @@ PopupMenu* DBTreeListBox::CreateContextMenu( void ) // the interceptors only know command URLs, but our menus primarily work // with IDs -> we need to translate the commands to IDs lcl_adjustMenuItemIDs( *pModifiedMenu, m_pContextMenuProvider->getCommandController() ); - } // if ( bModifiedMenu ) + } return pContextMenu.release(); } // ----------------------------------------------------------------------------- -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 2f2c7afd2a60..74193e682409 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/makefile.mk b/dbaccess/source/ui/control/makefile.mk index 76857497cb6b..913a4752e544 100644 --- a/dbaccess/source/ui/control/makefile.mk +++ b/dbaccess/source/ui/control/makefile.mk @@ -48,29 +48,29 @@ SRC1FILES = \ # ... exception files ......................... EXCEPTIONSFILES=\ - $(SLO)$/statusbarontroller.obj \ - $(SLO)$/RelationControl.obj \ - $(SLO)$/toolboxcontroller.obj \ - $(SLO)$/tabletree.obj \ - $(SLO)$/TableGrantCtrl.obj \ - $(SLO)$/dbtreelistbox.obj \ - $(SLO)$/sqledit.obj \ $(SLO)$/ColumnControlWindow.obj \ $(SLO)$/FieldDescControl.obj \ - $(SLO)$/opendoccontrols.obj + $(SLO)$/RelationControl.obj \ + $(SLO)$/SqlNameEdit.obj \ + $(SLO)$/TableGrantCtrl.obj \ + $(SLO)$/VertSplitView.obj \ + $(SLO)$/charsetlistbox.obj \ + $(SLO)$/curledit.obj \ + $(SLO)$/dbtreelistbox.obj \ + $(SLO)$/listviewitems.obj \ + $(SLO)$/marktree.obj \ + $(SLO)$/opendoccontrols.obj \ + $(SLO)$/sqledit.obj \ + $(SLO)$/statusbarontroller.obj \ + $(SLO)$/tabletree.obj \ + $(SLO)$/toolboxcontroller.obj \ + $(SLO)$/undosqledit.obj # ... object files ............................ SLOFILES= \ - $(EXCEPTIONSFILES) \ - $(SLO)$/ScrollHelper.obj \ - $(SLO)$/VertSplitView.obj \ - $(SLO)$/SqlNameEdit.obj \ - $(SLO)$/listviewitems.obj \ - $(SLO)$/undosqledit.obj \ - $(SLO)$/marktree.obj \ - $(SLO)$/curledit.obj \ - $(SLO)$/charsetlistbox.obj + $(EXCEPTIONSFILES) \ + $(SLO)$/ScrollHelper.obj # --- Targets ---------------------------------- diff --git a/dbaccess/source/ui/control/marktree.cxx b/dbaccess/source/ui/control/marktree.cxx index 1ecb15575ca9..e97f8a4a33fc 100644 --- a/dbaccess/source/ui/control/marktree.cxx +++ b/dbaccess/source/ui/control/marktree.cxx @@ -152,10 +152,9 @@ SvButtonState OMarkableTreeListBox::implDetermineState(SvLBoxEntry* _pEntry) // we did not finish the loop because at least one of the children is in tristate eState = SV_BUTTON_TRISTATE; - // but this means that we did not finish all the siblings of pChildLoop, so their checking may be - // incorrect at the moment + // but this means that we did not finish all the siblings of pChildLoop, + // so their checking may be incorrect at the moment // -> correct this - // 88485 - 20.06.2001 - frank.schoenheit@sun.com while (pChildLoop) { implDetermineState(pChildLoop); @@ -163,9 +162,9 @@ SvButtonState OMarkableTreeListBox::implDetermineState(SvLBoxEntry* _pEntry) } } else - // none if the children is in tristate + // none if the children are in tristate if (nCheckedChildren) - // we have at least one chil checked + // we have at least one child checked if (nCheckedChildren != nChildrenOverall) // not all children are checked eState = SV_BUTTON_TRISTATE; diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 78fd8f4fdd1c..e02b7c000501 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -49,6 +49,7 @@ #include <comphelper/sequenceashashmap.hxx> #include <tools/urlobj.hxx> #include <svl/filenotation.hxx> +#include <osl/diagnose.h> //........................................................................ namespace dbaui @@ -106,7 +107,7 @@ namespace dbaui for ( sal_Int32 i=0; i<nCount; ++i ) { ::rtl::OUString sPropertyName( aProperties[i].Name ); - if ( sPropertyName.equalsAscii("Label" ) ) + if ( sPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("Label" ) ) ) { aProperties[i].Value >>= sLabel; break; @@ -185,7 +186,7 @@ namespace dbaui //-------------------------------------------------------------------- void OpenDocumentButton::impl_init( const sal_Char* _pAsciiModuleName ) { - DBG_ASSERT( _pAsciiModuleName, "OpenDocumentButton::impl_init: invalid module name!" ); + OSL_ENSURE( _pAsciiModuleName, "OpenDocumentButton::impl_init: invalid module name!" ); m_sModule = ::rtl::OUString::createFromAscii( _pAsciiModuleName ); // our label should equal the UI text of the "Open" command @@ -195,9 +196,9 @@ namespace dbaui SetText( sLabel ); // Place icon left of text and both centered in the button. - SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ), BMP_COLOR_NORMAL ); - EnableImageDisplay( TRUE ); - EnableTextDisplay( TRUE ); + SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ) ); + EnableImageDisplay( sal_True ); + EnableTextDisplay( sal_True ); SetImageAlign( IMAGEALIGN_LEFT ); SetStyle( GetStyle() | WB_CENTER ); } @@ -215,7 +216,7 @@ namespace dbaui //-------------------------------------------------------------------- void OpenDocumentListBox::impl_init( const sal_Char* _pAsciiModuleName ) { - DBG_ASSERT( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" ); + OSL_ENSURE( _pAsciiModuleName, "OpenDocumentListBox::impl_init: invalid module name!" ); Sequence< Sequence< PropertyValue> > aHistory = SvtHistoryOptions().GetList( ePICKLIST ); Reference< XNameAccess > xFilterFactory; @@ -256,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 ) ) ); } } @@ -271,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; @@ -281,17 +282,17 @@ 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 ); - DBG_ASSERT( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" ); + OSL_ENSURE( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" ); StringPair aDocumentDescriptor; if ( pos != m_aURLs.end() ) @@ -315,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 3eee26f30959..1caa8917be8b 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 832459021f1e..c1c12947cb9b 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -50,10 +50,12 @@ #include "commontypes.hxx" #include "listviewitems.hxx" #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <connectivity/dbmetadata.hxx> #include <algorithm> +#include <o3tl/compat_functional.hxx> //......................................................................... namespace dbaui @@ -105,10 +107,8 @@ OTableTreeListBox::~OTableTreeListBox() void OTableTreeListBox::implSetDefaultImages() { ImageProvider aImageProvider; - SetDefaultExpandedEntryBmp( aImageProvider.getFolderImage( DatabaseObject::TABLE, false ), BMP_COLOR_NORMAL ); - SetDefaultExpandedEntryBmp( aImageProvider.getFolderImage( DatabaseObject::TABLE, true ), BMP_COLOR_HIGHCONTRAST ); - SetDefaultCollapsedEntryBmp( aImageProvider.getFolderImage( DatabaseObject::TABLE, false ), BMP_COLOR_NORMAL ); - SetDefaultCollapsedEntryBmp( aImageProvider.getFolderImage( DatabaseObject::TABLE, true ), BMP_COLOR_HIGHCONTRAST ); + SetDefaultExpandedEntryBmp( aImageProvider.getFolderImage( DatabaseObject::TABLE ) ); + SetDefaultCollapsedEntryBmp( aImageProvider.getFolderImage( DatabaseObject::TABLE ) ); } // ----------------------------------------------------------------------------- @@ -131,33 +131,27 @@ 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) { SvLBoxContextBmp* pContextBitmapItem = static_cast< SvLBoxContextBmp* >( pItem ); - Image aImage, aImageHC; + Image aImage; if ( isFolderEntry( pEntryLoop ) ) { - aImage = m_pImageProvider->getFolderImage( DatabaseObject::TABLE, false ); - aImageHC = m_pImageProvider->getFolderImage( DatabaseObject::TABLE, true ); + aImage = m_pImageProvider->getFolderImage( DatabaseObject::TABLE ); } else { String sCompleteName( getQualifiedTableName( pEntryLoop ) ); - m_pImageProvider->getImages( sCompleteName, DatabaseObject::TABLE, aImage, aImageHC ); + m_pImageProvider->getImages( sCompleteName, DatabaseObject::TABLE, aImage ); } - pContextBitmapItem->SetBitmap1( aImage, BMP_COLOR_NORMAL ); - pContextBitmapItem->SetBitmap2( aImage, BMP_COLOR_NORMAL ); - pContextBitmapItem->SetBitmap1( aImageHC, BMP_COLOR_HIGHCONTRAST ); - pContextBitmapItem->SetBitmap2( aImageHC, BMP_COLOR_HIGHCONTRAST ); - // TODO: Now that we give both images to the entry item, it is not necessary anymore - // to do this anytime HC changes - the tree control will do this itself now. - // We would only need to properly initialize newly inserted entries. + pContextBitmapItem->SetBitmap1( aImage ); + pContextBitmapItem->SetBitmap2( aImage ); break; } } @@ -199,7 +193,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn } catch(RuntimeException&) { - DBG_ERROR("OTableTreeListBox::UpdateTableList : caught an RuntimeException!"); + OSL_FAIL("OTableTreeListBox::UpdateTableList : caught an RuntimeException!"); } catch ( const SQLException& ) { @@ -207,7 +201,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn } catch(Exception&) { - // a non-SQLException exception occured ... simply throw an SQLException + // a non-SQLException exception occurred ... simply throw an SQLException SQLException aInfo; aInfo.Message = sCurrentActionError; throw aInfo; @@ -290,15 +284,13 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn try { - // the root entry saying "all objects" - SvLBoxEntry* pAllObjects = NULL; if (haveVirtualRoot()) { String sRootEntryText; TNames::const_iterator aViews = ::std::find_if(_rTables.begin(),_rTables.end(), - ::std::compose1(::std::bind2nd(::std::equal_to<sal_Bool>(),sal_False),::std::select2nd<TNames::value_type>())); + ::o3tl::compose1(::std::bind2nd(::std::equal_to<sal_Bool>(),sal_False),::o3tl::select2nd<TNames::value_type>())); TNames::const_iterator aTables = ::std::find_if(_rTables.begin(),_rTables.end(), - ::std::compose1(::std::bind2nd(::std::equal_to<sal_Bool>(),sal_True),::std::select2nd<TNames::value_type>())); + ::o3tl::compose1(::std::bind2nd(::std::equal_to<sal_Bool>(),sal_True),::o3tl::select2nd<TNames::value_type>())); if ( aViews == _rTables.end() ) sRootEntryText = String(ModuleRes(STR_ALL_TABLES)); @@ -306,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)); - pAllObjects = 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() ) @@ -352,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 ) ); } } } @@ -392,22 +384,21 @@ void OTableTreeListBox::checkedButton_noBroadcast(SvLBoxEntry* _pEntry) { OMarkableTreeListBox::checkedButton_noBroadcast(_pEntry); - // if an entry has children, it makes a difference if the entry is checked because alls children are checked - // or if the user checked it explicitly. + // if an entry has children, it makes a difference if the entry is checked + // because all children are checked or if the user checked it explicitly. // So we track explicit (un)checking SvButtonState eState = GetCheckButtonState(_pEntry); - DBG_ASSERT(SV_BUTTON_TRISTATE != eState, "OTableTreeListBox::CheckButtonHdl: user action which lead to TRISTATE?"); + OSL_ENSURE(SV_BUTTON_TRISTATE != eState, "OTableTreeListBox::CheckButtonHdl: user action which lead to TRISTATE?"); implEmphasize(_pEntry, SV_BUTTON_CHECKED == eState); } //------------------------------------------------------------------------ void OTableTreeListBox::implEmphasize(SvLBoxEntry* _pEntry, sal_Bool _bChecked, sal_Bool _bUpdateDescendants, sal_Bool _bUpdateAncestors) { - DBG_ASSERT(_pEntry, "OTableTreeListBox::implEmphasize: invalid entry (NULL)!"); + OSL_ENSURE(_pEntry, "OTableTreeListBox::implEmphasize: invalid entry (NULL)!"); // special emphasizing handling for the "all objects" entry - // 89709 - 16.07.2001 - frank.schoenheit@sun.com sal_Bool bAllObjectsEntryAffected = haveVirtualRoot() && (getAllObjectsEntry() == _pEntry); if ( GetModel()->HasChilds(_pEntry) // the entry has children || bAllObjectsEntryAffected // or it is the "all objects" entry @@ -448,9 +439,9 @@ void OTableTreeListBox::InitEntry(SvLBoxEntry* _pEntry, const XubString& _rStrin // replace the text item with our own one SvLBoxItem* pTextItem = _pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING); - DBG_ASSERT(pTextItem, "OTableTreeListBox::InitEntry: no text item!?"); + OSL_ENSURE(pTextItem, "OTableTreeListBox::InitEntry: no text item!?"); sal_uInt16 nTextPos = _pEntry->GetPos(pTextItem); - DBG_ASSERT(((sal_uInt16)-1) != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); + OSL_ENSURE(((sal_uInt16)-1) != nTextPos, "OTableTreeListBox::InitEntry: no text item pos!"); _pEntry->ReplaceItem(new OBoldListboxString(_pEntry, 0, _rString), nTextPos); } @@ -490,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; } @@ -498,22 +489,20 @@ 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, aImageHC; - m_pImageProvider->getImages( _rTableName, DatabaseObject::TABLE, aImage, aImageHC ); + Image aImage; + m_pImageProvider->getImages( _rTableName, DatabaseObject::TABLE, aImage ); - SetExpandedEntryBmp( pRet, aImage, BMP_COLOR_NORMAL ); - SetCollapsedEntryBmp( pRet, aImage, BMP_COLOR_NORMAL ); - SetExpandedEntryBmp( pRet, aImageHC, BMP_COLOR_HIGHCONTRAST ); - SetCollapsedEntryBmp( pRet, aImageHC, BMP_COLOR_HIGHCONTRAST ); + SetExpandedEntryBmp( pRet, aImage ); + SetCollapsedEntryBmp( pRet, aImage ); } return pRet; } diff --git a/dbaccess/source/ui/control/tabletree.src b/dbaccess/source/ui/control/tabletree.src index d08535f3e8da..71f3945e245e 100644 --- a/dbaccess/source/ui/control/tabletree.src +++ b/dbaccess/source/ui/control/tabletree.src @@ -33,7 +33,6 @@ #endif #include "browserids.hxx" - Menu MENU_TABLETREE_POPUP { ItemList = @@ -65,24 +64,28 @@ String STR_COULDNOTCONNECT { Text [ en-US ] = "No connection could be established for the URL #connurl#."; }; + String STR_COULDNOTCONNECT_PLEASECHECK { Text [ en-US ] = "Please check the current settings, for example user name and password."; }; + String STR_NOTABLEINFO { Text [ en-US ] = "Successfully connected, but information about database tables is not available."; }; + String STR_ALL_TABLES { Text [ en-US ] = "All tables"; }; + String STR_ALL_VIEWS { Text [ en-US ] = "All views"; }; + String STR_ALL_TABLES_AND_VIEWS { Text [ en-US ] = "All tables and views"; }; - diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 57618dea47b1..5f36c9678b99 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)); @@ -115,7 +115,7 @@ namespace dbaui SolarMutexGuard aSolarMutexGuard; ::osl::MutexGuard aGuard(m_aMutex); - if ( m_aCommandURL.equalsAscii(".uno:DBNewForm") ) + if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:DBNewForm")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewForm")) ,sal_True)); m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DBNewView")) ,sal_True)); @@ -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 ) { @@ -192,8 +192,6 @@ namespace dbaui { pMenu.reset( new PopupMenu( ModuleRes( RID_MENU_APP_NEW ) ) ); - sal_Bool bHighContrast = isHighContrast(); - try { Reference<XModuleUIConfigurationManagerSupplier> xModuleCfgMgrSupplier(getServiceManager()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.ModuleUIConfigurationManagerSupplier"))),UNO_QUERY); @@ -202,17 +200,15 @@ namespace dbaui short nImageType = hasBigImages() ? ImageType::SIZE_LARGE : ImageType::SIZE_DEFAULT; - if ( bHighContrast ) - nImageType |= ImageType::COLOR_HIGHCONTRAST; 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); @@ -246,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/control/undosqledit.src b/dbaccess/source/ui/control/undosqledit.src index 814a304d18c0..aab44ad5e7db 100644 --- a/dbaccess/source/ui/control/undosqledit.src +++ b/dbaccess/source/ui/control/undosqledit.src @@ -33,34 +33,3 @@ String STR_QUERY_UNDO_MODIFYSQLEDIT { Text [ en-US ] = "Modify SQL statement(s)" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/dlg/AdabasStat.cxx b/dbaccess/source/ui/dlg/AdabasStat.cxx index 6f4af6e9aae8..25710d04abfc 100644 --- a/dbaccess/source/ui/dlg/AdabasStat.cxx +++ b/dbaccess/source/ui/dlg/AdabasStat.cxx @@ -29,9 +29,9 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" -#include <tools/debug.hxx> #include <cppuhelper/exc_hlp.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "AdabasStat.hxx" #include <comphelper/types.hxx> #include <com/sun/star/sdbc/XStatement.hpp> @@ -84,7 +84,7 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, FreeResource(); - DBG_ASSERT(m_xConnection.is(),"No connection"); + OSL_ENSURE(m_xConnection.is(),"No connection"); if(m_xConnection.is()) { Reference<XStatement> xStmt; @@ -99,14 +99,14 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, try { xMetaData = m_xConnection->getMetaData(); - bCanSelect = checkSystemTable(::rtl::OUString::createFromAscii("SERVERDBSTATISTICS"),sSchema); + bCanSelect = checkSystemTable(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SERVERDBSTATISTICS")), sSchema); if(bCanSelect) { - aStmt = ::rtl::OUString::createFromAscii("SELECT SERVERDBSIZE, UNUSEDPAGES FROM "); + aStmt = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT SERVERDBSIZE, UNUSEDPAGES FROM ")); aStmt += ::dbtools::quoteTableName(xMetaData,sSchema,::dbtools::eInDataManipulation); - aStmt += ::rtl::OUString::createFromAscii(".\"SERVERDBSTATISTICS\""); + aStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".\"SERVERDBSTATISTICS\"")); xStmt = m_xConnection->createStatement(); xRes = xStmt->executeQuery(aStmt); @@ -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 @@ -153,14 +153,14 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, { try { - bCanSelect = checkSystemTable(::rtl::OUString::createFromAscii("DATADEVSPACES"),sSchema); + bCanSelect = checkSystemTable(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATADEVSPACES")), sSchema); if(bCanSelect) { // then the db files - aStmt = ::rtl::OUString::createFromAscii("SELECT DEVSPACENAME FROM "); + aStmt = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT DEVSPACENAME FROM ")); aStmt += ::dbtools::quoteTableName(xMetaData,sSchema,::dbtools::eInDataManipulation); - aStmt += ::rtl::OUString::createFromAscii(".\"DATADEVSPACES\""); + aStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".\"DATADEVSPACES\"")); xStmt = m_xConnection->createStatement(); xRes = xStmt->executeQuery(aStmt); @@ -197,13 +197,13 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, { try { - bCanSelect = checkSystemTable(::rtl::OUString::createFromAscii("CONFIGURATION"),sSchema); + bCanSelect = checkSystemTable(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CONFIGURATION")), sSchema); if(bCanSelect) { - aStmt = ::rtl::OUString::createFromAscii("SELECT * FROM "); + aStmt = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT * FROM ")); aStmt += ::dbtools::quoteTableName(xMetaData,sSchema,::dbtools::eInDataManipulation); - aStmt += ::rtl::OUString::createFromAscii(".CONFIGURATION WHERE DESCRIPTION LIKE 'SYS%DEVSPACE%NAME'"); + aStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".CONFIGURATION WHERE DESCRIPTION LIKE 'SYS%DEVSPACE%NAME'")); xStmt = m_xConnection->createStatement(); xRes = xStmt->executeQuery(aStmt); if(xRes.is() && xRes->next()) @@ -214,9 +214,9 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, else showError(); - aStmt = ::rtl::OUString::createFromAscii("SELECT * FROM "); + aStmt = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT * FROM ")); aStmt += ::dbtools::quoteTableName(xMetaData,sSchema,::dbtools::eInDataManipulation); - aStmt += ::rtl::OUString::createFromAscii(".CONFIGURATION WHERE DESCRIPTION = 'TRANSACTION LOG NAME'"); + aStmt += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".CONFIGURATION WHERE DESCRIPTION = 'TRANSACTION LOG NAME'")); xRes = xStmt->executeQuery(aStmt); if(xRes.is() && xRes->next()) { @@ -268,11 +268,11 @@ sal_Bool OAdabasStatistics::checkSystemTable(const ::rtl::OUString& _rsSystemTab Reference<XDatabaseMetaData> xMeta = m_xConnection->getMetaData(); if ( xMeta.is() ) { - Reference<XResultSet> xRes = xMeta->getTablePrivileges(Any(),::rtl::OUString::createFromAscii("%"), _rsSystemTable); + Reference<XResultSet> xRes = xMeta->getTablePrivileges(Any(), ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%")), _rsSystemTable); if(xRes.is()) { Reference<XRow> xRow(xRes,UNO_QUERY); - static const ::rtl::OUString sSelect = ::rtl::OUString::createFromAscii("SELECT"); + static const ::rtl::OUString sSelect(RTL_CONSTASCII_USTRINGPARAM("SELECT")); // first the db sizes while( xRow.is() && xRes->next() ) { diff --git a/dbaccess/source/ui/dlg/AdabasStat.src b/dbaccess/source/ui/dlg/AdabasStat.src index ff29ac12383d..476750f7b531 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 ) ; @@ -199,33 +206,3 @@ String STR_ADABAS_ERROR_SYSTEMTABLES { Text [ en-US ] = "No information could be displayed because no access rights exist for the required system tables."; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/dlg/AutoControls.src b/dbaccess/source/ui/dlg/AutoControls.src index 1bfe3c0233a9..e43e2a13a7fb 100644 --- a/dbaccess/source/ui/dlg/AutoControls.src +++ b/dbaccess/source/ui/dlg/AutoControls.src @@ -69,13 +69,11 @@ String STR_MSACCESS_MDB_FILE Text[ en-US ] = "Microsoft Access database file"; }; - String STR_NO_ADDITIONAL_SETTINGS { Text[ en-US ] = "No more settings are necessary. To verify that the connection is working, click the '%test' button."; }; - String STR_COMMONURL { Text [ en-US ] = "Datasource URL" ; @@ -85,18 +83,15 @@ String STR_HOSTNAME { Text[ en-US ] = "~Host name"; }; + String STR_MOZILLA_PROFILE_NAME { Text[ en-US ] = "~Mozilla profile name"; }; + String STR_THUNDERBIRD_PROFILE_NAME { Text[ en-US ] = "~Thunderbird profile name"; }; - // ------------------------------------------------------------------------------------------------- - - - - diff --git a/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc b/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc index 425e713094f3..258eec3a2acf 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 c3308fd53f9a..89e3a8d8439a 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -107,9 +107,7 @@ OCollectionView::OCollectionView( Window * pParent m_aNewFolder.SetStyle( m_aNewFolder.GetStyle() | WB_NOPOINTERFOCUS ); m_aUp.SetModeImage(ModuleRes(IMG_NAVIGATION_BTN_UP_SC)); - m_aUp.SetModeImage(ModuleRes(IMG_NAVIGATION_BTN_UP_SCH),BMP_COLOR_HIGHCONTRAST); m_aNewFolder.SetModeImage(ModuleRes(IMG_NAVIGATION_CREATEFOLDER_SC)); - m_aNewFolder.SetModeImage(ModuleRes(IMG_NAVIGATION_CREATEFOLDER_SCH),BMP_COLOR_HIGHCONTRAST); m_aView.SetDoubleClickHdl( LINK( this, OCollectionView, Dbl_Click_FileView ) ); m_aView.EnableAutoResize(); @@ -213,10 +211,9 @@ IMPL_LINK( OCollectionView, Save_Click, PushButton*, EMPTYARG ) QueryBox aBox( this, WB_YES_NO, ModuleRes( STR_ALREADYEXISTOVERWRITE ) ); if ( aBox.Execute() != RET_YES ) return 0; - // xNameContainer->removeByName(sName); } m_aName.SetText(sName); - EndDialog( TRUE ); + EndDialog( sal_True ); } } catch( const Exception& ) @@ -303,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 018893384dab..e431a6502e81 100644 --- a/dbaccess/source/ui/dlg/CollectionView.src +++ b/dbaccess/source/ui/dlg/CollectionView.src @@ -43,14 +43,12 @@ #define FIXEDLINE_HEIGHT 1 #define IMG_SIZE 15 - ModalDialog DLG_COLLECTION_VIEW { OutputSize = TRUE ; SVLook = TRUE ; Moveable = TRUE ; Closeable = TRUE ; - //Sizeable = TRUE; HelpId = HID_EXPLORERDLG_COLLECTION ; Size = MAP_APPFONT ( WIN_X , WIN_Y ) ; @@ -64,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 ) ; @@ -71,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 ) ; @@ -93,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 ; @@ -107,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 ; @@ -128,7 +130,6 @@ ModalDialog DLG_COLLECTION_VIEW Size = MAP_APPFONT ( 50 , BUTTON_HEIGHT ) ; }; - String STR_PATHNAME { Text [ en-US ] = "~Path:" ; @@ -139,29 +140,20 @@ String STR_NEW_FOLDER { Text [ en-US ] = "Folder" ; }; + Image IMG_NAVIGATION_BTN_UP_SC { ImageBitmap = Bitmap { File = "fp010"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; -Image IMG_NAVIGATION_BTN_UP_SCH -{ - ImageBitmap = Bitmap { File = "fph010"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; + Image IMG_NAVIGATION_CREATEFOLDER_SC { ImageBitmap = Bitmap { File = "fp015"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; -Image IMG_NAVIGATION_CREATEFOLDER_SCH -{ - ImageBitmap = Bitmap { File = "fph015"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; String STR_ALREADYEXISTOVERWRITE { Text [ en-US ] = "The file already exists. Overwrite?" ; }; - diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 7e6ac39f658f..d2f87d016152 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -45,6 +45,7 @@ #include "dbaccess_helpid.hrc" #include "localresaccess.hxx" #include <osl/process.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <sfx2/filedlghelper.hxx> #include "dbadmin.hxx" @@ -58,7 +59,6 @@ #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/awt/XWindow.hpp> -// #106016# ------------------------------------ #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include "UITools.hxx" @@ -70,16 +70,11 @@ #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 #ifdef _ADO_DATALINK_BROWSE_ -#if defined( WNT ) - #include <tools/prewin.h> - #include <windows.h> - #include <tools/postwin.h> -#endif #include <vcl/sysdata.hxx> #include "adodatalinks.hxx" #endif //_ADO_DATALINK_BROWSE_ @@ -120,7 +115,7 @@ DBG_NAME(OConnectionHelper) if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); m_aPB_Connection.SetClickHdl(LINK(this, OConnectionHelper, OnBrowseConnections)); - DBG_ASSERT(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !"); + OSL_ENSURE(m_pCollection, "OConnectionHelper::OConnectionHelper : really need a DSN type collection !"); m_aConnectionURL.SetTypeCollection(m_pCollection); } @@ -143,7 +138,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); @@ -184,7 +179,7 @@ DBG_NAME(OConnectionHelper) { try { - ::rtl::OUString sFolderPickerService = ::rtl::OUString::createFromAscii(SERVICE_UI_FOLDERPICKER); + ::rtl::OUString sFolderPickerService(SERVICE_UI_FOLDERPICKER); Reference< XFolderPicker > xFolderPicker(m_xORB->createInstance(sFolderPickerService), UNO_QUERY); if (!xFolderPicker.is()) { @@ -328,7 +323,6 @@ DBG_NAME(OConnectionHelper) if (RET_OK == aSelector.Execute()) { setURLNoPrefix(aSelector.GetSelected()); - // checkCreateDatabase( ::dbaccess::DST_ADABAS); SetRoadmapStateValue(sal_True); callModifiedHdl(); } @@ -406,7 +400,7 @@ DBG_NAME(OConnectionHelper) aProfiles.insert(pArray[index]); - // excute the select dialog + // execute the select dialog ODatasourceSelectDialog aSelector(GetParent(), aProfiles, eType); ::rtl::OUString sOldProfile=getURLNoPrefix(); @@ -440,13 +434,13 @@ DBG_NAME(OConnectionHelper) void OConnectionHelper::impl_setURL( const String& _rURL, sal_Bool _bPrefix ) { String sURL( _rURL ); - DBG_ASSERT( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" ); + OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_setURL: have no interpreter for the URLs!" ); if ( m_pCollection && sURL.Len() ) { if ( m_pCollection->isFileSystemBased( m_eType ) ) { - // get the tow parts: prefix and file URL + // get the two parts: prefix and file URL String sTypePrefix, sFileURLEncoded; if ( _bPrefix ) { @@ -486,13 +480,13 @@ DBG_NAME(OConnectionHelper) // get the pure text String sURL = _bPrefix ? m_aConnectionURL.GetText() : m_aConnectionURL.GetTextNoPrefix(); - DBG_ASSERT( m_pCollection, "OConnectionHelper::impl_getURL: have no interpreter for the URLs!" ); + OSL_ENSURE( m_pCollection, "OConnectionHelper::impl_getURL: have no interpreter for the URLs!" ); if ( m_pCollection && sURL.Len() ) { if ( m_pCollection->isFileSystemBased( m_eType ) ) { - // get the tow parts: prefix and file URL + // get the two parts: prefix and file URL String sTypePrefix, sFileURLDecoded; if ( _bPrefix ) { @@ -584,7 +578,6 @@ DBG_NAME(OConnectionHelper) break; case RET_NO: - // SetRoadmapStateValue(sal_False); callModifiedHdl(); return RET_OK; @@ -653,7 +646,7 @@ DBG_NAME(OConnectionHelper) } catch(Exception&) { - DBG_ERROR("OConnectionHelper::getInstalledAdabasDBDirs: could not enumerate the adabas config files!"); + OSL_FAIL("OConnectionHelper::getInstalledAdabasDBDirs: could not enumerate the adabas config files!"); } } @@ -697,7 +690,7 @@ DBG_NAME(OConnectionHelper) } return aInstalledDBs; } - // #106016# ------------------------------------------------------------------- + // ----------------------------------------------------------------------------- IS_PATH_EXIST OConnectionHelper::pathExists(const ::rtl::OUString& _rURL, sal_Bool bIsFile) const { ::ucbhelper::Content aCheckExistence; @@ -742,7 +735,7 @@ DBG_NAME(OConnectionHelper) return 1L; // handled } break; - } // switch (_rNEvt.GetType()) + } } return OGenericAdministrationPage::PreNotify( _rNEvt ); @@ -763,7 +756,6 @@ DBG_NAME(OConnectionHelper) ::std::vector< ::rtl::OUString > aToBeCreated; // the to-be-created levels // search a level which exists - // #106016# --------------------- IS_PATH_EXIST eParentExists = PATH_NOT_EXIST; while ( eParentExists == PATH_NOT_EXIST && aParser.getSegmentCount()) { @@ -785,18 +777,18 @@ DBG_NAME(OConnectionHelper) ::rtl::OUString sContentType; if ( INET_PROT_FILE == eProtocol ) { - sContentType = ::rtl::OUString::createFromAscii( "application/vnd.sun.staroffice.fsys-folder" ); + sContentType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("application/vnd.sun.staroffice.fsys-folder")); // the file UCP currently does not support the ContentType property } else { - Any aContentType = aParent.getPropertyValue( ::rtl::OUString::createFromAscii( "ContentType" ) ); + Any aContentType = aParent.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")) ); aContentType >>= sContentType; } // the properties which need to be set on the new content Sequence< ::rtl::OUString > aNewDirectoryProperties(1); - aNewDirectoryProperties[0] = ::rtl::OUString::createFromAscii("Title"); + aNewDirectoryProperties[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title")); // the values to be set Sequence< Any > aNewDirectoryAttributes(1); @@ -856,7 +848,7 @@ DBG_NAME(OConnectionHelper) const ::dbaccess::DATASOURCE_TYPE eType = m_pCollection->determineType(m_eType); if ( ( ::dbaccess::DST_CALC == eType) || ( ::dbaccess::DST_MSACCESS == eType) || ( ::dbaccess::DST_MSACCESS_2007 == eType) ) - { // #106016# -------------------------- + { if( pathExists(sURL, sal_True) == PATH_NOT_EXIST ) { String sFile = String( ModuleRes( STR_FILE_DOES_NOT_EXIST ) ); diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.hxx b/dbaccess/source/ui/dlg/ConnectionHelper.hxx index 3e4c538d084c..cd1e491dfb6b 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.hxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.hxx @@ -47,7 +47,6 @@ namespace dbaui { //......................................................................... - // #106016# -------------- enum IS_PATH_EXIST { PATH_NOT_EXIST = 0, diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index 03f2b5f057df..9e9f9cd027a9 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -56,7 +56,6 @@ #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/awt/XWindow.hpp> -// #106016# ------------------------------------ #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/sdbc/XConnection.hpp> @@ -72,16 +71,11 @@ #include <tools/urlobj.hxx> #include <sfx2/docfilt.hxx> #include "dsnItem.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #define _ADO_DATALINK_BROWSE_ #endif #ifdef _ADO_DATALINK_BROWSE_ -#if defined( WNT ) - #include <tools/prewin.h> - #include <windows.h> - #include <tools/postwin.h> -#endif #include <vcl/sysdata.hxx> #include "adodatalinks.hxx" #endif //_ADO_DATALINK_BROWSE_ @@ -135,6 +129,8 @@ namespace dbaui m_aTestJavaDriver.SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aTestConnection ); } // ----------------------------------------------------------------------- @@ -259,7 +255,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); @@ -268,7 +264,7 @@ namespace dbaui m_aJavaDriver.SetText(sDefaultJdbcDriverName); m_aJavaDriver.SetModifyFlag(); } - } // if ( !pJdbcDrvItem->GetValue().Len() ) + } else m_aJavaDriver.SetText(pJdbcDrvItem->GetValue()); @@ -349,7 +345,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; @@ -358,7 +354,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 140ea6792efc..bd0034a22a91 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 8ead374bdef4..63c400b0a77a 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,9 +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 { @@ -66,7 +65,6 @@ TabPage PAGE_CONNECTION Size = MAP_APPFONT ( PAGE_X - 12 , 3*FIXEDTEXT_HEIGHT ) ; }; - FixedText FT_HOSTNAME { Hide = TRUE; @@ -75,7 +73,6 @@ TabPage PAGE_CONNECTION Text[ en-US ] = "~Host name"; }; - FixedLine FL_SEPARATOR2 { Pos = MAP_APPFONT ( 4 , 3*FIXEDTEXT_HEIGHT + 3*UNRELATED_CONTROLS + RELATED_CONTROLS ) ; @@ -89,15 +86,19 @@ TabPage PAGE_CONNECTION Size = MAP_APPFONT ( 90 - 12 , FIXEDTEXT_HEIGHT ) ; Text [ en-US ] = "~User name" ; }; + 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 ) ; TabStop = TRUE ; }; + 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"; @@ -118,6 +119,7 @@ TabPage PAGE_CONNECTION Size = MAP_APPFONT ( 90 - 12 , FIXEDTEXT_HEIGHT ) ; Text [ en-US ] = "~JDBC driver class" ; }; + Edit ET_JDBCDRIVERCLASS { Border = TRUE ; @@ -129,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 ) ; @@ -137,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 ; @@ -184,4 +188,3 @@ String STR_MSACCESS_2007_FILTERNAME { Text [ en-US ] = "MS Access 2007 file"; }; - diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index fcc5af853afd..6ee4c808aeb5 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -56,7 +56,6 @@ #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/awt/XWindow.hpp> -// #106016# ------------------------------------ #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/sdbc/XConnection.hpp> @@ -134,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 c49fcc8d28ad..0fd31cf58101 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -42,14 +42,6 @@ namespace dbaui { //......................................................................... -/* // #106016# -------------- - enum IS_PATH_EXIST - { - PATH_NOT_EXIST = 0, - PATH_EXIST, - PATH_NOT_KNOWN - }; - */ class IDatabaseSettingsDialog; //========================================================================= @@ -77,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 ); @@ -95,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 66a1c3b44787..d2b4bb956b67 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -51,7 +51,6 @@ #include <comphelper/types.hxx> #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> -// #106016# ------------------------------------ #include <com/sun/star/task/XInteractionHandler.hpp> #include <com/sun/star/sdbc/XDriverAccess.hpp> #include "dbustrings.hrc" @@ -66,6 +65,7 @@ #include <unotools/pathoptions.hxx> #include <svtools/roadmapwizard.hxx> #include "TextConnectionHelper.hxx" +#include <osl/diagnose.h> //......................................................................... @@ -73,14 +73,6 @@ namespace dbaui { //......................................................................... using namespace ::com::sun::star; -// using namespace ::com::sun::star::ucb; -// using namespace ::com::sun::star::ui::dialogs; -// using namespace ::com::sun::star::sdbc; -// using namespace ::com::sun::star::beans; -// using namespace ::com::sun::star::lang; -// using namespace ::com::sun::star::container; -// using namespace ::dbtools; -// using namespace ::svt; OGenericAdministrationPage* OTextConnectionPageSetup::CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet ) { @@ -210,7 +202,7 @@ DBG_NAME(OTextConnectionPageSetup) ::dbaccess::ODsnTypeCollection* pCollection = NULL; if (pCollectionItem) pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !"); + OSL_ENSURE(pCollection, "OLDAPConnectionPageSetup::FillItemSet : really need a DSN type collection !"); String sUrl = pCollection->getPrefix( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:address:ldap:"))); sUrl += m_aETHostServer.GetText(); @@ -218,7 +210,6 @@ DBG_NAME(OTextConnectionPageSetup) bChangedSomething = sal_True; } - // fillString(_rSet,&m_aETHostServer, DSID_CONNECTURL, bChangedSomething); fillBool(_rSet,&m_aCBUseSSL,DSID_CONN_LDAP_USESSL,bChangedSomething); return bChangedSomething; } @@ -342,9 +333,9 @@ 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."); + OSL_FAIL("Who called me?! Please ask oj for more information."); return sal_True; } @@ -430,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)) @@ -588,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; @@ -664,8 +655,8 @@ DBG_NAME(OMySQLIntroPageSetup) { m_aETDriverClass.SetText(sDefaultJdbcDriverName); m_aETDriverClass.SetModifyFlag(); - } // if ( sDefaultJdbcDriverName.Len() ) - } // if ( !pJdbcDrvItem->GetValue().Len() ) + } + } else { m_aETDriverClass.SetText(pDrvItem->GetValue()); @@ -683,10 +674,9 @@ 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; -// m_aTestConnection.Enable(bEnableTestConnection); } @@ -708,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; @@ -801,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 da3735b18cc7..00fe40ffbce1 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -48,7 +48,6 @@ namespace dbaui //......................................................................... class IDatabaseSettingsDialog; -// static OGenericAdministrationPage* CreateDbaseTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); //======================================================================== @@ -57,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); @@ -78,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; @@ -102,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); } @@ -145,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(); @@ -161,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); @@ -195,7 +194,7 @@ namespace dbaui PushButton m_aPBTestJavaDriver; String m_sDefaultJdbcDriverName; - USHORT m_nPortId; + sal_uInt16 m_nPortId; }; @@ -211,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); @@ -251,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); @@ -278,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); @@ -305,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 8be379b9aa89..968fc0127157 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -76,6 +76,7 @@ #include <svl/stritem.hxx> #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <typelib/typedescription.hxx> #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> @@ -85,6 +86,8 @@ #include <algorithm> #include <functional> +#include <o3tl/compat_functional.hxx> + //......................................................................... namespace dbaui { @@ -105,12 +108,12 @@ 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; SfxItemPool* pPool = _rSet.GetPool(); - DBG_ASSERT( pPool, "implCheckItemType: invalid item pool!" ); + OSL_ENSURE( pPool, "implCheckItemType: invalid item pool!" ); if ( pPool ) { const SfxPoolItem& rDefItem = pPool->GetDefaultItem( _nId ); @@ -128,11 +131,11 @@ namespace } catch(Exception&) { - #ifdef DBG_UTIL + #if OSL_DEBUG_LEVEL > 0 ::rtl::OString sMessage("ODbAdminDialog::implTranslateProperty: could not set the property "); sMessage += ::rtl::OString(_rName.getStr(), _rName.getLength(), RTL_TEXTENCODING_ASCII_US); sMessage += ::rtl::OString("!"); - DBG_ERROR(sMessage.getStr()); + OSL_FAIL(sMessage.getStr()); #endif } @@ -207,18 +210,18 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_NAMED_PIPE, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "NamedPipe" ) ) ) ); // special settings for adabas - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SHUTSERVICE, ::rtl::OUString::createFromAscii("ShutdownDatabase"))); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_DATAINC, ::rtl::OUString::createFromAscii("DataCacheSizeIncrement"))); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_CACHESIZE, ::rtl::OUString::createFromAscii("DataCacheSize"))); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_CTRLUSER, ::rtl::OUString::createFromAscii("ControlUser"))); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_CTRLPWD, ::rtl::OUString::createFromAscii("ControlPassword"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_SHUTSERVICE, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShutdownDatabase")))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_DATAINC, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataCacheSizeIncrement")))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_CACHESIZE, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DataCacheSize")))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_CTRLUSER, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlUser")))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_CTRLPWD, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlPassword")))); // extra settings for odbc m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_USECATALOG, INFO_USECATALOG)); // extra settings for a ldap address book m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_BASEDN, INFO_CONN_LDAP_BASEDN)); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_ROWCOUNT, INFO_CONN_LDAP_ROWCOUNT)); - m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_USESSL, ::rtl::OUString::createFromAscii("UseSSL"))); + m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_CONN_LDAP_USESSL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UseSSL")))); m_aIndirectPropTranslator.insert(MapInt2String::value_type(DSID_DOCUMENT_URL, PROPERTY_URL)); // oracle @@ -238,12 +241,12 @@ ODbDataSourceAdministrationHelper::ODbDataSourceAdministrationHelper(const Refer ShowServiceNotAvailableError(_pParent->GetParent(), String(SERVICE_SDB_DATABASECONTEXT), sal_True); } - DBG_ASSERT(m_xDynamicContext.is(), "ODbAdminDialog::ODbAdminDialog : no XNamingService interface !"); + OSL_ENSURE(m_xDynamicContext.is(), "ODbAdminDialog::ODbAdminDialog : no XNamingService interface !"); } //------------------------------------------------------------------------- sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< PropertyValue >& _rDriverParam) { - DBG_ASSERT(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::getCurrentSettings : not to be called without an example set!"); + OSL_ENSURE(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::getCurrentSettings : not to be called without an example set!"); if (!m_pItemSetHelper->getOutputSet()) return sal_False; @@ -356,7 +359,7 @@ sal_Bool ODbDataSourceAdministrationHelper::getCurrentSettings(Sequence< Propert //------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::successfullyConnected() { - DBG_ASSERT(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::successfullyConnected: not to be called without an example set!"); + OSL_ENSURE(m_pItemSetHelper->getOutputSet(), "ODbDataSourceAdministrationHelper::successfullyConnected: not to be called without an example set!"); if (!m_pItemSetHelper->getOutputSet()) return; @@ -422,7 +425,7 @@ Reference< XDriver > ODbDataSourceAdministrationHelper::getDriver(const ::rtl::O try { xDriverManager = Reference< XDriverAccess >(getORB()->createInstance(SERVICE_SDBC_CONNECTIONPOOL), UNO_QUERY); - DBG_ASSERT(xDriverManager.is(), "ODbDataSourceAdministrationHelper::getDriver: could not instantiate the driver manager, or it does not provide the necessary interface!"); + OSL_ENSURE(xDriverManager.is(), "ODbDataSourceAdministrationHelper::getDriver: could not instantiate the driver manager, or it does not provide the necessary interface!"); } catch (Exception& e) { @@ -477,16 +480,16 @@ Reference< XPropertySet > ODbDataSourceAdministrationHelper::getCurrentDataSourc } - DBG_ASSERT(m_xDatasource.is(), "ODbDataSourceAdministrationHelper::getCurrentDataSource: no data source!"); + OSL_ENSURE(m_xDatasource.is(), "ODbDataSourceAdministrationHelper::getCurrentDataSource: no data source!"); return m_xDatasource; } //------------------------------------------------------------------------- ::rtl::OUString ODbDataSourceAdministrationHelper::getDatasourceType( const SfxItemSet& _rSet ) { SFX_ITEMSET_GET( _rSet, pConnectURL, SfxStringItem, DSID_CONNECTURL, sal_True ); - DBG_ASSERT( pConnectURL , "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" ); + OSL_ENSURE( pConnectURL , "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!" ); SFX_ITEMSET_GET(_rSet, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); - DBG_ASSERT(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); + OSL_ENSURE(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); return pCollection->getType(pConnectURL->GetValue()); } @@ -507,9 +510,9 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!"); - DBG_ASSERT(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); + OSL_ENSURE(pTypeCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid items in the source set!"); ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); - DBG_ASSERT(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); + OSL_ENSURE(pCollection, "ODbDataSourceAdministrationHelper::getDatasourceType: invalid type collection!"); switch( pCollection->determineType(eType) ) { @@ -586,7 +589,6 @@ String ODbDataSourceAdministrationHelper::getConnectionURL() const break; case ::dbaccess::DST_LDAP: { - // SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pHostName, SfxStringItem, DSID_CONN_HOSTNAME, sal_True); SFX_ITEMSET_GET(*m_pItemSetHelper->getOutputSet(), pPortNumber, SfxInt32Item, DSID_CONN_LDAP_PORTNUMBER, sal_True); sNewUrl = pCollection->cutPrefix(pUrlItem->GetValue()); sNewUrl += lcl_createHostWithPort(NULL,pPortNumber); @@ -637,11 +639,11 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr } catch(Exception&) { -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ::rtl::OString aMessage("ODbDataSourceAdministrationHelper::translateProperties: could not extract the property "); aMessage += ::rtl::OString(aDirect->second.getStr(), aDirect->second.getLength(), RTL_TEXTENCODING_ASCII_US); aMessage += ::rtl::OString("!"); - DBG_ERROR(aMessage.getStr()); + OSL_FAIL(aMessage.getStr()); #endif } // transfer it into an item @@ -664,7 +666,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr if (0 == pAdditionalInfo->Name.compareToAscii("JDBCDRV")) { // compatibility PropertyValue aCompatibility(*pAdditionalInfo); - aCompatibility.Name = ::rtl::OUString::createFromAscii("JavaDriverClass"); + aCompatibility.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("JavaDriverClass")); aInfos.insert(aCompatibility); } else @@ -700,14 +702,14 @@ void ODbDataSourceAdministrationHelper::translateProperties(const Reference< XPr } catch(Exception&) { - OSL_ENSURE(0,"IsReadOnly throws an exception!"); + OSL_FAIL("IsReadOnly throws an exception!"); } } //------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _rSource, const Reference< XPropertySet >& _rxDest) { - DBG_ASSERT(_rxDest.is(), "ODbDataSourceAdministrationHelper::translateProperties: invalid property set!"); + OSL_ENSURE(_rxDest.is(), "ODbDataSourceAdministrationHelper::translateProperties: invalid property set!"); if (!_rxDest.is()) return; @@ -724,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; @@ -783,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) ) { @@ -833,14 +835,13 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS // * are known as indirect properties // * but not relevant for the current data source type // These settings have to be removed: If they're not relevant, we have no UI for changing them. - // 25.06.2001 - 88004/87182 - frank.schoenheit@sun.com // for this, we need a string-controlled quick access to m_aIndirectPropTranslator StringSet aIndirectProps; ::std::transform(m_aIndirectPropTranslator.begin(), m_aIndirectPropTranslator.end(), ::std::insert_iterator<StringSet>(aIndirectProps,aIndirectProps.begin()), - ::std::select2nd<MapInt2String::value_type>()); + ::o3tl::select2nd<MapInt2String::value_type>()); // now check the to-be-preserved props ::std::vector< sal_Int32 > aRemoveIndexes; @@ -853,7 +854,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS { if (aIndirectProps.end() != aIndirectProps.find(aPreserved->second)) { -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 const ::rtl::OUString sName = aPreserved->second; #endif aRemoveIndexes.push_back(aPreserved->first - nPositionCorrector); @@ -867,7 +868,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS ++aRemoveIndex ) ::comphelper::removeElementAt(_rInfo, *aRemoveIndex); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 const PropertyValue* pWhatsLeft = _rInfo.getConstArray(); const PropertyValue* pWhatsLeftEnd = pWhatsLeft + _rInfo.getLength(); for (; pWhatsLeft != pWhatsLeftEnd; ++pWhatsLeft) @@ -948,7 +949,7 @@ Any ODbDataSourceAdministrationHelper::implTranslateProperty(const SfxPoolItem* } else { - DBG_ERROR("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported item type!"); + OSL_FAIL("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported item type!"); return aValue; } @@ -960,7 +961,8 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty(const Reference< X Any aValue = implTranslateProperty(_pItem); lcl_putProperty(_rxSet, _rName,aValue); } -#ifdef DBG_UTIL + +#if OSL_DEBUG_LEVEL > 0 //------------------------------------------------------------------------- ::rtl::OString ODbDataSourceAdministrationHelper::translatePropertyId( sal_Int32 _nId ) { @@ -996,7 +998,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet _rSet.Put(SfxStringItem(_nId, sValue.getStr())); } else { - DBG_ERROR( + OSL_FAIL( ( ::rtl::OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" ) += ::rtl::OString( translatePropertyId( _nId ) ) += ::rtl::OString( " should be no string)!" ) @@ -1026,7 +1028,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet _rSet.Put( aItem ); } else { - DBG_ERROR( + OSL_FAIL( ( ::rtl::OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" ) += ::rtl::OString( translatePropertyId( _nId ) ) += ::rtl::OString( " should be no boolean)!" ) @@ -1043,7 +1045,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet _rSet.Put( SfxInt32Item( _nId, nValue ) ); } else { - DBG_ERROR( + OSL_FAIL( ( ::rtl::OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" ) += ::rtl::OString( translatePropertyId( _nId ) ) += ::rtl::OString( " should be no int)!" ) @@ -1059,7 +1061,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet TypeDescription aTD(_rValue.getValueType()); typelib_IndirectTypeDescription* pSequenceTD = reinterpret_cast< typelib_IndirectTypeDescription* >(aTD.get()); - DBG_ASSERT(pSequenceTD && pSequenceTD->pType, "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid sequence type!"); + OSL_ENSURE(pSequenceTD && pSequenceTD->pType, "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid sequence type!"); Type aElementType(pSequenceTD->pType); switch (aElementType.getTypeClass()) @@ -1072,11 +1074,11 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet } break; default: - DBG_ERROR("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported property value type!"); + OSL_FAIL("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported property value type!"); } } else { - DBG_ERROR( + OSL_FAIL( ( ::rtl::OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" ) += ::rtl::OString( translatePropertyId( _nId ) ) += ::rtl::OString( " should be no string sequence)!" ) @@ -1090,7 +1092,7 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet break; default: - DBG_ERROR("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported property value type!"); + OSL_FAIL("ODbDataSourceAdministrationHelper::implTranslateProperty: unsupported property value type!"); } } @@ -1112,14 +1114,13 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) SFX_ITEMSET_GET(_rDest, pTypeCollection, DbuTypeCollectionItem, DSID_TYPECOLLECTION, sal_True); OSL_ENSURE(pUrlItem,"Connection URL is NULL. -> GPF!"); - DBG_ASSERT(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!"); + OSL_ENSURE(pTypeCollection, "ODbAdminDialog::getDatasourceType: invalid items in the source set!"); ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); - DBG_ASSERT(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); + OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); - USHORT nPortNumberId = 0; + sal_uInt16 nPortNumberId = 0; sal_Int32 nPortNumber = -1; String sNewHostName; - //String sUrl = pCollection->cutPrefix(pUrlItem->GetValue()); String sUrlPart; pCollection->extractHostNamePort(pUrlItem->GetValue(),sUrlPart,sNewHostName,nPortNumber); @@ -1177,7 +1178,7 @@ sal_Bool ODbDataSourceAdministrationHelper::saveChanges(const SfxItemSet& _rSour // ----------------------------------------------------------------------------- void ODbDataSourceAdministrationHelper::setDataSourceOrName( const Any& _rDataSourceOrName ) { - DBG_ASSERT( !m_aDataSourceOrName.hasValue(), "ODbDataSourceAdministrationHelper::setDataSourceOrName: already have one!" ); + OSL_ENSURE( !m_aDataSourceOrName.hasValue(), "ODbDataSourceAdministrationHelper::setDataSourceOrName: already have one!" ); // hmm. We could reset m_xDatasource/m_xModel, probably, and continue working m_aDataSourceOrName = _rDataSourceOrName; } diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.hxx b/dbaccess/source/ui/dlg/DbAdminImpl.hxx index 02ef746fcd7a..2e4c2b251a53 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.hxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.hxx @@ -182,7 +182,7 @@ namespace dbaui */ sal_Bool hasAuthentication(const SfxItemSet& _rSet) const; -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 ::rtl::OString translatePropertyId( sal_Int32 _nId ); #endif }; diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx index 23390d34bba2..2408297e20cf 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 47b77106cd3e..000000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx +++ /dev/null @@ -1,222 +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 = String( ModuleRes( RID_STR_EXTENSION_NAME ) ); - 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()); - - // set an image in high contrast - // m_aFI_WARNING.SetModeImage(Image(BMP_EXCEPTION_WARNING_SCH), BMP_COLOR_HIGHCONTRAST); - - // to resize images - // WinBits aBits = m_aFI_WARNING.GetStyle(); - // aBits |= WB_SCALE; - // m_aFI_WARNING.SetStyle(aBits); - // - // Size aImageSize = m_aFI_WARNING.GetSizePixel(); - // (void) aImageSize; - // m_aFI_WARNING.Resize(); - - - 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 69794e3a76bc..000000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc +++ /dev/null @@ -1,48 +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 PAGE_WIDTH ( CELL_PADDING + BUTTON_WIDTH + CELL_PADDING + BUTTON_WIDTH + CELL_PADDING) -#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 9507c4256360..000000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.src +++ /dev/null @@ -1,89 +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."; - // OLD: Text [ en-US ] = "To open a report you require the extension %RPT_EXTENSION_NAME.\n\nClick 'Download...' to download and install the extension."; -}; -// To open a report you require the extension Sun Report Designer weiss der Geier Hauptsache extra langer Name -// String RID_STR_EXTENSION_NAME -// { -// Text = "Sun(TM) Report Builder"; -// }; - -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) ) ; - // Border = TRUE ; - // 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 947bec14a021..7618e732fd1a 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 68399ca52619..90602e37c4a9 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.src +++ b/dbaccess/source/ui/dlg/RelationDlg.src @@ -33,9 +33,9 @@ #endif #include "dbaccess_helpid.hrc" - ModalDialog DLG_REL_PROPERTIES { + HelpID = "dbaccess:ModalDialog:DLG_REL_PROPERTIES"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 186 , 205 ) ; @@ -43,7 +43,6 @@ ModalDialog DLG_REL_PROPERTIES Moveable = TRUE ; Closeable = TRUE ; - Window WND_CONTROL { Pos = MAP_APPFONT( 0, 0 ); @@ -86,9 +85,6 @@ ModalDialog DLG_REL_PROPERTIES }; }; - - - FixedLine FL_CASC_UPD { Pos = MAP_APPFONT ( 6 , 114 ) ; @@ -124,7 +120,6 @@ ModalDialog DLG_REL_PROPERTIES HelpId = HID_DLG_REL_CASC_UPD_DEFAULT ; Text [ en-US ] = "Set ~default" ; }; -// zweite FixedLine FixedLine FL_CASC_DEL { Pos = MAP_APPFONT ( 96 , 114 ) ; @@ -182,4 +177,3 @@ ModalDialog DLG_REL_PROPERTIES }; }; - diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index fe392d82cbe0..17fcf7861e51 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/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx index 4e2864aaaa52..2903742efa70 100644 --- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx @@ -55,7 +55,6 @@ #include <comphelper/types.hxx> #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> -// #106016# ------------------------------------ #include <com/sun/star/task/XInteractionHandler.hpp> #include <svl/filenotation.hxx> @@ -336,7 +335,7 @@ DBG_NAME(OTextConnectionHelper) String aErrorText; Control* pErrorWin = NULL; // if (!m_aFieldSeparator.GetText().Len()) - // bug (#42168) if this line is compiled under OS2 (in a product environent) + // if this line is compiled under OS2 (in a product environent) // -> use a temporary variable String aDelText(m_aFieldSeparator.GetText()); if(!aDelText.Len()) diff --git a/dbaccess/source/ui/dlg/UserAdmin.src b/dbaccess/source/ui/dlg/UserAdmin.src index 2cab4f9e89f0..74c8c1ed8098 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.src +++ b/dbaccess/source/ui/dlg/UserAdmin.src @@ -71,7 +71,6 @@ TabPage TAB_PAGE_USERADMIN HelpId = HID_TAB_PAGE_LBUSER ; }; - PushButton PB_NEWUSER { Pos = MAP_APPFONT ( 12 , 29 ) ; @@ -150,7 +149,6 @@ ModalDialog DLG_PASSWORD Size = MAP_APPFONT ( WIN_X - 3 - 6 - 6 - 50 , 8 ) ; Text [ en-US ] = "User \"$name$: $\""; }; - FixedText FT_OLDPASSWORD { Pos = MAP_APPFONT ( 6 , 17 ) ; @@ -159,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 ) ; @@ -173,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 ) ; @@ -186,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 ) ; @@ -215,28 +216,3 @@ String STR_ERROR_PASSWORDS_NOT_IDENTICAL { Text [ en-US ] = "The passwords do not match. Please enter the password again."; }; - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 5e7e28158777..553f5446ca86 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -96,11 +96,15 @@ DBG_NAME(OUserAdminDlg) OUserAdminDlg::~OUserAdminDlg() { if ( m_bOwnConnection ) + { try { ::comphelper::disposeComponent(m_xConnection); } - catch(Exception){} + catch(const Exception&) + { + } + } SetInputSet(NULL); DELETEZ(pExampleSet); @@ -119,12 +123,12 @@ DBG_NAME(OUserAdminDlg) throw SQLException(sError,NULL,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")) ,0,Any()); } } - catch(const SQLException& e) + catch(const SQLException&) { ::dbaui::showError( ::dbtools::SQLExceptionInfo( ::cppu::getCaughtException() ), GetParent(), getORB() ); return RET_CANCEL; } - catch( const Exception& ) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -134,7 +138,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 faa7f33302d7..5b07b43093b5 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.src +++ b/dbaccess/source/ui/dlg/UserAdminDlg.src @@ -35,7 +35,6 @@ #include "dbu_dlg.hrc" #endif - TabDialog DLG_DATABASE_USERADMIN { OutputSize = TRUE ; @@ -49,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 cfdc2dd3842f..a8b11805dcb3 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; }; //-------------------------------------------------------------------- @@ -108,7 +108,7 @@ namespace dbaui break; default: - OSL_ENSURE( false, "TextResetOperator::operateOn: unexpected event ID!" ); + OSL_FAIL( "TextResetOperator::operateOn: unexpected event ID!" ); // all those IDs should have been filtered out by payAttentionTo break; } @@ -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 cd3246cdc332..83353be4b8d0 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/admincontrols.src b/dbaccess/source/ui/dlg/admincontrols.src index 8ce3bb4030dc..8ce3bb4030dc 100755..100644 --- a/dbaccess/source/ui/dlg/admincontrols.src +++ b/dbaccess/source/ui/dlg/admincontrols.src diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index e87ca6a93d45..2bf12cf82740 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -163,7 +163,7 @@ namespace dbaui else { aEnumeration.getDatasourceNames(aOdbcDatasources); - // excute the select dialog + // execute the select dialog ODatasourceSelectDialog aSelector(GetParent(), aOdbcDatasources, false); if (_sCurr.getLength()) aSelector.Select(_sCurr); @@ -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 eba739fec877..51fd7f025965 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -151,7 +151,7 @@ namespace dbaui @param _sReturn <OUT/> contains the selected name. @return - <FALSE/> if an error occured, otherwise <TRUE/> + <FALSE/> if an error occurred, otherwise <TRUE/> */ sal_Bool getSelectedDataSource(::rtl::OUString& _sReturn,::rtl::OUString& _sCurr); @@ -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 a0f0365fb22b..9af7714a1cdc 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 68b7d64abd8c..540e26982039 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -190,7 +190,7 @@ void TableListFacade::updateTableObjectList( bool _bAllowViews ) m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); } sTables = xTables->getElementNames(); - } // if ( xTables.is() ) + } xViewSupp.set( xTableSupp, UNO_QUERY ); if ( xViewSupp.is() ) @@ -298,13 +298,10 @@ void QueryListFacade::updateTableObjectList( bool /*_bAllowViews*/ ) try { ImageProvider aImageProvider( m_xConnection ); - Image aQueryImage( aImageProvider.getDefaultImage( DatabaseObject::QUERY, false ) ); - Image aQueryImageHC( aImageProvider.getDefaultImage( DatabaseObject::QUERY, true ) ); + Image aQueryImage( aImageProvider.getDefaultImage( DatabaseObject::QUERY ) ); - m_rQueryList.SetDefaultExpandedEntryBmp( aQueryImage, BMP_COLOR_NORMAL ); - m_rQueryList.SetDefaultCollapsedEntryBmp( aQueryImage, BMP_COLOR_NORMAL ); - m_rQueryList.SetDefaultExpandedEntryBmp( aQueryImageHC, BMP_COLOR_HIGHCONTRAST ); - m_rQueryList.SetDefaultCollapsedEntryBmp( aQueryImageHC, BMP_COLOR_HIGHCONTRAST ); + m_rQueryList.SetDefaultExpandedEntryBmp( aQueryImage ); + m_rQueryList.SetDefaultCollapsedEntryBmp( aQueryImage ); Reference< XQueriesSupplier > xSuppQueries( m_xConnection, UNO_QUERY_THROW ); Reference< XNameAccess > xQueries( xSuppQueries->getQueries(), UNO_QUERY_THROW ); @@ -377,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 ); ////////////////////////////////////////////////////////////////////// @@ -422,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; @@ -504,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 af1d861a0faa..deb914dd831d 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"; @@ -67,14 +69,17 @@ ModelessDialog DLG_JOIN_TABADD Hide = TRUE; Group = TRUE; }; + 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" ; TabStop = TRUE ; DefButton = TRUE ; }; + CancelButton PB_CLOSE { Pos = MAP_APPFONT ( 123 , 22 ) ; @@ -83,6 +88,7 @@ ModelessDialog DLG_JOIN_TABADD Text [ en-US ] = "~Close" ; TabStop = TRUE ; }; + HelpButton PB_HELP { Pos = MAP_APPFONT ( 123 , 43 ) ; diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index 66df4a24c74c..d7dec225f1a8 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)); } // ----------------------------------------------------------------------- @@ -285,7 +311,7 @@ namespace dbaui aValue = PTR_CAST( OptionalBoolItem, pItem )->GetFullValue(); } else - DBG_ERROR( "SpecialSettingsPage::implInitControls: unknown boolean item type!" ); + OSL_FAIL( "SpecialSettingsPage::implInitControls: unknown boolean item type!" ); if ( !aValue ) { @@ -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 8abc5d8810d2..193fdf5f3853 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 f4c6e75e4f3f..6a6ae93f9f8e 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 4c5a7d924d33..9a2dc467d586 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 028705d806ea..510b1864eb0b 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); @@ -149,7 +149,6 @@ void ODbAdminDialog::impl_selectDataSource(const ::com::sun::star::uno::Any& _aD { case ::dbaccess::DST_DBASE: addDetailPage(PAGE_DBASE, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateDbase); - // bResetPasswordRequired = sal_True; break; case ::dbaccess::DST_ADO: @@ -158,7 +157,6 @@ void ODbAdminDialog::impl_selectDataSource(const ::com::sun::star::uno::Any& _aD case ::dbaccess::DST_FLAT: addDetailPage(PAGE_TEXT, STR_PAGETITLE_ADVANCED, ODriversSettings::CreateText); - // bResetPasswordRequired = sal_True; break; case ::dbaccess::DST_ODBC: @@ -411,9 +409,10 @@ 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 __READONLY_DATA aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = + static SfxItemInfo const aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = { {0,0}, {0,0}, @@ -473,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 c4457c62eec0..e5eae80b5406 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -82,7 +82,6 @@ Pos = MAP_APPFONT ( EDIT_X , AUTO_Y ) ; \ Size = MAP_APPFONT ( 97 , EDIT_HEIGHT ) ; \ }; \ - \ FixedText FT_PORTNUMBER \ { \ Pos = MAP_APPFONT ( 6 , AUTO_Y + UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + 2 ) ; \ @@ -113,7 +112,6 @@ TabDialog DLG_DATABASE_ADMINISTRATION { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; //......................................................................... @@ -147,7 +145,6 @@ ModalDialog DLG_DATABASE_TYPE_CHANGE { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; Text [ en-US ] = "Database properties" ; }; @@ -196,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" ; @@ -210,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; @@ -218,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; @@ -419,6 +419,7 @@ TabPage PAGE_ADABAS }; Edit ET_HOSTNAME { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_HOSTNAME"; TabStop = TRUE ; Border = TRUE ; @@ -434,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 ; @@ -451,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 ; @@ -473,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 ) ; @@ -486,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) ; @@ -495,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"; @@ -502,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..."; @@ -517,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 ) ; @@ -527,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 ) ; @@ -545,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 ) ; @@ -553,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 ) ; @@ -564,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 ) ; @@ -585,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 ) ; @@ -592,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"; @@ -602,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 ) ; @@ -621,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 ) ; @@ -629,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 ) ; @@ -725,8 +742,8 @@ TabPage PAGE_TEXT HelpId = HID_DSADMIN_PAGE_TEXT; AUTO_SEPARATORCONTROLGROUP(UNRELATED_CONTROLS, PAGE_X) - }; + //......................................................................... TabPage PAGE_USERDRIVER { @@ -744,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 ) ; @@ -759,6 +777,7 @@ TabPage PAGE_USERDRIVER NumericField NF_PORTNUMBER { + HelpID = "dbaccess:NumericField:PAGE_USERDRIVER:NF_PORTNUMBER"; TabStop = TRUE ; Border = TRUE ; NoThousandSep = TRUE; @@ -775,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 50b796541872..44ef3f024e3a 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,40 +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 @@ -109,6 +74,7 @@ String STR_HINT_CONNECTION_NOT_CAPABLE ModalDialog DLG_DOMAINPASSWORD { + HelpID = "dbaccess:ModalDialog:DLG_DOMAINPASSWORD"; Border = TRUE ; Moveable = TRUE ; OutputSize = TRUE ; @@ -125,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 ) ; @@ -185,4 +152,3 @@ TabPage PAGE_TABLESUBSCRIPTION Text [ en-US ] = "Mark the tables that should be visible for the applications."; }; }; - diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src index 7b0dbe011342..ea4341914e82 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 @@ -142,7 +141,6 @@ ModalDialog DLG_DATABASE_WIZARD }; }; - String STR_DATABASEDEFAULTNAME { Text[ en-US ] = "New Database" ; @@ -151,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 ) ; @@ -164,7 +163,6 @@ TabPage PAGE_DBWIZARD_MYSQL_INTRO WordBreak = TRUE; }; - FixedText FT_MYSQL_HELPTEXT { Pos = MAP_APPFONT (START_X , 27 ) ; @@ -197,18 +195,19 @@ 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" ; Hide = TRUE ; }; - }; #define AUTHENTEDIT_X (EDIT_X - 10) 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 ) ; @@ -222,7 +221,6 @@ TabPage PAGE_DBWIZARD_AUTHENTIFICATION WordBreak = TRUE; }; - FixedText FT_AUTHENTIFICATIONHELPTEXT\ { Pos = MAP_APPFONT (START_X , 27 ) ; @@ -261,18 +259,17 @@ TabPage PAGE_DBWIZARD_AUTHENTIFICATION Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; Text[ en-US ] = "~Test Connection" ; }; - }; 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 ) ; Hide = TRUE ; - FixedText FT_FINALHEADER { Pos = MAP_APPFONT ( START_X , 8 ) ; @@ -289,7 +286,6 @@ TabPage PAGE_DBWIZARD_FINAL WordBreak = TRUE ; }; - RadioButton RB_REGISTERDATASOURCE { HelpId = HID_PAGE_DBWIZARD_FINAL_RB_REGISTERDATASOURCE; @@ -299,7 +295,6 @@ TabPage PAGE_DBWIZARD_FINAL Text[ en-US ] = "~Yes, register the database for me" ; }; - RadioButton RB_DONTREGISTERDATASOURCE { HelpId = HID_PAGE_DBWIZARD_FINAL_RB_DONTREGISTERDATASOURCE ; @@ -343,12 +338,12 @@ 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 ) ; Hide = TRUE ; - String STR_MYSQLJDBC_HEADERTEXT { Text[ en-US ] = "Set up connection to a MySQL database using JDBC" ; @@ -370,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 ) ; @@ -400,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 ) ; @@ -410,44 +407,38 @@ TabPage PAGE_DBWIZARD_DBASE Text[ en-US ] = "Set up a connection to dBASE files" ; }; - String STR_DBASE_HELPTEXT { 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" ; }; - String STR_TEXT_HELPTEXT { Text[ en-US ] = "Select the folder where the CSV (Comma Separated Values) text files are stored. %PRODUCTNAME Base will open these files in read-only mode." ; }; - String STR_TEXT_PATH_OR_FILE{ 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 ) ; @@ -458,19 +449,17 @@ TabPage PAGE_DBWIZARD_MSACCESS Text[ en-US ] = "Set up a connection to a Microsoft Access database" ; }; - String STR_MSACCESS_HELPTEXT { Text[ en-US ] = "Please select the Microsoft Access file you want to access."; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION) -// FT_MSACCESS_MDB_FILE + 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 ) ; @@ -484,7 +473,6 @@ TabPage PAGE_DBWIZARD_LDAP WordBreak = TRUE; }; - FixedText FT_LDAP_HELPTEXT { Pos = MAP_APPFONT (START_X , 27 ) ; @@ -509,9 +497,9 @@ 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 ) ; @@ -522,17 +510,16 @@ TabPage PAGE_DBWIZARD_ADABAS Text[ en-US ] = "Set up a connection to an Adabas D database" ; }; - String STR_ADABAS_HELPTEXT{ 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 ) ; @@ -547,13 +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 ) ; @@ -568,23 +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 ) ; @@ -599,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 ) ; @@ -622,22 +610,21 @@ TabPage PAGE_DBWIZARD_ORACLE Text[ en-US ] = "Default: 1521" ; }; - String STR_ORACLE_DRIVERCLASSTEXT{ Text [ en-US ] = "Oracle JDBC ~driver class"; }; - String STR_ORACLE_HELPTEXT{ 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 ) ; @@ -648,13 +635,11 @@ TabPage PAGE_DBWIZARD_SPREADSHEET Text[ en-US ] = "Set up a connection to spreadsheets"; }; - String STR_SPREADSHEET_HELPTEXT{ 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" ; @@ -669,5 +654,3 @@ TabPage PAGE_DBWIZARD_SPREADSHEET Text[ en-US ] = "~Password required" ; }; }; - - diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index 809ccddc27eb..c1e77135987b 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -36,7 +36,7 @@ #include "moduledbu.hxx" #include "dbu_dlg.hrc" #include "dbfindex.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <unotools/localfilehelper.hxx> #include <tools/urlobj.hxx> #include <unotools/pathoptions.hxx> @@ -94,12 +94,6 @@ ODbaseIndexDialog::ODbaseIndexDialog( Window * pParent, String aDataSrcName ) Init(); SetCtrls(); FreeResource(); - - // set Hi contrast bitmaps - aIB_Add.SetModeImage( ModuleRes(IMG_ONE_LEFT_H),BMP_COLOR_HIGHCONTRAST); - aIB_AddAll.SetModeImage( ModuleRes(IMG_ALL_LEFT_H),BMP_COLOR_HIGHCONTRAST); - aIB_Remove.SetModeImage( ModuleRes(IMG_ONE_RIGHT_H),BMP_COLOR_HIGHCONTRAST); - aIB_RemoveAll.SetModeImage( ModuleRes(IMG_ALL_RIGHT_H),BMP_COLOR_HIGHCONTRAST); } //------------------------------------------------------------------------- @@ -172,7 +166,7 @@ OTableIndex ODbaseIndexDialog::implRemoveIndex(const String& _rName, TableIndexL } (void)_bMustExist; - DBG_ASSERT(!_bMustExist || (aSearch != _rList.end()), "ODbaseIndexDialog::implRemoveIndex : did not find the index!"); + OSL_ENSURE(!_bMustExist || (aSearch != _rList.end()), "ODbaseIndexDialog::implRemoveIndex : did not find the index!"); return aReturn; } @@ -354,8 +348,8 @@ void ODbaseIndexDialog::Init() Sequence< ::rtl::OUString> aFolderContent( ::utl::LocalFileHelper::GetFolderContents(m_aDSN,bFolder)); - ::rtl::OUString aIndexExt = ::rtl::OUString::createFromAscii("ndx"); - ::rtl::OUString aTableExt = ::rtl::OUString::createFromAscii("dbf"); + ::rtl::OUString aIndexExt(RTL_CONSTASCII_USTRINGPARAM("ndx")); + ::rtl::OUString aTableExt(RTL_CONSTASCII_USTRINGPARAM("dbf")); ::std::vector< String > aUsedIndexes; @@ -541,7 +535,7 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const try { ::ucbhelper::Content aContent(aURL.GetURLNoPass(),Reference<XCommandEnvironment>()); - aContent.executeCommand( rtl::OUString::createFromAscii( "delete" ),makeAny( sal_Bool( sal_True ) ) ); + aContent.executeCommand( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")),makeAny( sal_Bool( sal_True ) ) ); } catch (const Exception& e ) { @@ -549,7 +543,6 @@ void OTableInfo::WriteInfFile( const String& rDSN ) const // simply silent this. The strange algorithm here does a lot of things even if no files at all were // created or accessed, so it's possible that the file we're trying to delete does not even exist, // and this is a valid condition. - // 2003-05-15 - #109677# - fs@openoffice.org } } } diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index 59b1f0f66f1e..c10b2362027b 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 ad401102601d..ca8b6e4a3622 100644 --- a/dbaccess/source/ui/dlg/dbfindex.src +++ b/dbaccess/source/ui/dlg/dbfindex.src @@ -35,64 +35,9 @@ #define WIN_X 264 #define WIN_Y 149 -Image IMG_ONE_LEFT_H -{ - ImageBitmap = Bitmap - { - File = "one_left_h.bmp" ; - }; - MaskColor = Color - { - Red = 0xFFFF ; - Green = 0x0000 ; - Blue = 0xFFFF ; - }; -}; - -Image IMG_ALL_LEFT_H -{ - ImageBitmap = Bitmap - { - File = "all_left_h.bmp" ; - }; - MaskColor = Color - { - Red = 0xFFFF ; - Green = 0x0000 ; - Blue = 0xFFFF ; - }; -}; - -Image IMG_ONE_RIGHT_H -{ - ImageBitmap = Bitmap - { - File = "one_right_h.bmp" ; - }; - MaskColor = Color - { - Red = 0xFFFF ; - Green = 0x0000 ; - Blue = 0xFFFF ; - }; -}; - -Image IMG_ALL_RIGHT_H -{ - ImageBitmap = Bitmap - { - File = "all_right_h.bmp" ; - }; - MaskColor = Color - { - Red = 0xFFFF ; - Green = 0x0000 ; - Blue = 0xFFFF ; - }; -}; - ModalDialog DLG_DBASE_INDEXES { + HelpID = "dbaccess:ModalDialog:DLG_DBASE_INDEXES"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( WIN_X , WIN_Y ) ; @@ -125,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 ) ; @@ -146,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 ) ; @@ -160,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 ) ; @@ -168,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 ; @@ -175,7 +124,7 @@ ModalDialog DLG_DBASE_INDEXES { ImageBitmap = Bitmap { - File = "one_left.bmp" ; + File = "one_left.png" ; }; MaskColor = Color { @@ -187,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 ; @@ -194,7 +144,7 @@ ModalDialog DLG_DBASE_INDEXES { ImageBitmap = Bitmap { - File = "all_left.bmp" ; + File = "all_left.png" ; }; MaskColor = Color { @@ -206,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 ; @@ -213,7 +164,7 @@ ModalDialog DLG_DBASE_INDEXES { ImageBitmap = Bitmap { - File = "one_right.bmp" ; + File = "one_right.png" ; }; MaskColor = Color { @@ -225,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 ; @@ -232,7 +184,7 @@ ModalDialog DLG_DBASE_INDEXES { ImageBitmap = Bitmap { - File = "all_right.bmp" ; + File = "all_right.png" ; }; MaskColor = Color { @@ -242,5 +194,4 @@ ModalDialog DLG_DBASE_INDEXES }; }; }; - }; diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index cac6a8499601..f23f340b5e78 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) { @@ -310,7 +310,7 @@ TabPage* ODbTypeWizDialog::createPage(WizardState _nState) pPage = ODriversSettings::CreateUser(this,*m_pOutSet); break; default: - OSL_ENSURE(0,"Wrong state!"); + OSL_FAIL("Wrong state!"); break; } @@ -347,7 +347,7 @@ void ODbTypeWizDialog::enableConfirmSettings( bool _bEnable ) { enableButtons( WZB_FINISH, _bEnable ); // TODO: - // this is hacky. At the moment, this method is used in only one case (#b6532894#). + // this is hacky. At the moment, this method is used in only one case. // As soon as it is to be used more wide-spread, we should find a proper concept // for enabling both the Next and Finish buttons, depending on the current page state. // Plus, the concept must also care for the case where those pages are embedded into diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index aea15cf0fb8a..17843bd898a4 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -92,6 +92,7 @@ #include <comphelper/namedvaluecollection.hxx> #include <comphelper/sequenceashashmap.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <connectivity/DriversConfig.hxx> #include <memory> @@ -171,7 +172,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !"); + OSL_ENSURE(m_pCollection, "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !"); FreeResource(); @@ -181,7 +182,6 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(Window* _pParent m_pOutSet = new SfxItemSet( *_pItems->GetPool(), _pItems->GetRanges() ); m_pImpl->translateProperties(xDatasource, *m_pOutSet); -// eType = m_pImpl->getDatasourceType(*m_pOutSet); SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MAP_APPFONT)); ShowButtonFixedLine(sal_True); @@ -229,7 +229,7 @@ void ODbTypeWizDialogSetup::declareAuthDepPath( const ::rtl::OUString& _sURL, Pa { if ( bHasAuthentication || ( *aIter != PAGE_DBSETUPWIZARD_AUTHENTIFICATION ) ) aPath.push_back( *aIter ); - } // for(;aIter != aEnd;++aIter) + } // call base method ::svt::RoadmapWizard::declarePath( _nPathId, aPath ); @@ -359,7 +359,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() { sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); if ( nCreateNewDBIndex == -1 ) - nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString::createFromAscii( "sdbc:dbase:" ) ); + nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")) ); OSL_ENSURE( nCreateNewDBIndex != -1, "ODbTypeWizDialogSetup::activateDatabasePath: the GeneralPage should have prevented this!" ); activatePath( static_cast< PathId >( nCreateNewDBIndex + 1 ), sal_True ); @@ -388,7 +388,7 @@ void ODbTypeWizDialogSetup::activateDatabasePath() } break; default: - DBG_ERROR( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" ); + OSL_FAIL( "ODbTypeWizDialogSetup::activateDatabasePath: unknown creation mode!" ); } enableButtons( WZB_NEXT, m_pGeneralPage->GetDatabaseCreationMode() != OGeneralPage::eOpenExisting ); @@ -655,7 +655,7 @@ IMPL_LINK(ODbTypeWizDialogSetup, ImplClickHdl, OMySQLIntroPageSetup*, _pMySQLInt case OMySQLIntroPageSetup::VIA_NATIVE: sURLPrefix = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:mysql:mysqlc:")); break; - } // switch( _pMySQLIntroPageSetup->getMySQLMode() ) + } activatePath( static_cast<PathId>(m_pCollection->getIndexOf(sURLPrefix) + 1), sal_True); return sal_True; } @@ -726,7 +726,7 @@ sal_Bool ODbTypeWizDialogSetup::leaveState(WizardState _nState) // ----------------------------------------------------------------------------- void ODbTypeWizDialogSetup::setTitle(const ::rtl::OUString& /*_sTitle*/) { - DBG_ERROR( "ODbTypeWizDialogSetup::setTitle: not implemented!" ); + OSL_FAIL( "ODbTypeWizDialogSetup::setTitle: not implemented!" ); // why? } @@ -860,15 +860,13 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() } else if ( m_pCollection->isFileSystemBased(eType) ) { - Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY); + Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY); INetURLObject aDBPathURL(m_sWorkPath); aDBPathURL.Append(m_aDocURL.getBase()); createUniqueFolderName(&aDBPathURL); ::rtl::OUString sPrefix = eType; sUrl = aDBPathURL.GetMainURL( INetURLObject::NO_DECODE); xSimpleFileAccess->createFolder(sUrl); - //OFileNotation aFileNotation(sUrl); - //sUrl = aFileNotation.get(OFileNotation::N_SYSTEM); sUrl = sPrefix.concat(sUrl); } m_pOutSet->Put(SfxStringItem(DSID_CONNECTURL, sUrl)); @@ -929,7 +927,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() //------------------------------------------------------------------------- void ODbTypeWizDialogSetup::createUniqueFolderName(INetURLObject* pURL) { - Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY); + Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY); :: rtl::OUString sLastSegmentName = pURL->getName(); sal_Bool bFolderExists = sal_True; sal_Int32 i = 1; @@ -947,7 +945,7 @@ sal_Bool ODbTypeWizDialogSetup::SaveDatabaseDocument() //------------------------------------------------------------------------- String ODbTypeWizDialogSetup::createUniqueFileName(const INetURLObject& _rURL) { - Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" )), UNO_QUERY); + Reference< XSimpleFileAccess > xSimpleFileAccess(getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY); :: rtl::OUString sFilename = _rURL.getName(); ::rtl::OUString BaseName = _rURL.getBase(); ::rtl::OUString sExtension = _rURL.getExtension(); diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index fb3a27decc66..c02f603c99eb 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 2d304430e865..6d48d2fd2711 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 d964da262c30..0e4a61414de8 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!"); } @@ -308,7 +308,7 @@ DBG_NAME(DirectSQLDialog) m_aSQL.SetSelection(Selection(sStatement.Len(), sStatement.Len())); } else - OSL_ENSURE(sal_False, "DirectSQLDialog::switchToHistory: invalid position!"); + OSL_FAIL("DirectSQLDialog::switchToHistory: invalid position!"); } //-------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/directsql.src b/dbaccess/source/ui/dlg/directsql.src index 230fe4dac320..5428535c365a 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"; @@ -131,4 +137,3 @@ String STR_DIRECTSQL_CONNECTIONLOST { Text [ en-US ] = "The connection to the database has been lost. This dialog will be closed."; }; - diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 20537fce089d..e77c20704d26 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)) { @@ -63,8 +63,7 @@ SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumb SetText(aTitle); if( nFlags & TP_ATTR_CHAR ) { -// AddTabPage( RID_SVXPAGE_CHAR_STD,String(ModuleRes(TP_ATTR_CHAR)),SvxCharStdPage::Create, 0 ); - DBG_ERROR( "found flag TP_ATTR_CHAR" ); + OSL_FAIL( "found flag TP_ATTR_CHAR" ); } if( nFlags & TP_ATTR_NUMBER ) AddTabPage( RID_SVXPAGE_NUMBERFORMAT,String(ModuleRes(TP_ATTR_NUMBER)) ); @@ -89,21 +88,18 @@ 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; case RID_SVXPAGE_CHAR_STD: { - // ((SvxCharStdPage&)rTabPage).SetFontList(SBA_MOD_EXT()->FontListItem()); } break; case RID_SVXPAGE_ALIGNMENT: { -// aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, WBA_NO_ORIENTATION|WBA_NO_LINEBREAK|WBA_NO_GRIDLINES|WBA_NO_VERTICAL|WBA_NO_LEFTINDENT)); -// rTabPage.PageCreated(aSet); } break; diff --git a/dbaccess/source/ui/dlg/dlgattr.src b/dbaccess/source/ui/dlg/dlgattr.src index 8dce0835aa69..4ed8c1c5644a 100644 --- a/dbaccess/source/ui/dlg/dlgattr.src +++ b/dbaccess/source/ui/dlg/dlgattr.src @@ -36,6 +36,7 @@ #ifndef DBAUI_SBATTRDLG_HRC #include "dlgattr.hrc" #endif + //================================================ // Der Attributdialog: TabDialog DLG_ATTR @@ -73,7 +74,6 @@ TabDialog DLG_ATTR }; String TP_ATTR_CHAR { - /* ### ACHTUNG: Neuer Text in Resource? Schrift : Zeichen */ Text [ en-US ] = "Font" ; }; String TP_ATTR_NUMBER @@ -89,34 +89,3 @@ TabDialog DLG_ATTR Text [ en-US ] = "Table Format" ; }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index d9466a39663e..7d5738d1e7ff 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); @@ -309,7 +309,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, break; default: - OSL_ENSURE( false, "OSaveAsDlg::OSaveAsDlg: Type not supported yet!" ); + OSL_FAIL( "OSaveAsDlg::OSaveAsDlg: Type not supported yet!" ); } implInit(); diff --git a/dbaccess/source/ui/dlg/dlgsave.src b/dbaccess/source/ui/dlg/dlgsave.src index d550704b85f8..bc94b77eee37 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 ) ; @@ -138,4 +141,3 @@ ModalDialog DLG_SAVE_AS Text [ en-US ] = "Insert as"; }; }; - diff --git a/dbaccess/source/ui/dlg/dlgsize.src b/dbaccess/source/ui/dlg/dlgsize.src index ade6f3ff1222..556c53974c9a 100644 --- a/dbaccess/source/ui/dlg/dlgsize.src +++ b/dbaccess/source/ui/dlg/dlgsize.src @@ -24,17 +24,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - //--------------------------------------------------------------------------- - // - // (c) Copyright 1996 - 2000 by Star Division GmbH, Hamburg, Germany - // - // Ersterstellung: - // JN - // - // Letzte Aenderung: - // $Author: rt $ $Date: 2008-04-10 14:52:17 $ $Revision: 1.32 $ - // - //--------------------------------------------------------------------------- #ifndef DBAUI_DLGSIZE_HRC #include "dlgsize.hrc" @@ -62,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 ) ; @@ -75,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 ; @@ -117,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 ) ; @@ -130,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 ; @@ -156,34 +149,3 @@ ModalDialog DLG_COLWIDTH }; Text [ en-US ] = "Column Width" ; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index dc7e5426c1d8..e6bbb8494e16 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -149,7 +149,7 @@ IMPL_LINK( ODatasourceSelectDialog, CreateDBClickHdl, PushButton*, /*pButton*/ ) if ( xCatalog.is() && m_pOutputSet ) { Sequence< Any > aArgs(2); - aArgs[0] <<= PropertyValue(::rtl::OUString::createFromAscii("CreateCatalog"), 0,makeAny(xCatalog) , PropertyState_DIRECT_VALUE); + aArgs[0] <<= PropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CreateCatalog")), 0, makeAny(xCatalog), PropertyState_DIRECT_VALUE); aArgs[1] <<= PropertyValue(PROPERTY_PARENTWINDOW, 0, makeAny(VCLUnoHelper::GetInterface(this)), PropertyState_DIRECT_VALUE); Reference< XExecutableDialog > xDialog( @@ -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 555464635b84..34050aff9cb9 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 8eff7fffe6c4..d6a8855559a2 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 ; @@ -103,5 +107,3 @@ ModalDialog DLG_DATASOURCE_SELECTION Text [ en-US ] = "Choose a database"; }; }; - - diff --git a/dbaccess/source/ui/dlg/finteraction.cxx b/dbaccess/source/ui/dlg/finteraction.cxx index aee6876e8ebc..562ebf435223 100644 --- a/dbaccess/source/ui/dlg/finteraction.cxx +++ b/dbaccess/source/ui/dlg/finteraction.cxx @@ -31,6 +31,7 @@ #include "finteraction.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/ucb/InteractiveIOException.hpp> //........................................................................ @@ -51,7 +52,7 @@ namespace dbaui ,m_bDoesNotExist(sal_False) { DBG_CTOR( OFilePickerInteractionHandler, NULL ); - DBG_ASSERT( m_xMaster.is(), "OFilePickerInteractionHandler::OFilePickerInteractionHandler: invalid master handler!" ); + OSL_ENSURE( m_xMaster.is(), "OFilePickerInteractionHandler::OFilePickerInteractionHandler: invalid master handler!" ); } //-------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 1103a375b636..060f83d43853 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -52,6 +52,7 @@ #include "UITools.hxx" #include <comphelper/processfactory.hxx> #include <unotools/confignode.hxx> +#include <osl/diagnose.h> //......................................................................... namespace dbaui @@ -100,12 +101,12 @@ namespace dbaui DbuTypeCollectionItem* pCollectionItem = PTR_CAST(DbuTypeCollectionItem, _rItems.GetItem(DSID_TYPECOLLECTION)); if (pCollectionItem) m_pCollection = pCollectionItem->getCollection(); - DBG_ASSERT(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); + OSL_ENSURE(m_pCollection, "OGeneralPage::OGeneralPage : really need a DSN type collection !"); // If no driver for embedded DBs is installed, and no dBase driver, then hide the "Create new database" option sal_Int32 nCreateNewDBIndex = m_pCollection->getIndexOf( m_pCollection->getEmbeddedDatabase() ); if ( nCreateNewDBIndex == -1 ) - nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString::createFromAscii( "sdbc:dbase:" ) ); + nCreateNewDBIndex = m_pCollection->getIndexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdbc:dbase:")) ); bool bHideCreateNew = ( nCreateNewDBIndex == -1 ); // also, if our application policies tell us to hide the option, do it @@ -213,7 +214,7 @@ namespace dbaui ++loop ) insertDatasourceTypeEntryData( loop->eType, loop->sDisplayName ); - } // if ( m_pCollection ) + } } } @@ -360,8 +361,8 @@ namespace dbaui // collect some items and some values SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); - DBG_ASSERT(pUrlItem, "OGeneralPage::implInitControls : missing the type attribute !"); - DBG_ASSERT(pNameItem, "OGeneralPage::implInitControls : missing the type attribute !"); + OSL_ENSURE(pUrlItem, "OGeneralPage::implInitControls : missing the type attribute !"); + OSL_ENSURE(pNameItem, "OGeneralPage::implInitControls : missing the type attribute !"); sName = pNameItem->GetValue(); sConnectURL = pUrlItem->GetValue(); } @@ -504,7 +505,7 @@ namespace dbaui } //------------------------------------------------------------------------- - BOOL OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) + sal_Bool OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) { sal_Bool bChangedSomething = sal_False; @@ -529,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) { @@ -607,7 +608,6 @@ namespace dbaui const SfxFilter* pFilter = getStandardDatabaseFilter(); if ( pFilter ) { -// aFileDlg.AddFilter(pFilter->GetUIName(),pFilter->GetDefaultExtension()); aFileDlg.SetCurrentFilter(pFilter->GetUIName()); } if ( aFileDlg.Execute() == ERRCODE_NONE ) diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index ad28e2dc0692..5bd2dbe189fa 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.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index 780fe621157f..d4480c464d59 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -41,6 +41,7 @@ #include <svtools/imgdef.hxx> #include "browserids.hxx" #include <connectivity/dbtools.hxx> +#include <osl/diagnose.h> //...................................................................... namespace dbaui { @@ -145,14 +146,14 @@ namespace dbaui //------------------------------------------------------------------ void DbaIndexList::enableSelectHandler() { - DBG_ASSERT(m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); + OSL_ENSURE(m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); m_bSuspendSelectHdl = sal_False; } //------------------------------------------------------------------ void DbaIndexList::disableSelectHandler() { - DBG_ASSERT(!m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); + OSL_ENSURE(!m_bSuspendSelectHdl, "DbaIndexList::enableSelectHandler: invalid call (this is not cumulative)!"); m_bSuspendSelectHdl = sal_True; } @@ -186,7 +187,7 @@ DBG_NAME(DbaIndexDialog) const Reference< XMultiServiceFactory >& _rxORB,sal_Int32 _nMaxColumnsInIndex) :ModalDialog( _pParent, ModuleRes(DLG_INDEXDESIGN)) ,m_xConnection(_rxConnection) - ,m_aGeometrySettings(E_DIALOG, ::rtl::OUString::createFromAscii("dbaccess.tabledesign.indexdialog")) + ,m_aGeometrySettings(E_DIALOG, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dbaccess.tabledesign.indexdialog"))) ,m_aActions (this, ModuleRes(TLB_ACTIONS)) ,m_aIndexes (this, ModuleRes(CTR_INDEXLIST)) ,m_aIndexDetails (this, ModuleRes(FL_INDEXDETAILS)) @@ -229,7 +230,7 @@ DBG_NAME(DbaIndexDialog) } catch(Exception&) { - OSL_ENSURE(sal_False, "DbaIndexDialog::DbaIndexDialog: could not retrieve basic information from the UNO collection!"); + OSL_FAIL("DbaIndexDialog::DbaIndexDialog: could not retrieve basic information from the UNO collection!"); } fillIndexList(); @@ -239,14 +240,6 @@ DBG_NAME(DbaIndexDialog) m_aClose.SetClickHdl(LINK(this, DbaIndexDialog, OnCloseDialog)); - // get our most recent geometry settings -// if (m_aGeometrySettings.Exists()) -// { -// Point aPos; -// m_aGeometrySettings.GetPosition(aPos.X(), aPos.Y()); -// SetPosPixel(aPos); -// } - // if all of the indexes have an empty description, we're not interested in displaying it Indexes::const_iterator aCheck; @@ -316,8 +309,7 @@ DBG_NAME(DbaIndexDialog) //------------------------------------------------------------------ void DbaIndexDialog::fillIndexList() { - sal_Bool bHiContrast = GetSettings().GetStyleSettings().GetHighContrastMode(); - Image aPKeyIcon(ModuleRes( bHiContrast ? IMG_PKEYICON_SCH : IMG_PKEYICON)); + Image aPKeyIcon(ModuleRes( IMG_PKEYICON )); // fill the list with the index names m_aIndexes.Clear(); Indexes::iterator aIndexLoop = m_pIndexes->begin(); @@ -343,17 +335,13 @@ DBG_NAME(DbaIndexDialog) delete m_pIndexes; delete m_pFields; - // save our geometry settings -// Point aPos = GetPosPixel(); -// m_aGeometrySettings.SetPosition(aPos.X(), aPos.Y()); - DBG_DTOR(DbaIndexDialog,NULL); } //------------------------------------------------------------------ sal_Bool DbaIndexDialog::implCommit(SvLBoxEntry* _pEntry) { - DBG_ASSERT(_pEntry, "DbaIndexDialog::implCommit: invalid entry!"); + OSL_ENSURE(_pEntry, "DbaIndexDialog::implCommit: invalid entry!"); Indexes::iterator aCommitPos = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(_pEntry->GetUserData()); @@ -408,7 +396,7 @@ DBG_NAME(DbaIndexDialog) } if ((i>0x7FFFFFFF) || (i<0)) { - DBG_ERROR("DbaIndexDialog::OnNewIndex: no free index name found!"); + OSL_FAIL("DbaIndexDialog::OnNewIndex: no free index name found!"); // can't do anything ... of course we try another base, but this could end with the same result ... return; } @@ -421,7 +409,7 @@ DBG_NAME(DbaIndexDialog) for (SvLBoxEntry* pAdjust = m_aIndexes.First(); pAdjust; pAdjust = m_aIndexes.Next(pAdjust)) { Indexes::iterator aAfterInsertPos = m_pIndexes->find(m_aIndexes.GetEntryText(pAdjust)); - DBG_ASSERT(aAfterInsertPos != m_pIndexes->end(), "DbaIndexDialog::OnNewIndex: problems with on of the entries!"); + OSL_ENSURE(aAfterInsertPos != m_pIndexes->end(), "DbaIndexDialog::OnNewIndex: problems with on of the entries!"); pAdjust->SetUserData(reinterpret_cast< void* >(sal_Int32(aAfterInsertPos - m_pIndexes->begin()))); } @@ -437,7 +425,7 @@ DBG_NAME(DbaIndexDialog) { // the selected index SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected, "DbaIndexDialog::OnDropIndex: invalid call!"); + OSL_ENSURE(pSelected, "DbaIndexDialog::OnDropIndex: invalid call!"); if (pSelected) { // let the user confirm the drop @@ -463,7 +451,7 @@ DBG_NAME(DbaIndexDialog) { // do the drop Indexes::iterator aDropPos = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(_pEntry->GetUserData()); - DBG_ASSERT(aDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: did not find the index in my collection!"); + OSL_ENSURE(aDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: did not find the index in my collection!"); SQLExceptionInfo aExceptionInfo; sal_Bool bSuccess = sal_False; @@ -493,7 +481,7 @@ DBG_NAME(DbaIndexDialog) for (SvLBoxEntry* pAdjust = m_aIndexes.First(); pAdjust; pAdjust = m_aIndexes.Next(pAdjust)) { Indexes::iterator aAfterDropPos = m_pIndexes->find(m_aIndexes.GetEntryText(pAdjust)); - DBG_ASSERT(aAfterDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: problems with on of the remaining entries!"); + OSL_ENSURE(aAfterDropPos != m_pIndexes->end(), "DbaIndexDialog::OnDropIndex: problems with on of the remaining entries!"); pAdjust->SetUserData(reinterpret_cast< void* >(sal_Int32(aAfterDropPos - m_pIndexes->begin()))); } @@ -514,7 +502,7 @@ DBG_NAME(DbaIndexDialog) { // the selected index SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected, "DbaIndexDialog::OnRenameIndex: invalid call!"); + OSL_ENSURE(pSelected, "DbaIndexDialog::OnRenameIndex: invalid call!"); // save the changes made 'til here // Upon leaving the edit mode, the control will be re-initialized with the @@ -543,7 +531,7 @@ DBG_NAME(DbaIndexDialog) { // the selected index SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected, "DbaIndexDialog::OnResetIndex: invalid call!"); + OSL_ENSURE(pSelected, "DbaIndexDialog::OnResetIndex: invalid call!"); Indexes::iterator aResetPos = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(pSelected->GetUserData()); @@ -601,7 +589,7 @@ DBG_NAME(DbaIndexDialog) { if (m_aIndexes.IsEditingActive()) { - DBG_ASSERT(!m_bEditAgain, "DbaIndexDialog::OnCloseDialog: somebody was faster than hell!"); + OSL_ENSURE(!m_bEditAgain, "DbaIndexDialog::OnCloseDialog: somebody was faster than hell!"); // this means somebody entered a new name, which was invalid, which cause us to posted us an event, // and before the event arrived the user clicked onto "close". VERY fast, this user .... m_aIndexes.EndEditing(sal_False); @@ -612,7 +600,7 @@ DBG_NAME(DbaIndexDialog) // the currently selected entry const SvLBoxEntry* pSelected = m_aIndexes.FirstSelected(); - DBG_ASSERT(pSelected == m_pPreviousSelection, "DbaIndexDialog::OnCloseDialog: inconsistence!"); + OSL_ENSURE(pSelected == m_pPreviousSelection, "DbaIndexDialog::OnCloseDialog: inconsistence!"); sal_Int32 nResponse = RET_NO; if (pSelected) @@ -657,7 +645,7 @@ DBG_NAME(DbaIndexDialog) { Indexes::iterator aPosition = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(_pEntry->GetUserData()); - DBG_ASSERT(aPosition >= m_pIndexes->begin() && aPosition < m_pIndexes->end(), + OSL_ENSURE(aPosition >= m_pIndexes->begin() && aPosition < m_pIndexes->end(), "DbaIndexDialog::OnEntryEdited: invalid entry!"); String sNewName = m_aIndexes.GetEntryText(_pEntry); @@ -781,7 +769,7 @@ DBG_NAME(DbaIndexDialog) //------------------------------------------------------------------ IMPL_LINK( DbaIndexDialog, OnModified, void*, /*NOTINTERESTEDIN*/ ) { - DBG_ASSERT(m_pPreviousSelection, "DbaIndexDialog, OnModified: invalid call!"); + OSL_ENSURE(m_pPreviousSelection, "DbaIndexDialog, OnModified: invalid call!"); Indexes::iterator aPosition = m_pIndexes->begin() + reinterpret_cast<sal_IntPtr>(m_pPreviousSelection->GetUserData()); aPosition->setModified(sal_True); @@ -889,22 +877,19 @@ DBG_NAME(DbaIndexDialog) } } //------------------------------------------------------------------ - ImageList DbaIndexDialog::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const + ImageList DbaIndexDialog::getImageList(sal_Int16 _eBitmapSet) const { sal_Int16 nN = IMG_INDEX_DLG_SC; - sal_Int16 nH = IMG_INDEX_DLG_SCH; if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE ) { nN = IMG_INDEX_DLG_LC; - nH = IMG_INDEX_DLG_LCH; - } // if ( _eBitmapSet == SFX_SYMBOLS_LARGE ) - return ImageList(ModuleRes( _bHiContast ? nH : nN )); + } + return ImageList( nN ); } //------------------------------------------------------------------ void DbaIndexDialog::resizeControls(const Size& _rDiff) { // we use large images so we must change them - Size aTbNewSize = m_aActions.GetSizePixel(); if ( _rDiff.Width() || _rDiff.Height() ) { Size aDlgSize = GetSizePixel(); diff --git a/dbaccess/source/ui/dlg/indexdialog.src b/dbaccess/source/ui/dlg/indexdialog.src index ae8f80d6c616..2071684c37b6 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 ) ; @@ -57,7 +58,6 @@ ModalDialog DLG_INDEXDESIGN ToolBox TLB_ACTIONS { Pos = MAP_APPFONT ( 6 , 6 ) ; - // Size = MAP_APPFONT ( DIALOG_SIZE_X - 14 , 14 ) ; ButtonType = BUTTON_SYMBOL; Align = BOXALIGN_TOP; HelpId = HID_INDEX_DIALOG_ACTION_TB; @@ -132,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; @@ -154,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; @@ -171,14 +173,17 @@ String STR_TAB_INDEX_SORTORDER { Text [ en-US ] = "Sort order" ; }; + String STR_TAB_INDEX_FIELD { Text [ en-US ] = "Index field" ; }; + String STR_ORDER_ASCENDING { Text [ en-US ] = "Ascending" ; }; + String STR_ORDER_DESCENDING { Text [ en-US ] = "Descending" ; @@ -196,12 +201,7 @@ String STR_LOGICAL_INDEX_NAME Image IMG_PKEYICON { - ImageBitmap = Bitmap { File = "pkey.bmp"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; -Image IMG_PKEYICON_SCH -{ - ImageBitmap = Bitmap { File = "pkey_sch.bmp"; }; + ImageBitmap = Bitmap { File = "pkey.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; @@ -233,4 +233,3 @@ String STR_INDEXDESIGN_DOUBLE_COLUMN_NAME { Text [ en-US ] = "In an index definition, no table column may occur more than once. However, you have entered column \"$name$\" twice."; }; - diff --git a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx index a617abd6baa6..2a85b1a5d58b 100644 --- a/dbaccess/source/ui/dlg/indexfieldscontrol.cxx +++ b/dbaccess/source/ui/dlg/indexfieldscontrol.cxx @@ -198,7 +198,6 @@ DBG_NAME(IndexFieldsControl) // insert rows for the the fields RowInserted(GetRowCount(), m_aFields.size(), sal_False); // insert an additional row for a new field for that index -// if(!m_nMaxColumnsInIndex || GetRowCount() < m_nMaxColumnsInIndex ) RowInserted(GetRowCount(), 1, sal_False); SetUpdateMode(sal_True); @@ -311,7 +310,7 @@ DBG_NAME(IndexFieldsControl) break; default: - OSL_ENSURE(sal_False, "IndexFieldsControl::GetController: invalid column id!"); + OSL_FAIL("IndexFieldsControl::GetController: invalid column id!"); } if (pReturn) @@ -401,7 +400,7 @@ DBG_NAME(IndexFieldsControl) } break; default: - OSL_ENSURE(sal_False, "IndexFieldsControl::SaveModified: invalid column id!"); + OSL_FAIL("IndexFieldsControl::SaveModified: invalid column id!"); } return sal_True; } @@ -425,7 +424,7 @@ DBG_NAME(IndexFieldsControl) break; default: - OSL_ENSURE(sal_False, "IndexFieldsControl::InitController: invalid column id!"); + OSL_FAIL("IndexFieldsControl::InitController: invalid column id!"); } } @@ -491,7 +490,7 @@ DBG_NAME(IndexFieldsControl) else return _rRow->bSortAscending ? m_sAscendingText : m_sDescendingText; default: - OSL_ENSURE(sal_False, "IndexFieldsControl::GetCurrentRowCellText: invalid column id!"); + OSL_FAIL("IndexFieldsControl::GetCurrentRowCellText: invalid column id!"); } } return String(); diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk index 270741d00857..8fa615d28a52 100644 --- a/dbaccess/source/ui/dlg/makefile.mk +++ b/dbaccess/source/ui/dlg/makefile.mk @@ -85,47 +85,47 @@ SRC1FILES = \ # ... object files ............................ EXCEPTIONSFILES= \ + $(SLO)$/AdabasStat.obj \ + $(SLO)$/CollectionView.obj \ + $(SLO)$/ConnectionHelper.obj \ + $(SLO)$/ConnectionPage.obj \ + $(SLO)$/ConnectionPageSetup.obj \ + $(SLO)$/DBSetupConnectionPages.obj \ + $(SLO)$/DbAdminImpl.obj \ + $(SLO)$/DriverSettings.obj \ + $(SLO)$/RelationDlg.obj \ + $(SLO)$/TablesSingleDlg.obj \ + $(SLO)$/TextConnectionHelper.obj \ + $(SLO)$/UserAdmin.obj \ + $(SLO)$/UserAdminDlg.obj \ + $(SLO)$/admincontrols.obj \ + $(SLO)$/adminpages.obj \ + $(SLO)$/adtabdlg.obj \ + $(SLO)$/advancedsettings.obj \ + $(SLO)$/dbadmin.obj \ + $(SLO)$/dbfindex.obj \ + $(SLO)$/dbwiz.obj \ + $(SLO)$/dbwizsetup.obj \ + $(SLO)$/detailpages.obj \ $(SLO)$/directsql.obj \ - $(SLO)$/dbwiz.obj \ - $(SLO)$/dbwizsetup.obj \ + $(SLO)$/dlgattr.obj \ + $(SLO)$/dlgsave.obj \ + $(SLO)$/dlgsize.obj \ + $(SLO)$/dsselect.obj \ + $(SLO)$/finteraction.obj \ $(SLO)$/generalpage.obj \ - $(SLO)$/indexfieldscontrol.obj \ $(SLO)$/indexdialog.obj \ - $(SLO)$/RelationDlg.obj \ - $(SLO)$/adtabdlg.obj \ - $(SLO)$/dlgsave.obj \ - $(SLO)$/admincontrols.obj \ - $(SLO)$/adminpages.obj \ - $(SLO)$/queryorder.obj \ - $(SLO)$/queryfilter.obj \ + $(SLO)$/indexfieldscontrol.obj \ + $(SLO)$/odbcconfig.obj \ $(SLO)$/paramdialog.obj \ - $(SLO)$/dbadmin.obj \ - $(SLO)$/detailpages.obj \ + $(SLO)$/queryfilter.obj \ + $(SLO)$/queryorder.obj \ $(SLO)$/sqlmessage.obj \ - $(SLO)$/finteraction.obj \ - $(SLO)$/ConnectionPage.obj \ - $(SLO)$/ConnectionHelper.obj \ - $(SLO)$/TextConnectionHelper.obj \ - $(SLO)$/ConnectionPageSetup.obj \ - $(SLO)$/DBSetupConnectionPages.obj \ - $(SLO)$/UserAdminDlg.obj \ - $(SLO)$/UserAdmin.obj \ - $(SLO)$/AdabasStat.obj \ $(SLO)$/tablespage.obj \ - $(SLO)$/DbAdminImpl.obj \ - $(SLO)$/TablesSingleDlg.obj \ - $(SLO)$/CollectionView.obj \ - $(SLO)$/dsselect.obj \ - $(SLO)$/dbfindex.obj \ - $(SLO)$/DriverSettings.obj \ - $(SLO)$/odbcconfig.obj \ - $(SLO)$/advancedsettings.obj \ $(SLO)$/textconnectionsettings.obj -SLOFILES= \ - $(EXCEPTIONSFILES) \ - $(SLO)$/dlgsize.obj \ - $(SLO)$/dlgattr.obj \ +SLOFILES= \ + $(EXCEPTIONSFILES) \ $(SLO)$/optionalboolitem.obj .IF "$(WINDOWS_VISTA_PSDK)"!="" && "$(PROF_EDITION)"=="" @@ -137,8 +137,6 @@ SLOFILES+= $(SLO)$/adodatalinks.obj .ENDIF # --- Targets ---------------------------------- -#LOCALIZE_ME=AutoControls_tmpl.hrc - .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 1f27f2408f17..3c04790c2f73 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -30,6 +30,13 @@ #include "precompiled_dbaccess.hxx" #include "odbcconfig.hxx" + +#ifdef SYSTEM_ODBC_HEADERS +#include <sqltypes.h> +#else +#include <odbc/sqltypes.h> +#endif + #include <rtl/bootstrap.hxx> #include <rtl/ustring.hxx> #include <rtl/ustrbuf.hxx> @@ -41,7 +48,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 @@ -63,7 +70,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 @@ -73,7 +80,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 @@ -86,13 +93,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) @@ -278,7 +285,7 @@ void OOdbcEnumeration::getDatasourceNames(StringBag& _rNames) if (!allocEnv()) { - OSL_ENSURE(sal_False, "OOdbcEnumeration::getDatasourceNames: could not allocate an ODBC environment!"); + OSL_FAIL("OOdbcEnumeration::getDatasourceNames: could not allocate an ODBC environment!"); return; } diff --git a/dbaccess/source/ui/dlg/odbcconfig.hxx b/dbaccess/source/ui/dlg/odbcconfig.hxx index 479c0743953b..20b0adb0cb44 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.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx index 21023208a4d7..18eab7138f2e 100644 --- a/dbaccess/source/ui/dlg/paramdialog.cxx +++ b/dbaccess/source/ui/dlg/paramdialog.cxx @@ -40,7 +40,7 @@ #include "dbustrings.hrc" #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/diagnose_ex.h> #include "localresaccess.hxx" #include <unotools/syslocale.hxx> @@ -95,7 +95,7 @@ DBG_NAME(OParameterDialog) m_xFormatter = Reference< XNumberFormatter>(_rxORB->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY); else { - DBG_ERROR("OParameterDialog::OParameterDialog: need a service factory!"); + OSL_FAIL("OParameterDialog::OParameterDialog: need a service factory!"); } Reference< XNumberFormatsSupplier > xNumberFormats = ::dbtools::getNumberFormats(m_xConnection, sal_True); @@ -105,7 +105,7 @@ DBG_NAME(OParameterDialog) m_xFormatter->attachNumberFormatsSupplier(xNumberFormats); try { - DBG_ASSERT(rParamContainer->getCount(), "OParameterDialog::OParameterDialog : can't handle empty containers !"); + OSL_ENSURE(rParamContainer->getCount(), "OParameterDialog::OParameterDialog : can't handle empty containers !"); m_aFinalValues.realloc(rParamContainer->getCount()); PropertyValue* pValues = m_aFinalValues.getArray(); @@ -298,7 +298,7 @@ DBG_NAME(OParameterDialog) { sal_uInt16 nCurrent = m_aAllParams.GetSelectEntryPos(); sal_uInt16 nCount = m_aAllParams.GetEntryCount(); - DBG_ASSERT(nCount == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); + OSL_ENSURE(nCount == m_aVisitedParams.size(), "OParameterDialog::OnButtonClicked : inconsistent lists !"); // search the next entry in list we haven't visited yet sal_uInt16 nNext = (nCurrent + 1) % nCount; @@ -343,13 +343,13 @@ DBG_NAME(OParameterDialog) // initialize the controls with the new values sal_uInt16 nSelected = m_aAllParams.GetSelectEntryPos(); - DBG_ASSERT(nSelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnEntrySelected : no current entry !"); + OSL_ENSURE(nSelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnEntrySelected : no current entry !"); m_aParam.SetText(::comphelper::getString(m_aFinalValues[nSelected].Value)); m_nCurrentlySelected = nSelected; // with this the value isn't dirty - DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); + OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnEntrySelected : invalid current entry !"); m_aVisitedParams[m_nCurrentlySelected] &= ~EF_DIRTY; m_aResetVisitFlag.SetTimeout(1000); @@ -361,10 +361,10 @@ DBG_NAME(OParameterDialog) //------------------------------------------------------------------------------ IMPL_LINK(OParameterDialog, OnVisitedTimeout, Timer*, /*pTimer*/) { - DBG_ASSERT(m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnVisitedTimeout : invalid call !"); + OSL_ENSURE(m_nCurrentlySelected != LISTBOX_ENTRY_NOTFOUND, "OParameterDialog::OnVisitedTimeout : invalid call !"); // mark the currently selected entry as visited - DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); + OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnVisitedTimeout : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_VISITED; // was it the last "not visited yet" entry ? @@ -411,7 +411,7 @@ DBG_NAME(OParameterDialog) IMPL_LINK(OParameterDialog, OnValueModified, Control*, /*pBox*/) { // mark the currently selected entry as dirty - DBG_ASSERT(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); + OSL_ENSURE(m_nCurrentlySelected < m_aVisitedParams.size(), "OParameterDialog::OnValueModified : invalid entry !"); m_aVisitedParams[m_nCurrentlySelected] |= EF_DIRTY; m_bNeedErrorOnCurrent = sal_True; diff --git a/dbaccess/source/ui/dlg/paramdialog.src b/dbaccess/source/ui/dlg/paramdialog.src index 3993096f8847..1f78123c6096 100644 --- a/dbaccess/source/ui/dlg/paramdialog.src +++ b/dbaccess/source/ui/dlg/paramdialog.src @@ -37,13 +37,13 @@ ModalDialog DLG_PARAMETERS { + HelpID = "dbaccess:ModalDialog:DLG_PARAMETERS"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 6 + LIST_WIDTH + 3 + 6 + BUTTON_WIDTH + 6, 98 ) ; Moveable = TRUE ; Closeable = TRUE ; - FixedLine FL_PARAMS { Pos = MAP_APPFONT ( 4 , 3 ) ; @@ -52,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; @@ -65,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 ) ; @@ -72,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 ; @@ -97,4 +100,3 @@ ModalDialog DLG_PARAMETERS Text [ en-US ] = "The entry could not be converted to a valid value for the \"$name$\"column"; }; }; - diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx index 6c3a6124f5b4..75ed025ac6df 100644 --- a/dbaccess/source/ui/dlg/queryfilter.cxx +++ b/dbaccess/source/ui/dlg/queryfilter.cxx @@ -42,9 +42,8 @@ #include <com/sun/star/sdbc/XRow.hpp> #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/container/XNameAccess.hpp> -#include <tools/debug.hxx> -#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "moduledbu.hxx" #include <connectivity/sqliterator.hxx> #include <connectivity/dbtools.hxx> @@ -269,7 +268,7 @@ sal_Int32 DlgFilterCrit::GetOSQLPredicateType( const String& _rSelectedPredicate nPredicateType = SQLFilterOperator::NOT_SQLNULL; break; default: - OSL_ENSURE( false, "DlgFilterCrit::GetOSQLPredicateType: unknown predicate string!" ); + OSL_FAIL( "DlgFilterCrit::GetOSQLPredicateType: unknown predicate string!" ); break; } @@ -363,7 +362,7 @@ sal_Bool DlgFilterCrit::getCondition(const ListBox& _rField,const ListBox& _rCom sTableName += _rFilter.Name; _rFilter.Name = sTableName; } - } // if ( !bFunction ) + } } } catch(Exception) @@ -455,7 +454,7 @@ Reference< XPropertySet > DlgFilterCrit::getMatchingColumn( const Edit& _rValueI sField = aLB_WHEREFIELD3.GetSelectEntry(); } else { - DBG_ERROR( "DlgFilterCrit::getMatchingColumn: invalid event source!" ); + OSL_FAIL( "DlgFilterCrit::getMatchingColumn: invalid event source!" ); } // the field itself @@ -465,7 +464,7 @@ Reference< XPropertySet > DlgFilterCrit::getMatchingColumn( const Edit& _rValueI //------------------------------------------------------------------------------ IMPL_LINK( DlgFilterCrit, PredicateLoseFocus, Edit*, _pField ) { - DBG_ASSERT( _pField, "DlgFilterCrit::PredicateLoseFocus: invalid event source!" ); + OSL_ENSURE( _pField, "DlgFilterCrit::PredicateLoseFocus: invalid event source!" ); if ( _pField ) { // retrieve the field affected @@ -586,11 +585,9 @@ void DlgFilterCrit::SelectField( ListBox& rBox, const String& rField ) { DBG_CHKTHIS(DlgFilterCrit,NULL); sal_uInt16 nCnt = rBox.GetEntryCount(); - // sal_Bool bCase = m_rIterator.TablesAreSensitive(); for( sal_uInt16 i=0 ; i<nCnt ; i++ ) { - // if(bCase ? rBox.GetEntry(i) == rField : rBox.GetEntry(i).EqualsIgnoreCaseAscii(rField)) if(rBox.GetEntry(i) == rField) { rBox.SelectEntryPos(i); @@ -756,7 +753,7 @@ IMPL_LINK( DlgFilterCrit, ListSelectHdl, ListBox *, pListBox ) } else { - DBG_ASSERT(0,"DlgFilterCrit::ListSelectHdl: Diese Column d�rfte garnicht vorhanden sein!"); + OSL_FAIL("DlgFilterCrit::ListSelectHdl: Diese Column d�rfte garnicht vorhanden sein!"); } } pComp->SelectEntryPos(0); @@ -781,7 +778,6 @@ void DlgFilterCrit::BuildWherePart() Sequence<Sequence<PropertyValue> > aFilter,aHaving; aFilter.realloc(1); aHaving.realloc(1); - // ::rtl::OUString aFilter; if( LbPos(aLB_WHEREFIELD1) != 0 ) { diff --git a/dbaccess/source/ui/dlg/queryfilter.src b/dbaccess/source/ui/dlg/queryfilter.src index 2b1ef6e6baf5..6d273b5c53aa 100644 --- a/dbaccess/source/ui/dlg/queryfilter.src +++ b/dbaccess/source/ui/dlg/queryfilter.src @@ -30,15 +30,6 @@ #endif #include "dbaccess_helpid.hrc" -/* -#define STRLST_AND_OR \ - StringList [ en-US ] = \ - {\ - < "AND" ; Default ; > ; \ - < "OR" ; Default ; > ; \ - };\ -*/ - ModalDialog DLG_FILTERCRIT { OutputSize = TRUE ; @@ -53,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 ) ; @@ -61,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 ) ; @@ -71,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 ) ; @@ -78,13 +72,13 @@ 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 ) ; TabStop = TRUE ; DropDown = TRUE ; CurPos = 0 ; -// STRLST_AND_OR StringList [ en-US ] = { < "AND" ; Default ; > ; @@ -93,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 ) ; @@ -101,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 ) ; @@ -111,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 ) ; @@ -118,13 +115,13 @@ 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 ) ; TabStop = TRUE ; DropDown = TRUE ; CurPos = 0 ; -// STRLST_AND_OR StringList [ en-US ] = { < "AND" ; Default ; > ; @@ -133,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 ) ; @@ -141,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 ) ; @@ -151,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 ) ; @@ -181,7 +181,6 @@ ModalDialog DLG_FILTERCRIT { Pos = MAP_APPFONT ( 15 , 14 ) ; Size = MAP_APPFONT ( 40 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Verknpfung : Verknpfung */ Center = TRUE ; Text [ en-US ] = "Operator" ; }; @@ -219,4 +218,3 @@ ModalDialog DLG_FILTERCRIT Text [ en-US ] = "=;<>;<;<=;>;>=;like;not like;null;not null"; }; }; - diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index d237978ce1ce..75f60ec28d81 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 ); @@ -247,8 +247,8 @@ void DlgOrderCrit::EnableLines() DBG_CHKTHIS(DlgOrderCrit,NULL); Reference<XDatabaseMetaData> xMetaData = m_xConnection->getMetaData(); ::rtl::OUString sQuote = xMetaData.is() ? xMetaData->getIdentifierQuoteString() : ::rtl::OUString(); - static const ::rtl::OUString sDESC = ::rtl::OUString::createFromAscii(" DESC "); - static const ::rtl::OUString sASC = ::rtl::OUString::createFromAscii(" ASC "); + static const ::rtl::OUString sDESC(RTL_CONSTASCII_USTRINGPARAM(" DESC ")); + static const ::rtl::OUString sASC(RTL_CONSTASCII_USTRINGPARAM(" ASC ")); Reference< XNameAccess> xColumns = Reference< XColumnsSupplier >(m_xQueryComposer,UNO_QUERY)->getColumns(); @@ -258,7 +258,7 @@ void DlgOrderCrit::EnableLines() if(m_aColumnList[i]->GetSelectEntryPos() != 0) { if(sOrder.getLength()) - sOrder += ::rtl::OUString::createFromAscii(","); + sOrder += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(",")); String sName = m_aColumnList[i]->GetSelectEntry(); try diff --git a/dbaccess/source/ui/dlg/queryorder.src b/dbaccess/source/ui/dlg/queryorder.src index 2f2f85a797a0..7c349dda037b 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 ) ; @@ -133,7 +139,6 @@ ModalDialog DLG_ORDERCRIT { Pos = MAP_APPFONT ( 12 , 14 ) ; Size = MAP_APPFONT ( 46 , 8 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Verknpfung : Verknpfung */ Text [ en-US ] = "Operator" ; }; FixedText FT_ORDERDIR @@ -173,39 +178,3 @@ ModalDialog DLG_ORDERCRIT Text [ en-US ] = "<none>" ; }; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 0220c2691ade..80a1378d6a5d 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/sdbc/SQLException.hpp> #include <com/sun/star/sdb/SQLContext.hpp> #include <vcl/fixed.hxx> +#include <osl/diagnose.h> #include <svtools/svtreebx.hxx> #include <svtools/svmedit.hxx> #include <connectivity/dbexception.hxx> @@ -46,6 +47,8 @@ #include "UITools.hxx" #include "moduledbu.hxx" +#include <tools/urlobj.hxx> + #define BUTTONID_MORE BUTTONID_RETRY + 1 #define DIALOG_WIDTH 220 @@ -70,7 +73,7 @@ namespace class IImageProvider { public: - virtual Image getImage( bool _highContrast ) const = 0; + virtual Image getImage() const = 0; virtual ~IImageProvider() { } }; @@ -88,28 +91,18 @@ namespace class ImageProvider : public IImageProvider { private: - USHORT m_defaultImageID; - USHORT m_highContrastImageID; + sal_uInt16 m_defaultImageID; mutable Image m_defaultImage; - mutable Image m_highContrastImage; public: - ImageProvider( USHORT _defaultImageID, USHORT _highContrastImageID ) + ImageProvider( sal_uInt16 _defaultImageID ) :m_defaultImageID( _defaultImageID ) - ,m_highContrastImageID( _highContrastImageID ) { } - virtual Image getImage( bool _highContrast ) const + virtual Image getImage() const { - if ( _highContrast ) - { - if ( !m_highContrastImage ) - m_highContrastImage = Image( ModuleRes( m_highContrastImageID ) ); - return m_highContrastImage; - } - if ( !m_defaultImage ) m_defaultImage = Image( ModuleRes( m_defaultImageID ) ); return m_defaultImage; @@ -122,7 +115,7 @@ namespace private: String m_label; public: - LabelProvider( USHORT _labelResourceID ) + LabelProvider( sal_uInt16 _labelResourceID ) :m_label( ModuleRes( _labelResourceID ) ) { } @@ -152,21 +145,18 @@ namespace ::boost::shared_ptr< IImageProvider > getImageProvider( SQLExceptionInfo::TYPE _eType ) const { ::boost::shared_ptr< IImageProvider >* ppProvider( &m_pErrorImage ); - USHORT nNormalImageID( BMP_EXCEPTION_ERROR ); - USHORT nHCImageID( BMP_EXCEPTION_ERROR_SCH ); + sal_uInt16 nNormalImageID( BMP_EXCEPTION_ERROR ); switch ( _eType ) { case SQLExceptionInfo::SQL_WARNING: ppProvider = &m_pWarningsImage; nNormalImageID = BMP_EXCEPTION_WARNING; - nHCImageID = BMP_EXCEPTION_WARNING_SCH; break; case SQLExceptionInfo::SQL_CONTEXT: ppProvider = &m_pInfoImage; nNormalImageID = BMP_EXCEPTION_INFO; - nHCImageID = BMP_EXCEPTION_INFO_SCH; break; default: @@ -174,14 +164,14 @@ namespace } if ( !ppProvider->get() ) - ppProvider->reset( new ImageProvider( nNormalImageID, nHCImageID ) ); + ppProvider->reset( new ImageProvider( nNormalImageID ) ); return *ppProvider; } ::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 ) { @@ -272,7 +262,7 @@ namespace iter.next( aCurrentElement ); const SQLException* pCurrentError = (const SQLException*)aCurrentElement; - DBG_ASSERT( pCurrentError, "lcl_buildExceptionChain: iterator failure!" ); + OSL_ENSURE( pCurrentError, "lcl_buildExceptionChain: iterator failure!" ); // hasMoreElements should not have returned <TRUE/> in this case ExceptionDisplayInfo aDisplayInfo( aCurrentElement.getType() ); @@ -286,7 +276,7 @@ namespace && !lcl_hasDetails( aDisplayInfo ) ) { - OSL_ENSURE( false, "lcl_buildExceptionChain: useles exception: no state, no error code, no message!" ); + OSL_FAIL( "lcl_buildExceptionChain: useles exception: no state, no error code, no message!" ); continue; } @@ -314,9 +304,9 @@ namespace } //------------------------------------------------------------------------------ - void lcl_insertExceptionEntry( SvTreeListBox& _rList, bool _bHiContrast, size_t _nElementPos, const ExceptionDisplayInfo& _rEntry ) + void lcl_insertExceptionEntry( SvTreeListBox& _rList, size_t _nElementPos, const ExceptionDisplayInfo& _rEntry ) { - Image aEntryImage( _rEntry.pImageProvider->getImage( _bHiContrast ) ); + Image aEntryImage( _rEntry.pImageProvider->getImage() ); SvLBoxEntry* pListEntry = _rList.InsertEntry( _rEntry.pLabelProvider->getLabel(), aEntryImage, aEntryImage ); pListEntry->SetUserData( reinterpret_cast< void* >( _nElementPos ) ); @@ -368,14 +358,13 @@ 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( ); m_aExceptionText.SetReadOnly(sal_True); bool bHave22018 = false; - bool bHiContrast = isHiContrast( this ); size_t elementPos = 0; for ( ExceptionDisplayChain::const_iterator loop = m_aExceptions.begin(); @@ -383,12 +372,12 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi ++loop, ++elementPos ) { - lcl_insertExceptionEntry( m_aExceptionList, bHiContrast, elementPos, *loop ); + lcl_insertExceptionEntry( m_aExceptionList, elementPos, *loop ); bHave22018 = loop->sSQLState.EqualsAscii( "22018" ); } // if the error has the code 22018, then add an additional explanation - // #i24021# / 2004-10-14 / frank.schoenheit@sun.com + // #i24021# if ( bHave22018 ) { ProviderFactory aProviderFactory; @@ -399,7 +388,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi aInfo22018.pImageProvider = aProviderFactory.getImageProvider( SQLExceptionInfo::SQL_CONTEXT ); m_aExceptions.push_back( aInfo22018 ); - lcl_insertExceptionEntry( m_aExceptionList, bHiContrast, m_aExceptions.size() - 1, aInfo22018 ); + lcl_insertExceptionEntry( m_aExceptionList, m_aExceptions.size() - 1, aInfo22018 ); } } @@ -413,7 +402,7 @@ OExceptionChainDialog::~OExceptionChainDialog() IMPL_LINK(OExceptionChainDialog, OnExceptionSelected, void*, EMPTYARG) { SvLBoxEntry* pSelected = m_aExceptionList.FirstSelected(); - DBG_ASSERT(!pSelected || !m_aExceptionList.NextSelected(pSelected), "OExceptionChainDialog::OnExceptionSelected : multi selection ?"); + OSL_ENSURE(!pSelected || !m_aExceptionList.NextSelected(pSelected), "OExceptionChainDialog::OnExceptionSelected : multi selection ?"); String sText; @@ -483,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; @@ -493,7 +482,7 @@ namespace case BUTTON_RETRY: nButtonID = BUTTONID_RETRY; break; case BUTTON_HELP: nButtonID = BUTTONID_HELP; break; default: - OSL_ENSURE( false, "lcl_addButton: invalid button id!" ); + OSL_FAIL( "lcl_addButton: invalid button id!" ); break; } _rDialog.AddButton( _eType, nButtonID, _bDefault ? BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON : 0 ); @@ -607,7 +596,7 @@ void OSQLMessageBox::impl_initImage( MessageType _eImage ) switch (_eImage) { default: - DBG_ERROR( "OSQLMessageBox::impl_initImage: unsupported image type!" ); + OSL_FAIL( "OSQLMessageBox::impl_initImage: unsupported image type!" ); case Info: m_aInfoImage.SetImage(InfoBox::GetStandardImage()); @@ -658,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 ) ); } } @@ -718,7 +710,7 @@ void OSQLMessageBox::Construct( WinBits _nStyle, MessageType _eImage ) case SQLExceptionInfo::SQL_EXCEPTION: eType = Error; break; case SQLExceptionInfo::SQL_WARNING: eType = Warning; break; case SQLExceptionInfo::SQL_CONTEXT: eType = Info; break; - default: OSL_ENSURE( false, "OSQLMessageBox::Construct: invalid type!" ); + default: OSL_FAIL( "OSQLMessageBox::Construct: invalid type!" ); } } impl_initImage( eType ); diff --git a/dbaccess/source/ui/dlg/sqlmessage.src b/dbaccess/source/ui/dlg/sqlmessage.src index af3d53f785dd..94b2e394d527 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.src +++ b/dbaccess/source/ui/dlg/sqlmessage.src @@ -38,41 +38,25 @@ //------------------------------------------------------------------------- Image BMP_EXCEPTION_ERROR { - ImageBitmap = Bitmap { File = "exerror.bmp"; }; + ImageBitmap = Bitmap { File = "exerror.png"; }; MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; }; Image BMP_EXCEPTION_WARNING { - ImageBitmap = Bitmap { File = "exwarning.bmp"; }; + ImageBitmap = Bitmap { File = "exwarning.png"; }; MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; }; Image BMP_EXCEPTION_INFO { - ImageBitmap = Bitmap { File = "exinfo.bmp"; }; - MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; -}; -Image BMP_EXCEPTION_ERROR_SCH -{ - ImageBitmap = Bitmap { File = "exerror_sch.bmp"; }; - MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; -}; - -Image BMP_EXCEPTION_WARNING_SCH -{ - ImageBitmap = Bitmap { File = "exwarning_sch.bmp"; }; - MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; -}; - -Image BMP_EXCEPTION_INFO_SCH -{ - ImageBitmap = Bitmap { File = "exinfo_sch.bmp"; }; + ImageBitmap = Bitmap { File = "exinfo.png"; }; MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; }; 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 441aa6c6f846..9b5e771b2173 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -55,6 +55,7 @@ #include "dbaccess_helpid.hrc" #include "UITools.hxx" #include <osl/mutex.hxx> +#include <osl/diagnose.h> #include <svtools/imgdef.hxx> #include "TablesSingleDlg.hxx" #include <tools/diagnose_ex.h> @@ -101,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(); @@ -173,7 +174,7 @@ DBG_NAME(OTableSubscriptionPage) } catch(SQLException&) { - DBG_ERROR("OTableSubscriptionPage::implCheckTables : could not retrieve the current connection's meta data!"); + OSL_FAIL("OTableSubscriptionPage::implCheckTables : could not retrieve the current connection's meta data!"); } // uncheck all @@ -256,7 +257,7 @@ DBG_NAME(OTableSubscriptionPage) // get the name of the data source we're working for SFX_ITEMSET_GET(_rSet, pNameItem, SfxStringItem, DSID_NAME, sal_True); - DBG_ASSERT(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!"); + OSL_ENSURE(pNameItem, "OTableSubscriptionPage::implInitControls: missing the name attribute!"); String sDSName = pNameItem->GetValue(); if (bValid && sDSName.Len() && !m_xCurrentConnection.is() ) @@ -264,7 +265,7 @@ DBG_NAME(OTableSubscriptionPage) // the PropertyValues for the current dialog settings Sequence< PropertyValue > aConnectionParams; - DBG_ASSERT(m_pTablesDlg, "OTableSubscriptionPage::implInitControls: need a parent dialog doing the translation!"); + OSL_ENSURE(m_pTablesDlg, "OTableSubscriptionPage::implInitControls: need a parent dialog doing the translation!"); if ( m_pTablesDlg ) { if (!m_pTablesDlg->getCurrentSettings(aConnectionParams)) @@ -387,13 +388,9 @@ DBG_NAME(OTableSubscriptionPage) // get the current table filter SFX_ITEMSET_GET(_rSet, pTableFilter, OStringListItem, DSID_TABLEFILTER, sal_True); - SFX_ITEMSET_GET(_rSet, pSuppress, SfxBoolItem, DSID_SUPPRESSVERSIONCL, sal_True); Sequence< ::rtl::OUString > aTableFilter; - sal_Bool bSuppressVersionColumns = sal_True; if (pTableFilter) aTableFilter = pTableFilter->getList(); - if (pSuppress) - bSuppressVersionColumns = pSuppress->GetValue(); implCompleteTablesCheck( aTableFilter ); @@ -450,11 +447,11 @@ DBG_NAME(OTableSubscriptionPage) { SvLBoxEntry* pLHS = static_cast<SvLBoxEntry*>(_pSortData->pLeft); SvLBoxEntry* pRHS = static_cast<SvLBoxEntry*>(_pSortData->pRight); - DBG_ASSERT(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); + OSL_ENSURE(pLHS && pRHS, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid tree entries!"); SvLBoxString* pLeftTextItem = static_cast<SvLBoxString*>(pLHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); SvLBoxString* pRightTextItem = static_cast<SvLBoxString*>(pRHS->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); - DBG_ASSERT(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); + OSL_ENSURE(pLeftTextItem && pRightTextItem, "SbaTableQueryBrowser::OnTreeEntryCompare: invalid text items!"); String sLeftText = pLeftTextItem->GetText(); String sRightText = pRightTextItem->GetText(); @@ -586,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 a15e7e159e53..81566ed7faf5 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 cca76e7f65a3..b34a056076a8 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/imagelists/dbimagelists.src b/dbaccess/source/ui/imagelists/dbimagelists.src index 2e2a64d87448..8f993554f7c7 100644 --- a/dbaccess/source/ui/imagelists/dbimagelists.src +++ b/dbaccess/source/ui/imagelists/dbimagelists.src @@ -56,13 +56,6 @@ ImageList IMG_INDEX_DLG_SC IL_TOOL_2 ; }; -ImageList IMG_INDEX_DLG_SCH -{ - MASKCOLOR; - prefix = "sch"; - IL_TOOL_2 ; -}; - ImageList IMG_INDEX_DLG_LC { MASKCOLOR; @@ -70,53 +63,29 @@ ImageList IMG_INDEX_DLG_LC IL_TOOL_2 ; }; -ImageList IMG_INDEX_DLG_LCH -{ - MASKCOLOR; - prefix = "lch"; - IL_TOOL_2 ; -}; - Image IMG_FORMFOLDER_TREE_L { ImageBitmap = Bitmap { File = "forms_32"; }; MASKCOLOR; }; -Image IMG_FORMFOLDER_TREE_LHC -{ - ImageBitmap = Bitmap { File = "forms_32_h"; }; - MASKCOLOR; -}; + Image IMG_REPORTFOLDER_TREE_L { ImageBitmap = Bitmap { File = "reports_32"; }; MASKCOLOR; }; -Image IMG_REPORTFOLDER_TREE_LHC -{ - ImageBitmap = Bitmap { File = "reports_32_h"; }; - MASKCOLOR; -}; + Image IMG_QUERYFOLDER_TREE_L { ImageBitmap = Bitmap { File = "queries_32"; }; MASKCOLOR; }; -Image IMG_QUERYFOLDER_TREE_LHC -{ - ImageBitmap = Bitmap { File = "queries_32_h"; }; - MASKCOLOR; -}; + Image IMG_TABLEFOLDER_TREE_L { ImageBitmap = Bitmap { File = "tables_32"; }; MASKCOLOR; }; -Image IMG_TABLEFOLDER_TREE_LHC -{ - ImageBitmap = Bitmap { File = "tables_32_h"; }; - MASKCOLOR; -}; //======================================================================== //= database object icons @@ -126,13 +95,7 @@ Image IMG_TABLEFOLDER_TREE_LHC Image DATABASE_TREE_ICON { - ImageBitmap = Bitmap { File = "db.bmp"; }; - MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; -}; - -Image DATABASE_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "db_sch.bmp"; }; + ImageBitmap = Bitmap { File = "db.png"; }; MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; }; @@ -145,24 +108,12 @@ Image TABLE_TREE_ICON MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; -Image TABLE_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "sxh03188.png"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - Image TABLEFOLDER_TREE_ICON { ImageBitmap = Bitmap { File = "sx03187.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; -Image TABLEFOLDER_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "sxh03187.png"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - //------------------------------------------------------------------------ // views @@ -172,36 +123,18 @@ Image VIEW_TREE_ICON MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; -Image VIEW_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "sxh16670.png"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - //------------------------------------------------------------------------ // queries and query folders Image QUERY_TREE_ICON { - ImageBitmap = Bitmap { File = "sx03202.bmp"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - -Image QUERY_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "sxh03202.bmp"; }; + ImageBitmap = Bitmap { File = "sx03202.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; Image QUERYFOLDER_TREE_ICON { - ImageBitmap = Bitmap { File = "sx03201.bmp"; }; - MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; -}; - -Image QUERYFOLDER_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "sxh03201.bmp"; }; + ImageBitmap = Bitmap { File = "sx03201.png"; }; MaskColor = Color { Red = 0xFFFF; Green = 0x0; Blue = 0xFFFF; }; }; @@ -214,24 +147,12 @@ Image FORM_TREE_ICON MASKCOLOR; }; -Image FORM_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "form_16_h"; }; - MASKCOLOR; -}; - Image FORMFOLDER_TREE_ICON { ImageBitmap = Bitmap { File = "forms_16"; }; MASKCOLOR; }; -Image FORMFOLDER_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "forms_16_h"; }; - MASKCOLOR; -}; - //------------------------------------------------------------------------ // reports and report folders @@ -241,22 +162,8 @@ Image REPORT_TREE_ICON MASKCOLOR; }; -Image REPORT_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "report_16_h"; }; - MASKCOLOR; -}; Image REPORTFOLDER_TREE_ICON { ImageBitmap = Bitmap { File = "reports_16"; }; MASKCOLOR; }; - -Image REPORTFOLDER_TREE_ICON_SCH -{ - ImageBitmap = Bitmap { File = "reports_16_h"; }; - MASKCOLOR; -}; - -//======================================================================== - diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index d0376cbf76dc..5cd8d93a337a 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 a8070ecd183e..9dfce6c0dfff 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -64,16 +64,16 @@ namespace dbaui OConnectionLine( const OConnectionLine& rLine ); virtual ~OConnectionLine(); - virtual OConnectionLine& operator=( const OConnectionLine& rLine ); + 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/DExport.hxx b/dbaccess/source/ui/inc/DExport.hxx index 4a96c8176825..d186b457e4a0 100644 --- a/dbaccess/source/ui/inc/DExport.hxx +++ b/dbaccess/source/ui/inc/DExport.hxx @@ -94,10 +94,9 @@ namespace dbaui SvNumberFormatter* m_pFormatter; SvStream& m_rInputStream; - //dyf add 2006/06/01 //for save the selected tablename ::rtl::OUString m_sDefaultTableName; - //dyf add end + String m_sTextToken; // Zellen Inhalt String m_sNumToken; /// SDNUM value String m_sValToken; /// SDVAL value @@ -167,9 +166,7 @@ namespace dbaui void SetColumnTypes(const TColumnVector* rList,const OTypeInfoMap* _pInfoMap); - //dyf add 20070601 inline void SetTableName(const ::rtl::OUString &_sTableName){ m_sDefaultTableName = _sTableName ; } - //dyf add end virtual void release() = 0; diff --git a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx b/dbaccess/source/ui/inc/ExtensionNotPresent.hxx deleted file mode 100644 index 9252a6b3974c..000000000000 --- a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx +++ /dev/null @@ -1,89 +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; - - /** returns the format string. - */ - // ::rtl::OUString getFormatString(::sal_Int16 _nNumberFormatIndex); - - 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 5ccb33bb70dc..661f66a96bda 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 38c270610a5f..cd038229deab 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 29e4d09e5670..de99bd3706f3 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/HtmlReader.hxx b/dbaccess/source/ui/inc/HtmlReader.hxx index 83d1926f1b1c..59c5bfc7f2b5 100644 --- a/dbaccess/source/ui/inc/HtmlReader.hxx +++ b/dbaccess/source/ui/inc/HtmlReader.hxx @@ -55,7 +55,7 @@ namespace dbaui virtual TypeSelectionPageFactory getTypeSelectionPageFactory(); - void TableDataOn(SvxCellHorJustify& eVal,int nToken); + void TableDataOn(SvxCellHorJustify& eVal); void TableFontOn(::com::sun::star::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor); sal_Int16 GetWidthPixel( const HTMLOption* pOption ); void setTextEncoding(); diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index 7c27a499e783..cc35323db7fd 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 @@ -150,14 +148,14 @@ namespace dbaui /** only defines a method to save a SQLException in d&d methods to show the error at a later state set the internal member m_aExceptionInfo to _rInfo */ - void setErrorOccured(const ::dbtools::SQLExceptionInfo& _rInfo) + void setErrorOccurred(const ::dbtools::SQLExceptionInfo& _rInfo) { m_aExceptionInfo = _rInfo; } /** just returns the internal member and clears it */ - ::dbtools::SQLExceptionInfo clearOccuredError() + ::dbtools::SQLExceptionInfo clearOccurredError() { ::dbtools::SQLExceptionInfo aInfo = m_aExceptionInfo; m_aExceptionInfo = ::dbtools::SQLExceptionInfo(); diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 72f5d054345e..48073242a301 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 5bd45e30ccb9..8089b1a2744b 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 184e0e97cbdb..096f97ba4675 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/RefFunctor.hxx b/dbaccess/source/ui/inc/RefFunctor.hxx index 20912af0af1c..41d48ca7b094 100644 --- a/dbaccess/source/ui/inc/RefFunctor.hxx +++ b/dbaccess/source/ui/inc/RefFunctor.hxx @@ -47,10 +47,6 @@ namespace dbaui { m_aFunction(_aType.get()); } -// inline void operator()(const ::rtl::Reference<T>& _aType) -// { -// m_aFunction(_aType.get()); -// } }; // ----------------------------------------------------------------------------- } // namespace dbaui diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index 55983b1dff6e..62b812f4f98f 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 3b0e375f8537..38253627fcc5 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 bbd66b2ba7b8..7320a8d14908 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 b7213e440754..d708cbac1424 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 5eb3429ce931..8d4629c36425 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 0a91e9bf5cc2..79ccd802d564 100644 --- a/dbaccess/source/ui/inc/TableConnectionData.hxx +++ b/dbaccess/source/ui/inc/TableConnectionData.hxx @@ -37,7 +37,6 @@ namespace dbaui { -#define MAX_CONN_COUNT 2 //================================================================== // ConnData ---------->* ConnLineData // ^1 ^1 @@ -79,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; } @@ -103,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 5b61c5ada9eb..5747cd20ac10 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/TableCopyHelper.hxx b/dbaccess/source/ui/inc/TableCopyHelper.hxx index 86012fa3706f..4745c232eaef 100644 --- a/dbaccess/source/ui/inc/TableCopyHelper.hxx +++ b/dbaccess/source/ui/inc/TableCopyHelper.hxx @@ -81,10 +81,10 @@ namespace dbaui struct DropDescriptor { ::svx::ODataAccessDescriptor aDroppedData; - //dyf add 20070601 + //for transfor the tablename ::rtl::OUString sDefaultTableName; - //dyf add end + String aUrl; SotStorageStreamRef aHtmlRtfStorage; ElementType nType; diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index 9acd1fbf02eb..0e905a459cc2 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 5e7c440a1466..a3bef0769a8c 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -38,14 +38,14 @@ namespace dbaui { //================================================================== // Ableitung von TabPage ist ein Trick von TH, - // um Aenderungen der Systemfarben zu bemerken (Bug #53905) + // um Aenderungen der Systemfarben zu bemerken class OTableDesignHelpBar : public TabPage ,public IClipboardTest { 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 b7bc8356ed76..9f4a96b6844d 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 bc4679434a0f..a0010fdbc82d 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 3fe4afa56854..9e02a0df0662 100644 --- a/dbaccess/source/ui/inc/TableRow.hxx +++ b/dbaccess/source/ui/inc/TableRow.hxx @@ -37,9 +37,6 @@ namespace dbaui { -// class OTableRow; -// friend SvStream& operator<<( SvStream& rStr, OTableRow& _rRow ); - class OFieldDescription; class OTypeInfo; class OTableRow @@ -62,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 323656ca869d..382a278dee2c 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 aa44a8d6d5f5..9a3bd21f1664 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 a3de07dac935..bf8fab0ac395 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 1e87054a9ece..e3b2ffcb3efb 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -84,18 +84,18 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xFactory; ::rtl::OUString m_sName; - //dyf add 20070601 + //for transfor the tablename ::rtl::OUString m_sDefaultTableName; - //dyf add end + ::rtl::OUString m_sDataSourceName; sal_Int32 m_nCommandType; bool m_bNeedToReInitialize; #if defined UNX - static const char __FAR_DATA sNewLine; + static const char sNewLine; #else - static const char __FAR_DATA sNewLine[]; + static const char sNewLine[]; #endif ODatabaseExport* m_pReader; @@ -121,13 +121,11 @@ namespace dbaui public: void setStream(SvStream* _pStream){ m_pStream = _pStream; } - //dyf add 20070601 //for set the tablename void setSTableName(const ::rtl::OUString &_sTableName){ m_sDefaultTableName = _sTableName; } - //dyf add end - 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(); @@ -163,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 @@ -178,11 +176,11 @@ namespace dbaui // HtmlFontSz[1-7] in s*3.ini [user] static sal_Int16 nFontSize[SBA_HTML_FONTSIZES]; static const sal_Int16 nCellSpacing; - static const char __FAR_DATA sIndentSource[]; + static const char sIndentSource[]; char sIndent[nIndentMax+1]; sal_Int16 m_nIndent; - #ifdef DBG_UTIL - BOOL m_bCheckFont; + #if OSL_DEBUG_LEVEL > 0 + sal_Bool m_bCheckFont; #endif void WriteHeader(); @@ -207,8 +205,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); }; // ========================================================================= @@ -244,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 8bd112c38742..c4c8ccb96d74 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -266,14 +266,6 @@ namespace dbaui */ void adjustToolBoxSize(ToolBox* _pToolBox); - /** isHiContrast check if we are in hi contrast mode. - @param _pWindow - The window we have to check on. - @return - <TRUE/> if so, otherwise <FALSE/> - */ - sal_Bool isHiContrast(Window* _pWindow); - void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId ); /** check if SQL92 name checking is enabled @@ -300,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. */ @@ -312,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. */ @@ -326,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 @@ -371,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 3b510f9a8926..6315528cda88 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 32f35779288e..b9d52b36fabd 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 110e8227027d..f754e5d9429d 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* ); @@ -70,24 +70,22 @@ namespace dbaui DECL_LINK( KeyClickHdl, Button* ); sal_Bool checkAppendData(); - //--------dyf add void SetAppendDataRadio(); - //--------add end 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(); @@ -97,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 8c0f16228bd2..a0819255f615 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/WTabPage.hxx b/dbaccess/source/ui/inc/WTabPage.hxx index 7aa6c138bd1b..d36a4438c554 100644 --- a/dbaccess/source/ui/inc/WTabPage.hxx +++ b/dbaccess/source/ui/inc/WTabPage.hxx @@ -43,7 +43,7 @@ namespace dbaui OCopyTableWizard* m_pParent; sal_Bool m_bFirstTime; // Page wird das erste mal gerufen ; should be set in the reset methode - OWizardPage( Window* pParent, const ResId& rResId );// : TabPage(pParent,rResId),m_pParent((OCopyTableWizard*)pParent),m_bFirstTime(sal_True) {}; + OWizardPage( Window* pParent, const ResId& rResId ); public: virtual void Reset ( ) = 0; diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index 214e5f9113e3..d2d7c6d8a98e 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 092afbb98108..6afc8f6ddd1c 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 ccc53bc650c7..47c510a68840 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 0f581e61b670..c0fde800c2e4 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 5983f252c8e5..1257cf31f4f1 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/datasourcemap.hxx b/dbaccess/source/ui/inc/datasourcemap.hxx index 836f001bf580..54802093e17d 100644 --- a/dbaccess/source/ui/inc/datasourcemap.hxx +++ b/dbaccess/source/ui/inc/datasourcemap.hxx @@ -113,7 +113,7 @@ namespace dbaui void clearModifiedFlag(const ::rtl::OUString& _rName); /** tell the map that a data source is scheduled to be deleted. - @return id for accessing the deleted data source later. -1 if no free id existed or an error occured + @return id for accessing the deleted data source later. -1 if no free id existed or an error occurred */ sal_Int32 markDeleted(const ::rtl::OUString& _rName); diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx index 4ba63866454b..a01314d188c1 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: @@ -123,7 +123,7 @@ private: { AR_LEAVE_MODIFIED, // somthing was modified and has successfully been committed AR_LEAVE_UNCHANGED, // no changes were made - AR_KEEP // don't leave the page (e.g. because an error occured) + AR_KEEP // don't leave the page (e.g. because an error occurred) }; /** apply all changes made */ diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index 4a7cbf0131c6..86e8ee277226 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 7e1b7df0d100..b107a0014dbb 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 be49adc0e518..7ba85bc6dfcb 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 @@ -249,48 +249,23 @@ // free // free #define IMG_PKEYICON RID_IMAGE_START + 12 -#define REPORTFOLDER_TREE_ICON_SCH RID_IMAGE_START + 13 -#define FORMFOLDER_TREE_ICON_SCH RID_IMAGE_START + 14 -#define IMG_DATABASE_CONNECTED RID_IMAGE_START + 15 -#define QUERYFOLDER_TREE_ICON_SCH RID_IMAGE_START + 16 -#define TABLEFOLDER_TREE_ICON_SCH RID_IMAGE_START + 17 // free -#define DATABASE_TREE_ICON_SCH RID_IMAGE_START + 19 -#define IMG_DATABASE_CONNECTED_SCH RID_IMAGE_START + 20 -#define TABLE_TREE_ICON_SCH RID_IMAGE_START + 21 -#define VIEW_TREE_ICON_SCH RID_IMAGE_START + 22 -#define QUERY_TREE_ICON_SCH RID_IMAGE_START + 23 -#define REPORTFOLDER_TREE_ICON RID_IMAGE_START + 24 // free +#define IMG_DATABASE_CONNECTED RID_IMAGE_START + 15 // free +// ... // free -#define BMP_EXCEPTION_ERROR_SCH RID_IMAGE_START + 28 -#define BMP_EXCEPTION_WARNING_SCH RID_IMAGE_START + 29 -#define BMP_EXCEPTION_INFO_SCH RID_IMAGE_START + 30 -#define IMG_PKEYICON_SCH RID_IMAGE_START + 31 -#define IMG_JOINS_H RID_IMAGE_START + 32 -#define IMG_ALL_LEFT_H RID_IMAGE_START + 33 -#define IMG_ONE_LEFT_H RID_IMAGE_START + 34 -#define IMG_ONE_RIGHT_H RID_IMAGE_START + 35 -#define IMG_ALL_RIGHT_H RID_IMAGE_START + 36 -#define IMG_SORTUP_H RID_IMAGE_START + 37 -#define IMG_SORTDOWN_H RID_IMAGE_START + 38 +#define REPORTFOLDER_TREE_ICON RID_IMAGE_START + 24 #define IMG_FORMFOLDER_TREE_L RID_IMAGE_START + 39 #define IMG_REPORTFOLDER_TREE_L RID_IMAGE_START + 40 #define IMG_QUERYFOLDER_TREE_L RID_IMAGE_START + 41 #define IMG_TABLEFOLDER_TREE_L RID_IMAGE_START + 42 -#define IMG_FORMFOLDER_TREE_LHC RID_IMAGE_START + 43 -#define IMG_REPORTFOLDER_TREE_LHC RID_IMAGE_START + 44 -#define IMG_QUERYFOLDER_TREE_LHC RID_IMAGE_START + 45 -#define IMG_TABLEFOLDER_TREE_LHC RID_IMAGE_START + 46 #define IMG_NAVIGATION_BTN_UP_SC RID_IMAGE_START + 47 -#define IMG_NAVIGATION_BTN_UP_SCH RID_IMAGE_START + 48 #define IMG_NAVIGATION_CREATEFOLDER_SC RID_IMAGE_START + 49 -#define IMG_NAVIGATION_CREATEFOLDER_SCH RID_IMAGE_START + 50 #define FORM_TREE_ICON RID_IMAGE_START + 51 #define REPORT_TREE_ICON RID_IMAGE_START + 52 -#define FORM_TREE_ICON_SCH RID_IMAGE_START + 53 -#define REPORT_TREE_ICON_SCH RID_IMAGE_START + 54 +// free +// free #define FORMFOLDER_TREE_ICON RID_IMAGE_START + 55 @@ -298,17 +273,17 @@ // image lists #define IMG_JOINS RID_IMAGELIST_START + 0 #define IMG_INDEX_DLG_SC RID_IMAGELIST_START + 1 -#define IMG_INDEX_DLG_SCH RID_IMAGELIST_START + 2 +// free #define IMG_INDEX_DLG_LC RID_IMAGELIST_START + 3 -#define IMG_INDEX_DLG_LCH RID_IMAGELIST_START + 4 +// free #define IMP_FORM_SC RID_IMAGELIST_START + 5 -#define IMP_FORM_SCH RID_IMAGELIST_START + 6 +// free #define IMP_FORM_LC RID_IMAGELIST_START + 7 -#define IMP_FORM_LCH RID_IMAGELIST_START + 8 +// free #define IMP_REPORT_SC RID_IMAGELIST_START + 9 -#define IMP_REPORT_SCH RID_IMAGELIST_START + 10 +// free #define IMP_REPORT_LC RID_IMAGELIST_START + 11 -#define IMP_REPORT_LCH RID_IMAGELIST_START + 12 +// free //======================================================================== // menues @@ -353,7 +328,7 @@ #define STR_TABLEDESIGN_DBFIELDTYPES RID_STR_GEN_START + 8 #define STR_QRY_CONTINUE RID_STR_GEN_START + 9 #define STR_COLUMN_NAME RID_STR_GEN_START + 10 -#define STR_ERROR_OCCURED_WHILE_COPYING RID_STR_GEN_START + 11 +#define STR_ERROR_OCCURRED_WHILE_COPYING RID_STR_GEN_START + 11 #define STR_MISSING_TABLES_XDROP RID_STR_GEN_START + 12 #define STR_QUERY_DELETE_TABLE RID_STR_GEN_START + 13 #define STR_BUTTON_TEXT_ALL RID_STR_GEN_START + 14 @@ -393,17 +368,17 @@ // free #define RSC_QUERY_OBJECT_TYPE RID_UNTYPED_START + 4 #define IMG_TABLESUBCRIPTION_SC RID_UNTYPED_START + 5 -#define IMG_TABLESUBCRIPTION_SCH RID_UNTYPED_START + 6 +// free #define IMG_TABLESUBCRIPTION_LC RID_UNTYPED_START + 7 -#define IMG_TABLESUBCRIPTION_LCH RID_UNTYPED_START + 8 +// free #define IMG_QUERYADMINISTRATION_SC RID_UNTYPED_START + 9 -#define IMG_QUERYADMINISTRATION_SCH RID_UNTYPED_START + 10 +// free #define IMG_QUERYADMINISTRATION_LC RID_UNTYPED_START + 11 -#define IMG_QUERYADMINISTRATION_LCH RID_UNTYPED_START + 12 +// free #define IMG_DOCUMENTLINKS_SC RID_UNTYPED_START + 13 -#define IMG_DOCUMENTLINKS_SCH RID_UNTYPED_START + 14 +// free #define IMG_DOCUMENTLINKS_LC RID_UNTYPED_START + 15 -#define IMG_DOCUMENTLINKS_LCH RID_UNTYPED_START + 16 +// free //======================================================================== // various diff --git a/dbaccess/source/ui/inc/dbwiz.hxx b/dbaccess/source/ui/inc/dbwiz.hxx index 882f78b806de..414a3a0b5108 100644 --- a/dbaccess/source/ui/inc/dbwiz.hxx +++ b/dbaccess/source/ui/inc/dbwiz.hxx @@ -116,7 +116,7 @@ protected: { AR_LEAVE_MODIFIED, // somthing was modified and has successfully been committed AR_LEAVE_UNCHANGED, // no changes were made - AR_KEEP // don't leave the page (e.g. because an error occured) + AR_KEEP // don't leave the page (e.g. because an error occurred) }; /** apply all changes made */ diff --git a/dbaccess/source/ui/inc/dbwizsetup.hxx b/dbaccess/source/ui/inc/dbwizsetup.hxx index ad8c6fb07eef..a6b4db6b6b02 100644 --- a/dbaccess/source/ui/inc/dbwizsetup.hxx +++ b/dbaccess/source/ui/inc/dbwizsetup.hxx @@ -149,7 +149,7 @@ protected: { AR_LEAVE_MODIFIED, // somthing was modified and has successfully been committed AR_LEAVE_UNCHANGED, // no changes were made - AR_KEEP // don't leave the page (e.g. because an error occured) + AR_KEEP // don't leave the page (e.g. because an error occurred) }; private: diff --git a/dbaccess/source/ui/inc/directsql.hxx b/dbaccess/source/ui/inc/directsql.hxx index dcb9ec5f96c1..250c667166be 100644 --- a/dbaccess/source/ui/inc/directsql.hxx +++ b/dbaccess/source/ui/inc/directsql.hxx @@ -126,7 +126,7 @@ namespace dbaui { \ const sal_Char* pError = impl_CheckInvariants(); \ if (pError) \ - OSL_ENSURE(sal_False, (ByteString(methodname) += ByteString(": ") += ByteString(pError)).GetBuffer()); \ + OSL_FAIL((ByteString(methodname) += ByteString(": ") += ByteString(pError)).GetBuffer()); \ } #else #define CHECK_INVARIANTS(methodname) diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index a1a3c82ec76a..e4fe6e158c96 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 3617c72e4a47..7b2e0152d226 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 7437d8b54b6c..9cc4d85808c8 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 a7a0d5c6c80b..5efa09c0c3cb 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 2fbd64bc99d5..34b6e96ec86d 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 fd1c479917f1..e3b5489203b0 100644 --- a/dbaccess/source/ui/inc/imageprovider.hxx +++ b/dbaccess/source/ui/inc/imageprovider.hxx @@ -87,16 +87,13 @@ namespace dbaui the name of the object @param _out_rImage the normal image to use for the object - @param _out_rImageHC - the high-contrast version of the image to use for the object @return the image to be used for the object. */ void getImages( const String& _rName, const sal_Int32 _nDatabaseObjectType, - Image& _out_rImage, - Image& _out_rImageHC + Image& _out_rImage ); /** returns the default image to be used for a database object @@ -108,18 +105,11 @@ namespace dbaui @param _nDatabaseObjectType the type of the object. Must be one of the css.sdb.application.DatabaseObject constants. - @param _bHighContrast - indicates whether High-Contrast icons should be used. - Note that normally, this would be some application-wide setting. However, - in current OOo, HC support is decided on a per-control basis, means every - control decides itself whether its images must be HC versions or not. - Thus callers need to specify this flag. @return the image to be used for the object type. */ Image getDefaultImage( - sal_Int32 _nDatabaseObjectType, - bool _bHighContrast + sal_Int32 _nDatabaseObjectType ); /** returns the resource ID for the default image to be used for a database object @@ -131,19 +121,12 @@ namespace dbaui @param _nDatabaseObjectType the type of the object. Must be one of the css.sdb.application.DatabaseObject constants. - @param _bHighContrast - indicates whether High-Contrast icons should be used. - Note that normally, this would be some application-wide setting. However, - in current OOo, HC support is decided on a per-control basis, means every - control decides itself whether its images must be HC versions or not. - Thus callers need to specify this flag. @return 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_Int32 _nDatabaseObjectType, - bool _bHighContrast + sal_uInt16 getDefaultImageResourceID( + sal_Int32 _nDatabaseObjectType ); /** retrieves the image to be used for folders of database objects @@ -152,31 +135,18 @@ namespace dbaui constants. @param _rName the name of the object - @param _bHighContrast - indicates whether High-Contrast icons should be used. - Note that normally, this would be some application-wide setting. However, - in current OOo, HC support is decided on a per-control basis, means every - control decides itself whether its images must be HC versions or not. - Thus callers need to specify this flag. @return the image to be used for folders of the given type */ Image getFolderImage( - sal_Int32 _nDatabaseObjectType, - bool _bHighContrast + sal_Int32 _nDatabaseObjectType ); /** retrieves the image to be used for a database as a whole. - @param _bHighContrast - indicates whether High-Contrast icons should be used. - Note that normally, this would be some application-wide setting. However, - in current OOo, HC support is decided on a per-control basis, means every - control decides itself whether its images must be HC versions or not. - Thus callers need to specify this flag. @return the image to be used for folders of this type */ - Image getDatabaseImage( bool _bHighContrast ); + Image getDatabaseImage(); }; //........................................................................ diff --git a/dbaccess/source/ui/inc/indexdialog.hxx b/dbaccess/source/ui/inc/indexdialog.hxx index f7d4c41a45fb..10839459626b 100644 --- a/dbaccess/source/ui/inc/indexdialog.hxx +++ b/dbaccess/source/ui/inc/indexdialog.hxx @@ -136,7 +136,7 @@ namespace dbaui @param _bHiContast <TRUE/> when in high contrast mode. */ - virtual ImageList getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const; + virtual ImageList getImageList(sal_Int16 _eBitmapSet) const; /** will be called when the controls need to be resized. */ diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx index 6d5394667111..3cf5ba748681 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 a57513f6c5e7..4297cdef693a 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 3e0e53e2d653..b4c73bfb9521 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 ef88f585631e..689e7998f6cf 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 0f2813cd0b05..363c5517050e 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 bfb10cae1924..2e4dd3c9e662 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 857c32d8f010..0d3dc746fa2b 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -29,8 +29,6 @@ #ifndef _SBA_GRID_HXX #define _SBA_GRID_HXX -// #include <sdb/tools.hxx> - #include <svx/fmgridcl.hxx> #include <svx/fmgridif.hxx> @@ -242,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 100644 index 000000000000..c738bd94e81c --- /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 3ad5a4d93460..2e98ce3ac3c6 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 deb68c99b6a0..ad026e81c9f2 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(); @@ -451,7 +451,7 @@ namespace dbaui void* _pTreeListUserData // in rela a DBTreeListUserData*, but we do not know this class here .... ); -#ifdef DBG_UTIL +#if OSL_DEBUG_LEVEL > 0 // checks whether the given tree entry denotes a data source bool impl_isDataSourceEntry( SvLBoxEntry* _pEntry ) const; #endif @@ -471,9 +471,6 @@ namespace dbaui // remove all grid columns and dispose them void clearGridColumns(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& _xColContainer); - sal_Bool isHiContrast() const; - - /** checks if the currently displayed entry changed @param _sName Name of the changed entry @@ -488,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 4473031808fe..e0b0dd4d8a34 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -56,6 +56,7 @@ #include "UITools.hxx" #include <unotools/configmgr.hxx> #include <memory> +#include <o3tl/compat_functional.hxx> #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include <i18npool/mslangid.hxx> @@ -115,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) @@ -174,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) @@ -290,7 +291,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection, break; } } - } // if(xSet.is()) + } if ( !m_pTypeInfo ) m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); SetColumnTypes(pList,_pInfoMap); @@ -326,20 +327,17 @@ void ODatabaseExport::insertValueIntoColumn() sal_Int32 nPos = m_vColumns[nNewPos].first; if ( nPos != COLUMN_POSITION_NOT_FOUND ) { - // if(m_nDefToken != LANGUAGE_DONTKNOW) // falls Sprache anders als Systemsprache - // m_pNF->ChangeIntl((LanguageType)m_nDefToken); - if ( !m_sTextToken.Len() && pField->IsNullable() ) m_pUpdateHelper->updateNull(nPos,pField->GetType()); else { - sal_Int32 nNumberFormat = 0; - double fOutNumber = 0.0; OSL_ENSURE((nNewPos) < static_cast<sal_Int32>(m_vColumnTypes.size()),"Illegal index for vector"); if (m_vColumnTypes[nNewPos] != DataType::VARCHAR && m_vColumnTypes[nNewPos] != DataType::CHAR && m_vColumnTypes[nNewPos] != DataType::LONGVARCHAR ) { RTL_LOGFILE_CONTEXT_TRACE( aLogger, "ODatabaseExport::insertValueIntoColumn != DataType::VARCHAR" ); ensureFormatter(); + sal_Int32 nNumberFormat = 0; + double fOutNumber = 0.0; bool bNumberFormatError = false; if ( m_pFormatter && m_sNumToken.Len() ) { @@ -562,7 +560,7 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl } break; default: - OSL_ENSURE(0,"ODatabaseExport: Unbekanntes Format"); + OSL_FAIL("ODatabaseExport: Unbekanntes Format"); } } } @@ -787,10 +785,10 @@ 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; - } // if(!m_bDontAskAgain) + m_bError = sal_True; + } } // ----------------------------------------------------------------------------- void ODatabaseExport::adjustFormat() @@ -872,7 +870,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R for(sal_uInt32 j=0; j < aInsertList.size() ;++i,++j) { ODatabaseExport::TPositions::const_iterator aFind = ::std::find_if(_rvColumns.begin(),_rvColumns.end(), - ::std::compose1(::std::bind2nd(::std::equal_to<sal_Int32>(),i+1),::std::select2nd<ODatabaseExport::TPositions::value_type>())); + ::o3tl::compose1(::std::bind2nd(::std::equal_to<sal_Int32>(),i+1),::o3tl::select2nd<ODatabaseExport::TPositions::value_type>())); if ( _rvColumns.end() != aFind && aFind->second != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND) && aFind->first != sal::static_int_cast< long >(CONTAINER_ENTRY_NOTFOUND) ) { OSL_ENSURE((aFind->first) < static_cast<sal_Int32>(aInsertList.size()),"aInsertList: Illegal index for vector"); diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 2764d2fc6116..d4b4c4c5e329 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -36,7 +36,7 @@ #include "dbu_misc.hrc" #include "dbustrings.hrc" #include <sfx2/sfxhtml.hxx> -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <tools/tenccvt.hxx> #include "moduledbu.hxx" #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> @@ -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(); // verndert 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++ ) @@ -337,7 +337,6 @@ void OHTMLReader::fetchOptions() case HTML_O_SDVAL: { m_sValToken = pOption->GetString(); - //m_sTextToken = pOption->GetString(); m_bSDNum = sal_True; } break; @@ -348,11 +347,10 @@ void OHTMLReader::fetchOptions() } } //--------------------------------------------------------------------------------- -void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal,int nToken) +void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::TableDataOn" ); DBG_CHKTHIS(OHTMLReader,NULL); - sal_Bool bHorJustifyCenterTH = (nToken == HTML_TABLEHEADER_ON); const HTMLOptions* pHtmlOptions = GetOptions(); sal_Int16 nArrLen = pHtmlOptions->Count(); for ( sal_Int16 i = 0; i < nArrLen; i++ ) @@ -362,7 +360,6 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal,int nToken) { case HTML_O_ALIGN: { - bHorJustifyCenterTH = sal_False; const String& rOptVal = pOption->GetString(); if (rOptVal.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_AL_right )) eVal = SVX_HOR_JUSTIFY_RIGHT; @@ -439,14 +436,14 @@ sal_Int16 OHTMLReader::GetWidthPixel( const HTMLOption* pOption ) const String& rOptVal = pOption->GetString(); if ( rOptVal.Search('%') != STRING_NOTFOUND ) { // Prozent - DBG_ASSERT( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 und Width%" ); + OSL_ENSURE( m_nColumnWidth, "WIDTH Option: m_nColumnWidth==0 und Width%" ); return (sal_Int16)((pOption->GetNumber() * m_nColumnWidth) / 100); } else { if ( rOptVal.Search('*') != STRING_NOTFOUND ) { // relativ zu was?!? -//2do: ColArray aller relativen Werte sammeln und dann MakeCol +//TODO: ColArray aller relativen Werte sammeln und dann MakeCol return 0; } else @@ -489,15 +486,11 @@ sal_Bool OHTMLReader::CreateTable(int nToken) m_sTextToken.Erase(); break; case HTML_TABLEDATA_ON: - // m_bAppendFirstLine = true; - // run through case HTML_TABLEHEADER_ON: - TableDataOn(eVal,nTmpToken2); - bTableHeader = TRUE; + TableDataOn(eVal); + bTableHeader = sal_True; break; case HTML_TABLEDATA_OFF: - // m_bAppendFirstLine = true; - // run through case HTML_TABLEHEADER_OFF: { aColumnName.EraseLeadingChars(); @@ -520,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 386c17312221..4ac330a3fc87 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -1,3 +1,4 @@ + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * @@ -48,7 +49,6 @@ using namespace ::com::sun::star::util; using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::lang; -// using namespace ::com::sun::star::sdbcx; // export data ORowSetImportExport::ORowSetImportExport( Window* _pParent, @@ -84,7 +84,7 @@ void ORowSetImportExport::initialize() m_aColumnTypes.reserve(nCount); for (sal_Int32 i = 1;i <= nCount; ++i) { - sal_Int32 nPos = -1; // -1 means column is autoincrement or doesn't exists + sal_Int32 nPos = -1; // -1 means column is autoincrement or doesn't exist if(!m_xTargetResultSetMetaData->isAutoIncrement(i)) { try @@ -95,7 +95,7 @@ void ORowSetImportExport::initialize() catch(const SQLException&) { if(m_xTargetResultSetMetaData->isNullable(i)) - nPos = 0; // column doesn't exists but we could set it to null + nPos = 0; // column doesn't exist but we could set it to null } } @@ -107,21 +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; - sal_Int32 nCurrentRow = 0; - sal_Int32 nRowFilterIndex = 0; + return sal_False; sal_Bool bContinue = sal_True; if(m_aSelection.getLength()) { @@ -131,7 +129,7 @@ BOOL ORowSetImportExport::Read() { sal_Int32 nPos = -1; *pBegin >>= nPos; - OSL_ENSURE(nPos != -1,"Invalid posiotion!"); + OSL_ENSURE(nPos != -1,"Invalid position!"); bContinue = (m_xResultSet.is() && m_xResultSet->absolute(nPos) && insertNewRow()); } } @@ -139,6 +137,8 @@ BOOL ORowSetImportExport::Read() { Reference<XPropertySet> xProp(m_xResultSet,UNO_QUERY); sal_Int32 nRowCount = 0; + sal_Int32 nCurrentRow = 0; + sal_Int32 nRowFilterIndex = 0; if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_ISROWCOUNTFINAL) ) { sal_Bool bFinal = sal_False; @@ -165,7 +165,7 @@ BOOL ORowSetImportExport::Read() } } } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- sal_Bool ORowSetImportExport::insertNewRow() @@ -242,7 +242,7 @@ sal_Bool ORowSetImportExport::insertNewRow() aValue <<= m_xRow->getClob(*aIter); break; default: - OSL_ENSURE(0,"Unknown type"); + OSL_FAIL("Unknown type"); } if(m_xRow->wasNull()) m_xTargetRowUpdate->updateNull(i); @@ -258,7 +258,7 @@ sal_Bool ORowSetImportExport::insertNewRow() { if(!m_bAlreadyAsked) { - String sAskIfContinue = String(ModuleRes(STR_ERROR_OCCURED_WHILE_COPYING)); + String sAskIfContinue = String(ModuleRes(STR_ERROR_OCCURRED_WHILE_COPYING)); OSQLWarningBox aDlg( m_pParent, sAskIfContinue, WB_YES_NO | WB_DEF_YES ); if(aDlg.Execute() == RET_YES) m_bAlreadyAsked = sal_True; diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx index f4f1ae4013cb..fb25f77d70f1 100644 --- a/dbaccess/source/ui/misc/RtfReader.cxx +++ b/dbaccess/source/ui/misc/RtfReader.cxx @@ -130,7 +130,6 @@ void ORTFReader::NextToken( int nToken ) { int nTmpToken2 = GetNextToken(); - sal_Bool bNext = TRUE; do { Color aColor; @@ -141,8 +140,7 @@ void ORTFReader::NextToken( int nToken ) case RTF_RED: aColor.SetRed((sal_uInt8)nTokenValue); break; case RTF_BLUE: aColor.SetBlue((sal_uInt8)nTokenValue); break; case RTF_GREEN: aColor.SetGreen((sal_uInt8)nTokenValue); break; - default: - bNext = sal_False; + default: break; } nTmpToken2 = GetNextToken(); } @@ -164,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(); // verndert vielleicht die Position des Streams + sal_uInt32 nTell = rInput.Tell(); // ver�ndert vielleicht die Position des Streams m_bError = !CreateTable(nToken); bInsertRow = m_bAppendFirstLine; @@ -194,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: @@ -217,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(); @@ -251,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: @@ -296,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: @@ -315,8 +313,6 @@ sal_Bool ORTFReader::CreateTable(int nToken) } break; case RTF_CF: - // if(nTokenValue < m_vecColor.size()) - // m_xTable->setPropertyValue(PROPERTY_TEXTCOLOR,makeAny(m_vecColor[nTokenValue])); break; case RTF_B: aFont.Weight = ::com::sun::star::awt::FontWeight::BOLD; diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx index 8cca42ddf1b4..655484d69920 100644 --- a/dbaccess/source/ui/misc/TableCopyHelper.cxx +++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx @@ -99,7 +99,7 @@ void OTableCopyHelper::insertTable( const ::rtl::OUString& i_rSourceDataSource, { if ( CommandType::QUERY != i_nCommandType && CommandType::TABLE != i_nCommandType ) { - DBG_ERROR( "OTableCopyHelper::insertTable: invalid call (no supported format found)!" ); + OSL_FAIL( "OTableCopyHelper::insertTable: invalid call (no supported format found)!" ); return; } @@ -111,7 +111,7 @@ void OTableCopyHelper::insertTable( const ::rtl::OUString& i_rSourceDataSource, if ( !xSrcConnection.is() || !i_rDestConnection.is() ) { - OSL_ENSURE( false, "OTableCopyHelper::insertTable: no connection/s!" ); + OSL_FAIL( "OTableCopyHelper::insertTable: no connection/s!" ); return; } @@ -223,7 +223,7 @@ void OTableCopyHelper::pasteTable( SotFormatStringId _nFormatId aTrans.bHtml = SOT_FORMATSTR_ID_HTML == _nFormatId; aTrans.sDefaultTableName = GetTableNameForAppend(); if ( !copyTagTable(aTrans,sal_False,_xConnection) ) - m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString::createFromAscii("S1000") ,0,Any())); + m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")),0,Any())); } catch(const SQLException&) { @@ -235,7 +235,7 @@ void OTableCopyHelper::pasteTable( SotFormatStringId _nFormatId } } else - m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString::createFromAscii("S1000") ,0,Any())); + m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")),0,Any())); } // ----------------------------------------------------------------------------- @@ -266,10 +266,9 @@ sal_Bool OTableCopyHelper::copyTagTable(OTableCopyHelper::DropDescriptor& _rDesc if ( _bCheck ) pImport->enableCheckOnly(); - //dyf add 20070601 //set the selected tablename pImport->setSTableName(_rDesc.sDefaultTableName); - //dyf add end + pImport->setStream(pStream); return pImport->Read(); } @@ -335,7 +334,7 @@ void OTableCopyHelper::asyncCopyTagTable( DropDescriptor& _rDesc else if ( !_rDesc.bError ) pasteTable(_rDesc.aDroppedData,i_rDestDataSource,_xConnection); else - m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString::createFromAscii("S1000") ,0,Any())); + m_pController->showError(SQLException(String(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*m_pController,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")),0,Any())); } // ----------------------------------------------------------------------------- //........................................................................ diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index e165df1c7b1b..ae08c7a38630 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -31,6 +31,7 @@ #include "TokenWriter.hxx" #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "RtfReader.hxx" #include "HtmlReader.hxx" #include "dbustrings.hrc" @@ -82,15 +83,15 @@ using namespace ::com::sun::star::util; using ::com::sun::star::frame::XModel; #if defined(UNX) -const char __FAR_DATA ODatabaseImportExport::sNewLine = '\012'; +const char ODatabaseImportExport::sNewLine = '\012'; #else -const char __FAR_DATA ODatabaseImportExport::sNewLine[] = "\015\012"; +const char ODatabaseImportExport::sNewLine[] = "\015\012"; #endif -const static char __FAR_DATA sMyBegComment[] = "<!-- "; -const static char __FAR_DATA sMyEndComment[] = " -->"; -const static char __FAR_DATA sFontFamily[] = "font-family: "; -const static char __FAR_DATA sFontSize[] = "font-size: "; +const static char sMyBegComment[] = "<!-- "; +const static char sMyEndComment[] = " -->"; +const static char sFontFamily[] = "font-family: "; +const static char sFontSize[] = "font-size: "; #define SBA_FORMAT_SELECTION_COUNT 4 #define CELL_X 1437 @@ -201,8 +202,6 @@ void SAL_CALL ODatabaseImportExport::disposing( const EventObject& Source ) thro m_xConnection.clear(); dispose(); m_bNeedToReInitialize = true; - //if(!m_bInInitialize) - // initialize(); } } // ----------------------------------------------------------------------------- @@ -249,7 +248,7 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor { if ( !m_xResultSet.is() ) { - OSL_ENSURE( false, "ODatabaseImportExport::impl_initFromDescriptor: selection without result set is nonsense!" ); + OSL_FAIL( "ODatabaseImportExport::impl_initFromDescriptor: selection without result set is nonsense!" ); m_aSelection.realloc( 0 ); } } @@ -258,7 +257,7 @@ void ODatabaseImportExport::impl_initFromDescriptor( const ODataAccessDescriptor { if ( m_bBookmarkSelection && !m_xRowLocate.is() ) { - OSL_ENSURE( false, "ODatabaseImportExport::impl_initFromDescriptor: no XRowLocate -> no bookmars!" ); + OSL_FAIL( "ODatabaseImportExport::impl_initFromDescriptor: no XRowLocate -> no bookmars!" ); m_aSelection.realloc( 0 ); } } @@ -332,7 +331,7 @@ void ODatabaseImportExport::initialize() // the result set may be already set with the datadescriptor if ( !m_xResultSet.is() ) { - m_xResultSet.set( m_xFactory->createInstance( ::rtl::OUString::createFromAscii( "com.sun.star.sdb.RowSet" ) ), UNO_QUERY ); + m_xResultSet.set( m_xFactory->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.RowSet")) ), UNO_QUERY ); Reference< XPropertySet > xProp( m_xResultSet, UNO_QUERY_THROW ); xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( m_xConnection.getTyped() ) ); xProp->setPropertyValue( PROPERTY_COMMAND_TYPE, makeAny( m_nCommandType ) ); @@ -363,24 +362,24 @@ void ODatabaseImportExport::initialize() m_bInInitialize = sal_False; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Write() +sal_Bool ODatabaseImportExport::Write() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); - } // if ( m_bNeedToReInitialize ) - return TRUE; + } + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Read() +sal_Bool ODatabaseImportExport::Read() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); - } // if ( m_bNeedToReInitialize ) - return TRUE; + } + return sal_True; } // ----------------------------------------------------------------------------- void ODatabaseImportExport::impl_initializeRowMember_throw() @@ -396,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(); @@ -404,58 +403,10 @@ BOOL ORTFImportExport::Write() (*m_pStream) << OOO_STRING_SVTOOLS_RTF_ANSI << ODatabaseImportExport::sNewLine; rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252; - /* - // Access RTF Export Beispiel - {\rtf1\ansi - {\colortbl\red0\green0\blue0;\red255\green255\blue255;\red192\green192\blue192;} - {\fonttbl\f0\fcharset0\fnil MS Sans Serif;\f1\fcharset0\fnil Arial;\f2\fcharset0\fnil Arial;} - \trowd\trgaph40 - \clbrdrl\brdrs\brdrcf0\clbrdrt\brdrs\brdrcf0\clbrdrb\brdrs\brdrcf0\clbrdrr\brdrs\brdrcf0\clshdng10000\clcfpat2\cellx1437 - \clbrdrl\brdrs\brdrcf0\clbrdrt\brdrs\brdrcf0\clbrdrb\brdrs\brdrcf0\clbrdrr\brdrs\brdrcf0\clshdng10000\clcfpat2\cellx2874 - { - \trrh-270\pard\intbl - {\qc\fs20\b\f1\cf0\cb2 text\cell} - \pard\intbl - {\qc\fs20\b\f1\cf0\cb2 datum\cell} - \pard\intbl\row - } - \trowd\trgaph40\clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx1437\clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx2874 - {\trrh-270\pard\intbl - {\ql\fs20\f2\cf0\cb1 heute\cell} - \pard\intbl - {\qr\fs20\f2\cf0\cb1 10.11.98\cell} - \pard\intbl\row - } - \trowd\trgaph40\clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx1437\clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx2874 - {\trrh-270\pard\intbl - {\ql\fs20\f2\cf0\cb1 morgen\cell} - \pard\intbl - {\qr\fs20\f2\cf0\cb1 11.11.98\cell} - \pard\intbl\row - } - \trowd\trgaph40\clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx1437\clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx2874 - {\trrh-270\pard\intbl - {\ql\fs20\f2\cf0\cb1 bruder\cell} - \pard\intbl - {\qr\fs20\f2\cf0\cb1 21.04.98\cell} - \pard\intbl\row - } - \trowd\trgaph40 - \clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx - \clbrdrl\brdrs\brdrcf2\clbrdrt\brdrs\brdrcf2\clbrdrb\brdrs\brdrcf2\clbrdrr\brdrs\brdrcf2\clshdng10000\clcfpat1\cellx2874 - {\trrh-270\pard\intbl - {\ql\fs20\f2\cf0\cb1 vater\cell} - \pard\intbl - {\qr\fs20\f2\cf0\cb1 28.06.98\cell} - \pard\intbl\row - } - } - */ - - 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()) @@ -619,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); } // ----------------------------------------------------------------------------- @@ -642,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); @@ -671,14 +622,12 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou Reference<XPropertySet> xColumn(m_xRowSetColumns->getByIndex(i-1),UNO_QUERY_THROW); dbtools::FormattedColumnValue aFormatedValue(aContext,xRowSet,xColumn); ::rtl::OUString sValue = aFormatedValue.getFormattedValue(); - // m_xRow->getString(i); - //if (!m_xRow->wasNull()) if ( sValue.getLength() ) RTFOutFuncs::Out_String(*m_pStream,sValue,m_eDestEnc); } catch (Exception&) { - OSL_ENSURE(0,"RTF WRITE!"); + OSL_FAIL("RTF WRITE!"); } (*m_pStream) << OOO_STRING_SVTOOLS_RTF_CELL; @@ -692,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(); @@ -712,7 +661,7 @@ BOOL ORTFImportExport::Read() } //------------------------------------------------------------------- //=================================================================== -const sal_Int16 __FAR_DATA OHTMLImportExport::nDefaultFontSize[SBA_HTML_FONTSIZES] = +const sal_Int16 OHTMLImportExport::nDefaultFontSize[SBA_HTML_FONTSIZES] = { HTMLFONTSZ1_DFLT, HTMLFONTSZ2_DFLT, HTMLFONTSZ3_DFLT, HTMLFONTSZ4_DFLT, HTMLFONTSZ5_DFLT, HTMLFONTSZ6_DFLT, HTMLFONTSZ7_DFLT @@ -721,14 +670,14 @@ const sal_Int16 __FAR_DATA OHTMLImportExport::nDefaultFontSize[SBA_HTML_FONTSIZE sal_Int16 OHTMLImportExport::nFontSize[SBA_HTML_FONTSIZES] = { 0 }; const sal_Int16 OHTMLImportExport::nCellSpacing = 0; -const char __FAR_DATA OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; +const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t"; //======================================================================== -// Makros fuer HTML-Export +// Macros for HTML-Export //======================================================================== #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 @@ -745,8 +694,8 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD const String& rExchange) : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) -#ifdef DBG_UTIL - ,m_bCheckFont(FALSE) +#if OSL_DEBUG_LEVEL > 0 + ,m_bCheckFont(sal_False) #endif { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::OHTMLImportExport" ); @@ -757,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(); @@ -776,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(); @@ -787,9 +736,7 @@ BOOL OHTMLImportExport::Read() ((OHTMLReader*)m_pReader)->AddRef(); if ( isCheckEnabled() ) m_pReader->enableCheckOnly(); - //dyf add 20070601 m_pReader->SetTableName(m_sDefaultTableName); - //dyf add end eState = ((OHTMLReader*)m_pReader)->CallParser(); m_pReader->release(); m_pReader = NULL; @@ -802,8 +749,8 @@ void OHTMLImportExport::WriteHeader() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::WriteHeader" ); uno::Reference<document::XDocumentProperties> xDocProps( - m_xFactory->createInstance(::rtl::OUString::createFromAscii( - "com.sun.star.document.DocumentProperties")), + m_xFactory->createInstance(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.DocumentProperties"))), uno::UNO_QUERY); if (xDocProps.is()) { xDocProps->setTitle(m_sName); @@ -835,7 +782,7 @@ void OHTMLImportExport::WriteBody() IncIndent(-1); OUT_LF(); TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_style ); OUT_LF(); - // default Textfarbe schwarz + // default Textcolour black (*m_pStream) << '<' << OOO_STRING_SVTOOLS_HTML_body << ' ' << OOO_STRING_SVTOOLS_HTML_O_text << '='; sal_Int32 nColor = 0; if(m_xObject.is()) @@ -1057,23 +1004,23 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I aStrTD = aStrTD + "="; aStrTD = aStrTD + pChar; - double fVal = 0.0; - Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier(); SvNumberFormatsSupplierObj* pSupplierImpl = SvNumberFormatsSupplierObj::getImplementation( xSupplier ); SvNumberFormatter* pFormatter = pSupplierImpl ? pSupplierImpl->GetNumberFormatter() : NULL; if(pFormatter) { + double fVal = 0.0; + try { 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 ); } } @@ -1081,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 ); @@ -1092,7 +1039,7 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I if ( bStrikeout ) TAG_ON( OOO_STRING_SVTOOLS_HTML_strike ); if ( !rValue.Len() ) - TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // #42573# keine komplett leere Zelle + TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak ); // keine komplett leere Zelle else HTMLOutFuncs::Out_String( (*m_pStream), rValue ,m_eDestEnc); @@ -1110,8 +1057,8 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I void OHTMLImportExport::FontOn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOn" ); -#ifdef DBG_UTIL - m_bCheckFont = TRUE; +#if OSL_DEBUG_LEVEL > 0 + m_bCheckFont = sal_True; #endif // <FONT FACE="xxx"> @@ -1141,10 +1088,10 @@ void OHTMLImportExport::FontOn() inline void OHTMLImportExport::FontOff() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOff" ); - DBG_ASSERT(m_bCheckFont,"Kein FontOn() gerufen"); + OSL_ENSURE(m_bCheckFont,"Kein FontOn() gerufen"); TAG_OFF( OOO_STRING_SVTOOLS_HTML_font ); -#ifdef DBG_UTIL - m_bCheckFont = FALSE; +#if OSL_DEBUG_LEVEL > 0 + m_bCheckFont = sal_False; #endif } //----------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/ToolBoxHelper.cxx b/dbaccess/source/ui/misc/ToolBoxHelper.cxx index 43e5883b86db..4e9c5b6c565a 100644 --- a/dbaccess/source/ui/misc/ToolBoxHelper.cxx +++ b/dbaccess/source/ui/misc/ToolBoxHelper.cxx @@ -40,9 +40,8 @@ namespace dbaui { DBG_NAME(OToolBoxHelper) OToolBoxHelper::OToolBoxHelper() - : m_bIsHiContrast(sal_False) - ,m_nSymbolsSize(-1 ) - ,m_pToolBox(NULL) + : m_nSymbolsSize(-1 ) + , m_pToolBox(NULL) { DBG_CTOR(OToolBoxHelper,NULL); @@ -64,14 +63,11 @@ namespace dbaui if ( m_pToolBox ) { sal_Int16 nCurSymbolsSize = SvtMiscOptions().GetCurrentSymbolsSize(); - if ( nCurSymbolsSize != m_nSymbolsSize || - m_bIsHiContrast != m_pToolBox->GetSettings().GetStyleSettings().GetHighContrastMode() ) + if ( nCurSymbolsSize != m_nSymbolsSize ) { m_nSymbolsSize = nCurSymbolsSize; - m_bIsHiContrast = m_pToolBox->GetSettings().GetStyleSettings().GetHighContrastMode(); - - m_pToolBox->SetImageList( getImageList(m_nSymbolsSize,m_bIsHiContrast) ); + m_pToolBox->SetImageList( getImageList(m_nSymbolsSize) ); Size aTbOldSize = m_pToolBox->GetSizePixel(); adjustToolBoxSize(m_pToolBox); Size aTbNewSize = m_pToolBox->GetSizePixel(); @@ -117,7 +113,6 @@ namespace dbaui m_pToolBox = _pTB; if ( m_pToolBox ) { - // m_bIsHiContrast = m_pToolBox->GetSettings().GetStyleSettings().GetHighContrastMode(); ConfigOptionsChanged(NULL); if ( bFirstTime ) adjustToolBoxSize(m_pToolBox); diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 089025b511f7..a89699c002a3 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -178,7 +178,7 @@ SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XP SQLExceptionInfo aInfo; if ( !_xDataSource.is() ) { - OSL_ENSURE(0,"createConnection: coult not retrieve the data source!"); + OSL_FAIL("createConnection: coult not retrieve the data source!"); return aInfo; } @@ -192,7 +192,7 @@ SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XP } catch(Exception&) { - OSL_ENSURE(0,"createConnection: error while retrieving data source properties!"); + OSL_FAIL("createConnection: error while retrieving data source properties!"); } @@ -203,15 +203,14 @@ SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XP Reference<XCompletedConnection> xConnectionCompletion(_xDataSource, UNO_QUERY); if (!xConnectionCompletion.is()) { - OSL_ENSURE(0,"createConnection: missing an interface ... need an error message here!"); + OSL_FAIL("createConnection: missing an interface ... need an error message here!"); } else { // instantiate the default SDB interaction handler Reference< XInteractionHandler > xHandler(_rMF->createInstance(SERVICE_TASK_INTERACTION_HANDLER), UNO_QUERY); if (!xHandler.is()) { - OSL_ENSURE(sal_False, "createConnection: could not instantiate an interaction handler!"); - // ShowServiceNotAvailableError(NULL, String(SERVICE_TASK_INTERACTION_HANDLER), sal_True); + OSL_FAIL("createConnection: could not instantiate an interaction handler!"); // TODO: a real parent! } else @@ -231,9 +230,7 @@ SQLExceptionInfo createConnection( const Reference< ::com::sun::star::beans::XP catch(SQLContext& e) { aInfo = SQLExceptionInfo(e); } catch(SQLWarning& e) { aInfo = SQLExceptionInfo(e); } catch(SQLException& e) { aInfo = SQLExceptionInfo(e); } - catch(Exception&) { OSL_ENSURE(0,"SbaTableQueryBrowser::OnExpandEntry: could not connect - unknown exception!"); } - - // showError(aInfo); + catch(Exception&) { OSL_FAIL("SbaTableQueryBrowser::OnExpandEntry: could not connect - unknown exception!"); } return aInfo; } @@ -403,8 +400,7 @@ TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, && ( (_bAutoIncrement && aIter->second->bAutoIncrement) || !_bAutoIncrement ) ) { - OSL_ENSURE(sal_False, - ( ::rtl::OString("getTypeInfoFromType: assuming column type ") + OSL_FAIL(( ::rtl::OString("getTypeInfoFromType: assuming column type ") += ::rtl::OString(aIter->second->aTypeName.getStr(), aIter->second->aTypeName.getLength(), gsl_getSystemTextEncoding()) += ::rtl::OString("\" (expected type name ") += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding()) @@ -419,11 +415,6 @@ TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo, // -> drop the precision and the scale restriction, accept any type with the property // type id (nType) - //OSL_ENSURE(sal_False, - // ( ::rtl::OString("getTypeInfoFromType: did not find a matching type") - // += ::rtl::OString(" (expected type name: ") - // += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding()) - // += ::rtl::OString(")! Defaulting to the first matching type.")).getStr()); for(aIter = aPair.first; aIter != aPair.second; ++aIter) { // search the best matching type (now comparing the local names) @@ -511,8 +502,8 @@ void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo // Information for a single SQL type if(xRs.is()) { - static const ::rtl::OUString aB1 = ::rtl::OUString::createFromAscii(" [ "); - static const ::rtl::OUString aB2 = ::rtl::OUString::createFromAscii(" ]"); + static const ::rtl::OUString aB1(RTL_CONSTASCII_USTRINGPARAM(" [ ")); + static const ::rtl::OUString aB2(RTL_CONSTASCII_USTRINGPARAM(" ]")); Reference<XResultSetMetaData> xResultSetMetaData = Reference<XResultSetMetaDataSupplier>(xRs,UNO_QUERY)->getMetaData(); ::connectivity::ORowSetValue aValue; ::std::vector<sal_Int32> aTypes; @@ -804,7 +795,7 @@ sal_Int32 mapTextAllign(const SvxCellHorJustify& _eAlignment) case SVX_HOR_JUSTIFY_CENTER: nAlignment = ::com::sun::star::awt::TextAlign::CENTER; break; case SVX_HOR_JUSTIFY_RIGHT: nAlignment = ::com::sun::star::awt::TextAlign::RIGHT; break; default: - OSL_ENSURE(0,"Invalid TextAlign!"); + OSL_FAIL("Invalid TextAlign!"); } return nAlignment; } @@ -818,7 +809,7 @@ SvxCellHorJustify mapTextJustify(const sal_Int32& _nAlignment) case ::com::sun::star::awt::TextAlign::CENTER : eJustify = SVX_HOR_JUSTIFY_CENTER; break; case ::com::sun::star::awt::TextAlign::RIGHT : eJustify = SVX_HOR_JUSTIFY_RIGHT; break; default: - OSL_ENSURE(0,"Invalid TextAlign!"); + OSL_FAIL("Invalid TextAlign!"); } return eJustify; } @@ -846,7 +837,7 @@ float ConvertFontWeight( ::FontWeight eWeight ) else if( eWeight == WEIGHT_BLACK ) return ::com::sun::star::awt::FontWeight::BLACK; - OSL_ENSURE(0, "Unknown FontWeigth" ); + OSL_FAIL("Unknown FontWeigth" ); return ::com::sun::star::awt::FontWeight::DONTKNOW; } // ----------------------------------------------------------------------------- @@ -873,7 +864,7 @@ float ConvertFontWidth( ::FontWidth eWidth ) else if( eWidth == WIDTH_ULTRA_EXPANDED ) return ::com::sun::star::awt::FontWidth::ULTRAEXPANDED; - OSL_ENSURE(0, "Unknown FontWidth" ); + OSL_FAIL("Unknown FontWidth" ); return ::com::sun::star::awt::FontWidth::DONTKNOW; } // ----------------------------------------------------------------------------- @@ -947,7 +938,7 @@ sal_Bool callColumnFormatDialog(Window* _pParent, sal_Bool _bHasFormat) { sal_Bool bRet = sal_False; - // the allowed format changes depend of the type of the field ... + // the allowed format changes depending on the type of the field ... _nFlags = TP_ATTR_ALIGN; if (_bHasFormat) @@ -1085,7 +1076,7 @@ sal_Bool appendToFilter(const Reference<XConnection>& _xConnection, xProp->getPropertyValue(PROPERTY_TABLEFILTER) >>= aFilter; // first check if we have something like SCHEMA.% sal_Bool bHasToInsert = sal_True; - static ::rtl::OUString sPattern = ::rtl::OUString::createFromAscii("%"); + static ::rtl::OUString sPattern(RTL_CONSTASCII_USTRINGPARAM("%")); const ::rtl::OUString* pBegin = aFilter.getConstArray(); const ::rtl::OUString* pEnd = pBegin + aFilter.getLength(); for (;pBegin != pEnd; ++pBegin) @@ -1150,22 +1141,6 @@ void adjustToolBoxSize(ToolBox* _pToolBox) } } // ----------------------------------------------------------------------------- -sal_Bool isHiContrast(Window* _pWindow) -{ - OSL_ENSURE(_pWindow,"Window must be not null!"); - Window* pIter = _pWindow; - // while( pIter && pIter->GetBackground().GetColor().GetColor() == COL_TRANSPARENT ) - while( pIter ) - { - if ( pIter->GetBackground().GetColor().GetColor() == COL_TRANSPARENT ) - pIter = pIter->GetParent(); - else - break; - } - return pIter && pIter->GetSettings().GetStyleSettings().GetHighContrastMode(); -} - -// ----------------------------------------------------------------------------- void adjustBrowseBoxColumnWidth( ::svt::EditBrowseBox* _pBox, sal_uInt16 _nColId ) { sal_Int32 nColSize = -1; @@ -1231,7 +1206,7 @@ void fillAutoIncrementValue(const Reference<XPropertySet>& _xDatasource, pValue->Value >>= _rsAutoIncrementValue; pValue =::std::find_if(aInfo.getConstArray(), aInfo.getConstArray() + aInfo.getLength(), - ::std::bind2nd(TPropertyValueEqualFunctor(),::rtl::OUString::createFromAscii("IsAutoRetrievingEnabled") )); + ::std::bind2nd(TPropertyValueEqualFunctor(),::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAutoRetrievingEnabled")) )); if ( pValue && pValue != (aInfo.getConstArray() + aInfo.getLength()) ) pValue->Value >>= _rAutoIncrementValueEnabled; } @@ -1306,7 +1281,7 @@ namespace { ::ucbhelper::Content aCnt( INetURLObject( _rURL ).GetMainURL( INetURLObject::NO_DECODE ), Reference< ::com::sun::star::ucb::XCommandEnvironment > () ); - if ( ( aCnt.getPropertyValue( ::rtl::OUString::createFromAscii( "AnchorName" ) ) >>= sAnchor ) ) + if ( ( aCnt.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorName")) ) >>= sAnchor ) ) { if ( sAnchor.getLength() > 0 ) @@ -1330,13 +1305,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; @@ -1464,18 +1439,18 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType break; default: ; - } // switch(_nDataType) + } if ( !pTypeInfo ) { ::rtl::OUString sCreate(RTL_CONSTASCII_USTRINGPARAM("x")),sTypeName; sal_Bool bForce = sal_True; pTypeInfo = ::dbaui::getTypeInfoFromType(_rTypeInfo,DataType::VARCHAR,sTypeName,sCreate,50,0,sal_False,bForce); - } // if ( !pTypeInfo ) + } OSL_ENSURE(pTypeInfo,"Wrong DataType supplied!"); 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 905846ba9892..b0df6f61f1b5 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); @@ -134,7 +134,7 @@ IMPL_LINK( OCopyTable, AppendDataClickHdl, Button*, /*pButton*/ ) SetAppendDataRadio(); return 0; } -//--------dyf ADD + void OCopyTable::SetAppendDataRadio() { m_pParent->EnableButton(OCopyTableWizard::WIZARD_NEXT,sal_True); @@ -144,7 +144,6 @@ void OCopyTable::SetAppendDataRadio() m_pParent->setOperation(CopyTableOperation::AppendData); } -//--------add end //------------------------------------------------------------------------ IMPL_LINK( OCopyTable, RadioChangeHdl, Button*, pButton ) { @@ -264,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()); @@ -305,7 +304,6 @@ sal_Bool OCopyTable::checkAppendData() xTables->getByName( m_edTableName.GetText() ) >>= xTable; ObjectCopySource aTableCopySource( m_pParent->m_xDestConnection, xTable ); m_pParent->loadData( aTableCopySource, m_pParent->m_vDestColumns, m_pParent->m_aDestVec ); - // #90027# const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector(); ODatabaseExport::TColumnVector::const_iterator aDestIter = pDestColumns->begin(); ODatabaseExport::TColumnVector::const_iterator aDestEnd = pDestColumns->end(); @@ -351,7 +349,6 @@ void OCopyTable::setCreatePrimaryKey( bool _bDoCreate, const ::rtl::OUString& _r } // ----------------------------------------------------------------------------- -//---dyf add 2006/7/10 void OCopyTable::setCreateStyleAction() { // reselect the last action before @@ -382,6 +379,5 @@ void OCopyTable::setCreateStyleAction() } } } -//---add end /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 11095d00f660..07affc1c2015 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -31,7 +31,7 @@ #include "WColumnSelect.hxx" #include "dbu_misc.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "WizardPages.hrc" #include "WCopyTable.hxx" #include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp> @@ -43,6 +43,7 @@ #include <com/sun/star/sdb/application/CopyTableOperation.hpp> #include "dbustrings.hrc" #include <functional> +#include <o3tl/compat_functional.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -125,8 +126,6 @@ void OWizColumnSelect::Reset() m_lbOrgColumnNames.SetEntryData(nPos,(*aIter)->second); } - // m_pParent->clearDestColumns(); - if(m_lbOrgColumnNames.GetEntryCount()) m_lbOrgColumnNames.SelectEntryPos(0); @@ -148,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); } @@ -161,7 +160,6 @@ sal_Bool OWizColumnSelect::LeavePage() { DBG_CHKTHIS(OWizColumnSelect,NULL); - // m_pParent->getColumns()->clear(); m_pParent->clearDestColumns(); for(sal_uInt16 i=0 ; i< m_lbNewColumnNames.GetEntryCount();++i) @@ -339,12 +337,12 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, { // find the new column in the dest name mapping to obtain the old column OCopyTableWizard::TNameMapping::iterator aIter = ::std::find_if(m_pParent->m_mNameMapping.begin(),m_pParent->m_mNameMapping.end(), - ::std::compose1( + ::o3tl::compose1( ::std::bind2nd(_aCase, _sColumnName), - ::std::select2nd<OCopyTableWizard::TNameMapping::value_type>()) + ::o3tl::select2nd<OCopyTableWizard::TNameMapping::value_type>()) ); - DBG_ASSERT(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); + OSL_ENSURE(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); if ( aIter == m_pParent->m_mNameMapping.end() ) return; // do nothing const ODatabaseExport::TColumns* pSrcColumns = m_pParent->getSourceColumns(); @@ -357,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); } @@ -368,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. @@ -389,12 +387,12 @@ USHORT OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, { // find the new column in the dest name mapping to obtain the old column OCopyTableWizard::TNameMapping::iterator aIter = ::std::find_if(m_pParent->m_mNameMapping.begin(),m_pParent->m_mNameMapping.end(), - ::std::compose1( + ::o3tl::compose1( ::std::bind2nd(_aCase, sColumnString), - ::std::select2nd<OCopyTableWizard::TNameMapping::value_type>()) + ::o3tl::select2nd<OCopyTableWizard::TNameMapping::value_type>()) ); - DBG_ASSERT(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); + OSL_ENSURE(aIter != m_pParent->m_mNameMapping.end(),"Column must be defined"); const ODatabaseExport::TColumns* pSrcColumns = m_pParent->getSourceColumns(); ODatabaseExport::TColumns::const_iterator aSrcIter = pSrcColumns->find((*aIter).first); if ( aSrcIter != pSrcColumns->end() ) diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index 4ab963777312..ceb8f6d6745e 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -75,6 +75,7 @@ #include <vcl/waitobj.hxx> #include <functional> +#include <o3tl/compat_functional.hxx> using namespace ::dbaui; using namespace ::com::sun::star::uno; @@ -152,7 +153,7 @@ bool ObjectCopySource::isView() const { ::rtl::OUString sObjectType; OSL_VERIFY( m_xObject->getPropertyValue( PROPERTY_TYPE ) >>= sObjectType ); - bIsView = sObjectType.equalsAscii( "VIEW" ); + bIsView = sObjectType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VIEW" ) ); } } catch( const Exception& ) @@ -330,7 +331,7 @@ bool NamedTableCopySource::isView() const { DBG_UNHANDLED_EXCEPTION(); } - return sTableType.equalsAscii( "VIEW" ); + return sTableType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "VIEW" ) ); } //------------------------------------------------------------------------ @@ -479,14 +480,14 @@ const DummyCopySource& DummyCopySource::Instance() //------------------------------------------------------------------------ ::rtl::OUString DummyCopySource::getQualifiedObjectName() const { - OSL_ENSURE( false, "DummyCopySource::getQualifiedObjectName: not to be called!" ); + OSL_FAIL( "DummyCopySource::getQualifiedObjectName: not to be called!" ); return ::rtl::OUString(); } //------------------------------------------------------------------------ bool DummyCopySource::isView() const { - OSL_ENSURE( false, "DummyCopySource::isView: not to be called!" ); + OSL_FAIL( "DummyCopySource::isView: not to be called!" ); return false; } @@ -508,27 +509,27 @@ Sequence< ::rtl::OUString > DummyCopySource::getColumnNames() const //------------------------------------------------------------------------ Sequence< ::rtl::OUString > DummyCopySource::getPrimaryKeyColumnNames() const { - OSL_ENSURE( false, "DummyCopySource::getPrimaryKeyColumnNames: not to be called!" ); + OSL_FAIL( "DummyCopySource::getPrimaryKeyColumnNames: not to be called!" ); return Sequence< ::rtl::OUString >(); } //------------------------------------------------------------------------ OFieldDescription* DummyCopySource::createFieldDescription( const ::rtl::OUString& /*_rColumnName*/ ) const { - OSL_ENSURE( false, "DummyCopySource::createFieldDescription: not to be called!" ); + OSL_FAIL( "DummyCopySource::createFieldDescription: not to be called!" ); return NULL; } //------------------------------------------------------------------------ ::rtl::OUString DummyCopySource::getSelectStatement() const { - OSL_ENSURE( false, "DummyCopySource::getSelectStatement: not to be called!" ); + OSL_FAIL( "DummyCopySource::getSelectStatement: not to be called!" ); return ::rtl::OUString(); } //------------------------------------------------------------------------ ::utl::SharedUNOComponent< XPreparedStatement > DummyCopySource::getPreparedSelectStatement() const { - OSL_ENSURE( false, "DummyCopySource::getPreparedSelectStatement: not to be called!" ); + OSL_FAIL( "DummyCopySource::getPreparedSelectStatement: not to be called!" ); return ::utl::SharedUNOComponent< XPreparedStatement >(); } @@ -616,8 +617,7 @@ OCopyTableWizard::OCopyTableWizard( Window * pParent, const ::rtl::OUString& _rD impl_loadSourceData(); bool bAllowViews = true; - // if the source is a, don't allow creating views #100644# (oj) - // (fs: Hmm? A SELECT * FROM <view> would be created, where #100644# claims this is nonsense. Why? + // if the source is a, don't allow creating views if ( m_rSourceObject.isView() ) bAllowViews = false; // no views if the target connection does not support creating them @@ -931,7 +931,7 @@ IMPL_LINK( OCopyTableWizard, ImplOKHdl, OKButton*, EMPTYARG ) if ( supportsPrimaryKey() ) { ODatabaseExport::TColumns::iterator aFind = ::std::find_if(m_vDestColumns.begin(),m_vDestColumns.end() - ,::std::compose1(::std::mem_fun(&OFieldDescription::IsPrimaryKey),::std::select2nd<ODatabaseExport::TColumns::value_type>())); + ,::o3tl::compose1(::std::mem_fun(&OFieldDescription::IsPrimaryKey),::o3tl::select2nd<ODatabaseExport::TColumns::value_type>())); if ( aFind == m_vDestColumns.end() && m_xInteractionHandler.is() ) { @@ -974,7 +974,7 @@ IMPL_LINK( OCopyTableWizard, ImplOKHdl, OKButton*, EMPTYARG ) break; default: { - OSL_ENSURE(sal_False, "OCopyTableWizard::ImplOKHdl: invalid creation style!"); + OSL_FAIL("OCopyTableWizard::ImplOKHdl: invalid creation style!"); } } @@ -1025,7 +1025,7 @@ IMPL_LINK( OCopyTableWizard, ImplActivateHdl, WizardDialog*, EMPTYARG ) void OCopyTableWizard::CheckButtons() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OCopyTableWizard::CheckButtons" ); - if(GetCurLevel() == 0) // erste Seite hat kein PrevButton + if(GetCurLevel() == 0) // the first page has no back button { if(m_nPageCount > 1) m_pbNext.Enable(sal_True); @@ -1034,7 +1034,7 @@ void OCopyTableWizard::CheckButtons() m_pbPrev.Enable(sal_False); } - else if(GetCurLevel() == m_nPageCount-1) // letzte Seite hat keinen Next Button + else if(GetCurLevel() == m_nPageCount-1) // the last page has no next button { m_pbNext.Enable(sal_False); m_pbPrev.Enable(sal_True); @@ -1042,14 +1042,13 @@ void OCopyTableWizard::CheckButtons() else { m_pbPrev.Enable(sal_True); - // next has already his state + // next already has its state } } // ----------------------------------------------------------------------- void OCopyTableWizard::EnableButton(Wizard_Button_Style eStyle,sal_Bool bEnable) { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OCopyTableWizard::EnableButton" ); -// CheckButtons(); Button* pButton; if(eStyle == WIZARD_NEXT) pButton = &m_pbNext; @@ -1230,7 +1229,7 @@ void OCopyTableWizard::appendColumns( Reference<XColumnsSupplier>& _rxColSup, co } else { - OSL_ENSURE(sal_False, "OCopyTableWizard::appendColumns: invalid field name!"); + OSL_FAIL("OCopyTableWizard::appendColumns: invalid field name!"); } } @@ -1377,8 +1376,8 @@ Reference< XPropertySet > OCopyTableWizard::createTable() ODatabaseExport::TPositions::iterator aPosFind = ::std::find_if( m_vColumnPos.begin(), m_vColumnPos.end(), - ::std::compose1( ::std::bind2nd( ::std::equal_to< sal_Int32 >(), nPos ), - ::std::select1st< ODatabaseExport::TPositions::value_type >() + ::o3tl::compose1( ::std::bind2nd( ::std::equal_to< sal_Int32 >(), nPos ), + ::o3tl::select1st< ODatabaseExport::TPositions::value_type >() ) ); diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 20a4177e3e3a..8f3222181146 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "WNameMatch.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "FieldDescriptions.hxx" #include "WCopyTable.hxx" #include "dbaccess_helpid.hrc" @@ -73,20 +73,14 @@ 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"); m_sDestText = m_FT_TABLE_RIGHT.GetText(); m_sDestText.AppendAscii("\n"); - // set hiContrast - m_ibColumn_up.SetModeImage(ModuleRes(IMG_SORTUP_H),BMP_COLOR_HIGHCONTRAST); - m_ibColumn_down.SetModeImage(ModuleRes(IMG_SORTDOWN_H),BMP_COLOR_HIGHCONTRAST); - m_ibColumn_up_right.SetModeImage(ModuleRes(IMG_SORTUP_H),BMP_COLOR_HIGHCONTRAST); - m_ibColumn_down_right.SetModeImage(ModuleRes(IMG_SORTDOWN_H),BMP_COLOR_HIGHCONTRAST); - FreeResource(); } // ----------------------------------------------------------------------- @@ -111,7 +105,6 @@ void OWizNameMatching::Reset() m_bFirstTime = sal_False; } - // m_CTRL_LEFT.Clear(); } // ----------------------------------------------------------------------- void OWizNameMatching::ActivatePage( ) @@ -162,7 +155,7 @@ sal_Bool OWizNameMatching::LeavePage() while(pLeftEntry && pRightEntry) { OFieldDescription* pSrcField = static_cast<OFieldDescription*>(pLeftEntry->GetUserData()); - DBG_ASSERT(pSrcField,"OWizNameMatching: OColumn can not be null!"); + OSL_ENSURE(pSrcField,"OWizNameMatching: OColumn can not be null!"); ODatabaseExport::TColumnVector::const_iterator aSrcIter = pSrcColumns->begin(); ODatabaseExport::TColumnVector::const_iterator aSrcEnd = pSrcColumns->end(); @@ -170,11 +163,10 @@ sal_Bool OWizNameMatching::LeavePage() ; const sal_Int32 nPos = ::std::distance(pSrcColumns->begin(),aSrcIter); - // sal_Int32 nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pLeftEntry); if(m_CTRL_LEFT.GetCheckButtonState(pLeftEntry) == SV_BUTTON_CHECKED) { OFieldDescription* pDestField = static_cast<OFieldDescription*>(pRightEntry->GetUserData()); - DBG_ASSERT(pDestField,"OWizNameMatching: OColumn can not be null!"); + OSL_ENSURE(pDestField,"OWizNameMatching: OColumn can not be null!"); const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector(); ODatabaseExport::TColumnVector::const_iterator aDestIter = pDestColumns->begin(); ODatabaseExport::TColumnVector::const_iterator aDestEnd = pDestColumns->end(); @@ -228,7 +220,6 @@ IMPL_LINK( OWizNameMatching, ButtonClickHdl, Button *, pButton ) if(pButton == &m_ibColumn_down && (nThumbPos+nVisibleSize+1) < nPos) { m_CTRL_LEFT.GetVScroll()->DoScrollAction(SCROLL_LINEDOWN); - // m_CTRL_LEFT.MakeVisible(pEntry,sal_True); } TableListClickHdl(&m_CTRL_LEFT); @@ -267,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)) { @@ -276,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); @@ -301,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)) { @@ -310,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); @@ -357,18 +348,7 @@ public: } virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); - //virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData); }; - - - -//------------------------------------------------------------------------ -/* -void OColumnString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* pViewData) -{ - SvLBoxString::InitViewData(pView,pEntry,pViewData); -} -*/ //------------------------------------------------------------------------ void OColumnString::Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 /*nFlags*/, SvLBoxEntry* /*pEntry*/ ) { @@ -386,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 efc94d56524b..2991ba00bf32 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -31,8 +31,8 @@ #include "WTypeSelect.hxx" #include "WizardPages.hrc" #include "dbustrings.hrc" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "FieldDescriptions.hxx" #include "WCopyTable.hxx" #include "dbaccess_helpid.hrc" @@ -43,13 +43,14 @@ #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; using namespace ::com::sun::star::container; using namespace ::com::sun::star::util; using namespace ::com::sun::star::sdbc; -// using namespace ::com::sun::star::sdbcx; //======================================================================== // OWizTypeSelectControl @@ -98,7 +99,7 @@ void OWizTypeSelectControl::DeactivateAggregate( EControlType eType ) // ----------------------------------------------------------------------- void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) { - DBG_ASSERT(nRow == -1,"nRow muss -1 sein!"); + OSL_ENSURE(nRow == -1,"nRow muss -1 sein!"); (void)nRow; MultiListBox &aListBox = ((OWizTypeSelect*)GetParent())->m_lbColumnNames; @@ -129,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); @@ -246,7 +247,7 @@ OWizTypeSelect::OWizTypeSelect( Window* pParent, SvStream* _pStream ) DBG_CTOR(OWizTypeSelect,NULL); m_lbColumnNames.SetSelectHdl(LINK(this,OWizTypeSelect,ColumnSelectHdl)); - ModuleRes aModuleRes(isHiContrast(&m_lbColumnNames) ? IMG_JOINS_H : IMG_JOINS); + ModuleRes aModuleRes(IMG_JOINS); ImageList aImageList(aModuleRes); m_imgPKey = aImageList.GetImage(IMG_PRIMARY_KEY); @@ -331,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 9871c3f7d810..360ab879a102 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,10 +68,10 @@ String STR_WIZ_NAME_MATCHING_TITEL ModalDialog WIZ_RTFCOPYTABLE { + HelpID = "dbaccess:ModalDialog:WIZ_RTFCOPYTABLE"; Text [ en-US ] = "Copy RTF Table" ; - OutputSize = TRUE ; SVLook = TRUE ; Moveable = TRUE ; @@ -91,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>"; @@ -123,13 +126,13 @@ TabPage TAB_WIZ_COLUMN_SELECT FixedLine FL_COLUMN_SELECT { - Pos = MAP_APPFONT ( 6 , 3 ) ; - Size = MAP_APPFONT ( WINDOW_SIZE_X - 12 , 8 ) ; - Text [ en-US ] = "Existing columns" ; + Pos = MAP_APPFONT ( 6 , 3 ) ; + Size = MAP_APPFONT ( WINDOW_SIZE_X - 12 , 8 ) ; + Text [ en-US ] = "Existing columns" ; }; - 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 ) ; @@ -142,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 ; @@ -149,7 +153,7 @@ TabPage TAB_WIZ_COLUMN_SELECT { ImageBitmap = Bitmap { - File = "one_right.bmp" ; + File = "one_right.png" ; }; MaskColor = Color { @@ -161,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; @@ -169,7 +174,7 @@ TabPage TAB_WIZ_COLUMN_SELECT { ImageBitmap = Bitmap { - File = "all_right.bmp" ; + File = "all_right.png" ; }; MaskColor = Color { @@ -181,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 ; @@ -188,7 +194,7 @@ TabPage TAB_WIZ_COLUMN_SELECT { ImageBitmap = Bitmap { - File = "one_left.bmp" ; + File = "one_left.png1" ; }; MaskColor = Color { @@ -200,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 ; @@ -207,7 +214,7 @@ TabPage TAB_WIZ_COLUMN_SELECT { ImageBitmap = Bitmap { - File = "all_left.bmp" ; + File = "all_left.png" ; }; MaskColor = Color { @@ -220,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 ) ; @@ -245,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 ) ; @@ -264,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; @@ -286,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 ) ; @@ -294,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 ; @@ -308,17 +320,19 @@ 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" ; }; }; }; + //================================================================== // TAB_WIZ_NAME_MATCHING //================================================================== TabPage TAB_WIZ_NAME_MATCHING { + HelpID = "dbaccess:TabPage:TAB_WIZ_NAME_MATCHING"; SVLook = TRUE ; Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; @@ -360,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; @@ -368,7 +383,7 @@ TabPage TAB_WIZ_NAME_MATCHING { ImageBitmap = Bitmap { - File = "sortup.bmp" ; + File = "sortup.png" ; }; MaskColor = Color { @@ -380,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; @@ -387,7 +403,7 @@ TabPage TAB_WIZ_NAME_MATCHING { ImageBitmap = Bitmap { - File = "sortdown.bmp" ; + File = "sortdown.png" ; }; MaskColor = Color { @@ -399,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; @@ -407,7 +424,7 @@ TabPage TAB_WIZ_NAME_MATCHING { ImageBitmap = Bitmap { - File = "sortup.bmp" ; + File = "sortup.png" ; }; MaskColor = Color { @@ -419,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 ; @@ -426,7 +444,7 @@ TabPage TAB_WIZ_NAME_MATCHING { ImageBitmap = Bitmap { - File = "sortdown.bmp" ; + File = "sortdown.png" ; }; MaskColor = Color { @@ -439,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 ; @@ -447,12 +466,14 @@ 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 ; Text [ en-US ] = "Non~e" ; }; }; + TabPage TAB_WIZ_COPYTABLE { SVLook = 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 ; @@ -562,69 +590,3 @@ String STR_INVALID_TABLE_NAME_LENGTH { Text [ en-US ] = "Please change the table name. It is too long."; }; - -Image IMG_SORTUP_H -{ - ImageBitmap = Bitmap - { - File = "sortup_h.bmp" ; - }; - MaskColor = Color - { - Red = 0xFFFF ; - Green = 0x0000 ; - Blue = 0xFFFF ; - }; -}; - -Image IMG_SORTDOWN_H -{ - ImageBitmap = Bitmap - { - File = "sortdown_h.bmp" ; - }; - MaskColor = Color - { - Red = 0xFFFF ; - Green = 0x0000 ; - Blue = 0xFFFF ; - }; -}; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/misc/charsets.cxx b/dbaccess/source/ui/misc/charsets.cxx index 2ce044be43c9..425aef75db87 100644 --- a/dbaccess/source/ui/misc/charsets.cxx +++ b/dbaccess/source/ui/misc/charsets.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "charsets.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbu_misc.hrc" #include <rtl/tencinfo.h> #include <tools/rcid.h> @@ -122,7 +122,7 @@ namespace dbaui :CharsetDisplayDerefHelper_Base(_rBase) ,m_sDisplayName(_rDisplayName) { - DBG_ASSERT( m_sDisplayName.getLength(), "CharsetDisplayDerefHelper::CharsetDisplayDerefHelper: invalid display name!" ); + OSL_ENSURE( m_sDisplayName.getLength(), "CharsetDisplayDerefHelper::CharsetDisplayDerefHelper: invalid display name!" ); } //========================================================================= @@ -133,7 +133,7 @@ namespace dbaui :m_pContainer(_pContainer) ,m_aPosition(_rPosition) { - DBG_ASSERT(m_pContainer, "OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator : invalid container!"); + OSL_ENSURE(m_pContainer, "OCharsetDisplay::ExtendedCharsetIterator::ExtendedCharsetIterator : invalid container!"); } //------------------------------------------------------------------------- @@ -146,7 +146,7 @@ namespace dbaui //------------------------------------------------------------------------- CharsetDisplayDerefHelper OCharsetDisplay::ExtendedCharsetIterator::operator*() const { - DBG_ASSERT( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator* : invalid position!"); + OSL_ENSURE( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator* : invalid position!"); rtl_TextEncoding eEncoding = (*m_aPosition).getEncoding(); return CharsetDisplayDerefHelper( @@ -158,7 +158,7 @@ namespace dbaui //------------------------------------------------------------------------- const OCharsetDisplay::ExtendedCharsetIterator& OCharsetDisplay::ExtendedCharsetIterator::operator++() { - DBG_ASSERT( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator++ : invalid position!"); + OSL_ENSURE( m_aPosition != m_pContainer->OCharsetDisplay_Base::end(), "OCharsetDisplay::ExtendedCharsetIterator::operator++ : invalid position!"); if ( m_aPosition != m_pContainer->OCharsetDisplay_Base::end() ) ++m_aPosition; return *this; @@ -167,7 +167,7 @@ namespace dbaui //------------------------------------------------------------------------- const OCharsetDisplay::ExtendedCharsetIterator& OCharsetDisplay::ExtendedCharsetIterator::operator--() { - DBG_ASSERT( m_aPosition != m_pContainer->OCharsetDisplay_Base::begin(), "OCharsetDisplay::ExtendedCharsetIterator::operator-- : invalid position!"); + OSL_ENSURE( m_aPosition != m_pContainer->OCharsetDisplay_Base::begin(), "OCharsetDisplay::ExtendedCharsetIterator::operator-- : invalid position!"); if ( m_aPosition != m_pContainer->OCharsetDisplay_Base::begin() ) --m_aPosition; return *this; diff --git a/dbaccess/source/ui/misc/controllerframe.cxx b/dbaccess/source/ui/misc/controllerframe.cxx index 23a336d76266..54d612329400 100644 --- a/dbaccess/source/ui/misc/controllerframe.cxx +++ b/dbaccess/source/ui/misc/controllerframe.cxx @@ -236,7 +236,7 @@ namespace dbaui { if ( _rData.m_xDocEventBroadcaster.is() ) { - ::rtl::OUString sEventName( ::rtl::OUString::createFromAscii( _bActive ? "OnFocus" : "OnUnfocus" ) ); + ::rtl::OUString sEventName = _bActive ? rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnFocus")) : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("OnUnfocus")); Reference< XController2 > xController( _rData.m_rController.getXController(), UNO_QUERY_THROW ); _rData.m_xDocEventBroadcaster->notifyDocumentEvent( sEventName, xController, Any() ); } @@ -295,11 +295,6 @@ namespace dbaui const Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); ENSURE_OR_THROW( pContainerWindow, "no Window implementation for the frame's container window!" ); - /*const Window* pContainerParentWindow = pContainerWindow->GetParent(); - if ( pContainerParentWindow && ( pContainerParentWindow->GetType() == WINDOW_BORDERWINDOW ) ) - pContainerParentWindow = pContainerParentWindow->GetParent(); - m_pData->m_bIsTopLevelDocumentWindow = ( pContainerParentWindow == NULL );*/ - m_pData->m_bIsTopLevelDocumentWindow = ( pContainerWindow->GetExtendedStyle() & WB_EXT_DOCUMENT ) != 0; } diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 9e0e5d352cc4..967f9752eb4d 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -131,16 +131,16 @@ namespace dbaui // if we have no externally provided frame, create one if ( !m_xFrameLoader.is() ) { - Reference< XSingleServiceFactory > xFact(m_xORB->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.TaskCreator")), UNO_QUERY_THROW); + Reference< XSingleServiceFactory > xFact(m_xORB->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.TaskCreator"))), UNO_QUERY_THROW); Sequence< Any > lArgs(2); NamedValue aProp; sal_Int32 nArg = 0; - aProp.Name = ::rtl::OUString::createFromAscii("ParentFrame"); + aProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentFrame")); aProp.Value <<= m_xParentFrame; lArgs[nArg++] <<= aProp; - aProp.Name = ::rtl::OUString::createFromAscii("TopWindow"); + aProp.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TopWindow")); aProp.Value <<= sal_True; lArgs[nArg++] <<= aProp; diff --git a/dbaccess/source/ui/misc/dbaundomanager.cxx b/dbaccess/source/ui/misc/dbaundomanager.cxx new file mode 100644 index 000000000000..83f55e0cbc5e --- /dev/null +++ b/dbaccess/source/ui/misc/dbaundomanager.cxx @@ -0,0 +1,394 @@ +/************************************************************************* + * 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 <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) + { + SolarMutexGuard aSolarGuard; + // (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) + { + SolarMutexGuard aSolarGuard; + // (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 000000000000..eb1b34710ff8 --- /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 552a076147d5..974b36e68005 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -61,7 +61,6 @@ String STR_MISSING_TABLES_XDROP String STR_BUTTON_TEXT_ALL { Text [ en-US ] = "~All"; - }; String STR_UNDO_COLON @@ -93,8 +92,9 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS { Text [ en-US ] = "The name '$#$' already exists.\nPlease enter another name." ; }; + 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 8bb505e5332f..945489cf7b62 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; @@ -151,9 +152,9 @@ namespace dbaui { ::rtl::OUString sAuth; aMetaData.get("Authentication") >>= sAuth; - if ( sAuth.equalsAscii("UserPassword") ) + if ( sAuth.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UserPassword")) ) aInit = AuthUserPwd; - else if ( sAuth.equalsAscii("Password") ) + else if ( sAuth.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Password")) ) aInit = AuthPwd; } s_aSupport.insert(Supported::value_type(*pIter,aInit)); diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx index 8147e2bd242a..7f8522ee9070 100644 --- a/dbaccess/source/ui/misc/imageprovider.cxx +++ b/dbaccess/source/ui/misc/imageprovider.cxx @@ -82,15 +82,12 @@ namespace dbaui { //................................................................ static void lcl_getConnectionProvidedTableIcon_nothrow( const ImageProvider_Data& _rData, - const ::rtl::OUString& _rName, Reference< XGraphic >& _out_rxGraphic, Reference< XGraphic >& _out_rxGraphicHC ) + const ::rtl::OUString& _rName, Reference< XGraphic >& _out_rxGraphic ) { try { if ( _rData.xTableUI.is() ) - { _out_rxGraphic = _rData.xTableUI->getTableIcon( _rName, GraphicColorMode::NORMAL ); - _out_rxGraphicHC = _rData.xTableUI->getTableIcon( _rName, GraphicColorMode::HIGH_CONTRAST ); - } } catch( const Exception& ) { @@ -100,21 +97,19 @@ namespace dbaui //................................................................ static void lcl_getTableImageResourceID_nothrow( const ImageProvider_Data& _rData, const ::rtl::OUString& _rName, - USHORT& _out_rResourceID, USHORT& _out_rResourceID_HC ) + sal_uInt16& _out_rResourceID) { - _out_rResourceID = _out_rResourceID_HC = 0; + _out_rResourceID = 0; try { bool bIsView = _rData.xViews.is() && _rData.xViews->hasByName( _rName ); if ( bIsView ) { _out_rResourceID = VIEW_TREE_ICON; - _out_rResourceID_HC = VIEW_TREE_ICON_SCH; } else { _out_rResourceID = TABLE_TREE_ICON; - _out_rResourceID_HC = TABLE_TREE_ICON_SCH; } } catch( const Exception& ) @@ -152,95 +147,88 @@ namespace dbaui } //-------------------------------------------------------------------- - void ImageProvider::getImages( const String& _rName, const sal_Int32 _nDatabaseObjectType, Image& _out_rImage, Image& _out_rImageHC ) + void ImageProvider::getImages( const String& _rName, const sal_Int32 _nDatabaseObjectType, Image& _out_rImage ) { if ( _nDatabaseObjectType != DatabaseObject::TABLE ) { // for types other than tables, the icon does not depend on the concrete object - _out_rImage = getDefaultImage( _nDatabaseObjectType, false ); - _out_rImageHC = getDefaultImage( _nDatabaseObjectType, true ); + _out_rImage = getDefaultImage( _nDatabaseObjectType ); } else { // check whether the connection can give us an icon Reference< XGraphic > xGraphic; - Reference< XGraphic > xGraphicHC; - lcl_getConnectionProvidedTableIcon_nothrow( *m_pData, _rName, xGraphic, xGraphicHC ); + lcl_getConnectionProvidedTableIcon_nothrow( *m_pData, _rName, xGraphic ); if ( xGraphic.is() ) _out_rImage = Image( xGraphic ); - if ( xGraphicHC.is() ) - _out_rImageHC = Image( xGraphicHC ); - if ( !_out_rImage || !_out_rImageHC ) + if ( !_out_rImage ) { // no -> determine by type - USHORT nImageResourceID = 0; - USHORT nImageResourceID_HC = 0; - lcl_getTableImageResourceID_nothrow( *m_pData, _rName, nImageResourceID, nImageResourceID_HC ); + sal_uInt16 nImageResourceID = 0; + lcl_getTableImageResourceID_nothrow( *m_pData, _rName, nImageResourceID ); if ( nImageResourceID && !_out_rImage ) _out_rImage = Image( ModuleRes( nImageResourceID ) ); - if ( nImageResourceID_HC && !_out_rImageHC ) - _out_rImageHC = Image( ModuleRes( nImageResourceID_HC ) ); } } } //-------------------------------------------------------------------- - Image ImageProvider::getDefaultImage( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) + Image ImageProvider::getDefaultImage( sal_Int32 _nDatabaseObjectType ) { Image aObjectImage; - USHORT nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType, _bHighContrast ) ); + sal_uInt16 nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType) ); if ( nImageResourceID ) aObjectImage = Image( ModuleRes( nImageResourceID ) ); return aObjectImage; } //-------------------------------------------------------------------- - USHORT ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) + sal_uInt16 ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: - nImageResourceID = _bHighContrast ? QUERY_TREE_ICON_SCH : QUERY_TREE_ICON; + nImageResourceID = QUERY_TREE_ICON; break; case DatabaseObject::FORM: - nImageResourceID = _bHighContrast ? FORM_TREE_ICON_SCH : FORM_TREE_ICON; + nImageResourceID = FORM_TREE_ICON; break; case DatabaseObject::REPORT: - nImageResourceID = _bHighContrast ? REPORT_TREE_ICON_SCH : REPORT_TREE_ICON; + nImageResourceID = REPORT_TREE_ICON; break; case DatabaseObject::TABLE: - nImageResourceID = _bHighContrast ? TABLE_TREE_ICON_SCH : TABLE_TREE_ICON; + nImageResourceID = TABLE_TREE_ICON; break; default: - OSL_ENSURE( false, "ImageProvider::getDefaultImage: invalid database object type!" ); + OSL_FAIL( "ImageProvider::getDefaultImage: invalid database object type!" ); break; } return nImageResourceID; } //-------------------------------------------------------------------- - Image ImageProvider::getFolderImage( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) + Image ImageProvider::getFolderImage( sal_Int32 _nDatabaseObjectType ) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: - nImageResourceID = _bHighContrast ? QUERYFOLDER_TREE_ICON_SCH : QUERYFOLDER_TREE_ICON; + nImageResourceID = QUERYFOLDER_TREE_ICON; break; case DatabaseObject::FORM: - nImageResourceID = _bHighContrast ? FORMFOLDER_TREE_ICON_SCH : FORMFOLDER_TREE_ICON; + nImageResourceID = FORMFOLDER_TREE_ICON; break; case DatabaseObject::REPORT: - nImageResourceID = _bHighContrast ? REPORTFOLDER_TREE_ICON_SCH : REPORTFOLDER_TREE_ICON; + nImageResourceID = REPORTFOLDER_TREE_ICON; break; case DatabaseObject::TABLE: - nImageResourceID = _bHighContrast ? TABLEFOLDER_TREE_ICON_SCH : TABLEFOLDER_TREE_ICON; + nImageResourceID = TABLEFOLDER_TREE_ICON; break; default: - OSL_ENSURE( false, "ImageProvider::getDefaultImage: invalid database object type!" ); + OSL_FAIL( "ImageProvider::getDefaultImage: invalid database object type!" ); break; } @@ -251,9 +239,9 @@ namespace dbaui } //-------------------------------------------------------------------- - Image ImageProvider::getDatabaseImage( bool _bHighContrast ) + Image ImageProvider::getDatabaseImage() { - return Image( ModuleRes( _bHighContrast ? DATABASE_TREE_ICON_SCH : DATABASE_TREE_ICON ) ); + return Image( ModuleRes( DATABASE_TREE_ICON ) ); } //........................................................................ diff --git a/dbaccess/source/ui/misc/indexcollection.cxx b/dbaccess/source/ui/misc/indexcollection.cxx index 137f9eeb696e..ae68cd988f55 100644 --- a/dbaccess/source/ui/misc/indexcollection.cxx +++ b/dbaccess/source/ui/misc/indexcollection.cxx @@ -65,12 +65,6 @@ namespace dbaui } //------------------------------------------------------------------ -// OIndexCollection::OIndexCollection(const Reference< XNameAccess >& _rxIndexes) -// { -// implConstructFrom(_rxIndexes); -// } - - //------------------------------------------------------------------ const OIndexCollection& OIndexCollection::operator=(const OIndexCollection& _rSource) { detach(); @@ -163,7 +157,7 @@ namespace dbaui Reference< XAppend > xAppendIndex(xIndexFactory, UNO_QUERY); if (!xAppendIndex.is()) { - OSL_ENSURE(sal_False, "OIndexCollection::commitNewIndex: missing an interface of the index container!"); + OSL_FAIL("OIndexCollection::commitNewIndex: missing an interface of the index container!"); return; } @@ -177,14 +171,14 @@ namespace dbaui Reference< XAppend > xAppendCols(xColumnFactory, UNO_QUERY); if (!xAppendCols.is()) { - OSL_ENSURE(sal_False, "OIndexCollection::commitNewIndex: invalid index descriptor returned!"); + OSL_FAIL("OIndexCollection::commitNewIndex: invalid index descriptor returned!"); return; } // set the properties - static const ::rtl::OUString s_sUniquePropertyName = ::rtl::OUString::createFromAscii("IsUnique"); - static const ::rtl::OUString s_sSortPropertyName = ::rtl::OUString::createFromAscii("IsAscending"); - static const ::rtl::OUString s_sNamePropertyName = ::rtl::OUString::createFromAscii("Name"); + static const ::rtl::OUString s_sUniquePropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsUnique")); + static const ::rtl::OUString s_sSortPropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAscending")); + static const ::rtl::OUString s_sNamePropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")); // the index' own props xIndexDescriptor->setPropertyValue(s_sUniquePropertyName, ::cppu::bool2any(_rPos->bUnique)); xIndexDescriptor->setPropertyValue(s_sNamePropertyName, makeAny(_rPos->sName)); @@ -232,7 +226,7 @@ namespace dbaui Reference< XDrop > xDropIndex(m_xIndexes, UNO_QUERY); if (!xDropIndex.is()) { - OSL_ENSURE(sal_False, "OIndexCollection::drop: no XDrop interface!"); + OSL_FAIL("OIndexCollection::drop: no XDrop interface!"); return sal_False; } @@ -279,7 +273,7 @@ namespace dbaui m_xIndexes->getByName(_rIndex.getOriginalName()) >>= xIndex; if (!xIndex.is()) { - OSL_ENSURE(sal_False, "OIndexCollection::implFillIndexInfo: got an invalid index object!"); + OSL_FAIL("OIndexCollection::implFillIndexInfo: got an invalid index object!"); } else implFillIndexInfo(_rIndex, xIndex); @@ -288,10 +282,10 @@ namespace dbaui //------------------------------------------------------------------ void OIndexCollection::implFillIndexInfo(OIndex& _rIndex, Reference< XPropertySet > _rxDescriptor) SAL_THROW((Exception)) { - static const ::rtl::OUString s_sPrimaryIndexPropertyName = ::rtl::OUString::createFromAscii("IsPrimaryKeyIndex"); - static const ::rtl::OUString s_sUniquePropertyName = ::rtl::OUString::createFromAscii("IsUnique"); - static const ::rtl::OUString s_sSortPropertyName = ::rtl::OUString::createFromAscii("IsAscending"); - static const ::rtl::OUString s_sCatalogPropertyName = ::rtl::OUString::createFromAscii("Catalog"); + static const ::rtl::OUString s_sPrimaryIndexPropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsPrimaryKeyIndex")); + static const ::rtl::OUString s_sUniquePropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsUnique")); + static const ::rtl::OUString s_sSortPropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsAscending")); + static const ::rtl::OUString s_sCatalogPropertyName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Catalog")); _rIndex.bPrimaryKey = ::cppu::any2bool(_rxDescriptor->getPropertyValue(s_sPrimaryIndexPropertyName)); _rIndex.bUnique = ::cppu::any2bool(_rxDescriptor->getPropertyValue(s_sUniquePropertyName)); @@ -320,7 +314,7 @@ namespace dbaui xCols->getByName(*pFieldNames) >>= xIndexColumn; if (!xIndexColumn.is()) { - OSL_ENSURE(sal_False, "OIndexCollection::implFillIndexInfo: invalid index column!"); + OSL_FAIL("OIndexCollection::implFillIndexInfo: invalid index column!"); --aCopyTo; continue; } @@ -389,7 +383,7 @@ namespace dbaui m_xIndexes->getByName(*pNames) >>= xIndex; if (!xIndex.is()) { - OSL_ENSURE(sal_False, "OIndexCollection::implConstructFrom: got an invalid index object ... ignoring!"); + OSL_FAIL("OIndexCollection::implConstructFrom: got an invalid index object ... ignoring!"); continue; } diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 8d470332158e..d1c5ccd14fe1 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> @@ -54,14 +54,12 @@ #include <svl/filenotation.hxx> #include "browserids.hxx" #include <sfx2/new.hxx> -#include <svtools/templdlg.hxx> #include "moduledbu.hxx" // ----------------- // for calling basic #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> @@ -173,7 +171,7 @@ namespace dbaui break; default: - OSL_ENSURE( false, "OLinkedDocumentsAccess::implOpen: invalid open mode!" ); + OSL_FAIL( "OLinkedDocumentsAccess::implOpen: invalid open mode!" ); break; } aArguments.put( "OpenMode", sOpenMode ); @@ -191,9 +189,8 @@ namespace dbaui xRet = xComponentLoader->loadComponentFromURL( _rLinkName, ::rtl::OUString(), 0, aArguments.getPropertyValues() ); } - catch(Exception& e) + catch(const Exception&) { - (void)e; throw; } @@ -231,7 +228,7 @@ namespace dbaui xWizard->trigger( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "start" ) ) ); ::comphelper::disposeComponent( xWizard ); } - catch(const Exception& e) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -289,7 +286,7 @@ namespace dbaui break; default: - OSL_ENSURE( sal_False, "OLinkedDocumentsAccess::newDocument: please use newFormWithPilot!" ); + OSL_FAIL( "OLinkedDocumentsAccess::newDocument: please use newFormWithPilot!" ); return Reference< XComponent >(); } @@ -336,7 +333,7 @@ namespace dbaui xNewDocument.set( xContent->execute( aCommand, xContent->createCommandIdentifier(), NULL ), UNO_QUERY ); } } - catch(const Exception& ) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -360,12 +357,11 @@ namespace dbaui com::sun::star::sdbc::SQLException aSQLException; aSQLException.Message = sMessage; - // aSQLException.Context = e.Context; aInfo = dbtools::SQLExceptionInfo(aSQLException); } return xRet; } - catch (com::sun::star::io::WrongFormatException e) + catch(const com::sun::star::io::WrongFormatException &e) { com::sun::star::sdbc::SQLException aSQLException; aSQLException.Message = e.Message; @@ -381,7 +377,7 @@ namespace dbaui sMessage.SearchAndReplaceAscii("$file$",_rLinkName); aInfo.prepend(sMessage); } - catch(Exception& e) + catch(const Exception& e) { Any aAny = ::cppu::getCaughtException(); com::sun::star::sdbc::SQLException a; diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 7f9bbed56023..534d90e3995c 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/propertystorage.cxx b/dbaccess/source/ui/misc/propertystorage.cxx index fc65cb18d670..b1dbfb27558d 100644 --- a/dbaccess/source/ui/misc/propertystorage.cxx +++ b/dbaccess/source/ui/misc/propertystorage.cxx @@ -117,7 +117,7 @@ namespace dbaui ) return; - OSL_ENSURE( false, "SetItemPropertyStorage::getPropertyValue: unsupported item type!" ); + OSL_FAIL( "SetItemPropertyStorage::getPropertyValue: unsupported item type!" ); } //-------------------------------------------------------------------- @@ -129,7 +129,7 @@ namespace dbaui ) return; - OSL_ENSURE( false, "SetItemPropertyStorage::setPropertyValue: unsupported item type!" ); + OSL_FAIL( "SetItemPropertyStorage::setPropertyValue: unsupported item type!" ); } //........................................................................ diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index d6cc403765bf..4f6d7b909d55 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -1,6 +1,5 @@ /* -*- 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. @@ -26,726 +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/debug.hxx> -#include <tools/diagnose_ex.h> -#include <vcl/msgbox.hxx> +#include <svl/undo.hxx> +#include <osl/diagnose.h> + +#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 ) - { - DBG_ASSERT( !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; - DBG_ASSERT( 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::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 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(); - } - - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::Construct(Window* _pParent) - { - DBG_ASSERT( 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() - { - m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + ClearUndoManager(); + m_pData->m_pUndoManager->disposing(); } - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::hasError() const + // ----------------------------------------------------------------------------- + void SAL_CALL OSingleDocumentController::disposing( const EventObject& i_event ) throw( RuntimeException ) { - return m_pImpl->m_aCurrentError.isValid(); + // simply disambiguate + OSingleDocumentController_Base::disposing( i_event ); } - //-------------------------------------------------------------------- - const ::dbtools::SQLExceptionInfo& OSingleDocumentController::getError() const + // ----------------------------------------------------------------------------- + void OSingleDocumentController::ClearUndoManager() { - return m_pImpl->m_aCurrentError; + GetUndoManager().Clear(); } - //-------------------------------------------------------------------- - void OSingleDocumentController::displayError() + // ----------------------------------------------------------------------------- + SfxUndoManager& OSingleDocumentController::GetUndoManager() const { - showError( m_pImpl->m_aCurrentError ); + return m_pData->m_pUndoManager->GetSfxUndoManager(); } - //-------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) + // ----------------------------------------------------------------------------- + void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) { - m_pImpl->m_bSuspended = bSuspend; - if ( !bSuspend && !isConnected() ) - reconnect(sal_True); + // add undo action + GetUndoManager().AddUndoAction( _pAction ); + // 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() ); - // There can be only one view with the same object - //const sal_Int32 nCurrentView = getCurrentStartNumber(); - //if ( nCurrentView > 1 ) - //{ - // sTitle.appendAscii(" : "); - // sTitle.append(nCurrentView); - //} - - 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 8ea14059692c..0a2dafc25bd0 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/ConnectionData.hxx b/dbaccess/source/ui/querydesign/ConnectionData.hxx deleted file mode 100644 index 67a768e79f40..000000000000 --- a/dbaccess/source/ui/querydesign/ConnectionData.hxx +++ /dev/null @@ -1,66 +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_CONNECTIONDATA_HXX -#define DBAUI_CONNECTIONDATA_HXX - -namespace dbaui -{ - - //================================================================== - // ConnData ---------->* ConnLineData - // ^1 ^1 - // | | - // Conn ---------->* ConnLine - //================================================================== - - -} -#endif // DBAUI_CONNECTIONDATA_HXX - -DECLARE_LIST( OConnectionLineDataList, OConnectionLineData* ); - -//================================================================== -class SbaJoinTabConn; - - - -DECLARE_LIST( OConnectionLineList, OConnectionLine* ); - -DECLARE_LIST( OTableConnectionDataList, OTableConnectionData* ); - -//================================================================== -const USHORT MAX_CONN_COUNT = 2; - -class SbaJoinTabWin; -class SbaJoinTabWinCont; - - - -DECLARE_LIST( SbaJoinTabConnList, SbaJoinTabConn* ); - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 4c119ca15c78..91d67b82108c 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -37,7 +37,7 @@ #ifndef _INC_MATH #include <math.h> #endif -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <vcl/lineinfo.hxx> @@ -64,7 +64,7 @@ namespace Rectangle GetTextPos(const OTableWindow* _pWin, const Point& _aConnPos,const Point& _aDescrLinePos) { OTableWindowListBox* pListBox = _pWin ? _pWin->GetListBox() : NULL; - DBG_ASSERT(_pWin && pListBox, "OConnectionLine::GetSourceTextPos : invalid call !"); + OSL_ENSURE(_pWin && pListBox, "OConnectionLine::GetSourceTextPos : invalid call !"); Rectangle aReturn; if ( pListBox ) @@ -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/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx index 8f532687e72c..a1297dfc68b0 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx @@ -46,7 +46,6 @@ namespace dbaui using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; - // using namespace ::com::sun::star::awt; using namespace ::com::sun::star; OConnectionLineAccess::OConnectionLineAccess(OTableConnection* _pLine) @@ -81,7 +80,7 @@ namespace dbaui // ----------------------------------------------------------------------------- ::rtl::OUString OConnectionLineAccess::getImplementationName_Static(void) throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ConnectionLineAccessibility"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ConnectionLineAccessibility")); } // ----------------------------------------------------------------------------- // XAccessibleContext diff --git a/dbaccess/source/ui/querydesign/JAccess.cxx b/dbaccess/source/ui/querydesign/JAccess.cxx index 155aac4c27da..90feae92b25d 100644 --- a/dbaccess/source/ui/querydesign/JAccess.cxx +++ b/dbaccess/source/ui/querydesign/JAccess.cxx @@ -57,7 +57,7 @@ namespace dbaui // ----------------------------------------------------------------------------- ::rtl::OUString OJoinDesignViewAccess::getImplementationName_Static(void) throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.JoinViewAccessibility"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.JoinViewAccessibility")); } // ----------------------------------------------------------------------------- void OJoinDesignViewAccess::clearTableView() diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 3f3059967447..f4552253d84f 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -66,6 +66,7 @@ #include <vcl/svapp.hxx> #include <osl/mutex.hxx> #include "UITools.hxx" +#include <osl/diagnose.h> #include <boost/optional.hpp> @@ -141,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 ); } // ----------------------------------------------------------------------------- @@ -307,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 @@ -316,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; @@ -334,7 +335,7 @@ void OJoinController::SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabW // Wenn die TabWins ein SetData haetten, koennte ich mir das sparen ... haben sie aber nicht, ausserdem muesste ich dann immer // noch Informationen, die sich eigentlich nicht geaendert haben, auch neu setzen. // Also loesche ich die TabWinDatas nicht, sondern aktualisiere sie nur. - DBG_ASSERT(m_vTableData.size() == pTabWinList->size(), + OSL_ENSURE(m_vTableData.size() == pTabWinList->size(), "OJoinController::SaveTabWinsPosSize : inkonsistenter Zustand : sollte genausviel TabWinDatas haben wie TabWins !"); OJoinTableView::OTableWindowMap::iterator aIter = pTabWinList->begin(); @@ -444,10 +445,10 @@ void OJoinController::saveTableWindows( ::comphelper::NamedValueCollection& o_rV aWindowData.put( "ComposedName", (*aIter)->GetComposedName() ); aWindowData.put( "TableName", (*aIter)->GetTableName() ); aWindowData.put( "WindowName", (*aIter)->GetWinName() ); - aWindowData.put( "WindowTop", (*aIter)->GetPosition().Y() ); - aWindowData.put( "WindowLeft", (*aIter)->GetPosition().X() ); - aWindowData.put( "WindowWidth", (*aIter)->GetSize().Width() ); - aWindowData.put( "WindowHeight", (*aIter)->GetSize().Height() ); + aWindowData.put( "WindowTop", static_cast<sal_Int32>((*aIter)->GetPosition().Y()) ); + aWindowData.put( "WindowLeft", static_cast<sal_Int32>((*aIter)->GetPosition().X()) ); + aWindowData.put( "WindowWidth", static_cast<sal_Int32>((*aIter)->GetSize().Width()) ); + aWindowData.put( "WindowHeight", static_cast<sal_Int32>((*aIter)->GetSize().Height()) ); aWindowData.put( "ShowAll", (*aIter)->IsShowAll() ); const ::rtl::OUString sTableName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Table" ) ) + ::rtl::OUString::valueOf( i ) ); @@ -463,7 +464,7 @@ TTableWindowData::value_type OJoinController::createTableWindowData(const ::rtl: OJoinDesignView* pView = getJoinView(); if( pView ) return pView->getTableView()->createTableWindowData(_sComposedName,_sTableName,_sWindowName); - OSL_ENSURE(0,"We should never ever reach this point!"); + OSL_FAIL("We should never ever reach this point!"); return TTableWindowData::value_type(); } diff --git a/dbaccess/source/ui/querydesign/JoinDesignView.cxx b/dbaccess/source/ui/querydesign/JoinDesignView.cxx index 85c5a9eb9120..397bb804c829 100644 --- a/dbaccess/source/ui/querydesign/JoinDesignView.cxx +++ b/dbaccess/source/ui/querydesign/JoinDesignView.cxx @@ -49,7 +49,6 @@ #include <comphelper/extract.hxx> #include "UITools.hxx" #include "JoinTableView.hxx" -// #include <com/sun/star/util/URL.hdl> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; @@ -95,7 +94,6 @@ void OJoinDesignView::Construct() // ----------------------------------------------------------------------------- void OJoinDesignView::initialize() { - // getAddTableDialog()->Update(); } // ------------------------------------------------------------------------- void OJoinDesignView::resizeDocumentView(Rectangle& _rPlayground) diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 60099ed9999d..f2d906e5017a 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "JoinTableView.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "querycontroller.hxx" #include "JoinDesignView.hxx" #include "dbu_qry.hrc" @@ -171,8 +171,6 @@ void OScrollWindowHelper::Resize() // class OJoinTableView //================================================================== -//const long WINDOW_WIDTH = 1000; -//const long WINDOW_HEIGHT = 1000; DBG_NAME(OJoinTableView); //------------------------------------------------------------------------------ OJoinTableView::OJoinTableView( Window* pParent, OJoinDesignView* pView ) @@ -183,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) @@ -214,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; } @@ -252,7 +250,7 @@ void OJoinTableView::Resize() } } //------------------------------------------------------------------------------ -ULONG OJoinTableView::GetTabWinCount() +sal_uLong OJoinTableView::GetTabWinCount() { DBG_CHKTHIS(OJoinTableView,NULL); return m_aTableMap.size(); @@ -335,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!"); @@ -432,9 +430,8 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) namespace { // ----------------------------------------------------------------------------- - BOOL isScrollAllowed( OJoinTableView* _pView,long nDelta, BOOL bHoriz) + sal_Bool isScrollAllowed( OJoinTableView* _pView,long nDelta, sal_Bool bHoriz) { - BOOL bRet = TRUE; ////////////////////////////////////////////////////////////////////// // adjust ScrollBar-Positions ScrollBar* pBar = _pView->GetVScrollBar(); @@ -444,40 +441,38 @@ namespace long nOldThumbPos = pBar->GetThumbPos(); long nNewThumbPos = nOldThumbPos + nDelta; if( nNewThumbPos < 0 ) - nNewThumbPos = 0;// bRet = FALSE; + nNewThumbPos = 0; else if( nNewThumbPos > pBar->GetRangeMax() ) - nNewThumbPos = pBar->GetRangeMax();// bRet = FALSE; + nNewThumbPos = pBar->GetRangeMax(); if ( bHoriz ) { if( nNewThumbPos == _pView->GetScrollOffset().X() ) - return FALSE; + return sal_False; } else if ( nNewThumbPos == _pView->GetScrollOffset().Y() ) - return FALSE; + return sal_False; - return bRet; + return sal_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 Point aUpperLeft = _rPoint; // normalize with respect to visibility aUpperLeft -= _pView->GetScrollOffset(); - // aUpperLeft.Y() -= _pView->GetScrollOffset().Y(); Point aLowerRight(aUpperLeft.X() + _rSize.Width(), aUpperLeft.Y() + _rSize.Height()); // 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) { - // #100386# OJ if (!bFitsHor) { // ensure the visibility of the right border @@ -485,7 +480,6 @@ namespace _nScrollX = aLowerRight.X() - aSize.Width() + TABWIN_SPACING_X; // ensure the visibility of the left border (higher priority) - // if ( (aUpperLeft.X() - _nScrollX) < 0 ) if ( aUpperLeft.X() < 0 ) _nScrollX = aUpperLeft.X() - TABWIN_SPACING_X; } @@ -496,16 +490,15 @@ namespace if ( aLowerRight.Y() > aSize.Height() ) _nScrollY = aLowerRight.Y() - aSize.Height() + TABWIN_SPACING_Y; // upper border - // if ( (aUpperLeft.Y() - _nScrollY) < 0 ) if ( aUpperLeft.Y() < 0 ) _nScrollY = aUpperLeft.Y() - TABWIN_SPACING_Y; } 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 ) { @@ -513,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; } } @@ -524,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); @@ -534,7 +527,6 @@ void OJoinTableView::EnsureVisible(const OTableWindow* _pWin) { // data about the tab win TTableWindowData::value_type pData = _pWin->GetData(); - // Point aUpperLeft = pData->GetPosition(); EnsureVisible( pData->GetPosition() , pData->GetSize()); Invalidate(INVALIDATE_NOCHILDREN); } @@ -545,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); } } @@ -565,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 ) { ////////////////////////////////////////////////////////////////// @@ -582,7 +574,7 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) ////////////////////////////////////////////////////////////////// // Belegte Bereiche dieser Zeile pruefen - OTableWindow* pOtherTabWin;// = GetTabWinMap()->First(); + OTableWindow* pOtherTabWin; OTableWindowMapIterator aIter = m_aTableMap.begin(); OTableWindowMapIterator aEnd = m_aTableMap.end(); for(;aIter != aEnd;++aIter) @@ -607,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 { @@ -617,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++; @@ -679,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(); } @@ -704,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 @@ -720,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; @@ -737,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; @@ -753,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 @@ -930,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) ) { @@ -953,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; @@ -982,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(); @@ -997,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); } @@ -1063,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(); @@ -1072,7 +1064,7 @@ BOOL OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const void OJoinTableView::ClearAll() { DBG_CHKTHIS(OJoinTableView,NULL); - SetUpdateMode(FALSE); + SetUpdateMode(sal_False); HideTabWins(); @@ -1087,16 +1079,16 @@ 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); - DBG_ASSERT(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging darf nur waehrend Dragging eines Fensters aufgerufen werden !"); + OSL_ENSURE(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging darf nur waehrend Dragging eines Fensters aufgerufen werden !"); // den Timer schon mal killen if (m_aDragScrollTimer.IsActive()) @@ -1107,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; @@ -1129,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(); @@ -1139,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; @@ -1148,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(); @@ -1203,36 +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; } - // nicht wenn keine Joins moeglich -// if (!GetDatabase()->IsCapable(SDB_CAP_JOIN) && nMax <= GetTabWinCount()) -// return FALSE; - - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void OJoinTableView::executePopup(const Point& _aPos,OTableConnection* _pSelConnection) @@ -1253,7 +1241,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) { DBG_CHKTHIS(OJoinTableView,NULL); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rEvt.GetCommand()) { @@ -1292,7 +1280,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) } } } - bHandled = TRUE; + bHandled = sal_True; } } if (!bHandled) @@ -1303,12 +1291,12 @@ void OJoinTableView::Command(const CommandEvent& rEvt) OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTableWindow* pRhs,bool _bSupressCrossOrNaturalJoin,const OTableConnection* _rpFirstAfter) const { OTableConnection* pConn = NULL; - DBG_ASSERT(pRhs || pLhs, "OJoinTableView::GetTabConn : invalid args !"); + OSL_ENSURE(pRhs || pLhs, "OJoinTableView::GetTabConn : invalid args !"); // only one NULL-arg allowed 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(); @@ -1345,7 +1333,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab pConn = pData; if (pData == _rpFirstAfter) - bFoundStart = TRUE; + bFoundStart = sal_True; } } } @@ -1355,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: @@ -1367,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; } } } @@ -1391,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(); @@ -1717,7 +1705,7 @@ bool OJoinTableView::allowQueries() const // ----------------------------------------------------------------------------- void OJoinTableView::onNoColumns_throw() { - OSL_ENSURE( false, "OTableWindow::onNoColumns_throw: cannot really handle this!" ); + OSL_FAIL( "OTableWindow::onNoColumns_throw: cannot really handle this!" ); throw SQLException(); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/querydesign/QTableConnection.cxx b/dbaccess/source/ui/querydesign/QTableConnection.cxx index 4bba1b75eaaa..8e18232e02ff 100644 --- a/dbaccess/source/ui/querydesign/QTableConnection.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnection.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "QTableConnection.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "QueryTableView.hxx" #include "ConnectionLine.hxx" using namespace dbaui; @@ -46,7 +46,6 @@ OQueryTableConnection::OQueryTableConnection(OQueryTableView* pContainer, const DBG_CTOR(OQueryTableConnection,NULL); } - //------------------------------------------------------------------------ OQueryTableConnection::OQueryTableConnection(const OQueryTableConnection& rConn) :OTableConnection( rConn ) @@ -74,7 +73,7 @@ OQueryTableConnection& OQueryTableConnection::operator=(const OQueryTableConnect //------------------------------------------------------------------------ sal_Bool OQueryTableConnection::operator==(const OQueryTableConnection& rCompare) { - DBG_ASSERT(GetData() && rCompare.GetData(), "OQueryTableConnection::operator== : einer der beiden Teilnehmer hat keine Daten !"); + OSL_ENSURE(GetData() && rCompare.GetData(), "OQueryTableConnection::operator== : einer der beiden Teilnehmer hat keine Daten !"); // allzuviel brauche ich nicht vergleichen (schon gar nicht alle Member) : lediglich die Fenster, an denen wir haengen, und // die Indizies in der entsprechenden Tabelle muessen uebereinstimmen @@ -97,9 +96,4 @@ sal_Bool OQueryTableConnection::operator==(const OQueryTableConnection& rCompare } // ----------------------------------------------------------------------------- - - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx index a15714a299cc..fc702cf94cfa 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx @@ -160,13 +160,10 @@ OTableConnectionData* OQueryTableConnectionData::NewInstance() const return new OQueryTableConnectionData(); } // ----------------------------------------------------------------------------- -BOOL OQueryTableConnectionData::Update() +sal_Bool OQueryTableConnectionData::Update() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx index f7d2173907b1..0b4c78d394a5 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.cxx b/dbaccess/source/ui/querydesign/QTableWindow.cxx index 45135346cde9..e20ca59c5494 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.cxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.cxx @@ -31,7 +31,7 @@ #include "QTableWindow.hxx" #include "QueryTableView.hxx" #include "dbustrings.hrc" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "QueryDesignView.hxx" #include "browserids.hxx" @@ -120,14 +120,13 @@ sal_Bool OQueryTableWindow::Init() sAliasName = String(sAliasName).EraseAllChars('"'); SetAliasName(sAliasName); // SetAliasName reicht das als WinName weiter, dadurch benutzt es die Basisklasse - // reset the titel + // reset the title m_aTitle.SetText( pWinData->GetWinName() ); m_aTitle.Show(); - // sal_Bool bSuccess(sal_True); if (!bSuccess) { // es soll nur ein Dummy-Window aufgemacht werden ... - DBG_ASSERT(GetAliasName().getLength(), "OQueryTableWindow::Init : kein Alias- UND kein Tabellenname geht nicht !"); + OSL_ENSURE(GetAliasName().getLength(), "OQueryTableWindow::Init : kein Alias- UND kein Tabellenname geht nicht !"); // .. aber das braucht wenigstens einen Alias // ::com::sun::star::form::ListBox anlegen @@ -164,14 +163,14 @@ void OQueryTableWindow::deleteUserData(void*& _pUserData) //------------------------------------------------------------------------------ void OQueryTableWindow::OnEntryDoubleClicked(SvLBoxEntry* pEntry) { - DBG_ASSERT(pEntry != NULL, "OQueryTableWindow::OnEntryDoubleClicked : pEntry darf nicht NULL sein !"); + OSL_ENSURE(pEntry != NULL, "OQueryTableWindow::OnEntryDoubleClicked : pEntry darf nicht NULL sein !"); // man koennte das auch abfragen und dann ein return hinsetzen, aber so weist es vielleicht auf Fehler bei Aufrufer hin if (getTableView()->getDesignView()->getController().isReadOnly()) return; OTableFieldInfo* pInf = static_cast<OTableFieldInfo*>(pEntry->GetUserData()); - DBG_ASSERT(pInf != NULL, "OQueryTableWindow::OnEntryDoubleClicked : Feld hat keine FieldInfo !"); + OSL_ENSURE(pInf != NULL, "OQueryTableWindow::OnEntryDoubleClicked : Feld hat keine FieldInfo !"); // eine DragInfo aufbauen OTableFieldDescRef aInfo = new OTableFieldDesc(GetTableName(),m_pListBox->GetEntryText(pEntry)); @@ -187,7 +186,7 @@ void OQueryTableWindow::OnEntryDoubleClicked(SvLBoxEntry* pEntry) //------------------------------------------------------------------------------ sal_Bool OQueryTableWindow::ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo) { - DBG_ASSERT(m_pListBox != NULL, "OQueryTableWindow::ExistsField : habe keine ::com::sun::star::form::ListBox !"); + OSL_ENSURE(m_pListBox != NULL, "OQueryTableWindow::ExistsField : habe keine ::com::sun::star::form::ListBox !"); OSL_ENSURE(rInfo.is(),"OQueryTableWindow::ExistsField: invlid argument for OTableFieldDescRef!"); Reference< XConnection> xConnection = getTableView()->getDesignView()->getController().getConnection(); sal_Bool bExists = sal_False; @@ -204,7 +203,7 @@ sal_Bool OQueryTableWindow::ExistsField(const ::rtl::OUString& strFieldName, OTa if (bCase(strFieldName,::rtl::OUString(m_pListBox->GetEntryText(pEntry)))) { OTableFieldInfo* pInf = static_cast<OTableFieldInfo*>(pEntry->GetUserData()); - DBG_ASSERT(pInf != NULL, "OQueryTableWindow::ExistsField : Feld hat keine FieldInfo !"); + OSL_ENSURE(pInf != NULL, "OQueryTableWindow::ExistsField : Feld hat keine FieldInfo !"); rInfo->SetTabWindow(this); rInfo->SetField(strFieldName); @@ -239,6 +238,4 @@ void OQueryTableWindow::KeyInput( const KeyEvent& rEvt ) } // ----------------------------------------------------------------------------- - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx index deaad8621808..16b5097ca6d0 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 6cccdbcf9c34..92a79f257efd 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 557a94c14204..f0f862cf3611 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 60e71a4a8e7d..ccd9b3af9533 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -36,6 +36,7 @@ #include <vcl/split.hxx> #include <svl/undo.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "adtabdlg.hxx" #include <vcl/svapp.hxx> #include <vcl/combobox.hxx> @@ -83,8 +84,8 @@ using namespace ::com::sun::star::container; // please look at the book LargeScale C++ to know why namespace { - static const ::rtl::OUString C_AND = ::rtl::OUString::createFromAscii(" AND "); - static const ::rtl::OUString C_OR = ::rtl::OUString::createFromAscii(" OR "); + static const ::rtl::OUString C_AND(RTL_CONSTASCII_USTRINGPARAM(" AND ")); + static const ::rtl::OUString C_OR(RTL_CONSTASCII_USTRINGPARAM(" OR ")); // forward declarations sal_Bool InsertJoin( const OQueryDesignView* _pView, @@ -247,7 +248,7 @@ namespace bError = sal_True; } } - // check if error occured + // check if error occurred if ( bError ) eErrorCode = eIllegalJoin; @@ -332,7 +333,7 @@ namespace } catch(SQLException&) { - OSL_ASSERT(!"Failure while building Join criteria!"); + OSL_FAIL("Failure while building Join criteria!"); } } @@ -375,7 +376,6 @@ namespace { ::rtl::OUString aDBName(pEntryTab->GetComposedName()); - // Reference< XConnection> xConnection = static_cast<OQueryController&>(_pView->getController()).getConnection(); if( _xConnection.is() ) { try @@ -389,9 +389,9 @@ namespace ::rtl::OUString aQuote = xMetaData->getIdentifierQuoteString(); if ( _bForce || isAppendTableAliasEnabled( _xConnection ) || pEntryTab->GetAliasName() != aDBName ) { - aTableListStr += ::rtl::OUString::createFromAscii(" "); + aTableListStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")); if ( generateAsBeforeTableAlias( _xConnection ) ) - aTableListStr += ::rtl::OUString::createFromAscii("AS "); + aTableListStr += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AS ")); aTableListStr += ::dbtools::quoteName( aQuote, pEntryTab->GetAliasName() ); } aDBName = aTableListStr; @@ -481,8 +481,6 @@ namespace if ( pEntryConnData->GetJoinType() == INNER_JOIN && !pEntryConnData->isNatural() ) return; - // Reference< XConnection> xConnection = static_cast<OQueryController&>(_pView->getController()).getConnection(); - if(!aJoin.getLength()) { OQueryTableWindow* pEntryTabFrom = static_cast<OQueryTableWindow*>(pEntryConn->GetSourceWin()); @@ -561,7 +559,7 @@ namespace else if (SQL_ISRULE(pNode,comparison_predicate)) { // only the comparison of columns is allowed - DBG_ASSERT(pNode->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree"); + OSL_ENSURE(pNode->count() == 3,"OQueryDesignView::InsertJoinConnection: Fehler im Parse Tree"); if (!(SQL_ISRULE(pNode->getChild(0),column_ref) && SQL_ISRULE(pNode->getChild(2),column_ref) && pNode->getChild(1)->getNodeType() == SQL_NODE_EQUAL)) @@ -580,7 +578,6 @@ namespace if ( pLeftTable ) { OQueryTableWindow* pLeftWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pLeftTable->getByRule(OSQLParseNode::table_ref) )); - // OQueryTableWindow* pRightWindow = static_cast<OQueryTableView*>(_pView->getTableView())->FindTable( getTableRange(_pView,pRightTable->getByRule(OSQLParseNode::table_ref) )); if ( pLeftWindow == aDragLeft->GetTabWindow() ) insertConnection(_pView,_eJoinType,aDragLeft,aDragRight); else @@ -681,7 +678,7 @@ namespace if ( pEntryField->isAggreateFunction() ) { - DBG_ASSERT(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + OSL_ENSURE(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); ::rtl::OUStringBuffer aTmpStr2( pEntryField->GetFunction()); aTmpStr2.appendAscii("("); aTmpStr2.append(aTmpStr.makeStringAndClear()); @@ -706,7 +703,7 @@ namespace } catch(SQLException&) { - OSL_ASSERT(!"Failure while building select list!"); + OSL_FAIL("Failure while building select list!"); } return aFieldListStr.makeStringAndClear(); } @@ -731,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(); @@ -881,7 +878,7 @@ namespace } catch(SQLException&) { - OSL_ASSERT(!"Failure while building where clause!"); + OSL_FAIL("Failure while building where clause!"); } return sal_True; } @@ -934,7 +931,7 @@ namespace } else if ( pEntryField->isNumericOrAggreateFunction() ) { - DBG_ASSERT(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + OSL_ENSURE(pEntryField->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); aWorkStr += pEntryField->GetFunction(); aWorkStr += ::rtl::OUString('('); aWorkStr += quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote); @@ -956,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(','); } } @@ -975,14 +972,14 @@ namespace eErrorCode = eStatementTooLong; else { - _rsRet = ::rtl::OUString::createFromAscii(" ORDER BY "); + _rsRet = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ORDER BY ")); _rsRet += aWorkStr; } } } catch(SQLException&) { - OSL_ASSERT(!"Failure while building group by!"); + OSL_FAIL("Failure while building group by!"); } return eErrorCode; @@ -1172,7 +1169,7 @@ namespace OTableFieldDescRef pEntryField = *aIter; if ( pEntryField->IsGroupBy() ) { - DBG_ASSERT(pEntryField->GetField().getLength(),"Kein FieldName vorhanden!;-("); + OSL_ENSURE(pEntryField->GetField().getLength(),"Kein FieldName vorhanden!;-("); ::rtl::OUString sGroupByPart = quoteTableAlias(bMulti,pEntryField->GetAlias(),aQuote); // only quote the field name when it isn't calculated @@ -1210,14 +1207,14 @@ namespace if ( aGroupByStr.getLength() ) { aGroupByStr = aGroupByStr.replaceAt(aGroupByStr.getLength()-1,1, ::rtl::OUString(' ') ); - ::rtl::OUString aGroupByStr2 = ::rtl::OUString::createFromAscii(" GROUP BY "); + ::rtl::OUString aGroupByStr2(RTL_CONSTASCII_USTRINGPARAM(" GROUP BY ")); aGroupByStr2 += aGroupByStr; aGroupByStr = aGroupByStr2; } } catch(SQLException&) { - OSL_ASSERT(!"Failure while building group by!"); + OSL_FAIL("Failure while building group by!"); } return aGroupByStr; } @@ -1549,13 +1546,6 @@ namespace &rController.getParser().getContext(), sal_True, sal_True); // quote is to true because we need quoted elements inside the function - // i75557 - //pFunction->parseNodeToPredicateStr(aColumnName, - // xConnection, - // rController.getNumberFormatter(), - // _pView->getLocale(), - // static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), - // &rController.getParser().getContext()); // don't display the column name aCondition = aCondition.copy(aColumnName.getLength()); aCondition = aCondition.trim(); @@ -1575,7 +1565,7 @@ namespace for(;aIter != aTabEnd;++aIter) { OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); - if (pTabWin->ExistsField( ::rtl::OUString::createFromAscii("*"), aDragLeft )) + if (pTabWin->ExistsField( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), aDragLeft )) { aDragLeft->SetAlias(String()); aDragLeft->SetTable(String()); @@ -1624,7 +1614,7 @@ namespace SqlParseError eErrorCode = eOk; OQueryController& rController = static_cast<OQueryController&>(_pView->getController()); - DBG_ASSERT(SQL_ISRULE( pCondition, comparison_predicate),"ComparisonPredicate: pCondition ist kein ComparisonPredicate"); + OSL_ENSURE(SQL_ISRULE( pCondition, comparison_predicate),"ComparisonPredicate: pCondition ist kein ComparisonPredicate"); if ( SQL_ISRULE(pCondition->getChild(0), column_ref ) || SQL_ISRULE(pCondition->getChild(pCondition->count()-1), column_ref) ) { @@ -1689,22 +1679,22 @@ namespace case SQL_NODE_LESS: // take the opposite as we change the order i--; - aCondition = aCondition + ::rtl::OUString::createFromAscii(">"); + aCondition = aCondition + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(">")); break; case SQL_NODE_LESSEQ: // take the opposite as we change the order i--; - aCondition = aCondition + ::rtl::OUString::createFromAscii(">="); + aCondition = aCondition + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(">=")); break; case SQL_NODE_GREAT: // take the opposite as we change the order i--; - aCondition = aCondition + ::rtl::OUString::createFromAscii("<"); + aCondition = aCondition + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<")); break; case SQL_NODE_GREATEQ: // take the opposite as we change the order i--; - aCondition = aCondition + ::rtl::OUString::createFromAscii("<="); + aCondition = aCondition + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("<=")); break; default: break; @@ -1808,7 +1798,7 @@ namespace rParseIter.getColumnRange( pColumnRef, aColumnName, aTableRange ); sal_Bool bFound(sal_False); - DBG_ASSERT(aColumnName.getLength(),"Columnname darf nicht leer sein"); + OSL_ENSURE(aColumnName.getLength(),"Columnname darf nicht leer sein"); if (!aTableRange.getLength()) { // SELECT column, ... @@ -1861,7 +1851,7 @@ namespace sal_Bool InsertJoin(const OQueryDesignView* _pView, const ::connectivity::OSQLParseNode *pNode) { - DBG_ASSERT( SQL_ISRULE( pNode, qualified_join ) || SQL_ISRULE( pNode, joined_table ) || SQL_ISRULE( pNode, cross_union ), + OSL_ENSURE( SQL_ISRULE( pNode, qualified_join ) || SQL_ISRULE( pNode, joined_table ) || SQL_ISRULE( pNode, cross_union ), "OQueryDesignView::InsertJoin: Fehler im Parse Tree"); if (SQL_ISRULE(pNode,joined_table)) @@ -1888,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; } @@ -1995,7 +1985,7 @@ namespace Reference< XConnection> xConnection = rController.getConnection(); if ( !xConnection.is() ) { - DBG_ERROR( "InitFromParseNodeImpl: no connection? no connection!" ); + OSL_FAIL( "InitFromParseNodeImpl: no connection? no connection!" ); break; } @@ -2102,13 +2092,13 @@ namespace } catch(SQLException&) { - OSL_ASSERT(!"getMaxTablesInSelect!"); + OSL_FAIL("getMaxTablesInSelect!"); } } while ( false ); // Durch das Neuerzeugen wurden wieder Undo-Actions in den Manager gestellt - rController.getUndoMgr()->Clear(); + rController.ClearUndoManager(); _pSelectionBrw->Invalidate(); return eErrorCode; } @@ -2205,11 +2195,6 @@ namespace _pView->getLocale(), static_cast<sal_Char>(_pView->getDecimalSeparator().toChar()), &rController.getParser().getContext()); - //pColumnRef->parseNodeToStr( aColumns, - // xConnection, - // &rController.getParser().getContext(), - // sal_True, - // sal_True); // quote is to true because we need quoted elements inside the function sal_Int32 nFunctionType = FKT_NONE; ::connectivity::OSQLParseNode* pParamRef = NULL; @@ -2232,7 +2217,7 @@ namespace for(;aIter != aEnd;++aIter) { OQueryTableWindow* pTabWin = static_cast<OQueryTableWindow*>(aIter->second); - if (pTabWin->ExistsField( ::rtl::OUString::createFromAscii("*"), aInfo )) + if (pTabWin->ExistsField( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")), aInfo )) { aInfo->SetAlias(String()); aInfo->SetTable(String()); @@ -2279,7 +2264,7 @@ namespace eErrorCode = _pView->InsertField(aInfo, sal_True, bFirstField); bFirstField = sal_False; } - else //if(SQL_ISRULE(pColumnRef,num_value_exp) || SQL_ISRULE(pColumnRef,term)) + else { ::rtl::OUString aColumns; pColumnRef->parseNodeToStr( aColumns, @@ -2312,7 +2297,7 @@ namespace break; } - DBG_ERROR( "InstallFields: don't know how to interpret this parse node!" ); + OSL_FAIL( "InstallFields: don't know how to interpret this parse node!" ); } while ( false ); } @@ -2468,7 +2453,7 @@ namespace //------------------------------------------------------------------------------ String getParseErrorMessage( SqlParseError _eErrorCode ) { - USHORT nResId; + sal_uInt16 nResId; switch(_eErrorCode) { case eIllegalJoin: @@ -2771,7 +2756,7 @@ sal_Int32 OQueryDesignView::getColWidth(sal_uInt16 _nColPos) const //------------------------------------------------------------------------------ void OQueryDesignView::fillValidFields(const ::rtl::OUString& sAliasName, ComboBox* pFieldList) { - DBG_ASSERT(pFieldList != NULL, "OQueryDesignView::FillValidFields : What the hell do you think I can do with a NULL-ptr ? This will crash !"); + OSL_ENSURE(pFieldList != NULL, "OQueryDesignView::FillValidFields : What the hell do you think I can do with a NULL-ptr ? This will crash !"); pFieldList->Clear(); sal_Bool bAllTables = sAliasName.getLength() == 0; @@ -2839,7 +2824,7 @@ sal_Bool OQueryDesignView::checkStatement() { sal_Bool bRet = sal_True; if ( m_pSelectionBox ) - bRet = m_pSelectionBox->Save(); // a error occured so we return no + bRet = m_pSelectionBox->Save(); // an error occurred so we return no return bRet; } //------------------------------------------------------------------------------- @@ -2890,7 +2875,7 @@ sal_Bool OQueryDesignView::checkStatement() const ::std::vector<OTableConnection*>* pConnList = m_pTableView->getTableConnections(); Reference< XConnection> xConnection = rController.getConnection(); ::rtl::OUString aTableListStr(GenerateFromClause(xConnection,pTabList,pConnList)); - DBG_ASSERT(aTableListStr.getLength(), "OQueryDesignView::getStatement() : unerwartet : habe Felder, aber keine Tabellen !"); + OSL_ENSURE(aTableListStr.getLength(), "OQueryDesignView::getStatement() : unerwartet : habe Felder, aber keine Tabellen !"); // wenn es Felder gibt, koennen die nur durch Einfuegen aus einer schon existenten Tabelle entstanden sein; wenn andererseits // eine Tabelle geloescht wird, verschwinden auch die zugehoerigen Felder -> ergo KANN es das nicht geben, dass Felder // existieren, aber keine Tabellen (und aFieldListStr hat schon eine Laenge, das stelle ich oben sicher) @@ -2903,9 +2888,9 @@ sal_Bool OQueryDesignView::checkStatement() GenerateInnerJoinCriterias(xConnection,aJoinCrit,pConnList); if(aJoinCrit.getLength()) { - ::rtl::OUString aTmp = ::rtl::OUString::createFromAscii("( "); + ::rtl::OUString aTmp(RTL_CONSTASCII_USTRINGPARAM("( ")); aTmp += aJoinCrit; - aTmp += ::rtl::OUString::createFromAscii(" )"); + aTmp += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" )")); if(aCriteriaListStr.getLength()) { aTmp += C_AND; @@ -2914,16 +2899,16 @@ sal_Bool OQueryDesignView::checkStatement() aCriteriaListStr = aTmp; } // ----------------- Statement aufbauen ---------------------- - ::rtl::OUStringBuffer aSqlCmd(::rtl::OUString::createFromAscii("SELECT ")); + ::rtl::OUStringBuffer aSqlCmd(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SELECT "))); if(static_cast<OQueryController&>(getController()).isDistinct()) - aSqlCmd.append(::rtl::OUString::createFromAscii(" DISTINCT ")); + aSqlCmd.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" DISTINCT "))); aSqlCmd.append(aFieldListStr); - aSqlCmd.append(::rtl::OUString::createFromAscii(" FROM ")); + aSqlCmd.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" FROM "))); aSqlCmd.append(aTableListStr); if (aCriteriaListStr.getLength()) { - aSqlCmd.append(::rtl::OUString::createFromAscii(" WHERE ")); + aSqlCmd.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" WHERE "))); aSqlCmd.append(aCriteriaListStr.makeStringAndClear()); } // ----------------- GroupBy aufbauen und Anh"angen ------------ @@ -2938,7 +2923,7 @@ sal_Bool OQueryDesignView::checkStatement() // ----------------- having Anh"angen ------------ if(aHavingStr.getLength()) { - aSqlCmd.append(::rtl::OUString::createFromAscii(" HAVING ")); + aSqlCmd.append(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" HAVING "))); aSqlCmd.append(aHavingStr.makeStringAndClear()); } // ----------------- Sortierung aufbauen und Anh"angen ------------ @@ -3029,7 +3014,6 @@ void OQueryDesignView::SaveUIConfig() { OQueryController& rCtrl = static_cast<OQueryController&>(getController()); rCtrl.SaveTabWinsPosSize( m_pTableView->GetTabWinMap(), m_pScrollWindow->GetHScrollBar()->GetThumbPos(), m_pScrollWindow->GetVScrollBar()->GetThumbPos() ); - // rCtrl.SaveTabFieldsWidth( m_pSelectionBox ); rCtrl.setVisibleRows( m_pSelectionBox->GetNoneVisibleRows() ); if ( m_aSplitter.GetSplitPosPixel() != 0 ) rCtrl.setSplitPos( m_aSplitter.GetSplitPosPixel() ); @@ -3165,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 93775a1be43e..6f9a45d59228 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 42a2e738bc53..186c522279d5 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 953cab5fa552..599afe015379 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,17 +125,13 @@ 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(); } // ----------------------------------------------------------------------------- - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx index 1fa0df1f3a01..7afb6811e810 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 b4b0506950ca..302b57cef86d 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -32,8 +32,8 @@ #include "QueryTableView.hxx" #include "TableFieldInfo.hxx" #include "TableFieldDescription.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "QTableWindow.hxx" #include "QTableConnection.hxx" @@ -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()); @@ -198,7 +198,7 @@ namespace Reference<XPropertySet> xColumn; if ( !( _rxSourceForeignKeyColumns->getByName(*pIter) >>= xColumn ) ) { - OSL_ENSURE( false, "addConnections: invalid foreign key column!" ); + OSL_FAIL( "addConnections: invalid foreign key column!" ); continue; } @@ -212,7 +212,7 @@ namespace if(aFind.getLength()) pNewConnData->SetFieldIndex(JTCS_FROM,aFind[0]+1); else - OSL_ENSURE(0,"Column not found!"); + OSL_FAIL("Column not found!"); } // get the position inside the tabe Reference<XNameAccess> xRefColumns = _rDest.GetOriginalColumns(); @@ -222,7 +222,7 @@ namespace if(aFind.getLength()) pNewConnData->SetFieldIndex(JTCS_TO,aFind[0]+1); else - OSL_ENSURE(0,"Column not found!"); + OSL_FAIL("Column not found!"); } pNewConnData->AppendConnLine(*pIter,sRelatedColumn); @@ -236,7 +236,6 @@ namespace // automatically remove all connections adjacent to the win. // (Because of this automatism we would have an ownerhsip ambiguity for // the connection data if we would insert the conn-Undo-Action) - // FS - 21.10.99 - 69183 } } } @@ -284,7 +283,7 @@ void OQueryTableView::ReSync() { DBG_CHKTHIS(OQueryTableView,NULL); TTableWindowData* pTabWinDataList = m_pView->getController().getTableWindowData(); - DBG_ASSERT((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0), + OSL_ENSURE((getTableConnections()->size()==0) && (GetTabWinMap()->size()==0), "vor OQueryTableView::ReSync() bitte ClearAll aufrufen !"); // ich brauche eine Sammlung aller Fensternamen, deren Anlegen schief geht, damit ich die entsprechenden Connections @@ -440,7 +439,7 @@ void OQueryTableView::AddTabWin(const ::rtl::OUString& _rTableName, const ::rtl: } catch(SQLException&) { - OSL_ASSERT(!"qualifiedNameComponents"); + OSL_FAIL("qualifiedNameComponents"); } } // ----------------------------------------------------------------------------- @@ -477,7 +476,7 @@ Reference<XPropertySet> getKeyReferencedTo(const Reference<XIndexAccess>& _rxKey void OQueryTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& _rTableName, const ::rtl::OUString& strAlias, sal_Bool bNewTable) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(_rTableName.getLength() || strAlias.getLength(), "OQueryTableView::AddTabWin : kein Tabellen- und kein Aliasname !"); + OSL_ENSURE(_rTableName.getLength() || strAlias.getLength(), "OQueryTableView::AddTabWin : kein Tabellen- und kein Aliasname !"); // wenn der Tabellenname nicht gesetzt ist, steht das fuer ein Dummy-Fenster, das braucht aber wenigstens einen Alias-Namen // neue Datenstruktur erzeugen @@ -691,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 ); @@ -701,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()]); @@ -753,7 +752,7 @@ void OQueryTableView::KeyInput( const KeyEvent& rEvt ) OQueryTableWindow* OQueryTableView::FindTable(const String& rAliasName) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(rAliasName.Len(), "OQueryTableView::FindTable : der AliasName sollte nicht leer sein !"); + OSL_ENSURE(rAliasName.Len(), "OQueryTableView::FindTable : der AliasName sollte nicht leer sein !"); // (nicht dass es schadet, aber es ist sinnlos und weist vielleicht auf Fehler beim Aufrufer hin) OTableWindowMap::const_iterator aIter = GetTabWinMap()->find(rAliasName); if(aIter != GetTabWinMap()->end()) @@ -781,13 +780,13 @@ sal_Bool OQueryTableView::FindTableFromField(const String& rFieldName, OTableFie void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(pTabWin != NULL, "OQueryTableView::RemoveTabWin : Fenster sollte ungleich NULL sein !"); + OSL_ENSURE(pTabWin != NULL, "OQueryTableView::RemoveTabWin : Fenster sollte ungleich NULL sein !"); // 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); @@ -800,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()) { @@ -832,8 +831,6 @@ void OQueryTableView::GetConnection(OQueryTableConnection* pConn) // bei mir und dem Dokument einfuegen addConnection( pConn ); - // invalidieren (damit es neu gezeichnet wird) - // pConn->Invalidate(); } //------------------------------------------------------------------------ @@ -850,7 +847,7 @@ void OQueryTableView::HideTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUndoAc { DBG_CHKTHIS(OQueryTableView,NULL); OTableWindowMap* pTabWins = GetTabWinMap(); - DBG_ASSERT(pTabWins != NULL, "OQueryTableView::HideTabWin : habe keine TabWins !"); + OSL_ENSURE(pTabWins != NULL, "OQueryTableView::HideTabWin : habe keine TabWins !"); if (pTabWin) { @@ -931,7 +928,7 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn if (pTabWin->Init()) { TTableWindowData::value_type pData = pTabWin->GetData(); - DBG_ASSERT(pData != NULL, "OQueryTableView::ShowTabWin : TabWin hat keine Daten !"); + OSL_ENSURE(pData != NULL, "OQueryTableView::ShowTabWin : TabWin hat keine Daten !"); // Wenn die Daten schon PosSize haben, diese benutzen if (pData->HasPosition() && pData->HasSize()) { @@ -963,9 +960,6 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn for(;aIter != aEnd;++aIter) addConnection(*aIter); // add all connections from the undo action - // each connection should invalidated inside addConnection so we don't need this here any longer -// if ( !pOwnList->empty() ) -// InvalidateConnections(); pTableCon->clear(); // und die Daten des Fensters ebenfalls in Liste (des Docs) @@ -1001,7 +995,7 @@ sal_Bool OQueryTableView::ShowTabWin( OQueryTableWindow* pTabWin, OQueryTabWinUn void OQueryTableView::InsertField(const OTableFieldDescRef& rInfo) { DBG_CHKTHIS(OQueryTableView,NULL); - DBG_ASSERT(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !"); + OSL_ENSURE(getDesignView() != NULL, "OQueryTableView::InsertField : habe kein Parent !"); static_cast<OQueryDesignView*>(getDesignView())->InsertField(rInfo); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index cd2e92a4d2cd..3f403a4c4892 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -57,12 +57,11 @@ 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 ) ); m_pEdit->Show(); - // m_pEdit->GrabFocus(); } // ----------------------------------------------------------------------------- OQueryTextView::~OQueryTextView() diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx index 792d283ee8a3..0ad058656489 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 9ff9b6133430..f48ff8767b50 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -39,7 +39,6 @@ #include "TableFieldInfo.hxx" #include "dbu_qry.hrc" #include "dbaccess_helpid.hrc" -#include <tools/debug.hxx> #include <com/sun/star/container/XNameAccess.hpp> #include "dbustrings.hrc" #include "QTableWindow.hxx" @@ -51,6 +50,7 @@ #include <comphelper/extract.hxx> #include "sqlmessage.hxx" #include "UITools.hxx" +#include <osl/diagnose.h> using namespace ::svt; using namespace ::dbaui; @@ -136,7 +136,6 @@ OSelectionBrowseBox::OSelectionBrowseBox( Window* pParent ) | BROWSER_HEADERBAR_NEW ; m_pTextCell = new Edit(&GetDataWindow(), 0); - // m_pTextCell->EnableSpecialCheck(sal_False); m_pVisibleCell = new CheckBoxControl(&GetDataWindow()); m_pTableCell = new ListBoxControl(&GetDataWindow()); m_pTableCell->SetDropDownLineCount( 20 ); m_pFieldCell = new ComboBoxControl(&GetDataWindow()); m_pFieldCell->SetDropDownLineCount( 20 ); @@ -153,9 +152,6 @@ OSelectionBrowseBox::OSelectionBrowseBox( Window* pParent ) // TriState der ::com::sun::star::form::CheckBox abschalten m_pVisibleCell->GetBox().EnableTriState( sal_False ); -// m_pEmptyEntry = new OTableFieldDesc(); -// m_pEmptyEntry->SetColWidth(DEFAULT_SIZE); - Font aTitleFont = OutputDevice::GetDefaultFont( DEFAULTFONT_SANS_UNICODE,Window::GetSettings().GetLanguage(),DEFAULTFONT_FLAGS_ONLYONE); aTitleFont.SetSize(Size(0, 6)); SetTitleFont(aTitleFont); @@ -217,11 +213,11 @@ void OSelectionBrowseBox::initialize() m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";")); m_aFunctionStrings += String(ByteString(rContext.getIntlKeywordAscii(eFunctions[i])),RTL_TEXTENCODING_UTF8); - } // for (sal_Int32 i = 0; i < SAL_N_ELEMENTS(eFunctions) ; ++i) + } m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";")); m_aFunctionStrings += sGroup; - // Diese Funktionen stehen nur unter CORE zur Verfgung + // Diese Funktionen stehen nur unter CORE zur Verf�gung if ( lcl_SupportsCoreSQLGrammar(xConnection) ) { xub_StrLen nCount = m_aFunctionStrings.GetTokenCount(); @@ -307,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) @@ -336,11 +332,11 @@ void OSelectionBrowseBox::ColumnMoved( USHORT nColId,BOOL _bCreateUndo ) pUndoAct->SetTabFieldDescr(pOldEntry); getDesignView()->getController().addUndoActionAndInvalidate(pUndoAct); - } // if ( !m_bInUndoMode && _bCreateUndo ) + } } } else - OSL_ENSURE(0,"Invalid column id!"); + OSL_FAIL("Invalid column id!"); } //------------------------------------------------------------------------------ void OSelectionBrowseBox::Init() @@ -367,7 +363,7 @@ void OSelectionBrowseBox::Init() const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); if ( aTemp.Height() > aHeight.Height() ) aHeight.Height() = aTemp.Height(); - } // for(int i= 0; i < SAL_N_ELEMENTS(pControls);++i + } SetDataRowHeight(aHeight.Height()); SetTitleLines(1); // Anzahl der sichtbaren Zeilen ermitteln @@ -391,7 +387,7 @@ void OSelectionBrowseBox::Init() } catch(const SQLException&) { - OSL_ENSURE(0,"Catched Exception when asking for database metadata options!"); + OSL_FAIL("Catched Exception when asking for database metadata options!"); m_nMaxColumns = 0; } } @@ -455,7 +451,7 @@ CellController* OSelectionBrowseBox::GetController(long nRow, sal_uInt16 nColId) if ( nColId > getFields().size() ) return NULL; OTableFieldDescRef pEntry = getFields()[nColId-1]; - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::GetController : keine FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::GetController : keine FieldDescription !"); if (!pEntry.is()) return NULL; @@ -488,11 +484,11 @@ 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]; - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::InitController : keine FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::InitController : keine FieldDescription !"); long nCellIndex = GetRealRow(nRow); switch (nCellIndex) @@ -560,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: @@ -578,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] ) @@ -593,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()) ) { @@ -644,7 +640,7 @@ sal_Bool OSelectionBrowseBox::fillColumnRef(const ::rtl::OUString& _sColumnName, if ( pTabWinList ) { sal_uInt16 nTabCount = 0; - if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occured: column not in table window + if ( !static_cast<OQueryTableView*>(getDesignView()->getTableView())->FindTableFromField(_sColumnName,_pEntry,nTabCount) ) // error occurred: column not in table window { String sErrorMsg(ModuleRes(RID_STR_FIELD_DOESNT_EXIST)); sErrorMsg.SearchAndReplaceAscii("$name$",_sColumnName); @@ -716,7 +712,7 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes if ( _pEntry->isAggreateFunction() ) { - DBG_ASSERT(_pEntry->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); + OSL_ENSURE(_pEntry->GetFunction().getLength(),"Functionname darf hier nicht leer sein! ;-("); ::rtl::OUStringBuffer aTmpStr2( _pEntry->GetFunction()); aTmpStr2.appendAscii("("); aTmpStr2.append(sSql); @@ -758,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() ) { @@ -850,7 +846,7 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes notifyFunctionFieldChanged(sOldLocalizedFunctionName,sLocalizedFunctionName,_bListAction, nColumnId); } else - OSL_ENSURE(0,"Unsupported function inserted!"); + OSL_FAIL("Unsupported function inserted!"); } else @@ -923,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; @@ -976,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 @@ -1005,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 @@ -1072,7 +1068,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() { strOldCellContents = pEntry->GetFunction(); sal_uInt16 nPos = m_pFunctionCell->GetSelectEntryPos(); - // Diese Funktionen stehen nur unter CORE zur Verfgung + // 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; @@ -1194,7 +1190,6 @@ sal_Bool OSelectionBrowseBox::SaveModified() bError = sal_True; } } - // } } strOldCellContents = pEntry->GetCriteria(nIdx); pEntry->SetCriteria(nIdx, aCrit); @@ -1210,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; } @@ -1232,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; } @@ -1262,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]; @@ -1294,14 +1289,14 @@ 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 - DBG_ASSERT((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::RemoveColumn : invalid parameter nColId"); + 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 sal_uInt16 nCurCol = GetCurColumnId(); @@ -1334,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)) ; @@ -1357,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() ) @@ -1431,7 +1426,7 @@ sal_Int8 OSelectionBrowseBox::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) { if ( IsEditing() ) { - // #100271# OJ allow the asterix again + // allow the asterix again m_bDisableErrorBox = sal_True; SaveModified(); m_bDisableErrorBox = sal_False; @@ -1453,7 +1448,7 @@ sal_Int8 OSelectionBrowseBox::ExecuteDrop( const BrowserExecuteDropEvent& _rEvt TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable); if (!OJoinExchObj::isFormatAvailable(aDropped.GetDataFlavorExVector())) { - DBG_ERROR("OSelectionBrowseBox::ExecuteDrop: this should never have passed AcceptDrop!"); + OSL_FAIL("OSelectionBrowseBox::ExecuteDrop: this should never have passed AcceptDrop!"); return DND_ACTION_NONE; } @@ -1476,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); @@ -1500,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 ) ) @@ -1552,11 +1547,11 @@ 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 - DBG_ASSERT(_nColumnPostion == BROWSER_INVALIDID || (_nColumnPostion <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId."); + OSL_ENSURE(_nColumnPostion == BROWSER_INVALIDID || (_nColumnPostion <= (long)getFields().size()), "OSelectionBrowseBox::InsertColumn : invalid parameter nColId."); // -1 heisst ganz hinten, Count heisst ganz hinten, der Rest bezeichnet eine richtige Position sal_uInt16 nCurCol = GetCurColumnId(); @@ -1565,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 @@ -1585,15 +1580,15 @@ 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); - } // if ( pEntry->GetColumnId() != nColumnId ) + ColumnMoved(pEntry->GetColumnId(),sal_False); + } if ( pEntry->GetFunctionType() & (FKT_AGGREGATE) ) { @@ -1616,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()); @@ -1642,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); @@ -1688,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(); @@ -1709,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) @@ -1726,7 +1721,7 @@ void OSelectionBrowseBox::AddGroupBy( const OTableFieldDescRef& rInfo , sal_uInt if(!xConnection.is()) return; DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(!rInfo->IsEmpty(),"AddGroupBy:: OTableFieldDescRef sollte nicht Empty sein!"); + OSL_ENSURE(!rInfo->IsEmpty(),"AddGroupBy:: OTableFieldDescRef sollte nicht Empty sein!"); OTableFieldDescRef pEntry; const Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); const ::comphelper::UStringMixEqual bCase(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); @@ -1793,13 +1788,13 @@ 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; } m_bVisibleRow[BROW_CRIT1_ROW + nNewLevel] = sal_True; - } // if (!pEntry->GetCriteria(nLevel).getLength() ) - } // for(;aIter != getFields().end();++aIter) + } + } } //------------------------------------------------------------------------------ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const String& rValue, const sal_uInt16 nLevel,bool _bAddOrOnOneLine ) @@ -1808,7 +1803,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S if(!xConnection.is()) return; DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(rInfo.is() && !rInfo->IsEmpty(),"AddCondition:: OTableFieldDescRef sollte nicht Empty sein!"); + OSL_ENSURE(rInfo.is() && !rInfo->IsEmpty(),"AddCondition:: OTableFieldDescRef sollte nicht Empty sein!"); OTableFieldDescRef pLastEntry; Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); @@ -1833,7 +1828,6 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pEntry->SetGroupBy(sal_False); else { -// pEntry->SetGroupBy(rInfo->IsGroupBy()); if(!m_bGroupByUnRelated && pEntry->IsGroupBy()) pEntry->SetVisible(sal_True); } @@ -1842,19 +1836,19 @@ 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; } m_bVisibleRow[BROW_CRIT1_ROW + nLevel] = sal_True; break; - } // if (!pEntry->GetCriteria(nLevel).getLength() ) + } if ( _bAddOrOnOneLine ) { pLastEntry = pEntry; } } - } // for(;aIter != getFields().end();++aIter) + } if ( pLastEntry.is() ) { String sCriteria = rValue; @@ -1870,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; } @@ -1887,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; } @@ -1902,7 +1896,7 @@ void OSelectionBrowseBox::AddOrder( const OTableFieldDescRef& rInfo, const EOrde if(!xConnection.is()) return; DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(!rInfo->IsEmpty(),"AddOrder:: OTableFieldDescRef sollte nicht Empty sein!"); + OSL_ENSURE(!rInfo->IsEmpty(),"AddOrder:: OTableFieldDescRef sollte nicht Empty sein!"); OTableFieldDescRef pEntry; Reference<XDatabaseMetaData> xMeta = xConnection->getMetaData(); ::comphelper::UStringMixEqual bCase(xMeta.is() && xMeta->supportsMixedCaseQuotedIdentifiers()); @@ -1995,7 +1989,7 @@ void OSelectionBrowseBox::CellModified() void OSelectionBrowseBox::Fill() { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(ColCount() >= 1, "OSelectionBrowseBox::Fill : please call only after inserting the handle column !"); + OSL_ENSURE(ColCount() >= 1, "OSelectionBrowseBox::Fill : please call only after inserting the handle column !"); sal_uInt16 nColCount = ColCount() - 1; if (nColCount < DEFAULT_QUERY_COLS) @@ -2028,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 ) ); @@ -2115,7 +2109,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) //------------------------------------------------------------------------------ sal_Bool OSelectionBrowseBox::IsRowVisible(sal_uInt16 _nWhich) const { - DBG_ASSERT(_nWhich<(m_bVisibleRow.size()), "OSelectionBrowseBox::IsRowVisible : invalid parameter !"); + OSL_ENSURE(_nWhich<(m_bVisibleRow.size()), "OSelectionBrowseBox::IsRowVisible : invalid parameter !"); return m_bVisibleRow[_nWhich]; } @@ -2123,7 +2117,7 @@ sal_Bool OSelectionBrowseBox::IsRowVisible(sal_uInt16 _nWhich) const void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - DBG_ASSERT(_nWhich<m_bVisibleRow.size(), "OSelectionBrowseBox::SetRowVisible : invalid parameter !"); + OSL_ENSURE(_nWhich<m_bVisibleRow.size(), "OSelectionBrowseBox::SetRowVisible : invalid parameter !"); sal_Bool bWasEditing = IsEditing(); if (bWasEditing) @@ -2151,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; @@ -2173,7 +2167,7 @@ long OSelectionBrowseBox::GetRealRow(long nRowId) const break; } } - DBG_ASSERT(nErg <= long(m_bVisibleRow.size()),"nErg kann nicht groesser als BROW_ROW_CNT sein!"); + OSL_ENSURE(nErg <= long(m_bVisibleRow.size()),"nErg kann nicht groesser als BROW_ROW_CNT sein!"); return i; } static long nVisibleRowMask[] = @@ -2217,10 +2211,10 @@ 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]; - DBG_ASSERT(pEntry != NULL, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... "); + OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... "); if ( pEntry->IsEmpty() ) return String(); @@ -2244,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; @@ -2336,16 +2330,15 @@ 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); - // DBG_ASSERT(nCellIndex < (GetRowCount()-1),"CellIndex ist zu gross"); if ( GetCurColumnId() == nColId && !m_bInUndoMode ) SaveModified(); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos - 1]; - DBG_ASSERT(pEntry != NULL, "OSelectionBrowseBox::GetCellContents : invalid column id, prepare for GPF ... "); + OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellContents : invalid column id, prepare for GPF ... "); switch (nCellIndex) { @@ -2364,16 +2357,16 @@ 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); - DBG_ASSERT(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); + OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); switch (nRow) @@ -2421,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) @@ -2455,10 +2448,10 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) // but the changes aren't permanent ... DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); - DBG_ASSERT(nPos <= getFields().size(),"ColumnResized:: nColId sollte nicht groesser als List::count sein!"); + sal_uInt16 nPos = GetColumnPos(nColId); + OSL_ENSURE(nPos <= getFields().size(),"ColumnResized:: nColId sollte nicht groesser als List::count sein!"); OTableFieldDescRef pEntry = getEntry(nPos-1); - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::ColumnResized : keine FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::ColumnResized : keine FieldDescription !"); static_cast<OQueryController&>(getDesignView()->getController()).setModified( sal_True ); EditBrowseBox::ColumnResized(nColId); @@ -2480,11 +2473,11 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); - DBG_ASSERT((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); + sal_uInt16 nPos = GetColumnPos(nColId); + OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); OTableFieldDescRef pEntry = getFields()[nPos-1]; - DBG_ASSERT(pEntry.is(), "OSelectionBrowseBox::GetTotalCellWidth : invalid FieldDescription !"); + OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::GetTotalCellWidth : invalid FieldDescription !"); long nRow = GetRealRow(nRowId); String strText(GetCellText(nRow, nColId)); @@ -2599,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); } @@ -2650,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(); @@ -2664,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() @@ -2690,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; @@ -2761,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 Verfgung + // 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 4ecb2e8e0245..fc361d5fc16f 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); @@ -259,7 +259,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> @return - <TRUE/> if an error occured otherwise <FALSE/> + <TRUE/> if an error occurred otherwise <FALSE/> */ sal_Bool saveField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction); @@ -283,7 +283,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> @return - <TRUE/> if an error occured otherwise <FALSE/> + <TRUE/> if an error occurred otherwise <FALSE/> */ sal_Bool fillColumnRef( const ::connectivity::OSQLParseNode* _pColumnRef, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection, @@ -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 964b54d00f25..db6a8efd328c 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 f097c35eb6f1..d820c5efa280 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -30,6 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "TableConnectionData.hxx" #include <tools/debug.hxx> +#include <osl/diagnose.h> #include <comphelper/stl_types.hxx> using namespace dbaui; @@ -60,8 +61,8 @@ void OTableConnectionData::Init() { ////////////////////////////////////////////////////////////////////// // LineDataList mit Defaults initialisieren - DBG_ASSERT(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); - ResetConnLines(TRUE); + OSL_ENSURE(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); + ResetConnLines(sal_True); // das legt Defaults an } //------------------------------------------------------------------------ @@ -83,7 +84,6 @@ OTableConnectionData::~OTableConnectionData() DBG_DTOR(OTableConnectionData,NULL); // LineDataList loeschen OConnectionLineDataVec().swap(m_vConnLineData); - //ResetConnLines(FALSE); } //------------------------------------------------------------------------ @@ -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,26 +111,26 @@ 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) return AppendConnLine(rSourceFieldName, rDestFieldName); OConnectionLineDataRef pConnLineData = m_vConnLineData[nIndex]; - DBG_ASSERT(pConnLineData != NULL, "OTableConnectionData::SetConnLine : habe ungueltiges LineData-Objekt"); + OSL_ENSURE(pConnLineData != NULL, "OTableConnectionData::SetConnLine : habe ungueltiges LineData-Objekt"); 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 1c0dd80e93f8..57185506f84c 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -34,8 +34,8 @@ #include "QueryDesignView.hxx" #include "TableWindowData.hxx" #include "imageprovider.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/svapp.hxx> #include <vcl/wall.hxx> @@ -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); @@ -121,7 +121,7 @@ OTableWindow::~OTableWindow() OSL_ENSURE(m_pListBox->GetEntryCount()==0,"Forgot to call EmptyListbox()!"); ::std::auto_ptr<Window> aTemp(m_pListBox); m_pListBox = NULL; - } // if (m_pListBox) + } if ( m_pContainerListener.is() ) m_pContainerListener->dispose(); @@ -178,7 +178,7 @@ OTableWindowListBox* OTableWindow::CreateListBox() } //------------------------------------------------------------------------------ -BOOL OTableWindow::FillListBox() +sal_Bool OTableWindow::FillListBox() { m_pListBox->Clear(); if ( !m_pContainerListener.is() ) @@ -188,13 +188,13 @@ BOOL OTableWindow::FillListBox() m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer); } // mark all primary keys with special image - ModuleRes TmpRes(isHiContrast(m_pListBox) ? IMG_JOINS_H : IMG_JOINS); + ModuleRes TmpRes(IMG_JOINS); ImageList aImageList(TmpRes); Image aPrimKeyImage = aImageList.GetImage(IMG_PRIMARY_KEY); if (GetData()->IsShowAll()) { - SvLBoxEntry* pEntry = m_pListBox->InsertEntry( ::rtl::OUString::createFromAscii("*") ); + SvLBoxEntry* pEntry = m_pListBox->InsertEntry( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*")) ); pEntry->SetUserData( createUserData(NULL,false) ); } @@ -205,7 +205,7 @@ BOOL OTableWindow::FillListBox() } catch(Exception&) { - OSL_ENSURE(0,"Exception occured!"); + OSL_FAIL("Exception occurred!"); } try { @@ -234,10 +234,10 @@ BOOL OTableWindow::FillListBox() } catch(Exception&) { - OSL_ENSURE(0,"Exception occured!"); + OSL_FAIL("Exception occurred!"); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/) @@ -273,28 +273,27 @@ void OTableWindow::impl_updateImage() { ImageProvider aImageProvider( getDesignView()->getController().getConnection() ); - Image aImage, aImageHC; - aImageProvider.getImages( GetComposedName(), m_pData->isQuery() ? DatabaseObject::QUERY : DatabaseObject::TABLE, aImage, aImageHC ); + Image aImage; + aImageProvider.getImages( GetComposedName(), m_pData->isQuery() ? DatabaseObject::QUERY : DatabaseObject::TABLE, aImage ); - if ( !aImage || !aImageHC ) + if ( !aImage ) { - OSL_ENSURE( false, "OTableWindow::impl_updateImage: no images!" ); + OSL_FAIL( "OTableWindow::impl_updateImage: no images!" ); return; } - m_aTypeImage.SetModeImage( aImage, BMP_COLOR_NORMAL ); - m_aTypeImage.SetModeImage( aImageHC, BMP_COLOR_HIGHCONTRAST ); + m_aTypeImage.SetModeImage( aImage ); m_aTypeImage.Show(); } //------------------------------------------------------------------------------ -BOOL OTableWindow::Init() +sal_Bool OTableWindow::Init() { // create list box if necessary if ( !m_pListBox ) { m_pListBox = CreateListBox(); - DBG_ASSERT( m_pListBox != NULL, "OTableWindow::Init() : CreateListBox hat NULL geliefert !" ); + OSL_ENSURE( m_pListBox != NULL, "OTableWindow::Init() : CreateListBox hat NULL geliefert !" ); m_pListBox->SetSelectionMode( MULTIPLE_SELECTION ); } @@ -306,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(); @@ -360,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 ) { @@ -510,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 ); @@ -532,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); } //------------------------------------------------------------------------------ @@ -545,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); } @@ -649,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: @@ -671,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; } @@ -766,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/TableWindowAccess.cxx b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx index aad8a07fa4cc..44b3953b57e8 100644 --- a/dbaccess/source/ui/querydesign/TableWindowAccess.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowAccess.cxx @@ -49,7 +49,6 @@ namespace dbaui using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; - // using namespace ::com::sun::star::awt; using namespace ::com::sun::star; OTableWindowAccess::OTableWindowAccess(OTableWindow* _pTable) @@ -100,14 +99,14 @@ namespace dbaui Sequence< ::rtl::OUString > OTableWindowAccess::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString > aSupported(2); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.accessibility.Accessible"); - aSupported[1] = ::rtl::OUString::createFromAscii("com.sun.star.accessibility.AccessibleContext"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.Accessible")); + aSupported[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.accessibility.AccessibleContext")); return aSupported; } // ----------------------------------------------------------------------------- ::rtl::OUString OTableWindowAccess::getImplementationName_Static(void) throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.TableWindowAccessibility"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.TableWindowAccessibility")); } // ----------------------------------------------------------------------------- // XAccessibleContext diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx index 6a9d63372a88..56cad8c62fff 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 936148c5ed93..9d0f29701421 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -34,7 +34,7 @@ #include "QueryTableView.hxx" #include "querycontroller.hxx" #include "JoinExchange.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include <com/sun/star/sdbc/XDatabaseMetaData.hpp> #include <svx/dbexch.hrc> #include <vcl/svapp.hxx> @@ -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 @@ -77,7 +77,7 @@ OTableWindowListBox::OTableWindowListBox( OTableWindow* pParent ) void OTableWindowListBox::dragFinished( ) { // first show the error msg when existing - m_pTabWin->getDesignView()->getController().showError(m_pTabWin->getDesignView()->getController().clearOccuredError()); + m_pTabWin->getDesignView()->getController().showError(m_pTabWin->getDesignView()->getController().clearOccurredError()); // second look for ui activities which should happen after d&d if (m_nUiEvent) Application::RemoveUserEvent(m_nUiEvent); @@ -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: @@ -166,7 +166,6 @@ long OTableWindowListBox::PreNotify(NotifyEvent& rNEvt) if(m_pTabWin) { bHandled = m_pTabWin->HandleKeyInput(*pKeyEvent); - // bHandled = TRUE; } break; } @@ -195,8 +194,7 @@ IMPL_LINK( OTableWindowListBox, ScrollUpHdl, SvTreeListBox*, /*pBox*/ ) { ScrollOutputArea( -1 ); pEntry = GetEntry( m_aMousePos ); - Select( pEntry, TRUE ); -// m_aScrollTimer.Start(); + Select( pEntry, sal_True ); } return 0; @@ -213,8 +211,7 @@ IMPL_LINK( OTableWindowListBox, ScrollDownHdl, SvTreeListBox*, /*pBox*/ ) { ScrollOutputArea( 1 ); pEntry = GetEntry( m_aMousePos ); - Select( pEntry, TRUE ); -// m_aScrollTimer.Start(); + Select( pEntry, sal_True ); } return 0; @@ -226,7 +223,7 @@ void OTableWindowListBox::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPi OJoinTableView* pCont = m_pTabWin->getTableView(); if (!pCont->getDesignView()->getController().isReadOnly() && pCont->getDesignView()->getController().isConnected()) { - // #100271# OJ asterix was not allowed to be copied to selection browsebox + // asterix was not allowed to be copied to selection browsebox sal_Bool bFirstNotAllowed = FirstSelected() == First() && m_pTabWin->GetData()->IsShowAll(); EndSelection(); // create a description of the source @@ -247,10 +244,9 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) && OJoinExchObj::isFormatAvailable(GetDataFlavorExVector(),SOT_FORMATSTR_ID_SBA_JOIN) ) { // don't drop into the window if it's the drag source itself - // remove the selection if the dragging operation is leaving the window if (_rEvt.mbLeaving) - SelectAll(FALSE); + SelectAll(sal_False); else { // hit test @@ -292,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()) )) @@ -326,7 +322,7 @@ IMPL_LINK( OTableWindowListBox, DropHdl, void *, /*EMPTY_ARG*/) catch(const SQLException& e) { // remember the exception so that we can show them later when d&d is finished - m_pTabWin->getDesignView()->getController().setErrorOccured(::dbtools::SQLExceptionInfo(e)); + m_pTabWin->getDesignView()->getController().setErrorOccurred(::dbtools::SQLExceptionInfo(e)); } return 0L; } @@ -367,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()); @@ -381,7 +377,7 @@ IMPL_LINK( OTableWindowListBox, OnDoubleClick, SvTreeListBox *, /*pBox*/ ) { // meinem Elter Bescheid sagen Window* pParent = Window::GetParent(); - DBG_ASSERT(pParent != NULL, "OTableWindowListBox::OnDoubleClick : habe kein Parent !"); + OSL_ENSURE(pParent != NULL, "OTableWindowListBox::OnDoubleClick : habe kein Parent !"); static_cast<OTableWindow*>(pParent)->OnEntryDoubleClicked(GetHdlEntry()); diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index 48e9865dd1ce..6c740fb6c52d 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 ); } @@ -129,15 +129,6 @@ void OTableWindowTitle::Command( const CommandEvent& rEvt ) } //------------------------------------------------------------------------------ -//void OTableWindowTitle::Paint( const Rectangle& rRect ) -//{ -// ////////////////////////////////////////////////////////////////////// -// // Ausgabe des Textes in der Titelzeile -// Rectangle aWinRect( Point(0,0), GetSizePixel() ); -// DrawText( aWinRect, GetText(), TEXT_DRAW_CENTER|TEXT_DRAW_VCENTER|TEXT_DRAW_ENDELLIPSIS ); -//} - -//------------------------------------------------------------------------------ void OTableWindowTitle::KeyInput( const KeyEvent& rEvt ) { if ( m_pTabWin ) @@ -216,7 +207,4 @@ void OTableWindowTitle::StateChanged( StateChangedType nType ) } } - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/querydesign/makefile.mk b/dbaccess/source/ui/querydesign/makefile.mk index 36e36c960023..a4a39c36a79c 100644 --- a/dbaccess/source/ui/querydesign/makefile.mk +++ b/dbaccess/source/ui/querydesign/makefile.mk @@ -38,42 +38,42 @@ TARGET=querydesign # --- Files -------------------------------------------------------- EXCEPTIONSFILES =\ + $(SLO)$/ConnectionLine.obj \ $(SLO)$/ConnectionLineAccess.obj \ - $(SLO)$/TableWindowAccess.obj \ - $(SLO)$/JAccess.obj \ - $(SLO)$/JoinDesignView.obj \ - $(SLO)$/JoinController.obj \ - $(SLO)$/QueryDesignView.obj \ - $(SLO)$/SelectionBrowseBox.obj \ - $(SLO)$/querydlg.obj \ - $(SLO)$/QueryTabWinUndoAct.obj \ + $(SLO)$/JAccess.obj \ + $(SLO)$/JoinController.obj \ + $(SLO)$/JoinDesignView.obj \ + $(SLO)$/JoinExchange.obj \ + $(SLO)$/JoinTableView.obj \ + $(SLO)$/QTableConnection.obj \ + $(SLO)$/QTableConnectionData.obj \ + $(SLO)$/QTableWindow.obj \ + $(SLO)$/QTableWindowData.obj \ + $(SLO)$/QueryDesignView.obj \ $(SLO)$/QueryMoveTabWinUndoAct.obj \ $(SLO)$/QueryTabConnUndoAction.obj \ + $(SLO)$/QueryTabWinUndoAct.obj \ + $(SLO)$/QueryTableView.obj \ + $(SLO)$/QueryTextView.obj \ + $(SLO)$/QueryViewSwitch.obj \ + $(SLO)$/SelectionBrowseBox.obj \ + $(SLO)$/TableConnection.obj \ + $(SLO)$/TableConnectionData.obj \ $(SLO)$/TableFieldDescription.obj \ - $(SLO)$/JoinTableView.obj \ - $(SLO)$/QueryViewSwitch.obj \ - $(SLO)$/QueryTableView.obj \ - $(SLO)$/TableWindowData.obj \ - $(SLO)$/QTableWindow.obj \ - $(SLO)$/TableWindow.obj \ - $(SLO)$/JoinExchange.obj \ - $(SLO)$/TableWindowListBox.obj \ - $(SLO)$/TableWindowTitle.obj \ - $(SLO)$/QueryTextView.obj \ - $(SLO)$/QTableConnection.obj \ - $(SLO)$/querycontroller.obj \ + $(SLO)$/TableWindow.obj \ + $(SLO)$/TableWindowAccess.obj \ + $(SLO)$/TableWindowData.obj \ + $(SLO)$/TableWindowListBox.obj \ + $(SLO)$/TableWindowTitle.obj \ $(SLO)$/querycontainerwindow.obj \ - $(SLO)$/queryview.obj \ - $(SLO)$/TableConnection.obj \ - $(SLO)$/TableConnectionData.obj + $(SLO)$/querycontroller.obj \ + $(SLO)$/querydlg.obj \ + $(SLO)$/queryview.obj SLOFILES =\ - $(EXCEPTIONSFILES) \ - $(SLO)$/TableFieldInfo.obj \ - $(SLO)$/QTableConnectionData.obj \ - $(SLO)$/QTableWindowData.obj \ - $(SLO)$/ConnectionLine.obj \ - $(SLO)$/ConnectionLineData.obj + $(EXCEPTIONSFILES) \ + $(SLO)$/ConnectionLineData.obj \ + $(SLO)$/TableFieldInfo.obj SRS1NAME=$(TARGET) SRC1FILES = query.src \ diff --git a/dbaccess/source/ui/querydesign/query.src b/dbaccess/source/ui/querydesign/query.src index d8a2162e1d14..aae5a07545ae 100644 --- a/dbaccess/source/ui/querydesign/query.src +++ b/dbaccess/source/ui/querydesign/query.src @@ -97,27 +97,11 @@ Menu RID_QUERYCOLPOPUPMENU }; }; }; + ImageList IMG_JOINS { Prefix = "jo"; - MaskColor = Color { - Red = 0xffff; - Green = 0x0000; - Blue = 0xffff; - }; - IdList = { - IMG_PRIMARY_KEY; IMG_FOREIGN_KEY; - }; - IdCount = { 2; }; -}; -ImageList IMG_JOINS_H -{ - Prefix = "joh"; - MaskColor = Color { - Red = 0xffff; - Green = 0x0000; - Blue = 0xffff; - }; + MaskColor = Color { Red = 0xffff; Green = 0x0000; Blue = 0xffff; }; IdList = { IMG_PRIMARY_KEY; IMG_FOREIGN_KEY; }; @@ -161,6 +145,7 @@ String STR_QUERY_UNDO_TABFIELDCREATE { Text [ en-US ] = "Add Column" ; }; + String RID_STR_TABLE_DOESNT_EXIST { Text [ en-US ] = "Invalid expression, table '$name$' does not exist."; @@ -170,6 +155,7 @@ String RID_STR_FIELD_DOESNT_EXIST { Text [ en-US ] = "Invalid expression, field name '$name$' does not exist."; }; + String RID_STR_TOMUCHTABLES { Text [ en-US ] = "The query covers #num# tables. The selected database type, however, can only process a maximum of #maxnum# table(s) per statement."; @@ -184,10 +170,12 @@ String STR_QUERY_UNDO_MODIFY_CELL { Text [ en-US ] = "Edit Column Description"; }; + String STR_QUERY_UNDO_SIZE_COLUMN { Text [ en-US ] = "Adjust column width"; }; + String STR_QUERY_SORTTEXT { Text [ en-US ] = "(not sorted);ascending;descending" ; @@ -197,14 +185,17 @@ String STR_QUERY_FUNCTIONS { Text [ en-US ] = "(no function);Group"; }; + String STR_QUERY_NOTABLE { Text [ en-US ] = "(no table)"; }; + String STR_QRY_ORDERBY_UNRELATED { Text [ en-US ] = "The database only supports sorting for visible fields."; }; + Menu RID_QUERYFUNCTION_POPUPMENU { ItemList = @@ -243,6 +234,7 @@ Menu RID_QUERYFUNCTION_POPUPMENU }; }; }; + String STR_QUERY_HANDLETEXT { Text [ en-US ] = "Field;Alias;Table;Sort;Visible;Function;Criterion;Or;Or"; @@ -257,38 +249,47 @@ ErrorBox ERR_QRY_CRITERIA_ON_ASTERISK { Message [ en-US ] = "A condition cannot be applied to field [*]" ; }; + String STR_QRY_TOO_LONG_STATEMENT { Text [ en-US ] = "The SQL statement created is too long."; }; + String STR_QRY_TOOCOMPLEX { Text [ en-US ] = "Query is too complex" ; }; + String STR_QRY_NOSELECT { Text [ en-US ] = "Nothing has been selected." ; }; + String STR_QRY_TOOMANYCOND { Text [ en-US ] = "Too many search criteria" ; }; + String STR_QRY_SYNTAX { Text [ en-US ] = "SQL syntax error" ; }; + ErrorBox ERR_QRY_ORDERBY_ON_ASTERISK { Message [ en-US ] = "[*] cannot be used as a sort criterion."; }; + String STR_QUERY_TRUE { Text [ en-US ] = "TRUE" ; }; + String STR_QUERY_FALSE { Text [ en-US ] = "FALSE" ; }; + String STR_QRY_TOO_MANY_TABLES { Text [ en-US ] = "There are too many tables."; @@ -298,10 +299,12 @@ String STR_QRY_NATIVE { Text [ en-US ] = "The statement will not be applied when querying in the SQL dialect of the database." ; }; + ErrorBox ERR_QRY_AMB_FIELD { Message [ en-US ] = "Field name not found or not unique" ; }; + String STR_QRY_ILLEGAL_JOIN { Text [ en-US ] = "Join could not be processed" ; diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index 56343b778e0a..15fbc7611c75 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -86,12 +86,11 @@ namespace dbaui m_xBeamer = NULL; if(xCloseable.is()) xCloseable->close(sal_False); // false - holds the owner ship of this frame - // m_xBeamer->setComponent(NULL,NULL); - } - { - ::std::auto_ptr<Window> aTemp(m_pSplitter); - m_pSplitter = NULL; } + + ::std::auto_ptr<Window> aTemp(m_pSplitter); + m_pSplitter = NULL; + } // ----------------------------------------------------------------------------- bool OQueryContainerWindow::switchView( ::dbtools::SQLExceptionInfo* _pErrorInfo ) @@ -184,7 +183,7 @@ namespace dbaui // ----------------------------------------------------------------------------- long OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_GETFOCUS: @@ -207,7 +206,7 @@ namespace dbaui ::dbaui::notifySystemWindow(this,m_pBeamer,::comphelper::mem_fun(&TaskPaneList::AddWindow)); - Reference < XFrame > xBeamerFrame( m_pViewSwitch->getORB()->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.Frame")),UNO_QUERY ); + Reference < XFrame > xBeamerFrame( m_pViewSwitch->getORB()->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.Frame"))),UNO_QUERY ); m_xBeamer.set( xBeamerFrame ); OSL_ENSURE(m_xBeamer.is(),"No frame created!"); m_xBeamer->initialize( VCLUnoHelper::GetInterface ( m_pBeamer ) ); diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 82122c97aed1..054c854e846a 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -90,6 +90,7 @@ #include <svtools/localresaccess.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -124,12 +125,12 @@ namespace dbaui // need by registration static ::rtl::OUString getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OViewDesign"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OViewDesign")); } static Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.ViewDesign"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ViewDesign")); return aSupported; } static Reference< XInterface > SAL_CALL Create(const Reference< XMultiServiceFactory >& _rM) @@ -156,11 +157,11 @@ namespace dbaui if (!_pNode->isToken()) { // Regelnamen als rule: ... - rString = ::rtl::OUString::createFromAscii("RULE_ID: "); + rString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RULE_ID: ")); rString += ::rtl::OUString::valueOf( (sal_Int32)_pNode->getRuleID()); - rString+= ::rtl::OUString::createFromAscii("("); + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("(")); rString += OSQLParser::RuleIDToStr(_pNode->getRuleID()); - rString+= ::rtl::OUString::createFromAscii(")"); + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(")")); _pParent = _pBox->InsertEntry(rString,_pParent); @@ -181,53 +182,58 @@ namespace dbaui case SQL_NODE_KEYWORD: { - rString+= ::rtl::OUString::createFromAscii("SQL_KEYWORD:"); + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_KEYWORD:")); ::rtl::OString sT = OSQLParser::TokenIDToStr(_pNode->getTokenID()); rString += ::rtl::OUString(sT,sT.getLength(),RTL_TEXTENCODING_UTF8); break;} case SQL_NODE_COMPARISON: - {rString+= ::rtl::OUString::createFromAscii("SQL_COMPARISON:"); - rString += _pNode->getTokenValue(); // haenge Nodevalue an + { + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_COMPARISON:")); + rString += _pNode->getTokenValue(); // haenge Nodevalue an // und beginne neu Zeile - break;} + break;} case SQL_NODE_NAME: - {rString+= ::rtl::OUString::createFromAscii("SQL_NAME:"); - rString+= ::rtl::OUString::createFromAscii("\""); - rString += _pNode->getTokenValue(); - rString+= ::rtl::OUString::createFromAscii("\""); - - break;} + { + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_NAME:")); + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); + rString += _pNode->getTokenValue(); + rString+= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"")); + break;} case SQL_NODE_STRING: - {rString += ::rtl::OUString::createFromAscii("SQL_STRING:'"); - rString += _pNode->getTokenValue(); - break;} + { + rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_STRING:'")); + rString += _pNode->getTokenValue(); + break;} case SQL_NODE_INTNUM: - {rString += ::rtl::OUString::createFromAscii("SQL_INTNUM:"); - rString += _pNode->getTokenValue(); - break;} + { + rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_INTNUM:")); + rString += _pNode->getTokenValue(); + break;} case SQL_NODE_APPROXNUM: - {rString += ::rtl::OUString::createFromAscii("SQL_APPROXNUM:"); - rString += _pNode->getTokenValue(); - break;} + { + rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_APPROXNUM:")); + rString += _pNode->getTokenValue(); + break;} case SQL_NODE_PUNCTUATION: - {rString += ::rtl::OUString::createFromAscii("SQL_PUNCTUATION:"); - rString += _pNode->getTokenValue(); // haenge Nodevalue an - break;} + { + rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_PUNCTUATION:")); + rString += _pNode->getTokenValue(); // haenge Nodevalue an + break;} case SQL_NODE_AMMSC: - {rString += ::rtl::OUString::createFromAscii("SQL_AMMSC:"); - rString += _pNode->getTokenValue(); // haenge Nodevalue an - - break;} + { + rString += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SQL_AMMSC:")); + rString += _pNode->getTokenValue(); // haenge Nodevalue an + break;} default: - OSL_ASSERT("OSQLParser::ShowParseTree: unzulaessiger NodeType"); + OSL_FAIL("OSQLParser::ShowParseTree: unzulaessiger NodeType"); rString += _pNode->getTokenValue(); } _pBox->InsertEntry(rString,_pParent); @@ -239,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; @@ -303,13 +309,13 @@ namespace //------------------------------------------------------------------------------ ::rtl::OUString OQueryController::getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OQueryDesign"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OQueryDesign")); } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString> OQueryController::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.QueryDesign"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.QueryDesign")); return aSupported; } //------------------------------------------------------------------------- @@ -355,7 +361,7 @@ OQueryController::~OQueryController() DBG_DTOR(OQueryController,NULL); if ( !getBroadcastHelper().bDisposed && !getBroadcastHelper().bInDispose ) { - OSL_ENSURE(0,"Please check who doesn't dispose this component!"); + OSL_FAIL("Please check who doesn't dispose this component!"); // increment ref count to prevent double call of Dtor osl_incrementInterlockedCount( &m_refCount ); dispose(); @@ -665,7 +671,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& } } } - catch(const SQLException& e) + catch(const SQLException&) { aError = ::cppu::getCaughtException(); } @@ -686,15 +692,14 @@ 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) InvalidateFeature(ID_BROWSER_ADDTABLE); } - // InvalidateFeature(ID_BROWSER_QUERY_EXECUTE); break; case SID_QUERY_VIEW_FUNCTIONS: case SID_QUERY_VIEW_TABLES: @@ -720,29 +725,24 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& { xCloseFrame->close( sal_True ); } - catch( const Exception& ) + catch(const Exception&) { - OSL_ENSURE( sal_False, "OQueryController::Execute(SID_DB_QUERY_PREVIEW): *nobody* is expected to veto closing the preview frame!" ); + OSL_FAIL( "OQueryController::Execute(SID_DB_QUERY_PREVIEW): *nobody* is expected to veto closing the preview frame!" ); } } else Execute(ID_BROWSER_QUERY_EXECUTE,Sequence< PropertyValue >()); } - catch(Exception&) + catch(const Exception&) { } break; case ID_QUERY_ZOOM_IN: { -// m_aZoom *= Fraction(1,10); -// static_cast<OQueryViewSwitch*>(getView())->zoomTableView(m_aZoom); } break; case ID_QUERY_ZOOM_OUT: { -// if(m_aZoom != Fraction(1,1)) -// m_aZoom /= Fraction(1,10); -// static_cast<OQueryViewSwitch*>(getView())->zoomTableView(m_aZoom); } break; #if OSL_DEBUG_LEVEL > 1 @@ -779,11 +779,10 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& pNodeTmp = pTemp->getChild(1); OSQLParseNode::compress(pNodeTmp); pNodeTmp = pTemp->getChild(1); - } // if ( pCondition ) // no where clause + } ::rtl::OUString sTemp; pNode->parseNodeToStr(sTemp,getConnection()); getContainer()->setStatement(sTemp); - } } @@ -864,7 +863,7 @@ void OQueryController::impl_initialize() ::rtl::OUString sIndependentSQLCommand; if ( rArguments.get_ensureType( "IndependentSQLCommand", sIndependentSQLCommand ) ) { - OSL_ENSURE( false, "OQueryController::impl_initialize: IndependentSQLCommand is regognized for compatibility only!" ); + OSL_FAIL( "OQueryController::impl_initialize: IndependentSQLCommand is regognized for compatibility only!" ); sCommand = sIndependentSQLCommand; m_nCommandType = CommandType::COMMAND; } @@ -872,7 +871,7 @@ void OQueryController::impl_initialize() ::rtl::OUString sCurrentQuery; if ( rArguments.get_ensureType( "CurrentQuery", sCurrentQuery ) ) { - OSL_ENSURE( false, "OQueryController::impl_initialize: CurrentQuery is regognized for compatibility only!" ); + OSL_FAIL( "OQueryController::impl_initialize: CurrentQuery is regognized for compatibility only!" ); sCommand = sCurrentQuery; m_nCommandType = CommandType::QUERY; } @@ -880,7 +879,7 @@ void OQueryController::impl_initialize() sal_Bool bCreateView( sal_False ); if ( rArguments.get_ensureType( "CreateView", bCreateView ) && bCreateView ) { - OSL_ENSURE( false, "OQueryController::impl_initialize: CurrentQuery is regognized for compatibility only!" ); + OSL_FAIL( "OQueryController::impl_initialize: CurrentQuery is regognized for compatibility only!" ); m_nCommandType = CommandType::TABLE; } @@ -904,7 +903,7 @@ void OQueryController::impl_initialize() m_sName = ::rtl::OUString(); break; default: - OSL_ENSURE( false, "OQueryController::impl_initialize: logic error in code!" ); + OSL_FAIL( "OQueryController::impl_initialize: logic error in code!" ); throw RuntimeException(); } @@ -912,7 +911,7 @@ void OQueryController::impl_initialize() sal_Bool bGraphicalDesign( sal_True ); if ( rArguments.get_ensureType( (::rtl::OUString)PROPERTY_QUERYDESIGNVIEW, bGraphicalDesign ) ) { - OSL_ENSURE( false, "OQueryController::impl_initialize: QueryDesignView is regognized for compatibility only!" ); + OSL_FAIL( "OQueryController::impl_initialize: QueryDesignView is regognized for compatibility only!" ); m_bGraphicalDesign = bGraphicalDesign; } @@ -1038,7 +1037,7 @@ void OQueryController::impl_initialize() } } - getUndoMgr()->Clear(); + ClearUndoManager(); if ( ( m_bGraphicalDesign ) && ( ( !m_sName.getLength() && !editingCommand() ) @@ -1051,7 +1050,7 @@ void OQueryController::impl_initialize() setModified(sal_False); } - catch(SQLException& e) + catch(const SQLException& e) { DBG_UNHANDLED_EXCEPTION(); // we caught an exception so we switch to text only mode @@ -1102,7 +1101,7 @@ void OQueryController::setQueryComposer() m_xComposer = xFactory->createQueryComposer(); getContainer()->setStatement(m_sStatement); } - catch (Exception&) + catch(const Exception&) { m_xComposer = NULL; } @@ -1165,7 +1164,7 @@ void SAL_CALL OQueryController::disposing( const EventObject& Source ) throw(Run if ( getContainer() && Source.Source.is() ) { if ( Source.Source == m_aCurrentFrame.getFrame() ) - { // our frame is beeing disposed -> close the preview window (if we have one) + { // our frame is being disposed -> close the preview window (if we have one) Reference< XFrame > xPreviewFrame( getContainer()->getPreviewFrame() ); ::comphelper::disposeComponent( xPreviewFrame ); } @@ -1290,7 +1289,7 @@ void OQueryController::executeQuery() InvalidateFeature(SID_DB_QUERY_PREVIEW); URL aWantToDispatch; - aWantToDispatch.Complete = ::rtl::OUString::createFromAscii(".component:DB/DataSourceBrowser"); + aWantToDispatch.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".component:DB/DataSourceBrowser")); ::rtl::OUString sFrameName( FRAME_NAME_QUERY_PREVIEW ); sal_Int32 nSearchFlags = FrameSearchFlag::CHILDREN; @@ -1351,12 +1350,12 @@ void OQueryController::executeQuery() } else { - OSL_ENSURE(0,"Couldn't create a beamer window!"); + OSL_FAIL("Couldn't create a beamer window!"); } } catch(const Exception&) { - OSL_ENSURE(0,"Couldn't create a beamer window!"); + OSL_FAIL("Couldn't create a beamer window!"); } } } @@ -1382,7 +1381,6 @@ sal_Bool OQueryController::askForNewName(const Reference<XNameAccess>& _xElement { String sName = String( ModuleRes( editingView() ? STR_VIEW_TITLE : STR_QRY_TITLE ) ); aDefaultName = sName.GetToken(0,' '); - //aDefaultName = getPrivateTitle( ); aDefaultName = ::dbtools::createUniqueName(_xElements,aDefaultName); } @@ -1548,7 +1546,7 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) // now check if our datasource has set a tablefilter and if so, append the new table name to it ::dbaui::appendToFilter( getConnection(), m_sName, getORB(), getView() ); - } // if ( editingView() ) + } Reference< XTitleChangeListener> xEventListener(impl_getTitleHelper_throw(),UNO_QUERY); if ( xEventListener.is() ) { @@ -1562,13 +1560,13 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) bSuccess = true; } - catch( const SQLException& ) + catch(const SQLException&) { if ( !bNew ) m_sName = sOriginalName; aInfo = SQLExceptionInfo( ::cppu::getCaughtException() ); } - catch(Exception&) + catch(const Exception&) { if ( !bNew ) m_sName = sOriginalName; @@ -1613,11 +1611,11 @@ bool OQueryController::doSaveAsDoc(sal_Bool _bSaveAs) m_xComposer->setQuery(sTranslatedStmt); sTranslatedStmt = m_xComposer->getComposedQuery(); } - catch(SQLException& e) + catch(const SQLException& e) { ::dbtools::SQLExceptionInfo aInfo(e); showError(aInfo); - // an error occured so we clear the statement + // an error occurred so we clear the statement sTranslatedStmt = ::rtl::OUString(); } } @@ -1699,7 +1697,7 @@ void OQueryController::impl_reset( const bool i_bForceCurrentControllerSettings } catch( const Exception& ) { - OSL_ENSURE( sal_False, "OQueryController::impl_reset: could not retrieve the layout information from the query!" ); + OSL_FAIL( "OQueryController::impl_reset: could not retrieve the layout information from the query!" ); } } } @@ -1790,7 +1788,7 @@ void OQueryController::reset() { impl_reset(); getContainer()->reset( NULL ); - getUndoMgr()->Clear(); + ClearUndoManager(); } // ----------------------------------------------------------------------------- @@ -1835,7 +1833,7 @@ bool OQueryController::allowViews() const // ----------------------------------------------------------------------------- bool OQueryController::allowQueries() const { - DBG_ASSERT( getSdbMetaData().isConnected(), "OQueryController::allowQueries: illegal call!" ); + OSL_ENSURE( getSdbMetaData().isConnected(), "OQueryController::allowQueries: illegal call!" ); if ( !getSdbMetaData().supportsSubqueriesInFrom() ) return false; diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index f7348dd25294..2b9e70e8d07b 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; } @@ -255,12 +255,12 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) String sHelpText = String( ModuleRes( nResId ) ); if( nPos ) { - sHelpText.SearchAndReplace( String( RTL_CONSTASCII_STRINGPARAM( "%1" ) ), sFirstWinName ); - sHelpText.SearchAndReplace( String( RTL_CONSTASCII_STRINGPARAM( "%2" ) ), sSecondWinName ); + sHelpText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%1" ) ), sFirstWinName ); + sHelpText.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%2" ) ), sSecondWinName ); } if ( bAddHint ) { - sHelpText += String( RTL_CONSTASCII_STRINGPARAM( "\n" ) ); + sHelpText += String( RTL_CONSTASCII_USTRINGPARAM( "\n" ) ); sHelpText += String( ModuleRes( STR_JOIN_TYPE_HINT ) ); } @@ -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 ) @@ -320,8 +320,6 @@ TTableConnectionData::value_type DlgQryJoin::getConnectionData() const // ----------------------------------------------------------------------------- void DlgQryJoin::setValid(sal_Bool _bValid) { - //LBChangeHdl(&aLB_JoinType); - aPB_OK.Enable(_bValid || eJoinType == CROSS_JOIN ); } // ----------------------------------------------------------------------------- @@ -358,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 2e0b331fb13e..21f4aea129ef 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 687df3159186..e0aec2c49d84 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 ) ; @@ -182,13 +183,13 @@ String STR_QUERY_FULL_JOIN { Text [ en-US ] = "Contains ALL records from '%1' and from '%2'."; }; + String STR_QUERY_CROSS_JOIN { Text [ en-US ] = "Contains the cartesian product of ALL records from '%1' and from '%2'."; }; + String STR_QUERY_NATURAL_JOIN { Text [ en-US ] = "Contains only one column for each pair of equally-named columns from '%1' and from '%2'."; }; - - diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index db145f75664f..713f2677b255 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); @@ -416,7 +416,7 @@ xKey.clear(); } } xKey.clear(); - } // for(sal_Int32 i=0;i<xKeys->getCount();++i) + } if ( bDropRelation ) { DropRelation(); @@ -424,8 +424,6 @@ xKey.clear(); ::dbtools::throwGenericSQLException(sError,NULL); } -// OSL_ENSURE(xKey.is(),"No key found have insertion!"); - // The fields the relation marks may not be the same as our LineDatas mark after the relation has been updated if ( xColSup.is() ) { @@ -454,14 +452,14 @@ xKey.clear(); m_vConnLineData.push_back(pNewData); } } - } // if ( xColSup.is() ) - // NOTE : the caller is resposible for updating any other objects referencing the old LineDatas (for instance a ConnLine) + } + // NOTE : the caller is responsible for updating any other objects referencing the old LineDatas (for instance a ConnLine) //////////////////////////////////////////////////////////// // 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 43400cb2c6a9..9af062981e78 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -96,8 +96,6 @@ using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdb; using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::util; -// using namespace ::com::sun::star::sdbcx; -// using namespace ::connectivity; using namespace ::dbtools; using namespace ::dbaui; using namespace ::comphelper; @@ -112,13 +110,13 @@ using namespace ::osl; //------------------------------------------------------------------------------ ::rtl::OUString ORelationController::getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.ORelationDesign"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.ORelationDesign")); } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString> ORelationController::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.RelationDesign"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.RelationDesign")); return aSupported; } //------------------------------------------------------------------------- @@ -348,7 +346,7 @@ namespace { ::comphelper::disposeComponent(xResult); loadTableData(m_xTables->getByName(*pIter)); - } // if ( xResult.is() && xResult->next() ) + } } catch( const Exception& ) { @@ -367,12 +365,10 @@ namespace Reference<XPropertySet> xTableProp(_aTable,UNO_QUERY); const ::rtl::OUString sSourceName = ::dbtools::composeTableName( m_xMetaData, xTableProp, ::dbtools::eInTableDefinitions, false, false, false ); TTableDataHelper::iterator aFind = m_aTableData.find(sSourceName); - bool bNotFound = true, bAdded = false; 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); - bAdded = true; + aFind->second->ShowAll(sal_False); } TTableWindowData::value_type pReferencingTable = aFind->second; Reference<XIndexAccess> xKeys = pReferencingTable->getKeys(); @@ -394,7 +390,6 @@ namespace xKey->getPropertyValue(PROPERTY_TYPE) >>= nKeyType; if ( KeyType::FOREIGN == nKeyType ) { - bNotFound = false; ::rtl::OUString sReferencedTable; xKey->getPropertyValue(PROPERTY_REFERENCEDTABLE) >>= sReferencedTable; ////////////////////////////////////////////////////////////////////// @@ -406,11 +401,11 @@ 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 - } // if ( aFind == m_aTableData.end() ) + } TTableWindowData::value_type pReferencedTable = aRefFind->second; ::rtl::OUString sKeyName; @@ -454,7 +449,7 @@ namespace pTabConnData->SetCardinality(); } } - } // if ( xKeys.is() ) + } } } @@ -478,7 +473,7 @@ void ORelationController::mergeData(const TTableConnectionData& _aConnectionData { m_vTableData.push_back((*aConnDataIter)->getReferencedTable()); } - } // for(;aConnDataIter != aConnDataEnd;++aConnDataIter) + } if ( m_nThreadEvent ) { --m_nThreadEvent; @@ -495,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()) @@ -535,8 +530,8 @@ void ORelationController::loadData() nStart = nEnd; nEnd += nMaxElements; nEnd = ::std::min(nEnd,nCount); - } // for(;pIter != pEnd;++pIter) - } // if ( aMeta.supportsThreads() ) + } + } else { RelationLoader* pThread = new RelationLoader(this,xMetaData,m_xTables,aNames,0,nCount); diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index d608ee531d25..d334aa93b133 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -28,33 +28,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" - #include "RelationTableView.hxx" - - #include "JoinExchange.hxx" - - #include <comphelper/extract.hxx> - - #include "browserids.hxx" - - #include <com/sun/star/sdbcx/XTablesSupplier.hpp> - - #include <com/sun/star/sdbc/XConnection.hpp> - - #include <com/sun/star/sdbcx/XKeysSupplier.hpp> - - #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> - - #include <com/sun/star/sdbcx/KeyType.hpp> - #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -180,7 +162,7 @@ void ORelationTableView::ReSync() pTabConnDataList->erase( ::std::remove(pTabConnDataList->begin(),pTabConnDataList->end(),*aConIter),pTabConnDataList->end() ); continue; } - } // if ( !arrInvalidTables.empty() ) + } addConnection( new ORelationTableConnection(this, *aConIter), sal_False ); // don't add the data again } @@ -189,7 +171,7 @@ void ORelationTableView::ReSync() GetTabWinMap()->begin()->second->GrabFocus(); } //------------------------------------------------------------------------------ -BOOL ORelationTableView::IsAddAllowed() +sal_Bool ORelationTableView::IsAddAllowed() { DBG_CHKTHIS(ORelationTableView,NULL); @@ -252,7 +234,7 @@ void ORelationTableView::AddConnection(const OJoinExchangeData& jxdSource, const } catch(const Exception&) { - OSL_ENSURE(0,"ORelationTableView::AddConnection: Exception oocured!"); + OSL_FAIL("ORelationTableView::AddConnection: Exception oocured!"); } } } @@ -292,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 @@ -319,13 +301,13 @@ bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_ } catch(Exception&) { - OSL_ENSURE(0,"ORelationTableView::RemoveConnection: Something other than SQLException occured!"); + OSL_FAIL("ORelationTableView::RemoveConnection: Something other than SQLException occurred!"); } return false; } //------------------------------------------------------------------------------ -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!"); @@ -343,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 @@ -376,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); @@ -384,31 +366,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) m_pView->getController().InvalidateFeature(ID_BROWSER_REDO); } } -// ----------------------------------------------------------------------------- -//namespace -//{ -// class OReleationAskDialog : public ButtonDialog -// { -// FixedImage m_aInfoImage; -// FixedText m_aTitle; -// FixedText m_aMessage; -// public: -// OReleationDialog(Window* _pParent) : ButtonDialog(_pParent,WB_HORZ | WB_STDDIALOG) -// ,m_aInfoImage(this) -// ,m_aTitle(this,WB_WORDBREAK | WB_LEFT) -// ,m_aMessage(this,WB_WORDBREAK | WB_LEFT) -// { -// m_aMessage.SetText(ModuleRes(STR_QUERY_REL_EDIT_RELATION)); -// m_aMessage.Show(); -// -// // Changed as per BugID 79541 Branding/Configuration -// String sDialogTitle( lcl_getProductName() ); -// SetText( sDialogTitle.AppendAscii( " Base" ) ); -// m_aTitle.Show(); -// } -// }; -//} -// ----------------------------------------------------------------------------- + void ORelationTableView::lookForUiActivities() { if(m_pExistingConnection) @@ -421,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(); @@ -470,14 +428,14 @@ 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); m_pView->getController().InvalidateFeature(ID_BROWSER_UNDO); m_pView->getController().InvalidateFeature(ID_BROWSER_REDO); } - } // if ( _rEvent.Accessor >>= sName ) + } m_bInRemove = false; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/relationdesign/relation.src b/dbaccess/source/ui/relationdesign/relation.src index e3c555debd79..4420ade06100 100644 --- a/dbaccess/source/ui/relationdesign/relation.src +++ b/dbaccess/source/ui/relationdesign/relation.src @@ -44,22 +44,27 @@ String STR_QUERY_REL_EDIT_RELATION { Text [ en-US ] = "This relation already exists. Do you want to edit it or create a new one?" ; }; + String STR_QUERY_REL_EDIT { Text [ en-US ] = "Edit..." ; }; + String STR_QUERY_REL_CREATE { Text [ en-US ] = "Create..." ; }; + String STR_RELATIONDESIGN { Text [ en-US ] = " - %PRODUCTNAME Base: Relation design" ; }; + String STR_RELATIONDESIGN_NOT_AVAILABLE { Text [ en-US ] = "The database does not support relations." ; }; + QueryBox RELATION_DESIGN_SAVEMODIFIED { Buttons = WB_YES_NO_CANCEL ; @@ -76,55 +81,3 @@ String STR_QUERY_REL_COULD_NOT_CREATE { Text [ en-US ] = "The database could not create the relation. May be foreign keys for this kind of table aren't supported.\nPlease check your documentation of the database."; }; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx index 22756f48a909..45165c16605f 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" #include "FieldDescGenWin.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "dbaccess_helpid.hrc" #include "TableDesignHelpBar.hxx" #include "TableFieldControl.hxx" @@ -62,7 +62,7 @@ OFieldDescGenWin::~OFieldDescGenWin() //------------------------------------------------------------------------------ void OFieldDescGenWin::Init() { - DBG_ASSERT(GetEditorCtrl() != NULL, "OFieldDescGenWin::Init : have no editor control !"); + OSL_ENSURE(GetEditorCtrl() != NULL, "OFieldDescGenWin::Init : have no editor control !"); m_pFieldControl->Init(); } @@ -110,11 +110,6 @@ OTableEditorCtrl* OFieldDescGenWin::GetEditorCtrl() } #endif //------------------------------------------------------------------------------ -//short OFieldDescGenWin::GetFormatCategory(OFieldDescription* pFieldDescr) -//{ -// return m_pFieldControl->GetFormatCategory(pFieldDescr); -//} -//------------------------------------------------------------------------------ void OFieldDescGenWin::SaveData( OFieldDescription* pFieldDescr ) { DBG_CHKTHIS(OFieldDescGenWin,NULL); @@ -184,8 +179,4 @@ void OFieldDescGenWin::paste() } // ----------------------------------------------------------------------------- - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx index 87cbbe9fb928..d95ddefbebf6 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/FieldDescriptions.cxx b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx index 0f7ef63d5d94..a307f0766766 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx +++ b/dbaccess/source/ui/tabledesign/FieldDescriptions.cxx @@ -561,7 +561,7 @@ sal_Int32 OFieldDescription::GetPrecision() const if ( !nPrec ) nPrec = pTypeInfo->nPrecision; break; - } // switch ( pTypeInfo->nType ) + } } return nPrec; diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 06bd03125f51..6884feaf2ef4 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; @@ -241,11 +243,6 @@ void OTableEditorCtrl::SetReadOnly( sal_Bool bRead ) DeactivateCell(); ////////////////////////////////////////////////////////////////////// - // ::com::sun::star::beans::Property Controls disablen -// if (pDescrWin) -// pDescrWin->SetReadOnly(bReadOnly || !SetDataPtr(nRow) || GetActRow()->IsReadOnly()); - - ////////////////////////////////////////////////////////////////////// // Cursor des Browsers anpassen BrowserMode nMode(BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL|BROWSER_AUTOSIZE_LASTCOL); @@ -280,7 +277,7 @@ void OTableEditorCtrl::InitCellController() } catch(SQLException&) { - OSL_ASSERT(!"getMaxColumnNameLength"); + OSL_FAIL("getMaxColumnNameLength"); } pNameCell = new OSQLNameEdit( &GetDataWindow(), sExtraNameChars,WB_LEFT ); @@ -313,7 +310,7 @@ void OTableEditorCtrl::InitCellController() const Size aTemp( pControls[i]->GetOptimalSize(WINDOWSIZE_PREFERRED) ); if ( aTemp.Height() > aHeight.Height() ) aHeight.Height() = aTemp.Height(); - } // for(int i= 0; i < SAL_N_ELEMENTS(pControls);++i + } SetDataRowHeight(aHeight.Height()); ClearModified(); @@ -335,7 +332,7 @@ OTableEditorCtrl::~OTableEditorCtrl() DBG_DTOR(OTableEditorCtrl,NULL); ////////////////////////////////////////////////////////////////////// // Undo-Manager zuruecksetzen - GetUndoManager()->Clear(); + GetUndoManager().Clear(); ////////////////////////////////////////////////////////////////////// // Moegliche Events aus Queue entfernen @@ -402,8 +399,6 @@ void OTableEditorCtrl::PaintCell(OutputDevice& rDev, const Rectangle& rRect, if (rDev.IsClipRegion()) rDev.SetClipRegion(); -// rDev.DrawText(rRect.TopLeft(), aText); -// rDev.SetClipRegion( ); } //------------------------------------------------------------------------------ @@ -415,7 +410,7 @@ CellController* OTableEditorCtrl::GetController(long nRow, sal_uInt16 nColumnId) Reference<XPropertySet> xTable = GetView()->getController().getTable(); if (IsReadOnly() || ( xTable.is() && xTable->getPropertySetInfo()->hasPropertyByName(PROPERTY_TYPE) && - ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW"))) + ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")))) return NULL; ////////////////////////////////////////////////////////////////////// @@ -630,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(); } @@ -711,15 +706,6 @@ sal_Bool OTableEditorCtrl::SaveModified() switch( nColId ) { ////////////////////////////////////////////////////////////// - // NameCell - case FIELD_NAME: - { - // removed the former duplicate-check. this is done in OTableDocShell::CheckDefConsistency now. - // FS - 07.12.99 - 69575 - - } break; - - ////////////////////////////////////////////////////////////// // TypeCell case FIELD_TYPE: { @@ -805,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(); @@ -822,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()) @@ -849,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 @@ -998,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(); } @@ -1010,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) ); ////////////////////////////////////////////////////////////////////// @@ -1058,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++ ) @@ -1136,7 +1122,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const TOTypeIn SwitchType( _pTypeInfo ); break; default: - OSL_ENSURE(sal_False, "OTableEditorCtrl::SetCellData: invalid column!"); + OSL_FAIL("OTableEditorCtrl::SetCellData: invalid column!"); } SetControlText(nRow,nColId,_pTypeInfo.get() ? _pTypeInfo->aUIName : ::rtl::OUString()); } @@ -1163,7 +1149,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s break; case FIELD_TYPE: - OSL_ENSURE(sal_False, "OTableEditorCtrl::SetCellData: invalid column!"); + OSL_FAIL("OTableEditorCtrl::SetCellData: invalid column!"); break; case COLUMN_DESCRIPTION: @@ -1191,8 +1177,7 @@ void OTableEditorCtrl::SetCellData( long nRow, sal_uInt16 nColId, const ::com::s break; case FIELD_PROPERTY_NUMTYPE: - // pFieldDescr->SetNumType( _rNewData ); - OSL_ENSURE(sal_False, "OTableEditorCtrl::SetCellData: invalid column!"); + OSL_FAIL("OTableEditorCtrl::SetCellData: invalid column!"); break; case FIELD_PROPERTY_AUTOINC: @@ -1275,8 +1260,8 @@ Any OTableEditorCtrl::GetCellData( long nRow, sal_uInt16 nColId ) break; case FIELD_PROPERTY_NUMTYPE: - OSL_ENSURE(sal_False, "OTableEditorCtrl::GetCellData: invalid column!"); - // return pFieldDescr->GetNumType(); + OSL_FAIL("OTableEditorCtrl::GetCellData: invalid column!"); + break; case FIELD_PROPERTY_AUTOINC: sValue = pFieldDescr->IsAutoIncrement() ? strYes : strNo; @@ -1322,7 +1307,7 @@ OFieldDescription* OTableEditorCtrl::GetFieldDescr( long nRow ) m_pRowList->size()); if( (nRow<0) || (sal::static_int_cast< unsigned long >(nRow)>=nListCount) ) { - OSL_ENSURE(0,"(nRow<0) || (nRow>=nListCount)"); + OSL_FAIL("(nRow<0) || (nRow>=nListCount)"); return NULL; } ::boost::shared_ptr<OTableRow> pRow = (*m_pRowList)[ nRow ]; @@ -1360,11 +1345,6 @@ sal_Bool OTableEditorCtrl::IsCutAllowed( long nRow ) } } -// Reference<XPropertySet> xTable = GetView()->getController().getTable(); -// if( !IsCopyAllowed(nRow) || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW"))) -// return sal_False; - - // return bCutAllowed && IsDeleteAllowed( nRow ); return bIsCutAllowed; } @@ -1382,7 +1362,7 @@ sal_Bool OTableEditorCtrl::IsCopyAllowed( long /*nRow*/ ) else if(m_eChildFocus == ROW) { Reference<XPropertySet> xTable = GetView()->getController().getTable(); - if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW"))) + if( !GetSelectRowCount() || (xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW")))) return sal_False; ////////////////////////////////////////////////////////////////////// @@ -1551,7 +1531,7 @@ sal_Bool OTableEditorCtrl::IsPrimaryKeyAllowed( long /*nRow*/ ) // Key darf nicht veraendert werden // Dies gilt jedoch nur, wenn die Tabelle nicht neu ist und keine ::com::sun::star::sdbcx::View. Ansonsten wird kein DROP ausgefhrt - if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW")) + if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"))) return sal_False; ////////////////////////////////////////////////////////////// // Wenn leeres Feld, kein PrimKey @@ -1600,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 ) ); @@ -1779,7 +1759,7 @@ void OTableEditorCtrl::AdjustFieldDescription(OFieldDescription* _pFieldDesc, { _pFieldDesc->SetIsNullable(ColumnValue::NO_NULLS); _pFieldDesc->SetControlDefault(Any()); - } // if(!_bSet && _pFieldDesc->getTypeInfo()->bNullable) + } if ( _pFieldDesc->IsAutoIncrement() && !_bPrimaryKey ) { OTableController& rController = GetView()->getController(); @@ -1803,7 +1783,6 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet ) // Evtl. vorhandene Primary Keys loeschen MultiSelection aDeletedPrimKeys; aDeletedPrimKeys.SetTotalRange( Range(0,GetRowCount()) ); - long nIndex = 0; ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = m_pRowList->begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aEnd = m_pRowList->end(); @@ -1822,7 +1801,7 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet ) aInsertedPrimKeys.SetTotalRange( Range(0,GetRowCount()) ); if( bSet ) { - nIndex = FirstSelectedRow(); + long nIndex = FirstSelectedRow(); while( nIndex >= 0 && nIndex < static_cast<long>(m_pRowList->size()) ) { ////////////////////////////////////////////////////////////////////// @@ -1836,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 @@ -1898,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 1d154ee5be0d..3128d979b681 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 3336906c21aa..b79eba4f8378 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -145,13 +145,13 @@ namespace //------------------------------------------------------------------------------ ::rtl::OUString OTableController::getImplementationName_Static() throw( RuntimeException ) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OTableDesign"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OTableDesign")); } //------------------------------------------------------------------------------ Sequence< ::rtl::OUString> OTableController::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString> aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.TableDesign"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.TableDesign")); return aSupported; } //------------------------------------------------------------------------- @@ -349,7 +349,6 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) { String aName = String(ModuleRes(STR_TBL_TITLE)); aDefaultName = aName.GetToken(0,' '); - //aDefaultName = getPrivateTitle(); aDefaultName = ::dbtools::createUniqueName(xTables,aDefaultName); } @@ -369,7 +368,7 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) } catch(Exception&) { - OSL_ENSURE(sal_False, "OTableController::doSaveDoc: nothing is expected to happen here!"); + OSL_FAIL("OTableController::doSaveDoc: nothing is expected to happen here!"); } sal_Bool bAlter = sal_False; @@ -380,7 +379,6 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) // check the columns for double names if(!checkColumns(bNew || !xTables->hasByName(m_sName))) { - // #105323# OJ return sal_False; } @@ -475,7 +473,6 @@ sal_Bool OTableController::doSaveDoc(sal_Bool _bSaveAs) stopTableListening(); m_xTable = NULL; } - // reload(); // a error occured so we have to reload } return ! (aInfo.isValid() || bError); } @@ -508,7 +505,7 @@ void OTableController::doEditIndexes() OSL_ENSURE(xIndexes.is(), "OTableController::doEditIndexes: no keys got from the indexes supplier!"); } else - OSL_ENSURE(sal_False, "OTableController::doEditIndexes: should never have reached this (no indexes supplier)!"); + OSL_FAIL("OTableController::doEditIndexes: should never have reached this (no indexes supplier)!"); // get the field names Reference< XColumnsSupplier > xColSupp(m_xTable, UNO_QUERY); @@ -569,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& ) @@ -582,8 +579,6 @@ sal_Bool OTableController::Construct(Window* pParent) { setView( * new OTableDesignView( pParent, getORB(), *this ) ); OTableController_BASE::Construct(pParent); -// m_pView->Construct(); -// m_pView->Show(); return sal_True; } // ----------------------------------------------------------------------------- @@ -634,7 +629,7 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti } catch(const Exception&) { - OSL_ENSURE(sal_False, "OTableController::suspend: nothing is expected to happen here!"); + OSL_FAIL("OTableController::suspend: nothing is expected to happen here!"); } } @@ -646,10 +641,7 @@ sal_Bool SAL_CALL OTableController::suspend(sal_Bool /*_bSuspend*/) throw( Runti } } } -/* - if ( bCheck ) - OSingleDocumentController::suspend(_bSuspend); -*/ + return bCheck; } // ----------------------------------------------------------------------------- @@ -667,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(); @@ -776,7 +763,7 @@ void OTableController::appendColumns(Reference<XColumnsSupplier>& _rxColSup,sal_ } else { - OSL_ENSURE(sal_False, "OTableController::appendColumns: invalid field name!"); + OSL_FAIL("OTableController::appendColumns: invalid field name!"); } } @@ -912,7 +899,6 @@ void OTableController::loadData() { pActFieldDescr->SetName(sName); pActFieldDescr->SetFormatKey(nFormatKey); - // pActFieldDescr->SetPrimaryKey(pPrimary->GetValue()); pActFieldDescr->SetDescription(sDescription); pActFieldDescr->SetHelpText(sHelpText); pActFieldDescr->SetAutoIncrement(bIsAutoIncrement); @@ -1024,10 +1010,10 @@ sal_Bool OTableController::checkColumns(sal_Bool _bNew) throw(::com::sun::star:: pNewRow->SetFieldType( pTypeInfo ); OFieldDescription* pActFieldDescr = pNewRow->GetActFieldDescr(); - pActFieldDescr->SetAutoIncrement(sal_False); // #95927# pTypeInfo->bAutoIncrement + pActFieldDescr->SetAutoIncrement(sal_False); pActFieldDescr->SetIsNullable(ColumnValue::NO_NULLS); - pActFieldDescr->SetName( createUniqueName(::rtl::OUString::createFromAscii("ID") )); + pActFieldDescr->SetName( createUniqueName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ID")) )); pActFieldDescr->SetPrimaryKey( sal_True ); m_vRowList.insert(m_vRowList.begin(),pNewRow); @@ -1103,14 +1089,13 @@ void OTableController::alterColumns() try { xColumn->getPropertyValue(PROPERTY_TYPENAME) >>= sTypeName; } catch( const Exception& ) { - OSL_ENSURE( sal_False, "no TypeName property?!" ); + OSL_FAIL( "no TypeName property?!" ); // since this is a last minute fix for #i41785#, I want to be on the safe side, // and catch errors here as early as possible (instead of the whole process of altering // the columns failing) // Normally, sdbcx::Column objects are expected to have a TypeName property } - // xColumn->getPropertyValue(PROPERTY_ISCURRENCY,::cppu::bool2any(pField->IsCurrency())); // check if something changed if((nType != pField->GetType() || sTypeName != pField->GetTypeName() || @@ -1156,7 +1141,7 @@ void OTableController::alterColumns() xAppend->appendByDescriptor(xNewColumn); } catch(const SQLException&) - { // an error occured so we try to reactivate the old one + { // an error occurred so we try to reactivate the old one xAppend->appendByDescriptor(xColumn); throw; } @@ -1187,7 +1172,7 @@ void OTableController::alterColumns() } else { - OSL_ENSURE(sal_False, "OTableController::alterColumns: invalid column (2)!"); + OSL_FAIL("OTableController::alterColumns: invalid column (2)!"); } } catch(const SQLException&) @@ -1214,7 +1199,7 @@ void OTableController::alterColumns() } else bReload = sal_True; - } // for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos) + } // alter column settings aIter = m_vRowList.begin(); @@ -1245,7 +1230,7 @@ void OTableController::alterColumns() xColumn->setPropertyValue(PROPERTY_FORMATKEY,makeAny(pField->GetFormatKey())); if(xInfo->hasPropertyByName(PROPERTY_ALIGN)) xColumn->setPropertyValue(PROPERTY_ALIGN,makeAny(dbaui::mapTextAllign(pField->GetHorJustify()))); - } // if ( xColumns->hasByName(pField->GetName()) ) + } } // second drop all columns which could be found by name Reference<XNameAccess> xKeyColumns = getKeyColumns(); @@ -1287,7 +1272,7 @@ void OTableController::alterColumns() SQLException aNewException; aNewException.Message = sError; - aNewException.SQLState = ::rtl::OUString::createFromAscii( "S1000" ); + aNewException.SQLState = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("S1000")); aNewException.NextException = ::cppu::getCaughtException(); throw aNewException; @@ -1323,7 +1308,7 @@ void OTableController::alterColumns() } else { - OSL_ENSURE(sal_False, "OTableController::alterColumns: invalid column!"); + OSL_FAIL("OTableController::alterColumns: invalid column!"); } } } @@ -1458,7 +1443,6 @@ void OTableController::assignTable() } } } - //updateTitle(); } // ----------------------------------------------------------------------------- sal_Bool OTableController::isAddAllowed() const @@ -1522,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 } // ----------------------------------------------------------------------------- @@ -1578,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 97de4f457d62..0867deb7a4b7 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); @@ -75,9 +75,6 @@ void OTableRowView::Init() { EditBrowseBox::Init(); -// SetMapMode( MapMode(MAP_TWIP) ); -// GetDataWindow().SetMapMode( GetMapMode() ); - Font aFont( GetDataWindow().GetFont() ); aFont.SetWeight( WEIGHT_NORMAL ); GetDataWindow().SetFont( aFont ); @@ -88,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; @@ -113,7 +110,7 @@ void OTableRowView::KeyInput( const KeyEvent& rEvt ) if( rEvt.GetKeyCode().GetCode() == KEY_F2 ) { ::com::sun::star::util::URL aUrl; - aUrl.Complete =::rtl::OUString::createFromAscii(".uno:DSBEditDoc"); + aUrl.Complete =::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:DSBEditDoc")); GetView()->getController().dispatch( aUrl,Sequence< PropertyValue >() ); } } @@ -121,7 +118,7 @@ void OTableRowView::KeyInput( const KeyEvent& rEvt ) } //------------------------------------------------------------------------ -void OTableRowView::SetUpdatable( BOOL bUpdate ) +void OTableRowView::SetUpdatable( sal_Bool bUpdate ) { m_bUpdatable = bUpdate; @@ -141,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 ) @@ -204,7 +201,7 @@ void OTableRowView::copy() //------------------------------------------------------------------------------ void OTableRowView::paste() { - OSL_ENSURE(0,"OTableRowView::Paste : (pseudo-) abstract method called !"); + OSL_FAIL("OTableRowView::Paste : (pseudo-) abstract method called !"); } //------------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 66b5d8c621f3..4c5882c7ef9e 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -148,7 +148,6 @@ void OTableBorderWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, if ( IsControlFont() ) aFont.Merge( GetControlFont() ); SetPointFont( aFont ); -// Set/*Zoomed*/PointFont( aFont ); } if ( bFont || bForeground ) @@ -278,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 14ef3955eebe..97484d519948 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx @@ -68,7 +68,7 @@ sal_Bool OTableFieldControl::IsReadOnly() { // Die Spalten einer ::com::sun::star::sdbcx::View knnen nicht verndert werden Reference<XPropertySet> xTable = GetCtrl()->GetView()->getController().getTable(); - if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString::createFromAscii("VIEW")) + if(xTable.is() && ::comphelper::getString(xTable->getPropertyValue(PROPERTY_TYPE)) == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VIEW"))) bRead = sal_True; else { @@ -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); } @@ -153,7 +153,4 @@ sal_Bool OTableFieldControl::isAutoIncrementValueEnabled() const } // ----------------------------------------------------------------------------- - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx index a45d2928889c..22a77811b51c 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 c6e810353794..ca2680fc09a8 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" #include "TableFieldDescWin.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #include "FieldDescriptions.hxx" #include "dbu_tbl.hrc" #include "FieldDescriptions.hxx" @@ -111,7 +111,7 @@ OTableFieldDescWin::~OTableFieldDescWin() //------------------------------------------------------------------------------ void OTableFieldDescWin::Init() { - DBG_ASSERT(getGenPage() != NULL, "OTableFieldDescWin::Init : ups ... no GenericPage ... this will crash ..."); + OSL_ENSURE(getGenPage() != NULL, "OTableFieldDescWin::Init : ups ... no GenericPage ... this will crash ..."); getGenPage()->Init(); } @@ -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: @@ -317,5 +317,4 @@ long OTableFieldDescWin::PreNotify( NotifyEvent& rNEvt ) return bHandled ? 1L : TabPage::PreNotify(rNEvt); } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx index aa2a05482211..5bfb03283cfc 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx @@ -40,7 +40,7 @@ namespace dbaui class OFieldDescription; //================================================================== // Ableitung von TabPage ist ein Trick von TH, - // um Aenderungen der Systemfarben zu bemerken (Bug #53905) + // um Aenderungen der Systemfarben zu bemerken class OTableFieldDescWin : public TabPage ,public IClipboardTest { @@ -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/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx index 84c5f293a125..b9891730c1e5 100644 --- a/dbaccess/source/ui/tabledesign/TableRow.cxx +++ b/dbaccess/source/ui/tabledesign/TableRow.cxx @@ -156,7 +156,7 @@ namespace dbaui _rStr << sal_Int32(pFieldDesc->IsAutoIncrement() ? 1 : 0); _rStr << sal_Int32(pFieldDesc->IsPrimaryKey() ? 1 : 0); _rStr << sal_Int32(pFieldDesc->IsCurrency() ? 1 : 0); - } // if(pFieldDesc) + } else _rStr << (sal_Int32)0; return _rStr; @@ -226,6 +226,4 @@ namespace dbaui // ----------------------------------------------------------------------------- } - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx index 516fcaf0fac4..97a6f2d649f1 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; @@ -81,11 +81,4 @@ namespace dbaui // ----------------------------------------------------------------------------- } - - - - - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx index 5d7e1da08c81..36262c5a0ac1 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,18 +462,15 @@ 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(); } - - - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx index ff744b2f0d57..23ecf12b8e61 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 e2a73292ec8d..8ae961bcbb80 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -65,18 +65,22 @@ String STR_VALUE_YES { Text [ en-US ] = "Yes" ; }; + String STR_VALUE_NO { Text [ en-US ] = "No" ; }; + String STR_VALUE_ASC { Text [ en-US ] = "Ascending" ; }; + String STR_VALUE_DESC { Text [ en-US ] = "Descending" ; }; + String STR_VALUE_NONE { // Bemerkung : sollte auch in anderen Sprachen irgendwie zum Wort 'Wert' passen : Wert - keiner .... @@ -87,46 +91,57 @@ String STR_TAB_FIELD_NAME { Text [ en-US ] = "Field name" ; }; + String STR_TAB_FIELD_COLUMN_NAME { Text [ en-US ] = "Field Name" ; }; + String STR_TAB_FIELD_DATATYPE { Text [ en-US ] = "Field ~type" ; }; + String STR_TAB_FIELD_COLUMN_DATATYPE { Text [ en-US ] = "Field Type" ; }; + String STR_TAB_FIELD_LENGTH { Text [ en-US ] = "Field length" ; }; + String STR_TAB_HELP_TEXT { Text [ en-US ] = "Description" ; }; + String STR_COLUMN_DESCRIPTION { Text [ en-US ] = "Column Description" ; }; + String STR_TAB_FIELD_NULLABLE { Text [ en-US ] = "Input required" ; }; + String STR_FIELD_AUTOINCREMENT { Text [ en-US ] = "~AutoValue"; }; + String STR_TAB_PROPERTIES { Text [ en-US ] = "Field Properties" ; }; + String STR_TABPAGE_GENERAL { Text [ en-US ] = "General" ; }; + String STR_TAB_TABLE_DESCRIPTION { Text [ en-US ] = "Description:"; @@ -156,61 +171,67 @@ Menu RID_TABLEDESIGNROWPOPUPMENU { ItemList = { - MenuItem - { - ITEM_EDIT_CUT - }; - MenuItem - { - ITEM_EDIT_COPY - }; - MenuItem - { - ITEM_EDIT_PASTE - }; - MenuItem - { - ITEM_EDIT_DELETE - }; - MenuItem - { - Identifier = SID_TABLEDESIGN_INSERTROWS ; - HelpID = SID_TABLEDESIGN_INSERTROWS ; - Text [ en-US ] = "Insert Rows" ; + MenuItem + { + ITEM_EDIT_CUT }; - MenuItem - { - Separator = TRUE ; - }; - MenuItem - { - Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - HelpID = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - Checkable = TRUE ; - Text [ en-US ] = "Primary Key" ; + MenuItem + { + ITEM_EDIT_COPY + }; + MenuItem + { + ITEM_EDIT_PASTE + }; + MenuItem + { + ITEM_EDIT_DELETE + }; + MenuItem + { + Identifier = SID_TABLEDESIGN_INSERTROWS ; + HelpID = HID_TABLEDESIGN_INSERTROWS ; + Text [ en-US ] = "Insert Rows" ; + }; + MenuItem + { + Separator = TRUE ; + }; + MenuItem + { + Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; + HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ; + Checkable = TRUE ; + Text [ en-US ] = "Primary Key" ; }; }; }; + String STR_TABED_UNDO_CELLMODIFIED { Text [ en-US ] = "Modify cell" ; }; + String STR_TABED_UNDO_ROWDELETED { Text [ en-US ] = "Delete row" ; }; + String STR_TABED_UNDO_TYPE_CHANGED { Text [ en-US ] = "Modify field type"; }; + String STR_TABED_UNDO_ROWINSERTED { Text [ en-US ] = "Insert row" ; }; + String STR_TABED_UNDO_NEWROWINSERTED { Text [ en-US ] = "Insert new row" ; }; + String STR_TABED_UNDO_PRIMKEY { Text [ en-US ] = "Insert/remove primary key" ; @@ -220,114 +241,141 @@ String STR_DEFAULT_VALUE { Text [ en-US ] = "~Default value" ; }; + String STR_FIELD_REQUIRED { Text [ en-US ] = "~Entry required" ; }; + String STR_TEXT_LENGTH { Text [ en-US ] = "~Length" ; }; + String STR_NUMERIC_TYPE { Text [ en-US ] = "~Type" ; }; + String STR_LENGTH { Text [ en-US ] = "~Length" ; }; + String STR_SCALE { Text [ en-US ] = "Decimal ~places" ; }; + String STR_FORMAT { Text [ en-US ] = "Format example"; }; + String STR_HELP_BOOL_DEFAULT { Text [ en-US ] = "Select a value that is to appear in all new records as default.\nIf the field is not to have a default value, select the empty string."; }; + String STR_HELP_DEFAULT_VALUE { Text [ en-US ] = "Enter a default value for this field.\n\nWhen you later enter data in the table, this string will be used in each new record for the field selected. It should, therefore, correspond to the cell format that needs to be entered below." ; }; + String STR_HELP_FIELD_REQUIRED { Text [ en-US ] = "Activate this option if this field cannot contain NULL values, i.e. the user must always enter data." ; }; + String STR_HELP_TEXT_LENGTH { Text [ en-US ] = "Enter the maximum text length permitted." ; }; + String STR_HELP_NUMERIC_TYPE { Text [ en-US ] = "Enter the number format." ; }; + String STR_HELP_LENGTH { Text [ en-US ] = "Determine the length data can have in this field.\n\nIf decimal fields, then the maximum length of the number to be entered, if binary fields, then the length of the data block.\nThe value will be corrected accordingly when it exceeds the maximum for this database." ; }; + String STR_HELP_SCALE { Text [ en-US ] = "Specify the number of decimal places permitted in this field." ; }; + String STR_HELP_FORMAT_CODE { Text [ en-US ] = "This is where you see how the data would be displayed in the current format (use the button on the right to modify the format)."; }; + String STR_HELP_FORMAT_BUTTON { Text [ en-US ] = "This is where you determine the output format of the data."; }; + String STR_HELP_AUTOINCREMENT { Text [ en-US ] = "Choose if this field should contain AutoIncrement values.\n\nYou can not enter data in fields of this type. An intrinsic value will be assigned to each new record automatically (resulting from the increment of the previous record)." ; }; + PushButton PB_FORMAT { TabStop = TRUE ; Text [ en-US ] = "~..."; }; + String STR_TABLEDESIGN_DUPLICATE_NAME { Text [ en-US ] = "The table cannot be saved because column name \"$column$\" was assigned twice."; }; + String STR_TBL_COLUMN_IS_KEYCOLUMN { Text [ en-US ] = "The column \"$column$\" belongs to the primary key. If the column is deleted, the primary key will also be deleted. Do you really want to continue?"; }; + String STR_TBL_COLUMN_IS_KEYCOLUMN_TITLE { Text [ en-US ] = "Primary Key Affected"; }; + String STR_COLUMN_NAME { Text [ en-US ] = "Column"; }; + String STR_QRY_CONTINUE { Text [ en-US ] = "Continue anyway?" ; }; + String STR_STAT_WARNING { Text [ en-US ] = "Warning!" ; }; + QueryBox TABLE_DESIGN_SAVEMODIFIED { Buttons = WB_YES_NO_CANCEL ; DefButton = WB_DEF_YES ; Message [ en-US ] = "The table has been changed.\nDo you want to save the changes?" ; }; + QueryBox TABLE_QUERY_CONNECTION_LOST { Buttons = WB_YES_NO ; Message [ en-US ] = "The connection to the database was lost! The table design can only be used with limited functionality without a connection.\nReconnect?" ; }; + String STR_TABLEDESIGN_CONNECTION_MISSING { Text [ en-US ] = "The table could not be saved due to problems connecting to the database."; }; + String STR_TABLEDESIGN_DATASOURCE_DELETED { Text [ en-US ] = "The table filter could not be adjusted because the data source has been deleted."; @@ -339,14 +387,18 @@ QueryBox QUERY_SAVE_TABLE_EDIT_INDEXES Buttons = WB_YES_NO ; }; + String STR_TABLEDESIGN_NO_PRIM_KEY_HEAD { Text [ en-US ] = "No primary key" ; }; + String STR_TABLEDESIGN_NO_PRIM_KEY { Text [ en-US ] = "A unique index or primary key is required for data record identification in this database.\nYou can only enter data into this table when one of these two structural conditions has been met.\n\nShould a primary key be created now?" ; }; + + String STR_TABLEDESIGN_TITLE { Text [ en-US ] = " - %PRODUCTNAME Base: Table Design"; @@ -382,6 +434,7 @@ String STR_AUTOINCREMENT_VALUE { Text [ en-US ] = "A~uto-increment statement"; }; + String STR_HELP_AUTOINCREMENT_VALUE { Text [ en-US ] = "Enter an SQL statement for the auto-increment field.\n\nThis statement will be directly transferred to the database when the table is created."; diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index c98e3ffa6d21..beac49e1513f 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 08ef5e8f5fe5..7971357106d3 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/ColumnModel.cxx b/dbaccess/source/ui/uno/ColumnModel.cxx index 6957f4c8e300..ec48a29409a0 100644 --- a/dbaccess/source/ui/uno/ColumnModel.cxx +++ b/dbaccess/source/ui/uno/ColumnModel.cxx @@ -105,8 +105,6 @@ void OColumnControlModel::registerProperties() &m_xConnection, ::getCppuType( &m_xConnection ) ); Any a; a <<= m_xColumn; -// registerMayBeVoidProperty( PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND| PropertyAttribute::MAYBEVOID, -// &a, ::getCppuType( &m_xColumn ) ); registerProperty( PROPERTY_COLUMN, PROPERTY_ID_COLUMN, PropertyAttribute::TRANSIENT | PropertyAttribute::BOUND, &m_xColumn, ::getCppuType( &m_xColumn ) ); diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index f816faf95777..647251deed6b 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -39,8 +39,8 @@ #include "queryfilter.hxx" #include "queryorder.hxx" #include <connectivity/dbtools.hxx> -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> extern "C" void SAL_CALL createRegistryInfo_ComposerDialogs() { @@ -124,13 +124,13 @@ namespace dbaui if ( !xColumns.is() || !xColumns->hasElements() ) { // perhaps the composer can supply us with columns? This is necessary for cases // where the dialog is invoked for a rowset which is not yet loaded - // #i22878# - 2003-12-16 - fs@openoffice.org + // #i22878# xSuppColumns = xSuppColumns.query( m_xComposer ); if ( xSuppColumns.is() ) xColumns = xSuppColumns->getColumns(); } - DBG_ASSERT( xColumns.is() && xColumns->hasElements(), "ComposerDialog::createDialog: not much fun without any columns!" ); + OSL_ENSURE( xColumns.is() && xColumns->hasElements(), "ComposerDialog::createDialog: not much fun without any columns!" ); } catch( const Exception& ) { diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index 65315cd0e738..3fb4b032e3bc 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -328,7 +328,7 @@ namespace dbaui const Reference< XPropertySet >& _rxDestTable ); - /** processes an error which occured during copying + /** processes an error which occurred during copying First, all listeners are ask. If a listener tells to cancel or continue copying, this is reported to the method's caller. If a listener tells to ask the user, this is done, and the user's decision is @@ -1095,7 +1095,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r case CopyTableContinuation::AskUser: break; // stop asking the listeners, ask the user default: - OSL_ENSURE( false, "CopyTableWizard::impl_processCopyError_nothrow: invalid listener response!" ); + OSL_FAIL( "CopyTableWizard::impl_processCopyError_nothrow: invalid listener response!" ); // ask next listener continue; } @@ -1112,7 +1112,7 @@ bool CopyTableWizard::impl_processCopyError_nothrow( const CopyTableRowEvent& _r { SQLContext aError; aError.Context = *this; - aError.Message = String( ModuleRes( STR_ERROR_OCCURED_WHILE_COPYING ) ); + aError.Message = String( ModuleRes( STR_ERROR_OCCURRED_WHILE_COPYING ) ); ::dbtools::SQLExceptionInfo aInfo( _rEvent.Error ); if ( aInfo.isValid() ) @@ -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; @@ -1308,6 +1314,13 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); break; + 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; @@ -1384,7 +1397,7 @@ void CopyTableWizard::impl_doCopy_nothrow() if( !xTable.is() ) { - OSL_ENSURE( false, "CopyTableWizard::impl_doCopy_nothrow: createTable should throw here, shouldn't it?" ); + OSL_FAIL( "CopyTableWizard::impl_doCopy_nothrow: createTable should throw here, shouldn't it?" ); break; } @@ -1401,7 +1414,7 @@ void CopyTableWizard::impl_doCopy_nothrow() xTable = rWizard.createTable(); if ( !xTable.is() ) { - OSL_ENSURE( false, "CopyTableWizard::impl_doCopy_nothrow: createTable should throw here, shouldn't it?" ); + OSL_FAIL( "CopyTableWizard::impl_doCopy_nothrow: createTable should throw here, shouldn't it?" ); break; } } @@ -1449,7 +1462,7 @@ void CopyTableWizard::impl_doCopy_nothrow() break; default: - OSL_ENSURE( false, "CopyTableWizard::impl_doCopy_nothrow: What operation, please?" ); + OSL_FAIL( "CopyTableWizard::impl_doCopy_nothrow: What operation, please?" ); break; } } @@ -1502,7 +1515,7 @@ void CopyTableWizard::impl_doCopy_nothrow() sColumns.append(aDestColumnNames[aPosIter->second - 1]); sColumns.append(sQuote); } - } // for ( ; aPosIter != aColumnMapping.end() ; ++aPosIter ) + } ::rtl::OUStringBuffer sSql; sSql.appendAscii("INSERT INTO "); const ::rtl::OUString sComposedTableName = ::dbtools::composeTableName( xDestMetaData, _xTable, ::dbtools::eInDataManipulation, false, false, true ); diff --git a/dbaccess/source/ui/uno/copytablewizard.src b/dbaccess/source/ui/uno/copytablewizard.src index fc6d00804607..a0dd16eabf4e 100644 --- a/dbaccess/source/ui/uno/copytablewizard.src +++ b/dbaccess/source/ui/uno/copytablewizard.src @@ -66,14 +66,17 @@ String STR_CTW_ERROR_DURING_INITIALIZATION { Text [ en-US ] = "An error occurred during initialization."; }; + String STR_CTW_ERROR_UNSUPPORTED_SETTING { Text [ en-US ] = "Unsupported setting in the copy source descriptor: $name$."; }; + String STR_CTW_ERROR_NO_QUERY { Text [ en-US ] = "To copy a query, your connection must be able to provide queries."; }; + String STR_CTW_ERROR_INVALID_INTERACTIONHANDLER { Text [ en-US ] = "The given interaction handler is invalid."; diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx index 390f339384f7..8e029adfdbde 100644 --- a/dbaccess/source/ui/uno/dbinteraction.cxx +++ b/dbaccess/source/ui/uno/dbinteraction.cxx @@ -31,8 +31,8 @@ #include "dbinteraction.hxx" #include "dbu_reghelper.hxx" -#include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <osl/diagnose.h> #include <vcl/msgbox.hxx> #include <connectivity/dbexception.hxx> #include "sqlmessage.hxx" @@ -99,7 +99,7 @@ namespace dbaui sal_Bool BasicInteractionHandler::impl_handle_throw( const Reference< XInteractionRequest >& i_Request ) { Any aRequest( i_Request->getRequest() ); - DBG_ASSERT(aRequest.hasValue(), "BasicInteractionHandler::handle: invalid request!"); + OSL_ENSURE(aRequest.hasValue(), "BasicInteractionHandler::handle: invalid request!"); if ( !aRequest.hasValue() ) // no request -> no handling return sal_False; @@ -146,12 +146,7 @@ namespace dbaui Reference< XInteractionSupplyParameters > xParamCallback; if (-1 != nParamPos) xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY); - DBG_ASSERT(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s"); - - // determine the style of the dialog, dependent on the present continuation types - WinBits nDialogStyle = WB_OK | WB_DEF_OK; - if (-1 != nAbortPos) - nDialogStyle = WB_OK_CANCEL; + OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s"); OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xORB); sal_Int16 nResult = aDlg.Execute(); @@ -208,7 +203,7 @@ namespace dbaui nDialogStyle = WB_RETRY_CANCEL | WB_DEF_RETRY; } - // excute the dialog + // execute the dialog OSQLMessageBox aDialog(NULL, _rSqlInfo, nDialogStyle); // TODO: need a way to specify the parent window sal_Int16 nResult = aDialog.Execute(); @@ -228,7 +223,7 @@ namespace dbaui if ( nDisapprovePos != -1 ) _rContinuations[ nDisapprovePos ]->select(); else - OSL_ENSURE( false, "BasicInteractionHandler::implHandle: no handler for NO!" ); + OSL_FAIL( "BasicInteractionHandler::implHandle: no handler for NO!" ); break; case RET_CANCEL: @@ -237,13 +232,13 @@ namespace dbaui else if ( nDisapprovePos != -1 ) _rContinuations[ nDisapprovePos ]->select(); else - OSL_ENSURE( false, "BasicInteractionHandler::implHandle: no handler for CANCEL!" ); + OSL_FAIL( "BasicInteractionHandler::implHandle: no handler for CANCEL!" ); break; case RET_RETRY: if ( nRetryPos != -1 ) _rContinuations[ nRetryPos ]->select(); else - OSL_ENSURE( false, "BasicInteractionHandler::implHandle: where does the RETRY come from?" ); + OSL_FAIL( "BasicInteractionHandler::implHandle: where does the RETRY come from?" ); break; } } @@ -282,12 +277,7 @@ namespace dbaui if (-1 != nDocuPos) { Reference< XInteractionDocumentSave > xCallback(_rContinuations[nDocuPos], UNO_QUERY); - DBG_ASSERT(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s"); - - // determine the style of the dialog, dependent on the present continuation types - WinBits nDialogStyle = WB_OK | WB_DEF_OK; - if (-1 != nAbortPos) - nDialogStyle = WB_OK_CANCEL; + OSL_ENSURE(xCallback.is(), "BasicInteractionHandler::implHandle(DocumentSaveRequest): can't save document without an appropriate interaction handler!s"); OCollectionView aDlg(NULL,_rDocuRequest.Content,_rDocuRequest.Name,m_xORB); sal_Int16 nResult = aDlg.Execute(); diff --git a/dbaccess/source/ui/uno/dbinteraction.hxx b/dbaccess/source/ui/uno/dbinteraction.hxx index 09d6ef37ac11..90beac1b797e 100644 --- a/dbaccess/source/ui/uno/dbinteraction.hxx +++ b/dbaccess/source/ui/uno/dbinteraction.hxx @@ -124,7 +124,7 @@ namespace dbaui SUPPLY_DOCUMENTSAVE }; /** check if a given continuation sequence contains a given continuation type<p/> - @return the index within <arg>_rContinuations</arg> of the first occurence of a continuation + @return the index within <arg>_rContinuations</arg> of the first occurrence of a continuation of the requested type, -1 of no such continuation exists */ sal_Int32 getContinuation( diff --git a/dbaccess/source/ui/uno/unosqlmessage.cxx b/dbaccess/source/ui/uno/unosqlmessage.cxx index 1396cbcf6495..66d65552b264 100644 --- a/dbaccess/source/ui/uno/unosqlmessage.cxx +++ b/dbaccess/source/ui/uno/unosqlmessage.cxx @@ -89,7 +89,7 @@ Reference< XInterface > SAL_CALL OSQLMessageDialog::Create(const Reference< XMul //------------------------------------------------------------------------- ::rtl::OUString OSQLMessageDialog::getImplementationName_Static() throw(RuntimeException) { - return ::rtl::OUString::createFromAscii("org.openoffice.comp.dbu.OSQLMessageDialog"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.comp.dbu.OSQLMessageDialog")); } //------------------------------------------------------------------------- @@ -102,7 +102,7 @@ Reference< XInterface > SAL_CALL OSQLMessageDialog::Create(const Reference< XMul ::comphelper::StringSequence OSQLMessageDialog::getSupportedServiceNames_Static() throw(RuntimeException) { ::comphelper::StringSequence aSupported(1); - aSupported.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.sdb.ErrorMessageDialog"); + aSupported.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.ErrorMessageDialog")); return aSupported; } @@ -155,7 +155,7 @@ Dialog* OSQLMessageDialog::createDialog(Window* _pParent) if ( m_aException.hasValue() ) return new OSQLMessageBox( _pParent, SQLExceptionInfo( m_aException ), WB_OK | WB_DEF_OK, m_sHelpURL ); - OSL_ENSURE(sal_False, "OSQLMessageDialog::createDialog : You should use the SQLException property to specify the error to display!"); + OSL_FAIL("OSQLMessageDialog::createDialog : You should use the SQLException property to specify the error to display!"); return new OSQLMessageBox(_pParent, SQLException()); } diff --git a/dbaccess/util/dba.component b/dbaccess/util/dba.component new file mode 100644 index 000000000000..b25768dbfab6 --- /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 000000000000..ce0dc45cf0be --- /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 bc49f49b87e6..094b4fbfecd0 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 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_T 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_C 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_ 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_P 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 { He 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 ee38f81411fb..3202f0ba5fa0 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 000000000000..0038c0cad27f --- /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> diff --git a/reportdesign/inc/ModuleHelper.hxx b/reportdesign/inc/ModuleHelper.hxx index cf3ccafded7d..b3ed01738b36 100644 --- a/reportdesign/inc/ModuleHelper.hxx +++ b/reportdesign/inc/ModuleHelper.hxx @@ -90,7 +90,7 @@ namespace rptui class REPORTDESIGN_DLLPUBLIC ModuleRes : public ::ResId { public: - inline ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { } + inline ModuleRes(sal_uInt16 _nId) : ResId(_nId, *OModule::getResManager()) { } }; //......................................................................... } // namespace rptui diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx index 79582a215b3f..fe7fc36d83e8 100644 --- a/reportdesign/inc/ReportDefinition.hxx +++ b/reportdesign/inc/ReportDefinition.hxx @@ -30,25 +30,36 @@ #define REPORTDESIGN_API_REPORTDEFINITION_HXX #include "dllapi.h" -#include <com/sun/star/report/XReportDefinition.hpp> -#include <cppuhelper/compbase12.hxx> -#include <cppuhelper/basemutex.hxx> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/lang/XTypeProvider.hpp> + +#include "ReportHelperDefines.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/datatransfer/XTransferable.hpp> +#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> +#include <com/sun/star/document/XUndoManagerSupplier.hpp> +#include <com/sun/star/frame/XModule.hpp> #include <com/sun/star/frame/XTitle.hpp> #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> #include <com/sun/star/frame/XUntitledNumbers.hpp> -#include <com/sun/star/frame/XModule.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/report/XReportDefinition.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> -#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp> -#include <com/sun/star/datatransfer/XTransferable.hpp> -#include <cppuhelper/propertysetmixin.hxx> -#include <comphelper/uno3.hxx> +/** === end UNO includes === **/ + #include <comphelper/embeddedobjectcontainer.hxx> +#include <comphelper/uno3.hxx> +#include <cppuhelper/basemutex.hxx> +#include <cppuhelper/propertysetmixin.hxx> #include <svx/unomod.hxx> -#include "ReportHelperDefines.hxx" +#if !defined(INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13) +#define INCLUDED_COMPHELPER_IMPLBASE_VAR_HXX_13 +#define COMPHELPER_IMPLBASE_INTERFACE_NUMBER 13 +#include <comphelper/implbase_var.hxx> +#endif + #include <boost/shared_ptr.hpp> @@ -63,32 +74,37 @@ namespace comphelper namespace reportdesign { class OReportComponentProperties; - typedef ::cppu::WeakComponentImplHelper12< com::sun::star::report::XReportDefinition - ,com::sun::star::document::XEventBroadcaster - ,com::sun::star::lang::XServiceInfo - ,com::sun::star::frame::XModule - ,com::sun::star::lang::XUnoTunnel - ,com::sun::star::util::XNumberFormatsSupplier - ,::com::sun::star::frame::XTitle - ,::com::sun::star::frame::XTitleChangeBroadcaster - ,::com::sun::star::frame::XUntitledNumbers - ,::com::sun::star::document::XDocumentPropertiesSupplier - ,::com::sun::star::datatransfer::XTransferable - ,SvxUnoDrawMSFactory> ReportDefinitionBase; - typedef ::cppu::PropertySetMixin<com::sun::star::report::XReportDefinition> ReportDefinitionPropertySet; + typedef ::comphelper::PartialWeakComponentImplHelper13 < ::com::sun::star::report::XReportDefinition + , ::com::sun::star::document::XEventBroadcaster + , ::com::sun::star::lang::XServiceInfo + , ::com::sun::star::frame::XModule + , ::com::sun::star::lang::XUnoTunnel + , ::com::sun::star::util::XNumberFormatsSupplier + , ::com::sun::star::frame::XTitle + , ::com::sun::star::frame::XTitleChangeBroadcaster + , ::com::sun::star::frame::XUntitledNumbers + , ::com::sun::star::document::XDocumentPropertiesSupplier + , ::com::sun::star::datatransfer::XTransferable + , ::com::sun::star::document::XUndoManagerSupplier + , SvxUnoDrawMSFactory + > ReportDefinitionBase; + + typedef ::cppu::PropertySetMixin< ::com::sun::star::report::XReportDefinition > ReportDefinitionPropertySet; struct OReportDefinitionImpl; /** \class OReportDefinition Defines the implementation of a \interface com:::sun::star::report::XReportDefinition * \ingroup reportdesign_api * */ - class REPORTDESIGN_DLLPUBLIC OReportDefinition : public ::cppu::BaseMutex, - public ReportDefinitionBase, - public ReportDefinitionPropertySet, - public ::comphelper::IEmbeddedHelper + class REPORTDESIGN_DLLPUBLIC OReportDefinition :public ::cppu::BaseMutex + ,public ReportDefinitionBase + ,public ReportDefinitionPropertySet + ,public ::comphelper::IEmbeddedHelper { + private: ::boost::shared_ptr<OReportComponentProperties> m_aProps; ::boost::shared_ptr<OReportDefinitionImpl> m_pImpl; + private: OReportDefinition(const OReportDefinition&); OReportDefinition& operator=(const OReportDefinition&); @@ -381,6 +397,9 @@ namespace reportdesign virtual ::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > SAL_CALL getTransferDataFlavors( ) throw (::com::sun::star::uno::RuntimeException); virtual ::sal_Bool SAL_CALL isDataFlavorSupported( const ::com::sun::star::datatransfer::DataFlavor& aFlavor ) throw (::com::sun::star::uno::RuntimeException); + // XUndoManagerSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) throw (::com::sun::star::uno::RuntimeException); + // comphelper::IEmbeddedHelper virtual com::sun::star::uno::Reference < com::sun::star::embed::XStorage > getStorage() const; virtual ::comphelper::EmbeddedObjectContainer& getEmbeddedObjectContainer() const; diff --git a/reportdesign/inc/RptDef.hxx b/reportdesign/inc/RptDef.hxx index 2e86a5d80e04..c3bbd9cd1edc 100644 --- a/reportdesign/inc/RptDef.hxx +++ b/reportdesign/inc/RptDef.hxx @@ -51,18 +51,18 @@ namespace rptui #define RPT_LAYER_HIDDEN 2 -const UINT32 ReportInventor = UINT32('R')*0x00000001+ - UINT32('P')*0x00000100+ - UINT32('T')*0x00010000+ - UINT32('1')*0x01000000; +const sal_uInt32 ReportInventor = sal_uInt32('R')*0x00000001+ + sal_uInt32('P')*0x00000100+ + sal_uInt32('T')*0x00010000+ + sal_uInt32('1')*0x01000000; -#define OBJ_DLG_FIXEDTEXT ((UINT16) OBJ_MAXI + 1) +#define OBJ_DLG_FIXEDTEXT ((sal_uInt16) OBJ_MAXI + 1) #define OBJ_DLG_IMAGECONTROL OBJ_FM_IMAGECONTROL -#define OBJ_DLG_FORMATTEDFIELD ((UINT16) OBJ_MAXI + 3) -#define OBJ_DLG_HFIXEDLINE ((UINT16) OBJ_MAXI + 4) -#define OBJ_DLG_VFIXEDLINE ((UINT16) OBJ_MAXI + 5) -#define OBJ_DLG_SUBREPORT ((UINT16) OBJ_MAXI + 6) +#define OBJ_DLG_FORMATTEDFIELD ((sal_uInt16) OBJ_MAXI + 3) +#define OBJ_DLG_HFIXEDLINE ((sal_uInt16) OBJ_MAXI + 4) +#define OBJ_DLG_VFIXEDLINE ((sal_uInt16) OBJ_MAXI + 5) +#define OBJ_DLG_SUBREPORT ((sal_uInt16) OBJ_MAXI + 6) // allows the alignment and resizing of controls namespace ControlModification diff --git a/reportdesign/inc/RptModel.hxx b/reportdesign/inc/RptModel.hxx index 544e1a6e251e..8ee243b8273d 100644 --- a/reportdesign/inc/RptModel.hxx +++ b/reportdesign/inc/RptModel.hxx @@ -36,7 +36,7 @@ class Window; namespace dbaui { - class OSingleDocumentController; + class DBSubComponentController; } namespace reportdesign { @@ -57,7 +57,7 @@ class REPORTDESIGN_DLLPUBLIC OReportModel : public SdrModel private: OXUndoEnvironment* m_pUndoEnv; - ::dbaui::OSingleDocumentController* m_pController; + ::dbaui::DBSubComponentController* m_pController; ::reportdesign::OReportDefinition* m_pReportDefinition; virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoModel(); @@ -73,15 +73,15 @@ public: virtual void SetChanged(sal_Bool bFlg = sal_True); virtual SdrPage* AllocPage(bool bMasterPage); virtual Window* GetCurDocViewWin(); - virtual SdrPage* RemovePage(USHORT nPgNum); + virtual SdrPage* RemovePage(sal_uInt16 nPgNum); /** returns the numbering type that is used to format page fields in drawing shapes */ virtual SvxNumType GetPageNumType() const; OXUndoEnvironment& GetUndoEnv(); void SetModified(sal_Bool _bModified); - inline dbaui::OSingleDocumentController* getController() const { return m_pController; } - inline void attachController( dbaui::OSingleDocumentController& _rController ) { m_pController = &_rController; } + inline dbaui::DBSubComponentController* getController() const { return m_pController; } + inline void attachController( dbaui::DBSubComponentController& _rController ) { m_pController = &_rController; } void detachController(); OReportPage* createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx index 0b16890ef982..056a06c4a522 100644 --- a/reportdesign/inc/RptObject.hxx +++ b/reportdesign/inc/RptObject.hxx @@ -176,8 +176,8 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape(); - virtual UINT16 GetObjIdentifier() const; - virtual UINT32 GetObjInventor() const; + virtual sal_uInt16 GetObjIdentifier() const; + virtual sal_uInt32 GetObjInventor() const; }; //============================================================================ @@ -188,17 +188,17 @@ class REPORTDESIGN_DLLPUBLIC OOle2Obj: public SdrOle2Obj , public OObjectBase friend class OReportPage; friend class DlgEdFactory; - UINT16 m_nType; + sal_uInt16 m_nType; bool m_bOnlyOnce; void impl_createDataProvider_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel); public: - static OOle2Obj* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,UINT16 _nType ) + static OOle2Obj* Create( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,sal_uInt16 _nType ) { return new OOle2Obj( _xComponent,_nType ); } protected: - OOle2Obj(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,UINT16 _nType); - OOle2Obj(const ::rtl::OUString& _sComponentName,UINT16 _nType); + OOle2Obj(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent>& _xComponent,sal_uInt16 _nType); + OOle2Obj(const ::rtl::OUString& _sComponentName,sal_uInt16 _nType); virtual void NbcMove( const Size& rSize ); @@ -218,10 +218,10 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getAwtComponent(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape(); - virtual UINT16 GetObjIdentifier() const; - virtual UINT32 GetObjInventor() const; + virtual sal_uInt16 GetObjIdentifier() const; + virtual sal_uInt32 GetObjInventor() const; // Clone() soll eine komplette Kopie des Objektes erzeugen. - virtual SdrObject* Clone() const; + virtual OOle2Obj* Clone() const; virtual void initializeOle(); void initializeChart( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel>& _xModel); @@ -271,9 +271,9 @@ public: static ::rtl::OUString GetDefaultName(const OUnoObject* _pObj); virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getUnoShape(); - virtual UINT16 GetObjIdentifier() const; - virtual UINT32 GetObjInventor() const; - virtual SdrObject* Clone() const; + virtual sal_uInt16 GetObjIdentifier() const; + virtual sal_uInt32 GetObjInventor() const; + virtual OUnoObject* Clone() const; private: void impl_setReportComponent_nothrow(); diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx index ca90ae3b2521..bd3a768ed0cc 100644 --- a/reportdesign/inc/RptPage.hxx +++ b/reportdesign/inc/RptPage.hxx @@ -40,7 +40,6 @@ namespace rptui //============================================================================ class OReportModel; -//class OReportSection; class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage { @@ -70,13 +69,13 @@ public: virtual SdrPage* Clone() const; using SdrPage::Clone; - virtual void NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason); - virtual SdrObject* RemoveObject(ULONG nObjNum); + virtual void NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInsertReason* pReason); + virtual SdrObject* RemoveObject(sal_uLong nObjNum); /** returns the index inside the object list which belongs to the report component. @param _xObject the report component */ - ULONG getIndexOf(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject); + sal_uLong getIndexOf(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject); /** removes the SdrObject which belongs to the report component. @param _xObject the report component diff --git a/reportdesign/inc/RptResId.hrc b/reportdesign/inc/RptResId.hrc index 3c5920f37a59..013cafdd8b3e 100644 --- a/reportdesign/inc/RptResId.hrc +++ b/reportdesign/inc/RptResId.hrc @@ -234,7 +234,6 @@ #define RID_STR_PARAADJUST (RID_STRING_START + 161) -// #define RID_STR_ (RID_STRING_START + 130) // ----------------------------------------------------------------------- #define RID_PAGEDIALOG_PAGE ( RID_PAGE_START + 1 ) #define RID_PAGEDIALOG_BACKGROUND ( RID_PAGE_START + 2 ) @@ -251,8 +250,6 @@ // ----------------------------------------------------------------------- #define RID_IMG_TREENODE_COLLAPSED ( RID_IMAGE_START + 1 ) #define RID_IMG_TREENODE_EXPANDED ( RID_IMAGE_START + 2 ) -#define RID_IMG_TREENODE_COLLAPSED_HC ( RID_IMAGE_START + 3 ) -#define RID_IMG_TREENODE_EXPANDED_HC ( RID_IMAGE_START + 4 ) #define REPORT_TREE_ICON ( RID_IMAGE_START + 5 ) // menu ----------------------------------------------------------------------- #define RID_MENU_REPORT ( RID_MENU_START + 0 ) @@ -262,17 +259,16 @@ // image lists ----------------------------------------------------------------------- #define IMG_CONDFORMAT_DLG_SC (RID_IMAGELIST_START + 0) -#define IMG_CONDFORMAT_DLG_SCH (RID_IMAGELIST_START + 1) +// free #define IMG_CONDFORMAT_DLG_LC (RID_IMAGELIST_START + 2) -#define IMG_CONDFORMAT_DLG_LCH (RID_IMAGELIST_START + 3) +// free #define RID_SVXIMGLIST_RPTEXPL (RID_IMAGELIST_START + 4) -#define RID_SVXIMGLIST_RPTEXPL_HC (RID_IMAGELIST_START + 5) #define IMGLST_GROUPSORT_DLG_SC (RID_IMAGELIST_START + 6) -#define IMGLST_GROUPSORT_DLG_SCH (RID_IMAGELIST_START + 7) +// free #define IMG_ADDFIELD_DLG_SC (RID_IMAGELIST_START + 8) -#define IMG_ADDFIELD_DLG_SCH (RID_IMAGELIST_START + 9) +// free #define IMG_ADDFIELD_DLG_LC (RID_IMAGELIST_START + 10) -#define IMG_ADDFIELD_DLG_LCH (RID_IMAGELIST_START + 11) +// free #define ADDFIELD_FL_HELP_SEPARATOR (RID_IMAGELIST_START + 12) #define ADDFIELD_HELP_FIELD (RID_IMAGELIST_START + 13) diff --git a/reportdesign/inc/UndoActions.hxx b/reportdesign/inc/UndoActions.hxx index 4b884424444b..c16cab9900f0 100644 --- a/reportdesign/inc/UndoActions.hxx +++ b/reportdesign/inc/UndoActions.hxx @@ -29,8 +29,9 @@ #define RPTUI_UNDOACTIONS_HXX #include "dllapi.h" -#include <svx/svdundo.hxx> -#include <tools/string.hxx> + +#include "RptModel.hxx" + /** === begin UNO includes === **/ #include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> @@ -44,13 +45,16 @@ #include <com/sun/star/report/XReportComponent.hpp> #include <com/sun/star/report/XReportDefinition.hpp> #include <com/sun/star/report/XGroup.hpp> +#include <com/sun/star/document/XUndoManager.hpp> /** === end UNO includes === **/ + #include <cppuhelper/implbase3.hxx> #include <comphelper/uno3.hxx> #include <comphelper/sequence.hxx> #include <svl/lstner.hxx> #include <svx/svdouno.hxx> -#include "RptModel.hxx" +#include <svx/svdundo.hxx> +#include <tools/string.hxx> #include <functional> #include <memory> @@ -120,23 +124,51 @@ namespace rptui static ::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> getMemberFunction(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); }; - class REPORTDESIGN_DLLPUBLIC UndoManagerListAction + //================================================================================================================== + //= UndoContext + //================================================================================================================== + class UndoContext { + public: + UndoContext( SfxUndoManager& i_undoManager, const ::rtl::OUString& i_undoTitle ) + :m_rUndoManager( i_undoManager ) + { + m_rUndoManager.EnterListAction( i_undoTitle, String() ); + } + + ~UndoContext() + { + m_rUndoManager.LeaveListAction(); + } + private: - SfxUndoManager& m_rManager; + SfxUndoManager& m_rUndoManager; + }; + //================================================================================================================== + //= UndoSuppressor + //================================================================================================================== + class UndoSuppressor + { public: - UndoManagerListAction( SfxUndoManager& _rManager, const String& _rListActionComment ) - :m_rManager( _rManager ) + UndoSuppressor( SfxUndoManager& i_undoManager ) + :m_rUndoManager( i_undoManager ) { - m_rManager.EnterListAction( _rListActionComment, String() ); + m_rUndoManager.EnableUndo( false ); } - ~UndoManagerListAction() + + ~UndoSuppressor() { - m_rManager.LeaveListAction(); + m_rUndoManager.EnableUndo( true ); } + + private: + SfxUndoManager& m_rUndoManager; }; + //================================================================================================================== + //= OCommentUndoAction + //================================================================================================================== class REPORTDESIGN_DLLPUBLIC OCommentUndoAction : public SdrUndoAction { protected: @@ -146,7 +178,7 @@ namespace rptui public: TYPEINFO(); OCommentUndoAction( SdrModel& rMod - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual ~OCommentUndoAction(); virtual UniString GetComment() const { return m_strComment; } @@ -176,7 +208,7 @@ namespace rptui ,Action _eAction ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > _xContainer ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem - ,USHORT _nCommentId); + ,sal_uInt16 _nCommentId); virtual ~OUndoContainerAction(); virtual void Undo(); @@ -202,7 +234,7 @@ namespace rptui ,OReportHelper> _pMemberFunction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem - ,USHORT _nCommentId); + ,sal_uInt16 _nCommentId); protected: virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ); @@ -224,7 +256,7 @@ namespace rptui ,OGroupHelper> _pMemberFunction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup ,const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface>& xElem - ,USHORT _nCommentId); + ,sal_uInt16 _nCommentId); protected: virtual void implReInsert( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ); diff --git a/reportdesign/inc/helpids.hrc b/reportdesign/inc/helpids.hrc index f73782a1d8d4..7b543169e032 100644 --- a/reportdesign/inc/helpids.hrc +++ b/reportdesign/inc/helpids.hrc @@ -27,104 +27,96 @@ #ifndef RTPUI_REPORTDESIGN_HELPID_HRC #define RTPUI_REPORTDESIGN_HELPID_HRC -#ifndef _SOLAR_HRC -#include <svl/solar.hrc> // HID_RPT_DBACCESS_START -#endif +#define UID_RPT_PROP_FORMULA "REPORTDESIGN_UID_RPT_PROP_FORMULA" +#define UID_RPT_RPT_PROP_DLG_FONT_TYPE "REPORTDESIGN_UID_RPT_RPT_PROP_DLG_FONT_TYPE" +#define UID_RPT_RPT_PROP_DLG_AREA "REPORTDESIGN_UID_RPT_RPT_PROP_DLG_AREA" +#define UID_RPT_PROP_CHARTTYPE_DLG "REPORTDESIGN_UID_RPT_PROP_CHARTTYPE_DLG" +#define UID_RPT_PROP_DLG_LINKFIELDS "REPORTDESIGN_UID_RPT_PROP_DLG_LINKFIELDS" -#define UID_RPT_RPT_APP_VIEW (HID_RPT_START + 0) -#define UID_RPT_SCROLLWINDOW (HID_RPT_START + 1) -#define UID_RPT_REPORTWINDOW (HID_RPT_START + 2) -#define HID_RPT_HORZ_RULER (HID_RPT_START + 3) -#define UID_RPT_SECTIONSWINDOW (HID_RPT_START + 4) -#define UID_RPT_VIEWSWINDOW (HID_RPT_START + 5) -#define HID_RPT_ENDMARKER (HID_RPT_START + 6) -#define HID_RPT_SPLITTER (HID_RPT_START + 7) -#define HID_REPORTSECTION (HID_RPT_START + 8) -#define HID_RPT_HORZ_SCROLLBAR (HID_RPT_START + 9) -#define HID_RPT_VERT_SCROLLBAR (HID_RPT_START + 10) -#define HID_RPT_STARTMARKER (HID_RPT_START + 11) -#define HID_RPT_FIELDEXPRESSION (HID_RPT_START + 12) -#define HID_RPT_SORTORDER (HID_RPT_START + 13) -#define HID_RPT_GROUPSBRW (HID_RPT_START + 14) -#define HID_RPT_GROUPSSORTING_DLG (HID_RPT_START + 15) -#define HID_RPT_PAGENUMBERS_DLG (HID_RPT_START + 16) -#define HID_RPT_DATETIME_DLG (HID_RPT_START + 17) -#define HID_RPT_CONDFORMAT_DLG (HID_RPT_START + 18) -#define HID_RPT_CONDFORMAT_TB (HID_RPT_START + 19) -#define HID_RPT_CRTL_FORMAT_PREVIEW (HID_RPT_START + 20) -#define HID_RPT_COND_DLG (HID_RPT_START + 21) -#define HID_RPT_POPUP_COLOR_CTRL (HID_RPT_START + 22) -#define HID_RPT_POPUP_COLOR (HID_RPT_START + 23) -#define HID_RPT_FIELD_SEL (HID_RPT_START + 24) -#define HID_RPT_FIELD_SEL_WIN (HID_RPT_START + 25) -#define HID_RPT_PROPDLG_TAB_GENERAL (HID_RPT_START + 26) -#define HID_RPT_PROPDLG_TAB_DATA (HID_RPT_START + 27) +#define UID_RPT_RPT_APP_VIEW "REPORTDESIGN_UID_RPT_RPT_APP_VIEW" +#define UID_RPT_SCROLLWINDOW "REPORTDESIGN_UID_RPT_SCROLLWINDOW" +#define UID_RPT_REPORTWINDOW "REPORTDESIGN_UID_RPT_REPORTWINDOW" +#define HID_RPT_HORZ_RULER "REPORTDESIGN_HID_RPT_HORZ_RULER" +#define UID_RPT_SECTIONSWINDOW "REPORTDESIGN_UID_RPT_SECTIONSWINDOW" +#define UID_RPT_VIEWSWINDOW "REPORTDESIGN_UID_RPT_VIEWSWINDOW" +#define HID_RPT_ENDMARKER "REPORTDESIGN_HID_RPT_ENDMARKER" +#define HID_RPT_SPLITTER "REPORTDESIGN_HID_RPT_SPLITTER" +#define HID_REPORTSECTION "REPORTDESIGN_HID_REPORTSECTION" +#define HID_RPT_HORZ_SCROLLBAR "REPORTDESIGN_HID_RPT_HORZ_SCROLLBAR" +#define HID_RPT_VERT_SCROLLBAR "REPORTDESIGN_HID_RPT_VERT_SCROLLBAR" +#define HID_RPT_STARTMARKER "REPORTDESIGN_HID_RPT_STARTMARKER" +#define HID_RPT_FIELDEXPRESSION "REPORTDESIGN_HID_RPT_FIELDEXPRESSION" +#define HID_RPT_SORTORDER "REPORTDESIGN_HID_RPT_SORTORDER" +#define HID_RPT_GROUPSBRW "REPORTDESIGN_HID_RPT_GROUPSBRW" +#define HID_RPT_GROUPSSORTING_DLG "REPORTDESIGN_HID_RPT_GROUPSSORTING_DLG" +#define HID_RPT_PAGENUMBERS_DLG "REPORTDESIGN_HID_RPT_PAGENUMBERS_DLG" +#define HID_RPT_DATETIME_DLG "REPORTDESIGN_HID_RPT_DATETIME_DLG" +#define HID_RPT_CONDFORMAT_DLG "REPORTDESIGN_HID_RPT_CONDFORMAT_DLG" +#define HID_RPT_CONDFORMAT_TB "REPORTDESIGN_HID_RPT_CONDFORMAT_TB" +#define HID_RPT_CRTL_FORMAT_PREVIEW "REPORTDESIGN_HID_RPT_CRTL_FORMAT_PREVIEW" +#define HID_RPT_COND_DLG "REPORTDESIGN_HID_RPT_COND_DLG" +#define HID_RPT_POPUP_COLOR_CTRL "REPORTDESIGN_HID_RPT_POPUP_COLOR_CTRL" +#define HID_RPT_POPUP_COLOR "REPORTDESIGN_HID_RPT_POPUP_COLOR" +#define HID_RPT_FIELD_SEL "REPORTDESIGN_HID_RPT_FIELD_SEL" +#define HID_RPT_FIELD_SEL_WIN "REPORTDESIGN_HID_RPT_FIELD_SEL_WIN" +#define HID_RPT_PROPDLG_TAB_GENERAL "REPORTDESIGN_HID_RPT_PROPDLG_TAB_GENERAL" +#define HID_RPT_PROPDLG_TAB_DATA "REPORTDESIGN_HID_RPT_PROPDLG_TAB_DATA" -#define HID_RPT_PROP_FORCENEWPAGE (HID_RPT_START + 28) -#define HID_RPT_PROP_NEWROWORCOL (HID_RPT_START + 29) -#define HID_RPT_PROP_KEEPTOGETHER (HID_RPT_START + 30) -#define HID_RPT_PROP_CANGROW (HID_RPT_START + 31) -#define HID_RPT_PROP_CANSHRINK (HID_RPT_START + 32) -#define HID_RPT_PROP_REPEATSECTION (HID_RPT_START + 33) -#define HID_RPT_PROP_FORMULALIST (HID_RPT_START + 34) -#define HID_RPT_PROP_SCOPE (HID_RPT_START + 35) -#define HID_RPT_PROP_TYPE (HID_RPT_START + 36) -#define HID_RPT_PROP_MASTERFIELDS (HID_RPT_START + 37) -#define HID_RPT_PROP_DETAILFIELDS (HID_RPT_START + 38) -#define HID_RPT_PROP_AREA (HID_RPT_START + 39) -#define UID_RPT_RPT_PROP_DLG_AREA (HID_RPT_START + 40) -#define HID_RPT_PROP_MIMETYPE (HID_RPT_START + 41) +#define HID_RPT_PROP_FORCENEWPAGE "REPORTDESIGN_HID_RPT_PROP_FORCENEWPAGE" +#define HID_RPT_PROP_NEWROWORCOL "REPORTDESIGN_HID_RPT_PROP_NEWROWORCOL" +#define HID_RPT_PROP_KEEPTOGETHER "REPORTDESIGN_HID_RPT_PROP_KEEPTOGETHER" +#define HID_RPT_PROP_CANGROW "REPORTDESIGN_HID_RPT_PROP_CANGROW" +#define HID_RPT_PROP_CANSHRINK "REPORTDESIGN_HID_RPT_PROP_CANSHRINK" +#define HID_RPT_PROP_REPEATSECTION "REPORTDESIGN_HID_RPT_PROP_REPEATSECTION" +#define HID_RPT_PROP_FORMULALIST "REPORTDESIGN_HID_RPT_PROP_FORMULALIST" +#define HID_RPT_PROP_SCOPE "REPORTDESIGN_HID_RPT_PROP_SCOPE" +#define HID_RPT_PROP_TYPE "REPORTDESIGN_HID_RPT_PROP_TYPE" +#define HID_RPT_PROP_MASTERFIELDS "REPORTDESIGN_HID_RPT_PROP_MASTERFIELDS" +#define HID_RPT_PROP_DETAILFIELDS "REPORTDESIGN_HID_RPT_PROP_DETAILFIELDS" +#define HID_RPT_PROP_AREA "REPORTDESIGN_HID_RPT_PROP_AREA" +#define HID_RPT_PROP_MIMETYPE "REPORTDESIGN_HID_RPT_PROP_MIMETYPE" // free // free -#define HID_RPT_PROP_PRINTREPEATEDVALUES (HID_RPT_START + 44) -#define HID_RPT_PROP_CONDITIONALPRINTEXPRESSION (HID_RPT_START + 45) -#define HID_RPT_PROP_VERTICALALIGN (HID_RPT_START + 46) -#define HID_RPT_PROP_STARTNEWCOLUMN (HID_RPT_START + 47) -#define HID_RPT_PROP_STARTNEWPAGE (HID_RPT_START + 48) -#define HID_RPT_PROP_RESETPAGENUMBER (HID_RPT_START + 49) -#define HID_RPT_PROP_PARAADJUST (HID_RPT_START + 50) -#define HID_RPT_PROP_MINHEIGHTNEWPAGE (HID_RPT_START + 51) -#define HID_RPT_PROP_PRINTWHENGROUPCHANGE (HID_RPT_START + 52) -#define HID_RPT_PROP_CHARTTYPE (HID_RPT_START + 53) +#define HID_RPT_PROP_PRINTREPEATEDVALUES "REPORTDESIGN_HID_RPT_PROP_PRINTREPEATEDVALUES" +#define HID_RPT_PROP_CONDITIONALPRINTEXPRESSION "REPORTDESIGN_HID_RPT_PROP_CONDITIONALPRINTEXPRESSION" +#define HID_RPT_PROP_VERTICALALIGN "REPORTDESIGN_HID_RPT_PROP_VERTICALALIGN" +#define HID_RPT_PROP_STARTNEWCOLUMN "REPORTDESIGN_HID_RPT_PROP_STARTNEWCOLUMN" +#define HID_RPT_PROP_STARTNEWPAGE "REPORTDESIGN_HID_RPT_PROP_STARTNEWPAGE" +#define HID_RPT_PROP_RESETPAGENUMBER "REPORTDESIGN_HID_RPT_PROP_RESETPAGENUMBER" +#define HID_RPT_PROP_PARAADJUST "REPORTDESIGN_HID_RPT_PROP_PARAADJUST" +#define HID_RPT_PROP_MINHEIGHTNEWPAGE "REPORTDESIGN_HID_RPT_PROP_MINHEIGHTNEWPAGE" +#define HID_RPT_PROP_PRINTWHENGROUPCHANGE "REPORTDESIGN_HID_RPT_PROP_PRINTWHENGROUPCHANGE" +#define HID_RPT_PROP_CHARTTYPE "REPORTDESIGN_HID_RPT_PROP_CHARTTYPE" // free // free -#define HID_RPT_PROP_VISIBLE (HID_RPT_START + 55) -#define HID_RPT_PROP_GROUPKEEPTOGETHER (HID_RPT_START + 56) -#define HID_RPT_PROP_PAGEHEADEROPTION (HID_RPT_START + 57) -#define HID_RPT_PROP_PAGEFOOTEROPTION (HID_RPT_START + 58) -#define UID_RPT_PROP_DLG_LINE_STYLE (HID_RPT_START + 59) -#define HID_RPT_PROP_PREVIEW_COUNT (HID_RPT_START + 60) -#define HID_RPT_PROP_DATAFIELD (HID_RPT_START + 61) -#define HID_RPT_PROP_BACKCOLOR (HID_RPT_START + 62) -#define HID_RPT_PROP_RPT_POSITIONX (HID_RPT_START + 63) -#define HID_RPT_PROP_RPT_POSITIONY (HID_RPT_START + 64) -#define HID_RPT_PROP_RPT_WIDTH (HID_RPT_START + 65) -#define HID_RPT_PROP_RPT_HEIGHT (HID_RPT_START + 66) -#define HID_RPT_START_TITLE (HID_RPT_START + 67) -#define HID_RPT_START_IMAGE (HID_RPT_START + 68) -#define HID_RPT_PROP_DEEPTRAVERSING (HID_RPT_START + 69) -#define HID_RPT_PROP_PREEVALUATED (HID_RPT_START + 70) -#define HID_RPT_NAVIGATOR_DLG (HID_RPT_START + 71) -#define HID_REPORT_NAVIGATOR_TREE (HID_RPT_START + 72) -#define HID_RPT_PROP_FORMULA (HID_RPT_START + 73) -#define HID_RPT_PROP_INITIALFORMULA (HID_RPT_START + 74) -#define HID_RPT_PROP_RPT_FONT (HID_RPT_START + 75) -#define UID_RPT_RPT_PROP_DLG_FONT_TYPE (HID_RPT_START + 76) -#define HID_RPT_PROP_PRESERVEIRI (HID_RPT_START + 77) -#define HID_RPT_PROP_BACKTRANSPARENT (HID_RPT_START + 78) -#define HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT (HID_RPT_START + 79) -#define UID_RPT_PROP_CHARTTYPE_DLG (HID_RPT_START + 80) -#define UID_RPT_PROP_DLG_LINKFIELDS (HID_RPT_START + 81) -#define UID_RPT_PROP_FORMULA (HID_RPT_START + 82) +#define HID_RPT_PROP_VISIBLE "REPORTDESIGN_HID_RPT_PROP_VISIBLE" +#define HID_RPT_PROP_GROUPKEEPTOGETHER "REPORTDESIGN_HID_RPT_PROP_GROUPKEEPTOGETHER" +#define HID_RPT_PROP_PAGEHEADEROPTION "REPORTDESIGN_HID_RPT_PROP_PAGEHEADEROPTION" +#define HID_RPT_PROP_PAGEFOOTEROPTION "REPORTDESIGN_HID_RPT_PROP_PAGEFOOTEROPTION" +#define UID_RPT_PROP_DLG_LINE_STYLE "REPORTDESIGN_UID_RPT_PROP_DLG_LINE_STYLE" +#define HID_RPT_PROP_PREVIEW_COUNT "REPORTDESIGN_HID_RPT_PROP_PREVIEW_COUNT" +#define HID_RPT_PROP_DATAFIELD "REPORTDESIGN_HID_RPT_PROP_DATAFIELD" +#define HID_RPT_PROP_BACKCOLOR "REPORTDESIGN_HID_RPT_PROP_BACKCOLOR" +#define HID_RPT_PROP_RPT_POSITIONX "REPORTDESIGN_HID_RPT_PROP_RPT_POSITIONX" +#define HID_RPT_PROP_RPT_POSITIONY "REPORTDESIGN_HID_RPT_PROP_RPT_POSITIONY" +#define HID_RPT_PROP_RPT_WIDTH "REPORTDESIGN_HID_RPT_PROP_RPT_WIDTH" +#define HID_RPT_PROP_RPT_HEIGHT "REPORTDESIGN_HID_RPT_PROP_RPT_HEIGHT" +#define HID_RPT_START_TITLE "REPORTDESIGN_HID_RPT_START_TITLE" +#define HID_RPT_START_IMAGE "REPORTDESIGN_HID_RPT_START_IMAGE" +#define HID_RPT_PROP_DEEPTRAVERSING "REPORTDESIGN_HID_RPT_PROP_DEEPTRAVERSING" +#define HID_RPT_PROP_PREEVALUATED "REPORTDESIGN_HID_RPT_PROP_PREEVALUATED" +#define HID_RPT_NAVIGATOR_DLG "REPORTDESIGN_HID_RPT_NAVIGATOR_DLG" +#define HID_REPORT_NAVIGATOR_TREE "REPORTDESIGN_HID_REPORT_NAVIGATOR_TREE" +#define HID_RPT_PROP_FORMULA "REPORTDESIGN_HID_RPT_PROP_FORMULA" +#define HID_RPT_PROP_INITIALFORMULA "REPORTDESIGN_HID_RPT_PROP_INITIALFORMULA" +#define HID_RPT_PROP_RPT_FONT "REPORTDESIGN_HID_RPT_PROP_RPT_FONT" +#define HID_RPT_PROP_PRESERVEIRI "REPORTDESIGN_HID_RPT_PROP_PRESERVEIRI" +#define HID_RPT_PROP_BACKTRANSPARENT "REPORTDESIGN_HID_RPT_PROP_BACKTRANSPARENT" +#define HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT "REPORTDESIGN_HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT" -#define HID_RPT_GROUPSORT_MOVE_UP (HID_RPT_START + 82) -#define HID_RPT_GROUPSORT_MOVE_DOWN (HID_RPT_START + 83) -#define HID_RPT_GROUPSORT_DELETE (HID_RPT_START + 84) - -#if UID_RPT_PROP_FORMULA > HID_RPT_END -#error Help-Id Ueberlauf in #file, #line -#endif -// don't forget to update the file util/hidother.src +#define HID_RPT_GROUPSORT_MOVE_UP "REPORTDESIGN_HID_RPT_GROUPSORT_MOVE_UP" +#define HID_RPT_GROUPSORT_MOVE_DOWN "REPORTDESIGN_HID_RPT_GROUPSORT_MOVE_DOWN" +#define HID_RPT_GROUPSORT_DELETE "REPORTDESIGN_HID_RPT_GROUPSORT_DELETE" #endif //RTPUI_REPORTDESIGN_HELPID_HRC diff --git a/reportdesign/inc/reportformula.hxx b/reportdesign/inc/reportformula.hxx index 8d26195f2010..1ff7c091dfe6 100644 --- a/reportdesign/inc/reportformula.hxx +++ b/reportdesign/inc/reportformula.hxx @@ -89,7 +89,7 @@ namespace rptui If the formula denotes an expression, then the <em>undecorated content</em> is the expression itself. */ - const ::rtl::OUString& getUndecoratedContent() const;// { return m_sUndecoratedContent; } + const ::rtl::OUString& getUndecoratedContent() const; /// convenience alias for <code>getUndecoratedContent</code>, which asserts (in a non-product build) when used on an expression inline ::rtl::OUString getFieldName() const; diff --git a/reportdesign/prj/build.lst b/reportdesign/prj/build.lst index 781eb91eccb3..cfa1e92f8a95 100644 --- a/reportdesign/prj/build.lst +++ b/reportdesign/prj/build.lst @@ -1,4 +1,4 @@ -rd reportdesign : l10n BOOST:boost comphelper dbaccess formula NULL +rd reportdesign : TRANSLATIONS:translations BOOST:boost comphelper dbaccess formula LIBXSLT:libxslt NULL rd reportdesign usr1 - all rd_mkout NULL rd reportdesign\inc nmake - all rd_inc NULL rd reportdesign\source\core\api nmake - all rd_api rd_inc NULL @@ -13,3 +13,6 @@ rd reportdesign\source\ui\inspection nmake rd reportdesign\source\filter\xml nmake - all rd_filter_xml rd_inc NULL rd reportdesign\util nmake - all rd_util rd_api rd_res rd_shared rd_uimisc rd_uidlg rd_uireport rd_uiinspection rd_sdr rd_misc rd_filter_xml NULL +# has problems in m78, in m83 also +# rd reportdesign\qa\complex\reportdesign nmake - all rd_qa_complex NULL + diff --git a/reportdesign/prj/d.lst b/reportdesign/prj/d.lst index b531c0eed8f0..d7cc5fad6396 100644 --- a/reportdesign/prj/d.lst +++ b/reportdesign/prj/d.lst @@ -19,3 +19,6 @@ dos: sh -c "if test %OS% = MACOSX; then create-bundle %_DEST%\lib%_EXT%\*.dylib; ..\uiconfig\dbreport\statusbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\statusbar\*.xml ..\uiconfig\dbreport\toolbar\*.xml %_DEST%\xml%_EXT%\uiconfig\modules\dbreport\toolbar\*.xml +..\%__SRC%\misc\rpt.component %_DEST%\xml%_EXT%\rpt.component +..\%__SRC%\misc\rptui.component %_DEST%\xml%_EXT%\rptui.component +..\%__SRC%\misc\rptxml.component %_DEST%\xml%_EXT%\rptxml.component diff --git a/reportdesign/qa/complex/reportdesign/FileURL.java b/reportdesign/qa/complex/reportdesign/FileURL.java new file mode 100644 index 000000000000..9d2cdb89bd0e --- /dev/null +++ b/reportdesign/qa/complex/reportdesign/FileURL.java @@ -0,0 +1,62 @@ +/* + * ************************************************************************ + * + * 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. + * + * ************************************************************************ + */ + +package complex.reportdesign; + +import java.io.File; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * + * @author ll93751 + */ +public class FileURL +{ + String m_sFileURL; + + public FileURL(String _sFileURL) + { + m_sFileURL = _sFileURL; + } + public boolean exists() + { + try + { + final URI aURI = new URI(m_sFileURL); + final File aFile = new File(aURI); + return aFile.exists(); + } + catch (URISyntaxException ex) + { + System.out.println("Error: URI is wrong. '" + m_sFileURL + "': " + ex.getMessage()); + } + return false; + } +} diff --git a/reportdesign/qa/complex/ReportDesignerTest.java b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java index 3bbb9a42fe26..6dfb6f719daf 100755..100644 --- a/reportdesign/qa/complex/ReportDesignerTest.java +++ b/reportdesign/qa/complex/reportdesign/ReportDesignerTest.java @@ -25,7 +25,7 @@ * ************************************************************************/ -package complex; +package complex.reportdesign; import java.io.File; import java.util.ArrayList; @@ -47,44 +47,28 @@ import com.sun.star.uno.UnoRuntime; import com.sun.star.uno.XInterface; import com.sun.star.util.XCloseable; -// import util.BasicMacroTools; -// import util.DesktopTools; -// import util.dbg; -import complexlib.ComplexTestCase; -import util.utils; +// import complexlib.ComplexTestCase; +// import util.utils; import helper.OfficeProvider; import helper.URLHelper; -import helper.OfficeWatcher; +// import helper.OfficeWatcher; import convwatch.DB; -// import java.util.Date; -// import java.text.SimpleDateFormat; -// import java.text.ParsePosition; -// import java.sql.Time; -// -// import java.io.BufferedReader; -// import java.io.File; -// import java.io.FileReader; -// import java.io.IOException; -// import java.io.FilenameFilter; -// -// import java.util.Vector; -// -// import helper.AppProvider; -// import java.text.DecimalFormat; -// import util.DynamicClassLoader; -// import java.util.StringTokenizer; - - - +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.*; class PropertySetHelper { XPropertySet m_xPropertySet; public PropertySetHelper(Object _aObj) { - m_xPropertySet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, _aObj); + m_xPropertySet = UnoRuntime.queryInterface(XPropertySet.class, _aObj); } /** @@ -152,57 +136,73 @@ class PropertyHelper } } -public class ReportDesignerTest extends ComplexTestCase { +public class ReportDesignerTest +{ String mTestDocumentPath; - public String[] getTestMethodNames() - { - return new String[] {"firsttest"}; - } - - private void checkIfOfficeExists(String _sOfficePathWithTrash) - { - String sOfficePath = ""; - int nIndex = _sOfficePathWithTrash.indexOf("soffice.exe"); - if (nIndex > 0) - { - sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 11); - } - else - { - nIndex = _sOfficePathWithTrash.indexOf("soffice"); - if (nIndex > 0) - { - sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 7); - } - } - - log.println(sOfficePath); - File sOffice = new File(sOfficePath); - if (! sOffice.exists()) - { - log.println("ERROR: There exists no office installation at given path: '" + sOfficePath + "'"); - System.exit(0); - } - } - - - private static XDesktop m_xDesktop = null; - public static XDesktop getXDesktop() +// public String[] getTestMethodNames() +// { +// return new String[] {"firsttest"}; +// } + + @Before public void before() + { + System.out.println("before"); + // String tempdir = System.getProperty("java.io.tmpdir"); + // + int dummy = 0; + // m_xXMultiServiceFactory = getMSF(); + } + + @After public void after() + { + System.out.println("after"); + } + +// private void checkIfOfficeExists(String _sOfficePathWithTrash) +// { +// String sOfficePath = ""; +// int nIndex = _sOfficePathWithTrash.indexOf("soffice.exe"); +// if (nIndex > 0) +// { +// sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 11); +// } +// else +// { +// nIndex = _sOfficePathWithTrash.indexOf("soffice"); +// if (nIndex > 0) +// { +// sOfficePath = _sOfficePathWithTrash.substring(0, nIndex + 7); +// } +// } +// +// System.out.println(sOfficePath); +// File sOffice = new File(sOfficePath); +// if (! sOffice.exists()) +// { +// System.out.println("ERROR: There exists no office installation at given path: '" + sOfficePath + "'"); +// System.exit(0); +// } +// } + + + private XDesktop m_xDesktop = null; + public XDesktop getXDesktop() { if (m_xDesktop == null) { try { - XInterface xInterface = (XInterface) m_xXMultiServiceFactory.createInstance( "com.sun.star.frame.Desktop" ); - m_xDesktop = (XDesktop) UnoRuntime.queryInterface(XDesktop.class, xInterface); + XInterface xInterface = (XInterface) getMSF().createInstance( "com.sun.star.frame.Desktop" ); + m_xDesktop = UnoRuntime.queryInterface(XDesktop.class, xInterface); + assertNotNull("Can't get XDesktop", m_xDesktop); } catch (com.sun.star.uno.Exception e) { - log.println("ERROR: uno.Exception caught"); - log.println("Message: " + e.getMessage()); + System.out.println("ERROR: uno.Exception caught"); + System.out.println("Message: " + e.getMessage()); } } return m_xDesktop; @@ -226,28 +226,27 @@ public class ReportDesignerTest extends ComplexTestCase { private OfficeProvider m_aProvider = null; - private static XMultiServiceFactory m_xXMultiServiceFactory = null; - private void startOffice() - { - // int tempTime = param.getInt("SingleTimeOut"); - param.put("TimeOut", new Integer(300000)); - System.out.println("TimeOut: " + param.getInt("TimeOut")); - System.out.println("ThreadTimeOut: " + param.getInt("ThreadTimeOut")); - - // OfficeProvider aProvider = null; - m_aProvider = new OfficeProvider(); - m_xXMultiServiceFactory = (XMultiServiceFactory) m_aProvider.getManager(param); - param.put("ServiceFactory", m_xXMultiServiceFactory); - } - - private void stopOffice() - { - if (m_aProvider != null) - { - m_aProvider.closeExistingOffice(param, true); - m_aProvider = null; - } - } +// private void startOffice() +// { +// // int tempTime = param.getInt("SingleTimeOut"); +// param.put("TimeOut", new Integer(300000)); +// System.out.println("TimeOut: " + param.getInt("TimeOut")); +// System.out.println("ThreadTimeOut: " + param.getInt("ThreadTimeOut")); +// +// // OfficeProvider aProvider = null; +// m_aProvider = new OfficeProvider(); +// m_xXMultiServiceFactory = (XMultiServiceFactory) m_aProvider.getManager(param); +// param.put("ServiceFactory", m_xXMultiServiceFactory); +// } +// +// private void stopOffice() +// { +// if (m_aProvider != null) +// { +// m_aProvider.closeExistingOffice(param, true); +// m_aProvider = null; +// } +// } private String m_sMailAddress = null; private String m_sUPDMinor; @@ -256,139 +255,104 @@ public class ReportDesignerTest extends ComplexTestCase { private static final int WRITER = 1; private static final int CALC = 2; - public void firsttest() + @Test public void firsttest() { - convwatch.GlobalLogWriter.set(log); - try - { - - // -------------------- preconditions, try to find an office -------------------- + // convwatch.GlobalLogWriter.set(log); - String sAppExecutionCommand = (String) param.get("AppExecutionCommand"); + // -------------------- preconditions, try to find an office -------------------- - String sUser = System.getProperty("user.name"); - log.println("user.name='" + sUser + "'"); +// String sAppExecutionCommand = (String) param.get("AppExecutionCommand"); - String sVCSID = System.getProperty("VCSID"); - log.println("VCSID='" + sVCSID + "'"); - m_sMailAddress = sVCSID + "@openoffice.org"; - log.println("Assumed mail address: " + m_sMailAddress); + String sUser = System.getProperty("user.name"); + System.out.println("user.name='" + sUser + "'"); - m_sUPDMinor = System.getProperty("UPDMINOR"); - m_sCWS_WORK_STAMP = System.getProperty("CWS_WORK_STAMP"); - // createDBEntry(); - log.println("Current CWS: " + m_sCWS_WORK_STAMP); - log.println("Current MWS: " + m_sUPDMinor); + String sVCSID = System.getProperty("VCSID"); + System.out.println("VCSID='" + sVCSID + "'"); + m_sMailAddress = sVCSID + "@openoffice.org"; + System.out.println("Assumed mail address: " + m_sMailAddress); - // System.exit(1); + m_sUPDMinor = System.getProperty("UPDMINOR"); + m_sCWS_WORK_STAMP = System.getProperty("CWS_WORK_STAMP"); + System.out.println("Current CWS: " + m_sCWS_WORK_STAMP); + System.out.println("Current MWS: " + m_sUPDMinor); - sAppExecutionCommand = sAppExecutionCommand.replaceAll( "\\$\\{USERNAME\\}", sUser); - log.println("sAppExecutionCommand='" + sAppExecutionCommand + "'"); - - // an other way to replace strings - // sAppExecutionCommand = utils.replaceAll13(sAppExecutionCommand, "${USERNAME}", sUser); - - checkIfOfficeExists(sAppExecutionCommand); - param.put("AppExecutionCommand", new String(sAppExecutionCommand)); - - // --------------------------- Start the given Office --------------------------- - - startOffice(); - - // ------------------------------ Start a test run ------------------------------ +// sAppExecutionCommand = sAppExecutionCommand.replaceAll( "\\$\\{USERNAME\\}", sUser); +// System.out.println("sAppExecutionCommand='" + sAppExecutionCommand + "'"); +// +// checkIfOfficeExists(sAppExecutionCommand); +// param.put("AppExecutionCommand", new String(sAppExecutionCommand)); - String sCurrentDirectory = System.getProperty("user.dir"); - log.println("Current Dir: " + sCurrentDirectory); + // --------------------------- Start the given Office --------------------------- - String sWriterDocument = sCurrentDirectory + "/" + "RPTWriterTests.odb"; - startTestForFile(sWriterDocument, WRITER); +// startOffice(); - String sCalcDocument = sCurrentDirectory + "/" + "RPTCalcTests.odb"; - startTestForFile(sCalcDocument, CALC); - } - catch (AssureException e) - { - stopOffice(); - throw new AssureException(e.getMessage()); - } + // ------------------------------ Start a test run ------------------------------ +// String sCurrentDirectory = System.getProperty("user.dir"); +// System.out.println("Current Dir: " + sCurrentDirectory); +// + String sWriterDocument = TestDocument.getUrl("RPTWriterTests.odb"); + startTestForFile(sWriterDocument, WRITER); + + String sCalcDocument = TestDocument.getUrl("RPTCalcTests.odb"); + startTestForFile(sCalcDocument, CALC); +// catch (AssureException e) +// { +// stopOffice(); +// throw new AssureException(e.getMessage()); +// } +// // ------------------------------ Office shutdown ------------------------------ - stopOffice(); +// stopOffice(); } // ----------------------------------------------------------------------------- private void startTestForFile(String _sDocument, int _nType) { - File aFile = new File(_sDocument); - assure("Test File doesn't '" + _sDocument + "'exist.", aFile.exists()); + FileURL aFileURL = new FileURL(_sDocument); + assertTrue("Test File doesn't '" + _sDocument + "'exist.", aFileURL.exists()); - String sFileURL = URLHelper.getFileURLFromSystemPath(_sDocument); - log.println("File URL: " + sFileURL); + String sFileURL = _sDocument; // URLHelper.getFileURLFromSystemPath(_sDocument); + System.out.println("File URL: " + sFileURL); XComponent xDocComponent = loadComponent(sFileURL, getXDesktop(), null); - log.println("Load done"); -// context = createUnoService("com.sun.star.sdb.DatabaseContext") -// oDataBase = context.getByName("hh") -// oDBDoc = oDataBase.DatabaseDocument -// -// dim args(1) as new com.sun.star.beans.PropertyValue -// args(0).Name = "ActiveConnection" -// args(0).Value = oDBDoc.getCurrentController().getPropertyValue("ActiveConnection") -// reportContainer = oDBDoc.getReportDocuments() -// report = reportContainer.loadComponentFromURL("Report40","",0,args) + System.out.println("Load done"); + assertNotNull("Can't load document ", xDocComponent); + try { - XInterface x = (XInterface)m_xXMultiServiceFactory.createInstance("com.sun.star.sdb.DatabaseContext"); - assure("can't create instance of com.sun.star.sdb.DatabaseContext", x != null); - log.println("createInstance com.sun.star.sdb.DatabaseContext done"); + XInterface x = (XInterface)getMSF().createInstance("com.sun.star.sdb.DatabaseContext"); + assertNotNull("can't create instance of com.sun.star.sdb.DatabaseContext", x); + System.out.println("createInstance com.sun.star.sdb.DatabaseContext done"); - XNameAccess xNameAccess = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, x); + XNameAccess xNameAccess = UnoRuntime.queryInterface(XNameAccess.class, x); showElements(xNameAccess); Object aObj = xNameAccess.getByName(sFileURL); -// log.println("1"); - // PropertySetHelper aHelper = new PropertySetHelper(aObj); - XDocumentDataSource xDataSource = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, aObj); -// Object aDatabaseDocmuent = aHelper.getPropertyValueAsObject("DatabaseDocument"); + XDocumentDataSource xDataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, aObj); XOfficeDatabaseDocument xOfficeDBDoc = xDataSource.getDatabaseDocument(); - // XOfficeDatabaseDocument xOfficeDBDoc = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, aDatabaseDocument); - assure("can't access DatabaseDocument", xOfficeDBDoc != null); -// log.println("2"); + assertNotNull("can't access DatabaseDocument", xOfficeDBDoc); - XModel xDBSource = (XModel)UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc); + XModel xDBSource = UnoRuntime.queryInterface(XModel.class, xOfficeDBDoc); Object aController = xDBSource.getCurrentController(); - assure("Controller of xOfficeDatabaseDocument is empty!", aController != null); -// log.println("3"); - - XDatabaseDocumentUI aDBDocUI = (XDatabaseDocumentUI)UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController); - boolean isConnect = aDBDocUI.connect(); -// if (isConnect) -// { -// System.out.println("true"); -// } -// else -// { -// System.out.println("false"); -// } -// log.println("4"); - - // aHelper = new PropertySetHelper(aController); - - // Object aActiveConnectionObj = aHelper.getPropertyValueAsObject("ActiveConnection"); + assertNotNull("Controller of xOfficeDatabaseDocument is empty!", aController); + + XDatabaseDocumentUI aDBDocUI = UnoRuntime.queryInterface(XDatabaseDocumentUI.class, aController); + /* boolean isConnect = */ +// TODO: throws an exception in DEV300m78 + aDBDocUI.connect(); Object aActiveConnectionObj = aDBDocUI.getActiveConnection(); - assure("ActiveConnection is empty", aActiveConnectionObj != null); -// log.println("5"); + assertNotNull("ActiveConnection is empty", aActiveConnectionObj); - XReportDocumentsSupplier xSupplier = (XReportDocumentsSupplier)UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc); + XReportDocumentsSupplier xSupplier = UnoRuntime.queryInterface(XReportDocumentsSupplier.class, xOfficeDBDoc); xNameAccess = xSupplier.getReportDocuments(); - assure("xOfficeDatabaseDocument returns no Report Document", xNameAccess != null); -// log.println("5"); + assertNotNull("xOfficeDatabaseDocument returns no Report Document", xNameAccess); showElements(xNameAccess); - ArrayList aPropertyList = new ArrayList(); + ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); PropertyValue aActiveConnection = new PropertyValue(); aActiveConnection.Name = "ActiveConnection"; @@ -400,14 +364,9 @@ public class ReportDesignerTest extends ComplexTestCase { } catch(com.sun.star.uno.Exception e) { - log.println("ERROR: Exception caught"); + fail("ERROR: Exception caught" + e.getMessage()); } - // String mTestDocumentPath = (String) param.get("TestDocumentPath"); - // System.out.println("mTestDocumentPath: '" + mTestDocumentPath + "'"); - // // workaround for issue using deprecated "DOCPTH" prop - // System.setProperty("DOCPTH", mTestDocumentPath); - // Close the document closeComponent(xDocComponent); } @@ -421,8 +380,8 @@ public class ReportDesignerTest extends ComplexTestCase { private void createDBEntry(int _nType) { // try to connect the database - String sDBConnection = (String)param.get( convwatch.PropertyName.DB_CONNECTION_STRING ); - log.println("DBConnection: " + sDBConnection); + String sDBConnection = ""; // (String)param.get( convwatch.PropertyName.DB_CONNECTION_STRING ); + System.out.println("DBConnection: " + sDBConnection); DB.init(sDBConnection); String sDestinationVersion = m_sCWS_WORK_STAMP; if (sDestinationVersion.length() == 0) @@ -436,12 +395,10 @@ public class ReportDesignerTest extends ComplexTestCase { String sSpecial = ""; String sFixRefSubDirectory = "ReportDesign_qa_complex_" + getFileFormat(_nType); - DB.insertinto_documentcompare(sFixRefSubDirectory, "", "fixref", - sDestinationVersion, sDestinationName, sDestinationCreatorType, - sDocumentPoolDir, sDocumentPoolName, m_sMailAddress, - sSpecial); - // DB.test(); - // System.exit(1); +// DB.insertinto_documentcompare(sFixRefSubDirectory, "", "fixref", +// sDestinationVersion, sDestinationName, sDestinationCreatorType, +// sDocumentPoolDir, sDocumentPoolName, m_sMailAddress, +// sSpecial); } private void loadAndStoreReports(XNameAccess _xNameAccess, ArrayList _aPropertyList, int _nType) @@ -495,7 +452,7 @@ public class ReportDesignerTest extends ComplexTestCase { private String getOutputPath(int _nType) { - String sOutputPath = (String)param.get( convwatch.PropertyName.DOC_COMPARATOR_OUTPUT_PATH ); + String sOutputPath = util.utils.getOfficeTemp/*Dir*/(getMSF());// (String)param.get( convwatch.PropertyName.DOC_COMPARATOR_OUTPUT_PATH ); if (!sOutputPath.endsWith("/") || // construct the output file name !sOutputPath.endsWith("\\")) @@ -505,9 +462,6 @@ public class ReportDesignerTest extends ComplexTestCase { sOutputPath += "tmp_123"; sOutputPath += System.getProperty("file.separator"); - // sOutputPath += getFileFormat(_nType); - // sOutputPath += System.getProperty("file.separator"); - File aOutputFile = new File(sOutputPath); // create the directory of the given output path aOutputFile.mkdirs(); @@ -533,7 +487,7 @@ public class ReportDesignerTest extends ComplexTestCase { String sOutputURL = URLHelper.getFileURLFromSystemPath(sOutputPath); - ArrayList aPropertyList = new ArrayList(); // set some properties for storeAsURL + ArrayList<PropertyValue> aPropertyList = new ArrayList<PropertyValue>(); // set some properties for storeAsURL PropertyValue aFileFormat = new PropertyValue(); aFileFormat.Name = "FilterName"; @@ -546,19 +500,19 @@ public class ReportDesignerTest extends ComplexTestCase { aPropertyList.add(aOverwrite); // store the document in an other directory - XStorable aStorable = (XStorable) UnoRuntime.queryInterface( XStorable.class, _xComponent); + XStorable aStorable = UnoRuntime.queryInterface(XStorable.class, _xComponent); if (aStorable != null) { - log.println("store document as URL: '" + sOutputURL + "'"); + System.out.println("store document as URL: '" + sOutputURL + "'"); try { aStorable.storeAsURL(sOutputURL, PropertyHelper.createPropertyValueArrayFormArrayList(aPropertyList)); } catch (com.sun.star.io.IOException e) { - log.println("ERROR: Exception caught"); - log.println("Can't write document URL: '" + sOutputURL + "'"); - log.println("Message: " + e.getMessage()); + System.out.println("ERROR: Exception caught"); + System.out.println("Can't write document URL: '" + sOutputURL + "'"); + System.out.println("Message: " + e.getMessage()); } } } @@ -566,25 +520,25 @@ public class ReportDesignerTest extends ComplexTestCase { private XComponent loadComponent(String _sName, Object _xComponent, ArrayList _aPropertyList) { XComponent xDocComponent = null; - XComponentLoader xComponentLoader = (XComponentLoader) UnoRuntime.queryInterface( XComponentLoader.class, _xComponent ); + XComponentLoader xComponentLoader = UnoRuntime.queryInterface(XComponentLoader.class, _xComponent); try { PropertyValue[] aLoadProperties = PropertyHelper.createPropertyValueArrayFormArrayList(_aPropertyList); - log.println("Load component: '" + _sName + "'"); + System.out.println("Load component: '" + _sName + "'"); xDocComponent = xComponentLoader.loadComponentFromURL(_sName, "_blank", 0, aLoadProperties); } catch (com.sun.star.io.IOException e) { - log.println("ERROR: Exception caught"); - log.println("Can't load document '" + _sName + "'"); - log.println("Message: " + e.getMessage()); + System.out.println("ERROR: Exception caught"); + System.out.println("Can't load document '" + _sName + "'"); + System.out.println("Message: " + e.getMessage()); } catch (com.sun.star.lang.IllegalArgumentException e) { - log.println("ERROR: Exception caught"); - log.println("Illegal Arguments given to loadComponentFromURL."); - log.println("Message: " + e.getMessage()); + System.out.println("ERROR: Exception caught"); + System.out.println("Illegal Arguments given to loadComponentFromURL."); + System.out.println("Message: " + e.getMessage()); } return xDocComponent; } @@ -592,17 +546,39 @@ public class ReportDesignerTest extends ComplexTestCase { private void closeComponent(XComponent _xDoc) { // Close the document - XCloseable xCloseable = (XCloseable) UnoRuntime.queryInterface(XCloseable.class, _xDoc); + XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, _xDoc); try { xCloseable.close(true); } catch (com.sun.star.util.CloseVetoException e) { - log.println("ERROR: CloseVetoException caught"); - log.println("CloseVetoException occured Can't close document."); - log.println("Message: " + e.getMessage()); + System.out.println("ERROR: CloseVetoException caught"); + System.out.println("CloseVetoException occured Can't close document."); + System.out.println("Message: " + e.getMessage()); } } + + private 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 { + System.out.println("setUpConnection()"); + connection.setUp(); + } + + @AfterClass public static void tearDownConnection() + throws InterruptedException, com.sun.star.uno.Exception + { + System.out.println("tearDownConnection()"); + connection.tearDown(); + } + + private static final OfficeConnection connection = new OfficeConnection(); + } diff --git a/dbaccess/qa/unoapi/Test.java b/reportdesign/qa/complex/reportdesign/TestDocument.java index 4f2409fdc8bd..a6e294d4d3ec 100644 --- a/dbaccess/qa/unoapi/Test.java +++ b/reportdesign/qa/complex/reportdesign/TestDocument.java @@ -1,4 +1,5 @@ /************************************************************************* +* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. @@ -21,32 +22,20 @@ * version 3 along with OpenOffice.org. If not, see * <http://www.openoffice.org/license.html> * for a copy of the LGPLv3 License. +* ************************************************************************/ -package org.openoffice.dbaccess.qa.unoapi; - -import org.openoffice.Runner; -import org.openoffice.test.OfficeConnection; -import static org.junit.Assert.*; - -public final class Test { - @org.junit.Before public void setUp() throws Exception { - connection.setUp(); - } +package complex.reportdesign; - @org.junit.After public void tearDown() - throws InterruptedException, com.sun.star.uno.Exception - { - connection.tearDown(); - } +import java.io.File; +import org.openoffice.test.OfficeFileUrl; - @org.junit.Test public void test() { - assertTrue( - Runner.run( - "-sce", "dbaccess.sce", "-xcl", "knownissues.xcl", "-ini", - "dbaccess.props", "-tdoc", "testdocuments", "-cs", - connection.getDescription())); - } +final class TestDocument +{ + public static String getUrl(String name) + { + return OfficeFileUrl.getAbsolute(new File("test_documents", name)); + } - private final OfficeConnection connection = new OfficeConnection(); + private TestDocument() {} } diff --git a/dbaccess/qa/unoapi/makefile.mk b/reportdesign/qa/complex/reportdesign/makefile.mk index 41ed9480f526..4174eb02ce3a 100644..100755 --- a/dbaccess/qa/unoapi/makefile.mk +++ b/reportdesign/qa/complex/reportdesign/makefile.mk @@ -1,6 +1,7 @@ #************************************************************************* -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # +# 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 @@ -21,22 +22,35 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -#***********************************************************************/ +# +#************************************************************************* .IF "$(OOO_SUBSEQUENT_TESTS)" == "" nothing .PHONY: .ELSE -PRJ = ../.. -PRJNAME = dbaccess -TARGET = qa_unoapi +PRJ = ../../.. +PRJNAME = reportdesign +TARGET = qa_complex_reportdesign .IF "$(OOO_JUNIT_JAR)" != "" -PACKAGE = org/openoffice/dbaccess/qa/unoapi -JAVATESTFILES = Test.java -JAVAFILES = $(JAVATESTFILES) -JARFILES = OOoRunner.jar ridl.jar test.jar +PACKAGE = complex/reportdesign + +# here store only Files which contain a @Test +JAVATESTFILES = \ + ReportDesignerTest.java + +# put here all other files +JAVAFILES = $(JAVATESTFILES) \ + TestDocument.java \ + FileURL.java + +JARFILES = OOoRunner.jar ridl.jar test.jar unoil.jar EXTRAJARFILES = $(OOO_JUNIT_JAR) + +# Sample how to debug +# JAVAIFLAGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=9003,suspend=y + .END .INCLUDE: settings.mk diff --git a/reportdesign/qa/complex/mysql-connector-exists.pl b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl index 6eefe2bb0639..6eefe2bb0639 100644 --- a/reportdesign/qa/complex/mysql-connector-exists.pl +++ b/reportdesign/qa/complex/reportdesign/mysql-connector-exists.pl diff --git a/reportdesign/qa/complex/runner.props b/reportdesign/qa/complex/reportdesign/runner.props index d894366ce006..d894366ce006 100755 --- a/reportdesign/qa/complex/runner.props +++ b/reportdesign/qa/complex/reportdesign/runner.props diff --git a/reportdesign/qa/complex/RPTCalcTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb Binary files differindex 0e91d633d4e7..0e91d633d4e7 100755..100644 --- a/reportdesign/qa/complex/RPTCalcTests.odb +++ b/reportdesign/qa/complex/reportdesign/test_documents/RPTCalcTests.odb diff --git a/reportdesign/qa/complex/RPTWriterTests.odb b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb Binary files differindex 86228f457f0b..7099b1abf2b5 100755..100644 --- a/reportdesign/qa/complex/RPTWriterTests.odb +++ b/reportdesign/qa/complex/reportdesign/test_documents/RPTWriterTests.odb diff --git a/reportdesign/source/core/api/FixedLine.cxx b/reportdesign/source/core/api/FixedLine.cxx index 4b5f26f9cd96..6db745085f61 100644 --- a/reportdesign/source/core/api/FixedLine.cxx +++ b/reportdesign/source/core/api/FixedLine.cxx @@ -188,7 +188,7 @@ OFixedLine::OFixedLine(uno::Reference< uno::XComponentContext > const & _xContex } catch(uno::Exception&) { - OSL_ENSURE(0,"OFixedLine::OFixedLine: Exception caught!"); + OSL_FAIL("OFixedLine::OFixedLine: Exception caught!"); } osl_decrementInterlockedCount( &m_refCount ); } @@ -198,7 +198,6 @@ OFixedLine::~OFixedLine() DBG_DTOR(rpt_OFixedLine,NULL); } // ----------------------------------------------------------------------------- -//IMPLEMENT_FORWARD_XINTERFACE2(OFixedLine,FixedLineBase,FixedLinePropertySet) IMPLEMENT_FORWARD_REFCOUNT( OFixedLine, FixedLineBase ) // -------------------------------------------------------------------------------- uno::Any SAL_CALL OFixedLine::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) diff --git a/reportdesign/source/core/api/FixedText.cxx b/reportdesign/source/core/api/FixedText.cxx index 4414508dcd04..7225803034d5 100644 --- a/reportdesign/source/core/api/FixedText.cxx +++ b/reportdesign/source/core/api/FixedText.cxx @@ -97,7 +97,6 @@ uno::Any SAL_CALL OFixedText::queryInterface( const uno::Type& _rType ) throw (u return aReturn.hasValue() ? aReturn : (m_aProps.aComponent.m_xProxy.is() ? m_aProps.aComponent.m_xProxy->queryAggregation(_rType) : aReturn); } -//IMPLEMENT_FORWARD_XINTERFACE2(OFixedText,FixedTextBase,FixedTextPropertySet) // ----------------------------------------------------------------------------- void SAL_CALL OFixedText::dispose() throw(uno::RuntimeException) { @@ -119,9 +118,8 @@ void SAL_CALL OFixedText::dispose() throw(uno::RuntimeException) //-------------------------------------------------------------------------- uno::Sequence< ::rtl::OUString > OFixedText::getSupportedServiceNames_Static( ) throw(uno::RuntimeException) { - uno::Sequence< ::rtl::OUString > aServices(1);//2); + uno::Sequence< ::rtl::OUString > aServices(1); aServices.getArray()[0] = SERVICE_FIXEDTEXT; - //aServices.getArray()[1] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")); return aServices; } diff --git a/reportdesign/source/core/api/FormattedField.cxx b/reportdesign/source/core/api/FormattedField.cxx index 100ded84e8ab..237822575de6 100644 --- a/reportdesign/source/core/api/FormattedField.cxx +++ b/reportdesign/source/core/api/FormattedField.cxx @@ -91,7 +91,6 @@ OFormattedField::~OFormattedField() DBG_DTOR( rpt_OFormattedField,NULL); } // ----------------------------------------------------------------------------- -//IMPLEMENT_FORWARD_XINTERFACE2(OFormattedField,FormattedFieldBase,FormattedFieldPropertySet) IMPLEMENT_FORWARD_REFCOUNT( OFormattedField, FormattedFieldBase ) // -------------------------------------------------------------------------------- uno::Any SAL_CALL OFormattedField::queryInterface( const uno::Type& _rType ) throw (uno::RuntimeException) diff --git a/reportdesign/source/core/api/Group.cxx b/reportdesign/source/core/api/Group.cxx index d7c208c98634..fbcad5aeb276 100644 --- a/reportdesign/source/core/api/Group.cxx +++ b/reportdesign/source/core/api/Group.cxx @@ -76,13 +76,13 @@ void OGroup::copyGroup(const uno::Reference< report::XGroup >& _xSource) { setHeaderOn(sal_True); OSection::lcl_copySection(_xSource->getHeader(),m_xHeader); - } // if ( _xSource->getHeaderOn() ) + } if ( _xSource->getFooterOn() ) { setFooterOn(sal_True); OSection::lcl_copySection(_xSource->getFooter(),m_xFooter); - } // if ( _xSource->getFooterOn() ) + } } //-------------------------------------------------------------------------- IMPLEMENT_FORWARD_XINTERFACE2(OGroup,GroupBase,GroupPropertySet) @@ -121,8 +121,6 @@ void SAL_CALL OGroup::disposing() { m_xHeader.clear(); m_xFooter.clear(); - //::comphelper::disposeComponent(m_xHeader); - //::comphelper::disposeComponent(m_xFooter); ::comphelper::disposeComponent(m_xFunctions); m_xContext.clear(); } @@ -150,8 +148,6 @@ void SAL_CALL OGroup::setHeaderOn( ::sal_Bool _headeron ) throw (uno::RuntimeExc if ( _headeron != m_xHeader.is() ) { ::rtl::OUString sName(RPT_RESSTRING(RID_STR_GROUP_HEADER,m_xContext->getServiceManager())); - /*const ::rtl::OUString sPlaceHolder(RTL_CONSTASCII_USTRINGPARAM("%1")); - sName = sName.replaceAt(sName.indexOf(sPlaceHolder),sPlaceHolder.getLength(),m_aProps.m_sExpression);*/ setSection(PROPERTY_HEADERON,_headeron,sName,m_xHeader); } } @@ -167,8 +163,6 @@ void SAL_CALL OGroup::setFooterOn( ::sal_Bool _footeron ) throw (uno::RuntimeExc if ( _footeron != m_xFooter.is() ) { ::rtl::OUString sName(RPT_RESSTRING(RID_STR_GROUP_FOOTER,m_xContext->getServiceManager())); - /*const ::rtl::OUString sPlaceHolder(RTL_CONSTASCII_USTRINGPARAM("%1")); - sName = sName.replaceAt(sName.indexOf(sPlaceHolder),sPlaceHolder.getLength(),m_aProps.m_sExpression);*/ setSection(PROPERTY_FOOTERON,_footeron,sName,m_xFooter); } } @@ -294,7 +288,6 @@ void SAL_CALL OGroup::setParent( const uno::Reference< uno::XInterface >& /*Pare // ----------------------------------------------------------------------------- uno::Reference< beans::XPropertySetInfo > SAL_CALL OGroup::getPropertySetInfo( ) throw(uno::RuntimeException) { - // return uno::Reference< beans::XPropertySetInfo >(); return GroupPropertySet::getPropertySetInfo(); } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/core/api/ImageControl.cxx b/reportdesign/source/core/api/ImageControl.cxx index 60498b766b12..f1b18970bd22 100644 --- a/reportdesign/source/core/api/ImageControl.cxx +++ b/reportdesign/source/core/api/ImageControl.cxx @@ -218,7 +218,6 @@ sal_Bool SAL_CALL OImageControl::supportsService(const ::rtl::OUString& ServiceN REPORTCOMPONENT_IMPL(OImageControl,m_aProps.aComponent) REPORTCOMPONENT_IMPL2(OImageControl,m_aProps.aComponent) REPORTCOMPONENT_NOMASTERDETAIL(OImageControl) -//REPORTCONTROLFORMAT_IMPL(OImageControl,m_aProps.aFormatProperties) NO_REPORTCONTROLFORMAT_IMPL(OImageControl) ::rtl::OUString SAL_CALL OImageControl::getHyperLinkURL() throw (uno::RuntimeException, beans::UnknownPropertyException) { diff --git a/reportdesign/source/core/api/ReportComponent.cxx b/reportdesign/source/core/api/ReportComponent.cxx index 78361152a82d..6854cec6e635 100644 --- a/reportdesign/source/core/api/ReportComponent.cxx +++ b/reportdesign/source/core/api/ReportComponent.cxx @@ -55,7 +55,7 @@ void lcl_getDefaultFonts( Font& rLatinFont, Font& rCJKFont, Font& rCTLFont,Langu { LanguageType eLatin = _eLatin; - // #108374# / #107782#: If the UI language is Korean, the default Latin font has to + // If the UI language is Korean, the default Latin font has to // be queried for Korean, too (the Latin language from the document can't be Korean). // This is the same logic as in SwDocShell::InitNew. LanguageType eUiLanguage = Application::GetSettings().GetUILanguage(); @@ -115,7 +115,6 @@ OFormatProperties::OFormatProperties() } aFontDescriptor.Weight = awt::FontWeight::NORMAL; aFontDescriptor.CharacterWidth = awt::FontWidth::NORMAL; - // aCharLocale = SvtSysLocale().GetLocaleData().getLocale(); } // ----------------------------------------------------------------------------- void OReportComponentProperties::setShape(uno::Reference< drawing::XShape >& _xShape,const uno::Reference< report::XReportComponent>& _xTunnel,oslInterlockedCount& _rRefCount) diff --git a/reportdesign/source/core/api/ReportControlModel.cxx b/reportdesign/source/core/api/ReportControlModel.cxx index c247742d9870..a1617d75d86f 100644 --- a/reportdesign/source/core/api/ReportControlModel.cxx +++ b/reportdesign/source/core/api/ReportControlModel.cxx @@ -85,7 +85,6 @@ void OReportControlModel::insertByIndex( ::sal_Int32 Index, const uno::Any& Elem if ( Index > static_cast<sal_Int32>(m_aFormatConditions.size()) ) throw lang::IndexOutOfBoundsException(); - //m_aFormatConditions.resize(m_aFormatConditions.size() + 1); m_aFormatConditions.insert(m_aFormatConditions.begin() + Index,xElement); } diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index fd9360e30b3c..935250b9370b 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -25,18 +25,66 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ + #include "ReportDefinition.hxx" + +#include "FixedLine.hxx" +#include "FixedText.hxx" +#include "FormattedField.hxx" +#include "Functions.hxx" +#include "Groups.hxx" +#include "ImageControl.hxx" +#include "ReportComponent.hxx" +#include "ReportHelperImpl.hxx" +#include "RptDef.hxx" +#include "RptModel.hxx" +#include "Section.hxx" +#include "Shape.hxx" +#include "Tools.hxx" +#include "UndoEnv.hxx" +#include "core_resource.hrc" +#include "core_resource.hxx" +#include "corestrings.hrc" + +/** === begin UNO includes === **/ #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/beans/XMultiPropertyStates.hpp> +#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp> +#include <com/sun/star/document/EventObject.hpp> +#include <com/sun/star/document/XEventListener.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XImporter.hpp> +#include <com/sun/star/embed/Aspects.hpp> +#include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/EmbedMapUnits.hpp> +#include <com/sun/star/embed/EntryInitModes.hpp> +#include <com/sun/star/embed/XEmbedPersist.hpp> +#include <com/sun/star/embed/XTransactedObject.hpp> +#include <com/sun/star/frame/FrameSearchFlag.hpp> +#include <com/sun/star/frame/XComponentLoader.hpp> +#include <com/sun/star/io/XActiveDataSource.hpp> +#include <com/sun/star/io/XSeekable.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/report/GroupKeepTogether.hpp> #include <com/sun/star/report/ReportPrintOption.hpp> #include <com/sun/star/report/XFunction.hpp> #include <com/sun/star/sdb/CommandType.hpp> +#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> +#include <com/sun/star/style/GraphicLocation.hpp> +#include <com/sun/star/style/NumberingType.hpp> +#include <com/sun/star/style/PageStyleLayout.hpp> +#include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/table/BorderLine.hpp> #include <com/sun/star/table/ShadowFormat.hpp> -#include <com/sun/star/style/PageStyleLayout.hpp> -#include <com/sun/star/style/GraphicLocation.hpp> +#include <com/sun/star/task/ErrorCodeIOException.hpp> +#include <com/sun/star/task/XStatusIndicator.hpp> +#include <com/sun/star/task/XStatusIndicatorFactory.hpp> +#include <com/sun/star/ui/XUIConfigurationStorage.hpp> #include <com/sun/star/xml/AttributeData.hpp> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +/** === end UNO includes === **/ + #include <comphelper/broadcasthelper.hxx> #include <comphelper/documentconstants.hxx> #include <comphelper/genericpropertyset.hxx> @@ -45,83 +93,40 @@ #include <comphelper/namecontainer.hxx> #include <comphelper/namedvaluecollection.hxx> #include <comphelper/numberedcollection.hxx> -#include <comphelper/propertystatecontainer.hxx> #include <comphelper/proparrhlp.hxx> #include <comphelper/property.hxx> #include <comphelper/propertysetinfo.hxx> -#include <comphelper/sequence.hxx> +#include <comphelper/propertystatecontainer.hxx> #include <comphelper/seqstream.hxx> +#include <comphelper/sequence.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/uno3.hxx> -#include <com/sun/star/chart2/data/DatabaseDataProvider.hpp> -#include <vcl/svapp.hxx> -#include <vcl/virdev.hxx> -#include <osl/mutex.hxx> -#include <com/sun/star/beans/XMultiPropertyStates.hpp> -#include <com/sun/star/document/EventObject.hpp> -#include <com/sun/star/document/XEventListener.hpp> -#include <com/sun/star/style/XStyle.hpp> -#include <com/sun/star/embed/XTransactedObject.hpp> -#include <com/sun/star/embed/ElementModes.hpp> -#include <com/sun/star/embed/EmbedMapUnits.hpp> -#include <com/sun/star/embed/EntryInitModes.hpp> -#include <com/sun/star/embed/Aspects.hpp> -#include <com/sun/star/io/XActiveDataSource.hpp> -#include <com/sun/star/embed/ElementModes.hpp> -#include <com/sun/star/io/XSeekable.hpp> -#include <com/sun/star/embed/XEmbedPersist.hpp> -#include <com/sun/star/task/XStatusIndicator.hpp> -#include <com/sun/star/task/XStatusIndicatorFactory.hpp> -#include <com/sun/star/ui/XUIConfigurationStorage.hpp> -#include <com/sun/star/document/XExporter.hpp> -#include <com/sun/star/document/XImporter.hpp> -#include <com/sun/star/document/XFilter.hpp> -#include <com/sun/star/task/ErrorCodeIOException.hpp> -#include <com/sun/star/xml/sax/XDocumentHandler.hpp> -#include <com/sun/star/frame/XComponentLoader.hpp> -#include <com/sun/star/frame/FrameSearchFlag.hpp> -#include "corestrings.hrc" -#include "Groups.hxx" -#include "RptDef.hxx" -#include "Section.hxx" -#include "FixedLine.hxx" -#include "core_resource.hrc" -#include "core_resource.hxx" -#include "Tools.hxx" -#include <tools/debug.hxx> -#include <tools/diagnose_ex.h> -#include <unotools/streamwrap.hxx> #include <connectivity/CommonTools.hxx> #include <connectivity/dbconversion.hxx> -#include <framework/titlehelper.hxx> #include <connectivity/dbtools.hxx> -#include <com/sun/star/task/XStatusIndicator.hpp> -#include "Functions.hxx" -#include <boost/mem_fn.hpp> -#include <boost/bind.hpp> -#include <boost/utility.hpp> -#include <unotools/saveopt.hxx> -#include "RptModel.hxx" -#include "UndoEnv.hxx" -#include "FormattedField.hxx" -#include "FixedText.hxx" -#include "ImageControl.hxx" -#include "Shape.hxx" -#include "ReportHelperImpl.hxx" -#include <svl/itempool.hxx> -#include <unotools/moduleoptions.hxx> -#include <osl/thread.hxx> - +#include <cppuhelper/exc_hlp.hxx> +#include <cppuhelper/interfacecontainer.h> +#include <dbaccess/dbaundomanager.hxx> #include <editeng/paperinf.hxx> +#include <framework/titlehelper.hxx> +#include <osl/thread.hxx> +#include <svl/itempool.hxx> +#include <svl/undo.hxx> #include <svx/svdlayer.hxx> +#include <svx/unofill.hxx> #include <svx/xmleohlp.hxx> #include <svx/xmlgrhlp.hxx> -#include <svx/unofill.hxx> -#include <cppuhelper/interfacecontainer.h> -#include <cppuhelper/exc_hlp.hxx> -#include "ReportComponent.hxx" -#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <com/sun/star/style/NumberingType.hpp> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> +#include <unotools/moduleoptions.hxx> +#include <unotools/saveopt.hxx> +#include <unotools/streamwrap.hxx> +#include <vcl/svapp.hxx> +#include <vcl/virdev.hxx> + +#include <boost/bind.hpp> +#include <boost/mem_fn.hpp> +#include <boost/utility.hpp> #define MAP_LEN(x) x, sizeof(x) - 1 #define MAP_CHAR_LEN(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(x)) @@ -238,8 +243,7 @@ void lcl_extractAndStartStatusIndicator( const ::comphelper::MediaDescriptor& _r } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "lcl_extractAndStartStatusIndicator: caught an exception!" ); -// DBG_UNHANDLED_EXCEPTION(); + OSL_FAIL( "lcl_extractAndStartStatusIndicator: caught an exception!" ); } } // ----------------------------------------------------------------------------- @@ -318,30 +322,23 @@ OStyle::OStyle() registerPropertyNoMember( PROPERTY_NAME, ++i,nBound,::getCppuType( static_cast< ::rtl::OUString *>(NULL) ), &sName ); registerPropertyNoMember(PROPERTY_BACKCOLOR, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nTransparent); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_GRAPHICFILT), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(PROPERTY_BACKGRAPHICLOCATION, ++i,nBound,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation); - //registerPropertyNoMember(PROPERTY_BACKGRAPHICURL, ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(PROPERTY_BACKTRANSPARENT, ++i,nBound,::getBooleanCppuType() ,&bTrue); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_BACKCOLOR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BORDERDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BOTTBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_BOTTBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_BOTTOMMARGIN, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nMargin); registerPropertyNoMember(MAP_CHAR_LEN("DisplayName"), ++i,nBound,::getCppuType((rtl::OUString*)0) ,&sEmpty); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FIRSTPAGE), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); - // registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nTransparent); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFFILT), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFLOC), ++i,nBound,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRGRFURL), ++i,nBound,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBACKTRAN), ++i,nBound,::getBooleanCppuType() ,&bTrue); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBODYDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBOTTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRBOTTBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRHEIGHT), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRON), ++i,nBound,::getBooleanCppuType() ,&bFalse); @@ -349,12 +346,10 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRLEFTMAR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRON), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTBDIS),++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRRIGHTMAR), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRSHADOW), ++i,nBound,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRTOPBOR), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_FTRTOPBDIS), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); // @@ -363,12 +358,10 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFLOC), ++i,nBound|nMayBeVoid,::getCppuType((const style::GraphicLocation*)0) ,&eGraphicLocation); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRGRFURL), ++i,nBound|nMayBeVoid,::getCppuType((const ::rtl::OUString*)0) ,&sEmpty); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBACKTRAN), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bTrue); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKCOL), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBODYDIST), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBRDDIST), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBOTTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRBOTTBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRDYNAMIC), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRHEIGHT), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRDYNAMIC), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRON), ++i,nBound|nMayBeVoid,::getBooleanCppuType() ,&bFalse); @@ -376,23 +369,18 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRLEFTMAR), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRON), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTBDIS),++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRRIGHTMAR), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRSHADOW), ++i,nBound|nMayBeVoid,::getCppuType((const table::ShadowFormat*)0) ,&eShadowFormat); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRSHARED), ++i,nBound,::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRTOPBOR), ++i,nBound|nMayBeVoid,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_HDRTOPBDIS), ++i,nBound|nMayBeVoid,::getCppuType((const sal_Int32*)0) ,&nZero); // registerProperty(PROPERTY_HEIGHT, ++i,nBound,&m_aSize.Height, ::getCppuType((const sal_Int32*)0) ); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_BACKTRANS), ++i,nBound, ::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(PROPERTY_ISLANDSCAPE, ++i,nBound, ::getBooleanCppuType() ,&bFalse); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTBORDER), ++i,nBound, ::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTBRDDIST), ++i,nBound, ::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_LEFTMARGIN, ++i,beans::PropertyAttribute::BOUND, ::getCppuType((const sal_Int32*)0) ,&nMargin); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTFTRCONT), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_LEFTHDRCONT), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); registerPropertyNoMember(PROPERTY_NUMBERINGTYPE, ++i,nBound,::getCppuType((const sal_Int16*)0) ,&nNummeringType); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALEVAL), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(PROPERTY_PAGESTYLELAYOUT, ++i,nBound,::getCppuType((const style::PageStyleLayout*)0) ,&ePageStyleLayout); @@ -401,8 +389,6 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTBRDDIST),++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_RIGHTMARGIN, ++i,beans::PropertyAttribute::BOUND,::getCppuType((const sal_Int32*)0) ,&nMargin); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTFTRCON), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_RIGHTHDRCON), ++i,nBound,::getCppuType((const uno::Reference< sheet::XHeaderFooterContent >*)0) ,NULL); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOPAG), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOX), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_SCALETOY), ++i,nBound,::getCppuType((const sal_Int16*)0) ,&n16Zero); @@ -411,12 +397,9 @@ OStyle::OStyle() registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_TOPBORDER), ++i,nBound,::getCppuType((const table::BorderLine*)0) ,&eBorderLine); registerPropertyNoMember(MAP_CHAR_LEN(SC_UNO_PAGE_TOPBRDDIST), ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nZero); registerPropertyNoMember(PROPERTY_TOPMARGIN, ++i,nBound,::getCppuType((const sal_Int32*)0) ,&nMargin); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_FTRBACKTRAN),++i,nBound,::getBooleanCppuType() ,&bFalse); - //registerPropertyNoMember(MAP_CHAR_LEN(OLD_UNO_PAGE_HDRBACKTRAN),++i,nBound,::getBooleanCppuType() ,&bFalse); uno::Reference< container::XNameContainer> xAttribs = ::comphelper::NameContainer_createInstance(::getCppuType(static_cast< xml::AttributeData* >(NULL))); registerPropertyNoMember(MAP_CHAR_LEN("UserDefinedAttributes"), ++i,nBound,::getCppuType((uno::Reference<container::XNameContainer>*)0) ,&xAttribs); registerProperty(PROPERTY_WIDTH, ++i,nBound,&m_aSize.Width,::getCppuType((const sal_Int32*)0) ); - //registerPropertyNoMember(MAP_CHAR_LEN(SC_UNONAME_WRITING), ++i,nBound,:.getCppuType((sal_Int16*)0) ,&n16Zero); registerPropertyNoMember(MAP_CHAR_LEN("PrinterName"), ++i,nBound,::getCppuType((const ::rtl::OUString*)0),&sEmpty); uno::Sequence<sal_Int8> aSe; registerPropertyNoMember(MAP_CHAR_LEN("PrinterSetup"), ++i,nBound,::getCppuType((const uno::Sequence<sal_Int8>*)0),&aSe); @@ -608,6 +591,7 @@ struct OReportDefinitionImpl ::boost::shared_ptr< ::comphelper::EmbeddedObjectContainer> m_pObjectContainer; ::boost::shared_ptr<rptui::OReportModel> m_pReportModel; + ::rtl::Reference< ::dbaui::UndoManager > m_pUndoManager; ::rtl::OUString m_sCaption; ::rtl::OUString m_sCommand; ::rtl::OUString m_sFilter; @@ -624,6 +608,7 @@ struct OReportDefinitionImpl sal_Bool m_bModified; sal_Bool m_bEscapeProcessing; sal_Bool m_bSetModifiedEnabled; + OReportDefinitionImpl(::osl::Mutex& _aMutex) :m_aStorageChangeListeners(_aMutex) ,m_aCloseListener(_aMutex) @@ -747,7 +732,6 @@ OReportDefinition::~OReportDefinition() } // ----------------------------------------------------------------------------- IMPLEMENT_FORWARD_REFCOUNT( OReportDefinition, ReportDefinitionBase ) -//IMPLEMENT_FORWARD_XINTERFACE2(OReportDefinition,ReportDefinitionBase,ReportDefinitionPropertySet) void OReportDefinition::init() { try @@ -765,7 +749,7 @@ void OReportDefinition::init() pCreatorThread->createSuspended(); pCreatorThread->setPriority(osl_Thread_PriorityBelowNormal); pCreatorThread->resume(); - } // for ( ; pIter != pEnd; ++pIter ) + } } m_pImpl->m_pReportModel.reset(new OReportModel(this)); @@ -776,6 +760,9 @@ void OReportDefinition::init() rAdmin.NewLayer(UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "back" ) ), RPT_LAYER_BACK ); rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), RPT_LAYER_HIDDEN ); + m_pImpl->m_pUndoManager = new ::dbaui::UndoManager( *this, m_aMutex ); + m_pImpl->m_pReportModel->SetSdrUndoManager( &m_pImpl->m_pUndoManager->GetSfxUndoManager() ); + m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext); if ( !m_pImpl->m_xStorage.is() ) m_pImpl->m_xStorage = ::comphelper::OStorageHelper::GetTemporaryStorage(); @@ -790,9 +777,9 @@ void OReportDefinition::init() } m_pImpl->m_pObjectContainer.reset( new comphelper::EmbeddedObjectContainer(m_pImpl->m_xStorage , static_cast<cppu::OWeakObject*>(this) ) ); } - catch(uno::Exception) + catch ( const uno::Exception& ) { - OSL_ENSURE(0,"Error!"); + DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- @@ -826,18 +813,13 @@ void SAL_CALL OReportDefinition::disposing() m_pImpl->m_xPageHeader.clear(); m_pImpl->m_xPageFooter.clear(); m_pImpl->m_xDetail.clear(); - //::comphelper::disposeComponent(m_pImpl->m_xReportHeader); - //::comphelper::disposeComponent(m_pImpl->m_xReportFooter); - //::comphelper::disposeComponent(m_pImpl->m_xPageHeader); - //::comphelper::disposeComponent(m_pImpl->m_xPageFooter); - //::comphelper::disposeComponent(m_pImpl->m_xDetail); ::comphelper::disposeComponent(m_pImpl->m_xFunctions); //::comphelper::disposeComponent(m_pImpl->m_xStorage); // don't dispose, this currently is the task of either the ref count going to // 0, or of the embedded object (if we're embedded, which is the only possible // case so far) - // #i78366# / 2007-06-18 / frank.schoenheit@sun.com + // #i78366# m_pImpl->m_xStorage.clear(); m_pImpl->m_xViewData.clear(); m_pImpl->m_xCurrentController.clear(); @@ -1211,7 +1193,7 @@ void SAL_CALL OReportDefinition::setParent( const uno::Reference< uno::XInterfac // XCloneable uno::Reference< util::XCloneable > SAL_CALL OReportDefinition::createClone( ) throw (uno::RuntimeException) { - OSL_ENSURE(0,"Not yet implemented correctly"); + OSL_FAIL("Not yet implemented correctly"); uno::Reference< report::XReportComponent> xSource = this; uno::Reference< report::XReportDefinition> xSet(cloneObject(xSource,m_aProps->m_xFactory,SERVICE_REPORTDEFINITION),uno::UNO_QUERY_THROW); return xSet.get(); @@ -1278,7 +1260,7 @@ void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (u catch( const util::CloseVetoException& ) { throw; } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "ODatabaseDocument::impl_closeControllerFrames: caught an unexpected exception!" ); + OSL_FAIL( "ODatabaseDocument::impl_closeControllerFrames: caught an unexpected exception!" ); } } } @@ -1297,10 +1279,21 @@ void SAL_CALL OReportDefinition::close( ::sal_Bool _bDeliverOwnership ) throw (u SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard(m_aMutex); - ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); + ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed ); ::comphelper::MediaDescriptor aDescriptor( _aArguments ); - fillArgs(aDescriptor); - m_pImpl->m_pReportModel->SetModified(sal_False); + + m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( false ); + try + { + fillArgs(aDescriptor); + m_pImpl->m_pReportModel->SetModified(sal_False); + } + catch ( ... ) + { + m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true ); + throw; + } + m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true ); return sal_True; } // ----------------------------------------------------------------------------- @@ -1409,10 +1402,6 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::getCurrentSelectio void OReportDefinition::impl_loadFromStorage_nolck_throw( const uno::Reference< embed::XStorage >& _xStorageToLoadFrom, const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor ) { -// ::osl::MutexGuard aGuard(m_aMutex); -// ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); -// - m_pImpl->m_xStorage = _xStorageToLoadFrom; ::comphelper::MediaDescriptor aDescriptor( _aMediaDescriptor ); @@ -1512,7 +1501,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS { const ::rtl::OUString sVal( aDescriptor.getUnpackedValueOrDefault(aDescriptor.PROP_DOCUMENTBASEURL(),::rtl::OUString()) ); xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BaseURI")), uno::makeAny(sVal)); - } // if ( aSaveOpt.IsSaveRelFSys() ) + } const ::rtl::OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HierarchicalDocumentName")),::rtl::OUString()) ); xInfoSet->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")), uno::makeAny(sHierarchicalDocumentName)); @@ -1565,7 +1554,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS sWarnFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("meta.xml")); } } - } // if( !bErr ) + } if( !bErr ) { @@ -1594,7 +1583,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS bErr = sal_True; sErrFile = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("content.xml")); } - } // if ( !bErr ) + } uno::Any aImage; uno::Reference< embed::XVisualObject > xCurrentController(getCurrentController(),uno::UNO_QUERY); @@ -1632,7 +1621,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS } catch(uno::Exception) { - OSL_ENSURE(0,"Exception Caught: Could not commit report storage!"); + OSL_FAIL("Exception Caught: Could not commit report storage!"); throw io::IOException(); } @@ -1843,7 +1832,6 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue else if ( sURL.getLength() ) aStorageSource <<= sURL; else - // TODO: error message throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "No input source (URL or InputStream) found." ) ), // TODO: resource @@ -1886,7 +1874,7 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue { if ( i == nLastOpenMode ) throw lang::WrappedTargetException( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An error occured while creating the document storage." ) ), + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "An error occurred while creating the document storage." ) ), // TODO: resource *this, ::cppu::getCaughtException() @@ -1909,15 +1897,12 @@ void SAL_CALL OReportDefinition::setVisualAreaSize( ::sal_Int64 _nAspect, const { ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); - //if( nAspect == embed::Aspects::MSOLE_CONTENT ) - { bool bChanged = (m_pImpl->m_aVisualAreaSize.Width != _aSize.Width || m_pImpl->m_aVisualAreaSize.Height != _aSize.Height); m_pImpl->m_aVisualAreaSize = _aSize; if( bChanged ) setModified( sal_True ); - } m_pImpl->m_nAspect = _nAspect; } // ----------------------------------------------------------------------------- @@ -2081,8 +2066,6 @@ uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewDat { m_pImpl->m_xViewData.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.IndexedPropertyValues")),m_aProps->m_xContext ),uno::UNO_QUERY); - //uno::Sequence< beans::PropertyValue > aProps; - //m_pImpl->m_xViewData->insertByIndex(m_pImpl->m_xViewData->getCount(),uno::makeAny(aProps)); uno::Reference< container::XIndexContainer > xContainer(m_pImpl->m_xViewData,uno::UNO_QUERY); ::std::vector< uno::Reference< frame::XController> >::iterator aIter = m_pImpl->m_aControllers.begin(); ::std::vector< uno::Reference< frame::XController> >::iterator aEnd = m_pImpl->m_aControllers.end(); @@ -2097,7 +2080,7 @@ uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewDat catch(uno::Exception&) { } - } // if ( aIter->is() ) + } } } @@ -2269,9 +2252,9 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstanceWith { beans::NamedValue aValue; *pIter >>= aValue; - if( aValue.Name.equalsAscii( "Storage" ) ) + if( aValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Storage" ) ) ) aValue.Value >>= xStorage; - } // for(;pIter != pEnd ;++pIter) + } m_pImpl->m_pObjectContainer->SwitchPersistence(xStorage); xRet = static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( xStorage,*this, EMBEDDEDOBJECTHELPER_MODE_READ )); } @@ -2283,7 +2266,7 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co ::osl::MutexGuard aGuard(m_aMutex); ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed); uno::Reference< drawing::XShape > xShape; - if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.report.") ) == 0 ) + if ( aServiceSpecifier.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.")) ) == 0 ) { if ( aServiceSpecifier == SERVICE_SHAPE ) xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.CustomShape")) ),uno::UNO_QUERY_THROW); @@ -2295,7 +2278,7 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co else xShape.set(SvxUnoDrawMSFactory::createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")) ),uno::UNO_QUERY_THROW); } - else if ( aServiceSpecifier.indexOf( ::rtl::OUString::createFromAscii("com.sun.star.form.component.") ) == 0 ) + else if ( aServiceSpecifier.indexOf( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.")) ) == 0 ) { xShape.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier,m_aProps->m_xContext),uno::UNO_QUERY); } @@ -2327,35 +2310,30 @@ uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( co { if ( !m_pImpl->m_xGradientTable.is() ) m_pImpl->m_xGradientTable.set(SvxUnoGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const awt::Gradient*) 0 ) ).get(); return m_pImpl->m_xGradientTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.HatchTable") ) == 0 ) { if ( !m_pImpl->m_xHatchTable.is() ) m_pImpl->m_xHatchTable.set(SvxUnoHatchTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const drawing::Hatch*) 0 ) ).get(); return m_pImpl->m_xHatchTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.BitmapTable") ) == 0 ) { if ( !m_pImpl->m_xBitmapTable.is() ) m_pImpl->m_xBitmapTable.set(SvxUnoBitmapTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const ::rtl::OUString*) 0 ) ).get(); return m_pImpl->m_xBitmapTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.TransparencyGradientTable") ) == 0 ) { if ( !m_pImpl->m_xTransparencyGradientTable.is() ) m_pImpl->m_xTransparencyGradientTable.set(SvxUnoTransGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const awt::Gradient*) 0 ) ).get(); return m_pImpl->m_xTransparencyGradientTable; } else if ( aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.DashTable") ) == 0 ) { if ( !m_pImpl->m_xDashTable.is() ) m_pImpl->m_xDashTable.set(SvxUnoDashTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY); - //comphelper::NameContainer_createInstance( ::getCppuType( (const drawing::LineDash*) 0 ) ).get(); return m_pImpl->m_xDashTable; } else if( 0 == aServiceSpecifier.reverseCompareToAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.MarkerTable") ) ) @@ -2761,7 +2739,7 @@ uno::Reference< frame::XUntitledNumbers > OReportDefinition::impl_getUntitledHel m_pImpl->m_xNumberedControllers = uno::Reference< frame::XUntitledNumbers >(static_cast< ::cppu::OWeakObject* >(pHelper), uno::UNO_QUERY_THROW); pHelper->setOwner (xThis); - pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : ")); + pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : "))); } return m_pImpl->m_xNumberedControllers; @@ -2932,8 +2910,15 @@ uno::Sequence< datatransfer::DataFlavor > SAL_CALL OReportDefinition::getTransfe { return aFlavor.MimeType.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("image/png"))); } + // ----------------------------------------------------------------------------- -// ----------------------------------------------------------------------------- +uno::Reference< document::XUndoManager > SAL_CALL OReportDefinition::getUndoManager( ) throw (uno::RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + return m_pImpl->m_pUndoManager.get(); +} + + // ============================================================================= }// namespace reportdesign // ============================================================================= diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index feb94419f337..87d9982b57fe 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -198,7 +198,7 @@ void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task { xStorageProp->setPropertyValue( s_sMediaType, uno::makeAny(sMimeType)); } - m_xReport->storeToStorage(xTemp,aEmpty); // store to temp file because it may contain information which aren't in the database yet. + m_xReport->storeToStorage(xTemp,aEmpty); // store to temp file because it may contain information which isn't in the database yet. uno::Sequence< beans::NamedValue > aConvertedProperties(8); sal_Int32 nPos = 0; @@ -262,7 +262,6 @@ void SAL_CALL OReportEngineJFree::setStatusIndicator( const uno::Reference< task xJob->execute(aConvertedProperties); if ( xStorageProp.is() ) { - //xStorageProp->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL"))) >>= sOutputName; sOutputName = sFileURL; } } @@ -333,7 +332,6 @@ uno::Reference< frame::XModel > SAL_CALL OReportEngineJFree::createDocumentAlive } uno::Reference< lang::XMultiServiceFactory > xFac(m_xContext->getServiceManager(),uno::UNO_QUERY); - /*::comphelper::MimeConfigurationHelper aHelper(xFac);*/ xModel.set( xFrameLoad->loadComponentFromURL( sOutputName, ::rtl::OUString(), // empty frame name diff --git a/reportdesign/source/core/api/Section.cxx b/reportdesign/source/core/api/Section.cxx index 54e5cd8847ca..6c6aba20a81b 100644 --- a/reportdesign/source/core/api/Section.cxx +++ b/reportdesign/source/core/api/Section.cxx @@ -136,7 +136,6 @@ OSection::OSection(const uno::Reference< report::XReportDefinition >& _xParent { DBG_CTOR( rpt_OSection,NULL); init(); - //.getSdrModel()->createNewPage(m_xSection); } //-------------------------------------------------------------------------- // TODO: VirtualFunctionFinder: This is virtual function! @@ -179,28 +178,6 @@ void SAL_CALL OSection::disposing() lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) ); m_aContainerListeners.disposeAndClear( aDisposeEvent ); m_xContext.clear(); - //m_xDrawPage.clear(); - - /*uno::Reference< report::XReportDefinition> xReport = getReportDefinition(); - ::boost::shared_ptr<rptui::OReportModel> pModel = OReportDefinition::getSdrModel(xReport); - osl_incrementInterlockedCount( &m_refCount ); - while( m_xDrawPage.is() && m_xDrawPage->hasElements() ) - { - try - { - uno::Reference< drawing::XShape> xShape(m_xDrawPage->getByIndex(0),uno::UNO_QUERY); - m_xDrawPage->remove(xShape); - ::comphelper::disposeComponent(xShape); - } - catch(const uno::Exception&) - {} - } - if ( pModel ) - { - uno::Reference< report::XSection> xSection = this; - pModel->DeletePage(pModel->getPage(xSection)->GetPageNum()); - } - osl_decrementInterlockedCount( &m_refCount );*/ } //-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OSection::getImplementationName( ) throw(uno::RuntimeException) @@ -471,7 +448,7 @@ const ::std::vector< ::rtl::OUString >& lcl_getControlModelMap() s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ImageControl")) ); s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FormattedField")) ); s_sControlModels.push_back( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Shape")) ); - } // if ( s_sMap.empty() ) + } return s_sControlModels; } @@ -504,9 +481,8 @@ uno::Reference< report::XReportComponent > SAL_CALL OSection::createReportCompon xRet.set(xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.ControlShape"))),uno::UNO_QUERY); break; default: - //xRet = new OShape(m_xContext); break; - } // switch( aRet.begin() - aFind ) + } return xRet; } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/core/api/Shape.cxx b/reportdesign/source/core/api/Shape.cxx index 4ed2b8aabb9d..2fa28cd0f81d 100644 --- a/reportdesign/source/core/api/Shape.cxx +++ b/reportdesign/source/core/api/Shape.cxx @@ -322,11 +322,9 @@ uno::Reference< util::XCloneable > SAL_CALL OShape::createClone( ) throw (uno:: if ( pClone ) { xSet.set(pClone->getUnoShape(),uno::UNO_QUERY_THROW ); - - // ::comphelper::copyProperties(xSource.get(),xSet.get()); } } - } // if ( pShape ) + } } catch(const uno::Exception&) { @@ -345,11 +343,6 @@ void SAL_CALL OShape::setParent( const uno::Reference< uno::XInterface >& Parent { ::osl::MutexGuard aGuard(m_aMutex); m_aProps.aComponent.m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY); - // not supported by the shape - //uno::Reference< container::XChild > xChild; - //comphelper::query_aggregation(m_aProps.aComponent.m_xProxy,xChild); - //if ( xChild.is() ) - // xChild->setParent(Parent); } uno::Reference< report::XFormatCondition > SAL_CALL OShape::createFormatCondition( ) throw (uno::Exception, uno::RuntimeException) { diff --git a/reportdesign/source/core/api/services.cxx b/reportdesign/source/core/api/services.cxx index 32fa29152634..5bbbbad5b1f4 100644 --- a/reportdesign/source/core/api/services.cxx +++ b/reportdesign/source/core/api/services.cxx @@ -91,12 +91,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return cppu::component_writeInfoHelper( - serviceManager, registryKey, entries); -} } // extern "C" /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/source/core/inc/Tools.hxx b/reportdesign/source/core/inc/Tools.hxx index 343acfbdf859..f61bd095ff2a 100644 --- a/reportdesign/source/core/inc/Tools.hxx +++ b/reportdesign/source/core/inc/Tools.hxx @@ -50,7 +50,6 @@ namespace reportdesign if ( _bOn && !_xSection.is() ) _xSection = new OSection(_xParent,_xParent->getContext(),_bPageSection); else if ( !_bOn ) - //_xSection.clear(); ::comphelper::disposeComponent(_xSection); } @@ -96,7 +95,7 @@ namespace reportdesign public: template<typename T> static void setSize(const ::com::sun::star::awt::Size& aSize,T* _pShape) { - OSL_ENSURE(aSize.Width >= 0 && aSize.Height >= 0,"Illegal with or height!"); + OSL_ENSURE(aSize.Width >= 0 && aSize.Height >= 0,"Illegal width or height!"); ::osl::MutexGuard aGuard(_pShape->m_aMutex); if ( _pShape->m_aProps.aComponent.m_xShape.is() ) @@ -118,7 +117,7 @@ namespace reportdesign if ( _pShape->m_aProps.aComponent.m_xShape.is() ) { ::com::sun::star::awt::Size aSize = _pShape->m_aProps.aComponent.m_xShape->getSize(); - OSL_ENSURE(aSize.Width >= 0 && aSize.Height >= 0,"Illegal with or height!"); + OSL_ENSURE(aSize.Width >= 0 && aSize.Height >= 0,"Illegal width or height!"); return aSize; } return ::com::sun::star::awt::Size(_pShape->m_aProps.aComponent.m_nWidth,_pShape->m_aProps.aComponent.m_nHeight); @@ -154,7 +153,6 @@ namespace reportdesign if ( _pShape->m_aProps.aComponent.m_xShape.is() ) { ::com::sun::star::awt::Point aPosition = _pShape->m_aProps.aComponent.m_xShape->getPosition(); -// OSL_ENSURE(aPosition.X >= 0 && aPosition.Y >= 0,"Illegal position!"); return aPosition; } return ::com::sun::star::awt::Point(_pShape->m_aProps.aComponent.m_nPosX,_pShape->m_aProps.aComponent.m_nPosY); diff --git a/reportdesign/source/core/misc/conditionalexpression.cxx b/reportdesign/source/core/misc/conditionalexpression.cxx index 0804c1814487..1c2d88a546d2 100644 --- a/reportdesign/source/core/misc/conditionalexpression.cxx +++ b/reportdesign/source/core/misc/conditionalexpression.cxx @@ -67,7 +67,7 @@ namespace rptui if ( pReplace == NULL ) { - OSL_ENSURE( false, "ConditionalExpression::assembleExpression: illegal pattern!" ); + OSL_FAIL( "ConditionalExpression::assembleExpression: illegal pattern!" ); break; } @@ -104,16 +104,16 @@ namespace rptui sal_Int32 nLHSIndex( sMatchExpression.indexOf( sLHSPattern ) ); sal_Int32 nRHSIndex( sMatchExpression.indexOf( sRHSPattern ) ); - // now we should have at most one occurance of $1 and $2, resp. + // now we should have at most one occurrence of $1 and $2, resp. OSL_ENSURE( sMatchExpression.indexOf( sLHSPattern, nLHSIndex + 1 ) == -1, - "ConditionalExpression::matchExpression: unsupported pattern (more than one LHS occurance)!" ); + "ConditionalExpression::matchExpression: unsupported pattern (more than one LHS occurrence)!" ); OSL_ENSURE( sMatchExpression.indexOf( sRHSPattern, nRHSIndex + 1 ) == -1, - "ConditionalExpression::matchExpression: unsupported pattern (more than one RHS occurance)!" ); + "ConditionalExpression::matchExpression: unsupported pattern (more than one RHS occurrence)!" ); // Also, an LHS must be present, and precede the RHS (if present) OSL_ENSURE( ( nLHSIndex != -1 ) && ( ( nLHSIndex < nRHSIndex ) || ( nRHSIndex == -1 ) ), "ConditionalExpression::matchExpression: no LHS, or an RHS preceeding the LHS - this is not supported!" ); - // up to the occurance of the LHS (which must exist, see above), the two expressions + // up to the occurrence of the LHS (which must exist, see above), the two expressions // must be identical if ( _rExpression.getLength() < nLHSIndex ) return false; @@ -123,7 +123,7 @@ namespace rptui // the left-most expression parts do not match return false; - // after the occurance of the RHS (or the LHS, if there is no RHS), the two expressions + // after the occurrence of the RHS (or the LHS, if there is no RHS), the two expressions // must be identical, too bool bHaveRHS( nRHSIndex != -1 ); sal_Int32 nRightMostIndex( bHaveRHS ? nRHSIndex : nLHSIndex ); diff --git a/reportdesign/source/core/misc/conditionupdater.cxx b/reportdesign/source/core/misc/conditionupdater.cxx index 69246f36e654..ed02acdb254f 100644 --- a/reportdesign/source/core/misc/conditionupdater.cxx +++ b/reportdesign/source/core/misc/conditionupdater.cxx @@ -70,7 +70,7 @@ namespace rptui return; Reference< XReportControlModel > xRptControlModel( _rEvent.Source, UNO_QUERY ); - if ( xRptControlModel.is() && _rEvent.PropertyName.equalsAscii( "DataField" ) ) + if ( xRptControlModel.is() && _rEvent.PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DataField" ) ) ) { ::rtl::OUString sOldDataSource, sNewDataSource; OSL_VERIFY( _rEvent.OldValue >>= sOldDataSource ); diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx index cd101b0a3be0..635138902d00 100644 --- a/reportdesign/source/core/misc/reportformula.cxx +++ b/reportdesign/source/core/misc/reportformula.cxx @@ -99,7 +99,7 @@ namespace rptui } break; default: - OSL_ENSURE( false, "ReportFormula::ReportFormula: illegal bind type!" ); + OSL_FAIL( "ReportFormula::ReportFormula: illegal bind type!" ); return; } diff --git a/reportdesign/source/core/resource/core_resource.cxx b/reportdesign/source/core/resource/core_resource.cxx index 90db1ef61e91..c854a9987742 100644 --- a/reportdesign/source/core/resource/core_resource.cxx +++ b/reportdesign/source/core/resource/core_resource.cxx @@ -66,8 +66,7 @@ namespace reportdesign ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale(); - rtl::OString sResLibName = rtl::OString( "rpt" ); - m_pImpl = SimpleResMgr::Create(sResLibName, aLocale); + m_pImpl = SimpleResMgr::Create("rpt", aLocale); } } diff --git a/reportdesign/source/core/resource/strings.src b/reportdesign/source/core/resource/strings.src index d6191e2f381e..bdc63648633a 100644 --- a/reportdesign/source/core/resource/strings.src +++ b/reportdesign/source/core/resource/strings.src @@ -31,26 +31,32 @@ String RID_STR_DETAIL { Text [ en-US ] = "Detail"; }; + String RID_STR_PAGE_HEADER { Text [ en-US ] = "Page Header"; }; + String RID_STR_PAGE_FOOTER { Text [ en-US ] = "Page Footer"; }; + String RID_STR_GROUP_HEADER { Text [ en-US ] = "Group Header"; }; + String RID_STR_GROUP_FOOTER { Text [ en-US ] = "Group Footer"; }; + String RID_STR_REPORT_HEADER { Text [ en-US ] = "Report Header"; }; + String RID_STR_REPORT_FOOTER { Text [ en-US ] = "Report Footer"; @@ -65,30 +71,37 @@ String RID_STR_ERROR_WRONG_ARGUMENT { Text [ en-US ] = "You tried to set an illegal argument. Please have a look at '#1' for valid arguments."; }; + String RID_STR_ARGUMENT_IS_NULL { Text [ en-US ] = "The element is invalid."; }; + String RID_STR_FIXEDTEXT { Text [ en-US ] = "Label field" ; }; + String RID_STR_FORMATTEDFIELD { Text [ en-US ] = "Formatted field"; }; + String RID_STR_IMAGECONTROL { Text [ en-US ] = "Image control" ; }; + String RID_STR_REPORT { Text [ en-US ] = "Report"; }; + String RID_STR_SHAPE { Text [ en-US ] = "Shape"; }; + String RID_STR_FIXEDLINE { Text [ en-US ] = "Fixed line"; diff --git a/reportdesign/source/core/sdr/ModuleHelper.cxx b/reportdesign/source/core/sdr/ModuleHelper.cxx index d132304be477..9c78d9efc35d 100644 --- a/reportdesign/source/core/sdr/ModuleHelper.cxx +++ b/reportdesign/source/core/sdr/ModuleHelper.cxx @@ -90,8 +90,7 @@ ResMgr* OModuleImpl::getResManager() if (!m_pRessources) { // create a manager with a fixed prefix - rtl::OString sName = rtl::OString( "rptui" ); - m_pRessources = ResMgr::CreateResMgr(sName); + m_pRessources = ResMgr::CreateResMgr("rptui"); } return m_pRessources; } diff --git a/reportdesign/source/core/sdr/PropertyForward.cxx b/reportdesign/source/core/sdr/PropertyForward.cxx index 307b6f26c390..b645d3b3a812 100644 --- a/reportdesign/source/core/sdr/PropertyForward.cxx +++ b/reportdesign/source/core/sdr/PropertyForward.cxx @@ -33,6 +33,7 @@ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> #include "corestrings.hrc" +#include <o3tl/compat_functional.hxx> //........................................................................ namespace rptui @@ -94,7 +95,7 @@ OPropertyMediator::OPropertyMediator(const Reference< XPropertySet>& _xSource DBG_UNHANDLED_EXCEPTION(); (void)e; } - } // if ( m_xDest.is() && m_xSource.is() ) + } osl_decrementInterlockedCount(&m_refCount); } // ----------------------------------------------------------------------------- @@ -131,9 +132,9 @@ void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt aFind = ::std::find_if( m_aNameMap.begin(), m_aNameMap.end(), - ::std::compose1( + ::o3tl::compose1( ::std::bind2nd(::std::equal_to< ::rtl::OUString >(), evt.PropertyName), - ::std::compose1(::std::select1st<TPropertyConverter>(),::std::select2nd<TPropertyNamePair::value_type>()) + ::o3tl::compose1(::o3tl::select1st<TPropertyConverter>(),::o3tl::select2nd<TPropertyNamePair::value_type>()) ) ); if ( aFind != m_aNameMap.end() ) @@ -163,7 +164,7 @@ void SAL_CALL OPropertyMediator::propertyChange( const PropertyChangeEvent& evt } catch(Exception&) { - OSL_ENSURE(0,"Exception catched!"); + OSL_FAIL("Exception catched!"); } m_bInChange = sal_False; } diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx index 2aa9cca9d187..3843b894673b 100644 --- a/reportdesign/source/core/sdr/ReportDrawPage.cxx +++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx @@ -119,7 +119,7 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb /************************************************** * Das leere OLE-Objekt bekommt ein neues IPObj **************************************************/ - pObj->SetEmptyPresObj(FALSE); + pObj->SetEmptyPresObj(sal_False); pOle2Obj->SetOutlinerParaObject(NULL); pOle2Obj->SetObjRef(xObj); pOle2Obj->SetPersistName(sName); @@ -134,7 +134,6 @@ uno::Reference< drawing::XShape > OReportDrawPage::_CreateShape( SdrObject *pOb SvxOle2Shape* pShape = new SvxOle2Shape( pObj ); xShape.set(*pShape,uno::UNO_QUERY); pShape->setShapeKind(pObj->GetObjIdentifier()); - //xShape = new SvxOle2Shape( pOle2Obj ); } if ( !xShape.is() ) diff --git a/reportdesign/source/core/sdr/ReportUndoFactory.cxx b/reportdesign/source/core/sdr/ReportUndoFactory.cxx index a16963c95573..054b3dd311cc 100644 --- a/reportdesign/source/core/sdr/ReportUndoFactory.cxx +++ b/reportdesign/source/core/sdr/ReportUndoFactory.cxx @@ -34,7 +34,7 @@ namespace rptui { using namespace ::com::sun::star; // ----------------------------------------------------------------------------- -SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,USHORT _nCommentId) +SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,sal_uInt16 _nCommentId) { OObjectBase* pObj = dynamic_cast<OObjectBase*>(&rObject); if ( !pObj ) @@ -80,12 +80,12 @@ SdrUndoAction* OReportUndoFactory::CreateUndoGeoObject( SdrObject& rObject ) SdrUndoAction* OReportUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText ) { - return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? TRUE : FALSE, bSaveText ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect ) { - return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool /*bOrdNumDirect*/ ) @@ -96,7 +96,6 @@ SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, b SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool /*bOrdNumDirect*/ ) { return lcl_createUndo(rObject,rptui::Removed,RID_STR_UNDO_DELETE_CONTROL); - //return m_pUndoFactory->CreateUndoDeleteObject( rObject, bOrdNumDirect ? TRUE : FALSE ); } SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool /*bOrdNumDirect*/ ) @@ -106,7 +105,7 @@ SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool SdrUndoAction* OReportUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect ) { - return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1) @@ -116,7 +115,7 @@ SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, s SdrUndoAction* OReportUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect ) { - return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? TRUE : FALSE ); + return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? sal_True : sal_False ); } SdrUndoAction* OReportUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer ) diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx index 7b98042f9aeb..f6ab95585ee7 100644 --- a/reportdesign/source/core/sdr/RptModel.cxx +++ b/reportdesign/source/core/sdr/RptModel.cxx @@ -29,7 +29,7 @@ #include "RptModel.hxx" #include "RptPage.hxx" -#include <dbaccess/singledoccontroller.hxx> +#include <dbaccess/dbsubcomponentcontroller.hxx> #include <tools/debug.hxx> #include <unotools/pathoptions.hxx> @@ -71,13 +71,6 @@ OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition m_pUndoEnv = new OXUndoEnvironment(*this); m_pUndoEnv->acquire(); SetSdrUndoFactory(new OReportUndoFactory); - - // SvxFontNameToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONT); - //SvxFontHeightToolBoxControl::RegisterControl(SID_ATTR_CHAR_FONTHEIGHT); - //SvxFontColorToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR); - //SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR2); - //SvxFontColorExtToolBoxControl::RegisterControl(SID_ATTR_CHAR_COLOR_BACKGROUND); - //SvxColorToolBoxControl::RegisterControl(SID_BACKGROUND_COLOR); } //---------------------------------------------------------------------------- @@ -100,7 +93,7 @@ void OReportModel::detachController() SdrPage* OReportModel::AllocPage(bool /*bMasterPage*/) { DBG_CHKTHIS( rpt_OReportModel, 0); - OSL_ENSURE(0,"Who called me!"); + OSL_FAIL("Who called me!"); return NULL; } @@ -131,13 +124,9 @@ void OReportModel::SetModified(sal_Bool _bModified) m_pController->setModified(_bModified); } // ----------------------------------------------------------------------------- -SdrPage* OReportModel::RemovePage(USHORT nPgNum) +SdrPage* OReportModel::RemovePage(sal_uInt16 nPgNum) { OReportPage* pPage = dynamic_cast<OReportPage*>(SdrModel::RemovePage(nPgNum)); - //if ( pPage ) - //{ - // m_pUndoEnv->RemoveSection(pPage); - //} return pPage; } // ----------------------------------------------------------------------------- @@ -152,8 +141,8 @@ OReportPage* OReportModel::createNewPage(const uno::Reference< report::XSection OReportPage* OReportModel::getPage(const uno::Reference< report::XSection >& _xSection) { OReportPage* pPage = NULL; - USHORT nCount = GetPageCount(); - for (USHORT i = 0; i < nCount && !pPage ; ++i) + sal_uInt16 nCount = GetPageCount(); + for (sal_uInt16 i = 0; i < nCount && !pPage ; ++i) { OReportPage* pRptPage = PTR_CAST( OReportPage, GetPage(i) ); if ( pRptPage && pRptPage->getSection() == _xSection ) diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 9e7a83a5b557..4969f740c7bb 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -38,7 +38,7 @@ #include <toolkit/helper/convert.hxx> #include "RptPage.hxx" #include "corestrings.hrc" -#include <dbaccess/singledoccontroller.hxx> +#include <dbaccess/dbsubcomponentcontroller.hxx> #include "ModuleHelper.hxx" #include <RptResId.hrc> @@ -172,7 +172,7 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon pNewObj = OOle2Obj::Create( _xComponent,nType ); break; default: - OSL_ENSURE(0,"Unknown object id"); + OSL_FAIL("Unknown object id"); break; } @@ -205,9 +205,9 @@ namespace nTextAlign = style::ParagraphAdjust_RIGHT; break; default: - OSL_ENSURE(0,"Illegal text alignment value!"); + OSL_FAIL("Illegal text alignment value!"); break; - } // switch(nTextAlign) + } aRet <<= (style::ParagraphAdjust)nTextAlign; } else @@ -228,9 +228,9 @@ namespace nTextAlign = awt::TextAlign::RIGHT; break; default: - OSL_ENSURE(0,"Illegal text alignment value!"); + OSL_FAIL("Illegal text alignment value!"); break; - } // switch(eParagraphAdjust) + } aRet <<= nTextAlign; } return aRet; @@ -251,7 +251,6 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBACKGROUND,TPropertyConverter(PROPERTY_BACKGROUNDCOLOR,aNoConverter))); s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter))); s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter))); - //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,PROPERTY_ALIGN)); } return s_aNameMap; } @@ -292,7 +291,6 @@ const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId) s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLTEXTEMPHASISMARK,TPropertyConverter(PROPERTY_FONTEMPHASISMARK,aNoConverter))); s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter))); s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_CONTROLBORDERCOLOR,TPropertyConverter(PROPERTY_BORDERCOLOR,aNoConverter))); - //s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter))); ::boost::shared_ptr<AnyConverter> aParaAdjust(new ParaAdjust()); s_aNameMap.insert(TPropertyNamePair::value_type(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust))); } @@ -398,7 +396,7 @@ void OObjectBase::EndListening(sal_Bool /*bRemoveListener*/) } catch(uno::Exception) { - OSL_ENSURE(0,"OObjectBase::EndListening: Exception caught!"); + OSL_FAIL("OObjectBase::EndListening: Exception caught!"); } } m_xPropertyChangeListener.clear(); @@ -510,12 +508,12 @@ OCustomShape::~OCustomShape() DBG_DTOR( rpt_OCustomShape, NULL); } // ----------------------------------------------------------------------------- -UINT16 OCustomShape::GetObjIdentifier() const +sal_uInt16 OCustomShape::GetObjIdentifier() const { - return UINT16(OBJ_CUSTOMSHAPE); + return sal_uInt16(OBJ_CUSTOMSHAPE); } //---------------------------------------------------------------------------- -UINT32 OCustomShape::GetObjInventor() const +sal_uInt32 OCustomShape::GetObjInventor() const { return ReportInventor; } @@ -534,7 +532,7 @@ sal_Int32 OCustomShape::GetStep() const { // get step property sal_Int32 nStep = 0; - OSL_ENSURE(0,"Who called me!"); + OSL_FAIL("Who called me!"); return nStep; } //---------------------------------------------------------------------------- @@ -693,12 +691,12 @@ void OUnoObject::impl_setReportComponent_nothrow() impl_initializeModel_nothrow(); } // ----------------------------------------------------------------------------- -UINT16 OUnoObject::GetObjIdentifier() const +sal_uInt16 OUnoObject::GetObjIdentifier() const { - return UINT16(m_nObjectType); + return sal_uInt16(m_nObjectType); } //---------------------------------------------------------------------------- -UINT32 OUnoObject::GetObjInventor() const +sal_uInt32 OUnoObject::GetObjInventor() const { return ReportInventor; } @@ -720,7 +718,7 @@ sal_Int32 OUnoObject::GetStep() const DBG_CHKTHIS( rpt_OUnoObject,NULL); // get step property sal_Int32 nStep = 0; - OSL_ENSURE(0,"Who called me!"); + OSL_FAIL("Who called me!"); return nStep; } @@ -749,11 +747,6 @@ void OUnoObject::NbcMove( const Size& rSize ) // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point? int nNewX = m_xReportComponent->getPositionX() + rSize.A(); - // can this hinder us to set components outside the area? - // if (nNewX < 0) - // { - // nNewX = 0; - // } m_xReportComponent->setPositionX(nNewX); int nNewY = m_xReportComponent->getPositionY() + rSize.B(); if (nNewY < 0 && !bUndoMode) @@ -766,14 +759,7 @@ void OUnoObject::NbcMove( const Size& rSize ) } if (bPositionFixed) { - // OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); - // if ( pRptModel ) - // { - // if (! pRptModel->GetUndoEnv().IsLocked()) - // { - GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); - // } - // } + GetModel()->AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize)); } // set geometry properties SetPropsFromRect(GetLogicRect()); @@ -956,16 +942,16 @@ uno::Reference< uno::XInterface > OUnoObject::getUnoShape() return OObjectBase::getUnoShapeOf( *this ); } // ----------------------------------------------------------------------------- -SdrObject* OUnoObject::Clone() const +OUnoObject* OUnoObject::Clone() const { - SdrObject* pClone = SdrUnoObj::Clone(); + OUnoObject* pClone = CloneHelper< OUnoObject >(); if ( pClone ) { Reference<XPropertySet> xSource(const_cast<OUnoObject*>(this)->getUnoShape(),uno::UNO_QUERY); Reference<XPropertySet> xDest(pClone->getUnoShape(),uno::UNO_QUERY); if ( xSource.is() && xDest.is() ) comphelper::copyProperties(xSource.get(),xDest.get()); - } // if ( pClone ) + } return pClone; } //---------------------------------------------------------------------------- @@ -973,7 +959,7 @@ SdrObject* OUnoObject::Clone() const //---------------------------------------------------------------------------- TYPEINIT1(OOle2Obj, SdrOle2Obj); DBG_NAME( rpt_OOle2Obj ); -OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,UINT16 _nType) +OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,sal_uInt16 _nType) :SdrOle2Obj() ,OObjectBase(_xComponent) ,m_nType(_nType) @@ -985,7 +971,7 @@ OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent, m_bIsListening = sal_True; } //---------------------------------------------------------------------------- -OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,UINT16 _nType) +OOle2Obj::OOle2Obj(const ::rtl::OUString& _sComponentName,sal_uInt16 _nType) :SdrOle2Obj() ,OObjectBase(_sComponentName) ,m_nType(_nType) @@ -1000,12 +986,12 @@ OOle2Obj::~OOle2Obj() DBG_DTOR( rpt_OOle2Obj, NULL); } // ----------------------------------------------------------------------------- -UINT16 OOle2Obj::GetObjIdentifier() const +sal_uInt16 OOle2Obj::GetObjIdentifier() const { return m_nType; } //---------------------------------------------------------------------------- -UINT32 OOle2Obj::GetObjInventor() const +sal_uInt32 OOle2Obj::GetObjInventor() const { return ReportInventor; } @@ -1027,7 +1013,7 @@ sal_Int32 OOle2Obj::GetStep() const DBG_CHKTHIS( rpt_OOle2Obj,NULL); // get step property sal_Int32 nStep = 0; - OSL_ENSURE(0,"Who called me!"); + OSL_FAIL("Who called me!"); return nStep; } @@ -1139,14 +1125,14 @@ uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const { xSource.set(xChartDoc->getDataProvider(),uno::UNO_QUERY); } - } // if( xCompSupp.is()) + } return xSource; } // ----------------------------------------------------------------------------- // Clone() soll eine komplette Kopie des Objektes erzeugen. -SdrObject* OOle2Obj::Clone() const +OOle2Obj* OOle2Obj::Clone() const { - OOle2Obj* pObj = static_cast<OOle2Obj*>(SdrOle2Obj::Clone()); + OOle2Obj* pObj = CloneHelper< OOle2Obj >(); OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); svt::EmbeddedObjectRef::TryRunningState( pObj->GetObjRef() ); pObj->impl_createDataProvider_nothrow(pRptModel->getReportDefinition().get()); @@ -1175,7 +1161,7 @@ void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XMod uno::Reference< lang::XMultiServiceFactory> xFac(_xModel,uno::UNO_QUERY); uno::Reference< chart2::data::XDatabaseDataProvider > xDataProvider( xFac->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.data.DataProvider"))),uno::UNO_QUERY); xReceiver->attachDataProvider( xDataProvider.get() ); - } // if( xReceiver.is() ) + } } catch(uno::Exception) { diff --git a/reportdesign/source/core/sdr/RptObjectListener.cxx b/reportdesign/source/core/sdr/RptObjectListener.cxx index 01ba228ffb96..693e76028faf 100644 --- a/reportdesign/source/core/sdr/RptObjectListener.cxx +++ b/reportdesign/source/core/sdr/RptObjectListener.cxx @@ -56,13 +56,6 @@ OObjectListener::~OObjectListener() void SAL_CALL OObjectListener::disposing( const ::com::sun::star::lang::EventObject& ) throw( ::com::sun::star::uno::RuntimeException) { - /* - // disconnect the listener - if (m_pObject) - { - (m_pObject->m_xPropertyChangeListener).clear(); - } - */ } // XPropertyChangeListener diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index fe9ae18cdb52..2ebbd53a2603 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -79,11 +79,11 @@ SdrPage* OReportPage::Clone() const } //---------------------------------------------------------------------------- -ULONG OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& _xObject) +sal_uLong OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& _xObject) { DBG_CHKTHIS( rpt_OReportPage,NULL); - ULONG nCount = GetObjCount(); - ULONG i = 0; + sal_uLong nCount = GetObjCount(); + sal_uLong i = 0; for (; i < nCount; ++i) { OObjectBase* pObj = dynamic_cast<OObjectBase*>(GetObj(i)); @@ -92,25 +92,25 @@ ULONG OReportPage::getIndexOf(const uno::Reference< report::XReportComponent >& { break; } - } // for (; i < nCount; ++i) + } return i; } //---------------------------------------------------------------------------- void OReportPage::removeSdrObject(const uno::Reference< report::XReportComponent >& _xObject) { DBG_CHKTHIS( rpt_OReportPage,NULL); - ULONG nPos = getIndexOf(_xObject); + sal_uLong nPos = getIndexOf(_xObject); if ( nPos < GetObjCount() ) { OObjectBase* pBase = dynamic_cast<OObjectBase*>(GetObj(nPos)); OSL_ENSURE(pBase,"Why is this not a OObjectBase?"); if ( pBase ) pBase->EndListening(); - /*delete */RemoveObject(nPos); + RemoveObject(nPos); } } // ----------------------------------------------------------------------------- -SdrObject* OReportPage::RemoveObject(ULONG nObjNum) +SdrObject* OReportPage::RemoveObject(sal_uLong nObjNum) { SdrObject* pObj = SdrPage::RemoveObject(nObjNum); if (getSpecialMode()) @@ -132,28 +132,13 @@ SdrObject* OReportPage::RemoveObject(ULONG nObjNum) return pObj; } //---------------------------------------------------------------------------- -//namespace -//{ -// ::rtl::OUString lcl_getControlName(const uno::Reference< lang::XServiceInfo >& _xServiceInfo) -// { -// if ( _xServiceInfo->supportsService( SERVICE_FIXEDTEXT )) -// return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText")); -// if ( _xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD )) -// return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FormattedField")); -// if ( _xServiceInfo->supportsService( SERVICE_IMAGECONTROL)) -// return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.DatabaseImageControl")); -// -// return ::rtl::OUString(); -// } -//} -//---------------------------------------------------------------------------- void OReportPage::insertObject(const uno::Reference< report::XReportComponent >& _xObject) { DBG_CHKTHIS( rpt_OReportPage,NULL); OSL_ENSURE(_xObject.is(),"Object is not valid to create a SdrObject!"); - if ( !_xObject.is() ) // || !m_pView ) + if ( !_xObject.is() ) return; - ULONG nPos = getIndexOf(_xObject); + sal_uLong nPos = getIndexOf(_xObject); if ( nPos < GetObjCount() ) return; // Object already in list @@ -178,7 +163,7 @@ void OReportPage::removeTempObject(SdrObject *_pToRemoveObj) { if (_pToRemoveObj) { - for (ULONG i=0;i<GetObjCount();i++) + for (sal_uLong i=0;i<GetObjCount();i++) { SdrObject *aObj = GetObj(i); if (aObj && aObj == _pToRemoveObj) @@ -186,7 +171,6 @@ void OReportPage::removeTempObject(SdrObject *_pToRemoveObj) SdrObject* pObject = RemoveObject(i); (void)pObject; break; - // delete pObject; } } } @@ -208,7 +192,7 @@ void OReportPage::resetSpecialMode() m_bSpecialInsertMode = false; } // ----------------------------------------------------------------------------- -void OReportPage::NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason) +void OReportPage::NbcInsertObject(SdrObject* pObj, sal_uLong nPos, const SdrInsertReason* pReason) { SdrPage::NbcInsertObject(pObj, nPos, pReason); @@ -232,14 +216,6 @@ void OReportPage::NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertRe uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY); pSection->notifyElementAdded(xShape); - //// check if we are a shape - //uno::Reference<beans::XPropertySet> xProp(xShape,uno::UNO_QUERY); - //if ( xProp.is() && xProp->getPropertySetInfo()->hasPropertyByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID"))) ) - //{ - // // use MimeConfigurationHelper::GetStringClassIDRepresentation(MimeConfigurationHelper::GetSequenceClassID(SO3_SCH_OLE_EMBED_CLASSID_8)) - // xProp->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CLSID")),uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("12dcae26-281f-416f-a234-c3086127382e")))); - //} - // now that the shape is inserted into its structures, we can allow the OObjectBase // to release the reference to it OObjectBase* pObjectBase = dynamic_cast< OObjectBase* >( pObj ); diff --git a/reportdesign/source/core/sdr/UndoActions.cxx b/reportdesign/source/core/sdr/UndoActions.cxx index 737e43af74be..9c7895d6d708 100644 --- a/reportdesign/source/core/sdr/UndoActions.cxx +++ b/reportdesign/source/core/sdr/UndoActions.cxx @@ -53,7 +53,7 @@ #include <tools/diagnose_ex.h> #include <comphelper/stl_types.hxx> #include <vcl/svapp.hxx> -#include <dbaccess/singledoccontroller.hxx> +#include <dbaccess/dbsubcomponentcontroller.hxx> #include <svx/unoshape.hxx> #include <osl/mutex.hxx> @@ -97,7 +97,7 @@ namespace rptui TYPEINIT1( OCommentUndoAction, SdrUndoAction ); DBG_NAME(rpt_OCommentUndoAction) //---------------------------------------------------------------------------- -OCommentUndoAction::OCommentUndoAction(SdrModel& _rMod,USHORT nCommentID) +OCommentUndoAction::OCommentUndoAction(SdrModel& _rMod,sal_uInt16 nCommentID) :SdrUndoAction(_rMod) { DBG_CTOR(rpt_OCommentUndoAction,NULL); @@ -123,7 +123,7 @@ OUndoContainerAction::OUndoContainerAction(SdrModel& _rMod ,Action _eAction ,const uno::Reference< container::XIndexContainer > _xContainer ,const Reference< XInterface > & xElem - ,USHORT _nCommentId) + ,sal_uInt16 _nCommentId) :OCommentUndoAction(_rMod,_nCommentId) ,m_xElement(xElem) ,m_xContainer(_xContainer) @@ -224,13 +224,13 @@ void OUndoContainerAction::Undo() implReInsert(); break; default: - OSL_ENSURE(0,"Illegal case value"); + OSL_FAIL("Illegal case value"); break; } } catch( const Exception& ) { - OSL_ENSURE( sal_False, "OUndoContainerAction::Undo: caught an exception!" ); + OSL_FAIL( "OUndoContainerAction::Undo: caught an exception!" ); } } } @@ -252,13 +252,13 @@ void OUndoContainerAction::Redo() implReRemove(); break; default: - OSL_ENSURE(0,"Illegal case value"); + OSL_FAIL("Illegal case value"); break; } } catch( const Exception& ) { - OSL_ENSURE( sal_False, "OUndoContainerAction::Redo: caught an exception!" ); + OSL_FAIL( "OUndoContainerAction::Redo: caught an exception!" ); } } } @@ -269,7 +269,7 @@ OUndoGroupSectionAction::OUndoGroupSectionAction(SdrModel& _rMod ,OGroupHelper> _pMemberFunction ,const uno::Reference< report::XGroup >& _xGroup ,const Reference< XInterface > & xElem - ,USHORT _nCommentId) + ,sal_uInt16 _nCommentId) :OUndoContainerAction(_rMod,_eAction,NULL,xElem,_nCommentId) ,m_aGroupHelper(_xGroup) ,m_pMemberFunction(_pMemberFunction) @@ -315,7 +315,7 @@ OUndoReportSectionAction::OUndoReportSectionAction(SdrModel& _rMod ,OReportHelper> _pMemberFunction ,const uno::Reference< report::XReportDefinition >& _xReport ,const Reference< XInterface > & xElem - ,USHORT _nCommentId) + ,sal_uInt16 _nCommentId) :OUndoContainerAction(_rMod,_eAction,NULL,xElem,_nCommentId) ,m_aReportHelper(_xReport) ,m_pMemberFunction(_pMemberFunction) @@ -397,7 +397,7 @@ void ORptUndoPropertyAction::setProperty(sal_Bool _bOld) } catch( const Exception& ) { - OSL_ENSURE( sal_False, "ORptUndoPropertyAction::Redo: caught an exception!" ); + OSL_FAIL( "ORptUndoPropertyAction::Redo: caught an exception!" ); } } } diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx index 780113958495..b21a3c91278d 100644 --- a/reportdesign/source/core/sdr/UndoEnv.cxx +++ b/reportdesign/source/core/sdr/UndoEnv.cxx @@ -45,14 +45,17 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/util/XModifyBroadcaster.hpp> +#include <com/sun/star/beans/XIntrospectionAccess.hpp> +#include <com/sun/star/beans/XIntrospection.hpp> /** === end UNO includes === **/ #include <connectivity/dbtools.hxx> #include <svl/smplhint.hxx> #include <tools/diagnose_ex.h> #include <comphelper/stl_types.hxx> +#include <comphelper/componentcontext.hxx> #include <vcl/svapp.hxx> -#include <dbaccess/singledoccontroller.hxx> +#include <dbaccess/dbsubcomponentcontroller.hxx> #include <svx/unoshape.hxx> #include <osl/mutex.hxx> @@ -70,8 +73,36 @@ namespace rptui //---------------------------------------------------------------------------- -DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties); -DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache); +struct PropertyInfo +{ + bool bIsReadonlyOrTransient; + + PropertyInfo() + :bIsReadonlyOrTransient( false ) + { + } + + PropertyInfo( const bool i_bIsTransientOrReadOnly ) + :bIsReadonlyOrTransient( i_bIsTransientOrReadOnly ) + { + } +}; + +typedef ::boost::unordered_map< ::rtl::OUString, PropertyInfo, ::rtl::OUStringHash > PropertiesInfo; + +struct ObjectInfo +{ + PropertiesInfo aProperties; + Reference< XPropertySet > xPropertyIntrospection; + + ObjectInfo() + :aProperties() + ,xPropertyIntrospection() + { + } +}; + +typedef ::std::map< Reference< XPropertySet >, ObjectInfo, ::comphelper::OInterfaceCompare< XPropertySet > > PropertySetInfoCache; // ----------------------------------------------------------------------------- @@ -86,6 +117,7 @@ public: ConditionUpdater m_aConditionUpdater; ::osl::Mutex m_aMutex; ::std::vector< uno::Reference< container::XChild> > m_aSections; + Reference< XIntrospection > m_xIntrospection; oslInterlockedCount m_nLocks; sal_Bool m_bReadOnly; sal_Bool m_bIsUndo; @@ -155,7 +187,7 @@ void OXUndoEnvironment::Clear(const Accessor& /*_r*/) { uno::Reference<beans::XPropertySet> xProp(aIter->first,uno::UNO_QUERY); xProp->getPropertySetInfo(); - int nlen = aIter->second.size(); + int nlen = aIter->second.aProperties.size(); nlen = nlen; } #endif @@ -213,8 +245,6 @@ void SAL_CALL OXUndoEnvironment::disposing(const EventObject& e) throw( RuntimeE RemoveSection(xSection); else RemoveElement(xSourceSet); - /*if (!m_pImpl->m_aPropertySetCache.empty()) - m_pImpl->m_aPropertySetCache.erase(xSourceSet);*/ } } @@ -232,7 +262,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv if (!xSet.is()) return; - dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController(); + dbaui::DBSubComponentController* pController = m_pImpl->m_rModel.getController(); if ( !pController ) return; @@ -242,29 +272,73 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv int nlen = m_pImpl->m_aPropertySetCache.size(); nlen = nlen; #endif - PropertySetInfoCache::iterator aSetPos = m_pImpl->m_aPropertySetCache.find(xSet); - if (aSetPos == m_pImpl->m_aPropertySetCache.end()) + PropertySetInfoCache::iterator objectPos = m_pImpl->m_aPropertySetCache.find(xSet); + if (objectPos == m_pImpl->m_aPropertySetCache.end()) { - AllProperties aNewEntry; - aSetPos = m_pImpl->m_aPropertySetCache.insert(PropertySetInfoCache::value_type(xSet,aNewEntry)).first; - DBG_ASSERT(aSetPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); + objectPos = m_pImpl->m_aPropertySetCache.insert( PropertySetInfoCache::value_type( + xSet, ObjectInfo() + ) ).first; + DBG_ASSERT(objectPos != m_pImpl->m_aPropertySetCache.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); } - if ( aSetPos == m_pImpl->m_aPropertySetCache.end() ) + if ( objectPos == m_pImpl->m_aPropertySetCache.end() ) return; // now we have access to the cached info about the set // let's see what we know about the property - AllProperties& rPropInfos = aSetPos->second; - AllPropertiesIterator aPropertyPos = rPropInfos.find( _rEvent.PropertyName ); - if (aPropertyPos == rPropInfos.end()) + ObjectInfo& rObjectInfo = objectPos->second; + PropertiesInfo::iterator aPropertyPos = rObjectInfo.aProperties.find( _rEvent.PropertyName ); + if ( aPropertyPos == rObjectInfo.aProperties.end() ) { // nothing 'til now ... have to change this .... // the attributes - INT32 nAttributes = xSet->getPropertySetInfo()->getPropertyByName( _rEvent.PropertyName ).Attributes; - bool bTransReadOnly = ((nAttributes & PropertyAttribute::READONLY) != 0) || ((nAttributes & PropertyAttribute::TRANSIENT) != 0); + Reference< XPropertySetInfo > xPSI( xSet->getPropertySetInfo(), UNO_SET_THROW ); + sal_Int32 nPropertyAttributes = 0; + try + { + if ( xPSI->hasPropertyByName( _rEvent.PropertyName ) ) + { + nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes; + } + else + { + // it's perfectly valid for a component to notify a change in a property which it doesn't have - as long + // as it has an attribute with this name + if ( !rObjectInfo.xPropertyIntrospection.is() ) + { + if ( !m_pImpl->m_xIntrospection.is() ) + { + ::comphelper::ComponentContext aContext( m_pImpl->m_rModel.getController()->getORB() ); + OSL_VERIFY( aContext.createComponent( "com.sun.star.beans.Introspection", m_pImpl->m_xIntrospection ) ); + } + if ( m_pImpl->m_xIntrospection.is() ) + { + Reference< XIntrospectionAccess > xIntrospection( + m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ), + UNO_SET_THROW + ); + rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW ); + } + } + if ( rObjectInfo.xPropertyIntrospection.is() ) + { + xPSI.set( rObjectInfo.xPropertyIntrospection->getPropertySetInfo(), UNO_SET_THROW ); + nPropertyAttributes = xPSI->getPropertyByName( _rEvent.PropertyName ).Attributes; + } + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + const bool bTransReadOnly = + ( ( nPropertyAttributes & PropertyAttribute::READONLY ) != 0 ) + || ( ( nPropertyAttributes & PropertyAttribute::TRANSIENT ) != 0 ); // insert the new entry - aPropertyPos = rPropInfos.insert( AllProperties::value_type( _rEvent.PropertyName, bTransReadOnly ) ).first; - DBG_ASSERT(aPropertyPos != rPropInfos.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); + aPropertyPos = rObjectInfo.aProperties.insert( PropertiesInfo::value_type( + _rEvent.PropertyName, + PropertyInfo( bTransReadOnly ) + ) ).first; + DBG_ASSERT(aPropertyPos != rObjectInfo.aProperties.end(), "OXUndoEnvironment::propertyChange : just inserted it ... why it's not there ?"); } implSetModified(); @@ -273,7 +347,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv // and are able to decide wether or not we need an undo action // no UNDO for transient/readonly properties - if ( aPropertyPos->second ) + if ( aPropertyPos->second.bIsReadonlyOrTransient ) return; // give components with sub responsibilities a chance @@ -306,7 +380,7 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv if ( pUndo == NULL ) pUndo = new ORptUndoPropertyAction( m_pImpl->m_rModel, _rEvent ); - pController->addUndoActionAndInvalidate(pUndo); + m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( pUndo ); pController->InvalidateAll(); } // ----------------------------------------------------------------------------- @@ -365,12 +439,9 @@ void SAL_CALL OXUndoEnvironment::elementInserted(const ContainerEvent& evt) thro uno::Reference< report::XFunctions> xContainer(evt.Source,uno::UNO_QUERY); if ( xContainer.is() ) { - dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController(); - pController->addUndoActionAndInvalidate(new OUndoContainerAction(m_pImpl->m_rModel - ,rptui::Inserted - ,xContainer.get() - ,xIface - ,RID_STR_UNDO_ADDFUNCTION)); + m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( + new OUndoContainerAction( m_pImpl->m_rModel, rptui::Inserted, xContainer.get(), + xIface, RID_STR_UNDO_ADDFUNCTION ) ); } } } @@ -383,7 +454,6 @@ void SAL_CALL OXUndoEnvironment::elementInserted(const ContainerEvent& evt) thro //------------------------------------------------------------------------------ void OXUndoEnvironment::implSetModified() { - //if ( !IsLocked() ) m_pImpl->m_rModel.SetModified( sal_True ); } @@ -436,12 +506,8 @@ void SAL_CALL OXUndoEnvironment::elementRemoved(const ContainerEvent& evt) throw uno::Reference< report::XFunctions> xFunctions(evt.Source,uno::UNO_QUERY); if ( xFunctions.is() ) { - dbaui::OSingleDocumentController* pController = m_pImpl->m_rModel.getController(); - pController->addUndoActionAndInvalidate(new OUndoContainerAction(m_pImpl->m_rModel - ,rptui::Removed - ,xFunctions.get() - ,xIface - ,RID_STR_UNDO_ADDFUNCTION)); + m_pImpl->m_rModel.GetSdrUndoManager()->AddUndoAction( new OUndoContainerAction( + m_pImpl->m_rModel, rptui::Removed, xFunctions.get(), xIface, RID_STR_UNDO_ADDFUNCTION ) ); } } } @@ -541,7 +607,6 @@ void OXUndoEnvironment::switchListening( const Reference< XIndexAccess >& _rxCon // be notified of any changes in the container elements Reference< XContainer > xSimpleContainer( _rxContainer, UNO_QUERY ); - // OSL_ENSURE( xSimpleContainer.is(), "OXUndoEnvironment::switchListening: how are we expected to be notified of changes in the container?" ); if ( xSimpleContainer.is() ) { if ( _bStartListening ) @@ -586,7 +651,6 @@ void OXUndoEnvironment::switchListening( const Reference< XInterface >& _rxObjec } catch( const Exception& ) { - //OSL_ENSURE( sal_False, "OXUndoEnvironment::switchListening: caught an exception!" ); } } diff --git a/reportdesign/source/core/sdr/formatnormalizer.cxx b/reportdesign/source/core/sdr/formatnormalizer.cxx index 3620f29bf554..9dd4730c81ff 100644 --- a/reportdesign/source/core/sdr/formatnormalizer.cxx +++ b/reportdesign/source/core/sdr/formatnormalizer.cxx @@ -36,7 +36,7 @@ #include <com/sun/star/util/XNumberFormatTypes.hpp> /** === end UNO includes === **/ -#include <dbaccess/singledoccontroller.hxx> +#include <dbaccess/dbsubcomponentcontroller.hxx> #include <unotools/syslocale.hxx> #include <connectivity/statementcomposer.hxx> #include <connectivity/dbtools.hxx> @@ -127,9 +127,9 @@ namespace rptui //-------------------------------------------------------------------- void FormatNormalizer::impl_onDefinitionPropertyChange( const ::rtl::OUString& _rChangedPropName ) { - if ( !_rChangedPropName.equalsAscii( "Command" ) - && !_rChangedPropName.equalsAscii( "CommandType" ) - && !_rChangedPropName.equalsAscii( "EscapeProcessing" ) + if ( !_rChangedPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Command" ) ) + && !_rChangedPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "CommandType" ) ) + && !_rChangedPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EscapeProcessing" ) ) ) // nothing we're interested in return; @@ -139,7 +139,7 @@ namespace rptui //-------------------------------------------------------------------- void FormatNormalizer::impl_onFormattedProperttyChange( const Reference< XFormattedField >& _rxFormatted, const ::rtl::OUString& _rChangedPropName ) { - if ( !_rChangedPropName.equalsAscii( "DataField" ) ) + if ( !_rChangedPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DataField" ) ) ) // nothing we're interested in return; @@ -187,7 +187,7 @@ namespace rptui if ( !m_xReportDefinition.is() ) return false; - ::dbaui::OSingleDocumentController* pController( m_rModel.getController() ); + ::dbaui::DBSubComponentController* pController( m_rModel.getController() ); OSL_ENSURE( pController, "FormatNormalizer::impl_ensureUpToDateFieldList_nothrow: no controller? how can *this* happen?!" ); if ( !pController ) return false; @@ -247,7 +247,7 @@ namespace rptui if ( sDataField.getStr()[ sDataField.getLength() - 1 ] != ']' ) { // last character is not the closing brace - OSL_ENSURE( false, "FormatNormalizer::impl_adjustFormatToDataFieldType_nothrow: suspicious data field value!" ); + OSL_FAIL( "FormatNormalizer::impl_adjustFormatToDataFieldType_nothrow: suspicious data field value!" ); return; } sDataField = sDataField.copy( sFieldPrefix.getLength(), sDataField.getLength() - sFieldPrefix.getLength() - 1 ); diff --git a/reportdesign/source/filter/xml/dbloader2.cxx b/reportdesign/source/filter/xml/dbloader2.cxx index fae4e234bdb3..2c66523bb15a 100644 --- a/reportdesign/source/filter/xml/dbloader2.cxx +++ b/reportdesign/source/filter/xml/dbloader2.cxx @@ -74,10 +74,10 @@ ORptTypeDetection::ORptTypeDetection(Reference< XComponentContext > const & xCon { ::rtl::OUString sMediaType; xProp->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= sMediaType; - if ( sMediaType.equalsAscii(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII) ) + if ( sMediaType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII)) ) return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("StarBaseReport")); ::comphelper::disposeComponent(xProp); - } // if ( xProp.is() ) + } } catch(Exception&) { @@ -116,7 +116,7 @@ Sequence< ::rtl::OUString > SAL_CALL ORptTypeDetection::getSupportedServiceNames Sequence< ::rtl::OUString > ORptTypeDetection::getSupportedServiceNames_Static(void) throw( RuntimeException ) { Sequence< ::rtl::OUString > aSNS( 1 ); - aSNS.getArray()[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExtendedTypeDetection"); + aSNS.getArray()[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExtendedTypeDetection")); return aSNS; } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/dbloader2.hxx b/reportdesign/source/filter/xml/dbloader2.hxx index 442017d9a940..b58309ecda91 100644 --- a/reportdesign/source/filter/xml/dbloader2.hxx +++ b/reportdesign/source/filter/xml/dbloader2.hxx @@ -91,7 +91,7 @@ public: // static methods static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException ) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.ORptTypeDetection"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.ORptTypeDetection")); } static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException ); static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL diff --git a/reportdesign/source/filter/xml/xmlCell.cxx b/reportdesign/source/filter/xml/xmlCell.cxx index f47f360c4687..868a73002315 100644 --- a/reportdesign/source/filter/xml/xmlCell.cxx +++ b/reportdesign/source/filter/xml/xmlCell.cxx @@ -245,7 +245,7 @@ void OXMLCell::EndElement() } catch(uno::Exception&) { - OSL_ENSURE(0,"OXMLCell::EndElement -> exception catched"); + OSL_FAIL("OXMLCell::EndElement -> exception catched"); } } } diff --git a/reportdesign/source/filter/xml/xmlComponent.cxx b/reportdesign/source/filter/xml/xmlComponent.cxx index dd1387db40da..aa8da4c42b62 100644 --- a/reportdesign/source/filter/xml/xmlComponent.cxx +++ b/reportdesign/source/filter/xml/xmlComponent.cxx @@ -98,7 +98,7 @@ OXMLComponent::OXMLComponent( ORptFilter& _rImport } catch(const Exception&) { - OSL_ENSURE(0,"Exception catched while putting props into report component!"); + OSL_FAIL("Exception catched while putting props into report component!"); } } } diff --git a/reportdesign/source/filter/xml/xmlComponent.hxx b/reportdesign/source/filter/xml/xmlComponent.hxx index 1daca10d9a2a..9797b8e2d632 100644 --- a/reportdesign/source/filter/xml/xmlComponent.hxx +++ b/reportdesign/source/filter/xml/xmlComponent.hxx @@ -43,7 +43,7 @@ namespace rptxml ::rtl::OUString m_sTextStyleName; OXMLComponent(const OXMLComponent&); - void operator =(const OXMLComponent&); + OXMLComponent operator =(const OXMLComponent&); public: OXMLComponent( ORptFilter& rImport diff --git a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx index 16135095268a..56eb0c4eabb9 100644 --- a/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx +++ b/reportdesign/source/filter/xml/xmlCondPrtExpr.cxx @@ -81,7 +81,7 @@ OXMLCondPrtExpr::OXMLCondPrtExpr( ORptFilter& _rImport, } catch(const Exception&) { - OSL_ENSURE(0,"Exception catched while putting Function props!"); + OSL_FAIL("Exception catched while putting Function props!"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlControlProperty.cxx b/reportdesign/source/filter/xml/xmlControlProperty.cxx index 6e717557aca8..1de438f425ea 100644 --- a/reportdesign/source/filter/xml/xmlControlProperty.cxx +++ b/reportdesign/source/filter/xml/xmlControlProperty.cxx @@ -82,7 +82,7 @@ OXMLControlProperty::OXMLControlProperty( ORptFilter& rImport switch( rTokenMap.Get( nPrefix, sLocalName ) ) { case XML_TOK_LIST_PROPERTY: - m_bIsList = sValue.equalsAscii("true"); + m_bIsList = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("true")); break; case XML_TOK_VALUE_TYPE: { @@ -165,7 +165,7 @@ void OXMLControlProperty::EndElement() } catch(const Exception&) { - OSL_ENSURE(0,"Unknown property found!"); + OSL_FAIL("Unknown property found!"); } } } @@ -237,7 +237,7 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe } case TypeClass_HYPER: { - OSL_ENSURE(sal_False, "OXMLControlProperty::convertString: 64-bit integers not implemented yet!"); + OSL_FAIL("OXMLControlProperty::convertString: 64-bit integers not implemented yet!"); } break; case TypeClass_DOUBLE: @@ -321,11 +321,11 @@ Any OXMLControlProperty::convertString(const ::com::sun::star::uno::Type& _rExpe } } else - OSL_ENSURE(sal_False, "OPropertyImport::convertString: unsupported property type!"); + OSL_FAIL("OPropertyImport::convertString: unsupported property type!"); } break; default: - OSL_ENSURE(sal_False, "OXMLControlProperty::convertString: invalid type class!"); + OSL_FAIL("OXMLControlProperty::convertString: invalid type class!"); } return aReturn; diff --git a/reportdesign/source/filter/xml/xmlExport.cxx b/reportdesign/source/filter/xml/xmlExport.cxx index a8fdacf51e9e..767fc340d1f8 100644 --- a/reportdesign/source/filter/xml/xmlExport.cxx +++ b/reportdesign/source/filter/xml/xmlExport.cxx @@ -88,13 +88,13 @@ namespace rptxml //--------------------------------------------------------------------- ::rtl::OUString ORptExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLSettingsExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.XMLSettingsExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > ORptExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } //--------------------------------------------------------------------- @@ -105,13 +105,13 @@ namespace rptxml //--------------------------------------------------------------------- ::rtl::OUString ORptContentExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLContentExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.XMLContentExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > ORptContentExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } @@ -124,13 +124,13 @@ namespace rptxml //--------------------------------------------------------------------- ::rtl::OUString ORptStylesExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLStylesExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.XMLStylesExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > ORptStylesExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } @@ -142,13 +142,13 @@ namespace rptxml //--------------------------------------------------------------------- ::rtl::OUString ORptMetaExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLMetaExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.XMLMetaExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > ORptMetaExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } @@ -160,13 +160,13 @@ namespace rptxml //--------------------------------------------------------------------- ::rtl::OUString ODBFullExportHelper::getImplementationName_Static( ) throw (RuntimeException) { - return ::rtl::OUString::createFromAscii("com.sun.star.comp.report.XMLFullExporter"); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.report.XMLFullExporter")); } //--------------------------------------------------------------------- Sequence< ::rtl::OUString > ODBFullExportHelper::getSupportedServiceNames_Static( ) throw(RuntimeException) { Sequence< ::rtl::OUString > aSupported(1); - aSupported[0] = ::rtl::OUString::createFromAscii("com.sun.star.document.ExportFilter"); + aSupported[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.ExportFilter")); return aSupported; } @@ -284,7 +284,6 @@ ORptExport::ORptExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt1 xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2); m_xTableStylesExportPropertySetMapper = new SvXMLExportPropertyMapper(xTableStylesPropertySetMapper1); - //m_xTableStylesExportPropertySetMapper->ChainExportMapper(xTableStylesPropertySetMapper2); m_xCellStylesPropertySetMapper = OXMLHelper::GetCellStylePropertyMap(); m_xCellStylesExportPropertySetMapper = new OSpecialHanldeXMLExportPropertyMapper(m_xCellStylesPropertySetMapper); @@ -298,7 +297,6 @@ ORptExport::ORptExport(const Reference< XMultiServiceFactory >& _rxMSF,sal_uInt1 UniReference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA )); m_xParaPropMapper = new OSpecialHanldeXMLExportPropertyMapper( xPropMapper); - // m_xParaPropMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this)); ::rtl::OUString sFamily( GetXMLToken(XML_PARAGRAPH) ); ::rtl::OUString aPrefix( String( 'P' ) ); @@ -405,13 +403,12 @@ void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefini { exportFunctions(_xReportDefinition->getFunctions().get()); exportGroupsExpressionAsFunction(_xReportDefinition->getGroups()); - //exportMasterDetailFields(_xReportDefinition.get()); if ( _xReportDefinition->getReportHeaderOn() ) { SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_REPORT_HEADER, sal_True, sal_True); exportSection(_xReportDefinition->getReportHeader()); - } // if ( _xReportDefinition->getReportHeaderOn() ) + } if ( _xReportDefinition->getPageHeaderOn() ) { ::rtl::OUStringBuffer sValue; @@ -422,7 +419,7 @@ void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefini SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_HEADER, sal_True, sal_True); exportSection(_xReportDefinition->getPageHeader(),true); - } // if ( _xReportDefinition->getPageHeaderOn() ) + } exportGroup(_xReportDefinition,0); @@ -435,12 +432,12 @@ void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefini AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear()); SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_FOOTER, sal_True, sal_True); exportSection(_xReportDefinition->getPageFooter(),true); - } // if ( _xReportDefinition->getPageFooterOn() ) + } if ( _xReportDefinition->getReportFooterOn() ) { SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_REPORT_FOOTER, sal_True, sal_True); exportSection(_xReportDefinition->getReportFooter()); - } // if ( _xReportDefinition->getReportFooterOn() ) + } } } // ----------------------------------------------------------------------------- @@ -472,11 +469,11 @@ void ORptExport::exportFormatConditions(const Reference<XReportControlModel>& _x exportStyleName(xCond.get(),GetAttrList(),m_sCellStyle); SvXMLElementExport aElem(*this,XML_NAMESPACE_REPORT, XML_FORMAT_CONDITION, sal_True, sal_True); - } // for (sal_Int32 i = 0; i < nCount ; ++i) + } } catch(uno::Exception&) { - OSL_ENSURE(0,"Can not access format condition!"); + OSL_FAIL("Can not access format condition!"); } } // ----------------------------------------------------------------------------- @@ -500,7 +497,7 @@ void ORptExport::exportReportElement(const Reference<XReportControlModel>& _xRep { exportFormula(XML_FORMULA,sExpr); SvXMLElementExport aPrintExpr(*this,XML_NAMESPACE_REPORT, XML_CONDITIONAL_PRINT_EXPRESSION, sal_True, sal_True); - } // if ( sExpr.getLength() ) + } // only export when parent exists uno::Reference< report::XSection> xParent(_xReportElement->getParent(),uno::UNO_QUERY); @@ -719,11 +716,11 @@ void ORptExport::exportReportComponentAutoStyles(const Reference<XSection>& _xPr { uno::Reference< report::XFormatCondition > xCond(xFormattedField->getByIndex(j),uno::UNO_QUERY); exportAutoStyle(xCond.get(),xFormattedField); - } // for (sal_Int32 j = 0; j < nCount ; ++j) + } } catch(uno::Exception&) { - OSL_ENSURE(0,"Can not access format condition!"); + OSL_FAIL("Can not access format condition!"); } } } @@ -971,7 +968,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) exportSection(xSection); } } - } // if ( aColIter->xElement.is() ) + } else if ( !bShapeHandled ) { bShapeHandled = true; @@ -989,7 +986,7 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) } } - } // for (sal_Int32 i = 0 ; i< nCount ; ++i) + } if ( nEmptyCellColSpan ) { { @@ -1037,21 +1034,6 @@ void ORptExport::exportContainer(const Reference< XSection>& _xSection) ::rtl::OUString sFormula = _sFormula; if ( _sFormula.equalsAsciiL("rpt:",4) ) sFormula = ::rtl::OUString(); - //sal_Int32 nLength = _sFormula.getLength(); - //if ( nLength ) - //{ - // sal_Int32 nPos = 0; - // if ( _sFormula.matchAsciiL("=",1) != 0 ) - // { - // nPos = 1; - // --nLength; - // } - // bool bFormula = _sFormula.indexOf('[') != -1 || _sFormula.indexOf('(') != -1; - // if ( bFormula ) - // sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:")) + _sFormula.copy(nPos,nLength); - // else - // sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("field:[")) + _sFormula.copy(nPos,nLength) + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]"));; - //} return sFormula; } // ----------------------------------------------------------------------------- @@ -1157,7 +1139,7 @@ sal_Bool ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDef AddAttribute(XML_NAMESPACE_REPORT, XML_REPEAT_SECTION,XML_TRUE ); SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_FOOTER, sal_True, sal_True); exportSection(xSection); - } // if ( xGroup->getFooterOn() ) + } } } else if ( _bExportAutoStyle ) @@ -1259,37 +1241,6 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted } else { - //sal_Int32 nTextAlignIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_SD_SHAPE_PARA_ADJUST ); - //if ( nTextAlignIndex != -1 ) - //{ - // ::std::vector< XMLPropertyState >::iterator aIter = aPropertyStates.begin(); - // ::std::vector< XMLPropertyState >::iterator aEnd = aPropertyStates.end(); - // for (; aIter != aEnd; ++aIter) - // { - // if ( aIter->mnIndex == nTextAlignIndex ) - // { - // sal_Int16 nTextAlign = 0; - // aIter->maValue >>= nTextAlign; - // switch(nTextAlign) - // { - // case awt::TextAlign::LEFT: - // nTextAlign = style::ParagraphAdjust_LEFT; - // break; - // case awt::TextAlign::CENTER: - // nTextAlign = style::ParagraphAdjust_CENTER; - // break; - // case awt::TextAlign::RIGHT: - // nTextAlign = style::ParagraphAdjust_RIGHT; - // break; - // default: - // OSL_ENSURE(0,"Illegal text alignment value!"); - // break; - // } - // aIter->maValue <<= nTextAlign; - // break; - // } - // } - //} const Reference<XFormattedField> xFormattedField(_xProp,uno::UNO_QUERY); if ( (_xParentFormattedField.is() || xFormattedField.is()) && !aPropertyStates.empty() ) { @@ -1307,7 +1258,6 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted } } - if ( !aPropertyStates.empty() ) m_aAutoStyleNames.insert( TPropertyStyleMap::value_type(_xProp,GetAutoStylePool()->Add( XML_STYLE_FAMILY_TABLE_CELL, aPropertyStates ))); } @@ -1422,12 +1372,6 @@ void ORptExport::_ExportAutoStyles() ,GetNamespaceMap() ); - - /*GetAutoStylePool()->exportXML(XML_STYLE_FAMILY_REPORT_ID - ,GetDocHandler() - ,GetMM100UnitConverter() - ,GetNamespaceMap() - );*/ exportDataStyles(); GetShapeExport()->exportAutoStyles(); } @@ -1438,7 +1382,7 @@ void ORptExport::_ExportAutoStyles() GetPageExport()->exportAutoStyles(); } // ----------------------------------------------------------------------------- -void ORptExport::_ExportStyles(BOOL bUsed) +void ORptExport::_ExportStyles(sal_Bool bUsed) { SvXMLExport::_ExportStyles(bUsed); diff --git a/reportdesign/source/filter/xml/xmlExport.hxx b/reportdesign/source/filter/xml/xmlExport.hxx index 3d71e8deac69..8e0e7299335b 100644 --- a/reportdesign/source/filter/xml/xmlExport.hxx +++ b/reportdesign/source/filter/xml/xmlExport.hxx @@ -182,7 +182,7 @@ private: virtual void SetBodyAttributes(); protected: - virtual void _ExportStyles( BOOL bUsed ); + virtual void _ExportStyles( sal_Bool bUsed ); virtual void _ExportAutoStyles(); virtual void _ExportContent(); virtual void _ExportMasterStyles(); diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx index 9abb4056108b..166ba87db540 100644 --- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx @@ -159,7 +159,7 @@ void SAL_CALL ExportDocumentHandler::endDocument() throw (uno::RuntimeException, void SAL_CALL ExportDocumentHandler::startElement(const ::rtl::OUString & _sName, const uno::Reference< xml::sax::XAttributeList > & xAttribs) throw (uno::RuntimeException, xml::sax::SAXException) { bool bExport = true; - if ( _sName.equalsAscii("office:chart") ) + if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("office:chart")) ) { SvXMLAttributeList* pList = new SvXMLAttributeList(); uno::Reference< xml::sax::XAttributeList > xNewAttribs = pList; @@ -168,7 +168,6 @@ void SAL_CALL ExportDocumentHandler::startElement(const ::rtl::OUString & _sName { { XML_TABLE, sdb::CommandType::TABLE }, { XML_QUERY, sdb::CommandType::QUERY }, - // { XML_COMMAND, CommandType::COMMAND }, // default { XML_TOKEN_INVALID, 0 } }; if ( SvXMLUnitConverter::convertEnum( sValue, static_cast<sal_uInt16>(m_xDatabaseDataProvider->getCommandType()),aXML_CommnadTypeEnumMap ) ) @@ -203,20 +202,20 @@ void SAL_CALL ExportDocumentHandler::startElement(const ::rtl::OUString & _sName m_xDelegatee->endElement(sTableCalc); bExport = false; } - else if ( _sName.equalsAscii("table:table") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table")) ) { m_xDelegatee->startElement(lcl_createAttribute(XML_NP_RPT,XML_DETAIL),NULL); lcl_exportPrettyPrinting(m_xDelegatee); } - else if ( _sName.equalsAscii("table:table-header-rows") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-header-rows")) ) { m_bCountColumnHeader = true; } - else if ( m_bCountColumnHeader && _sName.equalsAscii("table:table-cell") ) + else if ( m_bCountColumnHeader && _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-cell")) ) { ++m_nColumnCount; } - else if ( _sName.equalsAscii("table:table-rows") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-rows")) ) { m_xDelegatee->startElement(_sName,xAttribs); exportTableRows(); @@ -224,30 +223,30 @@ void SAL_CALL ExportDocumentHandler::startElement(const ::rtl::OUString & _sName m_bTableRowsStarted = true; m_bFirstRowExported = true; } - else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.equalsAscii("table:table-row") || _sName.equalsAscii("table:table-cell")) ) + else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-row")) || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-cell"))) ) bExport = false; - else if ( _sName.equalsAscii("chart:plot-area")) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart:plot-area"))) { SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs); pList->RemoveAttribute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("table:cell-range-address"))); } - else if ( _sName.equalsAscii("chart:categories")) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart:categories"))) { static ::rtl::OUString s_sCellAddress(lcl_createAttribute(XML_NP_TABLE,XML_CELL_RANGE_ADDRESS)); lcl_correctCellAddress(s_sCellAddress,xAttribs); } - else if ( _sName.equalsAscii("chart:series")) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart:series"))) { static ::rtl::OUString s_sCellAddress(lcl_createAttribute(XML_NP_CHART,XML_VALUES_CELL_RANGE_ADDRESS)); lcl_correctCellAddress(s_sCellAddress,xAttribs); } - else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName.equalsAscii("table:table-cell") ) + else if ( m_bTableRowsStarted && !m_bFirstRowExported && _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-cell")) ) { SvXMLAttributeList* pList = SvXMLAttributeList::getImplementation(xAttribs); static ::rtl::OUString s_sValue(lcl_createAttribute(XML_NP_OFFICE,XML_VALUE)); pList->RemoveAttribute(s_sValue); } - else if ( m_bTableRowsStarted && _sName.equalsAscii("text:p") ) + else if ( m_bTableRowsStarted && _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("text:p")) ) { bExport = false; } @@ -259,27 +258,27 @@ void SAL_CALL ExportDocumentHandler::endElement(const ::rtl::OUString & _sName) { bool bExport = true; ::rtl::OUString sNewName = _sName; - if ( _sName.equalsAscii("office:chart") ) + if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("office:chart")) ) { sNewName = lcl_createAttribute(XML_NP_OFFICE,XML_REPORT); } - else if ( _sName.equalsAscii("table:table") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table")) ) { m_xDelegatee->endElement(_sName); lcl_exportPrettyPrinting(m_xDelegatee); sNewName = lcl_createAttribute(XML_NP_RPT,XML_DETAIL); } - else if ( _sName.equalsAscii("table:table-header-rows") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-header-rows")) ) { m_bCountColumnHeader = false; } - else if ( _sName.equalsAscii("table:table-rows") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-rows")) ) m_bTableRowsStarted = false; - else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.equalsAscii("table:table-row") || _sName.equalsAscii("table:table-cell")) ) + else if ( m_bTableRowsStarted && m_bFirstRowExported && (_sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-row")) || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-cell"))) ) bExport = false; - else if ( m_bTableRowsStarted && _sName.equalsAscii("table:table-row") ) + else if ( m_bTableRowsStarted && _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("table:table-row")) ) m_bFirstRowExported = true; - else if ( m_bTableRowsStarted && _sName.equalsAscii("text:p") ) + else if ( m_bTableRowsStarted && _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("text:p")) ) { bExport = !m_bFirstRowExported; } @@ -415,7 +414,7 @@ void ExportDocumentHandler::exportTableRows() bRemoveString = false; pCellAtt->RemoveAttribute(sValueType); pCellAtt->AddAttribute(sValueType,s_sFloat); - } // if ( i == 0 ) + } m_xDelegatee->startElement(sP,NULL); m_xDelegatee->endElement(sP); m_xDelegatee->endElement(sCell); @@ -447,7 +446,7 @@ void ExportDocumentHandler::exportTableRows() m_xDelegatee->endElement(sFtext); m_xDelegatee->endElement(sP); m_xDelegatee->endElement(sCell); - } // for(sal_Int32 i = 0; i < nCount ; ++i) + } m_xDelegatee->endElement(sRow); } diff --git a/reportdesign/source/filter/xml/xmlFixedContent.cxx b/reportdesign/source/filter/xml/xmlFixedContent.cxx index c30c3344b9e0..faec25209fbf 100644 --- a/reportdesign/source/filter/xml/xmlFixedContent.cxx +++ b/reportdesign/source/filter/xml/xmlFixedContent.cxx @@ -52,7 +52,7 @@ class OXMLCharContent : public XMLCharContext { OXMLFixedContent* m_pFixedContent; OXMLCharContent(const OXMLCharContent&); - void operator =(const OXMLCharContent&); + OXMLCharContent operator =(const OXMLCharContent&); public: OXMLCharContent( SvXMLImport& rImport, @@ -106,7 +106,7 @@ void OXMLCharContent::InsertControlCharacter(sal_Int16 _nControl) m_pFixedContent->Characters(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\n"))); break; default: - OSL_ENSURE(0,"Not supported control character"); + OSL_FAIL("Not supported control character"); break; } } diff --git a/reportdesign/source/filter/xml/xmlFixedContent.hxx b/reportdesign/source/filter/xml/xmlFixedContent.hxx index 42e9eaeefb4f..f1b0fa85ebe7 100644 --- a/reportdesign/source/filter/xml/xmlFixedContent.hxx +++ b/reportdesign/source/filter/xml/xmlFixedContent.hxx @@ -48,8 +48,9 @@ namespace rptxml virtual SvXMLImportContext* _CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList ); + private: OXMLFixedContent(const OXMLFixedContent&); - void operator =(const OXMLFixedContent&); + OXMLFixedContent& operator =(const OXMLFixedContent&); public: OXMLFixedContent( ORptFilter& rImport, sal_uInt16 nPrfx, diff --git a/reportdesign/source/filter/xml/xmlFormatCondition.cxx b/reportdesign/source/filter/xml/xmlFormatCondition.cxx index 6d70a78ec147..71b4f05f95be 100644 --- a/reportdesign/source/filter/xml/xmlFormatCondition.cxx +++ b/reportdesign/source/filter/xml/xmlFormatCondition.cxx @@ -95,7 +95,7 @@ OXMLFormatCondition::OXMLFormatCondition( ORptFilter& rImport, } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the report definition props"); + OSL_FAIL("Exception catched while filling the report definition props"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlFormattedField.cxx b/reportdesign/source/filter/xml/xmlFormattedField.cxx index 65fdbe1ee81f..73fd83dc474d 100644 --- a/reportdesign/source/filter/xml/xmlFormattedField.cxx +++ b/reportdesign/source/filter/xml/xmlFormattedField.cxx @@ -92,7 +92,7 @@ OXMLFormattedField::OXMLFormattedField( ORptFilter& rImport, } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the report definition props"); + OSL_FAIL("Exception catched while filling the report definition props"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlFunction.cxx b/reportdesign/source/filter/xml/xmlFunction.cxx index fd0ede7b2244..998e40839bd2 100644 --- a/reportdesign/source/filter/xml/xmlFunction.cxx +++ b/reportdesign/source/filter/xml/xmlFunction.cxx @@ -101,7 +101,7 @@ OXMLFunction::OXMLFunction( ORptFilter& _rImport } catch(const Exception&) { - OSL_ENSURE(0,"Exception catched while putting Function props!"); + OSL_FAIL("Exception catched while putting Function props!"); } } } @@ -132,7 +132,7 @@ void OXMLFunction::EndElement() m_xFunction.clear(); }catch(uno::Exception&) { - OSL_ENSURE(0,"Exception catched!"); + OSL_FAIL("Exception catched!"); } } } diff --git a/reportdesign/source/filter/xml/xmlFunction.hxx b/reportdesign/source/filter/xml/xmlFunction.hxx index 2e6b33215b85..1a3f9a06d6bf 100644 --- a/reportdesign/source/filter/xml/xmlFunction.hxx +++ b/reportdesign/source/filter/xml/xmlFunction.hxx @@ -47,7 +47,7 @@ namespace rptxml ORptFilter& GetOwnImport(); OXMLFunction(const OXMLFunction&); - void operator =(const OXMLFunction&); + OXMLFunction operator =(const OXMLFunction&); public: OXMLFunction( ORptFilter& rImport diff --git a/reportdesign/source/filter/xml/xmlGroup.cxx b/reportdesign/source/filter/xml/xmlGroup.cxx index c5fad4d165cd..d2524371ae98 100644 --- a/reportdesign/source/filter/xml/xmlGroup.cxx +++ b/reportdesign/source/filter/xml/xmlGroup.cxx @@ -193,7 +193,7 @@ OXMLGroup::OXMLGroup( ORptFilter& _rImport } catch(const Exception&) { - OSL_ENSURE(0,"Exception catched while putting group props!"); + OSL_FAIL("Exception catched while putting group props!"); } } } @@ -271,7 +271,7 @@ void OXMLGroup::EndElement() m_xGroups->insertByIndex(0,uno::makeAny(m_xGroup)); }catch(uno::Exception&) { - OSL_ENSURE(0,"Exception catched!"); + OSL_FAIL("Exception catched!"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlGroup.hxx b/reportdesign/source/filter/xml/xmlGroup.hxx index 06dfedf87785..31d31fea2742 100644 --- a/reportdesign/source/filter/xml/xmlGroup.hxx +++ b/reportdesign/source/filter/xml/xmlGroup.hxx @@ -44,7 +44,7 @@ namespace rptxml ORptFilter& GetOwnImport(); OXMLGroup(const OXMLGroup&); - void operator =(const OXMLGroup&); + OXMLGroup operator =(const OXMLGroup&); public: OXMLGroup( ORptFilter& rImport diff --git a/reportdesign/source/filter/xml/xmlHelper.cxx b/reportdesign/source/filter/xml/xmlHelper.cxx index 9e4569704d9c..8446bf6bdd5f 100644 --- a/reportdesign/source/filter/xml/xmlHelper.cxx +++ b/reportdesign/source/filter/xml/xmlHelper.cxx @@ -91,7 +91,7 @@ const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 { case XML_RPT_ALGINMENT: { - static SvXMLEnumMapEntry __READONLY_DATA pXML_VerticalAlign_Enum[] = + static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] = { { XML_TOP, style::VerticalAlignment_TOP }, { XML_MIDDLE, style::VerticalAlignment_MIDDLE }, @@ -179,7 +179,6 @@ const XMLPropertyMapEntry* OXMLHelper::GetTableStyleProps() { MAP_CONST_T( PROPERTY_BACKCOLOR, FO, BACKGROUND_COLOR, XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ), MAP_CONST_T( PROPERTY_BACKTRANSPARENT,FO, BACKGROUND_COLOR, XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, 0 ), - // MAP_CONST_T( PROPERTY_KEEPTOGETHER, STYLE, MAY_BREAK_BETWEEN_ROWS, XML_TYPE_BOOL , 0 ), MAP_END() }; return aXMLTableStylesProperties; @@ -199,10 +198,7 @@ const XMLPropertyMapEntry* OXMLHelper::GetColumnStyleProps() { static const XMLPropertyMapEntry aXMLColumnStylesProperties[] = { - //MAP( "IsManualPageBreak", XML_NAMESPACE_FO, XML_BREAK_BEFORE, XML_TYPE_PROP_TABLE_COLUMN|XML_SC_TYPE_BREAKBEFORE, 0), - //MAP( "IsVisible", XML_NAMESPACE_TABLE, XML_DISPLAY, XML_TYPE_PROP_TABLE_COLUMN|XML_SC_TYPE_EQUAL|MID_FLAG_SPECIAL_ITEM, CTF_SC_ISVISIBLE ), MAP_CONST_S( "Width", STYLE, COLUMN_WIDTH, XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_MEASURE, 0 ), - // MAP( "OptimalWidth", XML_NAMESPACE_STYLE, XML_USE_OPTIMAL_COLUMN_WIDTH, XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_BOOL, 0), MAP_END() }; return aXMLColumnStylesProperties; @@ -212,7 +208,6 @@ const SvXMLEnumMapEntry* OXMLHelper::GetReportPrintOptions() { static SvXMLEnumMapEntry s_aXML_EnumMap[] = { - // { XML_ALL_PAGES, report::ReportPrintOption::ALL_PAGES }, // default { XML_NOT_WITH_REPORT_HEADER, report::ReportPrintOption::NOT_WITH_REPORT_HEADER }, { XML_NOT_WITH_REPORT_FOOTER, report::ReportPrintOption::NOT_WITH_REPORT_FOOTER }, { XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER, report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER }, @@ -225,7 +220,6 @@ const SvXMLEnumMapEntry* OXMLHelper::GetForceNewPageOptions() { static SvXMLEnumMapEntry s_aXML_EnumMap[] = { - // { XML_NONE, report::ForceNewPage::NONE }, // default { XML_BEFORE_SECTION, report::ForceNewPage::BEFORE_SECTION }, { XML_AFTER_SECTION, report::ForceNewPage::AFTER_SECTION }, { XML_BEFORE_AFTER_SECTION, report::ForceNewPage::BEFORE_AFTER_SECTION }, @@ -238,7 +232,6 @@ const SvXMLEnumMapEntry* OXMLHelper::GetKeepTogetherOptions() { static SvXMLEnumMapEntry s_aXML_EnumMap[] = { - // { XML_NO, report::KeepTogether::NO }, // default { XML_WHOLE_GROUP, report::KeepTogether::WHOLE_GROUP }, { XML_WITH_FIRST_DETAIL, report::KeepTogether::WITH_FIRST_DETAIL }, { XML_TOKEN_INVALID, 0 } @@ -252,7 +245,6 @@ const SvXMLEnumMapEntry* OXMLHelper::GetCommandTypeOptions() { { XML_TABLE, CommandType::TABLE }, { XML_QUERY, CommandType::QUERY }, - // { XML_COMMAND, CommandType::COMMAND }, // default { XML_TOKEN_INVALID, 0 } }; return s_aXML_EnumMap; @@ -300,13 +292,6 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const ::rtl::OUString& _sSty {PROPERTY_FONTKERNING, static_cast<sal_uInt16>(PROPERTY_FONTKERNING.length), PROPERTY_ID_FONTKERNING, &::getCppuType(&aFont.Kerning) ,PropertyAttribute::BOUND,0}, {PROPERTY_CHARWORDMODE, static_cast<sal_uInt16>(PROPERTY_CHARWORDMODE.length), PROPERTY_ID_FONTWORDLINEMODE, &::getCppuType(&aFont.WordLineMode) ,PropertyAttribute::BOUND,0}, {PROPERTY_FONTTYPE, static_cast<sal_uInt16>(PROPERTY_FONTTYPE.length), PROPERTY_ID_FONTTYPE, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0}, - //{PROPERTY_BACKGROUNDCOLOR, static_cast<sal_uInt16>(PROPERTY_BACKGROUNDCOLOR.length), PROPERTY_ID_BACKGROUNDCOLOR, &::getCppuType(&nBackgroundColor) ,PropertyAttribute::BOUND,0},, - //{PROPERTY_PARAADJUST, static_cast<sal_uInt16>(PROPERTY_PARAADJUST.length), PROPERTY_ID_ALIGN, &::getCppuType(&nAlign) ,PropertyAttribute::BOUND,0},, - //{PROPERTY_CONTROLBORDER, static_cast<sal_uInt16>(PROPERTY_CONTROLBORDER.length), PROPERTY_ID_BORDER, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},, - //{PROPERTY_CONTROLBORDERCOLOR, static_cast<sal_uInt16>(PROPERTY_CONTROLBORDERCOLOR.length), PROPERTY_ID_BORDERCOLOR, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},, - //{PROPERTY_CHARCOLOR, static_cast<sal_uInt16>(PROPERTY_TEXTCOLOR.length), PROPERTY_ID_TEXTCOLOR, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},, - //{PROPERTY_FORMATKEY, static_cast<sal_uInt16>(PROPERTY_FORMATKEY.length), PROPERTY_ID_FORMATKEY, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},, - //{PROPERTY_CHARUNDERLINECOLOR, static_cast<sal_uInt16>(PROPERTY_CHARUNDERLINECOLOR.length), PROPERTY_ID_TEXTLINECOLOR, &::getCppuType(&aFont.Type) ,PropertyAttribute::BOUND,0},, { NULL, 0, 0, NULL, 0, 0 } }; try @@ -345,7 +330,7 @@ void OXMLHelper::copyStyleElements(const bool _bOld,const ::rtl::OUString& _sSty } catch(uno::Exception&) { - OSL_ENSURE(0,"OXMLHelper::copyStyleElements -> exception catched"); + OSL_FAIL("OXMLHelper::copyStyleElements -> exception catched"); } } } @@ -365,7 +350,7 @@ uno::Reference<beans::XPropertySet> OXMLHelper::createBorderPropertySet() // ----------------------------------------------------------------------------- SvXMLTokenMap* OXMLHelper::GetReportElemTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_REPORT, XML_REPORT_HEADER, XML_TOK_REPORT_HEADER }, { XML_NAMESPACE_REPORT, XML_PAGE_HEADER , XML_TOK_PAGE_HEADER }, @@ -392,7 +377,7 @@ SvXMLTokenMap* OXMLHelper::GetReportElemTokenMap() // ----------------------------------------------------------------------------- SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap() { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELD, XML_TOK_MASTER_DETAIL_FIELD}, { XML_NAMESPACE_REPORT, XML_MASTER, XML_TOK_MASTER}, @@ -406,7 +391,6 @@ const SvXMLEnumMapEntry* OXMLHelper::GetImageScaleOptions() { static SvXMLEnumMapEntry s_aXML_EnumMap[] = { - // { XML_NONE, awt::ImageScaleMode::None }, // default { XML_ISOTROPIC, awt::ImageScaleMode::Isotropic }, { XML_ANISOTROPIC, awt::ImageScaleMode::Anisotropic }, { XML_TOKEN_INVALID, 0 } diff --git a/reportdesign/source/filter/xml/xmlImage.cxx b/reportdesign/source/filter/xml/xmlImage.cxx index ab7567214fdf..0e254e92eab2 100644 --- a/reportdesign/source/filter/xml/xmlImage.cxx +++ b/reportdesign/source/filter/xml/xmlImage.cxx @@ -114,7 +114,7 @@ OXMLImage::OXMLImage( ORptFilter& rImport, } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the image props"); + OSL_FAIL("Exception catched while filling the image props"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index a61c4b21928b..c2dea15b7023 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -149,7 +149,7 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName { uno::Reference< xml::sax::XAttributeList > xNewAttribs = _xAttrList; bool bExport = true; - if ( _sName.equalsAscii("office:report") ) + if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("office:report")) ) { const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0; static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE); @@ -192,13 +192,12 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName } catch(uno::Exception&) { - // OSL_ENSURE(0,"Exception catched while filling the report definition props"); } m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_CHART),NULL); bExport = false; m_bImportedChart = true; } - else if ( _sName.equalsAscii("rpt:master-detail-field") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:master-detail-field")) ) { const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0; static const ::rtl::OUString s_sTRUE = ::xmloff::token::GetXMLToken(XML_TRUE); @@ -234,17 +233,17 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception catched while filling the report definition props"); + OSL_FAIL("Exception catched while filling the report definition props"); } bExport = false; } - else if ( _sName.equalsAscii("rpt:detail") - || _sName.equalsAscii("rpt:formatted-text") - || _sName.equalsAscii("rpt:master-detail-fields") - || _sName.equalsAscii("rpt:report-component") - || _sName.equalsAscii("rpt:report-element")) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:detail")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:formatted-text")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:master-detail-fields")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:report-component")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:report-element"))) bExport = false; - else if ( _sName.equalsAscii("chart:plot-area")) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart:plot-area"))) { sal_Bool bHasCategories = sal_True; const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() : 0; @@ -258,24 +257,23 @@ void SAL_CALL ImportDocumentHandler::startElement(const ::rtl::OUString & _sName sLocalName = sAttrName; else sLocalName = sAttrName.copy( nColonPos + 1L ); - if ( sLocalName.equalsAscii("data-source-has-labels") ) + if ( sLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("data-source-has-labels")) ) { const rtl::OUString sValue = _xAttrList->getValueByIndex( i ); - bHasCategories = sValue.equalsAscii("both"); + bHasCategories = sValue.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("both")); break; } - } // for(sal_Int16 i = 0; i < nLength; ++i) + } beans::PropertyValue* pArgIter = m_aArguments.getArray(); beans::PropertyValue* pArgEnd = pArgIter + m_aArguments.getLength(); for(;pArgIter != pArgEnd;++pArgIter) { - if ( pArgIter->Name.equalsAscii("HasCategories") ) + if ( pArgIter->Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasCategories")) ) { pArgIter->Value <<= bHasCategories; break; } - } // for(;pArgIter != pArgEnd;++pArgIter) - + } SvXMLAttributeList* pList = new SvXMLAttributeList(); xNewAttribs = pList; @@ -292,11 +290,11 @@ void SAL_CALL ImportDocumentHandler::endElement(const ::rtl::OUString & _sName) { bool bExport = true; ::rtl::OUString sNewName = _sName; - if ( _sName.equalsAscii("office:report") ) + if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("office:report")) ) { sNewName = lcl_createAttribute(XML_NP_OFFICE,XML_CHART); } - else if ( _sName.equalsAscii("rpt:master-detail-fields") ) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:master-detail-fields")) ) { if ( !m_aMasterFields.empty() ) m_xDatabaseDataProvider->setMasterFields(uno::Sequence< ::rtl::OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size())); @@ -304,11 +302,11 @@ void SAL_CALL ImportDocumentHandler::endElement(const ::rtl::OUString & _sName) m_xDatabaseDataProvider->setDetailFields(uno::Sequence< ::rtl::OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size())); bExport = false; } - else if ( _sName.equalsAscii("rpt:detail") - || _sName.equalsAscii("rpt:formatted-text") - || _sName.equalsAscii("rpt:master-detail-field") - || _sName.equalsAscii("rpt:report-component") - || _sName.equalsAscii("rpt:report-element")) + else if ( _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:detail")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:formatted-text")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:master-detail-field")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:report-component")) + || _sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("rpt:report-element"))) bExport = false; if ( bExport ) @@ -358,7 +356,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any > uno::Reference< chart2::data::XDataReceiver > xReceiver(m_xModel,uno::UNO_QUERY_THROW); xReceiver->attachDataProvider(m_xDatabaseDataProvider.get()); - } // if ( !m_xDatabaseDataProvider.is() ) + } m_aArguments = m_xDatabaseDataProvider->detectArguments(NULL); diff --git a/reportdesign/source/filter/xml/xmlReport.cxx b/reportdesign/source/filter/xml/xmlReport.cxx index 6990c9144b20..3edb30acd555 100644 --- a/reportdesign/source/filter/xml/xmlReport.cxx +++ b/reportdesign/source/filter/xml/xmlReport.cxx @@ -111,7 +111,7 @@ OXMLReport::OXMLReport( ORptFilter& rImport, } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the report definition props"); + OSL_FAIL("Exception catched while filling the report definition props"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlReportElement.cxx b/reportdesign/source/filter/xml/xmlReportElement.cxx index 2ef2ad192423..6ed989c06dbb 100644 --- a/reportdesign/source/filter/xml/xmlReportElement.cxx +++ b/reportdesign/source/filter/xml/xmlReportElement.cxx @@ -85,7 +85,7 @@ OXMLReportElement::OXMLReportElement( ORptFilter& rImport, } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the report definition props"); + OSL_FAIL("Exception catched while filling the report definition props"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlReportElementBase.cxx b/reportdesign/source/filter/xml/xmlReportElementBase.cxx index 01de1e714bf9..0a86638028b9 100644 --- a/reportdesign/source/filter/xml/xmlReportElementBase.cxx +++ b/reportdesign/source/filter/xml/xmlReportElementBase.cxx @@ -108,7 +108,7 @@ void OXMLReportElementBase::EndElement() } catch(Exception&) { - OSL_ENSURE(0,"Exception caught while inserting a new control!"); + OSL_FAIL("Exception caught while inserting a new control!"); } } //---------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlSection.cxx b/reportdesign/source/filter/xml/xmlSection.cxx index 098858190d28..5d19b6e9c202 100644 --- a/reportdesign/source/filter/xml/xmlSection.cxx +++ b/reportdesign/source/filter/xml/xmlSection.cxx @@ -102,13 +102,13 @@ OXMLSection::OXMLSection( ORptFilter& rImport, break; default: - OSL_ENSURE(0,"OXMLSection: Unknown attribute!"); + OSL_FAIL("OXMLSection: Unknown attribute!"); } } } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the section props"); + OSL_FAIL("Exception catched while filling the section props"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlStyleImport.cxx b/reportdesign/source/filter/xml/xmlStyleImport.cxx index afb2ceff5431..eab257017a91 100644 --- a/reportdesign/source/filter/xml/xmlStyleImport.cxx +++ b/reportdesign/source/filter/xml/xmlStyleImport.cxx @@ -44,7 +44,7 @@ #include <tools/debug.hxx> #include "xmlfilter.hxx" #include "xmlHelper.hxx" -#include <tools/debug.hxx> +#include <osl/diagnose.h> #define XML_LINE_LEFT 0 #define XML_LINE_RIGHT 1 @@ -129,7 +129,7 @@ void OControlStyleContext::FillPropertySet(const Reference< XPropertySet > & rPr pStyle = PTR_CAST(SvXMLNumFormatContext,pMyStyles-> FindStyleChildContext(XML_STYLE_FAMILY_DATA_STYLE, m_sDataStyleName, sal_True)); else { - DBG_ERROR("not possible to get style"); + OSL_FAIL("not possible to get style"); } } if ( pStyle ) @@ -151,7 +151,7 @@ void OControlStyleContext::SetDefaults() void OControlStyleContext::AddProperty(const sal_Int16 nContextID, const uno::Any& rValue) { sal_Int32 nIndex(static_cast<OReportStylesContext *>(pStyles)->GetIndex(nContextID)); - DBG_ASSERT(nIndex != -1, "Property not found in Map"); + OSL_ENSURE(nIndex != -1, "Property not found in Map"); XMLPropertyState aPropState(nIndex, rValue); GetProperties().push_back(aPropState); // has to be insertes in a sort order later } @@ -257,7 +257,6 @@ UniReference < SvXMLImportPropertyMapper > { UniReference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory(); m_xTableImpPropMapper = new SvXMLImportPropertyMapper( new XMLPropertySetMapper(OXMLHelper::GetTableStyleProps(), xFac), m_rImport ); - //m_xTableImpPropMapper = new SvXMLImportPropertyMapper( rImport.GetTableStylesPropertySetMapper(), m_rImport ); } xMapper = m_xTableImpPropMapper; } @@ -312,7 +311,7 @@ SvXMLStyleContext *OReportStylesContext::CreateStyleStyleChildContext( xAttrList, *this, nFamily ); break; default: - OSL_ENSURE(0,"OReportStylesContext::CreateStyleStyleChildContext: Unknown style family. PLease check."); + OSL_FAIL("OReportStylesContext::CreateStyleStyleChildContext: Unknown style family. PLease check."); break; } } @@ -369,7 +368,7 @@ Reference < XNameContainer > xStyles = ((SvXMLImport *)&GetImport())->GetTextImport()->GetFrameStyles(); break; default: - OSL_ENSURE(0,"OReportStylesContext::CreateStyleStyleChildContext: Unknown style family. PLease check."); + OSL_FAIL("OReportStylesContext::CreateStyleStyleChildContext: Unknown style family. PLease check."); break; } if( !xStyles.is() && sName.getLength() && GetOwnImport().GetModel().is() ) diff --git a/reportdesign/source/filter/xml/xmlSubDocument.cxx b/reportdesign/source/filter/xml/xmlSubDocument.cxx index 623eceaa849f..847752adaeae 100644 --- a/reportdesign/source/filter/xml/xmlSubDocument.cxx +++ b/reportdesign/source/filter/xml/xmlSubDocument.cxx @@ -120,9 +120,6 @@ void OXMLSubDocument::EndElement() m_xComponent.set(m_pContainer->getSection()->getByIndex(m_nCurrentCount),uno::UNO_QUERY); if ( m_xComponent.is() ) { - // #i94115# this is no longer need. - // m_pContainer->addCell(m_xComponent.get()); - if ( !m_aMasterFields.empty() ) m_xComponent->setMasterFields(Sequence< ::rtl::OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size())); if ( !m_aDetailFields.empty() ) @@ -143,11 +140,11 @@ void OXMLSubDocument::EndElement() uno::Reference< report::XFormatCondition > xNewCond = xComponentModel->createFormatCondition(); ::comphelper::copyProperties(xCond.get(),xNewCond.get()); xComponentModel->insertByIndex(xComponentModel->getCount(),uno::makeAny(xNewCond)); - } // for (sal_Int32 i = 0; i < nCount ; ++i) + } } catch(uno::Exception&) { - OSL_ENSURE(0,"Can not access format condition!"); + OSL_FAIL("Can not access format condition!"); } } diff --git a/reportdesign/source/filter/xml/xmlTable.cxx b/reportdesign/source/filter/xml/xmlTable.cxx index f70a65d98bcc..92fbf0658867 100644 --- a/reportdesign/source/filter/xml/xmlTable.cxx +++ b/reportdesign/source/filter/xml/xmlTable.cxx @@ -122,7 +122,7 @@ OXMLTable::OXMLTable( ORptFilter& rImport } catch(Exception&) { - OSL_ENSURE(0,"Exception catched while filling the section props"); + OSL_FAIL("Exception catched while filling the section props"); } } // ----------------------------------------------------------------------------- @@ -192,7 +192,7 @@ void OXMLTable::EndElement() pAutoStyle->FillPropertySet(m_xSection.get()); } } - } // if ( m_sStyleName.getLength() ) + } // set height ::std::vector<sal_Int32>::iterator aIter = m_aHeight.begin(); ::std::vector<sal_Int32>::iterator aEnd = m_aHeight.end(); @@ -269,7 +269,7 @@ void OXMLTable::EndElement() } catch(beans::PropertyVetoException) { - OSL_ENSURE(0,"Could not set the correct position or size!"); + OSL_FAIL("Could not set the correct position or size!"); } } } @@ -278,11 +278,11 @@ void OXMLTable::EndElement() } nPosY += m_aHeight[i]; } - } // if ( m_xComponent.is() ) + } } catch(Exception&) { - OSL_ENSURE(0,"OXMLTable::EndElement -> exception catched"); + OSL_FAIL("OXMLTable::EndElement -> exception catched"); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx index 1e1f2ba71305..b44fd3282ed3 100644 --- a/reportdesign/source/filter/xml/xmlfilter.cxx +++ b/reportdesign/source/filter/xml/xmlfilter.cxx @@ -85,8 +85,8 @@ using namespace ::com::sun::star::io; using namespace ::com::sun::star::report; using namespace ::com::sun::star::xml::sax; using namespace xmloff; - sal_Char __READONLY_DATA sXML_np__rpt[] = "_report"; - sal_Char __READONLY_DATA sXML_np___rpt[] = "__report"; + sal_Char const sXML_np__rpt[] = "_report"; + sal_Char const sXML_np___rpt[] = "__report"; using namespace ::com::sun::star::util; @@ -138,9 +138,9 @@ sal_Int32 ReadThroughComponent( const uno::Reference< XDocumentHandler >& _xFilter, sal_Bool /*bEncrypted*/ ) { - DBG_ASSERT(xInputStream.is(), "input stream missing"); - DBG_ASSERT(xModelComponent.is(), "document missing"); - DBG_ASSERT(rFactory.is(), "factory missing"); + OSL_ENSURE(xInputStream.is(), "input stream missing"); + OSL_ENSURE(xModelComponent.is(), "document missing"); + OSL_ENSURE(rFactory.is(), "factory missing"); RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "rptxml", "oj", "ReadThroughComponent" ); @@ -151,15 +151,15 @@ sal_Int32 ReadThroughComponent( // get parser uno::Reference< XParser > xParser( rFactory->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser") ), + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))), UNO_QUERY ); - DBG_ASSERT( xParser.is(), "Can't create parser" ); + OSL_ENSURE( xParser.is(), "Can't create parser" ); if( !xParser.is() ) return 1; RTL_LOGFILE_CONTEXT_TRACE( aLog, "parser created" ); // get filter - DBG_ASSERT( _xFilter.is(), "Can't instantiate filter component." ); + OSL_ENSURE( _xFilter.is(), "Can't instantiate filter component." ); if( !_xFilter.is() ) return 1; @@ -196,7 +196,7 @@ r aError += ','; aError += ByteString::CreateFromInt32( r.ColumnNumber ); - DBG_ERROR( aError.GetBuffer() ); + OSL_FAIL( aError.GetBuffer() ); #endif return 1; } @@ -233,8 +233,8 @@ sal_Int32 ReadThroughComponent( const ::rtl::OUString& _sFilterName ,const uno::Reference<beans::XPropertySet>& _xProp) { - DBG_ASSERT( xStorage.is(), "Need storage!"); - DBG_ASSERT(NULL != pStreamName, "Please, please, give me a name!"); + OSL_ENSURE( xStorage.is(), "Need storage!"); + OSL_ENSURE(NULL != pStreamName, "Please, please, give me a name!"); if ( xStorage.is() ) { @@ -482,11 +482,11 @@ sal_Bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) const PropertyValue* pEnd = pIter + rDescriptor.getLength(); for(;pIter != pEnd;++pIter) { - if( pIter->Name.equalsAscii( "FileName" ) ) + if( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FileName" ) ) ) pIter->Value >>= sFileName; - else if( pIter->Name.equalsAscii( "Storage" ) ) + else if( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Storage" ) ) ) pIter->Value >>= xStorage; - else if( pIter->Name.equalsAscii( "ComponentData" ) ) + else if( pIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ComponentData" ) ) ) { Sequence< PropertyValue > aComponent; pIter->Value >>= aComponent; @@ -494,7 +494,7 @@ sal_Bool ORptFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) const PropertyValue* pComponentEnd = pComponentIter + aComponent.getLength(); for(;pComponentIter != pComponentEnd;++pComponentIter) { - if( pComponentIter->Name.equalsAscii( "ActiveConnection" ) ) + if( pComponentIter->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ActiveConnection" ) ) ) { uno::Reference<sdbc::XConnection> xCon(pComponentIter->Value,uno::UNO_QUERY); xNumberFormatsSupplier = ::dbtools::getNumberFormats(xCon); @@ -509,20 +509,19 @@ sal_Bool ORptFilter::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 ); if( pMedium ) { try { xStorage = pMedium->GetStorage(); - // nError = pMedium->GetError(); } catch(const Exception&) { } - } // if( pMedium ) - } // if ( bRet = (sFileName.getLength() != 0) ) + } + } sal_Bool bRet = xStorage.is(); if ( bRet ) { @@ -742,20 +741,16 @@ const SvXMLTokenMap& ORptFilter::GetDocElemTokenMap() const { if ( !m_pDocElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_OFFICE, XML_SETTINGS, XML_TOK_DOC_SETTINGS }, - //{ XML_NAMESPACE_OOO, XML_SETTINGS, XML_TOK_DOC_SETTINGS }, { XML_NAMESPACE_OFFICE, XML_STYLES, XML_TOK_DOC_STYLES }, - //{ XML_NAMESPACE_OOO, XML_STYLES, XML_TOK_DOC_STYLES }, { XML_NAMESPACE_OFFICE, XML_AUTOMATIC_STYLES, XML_TOK_DOC_AUTOSTYLES }, - //{ XML_NAMESPACE_OOO, XML_AUTOMATIC_STYLES, XML_TOK_DOC_AUTOSTYLES }, { XML_NAMESPACE_OFFICE, XML_REPORT, XML_TOK_DOC_REPORT }, { XML_NAMESPACE_OOO, XML_REPORT, XML_TOK_DOC_REPORT }, { XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS, XML_TOK_DOC_FONTDECLS }, { XML_NAMESPACE_OFFICE, XML_MASTER_STYLES, XML_TOK_DOC_MASTERSTYLES }, { XML_NAMESPACE_OFFICE, XML_DOCUMENT_META, XML_TOK_DOC_META }, - //{ XML_NAMESPACE_OOO, XML_FONT_FACE_DECLS, XML_TOK_DOC_FONTDECLS }, XML_TOKEN_MAP_END }; m_pDocElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap )); @@ -781,7 +776,7 @@ const SvXMLTokenMap& ORptFilter::GetFunctionElemTokenMap() const { if ( !m_pFunctionElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_REPORT, XML_NAME, XML_TOK_FUNCTION_NAME }, { XML_NAMESPACE_REPORT, XML_FORMULA, XML_TOK_FUNCTION_FORMULA}, @@ -799,11 +794,11 @@ const SvXMLTokenMap& ORptFilter::GetFormatElemTokenMap() const { if ( !m_pFormatElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { - { XML_NAMESPACE_REPORT, XML_ENABLED , XML_TOK_ENABLED }, - { XML_NAMESPACE_REPORT, XML_FORMULA , XML_TOK_FORMULA }, - { XML_NAMESPACE_REPORT, XML_STYLE_NAME , XML_TOK_FORMAT_STYLE_NAME }, + { XML_NAMESPACE_REPORT, XML_ENABLED , XML_TOK_ENABLED }, + { XML_NAMESPACE_REPORT, XML_FORMULA , XML_TOK_FORMULA }, + { XML_NAMESPACE_REPORT, XML_STYLE_NAME , XML_TOK_FORMAT_STYLE_NAME }, XML_TOKEN_MAP_END }; m_pFormatElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap )); @@ -815,7 +810,7 @@ const SvXMLTokenMap& ORptFilter::GetGroupElemTokenMap() const { if ( !m_pGroupElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_REPORT, XML_START_NEW_COLUMN , XML_TOK_START_NEW_COLUMN }, { XML_NAMESPACE_REPORT, XML_RESET_PAGE_NUMBER , XML_TOK_RESET_PAGE_NUMBER }, @@ -829,7 +824,6 @@ const SvXMLTokenMap& ORptFilter::GetGroupElemTokenMap() const { XML_NAMESPACE_REPORT, XML_SORT_ASCENDING , XML_TOK_SORT_ASCENDING }, { XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER , XML_TOK_GROUP_KEEP_TOGETHER }, { XML_NAMESPACE_REPORT, XML_FUNCTION , XML_TOK_GROUP_FUNCTION }, - //{ XML_NAMESPACE_REPORT, XML_ , XML_TOK_ }, XML_TOKEN_MAP_END }; m_pGroupElemTokenMap.reset(new SvXMLTokenMap( aElemTokenMap )); @@ -841,7 +835,7 @@ const SvXMLTokenMap& ORptFilter::GetReportElementElemTokenMap() const { if ( !m_pElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_REPORT, XML_PRINT_REPEATED_VALUES ,XML_TOK_PRINT_REPEATED_VALUES }, { XML_NAMESPACE_REPORT, XML_PRINT_ONLY_WHEN_GROUP_CHANGE,XML_TOK_PRINT_ONLY_WHEN_GROUP_CHANGE }, @@ -859,7 +853,7 @@ const SvXMLTokenMap& ORptFilter::GetControlElemTokenMap() const { if ( !m_pControlElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_FORM, XML_LABEL ,XML_TOK_LABEL }, { XML_NAMESPACE_FORM, XML_PROPERTIES ,XML_TOK_PROPERTIES }, @@ -881,7 +875,7 @@ const SvXMLTokenMap& ORptFilter::GetControlPropertyElemTokenMap() const { if ( !m_pControlElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_FORM, XML_PROPERTY_NAME ,XML_TOK_PROPERTY_NAME }, { XML_NAMESPACE_OOO, XML_VALUE_TYPE ,XML_TOK_VALUE_TYPE }, @@ -903,7 +897,7 @@ const SvXMLTokenMap& ORptFilter::GetComponentElemTokenMap() const { if ( !m_pComponentElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_DRAW, XML_NAME , XML_TOK_NAME }, { XML_NAMESPACE_DRAW, XML_TEXT_STYLE_NAME , XML_TOK_TEXT_STYLE_NAME }, @@ -919,7 +913,7 @@ const SvXMLTokenMap& ORptFilter::GetColumnTokenMap() const { if ( !m_pColumnTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_TABLE, XML_NAME , XML_TOK_NAME }, { XML_NAMESPACE_TABLE, XML_STYLE_NAME , XML_TOK_COLUMN_STYLE_NAME }, @@ -943,7 +937,7 @@ const SvXMLTokenMap& ORptFilter::GetSectionElemTokenMap() const { if ( !m_pSectionElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_TABLE, XML_TABLE , XML_TOK_TABLE }, { XML_NAMESPACE_TABLE, XML_NAME , XML_TOK_SECTION_NAME }, @@ -966,7 +960,7 @@ const SvXMLTokenMap& ORptFilter::GetCellElemTokenMap() const { if ( !m_pCellElemTokenMap.get() ) { - static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]= + static SvXMLTokenMapEntry aElemTokenMap[]= { { XML_NAMESPACE_TEXT, XML_P , XML_TOK_P }, { XML_NAMESPACE_REPORT, XML_FIXED_CONTENT , XML_TOK_FIXED_CONTENT }, @@ -995,10 +989,8 @@ SvXMLImportContext* ORptFilter::CreateStylesContext(const ::rtl::OUString& rLoca { pContext = new OReportStylesContext(*this, XML_NAMESPACE_OFFICE, rLocalName, xAttrList, bIsAutoStyle); if (bIsAutoStyle) - //xAutoStyles = pContext; SetAutoStyles((SvXMLStylesContext*)pContext); else - //xStyles = pContext; SetStyles((SvXMLStylesContext*)pContext); } return pContext; @@ -1042,20 +1034,6 @@ void ORptFilter::FinishStyles() // ----------------------------------------------------------------------------- ::rtl::OUString ORptFilter::convertFormula(const ::rtl::OUString& _sFormula) { - //sal_Int32 nLen = _sFormula.getLength(); - //if ( nLen ) - //{ - // const static ::rtl::OUString s_sField(RTL_CONSTASCII_USTRINGPARAM("field:[")); - // sal_Int32 nPos = _sFormula.indexOf(s_sField); - // if ( nPos == -1 ) - // nPos = 4; // "rpt:" - // else - // { - // nPos = s_sField.getLength(); - // --nLen; // eat "]" - // } - // return _sFormula.copy(nPos,nLen-nPos); - //} return _sFormula; } // ----------------------------------------------------------------------------- @@ -1076,7 +1054,7 @@ void SAL_CALL ORptFilter::startDocument( void ) void ORptFilter::endDocument( void ) throw( xml::sax::SAXException, uno::RuntimeException ) { - DBG_ASSERT( GetModel().is(), "model missing; maybe startDocument wasn't called?" ); + OSL_ENSURE( GetModel().is(), "model missing; maybe startDocument wasn't called?" ); if( !GetModel().is() ) return; @@ -1109,8 +1087,8 @@ SvXMLImportContext* ORptFilter::CreateMetaContext(const ::rtl::OUString& rLocalN if ( (getImportFlags() & IMPORT_META) ) { uno::Reference<xml::sax::XDocumentHandler> xDocBuilder( - getServiceFactory()->createInstance(::rtl::OUString::createFromAscii( - "com.sun.star.xml.dom.SAXDocumentBuilder")), + getServiceFactory()->createInstance(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.SAXDocumentBuilder"))), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW); pContext = new SvXMLMetaDocumentContext(*this,XML_NAMESPACE_OFFICE, rLocalName,xDPS->getDocumentProperties(), xDocBuilder); @@ -1129,7 +1107,7 @@ sal_Bool ORptFilter::isOldFormat() const { xProp->getPropertyValue(s_sOld) >>= bOldFormat; } - } // if ( xProp.is() ) + } return bOldFormat; } diff --git a/reportdesign/source/filter/xml/xmlservices.cxx b/reportdesign/source/filter/xml/xmlservices.cxx index 3e4a09d3993a..b479396371b8 100644 --- a/reportdesign/source/filter/xml/xmlservices.cxx +++ b/reportdesign/source/filter/xml/xmlservices.cxx @@ -94,11 +94,5 @@ extern "C" void SAL_CALL component_getImplementationEnvironment( *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -extern "C" sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return cppu::component_writeInfoHelper( - serviceManager, registryKey, entries); -} -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/reportdesign/source/shared/makefile.mk b/reportdesign/source/shared/makefile.mk index e399649bc825..62f78561dcf2 100644 --- a/reportdesign/source/shared/makefile.mk +++ b/reportdesign/source/shared/makefile.mk @@ -34,8 +34,6 @@ LIB1TARGET=$(SLB)$/coreshared.lib LIB2TARGET=$(SLB)$/xmlshared.lib LIB3TARGET=$(SLB)$/uishared.lib -#ENABLE_EXCEPTIONS=TRUE - # --- Settings ---------------------------------- .INCLUDE : settings.mk diff --git a/reportdesign/source/ui/dlg/AddField.cxx b/reportdesign/source/ui/dlg/AddField.cxx index 43ad175d827d..1193e63d694a 100644 --- a/reportdesign/source/ui/dlg/AddField.cxx +++ b/reportdesign/source/ui/dlg/AddField.cxx @@ -76,8 +76,6 @@ class OAddFieldWindowListBox : public SvTreeListBox OAddFieldWindowListBox(const OAddFieldWindowListBox&); void operator =(const OAddFieldWindowListBox&); -protected: -// virtual void Command( const CommandEvent& rEvt ); public: OAddFieldWindowListBox( OAddFieldWindow* _pParent ); @@ -191,7 +189,7 @@ OAddFieldWindow::OAddFieldWindow(Window* pParent m_aActions.SetSelectHdl(LINK(this, OAddFieldWindow, OnSortAction)); setToolBox(&m_aActions); m_aActions.CheckItem(SID_FM_SORTUP); - m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, FALSE); + m_aActions.EnableItem(SID_ADD_CONTROL_PAIR, sal_False); m_pListBox->SetDoubleClickHdl(LINK( this, OAddFieldWindow, OnDoubleClickHdl ) ); m_pListBox->SetSelectHdl(LINK( this, OAddFieldWindow, OnSelectHdl ) ); @@ -207,7 +205,6 @@ OAddFieldWindow::OAddFieldWindow(Window* pParent m_aHelpText.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() ); SetSizePixel(Size(STD_WIN_SIZE_X,STD_WIN_SIZE_Y)); - //Show(); if ( m_xRowSet.is() ) { @@ -233,8 +230,8 @@ OAddFieldWindow::~OAddFieldWindow() if ( m_pListBox.get() ) { SvLBoxTreeList* pModel = m_pListBox->GetModel(); - ULONG nCount = pModel->GetEntryCount(); - for(ULONG i = 0; i< nCount;++i) + sal_uLong nCount = pModel->GetEntryCount(); + for(sal_uLong i = 0; i< nCount;++i) { delete static_cast<ColumnInfo*>(pModel->GetEntry(i)->GetUserData()); } @@ -294,7 +291,7 @@ namespace const ::rtl::OUString* pEntries = _rEntries.getConstArray(); sal_Int32 nEntries = _rEntries.getLength(); for ( sal_Int32 i = 0; i < nEntries; ++i, ++pEntries ) - _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries) ); + _rListBox.InsertEntry( *pEntries,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries) ); } void lcl_addToList( OAddFieldWindowListBox& _rListBox, const uno::Reference< container::XNameAccess>& i_xColumns ) { @@ -308,9 +305,9 @@ namespace if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if ( sLabel.getLength() ) - _rListBox.InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + _rListBox.InsertEntry( sLabel,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); else - _rListBox.InsertEntry( *pEntries,NULL,FALSE,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); + _rListBox.InsertEntry( *pEntries,NULL,sal_False,LIST_APPEND,new ColumnInfo(*pEntries,sLabel) ); } } } @@ -327,10 +324,10 @@ void OAddFieldWindow::Update() { // ListBox loeschen m_pListBox->Clear(); - const USHORT nItemCount = m_aActions.GetItemCount(); - for (USHORT j = 0; j< nItemCount; ++j) + const sal_uInt16 nItemCount = m_aActions.GetItemCount(); + for (sal_uInt16 j = 0; j< nItemCount; ++j) { - m_aActions.EnableItem(m_aActions.GetItemId(j),FALSE); + m_aActions.EnableItem(m_aActions.GetItemId(j),sal_False); } String aTitle(ModuleRes(RID_STR_FIELDSELECTION)); @@ -375,7 +372,7 @@ void OAddFieldWindow::Update() SetText( aTitle ); if ( m_aCommandName.getLength() ) { - for (USHORT i = 0; i < nItemCount; ++i) + for (sal_uInt16 i = 0; i < nItemCount; ++i) { m_aActions.EnableItem(m_aActions.GetItemId(i)); } @@ -448,7 +445,7 @@ void OAddFieldWindow::fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessD uno::Reference<frame::XModel> xModel(xDocument->getDatabaseDocument(),uno::UNO_QUERY); if ( xModel.is() ) _rDescriptor[ daDatabaseLocation ] <<= xModel->getURL(); - } // if ( xDocument.is() ) + } } _rDescriptor[ ::svx::daCommand ] <<= GetCommand(); @@ -457,7 +454,6 @@ void OAddFieldWindow::fillDescriptor(SvLBoxEntry* _pSelected,::svx::ODataAccessD _rDescriptor[ ::svx::daConnection ] <<= getConnection(); ColumnInfo* pInfo = static_cast<ColumnInfo*>(_pSelected->GetUserData()); - // ::rtl::OUString sColumnName = m_pListBox->GetEntryText( _pSelected ); _rDescriptor[ ::svx::daColumnName ] <<= pInfo->sColumnName; if ( m_xColumns->hasByName( pInfo->sColumnName ) ) _rDescriptor[ ::svx::daColumnObject ] <<= m_xColumns->getByName(pInfo->sColumnName); @@ -476,9 +472,9 @@ void OAddFieldWindow::_elementInserted( const container::ContainerEvent& _rEvent if ( xColumn->getPropertySetInfo()->hasPropertyByName(PROPERTY_LABEL) ) xColumn->getPropertyValue(PROPERTY_LABEL) >>= sLabel; if ( sLabel.getLength() ) - m_pListBox->InsertEntry( sLabel,NULL,FALSE,LIST_APPEND,new ColumnInfo(sName,sLabel) ); + m_pListBox->InsertEntry( sLabel,NULL,sal_False,LIST_APPEND,new ColumnInfo(sName,sLabel) ); else - m_pListBox->InsertEntry( sName,NULL,FALSE,LIST_APPEND,new ColumnInfo(sName,sLabel) ); + m_pListBox->InsertEntry( sName,NULL,sal_False,LIST_APPEND,new ColumnInfo(sName,sLabel) ); } } } @@ -512,16 +508,12 @@ IMPL_LINK( OAddFieldWindow, OnDoubleClickHdl, void* ,/*_pAddFieldDlg*/) return 0L; } //------------------------------------------------------------------------------ -ImageList OAddFieldWindow::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const +ImageList OAddFieldWindow::getImageList(sal_Int16 _eBitmapSet) const { sal_Int16 nN = IMG_ADDFIELD_DLG_SC; - sal_Int16 nH = IMG_ADDFIELD_DLG_SCH; if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE ) - { nN = IMG_ADDFIELD_DLG_LC; - nH = IMG_ADDFIELD_DLG_LCH; - } - return ImageList(ModuleRes( _bHiContast ? nH : nN )); + return ImageList(ModuleRes(nN)); } //------------------------------------------------------------------ void OAddFieldWindow::resizeControls(const Size& _rDiff) @@ -535,19 +527,19 @@ void OAddFieldWindow::resizeControls(const Size& _rDiff) //------------------------------------------------------------------ IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ ) { - const USHORT nCurItem = m_aActions.GetCurItemId(); + const sal_uInt16 nCurItem = m_aActions.GetCurItemId(); if ( SID_ADD_CONTROL_PAIR == nCurItem ) OnDoubleClickHdl(NULL); else { if ( SID_FM_REMOVE_FILTER_SORT == nCurItem || !m_aActions.IsItemChecked(nCurItem) ) { - const USHORT nItemCount = m_aActions.GetItemCount(); - for (USHORT j = 0; j< nItemCount; ++j) + const sal_uInt16 nItemCount = m_aActions.GetItemCount(); + for (sal_uInt16 j = 0; j< nItemCount; ++j) { - const USHORT nItemId = m_aActions.GetItemId(j); + const sal_uInt16 nItemId = m_aActions.GetItemId(j); if ( nCurItem != nItemId ) - m_aActions.CheckItem(nItemId,FALSE); + m_aActions.CheckItem(nItemId,sal_False); } SvSortMode eSortMode = SortNone; if ( SID_FM_REMOVE_FILTER_SORT != nCurItem ) @@ -557,7 +549,7 @@ IMPL_LINK( OAddFieldWindow, OnSortAction, ToolBox*, /*NOTINTERESTEDIN*/ ) eSortMode = SortAscending; else if ( m_aActions.IsItemChecked(SID_FM_SORTDOWN) ) eSortMode = SortDescending; - } // if ( SID_FM_REMOVE_FILTER_SORT != nCurItem ) + } m_pListBox->GetModel()->SetSortMode(eSortMode); if ( SID_FM_REMOVE_FILTER_SORT == nCurItem ) diff --git a/reportdesign/source/ui/dlg/CondFormat.cxx b/reportdesign/source/ui/dlg/CondFormat.cxx index 898779094953..e90b08faab6a 100644 --- a/reportdesign/source/ui/dlg/CondFormat.cxx +++ b/reportdesign/source/ui/dlg/CondFormat.cxx @@ -88,11 +88,11 @@ namespace rptui UpdateLocker( Window& _rWindow ) :m_rWindow( _rWindow ) { - _rWindow.SetUpdateMode( FALSE ); + _rWindow.SetUpdateMode( sal_False ); } ~UpdateLocker() { - m_rWindow.SetUpdateMode( TRUE ); + m_rWindow.SetUpdateMode( sal_True ); } }; @@ -394,14 +394,14 @@ namespace rptui } catch(Exception&) { - OSL_ENSURE(0,"Can not access format condition!"); + OSL_FAIL("Can not access format condition!"); } impl_conditionCountChanged(); } // ----------------------------------------------------------------------------- - void ConditionalFormattingDialog::applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ) + void ConditionalFormattingDialog::applyCommand( size_t _nCondIndex, sal_uInt16 _nCommandId, const ::Color _aColor ) { OSL_PRECOND( _nCommandId, "ConditionalFormattingDialog::applyCommand: illegal command id!" ); try @@ -466,8 +466,8 @@ namespace rptui short nRet = ModalDialog::Execute(); if ( nRet == RET_OK ) { - String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) ); - UndoManagerListAction aListAction(*m_rController.getUndoMgr(),sUndoAction); + const String sUndoAction( ModuleRes( RID_STR_UNDO_CONDITIONAL_FORMATTING ) ); + const UndoContext aUndoContext( m_rController.getUndoManager(), sUndoAction ); try { sal_Int32 j(0), i(0);; diff --git a/reportdesign/source/ui/dlg/CondFormat.hrc b/reportdesign/source/ui/dlg/CondFormat.hrc index 89e0e1b88246..47091374dec8 100644 --- a/reportdesign/source/ui/dlg/CondFormat.hrc +++ b/reportdesign/source/ui/dlg/CondFormat.hrc @@ -67,8 +67,6 @@ #define BTN_MOVE_DOWN 21 #define BTN_ADD_CONDITION 22 #define BTN_REMOVE_CONDITION 23 -#define IMG_MOVE_UP_HC 24 -#define IMG_MOVE_DOWN_HC 25 #define ROW_0_POS ( RELATED_CONTROLS ) #define ROW_0_HEIGTH ( FIXEDTEXT_HEIGHT ) diff --git a/reportdesign/source/ui/dlg/CondFormat.src b/reportdesign/source/ui/dlg/CondFormat.src index 14fe6649aff1..2e5e352bcbde 100644 --- a/reportdesign/source/ui/dlg/CondFormat.src +++ b/reportdesign/source/ui/dlg/CondFormat.src @@ -190,16 +190,6 @@ Control WIN_CONDITION Size = MAP_APPFONT( IMAGE_BUTTON_WIDTH, IMAGE_BUTTON_HEIGHT ); Text = "-"; }; - - Image IMG_MOVE_UP_HC - { - ImageBitmap = Bitmap { File = "arrow_move_up_hc" ; }; - }; - - Image IMG_MOVE_DOWN_HC - { - ImageBitmap = Bitmap { File = "arrow_move_down_hc" ; }; - }; }; ModalDialog RID_CONDFORMAT @@ -286,57 +276,29 @@ ImageList IMG_CONDFORMAT_DLG_SC MASKCOLOR; FileList = { - < "res/commandimagelist/sc_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ; - < "res/commandimagelist/sc_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ; - < "res/commandimagelist/sc_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ; - < "res/commandimagelist/sc_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ; - < "res/commandimagelist/sc_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ; - < "res/commandimagelist/sc_fontdialog.png" ; SID_CHAR_DLG ; > ; + < "res/commandimagelist/sc_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ; + < "res/commandimagelist/sc_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ; + < "res/commandimagelist/sc_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ; + < "res/commandimagelist/sc_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ; + < "res/commandimagelist/sc_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ; + < "res/commandimagelist/sc_fontdialog.png" ; SID_CHAR_DLG ; > ; }; }; -ImageList IMG_CONDFORMAT_DLG_SCH -{ - MASKCOLOR; - FileList = - { - < "res/commandimagelist/sch_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ; - < "res/commandimagelist/sch_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ; - < "res/commandimagelist/sch_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ; - < "res/commandimagelist/sch_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ; - < "res/commandimagelist/sch_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ; - < "res/commandimagelist/sch_fontdialog.png" ; SID_CHAR_DLG ; > ; - }; -}; ImageList IMG_CONDFORMAT_DLG_LC { MASKCOLOR; FileList = { - < "res/commandimagelist/lc_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ; - < "res/commandimagelist/lc_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ; - < "res/commandimagelist/lc_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ; - < "res/commandimagelist/lc_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ; - < "res/commandimagelist/lc_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ; - < "res/commandimagelist/lc_fontdialog.png" ; SID_CHAR_DLG ; > ; - }; -}; -ImageList IMG_CONDFORMAT_DLG_LCH -{ - MASKCOLOR; - FileList = - { - < "res/commandimagelist/lch_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ; - < "res/commandimagelist/lch_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ; - < "res/commandimagelist/lch_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ; - < "res/commandimagelist/lch_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ; - < "res/commandimagelist/lch_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ; - < "res/commandimagelist/lch_fontdialog.png" ; SID_CHAR_DLG ; > ; + < "res/commandimagelist/lc_bold.png" ; SID_ATTR_CHAR_WEIGHT ; > ; + < "res/commandimagelist/lc_italic.png" ; SID_ATTR_CHAR_POSTURE ; > ; + < "res/commandimagelist/lc_underline.png" ; SID_ATTR_CHAR_UNDERLINE ; > ; + < "res/commandimagelist/lc_backgroundcolor.png" ; SID_BACKGROUND_COLOR ; > ; + < "res/commandimagelist/lc_fontcolor.png" ; SID_ATTR_CHAR_COLOR2 ; > ; + < "res/commandimagelist/lc_fontdialog.png" ; SID_CHAR_DLG ; > ; }; }; - - ImageList 31000 { MASKCOLOR; @@ -388,20 +350,9 @@ ImageList IMG_ADDFIELD_DLG_SC MASKCOLOR; FileList = { - < "res/commandimagelist/sc_sortup.png" ; SID_FM_SORTUP ; > ; - < "res/commandimagelist/sc_sortdown.png" ; SID_FM_SORTDOWN ; > ; - < "res/commandimagelist/sc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; - }; -}; - -ImageList IMG_ADDFIELD_DLG_SCH -{ - MASKCOLOR; - FileList = - { - < "res/commandimagelist/sch_sortup.png" ; SID_FM_SORTUP ; > ; - < "res/commandimagelist/sch_sortdown.png" ; SID_FM_SORTDOWN ; > ; - < "res/commandimagelist/sch_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; + < "res/commandimagelist/sc_sortup.png" ; SID_FM_SORTUP ; > ; + < "res/commandimagelist/sc_sortdown.png" ; SID_FM_SORTDOWN ; > ; + < "res/commandimagelist/sc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; }; }; @@ -410,20 +361,9 @@ ImageList IMG_ADDFIELD_DLG_LC MASKCOLOR; FileList = { - < "res/commandimagelist/lc_sortup.png" ; SID_FM_SORTUP ; > ; - < "res/commandimagelist/lc_sortdown.png" ; SID_FM_SORTDOWN ; > ; - < "res/commandimagelist/lc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; - }; -}; - -ImageList IMG_ADDFIELD_DLG_LCH -{ - MASKCOLOR; - FileList = - { - < "res/commandimagelist/lch_sortup.png" ; SID_FM_SORTUP ; > ; - < "res/commandimagelist/lch_sortdown.png" ; SID_FM_SORTDOWN ; > ; - < "res/commandimagelist/lch_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; + < "res/commandimagelist/lc_sortup.png" ; SID_FM_SORTUP ; > ; + < "res/commandimagelist/lc_sortdown.png" ; SID_FM_SORTDOWN ; > ; + < "res/commandimagelist/lc_removefiltersort.png" ; SID_FM_REMOVE_FILTER_SORT ; > ; }; }; diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index a61b2fdb08cb..3b979d9649a0 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -72,7 +72,7 @@ ConditionField::ConditionField( Condition* _pParent, const ResId& _rResId ) : Ed { m_pSubEdit = new Edit(this,0); SetSubEdit(m_pSubEdit); - m_pSubEdit->EnableRTL( FALSE ); + m_pSubEdit->EnableRTL( sal_False ); m_pSubEdit->SetPosPixel( Point() ); m_aFormula.SetText(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("..."))); @@ -106,7 +106,7 @@ IMPL_LINK( ConditionField, OnFormula, Button*, /*_pClickedButton*/ ) { ReportFormula aFormula( sFormula ); sFormula = aFormula.getCompleteFormula(); - } // if ( nLen ) + } uno::Reference< awt::XWindow> xInspectorWindow = VCLUnoHelper::GetInterface(this); uno::Reference< beans::XPropertySet> xProp(m_pParent->getController().getRowSet(),uno::UNO_QUERY); if ( rptui::openDialogFormula_nothrow( sFormula, m_pParent->getController().getContext(),xInspectorWindow,xProp ) ) @@ -130,7 +130,7 @@ class OColorPopup : public FloatingWindow { DECL_LINK( SelectHdl, void * ); Condition* m_pCondition; - USHORT m_nSlotId; + sal_uInt16 m_nSlotId; public: OColorPopup(Window* _pParent,Condition* _pCondition); ValueSet m_aColorSet; @@ -139,7 +139,7 @@ public: virtual void Resize(); void StartSelection(); - void SetSlotId(USHORT _nSlotId); + void SetSlotId(sal_uInt16 _nSlotId); }; // ----------------------------------------------------------------------------- OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition) @@ -205,22 +205,22 @@ void OColorPopup::StartSelection() m_aColorSet.StartSelection(); } // ----------------------------------------------------------------------------- -void OColorPopup::SetSlotId(USHORT _nSlotId) +void OColorPopup::SetSlotId(sal_uInt16 _nSlotId) { m_nSlotId = _nSlotId; if ( SID_ATTR_CHAR_COLOR_BACKGROUND == _nSlotId || SID_BACKGROUND_COLOR == _nSlotId ) { m_aColorSet.SetStyle( m_aColorSet.GetStyle() | WB_NONEFIELD ); m_aColorSet.SetText( String(ModuleRes( STR_TRANSPARENT )) ); - } // if ( SID_ATTR_CHAR_COLOR_BACKGROUND == theSlotId || SID_BACKGROUND_COLOR == theSlotId ) + } } // ----------------------------------------------------------------------------- IMPL_LINK( OColorPopup, SelectHdl, void *, EMPTYARG ) { - USHORT nItemId = m_aColorSet.GetSelectItemId(); + sal_uInt16 nItemId = m_aColorSet.GetSelectItemId(); Color aColor( nItemId == 0 ? Color( COL_TRANSPARENT ) : m_aColorSet.GetItemColor( nItemId ) ); - /* #i33380# DR 2004-09-03 Moved the following line above the Dispatch() calls. + /* #i33380# Moved the following line above the Dispatch() calls. This instance may be deleted in the meantime (i.e. when a dialog is opened while in Dispatch()), accessing members will crash in this case. */ m_aColorSet.SetNoSelection(); @@ -259,9 +259,6 @@ Condition::Condition( Window* _pParent, IConditionalFormatAction& _rAction, ::rp ,m_nLastKnownWindowWidth( -1 ) ,m_bInDestruction( false ) { - m_aMoveUp.SetModeImage( ModuleRes( IMG_MOVE_UP_HC ), BMP_COLOR_HIGHCONTRAST ); - m_aMoveDown.SetModeImage( ModuleRes( IMG_MOVE_DOWN_HC ), BMP_COLOR_HIGHCONTRAST ); - FreeResource(); m_aActions.SetStyle(m_aActions.GetStyle()|WB_LINESPACING); m_aCondLHS.GrabFocus(); @@ -331,11 +328,11 @@ Condition::~Condition() // ----------------------------------------------------------------------------- IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ ) { - USHORT nId( m_aActions.GetCurItemId() ); + sal_uInt16 nId( m_aActions.GetCurItemId() ); if ( !m_pColorFloat ) m_pColorFloat = new OColorPopup(&m_aActions,this); - USHORT nTextId = 0; + sal_uInt16 nTextId = 0; switch(nId) { case SID_ATTR_CHAR_COLOR2: @@ -346,7 +343,7 @@ IMPL_LINK( Condition, DropdownClick, ToolBox*, /*pToolBar*/ ) break; default: break; - } // switch(nId) + } if ( nTextId ) m_pColorFloat->SetText(String(ModuleRes(nTextId))); m_pColorFloat->SetSlotId(nId); @@ -379,7 +376,7 @@ IMPL_LINK( Condition, OnConditionAction, Button*, _pClickedButton ) } //------------------------------------------------------------------------------ -void Condition::ApplyCommand( USHORT _nCommandId, const ::Color& _rColor) +void Condition::ApplyCommand( sal_uInt16 _nCommandId, const ::Color& _rColor) { if ( _nCommandId == SID_ATTR_CHAR_COLOR2 ) m_pBtnUpdaterFontColor->Update( _rColor ); @@ -389,16 +386,12 @@ void Condition::ApplyCommand( USHORT _nCommandId, const ::Color& _rColor) m_rAction.applyCommand( m_nCondIndex, _nCommandId, _rColor ); } //------------------------------------------------------------------------------ -ImageList Condition::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const +ImageList Condition::getImageList(sal_Int16 _eBitmapSet) const { sal_Int16 nN = IMG_CONDFORMAT_DLG_SC; - sal_Int16 nH = IMG_CONDFORMAT_DLG_SCH; if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE ) - { nN = IMG_CONDFORMAT_DLG_LC; - nH = IMG_CONDFORMAT_DLG_LCH; - } - return ImageList(ModuleRes( _bHiContast ? nH : nN )); + return ImageList(ModuleRes(nN)); } //------------------------------------------------------------------ void Condition::resizeControls(const Size& _rDiff) @@ -406,7 +399,6 @@ void Condition::resizeControls(const Size& _rDiff) // we use large images so we must change them if ( _rDiff.Width() || _rDiff.Height() ) { - Point aPos = LogicToPixel( Point( 2*RELATED_CONTROLS , 0), MAP_APPFONT ); Invalidate(); } } @@ -434,7 +426,6 @@ void Condition::StateChanged( StateChangedType nType ) { // The physical toolbar changed its outlook and shows another logical toolbar! // We have to set the correct high contrast mode on the new tbx manager. - // pMgr->SetHiContrast( IsHiContrastMode() ); checkImageList(); } } @@ -632,8 +623,8 @@ void Condition::impl_setCondition( const ::rtl::OUString& _rConditionFormula ) } // update UI - m_aConditionType.SelectEntryPos( (USHORT)eType ); - m_aOperationList.SelectEntryPos( (USHORT)eOperation ); + m_aConditionType.SelectEntryPos( (sal_uInt16)eType ); + m_aOperationList.SelectEntryPos( (sal_uInt16)eOperation ); m_aCondLHS.SetText( sLHS ); m_aCondRHS.SetText( sRHS ); @@ -668,10 +659,10 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat OSL_ENSURE(_xReportControlFormat.is(),"XReportControlFormat is NULL!"); if ( _xReportControlFormat.is() ) { - USHORT nItemCount = m_aActions.GetItemCount(); - for (USHORT j = 0; j< nItemCount; ++j) + sal_uInt16 nItemCount = m_aActions.GetItemCount(); + for (sal_uInt16 j = 0; j< nItemCount; ++j) { - USHORT nItemId = m_aActions.GetItemId(j); + sal_uInt16 nItemId = m_aActions.GetItemId(j); m_aActions.CheckItem( nItemId, m_rController.isFormatCommandEnabled( nItemId, _xReportControlFormat ) ); } diff --git a/reportdesign/source/ui/dlg/Condition.hxx b/reportdesign/source/ui/dlg/Condition.hxx index d382722ba818..aa34d461fc46 100644 --- a/reportdesign/source/ui/dlg/Condition.hxx +++ b/reportdesign/source/ui/dlg/Condition.hxx @@ -113,10 +113,8 @@ namespace rptui /** will be called when the id of the image list is needed. @param _eBitmapSet <svtools/imgdef.hxx> - @param _bHiContast - <TRUE/> when in high contrast mode. */ - virtual ImageList getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const; + virtual ImageList getImageList(sal_Int16 _eBitmapSet) const; /** will be called when the controls need to be resized. */ @@ -149,7 +147,7 @@ namespace rptui /** forward to the parent class */ - void ApplyCommand(USHORT _nCommandId, const ::Color& _aColor ); + void ApplyCommand(sal_uInt16 _nCommandId, const ::Color& _aColor ); inline ::rptui::OReportController& getController() const { return m_rController; } diff --git a/reportdesign/source/ui/dlg/DateTime.cxx b/reportdesign/source/ui/dlg/DateTime.cxx index b70e49140d2e..4a817deab842 100644 --- a/reportdesign/source/ui/dlg/DateTime.cxx +++ b/reportdesign/source/ui/dlg/DateTime.cxx @@ -241,12 +241,10 @@ sal_Int32 ODateTimeDialog::getFormatKey(sal_Bool _bDate) const sal_Int32 nFormatKey; if ( _bDate ) { - // nFormat = m_aDateF1.IsChecked() ? i18n::NumberFormatIndex::DATE_SYSTEM_LONG : (m_aDateF2.IsChecked() ? i18n::NumberFormatIndex::DATE_SYS_DMMMYYYY : i18n::NumberFormatIndex::DATE_SYSTEM_SHORT); nFormatKey = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(m_aDateListBox.GetEntryData( m_aDateListBox.GetSelectEntryPos() ))); } else { - // nFormat = m_aTimeF1.IsChecked() ? i18n::NumberFormatIndex::TIME_HHMMSS : (m_aTimeF2.IsChecked() ? i18n::NumberFormatIndex::TIME_HHMMSSAMPM : i18n::NumberFormatIndex::TIME_HHMM); nFormatKey = static_cast<sal_Int32>(reinterpret_cast<sal_IntPtr>(m_aTimeListBox.GetEntryData( m_aTimeListBox.GetSelectEntryPos() ))); } return nFormatKey; diff --git a/reportdesign/source/ui/dlg/DateTime.src b/reportdesign/source/ui/dlg/DateTime.src index 0e30747fb78c..e9378da1725c 100644 --- a/reportdesign/source/ui/dlg/DateTime.src +++ b/reportdesign/source/ui/dlg/DateTime.src @@ -47,6 +47,7 @@ ModalDialog RID_DATETIME_DLG CheckBox CB_DATE { + HelpID = "reportdesign:CheckBox:RID_DATETIME_DLG:CB_DATE"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS , RELATED_CONTROLS /* + UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT */) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ; Check = TRUE; @@ -62,6 +63,7 @@ ModalDialog RID_DATETIME_DLG ListBox LB_DATE_TYPE { + HelpID = "reportdesign:ListBox:RID_DATETIME_DLG:LB_DATE_TYPE"; Pos = MAP_APPFONT ( 2 * UNRELATED_CONTROLS + BUTTON_WIDTH, RELATED_CONTROLS + UNRELATED_CONTROLS + CHECKBOX_HEIGHT) ; Size = MAP_APPFONT( PAGE_WIDTH - 3*UNRELATED_CONTROLS - BUTTON_WIDTH, 60 ); Border = TRUE; @@ -74,10 +76,11 @@ ModalDialog RID_DATETIME_DLG { Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS + 2*UNRELATED_CONTROLS + CHECKBOX_HEIGHT + LISTBOX_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ; - // Text [ en-US ] = "Time"; }; + CheckBox CB_TIME { + HelpID = "reportdesign:CheckBox:RID_DATETIME_DLG:CB_TIME"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS, RELATED_CONTROLS + 3*UNRELATED_CONTROLS + CHECKBOX_HEIGHT + LISTBOX_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS, FIXEDTEXT_HEIGHT ) ; Check = TRUE; @@ -93,6 +96,7 @@ ModalDialog RID_DATETIME_DLG ListBox LB_TIME_TYPE { + HelpID = "reportdesign:ListBox:RID_DATETIME_DLG:LB_TIME_TYPE"; Pos = MAP_APPFONT ( 2 * UNRELATED_CONTROLS + BUTTON_WIDTH, RELATED_CONTROLS + 4*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + LISTBOX_HEIGHT) ; Size = MAP_APPFONT( PAGE_WIDTH - 3*UNRELATED_CONTROLS - BUTTON_WIDTH, 60 ); Border = TRUE; @@ -100,11 +104,13 @@ ModalDialog RID_DATETIME_DLG TabStop = TRUE; Sort = FALSE; }; + FixedLine FL_SEPARATOR1 { Pos = MAP_APPFONT ( RELATED_CONTROLS , RELATED_CONTROLS + 5*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , 1 ) ; }; + OKButton PB_OK { Pos = MAP_APPFONT ( UNRELATED_CONTROLS, RELATED_CONTROLS + 6*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_HEIGHT +1) ; @@ -112,12 +118,14 @@ ModalDialog RID_DATETIME_DLG TabStop = TRUE ; DefButton = TRUE ; }; + CancelButton PB_CANCEL { Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + BUTTON_WIDTH , RELATED_CONTROLS + 6*UNRELATED_CONTROLS + 2*CHECKBOX_HEIGHT + 2*LISTBOX_HEIGHT +1) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; TabStop = TRUE ; }; + HelpButton PB_HELP { TabStop = TRUE ; diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx index c199f8c3f7c3..f86c2cec1521 100644 --- a/reportdesign/source/ui/dlg/Formula.cxx +++ b/reportdesign/source/ui/dlg/Formula.cxx @@ -100,7 +100,7 @@ FormulaDialog::~FormulaDialog() { if ( m_pAddField ) { - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( HID_RPT_FIELD_SEL_WIN ) ); + SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( HID_RPT_FIELD_SEL_WIN ) ); aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pAddField->GetWindowState((WINDOWSTATE_MASK_X | WINDOWSTATE_MASK_Y | WINDOWSTATE_MASK_STATE | WINDOWSTATE_MASK_MINIMIZED)).GetBuffer() ) ); ::std::auto_ptr<Window> aTemp2(m_pAddField); @@ -116,7 +116,7 @@ bool FormulaDialog::calculateValue( const String& rStrExp, String& rStrResult ) rStrResult = rStrExp; return false; } -void FormulaDialog::doClose(BOOL _bOk) +void FormulaDialog::doClose(sal_Bool _bOk) { EndDialog(_bOk ? RET_OK : RET_CANCEL); } @@ -126,10 +126,10 @@ void FormulaDialog::insertEntryToLRUList(const IFunctionDescription* /*_pDesc void FormulaDialog::showReference(const String& /*_sFormula*/) { } -void FormulaDialog::dispatch(BOOL /*_bOK*/,BOOL /*_bMartixChecked*/) +void FormulaDialog::dispatch(sal_Bool /*_bOK*/,sal_Bool /*_bMartixChecked*/) { } -void FormulaDialog::setDispatcherLock( BOOL /*bLock*/ ) +void FormulaDialog::setDispatcherLock( sal_Bool /*bLock*/ ) { } void FormulaDialog::setReferenceInput(const FormEditData* /*_pData*/) @@ -189,7 +189,7 @@ void FormulaDialog::ShowReference(const String& /*_sRef*/) { } // ----------------------------------------------------------------------------- -void FormulaDialog::HideReference( BOOL /*bDoneRefMode*/) +void FormulaDialog::HideReference( sal_Bool /*bDoneRefMode*/) { } // ----------------------------------------------------------------------------- @@ -210,7 +210,7 @@ void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton) { m_pAddField = new OAddFieldWindow(this,m_xRowSet); m_pAddField->SetCreateHdl(LINK( this, FormulaDialog, OnClickHdl ) ); - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( HID_RPT_FIELD_SEL_WIN ) ); + SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( HID_RPT_FIELD_SEL_WIN ) ); if ( aDlgOpt.Exists() ) { m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); @@ -218,7 +218,7 @@ void FormulaDialog::ToggleCollapsed( RefEdit* _pEdit, RefButton* _pButton) } m_pAddField->Update(); - } // if ( !m_pAddField ) + } RefInputStartAfter( aPair.second, aPair.first ); m_pAddField->Show(); @@ -240,10 +240,10 @@ IMPL_LINK( FormulaDialog, OnClickHdl, OAddFieldWindow* ,_pAddFieldDlg) sName = ::rtl::OUString (RTL_CONSTASCII_USTRINGPARAM("[")) + sName + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("]")); m_pEdit->SetText(sName); } - } // if ( m_pEdit && aArgs.getLength() ) + } m_pEdit = NULL; _pAddFieldDlg->Hide(); - RefInputDoneAfter( TRUE ); + RefInputDoneAfter( sal_True ); return 0L; } diff --git a/reportdesign/source/ui/dlg/GroupExchange.cxx b/reportdesign/source/ui/dlg/GroupExchange.cxx index efa70b6b7e61..7f6720fd68ec 100644 --- a/reportdesign/source/ui/dlg/GroupExchange.cxx +++ b/reportdesign/source/ui/dlg/GroupExchange.cxx @@ -61,7 +61,7 @@ namespace rptui // ----------------------------------------------------------------------------- sal_Bool OGroupExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { - ULONG nFormat = SotExchange::GetFormat(rFlavor); + sal_uLong nFormat = SotExchange::GetFormat(rFlavor); if(nFormat == OGroupExchange::getReportGroupId() ) { return SetAny(uno::makeAny(m_aGroupRow),rFlavor); diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index f2334687e4f3..f8470a6b6002 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -103,14 +103,13 @@ class OFieldExpressionControl : public TContainerListenerBase ::svt::ComboBoxControl* m_pComboCell; sal_Int32 m_nDataPos; sal_Int32 m_nCurrentPos; - ULONG m_nPasteEvent; - ULONG m_nDeleteEvent; + sal_uLong m_nPasteEvent; + sal_uLong m_nDeleteEvent; OGroupsSortingDialog* m_pParent; bool m_bIgnoreEvent; - - void fillListBox(const uno::Reference< beans::XPropertySet>& _xDest,long nRow,USHORT nColumnId); - BOOL SaveModified(bool _bAppend); + void fillListBox(const uno::Reference< beans::XPropertySet>& _xDest,long nRow,sal_uInt16 nColumnId); + sal_Bool SaveModified(bool _bAppend); OFieldExpressionControl(const OFieldExpressionControl&); // NO COPY void operator =(const OFieldExpressionControl&); // NO ASSIGN @@ -137,7 +136,6 @@ public: inline ::svt::ComboBoxControl* getExpressionControl() const { return m_pComboCell; } - /** returns the sequence with the selected groups */ uno::Sequence<uno::Any> fillSelectedGroups(); @@ -146,18 +144,17 @@ public: */ void moveGroups(const uno::Sequence<uno::Any>& _aGroups,sal_Int32 _nRow,sal_Bool _bSelect = sal_True); - virtual BOOL CursorMoving(long nNewRow, USHORT nNewCol); + virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol); using OFieldExpressionControl_Base::GetRowCount; protected: - 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 RowStatus GetRowStatus(long nRow) const; virtual void KeyInput(const KeyEvent& rEvt); @@ -246,12 +243,12 @@ uno::Sequence<uno::Any> OFieldExpressionControl::fillSelectedGroups() } catch(uno::Exception&) { - OSL_ENSURE(0,"Can not access group!"); + OSL_FAIL("Can not access group!"); } } if ( !vClipboardList.empty() ) aList = uno::Sequence< uno::Any >(&vClipboardList[0], vClipboardList.size()); - } // if ( nCount > 1 ) + } return aList; } //------------------------------------------------------------------------------ @@ -267,7 +264,7 @@ void OFieldExpressionControl::StartDrag( sal_Int8 /*_nAction*/ , const Point& /* OGroupExchange* pData = new OGroupExchange(aClipboardList); uno::Reference< ::com::sun::star::datatransfer::XTransferable> xRef = pData; pData->StartDrag(this, DND_ACTION_MOVE ); - } // if(!vClipboardList.empty()) + } } } //------------------------------------------------------------------------------ @@ -277,7 +274,7 @@ sal_Int8 OFieldExpressionControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt sal_Int8 nAction = DND_ACTION_NONE; if ( IsEditing() ) { - USHORT nPos = m_pComboCell->GetSelectEntryPos(); + sal_uInt16 nPos = m_pComboCell->GetSelectEntryPos(); if ( COMBOBOX_ENTRY_NOTFOUND != nPos || m_pComboCell->GetText().Len() ) SaveModified(); DeactivateCell(); @@ -318,8 +315,8 @@ void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups m_bIgnoreEvent = true; { sal_Int32 nRow = _nRow; - String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP)); - UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction); + const String sUndoAction(ModuleRes(RID_STR_UNDO_MOVE_GROUP)); + const UndoContext aUndoContext( m_pParent->m_pController->getUndoManager(), sUndoAction ); uno::Reference< report::XGroups> xGroups = m_pParent->getGroups(); const uno::Any* pIter = _aGroups.getConstArray(); @@ -344,11 +341,11 @@ void OFieldExpressionControl::moveGroups(const uno::Sequence<uno::Any>& _aGroups m_pParent->m_pController->executeChecked(SID_GROUP_APPEND,aArgs); ++nRow; } - } // for(;pIter != pEnd;++pIter) + } } m_bIgnoreEvent = false; Invalidate(); - } // if ( _aGroups.getLength() ) + } } // ----------------------------------------------------------------------------- void OFieldExpressionControl::fillColumns(const uno::Reference< container::XNameAccess>& _xColumns) @@ -378,7 +375,7 @@ void OFieldExpressionControl::lateInit() aFont.SetWeight( WEIGHT_LIGHT ); SetFont(aFont); - InsertHandleColumn(static_cast<USHORT>(GetTextWidth('0') * 4)/*, TRUE */); + InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth('0') * 4)/*, sal_True */); InsertDataColumn( FIELD_EXPRESSION, String(ModuleRes(STR_RPT_EXPRESSION)), 100); m_pComboCell = new ComboBoxControl( &GetDataWindow() ); @@ -405,7 +402,7 @@ void OFieldExpressionControl::lateInit() // not the first call RowRemoved(0, GetRowCount()); - RowInserted(0, m_aGroupPositions.size(), TRUE); + RowInserted(0, m_aGroupPositions.size(), sal_True); } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- @@ -431,19 +428,19 @@ IMPL_LINK(OFieldExpressionControl, AsynchDeactivate, void*, EMPTYARG) } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::IsTabAllowed(BOOL /*bForward*/) const +sal_Bool OFieldExpressionControl::IsTabAllowed(sal_Bool /*bForward*/) const { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); - return FALSE; + return sal_False; } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::SaveModified() +sal_Bool OFieldExpressionControl::SaveModified() { return SaveModified(true); } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) +sal_Bool OFieldExpressionControl::SaveModified(bool _bAppendRow) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); sal_Int32 nRow = GetCurRow(); @@ -457,7 +454,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) { bAppend = sal_True; String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP)); - m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() ); + m_pParent->m_pController->getUndoManager().EnterListAction( sUndoAction, String() ); xGroup = m_pParent->getGroups()->createGroup(); xGroup->setHeaderOn(sal_True); @@ -488,7 +485,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) xGroup = m_pParent->getGroup(m_aGroupPositions[nRow]); if ( xGroup.is() ) { - USHORT nPos = m_pComboCell->GetSelectEntryPos(); + sal_uInt16 nPos = m_pComboCell->GetSelectEntryPos(); ::rtl::OUString sExpression; if ( COMBOBOX_ENTRY_NOTFOUND == nPos ) sExpression = m_pComboCell->GetText(); @@ -501,7 +498,7 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) ::rptui::adjustSectionName(xGroup,nPos); if ( bAppend ) - m_pParent->m_pController->getUndoMgr()->LeaveListAction(); + m_pParent->m_pController->getUndoManager().LeaveListAction(); } if ( Controller() ) @@ -517,14 +514,14 @@ BOOL OFieldExpressionControl::SaveModified(bool _bAppendRow) } catch(uno::Exception&) { - OSL_ENSURE(0,"OFieldExpressionControl::SaveModified: Exception caught!"); + OSL_FAIL("OFieldExpressionControl::SaveModified: Exception caught!"); } } - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ -String OFieldExpressionControl::GetCellText( long nRow, USHORT /*nColId*/ ) const +String OFieldExpressionControl::GetCellText( long nRow, sal_uInt16 /*nColId*/ ) const { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); String sText; @@ -548,14 +545,14 @@ String OFieldExpressionControl::GetCellText( long nRow, USHORT /*nColId*/ ) cons } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught while getting expression value from the group"); + OSL_FAIL("Exception caught while getting expression value from the group"); } - } // if ( nRow != BROWSER_ENDOFSELECTION && nRow < m_pParent->getGroups()->getCount() ) + } return sText; } //------------------------------------------------------------------------------ -void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId ) +void OFieldExpressionControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); @@ -578,7 +575,7 @@ sal_Bool OFieldExpressionControl::CursorMoving(long nNewRow, sal_uInt16 nNewCol) return sal_True; } //------------------------------------------------------------------------------ -CellController* OFieldExpressionControl::GetController( long /*nRow*/, USHORT /*nColumnId*/ ) +CellController* OFieldExpressionControl::GetController( long /*nRow*/, sal_uInt16 /*nColumnId*/ ) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); ComboBoxCellController* pCellController = new ComboBoxCellController( m_pComboCell ); @@ -587,17 +584,17 @@ CellController* OFieldExpressionControl::GetController( long /*nRow*/, USHORT /* } //------------------------------------------------------------------------------ -BOOL OFieldExpressionControl::SeekRow( long _nRow ) +sal_Bool OFieldExpressionControl::SeekRow( long _nRow ) { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); // die Basisklasse braucht den Aufruf, da sie sich dort merkt, welche Zeile gepainted wird EditBrowseBox::SeekRow(_nRow); m_nCurrentPos = _nRow; - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ -void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const +void OFieldExpressionControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS( rpt_OFieldExpressionControl,NULL); String aText =const_cast< OFieldExpressionControl*>(this)->GetCellText( m_nCurrentPos, nColumnId ); @@ -629,7 +626,7 @@ EditBrowseBox::RowStatus OFieldExpressionControl::GetRowStatus(long nRow) const } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception cathced while try to get a group!"); + OSL_FAIL("Exception cathced while try to get a group!"); } } return EditBrowseBox::CLEAN; @@ -676,13 +673,6 @@ void SAL_CALL OFieldExpressionControl::elementInserted(const container::Containe for(++aFind;aFind != aEnd;++aFind) if ( *aFind != NO_GROUP ) ++*aFind; - - //::std::vector<sal_Int32>::reverse_iterator aRIter = m_aGroupPositions.rbegin(); - //::std::vector<sal_Int32>::reverse_iterator aREnd = m_aGroupPositions.rend(); - //for (; aRIter != aREnd && *aRIter != NO_GROUP; ++aRIter) - // continue; - //if ( aRIter != aREnd ) - // m_aGroupPositions.erase(m_aGroupPositions.begin() + (m_aGroupPositions.size() - 1 - (aRIter - m_aGroupPositions.rbegin()))); } } Invalidate(); @@ -712,7 +702,6 @@ void SAL_CALL OFieldExpressionControl::elementRemoved(const container::Container for(++aFind;aFind != aEnd;++aFind) if ( *aFind != NO_GROUP ) --*aFind; - //PaintCell(*this,GetFieldRect(FIELD_EXPRESSION),FIELD_EXPRESSION); Invalidate(); } } @@ -750,11 +739,10 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) return; } - USHORT nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); + sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); if ( nColId == HANDLE_ID ) { - //long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); PopupMenu aContextMenu(ModuleRes(RID_GROUPSROWPOPUPMENU)); sal_Bool bEnable = sal_False; long nIndex = FirstSelectedRow(); @@ -764,10 +752,6 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) bEnable = sal_True; nIndex = NextSelectedRow(); } - //aContextMenu.EnableItem( SID_CUT, IsDeleteAllowed() && bEnable); - //aContextMenu.EnableItem( SID_COPY, bEnable); - //TransferableDataHelper aTransferData(TransferableDataHelper::CreateFromSystemClipboard(GetParent())); - //aContextMenu.EnableItem( SID_PASTE, aTransferData.HasFormat(SOT_FORMATSTR_ID_RPT_GRPED) ); aContextMenu.EnableItem( SID_DELETE, IsDeleteAllowed() && bEnable ); switch (aContextMenu.Execute(this, rEvt.GetMousePosPixel())) { @@ -789,7 +773,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) default: break; } - } // if ( nColId == HANDLE_ID ) + } // run through } default: @@ -826,7 +810,7 @@ void OFieldExpressionControl::DeleteRows() { bFirstTime = false; String sUndoAction(ModuleRes(RID_STR_UNDO_REMOVE_SELECTION)); - m_pParent->m_pController->getUndoMgr()->EnterListAction( sUndoAction, String() ); + m_pParent->m_pController->getUndoManager().EnterListAction( sUndoAction, String() ); } sal_Int32 nGroupPos = m_aGroupPositions[nIndex]; @@ -843,10 +827,10 @@ void OFieldExpressionControl::DeleteRows() --*aFind; } nIndex = NextSelectedRow(); - } // while( nIndex >= 0 ) + } if ( !bFirstTime ) - m_pParent->m_pController->getUndoMgr()->LeaveListAction(); + m_pParent->m_pController->getUndoManager().LeaveListAction(); m_nDataPos = GetCurRow(); InvalidateStatusCell( nOldDataPos ); @@ -932,8 +916,8 @@ void OFieldExpressionControl::InsertRows( long nRow ) { m_bIgnoreEvent = false; { - String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP)); - UndoManagerListAction aListAction(*m_pParent->m_pController->getUndoMgr(),sUndoAction); + const String sUndoAction(ModuleRes(RID_STR_UNDO_APPEND_GROUP)); + const UndoContext aUndoContext( m_pParent->m_pController->getUndoManager(), sUndoAction ); uno::Reference<report::XGroups> xGroups = m_pParent->getGroups(); sal_Int32 nGroupPos = 0; @@ -985,11 +969,6 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent ,OPropertyChangeListener(m_aMutex) ,m_aFL2(this, ModuleRes(FL_SEPARATOR2) ) ,m_aMove(this, ModuleRes(FT_MOVELABEL) ) -/* - ,m_aPB_Up(this, ModuleRes(PB_UP) ) - ,m_aPB_Down(this, ModuleRes(PB_DOWN) ) - ,m_aPB_Delete(this, ModuleRes(PB_DELETE) ) -*/ ,m_aToolBox(this, ModuleRes(TB_TOOLBOX) ) ,m_aFL3(this, ModuleRes(FL_SEPARATOR3) ) @@ -1015,14 +994,13 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent { DBG_CTOR( rpt_OGroupsSortingDialog,NULL); - Control* pControlsLst[] = { &m_aHeaderLst, &m_aFooterLst, &m_aGroupOnLst, &m_aKeepTogetherLst, &m_aOrderLst, &m_aGroupIntervalEd}; for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst); ++i) { pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot)); pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost)); - pControlsLst[i]->Show(TRUE); - } // for (int i = 0; i < SAL_N_ELEMENTS(pControls); ++i) + pControlsLst[i]->Show(sal_True); + } for (size_t i = 0; i < (SAL_N_ELEMENTS(pControlsLst))-1; ++i) static_cast<ListBox*>(pControlsLst[i])->SetSelectHdl(LINK(this,OGroupsSortingDialog,LBChangeHdl)); @@ -1036,7 +1014,7 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i) { - pControls[i]->Show(TRUE); + pControls[i]->Show(sal_True); String sText = pControls[i]->GetText(); if ( aMnemonicGenerator.CreateMnemonic(sText) ) pControls[i]->SetText(sText); @@ -1049,7 +1027,6 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent Size aOutSize(nMaxTextWidth + m_aHeader.GetSizePixel().Width() + 3*aSpace.Width(),aSpace.Height()); SetMinOutputSizePixel(aOutSize); SetOutputSizePixel(aOutSize); -// Resize(); m_pReportListener = new OPropertyChangeMultiplexer(this,m_pController->getReportDefinition().get()); m_pReportListener->addProperty(PROPERTY_COMMAND); @@ -1059,20 +1036,11 @@ OGroupsSortingDialog::OGroupsSortingDialog( Window* _pParent fillColumns(); m_pFieldExpression->Show(); - //m_aHelpWindow.SetReadOnly(); m_aHelpWindow.SetControlBackground( GetSettings().GetStyleSettings().GetFaceColor() ); - //BTN m_aPB_Up.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl)); - //BTN m_aPB_Down.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl)); - //BTN m_aPB_Delete.SetClickHdl(LINK(this,OGroupsSortingDialog,ClickHdl)); m_pFieldExpression->SetZOrder(&m_aFL2, WINDOW_ZORDER_BEHIND); m_aMove.SetZOrder(m_pFieldExpression, WINDOW_ZORDER_BEHIND); - //BTN m_aPB_Up.SetZOrder(&m_aMove, WINDOW_ZORDER_BEHIND); - //BTN m_aPB_Down.SetZOrder(&m_aPB_Up, WINDOW_ZORDER_BEHIND); - // set Hi contrast bitmaps - //BTN m_aPB_Up.SetModeImage( ModuleRes(IMG_UP_H),BMP_COLOR_HIGHCONTRAST); - //BTN m_aPB_Down.SetModeImage( ModuleRes(IMG_DOWN_H),BMP_COLOR_HIGHCONTRAST); m_aToolBox.SetStyle(m_aToolBox.GetStyle()|WB_LINESPACING); m_aToolBox.SetSelectHdl(LINK(this, OGroupsSortingDialog, OnFormatAction)); m_aToolBox.SetImageListProvider(this); @@ -1195,7 +1163,7 @@ sal_Int32 OGroupsSortingDialog::getColumnDataType(const ::rtl::OUString& _sColum } catch(uno::Exception&) { - OSL_ENSURE(0,"Eception caught while getting the type of a column"); + OSL_FAIL("Eception caught while getting the type of a column"); } return nDataType; @@ -1216,7 +1184,7 @@ IMPL_LINK(OGroupsSortingDialog, OnControlFocusGot, Control*, pControl ) NumericField* pNumericField = dynamic_cast< NumericField* >( pControl ); if ( pNumericField ) pNumericField->SaveValue(); - showHelpText(static_cast<USHORT>(i+STR_RPT_HELP_FIELD)); + showHelpText(static_cast<sal_uInt16>(i+STR_RPT_HELP_FIELD)); break; } } @@ -1235,11 +1203,10 @@ IMPL_LINK(OGroupsSortingDialog, OnControlFocusLost, Control*, pControl ) } // ----------------------------------------------------------------------------- IMPL_LINK( OGroupsSortingDialog, OnFormatAction, ToolBox*, /*NOTINTERESTEDIN*/ ) -// IMPL_LINK( OGroupsSortingDialog, ClickHdl, ImageButton*, _pButton ) { DBG_CHKTHIS( rpt_OGroupsSortingDialog,NULL); - USHORT nCommand = m_aToolBox.GetCurItemId(); + sal_uInt16 nCommand = m_aToolBox.GetCurItemId(); if ( m_pFieldExpression ) { @@ -1251,22 +1218,17 @@ IMPL_LINK( OGroupsSortingDialog, OnFormatAction, ToolBox*, /*NOTINTERESTEDIN*/ ) aClipboardList.realloc(1); aClipboardList[0] = m_xGroups->getByIndex(nGroupPos); } - //BTN if ( _pButton == &m_aPB_Up ) if ( nCommand == SID_RPT_GROUPSORT_MOVE_UP ) { --nIndex; } - //BTN if ( _pButton == &m_aPB_Down ) if ( nCommand == SID_RPT_GROUPSORT_MOVE_DOWN ) { ++nIndex; } - //BTN if ( _pButton == &m_aPB_Delete ) if ( nCommand == SID_RPT_GROUPSORT_DELETE ) { - // m_pFieldExpression->DeleteCurrentRow(); Application::PostUserEvent( LINK(m_pFieldExpression, OFieldExpressionControl, DelayedDelete) ); - // UpdateData( ); } else { @@ -1276,7 +1238,6 @@ IMPL_LINK( OGroupsSortingDialog, OnFormatAction, ToolBox*, /*NOTINTERESTEDIN*/ ) m_pFieldExpression->moveGroups(aClipboardList,nIndex,sal_False); m_pFieldExpression->DeactivateCell(); m_pFieldExpression->GoToRow(nIndex); - //long nCurRow = m_pFieldExpression->GetCurRow(); m_pFieldExpression->ActivateCell(nIndex, m_pFieldExpression->GetCurColumnId()); DisplayData(nIndex); } @@ -1320,7 +1281,7 @@ IMPL_LINK( OGroupsSortingDialog, LBChangeHdl, ListBox*, pListBox ) return 1L; } // ----------------------------------------------------------------------------- -void OGroupsSortingDialog::showHelpText(USHORT _nResId) +void OGroupsSortingDialog::showHelpText(sal_uInt16 _nResId) { m_aHelpWindow.SetText(String(ModuleRes(_nResId))); } @@ -1364,8 +1325,8 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x case sdbc::DataType::TIME: case sdbc::DataType::TIMESTAMP: { - USHORT nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE }; - for (USHORT i = 0; i < SAL_N_ELEMENTS(nIds); ++i) + sal_uInt16 nIds[] = { STR_RPT_YEAR, STR_RPT_QUARTER,STR_RPT_MONTH,STR_RPT_WEEK,STR_RPT_DAY,STR_RPT_HOUR,STR_RPT_MINUTE }; + for (sal_uInt16 i = 0; i < SAL_N_ELEMENTS(nIds); ++i) { m_aGroupOnLst.InsertEntry(String(ModuleRes(nIds[i]))); m_aGroupOnLst.SetEntryData(i+1,reinterpret_cast<void*>(i+2)); @@ -1376,8 +1337,8 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x m_aGroupOnLst.InsertEntry(String(ModuleRes(STR_RPT_INTERVAL))); m_aGroupOnLst.SetEntryData(1,reinterpret_cast<void*>(report::GroupOn::INTERVAL)); break; - } // switch(nDataType) - USHORT nPos = 0; + } + sal_uInt16 nPos = 0; switch(_xGroup->getGroupOn()) { case report::GroupOn::DEFAULT: @@ -1444,9 +1405,8 @@ void OGroupsSortingDialog::Resize() for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i) { nMaxTextWidth = ::std::max<sal_Int32>(static_cast<sal_Int32>(GetTextWidth(pControls[i]->GetText())),nMaxTextWidth); - } // for (int i = 0; i < SAL_N_ELEMENTS(pControls); ++i) + } - // aTotalOutputSize.Width() - m_aHeaderLst.GetSizePixel().Width() - 3*aSpace.Width() for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i) { pControls[i]->SetSizePixel(Size(nMaxTextWidth,pControls[i]->GetSizePixel().Height())); @@ -1455,20 +1415,11 @@ void OGroupsSortingDialog::Resize() aPos.Y() = pControlsLst[i]->GetPosPixel().Y(); pControlsLst[i]->SetPosSizePixel(aPos,Size(aTotalOutputSize.Width() - aPos.X() - aSpace.Width(),pControlsLst[i]->GetSizePixel().Height())); - } // for (int i = 0; i < SAL_N_ELEMENTS(pControls); ++i) + } m_aFL.SetSizePixel(Size(aTotalOutputSize.Width() - aSpace.Width(),m_aFL.GetSizePixel().Height())); m_aFL2.SetSizePixel(Size(aTotalOutputSize.Width() - aSpace.Width(),m_aFL2.GetSizePixel().Height())); m_aFL3.SetSizePixel(Size(aTotalOutputSize.Width() - aSpace.Width(),m_aFL3.GetSizePixel().Height())); - -//BTN sal_Int32 nPos = aTotalOutputSize.Width() - aSpace.Width() - m_aPB_Up.GetSizePixel().Width(); -//BTN m_aPB_Delete.SetPosPixel(Point(nPos,m_aPB_Delete.GetPosPixel().Y())); -//BTN -//BTN nPos -= (m_aPB_Up.GetSizePixel().Width() + LogicToPixel( Size( UNRELATED_CONTROLS, 0 ), MAP_APPFONT ).Width()); -//BTN m_aPB_Down.SetPosPixel(Point(nPos,m_aPB_Down.GetPosPixel().Y())); -//BTN -//BTN nPos -= (m_aPB_Up.GetSizePixel().Width() + LogicToPixel( Size( RELATED_CONTROLS, 0 ), MAP_APPFONT ).Width()); -//BTN m_aPB_Up.SetPosPixel(Point(nPos,m_aPB_Up.GetPosPixel().Y())); sal_Int32 nPos = aTotalOutputSize.Width() - aSpace.Width() - m_aToolBox.GetSizePixel().Width(); m_aToolBox.SetPosPixel(Point(nPos,m_aToolBox.GetPosPixel().Y())); @@ -1482,7 +1433,7 @@ void OGroupsSortingDialog::checkButtons(sal_Int32 _nRow) sal_Int32 nRowCount = m_pFieldExpression->GetRowCount(); sal_Bool bEnabled = nGroupCount > 1; - if (bEnabled && _nRow > 0 /* && _nRow < nGroupCount */ ) + if (bEnabled && _nRow > 0 ) { m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_UP, sal_True); } @@ -1490,7 +1441,7 @@ void OGroupsSortingDialog::checkButtons(sal_Int32 _nRow) { m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_UP, sal_False); } - if (bEnabled && _nRow < (nRowCount - 1) /* && _nRow < (nGroupCount - 1) */ ) + if (bEnabled && _nRow < (nRowCount - 1) ) { m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_DOWN, sal_True); } @@ -1498,34 +1449,25 @@ void OGroupsSortingDialog::checkButtons(sal_Int32 _nRow) { m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_DOWN, sal_False); } - //BTN m_aPB_Up.Enable(bEnable && _nRow > 0 ); - //BTN m_aPB_Down.Enable(bEnable && _nRow < (m_pFieldExpression->GetRowCount()-1) ); - // m_aToolBox.EnableItem(SID_RPT_GROUPSORT_MOVE_DOWN, bEnable && _nRow < (-1) ); sal_Int32 nGroupPos = m_pFieldExpression->getGroupPosition(_nRow); if ( nGroupPos != NO_GROUP ) { sal_Bool bEnableDelete = nGroupCount > 0; - //BTN m_aPB_Delete.Enable(bEnableDelete ); m_aToolBox.EnableItem(SID_RPT_GROUPSORT_DELETE, bEnableDelete); } else { - //BTN m_aPB_Delete.Enable( sal_False ); m_aToolBox.EnableItem(SID_RPT_GROUPSORT_DELETE, sal_False); } } -ImageList OGroupsSortingDialog::getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const +ImageList OGroupsSortingDialog::getImageList(sal_Int16 _eBitmapSet) const { sal_Int16 nN = IMG_CONDFORMAT_DLG_SC; - sal_Int16 nH = IMG_CONDFORMAT_DLG_SCH; if ( _eBitmapSet == SFX_SYMBOLS_SIZE_LARGE ) - { nN = IMG_CONDFORMAT_DLG_LC; - nH = IMG_CONDFORMAT_DLG_LCH; - } - return ImageList(ModuleRes( _bHiContast ? nH : nN )); + return ImageList(ModuleRes( nN )); } //------------------------------------------------------------------ @@ -1534,31 +1476,17 @@ void OGroupsSortingDialog::resizeControls(const Size& _rDiff) // we use large images so we must change them if ( _rDiff.Width() || _rDiff.Height() ) { - Point aPos = LogicToPixel( Point( 2*RELATED_CONTROLS , 0), MAP_APPFONT ); Invalidate(); } } //------------------------------------------------------------------ // load the images -ImageList OGroupsSortingDialog::getImageList(vcl::ImageListType _eType) SAL_THROW (( com::sun::star::lang::IllegalArgumentException )) +ImageList OGroupsSortingDialog::getImageList(vcl::ImageListType) SAL_THROW (( com::sun::star::lang::IllegalArgumentException )) { - if (_eType == vcl::HIGHCONTRAST_NO) - { - return ImageList(ModuleRes(IMGLST_GROUPSORT_DLG_SC)); - } - else if (_eType == vcl::HIGHCONTRAST_YES) - { - return ImageList(ModuleRes(IMGLST_GROUPSORT_DLG_SCH)); - } - else - { - throw com::sun::star::lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("High contrast parameter is wrong.")), NULL, 0); - } + return ImageList(ModuleRes(IMGLST_GROUPSORT_DLG_SC)); } - - // ============================================================================= } // rptui // ============================================================================= diff --git a/reportdesign/source/ui/dlg/GroupsSorting.hrc b/reportdesign/source/ui/dlg/GroupsSorting.hrc index 8dfbfd3224a4..049afa79d37b 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.hrc +++ b/reportdesign/source/ui/dlg/GroupsSorting.hrc @@ -50,18 +50,8 @@ #define PB_DOWN (21) #define FL_SEPARATOR2 (22) #define FL_SEPARATOR3 (23) -//BTN #define IMG_UP_H (24) -//BTN #define IMG_DOWN_H (25) -//BTN #define PB_DELETE (26) #define TB_TOOLBOX (27) -// #define IMG_GROUPSORT_MOVE_DOWN (28) -// #define IMG_GROUPSORT_MOVE_UP (29) -// #define IMG_GROUPSORT_DELETE (30) -// #define IMG_GROUPSORT_MOVE_DOWN_H (31) -// #define IMG_GROUPSORT_MOVE_UP_H (32) -// #define IMG_GROUPSORT_DELETE_H (33) - #define CHECKBOX_HEIGHT 8 #define FIXEDTEXT_HEIGHT 8 diff --git a/reportdesign/source/ui/dlg/GroupsSorting.src b/reportdesign/source/ui/dlg/GroupsSorting.src index 2c73fff07de4..3cb470933e26 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.src +++ b/reportdesign/source/ui/dlg/GroupsSorting.src @@ -66,57 +66,13 @@ FloatingWindow RID_GROUPS_SORTING { Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 3*UNRELATED_CONTROLS + BROWSER_HEIGHT ) ; Size = MAP_APPFONT ( FIXEDTEXT_WIDTH , FIXEDTEXT_HEIGHT ) ; -// Text [ en-US ] = "Move group" ; Text [ en-US ] = "Group actions" ; }; -// /* -// | PAGE_WIDTH | -// | /-----\ {-------\ /---------\ | -// | unreleated FT_MOVELABEL |PB_UP| unreleated |PB_DOWN| unreleated |PD_DELETE| unreleated | -// | \_____/ \_______/ \_________/ | -// -// Don't set any position here, it will be done in OGroupsSortingDialog::Resize() -// -// Find possible IMAGEBUTTON_* in rscicpx.cxx -// Symbol is vclrsc.hxx -// */ -// ImageButton PB_UP -// { -// Pos = MAP_APPFONT ( PAGE_WIDTH - 3*UNRELATED_CONTROLS - 3*14 - 2*RELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT -1 ) ; -// Size = MAP_APPFONT ( 14 , 14 ) ; -// TabStop = TRUE; -// // Symbol = IMAGEBUTTON_ARROW_UP ; // arrow up -// Symbol = IMAGEBUTTON_SPIN_UP ; // triangle up -// // Symbol = IMAGEBUTTON_FLOAT; -// }; -// -// ImageButton PB_DOWN -// { -// Pos = MAP_APPFONT ( PAGE_WIDTH - 2*UNRELATED_CONTROLS - 2*14 - 2*RELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ; -// Size = MAP_APPFONT ( 14 , 14 ) ; -// TabStop = TRUE; -// // Symbol = IMAGEBUTTON_ARROW_DOWN ; // arrow down -// // Symbol = IMAGEBUTTON_FIRST ; -// Symbol = IMAGEBUTTON_SPIN_DOWN; -// -// }; -// -// ImageButton PB_DELETE -// { -// Pos = MAP_APPFONT ( PAGE_WIDTH - UNRELATED_CONTROLS - 14, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ; -// Size = MAP_APPFONT ( 14 , 14 ) ; -// TabStop = TRUE; -// Symbol = IMAGEBUTTON_CLOSE ; -// }; - - ToolBox TB_TOOLBOX { Pos = MAP_APPFONT ( PAGE_WIDTH - 4*14 - UNRELATED_CONTROLS, 3*UNRELATED_CONTROLS + BROWSER_HEIGHT - 1 ) ; ButtonType = BUTTON_SYMBOL; -// Align = BOXALIGN_TOP; -// HelpId = HID_RPT_CONDFORMAT_TB; Customize = FALSE; ItemList = { @@ -127,7 +83,6 @@ FloatingWindow RID_GROUPS_SORTING HelpID = HID_RPT_GROUPSORT_MOVE_UP ; Text [ en-US ] = "Move up" ; Checkable = TRUE; -// Disable = TRUE; }; ToolBoxItem { @@ -136,7 +91,6 @@ FloatingWindow RID_GROUPS_SORTING HelpID = HID_RPT_GROUPSORT_MOVE_DOWN ; Text [ en-US ] = "Move down" ; Checkable = TRUE; -// Disable = TRUE; }; ToolBoxItem { @@ -145,7 +99,6 @@ FloatingWindow RID_GROUPS_SORTING HelpID = HID_RPT_GROUPSORT_DELETE ; Text [ en-US ] = "~Delete" ; Checkable = TRUE; -// Disable = TRUE; }; }; }; @@ -164,8 +117,10 @@ FloatingWindow RID_GROUPS_SORTING Hide = TRUE; Text [ en-US ] = "Sorting" ; }; + ListBox LST_ORDER { + HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING:LST_ORDER"; Border = TRUE; Pos = MAP_APPFONT(2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 4*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + FIXEDTEXT_HEIGHT - 1 ); Size = MAP_APPFONT( LISTBOX_WIDTH, 60 ); @@ -180,6 +135,7 @@ FloatingWindow RID_GROUPS_SORTING }; }; + FixedText FT_HEADER { Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 5*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 2*FIXEDTEXT_HEIGHT) ; @@ -188,8 +144,10 @@ FloatingWindow RID_GROUPS_SORTING Text [ en-US ] = "Group Header" ; }; + ListBox LST_HEADERLST { + HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING:LST_HEADERLST"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 5*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 2*FIXEDTEXT_HEIGHT -1); @@ -203,6 +161,7 @@ FloatingWindow RID_GROUPS_SORTING < "Not present" ; Default ; > ; }; }; + FixedText FT_FOOTER { Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 6*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 3*FIXEDTEXT_HEIGHT) ; @@ -211,8 +170,10 @@ FloatingWindow RID_GROUPS_SORTING Text [ en-US ] = "Group Footer" ; }; + ListBox LST_FOOTERLST { + HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING:LST_FOOTERLST"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 6*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 3*FIXEDTEXT_HEIGHT -1); @@ -226,6 +187,7 @@ FloatingWindow RID_GROUPS_SORTING < "Not present" ; Default ; > ; }; }; + FixedText FT_GROUPON { Pos = MAP_APPFONT ( UNRELATED_CONTROLS, 7*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 4*FIXEDTEXT_HEIGHT) ; @@ -234,8 +196,10 @@ FloatingWindow RID_GROUPS_SORTING Text [ en-US ] = "Group On" ; }; + ListBox LST_GROUPONLST { + HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING:LST_GROUPONLST"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH, 7*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 4*FIXEDTEXT_HEIGHT -1); @@ -248,6 +212,7 @@ FloatingWindow RID_GROUPS_SORTING < "Each Value" ; Default ; > ; }; }; + FixedText FT_GROUPINTERVAL { Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 8*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 5*FIXEDTEXT_HEIGHT) ; @@ -255,8 +220,10 @@ FloatingWindow RID_GROUPS_SORTING Hide = TRUE; Text [ en-US ] = "Group Interval" ; }; + NumericField ED_GROUPINTERVALLST { + HelpID = "reportdesign:NumericField:RID_GROUPS_SORTING:ED_GROUPINTERVALLST"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT(2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 8*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 5*FIXEDTEXT_HEIGHT -1); @@ -273,6 +240,7 @@ FloatingWindow RID_GROUPS_SORTING }; ListBox LST_KEEPTOGETHERLST { + HelpID = "reportdesign:ListBox:RID_GROUPS_SORTING:LST_KEEPTOGETHERLST"; Border = TRUE; Hide = TRUE; Pos = MAP_APPFONT(2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 9*UNRELATED_CONTROLS + BROWSER_HEIGHT + BUTTON_HEIGHT + 6*FIXEDTEXT_HEIGHT -1); @@ -302,58 +270,58 @@ FloatingWindow RID_GROUPS_SORTING WordBreak = TRUE; }; -//BTN Image IMG_UP_H -//BTN { -//BTN ImageBitmap = Bitmap { File = "arrow_move_up_hc" ; }; -//BTN }; -//BTN Image IMG_DOWN_H -//BTN { -//BTN ImageBitmap = Bitmap { File = "arrow_move_down_hc" ; }; -//BTN }; - - }; String STR_RPT_EXPRESSION { Text [ en-US ] = "Field/Expression" ; }; + String STR_RPT_SORTING { Text [ en-US ] = "Sort Order" ; }; + String STR_RPT_PREFIXCHARS { Text [ en-US ] = "Prefix Characters" ; }; + String STR_RPT_YEAR { Text [ en-US ] = "Year" ; }; + String STR_RPT_QUARTER { Text [ en-US ] = "Quarter" ; }; + String STR_RPT_MONTH { Text [ en-US ] = "Month" ; }; + String STR_RPT_WEEK { Text [ en-US ] = "Week" ; }; + String STR_RPT_DAY { Text [ en-US ] = "Day" ; }; + String STR_RPT_HOUR { Text [ en-US ] = "Hour" ; }; + String STR_RPT_MINUTE { Text [ en-US ] = "Minute" ; }; + String STR_RPT_INTERVAL { Text [ en-US ] = "Interval" ; @@ -373,42 +341,31 @@ String STR_RPT_HELP_FOOTER { Text [ en-US ] = "Display a footer for this group?" ; }; + String STR_RPT_HELP_GROUPON { Text [ en-US ] = "Select the value or range of values that starts a new group." ; }; + String STR_RPT_HELP_INTERVAL { Text [ en-US ] = "Interval or number of characters to group on." ; }; + String STR_RPT_HELP_KEEP { Text [ en-US ] = "Keep group together on one page?" ; }; + String STR_RPT_HELP_SORT { Text [ en-US ] = "Select ascending or descending sort order. Ascending means from A to Z or 0 to 9" ; }; - Menu RID_GROUPSROWPOPUPMENU { ItemList = { -/* - MenuItem - { - ITEM_EDIT_CUT - }; - MenuItem - { - ITEM_EDIT_COPY - }; - MenuItem - { - ITEM_EDIT_PASTE - }; -*/ MenuItem { ITEM_EDIT_DELETE @@ -436,61 +393,3 @@ ImageList IMGLST_GROUPSORT_DLG_SC prefix = "sc"; DEF_IL_GROUPSORT ; }; - -ImageList IMGLST_GROUPSORT_DLG_SCH -{ - DEF_MASKCOLOR; - prefix = "sch"; - DEF_IL_GROUPSORT ; -}; - - -// Image IMG_GROUPSORT_MOVEUP -// { -// ImageBitmap = Bitmap -// { -// File = "reportgroupmoveup"; // reportdesign/res/... -// }; -// DEF_MASKCOLOR; -// }; -// Image IMG_GROUPSORT_MOVEDOWN -// { -// ImageBitmap = Bitmap -// { -// File = "reportgroupmovedown"; -// }; -// DEF_MASKCOLOR; -// }; -// Image IMG_GROUPSORT_DELETE -// { -// ImageBitmap = Bitmap -// { -// File = "reportgroupdelete"; -// }; -// DEF_MASKCOLOR; -// }; -// -// Image IMG_GROUPSORT_MOVEUP_H -// { -// ImageBitmap = Bitmap -// { -// File = "reportgroupmoveup_h"; // reportdesign/res/... -// }; -// DEF_MASKCOLOR; -// }; -// Image IMG_GROUPSORT_MOVEDOWN_H -// { -// ImageBitmap = Bitmap -// { -// File = "reportgroupmovedown_h"; -// }; -// DEF_MASKCOLOR; -// }; -// Image IMG_GROUPSORT_DELETE_H -// { -// ImageBitmap = Bitmap -// { -// File = "reportgroupdelete_h"; -// }; -// DEF_MASKCOLOR; -// }; diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index cca1a5a2fbdb..072a9430d7b0 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -32,7 +32,7 @@ #include "uistrings.hrc" #include "ReportController.hxx" #include "UITools.hxx" -#include "Undo.hxx" +#include "RptUndo.hxx" #include "reportformula.hxx" #include <com/sun/star/container/XContainerListener.hpp> #include <com/sun/star/report/XReportDefinition.hpp> @@ -74,9 +74,9 @@ using namespace ::com::sun::star; using namespace utl; using namespace ::comphelper; -USHORT lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement) +sal_uInt16 lcl_getImageId(const uno::Reference< report::XReportComponent>& _xElement) { - USHORT nId = 0; + sal_uInt16 nId = 0; uno::Reference< report::XFixedLine> xFixedLine(_xElement,uno::UNO_QUERY); if ( uno::Reference< report::XFixedText>(_xElement,uno::UNO_QUERY).is() ) nId = SID_FM_FIXEDTEXT; @@ -154,7 +154,6 @@ class NavigatorTree : public ::cppu::BaseMutex AutoTimer m_aDropActionTimer; Timer m_aSynchronizeTimer; ImageList m_aNavigatorImages; - ImageList m_aNavigatorImagesHC; Point m_aTimerTriggered; // die Position, an der der DropTimer angeschaltet wurde DROP_ACTION m_aDropActionType; OReportController& m_rController; @@ -164,8 +163,8 @@ class NavigatorTree : public ::cppu::BaseMutex ::rtl::Reference< comphelper::OSelectionChangeMultiplexer> m_pSelectionListener; unsigned short m_nTimerCounter; - SvLBoxEntry* insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition,UserData* _pData); - void traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition = LIST_APPEND); + SvLBoxEntry* insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition,UserData* _pData); + void traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition = LIST_APPEND); void traverseFunctions(const uno::Reference< report::XFunctions>& _xFunctions,SvLBoxEntry* _pParent); NavigatorTree(const NavigatorTree&); @@ -244,17 +243,10 @@ NavigatorTree::NavigatorTree( Window* pParent,OReportController& _rController ) SetHelpId( HID_REPORT_NAVIGATOR_TREE ); m_aNavigatorImages = ImageList( ModuleRes( RID_SVXIMGLIST_RPTEXPL ) ); - m_aNavigatorImagesHC = ImageList( ModuleRes( RID_SVXIMGLIST_RPTEXPL_HC ) ); SetNodeBitmaps( m_aNavigatorImages.GetImage( RID_SVXIMG_COLLAPSEDNODE ), - m_aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ), - BMP_COLOR_NORMAL - ); - SetNodeBitmaps( - m_aNavigatorImagesHC.GetImage( RID_SVXIMG_COLLAPSEDNODE ), - m_aNavigatorImagesHC.GetImage( RID_SVXIMG_EXPANDEDNODE ), - BMP_COLOR_HIGHCONTRAST + m_aNavigatorImages.GetImage( RID_SVXIMG_EXPANDEDNODE ) ); SetDragDropMode(0xFFFF); @@ -318,12 +310,12 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) uno::Reference< report::XFunction>(pData->getContent(),uno::UNO_QUERY).is()); PopupMenu aContextMenu( ModuleRes( RID_MENU_NAVIGATOR ) ); - USHORT nCount = aContextMenu.GetItemCount(); - for (USHORT i = 0; i < nCount; ++i) + sal_uInt16 nCount = aContextMenu.GetItemCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { if ( MENUITEM_SEPARATOR != aContextMenu.GetItemType(i)) { - USHORT nId = aContextMenu.GetItemId(i); + sal_uInt16 nId = aContextMenu.GetItemId(i); aContextMenu.CheckItem(nId,m_rController.isCommandChecked(nId)); sal_Bool bEnabled = m_rController.isCommandEnabled(nId); @@ -335,8 +327,8 @@ void NavigatorTree::Command( const CommandEvent& rEvt ) else aContextMenu.EnableItem(nId,bEnabled); } - } // for (USHORT i = 0; i < nCount; ++i) - USHORT nId = aContextMenu.Execute(this, aWhere); + } + sal_uInt16 nId = aContextMenu.Execute(this, aWhere); if ( nId ) { uno::Sequence< beans::PropertyValue> aArgs; @@ -419,7 +411,6 @@ sal_Int8 NavigatorTree::AcceptDrop( const AcceptDropEvent& _rEvt ) // ------------------------------------------------------------------------- sal_Int8 NavigatorTree::ExecuteDrop( const ExecuteDropEvent& /*_rEvt*/ ) { - // _rEvt.mnAction; return DND_ACTION_NONE; } // ------------------------------------------------------------------------- @@ -502,7 +493,7 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) throw ( SetCurEntry(pEntry); } else if ( !pEntry ) - SelectAll(FALSE,FALSE); + SelectAll(sal_False,sal_False); } else { @@ -521,26 +512,20 @@ void NavigatorTree::_selectionChanged( const lang::EventObject& aEvent ) throw ( m_pSelectionListener->unlock(); } // ----------------------------------------------------------------------------- -SvLBoxEntry* NavigatorTree::insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition,UserData* _pData) +SvLBoxEntry* NavigatorTree::insertEntry(const ::rtl::OUString& _sName,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition,UserData* _pData) { SvLBoxEntry* pEntry = NULL; if ( _nImageId ) { const Image aImage( m_aNavigatorImages.GetImage( _nImageId ) ); - pEntry = InsertEntry(_sName,aImage,aImage,_pParent,FALSE,_nPosition,_pData); - if ( pEntry ) - { - const Image aImageHC( m_aNavigatorImagesHC.GetImage( _nImageId ) ); - SetExpandedEntryBmp( pEntry, aImageHC, BMP_COLOR_HIGHCONTRAST ); - SetCollapsedEntryBmp( pEntry, aImageHC, BMP_COLOR_HIGHCONTRAST ); - } + pEntry = InsertEntry(_sName,aImage,aImage,_pParent,sal_False,_nPosition,_pData); } else - pEntry = InsertEntry(_sName,_pParent,FALSE,_nPosition,_pData); + pEntry = InsertEntry(_sName,_pParent,sal_False,_nPosition,_pData); return pEntry; } // ----------------------------------------------------------------------------- -void NavigatorTree::traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,USHORT _nImageId,ULONG _nPosition) +void NavigatorTree::traverseSection(const uno::Reference< report::XSection>& _xSection,SvLBoxEntry* _pParent,sal_uInt16 _nImageId,sal_uLong _nPosition) { SvLBoxEntry* pSection = insertEntry(_xSection->getName(),_pParent,_nImageId,_nPosition,new UserData(this,_xSection)); const sal_Int32 nCount = _xSection->getCount(); @@ -681,7 +666,7 @@ void NavigatorTree::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) SvLBoxEntry* pParent = find(xReport); if ( _rEvent.PropertyName == PROPERTY_REPORTHEADERON ) { - ULONG nPos = xReport->getReportHeaderOn() ? 2 : 1; + sal_uLong nPos = xReport->getReportHeaderOn() ? 2 : 1; traverseSection(xReport->getReportHeader(),pParent,SID_REPORTHEADERFOOTER,nPos); } else if ( _rEvent.PropertyName == PROPERTY_PAGEHEADERON ) @@ -692,7 +677,7 @@ void NavigatorTree::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) traverseSection(xReport->getPageFooter(),pParent, SID_PAGEHEADERFOOTER); else if ( _rEvent.PropertyName == PROPERTY_REPORTFOOTERON ) { - ULONG nPos = xReport->getPageFooterOn() ? (GetLevelChildCount(pParent) - 1) : LIST_APPEND; + sal_uLong nPos = xReport->getPageFooterOn() ? (GetLevelChildCount(pParent) - 1) : LIST_APPEND; traverseSection(xReport->getReportFooter(),pParent,SID_REPORTHEADERFOOTER,nPos); } } @@ -723,7 +708,7 @@ void NavigatorTree::_elementInserted( const container::ContainerEvent& _rEvent ) uno::Reference< report::XReportComponent> xElement(xProp,uno::UNO_QUERY); if ( xProp.is() ) sName = lcl_getName(xProp); - insertEntry(sName,pEntry,(!xElement.is() ? USHORT(SID_RPT_NEW_FUNCTION) : lcl_getImageId(xElement)),LIST_APPEND,new UserData(this,xProp)); + insertEntry(sName,pEntry,(!xElement.is() ? sal_uInt16(SID_RPT_NEW_FUNCTION) : lcl_getImageId(xElement)),LIST_APPEND,new UserData(this,xProp)); } if ( !IsExpanded(pEntry) ) Expand(pEntry); @@ -852,8 +837,6 @@ void NavigatorTree::UserData::_propertyChanged(const beans::PropertyChangeEvent& ++nPos; m_pTree->traverseSection(pMemFunSection(&aGroupHelper),pEntry,bFooterOn ? SID_GROUPFOOTER : SID_GROUPHEADER,nPos); } - //else - // m_pTree->removeEntry(m_pTree->GetEntry(pEntry,nPos)); } else if ( PROPERTY_EXPRESSION == _rEvent.PropertyName) { @@ -937,10 +920,6 @@ ONavigator::ONavigator( Window* _pParent m_pImpl.reset(new ONavigatorImpl(_rController,this)); - //Size aSpace = LogicToPixel( Size( 7, 120), MAP_APPFONT ); - //Size aOutSize(nMaxTextWidth + m_aHeader.GetSizePixel().Width() + 3*aSpace.Width(),aSpace.Height()); - //SetMinOutputSizePixel(aOutSize); - //SetOutputSizePixel(aOutSize); FreeResource(); m_pImpl->m_pNavigatorTree->Show(); m_pImpl->m_pNavigatorTree->GrabFocus(); diff --git a/reportdesign/source/ui/dlg/Navigator.src b/reportdesign/source/ui/dlg/Navigator.src index 496bae3b0ab7..150c98d88343 100644 --- a/reportdesign/source/ui/dlg/Navigator.src +++ b/reportdesign/source/ui/dlg/Navigator.src @@ -88,13 +88,6 @@ ImageList RID_SVXIMGLIST_RPTEXPL NAVIGATOR_IMAGEIDS; }; -ImageList RID_SVXIMGLIST_RPTEXPL_HC -{ - Prefix = "sxh"; - MaskColor = Color { Red = 0xff00 ; Green = 0x0000 ; Blue = 0xff00 ; }; - NAVIGATOR_IMAGEIDS; -}; - String RID_STR_FUNCTIONS { Text [ en-US ] = "Functions" ; @@ -110,7 +103,6 @@ Menu RID_MENU_NAVIGATOR MenuItem { Identifier = SID_SORTINGANDGROUPING; - HelpId = SID_SORTINGANDGROUPING ; Command = ".uno:DbSortingAndGrouping"; Text [ en-US ] = "Sorting and Grouping..."; }; @@ -121,7 +113,6 @@ Menu RID_MENU_NAVIGATOR MenuItem { Identifier = SID_PAGEHEADERFOOTER; - HelpId = SID_PAGEHEADERFOOTER ; Command = ".uno:PageHeaderFooter"; Checkable = TRUE; Text [ en-US ] = "Page Header/Footer..."; @@ -129,7 +120,6 @@ Menu RID_MENU_NAVIGATOR MenuItem { Identifier = SID_REPORTHEADERFOOTER; - HelpId = SID_REPORTHEADERFOOTER ; Command = ".uno:ReportHeaderFooter"; Checkable = TRUE; Text [ en-US ] = "Report Header/Footer..."; @@ -141,7 +131,6 @@ Menu RID_MENU_NAVIGATOR MenuItem { Identifier = SID_RPT_NEW_FUNCTION; - HelpId = SID_RPT_NEW_FUNCTION; Command = ".uno:NewFunction"; Text [ en-US ] = "New Function"; }; @@ -152,7 +141,6 @@ Menu RID_MENU_NAVIGATOR MenuItem { Identifier = SID_SHOW_PROPERTYBROWSER; - HelpId = SID_SHOW_PROPERTYBROWSER ; Command = ".uno:FormProperties"; Text [ en-US ] = "Properties..."; }; diff --git a/reportdesign/source/ui/dlg/PageNumber.src b/reportdesign/source/ui/dlg/PageNumber.src index 31c5bdb4026c..c5c760e1755d 100644 --- a/reportdesign/source/ui/dlg/PageNumber.src +++ b/reportdesign/source/ui/dlg/PageNumber.src @@ -54,6 +54,7 @@ ModalDialog RID_PAGENUMBERS RadioButton RB_PAGE_N { + HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_N"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 2*RELATED_CONTROLS + FIXEDTEXT_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; Group = TRUE; @@ -62,6 +63,7 @@ ModalDialog RID_PAGENUMBERS }; RadioButton RB_PAGE_N_OF_M { + HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_N_OF_M"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 3*RELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; Text [ en-US ] = "Page N of M"; @@ -76,6 +78,7 @@ ModalDialog RID_PAGENUMBERS RadioButton RB_PAGE_TOPPAGE { + HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_TOPPAGE"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 4*RELATED_CONTROLS + UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; Group = TRUE; @@ -84,6 +87,7 @@ ModalDialog RID_PAGENUMBERS }; RadioButton RB_PAGE_BOTTOMPAGE { + HelpID = "reportdesign:RadioButton:RID_PAGENUMBERS:RB_PAGE_BOTTOMPAGE"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS + RELATED_CONTROLS, 5*RELATED_CONTROLS + UNRELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; Text [ en-US ] = "Bottom of Page (Footer)"; @@ -104,6 +108,7 @@ ModalDialog RID_PAGENUMBERS }; ListBox LST_ALIGNMENT { + HelpID = "reportdesign:ListBox:RID_PAGENUMBERS:LST_ALIGNMENT"; Border = TRUE; Pos = MAP_APPFONT( 2*UNRELATED_CONTROLS + FIXEDTEXT_WIDTH , 6*RELATED_CONTROLS + 2*UNRELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT -1); Size = MAP_APPFONT( LISTBOX_WIDTH, 60 ); @@ -121,6 +126,7 @@ ModalDialog RID_PAGENUMBERS }; CheckBox CB_SHOWNUMBERONFIRSTPAGE { + HelpID = "reportdesign:CheckBox:RID_PAGENUMBERS:CB_SHOWNUMBERONFIRSTPAGE"; Pos = MAP_APPFONT ( UNRELATED_CONTROLS , 6*RELATED_CONTROLS + 3*UNRELATED_CONTROLS + 8*FIXEDTEXT_HEIGHT) ; Size = MAP_APPFONT ( PAGE_WIDTH - 2*RELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; Check = TRUE; diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx index 383078a377f5..33547cdd3fe0 100644 --- a/reportdesign/source/ui/dlg/dlgpage.cxx +++ b/reportdesign/source/ui/dlg/dlgpage.cxx @@ -36,7 +36,7 @@ #include "dlgpage.hxx" #include "ModuleHelper.hxx" #include "RptResId.hrc" -#include <svl/intitem.hxx> //add CHINA001 +#include <svl/intitem.hxx> #include <svl/cjkoptions.hxx> #include <svl/aeitem.hxx> @@ -48,20 +48,18 @@ namespace rptui |* \************************************************************************/ -ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,USHORT _nPageId) : +ORptPageDialog::ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,sal_uInt16 _nPageId) : SfxTabDialog ( pParent, ModuleRes( _nPageId ), pAttr ), rOutAttrs ( *pAttr ) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); - DBG_ASSERT(pFact, "Dialogdiet fail!"); + OSL_ENSURE(pFact, "Dialogdiet fail!"); switch( _nPageId ) { case RID_PAGEDIALOG_BACKGROUND: AddTabPage( RID_SVXPAGE_BACKGROUND,String(ModuleRes(1))); break; case RID_PAGEDIALOG_PAGE: - //AddTabPage( RID_SVXPAGE_PAGE,String(ModuleRes(1))); - // AddTabPage( RID_SVXPAGE_BACKGROUND,String(ModuleRes(1))); AddTabPage(RID_SVXPAGE_PAGE, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), 0 ); AddTabPage(RID_SVXPAGE_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 ); break; @@ -76,11 +74,9 @@ SfxTabDialog ( pParent, ModuleRes( _nPageId ), pAttr ), break; case RID_PAGEDIALOG_LINE: AddTabPage( RID_SVXPAGE_LINE,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE ), 0 ); - //AddTabPage( RID_SVXPAGE_LINE_DEF,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINE_DEF ), 0 ); - //AddTabPage( RID_SVXPAGE_LINEEND_DEF,pFact->GetTabPageCreatorFunc( RID_SVXPAGE_LINEEND_DEF ), 0 ); break; default: - OSL_ENSURE(0,"Unknown page id"); + OSL_FAIL("Unknown page id"); } SvtCJKOptions aCJKOptions; diff --git a/reportdesign/source/ui/dlg/dlgpage.src b/reportdesign/source/ui/dlg/dlgpage.src index b8dfcd377994..dd05a94b6395 100644 --- a/reportdesign/source/ui/dlg/dlgpage.src +++ b/reportdesign/source/ui/dlg/dlgpage.src @@ -79,7 +79,6 @@ TabDialog RID_PAGEDIALOG_PAGE { Pos = MAP_APPFONT ( 169 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */ Text [ en-US ] = "Return" ; TabStop = TRUE ; }; @@ -129,7 +128,6 @@ TabDialog RID_PAGEDIALOG_BACKGROUND { Pos = MAP_APPFONT ( 169 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */ Text [ en-US ] = "Return" ; TabStop = TRUE ; Text [ x-comment ] = " "; @@ -218,7 +216,6 @@ TabDialog RID_PAGEDIALOG_CHAR { Pos = MAP_APPFONT ( 169 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */ Text [ en-US ] = "Return" ; TabStop = TRUE ; Text [ x-comment ] = " "; @@ -290,7 +287,6 @@ TabDialog RID_PAGEDIALOG_LINE { Pos = MAP_APPFONT ( 169 , 151 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; - /* ### ACHTUNG: Neuer Text in Resource? Zurück : Zur³ck */ Text [ en-US ] = "Return" ; TabStop = TRUE ; Text [ x-comment ] = " "; diff --git a/reportdesign/source/ui/inc/AddField.hxx b/reportdesign/source/ui/inc/AddField.hxx index cbfc8608d1bb..374ec169a055 100644 --- a/reportdesign/source/ui/inc/AddField.hxx +++ b/reportdesign/source/ui/inc/AddField.hxx @@ -110,10 +110,8 @@ public: /** will be called when the id of the image list is needed. @param _eBitmapSet <svtools/imgdef.hxx> - @param _bHiContast - <TRUE/> when in high contrast mode. */ - virtual ImageList getImageList(sal_Int16 _eBitmapSet,sal_Bool _bHiContast) const; + virtual ImageList getImageList(sal_Int16 _eBitmapSet) const; /** will be called when the controls need to be resized. */ diff --git a/reportdesign/source/ui/inc/ColumnInfo.hxx b/reportdesign/source/ui/inc/ColumnInfo.hxx index 215797729b1c..bdbdfd3d5f6d 100644 --- a/reportdesign/source/ui/inc/ColumnInfo.hxx +++ b/reportdesign/source/ui/inc/ColumnInfo.hxx @@ -7,9 +7,6 @@ * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: AddField.cxx,v $ - * $Revision: 1.5 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify diff --git a/reportdesign/source/ui/inc/CondFormat.hxx b/reportdesign/source/ui/inc/CondFormat.hxx index 20156d51b01d..5ccd968c6a66 100644 --- a/reportdesign/source/ui/inc/CondFormat.hxx +++ b/reportdesign/source/ui/inc/CondFormat.hxx @@ -61,7 +61,7 @@ namespace rptui public: virtual void addCondition( size_t _nAddAfterIndex ) = 0; virtual void deleteCondition( size_t _nCondIndex ) = 0; - virtual void applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ) = 0; + virtual void applyCommand( size_t _nCondIndex, sal_uInt16 _nCommandId, const ::Color _aColor ) = 0; virtual void moveConditionUp( size_t _nCondIndex ) = 0; virtual void moveConditionDown( size_t _nCondIndex ) = 0; virtual ::rtl::OUString getDataField() const = 0; @@ -110,7 +110,7 @@ namespace rptui // IConditionalFormatAction overridables virtual void addCondition( size_t _nAddAfterIndex ); virtual void deleteCondition( size_t _nCondIndex ); - virtual void applyCommand( size_t _nCondIndex, USHORT _nCommandId, const ::Color _aColor ); + virtual void applyCommand( size_t _nCondIndex, sal_uInt16 _nCommandId, const ::Color _aColor ); virtual void moveConditionUp( size_t _nCondIndex ); virtual void moveConditionDown( size_t _nCondIndex ); virtual ::rtl::OUString getDataField() const; diff --git a/reportdesign/source/ui/inc/DateTime.hxx b/reportdesign/source/ui/inc/DateTime.hxx index c73f366ea619..4d6f9a233a55 100644 --- a/reportdesign/source/ui/inc/DateTime.hxx +++ b/reportdesign/source/ui/inc/DateTime.hxx @@ -49,7 +49,6 @@ class OReportController; \************************************************************************/ class ODateTimeDialog : public ModalDialog { - // FixedLine m_aFLDate; CheckBox m_aDate; FixedText m_aFTDateFormat; ListBox m_aDateListBox; diff --git a/reportdesign/source/ui/inc/DesignView.hxx b/reportdesign/source/ui/inc/DesignView.hxx index ffe4b5f37cb1..a85f500de4df 100644 --- a/reportdesign/source/ui/inc/DesignView.hxx +++ b/reportdesign/source/ui/inc/DesignView.hxx @@ -84,14 +84,14 @@ namespace rptui Timer m_aMarkTimer; Point m_aScrollOffset; DlgEdMode m_eMode; - USHORT m_nCurrentPosition; - USHORT m_eActObj; - BOOL m_bFirstDraw; + sal_uInt16 m_nCurrentPosition; + sal_uInt16 m_eActObj; + sal_Bool m_bFirstDraw; Size m_aGridSizeCoarse; Size m_aGridSizeFine; - BOOL m_bGridVisible; - BOOL m_bGridSnap; - BOOL m_bDeleted; + sal_Bool m_bGridVisible; + sal_Bool m_bGridSnap; + sal_Bool m_bDeleted; DECL_LINK( MarkTimeout, Timer * ); @@ -126,8 +126,8 @@ namespace rptui inline OReportController& getController() const { return m_rReportController; } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); - USHORT GetInsertObj() const; + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + sal_uInt16 GetInsertObj() const; rtl::OUString GetInsertObjString() const; DlgEdMode GetMode() const { return m_eMode; } @@ -143,7 +143,7 @@ namespace rptui * * \return <TRUE/> if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -163,17 +163,17 @@ namespace rptui void SelectAll(const sal_uInt16 _nObjectType); /// checks if a selection exists - BOOL HasSelection() const; + sal_Bool HasSelection() const; void UpdatePropertyBrowserDelayed(OSectionView& _rView); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** removes the section at the given position. * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is <NULL/> nothing happens. @@ -181,13 +181,13 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); inline Size getGridSizeCoarse() const { return m_aGridSizeCoarse; } inline Size getGridSizeFine() const { return m_aGridSizeFine; } - inline BOOL isGridSnap() const { return m_bGridSnap; } - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + inline sal_Bool isGridSnap() const { return m_bGridSnap; } + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** turns the grid on or off * * \param _bGridVisible @@ -196,10 +196,10 @@ namespace rptui void togglePropertyBrowser(sal_Bool _bToogleOn); - BOOL isAddFieldVisible() const; + sal_Bool isAddFieldVisible() const; void toggleAddField(); - BOOL isReportExplorerVisible() const; + sal_Bool isReportExplorerVisible() const; void toggleReportExplorer(); /** shows or hides the ruler. diff --git a/reportdesign/source/ui/inc/FixedTextColor.hxx b/reportdesign/source/ui/inc/FixedTextColor.hxx index 7a9916e5a499..9120aa433537 100644 --- a/reportdesign/source/ui/inc/FixedTextColor.hxx +++ b/reportdesign/source/ui/inc/FixedTextColor.hxx @@ -54,8 +54,6 @@ namespace rptui void setPropertyTextColor(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer >& _xVclWindowPeer, sal_Int32 _nFormatKey); - // sal_Int32 getTextColor(); - public: FixedTextColor(const OReportController & _aObserver); virtual ~FixedTextColor(); diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx index da5471fbce52..c458ccf240e4 100644 --- a/reportdesign/source/ui/inc/Formula.hxx +++ b/reportdesign/source/ui/inc/Formula.hxx @@ -73,11 +73,11 @@ public: virtual void notifyChange(); virtual void fill(); virtual bool calculateValue(const String& _sExpression,String& _rResult); - virtual void doClose(BOOL _bOk); + virtual void doClose(sal_Bool _bOk); virtual void insertEntryToLRUList(const formula::IFunctionDescription* pDesc); virtual void showReference(const String& _sFormula); - virtual void dispatch(BOOL _bOK,BOOL _bMartixChecked); - virtual void setDispatcherLock( BOOL bLock ); + virtual void dispatch(sal_Bool _bOK,sal_Bool _bMartixChecked); + virtual void setDispatcherLock( sal_Bool bLock ); virtual void setReferenceInput(const formula::FormEditData* _pData); virtual void deleteFormData(); virtual void clear(); @@ -97,7 +97,7 @@ public: // IControlReferenceHandler virtual void ShowReference(const String& _sRef); - virtual void HideReference( BOOL bDoneRefMode = TRUE ); + virtual void HideReference( sal_Bool bDoneRefMode = sal_True ); virtual void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); virtual void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); diff --git a/reportdesign/source/ui/inc/FunctionHelper.hxx b/reportdesign/source/ui/inc/FunctionHelper.hxx index 743cd1a755b6..e59be1a5c8bf 100644 --- a/reportdesign/source/ui/inc/FunctionHelper.hxx +++ b/reportdesign/source/ui/inc/FunctionHelper.hxx @@ -79,10 +79,10 @@ public: virtual ::rtl::OUString getDescription() const ; virtual xub_StrLen getSuppressedArgumentCount() const ; virtual ::rtl::OUString getFormula(const ::std::vector< ::rtl::OUString >& _aArguments) const ; - virtual void fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const ; + virtual void fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const ; virtual void initArgumentInfo() const; virtual ::rtl::OUString getSignature() const ; - virtual long getHelpId() const ; + virtual rtl::OString getHelpId() const ; virtual sal_uInt32 getParameterCount() const ; virtual ::rtl::OUString getParameterName(sal_uInt32 _nPos) const ; virtual ::rtl::OUString getParameterDescription(sal_uInt32 _nPos) const ; diff --git a/reportdesign/source/ui/inc/GeometryHandler.hxx b/reportdesign/source/ui/inc/GeometryHandler.hxx index e6d5d51a4485..91504e7f1cb9 100644 --- a/reportdesign/source/ui/inc/GeometryHandler.hxx +++ b/reportdesign/source/ui/inc/GeometryHandler.hxx @@ -196,7 +196,7 @@ namespace rptui * \param _sQuotedFunction the quoted function name * \param _Out_rDataField the data field which is used in the function * \param _xFunctionsSupplier teh function supplier to search or empty if not used - * \param _bSet If set to TRUE than the m_sDefaultFunction and m_sScope vars will be set if successful. + * \param _bSet If set to sal_True than the m_sDefaultFunction and m_sScope vars will be set if successful. * \return sal_True with known otherwise sal_False */ sal_Bool isDefaultFunction(const ::rtl::OUString& _sQuotedFunction diff --git a/reportdesign/source/ui/inc/GroupsSorting.hxx b/reportdesign/source/ui/inc/GroupsSorting.hxx index 84178a76feaa..22f195bac07e 100644 --- a/reportdesign/source/ui/inc/GroupsSorting.hxx +++ b/reportdesign/source/ui/inc/GroupsSorting.hxx @@ -33,7 +33,7 @@ #include <vcl/lstbox.hxx> #include <vcl/edit.hxx> #include <vcl/field.hxx> -#include <vcl/imagebtn.hxx> +#include <vcl/button.hxx> #include <vcl/toolbox.hxx> #include <com/sun/star/report/XGroups.hpp> #include <com/sun/star/report/XGroup.hpp> @@ -65,18 +65,15 @@ class OReportController; \************************************************************************/ class OGroupsSortingDialog : public FloatingWindow - , public ::cppu::BaseMutex - , public ::comphelper::OPropertyChangeListener - ,public dbaui::OToolBoxHelper - ,public vcl::IImageListProvider + , public ::cppu::BaseMutex + , public ::comphelper::OPropertyChangeListener + , public dbaui::OToolBoxHelper + , public vcl::IImageListProvider { friend class OFieldExpressionControl; FixedLine m_aFL2; FixedText m_aMove; -//BTN ImageButton m_aPB_Up; -//BTN ImageButton m_aPB_Down; -//BTN ImageButton m_aPB_Delete; ToolBox m_aToolBox; FixedLine m_aFL3; @@ -106,7 +103,6 @@ private: DECL_LINK( OnControlFocusLost, Control* ); DECL_LINK( OnControlFocusGot, Control* ); DECL_LINK( LBChangeHdl, ListBox* ); -//BTN DECL_LINK( ClickHdl, ImageButton* ); DECL_LINK( OnFormatAction, ToolBox* ); /** returns the groups @@ -142,7 +138,7 @@ private: /** shows the text given by the id in the multiline edit @param _nResId the string id */ - void showHelpText(USHORT _nResId); + void showHelpText(sal_uInt16 _nResId); /** display the group props @param _xGroup the group to display */ @@ -188,10 +184,8 @@ public: /** will be called when the image list is needed. @param _eSymbolsSize <svtools/imgdef.hxx> - @param _bHiContast - <TRUE/> when in high contrast mode. */ - virtual ImageList getImageList(sal_Int16 _eSymbolsSize,sal_Bool _bHiContast) const; + virtual ImageList getImageList(sal_Int16 _eSymbolsSize) const; // ImageListProvider interface virtual ImageList getImageList(vcl::ImageListType) SAL_THROW ((com::sun::star::lang::IllegalArgumentException )); diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index c55e32cb2dd5..007b42d225fb 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -28,48 +28,52 @@ #ifndef RPTUI_REPORTCONTROLLER_HXX #define RPTUI_REPORTCONTROLLER_HXX -#include <dbaccess/singledoccontroller.hxx> -#include <com/sun/star/uno/XComponentContext.hpp> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/uno/Sequence.hxx> -#include <com/sun/star/sdbc/XConnection.hpp> -#include <com/sun/star/sdbc/XRowSet.hpp> +#include "DesignView.hxx" +#include "ModuleHelper.hxx" +#include "ReportControllerObserver.hxx" +#include "RptDef.hxx" + +/** === begin UNO includes === **/ #include <com/sun/star/beans/PropertyValue.hpp> -#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/util/XNumberFormatter.hpp> -#include <com/sun/star/io/XObjectOutputStream.hpp> -#include <com/sun/star/io/XObjectInputStream.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/embed/XVisualObject.hpp> #include <com/sun/star/frame/XComponentLoader.hpp> #include <com/sun/star/frame/XFrame.hpp> -#include <com/sun/star/report/XReportDefinition.hpp> +#include <com/sun/star/io/XObjectInputStream.hpp> +#include <com/sun/star/io/XObjectOutputStream.hpp> #include <com/sun/star/report/XReportControlModel.hpp> +#include <com/sun/star/report/XReportDefinition.hpp> #include <com/sun/star/report/XReportEngine.hpp> #include <com/sun/star/report/XSection.hpp> +#include <com/sun/star/sdbc/XConnection.hpp> +#include <com/sun/star/sdbc/XRowSet.hpp> +#include <com/sun/star/uno/Sequence.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/util/XModeSelector.hpp> +#include <com/sun/star/util/XNumberFormatter.hpp> #include <com/sun/star/view/XSelectionSupplier.hpp> -#include <com/sun/star/embed/XVisualObject.hpp> -#include <cppuhelper/implbase5.hxx> -#include <svtools/transfer.hxx> -#include <svl/lstner.hxx> -#include <svx/svdedtv.hxx> -#include <svx/zoomitem.hxx> -#include "ModuleHelper.hxx" +/** === end UNO includes === **/ -#include <comphelper/uno3.hxx> #include <comphelper/implementationreference.hxx> #include <comphelper/proparrhlp.hxx> #include <comphelper/propertystatecontainer.hxx> +#include <comphelper/uno3.hxx> +#include <cppuhelper/implbase5.hxx> +#include <dbaccess/dbsubcomponentcontroller.hxx> +#include <svl/lstner.hxx> +#include <svtools/transfer.hxx> +#include <svx/svdedtv.hxx> +#include <svx/zoomitem.hxx> -#include "RptDef.hxx" -#include "DesignView.hxx" -#include <functional> +#include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> -#include <com/sun/star/util/XModeSelector.hpp> -#include "ReportControllerObserver.hxx" +#include <functional> class TransferableHelper; class TransferableClipboardListener; class VclWindowEvent; +class SfxUndoManager; namespace rptui { class OGroupsSortingDialog; @@ -79,7 +83,7 @@ namespace rptui class OAddFieldWindow; class OSectionWindow; - typedef ::dbaui::OSingleDocumentController OReportController_BASE; + typedef ::dbaui::DBSubComponentController OReportController_BASE; typedef ::cppu::ImplHelper5 < ::com::sun::star::container::XContainerListener , ::com::sun::star::beans::XPropertyChangeListener , ::com::sun::star::view::XSelectionSupplier @@ -92,6 +96,7 @@ namespace rptui ,public SfxListener ,public ::comphelper::OPropertyStateContainer ,public ::comphelper::OPropertyArrayUsageHelper < OReportController_BASE > + ,public ::boost::noncopyable { private: OModuleClient m_aModuleClient; @@ -108,9 +113,9 @@ namespace rptui ODesignView* getDesignView() const { return static_cast< ODesignView* >( getView() ); } - ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition> m_xReportDefinition; - ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine> m_xReportEngine; - ::com::sun::star::uno::Reference < ::com::sun::star::frame::XComponentLoader> m_xFrameLoader; + ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReportDefinition; + ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportEngine > m_xReportEngine; + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XComponentLoader > m_xFrameLoader; ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > m_xRowSet; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > m_xRowSetMediator; @@ -214,18 +219,23 @@ namespace rptui ,sal_Int32 _nGroupPos ,bool _bShow); - void executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun); - void alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false); + void executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun); + void alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection = false); + + // open the help agent of report designer at start time + void doOpenHelpAgent(); + + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame(); + /** shrink a section @param _nUndoStrId the string id of the string which is shown in undo menu @param _nShrinkId ID of what you would like to shrink. */ - protected: void shrinkSectionBottom(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); void shrinkSectionTop(::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection); - public: - void shrinkSection(USHORT _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId); + public: + void shrinkSection(sal_uInt16 _nUndoStrId, ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > _xSection, sal_Int32 _nShrinkId); /** opens the file open dialog to allow the user to select a image which will be * bound to a newly created image button. @@ -280,7 +290,7 @@ namespace rptui /** collapse or expand the currently selected section. * - * \param _bCollapse collapse if TRUE otherwise expand + * \param _bCollapse collapse if sal_True otherwise expand */ void collapseSection(const bool _bCollapse); @@ -293,14 +303,11 @@ namespace rptui */ void impl_zoom_nothrow(); - private: - OReportController(OReportController const&); - OReportController& operator =(OReportController const&); - public: - ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > getXFrame(); + virtual void impl_onModifyChanged(); - // open the help agent of report designer at start time - void doOpenHelpAgent(); + virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager ); + virtual void impl_initialize( ); + bool isUiVisible() const; /** creates a new default control for the currently set type when the modifier KEY_MOD1 was pressed * \param _aArgs must contain a properyvalue with name "KeyModifier" and value KEY_MOD1 when control should be created. @@ -334,16 +341,15 @@ namespace rptui // execute a feature virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); - virtual void losingConnection( ); - virtual void getPropertyDefaultByHandle( sal_Int32 _nHandle, ::com::sun::star::uno::Any& _rDefault ) const; virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception); + private: virtual ~OReportController(); + public: OReportController(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context); - DECL_LINK( NotifyUndoActionHdl, SfxUndoAction* ); DECL_LINK( EventLstHdl, VclWindowEvent* ); DECL_LINK( OnCreateHdl, OAddFieldWindow*); @@ -353,12 +359,6 @@ namespace rptui // SfxListener virtual void Notify(SfxBroadcaster & rBc, SfxHint const & rHint); - virtual void impl_onModifyChanged(); - - // const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();} - // need for undo's and redo's - SfxUndoManager* getUndoMgr(); - /** returns <TRUE/> when the command is enbaled @param _nCommand the command id @param _xControlFormat the report control format @@ -456,7 +456,7 @@ namespace rptui * * \return */ - ::boost::shared_ptr<rptui::OReportModel> getSdrModel(); + ::boost::shared_ptr<rptui::OReportModel> getSdrModel() const; inline ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > getContext() const { return m_xContext; } inline sal_Int16 getZoomValue() const { return m_nZoomValue; } @@ -478,10 +478,9 @@ namespace rptui ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > getColumns() const; ::rtl::OUString getColumnLabel_throw(const ::rtl::OUString& i_sColumnName) const; - private: - virtual void onLoadedMenu( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& _xLayoutManager ); - virtual void impl_initialize( ); - bool isUiVisible() const; + SfxUndoManager& getUndoManager() const; + void clearUndoManager() const; + void addUndoAction( SfxUndoAction* i_pAction ); }; } #endif // RPTUI_REPORTCONTROLLER_HXX diff --git a/reportdesign/source/ui/inc/ReportControllerObserver.hxx b/reportdesign/source/ui/inc/ReportControllerObserver.hxx index 8c3d827110ba..9beba004407b 100644 --- a/reportdesign/source/ui/inc/ReportControllerObserver.hxx +++ b/reportdesign/source/ui/inc/ReportControllerObserver.hxx @@ -49,12 +49,11 @@ namespace rptui class OXReportControllerObserverImpl; //======================================================================== - class /* REPORTDESIGN_DLLPUBLIC */ OXReportControllerObserver + class OXReportControllerObserver : public ::cppu::WeakImplHelper3< ::com::sun::star::beans::XPropertyChangeListener , ::com::sun::star::container::XContainerListener , ::com::sun::star::util::XModifyListener > - /*,public SfxListener*/ { const ::std::auto_ptr<OXReportControllerObserverImpl> m_pImpl; @@ -69,7 +68,6 @@ namespace rptui public: OXReportControllerObserver(const OReportController& _rController); -// protected: // XPropertyChangeListener virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw(::com::sun::star::uno::RuntimeException); @@ -91,9 +89,6 @@ namespace rptui void AddSection( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection); void RemoveSection( const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection ); - // SfxListener - // virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - /** Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope, no undo is possible for manipulated object. @@ -117,7 +112,6 @@ namespace rptui void switchListening( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& _rxContainer, bool _bStartListening ) SAL_THROW(()); void switchListening( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxObject, bool _bStartListening ) SAL_THROW(()); - // void ModeChanged(); // will be called from 'Notify' DECL_LINK(SettingsChanged, VclWindowEvent* ); private: diff --git a/reportdesign/source/ui/inc/ReportRuler.hxx b/reportdesign/source/ui/inc/ReportRuler.hxx index 97962a336ee5..092054b9faf5 100644 --- a/reportdesign/source/ui/inc/ReportRuler.hxx +++ b/reportdesign/source/ui/inc/ReportRuler.hxx @@ -56,7 +56,7 @@ namespace rptui * * \param _bVisible when <TRUE/> the grid is made visible */ - void SetGridVisible(BOOL _bVisible); + void SetGridVisible(sal_Bool _bVisible); }; //============================================================================== } // rptui diff --git a/reportdesign/source/ui/inc/ReportSection.hxx b/reportdesign/source/ui/inc/ReportSection.hxx index e8f64642afc6..cc64b29f9223 100644 --- a/reportdesign/source/ui/inc/ReportSection.hxx +++ b/reportdesign/source/ui/inc/ReportSection.hxx @@ -62,7 +62,7 @@ namespace rptui ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > m_xSection; DlgEdMode m_eMode; - BOOL m_bDialogModelChanged; + sal_Bool m_bDialogModelChanged; sal_Bool m_bInDrag; /** fills the section with all control from the report section @@ -118,15 +118,15 @@ namespace rptui * * \param _bVisible when <TRUE/> the grid is made visible */ - void SetGridVisible(BOOL _bVisible); + void SetGridVisible(sal_Bool _bVisible); inline OSectionWindow* getSectionWindow() const { return m_pParent; } inline OSectionView& getSectionView() const { return *m_pView; } inline OReportPage* getPage() const { return m_pPage; } inline ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection > getSection() const { return m_xSection; } - void SetDialogModelChanged( BOOL bChanged = TRUE ) { m_bDialogModelChanged = bChanged; } - BOOL IsDialogModelChanged() const { return m_bDialogModelChanged; } + void SetDialogModelChanged( sal_Bool bChanged = sal_True ) { m_bDialogModelChanged = bChanged; } + sal_Bool IsDialogModelChanged() const { return m_bDialogModelChanged; } DlgEdMode GetMode() const { return m_eMode; } void SetMode( DlgEdMode m_eMode ); diff --git a/reportdesign/source/ui/inc/ReportWindow.hxx b/reportdesign/source/ui/inc/ReportWindow.hxx index 11af785dc6a7..290076b6732c 100644 --- a/reportdesign/source/ui/inc/ReportWindow.hxx +++ b/reportdesign/source/ui/inc/ReportWindow.hxx @@ -87,10 +87,10 @@ namespace rptui inline OScrollWindowHelper* getScrollWindow() const { return m_pParent; } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); rtl::OUString GetInsertObjString() const; - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** copies the current selection in this section */ @@ -100,7 +100,7 @@ namespace rptui * * \return <TRUE/> if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -117,7 +117,7 @@ namespace rptui /** returns <TRUE/> when a object is marked */ - BOOL HasSelection() const; + sal_Bool HasSelection() const; Point getThumbPos() const; @@ -125,7 +125,7 @@ namespace rptui * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is <NULL/> nothing happens. @@ -133,9 +133,9 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** turns the grid on or off * diff --git a/reportdesign/source/ui/inc/Undo.hxx b/reportdesign/source/ui/inc/RptUndo.hxx index 199ecd92c1f8..1ac8295fb7c2 100644 --- a/reportdesign/source/ui/inc/Undo.hxx +++ b/reportdesign/source/ui/inc/RptUndo.hxx @@ -68,7 +68,7 @@ namespace rptui OSectionUndo( OReportModel& rMod ,sal_uInt16 _nSlot ,Action _eAction - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual ~OSectionUndo(); virtual void Undo(); @@ -96,7 +96,7 @@ namespace rptui ,OReportHelper> _pMemberFunction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReport ,Action _eAction - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual ~OReportSectionUndo(); }; @@ -123,7 +123,7 @@ namespace rptui ,OGroupHelper> _pMemberFunction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup ,Action _eAction - ,USHORT nCommentID); + ,sal_uInt16 nCommentID); virtual String GetComment() const; }; @@ -143,7 +143,7 @@ namespace rptui public: TYPEINFO(); OGroupUndo(OReportModel& rMod - ,USHORT nCommentID + ,sal_uInt16 nCommentID ,Action _eAction ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup ,const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition >& _xReportDefinition); diff --git a/reportdesign/source/ui/inc/ScrollHelper.hxx b/reportdesign/source/ui/inc/ScrollHelper.hxx index ecb117488bd4..06d9daeb1a6b 100644 --- a/reportdesign/source/ui/inc/ScrollHelper.hxx +++ b/reportdesign/source/ui/inc/ScrollHelper.hxx @@ -100,10 +100,10 @@ namespace rptui // forwards void SetMode( DlgEdMode _eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); rtl::OUString GetInsertObjString() const; - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** copies the current selection in this section */ void Copy(); @@ -112,7 +112,7 @@ namespace rptui * * \return <TRUE/> if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -129,13 +129,13 @@ namespace rptui /** returns <TRUE/> when a object is marked */ - BOOL HasSelection() const; + sal_Bool HasSelection() const; /** removes the section at the given position. * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is <NULL/> nothing happens. @@ -143,9 +143,9 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** turns the grid on or off * diff --git a/reportdesign/source/ui/inc/SectionWindow.hxx b/reportdesign/source/ui/inc/SectionWindow.hxx index 637b245097fd..700550ee99d5 100644 --- a/reportdesign/source/ui/inc/SectionWindow.hxx +++ b/reportdesign/source/ui/inc/SectionWindow.hxx @@ -76,9 +76,9 @@ namespace rptui * \param _nResId * \param _pGetSection * \param _pIsSectionOn - * @return TRUE when title was set otherwise FALSE + * @return sal_True when title was set otherwise FALSE */ - bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OGroupHelper> _pIsSectionOn); + bool setGroupSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OGroupHelper> _pIsSectionOn); /** set the title of the (report/page) header or footer * @@ -86,9 +86,9 @@ namespace rptui * \param _nResId * \param _pGetSection * \param _pIsSectionOn - * @return TRUE when title was set otherwise FALSE + * @return sal_True when title was set otherwise FALSE */ - bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OReportHelper> _pIsSectionOn); + bool setReportSectionTitle(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t< ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool, OReportHelper> _pIsSectionOn); void ImplInitSettings(); DECL_LINK(Collapsed,OColorListener*); diff --git a/reportdesign/source/ui/inc/StartMarker.hxx b/reportdesign/source/ui/inc/StartMarker.hxx index 50d4311d9ed4..2ae45214b44b 100644 --- a/reportdesign/source/ui/inc/StartMarker.hxx +++ b/reportdesign/source/ui/inc/StartMarker.hxx @@ -46,8 +46,6 @@ namespace rptui OSectionWindow* m_pParent; static Image* s_pDefCollapsed; static Image* s_pDefExpanded; - static Image* s_pDefCollapsedHC; - static Image* s_pDefExpandedHC; static oslInterlockedCount s_nImageRefCount; /// When 0 all static images will be destroyed sal_Bool m_bShowRuler; diff --git a/reportdesign/source/ui/inc/UITools.hxx b/reportdesign/source/ui/inc/UITools.hxx index 6e600c4307da..569c0b138e7c 100644 --- a/reportdesign/source/ui/inc/UITools.hxx +++ b/reportdesign/source/ui/inc/UITools.hxx @@ -69,7 +69,7 @@ namespace rptui ::com::sun::star::uno::Reference< T > xObject(_xCollection->getByIndex(i),::com::sun::star::uno::UNO_QUERY); if ( xObject == _xSearch ) break; - } // for (;i<nCount ; ++i) + } return i; } @@ -169,7 +169,7 @@ namespace rptui * * \param pControl the control which should place in the section without overlapping * \param _pReportSection the section - * \param _bInsert TRUE whe the control should be inserted, otherwise not. + * \param _bInsert sal_True whe the control should be inserted, otherwise not. */ void correctOverlapping(SdrObject* pControl,OReportSection& _aReportSection,bool _bInsert = true); diff --git a/reportdesign/source/ui/inc/ViewsWindow.hxx b/reportdesign/source/ui/inc/ViewsWindow.hxx index dfa2f6ec7cdf..041da5de03ce 100644 --- a/reportdesign/source/ui/inc/ViewsWindow.hxx +++ b/reportdesign/source/ui/inc/ViewsWindow.hxx @@ -93,7 +93,7 @@ namespace rptui public: OWindowPositionCorrector(Window* _pWindow,long _nDeltaX, long _nDeltaY) :m_nDeltaX(_nDeltaX), m_nDeltaY(_nDeltaY) { - USHORT nCount = _pWindow->GetChildCount(); + sal_uInt16 nCount = _pWindow->GetChildCount(); m_aChildren.reserve(nCount); while( nCount ) { @@ -147,7 +147,7 @@ namespace rptui void ImplInitSettings(); /** returns the iterator at pos _nPos or the end() */ - TSectionsMap::iterator getIteratorAtPos(USHORT _nPos); + TSectionsMap::iterator getIteratorAtPos(sal_uInt16 _nPos); void collectRectangles(TRectangleMap& _rMap,bool _bBoundRects); void collectBoundResizeRect(const TRectangleMap& _rSortRectangles,sal_Int32 _nControlModification,bool _bAlignAtSection,bool _bBoundRects,Rectangle& _rBound,Rectangle& _rResize); void impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Point& _rStartPoint,bool _bSet); @@ -182,7 +182,7 @@ namespace rptui * * \param _nPosition Zero based. */ - void removeSection(USHORT _nPosition); + void removeSection(sal_uInt16 _nPosition); /** adds a new section at position _nPosition. If the section is <NULL/> nothing happens. @@ -190,23 +190,23 @@ namespace rptui */ void addSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition = USHRT_MAX); + ,sal_uInt16 _nPosition = USHRT_MAX); - USHORT getSectionCount() const; + sal_uInt16 getSectionCount() const; /** return the section at the given position * * \param _nPos * \return the section at this pos or an empty section */ - ::boost::shared_ptr<OSectionWindow> getSectionWindow(const USHORT _nPos) const; + ::boost::shared_ptr<OSectionWindow> getSectionWindow(const sal_uInt16 _nPos) const; /** turns the grid on or off * * \param _bVisible */ void toggleGrid(sal_Bool _bVisible); - void setGridSnap(BOOL bOn); - void setDragStripes(BOOL bOn); + void setGridSnap(sal_Bool bOn); + void setDragStripes(sal_Bool bOn); /** returns the total accumulated height of all sections until _pSection is reached */ @@ -214,7 +214,7 @@ namespace rptui inline bool empty() const { return m_aSections.empty(); } void SetMode( DlgEdMode m_eMode ); - void SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); + void SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType = ::rtl::OUString()); rtl::OUString GetInsertObjString() const; /** copies the current selection in this section */ @@ -224,7 +224,7 @@ namespace rptui * * \return <TRUE/> if paste is allowed */ - BOOL IsPasteAllowed() const; + sal_Bool IsPasteAllowed() const; /** paste a new control in this section */ @@ -241,7 +241,7 @@ namespace rptui /** returns <TRUE/> when a object is marked */ - BOOL HasSelection() const; + sal_Bool HasSelection() const; /** unmark all objects on the views without the given one. * @@ -252,7 +252,6 @@ namespace rptui /** returns the report section window for the given xsection @param _xSection the section */ - // ::boost::shared_ptr<OSectionWindow> getReportSection(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection); ::boost::shared_ptr<OSectionWindow> getSectionWindow(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection>& _xSection) const; /** checks if the keycode is known by the child windows @@ -294,7 +293,7 @@ namespace rptui /** returns the current position in the list */ - USHORT getPosition(const OSectionWindow* _pSectionWindow = NULL) const; + sal_uInt16 getPosition(const OSectionWindow* _pSectionWindow = NULL) const; /** calls on every section BrkAction * @@ -310,12 +309,12 @@ namespace rptui bool isObjectInMyTempList(SdrObject *); public: void BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection); - void EndDragObj(BOOL _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt); + void EndDragObj(sal_Bool _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt); void EndAction(); void ForceMarkedToAnotherPage(); - BOOL IsAction() const; - BOOL IsDragObj() const; + sal_Bool IsAction() const; + sal_Bool IsDragObj() const; void handleKey(const KeyCode& _rCode); void stopScrollTimer(); @@ -328,7 +327,6 @@ namespace rptui OSectionView* getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt); void MovAction(const Point& rPnt,const OSectionView* _pSection,bool _bMove /*= true */, bool _bControlKeySet); - // void MovAction2(const Point& rPnt,const OSectionView* _pSection); sal_uInt32 getMarkedObjectCount() const; diff --git a/reportdesign/source/ui/inc/dlgedfunc.hxx b/reportdesign/source/ui/inc/dlgedfunc.hxx index 4300beaf4d16..2ac110a70396 100644 --- a/reportdesign/source/ui/inc/dlgedfunc.hxx +++ b/reportdesign/source/ui/inc/dlgedfunc.hxx @@ -94,9 +94,9 @@ public: DlgEdFunc( OReportSection* pParent ); virtual ~DlgEdFunc(); - virtual BOOL MouseButtonDown( const MouseEvent& rMEvt ); - virtual BOOL MouseButtonUp( const MouseEvent& rMEvt ); - virtual BOOL MouseMove( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt ); + virtual sal_Bool MouseMove( const MouseEvent& rMEvt ); /** checks if the keycode is known by the child windows @param _rCode the keycode @@ -135,9 +135,9 @@ public: DlgEdFuncInsert( OReportSection* pParent ); ~DlgEdFuncInsert(); - virtual BOOL MouseButtonDown( const MouseEvent& rMEvt ); - virtual BOOL MouseButtonUp( const MouseEvent& rMEvt ); - virtual BOOL MouseMove( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt ); + virtual sal_Bool MouseMove( const MouseEvent& rMEvt ); }; //============================================================================ @@ -150,11 +150,11 @@ public: DlgEdFuncSelect( OReportSection* pParent ); ~DlgEdFuncSelect(); - virtual BOOL MouseButtonDown( const MouseEvent& rMEvt ); - virtual BOOL MouseButtonUp( const MouseEvent& rMEvt ); - virtual BOOL MouseMove( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonDown( const MouseEvent& rMEvt ); + virtual sal_Bool MouseButtonUp( const MouseEvent& rMEvt ); + virtual sal_Bool MouseMove( const MouseEvent& rMEvt ); - void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag); + void SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, sal_Bool bQuickDrag); }; } diff --git a/reportdesign/source/ui/inc/dlgpage.hxx b/reportdesign/source/ui/inc/dlgpage.hxx index fb1a01e42301..4f713dad90ef 100644 --- a/reportdesign/source/ui/inc/dlgpage.hxx +++ b/reportdesign/source/ui/inc/dlgpage.hxx @@ -46,7 +46,7 @@ private: void operator =(const ORptPageDialog&); public: - ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,USHORT _nPageId); + ORptPageDialog( Window* pParent, const SfxItemSet* pAttr,sal_uInt16 _nPageId); virtual ~ORptPageDialog() {} }; // ============================================================================= diff --git a/reportdesign/source/ui/inc/metadata.hxx b/reportdesign/source/ui/inc/metadata.hxx index 727cd5bb1c62..2d0b49f74640 100644 --- a/reportdesign/source/ui/inc/metadata.hxx +++ b/reportdesign/source/ui/inc/metadata.hxx @@ -63,7 +63,7 @@ namespace rptui // IPropertyInfoService sal_Int32 getPropertyId(const String& _rName) const; String getPropertyTranslation(sal_Int32 _nId) const; - sal_Int32 getPropertyHelpId(sal_Int32 _nId) const; + rtl::OString getPropertyHelpId(sal_Int32 _nId) const; sal_uInt32 getPropertyUIFlags(sal_Int32 _nId) const; static void getExcludeProperties(::std::vector< com::sun::star::beans::Property >& _rExcludeProperties,const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _xFormComponentHandler); @@ -86,7 +86,7 @@ namespace rptui class HelpIdUrl { public: - static ::rtl::OUString getHelpURL( sal_uInt32 _nHelpId ); + static ::rtl::OUString getHelpURL( const rtl::OString& _sHelpId ); }; //======================================================================== diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index f2a87ea06bde..fadd0fd065cc 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -52,7 +52,7 @@ #include <com/sun/star/inspection/XNumericControl.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/util/MeasureUnit.hpp> -#include <vcl/fldunit.hxx> +#include <tools/fldunit.hxx> #include "metadata.hxx" #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -169,13 +169,6 @@ void SAL_CALL DataProviderHandler::inspect(const uno::Reference< uno::XInterface m_xMasterDetails = new OPropertyMediator( m_xDataProvider.get(), m_xReportComponent.get(), aPropertyMediation,sal_True ); } - - //const ::rtl::OUString sRowSet(RTL_CONSTASCII_USTRINGPARAM("RowSet")); - //if ( xNameCont->hasByName(sRowSet) ) - //{ - // uno::Reference<beans::XPropertySet> xProp(m_xFormComponentHandler,uno::UNO_QUERY); - // xProp->setPropertyValue(sRowSet,xNameCont->getByName(sRowSet)); - //} } catch(uno::Exception) { @@ -271,7 +264,7 @@ void DataProviderHandler::impl_updateChartTitle_throw(const uno::Any& _aValue) aArgs[0] = xFormatted; xTitle->setText(aArgs); } - } // if ( xTitled.is() ) + } } beans::PropertyState SAL_CALL DataProviderHandler::getPropertyState(const ::rtl::OUString & PropertyName) throw (uno::RuntimeException, beans::UnknownPropertyException) @@ -286,7 +279,7 @@ inspection::LineDescriptor SAL_CALL DataProviderHandler::describePropertyLine(co switch(nId) { case PROPERTY_ID_CHARTTYPE: - aOut.PrimaryButtonId = UID_RPT_PROP_CHARTTYPE_DLG; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_CHARTTYPE_DLG); aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::TextField , sal_True); aOut.HasPrimaryButton = sal_True; break; @@ -296,7 +289,7 @@ inspection::LineDescriptor SAL_CALL DataProviderHandler::describePropertyLine(co case PROPERTY_ID_MASTERFIELDS: case PROPERTY_ID_DETAILFIELDS: aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::StringListField , sal_False); - aOut.PrimaryButtonId = UID_RPT_PROP_DLG_LINKFIELDS; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_DLG_LINKFIELDS); aOut.HasPrimaryButton = sal_True; break; default: @@ -330,7 +323,7 @@ uno::Any SAL_CALL DataProviderHandler::convertToPropertyValue(const ::rtl::OUStr } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" ); + OSL_FAIL( "DataProviderHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" ); } break; case PROPERTY_ID_MASTERFIELDS: @@ -364,7 +357,7 @@ uno::Any SAL_CALL DataProviderHandler::convertToControlValue(const ::rtl::OUStri } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" ); + OSL_FAIL( "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" ); } break; default: @@ -396,7 +389,6 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope ,PROPERTY_MASTERFIELDS ,PROPERTY_DETAILFIELDS ,PROPERTY_PREVIEW_COUNT - //,PROPERTY_TITLE }; for (size_t nPos = 0; nPos < SAL_N_ELEMENTS(s_pProperties) ;++nPos ) @@ -480,9 +472,9 @@ void SAL_CALL DataProviderHandler::actuatingPropertyChanged(const ::rtl::OUStrin xReceiver->setArguments( aArgs.getPropertyValues() ); if ( !bModified ) xReport->setModified(sal_False); - } // if ( NewValue != OldValue ) + } m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, InspectorUI, FirstTimeInit); - } // if ( ActuatingPropertyName == PROPERTY_COMMAND ) + } else if ( ActuatingPropertyName == PROPERTY_TITLE ) { if ( NewValue != OldValue ) diff --git a/reportdesign/source/ui/inspection/DefaultInspection.cxx b/reportdesign/source/ui/inspection/DefaultInspection.cxx index 368aa7cac239..7701c91e83d4 100644 --- a/reportdesign/source/ui/inspection/DefaultInspection.cxx +++ b/reportdesign/source/ui/inspection/DefaultInspection.cxx @@ -38,17 +38,20 @@ #include <rtl/ustrbuf.hxx> #include <tools/debug.hxx> #include "metadata.hxx" +#include <tools/urlobj.hxx> //........................................................................ namespace rptui { //........................................................................ //------------------------------------------------------------------------ - ::rtl::OUString HelpIdUrl::getHelpURL( sal_uInt32 _nHelpId ) + ::rtl::OUString HelpIdUrl::getHelpURL( const rtl::OString& sHelpId ) { ::rtl::OUStringBuffer aBuffer; - aBuffer.appendAscii( "HID:" ); - aBuffer.append( (sal_Int32)_nHelpId ); + ::rtl::OUString aTmp( sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8 ); + DBG_ASSERT( INetURLObject( aTmp ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" ); + aBuffer.appendAscii( INET_HID_SCHEME ); + aBuffer.append( aTmp.getStr() ); return aBuffer.makeStringAndClear(); } @@ -231,8 +234,8 @@ namespace rptui const struct { const sal_Char* programmaticName; - USHORT uiNameResId; - sal_uInt32 helpId; + sal_uInt16 uiNameResId; + rtl::OString helpId; } aCategories[] = { { "General", RID_STR_PROPPAGE_DEFAULT, HID_RPT_PROPDLG_TAB_GENERAL }, { "Data", RID_STR_PROPPAGE_DATA, HID_RPT_PROPDLG_TAB_DATA }, diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index a90a80a26f65..8b7cae395c33 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -67,7 +67,7 @@ #include <vcl/msgbox.hxx> #include <vcl/waitobj.hxx> -#include <vcl/fldunit.hxx> +#include <tools/fldunit.hxx> #include <vcl/stdtext.hxx> #include "ModuleHelper.hxx" @@ -116,6 +116,8 @@ #include "helpids.hrc" #include <toolkit/helper/convert.hxx> +#include <o3tl/compat_functional.hxx> + #define DATA_OR_FORMULA 0 #define FUNCTION 1 #define COUNTER 2 @@ -127,18 +129,17 @@ namespace rptui { //........................................................................ using namespace ::com::sun::star; -//using namespace formula; // comparing two property instances struct PropertyCompare : public ::std::binary_function< beans::Property, ::rtl::OUString , bool > { bool operator() (const beans::Property& x, const ::rtl::OUString& y) const { - return x.Name.equals(y);// ? true : false; + return x.Name.equals(y); } bool operator() (const ::rtl::OUString& x,const beans::Property& y) const { - return x.equals(y.Name);// ? true : false; + return x.equals(y.Name); } }; @@ -778,12 +779,12 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const break; case PROPERTY_ID_INITIALFORMULA: case PROPERTY_ID_FORMULA: - aOut.PrimaryButtonId = UID_RPT_PROP_FORMULA; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_FORMULA); aOut.HasPrimaryButton = sal_True; aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::MultiLineTextField , sal_False); break; case PROPERTY_ID_CONDITIONALPRINTEXPRESSION: - aOut.PrimaryButtonId = UID_RPT_PROP_FORMULA; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_FORMULA); aOut.HasPrimaryButton = sal_True; aOut.Control = _xControlFactory->createPropertyControl(inspection::PropertyControlType::MultiLineTextField , sal_False); break; @@ -798,7 +799,7 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const if ( m_nDataFieldType == DATA_OR_FORMULA ) { - aOut.PrimaryButtonId = UID_RPT_PROP_FORMULA; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_PROP_FORMULA); aOut.HasPrimaryButton = sal_True; } @@ -807,9 +808,9 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const { // add function names ::std::for_each( m_aFunctionNames.begin(), m_aFunctionNames.end(), - ::std::compose1( + ::o3tl::compose1( ::boost::bind( &inspection::XStringListControl::appendListEntry, xListControl,_1 ), - ::std::select1st<TFunctions::value_type>())); + ::o3tl::select1st<TFunctions::value_type>())); } else { @@ -825,12 +826,12 @@ inspection::LineDescriptor SAL_CALL GeometryHandler::describePropertyLine(const aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::ColorListBox, sal_False ); break; case PROPERTY_ID_FONT: - aOut.PrimaryButtonId = UID_RPT_RPT_PROP_DLG_FONT_TYPE; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_RPT_PROP_DLG_FONT_TYPE); aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True ); aOut.HasPrimaryButton = sal_True; break; case PROPERTY_ID_AREA: - aOut.PrimaryButtonId = UID_RPT_RPT_PROP_DLG_AREA; + aOut.PrimaryButtonId = rtl::OUString::createFromAscii(UID_RPT_RPT_PROP_DLG_AREA); aOut.Control = _xControlFactory->createPropertyControl( inspection::PropertyControlType::TextField, sal_True ); aOut.HasPrimaryButton = sal_True; break; @@ -1021,7 +1022,7 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const ::rtl::OUString } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" ); + OSL_FAIL( "GeometryHandler::convertToPropertyValue: caught an exception while converting via TypeConverter!" ); } } } @@ -1166,7 +1167,7 @@ uno::Any SAL_CALL GeometryHandler::convertToControlValue(const ::rtl::OUString & } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "GeometryHandler::convertToControlValue: caught an exception while converting via TypeConverter!" ); + OSL_FAIL( "GeometryHandler::convertToControlValue: caught an exception while converting via TypeConverter!" ); } } break; @@ -1329,7 +1330,7 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie } aNewProps.push_back(*pFind); } - } // for (size_t i = 0; i < SAL_N_ELEMENTS(pIncludeProperties) ;++i ) + } // special property for shapes // if ( uno::Reference< report::XShape>(m_xReportComponent,uno::UNO_QUERY).is() ) @@ -1450,7 +1451,6 @@ inspection::InteractiveSelectionResult SAL_CALL GeometryHandler::onInteractivePr eResult = inspection::InteractiveSelectionResult_ObtainedValue; beans::PropertyChangeEvent aScopeEvent; aScopeEvent.PropertyName = PROPERTY_FILLCOLOR; - // aScopeEvent.OldValue <<= _nOldDataFieldType; aScopeEvent.NewValue <<= xShape->getPropertyValue(PROPERTY_FILLCOLOR); m_aPropertyListeners.notify( aScopeEvent, &beans::XPropertyChangeListener::propertyChange ); } @@ -1519,7 +1519,7 @@ void SAL_CALL GeometryHandler::actuatingPropertyChanged(const ::rtl::OUString & { _rxInspectorUI->rebuildPropertyUI(PROPERTY_DATAFIELD); _rxInspectorUI->rebuildPropertyUI(PROPERTY_FORMULALIST); - } // if ( bEnable ) + } m_xFormComponentHandler->actuatingPropertyChanged(ActuatingPropertyName, NewValue, OldValue, _rxInspectorUI, _bFirstTimeInit); } break; @@ -1609,7 +1609,7 @@ bool GeometryHandler::impl_dialogFilter_nothrow( ::rtl::OUString& _out_rSelected catch (sdbc::SQLException& e) { aErrorInfo = e; } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" ); + OSL_FAIL( "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" ); } if ( aErrorInfo.isValid() ) @@ -1651,7 +1651,7 @@ void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUStrin if ( m_nDataFieldType == FUNCTION ) ::std::transform(m_aDefaultFunctions.begin(),m_aDefaultFunctions.end(),::std::back_inserter(_out_rList),::boost::bind( &DefaultFunction::getName, _1 )); else if ( m_nDataFieldType == USER_DEF_FUNCTION ) - ::std::transform(m_aFunctionNames.begin(),m_aFunctionNames.end(),::std::back_inserter(_out_rList),::std::select1st<TFunctions::value_type>()); + ::std::transform(m_aFunctionNames.begin(),m_aFunctionNames.end(),::std::back_inserter(_out_rList),::o3tl::select1st<TFunctions::value_type>()); } // ----------------------------------------------------------------------------- ::rtl::OUString GeometryHandler::impl_ConvertUIToMimeType_nothrow(const ::rtl::OUString& _sUIName) const @@ -1669,7 +1669,7 @@ void GeometryHandler::impl_fillFormulaList_nothrow(::std::vector< ::rtl::OUStrin const uno::Sequence< ::rtl::OUString > aMimeTypes( xReportDefinition->getAvailableMimeTypes() ); sRet = aMimeTypes[nPos]; } - } // if ( aFind != aList.end() ) + } return sRet; } // ----------------------------------------------------------------------------- @@ -1706,7 +1706,7 @@ void GeometryHandler::impl_fillMimeTypes_nothrow(::std::vector< ::rtl::OUString } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } } // ----------------------------------------------------------------------------- @@ -1738,7 +1738,7 @@ void GeometryHandler::impl_fillScopeList_nothrow(::std::vector< ::rtl::OUString } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } } // ----------------------------------------------------------------------------- @@ -1856,7 +1856,7 @@ sal_Bool GeometryHandler::isDefaultFunction( const ::rtl::OUString& _sQuotedFunc } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } return bDefaultFunction; } @@ -1896,7 +1896,7 @@ sal_Bool GeometryHandler::impl_isDefaultFunction_nothrow( const uno::Reference< } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } return bDefaultFunction; } @@ -1916,13 +1916,6 @@ void GeometryHandler::loadDefaultFunctions() DefaultFunction aDefault; aDefault.m_bDeepTraversing = sal_False; - //aDefault.m_sName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Counter")); - //aDefault.m_sFormula = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:[%FunctionName] + 1")); - //aDefault.m_sSearchString = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:\\[[:alpha:]+[:alnum:]*\\][:space:]*\\+[:space:]*1")); - //aDefault.m_sInitialFormula.IsPresent = sal_True; - //aDefault.m_sInitialFormula.Value = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("rpt:1")); - //m_aDefaultFunctions.push_back(aDefault); - aDefault.m_bPreEvaluated = sal_True; aDefault.m_sName = String(ModuleRes(RID_STR_F_ACCUMULATION)); @@ -1994,7 +1987,7 @@ void GeometryHandler::createDefaultFunction(::osl::ResettableMutexGuard& _aGuard } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } } // ----------------------------------------------------------------------------- @@ -2084,7 +2077,7 @@ void GeometryHandler::impl_initFieldList_nothrow( uno::Sequence< ::rtl::OUString } catch (uno::Exception&) { - DBG_ERROR( "GeometryHandler::impl_initFieldList_nothrow: caught an exception!" ); + OSL_FAIL( "GeometryHandler::impl_initFieldList_nothrow: caught an exception!" ); } } // ----------------------------------------------------------------------------- diff --git a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx index d42be56e7656..87e1f006c177 100644 --- a/reportdesign/source/ui/inspection/ReportComponentHandler.cxx +++ b/reportdesign/source/ui/inspection/ReportComponentHandler.cxx @@ -39,7 +39,7 @@ #include <com/sun/star/inspection/XNumericControl.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/util/MeasureUnit.hpp> -#include <vcl/fldunit.hxx> +#include <tools/fldunit.hxx> #include "metadata.hxx" //........................................................................ @@ -47,7 +47,6 @@ namespace rptui { //........................................................................ using namespace ::com::sun::star; -// using namespace comphelper; ReportComponentHandler::ReportComponentHandler(uno::Reference< uno::XComponentContext > const & context) :ReportComponentHandler_Base(m_aMutex) diff --git a/reportdesign/source/ui/inspection/metadata.cxx b/reportdesign/source/ui/inspection/metadata.cxx index 5915362f753e..4d53bca64388 100644 --- a/reportdesign/source/ui/inspection/metadata.cxx +++ b/reportdesign/source/ui/inspection/metadata.cxx @@ -30,7 +30,7 @@ #include <svtools/localresaccess.hxx> #include "com/sun/star/inspection/XPropertyHandler.hpp" #include <tools/debug.hxx> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include "helpids.hrc" #include "RptResId.hrc" #include "uistrings.hrc" @@ -53,7 +53,7 @@ namespace rptui { String sName; String sTranslation; - sal_uInt32 nHelpId; + rtl::OString sHelpId; sal_Int32 nId; sal_uInt16 nPos; sal_uInt32 nUIFlags; @@ -63,16 +63,16 @@ namespace rptui sal_Int32 _nId, const String& aTranslation, sal_uInt16 nPosId, - sal_uInt32 nHelpId, + const rtl::OString& _sHelpId, sal_uInt32 _nUIFlags); }; //------------------------------------------------------------------------ OPropertyInfoImpl::OPropertyInfoImpl(const ::rtl::OUString& _rName, sal_Int32 _nId, - const String& aString, sal_uInt16 nP, sal_uInt32 nHid, sal_uInt32 _nUIFlags) + const String& aString, sal_uInt16 nP, const rtl::OString& sHid, sal_uInt32 _nUIFlags) :sName(_rName) ,sTranslation(aString) - ,nHelpId(nHid) + ,sHelpId(sHid) ,nId(_nId) ,nPos(nP) ,nUIFlags(_nUIFlags) @@ -194,10 +194,10 @@ namespace rptui } //------------------------------------------------------------------------ - sal_Int32 OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const + rtl::OString OPropertyInfoService::getPropertyHelpId(sal_Int32 _nId) const { const OPropertyInfoImpl* pInfo = getPropertyInfo(_nId); - return (pInfo) ? pInfo->nHelpId : 0; + return (pInfo) ? pInfo->sHelpId : rtl::OString(); } //------------------------------------------------------------------------ @@ -213,7 +213,7 @@ namespace rptui // intialisierung if(!s_pPropertyInfos) getPropertyInfo(); - OPropertyInfoImpl aSearch(_rName, 0L, String(), 0, 0, 0); + OPropertyInfoImpl aSearch(_rName, 0L, String(), 0, "", 0); const OPropertyInfoImpl* pPropInfo = ::std::lower_bound( s_pPropertyInfos, s_pPropertyInfos + s_nCount, aSearch, PropertyInfoLessByName() ); diff --git a/reportdesign/source/ui/misc/FunctionHelper.cxx b/reportdesign/source/ui/misc/FunctionHelper.cxx index 1de40751f9c1..0f8787a07dd1 100644 --- a/reportdesign/source/ui/misc/FunctionHelper.cxx +++ b/reportdesign/source/ui/misc/FunctionHelper.cxx @@ -58,7 +58,7 @@ sal_Unicode FunctionManager::getSingleToken(const formula::IFunctionManager::ETo return sal_Unicode('{'); case eArrayClose: return sal_Unicode('}'); - } // switch(_eToken) + } return 0; } // ----------------------------------------------------------------------------- @@ -93,11 +93,6 @@ const formula::IFunctionDescription* FunctionManager::getFunctionByName(const :: // ----------------------------------------------------------------------------- void FunctionManager::fillLastRecentlyUsedFunctions(::std::vector< const formula::IFunctionDescription*>& /*_rLastRUFunctions*/) const { - //const sal_uInt32 nCount = getCount(); - //for(sal_uInt32 i = 0 ; i < nCount ; ++i) - //{ - // const formula::IFunctionCategory* pCategory = getCategory( - //} } // ----------------------------------------------------------------------------- ::boost::shared_ptr< FunctionDescription > FunctionManager::get(const uno::Reference< report::meta::XFunctionDescription>& _xFunctionDescription) const @@ -118,9 +113,9 @@ void FunctionManager::fillLastRecentlyUsedFunctions(::std::vector< const formula m_aCategoryIndex.push_back( aCategoryFind ); } aFunctionFind = m_aFunctions.insert(TFunctionsMap::value_type(sFunctionName,::boost::shared_ptr<FunctionDescription>(new FunctionDescription(aCategoryFind->second.get(),_xFunctionDescription)))).first; - } // if ( aFind == m_aFunctions.end() ) + } pDesc = aFunctionFind->second; - } // if ( _xFunctionDescription.is() ) + } return pDesc; } // ----------------------------------------------------------------------------- @@ -199,15 +194,15 @@ xub_StrLen FunctionDescription::getSuppressedArgumentCount() const } catch(const uno::Exception&) { - DBG_ERROR("Exception caught!"); + OSL_FAIL("Exception caught!"); } return sFormula; } // ----------------------------------------------------------------------------- -void FunctionDescription::fillVisibleArgumentMapping(::std::vector<USHORT>& _rArguments) const +void FunctionDescription::fillVisibleArgumentMapping(::std::vector<sal_uInt16>& _rArguments) const { const sal_Int32 nCount = m_aParameter.getLength(); - for(USHORT i = 0;i < nCount; ++i) + for(sal_uInt16 i = 0;i < nCount; ++i) { _rArguments.push_back(i); } @@ -222,9 +217,9 @@ void FunctionDescription::initArgumentInfo() const return m_xFunctionDescription->getSignature(); } // ----------------------------------------------------------------------------- -long FunctionDescription::getHelpId() const +rtl::OString FunctionDescription::getHelpId() const { - return 0; + return rtl::OString(); } // ----------------------------------------------------------------------------- sal_uInt32 FunctionDescription::getParameterCount() const diff --git a/reportdesign/source/ui/misc/Undo.cxx b/reportdesign/source/ui/misc/RptUndo.cxx index 3a434d179985..9e1fb6c66861 100644 --- a/reportdesign/source/ui/misc/Undo.cxx +++ b/reportdesign/source/ui/misc/RptUndo.cxx @@ -27,15 +27,16 @@ ************************************************************************/ #include "precompiled_reportdesign.hxx" -#include "Undo.hxx" +#include "RptUndo.hxx" #include "uistrings.hrc" #include "rptui_slotid.hrc" #include "UITools.hxx" +#include "UndoEnv.hxx" + #include <dbaccess/IController.hxx> #include <com/sun/star/report/XSection.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> -#include "UndoEnv.hxx" #include <com/sun/star/awt/Point.hpp> #include <com/sun/star/awt/Size.hpp> #include <svx/unoshape.hxx> @@ -70,7 +71,7 @@ namespace _xSection->remove(xShape); --nCount; } - } // if ( _xSection.is() ) + } } //---------------------------------------------------------------------------- void lcl_insertElements(const uno::Reference< report::XSection >& _xSection,const ::std::vector< uno::Reference< drawing::XShape> >& _aControls) @@ -91,7 +92,7 @@ namespace } catch(const uno::Exception&) { - OSL_ENSURE(0,"lcl_insertElements:Exception caught!"); + OSL_FAIL("lcl_insertElements:Exception caught!"); } } } @@ -111,7 +112,7 @@ namespace } catch(const uno::Exception&) { - OSL_ENSURE(0,"lcl_setValues:Exception caught!"); + OSL_FAIL("lcl_setValues:Exception caught!"); } } } @@ -124,7 +125,7 @@ DBG_NAME(rpt_OSectionUndo) OSectionUndo::OSectionUndo(OReportModel& _rMod ,sal_uInt16 _nSlot ,Action _eAction - ,USHORT nCommentID) + ,sal_uInt16 nCommentID) : OCommentUndoAction(_rMod,nCommentID) ,m_eAction(_eAction) ,m_nSlot(_nSlot) @@ -156,7 +157,7 @@ OSectionUndo::~OSectionUndo() } catch(uno::Exception) { - OSL_ENSURE(0,"Exception caught!"); + OSL_FAIL("Exception caught!"); } } } @@ -202,7 +203,7 @@ void OSectionUndo::Undo() } catch( const Exception& ) { - OSL_ENSURE( sal_False, "OSectionUndo::Undo: caught an exception!" ); + OSL_FAIL( "OSectionUndo::Undo: caught an exception!" ); } } //---------------------------------------------------------------------------- @@ -223,7 +224,7 @@ void OSectionUndo::Redo() } catch( const Exception& ) { - OSL_ENSURE( sal_False, "OSectionUndo::Redo: caught an exception!" ); + OSL_FAIL( "OSectionUndo::Redo: caught an exception!" ); } } //---------------------------------------------------------------------------- @@ -234,7 +235,7 @@ OReportSectionUndo::OReportSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot ,OReportHelper> _pMemberFunction ,const uno::Reference< report::XReportDefinition >& _xReport ,Action _eAction - ,USHORT nCommentID) + ,sal_uInt16 nCommentID) : OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) ,m_aReportHelper(_xReport) ,m_pMemberFunction(_pMemberFunction) @@ -273,7 +274,7 @@ OGroupSectionUndo::OGroupSectionUndo(OReportModel& _rMod,sal_uInt16 _nSlot ,OGroupHelper> _pMemberFunction ,const uno::Reference< report::XGroup >& _xGroup ,Action _eAction - ,USHORT nCommentID) + ,sal_uInt16 nCommentID) : OSectionUndo(_rMod,_nSlot,_eAction,nCommentID) ,m_aGroupHelper(_xGroup) ,m_pMemberFunction(_pMemberFunction) @@ -339,7 +340,7 @@ void OGroupSectionUndo::implReRemove( ) TYPEINIT1( OGroupUndo, OCommentUndoAction ); //---------------------------------------------------------------------------- OGroupUndo::OGroupUndo(OReportModel& _rMod - ,USHORT nCommentID + ,sal_uInt16 nCommentID ,Action _eAction ,const uno::Reference< report::XGroup>& _xGroup ,const uno::Reference< report::XReportDefinition >& _xReportDefinition) @@ -359,7 +360,7 @@ void OGroupUndo::implReInsert( ) } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception catched while undoing remove group"); + OSL_FAIL("Exception catched while undoing remove group"); } } //---------------------------------------------------------------------------- @@ -371,7 +372,7 @@ void OGroupUndo::implReRemove( ) } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception catched while redoing remove group"); + OSL_FAIL("Exception catched while redoing remove group"); } } //---------------------------------------------------------------------------- diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 6e1ed17c4e2e..a8dcd7ee351b 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -175,14 +175,14 @@ void adjustSectionName(const uno::Reference< report::XGroup >& _xGroup,sal_Int32 ::rtl::OUString sName = String(ModuleRes(RID_STR_GROUPHEADER)); sName += ::rtl::OUString::valueOf(_nPos); _xGroup->getHeader()->setName(sName); - } // if ( _xGroup->getHeaderOn() ) + } if ( _xGroup->getFooterOn() && !_xGroup->getFooter()->getName().getLength() ) { ::rtl::OUString sName = String(ModuleRes(RID_STR_GROUPFOOTER)); sName += ::rtl::OUString::valueOf(_nPos); _xGroup->getFooter()->setName(sName); - } // if ( _xGroup->getHeaderOn() ) + } } // ----------------------------------------------------------------------------- ::rtl::Reference< comphelper::OPropertyChangeMultiplexer> addStyleListener(const uno::Reference< report::XReportDefinition >& _xReportDefinition,::comphelper::OPropertyChangeListener* _pListener) @@ -207,7 +207,7 @@ void adjustSectionName(const uno::Reference< report::XGroup >& _xGroup,sal_Int32 namespace { // ------------------------------------------------------------------------- - Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, awt::FontDescriptor& _out_rControlFont ,USHORT _nWichFont) + Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, awt::FontDescriptor& _out_rControlFont ,sal_uInt16 _nWichFont) { if ( !_rxReportControlFormat.is() ) throw uno::RuntimeException(); @@ -231,14 +231,14 @@ namespace } // ------------------------------------------------------------------------- - Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,USHORT _nWhich ) + Font lcl_getReportControlFont( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat,sal_uInt16 _nWhich ) { awt::FontDescriptor aAwtFont; return lcl_getReportControlFont( _rxReportControlFormat, aAwtFont, _nWhich ); } // ------------------------------------------------------------------------- const Font lcl_setFont(const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, - SfxItemSet& _rItemSet,USHORT _nWhich,USHORT _nFont, USHORT _nFontHeight,USHORT _nLanguage,USHORT _nPosture, USHORT _nWeight) + SfxItemSet& _rItemSet,sal_uInt16 _nWhich,sal_uInt16 _nFont, sal_uInt16 _nFontHeight,sal_uInt16 _nLanguage,sal_uInt16 _nPosture, sal_uInt16 _nWeight) { // fill it awt::FontDescriptor aControlFont; @@ -261,7 +261,7 @@ namespace case COMPLEX: aLocale = _rxReportControlFormat->getCharLocaleComplex(); break; - } // switch(_nWhich) + } _rItemSet.Put(SvxLanguageItem(MsLangId::convertLocaleToLanguageWithFallback(aLocale),_nLanguage)); @@ -288,7 +288,7 @@ namespace pClone->PutValue(_xShape->getPropertyValue(aIt->sName), aIt->nMemberId); _rItemSet.Put(*pClone, aIt->nWID); } - } // if ( xInfo->hasPropertyByName(sPropertyName) ) + } ++aIt; } } @@ -319,11 +319,11 @@ namespace catch(uno::Exception&) { // shapes have a bug so we ignore this one. } - } // if ( pItem ) + } } } ++aIt; - } // while ( pPropertyMap->pName ) + } } // ------------------------------------------------------------------------- void lcl_CharPropertiesToItems( const uno::Reference<report::XReportControlFormat >& _rxReportControlFormat, @@ -353,7 +353,6 @@ namespace _rItemSet.Put(aUnderLineItem); _rItemSet.Put(SvxKerningItem(_rxReportControlFormat->getCharKerning(),ITEMID_KERNING)); _rItemSet.Put(SvxEmphasisMarkItem(static_cast<FontEmphasisMark>(_rxReportControlFormat->getCharEmphasis()),ITEMID_EMPHASISMARK)); - //_rItemSet.Put(SvxTwoLinesItem()); _rItemSet.Put(SvxCharReliefItem(static_cast<FontRelief>(_rxReportControlFormat->getCharRelief()),ITEMID_CHARRELIEF)); _rItemSet.Put(SvxColorItem(::Color(_rxReportControlFormat->getCharColor()),ITEMID_COLOR)); _rItemSet.Put(SvxCharRotateItem(_rxReportControlFormat->getCharRotation(),sal_False,ITEMID_CHARROTATE)); @@ -362,11 +361,9 @@ namespace SvxHorJustifyItem aHorJustifyItem(ITEMID_HORJUSTIFY); aHorJustifyItem.PutValue(xSet->getPropertyValue(PROPERTY_PARAADJUST),MID_HORJUST_ADJUST); _rItemSet.Put(aHorJustifyItem); - //_rItemSet.Put(SfxInt32Item(ITEMID_DEGREES,_rxReportControlFormat->getCharRotation())); SvxVerJustifyItem aVerJustifyItem(ITEMID_VERJUSTIFY); aVerJustifyItem.PutValue(xSet->getPropertyValue(PROPERTY_VERTICALALIGN),MID_HORJUST_ADJUST); _rItemSet.Put(aVerJustifyItem); - //_rItemSet.Put(SfxInt32Item(ITEMID_IDENT,_rxReportControlFormat->getCharRotation())); uno::Reference< report::XShape> xShape(_rxReportControlFormat,uno::UNO_QUERY); if ( !xShape.is() ) @@ -386,7 +383,7 @@ namespace // ------------------------------------------------------------------------- void lcl_initAwtFont( const Font& _rOriginalFont, const SfxItemSet& _rItemSet, awt::FontDescriptor& _out_rAwtFont, - USHORT _nFont, USHORT _nFontHeight,USHORT _nPosture, USHORT _nWeight) + sal_uInt16 _nFont, sal_uInt16 _nFontHeight,sal_uInt16 _nPosture, sal_uInt16 _nWeight) { Font aNewFont( _rOriginalFont ); const SfxPoolItem* pItem( NULL ); @@ -398,7 +395,7 @@ namespace aNewFont.SetFamily(pFontItem->GetFamily()); aNewFont.SetPitch(pFontItem->GetPitch()); aNewFont.SetCharSet(pFontItem->GetCharSet()); - } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_FONT,sal_True,&pItem) && pItem->ISA(SvxFontItem)) + } if ( SFX_ITEM_SET == _rItemSet.GetItemState( _nFontHeight,sal_True,&pItem) && pItem->ISA(SvxFontHeightItem)) { const SvxFontHeightItem* pFontItem = static_cast<const SvxFontHeightItem*>(pItem); @@ -544,9 +541,9 @@ namespace { const SvxCaseMapItem* pFontItem = static_cast<const SvxCaseMapItem*>(pItem); lcl_pushBack( _out_rProperties, PROPERTY_CHARCASEMAP, uno::makeAny( pFontItem->GetValue() ) ); - } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_CASEMAP,sal_True,&pItem) && pItem->ISA(SvxCaseMapItem)) + } struct Items { - USHORT nWhich; + sal_uInt16 nWhich; ::rtl::OUString sPropertyName; }; const Items pItems[] = { {ITEMID_LANGUAGE,PROPERTY_CHARLOCALE} @@ -561,7 +558,7 @@ namespace lang::Locale aCharLocale; MsLangId::convertLanguageToLocale( pFontItem->GetLanguage(), aCharLocale ); lcl_pushBack( _out_rProperties, pItems[k].sPropertyName, uno::makeAny( aCharLocale ) ); - } // if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_LANGUAGE,sal_True,&pItem) && pItem->ISA(SvxLanguageItem)) + } } if ( SFX_ITEM_SET == _rItemSet.GetItemState( ITEMID_ESCAPEMENT,sal_True,&pItem) && pItem->ISA(SvxEscapementItem)) { @@ -641,7 +638,6 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep { SID_ATTR_CHAR_SCALEWIDTH, SFX_ITEM_POOLABLE }, { SID_ATTR_CHAR_RELIEF, SFX_ITEM_POOLABLE }, { SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE }, - //{ SID_ATTR_BRUSH_CHAR, SFX_ITEM_POOLABLE }, { SID_ATTR_BRUSH, SFX_ITEM_POOLABLE }, { SID_ATTR_ALIGN_HOR_JUSTIFY, SFX_ITEM_POOLABLE }, { SID_ATTR_ALIGN_VER_JUSTIFY, SFX_ITEM_POOLABLE }, @@ -670,9 +666,9 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep new SvxPostureItem(ITALIC_NONE,ITEMID_POSTURE), new SvxWeightItem(WEIGHT_NORMAL,ITEMID_WEIGHT), - new SvxShadowedItem(FALSE,ITEMID_SHADOWED), - new SvxWordLineModeItem(FALSE,ITEMID_WORDLINEMODE), - new SvxContourItem(FALSE,ITEMID_CONTOUR), + new SvxShadowedItem(sal_False,ITEMID_SHADOWED), + new SvxWordLineModeItem(sal_False,ITEMID_WORDLINEMODE), + new SvxContourItem(sal_False,ITEMID_CONTOUR), new SvxCrossedOutItem(STRIKEOUT_NONE,ITEMID_CROSSEDOUT), new SvxUnderlineItem(UNDERLINE_NONE,ITEMID_UNDERLINE), @@ -681,15 +677,15 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep new SvxCaseMapItem(SVX_CASEMAP_NOT_MAPPED,ITEMID_CASEMAP), new SvxEscapementItem(ITEMID_ESCAPEMENT), new SvxFontListItem(pFontList.get(),ITEMID_FONTLIST), - new SvxAutoKernItem(FALSE,ITEMID_AUTOKERN), + new SvxAutoKernItem(sal_False,ITEMID_AUTOKERN), new SvxColorTableItem(pColorTable.get(),ITEMID_COLOR_TABLE), - new SvxBlinkItem(FALSE,ITEMID_BLINK), + new SvxBlinkItem(sal_False,ITEMID_BLINK), new SvxEmphasisMarkItem(EMPHASISMARK_NONE,ITEMID_EMPHASISMARK), - new SvxTwoLinesItem(TRUE,0,0,ITEMID_TWOLINES), + new SvxTwoLinesItem(sal_True,0,0,ITEMID_TWOLINES), new SvxCharRotateItem(0,sal_False,ITEMID_CHARROTATE), new SvxCharScaleWidthItem(100,ITEMID_CHARSCALE_W), new SvxCharReliefItem(RELIEF_NONE,ITEMID_CHARRELIEF), - new SvxCharHiddenItem(FALSE,ITEMID_CHARHIDDEN), + new SvxCharHiddenItem(sal_False,ITEMID_CHARHIDDEN), new SvxBrushItem(ITEMID_BRUSH), new SvxHorJustifyItem(ITEMID_HORJUSTIFY), new SvxVerJustifyItem(ITEMID_VERJUSTIFY), @@ -710,7 +706,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep OSL_ASSERT((SAL_N_ELEMENTS(pDefaults)) == (SAL_N_ELEMENTS(aItemInfos))); - static USHORT pRanges[] = + static sal_uInt16 pRanges[] = { ITEMID_FONT,ITEMID_WEIGHT_COMPLEX, 0 @@ -761,12 +757,6 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow ); - //static USHORT pRanges[] = - //{ - // XATTR_START,XATTR_END, - // 0 - //}; - bool bSuccess = false; try { @@ -813,14 +803,14 @@ void applyCharacterSettings( const uno::Reference< report::XReportControlFormat aAwtFont.Name = ::rtl::OUString(); // hack to _rxReportControlFormat->setFontDescriptor( aAwtFont ); _rxReportControlFormat->setCharFontName( sTemp ); - } // if ( aSettings.get( "Font" ) >>= aAwtFont ) + } if ( aSettings.get( "FontAsian" ) >>= aAwtFont ) { ::rtl::OUString sTemp = aAwtFont.Name; aAwtFont.Name = ::rtl::OUString(); // hack to _rxReportControlFormat->setFontDescriptorAsian( aAwtFont ); _rxReportControlFormat->setCharFontNameAsian( sTemp ); - } // if ( aSettings.get( "Font" ) >>= aAwtFont ) + } if ( aSettings.get( "FontComplex" ) >>= aAwtFont ) { ::rtl::OUString sTemp = aAwtFont.Name; @@ -899,7 +889,7 @@ SdrObject* isOver(const Rectangle& _rRect, SdrPage& _rPage, SdrView& _rView, boo return pOverlappedObj; } // ----------------------------------------------------------------------------- -bool checkArrayForOccurance(SdrObject* _pObjToCheck, SdrUnoObj* _pIgnore[], int _nListLength) +bool checkArrayForOccurrence(SdrObject* _pObjToCheck, SdrUnoObj* _pIgnore[], int _nListLength) { for(int i=0;i<_nListLength;i++) { @@ -920,7 +910,7 @@ SdrObject* isOver(const Rectangle& _rRect,SdrPage& _rPage,SdrView& _rView,bool _ while( !pOverlappedObj && (pObjIter = aIter.Next()) != NULL ) { - if (checkArrayForOccurance(pObjIter, _pIgnoreList, _nIgnoreListLength)) + if (checkArrayForOccurrence(pObjIter, _pIgnoreList, _nIgnoreListLength)) { continue; } @@ -1002,9 +992,6 @@ void correctOverlapping(SdrObject* _pControl,OReportSection& _aReportSection,boo { OSectionView& rSectionView = _aReportSection.getSectionView(); uno::Reference< report::XReportComponent> xComponent(_pControl->getUnoShape(),uno::UNO_QUERY); - // Rectangle aRet(VCLPoint(xComponent->getPosition()),VCLSize(xComponent->getSize())); - // aRet.setHeight(aRet.getHeight() + 1); - // aRet.setWidth(aRet.getWidth() + 1); Rectangle aRect = getRectangleFromControl(_pControl); bool bOverlapping = true; @@ -1040,7 +1027,6 @@ bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula OSL_PRECOND( _xInspectorWindow.is(), "openDialogFormula_nothrow: invalid parameters!" ); if ( !_xInspectorWindow.is() ) return false; - // _out_rFormula = ::rtl::OUString(); bool bSuccess = false; ::dbtools::SQLExceptionInfo aErrorInfo; uno::Reference< awt::XWindow > xInspectorWindow; @@ -1074,7 +1060,7 @@ bool openDialogFormula_nothrow( ::rtl::OUString& _in_out_rFormula catch (sdbc::SQLException& e) { aErrorInfo = e; } catch( const uno::Exception& ) { - OSL_ENSURE( sal_False, "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" ); + OSL_FAIL( "GeometryHandler::impl_dialogFilter_nothrow: caught an exception!" ); } if ( aErrorInfo.isValid() ) diff --git a/reportdesign/source/ui/misc/makefile.mk b/reportdesign/source/ui/misc/makefile.mk index b12bafdc7760..494b68023d62 100644 --- a/reportdesign/source/ui/misc/makefile.mk +++ b/reportdesign/source/ui/misc/makefile.mk @@ -44,7 +44,7 @@ VISIBILITY_HIDDEN=TRUE # ... object files ............................ EXCEPTIONSFILES= \ - $(SLO)$/Undo.obj \ + $(SLO)$/RptUndo.obj \ $(SLO)$/ColorListener.obj \ $(SLO)$/UITools.obj \ $(SLO)$/rptuiservices.obj \ diff --git a/reportdesign/source/ui/misc/rptuiservices.cxx b/reportdesign/source/ui/misc/rptuiservices.cxx index ee0fc6512c32..61d1b20ab432 100644 --- a/reportdesign/source/ui/misc/rptuiservices.cxx +++ b/reportdesign/source/ui/misc/rptuiservices.cxx @@ -82,11 +82,5 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnviron *envTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo( - void * serviceManager, void * registryKey) -{ - return cppu::component_writeInfoHelper( - serviceManager, registryKey, entries); -} -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/reportdesign/source/ui/misc/statusbarcontroller.cxx b/reportdesign/source/ui/misc/statusbarcontroller.cxx index a169c8279026..2de27a2217c4 100644 --- a/reportdesign/source/ui/misc/statusbarcontroller.cxx +++ b/reportdesign/source/ui/misc/statusbarcontroller.cxx @@ -100,21 +100,21 @@ void SAL_CALL OStatusbarController::initialize( const Sequence< Any >& _rArgumen StatusBar* pStatusBar = static_cast<StatusBar*>(VCLUnoHelper::GetWindow(m_xParentWindow)); if ( pStatusBar ) { - const USHORT nCount = pStatusBar->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + const sal_uInt16 nCount = pStatusBar->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - const USHORT nItemId = pStatusBar->GetItemId(nPos); + const sal_uInt16 nItemId = pStatusBar->GetItemId(nPos); if ( pStatusBar->GetItemCommand(nItemId) == String(m_aCommandURL) ) { m_nId = nItemId; break; } } - if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") ) + if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:ZoomSlider")) ) { m_pController = TStatusbarHelper::createFromQuery(new SvxZoomSliderControl(m_nSlotId = SID_ATTR_ZOOMSLIDER,m_nId,*pStatusBar)); - } // if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") ) - else if ( m_aCommandURL.equalsAscii(".uno:Zoom") ) + } + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:Zoom")) ) { m_pController = TStatusbarHelper::createFromQuery(new SvxZoomStatusBarControl(m_nSlotId = SID_ATTR_ZOOM,m_nId,*pStatusBar)); } @@ -137,7 +137,7 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv if ( m_pController.is() ) { - if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") ) + if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:ZoomSlider")) ) { Sequence< PropertyValue > aSeq; if ( (_aEvent.State >>= aSeq) && aSeq.getLength() == 2 ) @@ -146,8 +146,8 @@ void SAL_CALL OStatusbarController::statusChanged( const FeatureStateEvent& _aEv aZoomSlider.PutValue(_aEvent.State); static_cast<SvxZoomSliderControl*>(m_pController.get())->StateChanged(m_nSlotId,SFX_ITEM_AVAILABLE,&aZoomSlider); } - } // if ( m_aCommandURL.equalsAscii(".uno:ZoomSlider") ) - else if ( m_aCommandURL.equalsAscii(".uno:Zoom") ) + } + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:Zoom")) ) { Sequence< PropertyValue > aSeq; if ( (_aEvent.State >>= aSeq) && aSeq.getLength() == 3 ) diff --git a/reportdesign/source/ui/misc/toolboxcontroller.cxx b/reportdesign/source/ui/misc/toolboxcontroller.cxx index a009e4393de0..016573d21c01 100644 --- a/reportdesign/source/ui/misc/toolboxcontroller.cxx +++ b/reportdesign/source/ui/misc/toolboxcontroller.cxx @@ -149,52 +149,52 @@ void SAL_CALL OToolboxController::initialize( const Sequence< Any >& _rArguments ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent())); if ( pToolBox ) { - const USHORT nCount = pToolBox->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + const sal_uInt16 nCount = pToolBox->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - const USHORT nItemId = pToolBox->GetItemId(nPos); + const sal_uInt16 nItemId = pToolBox->GetItemId(nPos); if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) ) { m_nToolBoxId = nItemId; break; } } - if ( m_aCommandURL.equalsAscii(".uno:BasicShapes") ) + if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:BasicShapes")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:BasicShapes")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_BASIC,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:SymbolShapes") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:SymbolShapes")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:SymbolShapes")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_SYMBOL,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:ArrowShapes") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:ArrowShapes")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:ArrowShapes")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_ARROW,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:FlowChartShapes") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:FlowChartShapes")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FlowChartShapes")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_FLOWCHART,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:CalloutShapes") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:CalloutShapes")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CalloutShapes")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_CALLOUT,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:StarShapes") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:StarShapes")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:StarShapes")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxTbxCtlCustomShapes(m_nSlotId = SID_DRAWTBX_CS_STAR,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:CharFontName") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:CharFontName")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:CharFontName")),sal_True)); m_pToolbarController = TToolbarHelper::createFromQuery(new SvxFontNameToolBoxControl/*SvxStyleToolBoxControl*/(m_nSlotId = SID_ATTR_CHAR_FONT,m_nToolBoxId,*pToolBox)); } - else if ( m_aCommandURL.equalsAscii(".uno:FontColor") || m_aCommandURL.equalsAscii(".uno:Color") ) + else if ( m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:FontColor")) || m_aCommandURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:Color")) ) { m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:FontColor")),sal_True)); m_aStates.insert(TCommandState::value_type(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:Color")),sal_True)); @@ -231,9 +231,9 @@ void SAL_CALL OToolboxController::statusChanged( const FeatureStateEvent& Event sal_Bool bCheckmark = sal_False; //m_pToolbarController->GetToolBox().Enable(Event.IsEnabled); ToolBox& rTb = m_pToolbarController->GetToolBox(); - for ( USHORT i = 0; i < rTb.GetItemCount(); i++ ) + for ( sal_uInt16 i = 0; i < rTb.GetItemCount(); i++ ) { - USHORT nId = rTb.GetItemId( i ); + sal_uInt16 nId = rTb.GetItemId( i ); if ( nId == 0 ) continue; diff --git a/reportdesign/source/ui/report/DesignView.cxx b/reportdesign/source/ui/report/DesignView.cxx index 3e97c4e0f002..b8791bc294ff 100644 --- a/reportdesign/source/ui/report/DesignView.cxx +++ b/reportdesign/source/ui/report/DesignView.cxx @@ -114,20 +114,20 @@ public: long nReportSize = GetItemSize( REPORT_ID ); long nTaskPaneSize = GetItemSize( TASKPANE_ID ); - BOOL bMod = FALSE; + sal_Bool bMod = sal_False; if( nReportSize < nReportMinSplitSize ) { nReportSize = nReportMinSplitSize; nTaskPaneSize = 99 - nReportMinSplitSize; - bMod = TRUE; + bMod = sal_True; } else if( nTaskPaneSize < nTaskPaneMinSplitSize ) { nTaskPaneSize = nTaskPaneMinSplitSize; nReportSize = 99 - nTaskPaneMinSplitSize; - bMod = TRUE; + bMod = sal_True; } if( bMod ) @@ -156,12 +156,12 @@ ODesignView::ODesignView( Window* pParent, ,m_eMode( RPTUI_SELECT ) ,m_nCurrentPosition(USHRT_MAX) ,m_eActObj( OBJ_NONE ) - ,m_bFirstDraw(FALSE) + ,m_bFirstDraw(sal_False) ,m_aGridSizeCoarse( 1000, 1000 ) // #i93595# 100TH_MM changed to grid using coarse 1 cm grid ,m_aGridSizeFine( 250, 250 ) // and a 0,25 cm subdivision for better visualisation - ,m_bGridVisible(TRUE) - ,m_bGridSnap(TRUE) - ,m_bDeleted( FALSE ) + ,m_bGridVisible(sal_True) + ,m_bGridSnap(sal_True) + ,m_bDeleted( sal_False ) { DBG_CTOR( rpt_ODesignView,NULL); SetHelpId(UID_RPT_RPT_APP_VIEW); @@ -171,14 +171,11 @@ ODesignView::ODesignView( Window* pParent, // now create the task pane on the right side :-) m_pTaskPane = new OTaskWindow(this); - //m_pTaskPane->Show(); m_aSplitWin.InsertItem( COLSET_ID,100,SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE | SWIB_COLSET ); - m_aSplitWin.InsertItem( REPORT_ID, &m_aScrollWindow, 100/*m_aScrollWindow.getMaxMarkerWidth(sal_False)*/, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE /*SWIB_COLSET*/); - //m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane, 50, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE ); + m_aSplitWin.InsertItem( REPORT_ID, &m_aScrollWindow, 100, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); // Splitter einrichten - //m_aSplitter.SetSplitHdl(LINK(this, ODesignView,SplitHdl)); m_aSplitWin.SetSplitHdl(LINK(this, ODesignView,SplitHdl)); m_aSplitWin.ShowAutoHideButton(); m_aSplitWin.SetAlign(WINDOWALIGN_LEFT); @@ -192,7 +189,7 @@ ODesignView::ODesignView( Window* pParent, ODesignView::~ODesignView() { DBG_DTOR( rpt_ODesignView,NULL); - m_bDeleted = TRUE; + m_bDeleted = sal_True; Hide(); m_aScrollWindow.Hide(); m_aMarkTimer.Stop(); @@ -204,7 +201,7 @@ ODesignView::~ODesignView() } if ( m_pAddField ) { - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) ); + SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( UID_RPT_RPT_APP_VIEW ) ); aDlgOpt.SetWindowState( ::rtl::OUString::createFromAscii( m_pAddField->GetWindowState(WINDOWSTATE_MASK_ALL).GetBuffer() ) ); notifySystemWindow(this,m_pAddField,::comphelper::mem_fun(&TaskPaneList::RemoveWindow)); ::std::auto_ptr<Window> aTemp2(m_pAddField); @@ -249,7 +246,12 @@ long ODesignView::PreNotify( NotifyEvent& rNEvt ) switch(rNEvt.GetType()) { case EVENT_KEYINPUT: - //if ( nRet != 1L ) + if ( (m_pPropWin && m_pPropWin->HasChildPathFocus()) ) + return 0L; + if ( (m_pAddField && m_pAddField->HasChildPathFocus()) ) + return 0L; + if ( (m_pReportExplorer && m_pReportExplorer->HasChildPathFocus()) ) + return 0L; { const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); if ( handleKeyEvent(*pKeyEvent) ) @@ -291,7 +293,7 @@ void ODesignView::resizeDocumentView(Rectangle& _rPlayground) nSplitPos = static_cast<sal_Int32>(_rPlayground.Right() - nMinWidth); getController().setSplitPos(nSplitPos); } - } // if ( 0 != _rPlaygroundSize.Width() ) + } Size aReportWindowSize(aPlaygroundSize); if ( m_aSplitWin.IsItemValid(TASKPANE_ID) ) @@ -359,7 +361,7 @@ void ODesignView::SetMode( DlgEdMode _eNewMode ) m_aScrollWindow.SetMode(_eNewMode); } //---------------------------------------------------------------------------- -void ODesignView::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void ODesignView::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { m_eActObj = eObj; m_aScrollWindow.SetInsertObj( eObj,_sShapeType ); @@ -371,7 +373,7 @@ rtl::OUString ODesignView::GetInsertObjString() const } //---------------------------------------------------------------------------- -USHORT ODesignView::GetInsertObj() const +sal_uInt16 ODesignView::GetInsertObj() const { return m_eActObj; } @@ -402,13 +404,13 @@ void ODesignView::Delete() m_aScrollWindow.Delete(); } //---------------------------------------------------------------------------- -BOOL ODesignView::HasSelection() const +sal_Bool ODesignView::HasSelection() const { return m_aScrollWindow.HasSelection(); } //---------------------------------------------------------------------------- -BOOL ODesignView::IsPasteAllowed() const +sal_Bool ODesignView::IsPasteAllowed() const { return m_aScrollWindow.IsPasteAllowed(); } @@ -436,7 +438,7 @@ void ODesignView::toggleGrid(sal_Bool _bGridVisible) m_aScrollWindow.toggleGrid(_bGridVisible); } //---------------------------------------------------------------------------- -USHORT ODesignView::getSectionCount() const +sal_uInt16 ODesignView::getSectionCount() const { return m_aScrollWindow.getSectionCount(); } @@ -446,12 +448,12 @@ void ODesignView::showRuler(sal_Bool _bShow) m_aScrollWindow.showRuler(_bShow); } //---------------------------------------------------------------------------- -void ODesignView::removeSection(USHORT _nPosition) +void ODesignView::removeSection(sal_uInt16 _nPosition) { m_aScrollWindow.removeSection(_nPosition); } //---------------------------------------------------------------------------- -void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition) +void ODesignView::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,sal_uInt16 _nPosition) { m_aScrollWindow.addSection(_xSection,_sColorEntry,_nPosition); } @@ -470,11 +472,7 @@ void ODesignView::GetFocus() // ----------------------------------------------------------------------------- void ODesignView::ImplInitSettings() { -//#if OSL_DEBUG_LEVEL > 0 -// SetBackground( Wallpaper( COL_RED )); -//#else SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() )); -//#endif SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() ); SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() ); } @@ -530,12 +528,10 @@ void ODesignView::togglePropertyBrowser(sal_Bool _bToogleOn) m_pTaskPane->Invalidate(); if ( bWillBeVisible ) - m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE/*|SWIB_COLSET */); + m_aSplitWin.InsertItem( TASKPANE_ID, m_pTaskPane,START_SIZE_TASKPANE, SPLITWINDOW_APPEND, COLSET_ID, SWIB_PERCENTSIZE); else m_aSplitWin.RemoveItem(TASKPANE_ID); - // TRY - // Invalidate(/*INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE*/); if ( bWillBeVisible ) m_aMarkTimer.Start(); } @@ -553,7 +549,7 @@ void ODesignView::showProperties(const uno::Reference< uno::XInterface>& _xRepor } } //----------------------------------------------------------------------------- -BOOL ODesignView::isReportExplorerVisible() const +sal_Bool ODesignView::isReportExplorerVisible() const { return m_pReportExplorer && m_pReportExplorer->IsVisible(); } @@ -574,7 +570,7 @@ void ODesignView::toggleReportExplorer() m_pReportExplorer->Show(!m_pReportExplorer->IsVisible()); } //----------------------------------------------------------------------------- -BOOL ODesignView::isAddFieldVisible() const +sal_Bool ODesignView::isAddFieldVisible() const { return m_pAddField && m_pAddField->IsVisible(); } @@ -601,7 +597,7 @@ void ODesignView::toggleAddField() uno::Reference < beans::XPropertySet > xSet(rReportController.getRowSet(),uno::UNO_QUERY); m_pAddField = new OAddFieldWindow(this,xSet); m_pAddField->SetCreateHdl(LINK( &rReportController, OReportController, OnCreateHdl ) ); - SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( UID_RPT_RPT_APP_VIEW ) ); + SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromAscii( UID_RPT_RPT_APP_VIEW ) ); if ( aDlgOpt.Exists() ) m_pAddField->SetWindowState( ByteString( aDlgOpt.GetWindowState().getStr(), RTL_TEXTENCODING_ASCII_US ) ); m_pAddField->Update(); @@ -619,12 +615,6 @@ uno::Reference< report::XSection > ODesignView::getCurrentSection() const if ( m_pCurrentView ) xSection = m_pCurrentView->getReportSection()->getSection(); - // why do we need the code below? - //else - // { - // OReportController& rReportController = getController(); - // xSection = rReportController.getReportDefinition()->getDetail(); - // } return xSection; } // ----------------------------------------------------------------------------- @@ -745,13 +735,13 @@ void ODesignView::fillControlModelSelection(::std::vector< uno::Reference< uno:: m_aScrollWindow.fillControlModelSelection(_rSelection); } // ----------------------------------------------------------------------------- -void ODesignView::setGridSnap(BOOL bOn) +void ODesignView::setGridSnap(sal_Bool bOn) { m_aScrollWindow.setGridSnap(bOn); } // ----------------------------------------------------------------------------- -void ODesignView::setDragStripes(BOOL bOn) +void ODesignView::setDragStripes(sal_Bool bOn) { m_aScrollWindow.setDragStripes(bOn); } diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index 92b6b716860f..77fb99286993 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -47,7 +47,7 @@ OEndMarker::OEndMarker(Window* _pParent ,const ::rtl::OUString& _sColorEntry) DBG_CTOR( rpt_OEndMarker,NULL); SetUniqueId(HID_RPT_ENDMARKER); ImplInitSettings(); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); } // ----------------------------------------------------------------------------- OEndMarker::~OEndMarker() @@ -69,14 +69,14 @@ void OEndMarker::Paint( const Rectangle& /*rRect*/ ) Color aStartColor(m_nColor); aStartColor.IncreaseLuminance(10); - USHORT nHue = 0; - USHORT nSat = 0; - USHORT nBri = 0; + sal_uInt16 nHue = 0; + sal_uInt16 nSat = 0; + sal_uInt16 nBri = 0; aStartColor.RGBtoHSB(nHue, nSat, nBri); nSat += 40; Color aEndColor(Color::HSBtoRGB(nHue, nSat, nBri)); Gradient aGradient(GRADIENT_LINEAR,aStartColor,aEndColor); - aGradient.SetSteps(static_cast<USHORT>(aSize.Height())); + aGradient.SetSteps(static_cast<sal_uInt16>(aSize.Height())); DrawGradient(PixelToLogic(aPoly) ,aGradient); if ( m_bMarked ) diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx index 67c6829b75ec..2d6555dff6bc 100644 --- a/reportdesign/source/ui/report/FixedTextColor.cxx +++ b/reportdesign/source/ui/report/FixedTextColor.cxx @@ -69,69 +69,6 @@ namespace rptui } //-------------------------------------------------------------------- - // sal_Int32 FixedTextColor::getTextColor() - // { - // const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings(); - // BOOL bHighContrast = aStyleSettings.GetHighContrastMode(); - // - // Color aGetFaceColor = aStyleSettings.GetFaceColor(); - // Color aGetCheckedColor = aStyleSettings.GetCheckedColor(); - // Color aGetLightColor = aStyleSettings.GetLightColor(); - // Color aGetLightBorderColor = aStyleSettings.GetLightBorderColor(); - // Color aGetShadowColor = aStyleSettings.GetShadowColor(); - // Color aGetDarkShadowColor = aStyleSettings.GetDarkShadowColor(); - // Color aGetButtonTextColor = aStyleSettings.GetButtonTextColor(); - // Color aGetButtonRolloverTextColor = aStyleSettings.GetButtonRolloverTextColor(); - // Color aGetRadioCheckTextColor = aStyleSettings.GetRadioCheckTextColor(); - // Color aGetGroupTextColor = aStyleSettings.GetGroupTextColor(); - // Color aGetLabelTextColor = aStyleSettings.GetLabelTextColor(); - // Color aGetInfoTextColor = aStyleSettings.GetInfoTextColor(); - // Color aGetWindowColor = aStyleSettings.GetWindowColor(); - // Color aGetWindowTextColor = aStyleSettings.GetWindowTextColor(); - // Color aGetDialogColor = aStyleSettings.GetDialogColor(); - // Color aGetDialogTextColor = aStyleSettings.GetDialogTextColor(); - // Color aGetWorkspaceColor = aStyleSettings.GetWorkspaceColor(); - // Color aGetFieldColor = aStyleSettings.GetFieldColor(); - // Color aGetFieldTextColor = aStyleSettings.GetFieldTextColor(); - // Color aGetFieldRolloverTextColor = aStyleSettings.GetFieldRolloverTextColor(); - // Color aGetActiveColor = aStyleSettings.GetActiveColor(); - // Color aGetActiveColor2 = aStyleSettings.GetActiveColor2(); - // Color aGetActiveTextColor = aStyleSettings.GetActiveTextColor(); - // Color aGetActiveBorderColor = aStyleSettings.GetActiveBorderColor(); - // Color aGetDeactiveColor = aStyleSettings.GetDeactiveColor(); - // Color aGetDeactiveColor2 = aStyleSettings.GetDeactiveColor2(); - // Color aGetDeactiveTextColor = aStyleSettings.GetDeactiveTextColor(); - // Color aGetDeactiveBorderColor = aStyleSettings.GetDeactiveBorderColor(); - // Color aGetHighlightColor = aStyleSettings.GetHighlightColor(); - // Color aGetHighlightTextColor = aStyleSettings.GetHighlightTextColor(); - // Color aGetDisableColor = aStyleSettings.GetDisableColor(); - // Color aGetHelpColor = aStyleSettings.GetHelpColor(); - // Color aGetHelpTextColor = aStyleSettings.GetHelpTextColor(); - // Color aGetMenuColor = aStyleSettings.GetMenuColor(); - // Color aGetMenuBarColor = aStyleSettings.GetMenuBarColor(); - // Color aGetMenuBorderColor = aStyleSettings.GetMenuBorderColor(); - // Color aGetMenuTextColor = aStyleSettings.GetMenuTextColor(); - // Color aGetMenuHighlightColor = aStyleSettings.GetMenuHighlightColor(); - // Color aGetMenuHighlightTextColor = aStyleSettings.GetMenuHighlightTextColor(); - // Color aGetLinkColor = aStyleSettings.GetLinkColor(); - // Color aGetVisitedLinkColor = aStyleSettings.GetVisitedLinkColor(); - // Color aGetHighlightLinkColor = aStyleSettings.GetHighlightLinkColor(); - // Color aGetMonoColor = aStyleSettings.GetMonoColor(); - // Color aGetActiveTabColor = aStyleSettings.GetActiveTabColor(); - // Color aGetInactiveTabColor = aStyleSettings.GetInactiveTabColor(); - // - // Color aWindowColor = aStyleSettings.GetWindowColor(); - // Color aLabelColor = aStyleSettings.GetLabelTextColor(); - // - // // if (m_nTextColor == -1) - // // { - // // svtools::ExtendedColorConfig aConfig; - // // m_nTextColor = aConfig.GetColorValue(CFG_REPORTDESIGNER, DBTEXTBOXBOUNDCONTENT).getColor(); - // // } - // return aLabelColor.GetColor(); - // } - - //-------------------------------------------------------------------- FixedTextColor::~FixedTextColor() { DBG_DTOR(rpt_FixedTextColor,NULL); @@ -140,7 +77,6 @@ namespace rptui void FixedTextColor::notifyPropertyChange( const beans::PropertyChangeEvent& _rEvent ) { - // (void)_rEvent; uno::Reference< report::XFixedText > xFixedText( _rEvent.Source, uno::UNO_QUERY ); if ( ! xFixedText.is() ) { @@ -151,11 +87,8 @@ namespace rptui { uno::Reference< lang::XComponent > xComponent( xFixedText, uno::UNO_QUERY_THROW ); handle(xComponent); - // uno::Reference<awt::XVclWindowPeer> xVclWindowPeer = getVclWindowPeer(xComponent); - - // setPropertyTextColor(xVclWindowPeer, getTextColor()); } - catch (uno::Exception e) + catch (uno::Exception const&) { DBG_UNHANDLED_EXCEPTION(); } @@ -176,7 +109,6 @@ namespace rptui // ----------------------------------------------------------------------------- void FixedTextColor::handle( const uno::Reference< uno::XInterface >& _rxElement ) { - // (void) _rxElement; uno::Reference< report::XFixedText > xFixedText( _rxElement, uno::UNO_QUERY ); if ( ! xFixedText.is() ) { @@ -247,7 +179,7 @@ namespace rptui if ( xSection.is() ) { OReportPage *pPage = pModel->getPage(xSection); - ULONG nIndex = pPage->getIndexOf(_xFixedText.get()); + sal_uLong nIndex = pPage->getIndexOf(_xFixedText.get()); if (nIndex < pPage->GetObjCount() ) { SdrObject *pObject = pPage->GetObj(nIndex); diff --git a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx index 4cb76497d7f8..f7529c94bce8 100644 --- a/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx +++ b/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx @@ -150,7 +150,7 @@ namespace rptui // ----------------------------------------------------------------------------- void FormattedFieldBeautifier::notifyPropertyChange( const beans::PropertyChangeEvent& _rEvent ) { - if ( !_rEvent.PropertyName.equalsAscii( "DataField" ) ) + if ( !_rEvent.PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DataField" ) ) ) // not interested in return; @@ -180,14 +180,13 @@ namespace rptui if ( xSection.is() ) { OReportPage *pPage = pModel->getPage(xSection); - ULONG nIndex = pPage->getIndexOf(_xComponent); + sal_uLong nIndex = pPage->getIndexOf(_xComponent); if (nIndex < pPage->GetObjCount() ) { SdrObject *pObject = pPage->GetObj(nIndex); OUnoObject* pUnoObj = dynamic_cast<OUnoObject*>(pObject); if ( pUnoObj ) // this doesn't need to be done for shapes { - // Rectangle aRect = pUnoObj->GetCurrentBoundRect(); ::boost::shared_ptr<OSectionWindow> pSectionWindow = m_rReportController.getSectionWindow(xSection); if (pSectionWindow != NULL) { diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 4b520a915a9a..3f44e172ee00 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -100,6 +100,7 @@ #include <com/sun/star/sdb/SQLContext.hpp> #include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/document/XUndoManagerSupplier.hpp> #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> @@ -127,7 +128,7 @@ #include "DesignView.hxx" #include "ModuleHelper.hxx" #include "RptObject.hxx" -#include "Undo.hxx" +#include "RptUndo.hxx" #include "uistrings.hrc" #include "RptDef.hxx" #include "ReportSection.hxx" @@ -153,10 +154,12 @@ #include <toolkit/helper/vclunohelper.hxx> #include "UndoEnv.hxx" #include "InsertFunctions.hxx" +#include "ReportControllerObserver.hxx" #include <boost/mem_fn.hpp> #include <boost/bind.hpp> #include <boost/utility.hpp> +#include <boost/scoped_ptr.hpp> #include <cppuhelper/exc_hlp.hxx> #include <unotools/confignode.hxx> @@ -164,7 +167,7 @@ #include <ReportControllerObserver.hxx> -#define MAX_ROWS_FOR_PREVIEW 50 +#define MAX_ROWS_FOR_PREVIEW 20 using namespace ::com::sun::star; using namespace uno; @@ -194,11 +197,11 @@ namespace { bool operator() (const beans::PropertyValue& x, const ::rtl::OUString& y) const { - return x.Name.equals(y);// ? true : false; + return x.Name.equals(y); } bool operator() (const ::rtl::OUString& x,const beans::PropertyValue& y) const { - return x.equals(y.Name);// ? true : false; + return x.equals(y.Name); } }; @@ -221,16 +224,16 @@ namespace aFontDescriptor.Underline = awt::FontUnderline::SINGLE - aFontDescriptor.Underline; break; default: - OSL_ENSURE(0,"Illegal value in default!"); + OSL_FAIL("Illegal value in default!"); break; } _xReportControlFormat->setFontDescriptor(aFontDescriptor); } - catch(beans::UnknownPropertyException&) + catch(const beans::UnknownPropertyException&) { } - } // if ( xReportControlFormat.is() ) + } } } @@ -246,14 +249,16 @@ void lcl_getReportControlFormat(const Sequence< PropertyValue >& aArgs, SequenceAsHashMap aMap(aArgs); xReportControlFormat = aMap.getUnpackedValueOrDefault(REPORTCONTROLFORMAT,uno::Reference< report::XReportControlFormat>()); _xWindow = aMap.getUnpackedValueOrDefault(CURRENT_WINDOW,uno::Reference< awt::XWindow>()); - } // if ( aArgs.getLength() ) + } + if ( !xReportControlFormat.is() ) { _pView->fillControlModelSelection(_rControlsFormats); - //xReportControlFormat.set( _pView->getCurrentControlModel(),uno::UNO_QUERY); - } // if ( !xReportControlFormat.is() ) + } else + { _rControlsFormats.push_back(xReportControlFormat); + } if ( !_xWindow.is() ) _xWindow = VCLUnoHelper::GetInterface(_pView); @@ -340,7 +345,7 @@ void OReportController::disposing() m_pClipbordNotifier->AddRemoveListener( getView(), sal_False ); m_pClipbordNotifier->release(); m_pClipbordNotifier = NULL; - } // if ( getView() && m_pClipbordNotifier ) + } if ( m_pGroupsFloater ) { SvtViewOptions aDlgOpt( E_WINDOW, String::CreateFromInt32( RID_GROUPS_SORTING ) ); @@ -357,9 +362,9 @@ void OReportController::disposing() ::comphelper::disposeComponent( m_xRowSetMediator ); ::comphelper::disposeComponent( m_xFormatter ); } - catch(uno::Exception&) + catch(const uno::Exception&) { - OSL_ENSURE(0,"Exception caught while disposing row sets."); + OSL_FAIL("Exception caught while disposing row sets."); } m_xRowSet.clear(); m_xRowSetMediator.clear(); @@ -373,14 +378,15 @@ void OReportController::disposing() pSectionWindow = getDesignView()->getMarkedSection(); if ( pSectionWindow ) pSectionWindow->getReportSection().deactivateOle(); - getUndoMgr()->Clear(); // clear all undo redo things + clearUndoManager(); if ( m_aReportModel ) listen(false); m_pReportControllerObserver->Clear(); m_pReportControllerObserver->release(); } - catch(uno::Exception&) + catch(const uno::Exception&) { + DBG_UNHANDLED_EXCEPTION(); } } @@ -392,7 +398,6 @@ void OReportController::disposing() OReportController_BASE::disposing(); - // disconnect(); try { m_xReportDefinition.clear(); @@ -400,7 +405,7 @@ void OReportController::disposing() m_xFrameLoader.clear(); m_xReportEngine.clear(); } - catch(uno::Exception&) + catch(const uno::Exception&) { } if ( getDesignView() ) @@ -458,15 +463,27 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const break; case SID_REDO: case SID_UNDO: - aReturn = OReportController_BASE::GetState(_nId); - aReturn.bEnabled = aReturn.bEnabled; + { + size_t ( SfxUndoManager::*retrieveCount )( bool const ) const = + ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionCount : &SfxUndoManager::GetRedoActionCount; + + SfxUndoManager& rUndoManager( getUndoManager() ); + aReturn.bEnabled = ( rUndoManager.*retrieveCount )( ::svl::IUndoManager::TopLevel ) > 0; + if ( aReturn.bEnabled ) + { + // TODO: add "Undo/Redo: prefix" + String ( SfxUndoManager::*retrieveComment )( size_t, bool const ) const = + ( _nId == SID_UNDO ) ? &SfxUndoManager::GetUndoActionComment : &SfxUndoManager::GetRedoActionComment; + aReturn.sTitle = (rUndoManager.*retrieveComment)( 0, ::svl::IUndoManager::TopLevel ); + } + } break; case SID_OBJECT_RESIZING: case SID_OBJECT_SMALLESTWIDTH: case SID_OBJECT_SMALLESTHEIGHT: case SID_OBJECT_GREATESTWIDTH: case SID_OBJECT_GREATESTHEIGHT: - aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();// && getDesignView()->isAlignPossible(); + aReturn.bEnabled = isEditable() && getDesignView()->HasSelection(); if ( aReturn.bEnabled ) aReturn.bEnabled = m_nSelectionCount > 1; break; @@ -528,7 +545,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_SECTION_ALIGN_UP: case SID_SECTION_ALIGN_MIDDLE: case SID_SECTION_ALIGN_DOWN: - aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();// && getDesignView()->isAlignPossible(); + aReturn.bEnabled = isEditable() && getDesignView()->HasSelection(); break; case SID_CUT: aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId); @@ -564,7 +581,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_EXPAND_SECTION: case SID_NEXT_MARK: case SID_PREV_MARK: - aReturn.bEnabled = isEditable(); + aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent(_nId); break; case SID_SELECT: case SID_SELECT_REPORT: @@ -809,7 +826,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const const uno::Reference< report::XReportControlModel> xControlModel(getDesignView()->getCurrentControlModel(),uno::UNO_QUERY); aReturn.bEnabled = !xControlModel.is(); } - catch(beans::UnknownPropertyException&) + catch(const beans::UnknownPropertyException&) { } else @@ -843,7 +860,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const break; default: ; - } // switch(_nCommand) + } } break; case SID_ATTR_CHAR_COLOR: @@ -888,7 +905,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const aReturn.bChecked = _nId == SID_ATTR_PARA_ADJUST_CENTER; break; } - } // if ( aReturn.aValue >>= nParaAdjust ) + } aReturn.aValue.clear(); } break; @@ -898,7 +915,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const break; case SID_CHAR_DLG: case SID_SETCONTROLDEFAULTS: - aReturn.bEnabled = m_xReportDefinition.is() && isEditable();// && getDesignView()->getCurrentControlModel().is(); + aReturn.bEnabled = m_xReportDefinition.is() && isEditable(); if ( aReturn.bEnabled ) { ::std::vector< uno::Reference< uno::XInterface > > aSelection; @@ -935,7 +952,6 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const SvxZoomItem aZoom(m_eZoomType,m_nZoomValue); aZoom.SetValueSet(SVX_ZOOM_ENABLE_50|SVX_ZOOM_ENABLE_75|SVX_ZOOM_ENABLE_100|SVX_ZOOM_ENABLE_200); aZoom.QueryValue(aReturn.aValue); - //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue); } break; case SID_ATTR_ZOOMSLIDER: @@ -947,7 +963,6 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const aZoomSlider.AddSnappingPoint(100); aZoomSlider.AddSnappingPoint(200); aZoomSlider.QueryValue(aReturn.aValue); - //aReturn.sTitle = ::rtl::OUString::valueOf((sal_Int32)m_nZoomValue); } break; default: @@ -985,37 +1000,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); - if ( !getView() ) - { - switch(_nId) - { - case SID_RULER: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bShowRuler; - break; - case SID_HELPLINES_MOVE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bHelplinesMove; - break; - case SID_GRID_VISIBLE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bGridVisible; - break; - case SID_SHOW_PROPERTYBROWSER: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_bShowProperties; - break; - case SID_PROPERTYBROWSER_LAST_PAGE: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_sLastActivePage; - break; - case SID_SPLIT_POSITION: - OSL_ENSURE(aArgs.getLength() == 1,"Invalid length!"); - aArgs[0].Value >>= m_nSplitPos; - break; - } - return; // return without execution - } + sal_Bool bForceBroadcast = sal_False; switch(_nId) { @@ -1055,10 +1040,12 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_REDO: case SID_UNDO: { - // const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() ); - // We would like to know if we are in undo mode const OXUndoEnvironment::OUndoMode aLock( m_aReportModel->GetUndoEnv() ); - OReportController_BASE::Execute( _nId, aArgs ); + sal_Bool ( SfxUndoManager::*doXDo )() = + ( _nId == SID_UNDO ) ? &SfxUndoManager::Undo : &SfxUndoManager::Redo; + + SfxUndoManager& rUndoManager( getUndoManager() ); + (rUndoManager.*doXDo)(); InvalidateAll(); updateFloater(); } @@ -1169,7 +1156,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > select(uno::makeAny(m_xReportDefinition)); break; case SID_EXECUTE_REPORT: - /*m_nExecuteReportEvent = */getView()->PostUserEvent(LINK(this, OReportController,OnExecuteReport)); + getView()->PostUserEvent(LINK(this, OReportController,OnExecuteReport)); break; case SID_RPT_NEW_FUNCTION: createNewFunction(aArgs[0].Value); @@ -1196,7 +1183,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > uno::Reference< report::XFunctions> xFunctions(xFunction->getParent(),uno::UNO_QUERY_THROW); sal_Int32 nIndex = getPositionInIndexAccess(xFunctions.get(),xFunction); const String sUndoAction = String((ModuleRes(RID_STR_UNDO_REMOVE_FUNCTION))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); xFunctions->removeByIndex(nIndex); select(uno::makeAny(xFunctions->getParent())); InvalidateFeature( SID_SAVEDOC ); @@ -1223,14 +1210,6 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > InvalidateAll(); break; case SID_INSERT_DIAGRAM: - /*{ - OSectionView* pView = getCurrentSectionView(); - if ( pView ) - { - Reference< awt::XWindow> xWindow = VCLUnoHelper::GetInterface(getView()->Window::GetParent()); - InsertChart(m_xContext,m_xReportDefinition.get(),xWindow,pView,getSdrModel().get()); - } - }*/ getDesignView()->SetMode( RPTUI_INSERT ); getDesignView()->SetInsertObj( OBJ_OLE2); createDefaultControl(aArgs); @@ -1409,7 +1388,6 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_DRAWTBX_CS_STAR: sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("star5")); break; - case SID_DRAWTBX_CS_BASIC: default: sType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond")); } @@ -1483,19 +1461,16 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_ATTR_CHAR_POSTURE: case SID_ATTR_CHAR_UNDERLINE: { - ::std::auto_ptr<UndoManagerListAction> pListAction; uno::Reference< awt::XWindow> xWindow; ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats; lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats ); - bool bMulti = aControlsFormats.size() > 1; + + const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); + ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin(); for(; aIter != aControlsFormats.end();++aIter) { - if ( !pListAction.get() && bMulti) - { - const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); - pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction)); - } // if ( !pListAction.get() ) uno::Reference< report::XReportControlFormat> xReportControlFormat(*aIter,uno::UNO_QUERY); lcl_setFontWPU_nothrow(xReportControlFormat,_nId); } @@ -1517,7 +1492,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > if ( aArgs[0].Value >>= aFont ) { impl_setPropertyAtControls_throw(RID_STR_UNDO_CHANGEFONT,PROPERTY_CHARFONTNAME,uno::makeAny(aFont.Name),aArgs); - } // if ( aArgs[0].Value >>= aFont ) + } } break; case SID_ATTR_CHAR_FONTHEIGHT: @@ -1548,7 +1523,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_ATTR_PARA_ADJUST_BLOCK: eParagraphAdjust = style::ParagraphAdjust_BLOCK; break; - } // switch(_nId) + } impl_setPropertyAtControls_throw(RID_STR_UNDO_ALIGNMENT,PROPERTY_PARAADJUST,uno::makeAny(eParagraphAdjust),aArgs); InvalidateFeature(SID_ATTR_PARA_ADJUST_LEFT); @@ -1559,32 +1534,37 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > break; case SID_CHAR_DLG: { - ::std::auto_ptr<UndoManagerListAction> pListAction; uno::Sequence< beans::NamedValue > aSettings; uno::Reference< awt::XWindow> xWindow; ::std::vector< uno::Reference< uno::XInterface > > aControlsFormats; lcl_getReportControlFormat( aArgs, getDesignView(), xWindow, aControlsFormats ); - ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin(); - for(; aIter != aControlsFormats.end();++aIter) + + if ( !aControlsFormats.empty() ) { - uno::Reference< report::XReportControlFormat > xFormat(*aIter,uno::UNO_QUERY); - if ( xFormat.is() ) + const String sUndoAction( ModuleRes( RID_STR_UNDO_CHANGEFONT ) ); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); + + ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aControlsFormats.begin(); + for(; aIter != aControlsFormats.end();++aIter) { - if ( !pListAction.get() ) + uno::Reference< report::XReportControlFormat > xFormat( *aIter, uno::UNO_QUERY ); + if ( !xFormat.is() ) + continue; + + if ( aSettings.getLength() == 0 ) { - const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEFONT)); - pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction)); - rptui::openCharDialog(xFormat,xWindow,aSettings); - } // if ( !pListAction.get() ) + ::rptui::openCharDialog( xFormat, xWindow, aSettings ); + if ( aSettings.getLength() == 0 ) + break; + } + applyCharacterSettings( xFormat, aSettings ); } - } // for(; aIter != aControlsFormats.end();++aIter) - if ( !aControlsFormats.empty() ) + InvalidateAll(); + } } break; - //case SID_FM_DESIGN_MODE: - // break; case SID_INSERT_GRAPHIC: insertGraphic(); break; @@ -1610,7 +1590,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > } else createDateTime(aArgs); - } // if ( m_xReportDefinition.is() ) + } break; case SID_INSERT_FLD_PGNUMBER: if ( m_xReportDefinition.is() ) @@ -1622,7 +1602,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > } else createPageNumber(aArgs); - } // if ( m_xReportDefinition.is() ) + } break; case SID_EXPORTDOC: case SID_EXPORTDOCASPDF: @@ -1648,7 +1628,6 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > } } setEditable(!isEditable()); - //getJoinView()->setReadOnly(!isEditable()); InvalidateAll(); return; case SID_GROUP: @@ -1658,17 +1637,17 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > { openZoomDialog(); } - else if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) + else if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Zoom")) ) { SvxZoomItem aZoomItem; aZoomItem.PutValue(aArgs[0].Value); m_nZoomValue = aZoomItem.GetValue(); m_eZoomType = aZoomItem.GetType(); impl_zoom_nothrow(); - } // if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") ) + } break; case SID_ATTR_ZOOMSLIDER: - if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("ZoomSlider") ) + if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ZoomSlider")) ) { SvxZoomSliderItem aZoomSlider; aZoomSlider.PutValue(aArgs[0].Value); @@ -1687,6 +1666,7 @@ short OReportController::saveModified() { return RET_NO; } + // ----------------------------------------------------------------------------- void OReportController::impl_initialize( ) { @@ -1702,15 +1682,18 @@ void OReportController::impl_initialize( ) { if ( m_xReportDefinition.is() ) { - //m_sName = m_xReportDefinition->getName(); getView()->initialize(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things - getSdrModel(); + + m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition); if ( !m_aReportModel ) - throw Exception(); + throw RuntimeException(); + m_aReportModel->attachController( *this ); + + clearUndoManager(); + UndoSuppressor aSuppressUndo( getUndoManager() ); ::comphelper::NamedValueCollection aArgs(getModel()->getArgs()); - setMode(aArgs.getOrDefault("Mode", rtl::OUString::createFromAscii("normal"))); + setMode(aArgs.getOrDefault("Mode", ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal")))); listen(true); setEditable( !m_aReportModel->IsReadOnly() ); @@ -1732,11 +1715,11 @@ void OReportController::impl_initialize( ) m_xReportDefinition->setCommand(aNames[0]); m_xReportDefinition->setCommandType(sdb::CommandType::TABLE); } - } // if ( !sHierarchicalDocumentName.getLength() && getConnection().is() ) + } m_aVisualAreaSize = m_xReportDefinition->getVisualAreaSize(0); - } // if ( m_xReportDefinition.is() ) + } // check if chart is supported by the engine checkChartEnabled(); @@ -1774,7 +1757,7 @@ void OReportController::impl_initialize( ) getDesignView()->setCurrentPage(m_sLastActivePage); uno::Sequence< beans::PropertyValue> aArgs; executeUnChecked(SID_SELECT_REPORT,aArgs); - } // if ( m_bShowProperties && m_nPageNum == -1 ) + } setModified(sal_False); // and we are not modified yet @@ -1784,13 +1767,12 @@ void OReportController::impl_initialize( ) } catch(const SQLException&) { - OSL_ENSURE(sal_False, "OReportController::initialize: caught an exception!"); + DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- IMPL_LINK( OReportController, OnOpenHelpAgent, void* ,/*_pMemfun*/) { - //m_nExecuteReportEvent = 0; doOpenHelpAgent(); return 0L; } @@ -1812,10 +1794,8 @@ void OReportController::doOpenHelpAgent() { if (getFrame().is()) { - rtl::OUString suURL = rtl::OUString::createFromAscii("vnd.sun.star.help://shared/text/shared/explorer/database/rep_main.xhp?UseDB=no&DbPAR=swriter"); + rtl::OUString suURL(RTL_CONSTASCII_USTRINGPARAM("vnd.sun.star.help://shared/text/shared/explorer/database/rep_main.xhp?UseDB=no&DbPAR=swriter")); openHelpAgent(suURL); - // openHelpAgent(68245 /* HID_REPORT_DESIGN... UNKNOWN */ ); - // HID_APP_REPORT_TREE } else { @@ -1838,7 +1818,6 @@ sal_Bool OReportController::Construct(Window* pParent) m_pClipbordNotifier->AddRemoveListener( getView(), sal_True ); OReportController_BASE::Construct(pParent); - //getView()->Show(); return sal_True; } // ----------------------------------------------------------------------------- @@ -1859,14 +1838,13 @@ sal_Bool SAL_CALL OReportController::suspend(sal_Bool /*_bSuspend*/) throw( Runt // ----------------------------------------------------------------------------- void OReportController::describeSupportedFeatures() { - OSingleDocumentController::describeSupportedFeatures(); + DBSubComponentController::describeSupportedFeatures(); implDescribeSupportedFeature( ".uno:TextDocument", SID_RPT_TEXTDOCUMENT, CommandGroup::APPLICATION ); implDescribeSupportedFeature( ".uno:Spreadsheet", SID_RPT_SPREADSHEET, CommandGroup::APPLICATION ); implDescribeSupportedFeature( ".uno:Redo", SID_REDO, CommandGroup::EDIT ); implDescribeSupportedFeature( ".uno:Undo", SID_UNDO, CommandGroup::EDIT ); - //implDescribeSupportedFeature( ".uno:PasteSpecial", SID_PASTE, CommandGroup::EDIT ); implDescribeSupportedFeature( ".uno:SelectAll", SID_SELECTALL, CommandGroup::EDIT ); implDescribeSupportedFeature( ".uno:SelectAllInSection", SID_SELECTALL_IN_SECTION, CommandGroup::EDIT ); implDescribeSupportedFeature( ".uno:Delete", SID_DELETE, CommandGroup::EDIT ); @@ -1880,13 +1858,11 @@ void OReportController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:AddField", SID_FM_ADD_FIELD, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ReportNavigator", SID_RPT_SHOWREPORTEXPLORER, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ControlProperties", SID_SHOW_PROPERTYBROWSER, CommandGroup::VIEW ); - //implDescribeSupportedFeature( ".uno:SwitchControlDesignMode", SID_FM_DESIGN_MODE, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:DbSortingAndGrouping", SID_SORTINGANDGROUPING, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:PageHeaderFooter", SID_PAGEHEADERFOOTER, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ReportHeaderFooter", SID_REPORTHEADERFOOTER, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ZoomSlider", SID_ATTR_ZOOMSLIDER, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:Zoom", SID_ATTR_ZOOM, CommandGroup::VIEW ); - //implDescribeSupportedFeature( ".uno:SwitchControlDesignMode", SID_FM_DESIGN_MODE, CommandGroup::VIEW ); implDescribeSupportedFeature( ".uno:ConditionalFormatting", SID_CONDITIONALFORMATTING, CommandGroup::FORMAT ); implDescribeSupportedFeature( ".uno:PageDialog", SID_PAGEDIALOG, CommandGroup::FORMAT ); @@ -2122,33 +2098,20 @@ void OReportController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:ExpandSection", SID_EXPAND_SECTION); } // ----------------------------------------------------------------------------- -SfxUndoManager* OReportController::getUndoMgr() -{ - return &m_aUndoManager; -} -// ----------------------------------------------------------------------------- void OReportController::impl_onModifyChanged() { try { if ( m_xReportDefinition.is() ) m_xReportDefinition->setModified( impl_isModified() ); - OSingleDocumentController::impl_onModifyChanged(); + DBSubComponentController::impl_onModifyChanged(); } - catch(uno::Exception) + catch(const uno::Exception&) { DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- -void OReportController::losingConnection( ) -{ - // let the base class do it's reconnect - OReportController_BASE::losingConnection( ); - - InvalidateAll(); -} -// ----------------------------------------------------------------------------- void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _xLayoutManager) { if ( _xLayoutManager.is() ) @@ -2168,7 +2131,7 @@ void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _ _xLayoutManager->createElement( s_sMenu[i] ); _xLayoutManager->requestElement( s_sMenu[i] ); } - } // if ( _xLayoutManager.is() ) + } } // ----------------------------------------------------------------------------- void OReportController::notifyGroupSections(const ContainerEvent& _rEvent,bool _bShow) @@ -2234,7 +2197,7 @@ void SAL_CALL OReportController::elementReplaced( const ContainerEvent& /*_rEven { SolarMutexGuard aSolarGuard; ::osl::MutexGuard aGuard( getMutex() ); - OSL_ENSURE(0,"Not yet implemented!"); + OSL_FAIL("Not yet implemented!"); } // ----------------------------------------------------------------------------- void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEvent& evt ) throw (RuntimeException) @@ -2249,7 +2212,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven { if ( evt.PropertyName.equals( PROPERTY_REPORTHEADERON ) ) { - const USHORT nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0; + const sal_uInt16 nPosition = m_xReportDefinition->getPageHeaderOn() ? 1 : 0; if ( bShow ) { getDesignView()->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition); @@ -2262,7 +2225,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven } else if ( evt.PropertyName.equals( PROPERTY_REPORTFOOTERON ) ) { - USHORT nPosition = getDesignView()->getSectionCount(); + sal_uInt16 nPosition = getDesignView()->getSectionCount(); if ( m_xReportDefinition->getPageFooterOn() ) --nPosition; if ( bShow ) @@ -2284,7 +2247,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven } else { - getDesignView()->removeSection(USHORT(0)); + getDesignView()->removeSection(sal_uInt16(0)); } } else if ( evt.PropertyName.equals( PROPERTY_PAGEFOOTERON ) ) @@ -2314,7 +2277,7 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven /// TODO: check what we need to notify here TitleHelper /*else if ( evt.PropertyName.equals( PROPERTY_CAPTION ) ) updateTitle();*/ - } // if ( evt.Source == m_xReportDefinition ) + } else { uno::Reference< report::XGroup> xGroup(evt.Source,uno::UNO_QUERY); @@ -2335,16 +2298,17 @@ void SAL_CALL OReportController::propertyChange( const beans::PropertyChangeEven // ----------------------------------------------------------------------------- void SAL_CALL OReportController::disposing( const lang::EventObject& Source ) throw(uno::RuntimeException) { + // simply disambiguate OReportController_BASE::disposing(Source); } // ----------------------------------------------------------------------------- -USHORT lcl_getNonVisbleGroupsBefore( const uno::Reference< report::XGroups>& _xGroups +sal_uInt16 lcl_getNonVisbleGroupsBefore( const uno::Reference< report::XGroups>& _xGroups ,sal_Int32 _nGroupPos ,::std::mem_fun_t<sal_Bool,OGroupHelper>&_pGroupMemberFunction) { uno::Reference< report::XGroup> xGroup; - USHORT nNonVisibleGroups = 0; + sal_uInt16 nNonVisibleGroups = 0; sal_Int32 nCount = _xGroups->getCount(); for( sal_Int32 i = 0; i < _nGroupPos && i < nCount; ++i) { @@ -2359,16 +2323,15 @@ USHORT lcl_getNonVisbleGroupsBefore( const uno::Reference< report::XGroups>& _xG // ----------------------------------------------------------------------------- void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGroup,const ::rtl::OUString& _sPropName,sal_Int32 _nGroupPos,bool _bShow) { - //adjustSectionName(_xGroup,_nGroupPos); ::std::mem_fun_t<sal_Bool,OGroupHelper> pMemFun = ::std::mem_fun(&OGroupHelper::getHeaderOn); ::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> pMemFunSection = ::std::mem_fun(&OGroupHelper::getHeader); ::rtl::OUString sColor(DBGROUPHEADER); - USHORT nPosition = 0; + sal_uInt16 nPosition = 0; bool bHandle = false; if ( _sPropName.equals( PROPERTY_HEADERON ) ) { nPosition = m_xReportDefinition->getPageHeaderOn() ? (m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : (m_xReportDefinition->getReportHeaderOn() ? 1 : 0); - nPosition += (static_cast<USHORT>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); + nPosition += (static_cast<sal_uInt16>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); bHandle = true; } else if ( _sPropName.equals( PROPERTY_FOOTERON ) ) @@ -2382,7 +2345,7 @@ void OReportController::groupChange( const uno::Reference< report::XGroup>& _xGr if ( m_xReportDefinition->getReportFooterOn() ) --nPosition; sColor = DBGROUPFOOTER; - nPosition -= (static_cast<USHORT>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); + nPosition -= (static_cast<sal_uInt16>(_nGroupPos) - lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun)); if ( !_bShow ) --nPosition; bHandle = true; @@ -2406,13 +2369,6 @@ IMPL_LINK( OReportController, OnClipboardChanged, void*, EMPTYARG ) return OnInvalidateClipboard( NULL ); } //------------------------------------------------------------------------------ -IMPL_LINK( OReportController, NotifyUndoActionHdl, SfxUndoAction*, _pUndoAction ) -{ - OSL_ENSURE(_pUndoAction,"UndoAction is NULL!"); - addUndoActionAndInvalidate(_pUndoAction); - return 0L; -} -//------------------------------------------------------------------------------ IMPL_LINK(OReportController, OnInvalidateClipboard, void*, EMPTYARG) { InvalidateFeature(SID_CUT); @@ -2453,10 +2409,10 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ new SfxAllEnumItem(RPTUI_ID_START,PAPER_A4), new SfxAllEnumItem(RPTUI_ID_END,PAPER_E), new SvxBrushItem(ITEMID_BRUSH), - new SfxUInt16Item(RPTUI_ID_METRIC,static_cast<UINT16>(eUserMetric)) + new SfxUInt16Item(RPTUI_ID_METRIC,static_cast<sal_uInt16>(eUserMetric)) }; - static USHORT pRanges[] = + static sal_uInt16 pRanges[] = { RPTUI_ID_LRSPACE,RPTUI_ID_BRUSH, SID_ATTR_METRIC,SID_ATTR_METRIC, @@ -2477,9 +2433,9 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ pDescriptor->Put(SvxSizeItem(RPTUI_ID_SIZE,VCLSize(getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE)))); pDescriptor->Put(SvxLRSpaceItem(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_LEFTMARGIN) ,getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN),0,0,RPTUI_ID_LRSPACE)); - pDescriptor->Put(SvxULSpaceItem(static_cast<USHORT>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_TOPMARGIN)) - ,static_cast<USHORT>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BOTTOMMARGIN)),RPTUI_ID_ULSPACE)); - pDescriptor->Put(SfxUInt16Item(SID_ATTR_METRIC,static_cast<UINT16>(eUserMetric))); + pDescriptor->Put(SvxULSpaceItem(static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_TOPMARGIN)) + ,static_cast<sal_uInt16>(getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_BOTTOMMARGIN)),RPTUI_ID_ULSPACE)); + pDescriptor->Put(SfxUInt16Item(SID_ATTR_METRIC,static_cast<sal_uInt16>(eUserMetric))); uno::Reference< style::XStyle> xPageStyle(getUsedStyle(m_xReportDefinition)); if ( xPageStyle.is() ) @@ -2513,11 +2469,10 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ { uno::Reference< beans::XPropertySet> xProp(getUsedStyle(m_xReportDefinition),uno::UNO_QUERY_THROW); const String sUndoAction(ModuleRes(RID_STR_UNDO_CHANGEPAGE)); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); const SfxPoolItem* pItem = NULL; if ( SFX_ITEM_SET == pSet->GetItemState( RPTUI_ID_SIZE,sal_True,&pItem)) { - const Size aPaperSize = static_cast<const SvxSizeItem*>(pItem)->GetSize(); uno::Any aValue; static_cast<const SvxSizeItem*>(pItem)->QueryValue(aValue,MID_SIZE_SIZE); xProp->setPropertyValue(PROPERTY_PAPERSIZE,aValue); @@ -2554,7 +2509,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ } } } - catch(Exception&) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -2564,13 +2519,24 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _ delete pDefaults[i]; } + // ----------------------------------------------------------------------------- sal_Bool SAL_CALL OReportController::attachModel(const uno::Reference< frame::XModel > & xModel) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - m_xReportDefinition.set(xModel,uno::UNO_QUERY); - return m_xReportDefinition.is(); + + uno::Reference< report::XReportDefinition > xReportDefinition( xModel, UNO_QUERY ); + if ( !xReportDefinition.is() ) + return sal_False; + + uno::Reference< document::XUndoManagerSupplier > xTestSuppUndo( xModel, UNO_QUERY ); + if ( !xTestSuppUndo.is() ) + return sal_False; + + m_xReportDefinition = xReportDefinition; + return sal_True; } + // ----------------------------------------------------------------------------- void OReportController::openSortingAndGroupingDialog() { @@ -2624,19 +2590,19 @@ void OReportController::Notify(SfxBroadcaster & /* _rBc */, SfxHint const & _rHi } } // ----------------------------------------------------------------------------- -void OReportController::executeMethodWithUndo(USHORT _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun) +void OReportController::executeMethodWithUndo(sal_uInt16 _nUndoStrId,const ::std::mem_fun_t<void,ODesignView>& _pMemfun) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); _pMemfun( getDesignView() ); InvalidateFeature( SID_SAVEDOC ); InvalidateFeature( SID_UNDO ); } // ----------------------------------------------------------------------------- -void OReportController::alignControlsWithUndo(USHORT _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection) +void OReportController::alignControlsWithUndo(sal_uInt16 _nUndoStrId,sal_Int32 _nControlModification,bool _bAlignAtSection) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); getDesignView()->alignMarkedObjects(_nControlModification,_bAlignAtSection); InvalidateFeature( SID_SAVEDOC ); InvalidateFeature( SID_UNDO ); @@ -2651,7 +2617,6 @@ void OReportController::shrinkSectionBottom(uno::Reference<report::XSection> _xS return; } const sal_Int32 nSectionHeight = _xSection->getHeight(); - // sal_Int32 nMinPositionY = nSectionHeight; sal_Int32 nMaxPositionY = 0; uno::Reference< report::XReportComponent> xReportComponent; @@ -2662,7 +2627,6 @@ void OReportController::shrinkSectionBottom(uno::Reference<report::XSection> _xS const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY(); const sal_Int32 nReportComponentHeight = xReportComponent->getHeight(); const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight; - // nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY); nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY); } // now we know the minimal Y-Position and maximal Y-Position @@ -2686,7 +2650,6 @@ void OReportController::shrinkSectionTop(uno::Reference<report::XSection> _xSect const sal_Int32 nSectionHeight = _xSection->getHeight(); sal_Int32 nMinPositionY = nSectionHeight; - // sal_Int32 nMaxPositionY = 0; uno::Reference< report::XReportComponent> xReportComponent; // for every component get it's Y-position and compare it to the current Y-position @@ -2694,10 +2657,7 @@ void OReportController::shrinkSectionTop(uno::Reference<report::XSection> _xSect { xReportComponent.set(_xSection->getByIndex(i), uno::UNO_QUERY); const sal_Int32 nReportComponentPositionY = xReportComponent->getPositionY(); - // const sal_Int32 nReportComponentHeight = xReportComponent->getHeight(); - // const sal_Int32 nReportComponentPositionYAndHeight = nReportComponentPositionY + nReportComponentHeight; nMinPositionY = std::min(nReportComponentPositionY, nMinPositionY); - // nMaxPositionY = std::max(nReportComponentPositionYAndHeight, nMaxPositionY); } // now we know the minimal Y-Position and maximal Y-Position if (nMinPositionY == 0) @@ -2716,12 +2676,12 @@ void OReportController::shrinkSectionTop(uno::Reference<report::XSection> _xSect _xSection->setHeight(nNewSectionHeight); } -void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference<report::XSection> _xSection, sal_Int32 _nSid) +void OReportController::shrinkSection(sal_uInt16 _nUndoStrId, uno::Reference<report::XSection> _xSection, sal_Int32 _nSid) { if ( _xSection.is() ) { const String sUndoAction = String((ModuleRes(_nUndoStrId))); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); if (_nSid == SID_SECTION_SHRINK) { @@ -2746,35 +2706,38 @@ void OReportController::shrinkSection(USHORT _nUndoStrId, uno::Reference<report: uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - typedef ::std::pair< ::rtl::OUString,sal_uInt16> TStringIntPair; - const TStringIntPair pViewDataList[] = + + sal_Int32 nCommandIDs[] = { - TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridVisible")), SID_GRID_VISIBLE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GridUse")), SID_GRID_USE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HelplinesMove")), SID_HELPLINES_MOVE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowRuler")), SID_RULER) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlProperties")), SID_SHOW_PROPERTYBROWSER) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("LastPropertyBrowserPage")),SID_PROPERTYBROWSER_LAST_PAGE) - ,TStringIntPair(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SplitPosition")), SID_SPLIT_POSITION) + SID_GRID_VISIBLE, + SID_GRID_USE, + SID_HELPLINES_MOVE, + SID_RULER, + SID_SHOW_PROPERTYBROWSER, + SID_PROPERTYBROWSER_LAST_PAGE, + SID_SPLIT_POSITION }; - uno::Sequence<beans::PropertyValue> aCommandProps(SAL_N_ELEMENTS(pViewDataList)); - beans::PropertyValue* pIter = aCommandProps.getArray(); - beans::PropertyValue* pEnd = pIter + aCommandProps.getLength(); - for (sal_Int32 i = 0; pIter != pEnd; ++pIter,++i) + ::comphelper::NamedValueCollection aCommandProperties; + for ( size_t i=0; i < SAL_N_ELEMENTS(nCommandIDs); ++i ) { - FeatureState aFeatureState = GetState(pViewDataList[i].second); - pIter->Name = pViewDataList[i].first; + const FeatureState aFeatureState = GetState( nCommandIDs[i] ); + + ::rtl::OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main ); + OSL_ENSURE( sCommandURL.indexOfAsciiL( ".uno:", 5 ) == 0, "OReportController::getViewData: illegal command URL!" ); + sCommandURL = sCommandURL.copy( 5 ); + + Any aCommandState; if ( !!aFeatureState.bChecked ) - pIter->Value <<= (*aFeatureState.bChecked) ? sal_True : sal_False; + aCommandState <<= (*aFeatureState.bChecked) ? sal_True : sal_False; else if ( aFeatureState.aValue.hasValue() ) - pIter->Value = aFeatureState.aValue; + aCommandState = aFeatureState.aValue; - } // for (; pIter != pEnd; ++pIter) + aCommandProperties.put( sCommandURL, aCommandState ); + } - uno::Sequence<beans::PropertyValue> aProps(1); - aProps[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CommandProperties")); - aProps[0].Value <<= aCommandProps; + ::comphelper::NamedValueCollection aViewData; + aViewData.put( "CommandProperties", aCommandProperties.getPropertyValues() ); if ( getDesignView() ) { @@ -2791,68 +2754,83 @@ uno::Any SAL_CALL OReportController::getViewData(void) throw( uno::RuntimeExcept pCollapsedIter->Name = PROPERTY_SECTION + ::rtl::OUString::valueOf(i); pCollapsedIter->Value <<= static_cast<sal_Int32>(*aIter); } - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CollapsedSections")); - aProps[nCount].Value <<= aCollapsedSections; + + aViewData.put( "CollapsedSections", aCollapsedSections ); } ::boost::shared_ptr<OSectionWindow> pSectionWindow = getDesignView()->getMarkedSection(); if ( pSectionWindow.get() ) { - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MarkedSection")); - aProps[nCount].Value <<= (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum(); - } // if ( pSectionWindow.get() ) - } // if ( getDesignView() ) - const sal_Int32 nCount = aProps.getLength(); - aProps.realloc( nCount + 1 ); - aProps[nCount].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ZoomFactor")); - aProps[nCount].Value <<= m_nZoomValue; - return uno::makeAny(aProps); + aViewData.put( "MarkedSection", (sal_Int32)pSectionWindow->getReportSection().getPage()->GetPageNum() ); + } + } + + aViewData.put( "ZoomFactor", m_nZoomValue ); + return uno::makeAny( aViewData.getPropertyValues() ); } // ----------------------------------------------------------------------------- -void SAL_CALL OReportController::restoreViewData(const uno::Any& Data) throw( uno::RuntimeException ) +void SAL_CALL OReportController::restoreViewData(const uno::Any& i_data) throw( uno::RuntimeException ) { ::osl::MutexGuard aGuard( getMutex() ); - uno::Sequence<beans::PropertyValue> aProps; - if ( Data >>= aProps ) + + try { - const beans::PropertyValue* pPropsIter = aProps.getConstArray(); - const beans::PropertyValue* pPropsEnd = pPropsIter + aProps.getLength(); - for (sal_Int32 i = 0; pPropsIter != pPropsEnd; ++pPropsIter,++i) + const ::comphelper::NamedValueCollection aViewData( i_data ); + + m_aCollapsedSections = aViewData.getOrDefault( "CollapsedSections", m_aCollapsedSections ); + m_nPageNum = aViewData.getOrDefault( "MarkedSection", m_nPageNum ); + m_nZoomValue = aViewData.getOrDefault( "ZoomFactor", m_nZoomValue ); + // TODO: setting those 3 members is not enough - in theory, restoreViewData can be called when the + // view is fully alive, so we need to reflect those 3 values in the view. + // (At the moment, the method is called only during construction phase) + + + ::comphelper::NamedValueCollection aCommandProperties( aViewData.get( "CommandProperties" ) ); + const ::std::vector< ::rtl::OUString > aCommandNames( aCommandProperties.getNames() ); + + for ( ::std::vector< ::rtl::OUString >::const_iterator commandName = aCommandNames.begin(); + commandName != aCommandNames.end(); + ++commandName + ) { - if ( pPropsIter->Name.equalsAscii("CommandProperties") ) + const Any& rCommandValue = aCommandProperties.get( *commandName ); + if ( !rCommandValue.hasValue() ) + continue; + + if ( getView() ) { util::URL aCommand; - uno::Sequence< beans::PropertyValue> aArgs(1); - beans::PropertyValue* pArg = aArgs.getArray(); - pArg->Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Value")); - uno::Sequence< beans::PropertyValue> aCommandProps; - if ( pPropsIter->Value >>= aCommandProps ) - { - const beans::PropertyValue* pIter = aCommandProps.getConstArray(); - const beans::PropertyValue* pEnd = pIter + aCommandProps.getLength(); - for (; pIter != pEnd; ++pIter) - { - pArg->Value = pIter->Value; - if ( pArg->Value.hasValue() ) - { - aCommand.Complete = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".uno:")) + pIter->Name; - executeUnChecked(aCommand,aArgs); - } - } - } + aCommand.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:" ) ) + *commandName; + + Sequence< PropertyValue > aCommandArgs(1); + aCommandArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Value" ) ); + aCommandArgs[0].Value = rCommandValue; + + executeUnChecked( aCommand, aCommandArgs ); + } + else + { + if ( commandName->equalsAscii( "ShowRuler" ) ) + OSL_VERIFY( rCommandValue >>= m_bShowRuler ); + else if ( commandName->equalsAscii( "HelplinesMove" ) ) + OSL_VERIFY( rCommandValue >>= m_bHelplinesMove ); + else if ( commandName->equalsAscii( "GridVisible" ) ) + OSL_VERIFY( rCommandValue >>= m_bGridVisible ); + else if ( commandName->equalsAscii( "GridUse" ) ) + OSL_VERIFY( rCommandValue >>= m_bGridUse ); + else if ( commandName->equalsAscii( "ControlProperties" ) ) + OSL_VERIFY( rCommandValue >>= m_bShowProperties ); + else if ( commandName->equalsAscii( "LastPropertyBrowserPage" ) ) + OSL_VERIFY( rCommandValue >>= m_sLastActivePage ); + else if ( commandName->equalsAscii( "SplitPosition" ) ) + OSL_VERIFY( rCommandValue >>= m_nSplitPos ); } - else if ( pPropsIter->Name.equalsAscii("CollapsedSections") ) - pPropsIter->Value >>= m_aCollapsedSections; - else if ( pPropsIter->Name.equalsAscii("MarkedSection") ) - pPropsIter->Value >>= m_nPageNum; - else if ( pPropsIter->Name.equalsAscii("ZoomFactor") ) - pPropsIter->Value >>= m_nZoomValue; } } + catch(const IllegalArgumentException&) + { + DBG_UNHANDLED_EXCEPTION(); + } } // ----------------------------------------------------------------------------- void OReportController::updateFloater() @@ -2941,7 +2919,7 @@ uno::Reference<frame::XModel> OReportController::executeReport() Reference<XFrame> xFrame = getXFrame(); xModel = m_xReportEngine->createDocumentAlive(xFrame); } - catch( const sdbc::SQLException& /*e*/ ) + catch(const sdbc::SQLException&) { // SQLExceptions and derived exceptions must not be translated aInfo = ::cppu::getCaughtException(); } @@ -2979,7 +2957,7 @@ uno::Reference<frame::XModel> OReportController::executeReport() { const String suSQLContext = String( ModuleRes( RID_STR_COULD_NOT_CREATE_REPORT ) ); aInfo.prepend(suSQLContext); - } // if (aInfo.isValid()) + } m_bInGeneratePreview = false; } @@ -3022,7 +3000,7 @@ uno::Reference< sdbc::XRowSet > OReportController::getRowSet() m_xRowSetMediator = new OPropertyMediator( m_xReportDefinition.get(), xRowSetProp, aPropertyMediation ); m_xRowSet = xRowSet; } - catch( const uno::Exception& ) + catch(const uno::Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -3057,23 +3035,14 @@ void OReportController::insertGraphic() createControl(aArgs,xSection,::rtl::OUString(),OBJ_DLG_IMAGECONTROL); } } - catch(Exception&) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } } // ----------------------------------------------------------------------------- -::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel() +::boost::shared_ptr<rptui::OReportModel> OReportController::getSdrModel() const { - if ( !m_aReportModel ) - { - m_aReportModel = reportdesign::OReportDefinition::getSdrModel(m_xReportDefinition); - if ( m_aReportModel ) - { - m_aReportModel->attachController( *this ); - m_aReportModel->SetNotifyUndoActionHdl(LINK( this, OReportController, NotifyUndoActionHdl )); - } - } return m_aReportModel; } // ----------------------------------------------------------------------------- @@ -3152,7 +3121,6 @@ void OReportController::createNewFunction(const uno::Any& _aValue) // ----------------------------------------------------------------------------- IMPL_LINK( OReportController, OnExecuteReport, void* ,/*_pMemfun*/) { - //m_nExecuteReportEvent = 0; executeReport(); return 0L; } @@ -3185,7 +3153,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co sCustomShapeType = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("diamond")); pSectionWindow->getReportSection().createDefault(sCustomShapeType,pNewControl); pNewControl->SetLogicRect(Rectangle(3000,500,6000,3500)); // switch height and width - } // if ( _nObjectId == OBJ_CUSTOMSHAPE ) + } else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId ) { pNewControl = SdrObjFactory::MakeNewObject( ReportInventor, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() ); @@ -3229,7 +3197,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co { if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) ) xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i])); - } // for(size_t i = 0; i < SAL_N_ELEMENTS(sProps);++i) + } if ( xInfo->hasPropertyByName(PROPERTY_BORDER) && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER) ) xUnoProp->setPropertyValue(PROPERTY_BORDER,xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER)); @@ -3277,7 +3245,7 @@ void OReportController::createDateTime(const Sequence< PropertyValue >& _aArgs) getDesignView()->unmarkAllObjects(NULL); const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); SequenceAsHashMap aMap(_aArgs); aMap.createItemIfMissing(PROPERTY_FORMATKEY,aMap.getUnpackedValueOrDefault(PROPERTY_FORMATKEYDATE,sal_Int32(0))); @@ -3305,13 +3273,13 @@ void OReportController::createPageNumber(const Sequence< PropertyValue >& _aArgs getDesignView()->unmarkAllObjects(NULL); const String sUndoAction(ModuleRes(RID_STR_UNDO_INSERT_CONTROL)); - UndoManagerListAction aListAction(m_aUndoManager,sUndoAction); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); if ( !m_xReportDefinition->getPageHeaderOn() ) { uno::Sequence< beans::PropertyValue > aArgs; executeChecked(SID_PAGEHEADERFOOTER,aArgs); - } // if ( !m_xHoldAlive->getPageHeaderOn() ) + } SequenceAsHashMap aMap(_aArgs); sal_Bool bStateOfPage = aMap.getUnpackedValueOrDefault(PROPERTY_STATE,sal_False); @@ -3349,7 +3317,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) } uno::Reference<report::XSection> xCurrentSection = getDesignView()->getCurrentSection(); - UndoManagerListAction aUndo( *getUndoMgr(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) ); + UndoContext aUndoContext( getUndoManager(), String( ModuleRes( RID_STR_UNDO_INSERT_CONTROL ) ) ); try { @@ -3380,7 +3348,6 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) // LLA: new feature, add the Label in dependency of the given DND_ACTION one section up, normal or one section down sal_Int8 nDNDAction = aMap.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DNDAction")), sal_Int8(0)); pSectionWindow[1] = pSectionWindow[0]; - // ::boost::shared_ptr<OReportSection> pReportSectionPost; sal_Bool bLabelAboveTextField = nDNDAction == DND_ACTION_COPY; if ( bLabelAboveTextField || nDNDAction == DND_ACTION_LINK ) { @@ -3414,7 +3381,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) { xReportDefinition->setCommand(sCommand); xReportDefinition->setCommandType(nCommandType); - } // if ( !xReportDefinition->getCommand().getLength() ) + } xColumns = dbtools::getFieldsByCommandDescriptor(xConnection,nCommandType,sCommand,xHoldAlive); if ( xColumns.is() && xColumns->hasByName(sColumnName) ) @@ -3438,7 +3405,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) // definition is bound to - which is not supported for the parameters case, since we // can retrieve parameters from the RowSet only. } - catch( const Exception& ) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -3490,7 +3457,6 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) SdrUnoObj* pControl[2]; pControl[0] = NULL; pControl[1] = NULL; - //getDesignView()->GetModel()->GetUndoEnv().Lock(); const sal_Int32 nRightMargin = getStyleProperty<sal_Int32>(m_xReportDefinition,PROPERTY_RIGHTMARGIN); const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_xReportDefinition,PROPERTY_PAPERSIZE).Width - nRightMargin; OSectionView* pSectionViews[2]; @@ -3502,7 +3468,6 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) ,xField,xNumberFormats,nOBJID,::rtl::OUString(),ReportInventor,OBJ_DLG_FIXEDTEXT, pSectionWindow[1]->getReportSection().getPage(),pSectionWindow[0]->getReportSection().getPage(),m_aReportModel.get(), pControl[0],pControl[1]); - //getDesignView()->GetModel()->GetUndoEnv().UnLock(); if ( pControl[0] && pControl[1] ) { SdrPageView* pPgViews[2]; @@ -3542,15 +3507,12 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) ReportFormula aFormula( ReportFormula::Field, sName ); xUnoProp->setPropertyValue( PROPERTY_DATAFIELD, uno::makeAny( aFormula.getCompleteFormula() ) ); - } // if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) ) + } if ( xInfo->hasPropertyByName(PROPERTY_BORDER) && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER) ) xUnoProp->setPropertyValue(PROPERTY_BORDER,xShapeProp->getPropertyValue(PROPERTY_CONTROLBORDER)); pObjs[i]->CreateMediator(sal_True); - // need SectionView from the above or follow Section - // (getMarkedSection) returns the current Section - //pSectionViews[i]->InsertObjectAtView(pControl[i],*pPgViews[i],SDRINSERT_ADDMARK); const sal_Int32 nShapeWidth = xShapeProp->getWidth(); const bool bChangedPos = (aPos.X + nShapeWidth) > nPaperWidth; @@ -3568,8 +3530,6 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) if (pSectionViews[0] != pSectionViews[1] && nOBJID == OBJ_DLG_FORMATTEDFIELD) // we want this nice feature only at FORMATTEDFIELD { - // we have two different Views, so set the position x new. - // pSectionViews[1].position.x = pSectionViews[0].position.x uno::Reference< report::XReportComponent> xShapePropLabel(pObjs[0]->getUnoShape(),uno::UNO_QUERY_THROW); uno::Reference< report::XReportComponent> xShapePropTextField(pObjs[1]->getUnoShape(),uno::UNO_QUERY_THROW); if ( sLabel.getLength() ) @@ -3639,11 +3599,6 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) xTextfield->setPositionY(aTextfield.Top()); } } - // this should never happen. - // else - // { - // DBG_ERROR("unhandled case."); - // } } } } @@ -3654,7 +3609,7 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs) } } } - catch( const Exception& ) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -3735,11 +3690,6 @@ void OReportController::listen(const bool _bAdd) // Add Listeners to ReportControllerObserver OXReportControllerObserver& rObserver = *m_pReportControllerObserver; - // void (OXReportControllerObserver::*pObserverFunction)( const uno::Reference< uno::XInterface >& ) = - // _bAdd ? &OXReportControllerObserver::AddElement : &OXReportControllerObserver::RemoveElement; - - // (rObserver.*pObserverFunction)( m_xReportDefinition->getStyleFamilies() ); - // (rObserver.*pObserverFunction)( m_xReportDefinition->getFunctions() ); if ( m_xReportDefinition->getPageHeaderOn() && _bAdd ) { @@ -3770,7 +3720,7 @@ void OReportController::listen(const bool _bAdd) getDesignView()->addSection(xGroup->getHeader(),DBGROUPHEADER); rObserver.AddSection(xGroup->getHeader()); } - } // for (sal_Int32 i=0;i<nCount ; ++i) + } if ( _bAdd ) { @@ -3817,19 +3767,21 @@ void OReportController::switchReportSection(const sal_Int16 _nId) { const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() ); const bool bSwitchOn = !m_xReportDefinition->getReportHeaderOn(); + + ::boost::scoped_ptr< UndoContext > pUndoContext; if ( SID_REPORTHEADERFOOTER == _nId ) { const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)); - getUndoMgr()->EnterListAction( sUndoAction, String() ); + pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) ); - addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO + addUndoAction(new OReportSectionUndo(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getReportHeader) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed ,0 )); - addUndoActionAndInvalidate(new OReportSectionUndo(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO + addUndoAction(new OReportSectionUndo(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getReportFooter) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed @@ -3852,7 +3804,7 @@ void OReportController::switchReportSection(const sal_Int16 _nId) } if ( SID_REPORTHEADERFOOTER == _nId ) - getUndoMgr()->LeaveListAction(); + pUndoContext.reset(); getView()->Resize(); } } @@ -3865,12 +3817,13 @@ void OReportController::switchPageSection(const sal_Int16 _nId) const OXUndoEnvironment::OUndoEnvLock aLock( m_aReportModel->GetUndoEnv() ); const bool bSwitchOn = !m_xReportDefinition->getPageHeaderOn(); + ::boost::scoped_ptr< UndoContext > pUndoContext; if ( SID_PAGEHEADERFOOTER == _nId ) { const String sUndoAction(ModuleRes(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)); - getUndoMgr()->EnterListAction( sUndoAction, String() ); + pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) ); - addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel + addUndoAction(new OReportSectionUndo(*m_aReportModel ,SID_PAGEHEADER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getPageHeader) ,m_xReportDefinition @@ -3878,14 +3831,14 @@ void OReportController::switchPageSection(const sal_Int16 _nId) ,0 )); - addUndoActionAndInvalidate(new OReportSectionUndo(*m_aReportModel + addUndoAction(new OReportSectionUndo(*m_aReportModel ,SID_PAGEFOOTER_WITHOUT_UNDO ,::std::mem_fun(&OReportHelper::getPageFooter) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed ,0 )); - } // if ( SID_PAGEHEADERFOOTER == _nId ) + } switch( _nId ) { case SID_PAGEHEADER_WITHOUT_UNDO: @@ -3900,7 +3853,7 @@ void OReportController::switchPageSection(const sal_Int16 _nId) break; } if ( SID_PAGEHEADERFOOTER == _nId ) - getUndoMgr()->LeaveListAction(); + pUndoContext.reset(); getView()->Resize(); } } @@ -3926,7 +3879,7 @@ void OReportController::modifyGroup(const bool _bAppend, const Sequence< Propert rUndoEnv.AddElement( xGroup->getFunctions() ); } - addUndoActionAndInvalidate( new OGroupUndo( + addUndoAction( new OGroupUndo( *m_aReportModel, _bAppend ? RID_STR_UNDO_APPEND_GROUP : RID_STR_UNDO_REMOVE_GROUP, _bAppend ? Inserted : Removed, @@ -3942,7 +3895,7 @@ void OReportController::modifyGroup(const bool _bAppend, const Sequence< Propert xGroups->removeByIndex( nPos ); } } - catch( const Exception& ) + catch(const Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -3960,7 +3913,7 @@ void OReportController::createGroupSection(const bool _bUndo,const bool _bHeader { const OXUndoEnvironment::OUndoEnvLock aLock(m_aReportModel->GetUndoEnv()); if ( _bUndo ) - addUndoActionAndInvalidate(new OGroupSectionUndo(*m_aReportModel + addUndoAction(new OGroupSectionUndo(*m_aReportModel ,_bHeader ? SID_GROUPHEADER_WITHOUT_UNDO : SID_GROUPFOOTER_WITHOUT_UNDO ,_bHeader ? ::std::mem_fun(&OGroupHelper::getHeader) : ::std::mem_fun(&OGroupHelper::getFooter) ,xGroup @@ -4132,7 +4085,7 @@ void SAL_CALL OReportController::setMode( const ::rtl::OUString& aMode ) throw ( // ----------------------------------------------------------------------------- bool OReportController::isUiVisible() const { - return !m_sMode.equalsAscii("remote"); + return !m_sMode.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("remote")); } // ----------------------------------------------------------------------------- void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty,dbaui::FeatureState& _rState) const @@ -4160,15 +4113,15 @@ void OReportController::impl_fillState_nothrow(const ::rtl::OUString& _sProperty else if ( !comphelper::compare(aTemp,aTemp2) ) break; } - catch(beans::UnknownPropertyException&) + catch(const beans::UnknownPropertyException&) { _rState.bEnabled = sal_False; } - } // for(; aIter != aSelection.end();++aIter) + } if ( aIter == aSelection.end() ) _rState.aValue = aTemp; } - } // if ( _rState.bEnabled ) + } } // ----------------------------------------------------------------------------- void OReportController::impl_zoom_nothrow() @@ -4176,8 +4129,6 @@ void OReportController::impl_zoom_nothrow() Fraction aZoom(m_nZoomValue,100); setZoomFactor( aZoom,*getDesignView() ); getDesignView()->zoom(aZoom); - // TRY - /*getDesignView()->Invalidate(INVALIDATE_NOCHILDREN);*/ InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(),sal_True); InvalidateFeature(SID_ATTR_ZOOMSLIDER,Reference< XStatusListener >(),sal_True); } @@ -4204,9 +4155,9 @@ sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const un break; default: ; - } // switch(_nCommand) + } } - catch(uno::Exception&) + catch(const uno::Exception&) { } } @@ -4215,23 +4166,21 @@ sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const un // ----------------------------------------------------------------------------- bool OReportController::impl_setPropertyAtControls_throw(const sal_uInt16 _nUndoResId,const ::rtl::OUString& _sProperty,const uno::Any& _aValue,const Sequence< PropertyValue >& _aArgs) { - ::std::auto_ptr<UndoManagerListAction> pListAction; ::std::vector< uno::Reference< uno::XInterface > > aSelection; uno::Reference< awt::XWindow> xWindow; lcl_getReportControlFormat( _aArgs, getDesignView(), xWindow, aSelection ); - const bool bMultiSet = aSelection.size() > 1; ::std::vector< uno::Reference< uno::XInterface > >::iterator aIter = aSelection.begin(); + + const String sUndoAction = String( ModuleRes( _nUndoResId ) ); + UndoContext aUndoContext( getUndoManager(), sUndoAction ); + for(; aIter != aSelection.end();++aIter) { - if ( !pListAction.get() && _nUndoResId && bMultiSet ) - { - const String sUndoAction = String(ModuleRes(_nUndoResId)); - pListAction.reset(new UndoManagerListAction(m_aUndoManager,sUndoAction)); - } // if ( !pListAction.get() ) const uno::Reference< beans::XPropertySet > xControlModel(*aIter,uno::UNO_QUERY); if ( xControlModel.is() ) xControlModel->setPropertyValue(_sProperty,_aValue); - } // for(; aIter != aSelection.end();++aIter) + } + return !aSelection.empty(); } // ----------------------------------------------------------------------------- @@ -4269,7 +4218,7 @@ void OReportController::openZoomDialog() { new SvxZoomItem() }; - static USHORT pRanges[] = + static sal_uInt16 pRanges[] = { SID_ATTR_ZOOM,SID_ATTR_ZOOM, 0 @@ -4298,9 +4247,9 @@ void OReportController::openZoomDialog() m_nZoomValue = getDesignView()->getZoomFactor( m_eZoomType ); impl_zoom_nothrow(); - } // if ( !bCancel ) + } } - catch(uno::Exception&) + catch(const uno::Exception&) { DBG_UNHANDLED_EXCEPTION(); } @@ -4308,7 +4257,7 @@ void OReportController::openZoomDialog() for (sal_uInt16 i=0; i < SAL_N_ELEMENTS(pDefaults); ++i) delete pDefaults[i]; - } // if(pFact) + } } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- @@ -4316,15 +4265,12 @@ void OReportController::openZoomDialog() void SAL_CALL OReportController::setVisualAreaSize( ::sal_Int64 _nAspect, const awt::Size& _aSize ) throw (lang::IllegalArgumentException, embed::WrongStateException, uno::Exception, uno::RuntimeException) { ::osl::MutexGuard aGuard( getMutex() ); - //if( nAspect == embed::Aspects::MSOLE_CONTENT ) - { bool bChanged = (m_aVisualAreaSize.Width != _aSize.Width || m_aVisualAreaSize.Height != _aSize.Height); m_aVisualAreaSize = _aSize; if( bChanged ) setModified( sal_True ); - } m_nAspect = _nAspect; } // ----------------------------------------------------------------------------- @@ -4357,17 +4303,15 @@ embed::VisualRepresentation SAL_CALL OReportController::getPreferredVisualRepres { xTransfer->setVisualAreaSize(m_nAspect,m_aVisualAreaSize); aResult = xTransfer->getPreferredVisualRepresentation( _nAspect ); - } // if ( xTransfer.is() ) + } } - catch( uno::Exception & ex ) + catch(const uno::Exception&) { - (void)ex; } m_xReportEngine->setMaxRows(nOldMaxRows); } - catch( uno::Exception & ex ) + catch(const uno::Exception&) { - (void)ex; } m_bInGeneratePreview = false; } @@ -4400,6 +4344,34 @@ uno::Reference< container::XNameAccess > OReportController::getColumns() const } return sLabel; } + +// ----------------------------------------------------------------------------- +SfxUndoManager& OReportController::getUndoManager() const +{ + DBG_TESTSOLARMUTEX(); + // this is expected to be called during UI actions, so the SM is assumed to be locked + + ::boost::shared_ptr< OReportModel > pReportModel( getSdrModel() ); + ENSURE_OR_THROW( !!pReportModel, "no access to our model" ); + + SfxUndoManager* pUndoManager( pReportModel->GetSdrUndoManager() ); + ENSURE_OR_THROW( pUndoManager != NULL, "no access to our model's UndoManager" ); + + return *pUndoManager; +} + +// ----------------------------------------------------------------------------- +void OReportController::clearUndoManager() const +{ + getUndoManager().Clear(); +} + // ----------------------------------------------------------------------------- +void OReportController::addUndoAction( SfxUndoAction* i_pAction ) +{ + getUndoManager().AddUndoAction( i_pAction ); + InvalidateFeature( SID_UNDO ); + InvalidateFeature( SID_REDO ); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/reportdesign/source/ui/report/ReportControllerObserver.cxx b/reportdesign/source/ui/report/ReportControllerObserver.cxx index 45c389f94bef..ce0427728d20 100644 --- a/reportdesign/source/ui/report/ReportControllerObserver.cxx +++ b/reportdesign/source/ui/report/ReportControllerObserver.cxx @@ -50,8 +50,6 @@ namespace rptui using namespace ::com::sun::star; - // const OReportController *& m_pReportController; - DECLARE_STL_USTRINGACCESS_MAP(bool, AllProperties); DECLARE_STL_STDKEY_MAP(uno::Reference< beans::XPropertySet >, AllProperties, PropertySetInfoCache); @@ -111,31 +109,6 @@ public: if ( _pEvt ) { sal_Int32 nEvent = _pEvt->GetId(); - /* - // just for debug - if (nEvent == VCLEVENT_WINDOW_CHILDCREATED || - nEvent == VCLEVENT_WINDOW_PAINT || - nEvent == VCLEVENT_WINDOW_MOVE || - nEvent == VCLEVENT_WINDOW_RESIZE || - nEvent == VCLEVENT_WINDOW_SHOW || - nEvent == VCLEVENT_WINDOW_MOUSEMOVE || - nEvent == VCLEVENT_WINDOW_FRAMETITLECHANGED || - nEvent == VCLEVENT_WINDOW_HIDE || - nEvent == VCLEVENT_EDIT_MODIFY || - nEvent == VCLEVENT_SCROLLBAR_ENDSCROLL || - nEvent == VCLEVENT_EDIT_SELECTIONCHANGED || - nEvent == VCLEVENT_TABPAGE_INSERTED || - nEvent == VCLEVENT_TABPAGE_REMOVED || - nEvent == VCLEVENT_TOOLBOX_FORMATCHANGED || - nEvent == VCLEVENT_TOOLBOX_ITEMADDED || - nEvent == VCLEVENT_TOOLBOX_ALLITEMCHANGED || - nEvent == VCLEVENT_MENUBARADDED || - nEvent == 1 - ) - { - return 0L; - } - */ if (nEvent == VCLEVENT_APPLICATION_DATACHANGED ) { @@ -146,8 +119,6 @@ public: { OEnvLock aLock(*this); - // sal_uInt32 nCount = m_pImpl->m_aSections.size(); - // send all Section Objects a 'tingle' // maybe they need a change in format, color, etc ::std::vector< uno::Reference< container::XChild > >::const_iterator aIter = m_pImpl->m_aSections.begin(); @@ -200,7 +171,6 @@ public: void OXReportControllerObserver::Clear() { OEnvLock aLock(*this); - // sal_uInt32 nDebugValue = m_pImpl->m_aSections.size(); m_pImpl->m_aSections.clear(); } @@ -316,7 +286,6 @@ void OXReportControllerObserver::switchListening( const uno::Reference< containe // be notified of any changes in the container elements uno::Reference< container::XContainer > xSimpleContainer( _rxContainer, uno::UNO_QUERY ); - // OSL_ENSURE( xSimpleContainer.is(), "OXReportControllerObserver::switchListening: how are we expected to be notified of changes in the container?" ); if ( xSimpleContainer.is() ) { if ( _bStartListening ) @@ -368,17 +337,13 @@ void OXReportControllerObserver::switchListening( const uno::Reference< uno::XIn //------------------------------------------------------------------------------ void SAL_CALL OXReportControllerObserver::modified( const lang::EventObject& /*aEvent*/ ) throw (uno::RuntimeException) { - // implSetModified(); } //------------------------------------------------------------------------------ void OXReportControllerObserver::AddElement(const uno::Reference< uno::XInterface >& _rxElement ) { - // if ( !IsLocked() ) - // { m_aFormattedFieldBeautifier.notifyElementInserted(_rxElement); m_aFixedTextColor.notifyElementInserted(_rxElement); - // } // if it's a container, start listening at all elements uno::Reference< container::XIndexAccess > xContainer( _rxElement, uno::UNO_QUERY ); diff --git a/reportdesign/source/ui/report/ReportRuler.cxx b/reportdesign/source/ui/report/ReportRuler.cxx index 2867f9fee662..7c63b73c9299 100644 --- a/reportdesign/source/ui/report/ReportRuler.cxx +++ b/reportdesign/source/ui/report/ReportRuler.cxx @@ -54,7 +54,7 @@ void OReportRuler::Resize() m_pSection->SetPosSizePixel(Point(0,0),GetOutputSize()); } //------------------------------------------------------------------------------ -void OReportRuler::SetGridVisible(BOOL _bVisible) +void OReportRuler::SetGridVisible(sal_Bool _bVisible) { m_pSection->SetGridVisible( _bVisible ); } diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 875adf1118e3..54ccff238de2 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -97,7 +97,7 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re ,m_pReportListener(NULL) ,m_xSection(_xSection) ,m_eMode(RPTUI_SELECT) -,m_bDialogModelChanged(FALSE) +,m_bDialogModelChanged(sal_False) ,m_bInDrag(sal_False) { DBG_CTOR( rpt_OReportSection,NULL); @@ -111,18 +111,17 @@ OReportSection::OReportSection(OSectionWindow* _pParent,const uno::Reference< re } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception catched!"); + OSL_FAIL("Exception catched!"); } m_pFunc.reset(new DlgEdFuncSelect( this )); - m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( /* m_pParent->getViewsWindow()->getView()->getReportView()->getController().getORB() */ ) ); + m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor() ); } //------------------------------------------------------------------------------ OReportSection::~OReportSection() { DBG_DTOR( rpt_OReportSection,NULL); m_pPage = NULL; - //m_pModel->GetUndoEnv().RemoveSection(m_xSection.get()); if ( m_pMulti.is() ) m_pMulti->dispose(); @@ -136,7 +135,6 @@ OReportSection::~OReportSection() m_pView->EndListening( *m_pModel ); m_pView = NULL; } - /*m_pModel->DeletePage(m_pPage->GetPageNum());*/ } //------------------------------------------------------------------------------ void OReportSection::Paint( const Rectangle& rRect ) @@ -212,7 +210,7 @@ void OReportSection::fill() // without the following call, no grid is painted m_pView->ShowSdrPage( m_pPage ); - m_pView->SetMoveSnapOnlyTopLeft( TRUE ); + m_pView->SetMoveSnapOnlyTopLeft( sal_True ); ODesignView* pDesignView = m_pParent->getViewsWindow()->getView()->getReportView(); // #i93595# Adapted grid to a more coarse grid and subdivisions for better visualisation. This @@ -228,8 +226,8 @@ void OReportSection::fill() m_pView->SetSnapGridWidth(aX, aY); m_pView->SetGridSnap( pDesignView->isGridSnap() ); - m_pView->SetGridFront( FALSE ); - m_pView->SetDragStripes( TRUE ); + m_pView->SetGridFront( sal_False ); + m_pView->SetDragStripes( sal_True ); m_pView->SetPageVisible(); sal_Int32 nColor = m_xSection->getBackColor(); if ( nColor == (sal_Int32)COL_TRANSPARENT ) @@ -244,10 +242,9 @@ void OReportSection::fill() // LLA: TODO // m_pPage->SetUppBorder(-10000); - m_pView->SetDesignMode( TRUE ); + m_pView->SetDesignMode( sal_True ); m_pView->StartListening( *m_pModel ); - /*Resize();*/ if ( m_xSection.is() && m_pPage && m_pView ) { uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition(); @@ -256,9 +253,7 @@ void OReportSection::fill() const sal_Int32 nWorkAreaLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); const sal_Int32 nWorkAreaRightMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN); m_pView->SetWorkArea( Rectangle( Point( nWorkAreaLeftMargin, 0), Size(aPageSize.Width() - nWorkAreaLeftMargin - nWorkAreaRightMargin,aPageSize.Height()) ) ); - } // if ( m_xSection.is() && m_pPage && m_pView ) - - //SetBackground( Wallpaper( COL_BLUE )); + } } // ----------------------------------------------------------------------------- void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyCopiedObjects,bool _bForce) @@ -309,7 +304,6 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC { aRet.Move(0,aRet.getHeight()+1); pNeuObj->SetLogicRect(aRet); - //(*pCopiesIter)->setPositionY(aRet.Top()); } } m_pView->AddUndo( m_pView->GetModel()->GetSdrUndoFactory().CreateUndoNewObject( *pNeuObj ) ); @@ -321,7 +315,7 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC } catch(uno::Exception&) { - OSL_ENSURE(0,"Exception caught while pasting a new object!"); + OSL_FAIL("Exception caught while pasting a new object!"); } if ( !_bForce ) break; @@ -368,19 +362,16 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb if( !m_pView->AreObjectsMarked() || !m_xSection.is() ) return; - // stop all drawing actions - //m_pView->BrkAction(); - // insert control models of marked objects into clipboard dialog model const SdrMarkList& rMarkedList = m_pView->GetMarkedObjectList(); - const ULONG nMark = rMarkedList.GetMarkCount(); + const sal_uLong nMark = rMarkedList.GetMarkCount(); ::std::vector< uno::Reference<report::XReportComponent> > aCopies; aCopies.reserve(nMark); SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory(); - for( ULONG i = nMark; i > 0; ) + for( sal_uLong i = nMark; i > 0; ) { --i; SdrObject* pSdrObject = rMarkedList.GetMark(i)->GetMarkedSdrObj(); @@ -400,10 +391,10 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue >& _rAllreadyCopiedOb } catch(uno::Exception&) { - OSL_ENSURE(0,"Can't copy report elements!"); + OSL_FAIL("Can't copy report elements!"); } } - } // for( ULONG i = 0; i < nMark; i++ ) + } if ( !aCopies.empty() ) { @@ -437,7 +428,7 @@ void OReportSection::MouseMove( const MouseEvent& rMEvt ) } //---------------------------------------------------------------------------- -void OReportSection::SetGridVisible(BOOL _bVisible) +void OReportSection::SetGridVisible(sal_Bool _bVisible) { m_pView->SetGridVisible( _bVisible ); } @@ -461,23 +452,27 @@ void OReportSection::SelectAll(const sal_uInt16 _nObjectType) } } } -void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rController,const uno::Reference< report::XReportDefinition>& _xReportDefinition,uno::Reference<frame::XFrame>& _rFrame,BOOL _bHiContrast) +void lcl_insertMenuItemImages( + PopupMenu& rContextMenu, + OReportController& rController, + const uno::Reference< report::XReportDefinition>& _xReportDefinition,uno::Reference<frame::XFrame>& _rFrame +) { - const USHORT nCount = rContextMenu.GetItemCount(); - for (USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = rContextMenu.GetItemCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { if ( MENUITEM_SEPARATOR != rContextMenu.GetItemType(i)) { - const USHORT nId = rContextMenu.GetItemId(i); + const sal_uInt16 nId = rContextMenu.GetItemId(i); PopupMenu* pPopupMenu = rContextMenu.GetPopupMenu( nId ); if ( pPopupMenu ) { - lcl_insertMenuItemImages(*pPopupMenu,rController,_xReportDefinition,_rFrame,_bHiContrast); + lcl_insertMenuItemImages(*pPopupMenu,rController,_xReportDefinition,_rFrame); } else { const ::rtl::OUString sCommand = rContextMenu.GetItemCommand(nId); - rContextMenu.SetItemImage(nId,framework::GetImageFromURL(_rFrame,sCommand,FALSE,_bHiContrast)); + rContextMenu.SetItemImage(nId,framework::GetImageFromURL(_rFrame,sCommand,sal_False)); if ( nId == SID_PAGEHEADERFOOTER ) { String sText = String(ModuleRes((_xReportDefinition.is() && _xReportDefinition->getPageHeaderOn()) ? RID_STR_PAGEHEADERFOOTER_DELETE : RID_STR_PAGEHEADERFOOTER_INSERT)); @@ -492,7 +487,7 @@ void lcl_insertMenuItemImages(PopupMenu& rContextMenu,OReportController& rContro rContextMenu.CheckItem(nId,rController.isCommandChecked(nId)); rContextMenu.EnableItem(nId,rController.isCommandEnabled(nId)); } - } // for (USHORT i = 0; i < nCount; ++i) + } } //---------------------------------------------------------------------------- void OReportSection::Command( const CommandEvent& _rCEvt ) @@ -502,18 +497,16 @@ void OReportSection::Command( const CommandEvent& _rCEvt ) { case COMMAND_CONTEXTMENU: { - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - BOOL bHiContrast = rSettings.GetHighContrastMode(); OReportController& rController = m_pParent->getViewsWindow()->getView()->getReportView()->getController(); uno::Reference<frame::XFrame> xFrame = rController.getFrame(); PopupMenu aContextMenu( ModuleRes( RID_MENU_REPORT ) ); uno::Reference< report::XReportDefinition> xReportDefinition = getSection()->getReportDefinition(); - lcl_insertMenuItemImages(aContextMenu,rController,xReportDefinition,xFrame,bHiContrast); + lcl_insertMenuItemImages(aContextMenu,rController,xReportDefinition,xFrame); Point aPos = _rCEvt.GetMousePosPixel(); m_pView->EndAction(); - const USHORT nId = aContextMenu.Execute(this, aPos); + const sal_uInt16 nId = aContextMenu.Execute(this, aPos); if ( nId ) { uno::Sequence< beans::PropertyValue> aArgs; @@ -607,11 +600,11 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) } pBase->StartListening(); } - } // for (sal_Int32 i = 0; i < nCount; ++i) + } } catch(uno::Exception) { - OSL_ENSURE(0,"Exception caught: OReportSection::_propertyChanged("); + OSL_FAIL("Exception caught: OReportSection::_propertyChanged("); } Resize(); @@ -632,7 +625,7 @@ void OReportSection::deactivateOle() // ----------------------------------------------------------------------------- void OReportSection::createDefault(const ::rtl::OUString& _sType) { - SdrObject* pObj = m_pView->GetCreateObj();//rMarkList.GetMark(0)->GetObj(); + SdrObject* pObj = m_pView->GetCreateObj(); if ( !pObj ) return; createDefault(_sType,pObj); @@ -752,7 +745,7 @@ sal_Int8 OReportSection::AcceptDrop( const AcceptDropEvent& _rEvt ) ) { if (!m_pParent) return DND_ACTION_NONE; - USHORT nCurrentPosition = 0; + sal_uInt16 nCurrentPosition = 0; nCurrentPosition = m_pParent->getViewsWindow()->getPosition(m_pParent); if (_rEvt.mnAction == DND_ACTION_COPY ) { @@ -807,8 +800,7 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) nDropOption = DND_ACTION_COPYMOVE; m_pParent->getViewsWindow()->BrkAction(); m_pParent->getViewsWindow()->unmarkAllObjects(m_pView); - //m_pParent->getViewsWindow()->getView()->setMarked(m_pView,sal_True); - } // if ( OReportExchange::canExtract(rFlavors) ) + } else if ( bMultipleFormat || ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) ) { @@ -830,7 +822,7 @@ sal_Int8 OReportSection::ExecuteDrop( const ExecuteDropEvent& _rEvt ) aValues.realloc(1); aValues[0].Value <<= aDescriptor.createPropertyValueSequence(); - } // if ( !bMultipleFormat ) + } else aValues = ::svx::OMultiColumnTransferable::extractDescriptor(aDropped); diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index cd9363e05d57..2a7a32408db9 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -101,7 +101,7 @@ void OReportWindow::initialize() m_aViewsWindow.initialize(); } //---------------------------------------------------------------------------- -void OReportWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void OReportWindow::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { m_aViewsWindow.SetInsertObj( eObj,_sShapeType); } @@ -117,15 +117,14 @@ void OReportWindow::SetMode( DlgEdMode eNewMode ) m_aViewsWindow.SetMode(eNewMode); } //---------------------------------------------------------------------------- -void OReportWindow::removeSection(USHORT _nPosition) +void OReportWindow::removeSection(sal_uInt16 _nPosition) { m_aViewsWindow.removeSection(_nPosition); m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight()); m_aViewsWindow.Invalidate(INVALIDATE_TRANSPARENT); - //Resize(); } //---------------------------------------------------------------------------- -void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition) +void OReportWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,sal_uInt16 _nPosition) { if ( !_xSection.is() ) return; @@ -163,7 +162,7 @@ sal_Int32 OReportWindow::GetTotalWidth() const { Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH )); const Fraction aZoom(m_pView->getController().getZoomValue(),100); - aStartWidth *= aZoom; // m_aViewsWindow.GetMapMode().GetScaleX();; + aStartWidth *= aZoom; const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width; Fraction aPaperWidth(nPaperWidth,1); aPaperWidth *= aZoom; @@ -248,11 +247,10 @@ void OReportWindow::ScrollChildren(const Point& _aThumbPos) m_aHRuler.Scroll(-(aOrg.X() + _aThumbPos.X()),0); } - /*const Point aPos(PixelToLogic(_aThumbPos));*/ m_aViewsWindow.scrollChildren(_aThumbPos); } //---------------------------------------------------------------------------- -USHORT OReportWindow::getSectionCount() const +sal_uInt16 OReportWindow::getSectionCount() const { return m_aViewsWindow.getSectionCount(); } @@ -262,7 +260,7 @@ void OReportWindow::notifySizeChanged() m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight()); } //---------------------------------------------------------------------------- -BOOL OReportWindow::HasSelection() const +sal_Bool OReportWindow::HasSelection() const { return m_aViewsWindow.HasSelection(); } @@ -285,7 +283,7 @@ void OReportWindow::Paste() m_aViewsWindow.Paste(); } //---------------------------------------------------------------------------- -BOOL OReportWindow::IsPasteAllowed() const +sal_Bool OReportWindow::IsPasteAllowed() const { return m_aViewsWindow.IsPasteAllowed(); } @@ -365,13 +363,13 @@ void OReportWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAl m_aViewsWindow.alignMarkedObjects(_nControlModification, _bAlignAtSection, bBoundRects); } // ----------------------------------------------------------------------------- -void OReportWindow::setGridSnap(BOOL bOn) +void OReportWindow::setGridSnap(sal_Bool bOn) { m_aViewsWindow.setGridSnap(bOn); } // ----------------------------------------------------------------------------- -void OReportWindow::setDragStripes(BOOL bOn) +void OReportWindow::setDragStripes(sal_Bool bOn) { m_aViewsWindow.setDragStripes(bOn); } @@ -386,7 +384,6 @@ void OReportWindow::zoom(const Fraction& _aZoom) m_aHRuler.SetZoom(_aZoom); m_aHRuler.Invalidate(); - //setZoomFactor(_aZoom,*this); // if this will be include the H - ruler has the wrong size m_aViewsWindow.zoom(_aZoom); notifySizeChanged(); @@ -424,14 +421,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const break; case SVX_ZOOM_WHOLEPAGE: { - nZoom = (USHORT)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); + nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); MapMode aMap( MAP_100TH_MM ); const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap); - nZoom = ::std::min(nZoom,(USHORT)(long)Fraction(aSize.Height()*100,aHeight.Height())); + nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height())); } break; case SVX_ZOOM_PAGEWIDTH: - nZoom = (USHORT)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); + nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth()); break; default: break; diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index 82988a764f99..0abd5b75f666 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -93,7 +93,6 @@ void OScrollWindowHelper::impl_initScrollBar( ScrollBar& _rScrollBar ) const aStyle.SetDragFullOptions( aStyle.GetDragFullOptions() | DRAGFULL_OPTION_SCROLL ); // live scrolling aSettings.SetStyleSettings( aStyle ); _rScrollBar.SetSettings( aSettings ); - //_rScrollBar.SetMapMode( MapMode( MAP_100TH_MM ) ); _rScrollBar.SetScrollHdl( LINK( this, OScrollWindowHelper, ScrollHdl ) ); _rScrollBar.SetLineSize( SCR_LINE_SIZE ); @@ -204,12 +203,12 @@ IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ ) //------------------------------------------------------------------------------ void OScrollWindowHelper::addSection(const uno::Reference< report::XSection >& _xSection ,const ::rtl::OUString& _sColorEntry - ,USHORT _nPosition) + ,sal_uInt16 _nPosition) { m_aReportWindow.addSection(_xSection,_sColorEntry,_nPosition); } //------------------------------------------------------------------------------ -void OScrollWindowHelper::removeSection(USHORT _nPosition) +void OScrollWindowHelper::removeSection(sal_uInt16 _nPosition) { m_aReportWindow.removeSection(_nPosition); } @@ -219,12 +218,12 @@ void OScrollWindowHelper::toggleGrid(sal_Bool _bVisible) m_aReportWindow.toggleGrid(_bVisible); } //------------------------------------------------------------------------------ -USHORT OScrollWindowHelper::getSectionCount() const +sal_uInt16 OScrollWindowHelper::getSectionCount() const { return m_aReportWindow.getSectionCount(); } //------------------------------------------------------------------------------ -void OScrollWindowHelper::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void OScrollWindowHelper::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { m_aReportWindow.SetInsertObj(eObj,_sShapeType); } @@ -239,7 +238,7 @@ void OScrollWindowHelper::SetMode( DlgEdMode _eNewMode ) m_aReportWindow.SetMode(_eNewMode); } //------------------------------------------------------------------------------ -BOOL OScrollWindowHelper::HasSelection() const +sal_Bool OScrollWindowHelper::HasSelection() const { return m_aReportWindow.HasSelection(); } @@ -259,7 +258,7 @@ void OScrollWindowHelper::Paste() m_aReportWindow.Paste(); } //---------------------------------------------------------------------------- -BOOL OScrollWindowHelper::IsPasteAllowed() const +sal_Bool OScrollWindowHelper::IsPasteAllowed() const { return m_aReportWindow.IsPasteAllowed(); } @@ -359,7 +358,6 @@ void OScrollWindowHelper::alignMarkedObjects(sal_Int32 _nControlModification,boo void OScrollWindowHelper::ImplInitSettings() { SetBackground( Wallpaper( Application::GetSettings().GetStyleSettings().GetFaceColor() )); - // SetBackground( Wallpaper( COL_LIGHTRED )); SetFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() ); SetTextFillColor( Application::GetSettings().GetStyleSettings().GetFaceColor() ); } @@ -381,12 +379,12 @@ void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& /*_ m_aReportWindow.notifySizeChanged(); } // ----------------------------------------------------------------------------- -void OScrollWindowHelper::setGridSnap(BOOL bOn) +void OScrollWindowHelper::setGridSnap(sal_Bool bOn) { m_aReportWindow.setGridSnap(bOn); } // ----------------------------------------------------------------------------- -void OScrollWindowHelper::setDragStripes(BOOL bOn) +void OScrollWindowHelper::setDragStripes(sal_Bool bOn) { m_aReportWindow.setDragStripes(bOn); } diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx index b0c9a080ea3a..a0355349e361 100644 --- a/reportdesign/source/ui/report/SectionView.cxx +++ b/reportdesign/source/ui/report/SectionView.cxx @@ -57,7 +57,7 @@ OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, O SetBufferedOverlayAllowed(true); SetPageBorderVisible(false); SetBordVisible(); - SetQuickTextEditMode(FALSE); + SetQuickTextEditMode(sal_False); } //---------------------------------------------------------------------------- @@ -76,7 +76,6 @@ void OSectionView::MarkListHasChanged() if ( m_pReportWindow && m_pSectionWindow && !m_pSectionWindow->getPage()->getSpecialMode() ) { - //m_pReportWindow->unmarkAllObjects(this); // WHY DlgEdHint aHint( RPTUI_HINT_SELECTIONCHANGED ); m_pReportWindow->getReportView()->Broadcast( aHint ); m_pReportWindow->getReportView()->UpdatePropertyBrowserDelayed(*this); @@ -163,16 +162,16 @@ void OSectionView::ObjectRemovedInAliveMode( const SdrObject* _pObject ) { DBG_CHKTHIS( rpt_OSectionView,NULL); const SdrMarkList& rMarkedList = GetMarkedObjectList(); - const ULONG nMark = rMarkedList.GetMarkCount(); + const sal_uLong nMark = rMarkedList.GetMarkCount(); - for( ULONG i = 0; i < nMark; i++ ) + for( sal_uLong i = 0; i < nMark; i++ ) { SdrObject* pSdrObj = rMarkedList.GetMark(i)->GetMarkedSdrObj(); if (_pObject == pSdrObj) { SdrPageView* pPgView = GetSdrPageView(); BrkAction(); - MarkObj( pSdrObj, pPgView, TRUE ); + MarkObj( pSdrObj, pPgView, sal_True ); break; } } @@ -188,8 +187,8 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) BegUndo( ); const SdrMarkList& rMark = GetMarkedObjectList(); - ULONG nCount = rMark.GetMarkCount(); - for (ULONG i=0; i<nCount; i++) + sal_uLong nCount = rMark.GetMarkCount(); + for (sal_uLong i=0; i<nCount; i++) { SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); if ( pObj->ISA(OCustomShape) ) @@ -210,7 +209,7 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) EndUndo(); - // #84073# check mark list now instead of later in a timer + // check mark list now instead of later in a timer CheckMarked(); MarkListHasChanged(); } @@ -219,10 +218,10 @@ void OSectionView::SetMarkedToLayer( SdrLayerID _nLayerNo ) bool OSectionView::OnlyShapesMarked() const { const SdrMarkList& rMark = GetMarkedObjectList(); - const ULONG nCount = rMark.GetMarkCount(); + const sal_uLong nCount = rMark.GetMarkCount(); if ( !nCount ) return false; - ULONG i=0; + sal_uLong i=0; for (; i<nCount; i++) { SdrObject* pObj = rMark.GetMark(i)->GetMarkedSdrObj(); @@ -230,7 +229,7 @@ bool OSectionView::OnlyShapesMarked() const { break; } - } // for (ULONG i=0; i<nCount; i++) + } return i == nCount; } @@ -254,7 +253,7 @@ short OSectionView::GetLayerIdOfMarkedObjects() const { short nRet = SHRT_MAX; const SdrMarkList &rMrkList = GetMarkedObjectList(); - for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i ) + for ( sal_uInt16 i = 0; i < rMrkList.GetMarkCount(); ++i ) { const SdrObject *pObj = rMrkList.GetMark( i )->GetMarkedSdrObj(); if ( nRet == SHRT_MAX ) diff --git a/reportdesign/source/ui/report/SectionWindow.cxx b/reportdesign/source/ui/report/SectionWindow.cxx index 0a829c73f01e..c80f3af70db5 100644 --- a/reportdesign/source/ui/report/SectionWindow.cxx +++ b/reportdesign/source/ui/report/SectionWindow.cxx @@ -110,7 +110,7 @@ OSectionWindow::OSectionWindow( OViewsWindow* _pParent,const uno::Reference< rep } _propertyChanged(aEvent); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); } // ----------------------------------------------------------------------------- OSectionWindow::~OSectionWindow() @@ -136,18 +136,15 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) const uno::Reference< report::XSection> xCurrentSection = m_aReportSection.getSection(); if ( _rEvent.PropertyName.equals(PROPERTY_HEIGHT) ) { - m_pParent->getView()->SetUpdateMode(FALSE); + m_pParent->getView()->SetUpdateMode(sal_False); Resize(); m_pParent->getView()->notifySizeChanged(); m_pParent->resize(*this); - m_pParent->getView()->SetUpdateMode(TRUE); + m_pParent->getView()->SetUpdateMode(sal_True); m_aStartMarker.Invalidate(INVALIDATE_NOERASE); m_aEndMarker.Invalidate(INVALIDATE_NOERASE); m_aReportSection.Invalidate(/*INVALIDATE_NOERASE*/); getViewsWindow()->getView()->getReportView()->getController().resetZoomType(); - // Invalidate(INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); - // m_pParent->Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_NOERASE|INVALIDATE_TRANSPARENT); - // m_pParent->Invalidate(/*INVALIDATE_NOCHILDREN | INVALIDATE_NOERASE |*/ INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); } else if ( _rEvent.PropertyName.equals(PROPERTY_NAME) && !xSection->getGroup().is() ) { @@ -164,7 +161,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); } } - } // if ( xSection.is() ) + } else if ( _rEvent.PropertyName.equals(PROPERTY_EXPRESSION) ) { uno::Reference< report::XGroup > xGroup(_rEvent.Source,uno::UNO_QUERY); @@ -176,7 +173,7 @@ void OSectionWindow::_propertyChanged(const beans::PropertyChangeEvent& _rEvent) } } // ----------------------------------------------------------------------------- -bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OReportHelper> _pIsSectionOn) +bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReportDefinition>& _xReport,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OReportHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OReportHelper> _pIsSectionOn) { OReportHelper aReportHelper(_xReport); const bool bRet = _pIsSectionOn(&aReportHelper) && _pGetSection(&aReportHelper) == m_aReportSection.getSection(); @@ -185,11 +182,11 @@ bool OSectionWindow::setReportSectionTitle(const uno::Reference< report::XReport String sTitle = String(ModuleRes(_nResId)); m_aStartMarker.setTitle(sTitle); m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); - } // if ( bRet ) + } return bRet; } // ----------------------------------------------------------------------------- -bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,USHORT _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OGroupHelper> _pIsSectionOn) +bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& _xGroup,sal_uInt16 _nResId,::std::mem_fun_t<uno::Reference<report::XSection> , OGroupHelper> _pGetSection,::std::mem_fun_t<sal_Bool,OGroupHelper> _pIsSectionOn) { OGroupHelper aGroupHelper(_xGroup); const bool bRet = _pIsSectionOn(&aGroupHelper) && _pGetSection(&aGroupHelper) == m_aReportSection.getSection() ; @@ -206,14 +203,13 @@ bool OSectionWindow::setGroupSectionTitle(const uno::Reference< report::XGroup>& sTitle.SearchAndReplace('#',sExpression); m_aStartMarker.setTitle(sTitle); m_aStartMarker.Invalidate(INVALIDATE_CHILDREN); - } // if ( _pIsSectionOn(&aGroupHelper) ) + } return bRet; } //------------------------------------------------------------------------------ void OSectionWindow::ImplInitSettings() { SetBackground( ); - //SetBackground( Wallpaper( COL_RED )); } //----------------------------------------------------------------------------- void OSectionWindow::DataChanged( const DataChangedEvent& rDCEvt ) @@ -309,8 +305,6 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker ) m_pParent->resize(*this); Resize(); - // TRY - // m_pParent->Invalidate(INVALIDATE_TRANSPARENT | INVALIDATE_NOCHILDREN); Invalidate(); } return 0L; @@ -324,21 +318,19 @@ void OSectionWindow::zoom(const Fraction& _aZoom) setZoomFactor(_aZoom,m_aReportSection); setZoomFactor(_aZoom,m_aSplitter); setZoomFactor(_aZoom,m_aEndMarker); - //Resize(); - Invalidate(/*INVALIDATE_UPDATE |*/ /* | INVALIDATE_TRANSPARENT *//*INVALIDATE_NOCHILDREN*/); + Invalidate(); } //----------------------------------------------------------------------------- IMPL_LINK( OSectionWindow, StartSplitHdl, Splitter*, ) { - const String sEmpty(ModuleRes(RID_STR_UNDO_CHANGE_SIZE)); - getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->EnterListAction(sEmpty,String()); + const String sUndoAction( ModuleRes( RID_STR_UNDO_CHANGE_SIZE ) ); + getViewsWindow()->getView()->getReportView()->getController().getUndoManager().EnterListAction( sUndoAction, String() ); return 0L; } //------------------------------------------------------------------------------ IMPL_LINK( OSectionWindow, EndSplitHdl, Splitter*, ) { - getViewsWindow()->getView()->getReportView()->getController().getUndoMgr()->LeaveListAction(); - /*getViewsWindow()->Resize();*/ + getViewsWindow()->getView()->getReportView()->getController().getUndoManager().LeaveListAction(); return 0L; } //----------------------------------------------------------------------------- @@ -350,22 +342,19 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) } sal_Int32 nSplitPos = _pSplitter->GetSplitPosPixel(); - const Point aPos = _pSplitter->GetPosPixel(); - const uno::Reference< report::XSection> xSection = m_aReportSection.getSection(); nSplitPos = m_aSplitter.PixelToLogic(Size(0,nSplitPos)).Height(); - // nSplitPos = xSection->getHeight() + m_aSplitter.PixelToLogic(Size(0,nSplitPos - aPos.Y() )).Height(); const sal_Int32 nCount = xSection->getCount(); for (sal_Int32 i = 0; i < nCount; ++i) { uno::Reference<report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY); - if ( xReportComponent.is() /*&& nSplitPos < (xReportComponent->getPositionY() + xReportComponent->getHeight())*/ ) + if ( xReportComponent.is() ) { nSplitPos = ::std::max(nSplitPos,xReportComponent->getPositionY() + xReportComponent->getHeight()); } - } // for (sal_Int32 i = 0; i < nCount; ++i) + } if ( nSplitPos < 0 ) nSplitPos = 0; @@ -378,7 +367,7 @@ IMPL_LINK( OSectionWindow, SplitHdl, Splitter*, _pSplitter ) // ----------------------------------------------------------------------------- void lcl_scroll(Window& _rWindow,const Point& _aDelta) { - _rWindow.Scroll(-_aDelta.X(),-_aDelta.Y()/*,SCROLL_CHILDREN*//*|SCROLL_CLIP*/); + _rWindow.Scroll(-_aDelta.X(),-_aDelta.Y()); _rWindow.Invalidate(INVALIDATE_TRANSPARENT); } // ----------------------------------------------------------------------------- @@ -401,11 +390,9 @@ void OSectionWindow::scrollChildren(long _nX) const Point aNew = aMapMode.GetOrigin(); const Point aDiff = aOld - aNew; { - //OWindowPositionCorrector aCorrector(&m_aReportSection,-aDelta.Width(),0); lcl_scroll(m_aReportSection,aDiff); } - //lcl_setOrigin(m_aEndMarker,_nDeltaX, 0); lcl_scroll(m_aEndMarker,m_aEndMarker.PixelToLogic(Point(_nX,0))); lcl_setOrigin(m_aSplitter,_nX, 0); diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index da2e56a178e8..b27fcdec1f13 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -51,8 +51,6 @@ namespace rptui Image* OStartMarker::s_pDefCollapsed = NULL; Image* OStartMarker::s_pDefExpanded = NULL; -Image* OStartMarker::s_pDefCollapsedHC = NULL; -Image* OStartMarker::s_pDefExpandedHC = NULL; oslInterlockedCount OStartMarker::s_nImageRefCount = 0; DBG_NAME( rpt_OStartMarker ) @@ -84,7 +82,7 @@ OStartMarker::OStartMarker(OSectionWindow* _pParent,const ::rtl::OUString& _sCol m_aVRuler.SetMargin2(); const MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); m_aVRuler.SetUnit(MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); } // ----------------------------------------------------------------------------- OStartMarker::~OStartMarker() @@ -94,9 +92,7 @@ OStartMarker::~OStartMarker() { DELETEZ(s_pDefCollapsed); DELETEZ(s_pDefExpanded); - DELETEZ(s_pDefCollapsedHC); - DELETEZ(s_pDefExpandedHC); - } // if ( osl_decrementInterlockedCount(&s_nImageRefCount) == 0 ) + } } // ----------------------------------------------------------------------------- sal_Int32 OStartMarker::getMinHeight() const @@ -109,7 +105,6 @@ sal_Int32 OStartMarker::getMinHeight() const void OStartMarker::Paint( const Rectangle& rRect ) { Window::Paint( rRect ); - //SetUpdateMode(FALSE); Size aSize = GetOutputSizePixel(); long nSize = aSize.Width(); const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX()); @@ -117,10 +112,10 @@ void OStartMarker::Paint( const Rectangle& rRect ) if ( !isCollapsed() ) { const long nVRulerWidth = m_aVRuler.GetSizePixel().Width(); - nSize = aSize.Width() - nVRulerWidth/* - m_nCornerSize*/; + nSize = aSize.Width() - nVRulerWidth; SetClipRegion(Region(PixelToLogic(Rectangle(Point(),Size( nSize,aSize.Height()))))); aSize.Width() += nCornerWidth; - } // if ( !isCollapsed() ) + } else SetClipRegion(); @@ -133,14 +128,14 @@ void OStartMarker::Paint( const Rectangle& rRect ) Color aStartColor(m_nColor); aStartColor.IncreaseLuminance(10); - USHORT nHue = 0; - USHORT nSat = 0; - USHORT nBri = 0; + sal_uInt16 nHue = 0; + sal_uInt16 nSat = 0; + sal_uInt16 nBri = 0; aStartColor.RGBtoHSB(nHue, nSat, nBri); nSat += 40; Color aEndColor(Color::HSBtoRGB(nHue, nSat, nBri)); Gradient aGradient(GRADIENT_LINEAR,aStartColor,aEndColor); - aGradient.SetSteps(static_cast<USHORT>(aSize.Height())); + aGradient.SetSteps(static_cast<sal_uInt16>(aSize.Height())); DrawGradient(PixelToLogic(aPoly) ,aGradient); } @@ -191,11 +186,7 @@ void OStartMarker::MouseButtonUp( const MouseEvent& rMEvt ) // ----------------------------------------------------------------------------- void OStartMarker::changeImage() { - Image* pImage = NULL; - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC; - else - pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; + Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; m_aImage.SetImage(*pImage); } // ----------------------------------------------------------------------- @@ -204,30 +195,19 @@ void OStartMarker::initDefaultNodeImages() if ( !s_pDefCollapsed ) { s_pDefCollapsed = new Image( ModuleRes( RID_IMG_TREENODE_COLLAPSED ) ); - s_pDefCollapsedHC = new Image( ModuleRes( RID_IMG_TREENODE_COLLAPSED_HC ) ); s_pDefExpanded = new Image( ModuleRes( RID_IMG_TREENODE_EXPANDED ) ); - s_pDefExpandedHC = new Image( ModuleRes( RID_IMG_TREENODE_EXPANDED_HC ) ); } - Image* pImage = NULL; - if ( GetSettings().GetStyleSettings().GetHighContrastMode() ) - { - pImage = m_bCollapsed ? s_pDefCollapsedHC : s_pDefExpandedHC; - } - else - { - pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; - } + Image* pImage = m_bCollapsed ? s_pDefCollapsed : s_pDefExpanded; m_aImage.SetImage(*pImage); - m_aImage.SetMouseTransparent(TRUE); + m_aImage.SetMouseTransparent(sal_True); m_aImage.SetBackground(); m_aText.SetBackground(); - m_aText.SetMouseTransparent(TRUE); + m_aText.SetMouseTransparent(sal_True); } // ----------------------------------------------------------------------- void OStartMarker::ImplInitSettings() { - // SetBackground( Wallpaper( COL_YELLOW )); SetBackground( ); SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); setColor(); @@ -273,7 +253,6 @@ void OStartMarker::Notify(SfxBroadcaster & rBc, SfxHint const & rHint) == SFX_HINT_COLORS_CHANGED)) { setColor(); - //m_aText.Invalidate(); Invalidate(INVALIDATE_CHILDREN); } } @@ -290,7 +269,6 @@ void OStartMarker::RequestHelp( const HelpEvent& rHEvt ) { // Hilfe anzeigen Rectangle aItemRect(rHEvt.GetMousePosPixel(),Size(GetSizePixel().Width(),getMinHeight())); - //aItemRect = LogicToPixel( aItemRect ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); aItemRect.Left() = aPt.X(); aItemRect.Top() = aPt.Y(); diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 8571adceb816..7e66ceab829a 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -57,6 +57,7 @@ #include <toolkit/helper/convert.hxx> #include <algorithm> #include <numeric> +#include <o3tl/compat_functional.hxx> namespace rptui { @@ -185,7 +186,7 @@ OViewsWindow::OViewsWindow( OReportWindow* _pReportWindow) ,m_bInUnmark(sal_False) { DBG_CTOR( rpt_OViewsWindow,NULL); - SetPaintTransparent(TRUE); + SetPaintTransparent(sal_True); SetUniqueId(UID_RPT_VIEWSWINDOW); SetMapMode( MapMode( MAP_100TH_MM ) ); m_aColorConfig.AddListener(this); @@ -240,7 +241,7 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow) { aStartPoint = pSectionWindow->GetPosPixel(); bSet = true; - } // if ( pSectionWindow.get() == &_rSectionWindow ) + } if ( bSet ) { @@ -248,7 +249,7 @@ void OViewsWindow::resize(const OSectionWindow& _rSectionWindow) pSectionWindow->Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT); pSectionWindow->getStartMarker().Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT ); } - } // for (;aIter != aEnd ; ++aIter,++nPos) + } Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)); aStartWidth *= GetMapMode().GetScaleX(); Size aOut = GetOutputSizePixel(); @@ -269,11 +270,11 @@ void OViewsWindow::Resize() Point aStartPoint(0,-aOffset.Y()); TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); - for (USHORT nPos=0;aIter != aEnd ; ++aIter,++nPos) + for (;aIter != aEnd ; ++aIter) { const ::boost::shared_ptr<OSectionWindow> pSectionWindow = (*aIter); impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,true); - } // for (;aIter != aEnd ; ++aIter) + } } } // ----------------------------------------------------------------------------- @@ -295,7 +296,6 @@ void OViewsWindow::Paint( const Rectangle& rRect ) //------------------------------------------------------------------------------ void OViewsWindow::ImplInitSettings() { - // SetBackground( Wallpaper( COL_LIGHTBLUE )); SetBackground( ); SetFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); SetTextFillColor( Application::GetSettings().GetStyleSettings().GetDialogColor() ); @@ -313,7 +313,7 @@ void OViewsWindow::DataChanged( const DataChangedEvent& rDCEvt ) } } //---------------------------------------------------------------------------- -void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition) +void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSection,const ::rtl::OUString& _sColorEntry,sal_uInt16 _nPosition) { ::boost::shared_ptr<OSectionWindow> pSectionWindow( new OSectionWindow(this,_xSection,_sColorEntry) ); m_aSections.insert(getIteratorAtPos(_nPosition) , TSectionsMap::value_type(pSectionWindow)); @@ -322,7 +322,7 @@ void OViewsWindow::addSection(const uno::Reference< report::XSection >& _xSectio Resize(); } //---------------------------------------------------------------------------- -void OViewsWindow::removeSection(USHORT _nPosition) +void OViewsWindow::removeSection(sal_uInt16 _nPosition) { if ( _nPosition < m_aSections.size() ) { @@ -333,15 +333,15 @@ void OViewsWindow::removeSection(USHORT _nPosition) m_aSections.erase(aPos); Resize(); - } // if ( _nPosition < m_aSections.size() ) + } } //------------------------------------------------------------------------------ -void OViewsWindow::toggleGrid(BOOL _bVisible) +void OViewsWindow::toggleGrid(sal_Bool _bVisible) { ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OReportSection::SetGridVisible,_1,_bVisible),TReportPairHelper())); + ::o3tl::compose1(::boost::bind(&OReportSection::SetGridVisible,_1,_bVisible),TReportPairHelper())); ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OReportSection::Window::Invalidate,_1,INVALIDATE_NOERASE),TReportPairHelper())); + ::o3tl::compose1(::boost::bind(&OReportSection::Window::Invalidate,_1,INVALIDATE_NOERASE),TReportPairHelper())); } //------------------------------------------------------------------------------ sal_Int32 OViewsWindow::getTotalHeight() const @@ -356,12 +356,12 @@ sal_Int32 OViewsWindow::getTotalHeight() const return nHeight; } //---------------------------------------------------------------------------- -USHORT OViewsWindow::getSectionCount() const +sal_uInt16 OViewsWindow::getSectionCount() const { - return static_cast<USHORT>(m_aSections.size()); + return static_cast<sal_uInt16>(m_aSections.size()); } //---------------------------------------------------------------------------- -void OViewsWindow::SetInsertObj( USHORT eObj,const ::rtl::OUString& _sShapeType ) +void OViewsWindow::SetInsertObj( sal_uInt16 eObj,const ::rtl::OUString& _sShapeType ) { TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); @@ -380,10 +380,10 @@ rtl::OUString OViewsWindow::GetInsertObjString() const void OViewsWindow::SetMode( DlgEdMode eNewMode ) { ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OReportSection::SetMode,_1,eNewMode),TReportPairHelper())); + ::o3tl::compose1(::boost::bind(&OReportSection::SetMode,_1,eNewMode),TReportPairHelper())); } //---------------------------------------------------------------------------- -BOOL OViewsWindow::HasSelection() const +sal_Bool OViewsWindow::HasSelection() const { TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); @@ -396,7 +396,7 @@ void OViewsWindow::Delete() { m_bInUnmark = sal_True; ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::mem_fn(&OReportSection::Delete),TReportPairHelper())); + ::o3tl::compose1(::boost::mem_fn(&OReportSection::Delete),TReportPairHelper())); m_bInUnmark = sal_False; } //---------------------------------------------------------------------------- @@ -404,12 +404,8 @@ void OViewsWindow::Copy() { uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects; ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OReportSection::Copy,_1,::boost::ref(aAllreadyCopiedObjects)),TReportPairHelper())); + ::o3tl::compose1(::boost::bind(&OReportSection::Copy,_1,::boost::ref(aAllreadyCopiedObjects)),TReportPairHelper())); - //TSectionsMap::iterator aIter = m_aSections.begin(); - //TSectionsMap::iterator aEnd = m_aSections.end(); - //for (; aIter != aEnd; ++aIter) - // (*aIter)->getReportSection().Copy(aAllreadyCopiedObjects); OReportExchange* pCopy = new OReportExchange(aAllreadyCopiedObjects); uno::Reference< datatransfer::XTransferable> aEnsureDelete = pCopy; pCopy->CopyToClipboard(this); @@ -421,7 +417,7 @@ void OViewsWindow::Paste() OReportExchange::TSectionElements aCopies = OReportExchange::extractCopies(aTransferData); if ( aCopies.getLength() > 1 ) ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OReportSection::Paste,_1,aCopies,false),TReportPairHelper())); + ::o3tl::compose1(::boost::bind(&OReportSection::Paste,_1,aCopies,false),TReportPairHelper())); else { ::boost::shared_ptr<OSectionWindow> pMarkedSection = getMarkedSection(); @@ -500,9 +496,9 @@ void OViewsWindow::Paste() } break; } - } // ( (*aIter).second->isMarked() ) + } ++nCurrentPosition; - } // for (; aIter != aEnd ; ++aIter) + } return pRet; } @@ -513,7 +509,7 @@ void OViewsWindow::markSection(const sal_uInt16 _nPos) m_pParent->setMarked(m_aSections[_nPos]->getReportSection().getSection(),sal_True); } //---------------------------------------------------------------------------- -BOOL OViewsWindow::IsPasteAllowed() const +sal_Bool OViewsWindow::IsPasteAllowed() const { TransferableDataHelper aTransferData( TransferableDataHelper::CreateFromSystemClipboard( const_cast< OViewsWindow* >( this ) ) ); return aTransferData.HasFormat(OReportExchange::getDescriptorFormatId()); @@ -523,7 +519,7 @@ void OViewsWindow::SelectAll(const sal_uInt16 _nObjectType) { m_bInUnmark = sal_True; ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(::boost::mem_fn(&OReportSection::SelectAll),_1,_nObjectType),TReportPairHelper())); + ::o3tl::compose1(::boost::bind(::boost::mem_fn(&OReportSection::SelectAll),_1,_nObjectType),TReportPairHelper())); m_bInUnmark = sal_False; } //----------------------------------------------------------------------------- @@ -541,29 +537,10 @@ void OViewsWindow::unmarkAllObjects(OSectionView* _pSectionView) (*aIter)->getReportSection().deactivateOle(); (*aIter)->getReportSection().getSectionView().UnmarkAllObj(); } - } // for (; aIter != aEnd ; ++aIter) + } m_bInUnmark = sal_False; } } -//----------------------------------------------------------------------------- -/* -::boost::shared_ptr<OSectionWindow> OViewsWindow::getReportSection(const uno::Reference< report::XSection >& _xSection) -{ - OSL_ENSURE(_xSection.is(),"Section is NULL!"); - ::boost::shared_ptr<OSectionWindow> pRet; - TSectionsMap::iterator aIter = m_aSections.begin(); - TSectionsMap::iterator aEnd = m_aSections.end(); - for (; aIter != aEnd ; ++aIter) - { - if ( (*aIter)->getReportSection().getSection() == _xSection ) - { - pRet = (*aIter); - break; - } // if ( (*aIter)->getSection() == _xSection ) - } // for (; aIter != aEnd ; ++aIter) - return pRet; -} -*/ // ----------------------------------------------------------------------- void OViewsWindow::ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32) { @@ -585,9 +562,9 @@ void OViewsWindow::MouseButtonDown( const MouseEvent& rMEvt ) void OViewsWindow::showRuler(sal_Bool _bShow) { ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OStartMarker::showRuler,_1,_bShow),TStartMarkerHelper())); + ::o3tl::compose1(::boost::bind(&OStartMarker::showRuler,_1,_bShow),TStartMarkerHelper())); ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::bind(&OStartMarker::Window::Invalidate,_1,USHORT(INVALIDATE_NOERASE)),TStartMarkerHelper())); + ::o3tl::compose1(::boost::bind(&OStartMarker::Window::Invalidate, _1, sal_uInt16(INVALIDATE_NOERASE)), TStartMarkerHelper())); } //---------------------------------------------------------------------------- void OViewsWindow::MouseButtonUp( const MouseEvent& rMEvt ) @@ -620,7 +597,6 @@ sal_Bool OViewsWindow::handleKeyEvent(const KeyEvent& _rEvent) TSectionsMap::iterator aEnd = m_aSections.end(); for (;aIter != aEnd ; ++aIter) { - //if ( (*aIter).getReportSection().getSectionView().->AreObjectsMarked() ) if ( (*aIter)->getStartMarker().isMarked() ) { bRet = (*aIter)->getReportSection().handleKeyEvent(_rEvent); @@ -629,7 +605,7 @@ sal_Bool OViewsWindow::handleKeyEvent(const KeyEvent& _rEvent) return bRet; } //---------------------------------------------------------------------------- -OViewsWindow::TSectionsMap::iterator OViewsWindow::getIteratorAtPos(USHORT _nPos) +OViewsWindow::TSectionsMap::iterator OViewsWindow::getIteratorAtPos(sal_uInt16 _nPos) { TSectionsMap::iterator aRet = m_aSections.end(); if ( _nPos < m_aSections.size() ) @@ -744,7 +720,7 @@ void OViewsWindow::collectBoundResizeRect(const TRectangleMap& _rSortRectangles, SdrObjTransformInfoRec aInfo; const SdrObject* pObj = aRectIter->second.first; pObj->TakeObjInfo(aInfo); - BOOL bHasFixed = !aInfo.bMoveAllowed || pObj->IsMoveProtect(); + sal_Bool bHasFixed = !aInfo.bMoveAllowed || pObj->IsMoveProtect(); if ( bHasFixed ) _rBound.Union(aObjRect); else @@ -917,10 +893,8 @@ void OViewsWindow::alignMarkedObjects(sal_Int32 _nControlModification,bool _bAli { if ( _nControlModification == ControlModification::WIDTH_SMALLEST || _nControlModification == ControlModification::WIDTH_GREATEST ) pObjBase->getReportComponent()->setSize(awt::Size(nXMov,aObjRect.getHeight())); - //pObj->Resize(aObjRect.TopLeft(),Fraction(nXMov,aObjRect.getWidth()),Fraction(1,1)); else if ( _nControlModification == ControlModification::HEIGHT_GREATEST || _nControlModification == ControlModification::HEIGHT_SMALLEST ) pObjBase->getReportComponent()->setSize(awt::Size(aObjRect.getWidth(),nYMov)); - //pObj->Resize(aObjRect.TopLeft(),Fraction(1,1),Fraction(nYMov,aObjRect.getHeight())); } } break; @@ -940,7 +914,7 @@ void OViewsWindow::createDefault() pMarkedSection->getReportSection().createDefault(m_sShapeType); } // ----------------------------------------------------------------------------- -void OViewsWindow::setGridSnap(BOOL bOn) +void OViewsWindow::setGridSnap(sal_Bool bOn) { TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); @@ -951,7 +925,7 @@ void OViewsWindow::setGridSnap(BOOL bOn) } } // ----------------------------------------------------------------------------- -void OViewsWindow::setDragStripes(BOOL bOn) +void OViewsWindow::setDragStripes(sal_Bool bOn) { TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); @@ -959,11 +933,11 @@ void OViewsWindow::setDragStripes(BOOL bOn) (*aIter)->getReportSection().getSectionView().SetDragStripes(bOn); } // ----------------------------------------------------------------------------- -USHORT OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const +sal_uInt16 OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const { TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); - USHORT nPosition = 0; + sal_uInt16 nPosition = 0; for (; aIter != aEnd ; ++aIter) { if ( _pSectionWindow == (*aIter).get() ) @@ -975,7 +949,7 @@ USHORT OViewsWindow::getPosition(const OSectionWindow* _pSectionWindow) const return nPosition; } // ----------------------------------------------------------------------------- -::boost::shared_ptr<OSectionWindow> OViewsWindow::getSectionWindow(const USHORT _nPos) const +::boost::shared_ptr<OSectionWindow> OViewsWindow::getSectionWindow(const sal_uInt16 _nPos) const { ::boost::shared_ptr<OSectionWindow> aReturn; @@ -1060,29 +1034,22 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _ if ( &rView != &_rSection ) { -// SdrRectObj *pNewObj = new SdrRectObj(OBJ_RECT, _aRect); -// SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Temp Label"))); SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))); if (pNewObj) { pNewObj->SetLogicRect(_aRect); - // pNewObj->SetSize(_aRect.GetSize()); - // pNewObj->Move(Size(_aRect.Left(), _aRect.Top())); pNewObj->Move(Size(0, aNewPos.Y())); - BOOL bChanged = rView.GetModel()->IsChanged(); + sal_Bool bChanged = rView.GetModel()->IsChanged(); rReportSection.getPage()->InsertObject(pNewObj); rView.GetModel()->SetChanged(bChanged); m_aBegDragTempList.push_back(pNewObj); - Rectangle aRect = pNewObj->GetLogicRect(); - // pNewObj->SetText(String::CreateFromAscii("Drag helper")); rView.MarkObj( pNewObj, rView.GetSdrPageView() ); } } const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); aNewPos.Y() -= nSectionHeight; -// aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } } // ----------------------------------------------------------------------------- @@ -1117,7 +1084,7 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi // Create drag lines over all viewable Views // Therefore we need to identify the marked objects // and create temporary objects on all other views at the same position - // relative to its occurance. + // relative to its occurrence. OSL_TRACE("BegDragObj createInvisible Objects\n" ); int nViewCount = 0; @@ -1147,14 +1114,6 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi OSL_TRACE("BegDragObj createInvisible X:%d Y:%d on View #%d\n", aRect.Left(), aRect.Top(), nViewCount ); BegDragObj_createInvisibleObjectAtPosition(aRect, rView); - - // calculate the clickpoint -// const sal_Int32 nDeltaX = abs(aRect.Left() - aAbsolutePnt.X()); -// const sal_Int32 nDeltaY = abs(aRect.Top() - aAbsolutePnt.Y()); -// if (m_aDragDelta.X() > nDeltaX) -// m_aDragDelta.X() = nDeltaX; -// if (m_aDragDelta.Y() > nDeltaY) -// m_aDragDelta.Y() = nDeltaY; } } } @@ -1165,9 +1124,6 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); aNewObjPos.Y() += nSectionHeight; - - // don't subtract the height of the lines between the views - // aNewObjPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } const sal_Int32 nDeltaX = abs(aLeftTop.X() - aAbsolutePnt.X()); @@ -1176,38 +1132,13 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi m_aDragDelta.Y() = nDeltaY; Point aNewPos = aAbsolutePnt; - // for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) - // { - // OReportSection& rReportSection = (*aIter)->getReportSection(); - // if ( &rReportSection.getSectionView() == _pSection ) - // break; - // aNewPos.Y() += rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - // } const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width()); - // long nLastSectionHeight = 0; - // bool bAdd = true; nViewCount = 0; for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) { OReportSection& rReportSection = (*aIter)->getReportSection(); - // if ( &rReportSection.getSectionView() == _pSection ) - // { - // bAdd = false; - // aNewPos = _aPnt; - // } - // else if ( bAdd ) - // { - // const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - // aNewPos.Y() += nSectionHeight; - // } - // else - // { - // aNewPos.Y() -= nLastSectionHeight; - // } - - //? SdrHdl* pHdl = _pHdl; if ( pHdl ) { @@ -1222,8 +1153,6 @@ void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionVi const long nSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); aNewPos.Y() -= nSectionHeight; - // subtract the height between the views, because they are visible but not from interest here. - // aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } } @@ -1260,10 +1189,7 @@ void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection) } rReportSection.getSectionView().BegMarkObj ( aNewPos ); nLastSectionHeight = rReportSection.PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); - - // aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } - //::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( _aPnt , eMarkAction) ); } // ----------------------------------------------------------------------------- OSectionView* OViewsWindow::getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt) @@ -1327,10 +1253,10 @@ void OViewsWindow::EndDragObj_removeInvisibleObjects() } } // ----------------------------------------------------------------------------- -void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt) +void OViewsWindow::EndDragObj(sal_Bool _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt) { const String sUndoAction = String((ModuleRes(RID_STR_UNDO_CHANGEPOSITION))); - UndoManagerListAction aListAction(*getView()->getReportView()->getController().getUndoMgr(),sUndoAction); + const UndoContext aUndoContext( getView()->getReportView()->getController().getUndoManager(), sUndoAction ); Point aNewPos = _aPnt; OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos); @@ -1341,9 +1267,6 @@ void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSe EndDragObj_removeInvisibleObjects(); // we need to manipulate the current clickpoint, we substract the old delta from BeginDrag - // OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aPnt); - // aNewPos.X() -= m_aDragDelta.X(); - // aNewPos.Y() -= m_aDragDelta.Y(); aNewPos -= m_aDragDelta; uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects; @@ -1358,8 +1281,8 @@ void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSe rReportSection.Copy(aAllreadyCopiedObjects,true); } else - pInSection->EndDragObj(FALSE); - } // for (; aIter != aEnd; ++aIter) + pInSection->EndDragObj(sal_False); + } if ( aAllreadyCopiedObjects.getLength() ) { @@ -1429,7 +1352,7 @@ void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSe } else { - ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( FALSE ) ); + ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( sal_False ) ); EndDragObj_removeInvisibleObjects(); } m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32); @@ -1455,11 +1378,9 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo aHdlPos = pHdl->GetPos(); } - TSectionsMap::iterator aIter/* = m_aSections.begin() */; + TSectionsMap::iterator aIter; TSectionsMap::iterator aEnd = m_aSections.end(); - //if ( _bMove ) - //{ for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) { OReportSection& rReportSection = (*aIter)->getReportSection(); @@ -1467,8 +1388,7 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo break; const long nSectionHeight = (*aIter)->PixelToLogic(rReportSection.GetOutputSizePixel()).Height(); aCurrentSectionPos.Y() += nSectionHeight; - } // for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) - //} + } aRealMousePos += aCurrentSectionPos; // If control key is pressed the work area is limited to the section with the current selection. @@ -1483,7 +1403,6 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo { Rectangle aClipRect = rView.GetWorkArea(); aClipRect.Top() = aCurrentSectionPos.Y() - aPosForWorkArea.Y(); - // if (aClipRect.Top() < 0) aClipRect.Top() = 0; aClipRect.Bottom() = aClipRect.Top() + nSectionHeight; rView.SetWorkArea( aClipRect ); } @@ -1494,7 +1413,6 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo rView.SetWorkArea( aClipRect ); } aPosForWorkArea.Y() += nSectionHeight; - // aNewPos.Y() += PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } @@ -1513,9 +1431,9 @@ void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bo } } // ----------------------------------------------------------------------------- -BOOL OViewsWindow::IsAction() const +sal_Bool OViewsWindow::IsAction() const { - BOOL bAction = FALSE; + sal_Bool bAction = sal_False; TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); for (; !bAction && aIter != aEnd; ++aIter) @@ -1523,9 +1441,9 @@ BOOL OViewsWindow::IsAction() const return bAction; } // ----------------------------------------------------------------------------- -BOOL OViewsWindow::IsDragObj() const +sal_Bool OViewsWindow::IsDragObj() const { - BOOL bAction = FALSE; + sal_Bool bAction = sal_False; TSectionsMap::const_iterator aIter = m_aSections.begin(); TSectionsMap::const_iterator aEnd = m_aSections.end(); for (; !bAction && aIter != aEnd; ++aIter) @@ -1545,7 +1463,7 @@ sal_uInt32 OViewsWindow::getMarkedObjectCount() const // ----------------------------------------------------------------------------- void OViewsWindow::handleKey(const KeyCode& _rCode) { - const USHORT nCode = _rCode.GetCode(); + const sal_uInt16 nCode = _rCode.GetCode(); if ( _rCode.IsMod1() ) { // scroll page @@ -1655,13 +1573,13 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) if ( rView.IsDragObj() ) { const bool bWasNoSnap = rDragStat.IsNoSnap(); - const BOOL bWasSnapEnabled = rView.IsSnapEnabled(); + const sal_Bool bWasSnapEnabled = rView.IsSnapEnabled(); // switch snapping off if ( !bWasNoSnap ) - ((SdrDragStat&)rDragStat).SetNoSnap( TRUE ); + ((SdrDragStat&)rDragStat).SetNoSnap( sal_True ); if ( bWasSnapEnabled ) - rView.SetSnapEnabled( FALSE ); + rView.SetSnapEnabled( sal_False ); Rectangle aNewRect; bool bCheck = false; @@ -1717,7 +1635,7 @@ void OViewsWindow::handleKey(const KeyCode& _rCode) void OViewsWindow::stopScrollTimer() { ::std::for_each(m_aSections.begin(),m_aSections.end(), - ::std::compose1(::boost::mem_fn(&OReportSection::stopScrollTimer),TReportPairHelper())); + ::o3tl::compose1(::boost::mem_fn(&OReportSection::stopScrollTimer),TReportPairHelper())); } // ----------------------------------------------------------------------------- void OViewsWindow::fillCollapsedSections(::std::vector<sal_uInt16>& _rCollapsedPositions) const @@ -1762,7 +1680,7 @@ void OViewsWindow::zoom(const Fraction& _aZoom) for (;aIter != aEnd ; ++aIter) { (*aIter)->zoom(_aZoom); - } // for (;aIter != aEnd ; ++aIter) + } Resize(); @@ -1771,7 +1689,7 @@ void OViewsWindow::zoom(const Fraction& _aZoom) aOut = PixelToLogic(aOut); Rectangle aRect(PixelToLogic(Point(0,0)),aOut); - Invalidate(aRect,/*INVALIDATE_NOERASE | */INVALIDATE_NOCHILDREN /*| INVALIDATE_TRANSPARENT*/); + Invalidate(aRect,INVALIDATE_NOCHILDREN); } //---------------------------------------------------------------------------- void OViewsWindow::scrollChildren(const Point& _aThumbPos) @@ -1786,7 +1704,6 @@ void OViewsWindow::scrollChildren(const Point& _aThumbPos) aMapMode.SetOrigin( Point(aOld.X() , - aPosY.Y())); SetMapMode( aMapMode ); - //OWindowPositionCorrector aCorrector(this,0,-( aOld.Y() + aPosY.Y())); Scroll(0, -( aOld.Y() + aPosY.Y()),SCROLL_CHILDREN); Resize(); Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT); @@ -1797,7 +1714,7 @@ void OViewsWindow::scrollChildren(const Point& _aThumbPos) for (;aIter != aEnd ; ++aIter) { (*aIter)->scrollChildren(aPos.X()); - } // for (;aIter != aEnd ; ++aIter) + } } // ----------------------------------------------------------------------------- void OViewsWindow::fillControlModelSelection(::std::vector< uno::Reference< uno::XInterface > >& _rSelection) const diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx index 1ca2e5cadbee..d5db6eb1d101 100644 --- a/reportdesign/source/ui/report/dlgedfac.cxx +++ b/reportdesign/source/ui/report/dlgedfac.cxx @@ -101,7 +101,7 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory ) pObjFactory->pNewObj = new OOle2Obj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.chart2.ChartDocument")),OBJ_OLE2); break; default: - OSL_ENSURE(0,"Unknown object id"); + OSL_FAIL("Unknown object id"); break; } } diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 10fdbce9a06e..70f130c2afe4 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -96,7 +96,6 @@ void DlgEdFunc::ForceScroll( const Point& rPos ) Rectangle aOutRect( pScrollWindow->getThumbPos(), aOut ); aOutRect = m_pParent->PixelToLogic( aOutRect ); - //Rectangle aWorkArea = m_pParent->getView()->GetWorkArea(); Point aGcc3WorkaroundTemporary; Rectangle aWorkArea(aGcc3WorkaroundTemporary,pScrollWindow->getTotalSize()); aWorkArea.Right() -= (long)aStartWidth; @@ -134,7 +133,6 @@ DlgEdFunc::DlgEdFunc( OReportSection* _pParent ) m_bUiActive(false), m_bShowPropertyBrowser(false) { - // m_pParent = _pParent; aScrollTimer.SetTimeoutHdl( LINK( this, DlgEdFunc, ScrollTimeout ) ); m_rView.SetActualWin( m_pParent); aScrollTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL ); @@ -152,14 +150,7 @@ sal_Int32 lcl_setColorOfObject(uno::Reference< uno::XInterface > _xObj, long _nC try { uno::Reference<report::XReportComponent> xComponent(_xObj, uno::UNO_QUERY_THROW); - // NOT NEED if UNO_QUERY_THROW: - // if (xComponent.is()) - // { uno::Reference< beans::XPropertySet > xProp(xComponent, uno::UNO_QUERY_THROW); - // if (xProp.is()) - // { - // ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ControlBackground")) - // is PROPERTY_CONTROLBACKGROUND uno::Any aAny = xProp->getPropertyValue(PROPERTY_CONTROLBACKGROUND); if (aAny.hasValue()) { @@ -168,12 +159,9 @@ sal_Int32 lcl_setColorOfObject(uno::Reference< uno::XInterface > _xObj, long _nC uno::Any aBlackColorAny = uno::makeAny(_nColorTRGB); xProp->setPropertyValue(PROPERTY_CONTROLBACKGROUND, aBlackColorAny); } - // aCopies.push_back(xComponent->createClone()); } catch(uno::Exception&) { - // bit my shiny metal as! - // OSL_ENSURE(0,"Can't copy report elements!"); } return nBackColor; } @@ -186,11 +174,11 @@ DlgEdFunc::~DlgEdFunc() //---------------------------------------------------------------------------- -BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) { m_aMDPos = m_pParent->PixelToLogic( rMEvt.GetPosPixel() ); m_pParent->GrabFocus(); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if ( rMEvt.IsLeft() ) { if ( rMEvt.GetClicks() > 1 ) @@ -207,19 +195,18 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) // SdrViewEvent aVEvt; // m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) ) - // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, FALSE); - bHandled = TRUE; + // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, sal_False); + bHandled = sal_True; } } else { SdrHdl* pHdl = m_rView.PickHandle(m_aMDPos); - //m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(m_pView); // if selected object was hit, drag object if ( pHdl!=NULL || m_rView.IsMarkedHit(m_aMDPos) ) { - bHandled = TRUE; + bHandled = sal_True; m_pParent->CaptureMouse(); m_pParent->getSectionWindow()->getViewsWindow()->BegDragObj(m_aMDPos, pHdl,&m_rView); } @@ -236,10 +223,10 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) else m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL); - bHandled = TRUE; + bHandled = sal_True; } else if( !rMEvt.IsLeft() ) - bHandled = TRUE; + bHandled = sal_True; if ( !bHandled ) m_pParent->CaptureMouse(); return bHandled; @@ -247,9 +234,9 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) //---------------------------------------------------------------------------- -BOOL DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ ) +sal_Bool DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; m_pParent->getSectionWindow()->getViewsWindow()->stopScrollTimer(); return bHandled; } @@ -258,7 +245,7 @@ void DlgEdFunc::checkTwoCklicks(const MouseEvent& rMEvt) { deactivateOle(); - const USHORT nClicks = rMEvt.GetClicks(); + const sal_uInt16 nClicks = rMEvt.GetClicks(); if ( nClicks == 2 && rMEvt.IsLeft() ) { if ( m_rView.AreObjectsMarked() ) @@ -269,8 +256,8 @@ void DlgEdFunc::checkTwoCklicks(const MouseEvent& rMEvt) const SdrMark* pMark = rMarkList.GetMark(0); SdrObject* pObj = pMark->GetMarkedSdrObj(); activateOle(pObj); - } // if (rMarkList.GetMarkCount() == 1) - } // if ( pView->AreObjectsMarked() ) + } + } } } // ----------------------------------------------------------------------------- @@ -283,19 +270,19 @@ void DlgEdFunc::stopScrollTimer() } //---------------------------------------------------------------------------- -BOOL DlgEdFunc::MouseMove( const MouseEvent& /*rMEvt*/ ) +sal_Bool DlgEdFunc::MouseMove( const MouseEvent& /*rMEvt*/ ) { - return FALSE; + return sal_False; } //------------------------------------------------------------------------------ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) { - BOOL bReturn = FALSE; + sal_Bool bReturn = sal_False; if ( !m_bUiActive ) { const KeyCode& rCode = _rEvent.GetKeyCode(); - USHORT nCode = rCode.GetCode(); + sal_uInt16 nCode = rCode.GetCode(); switch ( nCode ) { @@ -304,12 +291,12 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) if ( m_pParent->getSectionWindow()->getViewsWindow()->IsAction() ) { m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); - bReturn = TRUE; + bReturn = sal_True; } else if ( m_rView.IsTextEdit() ) { m_rView.SdrEndTextEdit(); - bReturn = TRUE; + bReturn = sal_True; } else if ( m_rView.AreObjectsMarked() ) { @@ -319,10 +306,9 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) ((SdrHdlList&)rHdlList).ResetFocusHdl(); else m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL); - //m_rView.UnmarkAll(); deactivateOle(true); - bReturn = FALSE; + bReturn = sal_False; } else { @@ -345,7 +331,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) if ( m_rView.AreObjectsMarked() ) m_rView.MakeVisible( m_rView.GetAllMarkedRect(), *m_pParent); - bReturn = TRUE; + bReturn = sal_True; } else if ( rCode.IsMod1() && rCode.IsMod2()) { @@ -362,7 +348,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) m_rView.MakeVisible( aVisRect, *m_pParent); } - bReturn = TRUE; + bReturn = sal_True; } } break; @@ -372,7 +358,7 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) case KEY_RIGHT: { m_pParent->getSectionWindow()->getViewsWindow()->handleKey(rCode); - bReturn = TRUE; + bReturn = sal_True; } break; case KEY_RETURN: @@ -389,9 +375,9 @@ sal_Bool DlgEdFunc::handleKeyEvent(const KeyEvent& _rEvent) case KEY_DELETE: if ( !rCode.IsMod1() && !rCode.IsMod2() ) { - bReturn = TRUE; + bReturn = sal_True; break; - } // if ( !rCode.IsMod1() && !rCode.IsMod2() ) + } // run through default: { @@ -411,7 +397,7 @@ void DlgEdFunc::activateOle(SdrObject* _pObj) { if ( _pObj ) { - const UINT16 nSdrObjKind = _pObj->GetObjIdentifier(); + const sal_uInt16 nSdrObjKind = _pObj->GetObjIdentifier(); // // OLE: activate // @@ -445,15 +431,15 @@ void DlgEdFunc::activateOle(SdrObject* _pObj) } } } - } // if (nSdrObjKind == OBJ_OLE2) - } // if ( _pObj ) + } + } } // ----------------------------------------------------------------------------- void DlgEdFunc::deactivateOle(bool _bSelect) { OLEObjCache& rObjCache = GetSdrGlobalData().GetOLEObjCache(); - const ULONG nCount = rObjCache.Count(); - for(ULONG i = 0 ; i< nCount;++i) + const sal_uLong nCount = rObjCache.Count(); + for(sal_uLong i = 0 ; i< nCount;++i) { SdrOle2Obj* pObj = reinterpret_cast<SdrOle2Obj*>(rObjCache.GetObject(i)); if ( m_pParent->getPage() == pObj->GetPage() ) @@ -474,9 +460,9 @@ void DlgEdFunc::deactivateOle(bool _bSelect) SdrPageView* pPV = m_rView.GetSdrPageView(); m_rView.MarkObj(pObj, pPV); } - } // if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) + } } - } // for(ULONG i = 0 ; i< nCount;++i) + } } // ----------------------------------------------------------------------------- void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj) @@ -584,7 +570,6 @@ bool DlgEdFunc::isOnlyCustomShapeMarked() for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i ) { SdrMark* pMark = rMarkList.GetMark(i); - // bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL; SdrObject* pObj = pMark->GetMarkedSdrObj(); if (pObj->GetObjIdentifier() != OBJ_CUSTOMSHAPE) { @@ -609,7 +594,6 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt) if ( !bIsSetPoint ) { // no drag rect, we have to check every single select rect - //const Rectangle& rRect = m_rView.GetDragStat().GetActionRect(); const SdrDragStat& rDragStat = m_rView.GetDragStat(); if (rDragStat.GetDragMethod() != NULL) { @@ -674,39 +658,34 @@ bool DlgEdFunc::setMovementPointer(const MouseEvent& rMEvt) DlgEdFuncInsert::DlgEdFuncInsert( OReportSection* _pParent ) : DlgEdFunc( _pParent ) { - m_rView.SetCreateMode( TRUE ); + m_rView.SetCreateMode( sal_True ); } //---------------------------------------------------------------------------- DlgEdFuncInsert::~DlgEdFuncInsert() { - m_rView.SetEditMode( TRUE ); + m_rView.SetEditMode( sal_True ); } //---------------------------------------------------------------------------- -BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseButtonDown(rMEvt) ) - return TRUE; + return sal_True; SdrViewEvent aVEvt; sal_Int16 nId = m_rView.GetCurrentObjIdentifier(); const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); -// eHit == SDRHIT_UNMARKEDOBJECT under the mouse cursor is a unmarked object - if (eHit == SDRHIT_UNMARKEDOBJECT && nId != OBJ_CUSTOMSHAPE) { // there is an object under the mouse cursor, but not a customshape - // rtl::OUString suWasN = m_rView.getInsertObjString(); - // rtl::OUString suWasN2 = m_pParent->getSectionWindow()->getViewsWindow()->GetInsertObjString(); - m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); - return FALSE; + return sal_False; } if( eHit != SDRHIT_UNMARKEDOBJECT || nId == OBJ_CUSTOMSHAPE) @@ -731,19 +710,19 @@ BOOL DlgEdFuncInsert::MouseButtonDown( const MouseEvent& rMEvt ) m_pParent->getSectionWindow()->getViewsWindow()->BegMarkObj( m_aMDPos,&m_rView ); } - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseButtonUp( rMEvt ) ) - return TRUE; + return sal_True; const Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); - const USHORT nHitLog = USHORT ( m_pParent->PixelToLogic(Size(3,0)).Width() ); + const sal_uInt16 nHitLog = sal_uInt16 ( m_pParent->PixelToLogic(Size(3,0)).Width() ); - BOOL bReturn = TRUE; + sal_Bool bReturn = sal_True; // object creation active? if ( m_rView.IsCreateObj() ) { @@ -751,8 +730,8 @@ BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) { m_pParent->getSectionWindow()->getViewsWindow()->BrkAction(); // BrkAction disables the create mode - m_rView.SetCreateMode( TRUE ); - return TRUE; + m_rView.SetCreateMode( sal_True ); + return sal_True; } m_rView.EndCreateObj(SDRCREATE_FORCEEND); @@ -770,7 +749,6 @@ BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i ) { SdrMark* pMark = rMarkList.GetMark(i); - // bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL; OOle2Obj* pObj = dynamic_cast<OOle2Obj*>(pMark->GetMarkedSdrObj()); if ( pObj && !pObj->IsEmpty() ) { @@ -791,7 +769,7 @@ BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) SdrViewEvent aVEvt; m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); m_rView.MarkObj(aVEvt.pRootObj, pPV); - } // ift() && !rMEvt.IsMod2() ) + } checkTwoCklicks(rMEvt); m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView); return bReturn; @@ -799,10 +777,10 @@ BOOL DlgEdFuncInsert::MouseButtonUp( const MouseEvent& rMEvt ) //---------------------------------------------------------------------------- -BOOL DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseMove(rMEvt ) ) - return TRUE; + return sal_True; Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); if ( m_rView.IsCreateObj() ) @@ -827,13 +805,10 @@ BOOL DlgEdFuncInsert::MouseMove( const MouseEvent& rMEvt ) m_pParent->getSectionWindow()->getViewsWindow()->MovAction(aPos,&m_rView, m_rView.GetDragMethod() == NULL, false); } - //if ( isOver(m_rView.GetCreateObj(),*m_pParent->getPage(),*m_pView) ) - // m_pParent->SetPointer( Pointer(POINTER_NOTALLOWED)); - //else if ( !bIsSetPoint ) m_pParent->SetPointer( m_rView.GetPreferedPointer( aPos, m_pParent) ); - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- @@ -851,11 +826,11 @@ DlgEdFuncSelect::~DlgEdFuncSelect() //---------------------------------------------------------------------------- -BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) { m_bSelectionMode = false; if ( DlgEdFunc::MouseButtonDown(rMEvt) ) - return TRUE; + return sal_True; SdrViewEvent aVEvt; const SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); @@ -880,7 +855,6 @@ BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) { if( !rMEvt.IsShift() ) m_pParent->getSectionWindow()->getViewsWindow()->unmarkAllObjects(NULL); - //m_rView.UnmarkAll(); if ( rMEvt.GetClicks() == 1 ) { @@ -893,15 +867,15 @@ BOOL DlgEdFuncSelect::MouseButtonDown( const MouseEvent& rMEvt ) } } - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -BOOL DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseButtonUp( rMEvt ) ) - return TRUE; + return sal_True; // get view from parent const Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); @@ -917,15 +891,15 @@ BOOL DlgEdFuncSelect::MouseButtonUp( const MouseEvent& rMEvt ) if ( !m_bUiActive ) m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView); m_bSelectionMode = false; - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) +sal_Bool DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) { if ( DlgEdFunc::MouseMove(rMEvt ) ) - return TRUE; + return sal_True; Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); bool bIsSetPoint = false; @@ -948,15 +922,6 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) { aPnt.Y() = 0; } - // grow section if it is under the current section -// else -// { -// const Size& aSectionSize = m_rView->GetSizePixel(); -// if ( aPnt.Y() > aSectionSize.Height() ) -// { -// aPnt.Y() = aSectionSize.Height(); -// } -// } } // drag or resize an object bool bControlKey = rMEvt.IsMod1(); @@ -972,149 +937,8 @@ BOOL DlgEdFuncSelect::MouseMove( const MouseEvent& rMEvt ) unColorizeOverlappedObj(); } - return TRUE; + return sal_True; } -// ----------------------------------------------------------------------------- -//void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag) -//{ -// -// SdrPageView* pPV = m_rView.GetSdrPageView(); -// if( _pTextObj && _pTextObj->GetPage() == pPV->GetPage() ) -// { -// m_rView.SetCurrentObj(OBJ_TEXT); -// m_rView.SetEditMode(SDREDITMODE_EDIT); -// -// BOOL bEmptyOutliner = FALSE; -// -// if (!_pTextObj->GetOutlinerParaObject() && m_rView.GetTextEditOutliner()) -// { -// ::SdrOutliner* pOutl = m_rView.GetTextEditOutliner(); -// ULONG nParaAnz = pOutl->GetParagraphCount(); -// Paragraph* p1stPara = pOutl->GetParagraph( 0 ); -// -// if (nParaAnz==1 && p1stPara) -// { -// // Bei nur einem Pararaph -// if (pOutl->GetText(p1stPara).Len() == 0) -// { -// bEmptyOutliner = TRUE; -// } -// } -// } -// -// if (_pTextObj != m_rView.GetTextEditObject() || bEmptyOutliner) -// { -// UINT32 nInv = _pTextObj->GetObjInventor(); -// UINT16 nSdrObjKind = _pTextObj->GetObjIdentifier(); -// -// if (nInv == SdrInventor && _pTextObj->HasTextEdit() && -// (nSdrObjKind == OBJ_TEXT || -// nSdrObjKind == OBJ_TITLETEXT || -// nSdrObjKind == OBJ_OUTLINETEXT || -// (_pTextObj->ISA(SdrTextObj) && !_pTextObj->IsEmptyPresObj()))) -// { -// // Neuen Outliner machen (gehoert der SdrObjEditView) -// SdrModel* pModel = _pTextObj->GetModel(); -// SdrOutliner* pOutl = SdrMakeOutliner( OUTLINERMODE_OUTLINEOBJECT, pModel ); -// pOutl->SetMinDepth(0); -// pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pModel->GetStyleSheetPool()); -// //pOutl->SetCalcFieldValueHdl(LINK(SD_MOD(), SdModule, CalcFieldValueHdl)); -// ULONG nCntrl = pOutl->GetControlWord(); -// nCntrl |= EE_CNTRL_ALLOWBIGOBJS; -// nCntrl |= EE_CNTRL_URLSFXEXECUTE; -// nCntrl |= EE_CNTRL_MARKFIELDS; -// nCntrl |= EE_CNTRL_AUTOCORRECT; -// -// nCntrl &= ~EE_CNTRL_ULSPACESUMMATION; -// //if ( pModel->IsSummationOfParagraphs() ) -// // nCntrl |= EE_CNTRL_ULSPACESUMMATION; -// -// //SetSpellOptions( nCntrl ); -// -// pOutl->SetControlWord(nCntrl); -// -// uno::Reference< linguistic2::XSpellChecker1 > xSpellChecker( LinguMgr::GetSpellChecker() ); -// if ( xSpellChecker.is() ) -// pOutl->SetSpeller( xSpellChecker ); -// -// uno::Reference< linguistic2::XHyphenator > xHyphenator( LinguMgr::GetHyphenator() ); -// if( xHyphenator.is() ) -// pOutl->SetHyphenator( xHyphenator ); -// -// pOutl->SetDefaultLanguage( Application::GetSettings().GetLanguage() ); -// -// // in einem Gliederungstext darf nicht auf die 0-te -// // Ebene ausgerueckt werden -// if (_pTextObj->GetObjInventor() == SdrInventor && -// _pTextObj->GetObjIdentifier() == OBJ_OUTLINETEXT) -// { -// pOutl->SetMinDepth(1); -// } -// -// if (bEmptyOutliner) -// { -// m_rView.SdrEndTextEdit(sal_True); -// } -// -// if( _pTextObj ) -// { -// OutlinerParaObject* pOPO = _pTextObj->GetOutlinerParaObject(); -// if( ( pOPO && pOPO->IsVertical() ) /*|| -// nSlotId == SID_ATTR_CHAR_VERTICAL || -// nSlotId == SID_TEXT_FITTOSIZE_VERTICAL */) -// pOutl->SetVertical( TRUE ); -// -// -// if (m_rView.SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor) -// { -// //bFirstObjCreated = TRUE; -// //DeleteDefaultText(); -// -// OutlinerView* pOLV = m_rView.GetTextEditOutlinerView(); -// -// nSdrObjKind = _pTextObj->GetObjIdentifier(); -// -// SdrViewEvent aVEvt; -// SdrHitKind eHit = m_rView.PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); -// -// if (eHit == SDRHIT_TEXTEDIT) -// { -// // Text getroffen -// if (nSdrObjKind == OBJ_TEXT || -// nSdrObjKind == OBJ_TITLETEXT || -// nSdrObjKind == OBJ_OUTLINETEXT || -// //nSlotId == SID_TEXTEDIT || -// !bQuickDrag) -// { -// pOLV->MouseButtonDown(rMEvt); -// pOLV->MouseMove(rMEvt); -// pOLV->MouseButtonUp(rMEvt); -// } -// -// if ( bQuickDrag && _pTextObj->GetOutlinerParaObject()) -// { -// pOLV->MouseButtonDown(rMEvt); -// } -// } -// else -// { -// // #98198# Move cursor to end of text -// ESelection aNewSelection(EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND, EE_PARA_NOT_FOUND, EE_INDEX_NOT_FOUND); -// pOLV->SetSelection(aNewSelection); -// } -// } -// else -// { -// //RestoreDefaultText(); -// } -// } -// } -// } -// } -// else -// _pTextObj = NULL; -//} - //---------------------------------------------------------------------------- } diff --git a/reportdesign/source/ui/report/makefile.mk b/reportdesign/source/ui/report/makefile.mk index 3c19923f4c19..0383a98be4a8 100644 --- a/reportdesign/source/ui/report/makefile.mk +++ b/reportdesign/source/ui/report/makefile.mk @@ -36,7 +36,6 @@ VISIBILITY_HIDDEN=TRUE # --- Settings ----------------------------------------------------- .INCLUDE : settings.mk -# .INCLUDE : $(PRJ)$/util$/dll.pmk IMGLST_SRS=$(SRS)$/$(TARGET).srs # --- Files -------------------------------------------------------- diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index ac36078ff3cf..1d5564cace0d 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -121,12 +121,12 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen if (m_xMeAsFrame.is()) { m_xMeAsFrame->initialize( VCLUnoHelper::GetInterface ( this ) ); - m_xMeAsFrame->setName(::rtl::OUString::createFromAscii("report property browser")); // change name! + m_xMeAsFrame->setName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("report property browser"))); // change name! } } catch (Exception&) { - DBG_ERROR("PropBrw::PropBrw: could not create/initialize my frame!"); + OSL_FAIL("PropBrw::PropBrw: could not create/initialize my frame!"); m_xMeAsFrame.clear(); } @@ -141,9 +141,6 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen xFactoryProperties->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ), UNO_QUERY_THROW ); - /*uno::Reference< XComponent> xModel = new OContextHelper(m_xORB,uno::Reference< XComponent>(m_pDesignView->getController().getModel(),uno::UNO_QUERY) ); - uno::Reference< XComponent> xDialogParentWindow = new OContextHelper(m_xORB,uno::Reference< XComponent>(VCLUnoHelper::GetInterface ( this ),uno::UNO_QUERY) ); - uno::Reference< XComponent> xConnection = new OContextHelper(m_xORB,uno::Reference< XComponent>(m_pDesignView->getController().getConnection(),uno::UNO_QUERY) );*/ // a ComponentContext for the ::cppu::ContextEntry_Init aHandlerContextInfo[] = { @@ -182,7 +179,7 @@ PropBrw::PropBrw(const Reference< XMultiServiceFactory >& _xORB,Window* pParen } catch (Exception&) { - DBG_ERROR("PropBrw::PropBrw: could not create/initialize the browser controller!"); + OSL_FAIL("PropBrw::PropBrw: could not create/initialize the browser controller!"); try { ::comphelper::disposeComponent(m_xBrowserController); @@ -272,7 +269,7 @@ void PropBrw::implDetachController() } catch( const Exception& ) { - OSL_ENSURE( sal_False, "PropBrw::getCurrentPage: caught an exception while retrieving the current page!" ); + OSL_FAIL( "PropBrw::getCurrentPage: caught an exception while retrieving the current page!" ); } return sCurrentPage; } @@ -292,7 +289,7 @@ sal_Bool PropBrw::Close() } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FmPropBrw::Close: caught an exception while asking the controller!" ); + OSL_FAIL( "FmPropBrw::Close: caught an exception while asking the controller!" ); } } implDetachController(); @@ -302,7 +299,7 @@ sal_Bool PropBrw::Close() m_pDesignView->getController().executeUnChecked(SID_PROPERTYBROWSER_LAST_PAGE,uno::Sequence< beans::PropertyValue>()); - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- @@ -349,10 +346,8 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FmPropBrw::StateChanged: caught an exception while setting the initial page!" ); + OSL_FAIL( "FmPropBrw::StateChanged: caught an exception while setting the initial page!" ); } - - //Resize(); } SetText( GetHeadlineName(_aObjects) ); } @@ -368,13 +363,13 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> } else if ( _aObjects.getLength() == 1 ) // single selection { - sal_uInt16 nResId = 0; aName = String(ModuleRes(RID_STR_BRWTITLE_PROPERTIES)); uno::Reference< container::XNameContainer > xNameCont(_aObjects[0],uno::UNO_QUERY); Reference< lang::XServiceInfo > xServiceInfo( xNameCont->getByName(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ReportComponent"))), UNO_QUERY ); if ( xServiceInfo.is() ) { + sal_uInt16 nResId = 0; if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT ) ) { nResId = RID_STR_PROPTITLE_FIXEDTEXT; @@ -413,7 +408,7 @@ void PropBrw::implSetNewObject( const uno::Sequence< Reference<uno::XInterface> } else { - OSL_ENSURE(0,"Unknown service name!"); + OSL_FAIL("Unknown service name!"); nResId = RID_STR_CLASS_FORMATTEDFIELD; } @@ -524,7 +519,7 @@ void PropBrw::Update( OSectionView* pNewView ) } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FmPropBrw::StateChanged: caught an exception while setting the initial page!" ); + OSL_FAIL( "FmPropBrw::StateChanged: caught an exception while setting the initial page!" ); } } } @@ -536,8 +531,8 @@ void PropBrw::Update( OSectionView* pNewView ) uno::Sequence< Reference<uno::XInterface> > aMarkedObjects; OViewsWindow* pViews = m_pView->getReportSection()->getSectionWindow()->getViewsWindow(); - const USHORT nSectionCount = pViews->getSectionCount(); - for (USHORT i = 0; i < nSectionCount; ++i) + const sal_uInt16 nSectionCount = pViews->getSectionCount(); + for (sal_uInt16 i = 0; i < nSectionCount; ++i) { ::boost::shared_ptr<OSectionWindow> pSectionWindow = pViews->getSectionWindow(i); if ( pSectionWindow ) @@ -567,7 +562,7 @@ void PropBrw::Update( OSectionView* pNewView ) } catch ( Exception& ) { - DBG_ERROR( "PropBrw::Update: Exception occured!" ); + OSL_FAIL( "PropBrw::Update: Exception occurred!" ); } } //---------------------------------------------------------------------------- @@ -582,14 +577,14 @@ void PropBrw::Update( const uno::Reference< uno::XInterface>& _xReportComponent) { EndListening( *(m_pView->GetModel()) ); m_pView = NULL; - } // if ( m_pView ) + } uno::Reference< uno::XInterface> xTemp(CreateComponentPair(_xReportComponent,_xReportComponent)); implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> >(&xTemp,1) ); } catch ( Exception& ) { - DBG_ERROR( "PropBrw::Update: Exception occured!" ); + OSL_FAIL( "PropBrw::Update: Exception occurred!" ); } } } diff --git a/reportdesign/source/ui/report/report.src b/reportdesign/source/ui/report/report.src index 4a84f7bd034d..c4c64b83d1c6 100644 --- a/reportdesign/source/ui/report/report.src +++ b/reportdesign/source/ui/report/report.src @@ -32,7 +32,7 @@ #ifndef _SBASLTID_HRC #include <svx/svxids.hrc> #endif - +#include "helpids.hrc" // Dialog Controls --------------------------------------------------------------- @@ -112,25 +112,13 @@ String RID_STR_PROPTITLE_GROUP Image RID_IMG_TREENODE_COLLAPSED { - ImageBitmap = Bitmap { File = "plus.bmp"; } ; + ImageBitmap = Bitmap { File = "plus.png"; } ; MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }; }; Image RID_IMG_TREENODE_EXPANDED { - ImageBitmap = Bitmap { File = "minus.bmp"; } ; - MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }; -}; - -Image RID_IMG_TREENODE_COLLAPSED_HC -{ - ImageBitmap = Bitmap { File = "plus_sch.bmp"; } ; - MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }; -}; - -Image RID_IMG_TREENODE_EXPANDED_HC -{ - ImageBitmap = Bitmap { File = "minus_sch.bmp"; } ; + ImageBitmap = Bitmap { File = "minus.png"; } ; MaskColor = Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }; }; @@ -298,7 +286,6 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_SORTINGANDGROUPING; - HelpId = SID_SORTINGANDGROUPING ; Command = ".uno:DbSortingAndGrouping"; Text [ en-US ] = "Sorting and Grouping..."; }; @@ -309,14 +296,12 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_ATTR_CHAR_COLOR_BACKGROUND; - HelpId = SID_ATTR_CHAR_COLOR_BACKGROUND ; Command = ".uno:DBBackgroundColor"; Text [ en-US ] = "Background Color..."; }; MenuItem { Identifier = SID_RULER; - HelpId = SID_RULER ; Command = ".uno:ShowRuler"; Checkable = TRUE; Text [ en-US ] = "Ruler..."; @@ -324,7 +309,6 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_GRID_VISIBLE; - HelpId = SID_GRID_VISIBLE ; Command = ".uno:GridVisible"; Checkable = TRUE; Text [ en-US ] = "Grid..."; @@ -336,14 +320,12 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_PAGEHEADERFOOTER; - HelpId = SID_PAGEHEADERFOOTER ; Command = ".uno:PageHeaderFooter"; Checkable = TRUE; }; MenuItem { Identifier = SID_REPORTHEADERFOOTER; - HelpId = SID_REPORTHEADERFOOTER ; Command = ".uno:ReportHeaderFooter"; Checkable = TRUE; }; @@ -354,7 +336,6 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_ARRANGEMENU ; - HelpID = SID_ARRANGEMENU ; Command = ".uno:ArrangeMenu" ; Text [ en-US ] = "~Arrange" ; SubMenu = Menu @@ -368,13 +349,13 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_FRAME_UP ; - HelpID = SID_FRAME_UP ; + HelpId = ".uno:ObjectForwardOne"; Text [ en-US ] = "Bring ~Forward" ; }; MenuItem { Identifier = SID_FRAME_DOWN ; - HelpID = SID_FRAME_DOWN ; + HelpId = ".uno:ObjectBackOne"; Text [ en-US ] = "Send Back~ward" ; }; MenuItem @@ -443,7 +424,6 @@ Menu RID_MENU_REPORT { Identifier = SID_OBJECT_RESIZING ; Command = ".uno:ObjectResize" ; - HelpID = SID_OBJECT_RESIZING ; Text [ en-US ] = "~Object Resizing" ; Text [ x-comment ] = " "; SubMenu = Menu @@ -454,7 +434,6 @@ Menu RID_MENU_REPORT { Identifier = SID_OBJECT_SMALLESTWIDTH ; Command = ".uno:SmallestWidth" ; - HelpID = SID_OBJECT_SMALLESTWIDTH ; Text [ en-US ] = "~Fit to smallest width" ; Text [ x-comment ] = " "; }; @@ -462,7 +441,6 @@ Menu RID_MENU_REPORT { Identifier = SID_OBJECT_GREATESTWIDTH ; Command = ".uno:GreatestWidth" ; - HelpID = SID_OBJECT_GREATESTWIDTH ; Text [ en-US ] = "~Fit to greatest width" ; Text [ x-comment ] = " "; }; @@ -474,7 +452,6 @@ Menu RID_MENU_REPORT { Identifier = SID_OBJECT_SMALLESTHEIGHT ; Command = ".uno:SmallestHeight" ; - HelpID = SID_OBJECT_SMALLESTHEIGHT ; Text [ en-US ] = "~Fit to smallest height" ; Text [ x-comment ] = " "; }; @@ -482,7 +459,6 @@ Menu RID_MENU_REPORT { Identifier = SID_OBJECT_GREATESTHEIGHT ; Command = ".uno:GreatestHeight" ; - HelpID = SID_OBJECT_GREATESTHEIGHT ; Text [ en-US ] = "~Fit to greatest height" ; Text [ x-comment ] = " "; }; @@ -498,7 +474,6 @@ Menu RID_MENU_REPORT { Identifier = SID_SECTION_SHRINK_MENU ; Command = ".uno:SectionShrinkMenu" ; - HelpID = SID_SECTION_SHRINK_MENU ; Text [ en-US ] = "Section" ; Text [ x-comment ] = " "; SubMenu = Menu @@ -509,7 +484,6 @@ Menu RID_MENU_REPORT { Identifier = SID_SECTION_SHRINK ; Command = ".uno:SectionShrink" ; - HelpID = SID_SECTION_SHRINK ; Text [ en-US ] = "Shrink" ; Text [ x-comment ] = " "; }; @@ -517,7 +491,6 @@ Menu RID_MENU_REPORT { Identifier = SID_SECTION_SHRINK_TOP ; Command = ".uno:SectionShrinkTop" ; - HelpID = SID_SECTION_SHRINK_TOP ; Text [ en-US ] = "Shrink from top" ; Text [ x-comment ] = " "; }; @@ -525,7 +498,6 @@ Menu RID_MENU_REPORT { Identifier = SID_SECTION_SHRINK_BOTTOM ; Command = ".uno:SectionShrinkBottom" ; - HelpID = SID_SECTION_SHRINK_BOTTOM ; Text [ en-US ] = "Shrink from bottom" ; Text [ x-comment ] = " "; }; @@ -539,7 +511,6 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_DISTRIBUTION; - HelpId = SID_DISTRIBUTION ; Command = ".uno:Distribution"; Text [ en-US ] = "Distribution..." ; }; @@ -550,7 +521,6 @@ Menu RID_MENU_REPORT MenuItem { Identifier = SID_SHOW_PROPERTYBROWSER; - HelpId = SID_SHOW_PROPERTYBROWSER ; Command = ".uno:FormProperties"; Text [ en-US ] = "Properties..."; }; diff --git a/reportdesign/util/hidother.src b/reportdesign/util/hidother.src index f7e08f34442e..3c52ed77c852 100644 --- a/reportdesign/util/hidother.src +++ b/reportdesign/util/hidother.src @@ -26,11 +26,6 @@ ************************************************************************/ #include "../inc/helpids.hrc" -#include "../inc/rptui_slotid.hrc" - -#ifndef _SBASLTID_HRC -#include <svx/svxids.hrc> -#endif hidspecial UID_RPT_RPT_APP_VIEW { HelpId = UID_RPT_RPT_APP_VIEW ; }; hidspecial UID_RPT_SCROLLWINDOW { HelpId = UID_RPT_SCROLLWINDOW ; }; @@ -45,6 +40,7 @@ hidspecial HID_RPT_HORZ_SCROLLBAR { HelpId = HID_R hidspecial HID_RPT_VERT_SCROLLBAR { HelpId = HID_RPT_VERT_SCROLLBAR ; }; hidspecial HID_RPT_STARTMARKER { HelpId = HID_RPT_STARTMARKER ; }; +/* hidspecial SID_RPT_SHOWREPORTEXPLORER { HelpId = SID_RPT_SHOWREPORTEXPLORER ; }; hidspecial SID_PAGEHEADERFOOTER { HelpId = SID_PAGEHEADERFOOTER ; }; hidspecial SID_REPORTHEADERFOOTER { HelpId = SID_REPORTHEADERFOOTER ; }; @@ -54,6 +50,9 @@ hidspecial SID_CONDITIONALFORMATTING { HelpId = SID_CONDI hidspecial SID_PAGEDIALOG { HelpId = SID_PAGEDIALOG ; }; hidspecial SID_SETCONTROLDEFAULTS { HelpId = SID_SETCONTROLDEFAULTS ; }; hidspecial SID_INSERTBREAK { HelpId = SID_INSERTBREAK ; }; +hidspecial SID_ESCAPE { HelpId = SID_ESCAPE ; }; +*/ + hidspecial HID_RPT_FIELDEXPRESSION { HelpId = HID_RPT_FIELDEXPRESSION ; }; hidspecial HID_RPT_SORTORDER { HelpId = HID_RPT_SORTORDER ; }; hidspecial HID_RPT_GROUPSBRW { HelpId = HID_RPT_GROUPSBRW ; }; @@ -65,7 +64,6 @@ hidspecial HID_RPT_CRTL_FORMAT_PREVIEW { HelpId = HID_R hidspecial HID_RPT_COND_DLG { HelpId = HID_RPT_COND_DLG ; }; hidspecial HID_RPT_POPUP_COLOR_CTRL { HelpId = HID_RPT_POPUP_COLOR_CTRL ; }; hidspecial HID_RPT_POPUP_COLOR { HelpId = HID_RPT_POPUP_COLOR ; }; -hidspecial SID_ESCAPE { HelpId = SID_ESCAPE ; }; hidspecial HID_RPT_PROPDLG_TAB_GENERAL { HelpId = HID_RPT_PROPDLG_TAB_GENERAL ; }; hidspecial HID_RPT_PROPDLG_TAB_DATA { HelpId = HID_RPT_PROPDLG_TAB_DATA ; }; @@ -93,15 +91,18 @@ hidspecial HID_RPT_PROP_RPT_WIDTH { HelpId = HID_RPT_PROP_RPT_WIDTH; }; hidspecial HID_RPT_PROP_RPT_HEIGHT { HelpId = HID_RPT_PROP_RPT_HEIGHT; }; hidspecial HID_RPT_START_TITLE { HelpId = HID_RPT_START_TITLE; }; hidspecial HID_RPT_START_IMAGE { HelpId = HID_RPT_START_IMAGE; }; -hidspecial SID_EXECUTE_REPORT { HelpId = SID_EXECUTE_REPORT; }; +/* +hidspecial SID_EXECUTE_REPORT { HelpId = SID_EXECUTE_REPORT; }; hidspecial SID_RPT_TEXTDOCUMENT { HelpId = SID_RPT_TEXTDOCUMENT; }; hidspecial SID_RPT_SPREADSHEET { HelpId = SID_RPT_SPREADSHEET; }; +hidspecial SID_RPT_NEW_FUNCTION { HelpId = SID_RPT_NEW_FUNCTION; }; +*/ + hidspecial HID_RPT_PROP_DEEPTRAVERSING { HelpId = HID_RPT_PROP_DEEPTRAVERSING; }; hidspecial HID_RPT_PROP_PREEVALUATED { HelpId = HID_RPT_PROP_PREEVALUATED; }; hidspecial HID_RPT_NAVIGATOR_DLG { HelpId = HID_RPT_NAVIGATOR_DLG; }; hidspecial HID_REPORT_NAVIGATOR_TREE { HelpId = HID_REPORT_NAVIGATOR_TREE; }; -hidspecial SID_RPT_NEW_FUNCTION { HelpId = SID_RPT_NEW_FUNCTION; }; hidspecial HID_RPT_PROP_FORMULA { HelpId = HID_RPT_PROP_FORMULA; }; hidspecial HID_RPT_PROP_INITIALFORMULA { HelpId = HID_RPT_PROP_INITIALFORMULA; };x hidspecial HID_RPT_PROP_DATAFIELD { HelpId = HID_RPT_PROP_DATAFIELD; }; @@ -110,14 +111,17 @@ hidspecial UID_RPT_RPT_PROP_DLG_FONT_TYPE { HelpId = UID_RPT_RPT_PROP_DLG_FONT_T hidspecial HID_RPT_PROP_BACKCOLOR { HelpId = HID_RPT_PROP_BACKCOLOR; }; hidspecial HID_RPT_PROP_PRESERVEIRI { HelpId = HID_RPT_PROP_PRESERVEIRI; }; +/* hidspecial SID_OBJECT_SMALLESTWIDTH { HelpId = SID_OBJECT_SMALLESTWIDTH; }; hidspecial SID_OBJECT_SMALLESTHEIGHT { HelpId = SID_OBJECT_SMALLESTHEIGHT; }; hidspecial SID_OBJECT_GREATESTWIDTH { HelpId = SID_OBJECT_GREATESTWIDTH; }; hidspecial SID_OBJECT_GREATESTHEIGHT { HelpId = SID_OBJECT_GREATESTHEIGHT; }; +*/ hidspecial HID_RPT_PROP_BACKTRANSPARENT { HelpId = HID_RPT_PROP_BACKTRANSPARENT; }; hidspecial HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT { HelpId = HID_RPT_PROP_CONTROLBACKGROUNDTRANSPARENT; }; +/* hidspecial SID_ARRANGEMENU { HelpId = SID_ARRANGEMENU; }; hidspecial SID_SELECTALL_IN_SECTION { HelpId = SID_SELECTALL_IN_SECTION; }; hidspecial SID_SECTION_ALIGN { HelpId = SID_SECTION_ALIGN; }; @@ -129,10 +133,10 @@ hidspecial SID_SECTION_ALIGN_MIDDLE { HelpId = SID_SECTION_ALIGN_MIDDLE; }; hidspecial SID_SECTION_ALIGN_DOWN { HelpId = SID_SECTION_ALIGN_DOWN; }; hidspecial SID_NEXT_MARK { HelpId = SID_NEXT_MARK; }; hidspecial SID_PREV_MARK { HelpId = SID_PREV_MARK; }; - hidspecial SID_SECTION_SHRINK { HelpId = SID_SECTION_SHRINK; }; hidspecial SID_SECTION_SHRINK_TOP { HelpId = SID_SECTION_SHRINK_TOP; }; hidspecial SID_SECTION_SHRINK_BOTTOM { HelpId = SID_SECTION_SHRINK_BOTTOM; }; +*/ hidspecial UID_RPT_PROP_CHARTTYPE_DLG { HelpId = UID_RPT_PROP_CHARTTYPE_DLG; }; hidspecial HID_RPT_PROP_CHARTTYPE { HelpId = HID_RPT_PROP_CHARTTYPE; }; diff --git a/reportdesign/util/makefile.mk b/reportdesign/util/makefile.mk index fd6a31699268..dc58db3f61a0 100644 --- a/reportdesign/util/makefile.mk +++ b/reportdesign/util/makefile.mk @@ -230,3 +230,23 @@ DEF3NAME=$(SHL3TARGET) .INCLUDE : target.mk + +ALLTAR : $(MISC)/rpt.component $(MISC)/rptui.component $(MISC)/rptxml.component + +$(MISC)/rpt.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + rpt.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt rpt.component + +$(MISC)/rptui.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + rptui.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL2TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt rptui.component + +$(MISC)/rptxml.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt \ + rptxml.component + $(XSLTPROC) --nonet --stringparam uri \ + '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL3TARGETN:f)' -o $@ \ + $(SOLARENV)/bin/createcomponent.xslt rptxml.component diff --git a/reportdesign/util/rpt.component b/reportdesign/util/rpt.component new file mode 100644 index 000000000000..ef5b2cc4c78d --- /dev/null +++ b/reportdesign/util/rpt.component @@ -0,0 +1,58 @@ +<?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.report.OFixedLine"> + <service name="com.sun.star.report.FixedLine"/> + </implementation> + <implementation name="com.sun.star.comp.report.OFixedText"> + <service name="com.sun.star.report.FixedText"/> + </implementation> + <implementation name="com.sun.star.comp.report.OFormatCondition"> + <service name="com.sun.star.report.FormatCondition"/> + </implementation> + <implementation name="com.sun.star.comp.report.OFormattedField"> + <service name="com.sun.star.report.FormattedField"/> + </implementation> + <implementation name="com.sun.star.comp.report.OFunction"> + <service name="com.sun.star.report.Function"/> + </implementation> + <implementation name="com.sun.star.comp.report.OImageControl"> + <service name="com.sun.star.report.ImageControl"/> + </implementation> + <implementation name="com.sun.star.comp.report.OReportDefinition"> + <service name="com.sun.star.report.ReportDefinition"/> + </implementation> + <implementation name="com.sun.star.comp.report.OReportEngineJFree"> + <service name="com.sun.star.report.ReportEngine"/> + </implementation> + <implementation name="com.sun.star.comp.report.Shape"> + <service name="com.sun.star.report.Shape"/> + </implementation> +</component> diff --git a/reportdesign/util/rptui.component b/reportdesign/util/rptui.component new file mode 100644 index 000000000000..593f06d0b582 --- /dev/null +++ b/reportdesign/util/rptui.component @@ -0,0 +1,52 @@ +<?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.report.DataProviderHandler"> + <service name="com.sun.star.report.inspection.DataProviderHandler"/> + </implementation> + <implementation name="com.sun.star.comp.report.DefaultComponentInspectorModel"> + <service name="com.sun.star.report.inspection.DefaultComponentInspectorModel"/> + </implementation> + <implementation name="com.sun.star.comp.report.GeometryHandler"> + <service name="com.sun.star.report.inspection.GeometryHandler"/> + </implementation> + <implementation name="com.sun.star.comp.report.ReportComponentHandler"> + <service name="com.sun.star.report.inspection.ReportComponentHandler"/> + </implementation> + <implementation name="com.sun.star.report.comp.ReportDesign"> + <service name="com.sun.star.sdb.ReportDesign"/> + </implementation> + <implementation name="com.sun.star.report.comp.ReportToolboxController"> + <service name="com.sun.star.report.ReportToolboxController"/> + </implementation> + <implementation name="com.sun.star.report.comp.StatusbarController"> + <service name="com.sun.star.frame.StatusbarController"/> + </implementation> +</component> diff --git a/reportdesign/util/rptxml.component b/reportdesign/util/rptxml.component new file mode 100644 index 000000000000..8a0021ecdf9a --- /dev/null +++ b/reportdesign/util/rptxml.component @@ -0,0 +1,73 @@ +<?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.Report.XMLOasisContentImporter"> + <service name="com.sun.star.comp.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Report.XMLOasisMetaImporter"> + <service name="com.sun.star.comp.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Report.XMLOasisSettingsImporter"> + <service name="com.sun.star.comp.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.Report.XMLOasisStylesImporter"> + <service name="com.sun.star.comp.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.ExportDocumentHandler"> + <service name="com.sun.star.report.ExportDocumentHandler"/> + </implementation> + <implementation name="com.sun.star.comp.report.ExportFilter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.ImportDocumentHandler"> + <service name="com.sun.star.report.ImportDocumentHandler"/> + </implementation> + <implementation name="com.sun.star.comp.report.OReportFilter"> + <service name="com.sun.star.comp.document.ImportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.ORptTypeDetection"> + <service name="com.sun.star.document.ExtendedTypeDetection"/> + </implementation> + <implementation name="com.sun.star.comp.report.XMLContentExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.XMLFullExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.XMLMetaExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.XMLSettingsExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> + <implementation name="com.sun.star.comp.report.XMLStylesExporter"> + <service name="com.sun.star.document.ExportFilter"/> + </implementation> +</component> |