From 466bacc3ad07d88c8d947e4f745d9e8f3cdbed89 Mon Sep 17 00:00:00 2001 From: Gregor Hartmann Date: Fri, 27 Aug 2010 14:05:36 +0200 Subject: testtool: fix libsts to work with old testtool --- basic/inc/basic/ttstrhlp.hxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/ttstrhlp.hxx b/basic/inc/basic/ttstrhlp.hxx index 1827d013c492..06f4939d61c0 100644 --- a/basic/inc/basic/ttstrhlp.hxx +++ b/basic/inc/basic/ttstrhlp.hxx @@ -31,6 +31,8 @@ #define CByteString( constAsciiStr ) ByteString( RTL_CONSTASCII_STRINGPARAM ( constAsciiStr ) ) #define CUniString( constAsciiStr ) UniString( RTL_CONSTASCII_USTRINGPARAM ( constAsciiStr ) ) +#define Str2Id( Str ) rtl::OUStringToOString( Str, RTL_TEXTENCODING_ASCII_US ) +#define Id2Str( Id ) String( rtl::OStringToOUString( Id, RTL_TEXTENCODING_ASCII_US ) ) #define StartKenn CUniString("%") #define EndKenn CUniString("%") @@ -42,7 +44,7 @@ #define TabKenn ( StartKenn.AppendAscii("Tab") ) #define MakeStringParam(Type,aText) ( Type.AppendAscii("=").Append( aText ).Append( EndKenn ) ) #define MakeStringNumber(Type,nNumber) MakeStringParam (Type, UniString::CreateFromInt32(nNumber)) -#define UIdString(aID) MakeStringParam(UIdKenn,aID.GetText()) +#define UIdString(aID) MakeStringParam(UIdKenn,String(rtl::OStringToOUString( aID, RTL_TEXTENCODING_ASCII_US ))) #define MethodString(nNumber) MakeStringNumber(MethodKenn,nNumber) #define TypeString(nNumber) MakeStringNumber(TypeKenn,nNumber) #define SlotString(nNumber) MakeStringNumber(SlotKenn,nNumber) -- cgit v1.2.3 From f45bb35ad56cae8951b4ec0a79db4274526c741d Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 19 Apr 2010 18:40:22 +0200 Subject: CWS gnumake2: move all delivered headers in basic to folder inc/basic --- basic/inc/basic/modsizeexceeded.hxx | 61 +++++++++++++++++++ basic/inc/basic/svtmsg.hrc | 115 +++++++++++++++++++++++++++++++++++ basic/inc/basic/testtool.hrc | 36 +++++++++++ basic/inc/basic/ttmsg.hrc | 111 +++++++++++++++++++++++++++++++++ basic/inc/modsizeexceeded.hxx | 61 ------------------- basic/inc/svtmsg.hrc | 115 ----------------------------------- basic/inc/testtool.hrc | 36 ----------- basic/inc/ttmsg.hrc | 111 --------------------------------- basic/prj/d.lst | 39 +----------- basic/source/app/svtmsg.src | 2 +- basic/source/app/testtool.src | 2 +- basic/source/app/ttmsg.src | 2 +- basic/source/uno/modsizeexceeded.cxx | 2 +- basic/source/uno/scriptcont.cxx | 2 +- 14 files changed, 331 insertions(+), 364 deletions(-) create mode 100644 basic/inc/basic/modsizeexceeded.hxx create mode 100644 basic/inc/basic/svtmsg.hrc create mode 100644 basic/inc/basic/testtool.hrc create mode 100644 basic/inc/basic/ttmsg.hrc delete mode 100644 basic/inc/modsizeexceeded.hxx delete mode 100644 basic/inc/svtmsg.hrc delete mode 100644 basic/inc/testtool.hrc delete mode 100644 basic/inc/ttmsg.hrc (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/modsizeexceeded.hxx b/basic/inc/basic/modsizeexceeded.hxx new file mode 100644 index 000000000000..e2d716259f09 --- /dev/null +++ b/basic/inc/basic/modsizeexceeded.hxx @@ -0,0 +1,61 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _BASIC_MODSIZEEXCEEDED_HXX +#define _BASIC_MODSIZEEXCEEDED_HXX + +#include +#include + +class ModuleSizeExceeded : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > +{ + // C++ interface + public: + ModuleSizeExceeded( const com::sun::star::uno::Sequence< ::rtl::OUString>& sModules ); + + sal_Bool isAbort() const; + sal_Bool isApprove() const; + + // UNO interface + public: + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException ) { return m_lContinuations; } + com::sun::star::uno::Any SAL_CALL getRequest() throw( com::sun::star::uno::RuntimeException ) + { + return m_aRequest; + } + + // member + private: + rtl::OUString m_sMods; + com::sun::star::uno::Any m_aRequest; + com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > m_lContinuations; + com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > m_xAbort; + com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation> m_xApprove; +}; + +#endif + diff --git a/basic/inc/basic/svtmsg.hrc b/basic/inc/basic/svtmsg.hrc new file mode 100644 index 000000000000..ff215d3fc9cb --- /dev/null +++ b/basic/inc/basic/svtmsg.hrc @@ -0,0 +1,115 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "basic/ttglobal.hrc" + + +// Here are the messages of /basic/source/app included + +/////////////////////////////// +// Error message that go to the Resultfile. +// ********************* +// *** !!ATTENTION!! *** +// ********************* +// Theses numbers MUST NOT change ever! +// Because they are stored in the Resultfiles and if you showed them again +// the appropriate new or no Strings are viewed. +/////////////////////////////// + +#define S_GPF_ABORT ( SVT_START + 0 ) +#define S_APP_SHUTDOWN ( SVT_START + 1 ) +#define S_SID_EXECUTE_FAILED_NO_DISPATCHER ( SVT_START + 2 ) +#define S_SID_EXECUTE_FAILED ( SVT_START + 3 ) +#define S_UNO_PROPERTY_NITIALIZE_FAILED ( SVT_START + 4 ) +#define S_RESETAPPLICATION_FAILED_COMPLEX ( SVT_START + 5 ) +#define S_RESETAPPLICATION_FAILED_UNKNOWN ( SVT_START + 6 ) +#define S_NO_ACTIVE_WINDOW ( SVT_START + 7 ) +#define S_NO_DIALOG_IN_GETACTIVE ( SVT_START + 8 ) +#define S_NO_POPUP ( SVT_START + 9 ) +#define S_NO_SUBMENU ( SVT_START + 10 ) +#define S_CONTROLTYPE_NOT_SUPPORTED ( SVT_START + 11 ) +#define S_SELECTION_BY_ATTRIBUTE_ONLY_DIRECTORIES ( SVT_START + 12 ) +#define S_NO_MORE_FILES ( SVT_START + 13 ) +#define S_UNKNOWN_METHOD ( SVT_START + 14 ) +#define S_INVALID_PARAMETERS ( SVT_START + 15 ) +#define S_POINTER_OUTSIDE_APPWIN ( SVT_START + 16 ) +#define S_UNKNOWN_COMMAND ( SVT_START + 17 ) +#define S_WIN_NOT_FOUND ( SVT_START + 18 ) +#define S_WIN_INVISIBLE ( SVT_START + 19 ) +#define S_WIN_DISABLED ( SVT_START + 20 ) +#define S_NUMBER_TOO_BIG ( SVT_START + 21 ) +#define S_NUMBER_TOO_SMALL ( SVT_START + 22 ) +#define S_WINDOW_DISAPPEARED ( SVT_START + 23 ) +#define S_ERROR_SAVING_IMAGE ( SVT_START + 24 ) +#define S_INVALID_POSITION ( SVT_START + 25 ) +#define S_SPLITWIN_NOT_FOUND ( SVT_START + 26 ) +#define S_INTERNAL_ERROR ( SVT_START + 27 ) +#define S_NO_STATUSBAR ( SVT_START + 28 ) +#define S_ITEMS_INVISIBLE ( SVT_START + 29 ) +#define S_TABPAGE_NOT_FOUND ( SVT_START + 30 ) +#define S_TRISTATE_NOT_ALLOWED ( SVT_START + 31 ) +#define S_ERROR_IN_SET_TEXT ( SVT_START + 32 ) +#define S_ATTEMPT_TO_WRITE_READONLY ( SVT_START + 33 ) +#define S_NO_SELECT_FALSE ( SVT_START + 34 ) +#define S_ENTRY_NOT_FOUND ( SVT_START + 35 ) +#define S_METHOD_FAILED ( SVT_START + 36 ) +#define S_HELPID_ON_TOOLBOX_NOT_FOUND ( SVT_START + 37 ) +#define S_BUTTON_DISABLED_ON_TOOLBOX ( SVT_START + 38 ) +#define S_BUTTON_HIDDEN_ON_TOOLBOX ( SVT_START + 39 ) +#define S_CANNOT_MAKE_BUTTON_VISIBLE_IN_TOOLBOX ( SVT_START + 40 ) +#define S_TEAROFF_FAILED ( SVT_START + 41 ) +#define S_NO_SELECTED_ENTRY_DEPRECATED ( SVT_START + 42 ) // Has to stay in for old res files +#define S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED ( SVT_START + 43 ) +#define S_ALLOWED_ONLY_IN_FLOATING_MODE ( SVT_START + 44 ) +#define S_ALLOWED_ONLY_IN_DOCKING_MODE ( SVT_START + 45 ) +#define S_SIZE_NOT_CHANGEABLE ( SVT_START + 46 ) +#define S_NO_OK_BUTTON ( SVT_START + 47 ) +#define S_NO_CANCEL_BUTTON ( SVT_START + 48 ) +#define S_NO_YES_BUTTON ( SVT_START + 49 ) +#define S_NO_NO_BUTTON ( SVT_START + 50 ) +#define S_NO_RETRY_BUTTON ( SVT_START + 51 ) +#define S_NO_HELP_BUTTON ( SVT_START + 52 ) +#define S_NO_DEFAULT_BUTTON ( SVT_START + 53 ) +#define S_BUTTON_ID_NOT_THERE ( SVT_START + 54 ) +#define S_BUTTONID_REQUIRED ( SVT_START + 55 ) +#define S_UNKNOWN_TYPE ( SVT_START + 56 ) +#define S_UNPACKING_STORAGE_FAILED ( SVT_START + 57 ) +#define S_NO_LIST_BOX_BUTTON ( SVT_START + 58 ) +#define S_UNO_URL_EXECUTE_FAILED_NO_DISPATCHER ( SVT_START + 59 ) +#define S_UNO_URL_EXECUTE_FAILED_NO_FRAME ( SVT_START + 60 ) +#define S_NO_MENU ( SVT_START + 61 ) +#define S_NO_SELECTED_ENTRY ( SVT_START + 62 ) +#define S_UNO_URL_EXECUTE_FAILED_DISABLED ( SVT_START + 63 ) +#define S_NO_SCROLLBAR ( SVT_START + 64 ) +#define S_NO_SAX_PARSER ( SVT_START + 65 ) +#define S_CANNOT_CREATE_DIRECTORY ( SVT_START + 66 ) +#define S_DIRECTORY_NOT_EMPTY ( SVT_START + 67 ) +#define S_DEPRECATED ( SVT_START + 68 ) +#define S_SIZE_BELOW_MINIMUM ( SVT_START + 69 ) +#define S_CANNOT_FIND_FLOATING_WIN ( SVT_START + 70 ) +#define S_NO_LIST_BOX_STRING ( SVT_START + 71 ) +#define S_SLOT_IN_EXECUTE ( SVT_START + 72 ) +#define S_MENU_NOT_CLOSING ( SVT_START + 73 ) diff --git a/basic/inc/basic/testtool.hrc b/basic/inc/basic/testtool.hrc new file mode 100644 index 000000000000..075b462944c9 --- /dev/null +++ b/basic/inc/basic/testtool.hrc @@ -0,0 +1,36 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#define S_INVALID_KEYCODE 257 +#define S_MANDATORY_FILE 258 +#define S_READING_LONGNAMES 259 +#define S_READING_SLOT_IDS 260 +#define S_READING_CONTROLS 261 +#define S_READING_BASIC_MODULE 262 +#define S_STARTING_APPLICATION 263 + + + diff --git a/basic/inc/basic/ttmsg.hrc b/basic/inc/basic/ttmsg.hrc new file mode 100644 index 000000000000..26f250bc6a6a --- /dev/null +++ b/basic/inc/basic/ttmsg.hrc @@ -0,0 +1,111 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "basic/ttglobal.hrc" + + +// Here are the messages of directory /basic/source/testtool included + +/////////////////////////////// +// Error message that go to the Resultfile. +// ********************* +// *** !!ATTENTION!! *** +// ********************* +// Theses numbers MUST NOT change ever! +// Because they are stored in the Resultfiles and if you showed them again +// the appropriate new or no Strings are viewed. +/////////////////////////////// + +#define S_NAME_NOT_THERE ( TT_START + 0 ) +#define S_DOUBLE_NAME ( TT_START + 1 ) +#define S_READING_FILE ( TT_START + 2 ) +#define S_CANNOT_OPEN_FILE ( TT_START + 3 ) +#define S_INVALID_LINE ( TT_START + 4 ) +#define S_SHORTNAME_UNKNOWN ( TT_START + 5 ) +#define S_LONGNAME_UNKNOWN ( TT_START + 6 ) +#define S_FIRST_SHORTNAME_REQ_ASTRX ( TT_START + 7 ) +#define S_TIMOUT_WAITING ( TT_START + 8 ) +#define S_APPLICATION_RESTARTED ( TT_START + 9 ) +#define S_APPLICATION_START_FAILED ( TT_START + 10 ) +#define S_TIMOUT_SENDING ( TT_START + 11 ) +#define S_NO_CONNECTION ( TT_START + 12 ) +#define S_NO_FILES_FOUND ( TT_START + 13 ) // Not used anymore. needed only for old *.res files +#define S_ERRORS_DETECTED ( TT_START + 14 ) +#define S_NO_ERRORS_DETECTED ( TT_START + 15 ) +#define S_WARNINGS_DETECTED ( TT_START + 16 ) +#define S_NO_WARNINGS_DETECTED ( TT_START + 17 ) +#define S_UNKNOWN_SLOT_CONTROL ( TT_START + 18 ) +#define S_RETURN_SEQUENCE_MISSMATCH ( TT_START + 19 ) +#define S_RETURNED_VALUE_ID_MISSMATCH ( TT_START + 20 ) +#define S_RETURNED_VALUE_NO_RECEIVER ( TT_START + 21 ) +#define S_UNKNOWN_METHOD ( TT_START + 22 ) +#define S_INCLUDE_FILE_WARNINGS_DETECTED ( TT_START + 23 ) +#define S_NO_INCLUDE_FILE_WARNINGS_DETECTED ( TT_START + 24 ) + +// Strings + + +/* +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +#define S_ ( TT_START + 0 ) +*/ diff --git a/basic/inc/modsizeexceeded.hxx b/basic/inc/modsizeexceeded.hxx deleted file mode 100644 index e2d716259f09..000000000000 --- a/basic/inc/modsizeexceeded.hxx +++ /dev/null @@ -1,61 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _BASIC_MODSIZEEXCEEDED_HXX -#define _BASIC_MODSIZEEXCEEDED_HXX - -#include -#include - -class ModuleSizeExceeded : public ::cppu::WeakImplHelper1< ::com::sun::star::task::XInteractionRequest > -{ - // C++ interface - public: - ModuleSizeExceeded( const com::sun::star::uno::Sequence< ::rtl::OUString>& sModules ); - - sal_Bool isAbort() const; - sal_Bool isApprove() const; - - // UNO interface - public: - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > SAL_CALL getContinuations() throw( ::com::sun::star::uno::RuntimeException ) { return m_lContinuations; } - com::sun::star::uno::Any SAL_CALL getRequest() throw( com::sun::star::uno::RuntimeException ) - { - return m_aRequest; - } - - // member - private: - rtl::OUString m_sMods; - com::sun::star::uno::Any m_aRequest; - com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > > m_lContinuations; - com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation > m_xAbort; - com::sun::star::uno::Reference< com::sun::star::task::XInteractionContinuation> m_xApprove; -}; - -#endif - diff --git a/basic/inc/svtmsg.hrc b/basic/inc/svtmsg.hrc deleted file mode 100644 index ff215d3fc9cb..000000000000 --- a/basic/inc/svtmsg.hrc +++ /dev/null @@ -1,115 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "basic/ttglobal.hrc" - - -// Here are the messages of /basic/source/app included - -/////////////////////////////// -// Error message that go to the Resultfile. -// ********************* -// *** !!ATTENTION!! *** -// ********************* -// Theses numbers MUST NOT change ever! -// Because they are stored in the Resultfiles and if you showed them again -// the appropriate new or no Strings are viewed. -/////////////////////////////// - -#define S_GPF_ABORT ( SVT_START + 0 ) -#define S_APP_SHUTDOWN ( SVT_START + 1 ) -#define S_SID_EXECUTE_FAILED_NO_DISPATCHER ( SVT_START + 2 ) -#define S_SID_EXECUTE_FAILED ( SVT_START + 3 ) -#define S_UNO_PROPERTY_NITIALIZE_FAILED ( SVT_START + 4 ) -#define S_RESETAPPLICATION_FAILED_COMPLEX ( SVT_START + 5 ) -#define S_RESETAPPLICATION_FAILED_UNKNOWN ( SVT_START + 6 ) -#define S_NO_ACTIVE_WINDOW ( SVT_START + 7 ) -#define S_NO_DIALOG_IN_GETACTIVE ( SVT_START + 8 ) -#define S_NO_POPUP ( SVT_START + 9 ) -#define S_NO_SUBMENU ( SVT_START + 10 ) -#define S_CONTROLTYPE_NOT_SUPPORTED ( SVT_START + 11 ) -#define S_SELECTION_BY_ATTRIBUTE_ONLY_DIRECTORIES ( SVT_START + 12 ) -#define S_NO_MORE_FILES ( SVT_START + 13 ) -#define S_UNKNOWN_METHOD ( SVT_START + 14 ) -#define S_INVALID_PARAMETERS ( SVT_START + 15 ) -#define S_POINTER_OUTSIDE_APPWIN ( SVT_START + 16 ) -#define S_UNKNOWN_COMMAND ( SVT_START + 17 ) -#define S_WIN_NOT_FOUND ( SVT_START + 18 ) -#define S_WIN_INVISIBLE ( SVT_START + 19 ) -#define S_WIN_DISABLED ( SVT_START + 20 ) -#define S_NUMBER_TOO_BIG ( SVT_START + 21 ) -#define S_NUMBER_TOO_SMALL ( SVT_START + 22 ) -#define S_WINDOW_DISAPPEARED ( SVT_START + 23 ) -#define S_ERROR_SAVING_IMAGE ( SVT_START + 24 ) -#define S_INVALID_POSITION ( SVT_START + 25 ) -#define S_SPLITWIN_NOT_FOUND ( SVT_START + 26 ) -#define S_INTERNAL_ERROR ( SVT_START + 27 ) -#define S_NO_STATUSBAR ( SVT_START + 28 ) -#define S_ITEMS_INVISIBLE ( SVT_START + 29 ) -#define S_TABPAGE_NOT_FOUND ( SVT_START + 30 ) -#define S_TRISTATE_NOT_ALLOWED ( SVT_START + 31 ) -#define S_ERROR_IN_SET_TEXT ( SVT_START + 32 ) -#define S_ATTEMPT_TO_WRITE_READONLY ( SVT_START + 33 ) -#define S_NO_SELECT_FALSE ( SVT_START + 34 ) -#define S_ENTRY_NOT_FOUND ( SVT_START + 35 ) -#define S_METHOD_FAILED ( SVT_START + 36 ) -#define S_HELPID_ON_TOOLBOX_NOT_FOUND ( SVT_START + 37 ) -#define S_BUTTON_DISABLED_ON_TOOLBOX ( SVT_START + 38 ) -#define S_BUTTON_HIDDEN_ON_TOOLBOX ( SVT_START + 39 ) -#define S_CANNOT_MAKE_BUTTON_VISIBLE_IN_TOOLBOX ( SVT_START + 40 ) -#define S_TEAROFF_FAILED ( SVT_START + 41 ) -#define S_NO_SELECTED_ENTRY_DEPRECATED ( SVT_START + 42 ) // Has to stay in for old res files -#define S_SELECT_DESELECT_VIA_STRING_NOT_IMPLEMENTED ( SVT_START + 43 ) -#define S_ALLOWED_ONLY_IN_FLOATING_MODE ( SVT_START + 44 ) -#define S_ALLOWED_ONLY_IN_DOCKING_MODE ( SVT_START + 45 ) -#define S_SIZE_NOT_CHANGEABLE ( SVT_START + 46 ) -#define S_NO_OK_BUTTON ( SVT_START + 47 ) -#define S_NO_CANCEL_BUTTON ( SVT_START + 48 ) -#define S_NO_YES_BUTTON ( SVT_START + 49 ) -#define S_NO_NO_BUTTON ( SVT_START + 50 ) -#define S_NO_RETRY_BUTTON ( SVT_START + 51 ) -#define S_NO_HELP_BUTTON ( SVT_START + 52 ) -#define S_NO_DEFAULT_BUTTON ( SVT_START + 53 ) -#define S_BUTTON_ID_NOT_THERE ( SVT_START + 54 ) -#define S_BUTTONID_REQUIRED ( SVT_START + 55 ) -#define S_UNKNOWN_TYPE ( SVT_START + 56 ) -#define S_UNPACKING_STORAGE_FAILED ( SVT_START + 57 ) -#define S_NO_LIST_BOX_BUTTON ( SVT_START + 58 ) -#define S_UNO_URL_EXECUTE_FAILED_NO_DISPATCHER ( SVT_START + 59 ) -#define S_UNO_URL_EXECUTE_FAILED_NO_FRAME ( SVT_START + 60 ) -#define S_NO_MENU ( SVT_START + 61 ) -#define S_NO_SELECTED_ENTRY ( SVT_START + 62 ) -#define S_UNO_URL_EXECUTE_FAILED_DISABLED ( SVT_START + 63 ) -#define S_NO_SCROLLBAR ( SVT_START + 64 ) -#define S_NO_SAX_PARSER ( SVT_START + 65 ) -#define S_CANNOT_CREATE_DIRECTORY ( SVT_START + 66 ) -#define S_DIRECTORY_NOT_EMPTY ( SVT_START + 67 ) -#define S_DEPRECATED ( SVT_START + 68 ) -#define S_SIZE_BELOW_MINIMUM ( SVT_START + 69 ) -#define S_CANNOT_FIND_FLOATING_WIN ( SVT_START + 70 ) -#define S_NO_LIST_BOX_STRING ( SVT_START + 71 ) -#define S_SLOT_IN_EXECUTE ( SVT_START + 72 ) -#define S_MENU_NOT_CLOSING ( SVT_START + 73 ) diff --git a/basic/inc/testtool.hrc b/basic/inc/testtool.hrc deleted file mode 100644 index 075b462944c9..000000000000 --- a/basic/inc/testtool.hrc +++ /dev/null @@ -1,36 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#define S_INVALID_KEYCODE 257 -#define S_MANDATORY_FILE 258 -#define S_READING_LONGNAMES 259 -#define S_READING_SLOT_IDS 260 -#define S_READING_CONTROLS 261 -#define S_READING_BASIC_MODULE 262 -#define S_STARTING_APPLICATION 263 - - - diff --git a/basic/inc/ttmsg.hrc b/basic/inc/ttmsg.hrc deleted file mode 100644 index 26f250bc6a6a..000000000000 --- a/basic/inc/ttmsg.hrc +++ /dev/null @@ -1,111 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "basic/ttglobal.hrc" - - -// Here are the messages of directory /basic/source/testtool included - -/////////////////////////////// -// Error message that go to the Resultfile. -// ********************* -// *** !!ATTENTION!! *** -// ********************* -// Theses numbers MUST NOT change ever! -// Because they are stored in the Resultfiles and if you showed them again -// the appropriate new or no Strings are viewed. -/////////////////////////////// - -#define S_NAME_NOT_THERE ( TT_START + 0 ) -#define S_DOUBLE_NAME ( TT_START + 1 ) -#define S_READING_FILE ( TT_START + 2 ) -#define S_CANNOT_OPEN_FILE ( TT_START + 3 ) -#define S_INVALID_LINE ( TT_START + 4 ) -#define S_SHORTNAME_UNKNOWN ( TT_START + 5 ) -#define S_LONGNAME_UNKNOWN ( TT_START + 6 ) -#define S_FIRST_SHORTNAME_REQ_ASTRX ( TT_START + 7 ) -#define S_TIMOUT_WAITING ( TT_START + 8 ) -#define S_APPLICATION_RESTARTED ( TT_START + 9 ) -#define S_APPLICATION_START_FAILED ( TT_START + 10 ) -#define S_TIMOUT_SENDING ( TT_START + 11 ) -#define S_NO_CONNECTION ( TT_START + 12 ) -#define S_NO_FILES_FOUND ( TT_START + 13 ) // Not used anymore. needed only for old *.res files -#define S_ERRORS_DETECTED ( TT_START + 14 ) -#define S_NO_ERRORS_DETECTED ( TT_START + 15 ) -#define S_WARNINGS_DETECTED ( TT_START + 16 ) -#define S_NO_WARNINGS_DETECTED ( TT_START + 17 ) -#define S_UNKNOWN_SLOT_CONTROL ( TT_START + 18 ) -#define S_RETURN_SEQUENCE_MISSMATCH ( TT_START + 19 ) -#define S_RETURNED_VALUE_ID_MISSMATCH ( TT_START + 20 ) -#define S_RETURNED_VALUE_NO_RECEIVER ( TT_START + 21 ) -#define S_UNKNOWN_METHOD ( TT_START + 22 ) -#define S_INCLUDE_FILE_WARNINGS_DETECTED ( TT_START + 23 ) -#define S_NO_INCLUDE_FILE_WARNINGS_DETECTED ( TT_START + 24 ) - -// Strings - - -/* -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -#define S_ ( TT_START + 0 ) -*/ diff --git a/basic/prj/d.lst b/basic/prj/d.lst index d2a083ebcb1e..ee5aae9acbf2 100644 --- a/basic/prj/d.lst +++ b/basic/prj/d.lst @@ -20,40 +20,7 @@ mkdir: %COMMON_DEST%\res%_EXT% ..\%__SRC%\lib\libsample.a %_DEST%\lib%_EXT%\libsample.a mkdir: %_DEST%\inc%_EXT%\basic -..\inc\testtool.hrc %_DEST%\inc%_EXT%\basic\testtool.hrc -..\inc\ttmsg.hrc %_DEST%\inc%_EXT%\basic\ttmsg.hrc -..\inc\basic\ttglobal.hrc %_DEST%\inc%_EXT%\basic\ttglobal.hrc -..\inc\svtmsg.hrc %_DEST%\inc%_EXT%\basic\svtmsg.hrc +..\inc\basic\*.hxx %_DEST%\inc%_EXT%\basic\*.hxx +..\inc\basic\*.hrc %_DEST%\inc%_EXT%\basic\*.hrc +..\inc\basic\*.h %_DEST%\inc%_EXT%\basic\*.h -..\inc\basic\sbdef.hxx %_DEST%\inc%_EXT%\basic\sbdef.hxx -..\inc\basic\sbmod.hxx %_DEST%\inc%_EXT%\basic\sbmod.hxx -..\inc\basic\sbjsmod.hxx %_DEST%\inc%_EXT%\basic\sbjsmod.hxx -..\inc\basic\sbmeth.hxx %_DEST%\inc%_EXT%\basic\sbmeth.hxx -..\inc\basic\sbprop.hxx %_DEST%\inc%_EXT%\basic\sbprop.hxx -..\inc\basic\sbstar.hxx %_DEST%\inc%_EXT%\basic\sbstar.hxx -..\inc\basic\sbuno.hxx %_DEST%\inc%_EXT%\basic\sbuno.hxx -..\inc\basic\basmgr.hxx %_DEST%\inc%_EXT%\basic\basmgr.hxx -..\inc\basic\sberrors.hxx %_DEST%\inc%_EXT%\basic\sberrors.hxx -..\inc\basic\basrdll.hxx %_DEST%\inc%_EXT%\basic\basrdll.hxx -..\inc\basic\sbstdobj.hxx %_DEST%\inc%_EXT%\basic\sbstdobj.hxx -..\inc\basic\process.hxx %_DEST%\inc%_EXT%\basic\process.hxx -..\inc\basic\mybasic.hxx %_DEST%\inc%_EXT%\basic\mybasic.hxx -..\inc\basic\testtool.hxx %_DEST%\inc%_EXT%\basic\testtool.hxx -..\inc\basic\basicrt.hxx %_DEST%\inc%_EXT%\basic\basicrt.hxx -..\inc\basic\dispdefs.hxx %_DEST%\inc%_EXT%\basic\dispdefs.hxx -..\inc\basic\ttstrhlp.hxx %_DEST%\inc%_EXT%\basic\ttstrhlp.hxx - -..\inc\basic\sbx.hxx %_DEST%\inc%_EXT%\basic\sbx.hxx -..\inc\basic\sbxcore.hxx %_DEST%\inc%_EXT%\basic\sbxcore.hxx -..\inc\basic\sbxdef.hxx %_DEST%\inc%_EXT%\basic\sbxdef.hxx -..\inc\basic\sbxform.hxx %_DEST%\inc%_EXT%\basic\sbxform.hxx -..\inc\basic\sbxmeth.hxx %_DEST%\inc%_EXT%\basic\sbxmeth.hxx -..\inc\basic\sbxobj.hxx %_DEST%\inc%_EXT%\basic\sbxobj.hxx -..\inc\basic\sbxprop.hxx %_DEST%\inc%_EXT%\basic\sbxprop.hxx -..\inc\basic\sbxvar.hxx %_DEST%\inc%_EXT%\basic\sbxvar.hxx -..\inc\basic\sbxbase.hxx %_DEST%\inc%_EXT%\basic\sbxbase.hxx -..\inc\basic\sbxfac.hxx %_DEST%\inc%_EXT%\basic\sbxfac.hxx -..\inc\basic\sbxmstrm.hxx %_DEST%\inc%_EXT%\basic\sbxmstrm.hxx - -..\inc\basic\basicmanagerrepository.hxx %_DEST%\inc%_EXT%\basic\basicmanagerrepository.hxx -..\inc\modsizeexceeded.hxx %_DEST%\inc%_EXT%\basic\modsizeexceeded.hxx diff --git a/basic/source/app/svtmsg.src b/basic/source/app/svtmsg.src index 89686ebfc0ee..748256bb5564 100644 --- a/basic/source/app/svtmsg.src +++ b/basic/source/app/svtmsg.src @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "svtmsg.hrc" +#include "basic/svtmsg.hrc" // Hier sind die Messages aus dem Verzeichnis /basic/source/app enhalten diff --git a/basic/source/app/testtool.src b/basic/source/app/testtool.src index 245cff6c7917..090cb735c139 100644 --- a/basic/source/app/testtool.src +++ b/basic/source/app/testtool.src @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "testtool.hrc" +#include "basic/testtool.hrc" /////////////////////////////// diff --git a/basic/source/app/ttmsg.src b/basic/source/app/ttmsg.src index 63a6643f3cf1..076ee83fd879 100644 --- a/basic/source/app/ttmsg.src +++ b/basic/source/app/ttmsg.src @@ -24,7 +24,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "ttmsg.hrc" +#include "basic/ttmsg.hrc" // Hier sind die Messages aus dem Verzeichnis /basic/source/testtool enhalten diff --git a/basic/source/uno/modsizeexceeded.cxx b/basic/source/uno/modsizeexceeded.cxx index 408b0f3f8dd4..95c5b0ac2a83 100644 --- a/basic/source/uno/modsizeexceeded.cxx +++ b/basic/source/uno/modsizeexceeded.cxx @@ -27,7 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basic.hxx" -#include "modsizeexceeded.hxx" +#include "basic/modsizeexceeded.hxx" #include #include diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index 096d497a4c50..88caeac1facf 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -60,7 +60,7 @@ #include #include #include -#include "modsizeexceeded.hxx" +#include "basic/modsizeexceeded.hxx" #include #include #include -- cgit v1.2.3 From 966d524bff619cc7c6f709789353e7aa057be833 Mon Sep 17 00:00:00 2001 From: Malte Timmermann Date: Thu, 1 Jul 2010 09:13:15 +0200 Subject: codecleanup02: #i52551# Removed old stuff: VOS_NAMESPACE, use vos:: directly --- basic/inc/basic/process.hxx | 6 ++-- basic/source/app/process.cxx | 38 ++++++++++++------------- basic/source/classes/eventatt.cxx | 2 +- basic/source/classes/sbunoobj.cxx | 4 +-- basic/source/runtime/methods.cxx | 32 ++++++++++----------- connectivity/source/drivers/file/FResultSet.cxx | 4 +-- sfx2/source/dialog/filedlghelper.cxx | 2 +- 7 files changed, 44 insertions(+), 44 deletions(-) mode change 100644 => 100755 basic/source/classes/sbunoobj.cxx (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/process.hxx b/basic/inc/basic/process.hxx index 20cdbe1d4aa4..9a593322b896 100644 --- a/basic/inc/basic/process.hxx +++ b/basic/inc/basic/process.hxx @@ -39,9 +39,9 @@ typedef Environment::value_type EnvironmentVariable; class Process { // Internal members and methods - NAMESPACE_VOS(OArgumentList) *pArgumentList; - NAMESPACE_VOS(OEnvironment) *pEnvList; - NAMESPACE_VOS(OProcess) *pProcess; + vos::OArgumentList *pArgumentList; + vos::OEnvironment *pEnvList; + vos::OProcess *pProcess; BOOL ImplIsRunning(); long ImplGetExitCode(); BOOL bWasGPF; diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx index c37af05ac8da..0eec05e1697c 100644 --- a/basic/source/app/process.cxx +++ b/basic/source/app/process.cxx @@ -72,9 +72,9 @@ BOOL Process::ImplIsRunning() { if ( pProcess && bHasBeenStarted ) { - NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; - pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); - if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + vos::OProcess::TProcessInfo aProcessInfo; + pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); + if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) return TRUE; else return FALSE; @@ -87,9 +87,9 @@ long Process::ImplGetExitCode() { if ( pProcess ) { - NAMESPACE_VOS(OProcess::TProcessInfo) aProcessInfo; - pProcess->getInfo( NAMESPACE_VOS(OProcess::TData_ExitCode), &aProcessInfo ); - if ( !(aProcessInfo.Fields & NAMESPACE_VOS(OProcess::TData_ExitCode)) ) + vos::OProcess::TProcessInfo aProcessInfo; + pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); + if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) SbxBase::SetError( SbxERR_NO_ACTIVE_OBJECT ); return aProcessInfo.Code; } @@ -124,7 +124,7 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const nParamCount++; } } - pArgumentList = new NAMESPACE_VOS(OArgumentList)( pParamList, nCount ); + pArgumentList = new vos::OArgumentList( pParamList, nCount ); ::rtl::OUString *pEnvArray = NULL; @@ -143,12 +143,12 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const nEnvCount++; aIter++; } - pEnvList = new NAMESPACE_VOS(OEnvironment)( pEnvArray, nEnvCount ); + pEnvList = new vos::OEnvironment( pEnvArray, nEnvCount ); } ::rtl::OUString aNormalizedAppPath; osl::FileBase::getFileURLFromSystemPath( ::rtl::OUString(aAppPath), aNormalizedAppPath ); - pProcess = new NAMESPACE_VOS(OProcess)( aNormalizedAppPath ); + pProcess = new vos::OProcess( aNormalizedAppPath ); bHasBeenStarted = FALSE; delete [] pParamList; @@ -170,20 +170,20 @@ BOOL Process::Start() #endif if ( pEnvList ) { - bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - ( NAMESPACE_VOS(OProcess)::TOption_SearchPath - /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ - /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), + bSuccess = pProcess->execute( (vos::OProcess::TProcessOption) + ( vos::OProcess::TOption_SearchPath + /*| vos::OProcess::TOption_Detached*/ + /*| vos::OProcess::TOption_Wait*/ ), *pArgumentList, - *pEnvList ) == NAMESPACE_VOS(OProcess)::E_None; + *pEnvList ) == vos::OProcess::E_None; } else { - bSuccess = pProcess->execute( (NAMESPACE_VOS(OProcess)::TProcessOption) - ( NAMESPACE_VOS(OProcess)::TOption_SearchPath - /*| NAMESPACE_VOS(OProcess)::TOption_Detached*/ - /*| NAMESPACE_VOS(OProcess)::TOption_Wait*/ ), - *pArgumentList ) == NAMESPACE_VOS(OProcess)::E_None; + bSuccess = pProcess->execute( (vos::OProcess::TProcessOption) + ( vos::OProcess::TOption_SearchPath + /*| vos::OProcess::TOption_Detached*/ + /*| vos::OProcess::TOption_Wait*/ ), + *pArgumentList ) == vos::OProcess::E_None; } #ifdef WNT } diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 791e9fe5a8c1..78682a633fe3 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -255,7 +255,7 @@ Any BasicScriptListener_Impl::approveFiring( const ScriptEvent& aScriptEvent ) void BasicScriptListener_Impl::disposing(const EventObject& ) throw ( RuntimeException ) { // TODO: ??? - //NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + //vos::OGuard guard( Application::GetSolarMutex() ); //xSbxObj.Clear(); } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx old mode 100644 new mode 100755 index 849fd839bfd1..80b5721be65f --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -3744,7 +3744,7 @@ BasicAllListener_Impl::~BasicAllListener_Impl() void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); if( xSbxObj.Is() ) { @@ -3809,7 +3809,7 @@ Any BasicAllListener_Impl::approveFiring( const AllEventObject& Event ) throw ( // Methoden von XEventListener void BasicAllListener_Impl ::disposing(const EventObject& ) throw ( RuntimeException ) { - NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + vos::OGuard guard( Application::GetSolarMutex() ); xSbxObj.Clear(); } diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index dbeb7c619b9d..7f492ced6aeb 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -3371,8 +3371,8 @@ RTLFUNC(Shell) } else { - USHORT nOptions = NAMESPACE_VOS(OProcess)::TOption_SearchPath| - NAMESPACE_VOS(OProcess)::TOption_Detached; + USHORT nOptions = vos::OProcess::TOption_SearchPath| + vos::OProcess::TOption_Detached; String aCmdLine = rPar.Get(1)->GetString(); // Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden if( nArgCount >= 4 ) @@ -3450,13 +3450,13 @@ RTLFUNC(Shell) switch( nWinStyle ) { case 2: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Minimized; + nOptions |= vos::OProcess::TOption_Minimized; break; case 3: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Maximized; + nOptions |= vos::OProcess::TOption_Maximized; break; case 10: - nOptions |= NAMESPACE_VOS(OProcess)::TOption_FullScreen; + nOptions |= vos::OProcess::TOption_FullScreen; break; } @@ -3464,10 +3464,10 @@ RTLFUNC(Shell) if( nArgCount >= 5 ) bSync = rPar.Get(4)->GetBool(); if( bSync ) - nOptions |= NAMESPACE_VOS(OProcess)::TOption_Wait; + nOptions |= vos::OProcess::TOption_Wait; } - NAMESPACE_VOS(OProcess)::TProcessOption eOptions = - (NAMESPACE_VOS(OProcess)::TProcessOption)nOptions; + vos::OProcess::TProcessOption eOptions = + (vos::OProcess::TProcessOption)nOptions; // #72471 Parameter aufbereiten @@ -3497,25 +3497,25 @@ RTLFUNC(Shell) } //const char* pParams = aParams.Len() ? aParams.GetStr() : 0; - NAMESPACE_VOS(OProcess)* pApp; - pApp = new NAMESPACE_VOS(OProcess)( aOUStrProgUNC ); + vos::OProcess* pApp; + pApp = new vos::OProcess( aOUStrProgUNC ); BOOL bSucc; if( nParamCount == 0 ) { - bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; } else { - NAMESPACE_VOS(OArgumentList) aArgList( pArgumentList, nParamCount ); - bSucc = pApp->execute( eOptions, aArgList ) == NAMESPACE_VOS(OProcess)::E_None; + vos::OArgumentList aArgList( pArgumentList, nParamCount ); + bSucc = pApp->execute( eOptions, aArgList ) == vos::OProcess::E_None; } /* if( nParamCount == 0 ) - pApp = new NAMESPACE_VOS(OProcess)( pProg ); + pApp = new vos::OProcess( pProg ); else - pApp = new NAMESPACE_VOS(OProcess)( pProg, pParamList, nParamCount ); - BOOL bSucc = pApp->execute( eOptions ) == NAMESPACE_VOS(OProcess)::E_None; + pApp = new vos::OProcess( pProg, pParamList, nParamCount ); + BOOL bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; */ delete pApp; diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 3462422b99e6..94d65cc8a1bc 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1044,7 +1044,7 @@ BOOL OResultSet::Move(IResultSetHelper::Movement eCursorPosition, INT32 nOffset, // INT32 nTempPos = m_nRowPos; // exclusiver zugriff auf die Tabelle - // NAMESPACE_VOS(OGuard)* pGuard = m_pTable->Lock(); + // vos::OGuard* pGuard = m_pTable->Lock(); if (m_aSQLIterator.getStatementType() == SQL_STATEMENT_SELECT && !isCount()) @@ -1402,7 +1402,7 @@ BOOL OResultSet::OpenImpl() m_nRowCountResult = -1; // exclusiver zugriff auf die Tabelle - // NAMESPACE_VOS(OGuard)* pGuard = pTable->Lock(); + // vos::OGuard* pGuard = pTable->Lock(); m_nLastVisitedPos = m_pTable->getCurrentLastPos(); switch(m_aSQLIterator.getStatementType()) diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index d56c36bfd5ea..49c605cadf85 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2721,7 +2721,7 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath ) if ( sFolder.getLength() == 0 ) { // _rPath is not a valid path -> fallback to home directory - NAMESPACE_VOS( OSecurity ) aSecurity; + vos:: OSecurity aSecurity; aSecurity.getHomeDir( sFolder ); } mpImp->displayFolder( sFolder ); -- cgit v1.2.3 From d67208c7d51dba05e5e242686a30525eb977e771 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Mon, 23 Aug 2010 10:54:49 +0200 Subject: mib19: #163377# Support procedure properties for UserForm modules --- basic/inc/basic/sbmod.hxx | 1 + basic/inc/basic/sbobjmod.hxx | 4 ++ basic/source/classes/sb.cxx | 88 +----------------------------------- basic/source/classes/sbxmod.cxx | 99 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 105 insertions(+), 87 deletions(-) mode change 100644 => 100755 basic/source/classes/sbxmod.cxx (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index abb482f7bfe5..863335926cb6 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -92,6 +92,7 @@ protected: virtual BOOL LoadCompleted(); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); + void handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rHint ); virtual ~SbModule(); public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2); diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx index 9ff46d1931f3..2e142245dae7 100644 --- a/basic/inc/basic/sbobjmod.hxx +++ b/basic/inc/basic/sbobjmod.hxx @@ -56,6 +56,10 @@ public: TYPEINFO(); SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible ); virtual SbxVariable* Find( const XubString& rName, SbxClassType t ); + + virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ); + using SbxValue::GetObject; SbxVariable* GetObject(); void SetUnoObject( const com::sun::star::uno::Any& aObj )throw ( com::sun::star::uno::RuntimeException ) ; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 1e77892aab67..f509647e08a1 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -611,93 +611,7 @@ SbClassModuleObject::~SbClassModuleObject() void SbClassModuleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ) { - bool bDone = false; - - const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); - if( pHint ) - { - SbxVariable* pVar = pHint->GetVar(); - SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar ); - if( pProcProperty ) - { - bDone = true; - - if( pHint->GetId() == SBX_HINT_DATAWANTED ) - { - String aProcName; - aProcName.AppendAscii( "Property Get " ); - aProcName += pProcProperty->GetName(); - - SbxVariable* pMeth = Find( aProcName, SbxCLASS_METHOD ); - if( pMeth ) - { - SbxValues aVals; - aVals.eType = SbxVARIANT; - - SbxArray* pArg = pVar->GetParameters(); - USHORT nVarParCount = (pArg != NULL) ? pArg->Count() : 0; - if( nVarParCount > 1 ) - { - SbxArrayRef xMethParameters = new SbxArray; - xMethParameters->Put( pMeth, 0 ); // Method as parameter 0 - for( USHORT i = 1 ; i < nVarParCount ; ++i ) - { - SbxVariable* pPar = pArg->Get( i ); - xMethParameters->Put( pPar, i ); - } - - pMeth->SetParameters( xMethParameters ); - pMeth->Get( aVals ); - pMeth->SetParameters( NULL ); - } - else - { - pMeth->Get( aVals ); - } - - pVar->Put( aVals ); - } - } - else if( pHint->GetId() == SBX_HINT_DATACHANGED ) - { - SbxVariable* pMeth = NULL; - - bool bSet = pProcProperty->isSet(); - if( bSet ) - { - pProcProperty->setSet( false ); - - String aProcName; - aProcName.AppendAscii( "Property Set " ); - aProcName += pProcProperty->GetName(); - pMeth = Find( aProcName, SbxCLASS_METHOD ); - } - if( !pMeth ) // Let - { - String aProcName; - aProcName.AppendAscii( "Property Let " ); - aProcName += pProcProperty->GetName(); - pMeth = Find( aProcName, SbxCLASS_METHOD ); - } - - if( pMeth ) - { - // Setup parameters - SbxArrayRef xArray = new SbxArray; - xArray->Put( pMeth, 0 ); // Method as parameter 0 - xArray->Put( pVar, 1 ); - pMeth->SetParameters( xArray ); - - SbxValues aVals; - pMeth->Get( aVals ); - pMeth->SetParameters( NULL ); - } - } - } - } - - if( !bDone ) - SbModule::SFX_NOTIFY( rBC, rBCType, rHint, rHintType ); + handleProcedureProperties( rBC, rHint ); } SbxVariable* SbClassModuleObject::Find( const XubString& rName, SbxClassType t ) diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx old mode 100644 new mode 100755 index 8b1069bbeab3..bdbdde57cc1b --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1746,6 +1746,98 @@ BOOL SbModule::LoadCompleted() return TRUE; } +void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rHint ) +{ + bool bDone = false; + + const SbxHint* pHint = PTR_CAST(SbxHint,&rHint); + if( pHint ) + { + SbxVariable* pVar = pHint->GetVar(); + SbProcedureProperty* pProcProperty = PTR_CAST( SbProcedureProperty, pVar ); + if( pProcProperty ) + { + bDone = true; + + if( pHint->GetId() == SBX_HINT_DATAWANTED ) + { + String aProcName; + aProcName.AppendAscii( "Property Get " ); + aProcName += pProcProperty->GetName(); + + SbxVariable* pMeth = Find( aProcName, SbxCLASS_METHOD ); + if( pMeth ) + { + SbxValues aVals; + aVals.eType = SbxVARIANT; + + SbxArray* pArg = pVar->GetParameters(); + USHORT nVarParCount = (pArg != NULL) ? pArg->Count() : 0; + if( nVarParCount > 1 ) + { + SbxArrayRef xMethParameters = new SbxArray; + xMethParameters->Put( pMeth, 0 ); // Method as parameter 0 + for( USHORT i = 1 ; i < nVarParCount ; ++i ) + { + SbxVariable* pPar = pArg->Get( i ); + xMethParameters->Put( pPar, i ); + } + + pMeth->SetParameters( xMethParameters ); + pMeth->Get( aVals ); + pMeth->SetParameters( NULL ); + } + else + { + pMeth->Get( aVals ); + } + + pVar->Put( aVals ); + } + } + else if( pHint->GetId() == SBX_HINT_DATACHANGED ) + { + SbxVariable* pMeth = NULL; + + bool bSet = pProcProperty->isSet(); + if( bSet ) + { + pProcProperty->setSet( false ); + + String aProcName; + aProcName.AppendAscii( "Property Set " ); + aProcName += pProcProperty->GetName(); + pMeth = Find( aProcName, SbxCLASS_METHOD ); + } + if( !pMeth ) // Let + { + String aProcName; + aProcName.AppendAscii( "Property Let " ); + aProcName += pProcProperty->GetName(); + pMeth = Find( aProcName, SbxCLASS_METHOD ); + } + + if( pMeth ) + { + // Setup parameters + SbxArrayRef xArray = new SbxArray; + xArray->Put( pMeth, 0 ); // Method as parameter 0 + xArray->Put( pVar, 1 ); + pMeth->SetParameters( xArray ); + + SbxValues aVals; + pMeth->Get( aVals ); + pMeth->SetParameters( NULL ); + } + } + } + } + + if( !bDone ) + SbModule::Notify( rBC, rHint ); +} + + ///////////////////////////////////////////////////////////////////////// // Implementation SbJScriptModule (Basic-Modul fuer JavaScript-Sourcen) SbJScriptModule::SbJScriptModule( const String& rName ) @@ -2012,6 +2104,13 @@ SbObjModule::Find( const XubString& rName, SbxClassType t ) return pVar; } +void SbObjModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, + const SfxHint& rHint, const TypeId& rHintType ) +{ + SbModule::handleProcedureProperties( rBC, rHint ); +} + + typedef ::cppu::WeakImplHelper2< awt::XTopWindowListener, awt::XWindowListener > FormObjEventListener_BASE; class FormObjEventListenerImpl : public FormObjEventListener_BASE -- cgit v1.2.3 From e20d0e3eb6dbd05da364c8ec3b71ff4f118dbf48 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 30 Aug 2010 09:45:08 +0200 Subject: mib19: #163217# let the basic listeners stop listening on termination, patch from AB --- basic/inc/basic/sbobjmod.hxx | 4 + basic/inc/basic/sbxvar.hxx | 5 +- basic/source/classes/sb.cxx | 4 + basic/source/classes/sbunoobj.cxx | 161 +++++++++++++++++++++++++++++++++++++- basic/source/classes/sbxmod.cxx | 5 ++ basic/source/runtime/step0.cxx | 2 +- basic/source/sbx/sbxvar.cxx | 27 ++++++- 7 files changed, 200 insertions(+), 8 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx index 2e142245dae7..a8e650e43d87 100644 --- a/basic/inc/basic/sbobjmod.hxx +++ b/basic/inc/basic/sbobjmod.hxx @@ -52,6 +52,10 @@ class SbObjModule : public SbModule { SbObjModule( const SbObjModule& ); SbObjModule(); + +protected: + virtual ~SbObjModule(); + public: TYPEINFO(); SbObjModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVbaCompatible ); diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx index 0cddcbdf8d17..1ba1b5d1edfa 100644 --- a/basic/inc/basic/sbxvar.hxx +++ b/basic/inc/basic/sbxvar.hxx @@ -439,6 +439,7 @@ SV_DECL_REF(SbxInfo) class SfxBroadcaster; class SbxVariableImpl; +class StarBASIC; class SbxVariable : public SbxValue { @@ -499,7 +500,9 @@ public: const String& GetDeclareClassName( void ); void SetDeclareClassName( const String& ); - void SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener ); + void SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener, + StarBASIC* pParentBasic ); + void ClearComListener( void ); static USHORT MakeHashCode( const String& rName ); }; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index f509647e08a1..fbbf132c07d3 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -761,6 +761,8 @@ void StarBASIC::SetModified( BOOL b ) SbxBase::SetModified( b ); } +void disposeComVariablesForBasic( StarBASIC* pBasic ); + StarBASIC::~StarBASIC() { if( !--GetSbData()->nInst ) @@ -803,6 +805,8 @@ StarBASIC::~StarBASIC() } xUnoListeners = NULL; } + + disposeComVariablesForBasic( this ); } // Override new() operator, so that everyone can create a new instance diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index c9123b06341b..53a7c5c18930 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -36,9 +36,11 @@ #include #include +#include #include #include #include +#include #include #include @@ -4170,14 +4172,26 @@ void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) //========================================================================== -typedef WeakImplHelper1< XInvocation > ModuleInvocationProxyHelper; +namespace { +class OMutexBasis +{ +protected: + // this mutex is necessary for OInterfaceContainerHelper + ::osl::Mutex m_aMutex; +}; +}; -class ModuleInvocationProxy : public ModuleInvocationProxyHelper +typedef WeakImplHelper2< XInvocation, XComponent > ModuleInvocationProxyHelper; + +class ModuleInvocationProxy : public OMutexBasis, + public ModuleInvocationProxyHelper { ::rtl::OUString m_aPrefix; SbxObjectRef m_xScopeObj; bool m_bProxyIsClassModuleObject; + ::cppu::OInterfaceContainerHelper m_aListeners; + public: ModuleInvocationProxy( const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj ); ~ModuleInvocationProxy() @@ -4197,11 +4211,17 @@ public: Sequence< sal_Int16 >& rOutParamIndex, Sequence< Any >& rOutParam ) throw( CannotConvertException, InvocationTargetException ); + + // XComponent + virtual void SAL_CALL dispose() throw(RuntimeException); + virtual void SAL_CALL addEventListener( const Reference< XEventListener >& xListener ) throw (RuntimeException); + virtual void SAL_CALL removeEventListener( const Reference< XEventListener >& aListener ) throw (RuntimeException); }; ModuleInvocationProxy::ModuleInvocationProxy( const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj ) : m_aPrefix( aPrefix + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_") ) ) , m_xScopeObj( xScopeObj ) + , m_aListeners( m_aMutex ) { m_bProxyIsClassModuleObject = xScopeObj.Is() ? xScopeObj->ISA(SbClassModuleObject) : false; } @@ -4298,13 +4318,14 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction, NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); Any aRet; - if( !m_xScopeObj.Is() ) + SbxObjectRef xScopeObj = m_xScopeObj; + if( !xScopeObj.Is() ) return aRet; ::rtl::OUString aFunctionName = m_aPrefix; aFunctionName += rFunction; - SbxVariable* p = m_xScopeObj->Find( aFunctionName, SbxCLASS_METHOD ); + SbxVariable* p = xScopeObj->Find( aFunctionName, SbxCLASS_METHOD ); SbMethod* pMeth = p != NULL ? PTR_CAST(SbMethod,p) : NULL; if( pMeth == NULL ) { @@ -4341,6 +4362,30 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction, return aRet; } +void SAL_CALL ModuleInvocationProxy::dispose() + throw(RuntimeException) +{ + ::osl::MutexGuard aGuard( m_aMutex ); + + EventObject aEvent( (XComponent*)this ); + m_aListeners.disposeAndClear( aEvent ); + + m_xScopeObj = NULL; +} + +void SAL_CALL ModuleInvocationProxy::addEventListener( const Reference< XEventListener >& xListener ) + throw (RuntimeException) +{ + m_aListeners.addInterface( xListener ); +} + +void SAL_CALL ModuleInvocationProxy::removeEventListener( const Reference< XEventListener >& xListener ) + throw (RuntimeException) +{ + m_aListeners.removeInterface( xListener ); +} + + Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl::OUString& aVBAType, const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj ) { @@ -4370,6 +4415,97 @@ Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl:: return xRet; } +typedef std::vector< WeakReference< XComponent > > ComponentRefVector; + +struct StarBasicDisposeItem +{ + StarBASIC* m_pBasic; + SbxArrayRef m_pRegisteredVariables; + ComponentRefVector m_vComImplementsObjects; + + StarBasicDisposeItem( StarBASIC* pBasic ) + : m_pBasic( pBasic ) + { + m_pRegisteredVariables = new SbxArray(); + } +}; + +typedef std::vector< StarBasicDisposeItem* > DisposeItemVector; + +static DisposeItemVector GaDisposeItemVector; + +DisposeItemVector::iterator lcl_findItemForBasic( StarBASIC* pBasic ) +{ + DisposeItemVector::iterator it; + for( it = GaDisposeItemVector.begin() ; it != GaDisposeItemVector.end() ; ++it ) + { + StarBasicDisposeItem* pItem = *it; + if( pItem->m_pBasic == pBasic ) + return it; + } + return GaDisposeItemVector.end(); +} + +StarBasicDisposeItem* lcl_getOrCreateItemForBasic( StarBASIC* pBasic ) +{ + DisposeItemVector::iterator it = lcl_findItemForBasic( pBasic ); + StarBasicDisposeItem* pItem = (it != GaDisposeItemVector.end()) ? *it : NULL; + if( pItem == NULL ) + { + pItem = new StarBasicDisposeItem( pBasic ); + GaDisposeItemVector.push_back( pItem ); + } + return pItem; +} + +void lcl_registerComponentToBeDisposedForBasic + ( Reference< XComponent > xComponent, StarBASIC* pBasic ) +{ + StarBasicDisposeItem* pItem = lcl_getOrCreateItemForBasic( pBasic ); + pItem->m_vComImplementsObjects.push_back( xComponent ); +} + +void registerComListenerVariableForBasic( SbxVariable* pVar, StarBASIC* pBasic ) +{ + StarBasicDisposeItem* pItem = lcl_getOrCreateItemForBasic( pBasic ); + SbxArray* pArray = pItem->m_pRegisteredVariables; + pArray->Put( pVar, pArray->Count() ); +} + +void disposeComVariablesForBasic( StarBASIC* pBasic ) +{ + DisposeItemVector::iterator it = lcl_findItemForBasic( pBasic ); + if( it != GaDisposeItemVector.end() ) + { + StarBasicDisposeItem* pItem = *it; + + SbxArray* pArray = pItem->m_pRegisteredVariables; + USHORT nCount = pArray->Count(); + for( USHORT i = 0 ; i < nCount ; ++i ) + { + SbxVariable* pVar = pArray->Get( i ); + pVar->ClearComListener(); + } + + ComponentRefVector& rv = pItem->m_vComImplementsObjects; + ComponentRefVector::iterator itCRV; + for( itCRV = rv.begin() ; itCRV != rv.end() ; ++itCRV ) + { + try + { + Reference< XComponent > xComponent( (*itCRV).get(), UNO_QUERY_THROW ); + xComponent->dispose(); + } + catch( Exception& ) + {} + } + + delete pItem; + GaDisposeItemVector.erase( it ); + } +} + + // Handle module implements mechanism for OLE types bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pProxyClassModuleObject ) { @@ -4423,6 +4559,23 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP if( bSuccess ) { + Reference< XComponent > xComponent( xProxy, UNO_QUERY ); + if( xComponent.is() ) + { + StarBASIC* pParentBasic = NULL; + SbxObject* pCurObject = this; + do + { + SbxObject* pParent = pCurObject->GetParent(); + pParentBasic = PTR_CAST(StarBASIC,pParent); + pCurObject = pParent; + } + while( pParentBasic == NULL && pCurObject != NULL ); + + OSL_ASSERT( pParentBasic != NULL ); + lcl_registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); + } + o_rRetAny <<= xRet; break; } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 2b3849169fd9..46a1488844c1 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -2072,6 +2072,11 @@ SbObjModule::SbObjModule( const String& rName, const com::sun::star::script::Mod else if ( mInfo.ModuleObject.is() ) SetUnoObject( uno::makeAny( mInfo.ModuleObject ) ); } + +SbObjModule::~SbObjModule() +{ +} + void SbObjModule::SetUnoObject( const uno::Any& aObj ) throw ( uno::RuntimeException ) { diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 06a8bb19af00..797896bf32ef 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -548,7 +548,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b xComListener = createComListener( aControlAny, aVBAType, aPrefix, xScopeObj ); refVal->SetDeclareClassName( aDeclareClassName ); - refVal->SetComListener( xComListener ); // Hold reference + refVal->SetComListener( xComListener, &rBasic ); // Hold reference } *refVar = *refVal; diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 58e3c1ae92c2..45342a015194 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -59,13 +59,17 @@ class SbxVariableImpl friend class SbxVariable; String m_aDeclareClassName; Reference< XInterface > m_xComListener; + StarBASIC* m_pComListenerParentBasic; SbxVariableImpl( void ) + : m_pComListenerParentBasic( NULL ) {} SbxVariableImpl( const SbxVariableImpl& r ) : m_aDeclareClassName( r.m_aDeclareClassName ) , m_xComListener( r.m_xComListener ) - {} + , m_pComListenerParentBasic( r.m_pComListenerParentBasic ) + { + } }; @@ -84,12 +88,18 @@ SbxVariable::SbxVariable() : SbxValue() #endif } +void registerComListenerVariableForBasic( SbxVariable* pVar, StarBASIC* pBasic ); + SbxVariable::SbxVariable( const SbxVariable& r ) : SvRefBase( r ), SbxValue( r ), mpPar( r.mpPar ), pInfo( r.pInfo ) { mpSbxVariableImpl = NULL; if( r.mpSbxVariableImpl != NULL ) + { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); + if( mpSbxVariableImpl->m_xComListener.is() ) + registerComListenerVariableForBasic( this, mpSbxVariableImpl->m_pComListenerParentBasic ); + } pCst = NULL; if( r.CanRead() ) { @@ -315,7 +325,11 @@ SbxVariable& SbxVariable::operator=( const SbxVariable& r ) SbxValue::operator=( r ); delete mpSbxVariableImpl; if( r.mpSbxVariableImpl != NULL ) + { mpSbxVariableImpl = new SbxVariableImpl( *r.mpSbxVariableImpl ); + if( mpSbxVariableImpl->m_xComListener.is() ) + registerComListenerVariableForBasic( this, mpSbxVariableImpl->m_pComListenerParentBasic ); + } else mpSbxVariableImpl = NULL; return *this; @@ -396,10 +410,19 @@ void SbxVariable::SetDeclareClassName( const String& rDeclareClassName ) pImpl->m_aDeclareClassName = rDeclareClassName; } -void SbxVariable::SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener ) +void SbxVariable::SetComListener( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xComListener, + StarBASIC* pParentBasic ) { SbxVariableImpl* pImpl = getImpl(); pImpl->m_xComListener = xComListener; + pImpl->m_pComListenerParentBasic = pParentBasic; + registerComListenerVariableForBasic( this, pParentBasic ); +} + +void SbxVariable::ClearComListener( void ) +{ + SbxVariableImpl* pImpl = getImpl(); + pImpl->m_xComListener.clear(); } -- cgit v1.2.3 From 492878bbb84c5012b9d8ad42ce414018a70adfbe Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 2 Sep 2010 09:04:11 +0200 Subject: mib19: #163515# Protect StarBASIC::InitAllModules with solar mutex and change handling --- basic/inc/basic/sbmod.hxx | 3 ++- basic/source/classes/sb.cxx | 26 +++++++++++++------------- basic/source/runtime/runtime.cxx | 5 +++-- 3 files changed, 18 insertions(+), 16 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index 863335926cb6..d9f3fd0cde24 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -44,6 +44,7 @@ class SbProcedureProperty; class SbIfaceMapperMethod; class SbClassModuleObject; +class ModuleInitDependencyMap; struct ClassModuleRunInitItem; struct SbClassData; class SbModuleImpl; @@ -72,7 +73,7 @@ protected: SbxObjectRef pDocObject; // an impl object ( used by Document Modules ) bool bIsProxyModule; - static void implProcessModuleRunInit( ClassModuleRunInitItem& rItem ); + static void implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassModuleRunInitItem& rItem ); void StartDefinitions(); SbMethod* GetMethod( const String&, SbxDataType ); SbProperty* GetProperty( const String&, SbxDataType ); diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index fbbf132c07d3..3a9e892ada42 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -954,15 +954,15 @@ struct ClassModuleRunInitItem {} }; -typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem, - ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap; +// Derive from has_map type instead of typedef +// to allow forward declaration in sbmod.hxx +class ModuleInitDependencyMap : public + std::hash_map< ::rtl::OUString, ClassModuleRunInitItem, + ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > +{}; -static ModuleInitDependencyMap* GpMIDMap = NULL; - -void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem ) +void SbModule::implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassModuleRunInitItem& rItem ) { - ModuleInitDependencyMap& rMIDMap = *GpMIDMap; - rItem.m_bProcessing = true; //bool bAnyDependencies = true; @@ -977,8 +977,8 @@ void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem ) String& rStr = *it; // Is required type a class module? - ModuleInitDependencyMap::iterator itFind = rMIDMap.find( rStr ); - if( itFind != rMIDMap.end() ) + ModuleInitDependencyMap::iterator itFind = rMap.find( rStr ); + if( itFind != rMap.end() ) { ClassModuleRunInitItem& rParentItem = itFind->second; if( rParentItem.m_bProcessing ) @@ -989,7 +989,7 @@ void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem ) } if( !rParentItem.m_bRunInitDone ) - implProcessModuleRunInit( rParentItem ); + implProcessModuleRunInit( rMap, rParentItem ); } } } @@ -1003,6 +1003,8 @@ void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem ) // Run Init-Code of all modules (including inserted libraries) void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) { + NAMESPACE_VOS(OGuard) guard( Application::GetSolarMutex() ); + // Init own modules for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) { @@ -1017,7 +1019,6 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // Consider required types to init in right order. Class modules // that are required by other modules have to be initialized first. ModuleInitDependencyMap aMIDMap; - GpMIDMap = &aMIDMap; for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); @@ -1030,9 +1031,8 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) for( it = aMIDMap.begin() ; it != aMIDMap.end(); ++it ) { ClassModuleRunInitItem& rItem = it->second; - SbModule::implProcessModuleRunInit( rItem ); + SbModule::implProcessModuleRunInit( aMIDMap, rItem ); } - GpMIDMap = NULL; // Call RunInit on standard modules for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 1bb6fb82e113..06d0fab1e59a 100755 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -890,11 +890,12 @@ void SbiRuntime::Error( SbError _errCode, const String& _details ) { if ( _errCode ) { - OSL_ENSURE( pInst->pRun == this, "SbiRuntime::Error: can't propagate the error message details!" ); + // Not correct for class module usage, remove for now + //OSL_ENSURE( pInst->pRun == this, "SbiRuntime::Error: can't propagate the error message details!" ); if ( pInst->pRun == this ) { pInst->Error( _errCode, _details ); - OSL_POSTCOND( nError == _errCode, "SbiRuntime::Error: the instance is expecte to propagate the error code back to me!" ); + //OSL_POSTCOND( nError == _errCode, "SbiRuntime::Error: the instance is expecte to propagate the error code back to me!" ); } else { -- cgit v1.2.3 From edcda911555753034afb2175a0c1a8b09f0e8210 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Tue, 7 Sep 2010 17:59:48 +0200 Subject: mib19: #163433# let Application::Run find the correct document --- basic/inc/basic/sbstar.hxx | 4 ++++ basic/source/classes/eventatt.cxx | 50 +-------------------------------------- basic/source/classes/sb.cxx | 49 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 49 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index a234dc206ec7..227ca4d080c1 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -38,6 +38,7 @@ #include #include #include +#include class SbModule; // completed module class SbiInstance; // runtime instance @@ -207,6 +208,9 @@ public: bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ); void QuitAndExitApplication(); BOOL IsQuitApplication() { return bQuit; }; + + static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > + GetModelFromBasic( SbxObject* pBasic ); }; #ifndef __SB_SBSTARBASICREF_HXX diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 791e9fe5a8c1..796aedf5d76e 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -88,54 +88,6 @@ using namespace ::cppu; using namespace ::osl; - -Reference< frame::XModel > getModelFromBasic( SbxObject* pBasic ) -{ - OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" ); - if ( !pBasic ) - return NULL; - - // look for the ThisComponent variable, first in the parent (which - // might be the document's Basic), then in the parent's parent (which might be - // the application Basic) - const ::rtl::OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) ); - SbxVariable* pThisComponent = NULL; - - SbxObject* pLookup = pBasic->GetParent(); - while ( pLookup && !pThisComponent ) - { - pThisComponent = pLookup->Find( sThisComponent, SbxCLASS_OBJECT ); - pLookup = pLookup->GetParent(); - } - if ( !pThisComponent ) - { - OSL_TRACE("Failed to get ThisComponent"); - // the application Basic, at the latest, should have this variable - return NULL; - } - - Any aThisComponent( sbxToUnoValue( pThisComponent ) ); - Reference< frame::XModel > xModel( aThisComponent, UNO_QUERY ); - if ( !xModel.is() ) - { - // it's no XModel. Okay, ThisComponent nowadays is allowed to be a controller. - Reference< frame::XController > xController( aThisComponent, UNO_QUERY ); - if ( xController.is() ) - xModel = xController->getModel(); - } - - if ( !xModel.is() ) - return NULL; - -#if OSL_DEBUG_LEVEL > 0 - OSL_TRACE("Have model ThisComponent points to url %s", - ::rtl::OUStringToOString( xModel->getURL(), - RTL_TEXTENCODING_ASCII_US ).pData->buffer ); -#endif - - return xModel; -} - void SFURL_firing_impl( const ScriptEvent& aScriptEvent, Any* pRet, const Reference< frame::XModel >& xModel ) { OSL_TRACE("SFURL_firing_impl() processing script url %s", @@ -569,7 +521,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) bool bDocDialog = false; StarBASIC* pFoundBasic = NULL; OSL_TRACE("About to try get a hold of ThisComponent"); - Reference< frame::XModel > xModel = getModelFromBasic( pINST->GetBasic() ) ; + Reference< frame::XModel > xModel = StarBASIC::GetModelFromBasic( pINST->GetBasic() ) ; aDlgLibAny = implFindDialogLibForDialogBasic( aAnyISP, pINST->GetBasic(), pFoundBasic ); // If we found the dialog then it belongs to the Search basic if ( !pFoundBasic ) diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 3a9e892ada42..81b1991a215a 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -71,6 +71,7 @@ TYPEINIT1(StarBASIC,SbxObject) #define RTLNAME "@SBRTL" // i#i68894# +using namespace ::com::sun::star; using com::sun::star::uno::Reference; using com::sun::star::uno::Any; using com::sun::star::uno::UNO_QUERY; @@ -1767,6 +1768,54 @@ bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::u return bRes; } +Reference< frame::XModel > StarBASIC::GetModelFromBasic( SbxObject* pBasic ) +{ + OSL_PRECOND( pBasic != NULL, "getModelFromBasic: illegal call!" ); + if ( !pBasic ) + return NULL; + + // look for the ThisComponent variable, first in the parent (which + // might be the document's Basic), then in the parent's parent (which might be + // the application Basic) + const ::rtl::OUString sThisComponent( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) ); + SbxVariable* pThisComponent = NULL; + + SbxObject* pLookup = pBasic->GetParent(); + while ( pLookup && !pThisComponent ) + { + pThisComponent = pLookup->Find( sThisComponent, SbxCLASS_OBJECT ); + pLookup = pLookup->GetParent(); + } + if ( !pThisComponent ) + { + OSL_TRACE("Failed to get ThisComponent"); + // the application Basic, at the latest, should have this variable + return NULL; + } + + Any aThisComponent( sbxToUnoValue( pThisComponent ) ); + Reference< frame::XModel > xModel( aThisComponent, UNO_QUERY ); + if ( !xModel.is() ) + { + // it's no XModel. Okay, ThisComponent nowadays is allowed to be a controller. + Reference< frame::XController > xController( aThisComponent, UNO_QUERY ); + if ( xController.is() ) + xModel = xController->getModel(); + } + + if ( !xModel.is() ) + return NULL; + +#if OSL_DEBUG_LEVEL > 0 + OSL_TRACE("Have model ThisComponent points to url %s", + ::rtl::OUStringToOString( xModel->getURL(), + RTL_TEXTENCODING_ASCII_US ).pData->buffer ); +#endif + + return xModel; +} + + //======================================================================== // #118116 Implementation Collection object -- cgit v1.2.3 From d3ad5e48cac0e7c2c0e2d9be32b81582c3de4271 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Thu, 9 Sep 2010 12:45:01 +0200 Subject: mib19: #163576# Automatically reinstantiate objects declared with Dim As New --- basic/inc/basic/sbxdef.hxx | 3 ++ basic/source/classes/sb.cxx | 3 -- basic/source/comp/dim.cxx | 3 ++ basic/source/inc/runtime.hxx | 2 +- basic/source/runtime/step0.cxx | 113 +++++++++++++++++++++++++++++++++++++++++ basic/source/runtime/step2.cxx | 36 ++++++------- basic/source/sbx/sbxobj.cxx | 3 ++ basic/source/sbx/sbxvar.cxx | 4 ++ 8 files changed, 146 insertions(+), 21 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbxdef.hxx b/basic/inc/basic/sbxdef.hxx index 89322be776f9..b85b3552c79e 100644 --- a/basic/inc/basic/sbxdef.hxx +++ b/basic/inc/basic/sbxdef.hxx @@ -106,6 +106,7 @@ enum SbxDataType { }; const UINT32 SBX_TYPE_WITH_EVENTS_FLAG = 0x10000; +const UINT32 SBX_TYPE_DIM_AS_NEW_FLAG = 0x20000; const UINT32 SBX_FIXED_LEN_STRING_FLAG = 0x10000; // same value as above as no conflict possible #endif @@ -317,6 +318,8 @@ enum SbxError { // Ergebnis einer Rechenoperation/Konversion #define SBX_REFERENCE 0x4000 // Parameter is Reference (DLL-call) #define SBX_NO_MODIFY 0x8000 // SetModified is suppressed #define SBX_WITH_EVENTS 0x0080 // Same value as unused SBX_HIDDEN +#define SBX_DIM_AS_NEW 0x0800 // Same value as SBX_GBLSEARCH, cannot conflict as one + // is used for objects, the other for variables only // Broadcaster-IDs: #define SBX_HINT_DYING SFX_HINT_DYING diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 8d5a21b4e98e..c3c2facffbd2 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -565,7 +565,6 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) if( pObj != NULL ) { String aObjClass = pObj->GetClassName(); - (void)aObjClass; SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pObjBase); if( pClassModuleObj != NULL ) @@ -762,8 +761,6 @@ void StarBASIC::SetModified( BOOL b ) SbxBase::SetModified( b ); } -void disposeComVariablesForBasic( StarBASIC* pBasic ); - StarBASIC::~StarBASIC() { if( !--GetSbData()->nInst ) diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 59d77e3f3757..4d188ec1ca8a 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -375,6 +375,9 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) if( pDef->IsWithEvents() ) nOpnd2 |= SBX_TYPE_WITH_EVENTS_FLAG; + if( bCompatible && pDef->IsNew() ) + nOpnd2 |= SBX_TYPE_DIM_AS_NEW_FLAG; + short nFixedStringLength = pDef->GetFixedStringLength(); if( nFixedStringLength >= 0 ) nOpnd2 |= (SBX_FIXED_LEN_STRING_FLAG + (UINT32(nFixedStringLength) << 17)); // len = all bits above 0x10000 diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 8859739cccd3..356e07c9e55c 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -436,7 +436,7 @@ class SbiRuntime void StepDCREATE_REDIMP(UINT32,UINT32), StepDCREATE_IMPL(UINT32,UINT32); void StepFIND_CM( UINT32, UINT32 ); void StepFIND_STATIC( UINT32, UINT32 ); - void implCreateFixedString( SbxVariable* pStrVar, UINT32 nOp2 ); + void implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, UINT32 nOp2 ); public: void SetVBAEnabled( bool bEnabled ); USHORT GetImageFlag( USHORT n ) const; diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index 797896bf32ef..d8ad1c1fe620 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -47,6 +47,7 @@ Reference< XInterface > createComListener( const Any& aControlAny, const ::rtl:: const ::rtl::OUString& aPrefix, SbxObjectRef xScopeObj ); #include +#include SbxVariable* getDefaultProp( SbxVariable* pRef ); @@ -425,9 +426,53 @@ void SbiRuntime::StepPUT() } +// VBA Dim As New behavior handling, save init object information +struct DimAsNewRecoverItem +{ + String m_aObjClass; + String m_aObjName; + SbxObject* m_pObjParent; + SbModule* m_pClassModule; + + DimAsNewRecoverItem( void ) + : m_pObjParent( NULL ) + , m_pClassModule( NULL ) + {} + + DimAsNewRecoverItem( const String& rObjClass, const String& rObjName, + SbxObject* pObjParent, SbModule* pClassModule ) + : m_aObjClass( rObjClass ) + , m_aObjName( rObjName ) + , m_pObjParent( pObjParent ) + , m_pClassModule( pClassModule ) + {} + +}; + + +struct SbxVariablePtrHash +{ + size_t operator()( SbxVariable* pVar ) const + { return (size_t)pVar; } +}; + +typedef std::hash_map< SbxVariable*, DimAsNewRecoverItem, SbxVariablePtrHash > DimAsNewRecoverHash; + +static DimAsNewRecoverHash GaDimAsNewRecoverHash; + +void removeDimAsNewRecoverItem( SbxVariable* pVar ) +{ + DimAsNewRecoverHash::iterator it = GaDimAsNewRecoverHash.find( pVar ); + if( it != GaDimAsNewRecoverHash.end() ) + GaDimAsNewRecoverHash.erase( it ); +} + + // Speichern Objektvariable // Nicht-Objekt-Variable fuehren zu Fehlern +static const char pCollectionStr[] = "Collection"; + void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, bool bHandleDefaultProp ) { // #67733 Typen mit Array-Flag sind auch ok @@ -530,6 +575,12 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b } } + // Handle Dim As New + BOOL bDimAsNew = bVBAEnabled && refVar->IsSet( SBX_DIM_AS_NEW ); + SbxBaseRef xPrevVarObj; + if( bDimAsNew ) + xPrevVarObj = refVar->GetObject(); + // Handle withevents BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); if ( bWithEvents ) @@ -558,6 +609,68 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b *refVar = *refVal; } + if ( bDimAsNew ) + { + if( !refVar->ISA(SbxObject) ) + { + SbxBase* pValObjBase = refVal->GetObject(); + if( pValObjBase == NULL ) + { + if( xPrevVarObj.Is() ) + { + // Object is overwritten with NULL, instantiate init object + DimAsNewRecoverHash::iterator it = GaDimAsNewRecoverHash.find( refVar ); + if( it != GaDimAsNewRecoverHash.end() ) + { + const DimAsNewRecoverItem& rItem = it->second; + if( rItem.m_pClassModule != NULL ) + { + SbClassModuleObject* pNewObj = new SbClassModuleObject( rItem.m_pClassModule ); + pNewObj->SetName( rItem.m_aObjName ); + pNewObj->SetParent( rItem.m_pObjParent ); + refVar->PutObject( pNewObj ); + } + else if( rItem.m_aObjClass.EqualsIgnoreCaseAscii( pCollectionStr ) ) + { + BasicCollection* pNewCollection = new BasicCollection( String( RTL_CONSTASCII_USTRINGPARAM(pCollectionStr) ) ); + pNewCollection->SetName( rItem.m_aObjName ); + pNewCollection->SetParent( rItem.m_pObjParent ); + refVar->PutObject( pNewCollection ); + } + } + } + } + else + { + // Does old value exist? + bool bFirstInit = !xPrevVarObj.Is(); + if( bFirstInit ) + { + // Store information to instantiate object later + SbxObject* pValObj = PTR_CAST(SbxObject,pValObjBase); + if( pValObj != NULL ) + { + String aObjClass = pValObj->GetClassName(); + + SbClassModuleObject* pClassModuleObj = PTR_CAST(SbClassModuleObject,pValObjBase); + if( pClassModuleObj != NULL ) + { + SbModule* pClassModule = pClassModuleObj->getClassModule(); + GaDimAsNewRecoverHash[refVar] = + DimAsNewRecoverItem( aObjClass, pValObj->GetName(), pValObj->GetParent(), pClassModule ); + } + else if( aObjClass.EqualsIgnoreCaseAscii( "Collection" ) ) + { + GaDimAsNewRecoverHash[refVar] = + DimAsNewRecoverItem( aObjClass, pValObj->GetName(), pValObj->GetParent(), NULL ); + } + } + } + } + } + } + + // lhs is a property who's value is currently (Empty e.g. no broadcast yet) // in this case if there is a default prop involved the value of the // default property may infact be void so the type will also be SbxEMPTY diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index dd511a2dfe10..ebc494305f81 100755 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -1119,12 +1119,24 @@ void SbiRuntime::StepTCREATE( UINT32 nOp1, UINT32 nOp2 ) PushVar( pNew ); } -void SbiRuntime::implCreateFixedString( SbxVariable* pStrVar, UINT32 nOp2 ) +void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, UINT32 nOp2 ) { - USHORT nCount = static_cast( nOp2 >> 17 ); // len = all bits above 0x10000 - String aStr; - aStr.Fill( nCount, 0 ); - pStrVar->PutString( aStr ); + bool bWithEvents = ((t & 0xff) == SbxOBJECT && (nOp2 & SBX_TYPE_WITH_EVENTS_FLAG) != 0); + if( bWithEvents ) + pVar->SetFlag( SBX_WITH_EVENTS ); + + bool bDimAsNew = ((nOp2 & SBX_TYPE_DIM_AS_NEW_FLAG) != 0); + if( bDimAsNew ) + pVar->SetFlag( SBX_DIM_AS_NEW ); + + bool bFixedString = ((t & 0xff) == SbxSTRING && (nOp2 & SBX_FIXED_LEN_STRING_FLAG) != 0); + if( bFixedString ) + { + USHORT nCount = static_cast( nOp2 >> 17 ); // len = all bits above 0x10000 + String aStr; + aStr.Fill( nCount, 0 ); + pVar->PutString( aStr ); + } } // Einrichten einer lokalen Variablen (+StringID+Typ) @@ -1139,12 +1151,7 @@ void SbiRuntime::StepLOCAL( UINT32 nOp1, UINT32 nOp2 ) SbxDataType t = (SbxDataType)(nOp2 & 0xffff); SbxVariable* p = new SbxVariable( t ); p->SetName( aName ); - bool bWithEvents = ((t & 0xff) == SbxOBJECT && (nOp2 & SBX_TYPE_WITH_EVENTS_FLAG) != 0); - if( bWithEvents ) - p->SetFlag( SBX_WITH_EVENTS ); - bool bFixedString = ((t & 0xff) == SbxSTRING && (nOp2 & SBX_FIXED_LEN_STRING_FLAG) != 0); - if( bFixedString ) - implCreateFixedString( p, nOp2 ); + implHandleSbxFlags( p, t, nOp2 ); refLocals->Put( p, refLocals->Count() ); } } @@ -1171,12 +1178,7 @@ void SbiRuntime::StepPUBLIC_Impl( UINT32 nOp1, UINT32 nOp2, bool bUsedForClassMo // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' pProp->SetFlag( SBX_NO_MODIFY); - bool bWithEvents = ((t & 0xff) == SbxOBJECT && (nOp2 & SBX_TYPE_WITH_EVENTS_FLAG) != 0); - if( bWithEvents ) - pProp->SetFlag( SBX_WITH_EVENTS ); - bool bFixedString = ((t & 0xff) == SbxSTRING && (nOp2 & SBX_FIXED_LEN_STRING_FLAG) != 0); - if( bFixedString ) - implCreateFixedString( p, nOp2 ); + implHandleSbxFlags( pProp, t, nOp2 ); } } diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index b2b67fe3774f..6628973b29e8 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -112,6 +112,9 @@ SbxObject::~SbxObject() CheckParentsOnDelete( this, pProps ); CheckParentsOnDelete( this, pMethods ); CheckParentsOnDelete( this, pObjs ); + + // avoid handling in ~SbxVariable as SBX_DIM_AS_NEW == SBX_GBLSEARCH + ResetFlag( SBX_DIM_AS_NEW ); } SbxDataType SbxObject::GetType() const diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 45342a015194..12a6d29672a9 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -136,6 +136,8 @@ SbxVariable::SbxVariable( SbxDataType t, void* p ) : SbxValue( t, p ) #endif } +void removeDimAsNewRecoverItem( SbxVariable* pVar ); + SbxVariable::~SbxVariable() { #ifdef DBG_UTIL @@ -146,6 +148,8 @@ SbxVariable::~SbxVariable() maName.AssignAscii( aCellsStr, sizeof( aCellsStr )-1 ); GetSbxData_Impl()->aVars.Remove( this ); #endif + if( IsSet( SBX_DIM_AS_NEW )) + removeDimAsNewRecoverItem( this ); delete mpSbxVariableImpl; delete pCst; } -- cgit v1.2.3 From 36d96fd76fa6843b42655a78db872c8c83ac69e9 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Mon, 20 Sep 2010 09:48:40 +0200 Subject: mib19: #163651# Fixed initialize handling for form modules --- basic/inc/basic/sbobjmod.hxx | 7 ++++++- basic/source/classes/sb.cxx | 13 ++++++++++++- basic/source/classes/sbxmod.cxx | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx index a8e650e43d87..49fefb79309e 100644 --- a/basic/inc/basic/sbobjmod.hxx +++ b/basic/inc/basic/sbobjmod.hxx @@ -89,7 +89,7 @@ public: SbUserFormModule( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat ); virtual ~SbUserFormModule(); virtual SbxVariable* Find( const XubString& rName, SbxClassType t ); - void ResetApiObj(); + void ResetApiObj( bool bTriggerTerminateEvent = true ); void Unload(); void Load(); void triggerMethod( const String& ); @@ -101,6 +101,11 @@ public: void triggerLayoutEvent(); void triggerResizeEvent(); + bool getInitState( void ) + { return mbInit; } + void setInitState( bool bInit ) + { mbInit = bInit; } + class SbUserFormModuleInstance* CreateInstance(); }; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 1b82325392b6..00a198f19a72 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -347,7 +347,18 @@ SbxObject* SbFormFactory::CreateObject( const String& rClassName ) { if( SbUserFormModule* pFormModule = PTR_CAST( SbUserFormModule, pVar->GetObject() ) ) { - pFormModule->Load(); + bool bInitState = pFormModule->getInitState(); + if( bInitState ) + { + // Not the first instantiate, reset + bool bTriggerTerminateEvent = false; + pFormModule->ResetApiObj( bTriggerTerminateEvent ); + pFormModule->setInitState( false ); + } + else + { + pFormModule->Load(); + } return pFormModule->CreateInstance(); } } diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 3204e7681088..1e40fd8d5e2d 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -2301,9 +2301,9 @@ SbUserFormModule::~SbUserFormModule() { } -void SbUserFormModule::ResetApiObj() +void SbUserFormModule::ResetApiObj( bool bTriggerTerminateEvent ) { - if ( m_xDialog.is() ) // probably someone close the dialog window + if ( bTriggerTerminateEvent && m_xDialog.is() ) // probably someone close the dialog window { triggerTerminateEvent(); } -- cgit v1.2.3 From 9db83275b83efc4ce0228891a30418f133b01c06 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Tue, 21 Sep 2010 08:58:34 +0200 Subject: mib19: #163689# On deletion of doc basic clear dependencies in other basic instances --- basic/inc/basic/sbmod.hxx | 3 +++ basic/inc/basic/sbstar.hxx | 2 ++ basic/source/classes/sb.cxx | 50 ++++++++++++++++++++++++++++++++++++ basic/source/classes/sbxmod.cxx | 56 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 110 insertions(+), 1 deletion(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index d9f3fd0cde24..fc58817270f2 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -61,6 +61,8 @@ class SbModule : public SbxObject SbModuleImpl* mpSbModuleImpl; // Impl data std::vector< String > mModuleVariableNames; + void implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ); + protected: com::sun::star::uno::Reference< com::sun::star::script::XInvocation > mxWrapper; ::rtl::OUString aOUSource; @@ -83,6 +85,7 @@ protected: USHORT Run( SbMethod* ); void RunInit(); void ClearPrivateVars(); + void ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic ); void GlobalRunInit( BOOL bBasicStart ); // for all modules void GlobalRunDeInit( void ); const BYTE* FindNextStmnt( const BYTE*, USHORT&, USHORT& ) const; diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index 227ca4d080c1..0d348c6ef141 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -79,6 +79,8 @@ class StarBASIC : public SbxObject SbxObjectRef pVBAGlobals; SbxObject* getVBAGlobals( ); + void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ); + protected: BOOL CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen ); private: diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 507a8ff39001..9ac8dbc91266 100755 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -734,6 +734,9 @@ SbModule* SbClassFactory::FindClass( const String& rClassName ) return pMod; } +typedef std::vector< StarBASIC* > DocBasicVector; +static DocBasicVector GaDocBasics; + StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic ) { @@ -763,6 +766,9 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) SetFlag( SBX_GBLSEARCH ); pVBAGlobals = NULL; bQuit = FALSE; + + if( bDocBasic ) + GaDocBasics.push_back( this ); } // #51727 Override SetModified so that the modified state @@ -802,6 +808,29 @@ StarBASIC::~StarBASIC() } #endif } + else if( bDocBasic ) + { + SbxError eOld = SbxBase::GetError(); + + DocBasicVector::iterator it; + for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it ) + { + if( *it == this ) + { + GaDocBasics.erase( it ); + break; + } + } + for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it ) + { + StarBASIC* pBasic = *it; + pBasic->implClearDependingVarsOnDelete( this ); + } + + SbxBase::ResetError(); + if( eOld != SbxERR_OK ) + SbxBase::SetError( eOld ); + } // #100326 Set Parent NULL in registered listeners if( xUnoListeners.Is() ) @@ -835,6 +864,27 @@ void StarBASIC::operator delete( void* p ) ::operator delete( p ); } +void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ) +{ + if( this != pDeletedBasic ) + { + for( USHORT i = 0; i < pModules->Count(); i++ ) + { + SbModule* p = (SbModule*)pModules->Get( i ); + p->ClearVarsDependingOnDeletedBasic( pDeletedBasic ); + } + } + + for( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + { + SbxVariable* pVar = pObjs->Get( nObj ); + StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); + if( pBasic && pBasic != pDeletedBasic ) + pBasic->implClearDependingVarsOnDelete( pDeletedBasic ); + } +} + + /************************************************************************** * * Creation/Managment of modules diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 1e40fd8d5e2d..4ed40baf408a 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1334,6 +1334,61 @@ void SbModule::ClearPrivateVars() } } +void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ) +{ + if( pVar->SbxValue::GetType() != SbxOBJECT || pVar->ISA( SbProcedureProperty ) ) + return; + + SbxObject* pObj = PTR_CAST(SbxObject,pVar->GetObject()); + if( pObj != NULL ) + { + SbxObject* p = pObj; + + SbModule* pMod = PTR_CAST( SbModule, p ); + if( pMod != NULL ) + pMod->ClearVarsDependingOnDeletedBasic( pDeletedBasic ); + + while( (p = p->GetParent()) != NULL ) + { + StarBASIC* pBasic = PTR_CAST( StarBASIC, p ); + if( pBasic != NULL && pBasic == pDeletedBasic ) + { + pVar->SbxValue::Clear(); + break; + } + } + } +} + +void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic ) +{ + (void)pDeletedBasic; + + for( USHORT i = 0 ; i < pProps->Count() ; i++ ) + { + SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) ); + if( p ) + { + if( p->GetType() & SbxARRAY ) + { + SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject()); + if( pArray ) + { + for( USHORT j = 0 ; j < pArray->Count() ; j++ ) + { + SbxVariable* pVar = PTR_CAST(SbxVariable,pArray->Get( j )); + implClearIfVarDependsOnDeletedBasic( pVar, pDeletedBasic ); + } + } + } + else + { + implClearIfVarDependsOnDeletedBasic( p, pDeletedBasic ); + } + } + } +} + // Zunaechst in dieses Modul, um 358-faehig zu bleiben // (Branch in sb.cxx vermeiden) void StarBASIC::ClearAllModuleVars( void ) @@ -2494,7 +2549,6 @@ void SbUserFormModule::InitObject() { try { - String aHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); SbUnoObject* pGlobs = (SbUnoObject*)GetParent()->Find( aHook, SbxCLASS_DONTCARE ); if ( m_xModel.is() && pGlobs ) -- cgit v1.2.3 From 875cfd6a3e7a21475b6f2c72be854811c10eed71 Mon Sep 17 00:00:00 2001 From: Bartosz Kosiorek Date: Thu, 7 Oct 2010 22:07:22 +0200 Subject: svarray: #i112395#: SbiBreakpoints migrate to deque --- basic/inc/basic/sbmod.hxx | 8 ++++--- basic/inc/basic/sbstar.hxx | 1 - basic/source/classes/sbxmod.cxx | 47 ++++++++++++++++++----------------------- 3 files changed, 25 insertions(+), 31 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index cf888adf9dcf..d926b1667ecd 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -33,10 +33,12 @@ #include #include +#include + class SbMethod; class SbProperty; class SbiRuntime; -class SbiBreakpoints; +typedef std::deque< USHORT > SbiBreakpoints; class SbiImage; class SbProcedureProperty; class SbIfaceMapperMethod; @@ -109,8 +111,8 @@ public: const SbxObject* FindType( String aTypeName ) const; virtual BOOL IsBreakable( USHORT nLine ) const; - virtual USHORT GetBPCount() const; - virtual USHORT GetBP( USHORT n ) const; + virtual size_t GetBPCount() const; + virtual USHORT GetBP( size_t n ) const; virtual BOOL IsBP( USHORT nLine ) const; virtual BOOL SetBP( USHORT nLine ); virtual BOOL ClearBP( USHORT nLine ); diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index a234dc206ec7..7d189c363364 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -44,7 +44,6 @@ class SbiInstance; // runtime instance class SbiRuntime; // currently running procedure class SbiImage; // compiled image class BasicLibInfo; // info block for basic manager -class SbiBreakpoints; class SbTextPortions; class SbMethod; class BasicManager; diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 943c9fabee8c..c85d206fdef1 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -95,10 +95,6 @@ TYPEINIT1(SbJScriptMethod,SbMethod) TYPEINIT1(SbObjModule,SbModule) TYPEINIT1(SbUserFormModule,SbObjModule) -SV_DECL_VARARR(SbiBreakpoints,USHORT,4,4) -SV_IMPL_VARARR(SbiBreakpoints,USHORT) - - typedef std::vector HighlightPortions; bool getDefaultVBAMode( StarBASIC* pb ) @@ -1066,15 +1062,15 @@ BOOL SbModule::IsBreakable( USHORT nLine ) const return FALSE; } -USHORT SbModule::GetBPCount() const +size_t SbModule::GetBPCount() const { - return pBreaks ? pBreaks->Count() : 0; + return pBreaks ? pBreaks->size() : 0; } -USHORT SbModule::GetBP( USHORT n ) const +USHORT SbModule::GetBP( size_t n ) const { - if( pBreaks && n < pBreaks->Count() ) - return pBreaks->GetObject( n ); + if( pBreaks && n < pBreaks->size() ) + return pBreaks->operator[]( n ); else return 0; } @@ -1083,11 +1079,9 @@ BOOL SbModule::IsBP( USHORT nLine ) const { if( pBreaks ) { - const USHORT* p = pBreaks->GetData(); - USHORT n = pBreaks->Count(); - for( USHORT i = 0; i < n; i++, p++ ) + for( size_t i = 0; i < pBreaks->size(); i++ ) { - USHORT b = *p; + USHORT b = pBreaks->operator[]( i ); if( b == nLine ) return TRUE; if( b < nLine ) @@ -1103,18 +1097,16 @@ BOOL SbModule::SetBP( USHORT nLine ) return FALSE; if( !pBreaks ) pBreaks = new SbiBreakpoints; - const USHORT* p = pBreaks->GetData(); - USHORT n = pBreaks->Count(); - USHORT i; - for( i = 0; i < n; i++, p++ ) + size_t i; + for( i = 0; i < pBreaks->size(); i++ ) { - USHORT b = *p; + USHORT b = pBreaks->operator[]( i ); if( b == nLine ) return TRUE; if( b < nLine ) break; } - pBreaks->Insert( &nLine, 1, i ); + pBreaks->insert( pBreaks->begin() + i, nLine ); // #38568: Zur Laufzeit auch hier SbDEBUG_BREAK setzen if( pINST && pINST->pRun ) @@ -1128,19 +1120,19 @@ BOOL SbModule::ClearBP( USHORT nLine ) BOOL bRes = FALSE; if( pBreaks ) { - const USHORT* p = pBreaks->GetData(); - USHORT n = pBreaks->Count(); - for( USHORT i = 0; i < n; i++, p++ ) + for( size_t i = 0; i < pBreaks->size(); i++ ) { - USHORT b = *p; + USHORT b = pBreaks->operator[]( i ); if( b == nLine ) { - pBreaks->Remove( i, 1 ); bRes = TRUE; break; + pBreaks->erase( pBreaks->begin() + i ); + bRes = TRUE; + break; } if( b < nLine ) break; } - if( !pBreaks->Count() ) + if( pBreaks->empty() ) delete pBreaks, pBreaks = NULL; } return bRes; @@ -1148,7 +1140,8 @@ BOOL SbModule::ClearBP( USHORT nLine ) void SbModule::ClearAllBP() { - delete pBreaks; pBreaks = NULL; + delete pBreaks; + pBreaks = NULL; } void @@ -1176,7 +1169,7 @@ BOOL SbModule::LoadData( SvStream& rStrm, USHORT nVer ) Clear(); if( !SbxObject::LoadData( rStrm, 1 ) ) return FALSE; - // Sicherheitshalber... + // Precaution... SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH ); BYTE bImage; rStrm >> bImage; -- cgit v1.2.3 From 8241bf7c831b07bc19509387f1514c42bc5624c1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 1 Nov 2010 21:50:46 +0100 Subject: undoapi: - introduced BasicManager::HasMacro/ExecuteMacro - removed SfxQueryMacro, superseded by BasicManager::ExecuteMacro - removed macrconf.hxx - removed SfxObjectShell::CallScript, migrated the only client to BasicManager::HasMacro/SfxObjectShell::CallXScript - removed SfxObjectShell::CallStarBasicScript, migrated the only client to SfxObjectShell::CallXScript --- basic/inc/basic/basmgr.hxx | 7 +++ basic/source/basmgr/basmgr.cxx | 112 +++++++++++++++++++++++++++++++++++++ sfx2/inc/sfx2/objsh.hxx | 22 -------- sfx2/inc/sfxbasic.hxx | 39 ------------- sfx2/source/appl/app.cxx | 17 +----- sfx2/source/appl/appserv.cxx | 1 - sfx2/source/appl/appuno.cxx | 53 ++---------------- sfx2/source/bastyp/fltfnc.cxx | 1 - sfx2/source/control/macrconf.cxx | 88 ----------------------------- sfx2/source/control/makefile.mk | 1 - sfx2/source/control/shell.cxx | 1 - sfx2/source/doc/objmisc.cxx | 74 ------------------------ svx/source/form/fmscriptingenv.cxx | 83 +++++++-------------------- 13 files changed, 146 insertions(+), 353 deletions(-) delete mode 100644 sfx2/inc/sfxbasic.hxx delete mode 100644 sfx2/source/control/macrconf.cxx (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx index 5c62c347fbdd..720a6efd2182 100644 --- a/basic/inc/basic/basmgr.hxx +++ b/basic/inc/basic/basmgr.hxx @@ -237,6 +237,13 @@ public: */ bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< rtl::OUString >& _out_rModuleNames ); + /// determines whether the Basic Manager has a given macro, given by fully qualified name + bool HasMacro( String const& i_fullyQualifiedName ) const; + /// executes a given macro + ErrCode ExecuteMacro( String const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue ); + /// executes a given macro + ErrCode ExecuteMacro( String const& i_fullyQualifiedName, String const& i_commaSeparatedArgs, SbxValue* i_retValue ); + private: BOOL IsReference( USHORT nLib ); diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 84763468e64c..a491b957fef6 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -42,6 +42,8 @@ #include #include #include +#include +#include #include #include @@ -1868,6 +1870,116 @@ bool BasicManager::LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequen return false; } + +namespace +{ + SbMethod* lcl_queryMacro( BasicManager* i_manager, String const& i_fullyQualifiedName ) + { + sal_uInt16 nLast = 0; + String sMacro = i_fullyQualifiedName; + String sLibName = sMacro.GetToken( 0, '.', nLast ); + String sModule = sMacro.GetToken( 0, '.', nLast ); + sMacro.Erase( 0, nLast ); + + IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); + const CollatorWrapper* pCollator = aIntlWrapper.getCollator(); + sal_uInt16 nLibCount = i_manager->GetLibCount(); + for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib ) + { + if ( COMPARE_EQUAL == pCollator->compareString( i_manager->GetLibName( nLib ), sLibName ) ) + { + StarBASIC* pLib = i_manager->GetLib( nLib ); + if( !pLib ) + { + i_manager->LoadLib( nLib ); + pLib = i_manager->GetLib( nLib ); + } + + if( pLib ) + { + sal_uInt16 nModCount = pLib->GetModules()->Count(); + for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod ) + { + SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); + if ( pMod && COMPARE_EQUAL == pCollator->compareString( pMod->GetName(), sModule ) ) + { + SbMethod* pMethod = (SbMethod*)pMod->Find( sMacro, SbxCLASS_METHOD ); + if( pMethod ) + return pMethod; + } + } + } + } + } + return 0; + } +} + +bool BasicManager::HasMacro( String const& i_fullyQualifiedName ) const +{ + return ( NULL != lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) ); +} + +ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue ) +{ + SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName ); + ErrCode nError = 0; + if ( pMethod ) + { + if ( i_arguments ) + pMethod->SetParameters( i_arguments ); + nError = pMethod->Call( i_retValue ); + } + else + nError = ERRCODE_BASIC_PROC_UNDEFINED; + return nError; +} + +ErrCode BasicManager::ExecuteMacro( String const& i_fullyQualifiedName, String const& i_commaSeparatedArgs, SbxValue* i_retValue ) +{ + SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName ); + if ( !pMethod ) + return ERRCODE_BASIC_PROC_UNDEFINED; + + // arguments must be quoted + String sQuotedArgs; + String sArgs( i_commaSeparatedArgs ); + if ( sArgs.Len()<2 || sArgs.GetBuffer()[1] == '\"') + // no args or already quoted args + sQuotedArgs = sArgs; + else + { + // quote parameters + sArgs.Erase( 0, 1 ); + sArgs.Erase( sArgs.Len()-1, 1 ); + + sQuotedArgs = '('; + + sal_uInt16 nCount = sArgs.GetTokenCount(','); + for ( sal_uInt16 n=0; nGetName(); + sCall += sQuotedArgs; + sCall += ']'; + + SbxVariable* pRet = pMethod->GetParent()->Execute( sCall ); + if ( pRet ) + *i_retValue = *pRet; + return SbxBase::GetError(); +} + //===================================================================== class ModuleInfo_Impl : public ModuleInfoHelper diff --git a/sfx2/inc/sfx2/objsh.hxx b/sfx2/inc/sfx2/objsh.hxx index 0198a3c3ee75..4fe7f53a7015 100644 --- a/sfx2/inc/sfx2/objsh.hxx +++ b/sfx2/inc/sfx2/objsh.hxx @@ -366,28 +366,6 @@ public: ErrCode CallBasic( const String& rMacro, const String& rBasicName, SbxArray* pArgs = 0, SbxValue* pRet = 0 ); - ErrCode CallScript( - const String & rScriptType, const String & rCode, const void* pArgs = NULL, void* pRet = NULL ); - - /** calls a StarBasic script without magic - @param _rMacroName - specifies the name of the method to execute - @param _rLocation - specifies the location of the script to execute. Allowed values are "application" and "document". - @param _pArguments - This is a pointer to a Sequence< Any >. All elements of the Sequence are wrapped into Basic objects - and passed as arguments to the method specified by _rMacroName - @param _pReturn - If not , the Any pointed to by this argument contains the return value of the (synchronous) call - to the StarBasic macro - */ - ErrCode CallStarBasicScript( - const String& _rMacroName, - const String& _rLocation, - const void* _pArguments = NULL, - void* _pReturn = NULL - ); - ErrCode CallXScript( const String& rScriptURL, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams, diff --git a/sfx2/inc/sfxbasic.hxx b/sfx2/inc/sfxbasic.hxx deleted file mode 100644 index 5c367c52a2d4..000000000000 --- a/sfx2/inc/sfxbasic.hxx +++ /dev/null @@ -1,39 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SFXBASIC_HXX -#define _SFXBASIC_HXX - -class BasicManager; -class SbMethod; -class String; - -//------------------------------------------------------------------ - -SbMethod* SfxQueryMacro( BasicManager* pMgr, const String& rMacro ); - -#endif - diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index c0b426c387bc..1d71e1747bd1 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -36,7 +36,6 @@ #endif // UNX #include -#include "sfxbasic.hxx" #include #include #include @@ -848,19 +847,5 @@ void SfxApplication::MacroOrganizer( INT16 nTabId ) ErrCode SfxApplication::CallBasic( const String& rCode, BasicManager* pMgr, SbxArray* pArgs, SbxValue* pRet ) { - SfxApplication *pApp = SFX_APP(); - pApp->EnterBasicCall(); - SbMethod* pMethod = SfxQueryMacro( pMgr, rCode ); - ErrCode nErr = 0; - if( pMethod ) - { - if ( pArgs ) - pMethod->SetParameters( pArgs ); - nErr = pMethod->Call( pRet ); - } - else - nErr = ERRCODE_BASIC_PROC_UNDEFINED; - - pApp->LeaveBasicCall(); - return nErr; + return pMgr->ExecuteMacro( rCode, pArgs, pRet); } diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 5b2b9c3691ad..01258ac7a56b 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -111,7 +111,6 @@ #include #include #include "sfxtypes.hxx" -#include "sfxbasic.hxx" #include #include "arrdecl.hxx" #include "fltfnc.hxx" diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index 7056cc48a704..ddde2e26c344 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -120,7 +120,6 @@ using namespace ::com::sun::star::io; #include #include "frmload.hxx" #include -#include "sfxbasic.hxx" #include #include #include @@ -1802,35 +1801,8 @@ ErrCode SfxMacroLoader::loadMacro( const ::rtl::OUString& rURL, com::sun::star:: aQualifiedMethod.Erase( nArgsPos - nHashPos - 1 ); } - SbxMethod *pMethod = SfxQueryMacro( pBasMgr, aQualifiedMethod ); - if ( pMethod ) + if ( pBasMgr->HasMacro( aQualifiedMethod ) ) { - // arguments must be quoted - String aQuotedArgs; - if ( aArgs.Len()<2 || aArgs.GetBuffer()[1] == '\"') - // no args or already quoted args - aQuotedArgs = aArgs; - else - { - // quote parameters - aArgs.Erase(0,1); - aArgs.Erase( aArgs.Len()-1,1); - - aQuotedArgs = '('; - - sal_uInt16 nCount = aArgs.GetTokenCount(','); - for ( sal_uInt16 n=0; nGetName(); - aCall += aQuotedArgs; - aCall += ']'; - // just to let the shell be alive SfxObjectShellRef rSh = pSh; - // execute function using its Sbx parent, - //SbxVariable* pRet = pMethod->GetParent()->Execute( aCall ); - //rRetval = sbxToUnoValue( pRet ); - - SbxVariable* pRet = pMethod->GetParent()->Execute( aCall ); - if ( pRet ) - { - USHORT nFlags = pRet->GetFlags(); - pRet->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST ); - rRetval = sbxToUnoValue( pRet ); - pRet->SetFlags( nFlags ); - } + SbxVariableRef retValRef = new SbxVariable; + nErr = pBasMgr->ExecuteMacro( aQualifiedMethod, aArgs, retValRef ); + if ( nErr == ERRCODE_NONE ) + rRetval = sbxToUnoValue( retValRef ); - nErr = SbxBase::GetError(); if ( ( pBasMgr == pAppMgr ) && pSh ) { pAppMgr->SetGlobalUNOConstant( "ThisComponent", aOldThisComponent ); diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index d11b8b5130ed..11ff8d666964 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -111,7 +111,6 @@ using namespace ::vos; #include #include "sfxhelp.hxx" -#include "sfxbasic.hxx" #include #include #include "sfxtypes.hxx" diff --git a/sfx2/source/control/macrconf.cxx b/sfx2/source/control/macrconf.cxx deleted file mode 100644 index 30d8cd7a026f..000000000000 --- a/sfx2/source/control/macrconf.cxx +++ /dev/null @@ -1,88 +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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_sfx2.hxx" - -#include "sfxbasic.hxx" - -#include -#include -#include -#include -#include -#include - -//========================================================================== - -SbMethod* SfxQueryMacro_Impl( BasicManager* pMgr , const String& rMacro, - const String &rLibName, const String& rModule ) -{ - IntlWrapper aIntlWrapper( ::comphelper::getProcessServiceFactory(), Application::GetSettings().GetLocale() ); - const CollatorWrapper* pCollator = aIntlWrapper.getCollator(); - sal_uInt16 nLibCount = pMgr->GetLibCount(); - for ( sal_uInt16 nLib = 0; nLib < nLibCount; ++nLib ) - { - if ( COMPARE_EQUAL == pCollator->compareString( pMgr->GetLibName( nLib ), rLibName ) ) - { - StarBASIC* pLib = pMgr->GetLib( nLib ); - if( !pLib ) - { - pMgr->LoadLib( nLib ); - pLib = pMgr->GetLib( nLib ); - } - - if( pLib ) - { - sal_uInt16 nModCount = pLib->GetModules()->Count(); - for( sal_uInt16 nMod = 0; nMod < nModCount; ++nMod ) - { - SbModule* pMod = (SbModule*)pLib->GetModules()->Get( nMod ); - if ( pMod && COMPARE_EQUAL == pCollator->compareString( pMod->GetName(), rModule ) ) - { - SbMethod* pMethod = (SbMethod*)pMod->Find( rMacro, SbxCLASS_METHOD ); - if( pMethod ) - return pMethod; - } - } - } - } - } - return 0; -} - -SbMethod* SfxQueryMacro( BasicManager* pMgr , const String& rMacro ) -{ - sal_uInt16 nLast = 0; - String aMacro = rMacro; - String aLibName = aMacro.GetToken( 0, '.', nLast ); - String aModule = aMacro.GetToken( 0, '.', nLast ); - aMacro.Erase( 0, nLast ); - - return SfxQueryMacro_Impl( pMgr, aMacro, aLibName, aModule ); -} - diff --git a/sfx2/source/control/makefile.mk b/sfx2/source/control/makefile.mk index 86797589e3aa..7211bc409ca3 100644 --- a/sfx2/source/control/makefile.mk +++ b/sfx2/source/control/makefile.mk @@ -53,7 +53,6 @@ SLOFILES = \ $(SLO)$/bindings.obj \ $(SLO)$/ctrlitem.obj \ $(SLO)$/dispatch.obj \ - $(SLO)$/macrconf.obj \ $(SLO)$/macro.obj \ $(SLO)$/minfitem.obj \ $(SLO)$/msg.obj \ diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index 55486c39f53a..d1605754680a 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -46,7 +46,6 @@ #include #include #include -#include "sfxbasic.hxx" #include #include #include diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 3d1d495aef00..01c1eb558432 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1800,80 +1800,6 @@ namespace { *static_cast< Any* >( _pAny ) = sbxToUnoValue( _rBasicValue ); } } -//------------------------------------------------------------------------- -ErrCode SfxObjectShell::CallStarBasicScript( const String& _rMacroName, const String& _rLocation, - const void* _pArguments, void* _pReturn ) -{ - OSL_TRACE("in CallSBS"); - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); - - // the arguments for the call - SbxArrayRef xMacroArguments = lcl_translateUno2Basic( _pArguments ); - - // the return value - SbxVariableRef xReturn = _pReturn ? new SbxVariable : NULL; - - // the location (document or application) - String sMacroLocation; - if ( _rLocation.EqualsAscii( "application" ) ) - sMacroLocation = SFX_APP()->GetName(); -#ifdef DBG_UTIL - else - DBG_ASSERT( _rLocation.EqualsAscii( "document" ), - "SfxObjectShell::CallStarBasicScript: invalid (unknown) location!" ); -#endif - - // call the script - ErrCode eError = CallBasic( _rMacroName, sMacroLocation, xMacroArguments, xReturn ); - - // translate the return value - lcl_translateBasic2Uno( xReturn, _pReturn ); - - // outta here - return eError; -} - -//------------------------------------------------------------------------- -ErrCode SfxObjectShell::CallScript( - const String & rScriptType, - const String & rCode, - const void *pArgs, - void *pRet -) -{ - ::vos::OClearableGuard aGuard( Application::GetSolarMutex() ); - ErrCode nErr = ERRCODE_NONE; - if( rScriptType.EqualsAscii( "StarBasic" ) ) - { - // the arguments for the call - SbxArrayRef xMacroArguments = lcl_translateUno2Basic( pArgs ); - - // the return value - SbxVariableRef xReturn = pRet ? new SbxVariable : NULL; - - // call the script - nErr = CallBasic( rCode, String(), xMacroArguments, xReturn ); - - // translate the return value - lcl_translateBasic2Uno( xReturn, pRet ); - - // did this fail because the method was not found? - if ( nErr == ERRCODE_BASIC_PROC_UNDEFINED ) - { // yep-> look in the application BASIC module - nErr = CallBasic( rCode, SFX_APP()->GetName(), xMacroArguments, xReturn ); - } - } - else if( rScriptType.EqualsAscii( "JavaScript" ) ) - { - DBG_ERROR( "JavaScript not allowed" ); - return 0; - } - else - { - DBG_ERROR( "StarScript not allowed" ); - } - return nErr; -} SfxFrame* SfxObjectShell::GetSmartSelf( SfxFrame* pSelf, SfxMedium& /*rMedium*/ ) { diff --git a/svx/source/form/fmscriptingenv.cxx b/svx/source/form/fmscriptingenv.cxx index 154999333296..f351dba85815 100644 --- a/svx/source/form/fmscriptingenv.cxx +++ b/svx/source/form/fmscriptingenv.cxx @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" #include "fmscriptingenv.hxx" -#include +#include "svx/fmmodel.hxx" /** === begin UNO includes === **/ #include @@ -37,6 +37,7 @@ #include #include /** === end UNO includes === **/ + #include #include #include @@ -45,6 +46,8 @@ #include #include #include +#include +#include #include @@ -416,60 +419,6 @@ namespace svxform m_rObjectShell.CallXScript( m_sScriptCode, _rArguments, _rSynchronousResult, aOutArgsIndex, aOutArgs ); } - - //................................................................ - //. QualifiedBasicScript - //................................................................ - class QualifiedBasicScript : public IScript - { - SfxObjectShell& m_rObjectShell; - const ::rtl::OUString m_sMacroLocation; - const ::rtl::OUString m_sScriptCode; - - public: - QualifiedBasicScript( SfxObjectShell& _rObjectShell, const ::rtl::OUString& _rLocation, const ::rtl::OUString& _rScriptCode ) - :m_rObjectShell( _rObjectShell ) - ,m_sMacroLocation( _rLocation ) - ,m_sScriptCode( _rScriptCode ) - { - } - - // IScript - virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult ); - }; - - //................................................................ - void QualifiedBasicScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult ) - { - m_rObjectShell.CallStarBasicScript( m_sScriptCode, m_sMacroLocation, - &_rArguments, &_rSynchronousResult ); - } - - //................................................................ - //. UnqualifiedBasicScript - //................................................................ - class UnqualifiedBasicScript : public IScript - { - SfxObjectShell& m_rObjectShell; - const ::rtl::OUString m_sScriptCode; - - public: - UnqualifiedBasicScript( SfxObjectShell& _rObjectShell, const ::rtl::OUString& _rScriptCode ) - :m_rObjectShell( _rObjectShell ) - ,m_sScriptCode( _rScriptCode ) - { - } - - // IScript - virtual void invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult ); - }; - - //................................................................ - void UnqualifiedBasicScript::invoke( const Sequence< Any >& _rArguments, Any& _rSynchronousResult ) - { - m_rObjectShell.CallScript( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StarBasic" ) ), m_sScriptCode, - &_rArguments, &_rSynchronousResult ); - } } //-------------------------------------------------------------------- @@ -513,14 +462,24 @@ namespace svxform sScriptCode = sScriptCode.copy( nPrefixLen + 1 ); } - if ( sMacroLocation.getLength() ) - { // we have a StarBasic macro with fully-qualified macro location - pScript.reset( new QualifiedBasicScript( *xObjectShell, sMacroLocation, sScriptCode ) ); - } - else - { // we have a StarBasic macro without qualified location - let the object shell gues .... - pScript.reset( new UnqualifiedBasicScript( *xObjectShell, sScriptCode ) ); + if ( !sMacroLocation.getLength() ) + { + // legacy format: use the app-wide Basic, if it has a respective method, otherwise fall back to the doc's Basic + if ( SFX_APP()->GetBasicManager()->HasMacro( sScriptCode ) ) + sMacroLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "application" ) ); + else + sMacroLocation = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "document" ) ); } + + ::rtl::OUStringBuffer aScriptURI; + aScriptURI.appendAscii( "vnd.sun.star.script:" ); + aScriptURI.append( sScriptCode ); + aScriptURI.appendAscii( "?language=Basic" ); + aScriptURI.appendAscii( "&location=" ); + aScriptURI.append( sMacroLocation ); + + const ::rtl::OUString sScriptURI( aScriptURI.makeStringAndClear() ); + pScript.reset( new NewStyleUNOScript( *xObjectShell, sScriptURI ) ); } OSL_ENSURE( pScript.get(), "FormScriptingEnvironment::doFireScriptEvent: no script to execute!" ); -- cgit v1.2.3 From 642cfe8ac206af4fe82bc695d38b5c7f0edf7dc7 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Mon, 10 Jan 2011 14:40:57 +0100 Subject: removetooltypes01: #i112600# adjust basic and scaddins --- basic/inc/basic/basicrt.hxx | 12 +- basic/inc/basic/basmgr.hxx | 64 ++-- basic/inc/basic/basrdll.hxx | 8 +- basic/inc/basic/mybasic.hxx | 14 +- basic/inc/basic/process.hxx | 16 +- basic/inc/basic/sberrors.hxx | 2 +- basic/inc/basic/sbmeth.hxx | 22 +- basic/inc/basic/sbmod.hxx | 62 ++-- basic/inc/basic/sbobjmod.hxx | 2 +- basic/inc/basic/sbprop.hxx | 2 +- basic/inc/basic/sbstar.hxx | 82 ++--- basic/inc/basic/sbstdobj.hxx | 60 ++-- basic/inc/basic/sbx.hxx | 102 +++--- basic/inc/basic/sbxcore.hxx | 104 +++--- basic/inc/basic/sbxdef.hxx | 32 +- basic/inc/basic/sbxfac.hxx | 8 +- basic/inc/basic/sbxform.hxx | 28 +- basic/inc/basic/sbxmeth.hxx | 2 +- basic/inc/basic/sbxmstrm.hxx | 2 +- basic/inc/basic/sbxobj.hxx | 22 +- basic/inc/basic/sbxvar.hxx | 226 ++++++------- basic/inc/basic/testtool.hxx | 14 +- basic/inc/basic/ttstrhlp.hxx | 16 +- basic/source/app/app.cxx | 252 +++++++------- basic/source/app/app.hxx | 44 +-- basic/source/app/appbased.cxx | 36 +- basic/source/app/appbased.hxx | 6 +- basic/source/app/appedit.cxx | 26 +- basic/source/app/appedit.hxx | 8 +- basic/source/app/apperror.cxx | 16 +- basic/source/app/apperror.hxx | 4 +- basic/source/app/appwin.cxx | 118 +++---- basic/source/app/appwin.hxx | 54 +-- basic/source/app/basicrt.cxx | 10 +- basic/source/app/brkpnts.cxx | 52 +-- basic/source/app/brkpnts.hxx | 18 +- basic/source/app/dataedit.hxx | 24 +- basic/source/app/dialogs.cxx | 104 +++--- basic/source/app/dialogs.hxx | 14 +- basic/source/app/msgedit.cxx | 186 +++++------ basic/source/app/msgedit.hxx | 26 +- basic/source/app/mybasic.cxx | 20 +- basic/source/app/printer.cxx | 4 +- basic/source/app/process.cxx | 32 +- basic/source/app/processw.cxx | 40 +-- basic/source/app/processw.hxx | 12 +- basic/source/app/status.cxx | 8 +- basic/source/app/textedit.cxx | 160 ++++----- basic/source/app/textedit.hxx | 32 +- basic/source/basmgr/basicmanagerrepository.cxx | 12 +- basic/source/basmgr/basmgr.cxx | 298 ++++++++--------- basic/source/classes/disas.cxx | 72 ++-- basic/source/classes/eventatt.cxx | 6 +- basic/source/classes/image.cxx | 150 ++++----- basic/source/classes/propacc.cxx | 28 +- basic/source/classes/sb.cxx | 288 ++++++++-------- basic/source/classes/sbintern.cxx | 8 +- basic/source/classes/sbunoobj.cxx | 234 ++++++------- basic/source/classes/sbxmod.cxx | 284 ++++++++-------- basic/source/comp/buffer.cxx | 102 +++--- basic/source/comp/codegen.cxx | 88 ++--- basic/source/comp/dim.cxx | 182 +++++------ basic/source/comp/exprgen.cxx | 16 +- basic/source/comp/exprnode.cxx | 78 ++--- basic/source/comp/exprtree.cxx | 108 +++--- basic/source/comp/io.cxx | 18 +- basic/source/comp/loops.cxx | 62 ++-- basic/source/comp/parser.cxx | 72 ++-- basic/source/comp/sbcomp.cxx | 24 +- basic/source/comp/scanner.cxx | 76 ++--- basic/source/comp/symtbl.cxx | 48 +-- basic/source/comp/token.cxx | 40 +-- basic/source/inc/buffer.hxx | 30 +- basic/source/inc/codegen.hxx | 28 +- basic/source/inc/disas.hxx | 14 +- basic/source/inc/expr.hxx | 84 ++--- basic/source/inc/filefmt.hxx | 108 +++--- basic/source/inc/image.hxx | 44 +-- basic/source/inc/iosys.hxx | 12 +- basic/source/inc/object.hxx | 10 +- basic/source/inc/parser.hxx | 46 +-- basic/source/inc/propacc.hxx | 6 +- basic/source/inc/runtime.hxx | 158 ++++----- basic/source/inc/sbintern.hxx | 12 +- basic/source/inc/sbjsmod.hxx | 4 +- basic/source/inc/sbtrace.hxx | 10 +- basic/source/inc/sbunoobj.hxx | 32 +- basic/source/inc/scanner.hxx | 54 +-- basic/source/inc/stdobj.hxx | 2 +- basic/source/inc/symtbl.hxx | 136 ++++---- basic/source/inc/token.hxx | 32 +- basic/source/runtime/basrdll.cxx | 14 +- basic/source/runtime/ddectrl.cxx | 32 +- basic/source/runtime/ddectrl.hxx | 12 +- basic/source/runtime/dllmgr.cxx | 26 +- basic/source/runtime/inputbox.cxx | 4 +- basic/source/runtime/iosys.cxx | 98 +++--- basic/source/runtime/methods.cxx | 436 ++++++++++++------------- basic/source/runtime/methods1.cxx | 346 ++++++++++---------- basic/source/runtime/props.cxx | 12 +- basic/source/runtime/rtlproto.hxx | 4 +- basic/source/runtime/runtime.cxx | 86 ++--- basic/source/runtime/stdobj.cxx | 24 +- basic/source/runtime/stdobj1.cxx | 60 ++-- basic/source/runtime/step0.cxx | 62 ++-- basic/source/runtime/step1.cxx | 82 ++--- basic/source/runtime/step2.cxx | 162 ++++----- basic/source/sample/collelem.cxx | 2 +- basic/source/sample/object.cxx | 30 +- basic/source/sbx/sbxarray.cxx | 172 +++++----- basic/source/sbx/sbxbase.cxx | 114 +++---- basic/source/sbx/sbxbool.cxx | 34 +- basic/source/sbx/sbxbyte.cxx | 30 +- basic/source/sbx/sbxcoll.cxx | 30 +- basic/source/sbx/sbxconv.hxx | 42 +-- basic/source/sbx/sbxdate.cxx | 14 +- basic/source/sbx/sbxdbl.cxx | 12 +- basic/source/sbx/sbxdec.cxx | 56 ++-- basic/source/sbx/sbxdec.hxx | 22 +- basic/source/sbx/sbxexec.cxx | 28 +- basic/source/sbx/sbxform.cxx | 144 ++++---- basic/source/sbx/sbxint.cxx | 52 +-- basic/source/sbx/sbxlng.cxx | 22 +- basic/source/sbx/sbxobj.cxx | 200 ++++++------ basic/source/sbx/sbxres.cxx | 4 +- basic/source/sbx/sbxres.hxx | 4 +- basic/source/sbx/sbxscan.cxx | 104 +++--- basic/source/sbx/sbxstr.cxx | 14 +- basic/source/sbx/sbxulng.cxx | 20 +- basic/source/sbx/sbxvals.cxx | 34 +- basic/source/sbx/sbxvalue.cxx | 310 +++++++++--------- basic/source/sbx/sbxvar.cxx | 88 ++--- basic/source/uno/dlgcont.cxx | 14 +- basic/source/uno/namecont.cxx | 18 +- basic/source/uno/scriptcont.cxx | 14 +- basic/workben/mgrtest.cxx | 56 ++-- 136 files changed, 4234 insertions(+), 4234 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/basicrt.hxx b/basic/inc/basic/basicrt.hxx index 6d50e1cddc07..7af0e0fe9db7 100644 --- a/basic/inc/basic/basicrt.hxx +++ b/basic/inc/basic/basicrt.hxx @@ -44,8 +44,8 @@ public: xub_StrLen GetLine(); xub_StrLen GetCol1(); xub_StrLen GetCol2(); - BOOL IsRun(); - BOOL IsValid() { return pRun != NULL; } + sal_Bool IsRun(); + sal_Bool IsValid() { return pRun != NULL; } BasicRuntime GetNextRuntime(); }; @@ -67,12 +67,12 @@ class BasicRuntimeAccess public: static BasicRuntime GetRuntime(); static bool HasRuntime(); - static USHORT GetStackEntryCount(); - static BasicErrorStackEntry GetStackEntry( USHORT nIndex ); - static BOOL HasStack(); + static sal_uInt16 GetStackEntryCount(); + static BasicErrorStackEntry GetStackEntry( sal_uInt16 nIndex ); + static sal_Bool HasStack(); static void DeleteStack(); - static BOOL IsRunInit(); + static sal_Bool IsRunInit(); }; #endif diff --git a/basic/inc/basic/basmgr.hxx b/basic/inc/basic/basmgr.hxx index 5c62c347fbdd..da63da89ea81 100644 --- a/basic/inc/basic/basmgr.hxx +++ b/basic/inc/basic/basmgr.hxx @@ -68,21 +68,21 @@ class SotStorage; class BasicError { private: - ULONG nErrorId; - USHORT nReason; + sal_uIntPtr nErrorId; + sal_uInt16 nReason; String aErrStr; public: BasicError(); BasicError( const BasicError& rErr ); - BasicError( ULONG nId, USHORT nR, const String& rErrStr ); + BasicError( sal_uIntPtr nId, sal_uInt16 nR, const String& rErrStr ); - ULONG GetErrorId() const { return nErrorId; } - USHORT GetReason() const { return nReason; } + sal_uIntPtr GetErrorId() const { return nErrorId; } + sal_uInt16 GetReason() const { return nReason; } String GetErrorStr() { return aErrStr; } - void SetErrorId( ULONG n ) { nErrorId = n; } - void SetReason( USHORT n ) { nReason = n; } + void SetErrorId( sal_uIntPtr n ) { nErrorId = n; } + void SetReason( sal_uInt16 n ) { nReason = n; } void SetErrorStr( const String& rStr) { aErrStr = rStr; } }; @@ -146,33 +146,33 @@ private: String aName; String maStorageName; - BOOL bBasMgrModified; - BOOL mbDocMgr; + sal_Bool bBasMgrModified; + sal_Bool mbDocMgr; BasicManagerImpl* mpImpl; void Init(); protected: - BOOL ImpLoadLibary( BasicLibInfo* pLibInfo ) const; - BOOL ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, BOOL bInfosOnly = FALSE ) const; + sal_Bool ImpLoadLibary( BasicLibInfo* pLibInfo ) const; + sal_Bool ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, sal_Bool bInfosOnly = sal_False ) const; void ImpCreateStdLib( StarBASIC* pParentFromStdLib ); void ImpMgrNotLoaded( const String& rStorageName ); BasicLibInfo* CreateLibInfo(); - void LoadBasicManager( SotStorage& rStorage, const String& rBaseURL, BOOL bLoadBasics = TRUE ); + void LoadBasicManager( SotStorage& rStorage, const String& rBaseURL, sal_Bool bLoadBasics = sal_True ); void LoadOldBasicManager( SotStorage& rStorage ); - BOOL ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const; - BOOL ImplEncryptStream( SvStream& rStream ) const; + sal_Bool ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const; + sal_Bool ImplEncryptStream( SvStream& rStream ) const; BasicLibInfo* FindLibInfo( StarBASIC* pBasic ) const; - void CheckModules( StarBASIC* pBasic, BOOL bReference ) const; - void SetFlagToAllLibs( short nFlag, BOOL bSet ) const; + void CheckModules( StarBASIC* pBasic, sal_Bool bReference ) const; + void SetFlagToAllLibs( short nFlag, sal_Bool bSet ) const; BasicManager(); // Nur zum anpassen von Pfaden bei 'Speichern unter'. ~BasicManager(); public: TYPEINFO(); - BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL, BOOL bDocMgr = FALSE ); - BasicManager( StarBASIC* pStdLib, String* pLibPath = NULL, BOOL bDocMgr = FALSE ); + BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib = NULL, String* pLibPath = NULL, sal_Bool bDocMgr = sal_False ); + BasicManager( StarBASIC* pStdLib, String* pLibPath = NULL, sal_Bool bDocMgr = sal_False ); /** deletes the given BasicManager instance @@ -189,12 +189,12 @@ public: String GetName() const { return aName; } - USHORT GetLibCount() const; - StarBASIC* GetLib( USHORT nLib ) const; + sal_uInt16 GetLibCount() const; + StarBASIC* GetLib( sal_uInt16 nLib ) const; StarBASIC* GetLib( const String& rName ) const; - USHORT GetLibId( const String& rName ) const; + sal_uInt16 GetLibId( const String& rName ) const; - String GetLibName( USHORT nLib ); + String GetLibName( sal_uInt16 nLib ); /** announces the library containers which belong to this BasicManager @@ -208,14 +208,14 @@ public: const ::com::sun::star::uno::Reference< com::sun::star::script::XPersistentLibraryContainer >& GetScriptLibraryContainer() const; - BOOL LoadLib( USHORT nLib ); - BOOL RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ); + sal_Bool LoadLib( sal_uInt16 nLib ); + sal_Bool RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage ); // Modify-Flag wird nur beim Speichern zurueckgesetzt. - BOOL IsModified() const; - BOOL IsBasicModified() const; + sal_Bool IsModified() const; + sal_Bool IsBasicModified() const; - BOOL HasErrors(); + sal_Bool HasErrors(); void ClearErrors(); BasicError* GetFirstError(); BasicError* GetNextError(); @@ -238,14 +238,14 @@ public: bool LegacyPsswdBinaryLimitExceeded( ::com::sun::star::uno::Sequence< rtl::OUString >& _out_rModuleNames ); private: - BOOL IsReference( USHORT nLib ); + sal_Bool IsReference( sal_uInt16 nLib ); - BOOL SetLibName( USHORT nLib, const String& rName ); + sal_Bool SetLibName( sal_uInt16 nLib, const String& rName ); StarBASIC* GetStdLib() const; - StarBASIC* AddLib( SotStorage& rStorage, const String& rLibName, BOOL bReference ); - BOOL RemoveLib( USHORT nLib ); - BOOL HasLib( const String& rName ) const; + StarBASIC* AddLib( SotStorage& rStorage, const String& rLibName, sal_Bool bReference ); + sal_Bool RemoveLib( sal_uInt16 nLib ); + sal_Bool HasLib( const String& rName ) const; StarBASIC* CreateLibForLibContainer( const String& rLibName, const com::sun::star::uno::Reference< com::sun::star::script::XLibraryContainer >& diff --git a/basic/inc/basic/basrdll.hxx b/basic/inc/basic/basrdll.hxx index aecf55c26a22..2265bd354ec4 100644 --- a/basic/inc/basic/basrdll.hxx +++ b/basic/inc/basic/basrdll.hxx @@ -38,8 +38,8 @@ private: ResMgr* pSttResMgr; ResMgr* pBasResMgr; - BOOL bDebugMode; - BOOL bBreakEnabled; + sal_Bool bDebugMode; + sal_Bool bBreakEnabled; public: BasicDLL(); @@ -50,8 +50,8 @@ public: static void BasicBreak(); - static void EnableBreak( BOOL bEnable ); - static void SetDebugMode( BOOL bDebugMode ); + static void EnableBreak( sal_Bool bEnable ); + static void SetDebugMode( sal_Bool bDebugMode ); }; #define BASIC_DLL() (*(BasicDLL**)GetAppData( SHL_BASIC ) ) diff --git a/basic/inc/basic/mybasic.hxx b/basic/inc/basic/mybasic.hxx index 02002f43cdd4..9522dbe7b997 100644 --- a/basic/inc/basic/mybasic.hxx +++ b/basic/inc/basic/mybasic.hxx @@ -36,10 +36,10 @@ class ErrorEntry; class BasicError { AppBasEd* pWin; - USHORT nLine, nCol1, nCol2; + sal_uInt16 nLine, nCol1, nCol2; String aText; public: - BasicError( AppBasEd*, USHORT, const String&, USHORT, USHORT, USHORT ); + BasicError( AppBasEd*, sal_uInt16, const String&, sal_uInt16, sal_uInt16, sal_uInt16 ); void Show(); }; @@ -51,8 +51,8 @@ DECLARE_LIST( ErrorList, BasicError* ) class MyBasic : public StarBASIC { SbError nError; - virtual BOOL ErrorHdl(); - virtual USHORT BreakHdl(); + virtual sal_Bool ErrorHdl(); + virtual sal_uInt16 BreakHdl(); protected: Link GenLogHdl(); @@ -70,7 +70,7 @@ public: ErrorList aErrors; MyBasic(); virtual ~MyBasic(); - virtual BOOL Compile( SbModule* ); + virtual sal_Bool Compile( SbModule* ); void Reset(); SbError GetErrors() { return nError; } @@ -80,10 +80,10 @@ public: virtual void LoadIniFile(); // Determines the extended symbol type for syntax highlighting - virtual SbTextType GetSymbolType( const String &Symbol, BOOL bWasTTControl ); + virtual SbTextType GetSymbolType( const String &Symbol, sal_Bool bWasTTControl ); virtual const String GetSpechialErrorText(); virtual void ReportRuntimeError( AppBasEd *pEditWin ); - virtual void DebugFindNoErrors( BOOL bDebugFindNoErrors ); + virtual void DebugFindNoErrors( sal_Bool bDebugFindNoErrors ); static void SetCompileModule( SbModule *pMod ); static SbModule *GetCompileModule(); diff --git a/basic/inc/basic/process.hxx b/basic/inc/basic/process.hxx index 9a593322b896..e683bf527173 100644 --- a/basic/inc/basic/process.hxx +++ b/basic/inc/basic/process.hxx @@ -42,22 +42,22 @@ class Process vos::OArgumentList *pArgumentList; vos::OEnvironment *pEnvList; vos::OProcess *pProcess; - BOOL ImplIsRunning(); + sal_Bool ImplIsRunning(); long ImplGetExitCode(); - BOOL bWasGPF; - BOOL bHasBeenStarted; + sal_Bool bWasGPF; + sal_Bool bHasBeenStarted; public: Process(); ~Process(); // Methoden void SetImage( const String &aAppPath, const String &aAppParams, const Environment *pEnv = NULL ); - BOOL Start(); - ULONG GetExitCode(); - BOOL IsRunning(); - BOOL WasGPF(); + sal_Bool Start(); + sal_uIntPtr GetExitCode(); + sal_Bool IsRunning(); + sal_Bool WasGPF(); - BOOL Terminate(); + sal_Bool Terminate(); }; #endif diff --git a/basic/inc/basic/sberrors.hxx b/basic/inc/basic/sberrors.hxx index c34176e0bde7..4eeb28d43e32 100644 --- a/basic/inc/basic/sberrors.hxx +++ b/basic/inc/basic/sberrors.hxx @@ -31,7 +31,7 @@ #include #ifndef __RSC -typedef ULONG SbError; +typedef sal_uIntPtr SbError; #endif // Mapping to SbxError diff --git a/basic/inc/basic/sbmeth.hxx b/basic/inc/basic/sbmeth.hxx index 4e426ffe8552..fea6644db270 100644 --- a/basic/inc/basic/sbmeth.hxx +++ b/basic/inc/basic/sbmeth.hxx @@ -47,15 +47,15 @@ class SbMethod : public SbxMethod SbMethodImpl* mpSbMethodImpl; // Impl data SbModule* pMod; - USHORT nDebugFlags; - USHORT nLine1, nLine2; - UINT32 nStart; - BOOL bInvalid; + sal_uInt16 nDebugFlags; + sal_uInt16 nLine1, nLine2; + sal_uInt32 nStart; + sal_Bool bInvalid; SbxArrayRef refStatics; SbMethod( const String&, SbxDataType, SbModule* ); SbMethod( const SbMethod& ); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; virtual ~SbMethod(); public: @@ -66,14 +66,14 @@ public: SbxArray* GetStatics(); void ClearStatics(); SbModule* GetModule() { return pMod; } - UINT32 GetId() const { return nStart; } - USHORT GetDebugFlags() { return nDebugFlags; } - void SetDebugFlags( USHORT n ) { nDebugFlags = n; } - void GetLineRange( USHORT&, USHORT& ); + sal_uInt32 GetId() const { return nStart; } + sal_uInt16 GetDebugFlags() { return nDebugFlags; } + void SetDebugFlags( sal_uInt16 n ) { nDebugFlags = n; } + void GetLineRange( sal_uInt16&, sal_uInt16& ); // Schnittstelle zum Ausfuehren einer Methode aus den Applikationen virtual ErrCode Call( SbxValue* pRet = NULL ); - virtual void Broadcast( ULONG nHintId ); + virtual void Broadcast( sal_uIntPtr nHintId ); }; #ifndef __SB_SBMETHODREF_HXX diff --git a/basic/inc/basic/sbmod.hxx b/basic/inc/basic/sbmod.hxx index d6ee1d3eab0e..a0552cdf3d4b 100644 --- a/basic/inc/basic/sbmod.hxx +++ b/basic/inc/basic/sbmod.hxx @@ -40,7 +40,7 @@ class SbMethod; class SbProperty; class SbiRuntime; -typedef std::deque< USHORT > SbiBreakpoints; +typedef std::deque< sal_uInt16 > SbiBreakpoints; class SbiImage; class SbProcedureProperty; class SbIfaceMapperMethod; @@ -72,8 +72,8 @@ protected: SbiImage* pImage; // the Image SbiBreakpoints* pBreaks; // Breakpoints SbClassData* pClassData; - BOOL mbVBACompat; - INT32 mnType; + sal_Bool mbVBACompat; + sal_Int32 mnType; SbxObjectRef pDocObject; // an impl object ( used by Document Modules ) bool bIsProxyModule; @@ -83,19 +83,19 @@ protected: SbProperty* GetProperty( const String&, SbxDataType ); SbProcedureProperty* GetProcedureProperty( const String&, SbxDataType ); SbIfaceMapperMethod* GetIfaceMapperMethod( const String&, SbMethod* ); - void EndDefinitions( BOOL=FALSE ); - USHORT Run( SbMethod* ); + void EndDefinitions( sal_Bool=sal_False ); + sal_uInt16 Run( SbMethod* ); void RunInit(); void ClearPrivateVars(); void ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic ); - void GlobalRunInit( BOOL bBasicStart ); // for all modules + void GlobalRunInit( sal_Bool bBasicStart ); // for all modules void GlobalRunDeInit( void ); - const BYTE* FindNextStmnt( const BYTE*, USHORT&, USHORT& ) const; - const BYTE* FindNextStmnt( const BYTE*, USHORT&, USHORT&, - BOOL bFollowJumps, const SbiImage* pImg=NULL ) const; - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; - virtual BOOL LoadCompleted(); + const sal_uInt8* FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16& ) const; + const sal_uInt8* FindNextStmnt( const sal_uInt8*, sal_uInt16&, sal_uInt16&, + sal_Bool bFollowJumps, const SbiImage* pImg=NULL ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; + virtual sal_Bool LoadCompleted(); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); void handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rHint ); @@ -103,7 +103,7 @@ protected: public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASICMOD,2); TYPEINFO(); - SbModule( const String&, BOOL bCompat = FALSE ); + SbModule( const String&, sal_Bool bCompat = sal_False ); virtual void SetParent( SbxObject* ); virtual void Clear(); @@ -116,33 +116,33 @@ public: void SetSource32( const ::rtl::OUString& r ); void SetComment( const String& r ); - virtual BOOL Compile(); - BOOL Disassemble( String& rText ); - virtual BOOL IsCompiled() const; + virtual sal_Bool Compile(); + sal_Bool Disassemble( String& rText ); + virtual sal_Bool IsCompiled() const; const SbxObject* FindType( String aTypeName ) const; - virtual BOOL IsBreakable( USHORT nLine ) const; + virtual sal_Bool IsBreakable( sal_uInt16 nLine ) const; virtual size_t GetBPCount() const; - virtual USHORT GetBP( size_t n ) const; - virtual BOOL IsBP( USHORT nLine ) const; - virtual BOOL SetBP( USHORT nLine ); - virtual BOOL ClearBP( USHORT nLine ); + virtual sal_uInt16 GetBP( size_t n ) const; + virtual sal_Bool IsBP( sal_uInt16 nLine ) const; + virtual sal_Bool SetBP( sal_uInt16 nLine ); + virtual sal_Bool ClearBP( sal_uInt16 nLine ); virtual void ClearAllBP(); // Lines of Subs - virtual SbMethod* GetFunctionForLine( USHORT ); + virtual SbMethod* GetFunctionForLine( sal_uInt16 ); // Store only image, no source (needed for new password protection) - BOOL StoreBinaryData( SvStream& ); - BOOL StoreBinaryData( SvStream&, USHORT nVer ); - BOOL LoadBinaryData( SvStream&, USHORT nVer ); - BOOL LoadBinaryData( SvStream& ); - BOOL ExceedsLegacyModuleSize(); + sal_Bool StoreBinaryData( SvStream& ); + sal_Bool StoreBinaryData( SvStream&, sal_uInt16 nVer ); + sal_Bool LoadBinaryData( SvStream&, sal_uInt16 nVer ); + sal_Bool LoadBinaryData( SvStream& ); + sal_Bool ExceedsLegacyModuleSize(); void fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg = NULL ) const; - BOOL IsVBACompat() const; - void SetVBACompat( BOOL bCompat ); - INT32 GetModuleType() { return mnType; } - void SetModuleType( INT32 nType ) { mnType = nType; } + sal_Bool IsVBACompat() const; + void SetVBACompat( sal_Bool bCompat ); + sal_Int32 GetModuleType() { return mnType; } + void SetModuleType( sal_Int32 nType ) { mnType = nType; } bool isProxyModule() { return bIsProxyModule; } void AddVarName( const String& aName ); void RemoveVars(); diff --git a/basic/inc/basic/sbobjmod.hxx b/basic/inc/basic/sbobjmod.hxx index 49fefb79309e..f8c515b13108 100644 --- a/basic/inc/basic/sbobjmod.hxx +++ b/basic/inc/basic/sbobjmod.hxx @@ -117,7 +117,7 @@ public: SbUserFormModuleInstance( SbUserFormModule* pParentModule, const String& rName, const com::sun::star::script::ModuleInfo& mInfo, bool bIsVBACompat ); - virtual BOOL IsClass( const String& ) const; + virtual sal_Bool IsClass( const String& ) const; virtual SbxVariable* Find( const XubString& rName, SbxClassType t ); }; diff --git a/basic/inc/basic/sbprop.hxx b/basic/inc/basic/sbprop.hxx index 60cd9e5353c0..88f6504bff76 100644 --- a/basic/inc/basic/sbprop.hxx +++ b/basic/inc/basic/sbprop.hxx @@ -39,7 +39,7 @@ class SbProperty : public SbxProperty friend class SbModule; friend class SbProcedureProperty; SbModule* pMod; - BOOL bInvalid; + sal_Bool bInvalid; SbProperty( const String&, SbxDataType, SbModule* ); virtual ~SbProperty(); public: diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index db67836890e9..9eeee5f71d7c 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -67,13 +67,13 @@ class StarBASIC : public SbxObject // Handler-Support: Link aErrorHdl; // Error handler Link aBreakHdl; // Breakpoint handler - BOOL bNoRtl; // if TRUE: do not search RTL - BOOL bBreak; // if TRUE: Break, otherwise Step - BOOL bDocBasic; - BOOL bVBAEnabled; + sal_Bool bNoRtl; // if sal_True: do not search RTL + sal_Bool bBreak; // if sal_True: Break, otherwise Step + sal_Bool bDocBasic; + sal_Bool bVBAEnabled; BasicLibInfo* pLibInfo; // Info block for basic manager SbLanguageMode eLanguageMode; // LanguageMode of the basic object - BOOL bQuit; + sal_Bool bQuit; SbxObjectRef pVBAGlobals; SbxObject* getVBAGlobals( ); @@ -81,19 +81,19 @@ class StarBASIC : public SbxObject void implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ); protected: - BOOL CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen ); + sal_Bool CError( SbError, const String&, xub_StrLen, xub_StrLen, xub_StrLen ); private: - BOOL RTError( SbError, xub_StrLen, xub_StrLen, xub_StrLen ); - BOOL RTError( SbError, const String& rMsg, xub_StrLen, xub_StrLen, xub_StrLen ); - USHORT BreakPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); - USHORT StepPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + sal_Bool RTError( SbError, xub_StrLen, xub_StrLen, xub_StrLen ); + sal_Bool RTError( SbError, const String& rMsg, xub_StrLen, xub_StrLen, xub_StrLen ); + sal_uInt16 BreakPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); + sal_uInt16 StepPoint( xub_StrLen nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; protected: - virtual BOOL ErrorHdl(); - virtual USHORT BreakHdl(); + virtual sal_Bool ErrorHdl(); + virtual sal_uInt16 BreakHdl(); virtual ~StarBASIC(); public: @@ -101,11 +101,11 @@ public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_BASIC,1); TYPEINFO(); - StarBASIC( StarBASIC* pParent = NULL, BOOL bIsDocBasic = FALSE ); + StarBASIC( StarBASIC* pParent = NULL, sal_Bool bIsDocBasic = sal_False ); // #51727 SetModified overridden so that the Modfied-State is // not delivered to Parent. - virtual void SetModified( BOOL ); + virtual void SetModified( sal_Bool ); void* operator new( size_t ); void operator delete( void* ); @@ -122,14 +122,14 @@ public: SbModule* MakeModule( const String& rName, const String& rSrc ); SbModule* MakeModule32( const String& rName, const ::rtl::OUString& rSrc ); SbModule* MakeModule32( const String& rName, const com::sun::star::script::ModuleInfo& mInfo, const ::rtl::OUString& rSrc ); - BOOL Compile( SbModule* ); - BOOL Disassemble( SbModule*, String& rText ); + sal_Bool Compile( SbModule* ); + sal_Bool Disassemble( SbModule*, String& rText ); static void Stop(); static void Error( SbError ); static void Error( SbError, const String& rMsg ); static void FatalError( SbError ); static void FatalError( SbError, const String& rMsg ); - static BOOL IsRunning(); + static sal_Bool IsRunning(); static SbError GetErrBasic(); // #66536 make additional message accessible by RTL function Error static String GetErrorMsg(); @@ -138,7 +138,7 @@ public: void Highlight( const String& rSrc, SbTextPortions& rList ); virtual SbxVariable* Find( const String&, SbxClassType ); - virtual BOOL Call( const String&, SbxArray* = NULL ); + virtual sal_Bool Call( const String&, SbxArray* = NULL ); SbxArray* GetModules() { return pModules; } SbxObject* GetRtl() { return pRtl; } @@ -147,26 +147,26 @@ public: void InitAllModules( StarBASIC* pBasicNotToInit = NULL ); void DeInitAllModules( void ); void ClearAllModuleVars( void ); - void ActivateObject( const String*, BOOL ); - BOOL LoadOldModules( SvStream& ); + void ActivateObject( const String*, sal_Bool ); + sal_Bool LoadOldModules( SvStream& ); // #43011 For TestTool; deletes global vars void ClearGlobalVars( void ); // Calls for error and break handler - static USHORT GetLine(); - static USHORT GetCol1(); - static USHORT GetCol2(); - static void SetErrorData( SbError nCode, USHORT nLine, - USHORT nCol1, USHORT nCol2 ); + static sal_uInt16 GetLine(); + static sal_uInt16 GetCol1(); + static sal_uInt16 GetCol2(); + static void SetErrorData( SbError nCode, sal_uInt16 nLine, + sal_uInt16 nCol1, sal_uInt16 nCol2 ); // Specific to error handler static void MakeErrorText( SbError, const String& aMsg ); static const String& GetErrorText(); static SbError GetErrorCode(); - static BOOL IsCompilerError(); - static USHORT GetVBErrorCode( SbError nError ); - static SbError GetSfxFromVBError( USHORT nError ); + static sal_Bool IsCompilerError(); + static sal_uInt16 GetVBErrorCode( SbError nError ); + static SbError GetSfxFromVBError( sal_uInt16 nError ); static void SetGlobalLanguageMode( SbLanguageMode eLangMode ); static SbLanguageMode GetGlobalLanguageMode(); // Local settings @@ -175,7 +175,7 @@ public: SbLanguageMode GetLanguageMode(); // Specific for break handler - BOOL IsBreak() const { return bBreak; } + sal_Bool IsBreak() const { return bBreak; } static Link GetGlobalErrorHdl(); static void SetGlobalErrorHdl( const Link& rNewHdl ); @@ -191,24 +191,24 @@ public: static SbxBase* FindSBXInCurrentScope( const String& rName ); static SbxVariable* FindVarInCurrentScopy - ( const String& rName, USHORT& rStatus ); - static SbMethod* GetActiveMethod( USHORT nLevel = 0 ); + ( const String& rName, sal_uInt16& rStatus ); + static SbMethod* GetActiveMethod( sal_uInt16 nLevel = 0 ); static SbModule* GetActiveModule(); - void SetVBAEnabled( BOOL bEnabled ); - BOOL isVBAEnabled(); + void SetVBAEnabled( sal_Bool bEnabled ); + sal_Bool isVBAEnabled(); - // #60175 TRUE: SFX-Resource is not displayed on basic errors - static void StaticSuppressSfxResource( BOOL bSuppress ); + // #60175 sal_True: SFX-Resource is not displayed on basic errors + static void StaticSuppressSfxResource( sal_Bool bSuppress ); - // #91147 TRUE: Reschedule is enabled (default>, FALSE: No reschedule - static void StaticEnableReschedule( BOOL bReschedule ); + // #91147 sal_True: Reschedule is enabled (default>, sal_False: No reschedule + static void StaticEnableReschedule( sal_Bool bReschedule ); SbxObjectRef getRTL( void ) { return pRtl; } - BOOL IsDocBasic() { return bDocBasic; } + sal_Bool IsDocBasic() { return bDocBasic; } SbxVariable* VBAFind( const String& rName, SbxClassType t ); bool GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ); void QuitAndExitApplication(); - BOOL IsQuitApplication() { return bQuit; }; + sal_Bool IsQuitApplication() { return bQuit; }; static ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetModelFromBasic( SbxObject* pBasic ); diff --git a/basic/inc/basic/sbstdobj.hxx b/basic/inc/basic/sbstdobj.hxx index 5cc76c8bd9c3..b1c061161896 100644 --- a/basic/inc/basic/sbstdobj.hxx +++ b/basic/inc/basic/sbstdobj.hxx @@ -59,9 +59,9 @@ protected: virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); - void PropType( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropWidth( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropHeight( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PropType( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropWidth( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropHeight( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); public: TYPEINFO(); @@ -79,23 +79,23 @@ public: class SbStdFont : public SbxObject { protected: - BOOL bBold; - BOOL bItalic; - BOOL bStrikeThrough; - BOOL bUnderline; - USHORT nSize; + sal_Bool bBold; + sal_Bool bItalic; + sal_Bool bStrikeThrough; + sal_Bool bUnderline; + sal_uInt16 nSize; String aName; ~SbStdFont(); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); - void PropBold( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropItalic( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropStrikeThrough( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropUnderline( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropSize( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PropName( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PropBold( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropItalic( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropStrikeThrough( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropUnderline( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropSize( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PropName( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); public: TYPEINFO(); @@ -103,16 +103,16 @@ public: SbStdFont(); virtual SbxVariable* Find( const String&, SbxClassType ); - void SetBold( BOOL bB ) { bBold = bB; } - BOOL IsBold() const { return bBold; } - void SetItalic( BOOL bI ) { bItalic = bI; } - BOOL IsItalic() const { return bItalic; } - void SetStrikeThrough( BOOL bS ) { bStrikeThrough = bS; } - BOOL IsStrikeThrough() const { return bStrikeThrough; } - void SetUnderline( BOOL bU ) { bUnderline = bU; } - BOOL IsUnderline() const { return bUnderline; } - void SetSize( USHORT nS ) { nSize = nS; } - USHORT GetSize() const { return nSize; } + void SetBold( sal_Bool bB ) { bBold = bB; } + sal_Bool IsBold() const { return bBold; } + void SetItalic( sal_Bool bI ) { bItalic = bI; } + sal_Bool IsItalic() const { return bItalic; } + void SetStrikeThrough( sal_Bool bS ) { bStrikeThrough = bS; } + sal_Bool IsStrikeThrough() const { return bStrikeThrough; } + void SetUnderline( sal_Bool bU ) { bUnderline = bU; } + sal_Bool IsUnderline() const { return bUnderline; } + void SetSize( sal_uInt16 nS ) { nSize = nS; } + sal_uInt16 GetSize() const { return nSize; } void SetFontName( const String& rName ) { aName = rName; } String GetFontName() const { return aName; } }; @@ -128,12 +128,12 @@ protected: virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); - void MethClear( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite ); - void MethGetData( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite ); - void MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite ); - void MethGetText( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite ); - void MethSetData( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite ); - void MethSetText( SbxVariable* pVar, SbxArray* pPar_, BOOL bWrite ); + void MethClear( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite ); + void MethGetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite ); + void MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite ); + void MethGetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite ); + void MethSetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite ); + void MethSetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool bWrite ); public: TYPEINFO(); diff --git a/basic/inc/basic/sbx.hxx b/basic/inc/basic/sbx.hxx index 2eb194708739..7f0681ccce6c 100644 --- a/basic/inc/basic/sbx.hxx +++ b/basic/inc/basic/sbx.hxx @@ -72,9 +72,9 @@ struct SbxParamInfo const String aName; // Name of the parameter SbxBaseRef aTypeRef; // Object, if object type SbxDataType eType; // Data type - UINT16 nFlags; // Flag-Bits - UINT32 nUserData; // IDs etc. - SbxParamInfo( const String& s, SbxDataType t, USHORT n, SbxBase* b = NULL ) + sal_uInt16 nFlags; // Flag-Bits + sal_uInt32 nUserData; // IDs etc. + SbxParamInfo( const String& s, SbxDataType t, sal_uInt16 n, SbxBase* b = NULL ) : aName( s ), aTypeRef( b ), eType( t ), nFlags( n ), nUserData( 0 ) {} ~SbxParamInfo() {} }; @@ -97,27 +97,27 @@ class SbxInfo : public SvRefBase String aComment; String aHelpFile; - UINT32 nHelpId; + sal_uInt32 nHelpId; SbxParams aParams; protected: - BOOL LoadData( SvStream&, USHORT ); - BOOL StoreData( SvStream& ) const; + sal_Bool LoadData( SvStream&, sal_uInt16 ); + sal_Bool StoreData( SvStream& ) const; virtual ~SbxInfo(); public: SbxInfo(); - SbxInfo( const String&, UINT32 ); + SbxInfo( const String&, sal_uInt32 ); - void AddParam( const String&, SbxDataType, USHORT=SBX_READ ); + void AddParam( const String&, SbxDataType, sal_uInt16=SBX_READ ); void AddParam( const SbxParamInfo& ); - const SbxParamInfo* GetParam( USHORT n ) const; // index starts with 1! + const SbxParamInfo* GetParam( sal_uInt16 n ) const; // index starts with 1! const String& GetComment() const { return aComment; } const String& GetHelpFile() const { return aHelpFile; } - UINT32 GetHelpId() const { return nHelpId; } + sal_uInt32 GetHelpId() const { return nHelpId; } void SetComment( const String& r ) { aComment = r; } void SetHelpFile( const String& r ) { aHelpFile = r; } - void SetHelpId( UINT32 nId ) { nHelpId = nId; } + void SetHelpId( sal_uInt32 nId ) { nHelpId = nId; } }; #endif @@ -130,7 +130,7 @@ class SbxHint : public SfxSimpleHint SbxVariable* pVar; public: TYPEINFO(); - SbxHint( ULONG n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {} + SbxHint( sal_uIntPtr n, SbxVariable* v ) : SfxSimpleHint( n ), pVar( v ) {} SbxVariable* GetVar() const { return pVar; } }; @@ -144,7 +144,7 @@ class SbxAlias : public SbxVariable, public SfxListener { SbxVariableRef xAlias; virtual ~SbxAlias(); - virtual void Broadcast( ULONG ); + virtual void Broadcast( sal_uIntPtr ); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); public: @@ -173,7 +173,7 @@ class SbxArray : public SbxBase friend class SbMethod; friend class SbClassModuleObject; friend SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ); - void PutDirect( SbxVariable* pVar, UINT32 nIdx ); + void PutDirect( SbxVariable* pVar, sal_uInt32 nIdx ); SbxArrayImpl* mpSbxArrayImpl; // Impl data SbxVarRefs* pData; // The variables @@ -181,8 +181,8 @@ class SbxArray : public SbxBase protected: SbxDataType eType; // Data type of the array virtual ~SbxArray(); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_ARRAY,1); @@ -191,28 +191,28 @@ public: SbxArray( const SbxArray& ); SbxArray& operator=( const SbxArray& ); virtual void Clear(); - USHORT Count() const; + sal_uInt16 Count() const; virtual SbxDataType GetType() const; virtual SbxClassType GetClass() const; - SbxVariableRef& GetRef( USHORT ); - SbxVariable* Get( USHORT ); - void Put( SbxVariable*, USHORT ); - void Insert( SbxVariable*, USHORT ); - void Remove( USHORT ); + SbxVariableRef& GetRef( sal_uInt16 ); + SbxVariable* Get( sal_uInt16 ); + void Put( SbxVariable*, sal_uInt16 ); + void Insert( SbxVariable*, sal_uInt16 ); + void Remove( sal_uInt16 ); void Remove( SbxVariable* ); void Merge( SbxArray* ); - const String& GetAlias( USHORT ); - void PutAlias( const String&, USHORT ); - SbxVariable* FindUserData( UINT32 nUserData ); + const String& GetAlias( sal_uInt16 ); + void PutAlias( const String&, sal_uInt16 ); + SbxVariable* FindUserData( sal_uInt32 nUserData ); virtual SbxVariable* Find( const String&, SbxClassType ); // Additional methods for 32-bit indices - UINT32 Count32() const; - SbxVariableRef& GetRef32( UINT32 ); - SbxVariable* Get32( UINT32 ); - void Put32( SbxVariable*, UINT32 ); - void Insert32( SbxVariable*, UINT32 ); - void Remove32( UINT32 ); + sal_uInt32 Count32() const; + SbxVariableRef& GetRef32( sal_uInt32 ); + SbxVariable* Get32( sal_uInt32 ); + void Put32( SbxVariable*, sal_uInt32 ); + void Insert32( SbxVariable*, sal_uInt32 ); + void Remove32( sal_uInt32 ); }; #endif @@ -231,15 +231,15 @@ class SbxDimArray : public SbxArray SbxDim* pFirst, *pLast; // Links to Dimension table short nDim; // Number of dimensions - void AddDimImpl32( INT32, INT32, BOOL bAllowSize0 ); + void AddDimImpl32( sal_Int32, sal_Int32, sal_Bool bAllowSize0 ); bool mbHasFixedSize; protected: - USHORT Offset( const short* ); - UINT32 Offset32( const INT32* ); - USHORT Offset( SbxArray* ); - UINT32 Offset32( SbxArray* ); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + sal_uInt16 Offset( const short* ); + sal_uInt32 Offset32( const sal_Int32* ); + sal_uInt16 Offset( SbxArray* ); + sal_uInt32 Offset32( SbxArray* ); + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; virtual ~SbxDimArray(); public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_DIMARRAY,1); @@ -261,17 +261,17 @@ public: short GetDims() const { return nDim; } void AddDim( short, short ); void unoAddDim( short, short ); - BOOL GetDim( short, short&, short& ) const; + sal_Bool GetDim( short, short&, short& ) const; using SbxArray::GetRef32; - SbxVariableRef& GetRef32( const INT32* ); + SbxVariableRef& GetRef32( const sal_Int32* ); using SbxArray::Get32; - SbxVariable* Get32( const INT32* ); + SbxVariable* Get32( const sal_Int32* ); using SbxArray::Put32; - void Put32( SbxVariable*, const INT32* ); - void AddDim32( INT32, INT32 ); - void unoAddDim32( INT32, INT32 ); - BOOL GetDim32( INT32, INT32&, INT32& ) const; + void Put32( SbxVariable*, const sal_Int32* ); + void AddDim32( sal_Int32, sal_Int32 ); + void unoAddDim32( sal_Int32, sal_Int32 ); + sal_Bool GetDim32( sal_Int32, sal_Int32&, sal_Int32& ) const; bool hasFixedSize() { return mbHasFixedSize; }; void setHasFixedSize( bool bHasFixedSize ) {mbHasFixedSize = bHasFixedSize; }; }; @@ -286,7 +286,7 @@ class SbxCollection : public SbxObject void Initialize(); protected: virtual ~SbxCollection(); - virtual BOOL LoadData( SvStream&, USHORT ); + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); // Overridable methods (why not pure virtual?): @@ -300,7 +300,7 @@ public: SbxCollection( const String& rClassname ); SbxCollection( const SbxCollection& ); SbxCollection& operator=( const SbxCollection& ); - virtual SbxVariable* FindUserData( UINT32 nUserData ); + virtual SbxVariable* FindUserData( sal_uInt32 nUserData ); virtual SbxVariable* Find( const String&, SbxClassType ); virtual void Clear(); }; @@ -314,17 +314,17 @@ class SbxStdCollection : public SbxCollection { protected: String aElemClass; - BOOL bAddRemoveOk; + sal_Bool bAddRemoveOk; virtual ~SbxStdCollection(); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; virtual void CollAdd( SbxArray* pPar ); virtual void CollRemove( SbxArray* pPar ); public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_FIXCOLLECTION,1); TYPEINFO(); SbxStdCollection - ( const String& rClassname, const String& rElemClass, BOOL=TRUE ); + ( const String& rClassname, const String& rElemClass, sal_Bool=sal_True ); SbxStdCollection( const SbxStdCollection& ); SbxStdCollection& operator=( const SbxStdCollection& ); virtual void Insert( SbxVariable* ); diff --git a/basic/inc/basic/sbxcore.hxx b/basic/inc/basic/sbxcore.hxx index 83e474521cc2..b4e80a49f168 100644 --- a/basic/inc/basic/sbxcore.hxx +++ b/basic/inc/basic/sbxcore.hxx @@ -45,30 +45,30 @@ class UniString; // This version of the Macros does not define Load/StorePrivateData()-methods #define SBX_DECL_PERSIST_NODATA( nCre, nSbxId, nVer ) \ - virtual UINT32 GetCreator() const { return nCre; } \ - virtual UINT16 GetVersion() const { return nVer; } \ - virtual UINT16 GetSbxId() const { return nSbxId; } + virtual sal_uInt32 GetCreator() const { return nCre; } \ + virtual sal_uInt16 GetVersion() const { return nVer; } \ + virtual sal_uInt16 GetSbxId() const { return nSbxId; } #define SBX_DECL_PERSIST_NODATA_() \ - virtual UINT32 GetCreator() const; \ - virtual UINT16 GetVersion() const; \ - virtual UINT16 GetSbxId() const; + virtual sal_uInt32 GetCreator() const; \ + virtual sal_uInt16 GetVersion() const; \ + virtual sal_uInt16 GetSbxId() const; // This version of the macro defines Load/StorePrivateData()-methods #define SBX_DECL_PERSIST( nCre, nSbxId, nVer ) \ - virtual BOOL LoadPrivateData( SvStream&, USHORT ); \ - virtual BOOL StorePrivateData( SvStream& ) const; \ + virtual sal_Bool LoadPrivateData( SvStream&, sal_uInt16 ); \ + virtual sal_Bool StorePrivateData( SvStream& ) const; \ SBX_DECL_PERSIST_NODATA( nCre, nSbxId, nVer ) #define SBX_DECL_PERSIST_() \ - virtual BOOL LoadPrivateData( SvStream&, USHORT ); \ - virtual BOOL StorePrivateData( SvStream& ) const; \ + virtual sal_Bool LoadPrivateData( SvStream&, sal_uInt16 ); \ + virtual sal_Bool StorePrivateData( SvStream& ) const; \ SBX_DECL_PERSIST_NODATA_() #define SBX_IMPL_PERSIST( C, nCre, nSbxId, nVer ) \ - UINT32 C::GetCreator() const { return nCre; } \ - UINT16 C::GetVersion() const { return nVer; } \ - UINT16 C::GetSbxId() const { return nSbxId; } + sal_uInt32 C::GetCreator() const { return nCre; } \ + sal_uInt16 C::GetVersion() const { return nVer; } \ + sal_uInt16 C::GetSbxId() const { return nSbxId; } class SbxBase; class SbxFactory; @@ -82,10 +82,10 @@ class SbxBase : virtual public SvRefBase { SbxBaseImpl* mpSbxBaseImpl; // Impl data - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; protected: - USHORT nFlags; // Flag-Bits + sal_uInt16 nFlags; // Flag-Bits SbxBase(); SbxBase( const SbxBase& ); @@ -94,21 +94,21 @@ protected: SBX_DECL_PERSIST(0,0,0); public: TYPEINFO(); - inline void SetFlags( USHORT n ); - inline USHORT GetFlags() const; - inline void SetFlag( USHORT n ); - inline void ResetFlag( USHORT n ); - inline BOOL IsSet( USHORT n ) const; - inline BOOL IsReset( USHORT n ) const; - inline BOOL CanRead() const; - inline BOOL CanWrite() const; - inline BOOL IsModified() const; - inline BOOL IsConst() const; - inline BOOL IsHidden() const; - inline BOOL IsVisible() const; - - virtual BOOL IsFixed() const; - virtual void SetModified( BOOL ); + inline void SetFlags( sal_uInt16 n ); + inline sal_uInt16 GetFlags() const; + inline void SetFlag( sal_uInt16 n ); + inline void ResetFlag( sal_uInt16 n ); + inline sal_Bool IsSet( sal_uInt16 n ) const; + inline sal_Bool IsReset( sal_uInt16 n ) const; + inline sal_Bool CanRead() const; + inline sal_Bool CanWrite() const; + inline sal_Bool IsModified() const; + inline sal_Bool IsConst() const; + inline sal_Bool IsHidden() const; + inline sal_Bool IsVisible() const; + + virtual sal_Bool IsFixed() const; + virtual void SetModified( sal_Bool ); virtual SbxDataType GetType() const; virtual SbxClassType GetClass() const; @@ -117,24 +117,24 @@ public: static SbxBase* Load( SvStream& ); static void Skip( SvStream& ); - BOOL Store( SvStream& ); - virtual BOOL LoadCompleted(); - virtual BOOL StoreCompleted(); + sal_Bool Store( SvStream& ); + virtual sal_Bool LoadCompleted(); + virtual sal_Bool StoreCompleted(); static SbxError GetError(); static void SetError( SbxError ); - static BOOL IsError(); + static sal_Bool IsError(); static void ResetError(); // Set the factory for Load/Store/Create static void AddFactory( SbxFactory* ); static void RemoveFactory( SbxFactory* ); - static SbxBase* Create( UINT16, UINT32=SBXCR_SBX ); + static SbxBase* Create( sal_uInt16, sal_uInt32=SBXCR_SBX ); static SbxObject* CreateObject( const String& ); // Sbx solution as replacement for SfxBroadcaster::Enable() - static void StaticEnableBroadcasting( BOOL bEnable ); - static BOOL StaticIsEnabledBroadcasting( void ); + static void StaticEnableBroadcasting( sal_Bool bEnable ); + static sal_Bool StaticIsEnabledBroadcasting( void ); }; #ifndef SBX_BASE_DECL_DEFINED @@ -142,40 +142,40 @@ public: SV_DECL_REF(SbxBase) #endif -inline void SbxBase::SetFlags( USHORT n ) +inline void SbxBase::SetFlags( sal_uInt16 n ) { DBG_CHKTHIS( SbxBase, 0 ); nFlags = n; } -inline USHORT SbxBase::GetFlags() const +inline sal_uInt16 SbxBase::GetFlags() const { DBG_CHKTHIS( SbxBase, 0 ); return nFlags; } -inline void SbxBase::SetFlag( USHORT n ) +inline void SbxBase::SetFlag( sal_uInt16 n ) { DBG_CHKTHIS( SbxBase, 0 ); nFlags |= n; } -inline void SbxBase::ResetFlag( USHORT n ) +inline void SbxBase::ResetFlag( sal_uInt16 n ) { DBG_CHKTHIS( SbxBase, 0 ); nFlags &= ~n; } -inline BOOL SbxBase::IsSet( USHORT n ) const -{ DBG_CHKTHIS( SbxBase, 0 ); return BOOL( ( nFlags & n ) != 0 ); } +inline sal_Bool SbxBase::IsSet( sal_uInt16 n ) const +{ DBG_CHKTHIS( SbxBase, 0 ); return sal_Bool( ( nFlags & n ) != 0 ); } -inline BOOL SbxBase::IsReset( USHORT n ) const -{ DBG_CHKTHIS( SbxBase, 0 ); return BOOL( ( nFlags & n ) == 0 ); } +inline sal_Bool SbxBase::IsReset( sal_uInt16 n ) const +{ DBG_CHKTHIS( SbxBase, 0 ); return sal_Bool( ( nFlags & n ) == 0 ); } -inline BOOL SbxBase::CanRead() const +inline sal_Bool SbxBase::CanRead() const { DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_READ ); } -inline BOOL SbxBase::CanWrite() const +inline sal_Bool SbxBase::CanWrite() const { DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_WRITE ); } -inline BOOL SbxBase::IsModified() const +inline sal_Bool SbxBase::IsModified() const { DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_MODIFIED ); } -inline BOOL SbxBase::IsConst() const +inline sal_Bool SbxBase::IsConst() const { DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_CONST ); } -inline BOOL SbxBase::IsHidden() const +inline sal_Bool SbxBase::IsHidden() const { DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_HIDDEN ); } -inline BOOL SbxBase::IsVisible() const +inline sal_Bool SbxBase::IsVisible() const { DBG_CHKTHIS( SbxBase, 0 ); return IsReset( SBX_INVISIBLE ); } #endif diff --git a/basic/inc/basic/sbxdef.hxx b/basic/inc/basic/sbxdef.hxx index b85b3552c79e..6dc9fe1d8d66 100644 --- a/basic/inc/basic/sbxdef.hxx +++ b/basic/inc/basic/sbxdef.hxx @@ -57,23 +57,23 @@ enum SbxClassType { // SBX-class-IDs (order is important!) enum SbxDataType { SbxEMPTY = 0, // * Uninitialized SbxNULL = 1, // * Contains no valid data - SbxINTEGER = 2, // * Integer (INT16) - SbxLONG = 3, // * Long integer (INT32) + SbxINTEGER = 2, // * Integer (sal_Int16) + SbxLONG = 3, // * Long integer (sal_Int32) SbxSINGLE = 4, // * Single-precision floating point number (float) SbxDOUBLE = 5, // * Double-precision floating point number (double) - SbxCURRENCY = 6, // Currency (INT64) + SbxCURRENCY = 6, // Currency (sal_Int64) SbxDATE = 7, // * Date (double) SbxSTRING = 8, // * String (StarView) SbxOBJECT = 9, // * SbxBase object pointer - SbxERROR = 10, // * Error (UINT16) + SbxERROR = 10, // * Error (sal_uInt16) SbxBOOL = 11, // * Boolean (0 or -1) SbxVARIANT = 12, // * Anzeige fuer varianten Datentyp SbxDATAOBJECT = 13, // * Common data object w/o ref count SbxCHAR = 16, // * signed char SbxBYTE = 17, // * unsigned char - SbxUSHORT = 18, // * unsigned short (UINT16) - SbxULONG = 19, // * unsigned long (UINT32) + SbxUSHORT = 18, // * unsigned short (sal_uInt16) + SbxULONG = 19, // * unsigned long (sal_uInt32) SbxLONG64 = 20, // signed 64-bit int SbxULONG64 = 21, // unsigned 64-bit int SbxINT = 22, // * signed machine-dependent int @@ -105,9 +105,9 @@ enum SbxDataType { SbxUSERn = 2047 // last user defined data type }; -const UINT32 SBX_TYPE_WITH_EVENTS_FLAG = 0x10000; -const UINT32 SBX_TYPE_DIM_AS_NEW_FLAG = 0x20000; -const UINT32 SBX_FIXED_LEN_STRING_FLAG = 0x10000; // same value as above as no conflict possible +const sal_uInt32 SBX_TYPE_WITH_EVENTS_FLAG = 0x10000; +const sal_uInt32 SBX_TYPE_DIM_AS_NEW_FLAG = 0x20000; +const sal_uInt32 SBX_FIXED_LEN_STRING_FLAG = 0x10000; // same value as above as no conflict possible #endif @@ -123,8 +123,8 @@ enum SbxOperator { SbxPLUS, // this + var SbxMINUS, // this - var SbxNEG, // -this (var is ignored) - SbxIDIV, // this / var (both operands max. INT32!) - // Boolean operators (max INT32!): + SbxIDIV, // this / var (both operands max. sal_Int32!) + // Boolean operators (max sal_Int32!): SbxAND, // this & var SbxOR, // this | var SbxXOR, // this ^ var @@ -157,7 +157,7 @@ enum SbxNameType { // Type of the questioned name of a variable #endif // AB: 20.3.96: New error messages -typedef ULONG SbxError; // Preserve old type +typedef sal_uIntPtr SbxError; // Preserve old type #endif // von #ifndef __RSC @@ -356,10 +356,10 @@ enum SbxError { // Ergebnis einer Rechenoperation/Konversion #define SbxMAXBYTE ( 255) #define SbxMAXINT ( 32767) #define SbxMININT (-32768) -#define SbxMAXUINT ((UINT16) 65535) +#define SbxMAXUINT ((sal_uInt16) 65535) #define SbxMAXLNG ( 2147483647) -#define SbxMINLNG ((INT32)(-2147483647-1)) -#define SbxMAXULNG ((UINT32) 0xffffffff) +#define SbxMINLNG ((sal_Int32)(-2147483647-1)) +#define SbxMAXULNG ((sal_uInt32) 0xffffffff) #define SbxMAXSALINT64 SAL_MAX_INT64 #define SbxMINSALINT64 SAL_MIN_INT64 @@ -379,7 +379,7 @@ enum SbxError { // Ergebnis einer Rechenoperation/Konversion #define SBX_MAXINDEX 0x3FF0 #define SBX_MAXINDEX32 SbxMAXLNG -// The numeric values of TRUE and FALSE +// The numeric values of sal_True and FALSE enum SbxBOOL { SbxFALSE = 0, SbxTRUE = -1 }; #endif // __RSC diff --git a/basic/inc/basic/sbxfac.hxx b/basic/inc/basic/sbxfac.hxx index f72cebd8d979..372785657266 100644 --- a/basic/inc/basic/sbxfac.hxx +++ b/basic/inc/basic/sbxfac.hxx @@ -37,11 +37,11 @@ class UniString; class SbxFactory { - BOOL bHandleLast; // TRUE: Factory is asked at last because of its expensiveness + sal_Bool bHandleLast; // sal_True: Factory is asked at last because of its expensiveness public: - SbxFactory( BOOL bLast=FALSE ) { bHandleLast = bLast; } - BOOL IsHandleLast( void ) { return bHandleLast; } - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + SbxFactory( sal_Bool bLast=sal_False ) { bHandleLast = bLast; } + sal_Bool IsHandleLast( void ) { return bHandleLast; } + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); }; diff --git a/basic/inc/basic/sbxform.hxx b/basic/inc/basic/sbxform.hxx index 0e8ab2466271..9f31e3529d04 100644 --- a/basic/inc/basic/sbxform.hxx +++ b/basic/inc/basic/sbxform.hxx @@ -111,16 +111,16 @@ class SbxBasicFormater { String BasicFormat( double dNumber, String sFormatStrg ); String BasicFormatNull( String sFormatStrg ); - static BOOL isBasicFormat( String sFormatStrg ); + static sal_Bool isBasicFormat( String sFormatStrg ); private: //*** some helper methods *** //void ShowError( char *sErrMsg ); - inline void ShiftString( String& sStrg, USHORT nStartPos ); + inline void ShiftString( String& sStrg, sal_uInt16 nStartPos ); inline void StrAppendChar( String& sStrg, sal_Unicode ch ); void AppendDigit( String& sStrg, short nDigit ); void LeftShiftDecimalPoint( String& sStrg ); - void StrRoundDigit( String& sStrg, short nPos, BOOL& bOverflow ); + void StrRoundDigit( String& sStrg, short nPos, sal_Bool& bOverflow ); void StrRoundDigit( String& sStrg, short nPos ); void ParseBack( String& sStrg, const String& sFormatStrg, short nFormatPos ); @@ -128,30 +128,30 @@ class SbxBasicFormater { // Methods for string conversion with sprintf(): void InitScan( double _dNum ); void InitExp( double _dNewExp ); - short GetDigitAtPosScan( short nPos, BOOL& bFoundFirstDigit ); + short GetDigitAtPosScan( short nPos, sal_Bool& bFoundFirstDigit ); short GetDigitAtPosExpScan( double dNewExponent, short nPos, - BOOL& bFoundFirstDigit ); - short GetDigitAtPosExpScan( short nPos, BOOL& bFoundFirstDigit ); + sal_Bool& bFoundFirstDigit ); + short GetDigitAtPosExpScan( short nPos, sal_Bool& bFoundFirstDigit ); #else // Methods for direct 'calculation' with log10() and pow(): short GetDigitAtPos( double dNumber, short nPos, double& dNextNumber, - BOOL& bFoundFirstDigit ); + sal_Bool& bFoundFirstDigit ); short RoundDigit( double dNumber ); #endif - String GetPosFormatString( const String& sFormatStrg, BOOL & bFound ); - String GetNegFormatString( const String& sFormatStrg, BOOL & bFound ); - String Get0FormatString( const String& sFormatStrg, BOOL & bFound ); - String GetNullFormatString( const String& sFormatStrg, BOOL & bFound ); + String GetPosFormatString( const String& sFormatStrg, sal_Bool & bFound ); + String GetNegFormatString( const String& sFormatStrg, sal_Bool & bFound ); + String Get0FormatString( const String& sFormatStrg, sal_Bool & bFound ); + String GetNullFormatString( const String& sFormatStrg, sal_Bool & bFound ); short AnalyseFormatString( const String& sFormatStrg, short& nNoOfDigitsLeft, short& nNoOfDigitsRight, short& nNoOfOptionalDigitsLeft, short& nNoOfExponentDigits, short& nNoOfOptionalExponentDigits, - BOOL& bPercent, BOOL& bCurrency, BOOL& bScientific, - BOOL& bGenerateThousandSeparator, + sal_Bool& bPercent, sal_Bool& bCurrency, sal_Bool& bScientific, + sal_Bool& bGenerateThousandSeparator, short& nMultipleThousandSeparators ); void ScanFormatString( double dNumber, const String& sFormatStrg, - String& sReturnStrg, BOOL bCreateSign ); + String& sReturnStrg, sal_Bool bCreateSign ); //*** Data *** sal_Unicode cDecPoint; // sign for the decimal point diff --git a/basic/inc/basic/sbxmeth.hxx b/basic/inc/basic/sbxmeth.hxx index 5cc9af6f877a..1f812cdb6260 100644 --- a/basic/inc/basic/sbxmeth.hxx +++ b/basic/inc/basic/sbxmeth.hxx @@ -44,7 +44,7 @@ public: SbxMethod( const SbxMethod& r ) : SvRefBase( r ), SbxVariable( r ) {} SbxMethod& operator=( const SbxMethod& r ) { SbxVariable::operator=( r ); return *this; } - BOOL Run( SbxValues* pValues = NULL ); + sal_Bool Run( SbxValues* pValues = NULL ); virtual SbxClassType GetClass() const; }; diff --git a/basic/inc/basic/sbxmstrm.hxx b/basic/inc/basic/sbxmstrm.hxx index ebd6a2b93484..c382269f6903 100644 --- a/basic/inc/basic/sbxmstrm.hxx +++ b/basic/inc/basic/sbxmstrm.hxx @@ -37,7 +37,7 @@ SV_DECL_REF(SbxMemoryStream) class SbxMemoryStream : public SbxBase, public SvMemoryStream { public: - SbxMemoryStream(ULONG nInitSize_=512, ULONG nResize_=64) : + SbxMemoryStream(sal_uIntPtr nInitSize_=512, sal_uIntPtr nResize_=64) : SvMemoryStream(nInitSize_,nResize_) {} ~SbxMemoryStream(); diff --git a/basic/inc/basic/sbxobj.hxx b/basic/inc/basic/sbxobj.hxx index a1ed962502cd..8b973eee59cb 100644 --- a/basic/inc/basic/sbxobj.hxx +++ b/basic/inc/basic/sbxobj.hxx @@ -42,9 +42,9 @@ class SbxObject : public SbxVariable, public SfxListener { SbxObjectImpl* mpSbxObjectImpl; // Impl data - SbxArray* FindVar( SbxVariable*, USHORT& ); + SbxArray* FindVar( SbxVariable*, sal_uInt16& ); // AB 23.3.1997, special method for VCPtrRemove (see below) - SbxArray* VCPtrFindVar( SbxVariable*, USHORT& ); + SbxArray* VCPtrFindVar( SbxVariable*, sal_uInt16& ); protected: SbxArrayRef pMethods; // Methods SbxArrayRef pProps; // Properties @@ -52,8 +52,8 @@ protected: SbxProperty* pDfltProp; // Default-Property String aClassName; // Classname String aDfltPropName; - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; virtual ~SbxObject(); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); @@ -67,7 +67,7 @@ public: virtual SbxClassType GetClass() const; virtual void Clear(); - virtual BOOL IsClass( const String& ) const; + virtual sal_Bool IsClass( const String& ) const; const String& GetClassName() const { return aClassName; } void SetClassName( const String &rNew ) { aClassName = rNew; } // Default-Property @@ -75,15 +75,15 @@ public: void SetDfltProperty( const String& r ); void SetDfltProperty( SbxProperty* ); // Search for an element - virtual SbxVariable* FindUserData( UINT32 nUserData ); + virtual SbxVariable* FindUserData( sal_uInt32 nUserData ); virtual SbxVariable* Find( const String&, SbxClassType ); SbxVariable* FindQualified( const String&, SbxClassType ); // Quick-Call-Interface for Methods - virtual BOOL Call( const String&, SbxArray* = NULL ); + virtual sal_Bool Call( const String&, SbxArray* = NULL ); // Execution of DDE-Commands SbxVariable* Execute( const String& ); // Manage elements - virtual BOOL GetAll( SbxClassType ) { return TRUE; } + virtual sal_Bool GetAll( SbxClassType ) { return sal_True; } SbxVariable* Make( const String&, SbxClassType, SbxDataType ); virtual SbxObject* MakeObject( const String&, const String& ); virtual void Insert( SbxVariable* ); @@ -96,7 +96,7 @@ public: virtual void Remove( SbxVariable* ); // AB 23.3.1997, deletion per pointer for controls (duplicate names!) void VCPtrRemove( SbxVariable* ); - void SetPos( SbxVariable*, USHORT ); + void SetPos( SbxVariable*, sal_uInt16 ); // Macro-Recording virtual String GenerateSource( const String &rLinePrefix, @@ -108,9 +108,9 @@ public: // Hooks virtual SvDispatch* GetSvDispatch(); // Debugging - void Dump( SvStream&, BOOL bDumpAll=FALSE ); + void Dump( SvStream&, sal_Bool bDumpAll=sal_False ); - static void GarbageCollection( ULONG nObjects = 0 /* ::= all */ ); + static void GarbageCollection( sal_uIntPtr nObjects = 0 /* ::= all */ ); }; #ifndef __SBX_SBXOBJECTREF_HXX diff --git a/basic/inc/basic/sbxvar.hxx b/basic/inc/basic/sbxvar.hxx index 1ba1b5d1edfa..5a2fc4601586 100644 --- a/basic/inc/basic/sbxvar.hxx +++ b/basic/inc/basic/sbxvar.hxx @@ -38,17 +38,17 @@ struct SbxINT64 { - INT32 nHigh; UINT32 nLow; + sal_Int32 nHigh; sal_uInt32 nLow; #if FALSE SbxINT64() : nHigh( 0 ), nLow( 0 ) {} - SbxINT64( UINT8 n ) : nHigh( 0 ), nLow( n ) {} - SbxINT64( UINT16 n ) : nHigh( 0 ), nLow( n ) {} - SbxINT64( UINT32 n ) : nHigh( 0 ), nLow( n ) {} + SbxINT64( sal_uInt8 n ) : nHigh( 0 ), nLow( n ) {} + SbxINT64( sal_uInt16 n ) : nHigh( 0 ), nLow( n ) {} + SbxINT64( sal_uInt32 n ) : nHigh( 0 ), nLow( n ) {} SbxINT64( unsigned int n ) : nHigh( 0 ), nLow( n ) {} - SbxINT64( INT8 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} - SbxINT64( INT16 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} - SbxINT64( INT32 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} + SbxINT64( sal_Int8 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} + SbxINT64( sal_Int16 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} + SbxINT64( sal_Int32 n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} SbxINT64( int n ) : nHigh( n < 0 ? -1 : 0 ), nLow( n ) {} SbxINT64( SbxINT64 &r ) : nHigh( r.nHigh ), nLow( r.nLow ) {} @@ -57,7 +57,7 @@ struct SbxINT64 #endif void CHS() { - nLow ^= (UINT32)-1; + nLow ^= (sal_uInt32)-1; nHigh ^= -1; nLow++; if( !nLow ) @@ -69,16 +69,16 @@ struct SbxINT64 { if( n >= 0 ) { - nHigh = (INT32)(n / (double)4294967296.0); - nLow = (UINT32)(n - ((double)nHigh * (double)4294967296.0) + 0.5); + nHigh = (sal_Int32)(n / (double)4294967296.0); + nLow = (sal_uInt32)(n - ((double)nHigh * (double)4294967296.0) + 0.5); } else { - nHigh = (INT32)(-n / (double)4294967296.0); - nLow = (UINT32)(-n - ((double)nHigh * (double)4294967296.0) + 0.5); + nHigh = (sal_Int32)(-n / (double)4294967296.0); + nLow = (sal_uInt32)(-n - ((double)nHigh * (double)4294967296.0) + 0.5); CHS(); } } - void Set(INT32 n) { nHigh = n < 0 ? -1 : 0; nLow = n; } + void Set(sal_Int32 n) { nHigh = n < 0 ? -1 : 0; nLow = n; } void SetMax() { nHigh = 0x7FFFFFFF; nLow = 0xFFFFFFFF; } void SetMin() { nHigh = 0x80000000; nLow = 0x00000000; } @@ -117,14 +117,14 @@ struct SbxINT64 struct SbxUINT64 { - UINT32 nHigh; UINT32 nLow; + sal_uInt32 nHigh; sal_uInt32 nLow; void Set(double n) { - nHigh = (UINT32)(n / (double)4294967296.0); - nLow = (UINT32)(n - ((double)nHigh * (double)4294967296.0)); + nHigh = (sal_uInt32)(n / (double)4294967296.0); + nLow = (sal_uInt32)(n - ((double)nHigh * (double)4294967296.0)); } - void Set(UINT32 n) { nHigh = 0; nLow = n; } + void Set(sal_uInt32 n) { nHigh = 0; nLow = n; } void SetMax() { nHigh = 0xFFFFFFFF; nLow = 0xFFFFFFFF; } void SetMin() { nHigh = 0x00000000; nLow = 0x00000000; } @@ -165,11 +165,11 @@ struct SbxValues { union { sal_Unicode nChar; - BYTE nByte; - INT16 nInteger; - INT32 nLong; - UINT16 nUShort; - UINT32 nULong; + sal_uInt8 nByte; + sal_Int16 nInteger; + sal_Int32 nLong; + sal_uInt16 nUShort; + sal_uInt32 nULong; float nSingle; double nDouble; SbxINT64 nLong64; @@ -183,11 +183,11 @@ struct SbxValues SbxBase* pObj; sal_Unicode* pChar; - BYTE* pByte; - INT16* pInteger; - INT32* pLong; - UINT16* pUShort; - UINT32* pULong; + sal_uInt8* pByte; + sal_Int16* pInteger; + sal_Int32* pLong; + sal_uInt16* pUShort; + sal_uInt32* pULong; float* pSingle; double* pDouble; SbxINT64* pLong64; @@ -203,11 +203,11 @@ struct SbxValues SbxValues(): pData( NULL ), eType(SbxEMPTY) {} SbxValues( SbxDataType e ): eType(e) {} SbxValues( char _nChar ): nChar( _nChar ), eType(SbxCHAR) {} - SbxValues( BYTE _nByte ): nByte( _nByte ), eType(SbxBYTE) {} + SbxValues( sal_uInt8 _nByte ): nByte( _nByte ), eType(SbxBYTE) {} SbxValues( short _nInteger ): nInteger( _nInteger ), eType(SbxINTEGER ) {} SbxValues( long _nLong ): nLong( _nLong ), eType(SbxLONG) {} - SbxValues( USHORT _nUShort ): nUShort( _nUShort ), eType(SbxUSHORT) {} - SbxValues( ULONG _nULong ): nULong( _nULong ), eType(SbxULONG) {} + SbxValues( sal_uInt16 _nUShort ): nUShort( _nUShort ), eType(SbxUSHORT) {} + SbxValues( sal_uIntPtr _nULong ): nULong( _nULong ), eType(SbxULONG) {} SbxValues( float _nSingle ): nSingle( _nSingle ), eType(SbxSINGLE) {} SbxValues( double _nDouble ): nDouble( _nDouble ), eType(SbxDOUBLE) {} SbxValues( int _nInt ): nInt( _nInt ), eType(SbxINT) {} @@ -233,17 +233,17 @@ class SbxValue : public SbxBase SbxValueImpl* mpSbxValueImplImpl; // Impl data // #55226 Transport additional infos - SbxValue* TheRealValue( BOOL bObjInObjError ) const; + SbxValue* TheRealValue( sal_Bool bObjInObjError ) const; SbxValue* TheRealValue() const; protected: SbxValues aData; // Data ::rtl::OUString aPic; // Picture-String String aToolString; // tool string copy - virtual void Broadcast( ULONG ); // Broadcast-Call + virtual void Broadcast( sal_uIntPtr ); // Broadcast-Call virtual ~SbxValue(); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VALUE,1); TYPEINFO(); @@ -252,41 +252,41 @@ public: SbxValue( const SbxValue& ); SbxValue& operator=( const SbxValue& ); virtual void Clear(); - virtual BOOL IsFixed() const; - - BOOL IsInteger() const { return BOOL( GetType() == SbxINTEGER ); } - BOOL IsLong() const { return BOOL( GetType() == SbxLONG ); } - BOOL IsSingle() const { return BOOL( GetType() == SbxSINGLE ); } - BOOL IsDouble() const { return BOOL( GetType() == SbxDOUBLE ); } - BOOL IsString() const { return BOOL( GetType() == SbxSTRING ); } - BOOL IsDate() const { return BOOL( GetType() == SbxDATE ); } - BOOL IsCurrency()const { return BOOL( GetType() == SbxCURRENCY ); } - BOOL IsObject() const { return BOOL( GetType() == SbxOBJECT ); } - BOOL IsDataObject()const{return BOOL( GetType() == SbxDATAOBJECT);} - BOOL IsBool() const { return BOOL( GetType() == SbxBOOL ); } - BOOL IsErr() const { return BOOL( GetType() == SbxERROR ); } - BOOL IsEmpty() const { return BOOL( GetType() == SbxEMPTY ); } - BOOL IsNull() const { return BOOL( GetType() == SbxNULL ); } - BOOL IsChar() const { return BOOL( GetType() == SbxCHAR ); } - BOOL IsByte() const { return BOOL( GetType() == SbxBYTE ); } - BOOL IsUShort() const { return BOOL( GetType() == SbxUSHORT ); } - BOOL IsULong() const { return BOOL( GetType() == SbxULONG ); } - BOOL IsInt() const { return BOOL( GetType() == SbxINT ); } - BOOL IsUInt() const { return BOOL( GetType() == SbxUINT ); } - BOOL IspChar() const { return BOOL( GetType() == SbxLPSTR ); } - BOOL IsNumeric() const; - BOOL IsNumericRTL() const; // #41692 Interface for Basic - BOOL ImpIsNumeric( BOOL bOnlyIntntl ) const; // Implementation + virtual sal_Bool IsFixed() const; + + sal_Bool IsInteger() const { return sal_Bool( GetType() == SbxINTEGER ); } + sal_Bool IsLong() const { return sal_Bool( GetType() == SbxLONG ); } + sal_Bool IsSingle() const { return sal_Bool( GetType() == SbxSINGLE ); } + sal_Bool IsDouble() const { return sal_Bool( GetType() == SbxDOUBLE ); } + sal_Bool IsString() const { return sal_Bool( GetType() == SbxSTRING ); } + sal_Bool IsDate() const { return sal_Bool( GetType() == SbxDATE ); } + sal_Bool IsCurrency()const { return sal_Bool( GetType() == SbxCURRENCY ); } + sal_Bool IsObject() const { return sal_Bool( GetType() == SbxOBJECT ); } + sal_Bool IsDataObject()const{return sal_Bool( GetType() == SbxDATAOBJECT);} + sal_Bool IsBool() const { return sal_Bool( GetType() == SbxBOOL ); } + sal_Bool IsErr() const { return sal_Bool( GetType() == SbxERROR ); } + sal_Bool IsEmpty() const { return sal_Bool( GetType() == SbxEMPTY ); } + sal_Bool IsNull() const { return sal_Bool( GetType() == SbxNULL ); } + sal_Bool IsChar() const { return sal_Bool( GetType() == SbxCHAR ); } + sal_Bool IsByte() const { return sal_Bool( GetType() == SbxBYTE ); } + sal_Bool IsUShort() const { return sal_Bool( GetType() == SbxUSHORT ); } + sal_Bool IsULong() const { return sal_Bool( GetType() == SbxULONG ); } + sal_Bool IsInt() const { return sal_Bool( GetType() == SbxINT ); } + sal_Bool IsUInt() const { return sal_Bool( GetType() == SbxUINT ); } + sal_Bool IspChar() const { return sal_Bool( GetType() == SbxLPSTR ); } + sal_Bool IsNumeric() const; + sal_Bool IsNumericRTL() const; // #41692 Interface for Basic + sal_Bool ImpIsNumeric( sal_Bool bOnlyIntntl ) const; // Implementation virtual SbxClassType GetClass() const; virtual SbxDataType GetType() const; SbxDataType GetFullType() const; - BOOL SetType( SbxDataType ); + sal_Bool SetType( SbxDataType ); - virtual BOOL Get( SbxValues& ) const; - BOOL GetNoBroadcast( SbxValues& ); + virtual sal_Bool Get( SbxValues& ) const; + sal_Bool GetNoBroadcast( SbxValues& ); const SbxValues& GetValues_Impl() const { return aData; } - virtual BOOL Put( const SbxValues& ); + virtual sal_Bool Put( const SbxValues& ); inline SbxValues * data() { return &aData; } @@ -295,65 +295,65 @@ public: SbxUINT64 GetULong64() const; sal_Int64 GetInt64() const; sal_uInt64 GetUInt64() const; - INT16 GetInteger() const; - INT32 GetLong() const; + sal_Int16 GetInteger() const; + sal_Int32 GetLong() const; float GetSingle() const; double GetDouble() const; double GetDate() const; - BOOL GetBool() const; - UINT16 GetErr() const; + sal_Bool GetBool() const; + sal_uInt16 GetErr() const; const String& GetString() const; const String& GetCoreString() const; ::rtl::OUString GetOUString() const; SbxDecimal* GetDecimal() const; SbxBase* GetObject() const; - BOOL HasObject() const; + sal_Bool HasObject() const; void* GetData() const; sal_Unicode GetChar() const; - BYTE GetByte() const; - UINT16 GetUShort() const; - UINT32 GetULong() const; + sal_uInt8 GetByte() const; + sal_uInt16 GetUShort() const; + sal_uInt32 GetULong() const; int GetInt() const; - BOOL PutCurrency( const SbxINT64& ); - BOOL PutLong64( const SbxINT64& ); - BOOL PutULong64( const SbxUINT64& ); - BOOL PutInt64( sal_Int64 ); - BOOL PutUInt64( sal_uInt64 ); - BOOL PutInteger( INT16 ); - BOOL PutLong( INT32 ); - BOOL PutSingle( float ); - BOOL PutDouble( double ); - BOOL PutDate( double ); - BOOL PutBool( BOOL ); - BOOL PutErr( USHORT ); - BOOL PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "TRUE"/"FALSE") - BOOL PutString( const ::rtl::OUString& ); - BOOL PutString( const sal_Unicode* ); // Type = SbxSTRING - BOOL PutpChar( const sal_Unicode* ); // Type = SbxLPSTR - BOOL PutDecimal( SbxDecimal* pDecimal ); - BOOL PutObject( SbxBase* ); - BOOL PutData( void* ); - BOOL PutChar( sal_Unicode ); - BOOL PutByte( BYTE ); - BOOL PutUShort( UINT16 ); - BOOL PutULong( UINT32 ); - BOOL PutInt( int ); - BOOL PutEmpty(); - BOOL PutNull(); + sal_Bool PutCurrency( const SbxINT64& ); + sal_Bool PutLong64( const SbxINT64& ); + sal_Bool PutULong64( const SbxUINT64& ); + sal_Bool PutInt64( sal_Int64 ); + sal_Bool PutUInt64( sal_uInt64 ); + sal_Bool PutInteger( sal_Int16 ); + sal_Bool PutLong( sal_Int32 ); + sal_Bool PutSingle( float ); + sal_Bool PutDouble( double ); + sal_Bool PutDate( double ); + sal_Bool PutBool( sal_Bool ); + sal_Bool PutErr( sal_uInt16 ); + sal_Bool PutStringExt( const ::rtl::OUString& ); // with extended analysis (International, "sal_True"/"sal_False") + sal_Bool PutString( const ::rtl::OUString& ); + sal_Bool PutString( const sal_Unicode* ); // Type = SbxSTRING + sal_Bool PutpChar( const sal_Unicode* ); // Type = SbxLPSTR + sal_Bool PutDecimal( SbxDecimal* pDecimal ); + sal_Bool PutObject( SbxBase* ); + sal_Bool PutData( void* ); + sal_Bool PutChar( sal_Unicode ); + sal_Bool PutByte( sal_uInt8 ); + sal_Bool PutUShort( sal_uInt16 ); + sal_Bool PutULong( sal_uInt32 ); + sal_Bool PutInt( int ); + sal_Bool PutEmpty(); + sal_Bool PutNull(); // Special decimal methods - BOOL PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); - BOOL fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); + sal_Bool PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); + sal_Bool fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); - virtual BOOL Convert( SbxDataType ); - virtual BOOL Compute( SbxOperator, const SbxValue& ); - virtual BOOL Compare( SbxOperator, const SbxValue& ) const; - BOOL Scan( const String&, USHORT* = NULL ); + virtual sal_Bool Convert( SbxDataType ); + virtual sal_Bool Compute( SbxOperator, const SbxValue& ); + virtual sal_Bool Compare( SbxOperator, const SbxValue& ) const; + sal_Bool Scan( const String&, sal_uInt16* = NULL ); void Format( String&, const String* = NULL ) const; // Interface for CDbl in Basic - static SbxError ScanNumIntnl( const String& rSrc, double& nVal, BOOL bSingle=FALSE ); + static SbxError ScanNumIntnl( const String& rSrc, double& nVal, sal_Bool bSingle=sal_False ); // The following operators are definied for easier handling. // Error conditions (overflow, conversions) are not @@ -449,7 +449,7 @@ class SbxVariable : public SbxValue SfxBroadcaster* pCst; // Broadcaster, if needed String maName; // Name, if available SbxArrayRef mpPar; // Parameter-Array, if set - USHORT nHash; // Hash-ID for search + sal_uInt16 nHash; // Hash-ID for search SbxVariableImpl* getImpl( void ); @@ -458,8 +458,8 @@ protected: sal_uIntPtr nUserData; // User data for Call() SbxObject* pParent; // Currently attached object virtual ~SbxVariable(); - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_VARIABLE,2); TYPEINFO(); @@ -468,13 +468,13 @@ public: SbxVariable( const SbxVariable& ); SbxVariable& operator=( const SbxVariable& ); - void Dump( SvStream&, BOOL bDumpAll=FALSE ); + void Dump( SvStream&, sal_Bool bDumpAll=sal_False ); virtual void SetName( const String& ); virtual const String& GetName( SbxNameType = SbxNAME_NONE ) const; - USHORT GetHashCode() const { return nHash; } + sal_uInt16 GetHashCode() const { return nHash; } - virtual void SetModified( BOOL ); + virtual void SetModified( sal_Bool ); sal_uIntPtr GetUserData() const { return nUserData; } void SetUserData( sal_uIntPtr n ) { nUserData = n; } @@ -491,8 +491,8 @@ public: // Sfx-Broadcasting-Support: // Due to data reduction and better DLL-hierarchie currently via casting SfxBroadcaster& GetBroadcaster(); - BOOL IsBroadcaster() const { return BOOL( pCst != NULL ); } - virtual void Broadcast( ULONG nHintId ); + sal_Bool IsBroadcaster() const { return sal_Bool( pCst != NULL ); } + virtual void Broadcast( sal_uIntPtr nHintId ); inline const SbxObject* GetParent() const { return pParent; } inline SbxObject* GetParent() { return pParent; } @@ -504,7 +504,7 @@ public: StarBASIC* pParentBasic ); void ClearComListener( void ); - static USHORT MakeHashCode( const String& rName ); + static sal_uInt16 MakeHashCode( const String& rName ); }; #ifndef SBX_VARIABLE_DECL_DEFINED diff --git a/basic/inc/basic/testtool.hxx b/basic/inc/basic/testtool.hxx index 37e90bb5cd68..179d28152561 100644 --- a/basic/inc/basic/testtool.hxx +++ b/basic/inc/basic/testtool.hxx @@ -40,7 +40,7 @@ // #94145# Due to a tab in TT_SIGNATURE_FOR_UNICODE_TEXTFILES which is changed to blanks by some editors // this routine became necessary -BOOL IsTTSignatureForUnicodeTextfile( String aLine ); +sal_Bool IsTTSignatureForUnicodeTextfile( String aLine ); //#include "testapp.hxx" #define ADD_ERROR_QUIET(nNr, aStr) \ @@ -101,9 +101,9 @@ public: String aKurzname; String aSlotname; String aLangname; - USHORT nRType; + sal_uInt16 nRType; String aRName; - BOOL bIsReset; + sal_Bool bIsReset; }; // Defines for syntax Highlighting @@ -132,20 +132,20 @@ public: class TTExecutionStatusHint : public SfxSimpleHint { private: - USHORT mnType; + sal_uInt16 mnType; String maExecutionStatus; String maAdditionalExecutionStatus; public: TYPEINFO(); - TTExecutionStatusHint( USHORT nType, sal_Char *pExecutionStatus, const sal_Char *pAdditionalExecutionStatus = "" ) + TTExecutionStatusHint( sal_uInt16 nType, sal_Char *pExecutionStatus, const sal_Char *pAdditionalExecutionStatus = "" ) : SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION) , mnType( nType ) , maExecutionStatus( pExecutionStatus, RTL_TEXTENCODING_ASCII_US ) , maAdditionalExecutionStatus( pAdditionalExecutionStatus, RTL_TEXTENCODING_ASCII_US ) {;} - TTExecutionStatusHint( USHORT nType, const String &aExecutionStatus = String(), const String &aAdditionalExecutionStatus = String() ) + TTExecutionStatusHint( sal_uInt16 nType, const String &aExecutionStatus = String(), const String &aAdditionalExecutionStatus = String() ) : SfxSimpleHint(SBX_HINT_EXECUTION_STATUS_INFORMATION) , mnType( nType ) , maExecutionStatus( aExecutionStatus ) @@ -154,7 +154,7 @@ public: const String& GetExecutionStatus() const { return maExecutionStatus; } const String& GetAdditionalExecutionStatus() const { return maAdditionalExecutionStatus; } - USHORT GetType(){ return mnType; } + sal_uInt16 GetType(){ return mnType; } }; #endif // _BASIC_TESTTOOL_HXX_ diff --git a/basic/inc/basic/ttstrhlp.hxx b/basic/inc/basic/ttstrhlp.hxx index 06f4939d61c0..27867a97996d 100644 --- a/basic/inc/basic/ttstrhlp.hxx +++ b/basic/inc/basic/ttstrhlp.hxx @@ -57,20 +57,20 @@ #define ResString(nNumber) MakeStringNumber(ResKenn,nNumber) #define ArgString(nNumber, aText) MakeStringParam(ArgKenn(nNumber),aText) -UniString GEN_RES_STR0( ULONG nResId ); -UniString GEN_RES_STR1( ULONG nResId, const String &Text1 ); -UniString GEN_RES_STR2( ULONG nResId, const String &Text1, const String &Text2 ); -UniString GEN_RES_STR3( ULONG nResId, const String &Text1, const String &Text2, const String &Text3 ); +UniString GEN_RES_STR0( sal_uIntPtr nResId ); +UniString GEN_RES_STR1( sal_uIntPtr nResId, const String &Text1 ); +UniString GEN_RES_STR2( sal_uIntPtr nResId, const String &Text1, const String &Text2 ); +UniString GEN_RES_STR3( sal_uIntPtr nResId, const String &Text1, const String &Text2, const String &Text3 ); #define GEN_RES_STR1c( nResId, Text1 ) GEN_RES_STR1( nResId, CUniString(Text1) ) #define GEN_RES_STR2c2( nResId, Text1, Text2 ) GEN_RES_STR2( nResId, Text1, CUniString(Text2) ) #define GEN_RES_STR3c3( nResId, Text1, Text2, Text3 ) GEN_RES_STR3( nResId, Text1, Text2, CUniString(Text3) ) #define IMPL_GEN_RES_STR \ -UniString GEN_RES_STR0( ULONG nResId ) { return ResString( nResId ); } \ -UniString GEN_RES_STR1( ULONG nResId, const UniString &Text1 ) { return GEN_RES_STR0( nResId ).Append( ArgString( 1, Text1 ) ); } \ -UniString GEN_RES_STR2( ULONG nResId, const UniString &Text1, const UniString &Text2 ) { return GEN_RES_STR1( nResId, Text1 ).Append( ArgString( 2, Text2 ) ); } \ -UniString GEN_RES_STR3( ULONG nResId, const UniString &Text1, const UniString &Text2, const UniString &Text3 ) { return GEN_RES_STR2( nResId, Text1, Text2 ).Append( ArgString( 3, Text3 ) );} +UniString GEN_RES_STR0( sal_uIntPtr nResId ) { return ResString( nResId ); } \ +UniString GEN_RES_STR1( sal_uIntPtr nResId, const UniString &Text1 ) { return GEN_RES_STR0( nResId ).Append( ArgString( 1, Text1 ) ); } \ +UniString GEN_RES_STR2( sal_uIntPtr nResId, const UniString &Text1, const UniString &Text2 ) { return GEN_RES_STR1( nResId, Text1 ).Append( ArgString( 2, Text2 ) ); } \ +UniString GEN_RES_STR3( sal_uIntPtr nResId, const UniString &Text1, const UniString &Text2, const UniString &Text3 ) { return GEN_RES_STR2( nResId, Text1, Text2 ).Append( ArgString( 3, Text3 ) );} #endif diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx index fd613a81673f..cd3e1dd0061f 100644 --- a/basic/source/app/app.cxx +++ b/basic/source/app/app.cxx @@ -94,52 +94,52 @@ IMPL_GEN_RES_STR; #ifdef DBG_UTIL // filter Messages generated due to missing configuration Bug:#83887# -void TestToolDebugMessageFilter( const sal_Char *pString, BOOL bIsOsl ) +void TestToolDebugMessageFilter( const sal_Char *pString, sal_Bool bIsOsl ) { - static BOOL static_bInsideFilter = FALSE; + static sal_Bool static_bInsideFilter = sal_False; // Ignore messages during filtering to avoid endless recursions if ( static_bInsideFilter ) return; - static_bInsideFilter = TRUE; + static_bInsideFilter = sal_True; ByteString aMessage( pString ); - BOOL bIgnore = FALSE; + sal_Bool bIgnore = sal_False; if ( bIsOsl ) { // OSL if ( aMessage.Search( CByteString("Cannot open Configuration: Connector: unknown delegatee com.sun.star.connection.Connector.portal") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; } else { // DBG #if ! (OSL_DEBUG_LEVEL > 1) if ( aMessage.Search( CByteString("SelectAppIconPixmap") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; #endif if ( aMessage.Search( CByteString("PropertySetRegistry::") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("property value missing") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("getDateFormatsImpl") ) != STRING_NOTFOUND && aMessage.Search( CByteString("no date formats") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("ucb::configureUcb(): Bad arguments") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("CreateInstance with arguments exception") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; if ( aMessage.Search( CByteString("AcquireTree failed") ) != STRING_NOTFOUND ) - bIgnore = TRUE; + bIgnore = sal_True; } if ( bIgnore ) { - static_bInsideFilter = FALSE; + static_bInsideFilter = sal_False; return; } @@ -164,22 +164,22 @@ void TestToolDebugMessageFilter( const sal_Char *pString, BOOL bIsOsl ) /* DBG_INSTOUTERROR( DBG_OUT_MSGBOX ) DBG_ERROR( pString ); DBG_INSTOUTERROR( DBG_OUT_TESTTOOL )*/ - static_bInsideFilter = FALSE; + static_bInsideFilter = sal_False; } void SAL_CALL DBG_TestToolDebugMessageFilter( const sal_Char *pString ) { - TestToolDebugMessageFilter( pString, FALSE ); + TestToolDebugMessageFilter( pString, sal_False ); } extern "C" void SAL_CALL osl_TestToolDebugMessageFilter( const sal_Char *pString ) { if ( !getenv( "DISABLE_SAL_DBGBOX" ) ) - TestToolDebugMessageFilter( pString, TRUE ); + TestToolDebugMessageFilter( pString, sal_True ); } #endif // #94145# Due to a tab in TT_SIGNATURE_FOR_UNICODE_TEXTFILES which is changed to blanks by some editors // this routine became necessary -BOOL IsTTSignatureForUnicodeTextfile( String aLine ) +sal_Bool IsTTSignatureForUnicodeTextfile( String aLine ) { aLine.SearchAndReplace( '\t', ' ' ); String ThreeBlanks = CUniString(" "); @@ -304,7 +304,7 @@ void BasicApp::Main( ) if ( aDefIniPath.Exists() ) { aDefIniPath.CopyTo( aIniPath, FSYS_ACTION_COPYFILE ); - FileStat::SetReadOnlyFlag( aIniPath, FALSE ); + FileStat::SetReadOnlyFlag( aIniPath, sal_False ); } } } @@ -331,7 +331,7 @@ void BasicApp::Main( ) } // ResMgr::CreateResMgr( CREATEVERSIONRESMGR( stt ), ) -//const char* ResMgr::GetLang( LanguageType& nType, USHORT nPrio ) +//const char* ResMgr::GetLang( LanguageType& nType, sal_uInt16 nPrio ) // ResMgr::CreateResMgr( CREATEVERSIONRESMGR( stt ) // ResMgr *pRes = new ResMgr( "testtool.res" ); @@ -406,7 +406,7 @@ void BasicApp::SetFocus() IMPL_LINK( BasicApp, LateInit, void *, pDummy ) { (void) pDummy; /* avoid warning about unused parameter */ - USHORT i; + sal_uInt16 i; for ( i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) { if ( Application::GetCommandLineParam( i ).Copy(0,4).CompareIgnoreCaseToAscii("-run") == COMPARE_EQUAL @@ -414,7 +414,7 @@ IMPL_LINK( BasicApp, LateInit, void *, pDummy ) || Application::GetCommandLineParam( i ).Copy(0,4).CompareIgnoreCaseToAscii("/run") == COMPARE_EQUAL #endif ) - pFrame->SetAutoRun( TRUE ); + pFrame->SetAutoRun( sal_True ); else if ( Application::GetCommandLineParam( i ).Copy(0,7).CompareIgnoreCaseToAscii("-result") == COMPARE_EQUAL #ifndef UNX || Application::GetCommandLineParam( i ).Copy(0,7).CompareIgnoreCaseToAscii("/result") == COMPARE_EQUAL @@ -425,7 +425,7 @@ IMPL_LINK( BasicApp, LateInit, void *, pDummy ) { if ( ByteString( Application::GetCommandLineParam( i+1 ), osl_getThreadTextEncoding() ).IsNumericAscii() ) { - MsgEdit::SetMaxLogLen( sal::static_int_cast< USHORT >( Application::GetCommandLineParam( i+1 ).ToInt32() ) ); + MsgEdit::SetMaxLogLen( sal::static_int_cast< sal_uInt16 >( Application::GetCommandLineParam( i+1 ).ToInt32() ) ); } i++; } @@ -497,7 +497,7 @@ FloatingExecutionStatus::FloatingExecutionStatus( Window * pParent ) void FloatingExecutionStatus::SetStatus( String aW ) { - Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); ToTop( TOTOP_NOGRABFOCUS ); aAusblend.Start(); aStatus.SetText( aW ); @@ -505,7 +505,7 @@ void FloatingExecutionStatus::SetStatus( String aW ) void FloatingExecutionStatus::SetAdditionalInfo( String aF ) { - Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); ToTop( TOTOP_NOGRABFOCUS ); aAusblend.Start(); aAdditionalInfo.SetText( aF ); @@ -524,11 +524,11 @@ TYPEINIT1(TTExecutionStatusHint, SfxSimpleHint); BasicFrame::BasicFrame() : WorkWindow( NULL, WinBits( WB_APP | WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ) -, bIsAutoRun( FALSE ) +, bIsAutoRun( sal_False ) , pDisplayHidDlg( NULL ) , pEditVar ( 0 ) -, bAutoReload( FALSE ) -, bAutoSave( TRUE ) +, bAutoReload( sal_False ) +, bAutoSave( sal_True ) , pBasic( NULL ) , pExecutionStatus( NULL ) , pStatus( NULL ) @@ -538,10 +538,10 @@ BasicFrame::BasicFrame() : WorkWindow( NULL, { Application::SetDefDialogParent( this ); - AlwaysEnableInput( TRUE ); + AlwaysEnableInput( sal_True ); pBasic = TTBasic::CreateMyBasic(); // depending on what was linked to the executable - bInBreak = FALSE; - bDisas = FALSE; + bInBreak = sal_False; + bDisas = sal_False; nFlags = 0; // Icon aAppIcon; @@ -653,11 +653,11 @@ BasicFrame::BasicFrame() : WorkWindow( NULL, } const ByteString ProfilePrefix("_profile_"); -const USHORT ProfilePrefixLen = ProfilePrefix.Len(); +const sal_uInt16 ProfilePrefixLen = ProfilePrefix.Len(); void BasicFrame::LoadIniFile() { - USHORT i; + sal_uInt16 i; Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); for ( i = 0 ; i < aConf.GetGroupCount() ; i++ ) @@ -777,12 +777,12 @@ IMPL_LINK( BasicFrame, CheckAllFiles, Timer*, pTimer ) return 0; } -BOOL BasicFrame::IsAutoRun() +sal_Bool BasicFrame::IsAutoRun() { return bIsAutoRun; } -void BasicFrame::SetAutoRun( BOOL bAuto ) +void BasicFrame::SetAutoRun( sal_Bool bAuto ) { bIsAutoRun = bAuto; } @@ -849,7 +849,7 @@ void BasicFrame::Resize() // Resize possibly maximized window - ULONG i; + sal_uIntPtr i; for( i = pList->Count(); i > 0 ; i-- ) { if ( pList->GetObject( i-1 )->GetWinState() == TT_WIN_STATE_MAX ) @@ -877,7 +877,7 @@ IMPL_LINK( BasicFrame, CloseButtonClick, void*, EMPTYARG ) {}; if ( p ) p->GrabFocus(); - return Command( RID_FILECLOSE, FALSE ); + return Command( RID_FILECLOSE, sal_False ); } IMPL_LINK( BasicFrame, FloatButtonClick, void*, EMPTYARG ) @@ -906,7 +906,7 @@ void BasicFrame::WinShow_Hide() return; AppWin* p; - BOOL bWasFullscreen = FALSE; + sal_Bool bWasFullscreen = sal_False; for ( p = pList->Last() ; p ; p = pList->Prev() ) { if ( p->pDataEdit ) @@ -916,7 +916,7 @@ void BasicFrame::WinShow_Hide() ) p->Hide( SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); else - p->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + p->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } bWasFullscreen |= p->GetWinState() == TT_WIN_STATE_MAX; } @@ -926,10 +926,10 @@ void BasicFrame::WinMax_Restore() { // The application buttons AppWin* p; - BOOL bHasFullscreenWin = FALSE; + sal_Bool bHasFullscreenWin = sal_False; for( p = pList->First(); p && !bHasFullscreenWin ; p = pList->Next() ) bHasFullscreenWin |= ( p->GetWinState() == TT_WIN_STATE_MAX ); - GetMenuBar()->ShowButtons( bHasFullscreenWin, FALSE, FALSE ); + GetMenuBar()->ShowButtons( bHasFullscreenWin, sal_False, sal_False ); WinShow_Hide(); } @@ -948,9 +948,9 @@ void BasicFrame::RemoveWindow( AppWin *pWin ) Menu* pMenu = GetMenuBar(); if( pList->Count() == 0 ) { - pMenu->EnableItem( RID_APPEDIT, FALSE ); - pMenu->EnableItem( RID_APPRUN, FALSE ); - pMenu->EnableItem( RID_APPWINDOW, FALSE ); + pMenu->EnableItem( RID_APPEDIT, sal_False ); + pMenu->EnableItem( RID_APPRUN, sal_False ); + pMenu->EnableItem( RID_APPWINDOW, sal_False ); } PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); @@ -974,20 +974,20 @@ void BasicFrame::AddWindow( AppWin *pWin ) // Enable main menu MenuBar* pMenu = GetMenuBar(); if( pList->Count() > 0 ) { - pMenu->EnableItem( RID_APPEDIT, TRUE ); - pMenu->EnableItem( RID_APPRUN, TRUE ); - pMenu->EnableItem( RID_APPWINDOW, TRUE ); + pMenu->EnableItem( RID_APPEDIT, sal_True ); + pMenu->EnableItem( RID_APPRUN, sal_True ); + pMenu->EnableItem( RID_APPWINDOW, sal_True ); } PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); - USHORT nLastID = pWinMenu->GetItemId( pWinMenu->GetItemCount() - 1 ); + sal_uInt16 nLastID = pWinMenu->GetItemId( pWinMenu->GetItemCount() - 1 ); // Separator necessary if ( nLastID < RID_WIN_FILE1 && pWinMenu->GetItemType( pWinMenu->GetItemCount() - 1 ) != MENUITEM_SEPARATOR ) pWinMenu->InsertSeparator(); // Find free ID - USHORT nFreeID = RID_WIN_FILE1; + sal_uInt16 nFreeID = RID_WIN_FILE1; while ( pWinMenu->GetItemPos( nFreeID ) != MENU_ITEM_NOTFOUND && nFreeID < RID_WIN_FILEn ) nFreeID++; @@ -1013,7 +1013,7 @@ void BasicFrame::FocusWindow( AppWin *pWin ) pWork = pWin; pList->Remove( pWin ); pList->Insert( pWin, LIST_APPEND ); - pWin->Minimize( FALSE ); + pWin->Minimize( sal_False ); aAppFile = pWin->GetText(); UpdateTitle(); @@ -1022,14 +1022,14 @@ void BasicFrame::FocusWindow( AppWin *pWin ) pStatus->LoadTaskToolBox(); } -BOOL BasicFrame::Close() +sal_Bool BasicFrame::Close() { if( bInBreak || Basic().IsRunning() ) if( RET_NO == QueryBox( this, SttResId( IDS_RUNNING ) ).Execute() ) - return FALSE; + return sal_False; StarBASIC::Stop(); - bInBreak = FALSE; + bInBreak = sal_False; if( CloseAll() ) { aLineNum.Stop(); @@ -1043,30 +1043,30 @@ BOOL BasicFrame::Close() Application::SetDefDialogParent( NULL ); WorkWindow::Close(); - return TRUE; - } else return FALSE; + return sal_True; + } else return sal_False; } -BOOL BasicFrame::CloseAll() +sal_Bool BasicFrame::CloseAll() { while ( pList->Count() ) if ( !pList->Last()->Close() ) - return FALSE; - return TRUE; + return sal_False; + return sal_True; } -BOOL BasicFrame::CompileAll() +sal_Bool BasicFrame::CompileAll() { AppWin* p; for( p = pList->First(); p; p = pList->Next() ) - if( p->ISA(AppBasEd) && !((AppBasEd*)p)->Compile() ) return FALSE; - return TRUE; + if( p->ISA(AppBasEd) && !((AppBasEd*)p)->Compile() ) return sal_False; + return sal_True; } // Setup menu #define MENU2FILENAME( Name ) Name.Copy( Name.SearchAscii(" ") +1).EraseAllChars( '~' ) #define LRUNr( nNr ) CByteString("LRU").Append( ByteString::CreateFromInt32( nNr ) ) -String FILENAME2MENU( USHORT nNr, String aName ) +String FILENAME2MENU( sal_uInt16 nNr, String aName ) { String aRet; if ( nNr <= 9 ) @@ -1085,9 +1085,9 @@ void BasicFrame::AddToLRU(String const& aFile) PopupMenu *pPopup = GetMenuBar()->GetPopupMenu(RID_APPFILE); aConfig.SetGroup("LRU"); - USHORT nMaxLRU = (USHORT)aConfig.ReadKey("MaxLRU","4").ToInt32(); + sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32(); DirEntry aFileEntry( aFile ); - USHORT i,nLastMove = nMaxLRU; + sal_uInt16 i,nLastMove = nMaxLRU; for ( i = 1 ; iGetPopupMenu(RID_APPFILE); - BOOL bAddSep = TRUE; + sal_Bool bAddSep = sal_True; aConfig.SetGroup("LRU"); - USHORT nMaxLRU = (USHORT)aConfig.ReadKey("MaxLRU","4").ToInt32(); + sal_uInt16 nMaxLRU = (sal_uInt16)aConfig.ReadKey("MaxLRU","4").ToInt32(); if ( pPopup ) bAddSep = pPopup->GetItemPos( IDM_FILE_LRU1 ) == MENU_ITEM_NOTFOUND; - USHORT i; + sal_uInt16 i; for ( i = 1; i <= nMaxLRU && pPopup != NULL; i++) { String aFile = UniString( aConfig.ReadKey(LRUNr(i)), RTL_TEXTENCODING_UTF8 ); @@ -1137,7 +1137,7 @@ void BasicFrame::LoadLRU() if (bAddSep) { pPopup->InsertSeparator(); - bAddSep = FALSE; + bAddSep = sal_False; } if ( pPopup->GetItemPos( IDM_FILE_LRU1 + i-1 ) == MENU_ITEM_NOTFOUND ) @@ -1156,10 +1156,10 @@ void BasicFrame::LoadLRU() IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) { - BOOL bNormal = BOOL( !bInBreak ); + sal_Bool bNormal = sal_Bool( !bInBreak ); pMenu->EnableItem( RID_RUNCOMPILE, bNormal ); - BOOL bHasEdit = BOOL( /*bNormal &&*/ pWork != NULL ); + sal_Bool bHasEdit = sal_Bool( /*bNormal &&*/ pWork != NULL ); // pMenu->EnableItem( RID_FILENEW, bNormal ); // always possible // pMenu->EnableItem( RID_FILEOPEN, bNormal ); @@ -1171,16 +1171,16 @@ IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) pMenu->EnableItem( RID_FILELOADLIB, bNormal ); pMenu->EnableItem( RID_FILESAVELIB, bHasEdit ); - BOOL bHasErr = BOOL( bNormal && pBasic->GetErrors() != 0 ); - BOOL bNext = bHasErr & bNormal; - BOOL bPrev = bHasErr & bNormal; + sal_Bool bHasErr = sal_Bool( bNormal && pBasic->GetErrors() != 0 ); + sal_Bool bNext = bHasErr & bNormal; + sal_Bool bPrev = bHasErr & bNormal; if( bHasErr ) { - ULONG n = pBasic->aErrors.GetCurPos(); + sal_uIntPtr n = pBasic->aErrors.GetCurPos(); if( n == 0 ) - bPrev = FALSE; - if( USHORT(n+1) == pBasic->GetErrors() ) - bNext = FALSE; + bPrev = sal_False; + if( sal_uInt16(n+1) == pBasic->GetErrors() ) + bNext = sal_False; } pMenu->EnableItem( RID_RUNNEXTERR, bNext ); pMenu->EnableItem( RID_RUNPREVERR, bPrev ); @@ -1188,7 +1188,7 @@ IMPL_LINK( BasicFrame, InitMenu, Menu *, pMenu ) if( pWork ) pWork->InitMenu( pMenu ); - return TRUE; + return sal_True; } IMPL_LINK_INLINE_START( BasicFrame, DeInitMenu, Menu *, pMenu ) @@ -1208,7 +1208,7 @@ IMPL_LINK_INLINE_START( BasicFrame, DeInitMenu, Menu *, pMenu ) pMenu->EnableItem( RID_RUNPREVERR ); if( pWork ) pWork->DeInitMenu( pMenu ); */ - SetAutoRun( FALSE ); + SetAutoRun( sal_False ); String aString; pStatus->Message( aString ); return 0L; @@ -1225,15 +1225,15 @@ IMPL_LINK_INLINE_END( BasicFrame, HighlightMenu, Menu *, pMenu ) IMPL_LINK_INLINE_START( BasicFrame, MenuCommand, Menu *, pMenu ) { - USHORT nId = pMenu->GetCurItemId(); - BOOL bChecked = pMenu->IsItemChecked( nId ); + sal_uInt16 nId = pMenu->GetCurItemId(); + sal_Bool bChecked = pMenu->IsItemChecked( nId ); return Command( nId, bChecked ); } IMPL_LINK_INLINE_END( BasicFrame, MenuCommand, Menu *, pMenu ) IMPL_LINK_INLINE_START( BasicFrame, Accel, Accelerator*, pAcc ) { - SetAutoRun( FALSE ); + SetAutoRun( sal_False ); return Command( pAcc->GetCurItemId() ); } IMPL_LINK_INLINE_END( BasicFrame, Accel, Accelerator*, pAcc ) @@ -1298,14 +1298,14 @@ AppBasEd* BasicFrame::CreateModuleWin( SbModule* pMod ) return p; } -BOOL BasicFrame::LoadFile( String aFilename ) +sal_Bool BasicFrame::LoadFile( String aFilename ) { - BOOL bIsResult = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("RES") == COMPARE_EQUAL; - BOOL bIsBasic = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("BAS") == COMPARE_EQUAL; + sal_Bool bIsResult = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("RES") == COMPARE_EQUAL; + sal_Bool bIsBasic = DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("BAS") == COMPARE_EQUAL; bIsBasic |= DirEntry( aFilename ).GetExtension().CompareIgnoreCaseToAscii("INC") == COMPARE_EQUAL; AppWin* p; - BOOL bSuccess = TRUE; + sal_Bool bSuccess = sal_True; if ( bIsResult ) { p = new AppError( this, aFilename ); @@ -1332,7 +1332,7 @@ BOOL BasicFrame::LoadFile( String aFilename ) } // Execute command -long BasicFrame::Command( short nID, BOOL bChecked ) +long BasicFrame::Command( short nID, sal_Bool bChecked ) { BasicError* pErr; @@ -1346,7 +1346,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) case RID_FILEOPEN: { String s; - if( QueryFileName( s, FT_BASIC_SOURCE | FT_RESULT_FILE, FALSE ) ) { + if( QueryFileName( s, FT_BASIC_SOURCE | FT_RESULT_FILE, sal_False ) ) { AddToLRU( s ); LoadFile( s ); // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); @@ -1387,7 +1387,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) { SbModule *pModule = ((AppBasEd*)pWork)->GetModule(); #if OSL_DEBUG_LEVEL > 1 - USHORT x; + sal_uInt16 x; x = pWork->GetLineNr(); x = ((AppBasEd*)pWork)->GetModule()->GetBPCount(); if ( !x ) @@ -1395,7 +1395,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) x = pModule->GetBPCount(); #endif - for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + for ( sal_uInt16 nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); @@ -1417,7 +1417,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) else { AppWin *w = NULL; - for ( w = pList->Last() ; w ? !w->ISA(AppBasEd) : FALSE ; w = pList->Prev() ) ; + for ( w = pList->Last() ; w ? !w->ISA(AppBasEd) : sal_False ; w = pList->Prev() ) ; if ( w ) { p = ((AppBasEd*)w); @@ -1430,7 +1430,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) if( bInBreak ) // Reset the flag - bInBreak = FALSE; + bInBreak = sal_False; else { if( IsAutoSave() && !SaveAll() ) break; @@ -1439,12 +1439,12 @@ long BasicFrame::Command( short nID, BOOL bChecked ) pStatus->Message( aString ); if( p ) { - BasicDLL::SetDebugMode( TRUE ); + BasicDLL::SetDebugMode( sal_True ); Basic().ClearGlobalVars(); p->Run(); - BasicDLL::SetDebugMode( FALSE ); + BasicDLL::SetDebugMode( sal_False ); // If cancelled during Interactive=FALSE -// BasicDLL::EnableBreak( TRUE ); +// BasicDLL::EnableBreak( sal_True ); } }} } @@ -1459,7 +1459,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) } break; case RID_RUNDISAS: - bDisas = BOOL( !bChecked ); + bDisas = sal_Bool( !bChecked ); break; case RID_RUNBREAK: if ( Basic().IsRunning() && !bInBreak ) @@ -1470,7 +1470,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) break; case RID_RUNSTOP: Basic().Stop(); - bInBreak = FALSE; + bInBreak = sal_False; break; case RID_RUNNEXTERR: pErr = pBasic->aErrors.Next(); @@ -1494,7 +1494,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) case RID_WINTILE: { WindowArrange aArange; - for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < pList->Count() ; i++ ) { aArange.AddWindow( pList->GetObject( i ) ); pList->GetObject( i )->Restore(); @@ -1518,7 +1518,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) case RID_WINTILEHORZ: { WindowArrange aArange; - for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < pList->Count() ; i++ ) { aArange.AddWindow( pList->GetObject( i ) ); pList->GetObject( i )->Restore(); @@ -1546,7 +1546,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) //#define WINDOWARRANGE_CASCADE 4 { WindowArrange aArange; - for ( ULONG i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uIntPtr i = 0 ; i < pList->Count() ; i++ ) { aArange.AddWindow( pList->GetObject( i ) ); pList->GetObject( i )->Restore(); @@ -1569,7 +1569,7 @@ long BasicFrame::Command( short nID, BOOL bChecked ) break; case RID_WINCASCADE: { - for ( USHORT i = 0 ; i < pList->Count() ; i++ ) + for ( sal_uInt16 i = 0 ; i < pList->Count() ; i++ ) { pList->GetObject( i )->Cascade( i ); } @@ -1631,22 +1631,22 @@ long BasicFrame::Command( short nID, BOOL bChecked ) // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPEDIT )); // So daß Delete richtig ist } } - return TRUE; + return sal_True; } -BOOL BasicFrame::SaveAll() +sal_Bool BasicFrame::SaveAll() { AppWin* p, *q = pWork; for( p = pList->First(); p; p = pList->Next() ) { - USHORT nRes = p->QuerySave( QUERY_DISK_CHANGED ); + sal_uInt16 nRes = p->QuerySave( QUERY_DISK_CHANGED ); if( (( nRes == SAVE_RES_ERROR ) && QueryBox(this,SttResId(IDS_ASKSAVEERROR)).Execute() == RET_NO ) || ( nRes == SAVE_RES_CANCEL ) ) - return FALSE; + return sal_False; } if ( q ) q->ToTop(); - return TRUE; + return sal_True; } IMPL_LINK( BasicFrame, ModuleWinExists, String*, pFilename ) @@ -1687,7 +1687,7 @@ AppWin* BasicFrame::FindWin( const String& rName ) return NULL; } -AppWin* BasicFrame::FindWin( USHORT nWinId ) +AppWin* BasicFrame::FindWin( sal_uInt16 nWinId ) { AppWin* p; for( p = pList->First(); p; p = pList->Next() ) @@ -1714,10 +1714,10 @@ IMPL_LINK( BasicFrame, WriteString, String*, pString ) if ( pList->Last() ) { pList->Last()->pDataEdit->ReplaceSelected( *pString ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } class NewFileDialog : public FileDialog @@ -1740,7 +1740,7 @@ void NewFileDialog::FilterSelect() return; // User decides after he has changed the path String aCurFilter = GetCurFilter(); - USHORT nFilterNr = 0; + sal_uInt16 nFilterNr = 0; while ( nFilterNr < GetFilterCount() && aCurFilter != GetFilterName( nFilterNr ) ) { nFilterNr++; @@ -1759,7 +1759,7 @@ void NewFileDialog::FilterSelect() short NewFileDialog::Execute() { - BOOL bRet = (BOOL)FileDialog::Execute(); + sal_Bool bRet = (sal_Bool)FileDialog::Execute(); if ( bRet ) { Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); @@ -1772,8 +1772,8 @@ short NewFileDialog::Execute() return bRet; } -BOOL BasicFrame::QueryFileName - (String& rName, FileType nFileType, BOOL bSave ) +sal_Bool BasicFrame::QueryFileName + (String& rName, FileType nFileType, sal_Bool bSave ) { NewFileDialog aDlg( this, bSave ? WinBits( WB_SAVEAS ) : WinBits( WB_OPEN ) ); @@ -1826,21 +1826,21 @@ BOOL BasicFrame::QueryFileName if ( rExtension == aDlg.GetFilterName( i ) ) rExtension = aDlg.GetFilterType( i ); */ - return TRUE; - } else return FALSE; + return sal_True; + } else return sal_False; } -USHORT BasicFrame::BreakHandler() +sal_uInt16 BasicFrame::BreakHandler() { - bInBreak = TRUE; + bInBreak = sal_True; // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); // MenuBar aBar( ResId( RID_APPMENUBAR ) ); -// aBar.EnableItem( RID_APPEDIT, FALSE ); +// aBar.EnableItem( RID_APPEDIT, sal_False ); SetAppMode( String( SttResId ( IDS_APPMODE_BREAK ) ) ); while( bInBreak ) GetpApp()->Yield(); SetAppMode( String( SttResId ( IDS_APPMODE_RUN ) ) ); -// aBar.EnableItem( RID_APPEDIT, TRUE ); +// aBar.EnableItem( RID_APPEDIT, sal_True ); // InitMenu(GetMenuBar()->GetPopupMenu( RID_APPRUN )); return nFlags; } @@ -1848,7 +1848,7 @@ USHORT BasicFrame::BreakHandler() void BasicFrame::LoadLibrary() { String s; - if( QueryFileName( s, FT_BASIC_LIBRARY, FALSE ) ) + if( QueryFileName( s, FT_BASIC_LIBRARY, sal_False ) ) { CloseAll(); SvFileStream aStrm( s, STREAM_STD_READ ); @@ -1858,7 +1858,7 @@ void BasicFrame::LoadLibrary() pBasic = pNew; // Show all contents if existing SbxArray* pMods = pBasic->GetModules(); - for( USHORT i = 0; i < pMods->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMods->Count(); i++ ) { SbModule* pMod = (SbModule*) pMods->Get( i ); AppWin* p = new AppBasEd( this, pMod ); @@ -1876,7 +1876,7 @@ void BasicFrame::LoadLibrary() void BasicFrame::SaveLibrary() { String s; - if( QueryFileName( s, FT_BASIC_LIBRARY, TRUE ) ) + if( QueryFileName( s, FT_BASIC_LIBRARY, sal_True ) ) { SvFileStream aStrm( s, STREAM_STD_WRITE ); if( !Basic().Store( aStrm ) ) @@ -1890,8 +1890,8 @@ String BasicFrame::GenRealString( const String &aResString ) String aType,aValue,aResult(aResString); String aString; xub_StrLen nInsertPos = 0; - BOOL bFound; - bFound = FALSE; + sal_Bool bFound; + bFound = sal_False; while ( (nStart = aResult.Search(StartKenn,nStartPos)) != STRING_NOTFOUND && (nGleich = aResult.SearchAscii("=",nStart+StartKenn.Len())) != STRING_NOTFOUND && @@ -1911,7 +1911,7 @@ String BasicFrame::GenRealString( const String &aResString ) aString.Erase(); } // if ( Resource::GetResManager()->IsAvailable( ResId( aValue ) ) ) - aString = String( SttResId( (USHORT)(aValue.ToInt32()) ) ); + aString = String( SttResId( (sal_uInt16)(aValue.ToInt32()) ) ); // else { // DBG_ERROR( "Could not load resource!" ); @@ -1920,12 +1920,12 @@ String BasicFrame::GenRealString( const String &aResString ) nInsertPos = nStart; nStartPos = nStart; aResult.Erase( nStart, nEnd-nStart+1 ); - bFound = TRUE; + bFound = sal_True; } else if ( aType.Search(BaseArgKenn) == 0 ) // Starts with BaseArgKenn { // TODO: What the hell is that for?? - USHORT nArgNr = USHORT( aType.Copy( BaseArgKenn.Len() ).ToInt32() ); + sal_uInt16 nArgNr = sal_uInt16( aType.Copy( BaseArgKenn.Len() ).ToInt32() ); DBG_ASSERT( aString.Search( CUniString("($Arg").Append( String::CreateFromInt32(nArgNr) ).AppendAscii(")") ) != STRING_NOTFOUND, "Extra Argument given in String"); aString.SearchAndReplace( CUniString("($Arg").Append( String::CreateFromInt32(nArgNr) ).AppendAscii(")"), aValue ); nStartPos = nStart; diff --git a/basic/source/app/app.hxx b/basic/source/app/app.hxx index cd76b6481def..5a501ec5efcf 100644 --- a/basic/source/app/app.hxx +++ b/basic/source/app/app.hxx @@ -67,7 +67,7 @@ public: void LoadIniFile(); void SetFocus(); - void Wait( BOOL ); + void Wait( sal_Bool ); DECL_LINK( LateInit, void * ); #ifdef DBG_UTIL @@ -76,7 +76,7 @@ public: }; -typedef USHORT FileType; +typedef sal_uInt16 FileType; #define FT_NO_FILE (FileType)0x00 // An error has occurred ... #define FT_BASIC_SOURCE (FileType)0x01 @@ -95,16 +95,16 @@ class BasicFrame : public WorkWindow, public SfxBroadcaster, public SfxListener using SystemWindow::Notify; using Window::Command; -virtual BOOL Close(); - BOOL CloseAll(); // Close all windows - BOOL CompileAll(); // Compile all texts +virtual sal_Bool Close(); + sal_Bool CloseAll(); // Close all windows + sal_Bool CompileAll(); // Compile all texts AutoTimer aLineNum; // Show the line numbers virtual void Resize(); virtual void Move(); virtual void GetFocus(); void LoadLibrary(); void SaveLibrary(); - BOOL bIsAutoRun; + sal_Bool bIsAutoRun; DisplayHidDlg* pDisplayHidDlg; // BreakPoint *pRunToCursorBP; @@ -114,8 +114,8 @@ virtual void GetFocus(); Timer aCheckFiles; // Checks the files for changes - BOOL bAutoReload; - BOOL bAutoSave; + sal_Bool bAutoReload; + sal_Bool bAutoSave; DECL_LINK( CheckAllFiles, Timer* ); MyBasicRef pBasic; // BASIC-Engine @@ -131,16 +131,16 @@ virtual void GetFocus(); FloatingExecutionStatus *pExecutionStatus; public: - BOOL IsAutoRun(); - void SetAutoRun( BOOL bAuto ); - BOOL bInBreak; // TRUE if in Break-Handler + sal_Bool IsAutoRun(); + void SetAutoRun( sal_Bool bAuto ); + sal_Bool bInBreak; // sal_True if in Break-Handler StatusLine* pStatus; // Status line EditList* pList; // List of edit windows AppWin* pWork; // Current edit window BasicPrinter* pPrn; // Printer - BOOL bDisas; // TRUE: disassemble - USHORT nFlags; // Debugging-Flags - USHORT nMaximizedWindows; // Number of maximized windows + sal_Bool bDisas; // sal_True: disassemble + sal_uInt16 nFlags; // Debugging-Flags + sal_uInt16 nMaximizedWindows; // Number of maximized windows void FocusWindow( AppWin *pWin ); void WinMax_Restore(); void WinShow_Hide(); @@ -162,25 +162,25 @@ public: MsgEdit* GetMsgTree( String aLogFileName ); DECL_LINK( Log, TTLogMsg * ); DECL_LINK( WinInfo, WinInfoRec * ); - BOOL LoadFile( String aFilename ); - long Command( short,BOOL=FALSE ); // Command handler + sal_Bool LoadFile( String aFilename ); + long Command( short,sal_Bool=sal_False ); // Command handler virtual void Command( const CommandEvent& rCEvt ); // Command handler - BOOL SaveAll(); // Save all windows - BOOL QueryFileName( String& rName, FileType nFileType, BOOL bSave ); // Query for filename + sal_Bool SaveAll(); // Save all windows + sal_Bool QueryFileName( String& rName, FileType nFileType, sal_Bool bSave ); // Query for filename DECL_LINK( ModuleWinExists, String* ); DECL_LINK( WriteString, String* ); AppBasEd* CreateModuleWin( SbModule* pMod ); AppBasEd* FindModuleWin( const String& ); AppError* FindErrorWin( const String& ); AppWin* FindWin( const String& ); - AppWin* FindWin( USHORT nWinId ); + AppWin* FindWin( sal_uInt16 nWinId ); AppWin* IsWinValid( AppWin* pMaybeWin ); - USHORT BreakHandler(); // Break-Handler-Callback + sal_uInt16 BreakHandler(); // Break-Handler-Callback void SetEditVar( SbxVariable *pVar ){ pEditVar = pVar;} SbxVariable* GetEditVar(){ return pEditVar;} - BOOL IsAutoReload() { return bAutoReload; } - BOOL IsAutoSave() { return bAutoSave; } + sal_Bool IsAutoReload() { return bAutoReload; } + sal_Bool IsAutoSave() { return bAutoSave; } void LoadIniFile(); virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); diff --git a/basic/source/app/appbased.cxx b/basic/source/app/appbased.cxx index 847a2fde02ec..fd7637fe26bf 100644 --- a/basic/source/app/appbased.cxx +++ b/basic/source/app/appbased.cxx @@ -60,11 +60,11 @@ AppBasEd::AppBasEd( BasicFrame* pParent, SbModule* p ) pBreakpoints->Show(); - ((TextEdit*)pDataEdit)->GetTextEditImp().pTextView->SetAutoIndentMode( TRUE ); + ((TextEdit*)pDataEdit)->GetTextEditImp().pTextView->SetAutoIndentMode( sal_True ); ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->SetMaxTextLen( STRING_MAXLEN ); // ((TextEdit*)pDataEdit)->GetTextEditImp().pTextEngine->SetWordDelimiters( CUniString(" ,.;:(){}[]\"'+-*/<>^\\") ); - ((TextEdit*)pDataEdit)->GetTextEditImp().SyntaxHighlight( TRUE ); - ((TextEdit*)pDataEdit)->SaveAsUTF8( TRUE ); + ((TextEdit*)pDataEdit)->GetTextEditImp().SyntaxHighlight( sal_True ); + ((TextEdit*)pDataEdit)->SaveAsUTF8( sal_True ); String aEmpty; @@ -110,7 +110,7 @@ void AppBasEd::Notify( SfxBroadcaster&, const SfxHint& rHint ) const SfxSimpleHint* p = PTR_CAST(SfxSimpleHint,&rHint); if( p ) { - ULONG nHintId = p->GetId(); + sal_uIntPtr nHintId = p->GetId(); if( nHintId == SBX_HINT_LANGUAGE_EXTENSION_LOADED ) { ((TextEdit*)pDataEdit)->GetTextEditImp().InvalidateSyntaxHighlight(); @@ -126,8 +126,8 @@ FileType AppBasEd::GetFileType() IMPL_LINK_INLINE_START( AppBasEd, EditChange, void *, p ) { (void) p; /* avoid warning about unused parameter */ - bCompiled = FALSE; - return TRUE; + bCompiled = sal_False; + return sal_True; } IMPL_LINK_INLINE_END( AppBasEd, EditChange, void *, p ) @@ -135,16 +135,16 @@ IMPL_LINK_INLINE_END( AppBasEd, EditChange, void *, p ) long AppBasEd::InitMenu( Menu* pMenu ) { AppEdit::InitMenu (pMenu ); - BOOL bRunning = pFrame->Basic().IsRunning(); + sal_Bool bRunning = pFrame->Basic().IsRunning(); pMenu->EnableItem( RID_RUNCOMPILE, !bCompiled && !bRunning ); - return TRUE; + return sal_True; } long AppBasEd::DeInitMenu( Menu* pMenu ) { AppEdit::DeInitMenu (pMenu ); pMenu->EnableItem( RID_RUNCOMPILE ); - return TRUE; + return sal_True; } // Menu Handler @@ -186,13 +186,13 @@ void AppBasEd::PostLoad() pMod->SetName( GetText() ); pMod->Clear(); pMod->SetSource( pDataEdit->GetText() ); - bCompiled = FALSE; // because the code might have changed in the meantime + bCompiled = sal_False; // because the code might have changed in the meantime AppEdit::PostLoad(); pBreakpoints->LoadBreakpoints( GetText() ); } -USHORT AppBasEd::ImplSave() +sal_uInt16 AppBasEd::ImplSave() { pBreakpoints->SaveBreakpoints( GetText() ); return AppEdit::ImplSave(); @@ -208,7 +208,7 @@ void AppBasEd::Reload() // Reload source code file after change void AppBasEd::LoadSource() { - BOOL bErr; + sal_Bool bErr; // if( pDataEdit->GetText().Len() != 0 ) return; String aName = pMod->GetName(); @@ -218,7 +218,7 @@ void AppBasEd::LoadSource() ErrorBox( this, SttResId( IDS_READERROR ) ).Execute(); else UpdateFileInfo( HAS_BEEN_LOADED ); - bCompiled = FALSE; // because the code might have changed in the meantime + bCompiled = sal_False; // because the code might have changed in the meantime } // Save as (new name) @@ -229,15 +229,15 @@ void AppBasEd::PostSaveAs() } // Compile -BOOL AppBasEd::Compile() +sal_Bool AppBasEd::Compile() { if( !pDataEdit->HasText() || bCompiled ) - return TRUE; + return sal_True; pMod->SetSource( pDataEdit->GetText() ); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if( pFrame->Basic().Compile( pMod ) ) { - bRes = TRUE; + bRes = sal_True; if( pFrame->bDisas ) Disassemble(); TextSelection aSel( pDataEdit->GetSelection() ); @@ -267,7 +267,7 @@ void AppBasEd::Run() { pFrame->Basic().Reset(); SbxArray* pAllModules = pFrame->Basic().GetModules(); - for (USHORT i = 0; i < pAllModules->Count(); i++) + for (sal_uInt16 i = 0; i < pAllModules->Count(); i++) { if ( (pAllModules->Get(i)->GetName()).Copy(0,2).CompareToAscii( "--" ) == COMPARE_EQUAL ) { diff --git a/basic/source/app/appbased.hxx b/basic/source/app/appbased.hxx index 339f0c1a3d18..ccda8ce68c69 100644 --- a/basic/source/app/appbased.hxx +++ b/basic/source/app/appbased.hxx @@ -43,12 +43,12 @@ class AppBasEd : public AppEdit { // Editor-Window: using DockingWindow::Notify; SbModuleRef pMod; // compile module - BOOL bCompiled; // TRUE if compiled + sal_Bool bCompiled; // sal_True if compiled protected: DECL_LINK( EditChange, void * ); #define BREAKPOINTSWIDTH 15 BreakpointWindow *pBreakpoints; - virtual USHORT ImplSave(); // Save file + virtual sal_uInt16 ImplSave(); // Save file public: TYPEINFO(); @@ -64,7 +64,7 @@ public: virtual void PostSaveAs(); // Postprocess of module... void Reload(); void LoadSource(); // Load source for object - BOOL Compile(); // Compile text + sal_Bool Compile(); // Compile text void Run(); // Run image void Disassemble(); // Disassemble image const String& GetModName() const { return pMod->GetName(); } diff --git a/basic/source/app/appedit.cxx b/basic/source/app/appedit.cxx index d5769f3acb31..e51fd41ea3af 100644 --- a/basic/source/app/appedit.cxx +++ b/basic/source/app/appedit.cxx @@ -83,8 +83,8 @@ AppEdit::~AppEdit() void AppEdit::LoadIniFile() { TextView *pTextView = ((TextEdit*)pDataEdit)->aEdit.pTextView; - BOOL bWasModified = pTextView->GetTextEngine()->IsModified(); - pTextView->GetTextEngine()->SetModified( FALSE ); + sal_Bool bWasModified = pTextView->GetTextEngine()->IsModified(); + pTextView->GetTextEngine()->SetModified( sal_False ); FontList aFontList( pFrame ); // Just some Window is needed Config aConf(Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") )); @@ -93,8 +93,8 @@ void AppEdit::LoadIniFile() String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 ); String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 ); Font aFont = aFontList.Get( aFontName, aFontStyle ); -// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT ); - ULONG nFontSize = aFontSize.ToInt32(); +// sal_uIntPtr nFontSize = aFontSize.GetValue( FUNIT_POINT ); + sal_uIntPtr nFontSize = aFontSize.ToInt32(); // aFont.SetSize( Size( nFontSize, nFontSize ) ); aFont.SetHeight( nFontSize ); @@ -103,7 +103,7 @@ void AppEdit::LoadIniFile() Font aFont2( OutputDevice::GetDefaultFont( DEFAULTFONT_FIXED, Application::GetSettings().GetUILanguage(), 0, pFrame )); } #endif - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); // aFont.SetAlign( ALIGN_BOTTOM ); // aFont.SetHeight( aFont.GetHeight()+2 ); pDataEdit->SetFont( aFont ); @@ -184,7 +184,7 @@ void AppEdit::SetScrollBarRanges() -USHORT AppEdit::GetLineNr() +sal_uInt16 AppEdit::GetLineNr() { return pDataEdit->GetLineNr(); } @@ -201,14 +201,14 @@ long AppEdit::InitMenu( Menu* pMenu ) if( pDataEdit ) { - USHORT UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount(); - USHORT RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount(); + sal_uInt16 UndoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetUndoActionCount(); + sal_uInt16 RedoCount = ((TextEdit*)pDataEdit)->aEdit.pTextEngine->GetUndoManager().GetRedoActionCount(); pMenu->EnableItem( RID_EDITUNDO, UndoCount > 0 ); pMenu->EnableItem( RID_EDITREDO, RedoCount > 0 ); } - return TRUE; + return sal_True; } long AppEdit::DeInitMenu( Menu* pMenu ) @@ -218,7 +218,7 @@ long AppEdit::DeInitMenu( Menu* pMenu ) pMenu->EnableItem( RID_EDITUNDO ); pMenu->EnableItem( RID_EDITREDO ); - return TRUE; + return sal_True; } void AppEdit::Resize() @@ -233,7 +233,7 @@ void AppEdit::Resize() if ( pHScroll ) { rHSize = pHScroll->GetSizePixel(); - ULONG nHieght = rHSize.Height(); + sal_uIntPtr nHieght = rHSize.Height(); rNewSize.Height() -= nHieght; rHStart.Y() = rNewSize.Height(); } @@ -241,7 +241,7 @@ void AppEdit::Resize() if ( pVScroll ) { rVSize = pVScroll->GetSizePixel(); - ULONG nWidth = rVSize.Width(); + sal_uIntPtr nWidth = rVSize.Width(); rNewSize.Width() -= nWidth; rVStart.X() = rNewSize.Width(); } @@ -293,7 +293,7 @@ void AppEdit::PostSaveAs() { } -void AppEdit::Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 ) +void AppEdit::Highlight( sal_uInt16 nLine, sal_uInt16 nCol1, sal_uInt16 nCol2 ) { ((TextEdit*)pDataEdit)->Highlight( nLine, nCol1, nCol2 ); ToTop(); diff --git a/basic/source/app/appedit.hxx b/basic/source/app/appedit.hxx index 4a003bd0482d..b2c71c09c454 100644 --- a/basic/source/app/appedit.hxx +++ b/basic/source/app/appedit.hxx @@ -44,7 +44,7 @@ public: ScrollBar *pVScroll; ScrollBar *pHScroll; void SetScrollBarRanges(); - ULONG nCurTextWidth; + sal_uIntPtr nCurTextWidth; private: void InitScrollBars(); protected: @@ -53,7 +53,7 @@ public: TYPEINFO(); AppEdit( BasicFrame* ); ~AppEdit(); - USHORT GetLineNr(); // Current line number + sal_uInt16 GetLineNr(); // Current line number FileType GetFileType(); // Returns the file type virtual long InitMenu( Menu* ); // Inits the menu virtual long DeInitMenu( Menu* ); // Reset to enable all Shortcuts @@ -62,8 +62,8 @@ public: void PostLoad(); void PostSaveAs(); void Mark( short, short, short ); // Select text - void Highlight( USHORT nLine, USHORT nCol1, USHORT nCol2 ); - virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); } + void Highlight( sal_uInt16 nLine, sal_uInt16 nCol1, sal_uInt16 nCol2 ); + virtual sal_Bool ReloadAllowed(){ return !StarBASIC::IsRunning(); } virtual void LoadIniFile(); // (re)load ini file after change }; diff --git a/basic/source/app/apperror.cxx b/basic/source/app/apperror.cxx index 001c77a38146..03c8aebd0bbe 100644 --- a/basic/source/app/apperror.cxx +++ b/basic/source/app/apperror.cxx @@ -65,10 +65,10 @@ long AppError::InitMenu( Menu* pMenu ) { AppWin::InitMenu (pMenu ); - pMenu->EnableItem( RID_EDITUNDO, FALSE ); - pMenu->EnableItem( RID_EDITREDO, FALSE ); + pMenu->EnableItem( RID_EDITUNDO, sal_False ); + pMenu->EnableItem( RID_EDITREDO, sal_False ); - return TRUE; + return sal_True; } long AppError::DeInitMenu( Menu* pMenu ) @@ -78,10 +78,10 @@ long AppError::DeInitMenu( Menu* pMenu ) pMenu->EnableItem( RID_EDITUNDO ); pMenu->EnableItem( RID_EDITREDO ); - return TRUE; + return sal_True; } -USHORT AppError::GetLineNr(){ return pDataEdit->GetLineNr(); } +sal_uInt16 AppError::GetLineNr(){ return pDataEdit->GetLineNr(); } FileType AppError::GetFileType() { @@ -103,12 +103,12 @@ void AppError::LoadIniFile() String aFontStyle = String( aConf.ReadKey( "ScriptFontStyle", "normal" ), RTL_TEXTENCODING_UTF8 ); String aFontSize = String( aConf.ReadKey( "ScriptFontSize", "12" ), RTL_TEXTENCODING_UTF8 ); Font aFont = aFontList.Get( aFontName, aFontStyle ); -// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT ); - ULONG nFontSize = aFontSize.ToInt32(); +// sal_uIntPtr nFontSize = aFontSize.GetValue( FUNIT_POINT ); + sal_uIntPtr nFontSize = aFontSize.ToInt32(); // aFont.SetSize( Size( nFontSize, nFontSize ) ); aFont.SetHeight( nFontSize ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); // aFont.SetAlign( ALIGN_BOTTOM ); // aFont.SetHeight( aFont.GetHeight()+2 ); pDataEdit->SetFont( aFont ); diff --git a/basic/source/app/apperror.hxx b/basic/source/app/apperror.hxx index c5be8836efd9..3a7028aeae4b 100644 --- a/basic/source/app/apperror.hxx +++ b/basic/source/app/apperror.hxx @@ -39,10 +39,10 @@ public: // long Command( short nID ); virtual long InitMenu( Menu* ); virtual long DeInitMenu( Menu* ); - USHORT GetLineNr(); + sal_uInt16 GetLineNr(); FileType GetFileType(); MsgEdit* GetMsgTree() { return ((MsgEdit*)pDataEdit); } - virtual BOOL ReloadAllowed(){ return !StarBASIC::IsRunning(); } + virtual sal_Bool ReloadAllowed(){ return !StarBASIC::IsRunning(); } virtual void LoadIniFile(); // (re)load ini file after change DirEntry aBaseDir; }; diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx index b0a6c07ec956..4d0a5f95fca4 100644 --- a/basic/source/app/appwin.cxx +++ b/basic/source/app/appwin.cxx @@ -52,10 +52,10 @@ TYPEINIT0(AppWin); AppWin::AppWin( BasicFrame* pParent ) : DockingWindow( pParent, WB_SIZEMOVE | WB_CLOSEABLE | WB_PINABLE ) , nSkipReload(0) -, bHasFile( FALSE ) -, bReloadAborted( FALSE ) +, bHasFile( sal_False ) +, bReloadAborted( sal_False ) , pFrame( pParent ) -, bFind( TRUE ) +, bFind( sal_True ) , pDataEdit(NULL) { // Load the Untitled string if not yet loaded @@ -64,7 +64,7 @@ AppWin::AppWin( BasicFrame* pParent ) nCount++; // Get maximized state from current window - USHORT nInitialWinState; + sal_uInt16 nInitialWinState; if ( pFrame->pWork ) { nInitialWinState = pFrame->pWork->GetWinState(); @@ -98,7 +98,7 @@ void AppWin::SetText( const XubString& rStr ) pFrame->WindowRenamed( this ); } -void AppWin::TitleButtonClick( USHORT nButton ) +void AppWin::TitleButtonClick( sal_uInt16 nButton ) { if ( TITLE_BUTTON_DOCKING == nButton ) if ( TT_WIN_STATE_MAX != nWinState ) @@ -106,7 +106,7 @@ void AppWin::TitleButtonClick( USHORT nButton ) else Restore(); else // if ( TITLE_BUTTON_HIDE == nButton ) - Minimize( TRUE ); + Minimize( sal_True ); } void AppWin::Maximize() @@ -116,7 +116,7 @@ void AppWin::Maximize() nNormalPos = GetPosPixel(); nNormalSize = GetSizePixel(); - SetFloatingMode( FALSE ); + SetFloatingMode( sal_False ); pFrame->nMaximizedWindows++; nWinState = TT_WIN_STATE_MAX; @@ -138,7 +138,7 @@ void AppWin::Maximize() void AppWin::Restore() { - SetFloatingMode( TRUE ); + SetFloatingMode( sal_True ); SetPosSizePixel( nNormalPos, nNormalSize ); if ( TT_WIN_STATE_MAX == nWinState ) @@ -148,7 +148,7 @@ void AppWin::Restore() pFrame->WinMax_Restore(); } -void AppWin::Minimize( BOOL bMinimize ) +void AppWin::Minimize( sal_Bool bMinimize ) { if ( bMinimize ) nWinState |= TT_WIN_STATE_HIDE; @@ -157,7 +157,7 @@ void AppWin::Minimize( BOOL bMinimize ) pFrame->WinMax_Restore(); } -void AppWin::Cascade( USHORT nNr ) +void AppWin::Cascade( sal_uInt16 nNr ) { Restore(); @@ -229,7 +229,7 @@ long AppWin::PreNotify( NotifyEvent& rNEvt ) if ( rNEvt.GetType() == EVENT_GETFOCUS ) if ( pFrame->pList->Last() != this ) Activate(); - return FALSE; // Der event soll weiter verarbeitet werden + return sal_False; // Der event soll weiter verarbeitet werden } void AppWin::Activate() @@ -242,14 +242,14 @@ long AppWin::InitMenu( Menu* pMenu ) { ::rtl::OUString aTemp; - BOOL bMarked; + sal_Bool bMarked; if( pDataEdit ) { TextSelection r = pDataEdit->GetSelection(); bMarked = r.HasRange(); } else - bMarked = FALSE; + bMarked = sal_False; pMenu->EnableItem( RID_EDITREPEAT, (aFind.Len() != 0 ) ); pMenu->EnableItem( RID_EDITCUT, bMarked ); pMenu->EnableItem( RID_EDITCOPY, bMarked ); @@ -257,20 +257,20 @@ long AppWin::InitMenu( Menu* pMenu ) pMenu->EnableItem( RID_EDITDEL, bMarked ); // pMenu->EnableItem( RID_HELPTOPIC, bMarked ); - BOOL bHasText; + sal_Bool bHasText; if( pDataEdit ) bHasText = pDataEdit->HasText(); else - bHasText = FALSE; - BOOL bRunning = pFrame->Basic().IsRunning(); - BOOL bCanExecute = BOOL( (!bRunning && bHasText) || pFrame->bInBreak ); + bHasText = sal_False; + sal_Bool bRunning = pFrame->Basic().IsRunning(); + sal_Bool bCanExecute = sal_Bool( (!bRunning && bHasText) || pFrame->bInBreak ); pMenu->EnableItem( RID_RUNSTART, bCanExecute ); pMenu->EnableItem( RID_RUNBREAK, bRunning && !pFrame->bInBreak); pMenu->EnableItem( RID_RUNSTOP, bRunning ); pMenu->EnableItem( RID_RUNTOCURSOR, bCanExecute ); pMenu->EnableItem( RID_RUNSTEPINTO, bCanExecute ); pMenu->EnableItem( RID_RUNSTEPOVER, bCanExecute ); - return TRUE; + return sal_True; } long AppWin::DeInitMenu( Menu* pMenu ) @@ -287,7 +287,7 @@ long AppWin::DeInitMenu( Menu* pMenu ) pMenu->EnableItem( RID_RUNTOCURSOR ); pMenu->EnableItem( RID_RUNSTEPINTO ); pMenu->EnableItem( RID_RUNSTEPOVER ); - return TRUE; + return sal_True; } // Menu Handler @@ -295,7 +295,7 @@ long AppWin::DeInitMenu( Menu* pMenu ) void AppWin::Command( const CommandEvent& rCEvt ) { TextSelection r = pDataEdit->GetSelection(); - BOOL bHasMark = r.HasRange(); + sal_Bool bHasMark = r.HasRange(); switch( rCEvt.GetCommand() ) { case RID_FILESAVE: QuerySave( QUERY_DISK_CHANGED | SAVE_NOT_DIRTY ); break; @@ -337,7 +337,7 @@ void AppWin::Command( const CommandEvent& rCEvt ) pDataEdit->BuildKontextMenu( pKontext ); if ( pKontext ) { - USHORT nRes = pKontext->Execute( this, GetPointerPosPixel() ); + sal_uInt16 nRes = pKontext->Execute( this, GetPointerPosPixel() ); if ( nRes ) pFrame->Command( nRes ); delete pKontext; @@ -348,12 +348,12 @@ void AppWin::Command( const CommandEvent& rCEvt ) } -BOOL AppWin::IsSkipReload() +sal_Bool AppWin::IsSkipReload() { return nSkipReload != 0; } -void AppWin::SkipReload( BOOL bSkip ) +void AppWin::SkipReload( sal_Bool bSkip ) { DBG_ASSERT( bSkip || nSkipReload, "SkipReload aufgehoben ohne es zu aktivieren"); if ( bSkip ) @@ -362,17 +362,17 @@ void AppWin::SkipReload( BOOL bSkip ) nSkipReload--; } -BOOL AppWin::DiskFileChanged( USHORT nWhat ) +sal_Bool AppWin::DiskFileChanged( sal_uInt16 nWhat ) { if ( !bHasFile ) - return FALSE; + return sal_False; switch ( nWhat ) { case SINCE_LAST_LOAD: { if ( bReloadAborted ) - return TRUE; + return sal_True; else return DiskFileChanged( SINCE_LAST_ASK_RELOAD ); } @@ -393,16 +393,16 @@ BOOL AppWin::DiskFileChanged( USHORT nWhat ) default: DBG_ERROR("Not Implemented in AppWin::DiskFileChanged"); } - return TRUE; + return sal_True; } -void AppWin::UpdateFileInfo( USHORT nWhat ) +void AppWin::UpdateFileInfo( sal_uInt16 nWhat ) { switch ( nWhat ) { case HAS_BEEN_LOADED: { - bReloadAborted = FALSE; + bReloadAborted = sal_False; UpdateFileInfo( ASKED_RELOAD ); } @@ -447,7 +447,7 @@ void AppWin::CheckReload() } else { - bReloadAborted = TRUE; + bReloadAborted = sal_True; } } } @@ -458,14 +458,14 @@ void AppWin::Reload() TextSelection aSelMemo = pDataEdit->GetSelection(); Load( GetText() ); pDataEdit->SetSelection( aSelMemo ); - SkipReload( FALSE ); + SkipReload( sal_False ); } // Load file -BOOL AppWin::Load( const String& aName ) +sal_Bool AppWin::Load( const String& aName ) { SkipReload(); - BOOL bErr; + sal_Bool bErr; // if( !QuerySave() ) // return; @@ -494,17 +494,17 @@ BOOL AppWin::Load( const String& aName ) SetText( aModName ); UpdateFileInfo( HAS_BEEN_LOADED ); PostLoad(); - bHasFile = TRUE; + bHasFile = sal_True; } - SkipReload( FALSE ); + SkipReload( sal_False ); return !bErr; } // Save file -USHORT AppWin::ImplSave() +sal_uInt16 AppWin::ImplSave() { SkipReload(); - USHORT nResult = SAVE_RES_NOT_SAVED; + sal_uInt16 nResult = SAVE_RES_NOT_SAVED; String s1 = *pNoName; String s2 = GetText().Copy( 0, s1.Len() ); if( s1 == s2 ) @@ -514,7 +514,7 @@ USHORT AppWin::ImplSave() if ( pDataEdit->Save( aName ) ) { nResult = SAVE_RES_SAVED; - bHasFile = TRUE; + bHasFile = sal_True; } else { @@ -523,38 +523,38 @@ USHORT AppWin::ImplSave() } UpdateFileInfo( HAS_BEEN_LOADED ); } - SkipReload( FALSE ); + SkipReload( sal_False ); return nResult; } // Save to new file name -USHORT AppWin::SaveAs() +sal_uInt16 AppWin::SaveAs() { SkipReload(); String s1 = *pNoName; String s2 = GetText().Copy( 0, s1.Len() ); if( s1 == s2 ) s2.Erase(); else s2 = GetText(); - if( pFrame->QueryFileName( s2, GetFileType(), TRUE ) ) + if( pFrame->QueryFileName( s2, GetFileType(), sal_True ) ) { SetText( s2 ); PostSaveAs(); - SkipReload( FALSE ); + SkipReload( sal_False ); return ImplSave(); } else { - SkipReload( FALSE ); + SkipReload( sal_False ); return SAVE_RES_CANCEL; } } // Should we save the file? -USHORT AppWin::QuerySave( QueryBits nBits ) +sal_uInt16 AppWin::QuerySave( QueryBits nBits ) { - BOOL bQueryDirty = ( nBits & QUERY_DIRTY ) != 0; - BOOL bQueryDiskChanged = ( nBits & QUERY_DISK_CHANGED ) != 0; - BOOL bSaveNotDirty = ( nBits & SAVE_NOT_DIRTY ) != 0; + sal_Bool bQueryDirty = ( nBits & QUERY_DIRTY ) != 0; + sal_Bool bQueryDiskChanged = ( nBits & QUERY_DISK_CHANGED ) != 0; + sal_Bool bSaveNotDirty = ( nBits & SAVE_NOT_DIRTY ) != 0; SkipReload(); short nResult; @@ -563,8 +563,8 @@ USHORT AppWin::QuerySave( QueryBits nBits ) else nResult = RET_NO; - BOOL bAlwaysEnableInput = pFrame->IsAlwaysEnableInput(); - pFrame->AlwaysEnableInput( FALSE ); + sal_Bool bAlwaysEnableInput = pFrame->IsAlwaysEnableInput(); + pFrame->AlwaysEnableInput( sal_False ); if( ( ( IsModified() || bSaveNotDirty ) && bQueryDirty ) || ( DiskFileChanged( SINCE_LAST_LOAD ) && bQueryDiskChanged ) ) { ToTop(); @@ -578,7 +578,7 @@ USHORT AppWin::QuerySave( QueryBits nBits ) } pFrame->AlwaysEnableInput( bAlwaysEnableInput ); - USHORT nReturn; + sal_uInt16 nReturn; switch( nResult ) { case RET_YES: @@ -594,11 +594,11 @@ USHORT AppWin::QuerySave( QueryBits nBits ) DBG_ERROR("switch default where no default should be: Internal error"); nReturn = SAVE_RES_CANCEL; } - SkipReload( FALSE ); + SkipReload( sal_False ); return nReturn; } -BOOL AppWin::Close() +sal_Bool AppWin::Close() { switch ( QuerySave( QUERY_DIRTY ) ) { @@ -607,21 +607,21 @@ BOOL AppWin::Close() { DockingWindow::Close(); delete this; - return TRUE; + return sal_True; } // uncomment to avoid compiler warning // break; case SAVE_RES_ERROR: - return FALSE; + return sal_False; // uncomment to avoid compiler warning // break; case SAVE_RES_CANCEL: - return FALSE; + return sal_False; // uncomment to avoid compiler warning // break; default: DBG_ERROR("Not Implemented in AppWin::Close"); - return FALSE; + return sal_False; } } @@ -631,7 +631,7 @@ void AppWin::Find() SttResId aResId( IDD_FIND_DIALOG ); FindDialog aDlg( this, aResId, aFind ); if( aDlg.Execute() ) { - bFind = TRUE; + bFind = sal_True; Repeat(); } } @@ -643,7 +643,7 @@ void AppWin::Replace() ReplaceDialog* pDlg = new ReplaceDialog (this, aResId, aFind, aReplace ); if( pDlg->Execute() ) { - bFind = FALSE; + bFind = sal_False; Repeat(); } } @@ -651,7 +651,7 @@ void AppWin::Replace() // Repeat search/replace operation void AppWin::Repeat() { - if( (aFind.Len() != 0 ) && ( pDataEdit->Find( aFind ) || (ErrorBox(this,SttResId(IDS_PATTERNNOTFOUND)).Execute() && FALSE) ) && !bFind ) + if( (aFind.Len() != 0 ) && ( pDataEdit->Find( aFind ) || (ErrorBox(this,SttResId(IDS_PATTERNNOTFOUND)).Execute() && sal_False) ) && !bFind ) pDataEdit->ReplaceSelected( aReplace ); } diff --git a/basic/source/app/appwin.hxx b/basic/source/app/appwin.hxx index 0e864e69eef9..928380d50df8 100644 --- a/basic/source/app/appwin.hxx +++ b/basic/source/app/appwin.hxx @@ -35,15 +35,15 @@ #include "app.hxx" #include "dataedit.hxx" -typedef USHORT QueryBits; +typedef sal_uInt16 QueryBits; #define QUERY_NONE ( QueryBits ( 0x00 ) ) #define QUERY_DIRTY ( QueryBits ( 0x01 ) ) #define QUERY_DISK_CHANGED ( QueryBits ( 0x02 ) ) #define QUERY_ALL ( QUERY_DIRTY | QUERY_DISK_CHANGED ) #define SAVE_NOT_DIRTY ( QueryBits ( 0x04 ) ) -#define SAVE_RES_SAVED TRUE -#define SAVE_RES_NOT_SAVED FALSE +#define SAVE_RES_SAVED sal_True +#define SAVE_RES_NOT_SAVED sal_False #define SAVE_RES_ERROR 3 #define SAVE_RES_CANCEL 4 @@ -69,68 +69,68 @@ protected: static short nCount; // number of edit windows static String *pNoName; // "Untitled" FileStat aLastAccess; // Last access time of loaded file - USHORT nSkipReload; // Sometimes there must not be a reload - BOOL bHasFile; // Otherwise reload does not make sense - BOOL bReloadAborted; // Is set if reload was cancelled so that we can ask again wehn closing + sal_uInt16 nSkipReload; // Sometimes there must not be a reload + sal_Bool bHasFile; // Otherwise reload does not make sense + sal_Bool bReloadAborted; // Is set if reload was cancelled so that we can ask again wehn closing short nId; // ID-Nummer( "Unnamed n" ) BasicFrame* pFrame; // Parent-Window // Icon* pIcon; // Document icon String aFind; // Search string String aReplace; // Replace string - BOOL bFind; // TRUE if search not replace + sal_Bool bFind; // sal_True if search not replace void RequestHelp( const HelpEvent& ); // Help handler void GetFocus(); // activate - virtual USHORT ImplSave(); // Save file - USHORT nWinState; // Maximized, Iconized or Normal + virtual sal_uInt16 ImplSave(); // Save file + sal_uInt16 nWinState; // Maximized, Iconized or Normal Point nNormalPos; // Position if normal Size nNormalSize; // Size if Normal virtual long PreNotify( NotifyEvent& rNEvt ); - USHORT nWinId; + sal_uInt16 nWinId; public: TYPEINFO(); AppWin( BasicFrame* ); ~AppWin(); DataEdit* pDataEdit; // Data area - virtual USHORT GetLineNr()=0; // Current line number + virtual sal_uInt16 GetLineNr()=0; // Current line number virtual long InitMenu( Menu* ); // Init of the menu virtual long DeInitMenu( Menu* ); // reset to enable all shortcuts virtual void Command( const CommandEvent& rCEvt ); // Command handler virtual void Resize(); virtual void Help(); - virtual BOOL Load( const String& ); // Load file + virtual sal_Bool Load( const String& ); // Load file virtual void PostLoad(){} // Set source at module - virtual USHORT SaveAs(); // Save file as + virtual sal_uInt16 SaveAs(); // Save file as virtual void PostSaveAs(){} virtual void Find(); // find text virtual void Replace(); // replace text virtual void Repeat(); // repeat find/replace - virtual BOOL Close(); // close window + virtual sal_Bool Close(); // close window virtual void Activate(); // window was activated virtual FileType GetFileType()=0; // returns the filetype - virtual BOOL ReloadAllowed(){ return TRUE; } + virtual sal_Bool ReloadAllowed(){ return sal_True; } virtual void Reload(); // Reload after change on disk virtual void LoadIniFile(){;} // (re)load ini file after change void CheckReload(); // Checks and asks if reload should performed - BOOL DiskFileChanged( USHORT nWhat ); // Checks file for changes - void UpdateFileInfo( USHORT nWhat ); // Remembers last file state - BOOL IsSkipReload(); // Should we test reload? - void SkipReload( BOOL bSkip = TRUE ); - USHORT GetWinState(){ return nWinState; } + sal_Bool DiskFileChanged( sal_uInt16 nWhat ); // Checks file for changes + void UpdateFileInfo( sal_uInt16 nWhat ); // Remembers last file state + sal_Bool IsSkipReload(); // Should we test reload? + void SkipReload( sal_Bool bSkip = sal_True ); + sal_uInt16 GetWinState(){ return nWinState; } void Maximize(); void Restore(); - void Minimize( BOOL bMinimize ); - void Cascade( USHORT nNr ); + void Minimize( sal_Bool bMinimize ); + void Cascade( sal_uInt16 nNr ); - USHORT QuerySave( QueryBits nBits = QUERY_ALL ); - BOOL IsModified() { return pDataEdit->IsModified(); } + sal_uInt16 QuerySave( QueryBits nBits = QUERY_ALL ); + sal_Bool IsModified() { return pDataEdit->IsModified(); } BasicFrame* GetBasicFrame() { return pFrame; } - virtual void TitleButtonClick( USHORT nButton ); + virtual void TitleButtonClick( sal_uInt16 nButton ); virtual void SetText( const XubString& rStr ); - USHORT GetWinId() { return nWinId; } - void SetWinId( USHORT nWId ) { nWinId = nWId; } + sal_uInt16 GetWinId() { return nWinId; } + void SetWinId( sal_uInt16 nWId ) { nWinId = nWId; } }; DECLARE_LIST( EditList, AppWin* ) diff --git a/basic/source/app/basicrt.cxx b/basic/source/app/basicrt.cxx index e6c9f550ad5b..2df8df0d53fe 100644 --- a/basic/source/app/basicrt.cxx +++ b/basic/source/app/basicrt.cxx @@ -63,7 +63,7 @@ xub_StrLen BasicRuntime::GetCol2() return pRun->nCol2; } -BOOL BasicRuntime::IsRun() +sal_Bool BasicRuntime::IsRun() { return pRun->IsRun(); } @@ -117,17 +117,17 @@ bool BasicRuntimeAccess::HasRuntime() return pINST && pINST->pRun != NULL; } -USHORT BasicRuntimeAccess::GetStackEntryCount() +sal_uInt16 BasicRuntimeAccess::GetStackEntryCount() { return GetSbData()->pErrStack->Count(); } -BasicErrorStackEntry BasicRuntimeAccess::GetStackEntry( USHORT nIndex ) +BasicErrorStackEntry BasicRuntimeAccess::GetStackEntry( sal_uInt16 nIndex ) { return BasicErrorStackEntry( GetSbData()->pErrStack->GetObject( nIndex ) ); } -BOOL BasicRuntimeAccess::HasStack() +sal_Bool BasicRuntimeAccess::HasStack() { return GetSbData()->pErrStack != NULL; } @@ -138,7 +138,7 @@ void BasicRuntimeAccess::DeleteStack() GetSbData()->pErrStack = NULL; } -BOOL BasicRuntimeAccess::IsRunInit() +sal_Bool BasicRuntimeAccess::IsRunInit() { return GetSbData()->bRunInit; } diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx index 7bafc87e548a..e7687222d5da 100644 --- a/basic/source/app/brkpnts.cxx +++ b/basic/source/app/brkpnts.cxx @@ -48,9 +48,9 @@ struct Breakpoint { - USHORT nLine; + sal_uInt16 nLine; - Breakpoint( USHORT nL ) { nLine = nL; } + Breakpoint( sal_uInt16 nL ) { nLine = nL; } }; @@ -62,7 +62,7 @@ BreakpointWindow::BreakpointWindow( Window *pParent ) , nCurYOffset( 0 ) , nMarkerPos( MARKER_NOMARKER ) , pModule( NULL ) -, bErrorMarker( FALSE ) +, bErrorMarker( sal_False ) { if ( !pImages ) pImages = new ImageList( SttResId( RID_IMGLST_LAYOUT ) ); @@ -90,7 +90,7 @@ void BreakpointWindow::Reset() void BreakpointWindow::SetModule( SbModule *pMod ) { pModule = pMod; - USHORT i; + sal_uInt16 i; for ( i=0 ; i < pModule->GetBPCount() ; i++ ) { InsertBreakpoint( pModule->GetBP( i ) ); @@ -106,13 +106,13 @@ void BreakpointWindow::SetBPsInModule() Breakpoint* pBrk = First(); while ( pBrk ) { - pModule->SetBP( (USHORT)pBrk->nLine ); + pModule->SetBP( (sal_uInt16)pBrk->nLine ); #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( (USHORT)pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif pBrk = Next(); } - for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + for ( sal_uInt16 nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); @@ -121,7 +121,7 @@ void BreakpointWindow::SetBPsInModule() } -void BreakpointWindow::InsertBreakpoint( USHORT nLine ) +void BreakpointWindow::InsertBreakpoint( sal_uInt16 nLine ) { Breakpoint* pNewBrk = new Breakpoint( nLine ); Breakpoint* pBrk = First(); @@ -152,7 +152,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine ) #endif if ( StarBASIC::IsRunning() ) { - for ( USHORT nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) + for ( sal_uInt16 nMethod = 0; nMethod < pModule->GetMethods()->Count(); nMethod++ ) { SbMethod* pMethod = (SbMethod*)pModule->GetMethods()->Get( nMethod ); DBG_ASSERT( pMethod, "Methode nicht gefunden! (NULL)" ); @@ -166,7 +166,7 @@ void BreakpointWindow::InsertBreakpoint( USHORT nLine ) } -Breakpoint* BreakpointWindow::FindBreakpoint( ULONG nLine ) +Breakpoint* BreakpointWindow::FindBreakpoint( sal_uIntPtr nLine ) { Breakpoint* pBrk = First(); while ( pBrk ) @@ -181,20 +181,20 @@ Breakpoint* BreakpointWindow::FindBreakpoint( ULONG nLine ) } -void BreakpointWindow::AdjustBreakpoints( ULONG nLine, BOOL bInserted ) +void BreakpointWindow::AdjustBreakpoints( sal_uIntPtr nLine, sal_Bool bInserted ) { if ( nLine == 0 ) //TODO: nLine == TEXT_PARA_ALL+1 return; Breakpoint* pBrk = First(); while ( pBrk ) { - BOOL bDelBrk = FALSE; + sal_Bool bDelBrk = sal_False; if ( pBrk->nLine == nLine ) { if ( bInserted ) pBrk->nLine++; else - bDelBrk = TRUE; + bDelBrk = sal_True; } else if ( pBrk->nLine > nLine ) { @@ -206,7 +206,7 @@ void BreakpointWindow::AdjustBreakpoints( ULONG nLine, BOOL bInserted ) if ( bDelBrk ) { - ULONG n = GetCurPos(); + sal_uIntPtr n = GetCurPos(); delete Remove( pBrk ); pBrk = Seek( n ); } @@ -232,7 +232,7 @@ void BreakpointWindow::LoadBreakpoints( String aFilename ) for ( i = 0 ; i < aBreakpoints.GetTokenCount( ';' ) ; i++ ) { - InsertBreakpoint( (USHORT)aBreakpoints.GetToken( i, ';' ).ToInt32() ); + InsertBreakpoint( (sal_uInt16)aBreakpoints.GetToken( i, ';' ).ToInt32() ); } } @@ -280,12 +280,12 @@ void BreakpointWindow::Paint( const Rectangle& ) #if OSL_DEBUG_LEVEL > 1 DBG_ASSERT( !pModule->IsCompiled() || pModule->IsBP( pBrk->nLine ), "Brechpunkt wurde nicht gesetzt" ); #endif - ULONG nLine = pBrk->nLine-1; - ULONG nY = nLine*nLineHeight - nCurYOffset; + sal_uIntPtr nLine = pBrk->nLine-1; + sal_uIntPtr nY = nLine*nLineHeight - nCurYOffset; DrawImage( Point( 0, nY ) + aBmpOff, aBrk ); pBrk = Next(); } - ShowMarker( TRUE ); + ShowMarker( sal_True ); } @@ -297,7 +297,7 @@ Breakpoint* BreakpointWindow::FindBreakpoint( const Point& rMousePos ) Breakpoint* pBrk = First(); while ( pBrk ) { - ULONG nLine = pBrk->nLine-1; + sal_uIntPtr nLine = pBrk->nLine-1; long nY = nLine*nLineHeight; if ( ( nYPos > nY ) && ( nYPos < ( nY + nLineHeight ) ) ) return pBrk; @@ -307,7 +307,7 @@ Breakpoint* BreakpointWindow::FindBreakpoint( const Point& rMousePos ) } -void BreakpointWindow::ToggleBreakpoint( USHORT nLine ) +void BreakpointWindow::ToggleBreakpoint( sal_uInt16 nLine ) { Breakpoint* pBrk = FindBreakpoint( nLine ); if ( pBrk ) // remove @@ -323,7 +323,7 @@ void BreakpointWindow::ToggleBreakpoint( USHORT nLine ) Invalidate(); } -void BreakpointWindow::ShowMarker( BOOL bShow ) +void BreakpointWindow::ShowMarker( sal_Bool bShow ) { if ( nMarkerPos == MARKER_NOMARKER ) return; @@ -343,7 +343,7 @@ void BreakpointWindow::ShowMarker( BOOL bShow ) aMarkerOff.X() = ( aOutSz.Width() - aMarkerSz.Width() ) / 2; aMarkerOff.Y() = ( nLineHeight - aMarkerSz.Height() ) / 2; - ULONG nY = nMarkerPos*nLineHeight - nCurYOffset; + sal_uIntPtr nY = nMarkerPos*nLineHeight - nCurYOffset; Point aPos( 0, nY ); aPos += aMarkerOff; if ( bShow ) @@ -361,23 +361,23 @@ void BreakpointWindow::MouseButtonDown( const MouseEvent& rMEvt ) long nLineHeight = GetTextHeight(); long nYPos = aMousePos.Y() + nCurYOffset; long nLine = nYPos / nLineHeight + 1; - ToggleBreakpoint( sal::static_int_cast< USHORT >(nLine) ); + ToggleBreakpoint( sal::static_int_cast< sal_uInt16 >(nLine) ); Invalidate(); } } -void BreakpointWindow::SetMarkerPos( USHORT nLine, BOOL bError ) +void BreakpointWindow::SetMarkerPos( sal_uInt16 nLine, sal_Bool bError ) { - ShowMarker( FALSE ); // Remove old one + ShowMarker( sal_False ); // Remove old one nMarkerPos = nLine; bErrorMarker = bError; - ShowMarker( TRUE ); // Draw new one + ShowMarker( sal_True ); // Draw new one Update(); } -void BreakpointWindow::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags ) +void BreakpointWindow::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags ) { (void) nFlags; /* avoid warning about unused parameter */ nCurYOffset -= nVertScroll; diff --git a/basic/source/app/brkpnts.hxx b/basic/source/app/brkpnts.hxx index 05a03666a71b..64d5c0a9d0d7 100644 --- a/basic/source/app/brkpnts.hxx +++ b/basic/source/app/brkpnts.hxx @@ -50,27 +50,27 @@ public: void SetModule( SbModule *pMod ); void SetBPsInModule(); - void InsertBreakpoint( USHORT nLine ); - void ToggleBreakpoint( USHORT nLine ); - void AdjustBreakpoints( ULONG nLine, BOOL bInserted ); + void InsertBreakpoint( sal_uInt16 nLine ); + void ToggleBreakpoint( sal_uInt16 nLine ); + void AdjustBreakpoints( sal_uIntPtr nLine, sal_Bool bInserted ); void LoadBreakpoints( String aFilename ); void SaveBreakpoints( String aFilename ); protected: - Breakpoint* FindBreakpoint( ULONG nLine ); + Breakpoint* FindBreakpoint( sal_uIntPtr nLine ); private: long nCurYOffset; - USHORT nMarkerPos; + sal_uInt16 nMarkerPos; SbModule* pModule; - BOOL bErrorMarker; + sal_Bool bErrorMarker; static ImageList *pImages; protected: virtual void Paint( const Rectangle& ); Breakpoint* FindBreakpoint( const Point& rMousePos ); - void ShowMarker( BOOL bShow ); + void ShowMarker( sal_Bool bShow ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); public: @@ -78,10 +78,10 @@ public: // void SetModulWindow( ModulWindow* pWin ) // { pModulWindow = pWin; } - void SetMarkerPos( USHORT nLine, BOOL bErrorMarker = FALSE ); + void SetMarkerPos( sal_uInt16 nLine, sal_Bool bErrorMarker = sal_False ); virtual void Scroll( long nHorzScroll, long nVertScroll, - USHORT nFlags = 0 ); + sal_uInt16 nFlags = 0 ); long& GetCurYOffset() { return nCurYOffset; } }; diff --git a/basic/source/app/dataedit.hxx b/basic/source/app/dataedit.hxx index cbb114108c56..29148bc79919 100644 --- a/basic/source/app/dataedit.hxx +++ b/basic/source/app/dataedit.hxx @@ -41,9 +41,9 @@ class Font; #define DATA_FUNC_DEF( MemberName, MemberType ) \ public: \ MemberType MemberName; \ - BOOL Find( const String& rStr ); \ - BOOL Load( const String& rStr ); \ - BOOL Save( const String& rStr ); \ + sal_Bool Find( const String& rStr ); \ + sal_Bool Load( const String& rStr ); \ + sal_Bool Save( const String& rStr ); \ \ void GrabFocus(){ MemberName.GrabFocus(); } \ void Show(){ MemberName.Show(); } \ @@ -62,13 +62,13 @@ public: void Redo(); \ String GetText() const; \ void SetText( const String& rStr ); \ - BOOL HasText() const; \ + sal_Bool HasText() const; \ String GetSelected(); \ TextSelection GetSelection() const; \ void SetSelection( const TextSelection& rSelection ); \ - USHORT GetLineNr() const; \ + sal_uInt16 GetLineNr() const; \ void ReplaceSelected( const String& rStr ); \ - BOOL IsModified(); \ + sal_Bool IsModified(); \ void SetModifyHdl( Link l ); @@ -85,19 +85,19 @@ public: virtual void Undo()=0; virtual void Redo()=0; - virtual BOOL Find( const String& )=0; // Find and select text - virtual BOOL Load( const String& )=0; // Load text from file - virtual BOOL Save( const String& )=0; // Save text to file + virtual sal_Bool Find( const String& )=0; // Find and select text + virtual sal_Bool Load( const String& )=0; // Load text from file + virtual sal_Bool Save( const String& )=0; // Save text to file virtual String GetSelected()=0; virtual void GrabFocus()=0; virtual TextSelection GetSelection() const=0; virtual void SetSelection( const TextSelection& rSelection )=0; - virtual USHORT GetLineNr() const=0; + virtual sal_uInt16 GetLineNr() const=0; virtual String GetText() const=0; virtual void SetText( const String& rStr )=0; - virtual BOOL HasText() const=0; // to avoid GetText.Len() + virtual sal_Bool HasText() const=0; // to avoid GetText.Len() virtual void ReplaceSelected( const String& rStr )=0; - virtual BOOL IsModified()=0; + virtual sal_Bool IsModified()=0; virtual void SetModifyHdl( Link )=0; virtual void Show()=0; virtual void SetPosPixel( const Point& rNewPos )=0; diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx index c5abb472a0e4..85f09b6b6cd0 100644 --- a/basic/source/app/dialogs.cxx +++ b/basic/source/app/dialogs.cxx @@ -108,9 +108,9 @@ IMPL_LINK_INLINE_START( FindDialog, ButtonClick, Button *, pB ) { if( pB == &aOk ) { *pFind = aFind.GetText(); - EndDialog( TRUE ); - } else EndDialog( FALSE ); - return TRUE; + EndDialog( sal_True ); + } else EndDialog( sal_False ); + return sal_True; } IMPL_LINK_INLINE_END( FindDialog, ButtonClick, Button *, pB ) @@ -138,9 +138,9 @@ IMPL_LINK( ReplaceDialog, ButtonClick, Button *, pB ) if( pB == &aOk ) { *pFind = aFind.GetText(); *pReplace = aReplace.GetText(); - EndDialog( TRUE ); - } else EndDialog( FALSE ); - return TRUE; + EndDialog( sal_True ); + } else EndDialog( sal_False ); + return sal_True; } //////////////////////////////////////////////////////////////////// @@ -163,7 +163,7 @@ void ConfEdit::Init( Config &aConf ) aEdit.SetText( aTemp ); } -ConfEdit::ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ) +ConfEdit::ConfEdit( Window* pParent, sal_uInt16 nResText, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ) : PushButton( pParent, SttResId(nResButton) ) , aText( pParent, SttResId(nResText) ) , aEdit( pParent, SttResId(nResEdit) ) @@ -172,7 +172,7 @@ ConfEdit::ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nR Init( aConf ); } -ConfEdit::ConfEdit( Window* pParent, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ) +ConfEdit::ConfEdit( Window* pParent, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ) : PushButton( pParent, SttResId(nResButton) ) , aText( pParent ) , aEdit( pParent, SttResId(nResEdit) ) @@ -210,7 +210,7 @@ void ConfEdit::Click() } } -OptConfEdit::OptConfEdit( Window* pParent, USHORT nResCheck, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ) +OptConfEdit::OptConfEdit( Window* pParent, sal_uInt16 nResCheck, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ) : ConfEdit( pParent, nResEdit, nResButton, aKN, aConf ) , aCheck( pParent, SttResId( nResCheck ) ) , rBase( rBaseEdit ) @@ -260,7 +260,7 @@ OptionsDialog::OptionsDialog( Window* pParent, const ResId& aResId ) , aCancel( this ) , aConfig( Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ) ) { - aConfig.EnablePersistence( FALSE ); + aConfig.EnablePersistence( sal_False ); FreeResource(); aTabCtrl.SetActivatePageHdl( LINK( this, OptionsDialog, ActivatePageHdl ) ); aTabCtrl.SetCurPageId( RID_TP_PRO ); @@ -274,25 +274,25 @@ OptionsDialog::OptionsDialog( Window* pParent, const ResId& aResId ) OptionsDialog::~OptionsDialog() { - for ( USHORT i = 0; i < aTabCtrl.GetPageCount(); i++ ) + for ( sal_uInt16 i = 0; i < aTabCtrl.GetPageCount(); i++ ) delete aTabCtrl.GetTabPage( aTabCtrl.GetPageId( i ) ); }; -BOOL OptionsDialog::Close() +sal_Bool OptionsDialog::Close() { if ( TabDialog::Close() ) { delete this; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } IMPL_LINK( OptionsDialog, ActivatePageHdl, TabControl *, pTabCtrl ) { - USHORT nId = pTabCtrl->GetCurPageId(); + sal_uInt16 nId = pTabCtrl->GetCurPageId(); // If TabPage was not yet created, do it if ( !pTabCtrl->GetTabPage( nId ) ) { @@ -362,7 +362,7 @@ IMPL_LINK( OptionsDialog, OKClick, Button *, pButton ) } const ByteString ProfilePrefix("_profile_"); -const USHORT ProfilePrefixLen = ProfilePrefix.Len(); +const sal_uInt16 ProfilePrefixLen = ProfilePrefix.Len(); ProfileOptions::ProfileOptions( Window* pParent, Config &rConfig ) : TabPage( pParent, SttResId( RID_TP_PROFILE ) ) @@ -384,7 +384,7 @@ ProfileOptions::ProfileOptions( Window* pParent, Config &rConfig ) { FreeResource(); - aCbProfile.EnableAutocomplete( TRUE ); + aCbProfile.EnableAutocomplete( sal_True ); aCbProfile.SetSelectHdl( LINK( this, ProfileOptions, Select ) ); @@ -399,7 +399,7 @@ ProfileOptions::ProfileOptions( Window* pParent, Config &rConfig ) void ProfileOptions::LoadData() { // collect all profiles (all groups starting with the ProfilePrefix) - for ( USHORT i = 0 ; i < rConf.GetGroupCount() ; i++ ) + for ( sal_uInt16 i = 0 ; i < rConf.GetGroupCount() ; i++ ) { ByteString aProfile = rConf.GetGroupName( i ); if ( aProfile.Match( ProfilePrefix ) ) @@ -520,7 +520,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) { FreeResource(); - aNFCRPort.SetUseThousandSep( FALSE ); + aNFCRPort.SetUseThousandSep( sal_False ); ByteString aTemp; @@ -530,7 +530,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) if ( aTemp.EqualsIgnoreCaseAscii( "true" ) || aTemp.Equals( "1" ) ) aCBUseProxy.Check(); else - aCBUseProxy.Check( FALSE ); + aCBUseProxy.Check( sal_False ); aCBUseProxy.SetToggleHdl( LINK( this, CrashreportOptions, CheckProxy ) ); LINK( this, CrashreportOptions, CheckProxy ).Call( NULL ); // call once to initialize @@ -545,7 +545,7 @@ CrashreportOptions::CrashreportOptions( Window* pParent, Config &aConfig ) if ( aTemp.EqualsIgnoreCaseAscii( "true" ) || aTemp.Equals( "1" ) ) aCBAllowContact.Check(); else - aCBAllowContact.Check( FALSE ); + aCBAllowContact.Check( sal_False ); aCBAllowContact.SetToggleHdl( LINK( this, CrashreportOptions, CheckResponse ) ); LINK( this, CrashreportOptions, CheckResponse ).Call( NULL ); // call once to initialize @@ -611,9 +611,9 @@ MiscOptions::MiscOptions( Window* pParent, Config &aConfig ) { FreeResource(); - aNFTTPort.SetUseThousandSep( FALSE ); - aNFUNOPort.SetUseThousandSep( FALSE ); - aTFMaxLRU.SetUseThousandSep( FALSE ); + aNFTTPort.SetUseThousandSep( sal_False ); + aNFUNOPort.SetUseThousandSep( sal_False ); + aTFMaxLRU.SetUseThousandSep( sal_False ); ByteString aTemp; @@ -661,8 +661,8 @@ void MiscOptions::Save( Config &aConfig ) aConfig.SetGroup("LRU"); ByteString aTemp = aConfig.ReadKey( "MaxLRU", "4" ); - USHORT nOldMaxLRU = (USHORT)aTemp.ToInt32(); - USHORT n; + sal_uInt16 nOldMaxLRU = (sal_uInt16)aTemp.ToInt32(); + sal_uInt16 n; for ( n = nOldMaxLRU ; n > aTFMaxLRU.GetValue() ; n-- ) aConfig.DeleteKey( ByteString("LRU").Append( ByteString::CreateFromInt32( n ) ) ); aConfig.WriteKey( "MaxLRU", ByteString::CreateFromInt64( aTFMaxLRU.GetValue() ) ); @@ -735,8 +735,8 @@ IMPL_LINK( FontOptions, FontSizeChanged, void*, EMPTYARG ) void FontOptions::UpdatePreview() { Font aFont = aFontList.Get( aFontName.GetText(), aFontStyle.GetText() ); -// ULONG nFontSize = aFontSize.GetValue( FUNIT_POINT ); - ULONG nFontSize = static_cast((aFontSize.GetValue() + 5) / 10); +// sal_uIntPtr nFontSize = aFontSize.GetValue( FUNIT_POINT ); + sal_uIntPtr nFontSize = static_cast((aFontSize.GetValue() + 5) / 10); aFont.SetHeight( nFontSize ); aFTPreview.SetFont( aFont ); aFTPreview.SetText( aFontName.GetText() ); @@ -770,13 +770,13 @@ GenericOptions::GenericOptions( Window* pParent, Config &aConfig ) , aPbDelValue( this, SttResId( RID_PB_DEL_VALUE ) ) , nMoveButtons( 0 ) -, bShowSelectPath( FALSE ) +, bShowSelectPath( sal_False ) { FreeResource(); LoadData(); - aCbArea.EnableAutocomplete( TRUE ); - aCbValue.EnableAutocomplete( TRUE ); + aCbArea.EnableAutocomplete( sal_True ); + aCbValue.EnableAutocomplete( sal_True ); aCbArea.SetSelectHdl( LINK( this, GenericOptions, LoadGroup ) ); @@ -802,7 +802,7 @@ GenericOptions::~GenericOptions() StringList* GenericOptions::GetAllGroups() { StringList* pGroups = new StringList(); - for ( USHORT i = 0 ; i < aConf.GetGroupCount() ; i++ ) + for ( sal_uInt16 i = 0 ; i < aConf.GetGroupCount() ; i++ ) { String *pGroup = new String( aConf.GetGroupName( i ), RTL_TEXTENCODING_UTF8 ); pGroups->Insert( pGroup ); @@ -841,16 +841,16 @@ void GenericOptions::ShowSelectPath( const String aType ) { // Show Path button nMoveButtons += nDelta; aMoveTimer.Start(); - bShowSelectPath = TRUE; - aPbSelectPath.Show( TRUE ); - aPbSelectPath.Enable( TRUE ); + bShowSelectPath = sal_True; + aPbSelectPath.Show( sal_True ); + aPbSelectPath.Enable( sal_True ); } else if ( !aType.EqualsIgnoreCaseAscii( "PATH" ) && bShowSelectPath ) { // Hide Path button nMoveButtons -= nDelta; aMoveTimer.Start(); - bShowSelectPath = FALSE; - aPbSelectPath.Enable( FALSE ); + bShowSelectPath = sal_False; + aPbSelectPath.Enable( sal_False ); } } @@ -903,7 +903,7 @@ IMPL_LINK( GenericOptions, LoadGroup, ComboBox*, EMPTYARG ) aConf.SetGroup( aLastGroupName ); aConf.WriteKey( C_KEY_AKTUELL, ByteString( aCurrentValue, RTL_TEXTENCODING_UTF8 ) ); - USHORT i; + sal_uInt16 i; for ( i=0 ; i < aCbValue.GetEntryCount() ; i++ ) { if ( i > 0 ) @@ -1021,16 +1021,16 @@ class TextAndWin : public DockingWindow Window* pFtOriginalParent; Window* pWinOriginalParent; long nSpace; // default space - BOOL bAlignTop; + sal_Bool bAlignTop; public: - TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, BOOL bAlignTopP ); + TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, sal_Bool bAlignTopP ); ~TextAndWin(); virtual void Resize(); }; -TextAndWin::TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, BOOL bAlignTopP ) +TextAndWin::TextAndWin( Window *pParent, FixedText *pFtP, Window *pWinP, long nSpaceP, sal_Bool bAlignTopP ) : DockingWindow( pParent ) , pFt( pFtP ) , pWin( pWinP ) @@ -1112,8 +1112,8 @@ DisplayHidDlg::DisplayHidDlg( Window * pParent ) #endif pSplit = new SplitWindow( this ); - pControls = new TextAndWin( pSplit, &aFtControls, &aMlbControls, aMlbControls.GetPosPixel().X(), TRUE ); - pSlots = new TextAndWin( pSplit, &aFtSlots, &aMlbSlots, aMlbControls.GetPosPixel().X(), FALSE ); + pControls = new TextAndWin( pSplit, &aFtControls, &aMlbControls, aMlbControls.GetPosPixel().X(), sal_True ); + pSlots = new TextAndWin( pSplit, &aFtSlots, &aMlbSlots, aMlbControls.GetPosPixel().X(), sal_False ); pSplit->SetPosPixel( aFtControls.GetPosPixel() ); pSplit->InsertItem( 1, pControls, 70, SPLITWINDOW_APPEND, 0, SWIB_PERCENTSIZE ); @@ -1139,7 +1139,7 @@ DisplayHidDlg::~DisplayHidDlg() IMPL_LINK( DisplayHidDlg, CopyToClipboard, void*, EMPTYARG ) { String aSammel; - USHORT i; + sal_uInt16 i; for ( i=0 ; i < aMlbControls.GetSelectEntryCount() ; i++ ) { @@ -1161,7 +1161,7 @@ IMPL_LINK( DisplayHidDlg, SelectAll, PushButton*, pButton ) { if ( pButton->GetState() != STATE_CHECK ) { - USHORT i; + sal_uInt16 i; for ( i=0 ; i < aMlbControls.GetEntryCount() ; i++ ) aMlbControls.SelectEntryPos( i ); for ( i=0 ; i < aMlbSlots.GetEntryCount() ; i++ ) @@ -1266,7 +1266,7 @@ void DisplayHidDlg::Resize() } else { -// SetUpdateMode( FALSE ); +// SetUpdateMode( sal_False ); // Minimum size Size aSize( GetOutputSizePixel() ); @@ -1322,7 +1322,7 @@ void DisplayHidDlg::Resize() aPos.Move( pSplit->GetSizePixel().Width(), pSplit->GetSizePixel().Height() ); aOKClose.SetPosPixel( aPos ); -// SetUpdateMode( TRUE ); +// SetUpdateMode( sal_True ); // Invalidate(); } FloatingWindow::Resize(); @@ -1402,7 +1402,7 @@ VarEditDialog::VarEditDialog( Window * pParent, SbxVariable *pPVar ) IMPL_LINK( VarEditDialog, OKClick, Button *, pButton ) { (void) pButton; /* avoid warning about unused parameter */ - BOOL bWasError = SbxBase::IsError(); // Probably an error is thrown + sal_Bool bWasError = SbxBase::IsError(); // Probably an error is thrown SbxDataType eType = pVar->GetType(); @@ -1445,7 +1445,7 @@ SvNumberformat:: String aContent( aEditRID_ED_NEW_STRING.GetText() ); - BOOL bError = FALSE; + sal_Bool bError = sal_False; switch ( eType ) { case SbxBOOL: @@ -1458,10 +1458,10 @@ SvNumberformat:: // pVar->PutDate( aContent ); // break; case SbxINTEGER: - pVar->PutInteger( (INT16)aNumericFieldRID_NF_NEW_INTEGER.GetValue() ); + pVar->PutInteger( (sal_Int16)aNumericFieldRID_NF_NEW_INTEGER.GetValue() ); break; case SbxLONG: - pVar->PutLong( static_cast(aNumericFieldRID_NF_NEW_LONG.GetValue()) ); + pVar->PutLong( static_cast(aNumericFieldRID_NF_NEW_LONG.GetValue()) ); break; case SbxDOUBLE: case SbxSINGLE: @@ -1482,7 +1482,7 @@ SvNumberformat:: // pVar->PutStringExt( aEditRID_ED_NEW_STRING.GetText() ); if ( !bWasError && SbxBase::IsError() ) { - bError = TRUE; + bError = sal_True; SbxBase::ResetError(); } diff --git a/basic/source/app/dialogs.hxx b/basic/source/app/dialogs.hxx index fbd67aa85f1b..e0a2409ad937 100644 --- a/basic/source/app/dialogs.hxx +++ b/basic/source/app/dialogs.hxx @@ -104,8 +104,8 @@ protected: void Init( Config &aConf ); public: - ConfEdit( Window* pParent, USHORT nResText, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ); - ConfEdit( Window* pParent, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, Config &aConf ); + ConfEdit( Window* pParent, sal_uInt16 nResText, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ); + ConfEdit( Window* pParent, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, Config &aConf ); void Save( Config &aConf ); void Reload( Config &aConf ); void Click(); @@ -121,7 +121,7 @@ protected: ConfEdit& rBase; DECL_LINK( ToggleHdl, CheckBox* ); public: - OptConfEdit( Window* pParent, USHORT nResCheck, USHORT nResEdit, USHORT nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ); + OptConfEdit( Window* pParent, sal_uInt16 nResCheck, sal_uInt16 nResEdit, sal_uInt16 nResButton, const ByteString& aKN, ConfEdit& rBaseEdit, Config& aConf ); void Reload( Config &aConf ); DECL_LINK( BaseModifyHdl, Edit* ); }; @@ -141,7 +141,7 @@ private: public: OptionsDialog( Window* pParent, const ResId& ); ~OptionsDialog(); - virtual BOOL Close(); + virtual sal_Bool Close(); DECL_LINK( ActivatePageHdl, TabControl * ); @@ -273,7 +273,7 @@ class GenericOptions : public TabPage PushButton aPbDelValue; int nMoveButtons; - BOOL bShowSelectPath; + sal_Bool bShowSelectPath; AutoTimer aMoveTimer; DECL_LINK( MoveButtons, AutoTimer* ); @@ -321,7 +321,7 @@ protected: DockingWindow* pSlots; SplitWindow *pSplit; - ULONG nDisplayMode; + sal_uIntPtr nDisplayMode; DECL_LINK( Select, void* ); DECL_LINK( SelectAll, PushButton* ); @@ -360,7 +360,7 @@ protected: DECL_LINK( OKClick, Button * ); -// BOOL bCompare = FALSE; +// sal_Bool bCompare = sal_False; // String aCompareString; public: diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx index 51864a397435..21febe8b3393 100644 --- a/basic/source/app/msgedit.cxx +++ b/basic/source/app/msgedit.cxx @@ -57,10 +57,10 @@ Version 3 Changed Charset from CHARSET_IBMPC to RTL_TEXTENCODING_UTF8 #include "basmsg.hrc" #include "basrid.hxx" -USHORT MsgEdit::nMaxLogLen = 0; -BOOL MsgEdit::bLimitLogLen = FALSE; -BOOL MsgEdit::bPrintLogToStdout = FALSE; -BOOL MsgEdit::bPrintLogToStdoutSet = FALSE; +sal_uInt16 MsgEdit::nMaxLogLen = 0; +sal_Bool MsgEdit::bLimitLogLen = sal_False; +sal_Bool MsgEdit::bPrintLogToStdout = sal_False; +sal_Bool MsgEdit::bPrintLogToStdoutSet = sal_False; #define WARNING_PREFIX String( SttResId( S_WARNING_PREFIX ) ) #define VERSION_STRING CUniString("File Format Version: ") @@ -74,8 +74,8 @@ MsgEdit::MsgEdit( AppError* pParent, BasicFrame *pBF, const WinBits& aBits ) , pCurrentTestCase(NULL) , pCurrentAssertion( NULL ) , pCurrentError(NULL) -, bModified(FALSE) -, bFileLoading(FALSE) +, bModified(sal_False) +, bFileLoading(sal_False) , nVersion(0) , pAppError( pParent ) , aEditTree( pParent, pBF, aBits | WB_HASBUTTONS | WB_HASLINES | WB_HASBUTTONSATROOT ) @@ -88,15 +88,15 @@ MsgEdit::MsgEdit( AppError* pParent, BasicFrame *pBF, const WinBits& aBits ) if ( !bPrintLogToStdoutSet ) { - bPrintLogToStdoutSet = TRUE; - for ( USHORT i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) + bPrintLogToStdoutSet = sal_True; + for ( sal_uInt16 i = 0 ; i < Application::GetCommandLineParamCount() ; i++ ) { if ( Application::GetCommandLineParam( i ).Copy(0,9).CompareIgnoreCaseToAscii("-printlog") == COMPARE_EQUAL #ifndef UNX || Application::GetCommandLineParam( i ).Copy(0,9).CompareIgnoreCaseToAscii("/printlog") == COMPARE_EQUAL #endif ) - bPrintLogToStdout = TRUE; + bPrintLogToStdout = sal_True; } } } @@ -177,11 +177,11 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg ) if ( !bFileLoading ) { // Comes from Testtool and must be written immediately - BOOL bFileWasChanged = pAppError->DiskFileChanged( SINCE_LAST_LOAD ); + sal_Bool bFileWasChanged = pAppError->DiskFileChanged( SINCE_LAST_LOAD ); DBG_ASSERT( aLogFileName == LogMsg->aLogFileName, "Logging to different logfile as before" ); DirEntry aEntry( LogMsg->aLogFileName ); - BOOL bNewFile = !aEntry.Exists(); + sal_Bool bNewFile = !aEntry.Exists(); SvFileStream aStrm( LogMsg->aLogFileName, STREAM_STD_WRITE ); if ( bNewFile ) { @@ -229,7 +229,7 @@ void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) { if ( !bFileLoading && bLimitLogLen ) { - USHORT nSkip = nMaxLogLen; + sal_uInt16 nSkip = nMaxLogLen; SvLBoxEntry *pRun = aEditTree.First(); while ( nSkip-- && pRun ) pRun = aEditTree.NextSibling( pRun ); @@ -240,7 +240,7 @@ void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) aEditTree.GetModel()->Remove( aEditTree.NextSibling( pRun ) ); aEditTree.GetModel()->Remove( pRun ); - bModified = TRUE; + bModified = sal_True; lModify.Call( NULL ); Save( aLogFileName ); pAppError->UpdateFileInfo( HAS_BEEN_LOADED ); @@ -249,9 +249,9 @@ void MsgEdit::AddRun( String aMsg, TTDebugData aDebugData ) COPY_TTDEBUGDATA( LOG_RUN ); if ( !bFileLoading || ( bFileLoading && nVersion >= 2 ) ) - pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, FALSE, 0, pTTDebugData ); + pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, sal_False, 0, pTTDebugData ); else // First file format - pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, FALSE, LIST_APPEND, pTTDebugData ); // and therefor at the end + pCurrentRun = aEditTree.InsertEntry( aMsg, NULL, sal_False, LIST_APPEND, pTTDebugData ); // and therefor at the end aEditTree.ShowEntry( pCurrentRun ); pCurrentTestCase = NULL; @@ -270,7 +270,7 @@ void MsgEdit::AddTestCase( String aMsg, TTDebugData aDebugData ) else { COPY_TTDEBUGDATA( LOG_TEST_CASE ); - pCurrentTestCase = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pCurrentTestCase = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pCurrentTestCase ); } } @@ -292,7 +292,7 @@ void MsgEdit::AddError( String aMsg, TTDebugData aDebugData ) if ( pCurrentTestCase ) { COPY_TTDEBUGDATA( LOG_ERROR ); - pCurrentError = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pCurrentError = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pCurrentError ); } } @@ -303,7 +303,7 @@ void MsgEdit::AddCallStack( String aMsg, TTDebugData aDebugData ) if ( pCurrentError ) { COPY_TTDEBUGDATA( LOG_CALL_STACK ); - aEditTree.InsertEntry( aMsg, pCurrentError, FALSE, LIST_APPEND, pTTDebugData ); + aEditTree.InsertEntry( aMsg, pCurrentError, sal_False, LIST_APPEND, pTTDebugData ); } } @@ -312,16 +312,16 @@ void MsgEdit::AddMessage( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_MESSAGE ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } } @@ -334,16 +334,16 @@ void MsgEdit::AddWarning( String aMsg, TTDebugData aDebugData ) COPY_TTDEBUGDATA( LOG_WARNING ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aCompleteMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -362,16 +362,16 @@ void MsgEdit::AddAssertion( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_ASSERTION ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -386,18 +386,18 @@ void MsgEdit::AddAssertionStack( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_ASSERTION_STACK ); if ( pCurrentAssertion ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentAssertion, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentAssertion, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -410,16 +410,16 @@ void MsgEdit::AddQAError( String aMsg, TTDebugData aDebugData ) SvLBoxEntry *pThisEntry = NULL; COPY_TTDEBUGDATA( LOG_QA_ERROR ); if ( pCurrentTestCase ) - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentTestCase, sal_False, LIST_APPEND, pTTDebugData ); else if ( pCurrentRun ) { - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } else { AddRun( aMsg, aDebugData ); - pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, FALSE, LIST_APPEND, pTTDebugData ); + pThisEntry = aEditTree.InsertEntry( aMsg, pCurrentRun, sal_False, LIST_APPEND, pTTDebugData ); aEditTree.ShowEntry( pThisEntry ); } @@ -428,8 +428,8 @@ void MsgEdit::AddQAError( String aMsg, TTDebugData aDebugData ) } /* - SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return SvLBox::GetEntry(pParent,nPos); } - SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return SvLBox::GetEntry(nRootPos);} + SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uIntPtr nPos ) const { return SvLBox::GetEntry(pParent,nPos); } + SvLBoxEntry* GetEntry( sal_uIntPtr nRootPos ) const { return SvLBox::GetEntry(nRootPos);} @@ -442,16 +442,16 @@ void MsgEdit::AddQAError( String aMsg, TTDebugData aDebugData ) SvLBoxEntry* PrevSelected( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(SvListView::PrevSelected(pEntry)); } SvLBoxEntry* LastSelected() const { return (SvLBoxEntry*)(SvListView::LastSelected()); } - SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, ULONG nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); } - SvLBoxEntry* GetEntry( ULONG nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); } + SvLBoxEntry* GetEntry( SvLBoxEntry* pParent, sal_uIntPtr nPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(pParent,nPos)); } + SvLBoxEntry* GetEntry( sal_uIntPtr nRootPos ) const { return (SvLBoxEntry*)(pModel->GetEntry(nRootPos)); } SvLBoxEntry* GetParent( SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetParent(pEntry)); } SvLBoxEntry* GetRootLevelParent(SvLBoxEntry* pEntry ) const { return (SvLBoxEntry*)(pModel->GetRootLevelParent( pEntry ));} - BOOL IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const; - SvListEntry* GetEntry( SvListEntry* pParent, ULONG nPos ) const; - SvListEntry* GetEntry( ULONG nRootPos ) const; - SvListEntry* GetEntryAtAbsPos( ULONG nAbsPos ) const; + sal_Bool IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const; + SvListEntry* GetEntry( SvListEntry* pParent, sal_uIntPtr nPos ) const; + SvListEntry* GetEntry( sal_uIntPtr nRootPos ) const; + SvListEntry* GetEntryAtAbsPos( sal_uIntPtr nAbsPos ) const; SvListEntry* GetParent( SvListEntry* pEntry ) const; SvListEntry* GetRootLevelParent( SvListEntry* pEntry ) const; */ @@ -465,11 +465,11 @@ void MsgEdit::Delete() CHECK( pCurrentTestCase ); CHECK( pCurrentAssertion ); CHECK( pCurrentError ); - bModified = TRUE; + bModified = sal_True; lModify.Call( NULL ); } -void MsgEdit::Cut(){ Copy(); Delete(); bModified = TRUE; lModify.Call( NULL ); } +void MsgEdit::Cut(){ Copy(); Delete(); bModified = sal_True; lModify.Call( NULL ); } void MsgEdit::Copy(){ ::svt::OStringTransfer::CopyString( GetSelected(), &aEditTree ); } /**/void MsgEdit::Paste(){ Sound::Beep(); } void MsgEdit::Undo(){ Sound::Beep(); } @@ -548,7 +548,7 @@ String MsgEdit::GetSelected() TextSelection MsgEdit::GetSelection() const { - ULONG nStart=0,nEnd=0; + sal_uIntPtr nStart=0,nEnd=0; if ( aEditTree.FirstSelected() ) { @@ -563,25 +563,25 @@ TextSelection MsgEdit::GetSelection() const void MsgEdit::SetSelection( const TextSelection& rSelection ) { - ULONG nStart,nEnd; + sal_uIntPtr nStart,nEnd; while ( aEditTree.GetSelectionCount() ) - aEditTree.Select( aEditTree.FirstSelected(), FALSE ); + aEditTree.Select( aEditTree.FirstSelected(), sal_False ); if ( rSelection.HasRange() ) { nStart = rSelection.GetStart().GetPara(); nEnd = rSelection.GetEnd().GetPara(); - for ( ULONG i = nStart ; i <= nEnd ; i++ ) - aEditTree.Select( aEditTree.GetModel()->GetEntryAtAbsPos( i ), TRUE ); + for ( sal_uIntPtr i = nStart ; i <= nEnd ; i++ ) + aEditTree.Select( aEditTree.GetModel()->GetEntryAtAbsPos( i ), sal_True ); } } -USHORT MsgEdit::GetLineNr() const +sal_uInt16 MsgEdit::GetLineNr() const { if ( aEditTree.GetCurEntry() ) - return (USHORT)aEditTree.GetModel()->GetAbsPos(aEditTree.GetCurEntry() ) + 1; + return (sal_uInt16)aEditTree.GetModel()->GetAbsPos(aEditTree.GetCurEntry() ) + 1; else return 0; } @@ -593,7 +593,7 @@ void MsgEdit::ReplaceSelected( const String& rStr ) DBG_ERROR("Not Implemented"); } -BOOL MsgEdit::IsModified(){ return bModified; } +sal_Bool MsgEdit::IsModified(){ return bModified; } void MsgEdit::SetModifyHdl( Link l ){ lModify = l; } String MsgEdit::GetText() const @@ -617,16 +617,16 @@ void MsgEdit::SetText( const String& rStr ) DBG_ERROR("Not Implemented"); } -BOOL MsgEdit::HasText() const +sal_Bool MsgEdit::HasText() const { return aEditTree.First() != NULL; } // Search from the beginning or mark start + 1 -BOOL MsgEdit::Find( const String& s ) +sal_Bool MsgEdit::Find( const String& s ) { TextSelection r = GetSelection(); - USHORT bgn = (USHORT) r.GetStart().GetPara() + 1; + sal_uInt16 bgn = (sal_uInt16) r.GetStart().GetPara() + 1; if ( r.GetStart().GetPara() == 0 ) bgn = 0; // Search from the beginning @@ -636,11 +636,11 @@ BOOL MsgEdit::Find( const String& s ) if( aEditTree.GetEntryText( pEntry ).Search( s, 0 ) != STRING_NOTFOUND ) { aEditTree.SetCurEntry( pEntry ); - return TRUE; + return sal_True; } pEntry = aEditTree.Next( pEntry ); } - return FALSE; + return sal_False; } /****************************************************************** @@ -653,17 +653,17 @@ BOOL MsgEdit::Find( const String& s ) ******************************************************************/ -BOOL MsgEdit::Load( const String& aName ) +sal_Bool MsgEdit::Load( const String& aName ) { aLogFileName = aName; - BOOL bOk = TRUE, bFirstLine = TRUE; - BOOL bLoadError = FALSE; + sal_Bool bOk = sal_True, bFirstLine = sal_True; + sal_Bool bLoadError = sal_False; SvFileStream aStrm( aName, STREAM_STD_READ ); if( aStrm.IsOpen() ) { aEditTree.Clear(); String aLine; - bFileLoading = TRUE; // To avoid logging to disk + bFileLoading = sal_True; // To avoid logging to disk TTLogMsg *pLogMsg = new TTLogMsg; while( !aStrm.IsEof() && bOk ) { @@ -673,7 +673,7 @@ BOOL MsgEdit::Load( const String& aName ) aStrm.ReadByteStringLine( aLine, RTL_TEXTENCODING_IBM_850 ); if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; #define TOKEN( n ) aLine.GetToken( n ) @@ -683,9 +683,9 @@ BOOL MsgEdit::Load( const String& aName ) TTDebugData aDebugData; aDebugData.aLogType = TTLogType( TOKEN(0).ToInt32() ); aDebugData.aFilename = TOKEN(1); - aDebugData.nLine = USHORT( TOKEN(2).ToInt32() ); - aDebugData.nCol1 = USHORT( TOKEN(3).ToInt32() ); - aDebugData.nCol2 = USHORT( TOKEN(4).ToInt32() ); + aDebugData.nLine = sal_uInt16( TOKEN(2).ToInt32() ); + aDebugData.nCol1 = sal_uInt16( TOKEN(3).ToInt32() ); + aDebugData.nCol2 = sal_uInt16( TOKEN(4).ToInt32() ); aDebugData.aMsg = aLine.GetQuotedToken( 5, CUniString("\"\"") ); // Remove leading and trailing quotes @@ -698,13 +698,13 @@ BOOL MsgEdit::Load( const String& aName ) AddAnyMsg( pLogMsg ); } else if ( bFirstLine && (aLine.Search( VERSION_STRING ) == 0) ) - nVersion = USHORT( aLine.Copy( VERSION_STRING.Len() ).ToInt32() ); + nVersion = sal_uInt16( aLine.Copy( VERSION_STRING.Len() ).ToInt32() ); else if ( aLine.Len() ) - bLoadError = TRUE; + bLoadError = sal_True; - bFirstLine = FALSE; + bFirstLine = sal_False; } - bFileLoading = FALSE; + bFileLoading = sal_False; delete pLogMsg; aStrm.Close(); if ( nVersion < 2 && !bLoadError ) @@ -712,16 +712,16 @@ BOOL MsgEdit::Load( const String& aName ) } else - bOk = FALSE; + bOk = sal_False; return bOk; } -BOOL MsgEdit::Save( const String& aName ) +sal_Bool MsgEdit::Save( const String& aName ) { - BOOL bOk = TRUE; - BOOL bIsText = DirEntry( aName ).GetExtension().CompareIgnoreCaseToAscii("TXT") == COMPARE_EQUAL; + sal_Bool bOk = sal_True; + sal_Bool bIsText = DirEntry( aName ).GetExtension().CompareIgnoreCaseToAscii("TXT") == COMPARE_EQUAL; if ( bIsText && !QueryBox( NULL, SttResId( IDS_LOSS_OF_INFORMATION ) ).Execute() ) - return FALSE; + return sal_False; SvFileStream aStrm( aName, STREAM_STD_WRITE | STREAM_TRUNC ); if( aStrm.IsOpen() ) { @@ -759,16 +759,16 @@ BOOL MsgEdit::Save( const String& aName ) } } if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; else { - bModified = FALSE; + bModified = sal_False; lModify.Call( NULL ); } } else - bOk = FALSE; + bOk = sal_False; return bOk; } @@ -780,7 +780,7 @@ TTTreeListBox::TTTreeListBox( AppError* pParent, BasicFrame* pBF, WinBits nWinSt //, nDeselectParent(0) {} -BOOL TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry ) +sal_Bool TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry ) { if ( pThisEntry && pThisEntry->GetUserData() && ((TTDebugData*)pThisEntry->GetUserData())->aFilename.Len() > 0 ) { @@ -816,20 +816,20 @@ BOOL TTTreeListBox::JumpToSourcecode( SvLBoxEntry *pThisEntry ) if ( pBasicFrame->pWork && pBasicFrame->pWork->ISA(AppEdit) ) ((AppEdit*)pBasicFrame->pWork)->Highlight( aData->nLine, aData->nCol1, aData->nCol2 ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -BOOL TTTreeListBox::DoubleClickHdl() +sal_Bool TTTreeListBox::DoubleClickHdl() { return JumpToSourcecode( GetHdlEntry() ); } -/*ULONG TTTreeListBox::SelectChildren( SvLBoxEntry* pParent, BOOL bSelect ) +/*sal_uIntPtr TTTreeListBox::SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect ) { SvLBoxEntry *pEntry = FirstChild( pParent ); - ULONG nRet = 0; + sal_uIntPtr nRet = 0; while ( pEntry ) { nRet++; @@ -844,8 +844,8 @@ void TTTreeListBox::SelectHdl() { SvLBoxEntry* pHdlEntry = GetHdlEntry(); - SelectChildren( pHdlEntry, TRUE ); - Select( pHdlEntry, TRUE ); + SelectChildren( pHdlEntry, sal_True ); + Select( pHdlEntry, sal_True ); // InitMenu(pApp->GetAppMenu()->GetPopupMenu( RID_APPEDIT )); // So daß Delete richtig ist } @@ -855,13 +855,13 @@ void TTTreeListBox::DeselectHdl() if ( GetParent( pHdlEntry ) ) { nDeselectParent++; - Select( GetParent( pHdlEntry ), FALSE ); + Select( GetParent( pHdlEntry ), sal_False ); nDeselectParent--; } if ( !nDeselectParent ) { - SelectChildren( pHdlEntry, FALSE ); - Select( pHdlEntry, FALSE ); + SelectChildren( pHdlEntry, sal_False ); + Select( pHdlEntry, sal_False ); } Invalidate(); } */ @@ -932,15 +932,15 @@ class TTLBoxString : public SvLBoxString { public: - TTLBoxString( SvLBoxEntry* pEntry, USHORT nFlags, + TTLBoxString( SvLBoxEntry* pEntry, sal_uInt16 nFlags, const String& rStr ) : SvLBoxString(pEntry,nFlags,rStr) {} - virtual void Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, + virtual void Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); }; -void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, +void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry ) { TTFeatures aFeatures = ((TTTreeListBox*)&rDev)->GetFeatures( pEntry ); @@ -964,7 +964,7 @@ void TTLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT nFlags, else { aFont.SetFillColor( aCol ); - aFont.SetTransparent( FALSE ); + aFont.SetTransparent( sal_False ); Color aCol2( COL_BLACK ); aFont.SetColor( aCol2 ); } @@ -990,7 +990,7 @@ void TTTreeListBox::InitEntry(SvLBoxEntry* pEntry, const String& rStr ,const Image& rImg1, const Image& rImg2, SvLBoxButtonKind eButtonKind ) { - USHORT nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" + sal_uInt16 nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); SvLBoxString* pCol = (SvLBoxString*)pEntry->GetItem( nColToHilite ); TTLBoxString* pStr = new TTLBoxString( pEntry, 0, pCol->GetText() ); diff --git a/basic/source/app/msgedit.hxx b/basic/source/app/msgedit.hxx index 76b085668768..c3e4d6413db4 100644 --- a/basic/source/app/msgedit.hxx +++ b/basic/source/app/msgedit.hxx @@ -37,7 +37,7 @@ class AppError; #define SelectChildren SelectChilds // Sonst wird mir schlecht -typedef USHORT TTFeatures; // Bitfield for features of the entries +typedef sal_uInt16 TTFeatures; // Bitfield for features of the entries #define HasNothing TTFeatures(0x00) #define HasError TTFeatures(0x01) #define HasWarning TTFeatures(0x02) @@ -49,13 +49,13 @@ class TTTreeListBox : public SvTreeListBox { protected: // virtual void Command( const CommandEvent& rCEvt ); -// USHORT nDeselectParent; +// sal_uInt16 nDeselectParent; BasicFrame *pBasicFrame; void InitEntry( SvLBoxEntry*, const String&, const Image&, const Image&, SvLBoxButtonKind eButtonKind ); AppError *pAppError; - BOOL JumpToSourcecode( SvLBoxEntry *pThisEntry ); + sal_Bool JumpToSourcecode( SvLBoxEntry *pThisEntry ); public: TTTreeListBox( AppError* pParent, BasicFrame* pBF, WinBits nWinStyle=0 ); @@ -63,11 +63,11 @@ public: // virtual void SelectHdl(); // virtual void DeselectHdl(); - virtual BOOL DoubleClickHdl(); + virtual sal_Bool DoubleClickHdl(); virtual void KeyInput( const KeyEvent& rKEvt ); -// ULONG SelectChildren( SvLBoxEntry* pParent, BOOL bSelect ); +// sal_uIntPtr SelectChildren( SvLBoxEntry* pParent, sal_Bool bSelect ); TTFeatures GetFeatures( SvLBoxEntry* ); }; @@ -79,20 +79,20 @@ class MsgEdit : public DataEdit SvLBoxEntry *pCurrentTestCase; SvLBoxEntry *pCurrentAssertion; SvLBoxEntry *pCurrentError; - BOOL bModified; + sal_Bool bModified; Link lModify; - BOOL bFileLoading; // TRUE while loading a file + sal_Bool bFileLoading; // sal_True while loading a file String Impl_MakeText( SvLBoxEntry *pEntry ) const; String Impl_MakeSaveText( SvLBoxEntry *pEntry ) const; String Impl_MakeSaveText( TTDebugData aData ) const; - USHORT nVersion; // Stores file version + sal_uInt16 nVersion; // Stores file version AppError* pAppError; String aLogFileName; - static USHORT nMaxLogLen; - static BOOL bLimitLogLen; - static BOOL bPrintLogToStdout; - static BOOL bPrintLogToStdoutSet; // has it been initialized yet + static sal_uInt16 nMaxLogLen; + static sal_Bool bLimitLogLen; + static sal_Bool bPrintLogToStdout; + static sal_Bool bPrintLogToStdoutSet; // has it been initialized yet public: MsgEdit( AppError*, BasicFrame *pBF, const WinBits& ); ~MsgEdit(); @@ -107,7 +107,7 @@ public: void AddAssertionStack( String aMsg, TTDebugData aDebugData ); void AddQAError( String aMsg, TTDebugData aDebugData ); - static void SetMaxLogLen( USHORT nLen ) { nMaxLogLen = nLen; bLimitLogLen = TRUE; } + static void SetMaxLogLen( sal_uInt16 nLen ) { nMaxLogLen = nLen; bLimitLogLen = sal_True; } DATA_FUNC_DEF( aEditTree, TTTreeListBox ) }; diff --git a/basic/source/app/mybasic.cxx b/basic/source/app/mybasic.cxx index f69c4c468111..791c267cda44 100644 --- a/basic/source/app/mybasic.cxx +++ b/basic/source/app/mybasic.cxx @@ -65,7 +65,7 @@ TYPEINIT1(MyBasic,StarBASIC) class MyFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); }; static SampleObjectFac aFac1; @@ -73,7 +73,7 @@ static MyFactory aFac2; static ProcessFactory aProcessFac; static short nInst = 0; -SbxBase* MyFactory::Create( UINT16 nSbxId, UINT32 nCr ) +SbxBase* MyFactory::Create( sal_uInt16 nSbxId, sal_uInt32 nCr ) { if( nCr == SBXCR_TEST && nSbxId == SBXID_MYBASIC ) return new MyBasic; @@ -156,7 +156,7 @@ void MyBasic::LoadIniFile() { } -SbTextType MyBasic::GetSymbolType( const String &rSymbol, BOOL bWasTTControl ) +SbTextType MyBasic::GetSymbolType( const String &rSymbol, sal_Bool bWasTTControl ) { (void) rSymbol; /* avoid warning about unused parameter */ (void) bWasTTControl; /* avoid warning about unused parameter */ @@ -181,13 +181,13 @@ void MyBasic::Reset() nError = 0; } -BOOL MyBasic::Compile( SbModule* p ) +sal_Bool MyBasic::Compile( SbModule* p ) { Reset(); return StarBASIC::Compile( p ); } -BOOL MyBasic::ErrorHdl() +sal_Bool MyBasic::ErrorHdl() { AppBasEd* pWin = aBasicApp.pFrame->FindModuleWin( GetActiveModule()->GetName() ); if( !pWin ) @@ -204,12 +204,12 @@ BOOL MyBasic::ErrorHdl() 0, StarBASIC::GetErrorText(), GetLine(), GetCol1(), GetCol2() ), LIST_APPEND ); nError++; - return BOOL( nError < 20 ); // Cancel after 20 errors + return sal_Bool( nError < 20 ); // Cancel after 20 errors } else { ReportRuntimeError( pWin ); - return FALSE; + return sal_False; } } @@ -226,7 +226,7 @@ void MyBasic::ReportRuntimeError( AppBasEd *pEditWin ) GetCol1(), GetCol2() ).Show(); } -void MyBasic::DebugFindNoErrors( BOOL bDebugFindNoErrors ) +void MyBasic::DebugFindNoErrors( sal_Bool bDebugFindNoErrors ) { (void) bDebugFindNoErrors; /* avoid warning about unused parameter */ } @@ -236,7 +236,7 @@ const String MyBasic::GetSpechialErrorText() return GetErrorText(); } -USHORT MyBasic::BreakHdl() +sal_uInt16 MyBasic::BreakHdl() { SbModule* pMod = GetActiveModule(); if( pMod ) @@ -270,7 +270,7 @@ USHORT MyBasic::BreakHdl() ***************************************************************************/ BasicError::BasicError - ( AppBasEd* w, USHORT nE, const String& r, USHORT nL, USHORT nC1, USHORT nC2 ) + ( AppBasEd* w, sal_uInt16 nE, const String& r, sal_uInt16 nL, sal_uInt16 nC1, sal_uInt16 nC2 ) : aText( SttResId( IDS_ERROR1 ) ) { pWin = w; diff --git a/basic/source/app/printer.cxx b/basic/source/app/printer.cxx index 0ad562970fe6..8e89f5d90c03 100644 --- a/basic/source/app/printer.cxx +++ b/basic/source/app/printer.cxx @@ -97,7 +97,7 @@ void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame * // Disable PRINT-Menu MenuBar* pBar = pFrame->GetMenuBar(); Menu* pFileMenu = pBar->GetPopupMenu( RID_APPFILE ); - pFileMenu->EnableItem( RID_FILEPRINT, FALSE ); + pFileMenu->EnableItem( RID_FILEPRINT, sal_False ); mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) ); mpListener->StartPage(); @@ -116,7 +116,7 @@ void BasicPrinter::Print( const String& rFile, const String& rText, BasicFrame * Printer::PrintJob( mpListener, mpPrinter->GetJobSetup() ); nPage = 1; - pFileMenu->EnableItem( RID_FILEPRINT, TRUE ); + pFileMenu->EnableItem( RID_FILEPRINT, sal_True ); } diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx index 0eec05e1697c..703f684b38de 100644 --- a/basic/source/app/process.cxx +++ b/basic/source/app/process.cxx @@ -55,8 +55,8 @@ Process::Process() : pArgumentList( NULL ) , pEnvList( NULL ) , pProcess( NULL ) -, bWasGPF( FALSE ) -, bHasBeenStarted( FALSE ) +, bWasGPF( sal_False ) +, bHasBeenStarted( sal_False ) { } @@ -68,19 +68,19 @@ Process::~Process() } -BOOL Process::ImplIsRunning() +sal_Bool Process::ImplIsRunning() { if ( pProcess && bHasBeenStarted ) { vos::OProcess::TProcessInfo aProcessInfo; pProcess->getInfo( vos::OProcess::TData_ExitCode, &aProcessInfo ); if ( !(aProcessInfo.Fields & vos::OProcess::TData_ExitCode) ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } else - return FALSE; + return sal_False; } long Process::ImplGetExitCode() @@ -149,19 +149,19 @@ void Process::SetImage( const String &aAppPath, const String &aAppParams, const ::rtl::OUString aNormalizedAppPath; osl::FileBase::getFileURLFromSystemPath( ::rtl::OUString(aAppPath), aNormalizedAppPath ); pProcess = new vos::OProcess( aNormalizedAppPath ); - bHasBeenStarted = FALSE; + bHasBeenStarted = sal_False; delete [] pParamList; delete [] pEnvArray; } } -BOOL Process::Start() +sal_Bool Process::Start() { // Start program - BOOL bSuccess=FALSE; + sal_Bool bSuccess=sal_False; if ( pProcess && !ImplIsRunning() ) { - bWasGPF = FALSE; + bWasGPF = sal_False; #ifdef WNT // sal_uInt32 nErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX); sal_uInt32 nErrorMode = SetErrorMode(SEM_NOOPENFILEERRORBOX | SEM_NOALIGNMENTFAULTEXCEPT | SEM_NOGPFAULTERRORBOX); @@ -189,7 +189,7 @@ BOOL Process::Start() } catch( ... ) { - bWasGPF = TRUE; + bWasGPF = sal_True; // TODO: Output debug message !! } nErrorMode = SetErrorMode(nErrorMode); @@ -201,17 +201,17 @@ BOOL Process::Start() return bSuccess; } -ULONG Process::GetExitCode() +sal_uIntPtr Process::GetExitCode() { // ExitCode of program after execution return ImplGetExitCode(); } -BOOL Process::IsRunning() +sal_Bool Process::IsRunning() { return ImplIsRunning(); } -BOOL Process::WasGPF() +sal_Bool Process::WasGPF() { // Did the process fail? #ifdef WNT return ImplGetExitCode() == 3221225477; @@ -220,10 +220,10 @@ BOOL Process::WasGPF() #endif } -BOOL Process::Terminate() +sal_Bool Process::Terminate() { if ( ImplIsRunning() ) return pProcess->terminate() == vos::OProcess::E_None; - return TRUE; + return sal_True; } diff --git a/basic/source/app/processw.cxx b/basic/source/app/processw.cxx index 291ea9db33b7..0abf5afc0d57 100644 --- a/basic/source/app/processw.cxx +++ b/basic/source/app/processw.cxx @@ -48,10 +48,10 @@ // none // 2) Methods: // SetImage( Filename ) -// BOOL Start -// USHORT GetExitCode -// BOOL IsRunning -// BOOL WasGPF +// sal_Bool Start +// sal_uInt16 GetExitCode +// sal_Bool IsRunning +// sal_Bool WasGPF // This implementation is a sample for a table driven version that @@ -67,7 +67,7 @@ #define _BWRITE 0x0200 // can be used as Lvaluen #define _LVALUE _BWRITE #define _READWRITE 0x0300 // can read and written -#define _OPT 0x0400 // TRUE: optional parameter +#define _OPT 0x0400 // sal_True: optional parameter #define _METHOD 0x1000 // Mask-Bit for a method #define _PROPERTY 0x2000 // Mask-Bit for a property #define _COLL 0x4000 // Mask-Bit for a collection @@ -128,12 +128,12 @@ SbxVariable* ProcessWrapper::Find( const String& rName, SbxClassType t ) // otherwise search Methods* p = pMethods; short nIndex = 0; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; while( p->nArgs != -1 ) { if( rName.EqualsIgnoreCaseAscii( p->pName ) ) { - bFound = TRUE; break; + bFound = sal_True; break; } nIndex += ( p->nArgs & _ARGSMASK ) + 1; p = pMethods + nIndex; @@ -168,22 +168,22 @@ void ProcessWrapper::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pNotifyPar = pVar->GetParameters(); - USHORT nIndex = (USHORT) pVar->GetUserData(); + sal_uInt16 nIndex = (sal_uInt16) pVar->GetUserData(); // No index: put through if( nIndex ) { - ULONG t = pHint->GetId(); + sal_uIntPtr t = pHint->GetId(); if( t == SBX_HINT_INFOWANTED ) pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); else { - BOOL bWrite = FALSE; + sal_Bool bWrite = sal_False; if( t == SBX_HINT_DATACHANGED ) - bWrite = TRUE; + bWrite = sal_True; if( t == SBX_HINT_DATAWANTED || bWrite ) { // Parameter-Test for methods: - USHORT nPar = pMethods[ --nIndex ].nArgs & 0x00FF; + sal_uInt16 nPar = pMethods[ --nIndex ].nArgs & 0x00FF; // Element 0 is the return value if( ( !pNotifyPar && nPar ) || ( pNotifyPar && pNotifyPar->Count() < nPar+1 ) ) @@ -212,7 +212,7 @@ SbxInfo* ProcessWrapper::GetInfo( short nIdx ) { p++; String aMethodName( p->pName, RTL_TEXTENCODING_ASCII_US ); - USHORT nInfoFlags = ( p->nArgs >> 8 ) & 0x03; + sal_uInt16 nInfoFlags = ( p->nArgs >> 8 ) & 0x03; if( p->nArgs & _OPT ) nInfoFlags |= SBX_OPTIONAL; pResultInfo->AddParam( aMethodName, p->eType, nInfoFlags ); @@ -226,10 +226,10 @@ SbxInfo* ProcessWrapper::GetInfo( short nIdx ) //////////////////////////////////////////////////////////////////////////// -// Properties and methods save the return value in argv[0] (Get, bPut = FALSE) -// and store the value from argv[0] (Put, bPut = TRUE) +// Properties and methods save the return value in argv[0] (Get, bPut = sal_False) +// and store the value from argv[0] (Put, bPut = sal_True) -void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Imagefile of the executable (void) pVar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ @@ -239,28 +239,28 @@ void ProcessWrapper::PSetImage( SbxVariable* pVar, SbxArray* pMethodePar, BOOL b pProcess->SetImage(pMethodePar->Get( 1 )->GetString(), String() ); } -void ProcessWrapper::PStart( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PStart( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Program is started (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ pVar->PutBool( pProcess->Start() ); } -void ProcessWrapper::PGetExitCode( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PGetExitCode( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // ExitCode of the program after it was finished (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ pVar->PutULong( pProcess->GetExitCode() ); } -void ProcessWrapper::PIsRunning( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PIsRunning( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Program is still running (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ pVar->PutBool( pProcess->IsRunning() ); } -void ProcessWrapper::PWasGPF( SbxVariable* pVar, SbxArray* pMethodePar, BOOL bWriteIt ) +void ProcessWrapper::PWasGPF( SbxVariable* pVar, SbxArray* pMethodePar, sal_Bool bWriteIt ) { // Program faulted with GPF etc. (void) pMethodePar; /* avoid warning about unused parameter */ (void) bWriteIt; /* avoid warning about unused parameter */ diff --git a/basic/source/app/processw.hxx b/basic/source/app/processw.hxx index e04396e20809..69f6eb73a793 100644 --- a/basic/source/app/processw.hxx +++ b/basic/source/app/processw.hxx @@ -44,7 +44,7 @@ using SbxVariable::GetInfo; public: #endif typedef void( ProcessWrapper::*pMeth ) - ( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite ); + ( SbxVariable* pThis, SbxArray* pArgs, sal_Bool bWrite ); #if defined ( ICC ) || defined ( HPUX ) private: #endif @@ -58,11 +58,11 @@ private: static Methods aProcessMethods[]; // Method table Methods *pMethods; // Current method table - void PSetImage( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PStart( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PGetExitCode( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PIsRunning( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); - void PWasGPF( SbxVariable* pVar, SbxArray* pPar, BOOL bWrite ); + void PSetImage( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PStart( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PGetExitCode( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PIsRunning( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); + void PWasGPF( SbxVariable* pVar, SbxArray* pPar, sal_Bool bWrite ); // Internal members and methods Process *pProcess; diff --git a/basic/source/app/status.cxx b/basic/source/app/status.cxx index 604fdedfc133..beb43ec1de18 100644 --- a/basic/source/app/status.cxx +++ b/basic/source/app/status.cxx @@ -72,7 +72,7 @@ void StatusLine::SetProfileName( const String& s ) IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) { - USHORT nFirstWinPos=0; + sal_uInt16 nFirstWinPos=0; MenuBar* pMenu = pFrame->GetMenuBar(); PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); @@ -81,14 +81,14 @@ IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) nFirstWinPos += pTTB->GetItemPos( pTTB->GetCurItemId() ) / 2; - USHORT x; + sal_uInt16 x; x = pTTB->GetItemPos( pTTB->GetCurItemId() ); x = pWinMenu->GetItemId( nFirstWinPos ); x = pWinMenu->GetItemCount(); AppWin* pWin = pFrame->FindWin( pWinMenu->GetItemText( pWinMenu->GetItemId( nFirstWinPos ) ).EraseAllChars( L'~' ) ); if ( pWin ) { - pWin->Minimize( FALSE ); + pWin->Minimize( sal_False ); pWin->ToTop(); } return 0; @@ -96,7 +96,7 @@ IMPL_LINK( StatusLine, ActivateTask, TaskToolBox*, pTTB ) void StatusLine::LoadTaskToolBox() { - USHORT nFirstWinPos=0; + sal_uInt16 nFirstWinPos=0; MenuBar* pMenu = pFrame->GetMenuBar(); PopupMenu* pWinMenu = pMenu->GetPopupMenu( RID_APPWINDOW ); diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx index bd18d4176803..55e91ea879b5 100644 --- a/basic/source/app/textedit.cxx +++ b/basic/source/app/textedit.cxx @@ -45,19 +45,19 @@ TextEditImp::TextEditImp( AppEdit* pParent, const WinBits& aBits ) : Window( pParent, aBits ) , pAppEdit( pParent ) -, bHighlightning( FALSE ) -, bDoSyntaxHighlight( FALSE ) -, bDelayHighlight( TRUE ) +, bHighlightning( sal_False ) +, bDoSyntaxHighlight( sal_False ) +, bDelayHighlight( sal_True ) , nTipId( 0 ) -, bViewMoved( FALSE ) +, bViewMoved( sal_False ) { pTextEngine = new TextEngine(); pTextEngine->SetMaxTextLen( STRING_MAXLEN ); - pTextEngine->EnableUndo( TRUE ); + pTextEngine->EnableUndo( sal_True ); pTextView = new TextView( pTextEngine, this ); pTextEngine->InsertView( pTextView ); - pTextEngine->SetModified( FALSE ); + pTextEngine->SetModified( sal_False ); aSyntaxIdleTimer.SetTimeout( 200 ); aSyntaxIdleTimer.SetTimeoutHdl( LINK( this, TextEditImp, SyntaxTimerHdl ) ); @@ -80,10 +80,10 @@ TextEditImp::~TextEditImp() delete pTextEngine; } -BOOL TextEditImp::ViewMoved() +sal_Bool TextEditImp::ViewMoved() { - BOOL bOld = bViewMoved; - bViewMoved = FALSE; + sal_Bool bOld = bViewMoved; + bViewMoved = sal_False; return bOld; } @@ -99,7 +99,7 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) pAppEdit->pVScroll->SetThumbPos( pTextView->GetStartDocPos().Y() ); if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->Scroll( 0, ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->GetCurYOffset() - pTextView->GetStartDocPos().Y() ); - bViewMoved = TRUE; + bViewMoved = sal_True; } else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED ) { @@ -115,8 +115,8 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) } else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED ) { - ULONG nWidth = pTextEngine->CalcTextWidth(); - if ( (ULONG)nWidth != pAppEdit->nCurTextWidth ) + sal_uIntPtr nWidth = pTextEngine->CalcTextWidth(); + if ( (sal_uIntPtr)nWidth != pAppEdit->nCurTextWidth ) { pAppEdit->nCurTextWidth = nWidth; if ( pAppEdit->pHScroll ) @@ -129,12 +129,12 @@ void TextEditImp::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) else if( rTextHint.GetId() == TEXT_HINT_PARAINSERTED ) { if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) - ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, TRUE ); + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, sal_True ); } else if( rTextHint.GetId() == TEXT_HINT_PARAREMOVED ) { if ( ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow() ) - ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, FALSE ); + ((TextEdit*)(pAppEdit->pDataEdit))->GetBreakpointWindow()->AdjustBreakpoints( rTextHint.GetValue()+1, sal_False ); // Itchy adaption for two signs at line ends instead of one (hard coded default) pTextEngine->SetMaxTextLen( STRING_MAXLEN - pTextEngine->GetParagraphCount() ); @@ -189,12 +189,12 @@ int TextAttribSpechial::operator==( const TextAttrib& rAttr ) const ( maFontWeight == ((const TextAttribSpechial&)rAttr).maFontWeight ) ); } -void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) +void TextEditImp::ImpDoHighlight( const String& rSource, sal_uIntPtr nLineOff ) { SbTextPortions aPortionList; pAppEdit->GetBasicFrame()->Basic().Highlight( rSource, aPortionList ); - USHORT nCount = aPortionList.Count(); + sal_uInt16 nCount = aPortionList.Count(); if ( !nCount ) return; @@ -211,8 +211,8 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) } // here is the postprocessing for types for the TestTool - USHORT i; - BOOL bWasTTControl = FALSE; + sal_uInt16 i; + sal_Bool bWasTTControl = sal_False; for ( i = 0; i < aPortionList.Count(); i++ ) { SbTextPortion& r = aPortionList[i]; @@ -230,20 +230,20 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) r.eType = pAppEdit->GetBasicFrame()->Basic().GetSymbolType( aSymbol, bWasTTControl ); if ( r.eType == TT_CONTROL ) - bWasTTControl = TRUE; + bWasTTControl = sal_True; else - bWasTTControl = FALSE; + bWasTTControl = sal_False; } break; case SB_PUNCTUATION: { String aPunctuation = rSource.Copy( r.nStart, r.nEnd - r.nStart +1 ); if ( aPunctuation.CompareToAscii( "." ) != COMPARE_EQUAL ) - bWasTTControl = FALSE; + bWasTTControl = sal_False; } break; default: - bWasTTControl = FALSE; + bWasTTControl = sal_False; } } @@ -273,7 +273,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) r.nEnd = rSource.Len()-1; } - BOOL bWasModified = pTextEngine->IsModified(); + sal_Bool bWasModified = pTextEngine->IsModified(); for ( i = 0; i < aPortionList.Count(); i++ ) { SbTextPortion& r = aPortionList[i]; @@ -283,7 +283,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) SbTextType eCol = r.eType; Color aColor; - ULONG nLine = nLineOff+r.nLine-1; // -1, because BASIC starts with 1 + sal_uIntPtr nLine = nLineOff+r.nLine-1; // -1, because BASIC starts with 1 switch ( +eCol ) { case SB_KEYWORD: @@ -336,7 +336,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff ) pTextEngine->SetModified( bWasModified ); } -void TextEditImp::DoSyntaxHighlight( ULONG nPara ) +void TextEditImp::DoSyntaxHighlight( sal_uIntPtr nPara ) { // Due to delayed syntax highlight it can happend that the // paragraph does no longer exist @@ -362,7 +362,7 @@ void TextEditImp::DoDelayedSyntaxHighlight( xub_StrLen nPara ) { if ( bDelayHighlight ) { - aSyntaxLineTable.Insert( nPara, (void*)(ULONG)1 ); + aSyntaxLineTable.Insert( nPara, (void*)(sal_uIntPtr)1 ); aSyntaxIdleTimer.Start(); } else @@ -373,38 +373,38 @@ void TextEditImp::DoDelayedSyntaxHighlight( xub_StrLen nPara ) IMPL_LINK( TextEditImp, SyntaxTimerHdl, Timer *, EMPTYARG ) { DBG_ASSERT( pTextView, "Not yet a View but Syntax-Highlight ?!" ); - pTextEngine->SetUpdateMode( FALSE ); + pTextEngine->SetUpdateMode( sal_False ); - bHighlightning = TRUE; - USHORT nLine; + bHighlightning = sal_True; + sal_uInt16 nLine; while ( aSyntaxLineTable.First() && !Application::AnyInput( INPUT_MOUSEANDKEYBOARD ) ) { - nLine = (USHORT)aSyntaxLineTable.GetCurKey(); + nLine = (sal_uInt16)aSyntaxLineTable.GetCurKey(); DoSyntaxHighlight( nLine ); aSyntaxLineTable.Remove( nLine ); /* if ( Application::AnyInput() ) { aSyntaxIdleTimer.Start(); // Starten, falls wir in einem Dialog landen - pTextView->ShowCursor( TRUE, TRUE ); - pTextEngine->SetUpdateMode( TRUE ); - bHighlightning = FALSE; + pTextView->ShowCursor( sal_True, sal_True ); + pTextEngine->SetUpdateMode( sal_True ); + bHighlightning = sal_False; GetpApp()->Reschedule(); - bHighlightning = TRUE; - pTextEngine->SetUpdateMode( FALSE ); + bHighlightning = sal_True; + pTextEngine->SetUpdateMode( sal_False ); }*/ } - BOOL bWasModified = pTextEngine->IsModified(); + sal_Bool bWasModified = pTextEngine->IsModified(); if ( aSyntaxLineTable.Count() > 3 ) // Without VDev { - pTextEngine->SetUpdateMode( TRUE ); - pTextView->ShowCursor( TRUE, TRUE ); + pTextEngine->SetUpdateMode( sal_True ); + pTextView->ShowCursor( sal_True, sal_True ); } else - pTextEngine->SetUpdateMode( TRUE ); // ! With VDev + pTextEngine->SetUpdateMode( sal_True ); // ! With VDev // pTextView->ForceUpdate(); - // SetUpdateMode( TRUE ) soll kein Modify setzen + // SetUpdateMode( sal_True ) soll kein Modify setzen pTextEngine->SetModified( bWasModified ); // SyntaxTimerHdl wird gerufen, wenn Text-Aenderung @@ -413,7 +413,7 @@ IMPL_LINK( TextEditImp, SyntaxTimerHdl, Timer *, EMPTYARG ) // nCurTextWidth = pTextEngine->CalcTextWidth(); // if ( nCurTextWidth != nPrevTextWidth ) // SetScrollBarRanges(); - bHighlightning = FALSE; + bHighlightning = sal_False; if ( aSyntaxLineTable.First() ) aImplSyntaxIdleTimer.Start(); @@ -430,7 +430,7 @@ void TextEditImp::InvalidateSyntaxHighlight() DoDelayedSyntaxHighlight( i ); } -void TextEditImp::SyntaxHighlight( BOOL bNew ) +void TextEditImp::SyntaxHighlight( sal_Bool bNew ) { if ( ( bNew && bDoSyntaxHighlight ) || ( !bNew && !bDoSyntaxHighlight ) ) return; @@ -447,13 +447,13 @@ void TextEditImp::SyntaxHighlight( BOOL bNew ) else { aSyntaxIdleTimer.Stop(); - pTextEngine->SetUpdateMode( FALSE ); - for ( ULONG i = 0; i < pTextEngine->GetParagraphCount(); i++ ) + pTextEngine->SetUpdateMode( sal_False ); + for ( sal_uIntPtr i = 0; i < pTextEngine->GetParagraphCount(); i++ ) pTextEngine->RemoveAttribs( i ); // pTextEngine->QuickFormatDoc(); - pTextEngine->SetUpdateMode( TRUE ); - pTextView->ShowCursor(TRUE, TRUE ); + pTextEngine->SetUpdateMode( sal_True ); + pTextView->ShowCursor(sal_True, sal_True ); } } @@ -463,15 +463,15 @@ void TextEditImp::SetFont( const Font& rNewFont ) pTextEngine->SetFont(rNewFont); } -BOOL TextEditImp::IsModified() +sal_Bool TextEditImp::IsModified() { return pTextEngine->IsModified(); } void TextEditImp::KeyInput( const KeyEvent& rKeyEvent ) { - BOOL bWasModified = pTextView->GetTextEngine()->IsModified(); - pTextView->GetTextEngine()->SetModified( FALSE ); + sal_Bool bWasModified = pTextView->GetTextEngine()->IsModified(); + pTextView->GetTextEngine()->SetModified( sal_False ); if ( !pTextView->KeyInput( rKeyEvent ) ) Window::KeyInput( rKeyEvent ); @@ -487,8 +487,8 @@ void TextEditImp::MouseButtonUp( const MouseEvent& rMouseEvent ){ pTextView->Mou //void TextEditImp::MouseButtonDown( const MouseEvent& rMouseEvent ){ pTextView->MouseButtonDown( rMouseEvent );} //void TextEditImp::MouseMove( const MouseEvent& rMouseEvent ){ pTextView->MouseMove( rMouseEvent );} //void TextEditImp::Command( const CommandEvent& rCEvt ){ pTextView->Command( rCEvt );} -//BOOL TextEditImp::Drop( const DropEvent& rEvt ){ return FALSE /*pTextView->Drop( rEvt )*/;} -//BOOL TextEditImp::QueryDrop( DropEvent& rEvt ){ return FALSE /*pTextView->QueryDrop( rEvt )*/;} +//sal_Bool TextEditImp::Drop( const DropEvent& rEvt ){ return sal_False /*pTextView->Drop( rEvt )*/;} +//sal_Bool TextEditImp::QueryDrop( DropEvent& rEvt ){ return sal_False /*pTextView->QueryDrop( rEvt )*/;} void TextEditImp::Command( const CommandEvent& rCEvt ) @@ -550,10 +550,10 @@ SbxBase* TextEditImp::GetSbxAtMousePos( String &aWord ) if ( aSuffixes.Search( aWord.GetChar(nLastChar) ) != STRING_NOTFOUND ) aWord.Erase( nLastChar, 1 ); // because perhaps TestTools throws an error - BOOL bWasError = SbxBase::IsError(); - pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( TRUE ); + sal_Bool bWasError = SbxBase::IsError(); + pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( sal_True ); SbxBase* pSBX = StarBASIC::FindSBXInCurrentScope( aWord ); - pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( FALSE ); + pAppEdit->GetBasicFrame()->Basic().DebugFindNoErrors( sal_False ); DBG_ASSERT( !( !bWasError && SbxBase::IsError()), "Error generated while retrieving Variable data for viewing" ); if ( !bWasError && SbxBase::IsError() ) SbxBase::ResetError(); @@ -679,8 +679,8 @@ DBG_NAME(TextEdit) TextEdit::TextEdit( AppEdit* pParent, const WinBits& aBits ) : pBreakpointWindow( NULL ) -, bFileWasUTF8( FALSE ) -, bSaveAsUTF8( FALSE ) +, bFileWasUTF8( sal_False ) +, bSaveAsUTF8( sal_False ) , aEdit( pParent, aBits | WB_NOHIDESELECTION ) { DBG_CTOR(TextEdit,0); @@ -689,7 +689,7 @@ DBG_CTOR(TextEdit,0); TextEdit::~TextEdit() {DBG_DTOR(TextEdit,0);} -void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) +void TextEdit::Highlight( sal_uIntPtr nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) { if ( nLine ) // Should not occure but at 'Sub expected' in first line nLine--; @@ -715,7 +715,7 @@ void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) // Because nCol2 *may* point after the current statement // (because the next one starts there) there are space // that must be removed - BOOL bColon = FALSE; + sal_Bool bColon = sal_False; while ( s.GetChar( nCol2 ) == ' ' && nCol2 > nCol1 && !bColon ) { @@ -723,7 +723,7 @@ void TextEdit::Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ) if ( s.GetChar( nCol2 ) == ':' ) { nCol2--; - bColon = TRUE; + bColon = sal_True; } } @@ -748,31 +748,31 @@ String TextEdit::GetSelected(){ return aEdit.pTextView->GetSelected(); } TextSelection TextEdit::GetSelection() const{ return aEdit.pTextView->GetSelection(); } void TextEdit::SetSelection( const TextSelection& rSelection ){ aEdit.pTextView->SetSelection( rSelection ); } -USHORT TextEdit::GetLineNr() const +sal_uInt16 TextEdit::GetLineNr() const { - return sal::static_int_cast< USHORT >( + return sal::static_int_cast< sal_uInt16 >( aEdit.pTextView->GetSelection().GetEnd().GetPara()+1); } void TextEdit::ReplaceSelected( const String& rStr ){ aEdit.pTextView->InsertText(rStr); } -BOOL TextEdit::IsModified(){ return aEdit.IsModified(); } +sal_Bool TextEdit::IsModified(){ return aEdit.IsModified(); } String TextEdit::GetText() const { return aEdit.pTextEngine->GetText( GetSystemLineEnd() ); } -void TextEdit::SetText( const String& rStr ){ aEdit.pTextEngine->SetText(rStr); aEdit.pTextEngine->SetModified( FALSE ); } +void TextEdit::SetText( const String& rStr ){ aEdit.pTextEngine->SetText(rStr); aEdit.pTextEngine->SetModified( sal_False ); } void TextEdit::SetModifyHdl( Link l ){ aEdit.SetModifyHdl(l); } -BOOL TextEdit::HasText() const { return aEdit.pTextEngine->GetTextLen() > 0; } +sal_Bool TextEdit::HasText() const { return aEdit.pTextEngine->GetTextLen() > 0; } // Search from the beginning or at mark + 1 -BOOL TextEdit::Find( const String& s ) +sal_Bool TextEdit::Find( const String& s ) { DBG_CHKTHIS(TextEdit,0); TextSelection aSelection = aEdit.pTextView->GetSelection(); - ULONG nPara = aSelection.GetStart().GetPara(); + sal_uIntPtr nPara = aSelection.GetStart().GetPara(); xub_StrLen nIndex = aSelection.GetStart().GetIndex(); if ( aSelection.HasRange() ) @@ -786,23 +786,23 @@ BOOL TextEdit::Find( const String& s ) if( nIndex != STRING_NOTFOUND ) { aEdit.pTextView->SetSelection( TextSelection( TextPaM( nPara, nIndex ), TextPaM( nPara, nIndex + s.Len() ) ) ); - return TRUE; + return sal_True; } nIndex = 0; nPara++; } - return FALSE; + return sal_False; } -BOOL TextEdit::Load( const String& aName ) +sal_Bool TextEdit::Load( const String& aName ) { DBG_CHKTHIS(TextEdit,0); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SvFileStream aStrm( aName, STREAM_STD_READ ); if( aStrm.IsOpen() ) { String aText, aLine, aLineBreak; - BOOL bIsFirstLine = TRUE; + sal_Bool bIsFirstLine = sal_True; aLineBreak += '\n'; aLineBreak.ConvertLineEnd(); rtl_TextEncoding aFileEncoding = RTL_TEXTENCODING_IBM_850; @@ -812,29 +812,29 @@ DBG_CHKTHIS(TextEdit,0); if ( bIsFirstLine && IsTTSignatureForUnicodeTextfile( aLine ) ) { aFileEncoding = RTL_TEXTENCODING_UTF8; - bFileWasUTF8 = TRUE; + bFileWasUTF8 = sal_True; } else { if ( !bIsFirstLine ) aText += aLineBreak; aText += aLine; - bIsFirstLine = FALSE; + bIsFirstLine = sal_False; } if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; } SetText( aText ); } else - bOk = FALSE; + bOk = sal_False; return bOk; } -BOOL TextEdit::Save( const String& aName ) +sal_Bool TextEdit::Save( const String& aName ) { DBG_CHKTHIS(TextEdit,0); - BOOL bOk = TRUE; + sal_Bool bOk = sal_True; SvFileStream aStrm( aName, STREAM_STD_WRITE | STREAM_TRUNC ); rtl_TextEncoding aFileEncoding = RTL_TEXTENCODING_IBM_850; if( aStrm.IsOpen() ) @@ -849,10 +849,10 @@ DBG_CHKTHIS(TextEdit,0); aSave.ConvertLineEnd(LINEEND_LF); aStrm << ByteString( aSave, aFileEncoding ).GetBuffer(); if( aStrm.GetError() != SVSTREAM_OK ) - bOk = FALSE; + bOk = sal_False; else - aEdit.pTextEngine->SetModified(FALSE); - } else bOk = FALSE; + aEdit.pTextEngine->SetModified(sal_False); + } else bOk = sal_False; return bOk; } diff --git a/basic/source/app/textedit.hxx b/basic/source/app/textedit.hxx index 354c94dc44ab..404dc4acb2bd 100644 --- a/basic/source/app/textedit.hxx +++ b/basic/source/app/textedit.hxx @@ -49,7 +49,7 @@ class TextEditImp : public Window, public SfxListener using Window::Notify; protected: - void DoSyntaxHighlight( ULONG nPara ); + void DoSyntaxHighlight( sal_uIntPtr nPara ); private: @@ -63,10 +63,10 @@ private: void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); - void ImpDoHighlight( const String& rSource, ULONG nLineOff ); - BOOL bHighlightning; - BOOL bDoSyntaxHighlight; - BOOL bDelayHighlight; + void ImpDoHighlight( const String& rSource, sal_uIntPtr nLineOff ); + sal_Bool bHighlightning; + sal_Bool bDoSyntaxHighlight; + sal_Bool bDelayHighlight; SbxBase* GetSbxAtMousePos( String &aWord ); @@ -75,12 +75,12 @@ private: DECL_LINK( ShowVarContents, void* ); Point aTipPos; String aTipWord; - ULONG nTipId; + sal_uIntPtr nTipId; Timer HideTipTimer; Timer ShowTipTimer; - BOOL bViewMoved; + sal_Bool bViewMoved; public: TextEditImp( AppEdit *pParent, const WinBits& aBits ); @@ -90,7 +90,7 @@ public: TextView *pTextView; void SetFont( const Font& rNewFont ); - BOOL IsModified(); + sal_Bool IsModified(); void SetModifyHdl( Link l ){ ModifyHdl = l; } void KeyInput( const KeyEvent& rKeyEvent ); @@ -99,14 +99,14 @@ public: void MouseButtonDown( const MouseEvent& rMouseEvent ); // void MouseMove( const MouseEvent& rMouseEvent ); void Command( const CommandEvent& rCEvt ); - //BOOL Drop( const DropEvent& rEvt ); - //BOOL QueryDrop( DropEvent& rEvt ); + //sal_Bool Drop( const DropEvent& rEvt ); + //sal_Bool QueryDrop( DropEvent& rEvt ); - BOOL ViewMoved(); + sal_Bool ViewMoved(); void DoDelayedSyntaxHighlight( xub_StrLen nPara ); void InvalidateSyntaxHighlight(); - void SyntaxHighlight( BOOL bNew ); + void SyntaxHighlight( sal_Bool bNew ); void BuildKontextMenu( PopupMenu *&pMenu ); }; @@ -116,13 +116,13 @@ DBG_NAMEEX(TextEdit) class TextEdit : public DataEdit { BreakpointWindow *pBreakpointWindow; - BOOL bFileWasUTF8; - BOOL bSaveAsUTF8; + sal_Bool bFileWasUTF8; + sal_Bool bSaveAsUTF8; public: TextEdit( AppEdit*, const WinBits& ); ~TextEdit(); - void Highlight( ULONG nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); + void Highlight( sal_uIntPtr nLine, xub_StrLen nCol1, xub_StrLen nCol2 ); TextEditImp& GetTextEditImp() { return aEdit; } void SetBreakpointWindow( BreakpointWindow *pBPWindow ){ pBreakpointWindow = pBPWindow; } @@ -132,7 +132,7 @@ public: virtual void BuildKontextMenu( PopupMenu *&pMenu ); - void SaveAsUTF8( BOOL bUTF8 ) { bSaveAsUTF8 = bUTF8; } + void SaveAsUTF8( sal_Bool bUTF8 ) { bSaveAsUTF8 = bUTF8; } }; #endif diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index a5a1d4c8ca12..241cfce6d342 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -169,11 +169,11 @@ namespace basic @param _out_rStorage takes the storage upon successful return. Note that this might be even - if is returned. In this case, the document has not yet been saved. + if is returned. In this case, the document has not yet been saved. @return - if the storage could be successfully retrieved (in which case - _out_rStorage might or might not be ), otherwise. + if the storage could be successfully retrieved (in which case + _out_rStorage might or might not be ), otherwise. In the latter case, processing this document should stop. */ bool impl_getDocumentStorage_nothrow( const Reference< XModel >& _rxDocument, Reference< XStorage >& _out_rStorage ); @@ -190,7 +190,7 @@ namespace basic takes the dialog library container upon successful return @return - if and only if both containers exist, and could successfully be retrieved + if and only if both containers exist, and could successfully be retrieved */ bool impl_getDocumentLibraryContainers_nothrow( const Reference< XModel >& _rxDocument, @@ -451,7 +451,7 @@ namespace basic SotStorageRef xDummyStor = new SotStorage( ::rtl::OUString() ); _out_rpBasicManager = new BasicManager( *xDummyStor, String() /* TODO/LATER: xStorage */, pAppBasic, - &aAppBasicDir, TRUE ); + &aAppBasicDir, sal_True ); if ( _out_rpBasicManager->HasErrors() ) { // handle errors @@ -477,7 +477,7 @@ namespace basic // create new BASIC-manager StarBASIC* pBasic = new StarBASIC( pAppBasic ); pBasic->SetFlag( SBX_EXTSEARCH ); - _out_rpBasicManager = new BasicManager( pBasic, NULL, TRUE ); + _out_rpBasicManager = new BasicManager( pBasic, NULL, sal_True ); } // knit the containers with the BasicManager diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 84763468e64c..d1f68fed511b 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -90,15 +90,15 @@ typedef WeakImplHelper1< XStarBasicAccess > StarBasicAccessHelper; #define CURR_VER 2 // Version 1 -// ULONG nEndPos -// USHORT nId -// USHORT nVer -// BOOL bDoLoad +// sal_uIntPtr nEndPos +// sal_uInt16 nId +// sal_uInt16 nVer +// sal_Bool bDoLoad // String LibName // String AbsStorageName // String RelStorageName // Version 2 -// + BOOL bReference +// + sal_Bool bReference static const char* szStdLibName = "Standard"; static const char szBasicStorage[] = "StarBASIC"; @@ -252,7 +252,7 @@ void BasMgrContainerListenerImpl::addLibraryModulesImpl( BasicManager* pMgr, } } - pLib->SetModified( FALSE ); + pLib->SetModified( sal_False ); } @@ -310,7 +310,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementInserted( const ContainerEvent } else pLib->MakeModule32( aName, aMod ); - pLib->SetModified( FALSE ); + pLib->SetModified( sal_False ); } } } @@ -344,7 +344,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementReplaced( const ContainerEvent else pLib->MakeModule32( aName, aMod ); - pLib->SetModified( FALSE ); + pLib->SetModified( sal_False ); } } @@ -364,8 +364,8 @@ void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const ContainerEvent& StarBASIC* pLib = mpMgr->GetLib( aName ); if( pLib ) { - USHORT nLibId = mpMgr->GetLibId( aName ); - mpMgr->RemoveLib( nLibId, FALSE ); + sal_uInt16 nLibId = mpMgr->GetLibId( aName ); + mpMgr->RemoveLib( nLibId, sal_False ); } } else @@ -375,7 +375,7 @@ void SAL_CALL BasMgrContainerListenerImpl::elementRemoved( const ContainerEvent& if( pMod ) { pLib->Remove( pMod ); - pLib->SetModified( FALSE ); + pLib->SetModified( sal_False ); } } } @@ -394,7 +394,7 @@ public: void Reset(); void InsertError( const BasicError& rError ); - BOOL HasErrors() { return (BOOL)aErrorList.Count(); } + sal_Bool HasErrors() { return (sal_Bool)aErrorList.Count(); } BasicError* GetFirstError() { return aErrorList.First(); } BasicError* GetNextError() { return aErrorList.Next(); } }; @@ -428,7 +428,7 @@ BasicError::BasicError() nReason = 0; } -BasicError::BasicError( ULONG nId, USHORT nR, const String& rErrStr ) : +BasicError::BasicError( sal_uIntPtr nId, sal_uInt16 nR, const String& rErrStr ) : aErrStr( rErrStr ) { nErrorId = nId; @@ -452,10 +452,10 @@ private: String aRelStorageName; String aPassword; - BOOL bDoLoad; - BOOL bReference; - BOOL bPasswordVerified; - BOOL bFoundInPath; // Must not relativated again! + sal_Bool bDoLoad; + sal_Bool bReference; + sal_Bool bPasswordVerified; + sal_Bool bFoundInPath; // Must not relativated again! // Lib represents library in new UNO library container Reference< XLibraryContainer > mxScriptCont; @@ -464,10 +464,10 @@ public: BasicLibInfo(); BasicLibInfo( const String& rStorageName ); - BOOL IsReference() const { return bReference; } - BOOL& IsReference() { return bReference; } + sal_Bool IsReference() const { return bReference; } + sal_Bool& IsReference() { return bReference; } - BOOL IsExtern() const { return ! aStorageName.EqualsAscii(szImbedded); } + sal_Bool IsExtern() const { return ! aStorageName.EqualsAscii(szImbedded); } void SetStorageName( const String& rName ) { aStorageName = rName; } const String& GetStorageName() const { return aStorageName; } @@ -490,19 +490,19 @@ public: void SetLibName( const String& rName ) { aLibName = rName; } // Only temporary for Load/Save - BOOL DoLoad() { return bDoLoad; } + sal_Bool DoLoad() { return bDoLoad; } - BOOL HasPassword() const { return aPassword.Len() != 0; } + sal_Bool HasPassword() const { return aPassword.Len() != 0; } const String& GetPassword() const { return aPassword; } void SetPassword( const String& rNewPassword ) { aPassword = rNewPassword; } - BOOL IsPasswordVerified() const { return bPasswordVerified; } - void SetPasswordVerified() { bPasswordVerified = TRUE; } + sal_Bool IsPasswordVerified() const { return bPasswordVerified; } + void SetPasswordVerified() { bPasswordVerified = sal_True; } - BOOL IsFoundInPath() const { return bFoundInPath; } - void SetFoundInPath( BOOL bInPath ) { bFoundInPath = bInPath; } + sal_Bool IsFoundInPath() const { return bFoundInPath; } + void SetFoundInPath( sal_Bool bInPath ) { bFoundInPath = bInPath; } - void Store( SotStorageStream& rSStream, const String& rBasMgrStorageName, BOOL bUseOldReloadInfo ); + void Store( SotStorageStream& rSStream, const String& rBasMgrStorageName, sal_Bool bUseOldReloadInfo ); static BasicLibInfo* Create( SotStorageStream& rSStream ); Reference< XLibraryContainer > GetLibraryContainer( void ) @@ -521,10 +521,10 @@ public: BasicLibInfo::BasicLibInfo() { - bReference = FALSE; - bPasswordVerified = FALSE; - bDoLoad = FALSE; - bFoundInPath = FALSE; + bReference = sal_False; + bPasswordVerified = sal_False; + bDoLoad = sal_False; + bFoundInPath = sal_False; mxScriptCont = NULL; aStorageName = String::CreateFromAscii(szImbedded); aRelStorageName = String::CreateFromAscii(szImbedded); @@ -532,20 +532,20 @@ BasicLibInfo::BasicLibInfo() BasicLibInfo::BasicLibInfo( const String& rStorageName ) { - bReference = TRUE; - bPasswordVerified = FALSE; - bDoLoad = FALSE; + bReference = sal_True; + bPasswordVerified = sal_False; + bDoLoad = sal_False; mxScriptCont = NULL; aStorageName = rStorageName; } -void BasicLibInfo::Store( SotStorageStream& rSStream, const String& rBasMgrStorageName, BOOL bUseOldReloadInfo ) +void BasicLibInfo::Store( SotStorageStream& rSStream, const String& rBasMgrStorageName, sal_Bool bUseOldReloadInfo ) { - ULONG nStartPos = rSStream.Tell(); + sal_uIntPtr nStartPos = rSStream.Tell(); sal_uInt32 nEndPos = 0; - USHORT nId = LIBINFO_ID; - USHORT nVer = CURR_VER; + sal_uInt16 nId = LIBINFO_ID; + sal_uInt16 nVer = CURR_VER; rSStream << nEndPos; rSStream << nId; @@ -559,7 +559,7 @@ void BasicLibInfo::Store( SotStorageStream& rSStream, const String& rBasMgrStora aStorageName = aCurStorageName; // Load again? - BOOL bDoLoad_ = xLib.Is(); + sal_Bool bDoLoad_ = xLib.Is(); if ( bUseOldReloadInfo ) bDoLoad_ = DoLoad(); rSStream << bDoLoad_; @@ -612,8 +612,8 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) BasicLibInfo* pInfo = new BasicLibInfo; sal_uInt32 nEndPos; - USHORT nId; - USHORT nVer; + sal_uInt16 nId; + sal_uInt16 nVer; rSStream >> nEndPos; rSStream >> nId; @@ -623,7 +623,7 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) if( nId == LIBINFO_ID ) { // Reload? - BOOL bDoLoad; + sal_Bool bDoLoad; rSStream >> bDoLoad; pInfo->bDoLoad = bDoLoad; @@ -644,7 +644,7 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream ) if ( nVer >= 2 ) { - BOOL bReferenz; + sal_Bool bReferenz; rSStream >> bReferenz; pInfo->IsReference() = bReferenz; } @@ -667,7 +667,7 @@ void BasicLibInfo::CalcRelStorageName( const String& rMgrStorageName ) else SetRelStorageName( String() ); } -BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib, String* pLibPath, BOOL bDocMgr ) : mbDocMgr( bDocMgr ) +BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBASIC* pParentFromStdLib, String* pLibPath, sal_Bool bDocMgr ) : mbDocMgr( bDocMgr ) { DBG_CTOR( BasicManager, 0 ); @@ -704,13 +704,13 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA xStdLib->SetName( String::CreateFromAscii(szStdLibName) ); pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); - xStdLib->SetModified( FALSE ); + xStdLib->SetModified( sal_False ); } else { pStdLib->SetParent( pParentFromStdLib ); // The other get StdLib as parent: - for ( USHORT nBasic = 1; nBasic < GetLibCount(); nBasic++ ) + for ( sal_uInt16 nBasic = 1; nBasic < GetLibCount(); nBasic++ ) { StarBASIC* pBasic = GetLib( nBasic ); if ( pBasic ) @@ -721,7 +721,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA } } // Modified through insert - pStdLib->SetModified( FALSE ); + pStdLib->SetModified( sal_False ); } // #91626 Save all stream data to save it unmodified if basic isn't modified @@ -732,12 +732,12 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA *static_cast(&xManagerStream) >> *mpImpl->mpManagerStream; SotStorageRef xBasicStorage = rStorage.OpenSotStorage - ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, sal_False ); if( xBasicStorage.Is() && !xBasicStorage->GetError() ) { - USHORT nLibs = GetLibCount(); + sal_uInt16 nLibs = GetLibCount(); mpImpl->mppLibStreams = new SvMemoryStream*[ nLibs ]; - for( USHORT nL = 0; nL < nLibs; nL++ ) + for( sal_uInt16 nL = 0; nL < nLibs; nL++ ) { BasicLibInfo* pInfo = pLibs->GetObject( nL ); DBG_ASSERT( pInfo, "pInfo?!" ); @@ -756,7 +756,7 @@ BasicManager::BasicManager( SotStorage& rStorage, const String& rBaseURL, StarBA LoadOldBasicManager( rStorage ); } - bBasMgrModified = FALSE; + bBasMgrModified = sal_False; } void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInfo ) @@ -775,8 +775,8 @@ void copyToLibraryContainer( StarBASIC* pBasic, const LibraryContainerInfo& rInf if ( !xLib.is() ) return; - USHORT nModCount = pBasic->GetModules()->Count(); - for ( USHORT nMod = 0 ; nMod < nModCount ; nMod++ ) + sal_uInt16 nModCount = pBasic->GetModules()->Count(); + for ( sal_uInt16 nMod = 0 ; nMod < nModCount ; nMod++ ) { SbModule* pModule = (SbModule*)pBasic->GetModules()->Get( nMod ); DBG_ASSERT( pModule, "Modul nicht erhalten!" ); @@ -840,14 +840,14 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) else { // No libs? Maybe an 5.2 document already loaded - USHORT nLibs = GetLibCount(); - for( USHORT nL = 0; nL < nLibs; nL++ ) + sal_uInt16 nLibs = GetLibCount(); + for( sal_uInt16 nL = 0; nL < nLibs; nL++ ) { BasicLibInfo* pBasLibInfo = pLibs->GetObject( nL ); StarBASIC* pLib = pBasLibInfo->GetLib(); if( !pLib ) { - BOOL bLoaded = ImpLoadLibary( pBasLibInfo, NULL, FALSE ); + sal_Bool bLoaded = ImpLoadLibary( pBasLibInfo, NULL, sal_False ); if( bLoaded ) pLib = pBasLibInfo->GetLib(); } @@ -876,7 +876,7 @@ void BasicManager::SetLibraryContainerInfo( const LibraryContainerInfo& rInfo ) SetGlobalUNOConstant( "DialogLibraries", makeAny( mpImpl->maContainerInfo.mxDialogCont ) ); } -BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath, BOOL bDocMgr ) : mbDocMgr( bDocMgr ) +BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath, sal_Bool bDocMgr ) : mbDocMgr( bDocMgr ) { DBG_CTOR( BasicManager, 0 ); Init(); @@ -893,8 +893,8 @@ BasicManager::BasicManager( StarBASIC* pSLib, String* pLibPath, BOOL bDocMgr ) : pSLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); // Save is only necessary if basic has changed - xStdLib->SetModified( FALSE ); - bBasMgrModified = FALSE; + xStdLib->SetModified( sal_False ); + bBasMgrModified = sal_False; } BasicManager::BasicManager() @@ -919,7 +919,7 @@ void BasicManager::ImpMgrNotLoaded( const String& rStorageName ) xStdLib->SetName( String::CreateFromAscii(szStdLibName) ); pStdLibInfo->SetLibName( String::CreateFromAscii(szStdLibName) ); xStdLib->SetFlag( SBX_DONTSTORE | SBX_EXTSEARCH ); - xStdLib->SetModified( FALSE ); + xStdLib->SetModified( sal_False ); } @@ -934,7 +934,7 @@ void BasicManager::ImpCreateStdLib( StarBASIC* pParentFromStdLib ) } -void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseURL, BOOL bLoadLibs ) +void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseURL, sal_Bool bLoadLibs ) { DBG_CHKTHIS( BasicManager, 0 ); @@ -972,7 +972,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR sal_uInt32 nEndPos; *xManagerStream >> nEndPos; - USHORT nLibs; + sal_uInt16 nLibs; *xManagerStream >> nLibs; // Plausi! if( nLibs & 0xF000 ) @@ -980,7 +980,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR DBG_ASSERT( !this, "BasicManager-Stream defect!" ); return; } - for ( USHORT nL = 0; nL < nLibs; nL++ ) + for ( sal_uInt16 nL = 0; nL < nLibs; nL++ ) { BasicLibInfo* pInfo = BasicLibInfo::Create( *xManagerStream ); @@ -990,7 +990,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR { INetURLObject aObj( aRealStorageName, INET_PROT_FILE ); aObj.removeSegment(); - bool bWasAbsolute = FALSE; + bool bWasAbsolute = sal_False; aObj = aObj.smartRel2Abs( pInfo->GetRelStorageName(), bWasAbsolute ); //*** TODO: Replace if still necessary @@ -1006,7 +1006,7 @@ void BasicManager::LoadBasicManager( SotStorage& rStorage, const String& rBaseUR if( aPathCFG.SearchFile( aSearchFile, SvtPathOptions::PATH_BASIC ) ) { pInfo->SetStorageName( aSearchFile ); - pInfo->SetFoundInPath( TRUE ); + pInfo->SetFoundInPath( sal_True ); } } } @@ -1071,8 +1071,8 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) { String aCurStorageName( aStorName ); INetURLObject aCurStorage( aCurStorageName, INET_PROT_FILE ); - USHORT nLibs = aLibs.GetTokenCount( LIB_SEP ); - for ( USHORT nLib = 0; nLib < nLibs; nLib++ ) + sal_uInt16 nLibs = aLibs.GetTokenCount( LIB_SEP ); + for ( sal_uInt16 nLib = 0; nLib < nLibs; nLib++ ) { String aLibInfo( aLibs.GetToken( nLib, LIB_SEP ) ); // TODO: Remove == 2 @@ -1084,7 +1084,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) INetURLObject aLibRelStorage( aStorName ); aLibRelStorage.removeSegment(); - bool bWasAbsolute = FALSE; + bool bWasAbsolute = sal_False; aLibRelStorage = aLibRelStorage.smartRel2Abs( aLibRelStorageName, bWasAbsolute); DBG_ASSERT(!bWasAbsolute, "RelStorageName was absolute!" ); @@ -1093,14 +1093,14 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage ) xStorageRef = &rStorage; else { - xStorageRef = new SotStorage( FALSE, aLibAbsStorage.GetMainURL - ( INetURLObject::NO_DECODE ), eStorageReadMode, TRUE ); + xStorageRef = new SotStorage( sal_False, aLibAbsStorage.GetMainURL + ( INetURLObject::NO_DECODE ), eStorageReadMode, sal_True ); if ( xStorageRef->GetError() != ERRCODE_NONE ) - xStorageRef = new SotStorage( FALSE, aLibRelStorage. - GetMainURL( INetURLObject::NO_DECODE ), eStorageReadMode, TRUE ); + xStorageRef = new SotStorage( sal_False, aLibRelStorage. + GetMainURL( INetURLObject::NO_DECODE ), eStorageReadMode, sal_True ); } if ( xStorageRef.Is() ) - AddLib( *xStorageRef, aLibName, FALSE ); + AddLib( *xStorageRef, aLibName, sal_False ); else { // String aErrorText( BasicResId( IDS_SBERR_LIBLOAD ) ); @@ -1143,7 +1143,7 @@ void BasicManager::Init() { DBG_CHKTHIS( BasicManager, 0 ); - bBasMgrModified = FALSE; + bBasMgrModified = sal_False; pErrorMgr = new BasicErrorManager; pLibs = new BasicLibs; mpImpl = new BasicManagerImpl(); @@ -1158,7 +1158,7 @@ BasicLibInfo* BasicManager::CreateLibInfo() return pInf; } -BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, BOOL bInfosOnly ) const +sal_Bool BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorage, sal_Bool bInfosOnly ) const { DBG_CHKTHIS( BasicManager, 0 ); @@ -1186,10 +1186,10 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag } if ( !xStorage.Is() ) - xStorage = new SotStorage( FALSE, aStorageName, eStorageReadMode ); + xStorage = new SotStorage( sal_False, aStorageName, eStorageReadMode ); SotStorageRef xBasicStorage = xStorage->OpenSotStorage - ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, FALSE ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), eStorageReadMode, sal_False ); if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) { @@ -1207,7 +1207,7 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag } else { - BOOL bLoaded = FALSE; + sal_Bool bLoaded = sal_False; if ( xBasicStream->Seek( STREAM_SEEK_TO_END ) != 0 ) { if ( !bInfosOnly ) @@ -1220,7 +1220,7 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag xBasicStream->SetBufferSize( 0 ); StarBASICRef xStdLib = pLibInfo->GetLib(); xStdLib->SetName( pLibInfo->GetLibName() ); - xStdLib->SetModified( FALSE ); + xStdLib->SetModified( sal_False ); xStdLib->SetFlag( SBX_DONTSTORE ); } else @@ -1229,7 +1229,7 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag xBasicStream->Seek( STREAM_SEEK_TO_BEGIN ); ImplEncryptStream( *xBasicStream ); SbxBase::Skip( *xBasicStream ); - bLoaded = TRUE; + bLoaded = sal_True; } } if ( !bLoaded ) @@ -1256,20 +1256,20 @@ BOOL BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurStorag return bLoaded; } } - return FALSE; + return sal_False; } -BOOL BasicManager::ImplEncryptStream( SvStream& rStrm ) const +sal_Bool BasicManager::ImplEncryptStream( SvStream& rStrm ) const { - ULONG nPos = rStrm.Tell(); - UINT32 nCreator; + sal_uIntPtr nPos = rStrm.Tell(); + sal_uInt32 nCreator; rStrm >> nCreator; rStrm.Seek( nPos ); - BOOL bProtected = FALSE; + sal_Bool bProtected = sal_False; if ( nCreator != SBXCR_SBX ) { // Should only be the case for encrypted Streams - bProtected = TRUE; + bProtected = sal_True; rStrm.SetKey( szCryptingKey ); rStrm.RefreshBuffer(); } @@ -1278,11 +1278,11 @@ BOOL BasicManager::ImplEncryptStream( SvStream& rStrm ) const // This code is necessary to load the BASIC of Beta 1 // TODO: Which Beta 1? -BOOL BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const +sal_Bool BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) const { - BOOL bProtected = ImplEncryptStream( rStrm ); + sal_Bool bProtected = ImplEncryptStream( rStrm ); SbxBaseRef xNew = SbxBase::Load( rStrm ); - BOOL bLoaded = FALSE; + sal_Bool bLoaded = sal_False; if( xNew.Is() ) { if( xNew->IsA( TYPE(StarBASIC) ) ) @@ -1308,8 +1308,8 @@ BOOL BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) con rOldBasic->SetFlag( SBX_EXTSEARCH ); } */ - pNew->SetModified( FALSE ); - bLoaded = TRUE; + pNew->SetModified( sal_False ); + bLoaded = sal_True; } } if ( bProtected ) @@ -1317,14 +1317,14 @@ BOOL BasicManager::ImplLoadBasic( SvStream& rStrm, StarBASICRef& rOldBasic ) con return bLoaded; } -void BasicManager::CheckModules( StarBASIC* pLib, BOOL bReference ) const +void BasicManager::CheckModules( StarBASIC* pLib, sal_Bool bReference ) const { if ( !pLib ) return; - BOOL bModified = pLib->IsModified(); + sal_Bool bModified = pLib->IsModified(); - for ( USHORT nMod = 0; nMod < pLib->GetModules()->Count(); nMod++ ) + for ( sal_uInt16 nMod = 0; nMod < pLib->GetModules()->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pLib->GetModules()->Get( nMod ); DBG_ASSERT( pModule, "Modul nicht erhalten!" ); @@ -1337,11 +1337,11 @@ void BasicManager::CheckModules( StarBASIC* pLib, BOOL bReference ) const if( !bModified && bReference ) { DBG_ERROR( "Per Reference eingebundene Basic-Library ist nicht compiliert!" ); - pLib->SetModified( FALSE ); + pLib->SetModified( sal_False ); } } -StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, BOOL bReference ) +StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, sal_Bool bReference ) { DBG_CHKTHIS( BasicManager, 0 ); @@ -1359,12 +1359,12 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, B // Use original name otherwise ImpLoadLibary failes... pLibInfo->SetLibName( rLibName ); // Funktioniert so aber nicht, wenn Name doppelt -// USHORT nLibId = GetLibId( rLibName ); - USHORT nLibId = (USHORT) pLibs->GetPos( pLibInfo ); +// sal_uInt16 nLibId = GetLibId( rLibName ); + sal_uInt16 nLibId = (sal_uInt16) pLibs->GetPos( pLibInfo ); // Set StorageName before load because it is compared with pCurStorage pLibInfo->SetStorageName( aStorageName ); - BOOL bLoaded = ImpLoadLibary( pLibInfo, &rStorage ); + sal_Bool bLoaded = ImpLoadLibary( pLibInfo, &rStorage ); if ( bLoaded ) { @@ -1373,21 +1373,21 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, B if ( bReference ) { - pLibInfo->GetLib()->SetModified( FALSE ); // Don't save in this case + pLibInfo->GetLib()->SetModified( sal_False ); // Don't save in this case pLibInfo->SetRelStorageName( String() ); // pLibInfo->CalcRelStorageName( GetStorageName() ); - pLibInfo->IsReference() = TRUE; + pLibInfo->IsReference() = sal_True; } else { - pLibInfo->GetLib()->SetModified( TRUE ); // Must be saved after Add! + pLibInfo->GetLib()->SetModified( sal_True ); // Must be saved after Add! pLibInfo->SetStorageName( String::CreateFromAscii(szImbedded) ); // Save in BasicManager-Storage } - bBasMgrModified = TRUE; + bBasMgrModified = sal_True; } else { - RemoveLib( nLibId, FALSE ); + RemoveLib( nLibId, sal_False ); pLibInfo = 0; } @@ -1397,7 +1397,7 @@ StarBASIC* BasicManager::AddLib( SotStorage& rStorage, const String& rLibName, B return 0; } -BOOL BasicManager::IsReference( USHORT nLib ) +sal_Bool BasicManager::IsReference( sal_uInt16 nLib ) { DBG_CHKTHIS( BasicManager, 0 ); @@ -1406,16 +1406,16 @@ BOOL BasicManager::IsReference( USHORT nLib ) if ( pLibInfo ) return pLibInfo->IsReference(); - return FALSE; + return sal_False; } -BOOL BasicManager::RemoveLib( USHORT nLib ) +sal_Bool BasicManager::RemoveLib( sal_uInt16 nLib ) { // Only pyhsical deletion if no reference return RemoveLib( nLib, !IsReference( nLib ) ); } -BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) +sal_Bool BasicManager::RemoveLib( sal_uInt16 nLib, sal_Bool bDelBasicFromStorage ) { DBG_CHKTHIS( BasicManager, 0 ); DBG_ASSERT( nLib, "Standard-Lib cannot be removed!" ); @@ -1428,7 +1428,7 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) // String aErrorText( BasicResId( IDS_SBERR_REMOVELIB ) ); StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, String(), ERRCODE_BUTTON_OK ); pErrorMgr->InsertError( BasicError( *pErrInf, BASERR_REASON_STDLIB, pLibInfo->GetLibName() ) ); - return FALSE; + return sal_False; } // If one of the streams cannot be opened, this is not an error, @@ -1438,14 +1438,14 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) { SotStorageRef xStorage; if ( !pLibInfo->IsExtern() ) - xStorage = new SotStorage( FALSE, GetStorageName() ); + xStorage = new SotStorage( sal_False, GetStorageName() ); else - xStorage = new SotStorage( FALSE, pLibInfo->GetStorageName() ); + xStorage = new SotStorage( sal_False, pLibInfo->GetStorageName() ); if ( xStorage->IsStorage( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)) ) ) { SotStorageRef xBasicStorage = xStorage->OpenSotStorage - ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), STREAM_STD_READWRITE, FALSE ); + ( String(RTL_CONSTASCII_USTRINGPARAM(szBasicStorage)), STREAM_STD_READWRITE, sal_False ); if ( !xBasicStorage.Is() || xBasicStorage->GetError() ) { @@ -1483,20 +1483,20 @@ BOOL BasicManager::RemoveLib( USHORT nLib, BOOL bDelBasicFromStorage ) } } } - bBasMgrModified = TRUE; + bBasMgrModified = sal_True; if ( pLibInfo->GetLib().Is() ) GetStdLib()->Remove( pLibInfo->GetLib() ); delete pLibs->Remove( pLibInfo ); - return TRUE; // Remove was successful, del unimportant + return sal_True; // Remove was successful, del unimportant } -USHORT BasicManager::GetLibCount() const +sal_uInt16 BasicManager::GetLibCount() const { DBG_CHKTHIS( BasicManager, 0 ); - return (USHORT)pLibs->Count(); + return (sal_uInt16)pLibs->Count(); } -StarBASIC* BasicManager::GetLib( USHORT nLib ) const +StarBASIC* BasicManager::GetLib( sal_uInt16 nLib ) const { DBG_CHKTHIS( BasicManager, 0 ); BasicLibInfo* pInf = pLibs->GetObject( nLib ); @@ -1528,7 +1528,7 @@ StarBASIC* BasicManager::GetLib( const String& rName ) const return 0; } -USHORT BasicManager::GetLibId( const String& rName ) const +sal_uInt16 BasicManager::GetLibId( const String& rName ) const { DBG_CHKTHIS( BasicManager, 0 ); @@ -1536,14 +1536,14 @@ USHORT BasicManager::GetLibId( const String& rName ) const while ( pInf ) { if ( pInf->GetLibName().CompareIgnoreCaseToAscii( rName ) == COMPARE_EQUAL ) - return (USHORT)pLibs->GetCurPos(); + return (sal_uInt16)pLibs->GetCurPos(); pInf = pLibs->Next(); } return LIB_NOTFOUND; } -BOOL BasicManager::HasLib( const String& rName ) const +sal_Bool BasicManager::HasLib( const String& rName ) const { DBG_CHKTHIS( BasicManager, 0 ); @@ -1551,14 +1551,14 @@ BOOL BasicManager::HasLib( const String& rName ) const while ( pInf ) { if ( pInf->GetLibName().CompareIgnoreCaseToAscii( rName ) == COMPARE_EQUAL ) - return TRUE; + return sal_True; pInf = pLibs->Next(); } - return FALSE; + return sal_False; } -BOOL BasicManager::SetLibName( USHORT nLib, const String& rName ) +sal_Bool BasicManager::SetLibName( sal_uInt16 nLib, const String& rName ) { DBG_CHKTHIS( BasicManager, 0 ); @@ -1571,15 +1571,15 @@ BOOL BasicManager::SetLibName( USHORT nLib, const String& rName ) { StarBASICRef xStdLib = pLibInfo->GetLib(); xStdLib->SetName( rName ); - xStdLib->SetModified( TRUE ); + xStdLib->SetModified( sal_True ); } - bBasMgrModified = TRUE; - return TRUE; + bBasMgrModified = sal_True; + return sal_True; } - return FALSE; + return sal_False; } -String BasicManager::GetLibName( USHORT nLib ) +String BasicManager::GetLibName( sal_uInt16 nLib ) { DBG_CHKTHIS( BasicManager, 0 ); @@ -1590,11 +1590,11 @@ String BasicManager::GetLibName( USHORT nLib ) return String(); } -BOOL BasicManager::LoadLib( USHORT nLib ) +sal_Bool BasicManager::LoadLib( sal_uInt16 nLib ) { DBG_CHKTHIS( BasicManager, 0 ); - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; BasicLibInfo* pLibInfo = pLibs->GetObject( nLib ); DBG_ASSERT( pLibInfo, "Lib?!" ); if ( pLibInfo ) @@ -1608,7 +1608,7 @@ BOOL BasicManager::LoadLib( USHORT nLib ) } else { - bDone = ImpLoadLibary( pLibInfo, NULL, FALSE ); + bDone = ImpLoadLibary( pLibInfo, NULL, sal_False ); StarBASIC* pLib = GetLib( nLib ); if ( pLib ) { @@ -1654,17 +1654,17 @@ StarBASIC* BasicManager::CreateLib { if( LinkTargetURL.Len() != 0 ) { - SotStorageRef xStorage = new SotStorage( FALSE, LinkTargetURL, STREAM_READ | STREAM_SHARE_DENYWRITE ); + SotStorageRef xStorage = new SotStorage( sal_False, LinkTargetURL, STREAM_READ | STREAM_SHARE_DENYWRITE ); if( !xStorage->GetError() ) { - pLib = AddLib( *xStorage, rLibName, TRUE ); + pLib = AddLib( *xStorage, rLibName, sal_True ); //if( !pLibInfo ) //pLibInfo = FindLibInfo( pLib ); //pLibInfo->SetStorageName( LinkTargetURL ); - //pLibInfo->GetLib()->SetModified( FALSE ); // Dann nicht speichern + //pLibInfo->GetLib()->SetModified( sal_False ); // Dann nicht speichern //pLibInfo->SetRelStorageName( String() ); - //pLibInfo->IsReference() = TRUE; + //pLibInfo->IsReference() = sal_True; } //else //Message? @@ -1720,16 +1720,16 @@ BasicLibInfo* BasicManager::FindLibInfo( StarBASIC* pBasic ) const } -BOOL BasicManager::IsModified() const +sal_Bool BasicManager::IsModified() const { DBG_CHKTHIS( BasicManager, 0 ); if ( bBasMgrModified ) - return TRUE; + return sal_True; return IsBasicModified(); } -BOOL BasicManager::IsBasicModified() const +sal_Bool BasicManager::IsBasicModified() const { DBG_CHKTHIS( BasicManager, 0 ); @@ -1737,17 +1737,17 @@ BOOL BasicManager::IsBasicModified() const while ( pInf ) { if ( pInf->GetLib().Is() && pInf->GetLib()->IsModified() ) - return TRUE; + return sal_True; pInf = pLibs->Next(); } - return FALSE; + return sal_False; } -void BasicManager::SetFlagToAllLibs( short nFlag, BOOL bSet ) const +void BasicManager::SetFlagToAllLibs( short nFlag, sal_Bool bSet ) const { - USHORT nLibs = GetLibCount(); - for ( USHORT nL = 0; nL < nLibs; nL++ ) + sal_uInt16 nLibs = GetLibCount(); + for ( sal_uInt16 nL = 0; nL < nLibs; nL++ ) { BasicLibInfo* pInfo = pLibs->GetObject( nL ); DBG_ASSERT( pInfo, "Info?!" ); @@ -1762,7 +1762,7 @@ void BasicManager::SetFlagToAllLibs( short nFlag, BOOL bSet ) const } } -BOOL BasicManager::HasErrors() +sal_Bool BasicManager::HasErrors() { DBG_CHKTHIS( BasicManager, 0 ); return pErrorMgr->HasErrors(); @@ -2021,10 +2021,10 @@ Sequence< ::rtl::OUString > ModuleContainer_Impl::getElementNames() throw(RuntimeException) { SbxArray* pMods = mpLib ? mpLib->GetModules() : NULL; - USHORT nMods = pMods ? pMods->Count() : 0; + sal_uInt16 nMods = pMods ? pMods->Count() : 0; Sequence< ::rtl::OUString > aRetSeq( nMods ); ::rtl::OUString* pRetSeq = aRetSeq.getArray(); - for( USHORT i = 0 ; i < nMods ; i++ ) + for( sal_uInt16 i = 0 ; i < nMods ; i++ ) { SbxVariable* pMod = pMods->Get( i ); pRetSeq[i] = ::rtl::OUString( pMod->GetName() ); @@ -2351,10 +2351,10 @@ Any LibraryContainer_Impl::getByName( const ::rtl::OUString& aName ) Sequence< ::rtl::OUString > LibraryContainer_Impl::getElementNames() throw(RuntimeException) { - USHORT nLibs = mpMgr->GetLibCount(); + sal_uInt16 nLibs = mpMgr->GetLibCount(); Sequence< ::rtl::OUString > aRetSeq( nLibs ); ::rtl::OUString* pRetSeq = aRetSeq.getArray(); - for( USHORT i = 0 ; i < nLibs ; i++ ) + for( sal_uInt16 i = 0 ; i < nLibs ; i++ ) { pRetSeq[i] = ::rtl::OUString( mpMgr->GetLibName( i ) ); } @@ -2391,7 +2391,7 @@ void LibraryContainer_Impl::removeByName( const ::rtl::OUString& Name ) StarBASIC* pLib = mpMgr->GetLib( Name ); if( !pLib ) throw NoSuchElementException(); - USHORT nLibId = mpMgr->GetLibId( Name ); + sal_uInt16 nLibId = mpMgr->GetLibId( Name ); mpMgr->RemoveLib( nLibId ); } diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx index a837a3dc4f24..37d777cb8da8 100644 --- a/basic/source/classes/disas.cxx +++ b/basic/source/classes/disas.cxx @@ -236,7 +236,7 @@ static const char* _crlf() } // This method exists because we want to load the file as own segment -BOOL SbModule::Disassemble( String& rText ) +sal_Bool SbModule::Disassemble( String& rText ) { rText.Erase(); if( pImage ) @@ -244,7 +244,7 @@ BOOL SbModule::Disassemble( String& rText ) SbiDisas aDisas( this, pImage ); aDisas.Disas( rText ); } - return BOOL( rText.Len() != 0 ); + return sal_Bool( rText.Len() != 0 ); } SbiDisas::SbiDisas( SbModule* p, const SbiImage* q ) : rImg( *q ), pMod( p ) @@ -278,23 +278,23 @@ SbiDisas::SbiDisas( SbModule* p, const SbiImage* q ) : rImg( *q ), pMod( p ) } nOff = 0; // Add the publics - for( USHORT i = 0; i < pMod->GetMethods()->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMod->GetMethods()->Count(); i++ ) { SbMethod* pMeth = PTR_CAST(SbMethod,pMod->GetMethods()->Get( i )); if( pMeth ) { - USHORT nPos = (USHORT) (pMeth->GetId()); + sal_uInt16 nPos = (sal_uInt16) (pMeth->GetId()); cLabels[ nPos >> 3 ] |= ( 1 << ( nPos & 7 ) ); } } } // Read current opcode -BOOL SbiDisas::Fetch() +sal_Bool SbiDisas::Fetch() { nPC = nOff; if( nOff >= rImg.GetCodeSize() ) - return FALSE; + return sal_False; const unsigned char* p = (const unsigned char*)( rImg.GetCode() + nOff ); eOp = (SbiOpcode) ( *p++ & 0xFF ); if( eOp <= SbOP0_END ) @@ -302,29 +302,29 @@ BOOL SbiDisas::Fetch() nOp1 = nOp2 = 0; nParts = 1; nOff++; - return TRUE; + return sal_True; } else if( eOp <= SbOP1_END ) { nOff += 5; if( nOff > rImg.GetCodeSize() ) - return FALSE; + return sal_False; nOp1 = *p++; nOp1 |= *p++ << 8; nOp1 |= *p++ << 16; nOp1 |= *p++ << 24; nParts = 2; - return TRUE; + return sal_True; } else if( eOp <= SbOP2_END ) { nOff += 9; if( nOff > rImg.GetCodeSize() ) - return FALSE; + return sal_False; nOp1 = *p++; nOp1 |= *p++ << 8; nOp1 |= *p++ << 16; nOp1 |= *p++ << 24; nOp2 = *p++; nOp2 |= *p++ << 8; nOp2 |= *p++ << 16; nOp2 |= *p++ << 24; nParts = 3; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } void SbiDisas::Disas( SvStream& r ) @@ -351,7 +351,7 @@ void SbiDisas::Disas( String& r ) aText.ConvertLineEnd(); } -BOOL SbiDisas::DisasLine( String& rText ) +sal_Bool SbiDisas::DisasLine( String& rText ) { char cBuf[ 100 ]; const char* pMask[] = { @@ -361,7 +361,7 @@ BOOL SbiDisas::DisasLine( String& rText ) "%08" SAL_PRIXUINT32 " %02X %08X %08X " }; rText.Erase(); if( !Fetch() ) - return FALSE; + return sal_False; #ifdef DBG_TRACE_BASIC String aTraceStr_STMNT; @@ -373,8 +373,8 @@ BOOL SbiDisas::DisasLine( String& rText ) // Find line String aSource = rImg.aOUSource; nLine = nOp1; - USHORT n = 0; - USHORT l = (USHORT)nLine; + sal_uInt16 n = 0; + sal_uInt16 l = (sal_uInt16)nLine; while( --l ) { n = aSource.SearchAscii( "\n", n ); if( n == STRING_NOTFOUND ) break; @@ -383,16 +383,16 @@ BOOL SbiDisas::DisasLine( String& rText ) // Show position if( n != STRING_NOTFOUND ) { - USHORT n2 = aSource.SearchAscii( "\n", n ); + sal_uInt16 n2 = aSource.SearchAscii( "\n", n ); if( n2 == STRING_NOTFOUND ) n2 = aSource.Len() - n; String s( aSource.Copy( n, n2 - n + 1 ) ); - BOOL bDone; + sal_Bool bDone; do { - bDone = TRUE; + bDone = sal_True; n = s.Search( '\r' ); - if( n != STRING_NOTFOUND ) bDone = FALSE, s.Erase( n, 1 ); + if( n != STRING_NOTFOUND ) bDone = sal_False, s.Erase( n, 1 ); n = s.Search( '\n' ); - if( n != STRING_NOTFOUND ) bDone = FALSE, s.Erase( n, 1 ); + if( n != STRING_NOTFOUND ) bDone = sal_False, s.Erase( n, 1 ); } while( !bDone ); // snprintf( cBuf, sizeof(cBuf), pMask[ 0 ], nPC ); // rText += cBuf; @@ -412,7 +412,7 @@ BOOL SbiDisas::DisasLine( String& rText ) { // Public? ByteString aByteMethName; - for( USHORT i = 0; i < pMod->GetMethods()->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMod->GetMethods()->Count(); i++ ) { SbMethod* pMeth = PTR_CAST(SbMethod,pMod->GetMethods()->Get( i )); if( pMeth ) @@ -442,7 +442,7 @@ BOOL SbiDisas::DisasLine( String& rText ) rText += ':'; rText.AppendAscii( _crlf() ); } - snprintf( cBuf, sizeof(cBuf), pMask[ nParts ], nPC, (USHORT) eOp, nOp1, nOp2 ); + snprintf( cBuf, sizeof(cBuf), pMask[ nParts ], nPC, (sal_uInt16) eOp, nOp1, nOp2 ); String aPCodeStr; aPCodeStr.AppendAscii( cBuf ); @@ -466,13 +466,13 @@ BOOL SbiDisas::DisasLine( String& rText ) dbg_RegisterTraceTextForPC( pMod, nPC, aTraceStr_STMNT, aPCodeStr ); #endif - return TRUE; + return sal_True; } // Read from StringPool void SbiDisas::StrOp( String& rText ) { - String aStr = rImg.GetString( (USHORT)nOp1 ); + String aStr = rImg.GetString( (sal_uInt16)nOp1 ); ByteString aByteString( aStr, RTL_TEXTENCODING_ASCII_US ); const char* p = aByteString.GetBuffer(); if( p ) @@ -484,7 +484,7 @@ void SbiDisas::StrOp( String& rText ) else { rText.AppendAscii( "?String? " ); - rText += (USHORT)nOp1; + rText += (sal_uInt16)nOp1; } } @@ -538,7 +538,7 @@ void SbiDisas::ResumeOp( String& rText ) } // print Prompt -// FALSE/TRUE +// sal_False/TRUE void SbiDisas::PromptOp( String& rText ) { if( nOp1 ) @@ -570,16 +570,16 @@ void SbiDisas::CharOp( String& rText ) rText += '\''; else rText.AppendAscii( "char " ), - rText += (USHORT)nOp1; + rText += (sal_uInt16)nOp1; } // Print var: String-ID and type void SbiDisas::VarOp( String& rText ) { - rText += rImg.GetString( (USHORT)(nOp1 & 0x7FFF) ); + rText += rImg.GetString( (sal_uInt16)(nOp1 & 0x7FFF) ); rText.AppendAscii( "\t; " ); // The type - UINT32 n = nOp1; + sal_uInt32 n = nOp1; nOp1 = nOp2; TypeOp( rText ); if( n & 0x8000 ) @@ -589,7 +589,7 @@ void SbiDisas::VarOp( String& rText ) // Define variable: String-ID and type void SbiDisas::VarDefOp( String& rText ) { - rText += rImg.GetString( (USHORT)(nOp1 & 0x7FFF) ); + rText += rImg.GetString( (sal_uInt16)(nOp1 & 0x7FFF) ); rText.AppendAscii( "\t; " ); // The Typ nOp1 = nOp2; @@ -602,7 +602,7 @@ void SbiDisas::OffOp( String& rText ) rText += String::CreateFromInt32( nOp1 & 0x7FFF ); rText.AppendAscii( "\t; " ); // The type - UINT32 n = nOp1; + sal_uInt32 n = nOp1; nOp1 = nOp2; TypeOp( rText ); if( n & 0x8000 ) @@ -638,14 +638,14 @@ void SbiDisas::TypeOp( String& rText ) else { rText.AppendAscii( "type " ); - rText += (USHORT)nOp1; + rText += (sal_uInt16)nOp1; } } #ifdef HP9000 #undef pTypes #endif -// TRUE-Label, condition Opcode +// sal_True-Label, condition Opcode void SbiDisas::CaseOp( String& rText ) { LblOp( rText ); @@ -658,8 +658,8 @@ void SbiDisas::StmntOp( String& rText ) { rText += String::CreateFromInt32( nOp1 ); rText += ','; - UINT32 nCol = nOp2 & 0xFF; - UINT32 nFor = nOp2 / 0x100; + sal_uInt32 nCol = nOp2 & 0xFF; + sal_uInt32 nFor = nOp2 / 0x100; rText += String::CreateFromInt32( nCol ); rText.AppendAscii( " (For-Level: " ); rText += String::CreateFromInt32( nFor ); diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index 6c77259ccc7d..8d9f30e4982f 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -298,7 +298,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any if( aName == aLibName ) { // Search only in the lib, not automatically in application basic - USHORT nFlags = pBasic->GetFlags(); + sal_uInt16 nFlags = pBasic->GetFlags(); pBasic->ResetFlag( SBX_GBLSEARCH ); pMethVar = pBasic->Find( aMacro, SbxCLASS_DONTCARE ); pBasic->SetFlags( nFlags ); @@ -328,7 +328,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any { SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); unoToSbxValue( (SbxVariable*)xVar, pArgs[i] ); - xArray->Put( xVar, sal::static_int_cast< USHORT >(i+1) ); + xArray->Put( xVar, sal::static_int_cast< sal_uInt16 >(i+1) ); } } @@ -443,7 +443,7 @@ static ::rtl::OUString aDecorationPropName = static ::rtl::OUString aTitlePropName = ::rtl::OUString::createFromAscii( "Title" ); -void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { static ::rtl::OUString aResourceResolverPropName = ::rtl::OUString::createFromAscii( "ResourceResolver" ); diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 79f49eb8724a..fc6228d1aee9 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -47,8 +47,8 @@ SbiImage::SbiImage() nLegacyCodeSize = nDimBase = 0; bInit = - bError = FALSE; - bFirstInit = TRUE; + bError = sal_False; + bFirstInit = sal_True; eCharSet = gsl_getSystemTextEncoding(); } @@ -73,7 +73,7 @@ void SbiImage::Clear() nCodeSize = 0; eCharSet = gsl_getSystemTextEncoding(); nDimBase = 0; - bError = FALSE; + bError = sal_False; } /************************************************************************** @@ -82,25 +82,25 @@ void SbiImage::Clear() * **************************************************************************/ -BOOL SbiGood( SvStream& r ) +sal_Bool SbiGood( SvStream& r ) { - return BOOL( !r.IsEof() && r.GetError() == SVSTREAM_OK ); + return sal_Bool( !r.IsEof() && r.GetError() == SVSTREAM_OK ); } // Open Record -ULONG SbiOpenRecord( SvStream& r, UINT16 nSignature, UINT16 nElem ) +sal_uIntPtr SbiOpenRecord( SvStream& r, sal_uInt16 nSignature, sal_uInt16 nElem ) { - ULONG nPos = r.Tell(); - r << nSignature << (INT32) 0 << nElem; + sal_uIntPtr nPos = r.Tell(); + r << nSignature << (sal_Int32) 0 << nElem; return nPos; } // Close Record -void SbiCloseRecord( SvStream& r, ULONG nOff ) +void SbiCloseRecord( SvStream& r, sal_uIntPtr nOff ) { - ULONG nPos = r.Tell(); + sal_uIntPtr nPos = r.Tell(); r.Seek( nOff + 2 ); - r << (INT32) ( nPos - nOff - 8 ); + r << (sal_Int32) ( nPos - nOff - 8 ); r.Seek( nPos ); } @@ -112,40 +112,40 @@ void SbiCloseRecord( SvStream& r, ULONG nOff ) // If the version number does not find, binary parts are omitted, but not // source, comments and name -BOOL SbiImage::Load( SvStream& r ) +sal_Bool SbiImage::Load( SvStream& r ) { - UINT32 nVersion = 0; // Versionsnumber + sal_uInt32 nVersion = 0; // Versionsnumber return Load( r, nVersion ); } -BOOL SbiImage::Load( SvStream& r, UINT32& nVersion ) +sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion ) { - UINT16 nSign, nCount; - UINT32 nLen, nOff; + sal_uInt16 nSign, nCount; + sal_uInt32 nLen, nOff; Clear(); // Read Master-Record r >> nSign >> nLen >> nCount; - ULONG nLast = r.Tell() + nLen; - UINT32 nCharSet; // System charset - UINT32 lDimBase; - UINT16 nReserved1; - UINT32 nReserved2; - UINT32 nReserved3; - BOOL bBadVer = FALSE; + sal_uIntPtr nLast = r.Tell() + nLen; + sal_uInt32 nCharSet; // System charset + sal_uInt32 lDimBase; + sal_uInt16 nReserved1; + sal_uInt32 nReserved2; + sal_uInt32 nReserved3; + sal_Bool bBadVer = sal_False; if( nSign == B_MODULE ) { r >> nVersion >> nCharSet >> lDimBase >> nFlags >> nReserved1 >> nReserved2 >> nReserved3; eCharSet = (CharSet) nCharSet; eCharSet = GetSOLoadTextEncoding( eCharSet ); - bBadVer = BOOL( nVersion > B_CURVERSION ); - nDimBase = (USHORT) lDimBase; + bBadVer = sal_Bool( nVersion > B_CURVERSION ); + nDimBase = (sal_uInt16) lDimBase; } bool bLegacy = ( nVersion < B_EXT_IMG_VERSION ); - ULONG nNext; + sal_uIntPtr nNext; while( ( nNext = r.Tell() ) < nLast ) { short i; @@ -174,7 +174,7 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion ) #ifdef EXTENDED_BINARY_MODULES case B_EXTSOURCE: { - for( UINT16 j = 0 ; j < nCount ; j++ ) + for( sal_uInt16 j = 0 ; j < nCount ; j++ ) { String aTmp; r.ReadByteString( aTmp, eCharSet ); @@ -191,10 +191,10 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion ) if ( bLegacy ) { ReleaseLegacyBuffer(); // release any previously held buffer - nLegacyCodeSize = (UINT16) nCodeSize; + nLegacyCodeSize = (sal_uInt16) nCodeSize; pLegacyPCode = pCode; - PCodeBuffConvertor< UINT16, UINT32 > aLegacyToNew( (BYTE*)pLegacyPCode, nLegacyCodeSize ); + PCodeBuffConvertor< sal_uInt16, sal_uInt32 > aLegacyToNew( (sal_uInt8*)pLegacyPCode, nLegacyCodeSize ); aLegacyToNew.convert(); pCode = (char*)aLegacyToNew.GetBuffer(); nCodeSize = aLegacyToNew.GetSize(); @@ -219,20 +219,20 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion ) for( i = 0; i < nStrings && SbiGood( r ); i++ ) { r >> nOff; - pStringOff[ i ] = (USHORT) nOff; + pStringOff[ i ] = (sal_uInt16) nOff; } r >> nLen; if( SbiGood( r ) ) { delete [] pStrings; pStrings = new sal_Unicode[ nLen ]; - nStringSize = (USHORT) nLen; + nStringSize = (sal_uInt16) nLen; char* pByteStrings = new char[ nLen ]; r.Read( pByteStrings, nStringSize ); for( short j = 0; j < nStrings; j++ ) { - USHORT nOff2 = (USHORT) pStringOff[ j ]; + sal_uInt16 nOff2 = (sal_uInt16) pStringOff[ j ]; String aStr( pByteStrings + nOff2, eCharSet ); memcpy( pStrings + nOff2, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( sal_Unicode ) ); } @@ -252,11 +252,11 @@ done: //if( eCharSet != ::GetSystemCharSet() ) //ConvertStrings(); if( !SbiGood( r ) ) - bError = TRUE; - return BOOL( !bError ); + bError = sal_True; + return sal_Bool( !bError ); } -BOOL SbiImage::Save( SvStream& r, UINT32 nVer ) +sal_Bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) { bool bLegacy = ( nVer < B_EXT_IMG_VERSION ); @@ -267,23 +267,23 @@ BOOL SbiImage::Save( SvStream& r, UINT32 nVer ) SbiImage aEmptyImg; aEmptyImg.aName = aName; aEmptyImg.Save( r, B_LEGACYVERSION ); - return TRUE; + return sal_True; } // First of all the header - ULONG nStart = SbiOpenRecord( r, B_MODULE, 1 ); - ULONG nPos; + sal_uIntPtr nStart = SbiOpenRecord( r, B_MODULE, 1 ); + sal_uIntPtr nPos; eCharSet = GetSOStoreTextEncoding( eCharSet ); if ( bLegacy ) - r << (INT32) B_LEGACYVERSION; + r << (sal_Int32) B_LEGACYVERSION; else - r << (INT32) B_CURVERSION; - r << (INT32) eCharSet - << (INT32) nDimBase - << (INT16) nFlags - << (INT16) 0 - << (INT32) 0 - << (INT32) 0; + r << (sal_Int32) B_CURVERSION; + r << (sal_Int32) eCharSet + << (sal_Int32) nDimBase + << (sal_Int16) nFlags + << (sal_Int16) 0 + << (sal_Int32) 0 + << (sal_Int32) 0; // Name? if( aName.Len() && SbiGood( r ) ) @@ -320,9 +320,9 @@ BOOL SbiImage::Save( SvStream& r, UINT32 nVer ) if( nLen > STRING_MAXLEN ) { sal_Int32 nRemainingLen = nLen - nMaxUnitSize; - UINT16 nUnitCount = UINT16( (nRemainingLen + nMaxUnitSize - 1) / nMaxUnitSize ); + sal_uInt16 nUnitCount = sal_uInt16( (nRemainingLen + nMaxUnitSize - 1) / nMaxUnitSize ); nPos = SbiOpenRecord( r, B_EXTSOURCE, nUnitCount ); - for( UINT16 i = 0 ; i < nUnitCount ; i++ ) + for( sal_uInt16 i = 0 ; i < nUnitCount ; i++ ) { sal_Int32 nCopyLen = (nRemainingLen > nMaxUnitSize) ? nMaxUnitSize : nRemainingLen; @@ -341,7 +341,7 @@ BOOL SbiImage::Save( SvStream& r, UINT32 nVer ) if ( bLegacy ) { ReleaseLegacyBuffer(); // release any previously held buffer - PCodeBuffConvertor< UINT32, UINT16 > aNewToLegacy( (BYTE*)pCode, nCodeSize ); + PCodeBuffConvertor< sal_uInt32, sal_uInt16 > aNewToLegacy( (sal_uInt8*)pCode, nCodeSize ); aNewToLegacy.convert(); pLegacyPCode = (char*)aNewToLegacy.GetBuffer(); nLegacyCodeSize = aNewToLegacy.GetSize(); @@ -356,21 +356,21 @@ BOOL SbiImage::Save( SvStream& r, UINT32 nVer ) { nPos = SbiOpenRecord( r, B_STRINGPOOL, nStrings ); // For every String: - // UINT32 Offset of the Strings in the Stringblock + // sal_uInt32 Offset of the Strings in the Stringblock short i; for( i = 0; i < nStrings && SbiGood( r ); i++ ) - r << (UINT32) pStringOff[ i ]; + r << (sal_uInt32) pStringOff[ i ]; // Then the String-Block char* pByteStrings = new char[ nStringSize ]; for( i = 0; i < nStrings; i++ ) { - USHORT nOff = (USHORT) pStringOff[ i ]; + sal_uInt16 nOff = (sal_uInt16) pStringOff[ i ]; ByteString aStr( pStrings + nOff, eCharSet ); memcpy( pByteStrings + nOff, aStr.GetBuffer(), (aStr.Len() + 1) * sizeof( char ) ); } - r << (UINT32) nStringSize; + r << (sal_uInt32) nStringSize; r.Write( pByteStrings, nStringSize ); delete[] pByteStrings; @@ -379,8 +379,8 @@ BOOL SbiImage::Save( SvStream& r, UINT32 nVer ) // Set overall length SbiCloseRecord( r, nStart ); if( !SbiGood( r ) ) - bError = TRUE; - return BOOL( !bError ); + bError = sal_True; + return sal_Bool( !bError ); } /************************************************************************** @@ -396,15 +396,15 @@ void SbiImage::MakeStrings( short nSize ) nStringOff = 0; nStringSize = 1024; pStrings = new sal_Unicode[ nStringSize ]; - pStringOff = new UINT32[ nSize ]; + pStringOff = new sal_uInt32[ nSize ]; if( pStrings && pStringOff ) { nStrings = nSize; - memset( pStringOff, 0, nSize * sizeof( UINT32 ) ); + memset( pStringOff, 0, nSize * sizeof( sal_uInt32 ) ); memset( pStrings, 0, nStringSize * sizeof( sal_Unicode ) ); } else - bError = TRUE; + bError = sal_True; } // Hinzufuegen eines Strings an den StringPool. Der String-Puffer @@ -414,16 +414,16 @@ void SbiImage::MakeStrings( short nSize ) void SbiImage::AddString( const String& r ) { if( nStringIdx >= nStrings ) - bError = TRUE; + bError = sal_True; if( !bError ) { xub_StrLen len = r.Len() + 1; - UINT32 needed = nStringOff + len; + sal_uInt32 needed = nStringOff + len; if( needed > 0xFFFFFF00L ) - bError = TRUE; // out of mem! + bError = sal_True; // out of mem! else if( needed > nStringSize ) { - UINT32 nNewLen = needed + 1024; + sal_uInt32 nNewLen = needed + 1024; nNewLen &= 0xFFFFFC00; // trim to 1K border if( nNewLen > 0xFFFFFF00L ) nNewLen = 0xFFFFFF00L; @@ -433,10 +433,10 @@ void SbiImage::AddString( const String& r ) memcpy( p, pStrings, nStringSize * sizeof( sal_Unicode ) ); delete[] pStrings; pStrings = p; - nStringSize = sal::static_int_cast< UINT16 >(nNewLen); + nStringSize = sal::static_int_cast< sal_uInt16 >(nNewLen); } else - bError = TRUE; + bError = sal_True; } if( !bError ) { @@ -455,7 +455,7 @@ void SbiImage::AddString( const String& r ) // The block was fetched by the compiler from class SbBuffer and // is already created with new. Additionally it contains all Integers // in Big Endian format, so can be directly read/written. -void SbiImage::AddCode( char* p, UINT32 s ) +void SbiImage::AddCode( char* p, sal_uInt32 s ) { pCode = p; nCodeSize = s; @@ -489,14 +489,14 @@ String SbiImage::GetString( short nId ) const { if( nId && nId <= nStrings ) { - UINT32 nOff = pStringOff[ nId - 1 ]; + sal_uInt32 nOff = pStringOff[ nId - 1 ]; sal_Unicode* pStr = pStrings + nOff; // #i42467: Special treatment for vbNullChar if( *pStr == 0 ) { - UINT32 nNextOff = (nId < nStrings) ? pStringOff[ nId ] : nStringOff; - UINT32 nLen = nNextOff - nOff - 1; + sal_uInt32 nNextOff = (nId < nStrings) ? pStringOff[ nId ] : nStringOff; + sal_uInt32 nLen = nNextOff - nOff - 1; if( nLen == 1 ) { // Force length 1 and make char 0 afterwards @@ -519,14 +519,14 @@ const SbxObject* SbiImage::FindType (String aTypeName) const return rTypes.Is() ? (SbxObject*)rTypes->Find(aTypeName,SbxCLASS_OBJECT) : NULL; } -UINT16 SbiImage::CalcLegacyOffset( INT32 nOffset ) +sal_uInt16 SbiImage::CalcLegacyOffset( sal_Int32 nOffset ) { - return SbiCodeGen::calcLegacyOffSet( (BYTE*)pCode, nOffset ) ; + return SbiCodeGen::calcLegacyOffSet( (sal_uInt8*)pCode, nOffset ) ; } -UINT32 SbiImage::CalcNewOffset( INT16 nOffset ) +sal_uInt32 SbiImage::CalcNewOffset( sal_Int16 nOffset ) { - return SbiCodeGen::calcNewOffSet( (BYTE*)pLegacyPCode, nOffset ) ; + return SbiCodeGen::calcNewOffSet( (sal_uInt8*)pLegacyPCode, nOffset ) ; } void SbiImage::ReleaseLegacyBuffer() @@ -536,9 +536,9 @@ void SbiImage::ReleaseLegacyBuffer() nLegacyCodeSize = 0; } -BOOL SbiImage::ExceedsLegacyLimits() +sal_Bool SbiImage::ExceedsLegacyLimits() { if ( ( nStringSize > 0xFF00L ) || ( CalcLegacyOffset( nCodeSize ) > 0xFF00L ) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } diff --git a/basic/source/classes/propacc.cxx b/basic/source/classes/propacc.cxx index 8c7fa0b273b2..9168ef915770 100644 --- a/basic/source/classes/propacc.cxx +++ b/basic/source/classes/propacc.cxx @@ -93,7 +93,7 @@ SbPropertyValues::~SbPropertyValues() { _xInfo = Reference< XPropertySetInfo >(); - for ( USHORT n = 0; n < _aPropVals.Count(); ++n ) + for ( sal_uInt16 n = 0; n < _aPropVals.Count(); ++n ) delete _aPropVals.GetObject( n ); } @@ -112,7 +112,7 @@ Reference< XPropertySetInfo > SbPropertyValues::getPropertySetInfo(void) throw( //------------------------------------------------------------------------- -INT32 SbPropertyValues::GetIndex_Impl( const ::rtl::OUString &rPropName ) const +sal_Int32 SbPropertyValues::GetIndex_Impl( const ::rtl::OUString &rPropName ) const { PropertyValue **ppPV; ppPV = (PropertyValue **) @@ -133,9 +133,9 @@ void SbPropertyValues::setPropertyValue( ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { - INT32 nIndex = GetIndex_Impl( aPropertyName ); + sal_Int32 nIndex = GetIndex_Impl( aPropertyName ); PropertyValue *pPropVal = _aPropVals.GetObject( - sal::static_int_cast< USHORT >(nIndex)); + sal::static_int_cast< sal_uInt16 >(nIndex)); pPropVal->Value = aValue; } @@ -147,10 +147,10 @@ Any SbPropertyValues::getPropertyValue( ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { - INT32 nIndex = GetIndex_Impl( aPropertyName ); + sal_Int32 nIndex = GetIndex_Impl( aPropertyName ); if ( nIndex != USHRT_MAX ) return _aPropVals.GetObject( - sal::static_int_cast< USHORT >(nIndex))->Value; + sal::static_int_cast< sal_uInt16 >(nIndex))->Value; return Any(); } @@ -199,7 +199,7 @@ void SbPropertyValues::removeVetoableChangeListener( Sequence< PropertyValue > SbPropertyValues::getPropertyValues(void) throw (::com::sun::star::uno::RuntimeException) { Sequence aRet( _aPropVals.Count()); - for ( USHORT n = 0; n < _aPropVals.Count(); ++n ) + for ( sal_uInt16 n = 0; n < _aPropVals.Count(); ++n ) aRet.getArray()[n] = *_aPropVals.GetObject(n); return aRet; } @@ -231,14 +231,14 @@ PropertySetInfoImpl::PropertySetInfoImpl() { } -INT32 PropertySetInfoImpl::GetIndex_Impl( const ::rtl::OUString &rPropName ) const +sal_Int32 PropertySetInfoImpl::GetIndex_Impl( const ::rtl::OUString &rPropName ) const { Property *pP; pP = (Property*) bsearch( &rPropName, _aProps.getConstArray(), _aProps.getLength(), sizeof( Property ), SbCompare_UString_Property_Impl ); - return pP ? sal::static_int_cast( (pP-_aProps.getConstArray()) / sizeof(pP) ) : -1; + return pP ? sal::static_int_cast( (pP-_aProps.getConstArray()) / sizeof(pP) ) : -1; } Sequence< Property > PropertySetInfoImpl::getProperties(void) throw() @@ -272,7 +272,7 @@ SbPropertySetInfo::SbPropertySetInfo() SbPropertySetInfo::SbPropertySetInfo( const SbPropertyValueArr_Impl &rPropVals ) { aImpl._aProps.realloc( rPropVals.Count() ); - for ( USHORT n = 0; n < rPropVals.Count(); ++n ) + for ( sal_uInt16 n = 0; n < rPropVals.Count(); ++n ) { Property &rProp = aImpl._aProps.getArray()[n]; const PropertyValue &rPropVal = *rPropVals.GetObject(n); @@ -302,7 +302,7 @@ Property SbPropertySetInfo::getPropertyByName(const ::rtl::OUString& Name) return aImpl.getPropertyByName( Name ); } -BOOL SbPropertySetInfo::hasPropertyByName(const ::rtl::OUString& Name) +sal_Bool SbPropertySetInfo::hasPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException ) { return aImpl.hasPropertyByName( Name ); @@ -323,7 +323,7 @@ SbPropertyContainer::~SbPropertyContainer() //---------------------------------------------------------------------------- void SbPropertyContainer::addProperty(const ::rtl::OUString& Name, - INT16 Attributes, + sal_Int16 Attributes, const Any& DefaultValue) throw( PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException ) @@ -353,7 +353,7 @@ Property SbPropertyContainer::getPropertyByName(const ::rtl::OUString& Name) return aImpl.getPropertyByName( Name ); } -BOOL SbPropertyContainer::hasPropertyByName(const ::rtl::OUString& Name) +sal_Bool SbPropertyContainer::hasPropertyByName(const ::rtl::OUString& Name) throw( RuntimeException ) { return aImpl.hasPropertyByName( Name ); @@ -375,7 +375,7 @@ void SbPropertyContainer::setPropertyValues(const Sequence< PropertyValue >& Pro //---------------------------------------------------------------------------- -void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 30e01892fab9..e2f53dd8ed8e 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -119,7 +119,7 @@ SbxVariable* StarBASIC::VBAFind( const String& rName, SbxClassType t ) // Create array for conversion SFX <-> VB error code struct SFX_VB_ErrorItem { - USHORT nErrorVB; + sal_uInt16 nErrorVB; SbError nErrorSFX; }; @@ -255,7 +255,7 @@ const SFX_VB_ErrorItem __FAR_DATA SFX_VB_ErrorTab[] = // the Modul-relationshop. But it works only when a modul is loaded. // Can cause troubles with separately loaded properties! -SbxBase* SbiFactory::Create( UINT16 nSbxId, UINT32 nCreator ) +SbxBase* SbiFactory::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator ) { if( nCreator == SBXCR_SBX ) { @@ -304,11 +304,11 @@ SbxObject* SbiFactory::CreateObject( const String& rClass ) class SbOLEFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); }; -SbxBase* SbOLEFactory::Create( UINT16, UINT32 ) +SbxBase* SbOLEFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported return NULL; @@ -329,11 +329,11 @@ SbxObject* SbOLEFactory::CreateObject( const String& rClassName ) class SbFormFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); }; -SbxBase* SbFormFactory::Create( UINT16, UINT32 ) +SbxBase* SbFormFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported return NULL; @@ -377,8 +377,8 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ) // Copy the properties, not only the reference to them SbxArray* pProps = pRet->GetProperties(); - UINT32 nCount = pProps->Count32(); - for( UINT32 i = 0 ; i < nCount ; i++ ) + sal_uInt32 nCount = pProps->Count32(); + for( sal_uInt32 i = 0 ; i < nCount ; i++ ) { SbxVariable* pVar = pProps->Get32( i ); SbxProperty* pProp = PTR_CAST( SbxProperty, pVar ); @@ -391,22 +391,22 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ) SbxBase* pParObj = pVar->GetObject(); SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj); SbxDimArray* pDest = new SbxDimArray( pVar->GetType() ); - INT32 lb = 0; - INT32 ub = 0; + sal_Int32 lb = 0; + sal_Int32 ub = 0; pDest->setHasFixedSize( pSource->hasFixedSize() ); if ( pSource->GetDims() && pSource->hasFixedSize() ) { - for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j ) + for ( sal_Int32 j = 1 ; j <= pSource->GetDims(); ++j ) { - pSource->GetDim32( (INT32)j, lb, ub ); + pSource->GetDim32( (sal_Int32)j, lb, ub ); pDest->AddDim32( lb, ub ); } } else pDest->unoAddDim( 0, -1 ); // variant array - USHORT nSavFlags = pVar->GetFlags(); + sal_uInt16 nSavFlags = pVar->GetFlags(); pNewProp->ResetFlag( SBX_FIXED ); // need to reset the FIXED flag // when calling PutObject ( because the type will not match Object ) @@ -432,11 +432,11 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ) class SbTypeFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); }; -SbxBase* SbTypeFactory::Create( UINT16, UINT32 ) +SbxBase* SbTypeFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported return NULL; @@ -480,8 +480,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) // Copy the methods from original class module SbxArray* pClassMethods = pClassModule->GetMethods(); - UINT32 nMethodCount = pClassMethods->Count32(); - UINT32 i; + sal_uInt32 nMethodCount = pClassMethods->Count32(); + sal_uInt32 i; for( i = 0 ; i < nMethodCount ; i++ ) { SbxVariable* pVar = pClassMethods->Get32( i ); @@ -493,7 +493,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbMethod* pMethod = PTR_CAST(SbMethod, pVar ); if( pMethod ) { - USHORT nFlags_ = pMethod->GetFlags(); + sal_uInt16 nFlags_ = pMethod->GetFlags(); pMethod->SetFlag( SBX_NO_BROADCAST ); SbMethod* pNewMethod = new SbMethod( *pMethod ); pNewMethod->ResetFlag( SBX_NO_BROADCAST ); @@ -501,7 +501,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) pNewMethod->pMod = this; pNewMethod->SetParent( this ); pMethods->PutDirect( pNewMethod, i ); - StartListening( pNewMethod->GetBroadcaster(), TRUE ); + StartListening( pNewMethod->GetBroadcaster(), sal_True ); } } } @@ -539,14 +539,14 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) // Copy the properties from original class module SbxArray* pClassProps = pClassModule->GetProperties(); - UINT32 nPropertyCount = pClassProps->Count32(); + sal_uInt32 nPropertyCount = pClassProps->Count32(); for( i = 0 ; i < nPropertyCount ; i++ ) { SbxVariable* pVar = pClassProps->Get32( i ); SbProcedureProperty* pProcedureProp = PTR_CAST( SbProcedureProperty, pVar ); if( pProcedureProp ) { - USHORT nFlags_ = pProcedureProp->GetFlags(); + sal_uInt16 nFlags_ = pProcedureProp->GetFlags(); pProcedureProp->SetFlag( SBX_NO_BROADCAST ); SbProcedureProperty* pNewProp = new SbProcedureProperty ( pProcedureProp->GetName(), pProcedureProp->GetType() ); @@ -555,14 +555,14 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) pNewProp->ResetFlag( SBX_NO_BROADCAST ); // except the Broadcast if it was set pProcedureProp->SetFlags( nFlags_ ); pProps->PutDirect( pNewProp, i ); - StartListening( pNewProp->GetBroadcaster(), TRUE ); + StartListening( pNewProp->GetBroadcaster(), sal_True ); } else { SbxProperty* pProp = PTR_CAST( SbxProperty, pVar ); if( pProp ) { - USHORT nFlags_ = pProp->GetFlags(); + sal_uInt16 nFlags_ = pProp->GetFlags(); pProp->SetFlag( SBX_NO_BROADCAST ); SbxProperty* pNewProp = new SbxProperty( *pProp ); @@ -709,7 +709,7 @@ void SbClassFactory::RemoveClassModule( SbModule* pClassModule ) xClassModules->Remove( pClassModule ); } -SbxBase* SbClassFactory::Create( UINT16, UINT32 ) +SbxBase* SbClassFactory::Create( sal_uInt16, sal_uInt32 ) { // Not supported return NULL; @@ -737,13 +737,13 @@ SbModule* SbClassFactory::FindClass( const String& rClassName ) typedef std::vector< StarBASIC* > DocBasicVector; static DocBasicVector GaDocBasics; -StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) +StarBASIC::StarBASIC( StarBASIC* p, sal_Bool bIsDocBasic ) : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic ) { SetParent( p ); pLibInfo = NULL; - bNoRtl = bBreak = FALSE; - bVBAEnabled = FALSE; + bNoRtl = bBreak = sal_False; + bVBAEnabled = sal_False; pModules = new SbxArray; if( !GetSbData()->nInst++ ) @@ -765,7 +765,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) // Search via StarBasic is always global SetFlag( SBX_GBLSEARCH ); pVBAGlobals = NULL; - bQuit = FALSE; + bQuit = sal_False; if( bDocBasic ) GaDocBasics.push_back( this ); @@ -773,7 +773,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) // #51727 Override SetModified so that the modified state // is not given to the parent -void StarBASIC::SetModified( BOOL b ) +void StarBASIC::SetModified( sal_Bool b ) { SbxBase::SetModified( b ); } @@ -835,8 +835,8 @@ StarBASIC::~StarBASIC() // #100326 Set Parent NULL in registered listeners if( xUnoListeners.Is() ) { - USHORT uCount = xUnoListeners->Count(); - for( USHORT i = 0 ; i < uCount ; i++ ) + sal_uInt16 uCount = xUnoListeners->Count(); + for( sal_uInt16 i = 0 ; i < uCount ; i++ ) { SbxVariable* pListenerObj = xUnoListeners->Get( i ); pListenerObj->SetParent( NULL ); @@ -853,7 +853,7 @@ void* StarBASIC::operator new( size_t n ) { if( n < sizeof( StarBASIC ) ) { -// DBG_ASSERT( FALSE, "Warnung: inkompatibler BASIC-Stand!" ); +// DBG_ASSERT( sal_False, "Warnung: inkompatibler BASIC-Stand!" ); n = sizeof( StarBASIC ); } return ::operator new( n ); @@ -868,14 +868,14 @@ void StarBASIC::implClearDependingVarsOnDelete( StarBASIC* pDeletedBasic ) { if( this != pDeletedBasic ) { - for( USHORT i = 0; i < pModules->Count(); i++ ) + for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { SbModule* p = (SbModule*)pModules->Get( i ); p->ClearVarsDependingOnDeletedBasic( pDeletedBasic ); } } - for( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + for( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ ) { SbxVariable* pVar = pObjs->Get( nObj ); StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); @@ -929,7 +929,7 @@ SbModule* StarBASIC::MakeModule32( const String& rName, const ModuleInfo& mInfo, p->SetSource32( rSrc ); p->SetParent( this ); pModules->Insert( p, pModules->Count() ); - SetModified( TRUE ); + SetModified( sal_True ); return p; } @@ -939,14 +939,14 @@ void StarBASIC::Insert( SbxVariable* pVar ) { pModules->Insert( pVar, pModules->Count() ); pVar->SetParent( this ); - StartListening( pVar->GetBroadcaster(), TRUE ); + StartListening( pVar->GetBroadcaster(), sal_True ); } else { - BOOL bWasModified = IsModified(); + sal_Bool bWasModified = IsModified(); SbxObject::Insert( pVar ); if( !bWasModified && pVar->IsSet( SBX_DONTSTORE ) ) - SetModified( FALSE ); + SetModified( sal_False ); } } @@ -964,17 +964,17 @@ void StarBASIC::Remove( SbxVariable* pVar ) SbxObject::Remove( pVar ); } -BOOL StarBASIC::Compile( SbModule* pMod ) +sal_Bool StarBASIC::Compile( SbModule* pMod ) { - return pMod ? pMod->Compile() : FALSE; + return pMod ? pMod->Compile() : sal_False; } -BOOL StarBASIC::Disassemble( SbModule* pMod, String& rText ) +sal_Bool StarBASIC::Disassemble( SbModule* pMod, String& rText ) { rText.Erase(); if( pMod ) pMod->Disassemble( rText ); - return BOOL( rText.Len() != 0 ); + return sal_Bool( rText.Len() != 0 ); } void StarBASIC::Clear() @@ -985,7 +985,7 @@ void StarBASIC::Clear() SbModule* StarBASIC::FindModule( const String& rName ) { - for( USHORT i = 0; i < pModules->Count(); i++ ) + for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { SbModule* p = (SbModule*) pModules->Get( i ); if( p->GetName().EqualsIgnoreCaseAscii( rName ) ) @@ -1066,7 +1066,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) ::vos::OGuard guard( Application::GetSolarMutex() ); // Init own modules - for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); if( !pModule->IsCompiled() ) @@ -1079,7 +1079,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // Consider required types to init in right order. Class modules // that are required by other modules have to be initialized first. ModuleInitDependencyMap aMIDMap; - for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); String aModuleName = pModule->GetName(); @@ -1095,7 +1095,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) } // Call RunInit on standard modules - for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); if( !pModule->isProxyModule() ) @@ -1104,7 +1104,7 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) // Check all objects if they are BASIC, // if yes initialize - for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ ) { SbxVariable* pVar = pObjs->Get( nObj ); StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); @@ -1118,14 +1118,14 @@ void StarBASIC::InitAllModules( StarBASIC* pBasicNotToInit ) void StarBASIC::DeInitAllModules( void ) { // Deinit own modules - for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); if( pModule->pImage && !pModule->isProxyModule() && !pModule->ISA(SbObjModule) ) pModule->pImage->bInit = false; } - for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ ) { SbxVariable* pVar = pObjs->Get( nObj ); StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); @@ -1138,13 +1138,13 @@ void StarBASIC::DeInitAllModules( void ) void StarBASIC::ClearGlobalVars( void ) { SbxArrayRef xProps( GetProperties() ); - USHORT nPropCount = xProps->Count(); - for ( USHORT nProp = 0 ; nProp < nPropCount ; ++nProp ) + sal_uInt16 nPropCount = xProps->Count(); + for ( sal_uInt16 nProp = 0 ; nProp < nPropCount ; ++nProp ) { SbxBase* pVar = xProps->Get( nProp ); pVar->Clear(); } - SetModified( TRUE ); + SetModified( sal_True ); } // This implementation at first searches within the runtime library, @@ -1175,7 +1175,7 @@ SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t ) } // Search module if( !pRes ) - for( USHORT i = 0; i < pModules->Count(); i++ ) + for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { SbModule* p = (SbModule*) pModules->Get( i ); if( p->IsVisible() ) @@ -1192,13 +1192,13 @@ SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t ) } // Only variables qualified by the Module Name e.g. Sheet1.foo // should work for Documant && Class type Modules - INT32 nType = p->GetModuleType(); + sal_Int32 nType = p->GetModuleType(); if ( nType == ModuleType::DOCUMENT || nType == ModuleType::FORM ) continue; // otherwise check if the element is available // unset GBLSEARCH-Flag (due to Rekursion) - USHORT nGblFlag = p->GetFlags() & SBX_GBLSEARCH; + sal_uInt16 nGblFlag = p->GetFlags() & SBX_GBLSEARCH; p->ResetFlag( SBX_GBLSEARCH ); pRes = p->Find( rName, t ); p->SetFlag( nGblFlag ); @@ -1214,9 +1214,9 @@ SbxVariable* StarBASIC::Find( const String& rName, SbxClassType t ) return pRes; } -BOOL StarBASIC::Call( const String& rName, SbxArray* pParam ) +sal_Bool StarBASIC::Call( const String& rName, SbxArray* pParam ) { - BOOL bRes = SbxObject::Call( rName, pParam ); + sal_Bool bRes = SbxObject::Call( rName, pParam ); if( !bRes ) { SbxError eErr = SbxBase::GetError(); @@ -1239,7 +1239,7 @@ SbxBase* StarBASIC::FindSBXInCurrentScope( const String& rName ) // Preserve old interface SbxVariable* StarBASIC::FindVarInCurrentScopy -( const String& rName, USHORT& rStatus ) +( const String& rName, sal_uInt16& rStatus ) { rStatus = 1; // Presumption: nothing found SbxVariable* pVar = NULL; @@ -1257,7 +1257,7 @@ SbxVariable* StarBASIC::FindVarInCurrentScopy void StarBASIC::QuitAndExitApplication() { Stop(); - bQuit = TRUE; + bQuit = sal_True; } void StarBASIC::Stop() @@ -1270,9 +1270,9 @@ void StarBASIC::Stop() } } -BOOL StarBASIC::IsRunning() +sal_Bool StarBASIC::IsRunning() { - return BOOL( pINST != NULL ); + return sal_Bool( pINST != NULL ); } /************************************************************************** @@ -1283,7 +1283,7 @@ BOOL StarBASIC::IsRunning() // Activation of an object. There is no need to access active objects // with name via BASIC. If NULL is given, everything is activated. -void StarBASIC::ActivateObject( const String* pName, BOOL bActivate ) +void StarBASIC::ActivateObject( const String* pName, sal_Bool bActivate ) { if( pName ) { @@ -1298,7 +1298,7 @@ void StarBASIC::ActivateObject( const String* pName, BOOL bActivate ) } else { - for( USHORT i = 0; i < GetObjects()->Count(); i++ ) + for( sal_uInt16 i = 0; i < GetObjects()->Count(); i++ ) { SbxObject* p = (SbxObject*) GetObjects()->Get( i ); if( bActivate ) @@ -1315,7 +1315,7 @@ void StarBASIC::ActivateObject( const String* pName, BOOL bActivate ) * **************************************************************************/ -SbMethod* StarBASIC::GetActiveMethod( USHORT nLevel ) +SbMethod* StarBASIC::GetActiveMethod( sal_uInt16 nLevel ) { if( pINST ) return pINST->GetCaller( nLevel ); @@ -1331,41 +1331,41 @@ SbModule* StarBASIC::GetActiveModule() return pCMOD; } -USHORT StarBASIC::BreakPoint( USHORT l, USHORT c1, USHORT c2 ) +sal_uInt16 StarBASIC::BreakPoint( sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 ) { SetErrorData( 0, l, c1, c2 ); - bBreak = TRUE; + bBreak = sal_True; if( GetSbData()->aBreakHdl.IsSet() ) - return (USHORT) GetSbData()->aBreakHdl.Call( this ); + return (sal_uInt16) GetSbData()->aBreakHdl.Call( this ); else return BreakHdl(); } -USHORT StarBASIC::StepPoint( USHORT l, USHORT c1, USHORT c2 ) +sal_uInt16 StarBASIC::StepPoint( sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 ) { SetErrorData( 0, l, c1, c2 ); - bBreak = FALSE; + bBreak = sal_False; if( GetSbData()->aBreakHdl.IsSet() ) - return (USHORT) GetSbData()->aBreakHdl.Call( this ); + return (sal_uInt16) GetSbData()->aBreakHdl.Call( this ); else return BreakHdl(); } -USHORT __EXPORT StarBASIC::BreakHdl() +sal_uInt16 __EXPORT StarBASIC::BreakHdl() { - return (USHORT) ( aBreakHdl.IsSet() + return (sal_uInt16) ( aBreakHdl.IsSet() ? aBreakHdl.Call( this ) : SbDEBUG_CONTINUE ); } // Calls for error handler and break handler -USHORT StarBASIC::GetLine() { return GetSbData()->nLine; } -USHORT StarBASIC::GetCol1() { return GetSbData()->nCol1; } -USHORT StarBASIC::GetCol2() { return GetSbData()->nCol2; } +sal_uInt16 StarBASIC::GetLine() { return GetSbData()->nLine; } +sal_uInt16 StarBASIC::GetCol1() { return GetSbData()->nCol1; } +sal_uInt16 StarBASIC::GetCol2() { return GetSbData()->nCol2; } // Specific to error handler SbError StarBASIC::GetErrorCode() { return GetSbData()->nCode; } const String& StarBASIC::GetErrorText() { return GetSbData()->aErrMsg; } -BOOL StarBASIC::IsCompilerError() { return GetSbData()->bCompiler; } +sal_Bool StarBASIC::IsCompilerError() { return GetSbData()->bCompiler; } void StarBASIC::SetGlobalLanguageMode( SbLanguageMode eLanguageMode ) { GetSbData()->eLanguageMode = eLanguageMode; @@ -1392,9 +1392,9 @@ SbLanguageMode StarBASIC::GetLanguageMode() // binaere Suche bei VB-Error -> SFX-Error. // Neue Fehler-Codes auf alte, Sbx-Kompatible zurueckmappen -USHORT StarBASIC::GetVBErrorCode( SbError nError ) +sal_uInt16 StarBASIC::GetVBErrorCode( SbError nError ) { - USHORT nRet = 0; + sal_uInt16 nRet = 0; if( SbiRuntime::isVBAEnabled() ) { @@ -1419,7 +1419,7 @@ USHORT StarBASIC::GetVBErrorCode( SbError nError ) // Suchschleife const SFX_VB_ErrorItem* pErrItem; - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; do { pErrItem = SFX_VB_ErrorTab + nIndex; @@ -1434,7 +1434,7 @@ USHORT StarBASIC::GetVBErrorCode( SbError nError ) return nRet; } -SbError StarBASIC::GetSfxFromVBError( USHORT nError ) +SbError StarBASIC::GetSfxFromVBError( sal_uInt16 nError ) { SbError nRet = 0L; @@ -1466,7 +1466,7 @@ SbError StarBASIC::GetSfxFromVBError( USHORT nError ) } } const SFX_VB_ErrorItem* pErrItem; - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; do { pErrItem = SFX_VB_ErrorTab + nIndex; @@ -1486,7 +1486,7 @@ SbError StarBASIC::GetSfxFromVBError( USHORT nError ) // Error- / Break-Daten setzen void StarBASIC::SetErrorData -( SbError nCode, USHORT nLine, USHORT nCol1, USHORT nCol2 ) +( SbError nCode, sal_uInt16 nLine, sal_uInt16 nCol1, sal_uInt16 nCol2 ) { SbiGlobals& aGlobals = *GetSbData(); aGlobals.nCode = nCode; @@ -1502,26 +1502,26 @@ struct BasicStringList_Impl : private Resource { ResId aResId; - BasicStringList_Impl( ResId& rErrIdP, USHORT nId) + BasicStringList_Impl( ResId& rErrIdP, sal_uInt16 nId) : Resource( rErrIdP ),aResId(nId, *rErrIdP.GetResMgr() ){} ~BasicStringList_Impl() { FreeResource(); } String GetString(){ return String( aResId ); } - BOOL IsErrorTextAvailable( void ) + sal_Bool IsErrorTextAvailable( void ) { return IsAvailableRes(aResId.SetRT(RSC_STRING)); } }; //---------------------------------------------------------------- // #60175 Flag, das bei Basic-Fehlern das Anziehen der SFX-Resourcen verhindert -static BOOL bStaticSuppressSfxResource = FALSE; +static sal_Bool bStaticSuppressSfxResource = sal_False; -void StarBASIC::StaticSuppressSfxResource( BOOL bSuppress ) +void StarBASIC::StaticSuppressSfxResource( sal_Bool bSuppress ) { bStaticSuppressSfxResource = bSuppress; } // Hack for #83750, use bStaticSuppressSfxResource as setup flag -BOOL runsInSetup( void ) +sal_Bool runsInSetup( void ) { return bStaticSuppressSfxResource; } @@ -1537,11 +1537,11 @@ void StarBASIC::MakeErrorText( SbError nId, const String& aMsg ) return; } - USHORT nOldID = GetVBErrorCode( nId ); + sal_uInt16 nOldID = GetVBErrorCode( nId ); // Hilfsklasse instanzieren BasResId aId( RID_BASIC_START ); - BasicStringList_Impl aMyStringList( aId, USHORT(nId & ERRCODE_RES_MASK) ); + BasicStringList_Impl aMyStringList( aId, sal_uInt16(nId & ERRCODE_RES_MASK) ); if( aMyStringList.IsErrorTextAvailable() ) { @@ -1549,7 +1549,7 @@ void StarBASIC::MakeErrorText( SbError nId, const String& aMsg ) String aMsg1 = aMyStringList.GetString(); // Argument-Platzhalter durch %s ersetzen String aSrgStr( RTL_CONSTASCII_USTRINGPARAM("$(ARG1)") ); - USHORT nResult = aMsg1.Search( aSrgStr ); + sal_uInt16 nResult = aMsg1.Search( aSrgStr ); if( nResult != STRING_NOTFOUND ) { @@ -1570,8 +1570,8 @@ void StarBASIC::MakeErrorText( SbError nId, const String& aMsg ) } -BOOL StarBASIC::CError - ( SbError code, const String& rMsg, USHORT l, USHORT c1, USHORT c2 ) +sal_Bool StarBASIC::CError + ( SbError code, const String& rMsg, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 ) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); @@ -1581,39 +1581,39 @@ BOOL StarBASIC::CError // #109018 Check if running Basic is affected StarBASIC* pStartedBasic = pINST->GetBasic(); if( pStartedBasic != this ) - return FALSE; + return sal_False; Stop(); } // Flag setzen, damit GlobalRunInit den Fehler mitbekommt - GetSbData()->bGlobalInitErr = TRUE; + GetSbData()->bGlobalInitErr = sal_True; // Fehlertext basteln MakeErrorText( code, rMsg ); // Umsetzung des Codes fuer String-Transport in SFX-Error if( rMsg.Len() ) - code = (ULONG)*new StringErrorInfo( code, String(rMsg) ); + code = (sal_uIntPtr)*new StringErrorInfo( code, String(rMsg) ); SetErrorData( code, l, c1, c2 ); - GetSbData()->bCompiler = TRUE; - BOOL bRet; + GetSbData()->bCompiler = sal_True; + sal_Bool bRet; if( GetSbData()->aErrHdl.IsSet() ) - bRet = (BOOL) GetSbData()->aErrHdl.Call( this ); + bRet = (sal_Bool) GetSbData()->aErrHdl.Call( this ); else bRet = ErrorHdl(); - GetSbData()->bCompiler = FALSE; // nur TRUE fuer Error-Handler + GetSbData()->bCompiler = sal_False; // nur sal_True fuer Error-Handler return bRet; } -BOOL StarBASIC::RTError - ( SbError code, USHORT l, USHORT c1, USHORT c2 ) +sal_Bool StarBASIC::RTError + ( SbError code, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 ) { return RTError( code, String(), l, c1, c2 ); } -BOOL StarBASIC::RTError( SbError code, const String& rMsg, USHORT l, USHORT c1, USHORT c2 ) +sal_Bool StarBASIC::RTError( SbError code, const String& rMsg, sal_uInt16 l, sal_uInt16 c1, sal_uInt16 c2 ) { vos::OGuard aSolarGuard( Application::GetSolarMutex() ); @@ -1635,15 +1635,15 @@ BOOL StarBASIC::RTError( SbError code, const String& rMsg, USHORT l, USHORT c1, aTmp += String::CreateFromInt32( SbxErrObject::getUnoErrObject()->getNumber() ); aTmp += String( RTL_CONSTASCII_USTRINGPARAM("\'\n") ); aTmp += GetSbData()->aErrMsg.Len() ? GetSbData()->aErrMsg : rMsg; - code = (ULONG)*new StringErrorInfo( code, aTmp ); + code = (sal_uIntPtr)*new StringErrorInfo( code, aTmp ); } else - code = (ULONG)*new StringErrorInfo( code, String(rMsg) ); + code = (sal_uIntPtr)*new StringErrorInfo( code, String(rMsg) ); } SetErrorData( code, l, c1, c2 ); if( GetSbData()->aErrHdl.IsSet() ) - return (BOOL) GetSbData()->aErrHdl.Call( this ); + return (sal_Bool) GetSbData()->aErrHdl.Call( this ); else return ErrorHdl(); } @@ -1688,7 +1688,7 @@ String StarBASIC::GetErrorMsg() return String(); } -USHORT StarBASIC::GetErl() +sal_uInt16 StarBASIC::GetErl() { if( pINST ) return pINST->GetErl(); @@ -1696,10 +1696,10 @@ USHORT StarBASIC::GetErl() return 0; } -BOOL __EXPORT StarBASIC::ErrorHdl() +sal_Bool __EXPORT StarBASIC::ErrorHdl() { - return (BOOL) ( aErrorHdl.IsSet() - ? aErrorHdl.Call( this ) : FALSE ); + return (sal_Bool) ( aErrorHdl.IsSet() + ? aErrorHdl.Call( this ) : sal_False ); } Link StarBASIC::GetGlobalErrorHdl() @@ -1737,16 +1737,16 @@ SbxArrayRef StarBASIC::getUnoListeners( void ) * **************************************************************************/ -BOOL StarBASIC::LoadData( SvStream& r, USHORT nVer ) +sal_Bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) { if( !SbxObject::LoadData( r, nVer ) ) - return FALSE; + return sal_False; // #95459 Delete dialogs, otherwise endless recursion // in SbxVarable::GetType() if dialogs are accessed - USHORT nObjCount = pObjs->Count(); + sal_uInt16 nObjCount = pObjs->Count(); SbxVariable** ppDeleteTab = new SbxVariable*[ nObjCount ]; - USHORT nObj; + sal_uInt16 nObj; for( nObj = 0 ; nObj < nObjCount ; nObj++ ) { @@ -1762,14 +1762,14 @@ BOOL StarBASIC::LoadData( SvStream& r, USHORT nVer ) } delete[] ppDeleteTab; - UINT16 nMod; + sal_uInt16 nMod; pModules->Clear(); r >> nMod; - for( USHORT i = 0; i < nMod; i++ ) + for( sal_uInt16 i = 0; i < nMod; i++ ) { SbModule* pMod = (SbModule*) SbxBase::Load( r ); if( !pMod ) - return FALSE; + return sal_False; else if( pMod->ISA(SbJScriptModule) ) { // Ref zuweisen, damit pMod deleted wird @@ -1792,26 +1792,26 @@ BOOL StarBASIC::LoadData( SvStream& r, USHORT nVer ) // Suche ueber StarBASIC ist immer global DBG_ASSERT( IsSet( SBX_GBLSEARCH ), "Basic ohne GBLSEARCH geladen" ); SetFlag( SBX_GBLSEARCH ); - return TRUE; + return sal_True; } -BOOL StarBASIC::StoreData( SvStream& r ) const +sal_Bool StarBASIC::StoreData( SvStream& r ) const { if( !SbxObject::StoreData( r ) ) - return FALSE; - r << (UINT16) pModules->Count(); - for( USHORT i = 0; i < pModules->Count(); i++ ) + return sal_False; + r << (sal_uInt16) pModules->Count(); + for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { SbModule* p = (SbModule*) pModules->Get( i ); if( !p->Store( r ) ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -BOOL StarBASIC::LoadOldModules( SvStream& ) +sal_Bool StarBASIC::LoadOldModules( SvStream& ) { - return FALSE; + return sal_False; } bool StarBASIC::GetUNOConstant( const sal_Char* _pAsciiName, ::com::sun::star::uno::Any& aOut ) @@ -1884,7 +1884,7 @@ static const char pCountStr[] = "Count"; static const char pAddStr[] = "Add"; static const char pItemStr[] = "Item"; static const char pRemoveStr[] = "Remove"; -static USHORT nCountHash = 0, nAddHash, nItemHash, nRemoveHash; +static sal_uInt16 nCountHash = 0, nAddHash, nItemHash, nRemoveHash; SbxInfoRef BasicCollection::xAddInfo = NULL; SbxInfoRef BasicCollection::xItemInfo = NULL; @@ -1955,10 +1955,10 @@ void BasicCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1, const SbxHint* p = PTR_CAST(SbxHint,&rHint); if( p ) { - ULONG nId = p->GetId(); - BOOL bRead = BOOL( nId == SBX_HINT_DATAWANTED ); - BOOL bWrite = BOOL( nId == SBX_HINT_DATACHANGED ); - BOOL bRequestInfo = BOOL( nId == SBX_HINT_INFOWANTED ); + sal_uIntPtr nId = p->GetId(); + sal_Bool bRead = sal_Bool( nId == SBX_HINT_DATAWANTED ); + sal_Bool bWrite = sal_Bool( nId == SBX_HINT_DATACHANGED ); + sal_Bool bRequestInfo = sal_Bool( nId == SBX_HINT_INFOWANTED ); SbxVariable* pVar = p->GetVar(); SbxArray* pArg = pVar->GetParameters(); XubString aVarName( pVar->GetName() ); @@ -1993,9 +1993,9 @@ void BasicCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1, SbxObject::SFX_NOTIFY( rCst, rId1, rHint, rId2 ); } -INT32 BasicCollection::implGetIndex( SbxVariable* pIndexVar ) +sal_Int32 BasicCollection::implGetIndex( SbxVariable* pIndexVar ) { - INT32 nIndex = -1; + sal_Int32 nIndex = -1; if( pIndexVar->GetType() == SbxSTRING ) nIndex = implGetIndexForName( pIndexVar->GetString() ); else @@ -2003,12 +2003,12 @@ INT32 BasicCollection::implGetIndex( SbxVariable* pIndexVar ) return nIndex; } -INT32 BasicCollection::implGetIndexForName( const String& rName ) +sal_Int32 BasicCollection::implGetIndexForName( const String& rName ) { - INT32 nIndex = -1; - INT32 nCount = xItemArray->Count32(); - INT32 nNameHash = MakeHashCode( rName ); - for( INT32 i = 0 ; i < nCount ; i++ ) + sal_Int32 nIndex = -1; + sal_Int32 nCount = xItemArray->Count32(); + sal_Int32 nNameHash = MakeHashCode( rName ); + for( sal_Int32 i = 0 ; i < nCount ; i++ ) { SbxVariable* pVar = xItemArray->Get32( i ); if( pVar->GetHashCode() == nNameHash && @@ -2023,7 +2023,7 @@ INT32 BasicCollection::implGetIndexForName( const String& rName ) void BasicCollection::CollAdd( SbxArray* pPar_ ) { - USHORT nCount = pPar_->Count(); + sal_uInt16 nCount = pPar_->Count(); if( nCount < 2 || nCount > 5 ) { SetError( SbxERR_WRONG_ARGS ); @@ -2049,7 +2049,7 @@ void BasicCollection::CollAdd( SbxArray* pPar_ ) return; } SbxVariable* pAfter = pPar_->Get(4); - INT32 nAfterIndex = implGetIndex( pAfter ); + sal_Int32 nAfterIndex = implGetIndex( pAfter ); if( nAfterIndex == -1 ) { SetError( SbERR_BAD_ARGUMENT ); @@ -2059,7 +2059,7 @@ void BasicCollection::CollAdd( SbxArray* pPar_ ) } else // if( nCount == 4 ) { - INT32 nBeforeIndex = implGetIndex( pBefore ); + sal_Int32 nBeforeIndex = implGetIndex( pBefore ); if( nBeforeIndex == -1 ) { SetError( SbERR_BAD_ARGUMENT ); @@ -2108,8 +2108,8 @@ void BasicCollection::CollItem( SbxArray* pPar_ ) } SbxVariable* pRes = NULL; SbxVariable* p = pPar_->Get( 1 ); - INT32 nIndex = implGetIndex( p ); - if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) + sal_Int32 nIndex = implGetIndex( p ); + if( nIndex >= 0 && nIndex < (sal_Int32)xItemArray->Count32() ) pRes = xItemArray->Get32( nIndex ); if( !pRes ) SetError( SbERR_BAD_ARGUMENT ); @@ -2126,8 +2126,8 @@ void BasicCollection::CollRemove( SbxArray* pPar_ ) } SbxVariable* p = pPar_->Get( 1 ); - INT32 nIndex = implGetIndex( p ); - if( nIndex >= 0 && nIndex < (INT32)xItemArray->Count32() ) + sal_Int32 nIndex = implGetIndex( p ); + if( nIndex >= 0 && nIndex < (sal_Int32)xItemArray->Count32() ) xItemArray->Remove32( nIndex ); else SetError( SbERR_BAD_ARGUMENT ); diff --git a/basic/source/classes/sbintern.cxx b/basic/source/classes/sbintern.cxx index 55b5f7f371ce..2b1f32e474d5 100644 --- a/basic/source/classes/sbintern.cxx +++ b/basic/source/classes/sbintern.cxx @@ -61,13 +61,13 @@ SbiGlobals::SbiGlobals() nCode = 0; nLine = 0; nCol1 = nCol2 = 0; - bCompiler = FALSE; - bGlobalInitErr = FALSE; - bRunInit = FALSE; + bCompiler = sal_False; + bGlobalInitErr = sal_False; + bRunInit = sal_False; eLanguageMode = SB_LANG_BASIC; pErrStack = NULL; pTransliterationWrapper = NULL; - bBlockCompilerError = FALSE; + bBlockCompilerError = sal_False; pAppBasMgr = NULL; pMSOMacroRuntimLib = NULL; } diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index e176eb9e3654..625f1e00b3df 100755 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -444,7 +444,7 @@ String implGetWrappedMsg( const WrappedTargetException& e ) void implHandleBasicErrorException( BasicErrorException& e ) { - SbError nError = StarBASIC::GetSfxFromVBError( (USHORT)e.ErrorCode ); + SbError nError = StarBASIC::GetSfxFromVBError( (sal_uInt16)e.ErrorCode ); StarBASIC::Error( nError, e.ErrorMessageArgument ); } @@ -471,7 +471,7 @@ void implHandleWrappedTargetException( const Any& _rWrappedTargetException ) // special handling for BasicErrorException errors if ( aWrapped.TargetException >>= aBasicError ) { - nError = StarBASIC::GetSfxFromVBError( (USHORT)aBasicError.ErrorCode ); + nError = StarBASIC::GetSfxFromVBError( (sal_uInt16)aBasicError.ErrorCode ); aMessageBuf.append( aBasicError.ErrorMessageArgument ); aExamine.clear(); break; @@ -637,7 +637,7 @@ static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int sal_Int32 nLen = xIdlArray->getLen( aValue ); for ( sal_Int32 index = 0; index < nLen; ++index ) { - Any aElementAny = xIdlArray->get( aValue, (UINT32)index ); + Any aElementAny = xIdlArray->get( aValue, (sal_uInt32)index ); // This detects the dimension were currently processing if ( dimCopy == dimension ) { @@ -751,7 +751,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) if ( pArray ) { SbxDimArrayRef xArray = pArray; - USHORT nFlags = pVar->GetFlags(); + sal_uInt16 nFlags = pVar->GetFlags(); pVar->ResetFlag( SBX_FIXED ); pVar->PutObject( (SbxDimArray*)xArray ); pVar->SetFlags( nFlags ); @@ -799,9 +799,9 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) sal_Int64 nValue64 = aCurrency.Value; SbxINT64 aInt64; aInt64.nHigh = - sal::static_int_cast< INT32 >( + sal::static_int_cast< sal_Int32 >( nValue64 >> 32); - aInt64.nLow = (UINT32)( nValue64 & 0xffffffff ); + aInt64.nLow = (sal_uInt32)( nValue64 & 0xffffffff ); pVar->PutCurrency( aInt64 ); break; } @@ -879,7 +879,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) for( i = 0 ; i < nLen ; i++ ) { // Elemente wandeln - Any aElementAny = xIdlArray->get( aValue, (UINT32)i ); + Any aElementAny = xIdlArray->get( aValue, (sal_uInt32)i ); SbxVariableRef xVar = new SbxVariable( eSbxElementType ); unoToSbxValue( (SbxVariable*)xVar, aElementAny ); @@ -893,7 +893,7 @@ void unoToSbxValue( SbxVariable* pVar, const Any& aValue ) } // Array zurueckliefern - USHORT nFlags = pVar->GetFlags(); + sal_uInt16 nFlags = pVar->GetFlags(); pVar->ResetFlag( SBX_FIXED ); pVar->PutObject( (SbxDimArray*)xArray ); pVar->SetFlags( nFlags ); @@ -1033,9 +1033,9 @@ Type getUnoTypeForSbxValue( SbxValue* pVal ) // der genommen, sonst wird das ganze als Any-Sequence betrachtet sal_Bool bNeedsInit = sal_True; - INT32 nSize = nUpper - nLower + 1; - INT32 nIdx = nLower; - for( INT32 i = 0 ; i < nSize ; i++,nIdx++ ) + sal_Int32 nSize = nUpper - nLower + 1; + sal_Int32 nIdx = nLower; + for( sal_Int32 i = 0 ; i < nSize ; i++,nIdx++ ) { SbxVariableRef xVar = pArray->Get32( &nIdx ); Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); @@ -1071,10 +1071,10 @@ Type getUnoTypeForSbxValue( SbxValue* pVal ) if( eElementTypeClass == TypeClass_VOID || eElementTypeClass == TypeClass_ANY ) { // For this check the array's dim structure does not matter - UINT32 nFlatArraySize = pArray->Count32(); + sal_uInt32 nFlatArraySize = pArray->Count32(); sal_Bool bNeedsInit = sal_True; - for( UINT32 i = 0 ; i < nFlatArraySize ; i++ ) + for( sal_uInt32 i = 0 ; i < nFlatArraySize ; i++ ) { SbxVariableRef xVar = pArray->SbxArray::Get32( i ); Type aType = getUnoTypeForSbxValue( (SbxVariable*)xVar ); @@ -1578,13 +1578,13 @@ Any sbxToUnoValue( SbxVariable* pVar, const Type& rType, Property* pUnoProperty } // Dbg-Hilfsmethode zum Auslesen der in einem Object implementierten Interfaces -String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, USHORT nRekLevel ) +String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< XIdlClass >& xClass, sal_uInt16 nRekLevel ) { Type aIfaceType = ::getCppuType( (const Reference< XInterface > *)0 ); static Reference< XIdlClass > xIfaceClass = TypeToIdlClass( aIfaceType ); String aRetStr; - for( USHORT i = 0 ; i < nRekLevel ; i++ ) + for( sal_uInt16 i = 0 ; i < nRekLevel ; i++ ) aRetStr.AppendAscii( " " ); aRetStr += String( xClass->getName() ); ::rtl::OUString aClassName = xClass->getName(); @@ -1603,8 +1603,8 @@ String Impl_GetInterfaceInfo( const Reference< XInterface >& x, const Reference< // Super-Interfaces holen Sequence< Reference< XIdlClass > > aSuperClassSeq = xClass->getSuperclasses(); const Reference< XIdlClass >* pClasses = aSuperClassSeq.getConstArray(); - UINT32 nSuperIfaceCount = aSuperClassSeq.getLength(); - for( UINT32 j = 0 ; j < nSuperIfaceCount ; j++ ) + sal_uInt32 nSuperIfaceCount = aSuperClassSeq.getLength(); + for( sal_uInt32 j = 0 ; j < nSuperIfaceCount ; j++ ) { const Reference< XIdlClass >& rxIfaceClass = pClasses[j]; if( !rxIfaceClass->equals( xIfaceClass ) ) @@ -1685,8 +1685,8 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj, { Sequence< Type > aTypeSeq = xTypeProvider->getTypes(); const Type* pTypeArray = aTypeSeq.getConstArray(); - UINT32 nIfaceCount = aTypeSeq.getLength(); - for( UINT32 j = 0 ; j < nIfaceCount ; j++ ) + sal_uInt32 nIfaceCount = aTypeSeq.getLength(); + for( sal_uInt32 j = 0 ; j < nIfaceCount ; j++ ) { const Type& rType = pTypeArray[j]; @@ -1764,8 +1764,8 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj ) // Interfaces der Implementation holen Sequence< Type > aTypeSeq = xTypeProvider->getTypes(); const Type* pTypeArray = aTypeSeq.getConstArray(); - UINT32 nIfaceCount = aTypeSeq.getLength(); - for( UINT32 j = 0 ; j < nIfaceCount ; j++ ) + sal_uInt32 nIfaceCount = aTypeSeq.getLength(); + for( sal_uInt32 j = 0 ; j < nIfaceCount ; j++ ) { const Type& rType = pTypeArray[j]; @@ -1865,13 +1865,13 @@ String Impl_DumpProperties( SbUnoObject* pUnoObj ) } Sequence props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); - UINT32 nUnoPropCount = props.getLength(); + sal_uInt32 nUnoPropCount = props.getLength(); const Property* pUnoProps = props.getConstArray(); SbxArray* pProps = pUnoObj->GetProperties(); - USHORT nPropCount = pProps->Count(); - USHORT nPropsPerLine = 1 + nPropCount / 30; - for( USHORT i = 0; i < nPropCount; i++ ) + sal_uInt16 nPropCount = pProps->Count(); + sal_uInt16 nPropsPerLine = 1 + nPropCount / 30; + for( sal_uInt16 i = 0; i < nPropCount; i++ ) { SbxVariable* pVar = pProps->Get( i ); if( pVar ) @@ -1884,7 +1884,7 @@ String Impl_DumpProperties( SbUnoObject* pUnoObj ) // Ist es in Uno eine Sequence? SbxDataType eType = pVar->GetFullType(); - BOOL bMaybeVoid = FALSE; + sal_Bool bMaybeVoid = sal_False; if( i < nUnoPropCount ) { const Property& rProp = pUnoProps[ i ]; @@ -1894,7 +1894,7 @@ String Impl_DumpProperties( SbUnoObject* pUnoObj ) if( rProp.Attributes & PropertyAttribute::MAYBEVOID ) { eType = unoToSbxType( rProp.Type.getTypeClass() ); - bMaybeVoid = TRUE; + bMaybeVoid = sal_True; } if( eType == SbxOBJECT ) { @@ -1945,14 +1945,14 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) const Reference< XIdlMethod >* pUnoMethods = methods.getConstArray(); SbxArray* pMethods = pUnoObj->GetMethods(); - USHORT nMethodCount = pMethods->Count(); + sal_uInt16 nMethodCount = pMethods->Count(); if( !nMethodCount ) { aRet.AppendAscii( "\nNo methods found\n" ); return aRet; } - USHORT nPropsPerLine = 1 + nMethodCount / 30; - for( USHORT i = 0; i < nMethodCount; i++ ) + sal_uInt16 nPropsPerLine = 1 + nMethodCount / 30; + for( sal_uInt16 i = 0; i < nMethodCount; i++ ) { SbxVariable* pVar = pMethods->Get( i ); if( pVar ) @@ -1980,12 +1980,12 @@ String Impl_DumpMethods( SbUnoObject* pUnoObj ) // get-Methode darf keinen Parameter haben Sequence< Reference< XIdlClass > > aParamsSeq = rxMethod->getParameterTypes(); - UINT32 nParamCount = aParamsSeq.getLength(); + sal_uInt32 nParamCount = aParamsSeq.getLength(); const Reference< XIdlClass >* pParams = aParamsSeq.getConstArray(); if( nParamCount > 0 ) { - for( USHORT j = 0; j < nParamCount; j++ ) + for( sal_uInt16 j = 0; j < nParamCount; j++ ) { String aTypeStr = Dbg_SbxDataType2String( unoToSbxType( pParams[ j ] ) ); aPropStr += aTypeStr; @@ -2032,7 +2032,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, if( pHint->GetId() == SBX_HINT_DATAWANTED ) { // Test-Properties - INT32 nId = pProp->nId; + sal_Int32 nId = pProp->nId; if( nId < 0 ) { // Id == -1: Implementierte Interfaces gemaess ClassProvider anzeigen @@ -2143,18 +2143,18 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, if( pHint->GetId() == SBX_HINT_DATAWANTED ) { // Anzahl Parameter -1 wegen Param0 == this - UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0; + sal_uInt32 nParamCount = pParams ? ((sal_uInt32)pParams->Count() - 1) : 0; Sequence args; - BOOL bOutParams = FALSE; - UINT32 i; + sal_Bool bOutParams = sal_False; + sal_uInt32 i; if( !bInvocation && mxUnoAccess.is() ) { // Infos holen const Sequence& rInfoSeq = pMeth->getParamInfos(); const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); - UINT32 nUnoParamCount = rInfoSeq.getLength(); - UINT32 nAllocParamCount = nParamCount; + sal_uInt32 nUnoParamCount = rInfoSeq.getLength(); + sal_uInt32 nAllocParamCount = nParamCount; // Ueberschuessige Parameter ignorieren, Alternative: Error schmeissen if( nParamCount > nUnoParamCount ) @@ -2197,14 +2197,14 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, com::sun::star::uno::Type aType( rxClass->getTypeClass(), rxClass->getName() ); // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! - pAnyArgs[i] = sbxToUnoValue( pParams->Get( (USHORT)(i+1) ), aType ); + pAnyArgs[i] = sbxToUnoValue( pParams->Get( (sal_uInt16)(i+1) ), aType ); // Wenn es nicht schon feststeht pruefen, ob Out-Parameter vorliegen if( !bOutParams ) { ParamMode aParamMode = rInfo.aMode; if( aParamMode != ParamMode_IN ) - bOutParams = TRUE; + bOutParams = sal_True; } } } @@ -2229,7 +2229,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, Any aValAny; for( i = 0 ; i < nParamCount ; i++ ) { - USHORT iSbx = (USHORT)(i+1); + sal_uInt16 iSbx = (sal_uInt16)(i+1); // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! aValAny = sbxToUnoValueImpl( pParams->Get( iSbx ), @@ -2254,14 +2254,14 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, for( i = 0 ; i < nParamCount ; i++ ) { // ACHTUNG: Bei den Sbx-Parametern den Offset nicht vergessen! - pAnyArgs[i] = sbxToUnoValueImpl( pParams->Get( (USHORT)(i+1) ), + pAnyArgs[i] = sbxToUnoValueImpl( pParams->Get( (sal_uInt16)(i+1) ), bBlockConversionToSmallestType ); } } } // Methode callen - GetSbData()->bBlockCompilerError = TRUE; // #106433 Block compiler errors for API calls + GetSbData()->bBlockCompilerError = sal_True; // #106433 Block compiler errors for API calls try { if( !bInvocation && mxUnoAccess.is() ) @@ -2280,13 +2280,13 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const Sequence& rInfoSeq = pMeth->getParamInfos(); const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); - UINT32 j; + sal_uInt32 j; for( j = 0 ; j < nParamCount ; j++ ) { const ParamInfo& rInfo = pParamInfos[j]; ParamMode aParamMode = rInfo.aMode; if( aParamMode != ParamMode_IN ) - unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pAnyArgs[ j ] ); + unoToSbxValue( (SbxVariable*)pParams->Get( (sal_uInt16)(j+1) ), pAnyArgs[ j ] ); } } } @@ -2301,21 +2301,21 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, aRetAny = xDirectInvoke->directInvoke( pMeth->GetName(), args ); else { - Sequence< INT16 > OutParamIndex; + Sequence< sal_Int16 > OutParamIndex; Sequence< Any > OutParam; aRetAny = mxInvocation->invoke( pMeth->GetName(), args, OutParamIndex, OutParam ); - const INT16* pIndices = OutParamIndex.getConstArray(); - UINT32 nLen = OutParamIndex.getLength(); + const sal_Int16* pIndices = OutParamIndex.getConstArray(); + sal_uInt32 nLen = OutParamIndex.getLength(); if( nLen ) { const Any* pNewValues = OutParam.getConstArray(); - for( UINT32 j = 0 ; j < nLen ; j++ ) + for( sal_uInt32 j = 0 ; j < nLen ; j++ ) { - INT16 iTarget = pIndices[ j ]; - if( iTarget >= (INT16)nParamCount ) + sal_Int16 iTarget = pIndices[ j ]; + if( iTarget >= (sal_Int16)nParamCount ) break; - unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pNewValues[ j ] ); + unoToSbxValue( (SbxVariable*)pParams->Get( (sal_uInt16)(j+1) ), pNewValues[ j ] ); } } } @@ -2333,7 +2333,7 @@ void SbUnoObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { implHandleAnyException( ::cppu::getCaughtException() ); } - GetSbData()->bBlockCompilerError = FALSE; // #106433 Unblock compiler errors + GetSbData()->bBlockCompilerError = sal_False; // #106433 Unblock compiler errors } } else @@ -2349,8 +2349,8 @@ Reference< XInvocation > createDynamicInvocationFor( const Any& aAny ); SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) : SbxObject( aName_ ) - , bNeedIntrospection( TRUE ) - , bNativeCOMObject( FALSE ) + , bNeedIntrospection( sal_True ) + , bNativeCOMObject( sal_False ) { static Reference< XIntrospection > xIntrospection; @@ -2393,7 +2393,7 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) // Rest bezieht sich nur auf Introspection if( !xTypeProvider.is() ) { - bNeedIntrospection = FALSE; + bNeedIntrospection = sal_False; return; } @@ -2401,34 +2401,34 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) // hiding of equally named COM symbols, e.g. XInvocation::getValue Reference< oleautomation::XAutomationObject > xAutomationObject( aUnoObj_, UNO_QUERY ); if( xAutomationObject.is() ) - bNativeCOMObject = TRUE; + bNativeCOMObject = sal_True; } maTmpUnoObj = aUnoObj_; //*** Namen bestimmen *** - BOOL bFatalError = TRUE; + sal_Bool bFatalError = sal_True; // Ist es ein Interface oder eine struct? - BOOL bSetClassName = FALSE; + sal_Bool bSetClassName = sal_False; String aClassName_; if( eType == TypeClass_STRUCT || eType == TypeClass_EXCEPTION ) { // Struct ist Ok - bFatalError = FALSE; + bFatalError = sal_False; // #67173 Echten Klassen-Namen eintragen if( aName_.Len() == 0 ) { aClassName_ = String( aUnoObj_.getValueType().getTypeName() ); - bSetClassName = TRUE; + bSetClassName = sal_True; } } else if( eType == TypeClass_INTERFACE ) { // #70197 Interface geht immer durch Typ im Any - bFatalError = FALSE; + bFatalError = sal_False; // Nach XIdlClassProvider-Interface fragen Reference< XIdlClassProvider > xClassProvider( x, UNO_QUERY ); @@ -2438,14 +2438,14 @@ SbUnoObject::SbUnoObject( const String& aName_, const Any& aUnoObj_ ) if( aName_.Len() == 0 ) { Sequence< Reference< XIdlClass > > szClasses = xClassProvider->getIdlClasses(); - UINT32 nLen = szClasses.getLength(); + sal_uInt32 nLen = szClasses.getLength(); if( nLen ) { const Reference< XIdlClass > xImplClass = szClasses.getConstArray()[ 0 ]; if( xImplClass.is() ) { aClassName_ = String( xImplClass->getName() ); - bSetClassName = TRUE; + bSetClassName = sal_True; } } } @@ -2476,7 +2476,7 @@ void SbUnoObject::doIntrospection( void ) if( !bNeedIntrospection ) return; - bNeedIntrospection = FALSE; + bNeedIntrospection = sal_False; if( !xIntrospection.is() ) { @@ -2623,16 +2623,16 @@ SbxInfo* SbUnoMethod::GetInfo() const Sequence& rInfoSeq = getParamInfos(); const ParamInfo* pParamInfos = rInfoSeq.getConstArray(); - UINT32 nParamCount = rInfoSeq.getLength(); + sal_uInt32 nParamCount = rInfoSeq.getLength(); - for( UINT32 i = 0 ; i < nParamCount ; i++ ) + for( sal_uInt32 i = 0 ; i < nParamCount ; i++ ) { const ParamInfo& rInfo = pParamInfos[i]; ::rtl::OUString aParamName = rInfo.aName; // const Reference< XIdlClass >& rxClass = rInfo.aType; SbxDataType t = SbxVARIANT; - USHORT nFlags_ = SBX_READ; + sal_uInt16 nFlags_ = SBX_READ; pInfo->AddParam( aParamName, t, nFlags_ ); } } @@ -2655,7 +2655,7 @@ SbUnoProperty::SbUnoProperty const String& aName_, SbxDataType eSbxType, const Property& aUnoProp_, - INT32 nId_, + sal_Int32 nId_, bool bInvocation ) : SbxProperty( aName_, eSbxType ) @@ -2871,10 +2871,10 @@ void SbUnoObject::implCreateAll( void ) // Properties anlegen Sequence props = xAccess->getProperties( PropertyConcept::ALL - PropertyConcept::DANGEROUS ); - UINT32 nPropCount = props.getLength(); + sal_uInt32 nPropCount = props.getLength(); const Property* pProps_ = props.getConstArray(); - UINT32 i; + sal_uInt32 i; for( i = 0 ; i < nPropCount ; i++ ) { const Property& rProp = pProps_[ i ]; @@ -2897,7 +2897,7 @@ void SbUnoObject::implCreateAll( void ) // Methoden anlegen Sequence< Reference< XIdlMethod > > aMethodSeq = xAccess->getMethods ( MethodConcept::ALL - MethodConcept::DANGEROUS ); - UINT32 nMethCount = aMethodSeq.getLength(); + sal_uInt32 nMethCount = aMethodSeq.getLength(); const Reference< XIdlMethod >* pMethods_ = aMethodSeq.getConstArray(); for( i = 0 ; i < nMethCount ; i++ ) { @@ -2957,7 +2957,7 @@ SbUnoObject* Impl_CreateUnoStruct( const String& aClassName ) // Factory-Klasse fuer das Anlegen von Uno-Structs per DIM AS NEW -SbxBase* SbUnoFactory::Create( UINT16, UINT32 ) +SbxBase* SbUnoFactory::Create( sal_uInt16, sal_uInt32 ) { // Ueber SbxId laeuft in Uno nix return NULL; @@ -2990,7 +2990,7 @@ void createAllObjectProperties( SbxObject* pObj ) } -void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -3015,7 +3015,7 @@ void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) refVar->PutObject( (SbUnoObject*)xUnoObj ); } -void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -3069,7 +3069,7 @@ void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) } } -void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -3127,7 +3127,7 @@ void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, } } -void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -3151,13 +3151,13 @@ void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, BOOL } } -void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; // Wir brauchen mindestens 2 Parameter - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount < 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -3166,7 +3166,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) // Variable fuer Rueckgabewert SbxVariableRef refVar = rPar.Get(0); - refVar->PutBool( FALSE ); + refVar->PutBool( sal_False ); // Uno-Objekt holen SbxBaseRef pObj = (SbxBase*)rPar.Get( 1 )->GetObject(); @@ -3185,7 +3185,7 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) if( !xCoreReflection.is() ) return; - for( USHORT i = 2 ; i < nParCount ; i++ ) + for( sal_uInt16 i = 2 ; i < nParCount ; i++ ) { // Interface-Name der struct holen String aIfaceName = rPar.Get( i )->GetString(); @@ -3202,11 +3202,11 @@ void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) return; } - // Alles hat geklappt, dann TRUE liefern - refVar->PutBool( TRUE ); + // Alles hat geklappt, dann sal_True liefern + refVar->PutBool( sal_True ); } -void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -3220,7 +3220,7 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) // Variable fuer Rueckgabewert SbxVariableRef refVar = rPar.Get(0); - refVar->PutBool( FALSE ); + refVar->PutBool( sal_False ); // Uno-Objekt holen SbxVariableRef xParam = rPar.Get( 1 ); @@ -3232,11 +3232,11 @@ void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) Any aAny = ((SbUnoObject*)(SbxBase*)pObj)->getUnoAny(); TypeClass eType = aAny.getValueType().getTypeClass(); if( eType == TypeClass_STRUCT ) - refVar->PutBool( TRUE ); + refVar->PutBool( sal_True ); } -void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -3249,7 +3249,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) // Variable fuer Rueckgabewert SbxVariableRef refVar = rPar.Get(0); - refVar->PutBool( FALSE ); + refVar->PutBool( sal_False ); // Uno-Objekte holen SbxVariableRef xParam1 = rPar.Get( 1 ); @@ -3281,7 +3281,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) //XInterfaceRef x2 = *(XInterfaceRef*)aAny2.get(); if( x1 == x2 ) - refVar->PutBool( TRUE ); + refVar->PutBool( sal_True ); } typedef std::hash_map< ::rtl::OUString, std::vector< ::rtl::OUString >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleHash; @@ -3511,7 +3511,7 @@ SbxVariable* SbUnoClass::Find( const XubString& rName, SbxClassType t ) // Uns selbst gleich wieder als Listener rausnehmen, // die Werte sind alle konstant if( pRes->IsBroadcaster() ) - EndListening( pRes->GetBroadcaster(), TRUE ); + EndListening( pRes->GetBroadcaster(), sal_True ); } } return pRes; @@ -3595,14 +3595,14 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, if( pUnoCtor && pHint->GetId() == SBX_HINT_DATAWANTED ) { // Parameter count -1 because of Param0 == this - UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0; + sal_uInt32 nParamCount = pParams ? ((sal_uInt32)pParams->Count() - 1) : 0; Sequence args; - BOOL bOutParams = FALSE; + sal_Bool bOutParams = sal_False; Reference< XServiceConstructorDescription > xCtor = pUnoCtor->getServiceCtorDesc(); Sequence< Reference< XParameter > > aParameterSeq = xCtor->getParameters(); const Reference< XParameter >* pParameterSeq = aParameterSeq.getConstArray(); - UINT32 nUnoParamCount = aParameterSeq.getLength(); + sal_uInt32 nUnoParamCount = aParameterSeq.getLength(); // Default: Ignore not needed parameters bool bParameterError = false; @@ -3620,8 +3620,8 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, } // Too many parameters with context as first parameter? - USHORT nSbxParameterOffset = 1; - USHORT nParameterOffsetByContext = 0; + sal_uInt16 nSbxParameterOffset = 1; + sal_uInt16 nParameterOffsetByContext = 0; Reference < XComponentContext > xFirstParamContext; if( nParamCount > nUnoParamCount ) { @@ -3632,8 +3632,8 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, nParameterOffsetByContext = 1; } - UINT32 nEffectiveParamCount = nParamCount - nParameterOffsetByContext; - UINT32 nAllocParamCount = nEffectiveParamCount; + sal_uInt32 nEffectiveParamCount = nParamCount - nParameterOffsetByContext; + sal_uInt32 nAllocParamCount = nEffectiveParamCount; if( nEffectiveParamCount > nUnoParamCount ) { if( !bRestParameterMode ) @@ -3660,9 +3660,9 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { args.realloc( nAllocParamCount ); Any* pAnyArgs = args.getArray(); - for( UINT32 i = 0 ; i < nEffectiveParamCount ; i++ ) + for( sal_uInt32 i = 0 ; i < nEffectiveParamCount ; i++ ) { - USHORT iSbx = (USHORT)(i + nSbxParameterOffset + nParameterOffsetByContext); + sal_uInt16 iSbx = (sal_uInt16)(i + nSbxParameterOffset + nParameterOffsetByContext); // bRestParameterMode allows nEffectiveParamCount > nUnoParamCount Reference< XParameter > xParam; @@ -3684,7 +3684,7 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, if( !bOutParams ) { if( xParam->isOut() ) - bOutParams = TRUE; + bOutParams = sal_True; } } else @@ -3729,14 +3729,14 @@ void SbUnoService::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { const Any* pAnyArgs = args.getConstArray(); - for( UINT32 j = 0 ; j < nUnoParamCount ; j++ ) + for( sal_uInt32 j = 0 ; j < nUnoParamCount ; j++ ) { Reference< XParameter > xParam = pParameterSeq[j]; if( !xParam.is() ) continue; if( xParam->isOut() ) - unoToSbxValue( (SbxVariable*)pParams->Get( (USHORT)(j+1) ), pAnyArgs[ j ] ); + unoToSbxValue( (SbxVariable*)pParams->Get( (sal_uInt16)(j+1) ), pAnyArgs[ j ] ); } } } @@ -3821,8 +3821,8 @@ void SbUnoSingleton::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pParams = pVar->GetParameters(); - UINT32 nParamCount = pParams ? ((UINT32)pParams->Count() - 1) : 0; - UINT32 nAllowedParamCount = 1; + sal_uInt32 nParamCount = pParams ? ((sal_uInt32)pParams->Count() - 1) : 0; + sal_uInt32 nAllowedParamCount = 1; Reference < XComponentContext > xContextToUse; if( nParamCount > 0 ) @@ -3881,7 +3881,7 @@ public: ~BasicAllListener_Impl(); // Methoden von XInterface - //virtual BOOL queryInterface( Uik aUik, Reference< XInterface > & rOut ); + //virtual sal_Bool queryInterface( Uik aUik, Reference< XInterface > & rOut ); // Methoden von XAllListener virtual void SAL_CALL firing(const AllEventObject& Event) throw ( RuntimeException ); @@ -3927,13 +3927,13 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet // In Basic Array anlegen SbxArrayRef xSbxArray = new SbxArray( SbxVARIANT ); const Any * pArgs = Event.Arguments.getConstArray(); - INT32 nCount = Event.Arguments.getLength(); - for( INT32 i = 0; i < nCount; i++ ) + sal_Int32 nCount = Event.Arguments.getLength(); + for( sal_Int32 i = 0; i < nCount; i++ ) { // Elemente wandeln SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); unoToSbxValue( (SbxVariable*)xVar, pArgs[i] ); - xSbxArray->Put( xVar, sal::static_int_cast< USHORT >(i+1) ); + xSbxArray->Put( xVar, sal::static_int_cast< sal_uInt16 >(i+1) ); } pLib->Call( aMethodName, xSbxArray ); @@ -3945,7 +3945,7 @@ void BasicAllListener_Impl::firing_impl( const AllEventObject& Event, Any* pRet if( pVar ) { // #95792 Avoid a second call - USHORT nFlags = pVar->GetFlags(); + sal_uInt16 nFlags = pVar->GetFlags(); pVar->SetFlag( SBX_NO_BROADCAST ); *pRet = sbxToUnoValueImpl( pVar ); pVar->SetFlags( nFlags ); @@ -4140,7 +4140,7 @@ sal_Bool SAL_CALL InvocationToAllListenerMapper::hasProperty(const ::rtl::OUStri // Uno-Service erzeugen // 1. Parameter == Prefix-Name der Makros // 2. Parameter == voll qualifizierter Name des Listeners -void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) //RTLFUNC(CreateUnoListener) { (void)bWrite; @@ -4204,7 +4204,7 @@ void SbRtl_CreateUnoListener( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) //======================================================================== // Represents the DefaultContext property of the ProcessServiceManager // in the Basic runtime system. -void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -4232,7 +4232,7 @@ void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite //======================================================================== // Creates a Basic wrapper object for a strongly typed Uno value // 1. parameter: Uno type as full qualified type name, e.g. "byte[]" -void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -4489,7 +4489,7 @@ Any SAL_CALL ModuleInvocationProxy::invoke( const ::rtl::OUString& rFunction, { SbxVariableRef xVar = new SbxVariable( SbxVARIANT ); unoToSbxValue( (SbxVariable*)xVar, pArgs[i] ); - xArray->Put( xVar, sal::static_int_cast< USHORT >(i+1) ); + xArray->Put( xVar, sal::static_int_cast< sal_uInt16 >(i+1) ); } } @@ -4627,8 +4627,8 @@ void disposeComVariablesForBasic( StarBASIC* pBasic ) StarBasicDisposeItem* pItem = *it; SbxArray* pArray = pItem->m_pRegisteredVariables; - USHORT nCount = pArray->Count(); - for( USHORT i = 0 ; i < nCount ; ++i ) + sal_uInt16 nCount = pArray->Count(); + for( sal_uInt16 i = 0 ; i < nCount ; ++i ) { SbxVariable* pVar = pArray->Get( i ); pVar->ClearComListener(); @@ -4673,8 +4673,8 @@ bool SbModule::createCOMWrapperForIface( Any& o_rRetAny, SbClassModuleObject* pP bool bSuccess = false; SbxArray* pModIfaces = pClassData->mxIfaces; - USHORT nCount = pModIfaces->Count(); - for( USHORT i = 0 ; i < nCount ; ++i ) + sal_uInt16 nCount = pModIfaces->Count(); + for( sal_uInt16 i = 0 ; i < nCount ; ++i ) { SbxVariable* pVar = pModIfaces->Get( i ); ::rtl::OUString aIfaceName = pVar->GetName(); diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 0f807db7cf8f..a268568a410d 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -265,7 +265,7 @@ DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence< if ( pInfo ) { sal_Int32 nSbxOptional = 0; - USHORT n = 1; + sal_uInt16 n = 1; for ( const SbxParamInfo* pParamInfo = pInfo->GetParam( n ); pParamInfo; pParamInfo = pInfo->GetParam( ++n ) ) { if ( ( pParamInfo->nFlags & SBX_OPTIONAL ) != 0 ) @@ -289,7 +289,7 @@ DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence< { SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT ); unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), pParams[i] ); - xSbxParams->Put( xSbxVar, static_cast< USHORT >( i ) + 1 ); + xSbxParams->Put( xSbxVar, static_cast< sal_uInt16 >( i ) + 1 ); // Enable passing by ref if ( xSbxVar->GetType() != SbxVARIANT ) @@ -312,7 +312,7 @@ DocObjectWrapper::invoke( const ::rtl::OUString& aFunctionName, const Sequence< if ( pInfo_ ) { OutParamMap aOutParamMap; - for ( USHORT n = 1, nCount = xSbxParams->Count(); n < nCount; ++n ) + for ( sal_uInt16 n = 1, nCount = xSbxParams->Count(); n < nCount; ++n ) { const SbxParamInfo* pParamInfo = pInfo_->GetParam( n ); if ( pParamInfo && ( pParamInfo->eType & SbxBYREF ) != 0 ) @@ -410,7 +410,7 @@ SbMethodRef DocObjectWrapper::getMethod( const rtl::OUString& aName ) throw (Run SbMethodRef pMethod = NULL; if ( m_pMod ) { - USHORT nSaveFlgs = m_pMod->GetFlags(); + sal_uInt16 nSaveFlgs = m_pMod->GetFlags(); // Limit search to this module m_pMod->ResetFlag( SBX_GBLSEARCH ); pMethod = (SbMethod*) m_pMod->SbModule::Find( aName, SbxCLASS_METHOD ); @@ -425,7 +425,7 @@ SbPropertyRef DocObjectWrapper::getProperty( const rtl::OUString& aName ) throw SbPropertyRef pProperty = NULL; if ( m_pMod ) { - USHORT nSaveFlgs = m_pMod->GetFlags(); + sal_uInt16 nSaveFlgs = m_pMod->GetFlags(); // Limit search to this module. m_pMod->ResetFlag( SBX_GBLSEARCH ); pProperty = (SbProperty*)m_pMod->SbModule::Find( aName, SbxCLASS_PROPERTY ); @@ -521,7 +521,7 @@ bool VBAUnlockControllers( StarBASIC* pBasic ) // Ein BASIC-Modul hat EXTSEARCH gesetzt, damit die im Modul enthaltenen // Elemente von anderen Modulen aus gefunden werden koennen. -SbModule::SbModule( const String& rName, BOOL bVBACompat ) +SbModule::SbModule( const String& rName, sal_Bool bVBACompat ) : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASICModule") ) ), pImage( NULL ), pBreaks( NULL ), pClassData( NULL ), mbVBACompat( bVBACompat ), pDocObject( NULL ), bIsProxyModule( false ) { @@ -557,9 +557,9 @@ SbModule::GetUnoModule() return mxWrapper; } -BOOL SbModule::IsCompiled() const +sal_Bool SbModule::IsCompiled() const { - return BOOL( pImage != 0 ); + return sal_Bool( pImage != 0 ); } const SbxObject* SbModule::FindType( String aTypeName ) const @@ -578,12 +578,12 @@ void SbModule::StartDefinitions() // Methoden und Properties bleiben erhalten, sind jedoch ungueltig // schliesslich sind ja u.U. die Infos belegt - USHORT i; + sal_uInt16 i; for( i = 0; i < pMethods->Count(); i++ ) { SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); if( p ) - p->bInvalid = TRUE; + p->bInvalid = sal_True; } for( i = 0; i < pProps->Count(); ) { @@ -609,11 +609,11 @@ SbMethod* SbModule::GetMethod( const String& rName, SbxDataType t ) pMeth->SetParent( this ); pMeth->SetFlags( SBX_READ ); pMethods->Put( pMeth, pMethods->Count() ); - StartListening( pMeth->GetBroadcaster(), TRUE ); + StartListening( pMeth->GetBroadcaster(), sal_True ); } // Per Default ist die Methode GUELTIG, da sie auch vom Compiler // (Codegenerator) erzeugt werden kann - pMeth->bInvalid = FALSE; + pMeth->bInvalid = sal_False; pMeth->ResetFlag( SBX_FIXED ); pMeth->SetFlag( SBX_WRITE ); pMeth->SetType( t ); @@ -637,7 +637,7 @@ SbProperty* SbModule::GetProperty( const String& rName, SbxDataType t ) pProp->SetFlag( SBX_READWRITE ); pProp->SetParent( this ); pProps->Put( pProp, pProps->Count() ); - StartListening( pProp->GetBroadcaster(), TRUE ); + StartListening( pProp->GetBroadcaster(), sal_True ); } return pProp; } @@ -655,7 +655,7 @@ SbProcedureProperty* SbModule::GetProcedureProperty pProp->SetFlag( SBX_READWRITE ); pProp->SetParent( this ); pProps->Put( pProp, pProps->Count() ); - StartListening( pProp->GetBroadcaster(), TRUE ); + StartListening( pProp->GetBroadcaster(), sal_True ); } return pProp; } @@ -674,7 +674,7 @@ SbIfaceMapperMethod* SbModule::GetIfaceMapperMethod pMapperMethod->SetFlags( SBX_READ ); pMethods->Put( pMapperMethod, pMethods->Count() ); } - pMapperMethod->bInvalid = FALSE; + pMapperMethod->bInvalid = sal_False; return pMapperMethod; } @@ -687,9 +687,9 @@ TYPEINIT1(SbIfaceMapperMethod,SbMethod) // Aus dem Codegenerator: Ungueltige Eintraege entfernen -void SbModule::EndDefinitions( BOOL bNewState ) +void SbModule::EndDefinitions( sal_Bool bNewState ) { - for( USHORT i = 0; i < pMethods->Count(); ) + for( sal_uInt16 i = 0; i < pMethods->Count(); ) { SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); if( p ) @@ -705,7 +705,7 @@ void SbModule::EndDefinitions( BOOL bNewState ) else i++; } - SetModified( TRUE ); + SetModified( sal_True ); } void SbModule::Clear() @@ -812,7 +812,7 @@ void SbModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, // side effects when using name as variable implicitely bool bForwardToSbxObject = true; - ULONG nId = pHint->GetId(); + sal_uIntPtr nId = pHint->GetId(); if( (nId == SBX_HINT_DATAWANTED || nId == SBX_HINT_DATACHANGED) && pVar->GetName().EqualsIgnoreCaseAscii( "name" ) ) bForwardToSbxObject = false; @@ -869,7 +869,7 @@ void SbModule::SetSource32( const ::rtl::OUString& r ) aTok.SetCompatible( true ); else if ( ( eCurTok == VBASUPPORT ) && ( aTok.Next() == NUMBER ) ) { - BOOL bIsVBA = ( aTok.GetDbl()== 1 ); + sal_Bool bIsVBA = ( aTok.GetDbl()== 1 ); SetVBACompat( bIsVBA ); aTok.SetCompatible( bIsVBA ); } @@ -881,7 +881,7 @@ void SbModule::SetSource32( const ::rtl::OUString& r ) SbMethod* pMeth = NULL; if( eEndTok != NIL ) { - USHORT nLine1 = aTok.GetLine(); + sal_uInt16 nLine1 = aTok.GetLine(); if( aTok.Next() == SYMBOL ) { String aName_( aTok.GetSym() ); @@ -891,7 +891,7 @@ void SbModule::SetSource32( const ::rtl::OUString& r ) pMeth = GetMethod( aName_, t ); pMeth->nLine1 = pMeth->nLine2 = nLine1; // Die Methode ist erst mal GUELTIG - pMeth->bInvalid = FALSE; + pMeth->bInvalid = sal_False; } else eEndTok = NIL; @@ -911,18 +911,18 @@ void SbModule::SetSource32( const ::rtl::OUString& r ) pMeth->nLine2 = aTok.GetLine(); } } - EndDefinitions( TRUE ); + EndDefinitions( sal_True ); } void SbModule::SetComment( const String& r ) { aComment = r; - SetModified( TRUE ); + SetModified( sal_True ); } -SbMethod* SbModule::GetFunctionForLine( USHORT nLine ) +SbMethod* SbModule::GetFunctionForLine( sal_uInt16 nLine ) { - for( USHORT i = 0; i < pMethods->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMethods->Count(); i++ ) { SbMethod* p = (SbMethod*) pMethods->Get( i ); if( p->GetSbxId() == SBXID_BASICMETHOD ) @@ -936,14 +936,14 @@ SbMethod* SbModule::GetFunctionForLine( USHORT nLine ) // Ausstrahlen eines Hints an alle Basics -static void _SendHint( SbxObject* pObj, ULONG nId, SbMethod* p ) +static void _SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p ) { // Selbst ein BASIC? if( pObj->IsA( TYPE(StarBASIC) ) && pObj->IsBroadcaster() ) pObj->GetBroadcaster().Broadcast( SbxHint( nId, p ) ); // Dann die Unterobjekte fragen SbxArray* pObjs = pObj->GetObjects(); - for( USHORT i = 0; i < pObjs->Count(); i++ ) + for( sal_uInt16 i = 0; i < pObjs->Count(); i++ ) { SbxVariable* pVar = pObjs->Get( i ); if( pVar->IsA( TYPE(SbxObject) ) ) @@ -951,7 +951,7 @@ static void _SendHint( SbxObject* pObj, ULONG nId, SbMethod* p ) } } -static void SendHint( SbxObject* pObj, ULONG nId, SbMethod* p ) +static void SendHint( SbxObject* pObj, sal_uIntPtr nId, SbMethod* p ) { while( pObj->GetParent() ) pObj = pObj->GetParent(); @@ -988,8 +988,8 @@ void ClearUnoObjectsInRTL_Impl_Rek( StarBASIC* pBasic ) // Ueber alle Sub-Basics gehen SbxArray* pObjs = pBasic->GetObjects(); - USHORT nCount = pObjs->Count(); - for( USHORT i = 0 ; i < nCount ; i++ ) + sal_uInt16 nCount = pObjs->Count(); + for( sal_uInt16 i = 0 ; i < nCount ; i++ ) { SbxVariable* pObjVar = pObjs->Get( i ); StarBASIC* pSubBasic = PTR_CAST( StarBASIC, pObjVar ); @@ -1013,24 +1013,24 @@ void ClearUnoObjectsInRTL_Impl( StarBASIC* pBasic ) if( ((StarBASIC*)p) != pBasic ) ClearUnoObjectsInRTL_Impl_Rek( (StarBASIC*)p ); } -BOOL SbModule::IsVBACompat() const +sal_Bool SbModule::IsVBACompat() const { return mbVBACompat; } -void SbModule::SetVBACompat( BOOL bCompat ) +void SbModule::SetVBACompat( sal_Bool bCompat ) { mbVBACompat = bCompat; } // Ausfuehren eines BASIC-Unterprogramms -USHORT SbModule::Run( SbMethod* pMeth ) +sal_uInt16 SbModule::Run( SbMethod* pMeth ) { - static USHORT nMaxCallLevel = 0; + static sal_uInt16 nMaxCallLevel = 0; static String aMSOMacroRuntimeLibName = String::CreateFromAscii( "Launcher" ); static String aMSOMacroRuntimeAppSymbol = String::CreateFromAscii( "Application" ); - USHORT nRes = 0; - BOOL bDelInst = BOOL( pINST == NULL ); + sal_uInt16 nRes = 0; + sal_Bool bDelInst = sal_Bool( pINST == NULL ); StarBASICRef xBasic; if( bDelInst ) { @@ -1044,7 +1044,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) // Launcher problem // i80726 The Find below will genarate an error in Testtool so we reset it unless there was one before already - BOOL bWasError = SbxBase::GetError() != 0; + sal_Bool bWasError = SbxBase::GetError() != 0; SbxVariable* pMSOMacroRuntimeLibVar = Find( aMSOMacroRuntimeLibName, SbxCLASS_OBJECT ); if ( !bWasError && (SbxBase::GetError() == SbxERR_PROC_UNDEFINED) ) SbxBase::ResetError(); @@ -1053,7 +1053,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) StarBASIC* pMSOMacroRuntimeLib = PTR_CAST(StarBASIC,pMSOMacroRuntimeLibVar); if( pMSOMacroRuntimeLib ) { - USHORT nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH; + sal_uInt16 nGblFlag = pMSOMacroRuntimeLib->GetFlags() & SBX_GBLSEARCH; pMSOMacroRuntimeLib->ResetFlag( SBX_GBLSEARCH ); SbxVariable* pAppSymbol = pMSOMacroRuntimeLib->Find( aMSOMacroRuntimeAppSymbol, SbxCLASS_METHOD ); pMSOMacroRuntimeLib->SetFlag( nGblFlag ); @@ -1100,7 +1100,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) GlobalRunInit( /* bBasicStart = */ bDelInst ); // Trat ein Compiler-Fehler auf? Dann starten wir nicht - if( GetSbData()->bGlobalInitErr == FALSE ) + if( GetSbData()->bGlobalInitErr == sal_False ) { if( bDelInst ) { @@ -1126,7 +1126,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) pINST->pRun = pRt; if ( mbVBACompat ) { - pINST->EnableCompatibility( TRUE ); + pINST->EnableCompatibility( sal_True ); } while( pRt->Step() ) {} if( pRt->pNext ) @@ -1151,7 +1151,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) GetpApp()->Yield(); } - nRes = TRUE; + nRes = sal_True; pINST->pRun = pRt->pNext; pINST->nCallLvl--; // Call-Level wieder runter @@ -1172,7 +1172,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) clearNativeObjectWrapperVector(); DBG_ASSERT(pINST->nCallLvl==0,"BASIC-Call-Level > 0"); - delete pINST, pINST = NULL, bDelInst = FALSE; + delete pINST, pINST = NULL, bDelInst = sal_False; // #i30690 vos::OGuard aSolarGuard( Application::GetSolarMutex() ); @@ -1226,9 +1226,9 @@ void SbModule::RunInit() && pImage->GetFlag( SBIMG_INITCODE ) ) { // Flag setzen, dass RunInit aktiv ist (Testtool) - GetSbData()->bRunInit = TRUE; + GetSbData()->bRunInit = sal_True; - // BOOL bDelInst = BOOL( pINST == NULL ); + // sal_Bool bDelInst = sal_Bool( pINST == NULL ); // if( bDelInst ) // pINST = new SbiInstance( (StarBASIC*) GetParent() ); SbModule* pOldMod = pMOD; @@ -1254,11 +1254,11 @@ void SbModule::RunInit() pMOD = pOldMod; // if( bDelInst ) // delete pINST, pINST = NULL; - pImage->bInit = TRUE; - pImage->bFirstInit = FALSE; + pImage->bInit = sal_True; + pImage->bFirstInit = sal_False; // RunInit ist nicht mehr aktiv - GetSbData()->bRunInit = FALSE; + GetSbData()->bRunInit = sal_False; } } @@ -1292,7 +1292,7 @@ void SbModule::RemoveVars() void SbModule::ClearPrivateVars() { - for( USHORT i = 0 ; i < pProps->Count() ; i++ ) + for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ ) { SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) ); if( p ) @@ -1303,12 +1303,12 @@ void SbModule::ClearPrivateVars() SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject()); if( pArray ) { - for( USHORT j = 0 ; j < pArray->Count() ; j++ ) + for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ ) { SbxVariable* pj = PTR_CAST(SbxVariable,pArray->Get( j )); pj->SbxValue::Clear(); /* - USHORT nFlags = pj->GetFlags(); + sal_uInt16 nFlags = pj->GetFlags(); pj->SetFlags( (nFlags | SBX_WRITE) & (~SBX_FIXED) ); pj->PutEmpty(); pj->SetFlags( nFlags ); @@ -1320,7 +1320,7 @@ void SbModule::ClearPrivateVars() { p->SbxValue::Clear(); /* - USHORT nFlags = p->GetFlags(); + sal_uInt16 nFlags = p->GetFlags(); p->SetFlags( (nFlags | SBX_WRITE) & (~SBX_FIXED) ); p->PutEmpty(); p->SetFlags( nFlags ); @@ -1360,7 +1360,7 @@ void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic ) { (void)pDeletedBasic; - for( USHORT i = 0 ; i < pProps->Count() ; i++ ) + for( sal_uInt16 i = 0 ; i < pProps->Count() ; i++ ) { SbProperty* p = PTR_CAST(SbProperty,pProps->Get( i ) ); if( p ) @@ -1370,7 +1370,7 @@ void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic ) SbxArray* pArray = PTR_CAST(SbxArray,p->GetObject()); if( pArray ) { - for( USHORT j = 0 ; j < pArray->Count() ; j++ ) + for( sal_uInt16 j = 0 ; j < pArray->Count() ; j++ ) { SbxVariable* pVar = PTR_CAST(SbxVariable,pArray->Get( j )); implClearIfVarDependsOnDeletedBasic( pVar, pDeletedBasic ); @@ -1390,7 +1390,7 @@ void SbModule::ClearVarsDependingOnDeletedBasic( StarBASIC* pDeletedBasic ) void StarBASIC::ClearAllModuleVars( void ) { // Eigene Module initialisieren - for ( USHORT nMod = 0; nMod < pModules->Count(); nMod++ ) + for ( sal_uInt16 nMod = 0; nMod < pModules->Count(); nMod++ ) { SbModule* pModule = (SbModule*)pModules->Get( nMod ); // Nur initialisieren, wenn der Startcode schon ausgefuehrt wurde @@ -1401,7 +1401,7 @@ void StarBASIC::ClearAllModuleVars( void ) /* #88042 This code can delete already used public vars during runtime! // Alle Objekte ueberpruefen, ob es sich um ein Basic handelt // Wenn ja, auch dort initialisieren - for ( USHORT nObj = 0; nObj < pObjs->Count(); nObj++ ) + for ( sal_uInt16 nObj = 0; nObj < pObjs->Count(); nObj++ ) { SbxVariable* pVar = pObjs->Get( nObj ); StarBASIC* pBasic = PTR_CAST(StarBASIC,pVar); @@ -1412,7 +1412,7 @@ void StarBASIC::ClearAllModuleVars( void ) } // Ausfuehren des Init-Codes aller Module -void SbModule::GlobalRunInit( BOOL bBasicStart ) +void SbModule::GlobalRunInit( sal_Bool bBasicStart ) { // Wenn kein Basic-Start, nur initialisieren, wenn Modul uninitialisiert if( !bBasicStart ) @@ -1423,7 +1423,7 @@ void SbModule::GlobalRunInit( BOOL bBasicStart ) // Anhand dieses Flags kann in SbModule::Run() nach dem Aufruf // von GlobalRunInit festgestellt werden, ob beim initialisieren // der Module ein Fehler auftrat. Dann wird nicht gestartet. - GetSbData()->bGlobalInitErr = FALSE; + GetSbData()->bGlobalInitErr = sal_False; // Parent vom Modul ist ein Basic StarBASIC *pBasic = PTR_CAST(StarBASIC,GetParent()); @@ -1470,15 +1470,15 @@ void SbModule::GlobalRunDeInit( void ) // Suche nach dem naechsten STMNT-Befehl im Code. Wird vom STMNT- // Opcode verwendet, um die Endspalte zu setzen. -const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol ) const +const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, sal_uInt16& nCol ) const { - return FindNextStmnt( p, nLine, nCol, FALSE ); + return FindNextStmnt( p, nLine, nCol, sal_False ); } -const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol, - BOOL bFollowJumps, const SbiImage* pImg ) const +const sal_uInt8* SbModule::FindNextStmnt( const sal_uInt8* p, sal_uInt16& nLine, sal_uInt16& nCol, + sal_Bool bFollowJumps, const SbiImage* pImg ) const { - UINT32 nPC = (UINT32) ( p - (const BYTE*) pImage->GetCode() ); + sal_uInt32 nPC = (sal_uInt32) ( p - (const sal_uInt8*) pImage->GetCode() ); while( nPC < pImage->GetCodeSize() ) { SbiOpcode eOp = (SbiOpcode ) ( *p++ ); @@ -1486,20 +1486,20 @@ const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol, if( bFollowJumps && eOp == _JUMP && pImg ) { DBG_ASSERT( pImg, "FindNextStmnt: pImg==NULL with FollowJumps option" ); - UINT32 nOp1 = *p++; nOp1 |= *p++ << 8; + sal_uInt32 nOp1 = *p++; nOp1 |= *p++ << 8; nOp1 |= *p++ << 16; nOp1 |= *p++ << 24; - p = (const BYTE*) pImg->GetCode() + nOp1; + p = (const sal_uInt8*) pImg->GetCode() + nOp1; } else if( eOp >= SbOP1_START && eOp <= SbOP1_END ) p += 4, nPC += 4; else if( eOp == _STMNT ) { - UINT32 nl, nc; + sal_uInt32 nl, nc; nl = *p++; nl |= *p++ << 8; nl |= *p++ << 16 ; nl |= *p++ << 24; nc = *p++; nc |= *p++ << 8; nc |= *p++ << 16 ; nc |= *p++ << 24; - nLine = (USHORT)nl; nCol = (USHORT)nc; + nLine = (sal_uInt16)nl; nCol = (sal_uInt16)nc; return p; } else if( eOp >= SbOP2_START && eOp <= SbOP2_END ) @@ -1515,16 +1515,16 @@ const BYTE* SbModule::FindNextStmnt( const BYTE* p, USHORT& nLine, USHORT& nCol, // Testen, ob eine Zeile STMNT-Opcodes enthaelt -BOOL SbModule::IsBreakable( USHORT nLine ) const +sal_Bool SbModule::IsBreakable( sal_uInt16 nLine ) const { if( !pImage ) - return FALSE; - const BYTE* p = (const BYTE* ) pImage->GetCode(); - USHORT nl, nc; + return sal_False; + const sal_uInt8* p = (const sal_uInt8* ) pImage->GetCode(); + sal_uInt16 nl, nc; while( ( p = FindNextStmnt( p, nl, nc ) ) != NULL ) if( nl == nLine ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } size_t SbModule::GetBPCount() const @@ -1532,7 +1532,7 @@ size_t SbModule::GetBPCount() const return pBreaks ? pBreaks->size() : 0; } -USHORT SbModule::GetBP( size_t n ) const +sal_uInt16 SbModule::GetBP( size_t n ) const { if( pBreaks && n < pBreaks->size() ) return pBreaks->operator[]( n ); @@ -1540,34 +1540,34 @@ USHORT SbModule::GetBP( size_t n ) const return 0; } -BOOL SbModule::IsBP( USHORT nLine ) const +sal_Bool SbModule::IsBP( sal_uInt16 nLine ) const { if( pBreaks ) { for( size_t i = 0; i < pBreaks->size(); i++ ) { - USHORT b = pBreaks->operator[]( i ); + sal_uInt16 b = pBreaks->operator[]( i ); if( b == nLine ) - return TRUE; + return sal_True; if( b < nLine ) break; } } - return FALSE; + return sal_False; } -BOOL SbModule::SetBP( USHORT nLine ) +sal_Bool SbModule::SetBP( sal_uInt16 nLine ) { if( !IsBreakable( nLine ) ) - return FALSE; + return sal_False; if( !pBreaks ) pBreaks = new SbiBreakpoints; size_t i; for( i = 0; i < pBreaks->size(); i++ ) { - USHORT b = pBreaks->operator[]( i ); + sal_uInt16 b = pBreaks->operator[]( i ); if( b == nLine ) - return TRUE; + return sal_True; if( b < nLine ) break; } @@ -1580,18 +1580,18 @@ BOOL SbModule::SetBP( USHORT nLine ) return IsBreakable( nLine ); } -BOOL SbModule::ClearBP( USHORT nLine ) +sal_Bool SbModule::ClearBP( sal_uInt16 nLine ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; if( pBreaks ) { for( size_t i = 0; i < pBreaks->size(); i++ ) { - USHORT b = pBreaks->operator[]( i ); + sal_uInt16 b = pBreaks->operator[]( i ); if( b == nLine ) { pBreaks->erase( pBreaks->begin() + i ); - bRes = TRUE; + bRes = sal_True; break; } if( b < nLine ) @@ -1614,39 +1614,39 @@ SbModule::fixUpMethodStart( bool bCvtToLegacy, SbiImage* pImg ) const { if ( !pImg ) pImg = pImage; - for( UINT32 i = 0; i < pMethods->Count(); i++ ) + for( sal_uInt32 i = 0; i < pMethods->Count(); i++ ) { - SbMethod* pMeth = PTR_CAST(SbMethod,pMethods->Get( (USHORT)i ) ); + SbMethod* pMeth = PTR_CAST(SbMethod,pMethods->Get( (sal_uInt16)i ) ); if( pMeth ) { //fixup method start positions if ( bCvtToLegacy ) pMeth->nStart = pImg->CalcLegacyOffset( pMeth->nStart ); else - pMeth->nStart = pImg->CalcNewOffset( (USHORT)pMeth->nStart ); + pMeth->nStart = pImg->CalcNewOffset( (sal_uInt16)pMeth->nStart ); } } } -BOOL SbModule::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { Clear(); if( !SbxObject::LoadData( rStrm, 1 ) ) - return FALSE; + return sal_False; // Precaution... SetFlag( SBX_EXTSEARCH | SBX_GBLSEARCH ); - BYTE bImage; + sal_uInt8 bImage; rStrm >> bImage; if( bImage ) { SbiImage* p = new SbiImage; - UINT32 nImgVer = 0; + sal_uInt32 nImgVer = 0; if( !p->Load( rStrm, nImgVer ) ) { delete p; - return FALSE; + return sal_False; } // If the image is in old format, we fix up the method start offsets if ( nImgVer < B_EXT_IMG_VERSION ) @@ -1674,24 +1674,24 @@ BOOL SbModule::LoadData( SvStream& rStrm, USHORT nVer ) delete p; } } - return TRUE; + return sal_True; } -BOOL SbModule::StoreData( SvStream& rStrm ) const +sal_Bool SbModule::StoreData( SvStream& rStrm ) const { - BOOL bFixup = ( pImage && !pImage->ExceedsLegacyLimits() ); + sal_Bool bFixup = ( pImage && !pImage->ExceedsLegacyLimits() ); if ( bFixup ) fixUpMethodStart( true ); - BOOL bRet = SbxObject::StoreData( rStrm ); + sal_Bool bRet = SbxObject::StoreData( rStrm ); if ( !bRet ) - return FALSE; + return sal_False; if( pImage ) { pImage->aOUSource = aOUSource; pImage->aComment = aComment; pImage->aName = GetName(); - rStrm << (BYTE) 1; + rStrm << (sal_uInt8) 1; // # PCode is saved only for legacy formats only // It should be noted that it probably isn't necessary // It would be better not to store the image ( more flexible with @@ -1708,12 +1708,12 @@ BOOL SbModule::StoreData( SvStream& rStrm ) const aImg.aOUSource = aOUSource; aImg.aComment = aComment; aImg.aName = GetName(); - rStrm << (BYTE) 1; + rStrm << (sal_uInt8) 1; return aImg.Save( rStrm ); } } -BOOL SbModule::ExceedsLegacyModuleSize() +sal_Bool SbModule::ExceedsLegacyModuleSize() { if ( !IsCompiled() ) Compile(); @@ -1724,17 +1724,17 @@ BOOL SbModule::ExceedsLegacyModuleSize() // Store only image, no source -BOOL SbModule::StoreBinaryData( SvStream& rStrm ) +sal_Bool SbModule::StoreBinaryData( SvStream& rStrm ) { return StoreBinaryData( rStrm, 0 ); } -BOOL SbModule::StoreBinaryData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer ) { - BOOL bRet = Compile(); + sal_Bool bRet = Compile(); if( bRet ) { - BOOL bFixup = ( !nVer && !pImage->ExceedsLegacyLimits() );// save in old image format, fix up method starts + sal_Bool bFixup = ( !nVer && !pImage->ExceedsLegacyLimits() );// save in old image format, fix up method starts if ( bFixup ) // save in old image format, fix up method starts fixUpMethodStart( true ); @@ -1745,7 +1745,7 @@ BOOL SbModule::StoreBinaryData( SvStream& rStrm, USHORT nVer ) pImage->aComment = aComment; pImage->aName = GetName(); - rStrm << (BYTE) 1; + rStrm << (sal_uInt8) 1; if ( nVer ) bRet = pImage->Save( rStrm, B_EXT_IMG_VERSION ); else @@ -1762,7 +1762,7 @@ BOOL SbModule::StoreBinaryData( SvStream& rStrm, USHORT nVer ) // Called for >= OO 1.0 passwd protected libraries only // -BOOL SbModule::LoadBinaryData( SvStream& rStrm ) +sal_Bool SbModule::LoadBinaryData( SvStream& rStrm ) { ::rtl::OUString aKeepSource = aOUSource; bool bRet = LoadData( rStrm, 2 ); @@ -1772,10 +1772,10 @@ BOOL SbModule::LoadBinaryData( SvStream& rStrm ) } -BOOL SbModule::LoadCompleted() +sal_Bool SbModule::LoadCompleted() { SbxArray* p = GetMethods(); - USHORT i; + sal_uInt16 i; for( i = 0; i < p->Count(); i++ ) { SbMethod* q = PTR_CAST(SbMethod,p->Get( i ) ); @@ -1789,7 +1789,7 @@ BOOL SbModule::LoadCompleted() if( q ) q->pMod = this; } - return TRUE; + return sal_True; } void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rHint ) @@ -1818,12 +1818,12 @@ void SbModule::handleProcedureProperties( SfxBroadcaster& rBC, const SfxHint& rH aVals.eType = SbxVARIANT; SbxArray* pArg = pVar->GetParameters(); - USHORT nVarParCount = (pArg != NULL) ? pArg->Count() : 0; + sal_uInt16 nVarParCount = (pArg != NULL) ? pArg->Count() : 0; if( nVarParCount > 1 ) { SbxArrayRef xMethParameters = new SbxArray; xMethParameters->Put( pMeth, 0 ); // Method as parameter 0 - for( USHORT i = 1 ; i < nVarParCount ; ++i ) + for( sal_uInt16 i = 1 ; i < nVarParCount ; ++i ) { SbxVariable* pPar = pArg->Get( i ); xMethParameters->Put( pPar, i ); @@ -1891,32 +1891,32 @@ SbJScriptModule::SbJScriptModule( const String& rName ) { } -BOOL SbJScriptModule::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbJScriptModule::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { (void)nVer; Clear(); if( !SbxObject::LoadData( rStrm, 1 ) ) - return FALSE; + return sal_False; // Source-String holen String aTmp; rStrm.ReadByteString( aTmp, gsl_getSystemTextEncoding() ); aOUSource = aTmp; //rStrm >> aSource; - return TRUE; + return sal_True; } -BOOL SbJScriptModule::StoreData( SvStream& rStrm ) const +sal_Bool SbJScriptModule::StoreData( SvStream& rStrm ) const { if( !SbxObject::StoreData( rStrm ) ) - return FALSE; + return sal_False; // Source-String schreiben String aTmp = aOUSource; rStrm.WriteByteString( aTmp, gsl_getSystemTextEncoding() ); //rStrm << aSource; - return TRUE; + return sal_True; } @@ -1925,7 +1925,7 @@ BOOL SbJScriptModule::StoreData( SvStream& rStrm ) const SbMethod::SbMethod( const String& r, SbxDataType t, SbModule* p ) : SbxMethod( r, t ), pMod( p ) { - bInvalid = TRUE; + bInvalid = sal_True; nStart = nDebugFlags = nLine1 = @@ -1970,35 +1970,35 @@ SbxArray* SbMethod::GetStatics() return refStatics; } -BOOL SbMethod::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbMethod::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { if( !SbxMethod::LoadData( rStrm, 1 ) ) - return FALSE; - INT16 n; + return sal_False; + sal_Int16 n; rStrm >> n; - INT16 nTempStart = (INT16)nStart; + sal_Int16 nTempStart = (sal_Int16)nStart; // nDebugFlags = n; // AB 16.1.96: Nicht mehr uebernehmen if( nVer == 2 ) rStrm >> nLine1 >> nLine2 >> nTempStart >> bInvalid; // AB: 2.7.1996: HACK wegen 'Referenz kann nicht gesichert werden' SetFlag( SBX_NO_MODIFY ); nStart = nTempStart; - return TRUE; + return sal_True; } -BOOL SbMethod::StoreData( SvStream& rStrm ) const +sal_Bool SbMethod::StoreData( SvStream& rStrm ) const { if( !SbxMethod::StoreData( rStrm ) ) - return FALSE; - rStrm << (INT16) nDebugFlags - << (INT16) nLine1 - << (INT16) nLine2 - << (INT16) nStart - << (BYTE) bInvalid; - return TRUE; + return sal_False; + rStrm << (sal_Int16) nDebugFlags + << (sal_Int16) nLine1 + << (sal_Int16) nLine2 + << (sal_Int16) nStart + << (sal_uInt8) bInvalid; + return sal_True; } -void SbMethod::GetLineRange( USHORT& l1, USHORT& l2 ) +void SbMethod::GetLineRange( sal_uInt16& l1, sal_uInt16& l2 ) { l1 = nLine1; l2 = nLine2; } @@ -2048,7 +2048,7 @@ ErrCode SbMethod::Call( SbxValue* pRet ) // #100883 Own Broadcast for SbMethod -void SbMethod::Broadcast( ULONG nHintId ) +void SbMethod::Broadcast( sal_uIntPtr nHintId ) { if( pCst && !IsSet( SBX_NO_BROADCAST ) && StaticIsEnabledBroadcasting() ) { @@ -2080,7 +2080,7 @@ void SbMethod::Broadcast( ULONG nHintId ) pCst = pSave; pSave->Broadcast( SbxHint( nHintId, pThisCopy ) ); - USHORT nSaveFlags = GetFlags(); + sal_uInt16 nSaveFlags = GetFlags(); SetFlag( SBX_READWRITE ); pCst = NULL; Put( pThisCopy->GetValues_Impl() ); @@ -2382,7 +2382,7 @@ void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any { SbxVariableRef xSbxVar = new SbxVariable( SbxVARIANT ); unoToSbxValue( static_cast< SbxVariable* >( xSbxVar ), aArguments[i] ); - xArray->Put( xSbxVar, static_cast< USHORT >( i ) + 1 ); + xArray->Put( xSbxVar, static_cast< sal_uInt16 >( i ) + 1 ); // Enable passing by ref if ( xSbxVar->GetType() != SbxVARIANT ) @@ -2395,7 +2395,7 @@ void SbUserFormModule::triggerMethod( const String& aMethodToRun, Sequence< Any for ( sal_Int32 i = 0; i < aArguments.getLength(); ++i ) { - aArguments[i] = sbxToUnoValue( xArray->Get( static_cast< USHORT >(i) + 1) ); + aArguments[i] = sbxToUnoValue( xArray->Get( static_cast< sal_uInt16 >(i) + 1) ); } pMeth->SetParameters( NULL ); } @@ -2465,10 +2465,10 @@ SbUserFormModuleInstance::SbUserFormModuleInstance( SbUserFormModule* pParentMod { } -BOOL SbUserFormModuleInstance::IsClass( const XubString& rName ) const +sal_Bool SbUserFormModuleInstance::IsClass( const XubString& rName ) const { - BOOL bParentNameMatches = m_pParentModule->GetName().EqualsIgnoreCaseAscii( rName ); - BOOL bRet = bParentNameMatches || SbxObject::IsClass( rName ); + sal_Bool bParentNameMatches = m_pParentModule->GetName().EqualsIgnoreCaseAscii( rName ); + sal_Bool bRet = bParentNameMatches || SbxObject::IsClass( rName ); return bRet; } @@ -2613,7 +2613,7 @@ SbUserFormModule::Find( const XubString& rName, SbxClassType t ) SbProperty::SbProperty( const String& r, SbxDataType t, SbModule* p ) : SbxProperty( r, t ), pMod( p ) { - bInvalid = FALSE; + bInvalid = sal_False; } SbProperty::~SbProperty() diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx index 74559bf0e6c4..46df47cbd665 100644 --- a/basic/source/comp/buffer.cxx +++ b/basic/source/comp/buffer.cxx @@ -32,7 +32,7 @@ #include "buffer.hxx" #include -const static UINT32 UP_LIMIT=0xFFFFFF00L; +const static sal_uInt32 UP_LIMIT=0xFFFFFF00L; // Der SbiBuffer wird in Inkrements von mindestens 16 Bytes erweitert. // Dies ist notwendig, da viele Klassen von einer Pufferlaenge @@ -69,24 +69,24 @@ char* SbiBuffer::GetBuffer() // Test, ob der Puffer n Bytes aufnehmen kann. // Im Zweifelsfall wird er vergroessert -BOOL SbiBuffer::Check( USHORT n ) +sal_Bool SbiBuffer::Check( sal_uInt16 n ) { - if( !n ) return TRUE; - if( ( static_cast( nOff )+ n ) > static_cast( nSize ) ) + if( !n ) return sal_True; + if( ( static_cast( nOff )+ n ) > static_cast( nSize ) ) { if( nInc == 0 ) - return FALSE; - USHORT nn = 0; + return sal_False; + sal_uInt16 nn = 0; while( nn < n ) nn = nn + nInc; char* p; - if( ( static_cast( nSize ) + nn ) > UP_LIMIT ) p = NULL; + if( ( static_cast( nSize ) + nn ) > UP_LIMIT ) p = NULL; else p = new char [nSize + nn]; if( !p ) { pParser->Error( SbERR_PROG_TOO_LARGE ); nInc = 0; delete[] pBuf; pBuf = NULL; - return FALSE; + return sal_False; } else { @@ -97,19 +97,19 @@ BOOL SbiBuffer::Check( USHORT n ) nSize = nSize + nn; } } - return TRUE; + return sal_True; } // Angleich des Puffers auf die uebergebene Byte-Grenze -void SbiBuffer::Align( INT32 n ) +void SbiBuffer::Align( sal_Int32 n ) { if( nOff % n ) { - UINT32 nn =( ( nOff + n ) / n ) * n; + sal_uInt32 nn =( ( nOff + n ) / n ) * n; if( nn <= UP_LIMIT ) { nn = nn - nOff; - if( Check( static_cast(nn) ) ) + if( Check( static_cast(nn) ) ) { memset( pCur, 0, nn ); pCur += nn; @@ -121,13 +121,13 @@ void SbiBuffer::Align( INT32 n ) // Patch einer Location -void SbiBuffer::Patch( UINT32 off, UINT32 val ) +void SbiBuffer::Patch( sal_uInt32 off, sal_uInt32 val ) { - if( ( off + sizeof( UINT32 ) ) < nOff ) + if( ( off + sizeof( sal_uInt32 ) ) < nOff ) { - UINT16 val1 = static_cast( val & 0xFFFF ); - UINT16 val2 = static_cast( val >> 16 ); - BYTE* p = (BYTE*) pBuf + off; + sal_uInt16 val1 = static_cast( val & 0xFFFF ); + sal_uInt16 val2 = static_cast( val >> 16 ); + sal_uInt8* p = (sal_uInt8*) pBuf + off; *p++ = (char) ( val1 & 0xFF ); *p++ = (char) ( val1 >> 8 ); *p++ = (char) ( val2 & 0xFF ); @@ -139,18 +139,18 @@ void SbiBuffer::Patch( UINT32 off, UINT32 val ) // bauen eine Kette auf. Der Anfang der Kette ist beim uebergebenen // Parameter, das Ende der Kette ist 0. -void SbiBuffer::Chain( UINT32 off ) +void SbiBuffer::Chain( sal_uInt32 off ) { if( off && pBuf ) { - BYTE *ip; - UINT32 i = off; - UINT32 val1 = (nOff & 0xFFFF); - UINT32 val2 = (nOff >> 16); + sal_uInt8 *ip; + sal_uInt32 i = off; + sal_uInt32 val1 = (nOff & 0xFFFF); + sal_uInt32 val2 = (nOff >> 16); do { - ip = (BYTE*) pBuf + i; - BYTE* pTmp = ip; + ip = (sal_uInt8*) pBuf + i; + sal_uInt8* pTmp = ip; i = *pTmp++; i |= *pTmp++ << 8; i |= *pTmp++ << 16; i |= *pTmp++ << 24; if( i >= nOff ) @@ -166,84 +166,84 @@ void SbiBuffer::Chain( UINT32 off ) } } -BOOL SbiBuffer::operator +=( INT8 n ) +sal_Bool SbiBuffer::operator +=( sal_Int8 n ) { if( Check( 1 ) ) { - *pCur++ = (char) n; nOff++; return TRUE; - } else return FALSE; + *pCur++ = (char) n; nOff++; return sal_True; + } else return sal_False; } -BOOL SbiBuffer::operator +=( UINT8 n ) +sal_Bool SbiBuffer::operator +=( sal_uInt8 n ) { if( Check( 1 ) ) { - *pCur++ = (char) n; nOff++; return TRUE; - } else return FALSE; + *pCur++ = (char) n; nOff++; return sal_True; + } else return sal_False; } -BOOL SbiBuffer::operator +=( INT16 n ) +sal_Bool SbiBuffer::operator +=( sal_Int16 n ) { if( Check( 2 ) ) { *pCur++ = (char) ( n & 0xFF ); *pCur++ = (char) ( n >> 8 ); - nOff += 2; return TRUE; - } else return FALSE; + nOff += 2; return sal_True; + } else return sal_False; } -BOOL SbiBuffer::operator +=( UINT16 n ) +sal_Bool SbiBuffer::operator +=( sal_uInt16 n ) { if( Check( 2 ) ) { *pCur++ = (char) ( n & 0xFF ); *pCur++ = (char) ( n >> 8 ); - nOff += 2; return TRUE; - } else return FALSE; + nOff += 2; return sal_True; + } else return sal_False; } -BOOL SbiBuffer::operator +=( UINT32 n ) +sal_Bool SbiBuffer::operator +=( sal_uInt32 n ) { if( Check( 4 ) ) { - UINT16 n1 = static_cast( n & 0xFFFF ); - UINT16 n2 = static_cast( n >> 16 ); + sal_uInt16 n1 = static_cast( n & 0xFFFF ); + sal_uInt16 n2 = static_cast( n >> 16 ); if ( operator +=( n1 ) && operator +=( n2 ) ) - return TRUE; - return TRUE; + return sal_True; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SbiBuffer::operator +=( INT32 n ) +sal_Bool SbiBuffer::operator +=( sal_Int32 n ) { - return operator +=( (UINT32) n ); + return operator +=( (sal_uInt32) n ); } -BOOL SbiBuffer::operator +=( const String& n ) +sal_Bool SbiBuffer::operator +=( const String& n ) { - USHORT l = n.Len() + 1; + sal_uInt16 l = n.Len() + 1; if( Check( l ) ) { ByteString aByteStr( n, gsl_getSystemTextEncoding() ); memcpy( pCur, aByteStr.GetBuffer(), l ); pCur += l; nOff = nOff + l; - return TRUE; + return sal_True; } - else return FALSE; + else return sal_False; } -BOOL SbiBuffer::Add( const void* p, USHORT len ) +sal_Bool SbiBuffer::Add( const void* p, sal_uInt16 len ) { if( Check( len ) ) { memcpy( pCur, p, len ); pCur += len; nOff = nOff + len; - return TRUE; - } else return FALSE; + return sal_True; + } else return sal_False; } diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 93fb18baf86e..a8c7e3f5330f 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -40,13 +40,13 @@ SbiCodeGen::SbiCodeGen( SbModule& r, SbiParser* p, short nInc ) : rMod( r ), aCode( p, nInc ) { pParser = p; - bStmnt = FALSE; + bStmnt = sal_False; nLine = 0; nCol = 0; nForLevel = 0; } -UINT32 SbiCodeGen::GetPC() +sal_uInt32 SbiCodeGen::GetPC() { return aCode.GetSize(); } @@ -55,7 +55,7 @@ UINT32 SbiCodeGen::GetPC() void SbiCodeGen::Statement() { - bStmnt = TRUE; + bStmnt = sal_True; nLine = pParser->GetLine(); nCol = pParser->GetCol1(); @@ -71,7 +71,7 @@ void SbiCodeGen::GenStmnt() { if( bStmnt ) { - bStmnt = FALSE; + bStmnt = sal_False; Gen( _STMNT, nLine, nCol ); } } @@ -79,39 +79,39 @@ void SbiCodeGen::GenStmnt() // Die Gen-Routinen returnen den Offset des 1. Operanden, // damit Jumps dort ihr Backchain versenken koennen -UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode ) +sal_uInt32 SbiCodeGen::Gen( SbiOpcode eOpcode ) { #ifdef DBG_UTIL if( eOpcode < SbOP0_START || eOpcode > SbOP0_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE1" ); #endif GenStmnt(); - aCode += (UINT8) eOpcode; + aCode += (sal_uInt8) eOpcode; return GetPC(); } -UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd ) +sal_uInt32 SbiCodeGen::Gen( SbiOpcode eOpcode, sal_uInt32 nOpnd ) { #ifdef DBG_UTIL if( eOpcode < SbOP1_START || eOpcode > SbOP1_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE2" ); #endif GenStmnt(); - aCode += (UINT8) eOpcode; - UINT32 n = GetPC(); + aCode += (sal_uInt8) eOpcode; + sal_uInt32 n = GetPC(); aCode += nOpnd; return n; } -UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd1, UINT32 nOpnd2 ) +sal_uInt32 SbiCodeGen::Gen( SbiOpcode eOpcode, sal_uInt32 nOpnd1, sal_uInt32 nOpnd2 ) { #ifdef DBG_UTIL if( eOpcode < SbOP2_START || eOpcode > SbOP2_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE3" ); #endif GenStmnt(); - aCode += (UINT8) eOpcode; - UINT32 n = GetPC(); + aCode += (sal_uInt8) eOpcode; + sal_uInt32 n = GetPC(); aCode += nOpnd1; aCode += nOpnd2; return n; @@ -178,7 +178,7 @@ void SbiCodeGen::Save() String aProcName = pProc->GetName(); String aIfaceProcName; String aIfaceName; - USHORT nPassCount = 1; + sal_uInt16 nPassCount = 1; if( nIfaceCount ) { int nPropPrefixFound = @@ -206,7 +206,7 @@ void SbiCodeGen::Save() } } SbMethod* pMeth = NULL; - for( USHORT nPass = 0 ; nPass < nPassCount ; nPass++ ) + for( sal_uInt16 nPass = 0 ; nPass < nPassCount ; nPass++ ) { if( nPass == 1 ) aProcName = aIfaceProcName; @@ -269,7 +269,7 @@ void SbiCodeGen::Save() // Die Parameter: SbxInfo* pInfo = pMeth->GetInfo(); String aHelpFile, aComment; - ULONG nHelpId = 0; + sal_uIntPtr nHelpId = 0; if( pInfo ) { // Die Zusatzdaten retten @@ -282,7 +282,7 @@ void SbiCodeGen::Save() pInfo->SetComment( aComment ); SbiSymPool* pPool = &pProc->GetParams(); // Das erste Element ist immer der Funktionswert! - for( USHORT i = 1; i < pPool->GetSize(); i++ ) + for( sal_uInt16 i = 1; i < pPool->GetSize(); i++ ) { SbiSymDef* pPar = pPool->Get( i ); SbxDataType t = pPar->GetType(); @@ -291,14 +291,14 @@ void SbiCodeGen::Save() if( pPar->GetDims() ) t = (SbxDataType) ( t | SbxARRAY ); // #33677 Optional-Info durchreichen - USHORT nFlags = SBX_READ; + sal_uInt16 nFlags = SBX_READ; if( pPar->IsOptional() ) nFlags |= SBX_OPTIONAL; pInfo->AddParam( pPar->GetName(), t, nFlags ); - UINT32 nUserData = 0; - USHORT nDefaultId = pPar->GetDefaultId(); + sal_uInt32 nUserData = 0; + sal_uInt16 nDefaultId = pPar->GetDefaultId(); if( nDefaultId ) nUserData |= nDefaultId; if( pPar->IsParamArray() ) @@ -320,14 +320,14 @@ void SbiCodeGen::Save() // Der globale StringPool. 0 ist nicht belegt. SbiStringPool* pPool = &pParser->aGblStrings; - USHORT nSize = pPool->GetSize(); + sal_uInt16 nSize = pPool->GetSize(); p->MakeStrings( nSize ); - USHORT i; + sal_uInt16 i; for( i = 1; i <= nSize; i++ ) p->AddString( pPool->Find( i ) ); // Typen einfuegen - USHORT nCount = pParser->rTypeArray->Count(); + sal_uInt16 nCount = pParser->rTypeArray->Count(); for (i = 0; i < nCount; i++) p->AddType((SbxObject *)pParser->rTypeArray->Get(i)); @@ -350,7 +350,7 @@ class PCodeVisitor public: virtual ~PCodeVisitor(); - virtual void start( BYTE* pStart ) = 0; + virtual void start( sal_uInt8* pStart ) = 0; virtual void processOpCode0( SbiOpcode eOp ) = 0; virtual void processOpCode1( SbiOpcode eOp, T nOp1 ) = 0; virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) = 0; @@ -366,8 +366,8 @@ class PCodeBufferWalker { private: T m_nBytes; - BYTE* m_pCode; - T readParam( BYTE*& pCode ) + sal_uInt8* m_pCode; + T readParam( sal_uInt8*& pCode ) { short nBytes = sizeof( T ); T nOp1=0; @@ -376,15 +376,15 @@ private: return nOp1; } public: - PCodeBufferWalker( BYTE* pCode, T nBytes ): m_nBytes( nBytes ), m_pCode( pCode ) + PCodeBufferWalker( sal_uInt8* pCode, T nBytes ): m_nBytes( nBytes ), m_pCode( pCode ) { } void visitBuffer( PCodeVisitor< T >& visitor ) { - BYTE* pCode = m_pCode; + sal_uInt8* pCode = m_pCode; if ( !pCode ) return; - BYTE* pEnd = pCode + m_nBytes; + sal_uInt8* pEnd = pCode + m_nBytes; visitor.start( m_pCode ); T nOp1 = 0, nOp2 = 0; for( ; pCode < pEnd; ) @@ -426,7 +426,7 @@ class OffSetAccumulator : public PCodeVisitor< T > public: OffSetAccumulator() : m_nNumOp0(0), m_nNumSingleParams(0), m_nNumDoubleParams(0){} - virtual void start( BYTE* /*pStart*/ ){} + virtual void start( sal_uInt8* /*pStart*/ ){} virtual void processOpCode0( SbiOpcode /*eOp*/ ){ ++m_nNumOp0; } virtual void processOpCode1( SbiOpcode /*eOp*/, T /*nOp1*/ ){ ++m_nNumSingleParams; } virtual void processOpCode2( SbiOpcode /*eOp*/, T /*nOp1*/, T /*nOp2*/ ) { ++m_nNumDoubleParams; } @@ -450,18 +450,18 @@ template < class T, class S > class BufferTransformer : public PCodeVisitor< T > { - BYTE* m_pStart; + sal_uInt8* m_pStart; SbiBuffer m_ConvertedBuf; public: BufferTransformer():m_pStart(NULL), m_ConvertedBuf( NULL, 1024 ) {} - virtual void start( BYTE* pStart ){ m_pStart = pStart; } + virtual void start( sal_uInt8* pStart ){ m_pStart = pStart; } virtual void processOpCode0( SbiOpcode eOp ) { - m_ConvertedBuf += (UINT8)eOp; + m_ConvertedBuf += (sal_uInt8)eOp; } virtual void processOpCode1( SbiOpcode eOp, T nOp1 ) { - m_ConvertedBuf += (UINT8)eOp; + m_ConvertedBuf += (sal_uInt8)eOp; switch( eOp ) { case _JUMP: @@ -486,7 +486,7 @@ public: } virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) { - m_ConvertedBuf += (UINT8)eOp; + m_ConvertedBuf += (sal_uInt8)eOp; if ( eOp == _CASEIS ) if ( nOp1 ) nOp1 = static_cast( convertBufferOffSet(m_pStart, nOp1) ); @@ -503,7 +503,7 @@ public: { return m_ConvertedBuf; } - static S convertBufferOffSet( BYTE* pStart, T nOp1 ) + static S convertBufferOffSet( sal_uInt8* pStart, T nOp1 ) { PCodeBufferWalker< T > aBuff( pStart, nOp1); OffSetAccumulator< T, S > aVisitor; @@ -512,16 +512,16 @@ public: } }; -UINT32 -SbiCodeGen::calcNewOffSet( BYTE* pCode, UINT16 nOffset ) +sal_uInt32 +SbiCodeGen::calcNewOffSet( sal_uInt8* pCode, sal_uInt16 nOffset ) { - return BufferTransformer< UINT16, UINT32 >::convertBufferOffSet( pCode, nOffset ); + return BufferTransformer< sal_uInt16, sal_uInt32 >::convertBufferOffSet( pCode, nOffset ); } -UINT16 -SbiCodeGen::calcLegacyOffSet( BYTE* pCode, UINT32 nOffset ) +sal_uInt16 +SbiCodeGen::calcLegacyOffSet( sal_uInt8* pCode, sal_uInt32 nOffset ) { - return BufferTransformer< UINT32, UINT16 >::convertBufferOffSet( pCode, nOffset ); + return BufferTransformer< sal_uInt32, sal_uInt16 >::convertBufferOffSet( pCode, nOffset ); } template @@ -531,9 +531,9 @@ PCodeBuffConvertor::convert() PCodeBufferWalker< T > aBuf( m_pStart, m_nSize ); BufferTransformer< T, S > aTrnsfrmer; aBuf.visitBuffer( aTrnsfrmer ); - m_pCnvtdBuf = (BYTE*)aTrnsfrmer.buffer().GetBuffer(); + m_pCnvtdBuf = (sal_uInt8*)aTrnsfrmer.buffer().GetBuffer(); m_nCnvtdSize = static_cast( aTrnsfrmer.buffer().GetSize() ); } -template class PCodeBuffConvertor< UINT16, UINT32 >; -template class PCodeBuffConvertor< UINT32, UINT16 >; +template class PCodeBuffConvertor< sal_uInt16, sal_uInt32 >; +template class PCodeBuffConvertor< sal_uInt32, sal_uInt16 >; diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index 4d188ec1ca8a..1ba8982404e4 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -37,7 +37,7 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj ); // Returnwert: eine neue Instanz, die eingefuegt und dann geloescht wird. // Array-Indexe werden als SbiDimList zurueckgegeben -SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, BOOL bStatic, BOOL bConst ) +SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, sal_Bool bStatic, sal_Bool bConst ) { bool bWithEvents = false; if( Peek() == WITHEVENTS ) @@ -72,7 +72,7 @@ SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, BOOL bStatic, BOOL bConst ) // Aufloesen einer AS-Typdeklaration // Der Datentyp wird in die uebergebene Variable eingetragen -void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed ) +void SbiParser::TypeDecl( SbiSymDef& rDef, sal_Bool bAsNewAlreadyParsed ) { SbxDataType eType = rDef.GetType(); short nSize = 0; @@ -193,34 +193,34 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, BOOL bAsNewAlreadyParsed ) void SbiParser::Dim() { - DefVar( _DIM, ( pProc && bVBASupportOn ) ? pProc->IsStatic() : FALSE ); + DefVar( _DIM, ( pProc && bVBASupportOn ) ? pProc->IsStatic() : sal_False ); } -void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) +void SbiParser::DefVar( SbiOpcode eOp, sal_Bool bStatic ) { SbiSymPool* pOldPool = pPool; - BOOL bSwitchPool = FALSE; - BOOL bPersistantGlobal = FALSE; + sal_Bool bSwitchPool = sal_False; + sal_Bool bPersistantGlobal = sal_False; SbiToken eFirstTok = eCurTok; if( pProc && ( eCurTok == GLOBAL || eCurTok == PUBLIC || eCurTok == PRIVATE ) ) Error( SbERR_NOT_IN_SUBR, eCurTok ); if( eCurTok == PUBLIC || eCurTok == GLOBAL ) { - bSwitchPool = TRUE; // im richtigen Moment auf globalen Pool schalten + bSwitchPool = sal_True; // im richtigen Moment auf globalen Pool schalten if( eCurTok == GLOBAL ) - bPersistantGlobal = TRUE; + bPersistantGlobal = sal_True; } // behavior in VBA is that a module scope variable's lifetime is // tied to the document. e.g. a module scope variable is global if( GetBasic()->IsDocBasic() && bVBASupportOn && !pProc ) - bPersistantGlobal = TRUE; + bPersistantGlobal = sal_True; // PRIVATE ist Synonym fuer DIM // _CONST_? - BOOL bConst = FALSE; + sal_Bool bConst = sal_False; if( eCurTok == _CONST_ ) - bConst = TRUE; + bConst = sal_True; else if( Peek() == _CONST_ ) - Next(), bConst = TRUE; + Next(), bConst = sal_True; // #110004 It can also be a sub/function if( !bConst && (eCurTok == SUB || eCurTok == FUNCTION || eCurTok == PROPERTY || @@ -241,10 +241,10 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) if( bNewGblDefs && nGblChain == 0 ) { nGblChain = aGen.Gen( _JUMP, 0 ); - bNewGblDefs = FALSE; + bNewGblDefs = sal_False; } Next(); - DefProc( FALSE, bPrivate ); + DefProc( sal_False, bPrivate ); return; } else if( eCurTok == ENUM ) @@ -291,14 +291,14 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) SbiDimList* pDim; // AB 9.7.97, #40689, Statics -> Modul-Initialisierung, in Sub ueberspringen - UINT32 nEndOfStaticLbl = 0; + sal_uInt32 nEndOfStaticLbl = 0; if( !bVBASupportOn && bStatic ) { nEndOfStaticLbl = aGen.Gen( _JUMP, 0 ); aGen.Statement(); // bei static hier nachholen } - BOOL bDefined = FALSE; + sal_Bool bDefined = sal_False; while( ( pDef = VarDecl( &pDim, bStatic, bConst ) ) != NULL ) { EnableErrors(); @@ -307,12 +307,12 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) pPool = &aGlobals; SbiSymDef* pOld = pPool->Find( pDef->GetName() ); // AB 31.3.1996, #25651#, auch in Runtime-Library suchen - BOOL bRtlSym = FALSE; + sal_Bool bRtlSym = sal_False; if( !pOld ) { pOld = CheckRTLForSym( pDef->GetName(), SbxVARIANT ); if( pOld ) - bRtlSym = TRUE; + bRtlSym = sal_True; } if( pOld && !(eOp == _REDIM || eOp == _REDIMP) ) { @@ -321,7 +321,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) } if( pOld ) { - bDefined = TRUE; + bDefined = sal_True; // Bei RTL-Symbol immer Fehler if( !bRtlSym && (eOp == _REDIM || eOp == _REDIMP) ) { @@ -367,11 +367,11 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) } global: aGen.BackChain( nGblChain ); nGblChain = 0; - bGblDefs = bNewGblDefs = TRUE; + bGblDefs = bNewGblDefs = sal_True; break; default: eOp2 = _LOCAL; } - UINT32 nOpnd2 = sal::static_int_cast< UINT16 >( pDef->GetType() ); + sal_uInt32 nOpnd2 = sal::static_int_cast< sal_uInt16 >( pDef->GetType() ); if( pDef->IsWithEvents() ) nOpnd2 |= SBX_TYPE_WITH_EVENTS_FLAG; @@ -380,7 +380,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) short nFixedStringLength = pDef->GetFixedStringLength(); if( nFixedStringLength >= 0 ) - nOpnd2 |= (SBX_FIXED_LEN_STRING_FLAG + (UINT32(nFixedStringLength) << 17)); // len = all bits above 0x10000 + nOpnd2 |= (SBX_FIXED_LEN_STRING_FLAG + (sal_uInt32(nFixedStringLength) << 17)); // len = all bits above 0x10000 aGen.Gen( eOp2, pDef->GetId(), nOpnd2 ); } @@ -487,10 +487,10 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) } pDef->SetDims( pDim->GetDims() ); if( bPersistantGlobal ) - pDef->SetGlobal( TRUE ); + pDef->SetGlobal( sal_True ); SbiExpression aExpr( this, *pDef, pDim ); aExpr.Gen(); - pDef->SetGlobal( FALSE ); + pDef->SetGlobal( sal_False ); aGen.Gen( (eOp == _STATIC) ? _DIM : eOp ); } } @@ -515,7 +515,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) { // globalen Chain pflegen nGblChain = aGen.Gen( _JUMP, 0 ); - bGblDefs = bNewGblDefs = TRUE; + bGblDefs = bNewGblDefs = sal_True; // fuer Sub Sprung auf Ende der statics eintragen aGen.BackChain( nEndOfStaticLbl ); @@ -528,7 +528,7 @@ void SbiParser::DefVar( SbiOpcode eOp, BOOL bStatic ) void SbiParser::ReDim() { - DefVar( _REDIM, ( pProc && bVBASupportOn ) ? pProc->IsStatic() : FALSE ); + DefVar( _REDIM, ( pProc && bVBASupportOn ) ? pProc->IsStatic() : sal_False ); } // ERASE array, ... @@ -548,10 +548,10 @@ void SbiParser::Erase() void SbiParser::Type() { - DefType( FALSE ); + DefType( sal_False ); } -void SbiParser::DefType( BOOL bPrivate ) +void SbiParser::DefType( sal_Bool bPrivate ) { // TODO: Use bPrivate (void)bPrivate; @@ -570,7 +570,7 @@ void SbiParser::DefType( BOOL bPrivate ) SbiSymDef* pElem; SbiDimList* pDim = NULL; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; while( !bDone && !IsEof() ) { @@ -578,7 +578,7 @@ void SbiParser::DefType( BOOL bPrivate ) { case ENDTYPE : pElem = NULL; - bDone = TRUE; + bDone = sal_True; Next(); break; @@ -590,9 +590,9 @@ void SbiParser::DefType( BOOL bPrivate ) default: pDim = NULL; - pElem = VarDecl(&pDim,FALSE,FALSE); + pElem = VarDecl(&pDim,sal_False,sal_False); if( !pElem ) - bDone = TRUE; // Error occured + bDone = sal_True; // Error occured } if( pElem ) { @@ -613,8 +613,8 @@ void SbiParser::DefType( BOOL bPrivate ) for ( short i=0; iGetSize();++i ) { - INT32 ub = -1; - INT32 lb = nBase; + sal_Int32 ub = -1; + sal_Int32 lb = nBase; SbiExprNode* pNode = pDim->Get(i)->GetExprNode(); ub = pNode->GetNumber(); if ( !pDim->Get( i )->IsBased() ) // each dim is low/up @@ -633,7 +633,7 @@ void SbiParser::DefType( BOOL bPrivate ) } else pArray->unoAddDim( 0, -1 ); // variant array - USHORT nSavFlags = pTypeElem->GetFlags(); + sal_uInt16 nSavFlags = pTypeElem->GetFlags(); // need to reset the FIXED flag // when calling PutObject ( because the type will not match Object ) pTypeElem->ResetFlag( SBX_FIXED ); @@ -643,7 +643,7 @@ void SbiParser::DefType( BOOL bPrivate ) // Nested user type? if( eElemType == SbxOBJECT ) { - USHORT nElemTypeId = pElem->GetTypeId(); + sal_uInt16 nElemTypeId = pElem->GetTypeId(); if( nElemTypeId != 0 ) { String aTypeName( aGblStrings.Find( nElemTypeId ) ); @@ -673,10 +673,10 @@ void SbiParser::DefType( BOOL bPrivate ) void SbiParser::Enum() { - DefEnum( FALSE ); + DefEnum( sal_False ); } -void SbiParser::DefEnum( BOOL bPrivate ) +void SbiParser::DefEnum( sal_Bool bPrivate ) { // Neues Token lesen, es muss ein Symbol sein if (!TestSymbol()) @@ -695,7 +695,7 @@ void SbiParser::DefEnum( BOOL bPrivate ) SbiSymDef* pElem; SbiDimList* pDim; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // Starting with -1 to make first default value 0 after ++ sal_Int32 nCurrentEnumValue = -1; @@ -705,7 +705,7 @@ void SbiParser::DefEnum( BOOL bPrivate ) { case ENDENUM : pElem = NULL; - bDone = TRUE; + bDone = sal_True; Next(); break; @@ -718,20 +718,20 @@ void SbiParser::DefEnum( BOOL bPrivate ) default: { // TODO: Check existing! - BOOL bDefined = FALSE; + sal_Bool bDefined = sal_False; pDim = NULL; - pElem = VarDecl( &pDim, FALSE, TRUE ); + pElem = VarDecl( &pDim, sal_False, sal_True ); if( !pElem ) { - bDone = TRUE; // Error occured + bDone = sal_True; // Error occured break; } else if( pDim ) { delete pDim; Error( SbERR_SYNTAX ); - bDone = TRUE; // Error occured + bDone = sal_True; // Error occured break; } @@ -761,7 +761,7 @@ void SbiParser::DefEnum( BOOL bPrivate ) if( pOld ) { Error( SbERR_VAR_DEFINED, pElem->GetName() ); - bDone = TRUE; // Error occured + bDone = sal_True; // Error occured break; } @@ -772,13 +772,13 @@ void SbiParser::DefEnum( BOOL bPrivate ) SbiOpcode eOp = _GLOBAL; aGen.BackChain( nGblChain ); nGblChain = 0; - bGblDefs = bNewGblDefs = TRUE; + bGblDefs = bNewGblDefs = sal_True; aGen.Gen( eOp, pElem->GetId(), - sal::static_int_cast< UINT16 >( pElem->GetType() ) ); + sal::static_int_cast< sal_uInt16 >( pElem->GetType() ) ); aVar.Gen(); - USHORT nStringId = aGen.GetParser()->aGblStrings.Add( nCurrentEnumValue, SbxLONG ); + sal_uInt16 nStringId = aGen.GetParser()->aGblStrings.Add( nCurrentEnumValue, SbxLONG ); aGen.Gen( _NUMBER, nStringId ); aGen.Gen( _PUTC ); } @@ -809,10 +809,10 @@ void SbiParser::DefEnum( BOOL bPrivate ) // das erste Token ist bereits eingelesen (SUB/FUNCTION) // xxx Name [LIB "name"[ALIAS "name"]][(Parameter)][AS TYPE] -SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) +SbiProcDef* SbiParser::ProcDecl( sal_Bool bDecl ) { - BOOL bFunc = BOOL( eCurTok == FUNCTION ); - BOOL bProp = BOOL( eCurTok == GET || eCurTok == SET || eCurTok == LET ); + sal_Bool bFunc = sal_Bool( eCurTok == FUNCTION ); + sal_Bool bProp = sal_Bool( eCurTok == GET || eCurTok == SET || eCurTok == LET ); if( !TestSymbol() ) return NULL; String aName( aSym ); SbxDataType eType = eScanType; @@ -847,7 +847,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) Error( SbERR_UNEXPECTED, ALIAS ); if( pDef->IsCdecl() ) Error( SbERR_UNEXPECTED, _CDECL_ ); - pDef->SetCdecl( FALSE ); + pDef->SetCdecl( sal_False ); pDef->GetLib().Erase(); pDef->GetAlias().Erase(); } @@ -858,7 +858,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) Error( SbERR_UNEXPECTED, ALIAS ); if( pDef->IsCdecl() ) Error( SbERR_UNEXPECTED, _CDECL_ ); - pDef->SetCdecl( FALSE ); + pDef->SetCdecl( sal_False ); pDef->GetAlias().Erase(); } // Klammern? @@ -869,23 +869,23 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) Next(); else for(;;) { - BOOL bByVal = FALSE; - BOOL bOptional = FALSE; - BOOL bParamArray = FALSE; + sal_Bool bByVal = sal_False; + sal_Bool bOptional = sal_False; + sal_Bool bParamArray = sal_False; while( Peek() == BYVAL || Peek() == BYREF || Peek() == _OPTIONAL_ ) { - if ( Peek() == BYVAL ) Next(), bByVal = TRUE; - else if ( Peek() == BYREF ) Next(), bByVal = FALSE; - else if ( Peek() == _OPTIONAL_ ) Next(), bOptional = TRUE; + if ( Peek() == BYVAL ) Next(), bByVal = sal_True; + else if ( Peek() == BYREF ) Next(), bByVal = sal_False; + else if ( Peek() == _OPTIONAL_ ) Next(), bOptional = sal_True; } if( bCompatible && Peek() == PARAMARRAY ) { if( bByVal || bOptional ) Error( SbERR_UNEXPECTED, PARAMARRAY ); Next(); - bParamArray = TRUE; + bParamArray = sal_True; } - SbiSymDef* pPar = VarDecl( NULL, FALSE, FALSE ); + SbiSymDef* pPar = VarDecl( NULL, sal_False, sal_False ); if( !pPar ) break; if( bByVal ) @@ -898,13 +898,13 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) SbiToken eTok = Next(); if( eTok != COMMA && eTok != RPAREN ) { - BOOL bError2 = TRUE; + sal_Bool bError2 = sal_True; if( bOptional && bCompatible && eTok == EQ ) { SbiConstExpression* pDefaultExpr = new SbiConstExpression( this ); SbxDataType eType2 = pDefaultExpr->GetType(); - USHORT nStringId; + sal_uInt16 nStringId; if( eType2 == SbxSTRING ) nStringId = aGblStrings.Add( pDefaultExpr->GetString() ); else @@ -915,7 +915,7 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) eTok = Next(); if( eTok == COMMA || eTok == RPAREN ) - bError2 = FALSE; + bError2 = sal_False; } if( bError2 ) { @@ -942,10 +942,10 @@ SbiProcDef* SbiParser::ProcDecl( BOOL bDecl ) void SbiParser::Declare() { - DefDeclare( FALSE ); + DefDeclare( sal_False ); } -void SbiParser::DefDeclare( BOOL bPrivate ) +void SbiParser::DefDeclare( sal_Bool bPrivate ) { Next(); if( eCurTok != SUB && eCurTok != FUNCTION ) @@ -954,7 +954,7 @@ void SbiParser::DefDeclare( BOOL bPrivate ) { bool bFunction = (eCurTok == FUNCTION); - SbiProcDef* pDef = ProcDecl( TRUE ); + SbiProcDef* pDef = ProcDecl( sal_True ); if( pDef ) { if( !pDef->GetLib().Len() ) @@ -987,39 +987,39 @@ void SbiParser::DefDeclare( BOOL bPrivate ) if( bNewGblDefs && nGblChain == 0 ) { nGblChain = aGen.Gen( _JUMP, 0 ); - bNewGblDefs = FALSE; + bNewGblDefs = sal_False; } - USHORT nSavLine = nLine; + sal_uInt16 nSavLine = nLine; aGen.Statement(); pDef->Define(); pDef->SetLine1( nSavLine ); pDef->SetLine2( nSavLine ); SbiSymPool& rPool = pDef->GetParams(); - USHORT nParCount = rPool.GetSize(); + sal_uInt16 nParCount = rPool.GetSize(); SbxDataType eType = pDef->GetType(); if( bFunction ) - aGen.Gen( _PARAM, 0, sal::static_int_cast< UINT16 >( eType ) ); + aGen.Gen( _PARAM, 0, sal::static_int_cast< sal_uInt16 >( eType ) ); if( nParCount > 1 ) { aGen.Gen( _ARGC ); - for( USHORT i = 1 ; i < nParCount ; ++i ) + for( sal_uInt16 i = 1 ; i < nParCount ; ++i ) { SbiSymDef* pParDef = rPool.Get( i ); SbxDataType eParType = pParDef->GetType(); - aGen.Gen( _PARAM, i, sal::static_int_cast< UINT16 >( eParType ) ); + aGen.Gen( _PARAM, i, sal::static_int_cast< sal_uInt16 >( eParType ) ); aGen.Gen( _ARGV ); - USHORT nTyp = sal::static_int_cast< USHORT >( pParDef->GetType() ); + sal_uInt16 nTyp = sal::static_int_cast< sal_uInt16 >( pParDef->GetType() ); if( pParDef->IsByVal() ) { // Reset to avoid additional byval in call to wrapper function - pParDef->SetByVal( FALSE ); + pParDef->SetByVal( sal_False ); nTyp |= 0x8000; } aGen.Gen( _ARGTYP, nTyp ); @@ -1029,12 +1029,12 @@ void SbiParser::DefDeclare( BOOL bPrivate ) aGen.Gen( _LIB, aGblStrings.Add( pDef->GetLib() ) ); SbiOpcode eOp = pDef->IsCdecl() ? _CALLC : _CALL; - USHORT nId = pDef->GetId(); + sal_uInt16 nId = pDef->GetId(); if( pDef->GetAlias().Len() ) nId = ( nId & 0x8000 ) | aGblStrings.Add( pDef->GetAlias() ); if( nParCount > 1 ) nId |= 0x8000; - aGen.Gen( eOp, nId, sal::static_int_cast< UINT16 >( eType ) ); + aGen.Gen( eOp, nId, sal::static_int_cast< sal_uInt16 >( eType ) ); if( bFunction ) aGen.Gen( _PUT ); @@ -1060,18 +1060,18 @@ void SbiParser::Call() void SbiParser::SubFunc() { - DefProc( FALSE, FALSE ); + DefProc( sal_False, sal_False ); } // Einlesen einer Prozedur -BOOL runsInSetup( void ); +sal_Bool runsInSetup( void ); -void SbiParser::DefProc( BOOL bStatic, BOOL bPrivate ) +void SbiParser::DefProc( sal_Bool bStatic, sal_Bool bPrivate ) { - USHORT l1 = nLine, l2 = nLine; - BOOL bSub = BOOL( eCurTok == SUB ); - BOOL bProperty = BOOL( eCurTok == PROPERTY ); + sal_uInt16 l1 = nLine, l2 = nLine; + sal_Bool bSub = sal_Bool( eCurTok == SUB ); + sal_Bool bProperty = sal_Bool( eCurTok == PROPERTY ); PropertyMode ePropertyMode = PROPERTY_MODE_NONE; if( bProperty ) { @@ -1087,7 +1087,7 @@ void SbiParser::DefProc( BOOL bStatic, BOOL bPrivate ) } SbiToken eExit = eCurTok; - SbiProcDef* pDef = ProcDecl( FALSE ); + SbiProcDef* pDef = ProcDecl( sal_False ); if( !pDef ) return; pDef->setPropertyMode( ePropertyMode ); @@ -1141,13 +1141,13 @@ void SbiParser::DefProc( BOOL bStatic, BOOL bPrivate ) if( bStatic ) { if ( bVBASupportOn ) - pProc->SetStatic( TRUE ); + pProc->SetStatic( sal_True ); else Error( SbERR_NOT_IMPLEMENTED ); // STATIC SUB ... } else { - pProc->SetStatic( FALSE ); + pProc->SetStatic( sal_False ); } // Normalfall: Lokale Variable->Parameter->Globale Variable pProc->GetLocals().SetParent( &pProc->GetParams() ); @@ -1172,10 +1172,10 @@ void SbiParser::DefProc( BOOL bStatic, BOOL bPrivate ) void SbiParser::Static() { - DefStatic( FALSE ); + DefStatic( sal_False ); } -void SbiParser::DefStatic( BOOL bPrivate ) +void SbiParser::DefStatic( sal_Bool bPrivate ) { switch( Peek() ) { @@ -1187,10 +1187,10 @@ void SbiParser::DefStatic( BOOL bPrivate ) if( bNewGblDefs && nGblChain == 0 ) { nGblChain = aGen.Gen( _JUMP, 0 ); - bNewGblDefs = FALSE; + bNewGblDefs = sal_False; } Next(); - DefProc( TRUE, bPrivate ); + DefProc( sal_True, bPrivate ); break; default: { if( !pProc ) @@ -1198,7 +1198,7 @@ void SbiParser::DefStatic( BOOL bPrivate ) // Pool umsetzen, damit STATIC-Deklarationen im globalen // Pool landen SbiSymPool* p = pPool; pPool = &aPublics; - DefVar( _STATIC, TRUE ); + DefVar( _STATIC, sal_True ); pPool = p; } break; } diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index 3e034af204f5..c77123493916 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -75,12 +75,12 @@ void SbiExprNode::Gen( RecursiveMode eRecMode ) case SbxINTEGER: pGen->Gen( _CONST, (short) nVal ); break; case SbxSTRING: { - USHORT nStringId = pGen->GetParser()->aGblStrings.Add( aStrVal, TRUE ); + sal_uInt16 nStringId = pGen->GetParser()->aGblStrings.Add( aStrVal, sal_True ); pGen->Gen( _SCONST, nStringId ); break; } default: { - USHORT nStringId = pGen->GetParser()->aGblStrings.Add( nVal, eType ); + sal_uInt16 nStringId = pGen->GetParser()->aGblStrings.Add( nVal, eType ); pGen->Gen( _NUMBER, nStringId ); } } @@ -174,7 +174,7 @@ void SbiExprNode::GenElement( SbiOpcode eOp ) // Das ID ist entweder die Position oder das String-ID // Falls das Bit 0x8000 gesetzt ist, hat die Variable // eine Parameterliste. - USHORT nId = ( eOp == _PARAM ) ? pDef->GetPos() : pDef->GetId(); + sal_uInt16 nId = ( eOp == _PARAM ) ? pDef->GetPos() : pDef->GetId(); // Parameterliste aufbauen if( aVar.pPar && aVar.pPar->GetSize() ) { @@ -182,7 +182,7 @@ void SbiExprNode::GenElement( SbiOpcode eOp ) aVar.pPar->Gen(); } - pGen->Gen( eOp, nId, sal::static_int_cast< UINT16 >( GetType() ) ); + pGen->Gen( eOp, nId, sal::static_int_cast< sal_uInt16 >( GetType() ) ); if( aVar.pvMorePar ) { @@ -207,7 +207,7 @@ void SbiExprList::Gen() { pParser->aGen.Gen( _ARGC ); // AB 10.1.96: Typ-Anpassung bei DECLARE - USHORT nCount = 1 /*, nParAnz = 0*/; + sal_uInt16 nCount = 1 /*, nParAnz = 0*/; // SbiSymPool* pPool = NULL; for( SbiExpression* pExpr = pFirst; pExpr; pExpr = pExpr->pNext,nCount++ ) { @@ -215,7 +215,7 @@ void SbiExprList::Gen() if( pExpr->GetName().Len() ) { // named arg - USHORT nSid = pParser->aGblStrings.Add( pExpr->GetName() ); + sal_uInt16 nSid = pParser->aGblStrings.Add( pExpr->GetName() ); pParser->aGen.Gen( _ARGN, nSid ); /* TODO: Check after Declare concept change @@ -226,7 +226,7 @@ void SbiExprList::Gen() pParser->Error( SbERR_NO_NAMED_ARGS ); // Spaeter, wenn Named Args bei DECLARE moeglich - //for( USHORT i = 1 ; i < nParAnz ; i++ ) + //for( sal_uInt16 i = 1 ; i < nParAnz ; i++ ) //{ // SbiSymDef* pDef = pPool->Get( i ); // const String& rName = pDef->GetName(); @@ -260,7 +260,7 @@ void SbiExpression::Gen( RecursiveMode eRecMode ) pParser->aGen.Gen( _BYVAL ); if( bBased ) { - USHORT uBase = pParser->nBase; + sal_uInt16 uBase = pParser->nBase; if( pParser->IsCompatible() ) uBase |= 0x8000; // #109275 Flag compatiblity pParser->aGen.Gen( _BASED, uBase ); diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index d47c86f86ea8..f516513d7589 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -53,7 +53,7 @@ SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, SbiToken t, SbiExprNode* nVal = 0; eType = SbxVARIANT; // Nodes sind immer Variant eNodeType = SbxNODE; - bComposite= TRUE; + bComposite= sal_True; } SbiExprNode::SbiExprNode( SbiParser* p, double n, SbxDataType t ) @@ -86,11 +86,11 @@ SbiExprNode::SbiExprNode( SbiParser* p, const SbiSymDef& r, SbxDataType t, SbiEx aVar.pNext= NULL; // Funktionsergebnisse sind nie starr - bComposite= BOOL( aVar.pDef->GetProcDef() != NULL ); + bComposite= sal_Bool( aVar.pDef->GetProcDef() != NULL ); } // #120061 TypeOf -SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, USHORT nId ) +SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, sal_uInt16 nId ) { BaseInit( p ); @@ -101,7 +101,7 @@ SbiExprNode::SbiExprNode( SbiParser* p, SbiExprNode* l, USHORT nId ) } // new -SbiExprNode::SbiExprNode( SbiParser* p, USHORT nId ) +SbiExprNode::SbiExprNode( SbiParser* p, sal_uInt16 nId ) { BaseInit( p ); @@ -118,8 +118,8 @@ void SbiExprNode::BaseInit( SbiParser* p ) pLeft = NULL; pRight = NULL; pWithParent = NULL; - bComposite = FALSE; - bError = FALSE; + bComposite = sal_False; + bError = sal_False; } SbiExprNode::~SbiExprNode() @@ -174,7 +174,7 @@ SbiExprNode* SbiExprNode::GetRealNode() // Diese Methode setzt den Typ um, falls er in den Integer-Bereich hineinpasst -BOOL SbiExprNode::IsIntConst() +sal_Bool SbiExprNode::IsIntConst() { if( eNodeType == SbxNUMVAL ) { @@ -185,29 +185,29 @@ BOOL SbiExprNode::IsIntConst() { nVal = (double) (short) nVal; eType = SbxINTEGER; - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } -BOOL SbiExprNode::IsNumber() +sal_Bool SbiExprNode::IsNumber() { - return BOOL( eNodeType == SbxNUMVAL ); + return sal_Bool( eNodeType == SbxNUMVAL ); } -BOOL SbiExprNode::IsString() +sal_Bool SbiExprNode::IsString() { - return BOOL( eNodeType == SbxSTRVAL ); + return sal_Bool( eNodeType == SbxSTRVAL ); } -BOOL SbiExprNode::IsVariable() +sal_Bool SbiExprNode::IsVariable() { - return BOOL( eNodeType == SbxVARVAL ); + return sal_Bool( eNodeType == SbxVARVAL ); } -BOOL SbiExprNode::IsLvalue() +sal_Bool SbiExprNode::IsLvalue() { return IsVariable(); } @@ -256,7 +256,7 @@ void SbiExprNode::CollectBits() } } -// Kann ein Zweig umgeformt werden, wird TRUE zurueckgeliefert. In diesem +// Kann ein Zweig umgeformt werden, wird sal_True zurueckgeliefert. In diesem // Fall ist das Ergebnis im linken Zweig. void SbiExprNode::FoldConstants() @@ -283,7 +283,7 @@ void SbiExprNode::FoldConstants() String rr( pRight->GetString() ); delete pLeft; pLeft = NULL; delete pRight; pRight = NULL; - bComposite = FALSE; + bComposite = sal_False; if( eTok == PLUS || eTok == CAT ) { eTok = CAT; @@ -320,7 +320,7 @@ void SbiExprNode::FoldConstants() break; default: pGen->GetParser()->Error( SbERR_CONVERSION ); - bError = TRUE; + bError = sal_True; } } } @@ -334,50 +334,50 @@ void SbiExprNode::FoldConstants() || eTok == IDIV || eTok == MOD ) { // Integer-Operationen - BOOL err = FALSE; - if( nl > SbxMAXLNG ) err = TRUE, nl = SbxMAXLNG; + sal_Bool err = sal_False; + if( nl > SbxMAXLNG ) err = sal_True, nl = SbxMAXLNG; else - if( nl < SbxMINLNG ) err = TRUE, nl = SbxMINLNG; - if( nr > SbxMAXLNG ) err = TRUE, nr = SbxMAXLNG; + if( nl < SbxMINLNG ) err = sal_True, nl = SbxMINLNG; + if( nr > SbxMAXLNG ) err = sal_True, nr = SbxMAXLNG; else - if( nr < SbxMINLNG ) err = TRUE, nr = SbxMINLNG; + if( nr < SbxMINLNG ) err = sal_True, nr = SbxMINLNG; ll = (long) nl; lr = (long) nr; llMod = (long) (nl < 0 ? nl - 0.5 : nl + 0.5); lrMod = (long) (nr < 0 ? nr - 0.5 : nr + 0.5); if( err ) { pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); - bError = TRUE; + bError = sal_True; } } - BOOL bBothInt = BOOL( pLeft->eType < SbxSINGLE + sal_Bool bBothInt = sal_Bool( pLeft->eType < SbxSINGLE && pRight->eType < SbxSINGLE ); delete pLeft; pLeft = NULL; delete pRight; pRight = NULL; nVal = 0; eType = SbxDOUBLE; eNodeType = SbxNUMVAL; - bComposite = FALSE; - BOOL bCheckType = FALSE; + bComposite = sal_False; + sal_Bool bCheckType = sal_False; switch( eTok ) { case EXPON: nVal = pow( nl, nr ); break; case MUL: - bCheckType = TRUE; + bCheckType = sal_True; nVal = nl * nr; break; case DIV: if( !nr ) { pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; - bError = TRUE; + bError = sal_True; } else nVal = nl / nr; break; case PLUS: - bCheckType = TRUE; + bCheckType = sal_True; nVal = nl + nr; break; case MINUS: - bCheckType = TRUE; + bCheckType = sal_True; nVal = nl - nr; break; case EQ: nVal = ( nl == nr ) ? SbxTRUE : SbxFALSE; @@ -401,14 +401,14 @@ void SbiExprNode::FoldConstants() if( !lr ) { pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; - bError = TRUE; + bError = sal_True; } else nVal = ll / lr; eType = SbxLONG; break; case MOD: if( !lr ) { pGen->GetParser()->Error( SbERR_ZERODIV ); nVal = HUGE_VAL; - bError = TRUE; + bError = sal_True; } else nVal = llMod % lrMod; eType = SbxLONG; break; case AND: @@ -448,21 +448,21 @@ void SbiExprNode::FoldConstants() pLeft = NULL; eType = SbxDOUBLE; eNodeType = SbxNUMVAL; - bComposite = FALSE; + bComposite = sal_False; switch( eTok ) { case NEG: nVal = -nVal; break; case NOT: { // Integer-Operation! - BOOL err = FALSE; - if( nVal > SbxMAXLNG ) err = TRUE, nVal = SbxMAXLNG; + sal_Bool err = sal_False; + if( nVal > SbxMAXLNG ) err = sal_True, nVal = SbxMAXLNG; else - if( nVal < SbxMINLNG ) err = TRUE, nVal = SbxMINLNG; + if( nVal < SbxMINLNG ) err = sal_True, nVal = SbxMINLNG; if( err ) { pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); - bError = TRUE; + bError = sal_True; } nVal = (double) ~((long) nVal); eType = SbxLONG; diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 69f9ea553529..42b4bfa06aaf 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -42,7 +42,7 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, SbiExprMode eMode, const KeywordSymbolInfo* pKeywordSymbolInfo ) { pParser = p; - bError = bByVal = bBased = bBracket = FALSE; + bError = bByVal = bBased = bBracket = sal_False; nParenLevel = 0; eCurExpr = t; m_eMode = eMode; @@ -61,7 +61,7 @@ SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t ) pParser = p; eCurExpr = SbOPERAND; pNext = NULL; - bError = bByVal = bBased = bBracket = FALSE; + bError = bByVal = bBased = bBracket = sal_False; pExpr = new SbiExprNode( pParser, n, t ); pExpr->Optimize(); } @@ -70,7 +70,7 @@ SbiExpression::SbiExpression( SbiParser* p, const String& r ) { pParser = p; pNext = NULL; - bError = bByVal = bBased = bBracket = FALSE; + bError = bByVal = bBased = bBracket = sal_False; eCurExpr = SbOPERAND; pExpr = new SbiExprNode( pParser, r ); } @@ -79,7 +79,7 @@ SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprList* pPa { pParser = p; pNext = NULL; - bError = bByVal = bBased = bBracket = FALSE; + bError = bByVal = bBased = bBracket = sal_False; eCurExpr = SbOPERAND; pExpr = new SbiExprNode( pParser, r, SbxVARIANT, pPar ); } @@ -88,7 +88,7 @@ SbiExpression::SbiExpression( SbiParser* p, SbiToken t ) { pParser = p; pNext = NULL; - bError = bByVal = bBased = bBracket = FALSE; + bError = bByVal = bBased = bBracket = sal_False; eCurExpr = SbOPERAND; pExpr = new SbiExprNode( pParser, NULL, t, NULL ); } @@ -107,17 +107,17 @@ SbiExpression::~SbiExpression() // Folgen Parameter ohne Klammer? Dies kann eine Zahl, ein String, // ein Symbol oder auch ein Komma sein (wenn der 1. Parameter fehlt) -static BOOL DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) +static sal_Bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) { if( eTok == LPAREN ) - return TRUE; + return sal_True; // Aber nur, wenn CALL-aehnlich! if( !p->WhiteSpace() || eCurExpr != SbSYMBOL ) - return FALSE; + return sal_False; if ( eTok == NUMBER || eTok == MINUS || eTok == FIXSTRING || eTok == SYMBOL || eTok == COMMA || eTok == DOT || eTok == NOT || eTok == BYVAL ) { - return TRUE; + return sal_True; } else // check for default params with reserved names ( e.g. names of tokens ) { @@ -125,9 +125,9 @@ static BOOL DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTo // Urk the Next() / Peek() symantics are... weird tokens.Next(); if ( tokens.Peek() == ASSIGN ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // Definition eines neuen Symbols @@ -138,7 +138,7 @@ static SbiSymDef* AddSym { SbiSymDef* pDef; // A= ist keine Prozedur - BOOL bHasType = BOOL( eTok == EQ || eTok == DOT ); + sal_Bool bHasType = sal_Bool( eTok == EQ || eTok == DOT ); if( ( !bHasType && eCurExpr == SbSYMBOL ) || pPar ) { // Dies ist also eine Prozedur @@ -151,14 +151,14 @@ static SbiSymDef* AddSym // Sonderbehandlung fuer Colls wie Documents(1) if( eCurExpr == SbSTDEXPR ) - bHasType = TRUE; + bHasType = sal_True; pDef = pProc; pDef->SetType( bHasType ? eType : SbxEMPTY ); if( pPar ) { // Dummy-Parameter generieren - USHORT n = 1; + sal_uInt16 n = 1; for( short i = 0; i < pPar->GetSize(); i++ ) { String aPar = String::CreateFromAscii( "PAR" ); @@ -232,7 +232,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) else { pParser->Error( SbERR_SYNTAX ); - bError = TRUE; + bError = sal_True; } } @@ -259,18 +259,18 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) // Es koennte ein Objektteil sein, wenn . oder ! folgt // Bei . muss aber die Variable bereits definiert sein; wenn pDef // nach der Suche NULL ist, isses ein Objekt! - BOOL bObj = BOOL( ( eTok == DOT || eTok == EXCLAM ) + sal_Bool bObj = sal_Bool( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); if( bObj ) { - bBracket = FALSE; // Now the bracket for the first term is obsolete + bBracket = sal_False; // Now the bracket for the first term is obsolete if( eType == SbxVARIANT ) eType = SbxOBJECT; else { // Name%. geht wirklich nicht! pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = TRUE; + bError = sal_True; } } // Suche: @@ -330,7 +330,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) { // Wie? Erst mit AS definieren und dann einen Suffix nehmen? pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = TRUE; + bError = sal_True; } else if ( eType == SbxVARIANT ) // Falls nix angegeben, den Typ des Eintrags nehmen @@ -355,13 +355,13 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) else { pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = TRUE; + bError = sal_True; } } } SbiExprNode* pNd = new SbiExprNode( pParser, *pDef, eType ); if( !pPar ) - pPar = new SbiParameters( pParser,FALSE,FALSE ); + pPar = new SbiParameters( pParser,sal_False,sal_False ); pNd->aVar.pPar = pPar; pNd->aVar.pvMorePar = pvMoreParLcl; if( bObj ) @@ -374,7 +374,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) if( pDef->GetType() != SbxOBJECT && pDef->GetType() != SbxVARIANT ) { pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = TRUE; + bError = sal_True; } if( !bError ) pNd->aVar.pNext = ObjTerm( *pDef ); @@ -399,14 +399,14 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) eTok != XOR && eTok != EQV && eTok != IMP && eTok != IS ) { pParser->Error( SbERR_VAR_EXPECTED ); - bError = TRUE; + bError = sal_True; } } /* #118410 Allow type for Class methods and RTL object, e.g. RTL.Chr$(97) else { if( pParser->GetType() != SbxVARIANT ) - pParser->Error( SbERR_SYNTAX ), bError = TRUE; + pParser->Error( SbERR_SYNTAX ), bError = sal_True; } */ if( bError ) @@ -437,7 +437,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) } } - BOOL bObj = BOOL( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); + sal_Bool bObj = sal_Bool( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); if( bObj ) { if( eType == SbxVARIANT ) @@ -446,7 +446,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) { // Name%. geht wirklich nicht! pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = TRUE; + bError = sal_True; } } @@ -477,7 +477,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) if( pDef->GetType() != SbxOBJECT ) { pParser->Error( SbERR_BAD_DECLARATION, aSym ); - bError = TRUE; + bError = sal_True; } if( !bError ) { @@ -554,7 +554,7 @@ SbiExprNode* SbiExpression::Operand( bool bUsedForTypeOf ) } } nParenLevel--; - pRes->bComposite = TRUE; + pRes->bComposite = sal_True; break; default: // Zur Zeit sind Keywords hier OK! @@ -604,7 +604,7 @@ SbiExprNode* SbiExpression::Unary() pParser->TestToken( IS ); String aDummy; SbiSymDef* pTypeDef = new SbiSymDef( aDummy ); - pParser->TypeDecl( *pTypeDef, TRUE ); + pParser->TypeDecl( *pTypeDef, sal_True ); pNd = new SbiExprNode( pParser, pObjNode, pTypeDef->GetTypeId() ); break; } @@ -613,7 +613,7 @@ SbiExprNode* SbiExpression::Unary() pParser->Next(); String aStr; SbiSymDef* pTypeDef = new SbiSymDef( aStr ); - pParser->TypeDecl( *pTypeDef, TRUE ); + pParser->TypeDecl( *pTypeDef, sal_True ); pNd = new SbiExprNode( pParser, pTypeDef->GetTypeId() ); break; } @@ -766,7 +766,7 @@ SbiExprNode* SbiExpression::Like() if( nCount > 1 ) { pParser->Error( SbERR_SYNTAX ); - bError = TRUE; + bError = sal_True; } } return pNd; @@ -816,28 +816,28 @@ SbiConstExpression::SbiConstExpression( SbiParser* p ) : SbiExpression( p ) } else { - // #40204 Spezialbehandlung fuer BOOL-Konstanten - BOOL bIsBool = FALSE; + // #40204 Spezialbehandlung fuer sal_Bool-Konstanten + sal_Bool bIsBool = sal_False; if( pExpr->eNodeType == SbxVARVAL ) { SbiSymDef* pVarDef = pExpr->GetVar(); - // Ist es eine BOOL-Konstante? - BOOL bBoolVal = FALSE; + // Ist es eine sal_Bool-Konstante? + sal_Bool bBoolVal = sal_False; if( pVarDef->GetName().EqualsIgnoreCaseAscii( "true" ) ) //if( pVarDef->GetName().ICompare( "true" ) == COMPARE_EQUAL ) { - bIsBool = TRUE; - bBoolVal = TRUE; + bIsBool = sal_True; + bBoolVal = sal_True; } else if( pVarDef->GetName().EqualsIgnoreCaseAscii( "false" ) ) //else if( pVarDef->GetName().ICompare( "false" ) == COMPARE_EQUAL ) { - bIsBool = TRUE; - bBoolVal = FALSE; + bIsBool = sal_True; + bBoolVal = sal_False; } - // Wenn es ein BOOL ist, Node austauschen + // Wenn es ein sal_Bool ist, Node austauschen if( bIsBool ) { delete pExpr; @@ -889,7 +889,7 @@ SbiExprList::SbiExprList( SbiParser* p ) nExpr = nDim = 0; bError = - bBracket = FALSE; + bBracket = sal_False; } SbiExprList::~SbiExprList() @@ -937,8 +937,8 @@ void SbiExprList::addExpression( SbiExpression* pExpr ) // #i79918/#i80532: bConst has never been set to true // -> reused as bStandaloneExpression -//SbiParameters::SbiParameters( SbiParser* p, BOOL bConst, BOOL bPar) : -SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPar) : +//SbiParameters::SbiParameters( SbiParser* p, sal_Bool bConst, sal_Bool bPar) : +SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_Bool bPar) : SbiExprList( p ) { if( !bPar ) @@ -958,7 +958,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa } else { - bBracket = TRUE; + bBracket = sal_True; pParser->Next(); eTok = pParser->Peek(); } @@ -982,7 +982,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa { pExpr = new SbiExpression( pParser, 0, SbxEMPTY ); //if( bConst ) - // pParser->Error( SbERR_SYNTAX ), bError = TRUE; + // pParser->Error( SbERR_SYNTAX ), bError = sal_True; } // Benannte Argumente: entweder .name= oder name:= else @@ -998,25 +998,25 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa if( bAssumeExprLParenMode ) { pExpr = new SbiExpression( pParser, SbSTDEXPR, EXPRMODE_LPAREN_PENDING ); - bAssumeExprLParenMode = FALSE; + bAssumeExprLParenMode = sal_False; SbiExprMode eModeAfter = pExpr->m_eMode; if( eModeAfter == EXPRMODE_LPAREN_NOT_NEEDED ) { - bBracket = TRUE; + bBracket = sal_True; } else if( eModeAfter == EXPRMODE_ARRAY_OR_OBJECT ) { // Expression "looks" like an array assignment // a(...)[(...)] = ? or a(...).b(...) // RPAREN is already parsed - bBracket = TRUE; + bBracket = sal_True; bAssumeArrayMode = true; eTok = NIL; } else if( eModeAfter == EXPRMODE_EMPTY_PAREN ) { - bBracket = TRUE; + bBracket = sal_True; delete pExpr; if( bByVal ) pParser->Error( SbERR_LVALUE_EXPECTED ); @@ -1042,7 +1042,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa pParser->Next(); pExpr = new SbiExpression( pParser ); //if( bConst ) - // pParser->Error( SbERR_SYNTAX ), bError = TRUE; + // pParser->Error( SbERR_SYNTAX ), bError = sal_True; } pExpr->GetName() = aName; } @@ -1067,7 +1067,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa pParser->Error( bBracket ? SbERR_BAD_BRACKETS : SbERR_EXPECTED, COMMA ); - bError = TRUE; + bError = sal_True; } else { @@ -1085,7 +1085,7 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa if( !bBracket ) { pParser->Error( SbERR_BAD_BRACKETS ); - bError = TRUE; + bError = sal_True; } } nDim = nExpr; @@ -1104,12 +1104,12 @@ SbiParameters::SbiParameters( SbiParser* p, BOOL bStandaloneExpression, BOOL bPa SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) { - bConst = TRUE; + bConst = sal_True; if( pParser->Next() != LPAREN ) { pParser->Error( SbERR_EXPECTED, LPAREN ); - bError = TRUE; return; + bError = sal_True; return; } if( pParser->Peek() != RPAREN ) diff --git a/basic/source/comp/io.cxx b/basic/source/comp/io.cxx index b211ea0b7b08..958b34ee57ff 100644 --- a/basic/source/comp/io.cxx +++ b/basic/source/comp/io.cxx @@ -35,9 +35,9 @@ // Test, ob ein I/O-Channel angegeben wurde -BOOL SbiParser::Channel( BOOL bAlways ) +sal_Bool SbiParser::Channel( sal_Bool bAlways ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; Peek(); if( IsHash() ) { @@ -46,7 +46,7 @@ BOOL SbiParser::Channel( BOOL bAlways ) Next(); aExpr.Gen(); aGen.Gen( _CHANNEL ); - bRes = TRUE; + bRes = sal_True; } else if( bAlways ) Error( SbERR_EXPECTED, "#" ); @@ -60,7 +60,7 @@ BOOL SbiParser::Channel( BOOL bAlways ) void SbiParser::Print() { - BOOL bChan = Channel(); + sal_Bool bChan = Channel(); // Die Ausdruecke zum Drucken: while( !bAbort ) { @@ -91,7 +91,7 @@ void SbiParser::Print() void SbiParser::Write() { - BOOL bChan = Channel(); + sal_Bool bChan = Channel(); // Die Ausdruecke zum Drucken: while( !bAbort ) { @@ -143,8 +143,8 @@ void SbiParser::Line() void SbiParser::LineInput() { - Channel( TRUE ); - // BOOL bChan = Channel( TRUE ); + Channel( sal_True ); + // sal_Bool bChan = Channel( sal_True ); SbiExpression* pExpr = new SbiExpression( this, SbOPERAND ); /* AB 15.1.96: Keinen allgemeinen Ausdruck mehr zulassen SbiExpression* pExpr = new SbiExpression( this ); @@ -180,8 +180,8 @@ void SbiParser::LineInput() void SbiParser::Input() { aGen.Gen( _RESTART ); - Channel( TRUE ); - // BOOL bChan = Channel( TRUE ); + Channel( sal_True ); + // sal_Bool bChan = Channel( sal_True ); SbiExpression* pExpr = new SbiExpression( this, SbOPERAND ); /* ALT: Jetzt keinen allgemeinen Ausdruck mehr zulassen SbiExpression* pExpr = new SbiExpression( this ); diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index bd4540a8ffde..02feb685c11f 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -34,7 +34,7 @@ void SbiParser::If() { - UINT32 nEndLbl; + sal_uInt32 nEndLbl; SbiToken eTok = NIL; // Ende-Tokens ignorieren: SbiExpression aCond( this ); @@ -46,8 +46,8 @@ void SbiParser::If() // eingefuegt werden, damit bei ELSEIF nicht erneut die Bedingung // ausgewertet wird. Die Tabelle nimmt alle Absprungstellen auf. #define JMP_TABLE_SIZE 100 - UINT32 pnJmpToEndLbl[JMP_TABLE_SIZE]; // 100 ELSEIFs zulaessig - USHORT iJmp = 0; // aktueller Tabellen-Index + sal_uInt32 pnJmpToEndLbl[JMP_TABLE_SIZE]; // 100 ELSEIFs zulaessig + sal_uInt16 iJmp = 0; // aktueller Tabellen-Index // multiline IF nEndLbl = aGen.Gen( _JUMPF, 0 ); @@ -58,7 +58,7 @@ void SbiParser::If() eTok = Peek(); if( IsEof() ) { - Error( SbERR_BAD_BLOCK, IF ); bAbort = TRUE; return; + Error( SbERR_BAD_BLOCK, IF ); bAbort = sal_True; return; } } // ELSEIF? @@ -67,7 +67,7 @@ void SbiParser::If() // #27720# Bei erfolgreichem IF/ELSEIF auf ENDIF springen if( iJmp >= JMP_TABLE_SIZE ) { - Error( SbERR_PROG_TOO_LARGE ); bAbort = TRUE; return; + Error( SbERR_PROG_TOO_LARGE ); bAbort = sal_True; return; } pnJmpToEndLbl[iJmp++] = aGen.Gen( _JUMP, 0 ); @@ -87,14 +87,14 @@ void SbiParser::If() eTok = Peek(); if( IsEof() ) { - Error( SbERR_BAD_BLOCK, ELSEIF ); bAbort = TRUE; return; + Error( SbERR_BAD_BLOCK, ELSEIF ); bAbort = sal_True; return; } } } if( eTok == ELSE ) { Next(); - UINT32 nElseLbl = nEndLbl; + sal_uInt32 nElseLbl = nEndLbl; nEndLbl = aGen.Gen( _JUMP, 0 ); aGen.BackChain( nElseLbl ); @@ -114,7 +114,7 @@ void SbiParser::If() else { // single line IF - bSingleLineIf = TRUE; + bSingleLineIf = sal_True; nEndLbl = aGen.Gen( _JUMPF, 0 ); Push( eCurTok ); while( !bAbort ) @@ -127,7 +127,7 @@ void SbiParser::If() if( eTok == ELSE ) { Next(); - UINT32 nElseLbl = nEndLbl; + sal_uInt32 nElseLbl = nEndLbl; nEndLbl = aGen.Gen( _JUMP, 0 ); aGen.BackChain( nElseLbl ); while( !bAbort ) @@ -138,7 +138,7 @@ void SbiParser::If() break; } } - bSingleLineIf = FALSE; + bSingleLineIf = sal_False; } aGen.BackChain( nEndLbl ); } @@ -156,7 +156,7 @@ void SbiParser::NoIf() void SbiParser::DoLoop() { - UINT32 nStartLbl = aGen.GetPC(); + sal_uInt32 nStartLbl = aGen.GetPC(); OpenBlock( DO ); SbiToken eTok = Next(); if( IsEoln( eTok ) ) @@ -183,7 +183,7 @@ void SbiParser::DoLoop() SbiExpression aCond( this ); aCond.Gen(); } - UINT32 nEndLbl = aGen.Gen( eTok == UNTIL ? _JUMPT : _JUMPF, 0 ); + sal_uInt32 nEndLbl = aGen.Gen( eTok == UNTIL ? _JUMPT : _JUMPF, 0 ); StmntBlock( LOOP ); TestEoln(); aGen.Gen( _JUMP, nStartLbl ); @@ -197,9 +197,9 @@ void SbiParser::DoLoop() void SbiParser::While() { SbiExpression aCond( this ); - UINT32 nStartLbl = aGen.GetPC(); + sal_uInt32 nStartLbl = aGen.GetPC(); aCond.Gen(); - UINT32 nEndLbl = aGen.Gen( _JUMPF, 0 ); + sal_uInt32 nEndLbl = aGen.Gen( _JUMPF, 0 ); StmntBlock( WEND ); aGen.Gen( _JUMP, nStartLbl ); aGen.BackChain( nEndLbl ); @@ -248,9 +248,9 @@ void SbiParser::For() aGen.Gen( _INITFOR ); } - UINT32 nLoop = aGen.GetPC(); + sal_uInt32 nLoop = aGen.GetPC(); // Test durchfuehren, evtl. Stack freigeben - UINT32 nEndTarget = aGen.Gen( _TESTFOR, 0 ); + sal_uInt32 nEndTarget = aGen.Gen( _TESTFOR, 0 ); OpenBlock( FOR ); StmntBlock( NEXT ); aGen.Gen( _NEXT ); @@ -305,7 +305,7 @@ void SbiParser::OnGoto() { SbiExpression aCond( this ); aCond.Gen(); - UINT32 nLabelsTarget = aGen.Gen( _ONJUMP, 0 ); + sal_uInt32 nLabelsTarget = aGen.Gen( _ONJUMP, 0 ); SbiToken eTok = Next(); if( eTok != GOTO && eTok != GOSUB ) { @@ -313,14 +313,14 @@ void SbiParser::OnGoto() eTok = GOTO; } // Label-Tabelle einlesen: - UINT32 nLbl = 0; + sal_uInt32 nLbl = 0; do { SbiToken eTok2 = NIL; eTok2 = Next(); // Label holen if( MayBeLabel() ) { - UINT32 nOff = pProc->GetLabels().Reference( aSym ); + sal_uInt32 nOff = pProc->GetLabels().Reference( aSym ); aGen.Gen( _JUMP, nOff ); nLbl++; } @@ -340,7 +340,7 @@ void SbiParser::Goto() Next(); if( MayBeLabel() ) { - UINT32 nOff = pProc->GetLabels().Reference( aSym ); + sal_uInt32 nOff = pProc->GetLabels().Reference( aSym ); aGen.Gen( eOp, nOff ); } else Error( SbERR_LABEL_EXPECTED ); @@ -353,7 +353,7 @@ void SbiParser::Return() Next(); if( MayBeLabel() ) { - UINT32 nOff = pProc->GetLabels().Reference( aSym ); + sal_uInt32 nOff = pProc->GetLabels().Reference( aSym ); aGen.Gen( _RETURN, nOff ); } else aGen.Gen( _RETURN, 0 ); @@ -369,9 +369,9 @@ void SbiParser::Select() aCase.Gen(); aGen.Gen( _CASE ); TestEoln(); - UINT32 nNextTarget = 0; - UINT32 nDoneTarget = 0; - BOOL bElse = FALSE; + sal_uInt32 nNextTarget = 0; + sal_uInt32 nDoneTarget = 0; + sal_Bool bElse = sal_False; // Die Cases einlesen: while( !bAbort ) { @@ -382,13 +382,13 @@ void SbiParser::Select() aGen.BackChain( nNextTarget ), nNextTarget = 0; aGen.Statement(); // Jeden Case einlesen - BOOL bDone = FALSE; - UINT32 nTrueTarget = 0; + sal_Bool bDone = sal_False; + sal_uInt32 nTrueTarget = 0; if( Peek() == ELSE ) { // CASE ELSE Next(); - bElse = TRUE; + bElse = sal_True; } else while( !bDone ) { @@ -407,7 +407,7 @@ void SbiParser::Select() aCompare.Gen(); nTrueTarget = aGen.Gen( _CASEIS, nTrueTarget, - sal::static_int_cast< UINT16 >( + sal::static_int_cast< sal_uInt16 >( SbxEQ + ( eTok2 - EQ ) ) ); } else @@ -428,7 +428,7 @@ void SbiParser::Select() } if( Peek() == COMMA ) Next(); - else TestEoln(), bDone = TRUE; + else TestEoln(), bDone = sal_True; } // Alle Cases abgearbeitet if( !bElse ) @@ -493,7 +493,7 @@ void SbiParser::On() aGen.Gen( _STDERROR ); else { - UINT32 nOff = pProc->GetLabels().Reference( aSym ); + sal_uInt32 nOff = pProc->GetLabels().Reference( aSym ); aGen.Gen( _ERRHDL, nOff ); } } @@ -525,7 +525,7 @@ void SbiParser::On() void SbiParser::Resume() { - UINT32 nLbl; + sal_uInt32 nLbl; switch( Next() ) { diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 3d7178ae7688..670ca7384767 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -35,18 +35,18 @@ struct SbiParseStack { // "Stack" fuer Statement-Blocks SbiParseStack* pNext; // Chain SbiExprNode* pWithVar; // Variable fuer WITH SbiToken eExitTok; // Exit-Token - UINT32 nChain; // JUMP-Chain + sal_uInt32 nChain; // JUMP-Chain }; struct SbiStatement { SbiToken eTok; void( SbiParser::*Func )(); // Verarbeitungsroutine - BOOL bMain; // TRUE: ausserhalb SUBs OK - BOOL bSubr; // TRUE: in SUBs OK + sal_Bool bMain; // sal_True: ausserhalb SUBs OK + sal_Bool bSubr; // sal_True: in SUBs OK }; -#define Y TRUE -#define N FALSE +#define Y sal_True +#define N sal_False static SbiStatement StmntTable [] = { { CALL, &SbiParser::Call, N, Y, }, // CALL @@ -141,7 +141,7 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm ) bGblDefs = bNewGblDefs = bSingleLineIf = - bExplicit = FALSE; + bExplicit = sal_False; bClassModule = ( pm->GetModuleType() == com::sun::star::script::ModuleType::CLASS ); OSL_TRACE("Parser - %s, bClassModule %d", rtl::OUStringToOString( pm->GetName(), RTL_TEXTENCODING_UTF8 ).getStr(), bClassModule ); pPool = &aPublics; @@ -187,7 +187,7 @@ SbiSymDef* SbiParser::CheckRTLForSym( const String& rSym, SbxDataType eType ) // Globale Chainkette schliessen -BOOL SbiParser::HasGlobalCode() +sal_Bool SbiParser::HasGlobalCode() { if( bGblDefs && nGblChain ) { @@ -252,49 +252,49 @@ void SbiParser::Exit() Error( SbERR_BAD_EXIT ); } -BOOL SbiParser::TestSymbol( BOOL bKwdOk ) +sal_Bool SbiParser::TestSymbol( sal_Bool bKwdOk ) { Peek(); if( eCurTok == SYMBOL || ( bKwdOk && IsKwd( eCurTok ) ) ) { - Next(); return TRUE; + Next(); return sal_True; } Error( SbERR_SYMBOL_EXPECTED ); - return FALSE; + return sal_False; } // Testen auf ein bestimmtes Token -BOOL SbiParser::TestToken( SbiToken t ) +sal_Bool SbiParser::TestToken( SbiToken t ) { if( Peek() == t ) { - Next(); return TRUE; + Next(); return sal_True; } else { Error( SbERR_EXPECTED, t ); - return FALSE; + return sal_False; } } // Testen auf Komma oder EOLN -BOOL SbiParser::TestComma() +sal_Bool SbiParser::TestComma() { SbiToken eTok = Peek(); if( IsEoln( eTok ) ) { Next(); - return FALSE; + return sal_False; } else if( eTok != COMMA ) { Error( SbERR_EXPECTED, COMMA ); - return FALSE; + return sal_False; } Next(); - return TRUE; + return sal_True; } // Testen, ob EOLN vorliegt @@ -320,16 +320,16 @@ void SbiParser::StmntBlock( SbiToken eEnd ) if( IsEof() ) { Error( SbERR_BAD_BLOCK, eEnd ); - bAbort = TRUE; + bAbort = sal_True; } } // Die Hauptroutine. Durch wiederholten Aufrufs dieser Routine wird -// die Quelle geparst. Returnwert FALSE bei Ende/Fehlern. +// die Quelle geparst. Returnwert sal_False bei Ende/Fehlern. -BOOL SbiParser::Parse() +sal_Bool SbiParser::Parse() { - if( bAbort ) return FALSE; + if( bAbort ) return sal_False; EnableErrors(); @@ -345,16 +345,16 @@ BOOL SbiParser::Parse() // ein nGblChain vorhanden sein, daher vorher abfragen if( bNewGblDefs && nGblChain == 0 ) nGblChain = aGen.Gen( _JUMP, 0 ); - return FALSE; + return sal_False; } // Leerstatement? if( IsEoln( eCurTok ) ) { - Next(); return TRUE; + Next(); return sal_True; } - if( !bSingleLineIf && MayBeLabel( TRUE ) ) + if( !bSingleLineIf && MayBeLabel( sal_True ) ) { // Ist ein Label if( !pProc ) @@ -365,7 +365,7 @@ BOOL SbiParser::Parse() // Leerstatement? if( IsEoln( eCurTok ) ) { - Next(); return TRUE; + Next(); return sal_True; } } @@ -378,13 +378,13 @@ BOOL SbiParser::Parse() Next(); if( eCurTok != NIL ) aGen.Statement(); - return FALSE; + return sal_False; } // Kommentar? if( eCurTok == REM ) { - Next(); return TRUE; + Next(); return sal_True; } // Kommt ein Symbol, ist es entweder eine Variable( LET ) @@ -428,7 +428,7 @@ BOOL SbiParser::Parse() ( eCurTok == SUB || eCurTok == FUNCTION || eCurTok == PROPERTY ) ) { nGblChain = aGen.Gen( _JUMP, 0 ); - bNewGblDefs = FALSE; + bNewGblDefs = sal_False; } // Statement-Opcode bitte auch am Anfang einer Sub if( ( p->bSubr && (eCurTok != STATIC || Peek() == SUB || Peek() == FUNCTION ) ) || @@ -459,7 +459,7 @@ BOOL SbiParser::Parse() } // Der Parser bricht am Ende ab, das naechste Token ist noch nicht // geholt! - return TRUE; + return sal_True; } // Innerste With-Variable liefern @@ -564,7 +564,7 @@ void SbiParser::Assign() SbiExpression aExpr( this ); aLvalue.Gen(); aExpr.Gen(); - USHORT nLen = 0; + sal_uInt16 nLen = 0; SbiSymDef* pDef = aLvalue.GetRealVar(); { if( pDef->GetConstDef() ) @@ -595,7 +595,7 @@ void SbiParser::Set() Next(); String aStr; SbiSymDef* pTypeDef = new SbiSymDef( aStr ); - TypeDecl( *pTypeDef, TRUE ); + TypeDecl( *pTypeDef, sal_True ); aLvalue.Gen(); // aGen.Gen( _CLASS, pDef->GetTypeId() | 0x8000 ); @@ -747,7 +747,7 @@ void SbiParser::EnableCompatibility() { if( !bCompatible ) AddConstants(); - bCompatible = TRUE; + bCompatible = sal_True; } // OPTION @@ -757,7 +757,7 @@ void SbiParser::Option() switch( Next() ) { case EXPLICIT: - bExplicit = TRUE; break; + bExplicit = sal_True; break; case BASE: if( Next() == NUMBER ) { @@ -780,9 +780,9 @@ void SbiParser::Option() { SbiToken eTok = Next(); if( eTok == BINARY ) - bText = FALSE; + bText = sal_False; else if( eTok == SYMBOL && GetSym().EqualsIgnoreCaseAscii("text") ) - bText = TRUE; + bText = sal_True; else Error( SbERR_EXPECTED, "Text/Binary" ); break; @@ -792,7 +792,7 @@ void SbiParser::Option() break; case CLASSMODULE: - bClassModule = TRUE; + bClassModule = sal_True; aGen.GetModule().SetModuleType( com::sun::star::script::ModuleType::CLASS ); break; case VBASUPPORT: diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index c8fe782487e3..12e368d1c7eb 100755 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -271,7 +271,7 @@ String lcl_dumpMethodParameters( SbMethod* pMethod ) { aStr += '('; // 0 is sub itself - for ( USHORT nParam = 1; nParam < pParams->Count(); nParam++ ) + for ( sal_uInt16 nParam = 1; nParam < pParams->Count(); nParam++ ) { SbxVariable* pVar = pParams->Get( nParam ); DBG_ASSERT( pVar, "Parameter?!" ); @@ -324,9 +324,9 @@ void dbg_DeInitTrace( void ) GbTraceOn = GbSavTraceOn; } -static INT32 GnLastCallLvl = 0; +static sal_Int32 GnLastCallLvl = 0; -void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl ) +void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl ) { if( !GbTraceOn ) return; @@ -383,7 +383,7 @@ void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl ) lcl_lineOut( GpTraceFileName, rStr_PCode.getStr(), lcl_getSpaces( nIndent ) ); } -void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave ) +void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallLvl, bool bLeave ) { static const char* pSeparator = "' ================================================================================"; @@ -448,7 +448,7 @@ void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, lcl_lineOut( GpTraceFileName, "" ); } -void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl ) +void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, sal_Int32 nCallLvl ) { if( !GbTraceOn ) return; @@ -463,7 +463,7 @@ void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool b lcl_lineOut( GpTraceFileName, Buffer, lcl_getSpaces( nIndent ) ); } -void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC, +void dbg_RegisterTraceTextForPC( SbModule* pModule, sal_uInt32 nPC, const String& aTraceStr_STMNT, const String& aTraceStr_PCode ) { String aModuleName = pModule->GetName(); @@ -490,7 +490,7 @@ void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC, (*pInnerMap)[nPC] = aData; } -void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) { (void)pBasic; (void)bWrite; @@ -621,13 +621,13 @@ void dbg_SaveDisassembly( SbModule* pModule ) // Diese Routine ist hier definiert, damit der Compiler als eigenes Segment // geladen werden kann. -BOOL SbModule::Compile() +sal_Bool SbModule::Compile() { if( pImage ) - return TRUE; + return sal_True; StarBASIC* pBasic = PTR_CAST(StarBASIC,GetParent()); if( !pBasic ) - return FALSE; + return sal_False; SbxBase::ResetError(); // Aktuelles Modul! SbModule* pOld = pCMOD; @@ -646,14 +646,14 @@ BOOL SbModule::Compile() // Beim Compilieren eines Moduls werden die Modul-globalen // Variablen aller Module ungueltig - BOOL bRet = IsCompiled(); + sal_Bool bRet = IsCompiled(); if( bRet ) { if( !this->ISA(SbObjModule) ) pBasic->ClearAllModuleVars(); RemoveVars(); // remove 'this' Modules variables // clear all method statics - for( USHORT i = 0; i < pMethods->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMethods->Count(); i++ ) { SbMethod* p = PTR_CAST(SbMethod,pMethods->Get( i ) ); if( p ) diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 26c6af53cc56..e518779b78d5 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -66,9 +66,9 @@ SbiScanner::SbiScanner( const ::rtl::OUString& rBuf, StarBASIC* p ) : aBuf( rBuf bUsedForHilite = bCompatible = bVBASupportOn = - bPrevLineExtentsComment = FALSE; + bPrevLineExtentsComment = sal_False; bHash = - bErrors = TRUE; + bErrors = sal_True; } SbiScanner::~SbiScanner() @@ -90,19 +90,19 @@ void SbiScanner::GenError( SbError code ) { if( GetSbData()->bBlockCompilerError ) { - bAbort = TRUE; + bAbort = sal_True; return; } if( !bError && bErrors ) { - BOOL bRes = TRUE; + sal_Bool bRes = sal_True; // Nur einen Fehler pro Statement reporten - bError = TRUE; + bError = sal_True; if( pBasic ) { // Falls EXPECTED oder UNEXPECTED kommen sollte, bezieht es sich // immer auf das letzte Token, also die Col1 uebernehmen - USHORT nc = nColLock ? nSavedCol1 : nCol1; + sal_uInt16 nc = nColLock ? nSavedCol1 : nCol1; switch( code ) { case SbERR_EXPECTED: @@ -122,16 +122,16 @@ void SbiScanner::GenError( SbError code ) nErrors++; } -// Falls sofort ein Doppelpunkt folgt, wird TRUE zurueckgeliefert. +// Falls sofort ein Doppelpunkt folgt, wird sal_True zurueckgeliefert. // Wird von SbiTokenizer::MayBeLabel() verwendet, um einen Label zu erkennen -BOOL SbiScanner::DoesColonFollow() +sal_Bool SbiScanner::DoesColonFollow() { if( pLine && *pLine == ':' ) { - pLine++; nCol++; return TRUE; + pLine++; nCol++; return sal_True; } - else return FALSE; + else return sal_False; } // Testen auf ein legales Suffix @@ -143,36 +143,36 @@ static SbxDataType GetSuffixType( sal_Unicode c ) { sal_uInt32 n = aSuffixesStr.Search( c ); if( STRING_NOTFOUND != n && c != ' ' ) - return SbxDataType( (USHORT) n + SbxINTEGER ); + return SbxDataType( (sal_uInt16) n + SbxINTEGER ); } return SbxVARIANT; } // Einlesen des naechsten Symbols in die Variablen aSym, nVal und eType -// Returnwert ist FALSE bei EOF oder Fehlern +// Returnwert ist sal_False bei EOF oder Fehlern #define BUF_SIZE 80 -BOOL SbiScanner::NextSym() +sal_Bool SbiScanner::NextSym() { // Fuer den EOLN-Fall merken - USHORT nOldLine = nLine; - USHORT nOldCol1 = nCol1; - USHORT nOldCol2 = nCol2; + sal_uInt16 nOldLine = nLine; + sal_uInt16 nOldCol1 = nCol1; + sal_uInt16 nOldCol2 = nCol2; sal_Unicode buf[ BUF_SIZE ], *p = buf; - bHash = FALSE; + bHash = sal_False; eScanType = SbxVARIANT; aSym.Erase(); bSymbol = - bNumber = bSpaces = FALSE; + bNumber = bSpaces = sal_False; // Zeile einlesen? if( !pLine ) { - INT32 n = nBufPos; - INT32 nLen = aBuf.getLength(); + sal_Int32 n = nBufPos; + sal_Int32 nLen = aBuf.getLength(); if( nBufPos >= nLen ) - return FALSE; + return sal_False; const sal_Unicode* p2 = aBuf.getStr(); p2 += n; while( ( n < nLen ) && ( *p2 != '\n' ) && ( *p2 != '\r' ) ) @@ -194,7 +194,7 @@ BOOL SbiScanner::NextSym() // Leerstellen weg: while( *pLine && (( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' )) ) - pLine++, nCol++, bSpaces = TRUE; + pLine++, nCol++, bSpaces = sal_True; nCol1 = nCol; @@ -209,7 +209,7 @@ BOOL SbiScanner::NextSym() { pLine++; nCol++; - bHash = TRUE; + bHash = sal_True; } // Symbol? Dann Zeichen kopieren. @@ -219,7 +219,7 @@ BOOL SbiScanner::NextSym() if( *pLine == '_' && !*(pLine+1) ) { pLine++; goto eoln; } - bSymbol = TRUE; + bSymbol = sal_True; short n = nCol; for ( ; (BasicSimpleCharClass::isAlphaNumeric( *pLine, bCompatible ) || ( *pLine == '_' ) ); pLine++ ) nCol++; @@ -279,13 +279,13 @@ BOOL SbiScanner::NextSym() short ndig = 0; short ncdig = 0; eScanType = SbxDOUBLE; - BOOL bBufOverflow = FALSE; + sal_Bool bBufOverflow = sal_False; while( strchr( "0123456789.DEde", *pLine ) && *pLine ) { // AB 4.1.1996: Buffer voll? -> leer weiter scannen if( (p-buf) == (BUF_SIZE-1) ) { - bBufOverflow = TRUE; + bBufOverflow = sal_True; pLine++, nCol++; continue; } @@ -322,7 +322,7 @@ BOOL SbiScanner::NextSym() if (!exp) ndig++; } *p = 0; - aSym = p; bNumber = TRUE; + aSym = p; bNumber = sal_True; // Komma, Exponent mehrfach vorhanden? if( comma > 1 || exp > 1 ) { aError = '.'; @@ -382,10 +382,10 @@ BOOL SbiScanner::NextSym() // Wird als Operator angesehen pLine--; nCol--; nCol1 = nCol-1; aSym = '&'; return SYMBOL; } - bNumber = TRUE; + bNumber = sal_True; long l = 0; int i; - BOOL bBufOverflow = FALSE; + sal_Bool bBufOverflow = sal_False; while( BasicSimpleCharClass::isAlphaNumeric( *pLine & 0xFF, bCompatible ) ) { sal_Unicode ch = sal::static_int_cast< sal_Unicode >( @@ -393,7 +393,7 @@ BOOL SbiScanner::NextSym() pLine++; nCol++; // AB 4.1.1996: Buffer voll, leer weiter scannen if( (p-buf) == (BUF_SIZE-1) ) - bBufOverflow = TRUE; + bBufOverflow = sal_True; else if( String( cmp ).Search( ch ) != STRING_NOTFOUND ) //else if( strchr( cmp, ch ) ) *p++ = ch; @@ -426,7 +426,7 @@ BOOL SbiScanner::NextSym() { sal_Unicode cSep = *pLine; if( cSep == '[' ) - bSymbol = TRUE, cSep = ']'; + bSymbol = sal_True, cSep = ']'; short n = nCol+1; while( *pLine ) { @@ -446,7 +446,7 @@ BOOL SbiScanner::NextSym() // Doppelte Stringbegrenzer raus String s( cSep ); s += cSep; - USHORT nIdx = 0; + sal_uInt16 nIdx = 0; do { nIdx = aSym.Search( s, nIdx ); @@ -485,15 +485,15 @@ PrevLineCommentLbl: if( bPrevLineExtentsComment || (eScanType != SbxSTRING && ( aSym.GetBuffer()[0] == '\'' || aSym.EqualsIgnoreCaseAscii( "REM" ) ) ) ) { - bPrevLineExtentsComment = FALSE; + bPrevLineExtentsComment = sal_False; aSym = String::CreateFromAscii( "REM" ); - USHORT nLen = String( pLine ).Len(); + sal_uInt16 nLen = String( pLine ).Len(); if( bCompatible && pLine[ nLen - 1 ] == '_' && pLine[ nLen - 2 ] == ' ' ) - bPrevLineExtentsComment = TRUE; + bPrevLineExtentsComment = sal_True; nCol2 = nCol2 + nLen; pLine = NULL; } - return TRUE; + return sal_True; // Sonst Zeilen-Ende: aber bitte auf '_' testen, ob die // Zeile nicht weitergeht! @@ -508,7 +508,7 @@ eoln: // .Method // ^^^ <- spaces is legal in MSO VBA OSL_TRACE("*** resetting bSpaces***"); - bSpaces = FALSE; + bSpaces = sal_False; } return bRes; } @@ -520,7 +520,7 @@ eoln: nCol2 = nOldCol2; aSym = '\n'; nColLock = 0; - return TRUE; + return sal_True; } } diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 9df91a5748b9..2688b5be28cf 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -58,7 +58,7 @@ SbiStringPool::~SbiStringPool() // Suchen -const String& SbiStringPool::Find( USHORT n ) const +const String& SbiStringPool::Find( sal_uInt16 n ) const { if( !n || n > aData.Count() ) return aEmpty; @@ -69,10 +69,10 @@ const String& SbiStringPool::Find( USHORT n ) const // Hinzufuegen eines Strings. Der String wird Case-Insensitiv // verglichen. -short SbiStringPool::Add( const String& rVal, BOOL bNoCase ) +short SbiStringPool::Add( const String& rVal, sal_Bool bNoCase ) { - USHORT n = aData.Count(); - for( USHORT i = 0; i < n; i++ ) + sal_uInt16 n = aData.Count(); + for( sal_uInt16 i = 0; i < n; i++ ) { String* p = aData.GetObject( i ); if( ( bNoCase && p->Equals( rVal ) ) @@ -125,7 +125,7 @@ void SbiSymPool::Clear() SbiSymDef* SbiSymPool::First() { - nCur = (USHORT) -1; + nCur = (sal_uInt16) -1; return Next(); } @@ -206,8 +206,8 @@ void SbiSymPool::Add( SbiSymDef* pDef ) SbiSymDef* SbiSymPool::Find( const String& rName ) const { - USHORT nCount = aData.Count(); - for( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = aData.Count(); + for( sal_uInt16 i = 0; i < nCount; i++ ) { SbiSymDef* p = aData.GetObject( nCount - i - 1 ); if( ( !p->nProcId || ( p->nProcId == nProcId ) ) @@ -222,9 +222,9 @@ SbiSymDef* SbiSymPool::Find( const String& rName ) const // Suchen ueber ID-Nummer -SbiSymDef* SbiSymPool::FindId( USHORT n ) const +SbiSymDef* SbiSymPool::FindId( sal_uInt16 n ) const { - for( USHORT i = 0; i < aData.Count(); i++ ) + for( sal_uInt16 i = 0; i < aData.Count(); i++ ) { SbiSymDef* p = aData.GetObject( i ); if( p->nId == n && ( !p->nProcId || ( p->nProcId == nProcId ) ) ) @@ -238,7 +238,7 @@ SbiSymDef* SbiSymPool::FindId( USHORT n ) const // Suchen ueber Position (ab 0) -SbiSymDef* SbiSymPool::Get( USHORT n ) const +SbiSymDef* SbiSymPool::Get( sal_uInt16 n ) const { if( n >= aData.Count() ) return NULL; @@ -246,7 +246,7 @@ SbiSymDef* SbiSymPool::Get( USHORT n ) const return aData.GetObject( n ); } -UINT32 SbiSymPool::Define( const String& rName ) +sal_uInt32 SbiSymPool::Define( const String& rName ) { SbiSymDef* p = Find( rName ); if( p ) @@ -258,7 +258,7 @@ UINT32 SbiSymPool::Define( const String& rName ) return p->Define(); } -UINT32 SbiSymPool::Reference( const String& rName ) +sal_uInt32 SbiSymPool::Reference( const String& rName ) { SbiSymDef* p = Find( rName ); if( !p ) @@ -272,7 +272,7 @@ UINT32 SbiSymPool::Reference( const String& rName ) void SbiSymPool::CheckRefs() { - for( USHORT i = 0; i < aData.Count(); i++ ) + for( sal_uInt16 i = 0; i < aData.Count(); i++ ) { SbiSymDef* p = aData.GetObject( i ); if( !p->IsDefined() ) @@ -304,7 +304,7 @@ SbiSymDef::SbiSymDef( const String& rName ) : aName( rName ) bWithEvents = bByVal = bChained = - bGlobal = FALSE; + bGlobal = sal_False; pIn = pPool = NULL; nDefaultId = 0; @@ -360,11 +360,11 @@ void SbiSymDef::SetType( SbxDataType t ) // Es wird der Wert zurueckgeliefert, der als Operand gespeichert // werden soll. -UINT32 SbiSymDef::Reference() +sal_uInt32 SbiSymDef::Reference() { if( !bChained ) { - UINT32 n = nChain; + sal_uInt32 n = nChain; nChain = pIn->pParser->aGen.GetOffset(); return n; } @@ -374,13 +374,13 @@ UINT32 SbiSymDef::Reference() // Definition eines Symbols. // Hier wird der Backchain aufgeloest, falls vorhanden -UINT32 SbiSymDef::Define() +sal_uInt32 SbiSymDef::Define() { - UINT32 n = pIn->pParser->aGen.GetPC(); + sal_uInt32 n = pIn->pParser->aGen.GetPC(); pIn->pParser->aGen.GenStmnt(); if( nChain ) pIn->pParser->aGen.BackChain( nChain ); nChain = n; - bChained = TRUE; + bChained = sal_True; return nChain; } @@ -409,7 +409,7 @@ SbiSymScope SbiSymDef::GetScope() const // 3) aLabels: Labels SbiProcDef::SbiProcDef( SbiParser* pParser, const String& rName, - BOOL bProcDecl ) + sal_Bool bProcDecl ) : SbiSymDef( rName ) , aParams( pParser->aGblStrings, SbPARAM ) // wird gedumpt , aLabels( pParser->aLclStrings, SbLOCAL ) // wird nicht gedumpt @@ -421,9 +421,9 @@ SbiProcDef::SbiProcDef( SbiParser* pParser, const String& rName, nLine1 = nLine2 = 0; mePropMode = PROPERTY_MODE_NONE; - bPublic = TRUE; - bCdecl = FALSE; - bStatic = FALSE; + bPublic = sal_True; + bCdecl = sal_False; + bStatic = sal_False; // Fuer Returnwerte ist das erste Element der Parameterliste // immer mit dem Namen und dem Typ der Proc definiert aParams.AddSym( aName ); @@ -451,7 +451,7 @@ void SbiProcDef::Match( SbiProcDef* pOld ) { SbiSymDef* po, *pn=NULL; // Parameter 0 ist der Funktionsname - USHORT i; + sal_uInt16 i; for( i = 1; i < aParams.GetSize(); i++ ) { po = pOld->aParams.Get( i ); diff --git a/basic/source/comp/token.cxx b/basic/source/comp/token.cxx index 8cb3126f03f1..8700ae4129ba 100644 --- a/basic/source/comp/token.cxx +++ b/basic/source/comp/token.cxx @@ -386,10 +386,10 @@ SbiTokenizer::SbiTokenizer( const ::rtl::OUString& rSrc, StarBASIC* pb ) //if( StarBASIC::GetGlobalLanguageMode() == SB_LANG_JAVASCRIPT ) // pTokTable = aTokTable_Java; TokenTable *tp; - bEof = bAs = FALSE; + bEof = bAs = sal_False; eCurTok = NIL; ePush = NIL; - bEos = bKeywords = bErrorIsSymbol = TRUE; + bEos = bKeywords = bErrorIsSymbol = sal_True; if( !nToken ) for( nToken = 0, tp = pTokTable; tp->t; nToken++, tp++ ) {} } @@ -431,9 +431,9 @@ SbiToken SbiTokenizer::Peek() { if( ePush == NIL ) { - USHORT nOldLine = nLine; - USHORT nOldCol1 = nCol1; - USHORT nOldCol2 = nCol2; + sal_uInt16 nOldLine = nLine; + sal_uInt16 nOldCol1 = nCol1; + sal_uInt16 nOldCol2 = nCol2; ePush = Next(); nPLine = nLine; nLine = nOldLine; nPCol1 = nCol1; nCol1 = nOldCol1; @@ -498,15 +498,15 @@ SbiToken SbiTokenizer::Next() // Sonst einlesen: if( !NextSym() ) { - bEof = bEos = TRUE; + bEof = bEos = sal_True; return eCurTok = EOLN; } // Zeilenende? if( aSym.GetBuffer()[0] == '\n' ) { - bEos = TRUE; return eCurTok = EOLN; + bEos = sal_True; return eCurTok = EOLN; } - bEos = FALSE; + bEos = sal_False; // Zahl? if( bNumber ) @@ -573,10 +573,10 @@ special: { // AB, 15.3.96, Spezialbehandlung fuer END, beim Peek() geht die // aktuelle Zeile verloren, daher alles merken und danach restaurieren - USHORT nOldLine = nLine; - USHORT nOldCol = nCol; - USHORT nOldCol1 = nCol1; - USHORT nOldCol2 = nCol2; + sal_uInt16 nOldLine = nLine; + sal_uInt16 nOldCol = nCol; + sal_uInt16 nOldCol1 = nCol1; + sal_uInt16 nOldCol2 = nCol2; String aOldSym = aSym; SaveLine(); // pLine im Scanner sichern @@ -612,11 +612,11 @@ special: eCurTok = tp->t; // AS: Datentypen sind Keywords if( tp->t == AS ) - bAs = TRUE; + bAs = sal_True; else { if( bAs ) - bAs = FALSE; + bAs = sal_False; else if( eCurTok >= DATATYPE1 && eCurTok <= DATATYPE2 && (bErrorIsSymbol || eCurTok != _ERROR_) ) eCurTok = SYMBOL; } @@ -653,12 +653,12 @@ special: // Kann das aktuell eingelesene Token ein Label sein? -BOOL SbiTokenizer::MayBeLabel( BOOL bNeedsColon ) +sal_Bool SbiTokenizer::MayBeLabel( sal_Bool bNeedsColon ) { if( eCurTok == SYMBOL || m_aTokenLabelInfo.canTokenBeLabel( eCurTok ) ) - return bNeedsColon ? DoesColonFollow() : TRUE; + return bNeedsColon ? DoesColonFollow() : sal_True; else - return BOOL( eCurTok == NUMBER + return sal_Bool( eCurTok == NUMBER && eScanType == SbxINTEGER && nVal >= 0 ); } @@ -670,8 +670,8 @@ BOOL SbiTokenizer::MayBeLabel( BOOL bNeedsColon ) void SbiTokenizer::Hilite( SbTextPortions& rList ) { - bErrors = FALSE; - bUsedForHilite = TRUE; + bErrors = sal_False; + bUsedForHilite = sal_True; SbiToken eLastTok = NIL; for( ;; ) { @@ -709,6 +709,6 @@ void SbiTokenizer::Hilite( SbTextPortions& rList ) break; eLastTok = eCurTok; } - bUsedForHilite = FALSE; + bUsedForHilite = sal_False; } diff --git a/basic/source/inc/buffer.hxx b/basic/source/inc/buffer.hxx index cbb1a1702354..4c14cac05791 100644 --- a/basic/source/inc/buffer.hxx +++ b/basic/source/inc/buffer.hxx @@ -37,27 +37,27 @@ class SbiBuffer { // Code/Konstanten-Puffer: SbiParser* pParser; // fuer Fehlermeldungen char* pBuf; // Puffer-Pointer char* pCur; // aktueller Puffer-Pointer - UINT32 nOff; // aktuelles Offset - UINT32 nSize; // aktuelle Groesse + sal_uInt32 nOff; // aktuelles Offset + sal_uInt32 nSize; // aktuelle Groesse short nInc; // Inkrement - BOOL Check( USHORT ); // Buffergroesse testen + sal_Bool Check( sal_uInt16 ); // Buffergroesse testen public: SbiBuffer( SbiParser*, short ); // Inkrement ~SbiBuffer(); - void Patch( UINT32, UINT32 ); // Patchen - void Chain( UINT32 ); // Back-Chain - void Align( INT32 ); // Alignment - BOOL Add( const void*, USHORT );// Element anfuegen - BOOL operator += (const String&);// Basic-String speichern - BOOL operator += (INT8); // Zeichen speichern - BOOL operator += (INT16); // Integer speichern - BOOL operator += (UINT8); // Zeichen speichern - BOOL operator += (UINT16); // Integer speichern - BOOL operator += (UINT32); // Integer speichern - BOOL operator += (INT32); // Integer speichern + void Patch( sal_uInt32, sal_uInt32 ); // Patchen + void Chain( sal_uInt32 ); // Back-Chain + void Align( sal_Int32 ); // Alignment + sal_Bool Add( const void*, sal_uInt16 );// Element anfuegen + sal_Bool operator += (const String&);// Basic-String speichern + sal_Bool operator += (sal_Int8); // Zeichen speichern + sal_Bool operator += (sal_Int16); // Integer speichern + sal_Bool operator += (sal_uInt8); // Zeichen speichern + sal_Bool operator += (sal_uInt16); // Integer speichern + sal_Bool operator += (sal_uInt32); // Integer speichern + sal_Bool operator += (sal_Int32); // Integer speichern char* GetBuffer(); // Puffer rausgeben (selbst loeschen!) char* GetBufferPtr(){ return pBuf; } - UINT32 GetSize() { return nOff; } + sal_uInt32 GetSize() { return nOff; } }; #endif diff --git a/basic/source/inc/codegen.hxx b/basic/source/inc/codegen.hxx index a3fe02227cfd..a496322bb6d7 100644 --- a/basic/source/inc/codegen.hxx +++ b/basic/source/inc/codegen.hxx @@ -40,28 +40,28 @@ class SbiCodeGen { // Code-Erzeugung: SbiBuffer aCode; // Code-Puffer short nLine, nCol; // Zeile, Spalte fuer Stmnt-Befehl short nForLevel; // #29955 for-Schleifen-Ebene - BOOL bStmnt; // TRUE: Statement-Opcode liegt an + sal_Bool bStmnt; // sal_True: Statement-Opcode liegt an public: SbiCodeGen( SbModule&, SbiParser*, short ); SbiParser* GetParser() { return pParser; } SbModule& GetModule() { return rMod; } - UINT32 Gen( SbiOpcode ); - UINT32 Gen( SbiOpcode, UINT32 ); - UINT32 Gen( SbiOpcode, UINT32, UINT32 ); - void Patch( UINT32 o, UINT32 v ){ aCode.Patch( o, v ); } - void BackChain( UINT32 off ) { aCode.Chain( off ); } + sal_uInt32 Gen( SbiOpcode ); + sal_uInt32 Gen( SbiOpcode, sal_uInt32 ); + sal_uInt32 Gen( SbiOpcode, sal_uInt32, sal_uInt32 ); + void Patch( sal_uInt32 o, sal_uInt32 v ){ aCode.Patch( o, v ); } + void BackChain( sal_uInt32 off ) { aCode.Chain( off ); } void Statement(); void GenStmnt(); // evtl. Statement-Opcode erzeugen - UINT32 GetPC(); - UINT32 GetOffset() { return GetPC() + 1; } + sal_uInt32 GetPC(); + sal_uInt32 GetOffset() { return GetPC() + 1; } void Save(); // #29955 for-Schleifen-Ebene pflegen void IncForLevel( void ) { nForLevel++; } void DecForLevel( void ) { nForLevel--; } - static UINT32 calcNewOffSet( BYTE* pCode, UINT16 nOffset ); - static UINT16 calcLegacyOffSet( BYTE* pCode, UINT32 nOffset ); + static sal_uInt32 calcNewOffSet( sal_uInt8* pCode, sal_uInt16 nOffset ); + static sal_uInt16 calcLegacyOffSet( sal_uInt8* pCode, sal_uInt32 nOffset ); }; @@ -69,8 +69,8 @@ template < class T, class S > class PCodeBuffConvertor { T m_nSize; // - BYTE* m_pStart; - BYTE* m_pCnvtdBuf; + sal_uInt8* m_pStart; + sal_uInt8* m_pCnvtdBuf; S m_nCnvtdSize; // // Disable usual copying symantics and bodgy default ctor @@ -78,11 +78,11 @@ class PCodeBuffConvertor PCodeBuffConvertor(const PCodeBuffConvertor& ); PCodeBuffConvertor& operator = ( const PCodeBuffConvertor& ); public: - PCodeBuffConvertor( BYTE* pCode, T nSize ): m_nSize( nSize ), m_pStart( pCode ), m_pCnvtdBuf( NULL ), m_nCnvtdSize( 0 ){ convert(); } + PCodeBuffConvertor( sal_uInt8* pCode, T nSize ): m_nSize( nSize ), m_pStart( pCode ), m_pCnvtdBuf( NULL ), m_nCnvtdSize( 0 ){ convert(); } S GetSize(){ return m_nCnvtdSize; } void convert(); // Caller owns the buffer returned - BYTE* GetBuffer() { return m_pCnvtdBuf; } + sal_uInt8* GetBuffer() { return m_pCnvtdBuf; } }; // #111897 PARAM_INFO flags start at 0x00010000 to not diff --git a/basic/source/inc/disas.hxx b/basic/source/inc/disas.hxx index 328a085e6c29..2d85dc5d1365 100644 --- a/basic/source/inc/disas.hxx +++ b/basic/source/inc/disas.hxx @@ -37,14 +37,14 @@ class SbiDisas { const SbiImage& rImg; SbModule* pMod; char cLabels[ MAX_LABELS ]; // Bitvektor fuer Labels - UINT32 nOff; // aktuelle Position - UINT32 nPC; // Position des Opcodes + sal_uInt32 nOff; // aktuelle Position + sal_uInt32 nPC; // Position des Opcodes SbiOpcode eOp; // Opcode - UINT32 nOp1, nOp2; // Operanden - UINT32 nParts; // 1, 2 oder 3 - UINT32 nLine; // aktuelle Zeile - BOOL DisasLine( String& ); - BOOL Fetch(); // naechster Opcode + sal_uInt32 nOp1, nOp2; // Operanden + sal_uInt32 nParts; // 1, 2 oder 3 + sal_uInt32 nLine; // aktuelle Zeile + sal_Bool DisasLine( String& ); + sal_Bool Fetch(); // naechster Opcode public: SbiDisas( SbModule*, const SbiImage* ); void Disas( SvStream& ); diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 3795321f0578..28a84094d918 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -98,7 +98,7 @@ class SbiExprNode { // Operatoren (und Operanden) friend class SbiExpression; friend class SbiConstExpression; union { - USHORT nTypeStrId; // gepoolter String-ID, #i59791/#i45570 Now only for TypeOf + sal_uInt16 nTypeStrId; // gepoolter String-ID, #i59791/#i45570 Now only for TypeOf double nVal; // numerischer Wert SbVar aVar; // oder Variable }; @@ -110,19 +110,19 @@ class SbiExprNode { // Operatoren (und Operanden) SbiNodeType eNodeType; // Art des Nodes SbxDataType eType; // aktueller Datentyp SbiToken eTok; // Token des Operators - BOOL bComposite; // TRUE: Zusammengesetzter Ausdruck - BOOL bError; // TRUE: Fehlerhaft + sal_Bool bComposite; // sal_True: Zusammengesetzter Ausdruck + sal_Bool bError; // sal_True: Fehlerhaft void FoldConstants(); // Constant Folding durchfuehren void CollectBits(); // Umwandeln von Zahlen in Strings - BOOL IsOperand() // TRUE, wenn Operand - { return BOOL( eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW ); } - BOOL IsTypeOf() - { return BOOL( eNodeType == SbxTYPEOF ); } - BOOL IsNew() - { return BOOL( eNodeType == SbxNEW ); } - BOOL IsNumber(); // TRUE bei Zahlen - BOOL IsString(); // TRUE bei Strings - BOOL IsLvalue(); // TRUE, falls als Lvalue verwendbar + sal_Bool IsOperand() // sal_True, wenn Operand + { return sal_Bool( eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW ); } + sal_Bool IsTypeOf() + { return sal_Bool( eNodeType == SbxTYPEOF ); } + sal_Bool IsNew() + { return sal_Bool( eNodeType == SbxNEW ); } + sal_Bool IsNumber(); // sal_True bei Zahlen + sal_Bool IsString(); // sal_True bei Strings + sal_Bool IsLvalue(); // sal_True, falls als Lvalue verwendbar void GenElement( SbiOpcode ); // Element void BaseInit( SbiParser* p ); // Hilfsfunktion fuer Ctor, AB 17.12.95 public: @@ -131,15 +131,15 @@ public: SbiExprNode( SbiParser*, const String& ); SbiExprNode( SbiParser*, const SbiSymDef&, SbxDataType, SbiExprList* = NULL ); SbiExprNode( SbiParser*, SbiExprNode*, SbiToken, SbiExprNode* ); - SbiExprNode( SbiParser*, SbiExprNode*, USHORT ); // #120061 TypeOf - SbiExprNode( SbiParser*, USHORT ); // new + SbiExprNode( SbiParser*, SbiExprNode*, sal_uInt16 ); // #120061 TypeOf + SbiExprNode( SbiParser*, sal_uInt16 ); // new virtual ~SbiExprNode(); - BOOL IsValid() { return BOOL( !bError ); } - BOOL IsConstant() // TRUE bei konstantem Operanden - { return BOOL( eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL ); } - BOOL IsIntConst(); // TRUE bei Integer-Konstanten - BOOL IsVariable(); // TRUE, wenn Variable + sal_Bool IsValid() { return sal_Bool( !bError ); } + sal_Bool IsConstant() // sal_True bei konstantem Operanden + { return sal_Bool( eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL ); } + sal_Bool IsIntConst(); // sal_True bei Integer-Konstanten + sal_Bool IsVariable(); // sal_True, wenn Variable SbiExprNode* GetWithParent() { return pWithParent; } void SetWithParent( SbiExprNode* p ) { pWithParent = p; } @@ -172,11 +172,11 @@ protected: SbiExprNode* pExpr; // Der Expression-Baum SbiExprType eCurExpr; // Art des Ausdrucks SbiExprMode m_eMode; // Expression context - BOOL bBased; // TRUE: einfacher DIM-Teil (+BASE) - BOOL bError; // TRUE: Fehler - BOOL bByVal; // TRUE: ByVal-Parameter - BOOL bBracket; // TRUE: Parameter list with brackets - USHORT nParenLevel; + sal_Bool bBased; // sal_True: einfacher DIM-Teil (+BASE) + sal_Bool bError; // sal_True: Fehler + sal_Bool bByVal; // sal_True: ByVal-Parameter + sal_Bool bBracket; // sal_True: Parameter list with brackets + sal_uInt16 nParenLevel; SbiExprNode* Term( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); SbiExprNode* ObjTerm( SbiSymDef& ); SbiExprNode* Operand( bool bUsedForTypeOf = false ); @@ -200,16 +200,16 @@ public: SbiExpression( SbiParser*, SbiToken ); // Spezial-Expr mit Spezial-Tokens ~SbiExpression(); String& GetName() { return aArgName; } - void SetBased() { bBased = TRUE; } - BOOL IsBased() { return bBased; } - void SetByVal() { bByVal = TRUE; } - BOOL IsByVal() { return bByVal; } - BOOL IsBracket() { return bBracket; } - BOOL IsValid() { return pExpr->IsValid(); } - BOOL IsConstant() { return pExpr->IsConstant(); } - BOOL IsVariable() { return pExpr->IsVariable(); } - BOOL IsLvalue() { return pExpr->IsLvalue(); } - BOOL IsIntConstant() { return pExpr->IsIntConst(); } + void SetBased() { bBased = sal_True; } + sal_Bool IsBased() { return bBased; } + void SetByVal() { bByVal = sal_True; } + sal_Bool IsByVal() { return bByVal; } + sal_Bool IsBracket() { return bBracket; } + sal_Bool IsValid() { return pExpr->IsValid(); } + sal_Bool IsConstant() { return pExpr->IsConstant(); } + sal_Bool IsVariable() { return pExpr->IsVariable(); } + sal_Bool IsLvalue() { return pExpr->IsLvalue(); } + sal_Bool IsIntConstant() { return pExpr->IsIntConst(); } const String& GetString() { return pExpr->GetString(); } SbiSymDef* GetVar() { return pExpr->GetVar(); } SbiSymDef* GetRealVar() { return pExpr->GetRealVar(); } @@ -237,31 +237,31 @@ protected: SbiExpression* pFirst; // Expressions short nExpr; // Anzahl Expressions short nDim; // Anzahl Dimensionen - BOOL bError; // TRUE: Fehler - BOOL bBracket; // TRUE: Klammern + sal_Bool bError; // sal_True: Fehler + sal_Bool bBracket; // sal_True: Klammern public: SbiExprList( SbiParser* ); virtual ~SbiExprList(); - BOOL IsBracket() { return bBracket; } - BOOL IsValid() { return BOOL( !bError ); } + sal_Bool IsBracket() { return bBracket; } + sal_Bool IsValid() { return sal_Bool( !bError ); } short GetSize() { return nExpr; } short GetDims() { return nDim; } SbiExpression* Get( short ); - BOOL Test( const SbiProcDef& ); // Parameter-Checks + sal_Bool Test( const SbiProcDef& ); // Parameter-Checks void Gen(); // Code-Erzeugung void addExpression( SbiExpression* pExpr ); }; class SbiParameters : public SbiExprList { public: - SbiParameters( SbiParser*, BOOL bConst = FALSE, BOOL bPar = TRUE);// parsender Ctor + SbiParameters( SbiParser*, sal_Bool bConst = sal_False, sal_Bool bPar = sal_True);// parsender Ctor }; class SbiDimList : public SbiExprList { - BOOL bConst; // TRUE: Alles sind Integer-Konstanten + sal_Bool bConst; // sal_True: Alles sind Integer-Konstanten public: SbiDimList( SbiParser* ); // Parsender Ctor - BOOL IsConstant() { return bConst; } + sal_Bool IsConstant() { return bConst; } }; #endif diff --git a/basic/source/inc/filefmt.hxx b/basic/source/inc/filefmt.hxx index dccdec703dd3..2b3b3eafbf65 100644 --- a/basic/source/inc/filefmt.hxx +++ b/basic/source/inc/filefmt.hxx @@ -57,9 +57,9 @@ class SvStream; // Diese Records enthalten wiederum weitere Records. Jeder Record hat // den folgenden Header: -// UINT16 Kennung -// UINT32 Laenge des Records ohne Header -// UINT16 Anzahl Unterelemente +// sal_uInt16 Kennung +// sal_uInt32 Laenge des Records ohne Header +// sal_uInt16 Anzahl Unterelemente // Alle Datei-Offsets in Records sind relativ zum Start des Moduls! @@ -84,33 +84,33 @@ class SvStream; #endif // Ein Library Record enthaelt nur Module Records -// UINT16 Kennung BL -// UINT32 Laenge des Records -// UINT16 Anzahl Module +// sal_uInt16 Kennung BL +// sal_uInt32 Laenge des Records +// sal_uInt16 Anzahl Module // Ein Modul-Record enthaelt alle anderen Recordtypen -// UINT16 Kennung BM -// UINT32 Laenge des Records -// UINT16 1 +// sal_uInt16 Kennung BM +// sal_uInt32 Laenge des Records +// sal_uInt16 1 // Daten: -// UINT32 Versionsnummer -// UINT32 Zeichensatz -// UINT32 Startadresse Initialisierungscode -// UINT32 Startadresse Sub Main -// UINT32 Reserviert -// UINT32 Reserviert +// sal_uInt32 Versionsnummer +// sal_uInt32 Zeichensatz +// sal_uInt32 Startadresse Initialisierungscode +// sal_uInt32 Startadresse Sub Main +// sal_uInt32 Reserviert +// sal_uInt32 Reserviert // Modulname, Kommentar und Quellcode: -// UINT16 Kennung MN, MC oder SC -// UINT32 Laenge des Records -// UINT16 1 +// sal_uInt16 Kennung MN, MC oder SC +// sal_uInt32 Laenge des Records +// sal_uInt16 1 // Daten: // String-Instanz // P-Code: -// UINT16 Kennung PC -// UINT32 Laenge des Records -// UINT16 1 +// sal_uInt16 Kennung PC +// sal_uInt32 Laenge des Records +// sal_uInt16 1 // Daten: // Der P-Code als Bytesack @@ -118,61 +118,61 @@ class SvStream; // Verweise auf diese Strings sind in Form eines Indexes in diesen Pool. // Liste aller Publics: -// UINT16 Kennung PU oder Pu -// UINT32 Laenge des Records -// UINT16 Anzahl der Publics +// sal_uInt16 Kennung PU oder Pu +// sal_uInt32 Laenge des Records +// sal_uInt16 Anzahl der Publics // Daten fuer jeden Public-Eintrag: -// UINT16 String-Index -// UINT32 Startadresse im P-Code-Image (UINT16 fuer alte Publics) -// UINT16 Datentyp des Returnwertes (ab Version 2) +// sal_uInt16 String-Index +// sal_uInt32 Startadresse im P-Code-Image (sal_uInt16 fuer alte Publics) +// sal_uInt16 Datentyp des Returnwertes (ab Version 2) // Verzeichnis der Symbol-Tabellen: -// UINT16 Kennung SP -// UINT32 Laenge des Records -// UINT16 Anzahl der Symboltabellen +// sal_uInt16 Kennung SP +// sal_uInt32 Laenge des Records +// sal_uInt16 Anzahl der Symboltabellen // Daten fuer jede Symboltabelle: -// UINT16 Stringindex des Namens -// UINT16 Anzahl Symbole -// UINT16 Scope-Kennung +// sal_uInt16 Stringindex des Namens +// sal_uInt16 Anzahl Symbole +// sal_uInt16 Scope-Kennung // Symboltabelle: -// UINT16 Kennung SY -// UINT32 Laenge des Records -// UINT16 Anzahl der Symbole +// sal_uInt16 Kennung SY +// sal_uInt32 Laenge des Records +// sal_uInt16 Anzahl der Symbole // Daten: -// UINT16 Stringindex des Namens -// UINT16 Anzahl Symbole +// sal_uInt16 Stringindex des Namens +// sal_uInt16 Anzahl Symbole // Daten fuer jedes Symbol: -// UINT16 Stringindex des Namens -// UINT16 Datentyp -// UINT16 Laenge bei STRING*n-Symbolen (0x8000: STATIC-Variable) +// sal_uInt16 Stringindex des Namens +// sal_uInt16 Datentyp +// sal_uInt16 Laenge bei STRING*n-Symbolen (0x8000: STATIC-Variable) // Stringpool: -// UINT16 Kennung ST -// UINT32 Laenge des Records -// UINT16 Anzahl der Strings +// sal_uInt16 Kennung ST +// sal_uInt32 Laenge des Records +// sal_uInt16 Anzahl der Strings // Daten fuer jeden String: -// UINT32 Offset in den Block aller Strings +// sal_uInt32 Offset in den Block aller Strings // Danach folgt der Block aller Strings, die dort als ASCIIZ-Strings liegen. // Line Ranges: -// UINT16 Kennung LR -// UINT32 Laenge des Records -// UINT16 Anzahl der Strings +// sal_uInt16 Kennung LR +// sal_uInt32 Laenge des Records +// sal_uInt16 Anzahl der Strings // Daten fuer jedes Public: -// UINT16 1. Zeile (Sub XXX) -// UINT16 2. Zeile (End Sub) +// sal_uInt16 1. Zeile (Sub XXX) +// sal_uInt16 2. Zeile (End Sub) // SBX-Objekte: -// UINT16 Anzahl Objekte +// sal_uInt16 Anzahl Objekte // .... Objektdaten //////////////////////////////////////////////////////////////////////////// // Service-Routinen (in IMAGE.CXX) -BOOL SbGood( SvStream& r ); -ULONG SbOpenRecord( SvStream&, UINT16 nSignature, UINT16 nElem ); -void SbCloseRecord( SvStream&, ULONG ); +sal_Bool SbGood( SvStream& r ); +sal_uIntPtr SbOpenRecord( SvStream&, sal_uInt16 nSignature, sal_uInt16 nElem ); +void SbCloseRecord( SvStream&, sal_uIntPtr ); #endif diff --git a/basic/source/inc/image.hxx b/basic/source/inc/image.hxx index d674b91faf71..b2d863acc52b 100644 --- a/basic/source/inc/image.hxx +++ b/basic/source/inc/image.hxx @@ -44,25 +44,25 @@ class SbiImage { SbxArrayRef rTypes; // User defined types SbxArrayRef rEnums; // Enum types - UINT32* pStringOff; // StringId-Offsets + sal_uInt32* pStringOff; // StringId-Offsets sal_Unicode* pStrings; // StringPool char* pCode; // Code-Image char* pLegacyPCode; // Code-Image - BOOL bError; // TRUE: Fehler - USHORT nFlags; // Flags (s.u.) + sal_Bool bError; // sal_True: Fehler + sal_uInt16 nFlags; // Flags (s.u.) short nStrings; // Anzahl Strings - UINT32 nStringSize; // Groesse des String-Puffers - UINT32 nCodeSize; // Groesse des Code-Blocks - UINT16 nLegacyCodeSize; // Groesse des Code-Blocks - UINT16 nDimBase; // OPTION BASE-Wert + sal_uInt32 nStringSize; // Groesse des String-Puffers + sal_uInt32 nCodeSize; // Groesse des Code-Blocks + sal_uInt16 nLegacyCodeSize; // Groesse des Code-Blocks + sal_uInt16 nDimBase; // OPTION BASE-Wert rtl_TextEncoding eCharSet; // Zeichensatz fuer Strings // temporaere Verwaltungs-Variable: short nStringIdx; // aktueller String-Index - UINT32 nStringOff; // aktuelle Pos im Stringpuffer + sal_uInt32 nStringOff; // aktuelle Pos im Stringpuffer // Routinen fuer Compiler: void MakeStrings( short ); // StringPool einrichten void AddString( const String& );// String zufuegen - void AddCode( char*, UINT32 ); // Codeblock dazu + void AddCode( char*, sal_uInt32 ); // Codeblock dazu void AddType(SbxObject *); // User-Type mit aufnehmen void AddEnum(SbxObject *); // Register enum type @@ -70,35 +70,35 @@ public: String aName; // Makroname ::rtl::OUString aOUSource; // Quellcode String aComment; // Kommentar - BOOL bInit; // TRUE: Init-Code ist gelaufen - BOOL bFirstInit; // TRUE, wenn das Image das erste mal nach + sal_Bool bInit; // sal_True: Init-Code ist gelaufen + sal_Bool bFirstInit; // sal_True, wenn das Image das erste mal nach // dem Compilieren initialisiert wird. SbiImage(); ~SbiImage(); void Clear(); // Inhalt loeschen - BOOL Load( SvStream&, UINT32& nVer ); // Loads image from stream + sal_Bool Load( SvStream&, sal_uInt32& nVer ); // Loads image from stream // nVer is set to version // of image - BOOL Load( SvStream& ); - BOOL Save( SvStream&, UINT32 = B_CURVERSION ); - BOOL IsError() { return bError; } + sal_Bool Load( SvStream& ); + sal_Bool Save( SvStream&, sal_uInt32 = B_CURVERSION ); + sal_Bool IsError() { return bError; } const char* GetCode() const { return pCode; } - UINT32 GetCodeSize() const { return nCodeSize; } + sal_uInt32 GetCodeSize() const { return nCodeSize; } ::rtl::OUString& GetSource32() { return aOUSource; } - USHORT GetBase() const { return nDimBase; } + sal_uInt16 GetBase() const { return nDimBase; } String GetString( short nId ) const; //const char* GetString( short nId ) const; const SbxObject* FindType (String aTypeName) const; SbxArrayRef GetEnums() { return rEnums; } - void SetFlag( USHORT n ) { nFlags |= n; } - USHORT GetFlag( USHORT n ) const { return nFlags & n; } - UINT16 CalcLegacyOffset( INT32 nOffset ); - UINT32 CalcNewOffset( INT16 nOffset ); + void SetFlag( sal_uInt16 n ) { nFlags |= n; } + sal_uInt16 GetFlag( sal_uInt16 n ) const { return nFlags & n; } + sal_uInt16 CalcLegacyOffset( sal_Int32 nOffset ); + sal_uInt32 CalcNewOffset( sal_Int16 nOffset ); void ReleaseLegacyBuffer(); - BOOL ExceedsLegacyLimits(); + sal_Bool ExceedsLegacyLimits(); }; diff --git a/basic/source/inc/iosys.hxx b/basic/source/inc/iosys.hxx index b0ebcb0e87f0..1308e0289b9f 100644 --- a/basic/source/inc/iosys.hxx +++ b/basic/source/inc/iosys.hxx @@ -49,10 +49,10 @@ class SvStream; class SbiStream { SvStream* pStrm; // der Stream - ULONG nExpandOnWriteTo; // bei Schreibzugriff, den Stream + sal_uIntPtr nExpandOnWriteTo; // bei Schreibzugriff, den Stream // bis zu dieser Groesse aufblasen ByteString aLine; // aktuelle Zeile - ULONG nLine; // aktuelle Zeilennummer + sal_uIntPtr nLine; // aktuelle Zeilennummer short nLen; // Pufferlaenge short nMode; // Bits: short nChan; // aktueller Kanal @@ -64,9 +64,9 @@ public: ~SbiStream(); SbError Open( short, const ByteString&, short, short, short ); SbError Close(); - SbError Read( ByteString&, USHORT = 0, bool bForceReadingPerByte=false ); + SbError Read( ByteString&, sal_uInt16 = 0, bool bForceReadingPerByte=false ); SbError Read( char& ); - SbError Write( const ByteString&, USHORT = 0 ); + SbError Write( const ByteString&, sal_uInt16 = 0 ); bool IsText() const { return (nMode & SBSTRM_BINARY) == 0; } bool IsRandom() const { return (nMode & SBSTRM_RANDOM) != 0; } @@ -75,8 +75,8 @@ public: bool IsAppend() const { return (nMode & SBSTRM_APPEND) != 0; } short GetBlockLen() const { return nLen; } short GetMode() const { return nMode; } - ULONG GetLine() const { return nLine; } - void SetExpandOnWriteTo( ULONG n ) { nExpandOnWriteTo = n; } + sal_uIntPtr GetLine() const { return nLine; } + void SetExpandOnWriteTo( sal_uIntPtr n ) { nExpandOnWriteTo = n; } void ExpandFile(); SvStream* GetStrm() { return pStrm; } }; diff --git a/basic/source/inc/object.hxx b/basic/source/inc/object.hxx index 29e4f68cc133..aa39eba72ef3 100644 --- a/basic/source/inc/object.hxx +++ b/basic/source/inc/object.hxx @@ -60,7 +60,7 @@ using SbxVariable::GetInfo; public: #endif typedef void( SampleObject::*pMeth ) - ( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite ); + ( SbxVariable* pThis, SbxArray* pArgs, sal_Bool bWrite ); #if defined ( ICC ) || defined ( HPUX ) private: #endif @@ -74,10 +74,10 @@ private: static Methods aMethods[]; // Methodentabelle // Methoden - void Display( SbxVariable*, SbxArray*, BOOL ); - void Event( SbxVariable*, SbxArray*, BOOL ); - void Square( SbxVariable*, SbxArray*, BOOL ); - void Create( SbxVariable*, SbxArray*, BOOL ); + void Display( SbxVariable*, SbxArray*, sal_Bool ); + void Event( SbxVariable*, SbxArray*, sal_Bool ); + void Square( SbxVariable*, SbxArray*, sal_Bool ); + void Create( SbxVariable*, SbxArray*, sal_Bool ); // Infoblock auffuellen SbxInfo* GetInfo( short nIdx ); // Broadcaster Notification diff --git a/basic/source/inc/parser.hxx b/basic/source/inc/parser.hxx index 733a65db7f61..62f7da1b4303 100644 --- a/basic/source/inc/parser.hxx +++ b/basic/source/inc/parser.hxx @@ -46,24 +46,24 @@ class SbiParser : public SbiTokenizer SbiProcDef* pProc; // aktuelle Prozedur SbiExprNode* pWithVar; // aktuelle With-Variable SbiToken eEndTok; // das Ende-Token - UINT32 nGblChain; // Chainkette fuer globale DIMs - BOOL bGblDefs; // TRUE globale Definitionen allgemein - BOOL bNewGblDefs; // TRUE globale Definitionen vor Sub - BOOL bSingleLineIf; // TRUE einzeiliges if-Statement - - SbiSymDef* VarDecl( SbiDimList**,BOOL,BOOL );// Variablen-Deklaration - SbiProcDef* ProcDecl(BOOL bDecl);// Prozedur-Deklaration - void DefStatic( BOOL bPrivate ); - void DefProc( BOOL bStatic, BOOL bPrivate ); // Prozedur einlesen - void DefVar( SbiOpcode eOp, BOOL bStatic ); // DIM/REDIM einlesen - void TypeDecl( SbiSymDef&, BOOL bAsNewAlreadyParsed=FALSE ); // AS-Deklaration + sal_uInt32 nGblChain; // Chainkette fuer globale DIMs + sal_Bool bGblDefs; // sal_True globale Definitionen allgemein + sal_Bool bNewGblDefs; // sal_True globale Definitionen vor Sub + sal_Bool bSingleLineIf; // sal_True einzeiliges if-Statement + + SbiSymDef* VarDecl( SbiDimList**,sal_Bool,sal_Bool );// Variablen-Deklaration + SbiProcDef* ProcDecl(sal_Bool bDecl);// Prozedur-Deklaration + void DefStatic( sal_Bool bPrivate ); + void DefProc( sal_Bool bStatic, sal_Bool bPrivate ); // Prozedur einlesen + void DefVar( SbiOpcode eOp, sal_Bool bStatic ); // DIM/REDIM einlesen + void TypeDecl( SbiSymDef&, sal_Bool bAsNewAlreadyParsed=sal_False ); // AS-Deklaration void OpenBlock( SbiToken, SbiExprNode* = NULL ); // Block oeffnen void CloseBlock(); // Block aufloesen - BOOL Channel( BOOL=FALSE ); // Kanalnummer parsen + sal_Bool Channel( sal_Bool=sal_False ); // Kanalnummer parsen void StmntBlock( SbiToken ); // Statement-Block abarbeiten - void DefType( BOOL bPrivate ); // Parse type declaration - void DefEnum( BOOL bPrivate ); // Parse enum declaration - void DefDeclare( BOOL bPrivate ); + void DefType( sal_Bool bPrivate ); // Parse type declaration + void DefEnum( sal_Bool bPrivate ); // Parse enum declaration + void DefDeclare( sal_Bool bPrivate ); void EnableCompatibility(); public: SbxArrayRef rTypeArray; // das Type-Array @@ -78,26 +78,26 @@ public: SbiSymPool* pPool; // aktueller Pool SbiExprType eCurExpr; // aktueller Expr-Typ short nBase; // OPTION BASE-Wert - BOOL bText; // OPTION COMPARE TEXT - BOOL bExplicit; // TRUE: OPTION EXPLICIT - BOOL bClassModule; // TRUE: OPTION ClassModule + sal_Bool bText; // OPTION COMPARE TEXT + sal_Bool bExplicit; // sal_True: OPTION EXPLICIT + sal_Bool bClassModule; // sal_True: OPTION ClassModule StringVector aIfaceVector; // Holds all interfaces implemented by a class module StringVector aRequiredTypes; // Types used in Dim As New outside subs SbxDataType eDefTypes[26]; // DEFxxx-Datentypen SbiParser( StarBASIC*, SbModule* ); - BOOL Parse(); // die Aktion + sal_Bool Parse(); // die Aktion SbiExprNode* GetWithVar(); // Innerste With-Variable liefern // AB 31.3.1996, Symbol in Runtime-Library suchen SbiSymDef* CheckRTLForSym( const String& rSym, SbxDataType eType ); void AddConstants( void ); - BOOL HasGlobalCode(); // Globaler Code definiert? + sal_Bool HasGlobalCode(); // Globaler Code definiert? - BOOL TestToken( SbiToken ); // bestimmtes TOken? - BOOL TestSymbol( BOOL=FALSE ); // Symbol? - BOOL TestComma(); // Komma oder EOLN? + sal_Bool TestToken( SbiToken ); // bestimmtes TOken? + sal_Bool TestSymbol( sal_Bool=sal_False ); // Symbol? + sal_Bool TestComma(); // Komma oder EOLN? void TestEoln(); // EOLN? void Symbol( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); // Let oder Call diff --git a/basic/source/inc/propacc.hxx b/basic/source/inc/propacc.hxx index be396a426185..262a2cf8935d 100644 --- a/basic/source/inc/propacc.hxx +++ b/basic/source/inc/propacc.hxx @@ -65,7 +65,7 @@ class SbPropertyValues: public SbPropertyValuesHelper NS_UNO::Reference< ::com::sun::star::beans::XPropertySetInfo > _xInfo; private: - INT32 GetIndex_Impl( const ::rtl::OUString &rPropName ) const; + sal_Int32 GetIndex_Impl( const ::rtl::OUString &rPropName ) const; public: SbPropertyValues(); @@ -166,7 +166,7 @@ public: // XPropertyContainer virtual void SAL_CALL addProperty( const ::rtl::OUString& Name, - INT16 Attributes, + sal_Int16 Attributes, const NS_UNO::Any& DefaultValue) throw( NS_BEANS::PropertyExistException, NS_BEANS::IllegalTypeException, NS_LANG::IllegalArgumentException, NS_UNO::RuntimeException ); @@ -190,7 +190,7 @@ public: class StarBASIC; class SbxArray; -void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_CreatePropertySet( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); #undef NS_BEANS diff --git a/basic/source/inc/runtime.hxx b/basic/source/inc/runtime.hxx index 356e07c9e55c..46cd9d16521f 100644 --- a/basic/source/inc/runtime.hxx +++ b/basic/source/inc/runtime.hxx @@ -109,10 +109,10 @@ struct SbiForStack { // for/next stack: // For each support ForType eForType; - INT32 nCurCollectionIndex; - INT32* pArrayCurIndices; - INT32* pArrayLowerBounds; - INT32* pArrayUpperBounds; + sal_Int32 nCurCollectionIndex; + sal_Int32* pArrayCurIndices; + sal_Int32* pArrayLowerBounds; + sal_Int32* pArrayUpperBounds; Reference< XEnumeration > xEnumeration; SbiForStack( void ) @@ -130,8 +130,8 @@ struct SbiForStack { // for/next stack: struct SbiGosubStack { // GOSUB-Stack: SbiGosubStack* pNext; // Chain - const BYTE* pCode; // Return-Pointer - USHORT nStartForLvl; // #118235: For Level in moment of gosub + const sal_uInt8* pCode; // Return-Pointer + sal_uInt16 nStartForLvl; // #118235: For Level in moment of gosub }; #define MAXRECURSION 500 // max. 500 Rekursionen @@ -156,7 +156,7 @@ public: #else ::osl::Directory* pDir; #endif - INT16 nDirFlags; + sal_Int16 nDirFlags; short nCurDirPos; String sFullNameToBeChecked; @@ -198,9 +198,9 @@ class SbiInstance SbError nErr; // aktueller Fehlercode String aErrorMsg; // letzte Error-Message fuer $ARG - USHORT nErl; // aktuelle Fehlerzeile - BOOL bReschedule; // Flag: TRUE = Reschedule in Hauptschleife - BOOL bCompatibility; // Flag: TRUE = VBA runtime compatibility mode + sal_uInt16 nErl; // aktuelle Fehlerzeile + sal_Bool bReschedule; // Flag: sal_True = Reschedule in Hauptschleife + sal_Bool bCompatibility; // Flag: sal_True = VBA runtime compatibility mode ComponentVector_t ComponentVector; @@ -210,9 +210,9 @@ public: // #31460 Neues Konzept fuer StepInto/Over/Out, // Erklaerung siehe runtime.cxx bei SbiInstance::CalcBreakCallLevel() - USHORT nCallLvl; // Call-Level (wg. Rekursion) - USHORT nBreakCallLvl; // Call-Level zum Anhalten - void CalcBreakCallLevel( USHORT nFlags ); // Gemaess Flags setzen + sal_uInt16 nCallLvl; // Call-Level (wg. Rekursion) + sal_uInt16 nBreakCallLvl; // Call-Level zum Anhalten + void CalcBreakCallLevel( sal_uInt16 nFlags ); // Gemaess Flags setzen SbiInstance( StarBASIC* ); ~SbiInstance(); @@ -229,14 +229,14 @@ public: SbError GetErr() { return nErr; } String GetErrorMsg() { return aErrorMsg; } xub_StrLen GetErl() { return nErl; } - void EnableReschedule( BOOL bEnable ) { bReschedule = bEnable; } - BOOL IsReschedule( void ) { return bReschedule; } - void EnableCompatibility( BOOL bEnable ) { bCompatibility = bEnable; } - BOOL IsCompatibility( void ) { return bCompatibility; } + void EnableReschedule( sal_Bool bEnable ) { bReschedule = bEnable; } + sal_Bool IsReschedule( void ) { return bReschedule; } + void EnableCompatibility( sal_Bool bEnable ) { bCompatibility = bEnable; } + sal_Bool IsCompatibility( void ) { return bCompatibility; } ComponentVector_t& getComponentVector( void ) { return ComponentVector; } - SbMethod* GetCaller( USHORT ); + SbMethod* GetCaller( sal_uInt16 ); SbModule* GetActiveModule(); SbxArray* GetLocals( SbMethod* ); @@ -276,11 +276,11 @@ struct RefSaveItem class SbiRuntime { - friend void SbRtl_CallByName( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); + friend void SbRtl_CallByName( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); typedef void( SbiRuntime::*pStep0 )(); - typedef void( SbiRuntime::*pStep1 )( UINT32 nOp1 ); - typedef void( SbiRuntime::*pStep2 )( UINT32 nOp1, UINT32 nOp2 ); + typedef void( SbiRuntime::*pStep1 )( sal_uInt32 nOp1 ); + typedef void( SbiRuntime::*pStep2 )( sal_uInt32 nOp1, sal_uInt32 nOp2 ); static pStep0 aStep0[]; // Opcode-Tabelle Gruppe 0 static pStep1 aStep1[]; // Opcode-Tabelle Gruppe 1 static pStep2 aStep2[]; // Opcode-Tabelle Gruppe 2 @@ -298,15 +298,15 @@ class SbiRuntime SbiArgvStack* pArgvStk; // ARGV-Stack SbiGosubStack* pGosubStk; // GOSUB stack SbiForStack* pForStk; // FOR/NEXT-Stack - USHORT nExprLvl; // Tiefe des Expr-Stacks - USHORT nGosubLvl; // Zum Vermeiden von Tot-Rekursionen - USHORT nForLvl; // #118235: Maintain for level - const BYTE* pCode; // aktueller Code-Pointer - const BYTE* pStmnt; // Beginn des lezten Statements - const BYTE* pError; // Adresse des aktuellen Error-Handlers - const BYTE* pRestart; // Restart-Adresse - const BYTE* pErrCode; // Restart-Adresse RESUME NEXT - const BYTE* pErrStmnt; // Restart-Adresse RESUMT 0 + sal_uInt16 nExprLvl; // Tiefe des Expr-Stacks + sal_uInt16 nGosubLvl; // Zum Vermeiden von Tot-Rekursionen + sal_uInt16 nForLvl; // #118235: Maintain for level + const sal_uInt8* pCode; // aktueller Code-Pointer + const sal_uInt8* pStmnt; // Beginn des lezten Statements + const sal_uInt8* pError; // Adresse des aktuellen Error-Handlers + const sal_uInt8* pRestart; // Restart-Adresse + const sal_uInt8* pErrCode; // Restart-Adresse RESUME NEXT + const sal_uInt8* pErrStmnt; // Restart-Adresse RESUMT 0 String aLibName; // Lib-Name fuer Declare-Call SbxArrayRef refParams; // aktuelle Prozedur-Parameter SbxArrayRef refLocals; // lokale Variable @@ -314,14 +314,14 @@ class SbiRuntime // AB, 28.3.2000 #74254, Ein refSaveObj reicht nicht! Neu: pRefSaveList (s.u.) //SbxVariableRef refSaveObj; // #56368 Bei StepElem Referenz sichern short nArgc; // aktueller Argc - BOOL bRun; // TRUE: Programm ist aktiv - BOOL bError; // TRUE: Fehler behandeln - BOOL bInError; // TRUE: in einem Fehler-Handler - BOOL bBlocked; // TRUE: blocked by next call level, #i48868 - BOOL bVBAEnabled; - USHORT nFlags; // Debugging-Flags + sal_Bool bRun; // sal_True: Programm ist aktiv + sal_Bool bError; // sal_True: Fehler behandeln + sal_Bool bInError; // sal_True: in einem Fehler-Handler + sal_Bool bBlocked; // sal_True: blocked by next call level, #i48868 + sal_Bool bVBAEnabled; + sal_uInt16 nFlags; // Debugging-Flags SbError nError; // letzter Fehler - USHORT nOps; // Opcode-Zaehler + sal_uInt16 nOps; // Opcode-Zaehler sal_uInt32 m_nLastTime; RefSaveItem* pRefSaveList; // #74254 Temporaere Referenzen sichern @@ -350,17 +350,17 @@ class SbiRuntime } SbxVariable* FindElement - ( SbxObject* pObj, UINT32 nOp1, UINT32 nOp2, SbError, BOOL bLocal, BOOL bStatic = FALSE ); - void SetupArgs( SbxVariable*, UINT32 ); + ( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError, sal_Bool bLocal, sal_Bool bStatic = sal_False ); + void SetupArgs( SbxVariable*, sal_uInt32 ); SbxVariable* CheckArray( SbxVariable* ); void PushVar( SbxVariable* ); // Variable push SbxVariableRef PopVar(); // Variable pop SbxVariable* GetTOS( short=0 ); // Variable vom TOS holen void TOSMakeTemp(); // TOS in temp. Variable wandeln - BOOL ClearExprStack(); // Expr-Stack freigeben + sal_Bool ClearExprStack(); // Expr-Stack freigeben - void PushGosub( const BYTE* ); // GOSUB-Element push + void PushGosub( const sal_uInt8* ); // GOSUB-Element push void PopGosub(); // GOSUB-Element pop void ClearGosubStack(); // GOSUB-Stack freigeben @@ -380,7 +380,7 @@ class SbiRuntime void SetParameters( SbxArray* );// Parameter uebernehmen // MUSS NOCH IMPLEMENTIERT WERDEN - void DllCall( const String&, const String&, SbxArray*, SbxDataType, BOOL ); + void DllCall( const String&, const String&, SbxArray*, SbxDataType, sal_Bool ); // #56204 DIM-Funktionalitaet in Hilfsmethode auslagern (step0.cxx) void DimImpl( SbxVariableRef refVar ); @@ -388,7 +388,7 @@ class SbiRuntime // #115829 bool implIsClass( SbxObject* pObj, const String& aClass ); - void StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt = false ); + void StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt = false ); // Die nachfolgenden Routinen werden vom Single Stepper // gerufen und implementieren die einzelnen Opcodes @@ -411,40 +411,40 @@ class SbiRuntime void StepLSET(), StepRSET(), StepREDIMP_ERASE(), StepERASE_CLEAR(); void StepARRAYACCESS(), StepBYVAL(); // Alle Opcodes mit einem Operanden - void StepLOADNC( UINT32 ), StepLOADSC( UINT32 ), StepLOADI( UINT32 ); - void StepARGN( UINT32 ), StepBASED( UINT32 ), StepPAD( UINT32 ); - void StepJUMP( UINT32 ), StepJUMPT( UINT32 ); - void StepJUMPF( UINT32 ), StepONJUMP( UINT32 ); - void StepGOSUB( UINT32 ), StepRETURN( UINT32 ); - void StepTESTFOR( UINT32 ), StepCASETO( UINT32 ), StepERRHDL( UINT32 ); - void StepRESUME( UINT32 ), StepSETCLASS( UINT32 ), StepVBASETCLASS( UINT32 ), StepTESTCLASS( UINT32 ), StepLIB( UINT32 ); + void StepLOADNC( sal_uInt32 ), StepLOADSC( sal_uInt32 ), StepLOADI( sal_uInt32 ); + void StepARGN( sal_uInt32 ), StepBASED( sal_uInt32 ), StepPAD( sal_uInt32 ); + void StepJUMP( sal_uInt32 ), StepJUMPT( sal_uInt32 ); + void StepJUMPF( sal_uInt32 ), StepONJUMP( sal_uInt32 ); + void StepGOSUB( sal_uInt32 ), StepRETURN( sal_uInt32 ); + void StepTESTFOR( sal_uInt32 ), StepCASETO( sal_uInt32 ), StepERRHDL( sal_uInt32 ); + void StepRESUME( sal_uInt32 ), StepSETCLASS( sal_uInt32 ), StepVBASETCLASS( sal_uInt32 ), StepTESTCLASS( sal_uInt32 ), StepLIB( sal_uInt32 ); bool checkClass_Impl( const SbxVariableRef& refVal, const String& aClass, bool bRaiseErrors, bool bDefault = true ); - void StepCLOSE( UINT32 ), StepPRCHAR( UINT32 ), StepARGTYP( UINT32 ); + void StepCLOSE( sal_uInt32 ), StepPRCHAR( sal_uInt32 ), StepARGTYP( sal_uInt32 ); // Alle Opcodes mit zwei Operanden - void StepRTL( UINT32, UINT32 ), StepPUBLIC( UINT32, UINT32 ), StepPUBLIC_P( UINT32, UINT32 ); - void StepPUBLIC_Impl( UINT32, UINT32, bool bUsedForClassModule ); - void StepFIND_Impl( SbxObject* pObj, UINT32 nOp1, UINT32 nOp2, SbError, BOOL bLocal, BOOL bStatic = FALSE ); - void StepFIND( UINT32, UINT32 ), StepELEM( UINT32, UINT32 ); - void StepGLOBAL( UINT32, UINT32 ), StepLOCAL( UINT32, UINT32 ); - void StepPARAM( UINT32, UINT32), StepCREATE( UINT32, UINT32 ); - void StepCALL( UINT32, UINT32 ), StepCALLC( UINT32, UINT32 ); - void StepCASEIS( UINT32, UINT32 ), StepSTMNT( UINT32, UINT32 ); + void StepRTL( sal_uInt32, sal_uInt32 ), StepPUBLIC( sal_uInt32, sal_uInt32 ), StepPUBLIC_P( sal_uInt32, sal_uInt32 ); + void StepPUBLIC_Impl( sal_uInt32, sal_uInt32, bool bUsedForClassModule ); + void StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError, sal_Bool bLocal, sal_Bool bStatic = sal_False ); + void StepFIND( sal_uInt32, sal_uInt32 ), StepELEM( sal_uInt32, sal_uInt32 ); + void StepGLOBAL( sal_uInt32, sal_uInt32 ), StepLOCAL( sal_uInt32, sal_uInt32 ); + void StepPARAM( sal_uInt32, sal_uInt32), StepCREATE( sal_uInt32, sal_uInt32 ); + void StepCALL( sal_uInt32, sal_uInt32 ), StepCALLC( sal_uInt32, sal_uInt32 ); + void StepCASEIS( sal_uInt32, sal_uInt32 ), StepSTMNT( sal_uInt32, sal_uInt32 ); SbxVariable* StepSTATIC_Impl( String& aName, SbxDataType& t ); - void StepOPEN( UINT32, UINT32 ), StepSTATIC( UINT32, UINT32 ); - void StepTCREATE(UINT32,UINT32), StepDCREATE(UINT32,UINT32); - void StepGLOBAL_P( UINT32, UINT32 ),StepFIND_G( UINT32, UINT32 ); - void StepDCREATE_REDIMP(UINT32,UINT32), StepDCREATE_IMPL(UINT32,UINT32); - void StepFIND_CM( UINT32, UINT32 ); - void StepFIND_STATIC( UINT32, UINT32 ); - void implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, UINT32 nOp2 ); + void StepOPEN( sal_uInt32, sal_uInt32 ), StepSTATIC( sal_uInt32, sal_uInt32 ); + void StepTCREATE(sal_uInt32,sal_uInt32), StepDCREATE(sal_uInt32,sal_uInt32); + void StepGLOBAL_P( sal_uInt32, sal_uInt32 ),StepFIND_G( sal_uInt32, sal_uInt32 ); + void StepDCREATE_REDIMP(sal_uInt32,sal_uInt32), StepDCREATE_IMPL(sal_uInt32,sal_uInt32); + void StepFIND_CM( sal_uInt32, sal_uInt32 ); + void StepFIND_STATIC( sal_uInt32, sal_uInt32 ); + void implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, sal_uInt32 nOp2 ); public: void SetVBAEnabled( bool bEnabled ); - USHORT GetImageFlag( USHORT n ) const; - USHORT GetBase(); + sal_uInt16 GetImageFlag( sal_uInt16 n ) const; + sal_uInt16 GetBase(); xub_StrLen nLine,nCol1,nCol2; // aktuelle Zeile, Spaltenbereich SbiRuntime* pNext; // Stack-Chain - SbiRuntime( SbModule*, SbMethod*, UINT32 ); + SbiRuntime( SbModule*, SbMethod*, sal_uInt32 ); ~SbiRuntime(); void Error( SbError, bool bVBATranslationAlreadyDone = false ); // Fehler setzen, falls != 0 void Error( SbError, const String& ); // Fehler setzen, falls != 0 @@ -452,15 +452,15 @@ public: void FatalError( SbError, const String& ); // Fehlerbehandlung=Standard, Fehler setzen static sal_Int32 translateErrorToVba( SbError nError, String& rMsg ); void DumpPCode(); - BOOL Step(); // Einzelschritt (ein Opcode) - void Stop() { bRun = FALSE; } - BOOL IsRun() { return bRun; } - void block( void ) { bBlocked = TRUE; } - void unblock( void ) { bBlocked = FALSE; } + sal_Bool Step(); // Einzelschritt (ein Opcode) + void Stop() { bRun = sal_False; } + sal_Bool IsRun() { return bRun; } + void block( void ) { bBlocked = sal_True; } + void unblock( void ) { bBlocked = sal_False; } SbMethod* GetMethod() { return pMeth; } SbModule* GetModule() { return pMod; } - USHORT GetDebugFlags() { return nFlags; } - void SetDebugFlags( USHORT nFl ) { nFlags = nFl; } + sal_uInt16 GetDebugFlags() { return nFlags; } + void SetDebugFlags( sal_uInt16 nFl ) { nFlags = nFl; } SbMethod* GetCaller(); SbxArray* GetLocals(); SbxArray* GetParams(); @@ -493,12 +493,12 @@ StarBASIC* GetCurrentBasic( StarBASIC* pRTBasic ); // no DDE functionality, no DLLCALL) in basic because // of portal "virtual" users (portal user != UNIX user) // (Implemented in iosys.cxx) -BOOL needSecurityRestrictions( void ); +sal_Bool needSecurityRestrictions( void ); -// Returns TRUE if UNO is available, otherwise the old +// Returns sal_True if UNO is available, otherwise the old // file system implementation has to be used // (Implemented in iosys.cxx) -BOOL hasUno( void ); +sal_Bool hasUno( void ); // Converts possibly relative paths to absolute paths // according to the setting done by ChDir/ChDrive diff --git a/basic/source/inc/sbintern.hxx b/basic/source/inc/sbintern.hxx index 4c54e2301bd5..41296e865032 100644 --- a/basic/source/inc/sbintern.hxx +++ b/basic/source/inc/sbintern.hxx @@ -46,7 +46,7 @@ class SbModule; class SbiFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); }; @@ -79,7 +79,7 @@ public: void AddClassModule( SbModule* pClassModule ); void RemoveClassModule( SbModule* pClassModule ); - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); SbModule* FindClass( const String& rClassName ); @@ -117,14 +117,14 @@ struct SbiGlobals SbError nCode; // aktueller Fehlercode xub_StrLen nLine; // aktuelle Zeile xub_StrLen nCol1,nCol2; // aktuelle Spalten (von,bis) - BOOL bCompiler; // Flag fuer Compiler-Error - BOOL bGlobalInitErr; // Beim GlobalInit trat ein Compiler-Fehler auf - BOOL bRunInit; // TRUE, wenn RunInit vom Basic aktiv ist + sal_Bool bCompiler; // Flag fuer Compiler-Error + sal_Bool bGlobalInitErr; // Beim GlobalInit trat ein Compiler-Fehler auf + sal_Bool bRunInit; // sal_True, wenn RunInit vom Basic aktiv ist String aErrMsg; // Puffer fuer GetErrorText() SbLanguageMode eLanguageMode; // Flag fuer Visual-Basic-Script-Modus SbErrorStack* pErrStack; // Stack fuer die im Fehlerfall abgebaute SbiRuntime Kette ::utl::TransliterationWrapper* pTransliterationWrapper; // For StrComp - BOOL bBlockCompilerError; + sal_Bool bBlockCompilerError; BasicManager* pAppBasMgr; StarBASIC* pMSOMacroRuntimLib; // Lib containing MSO Macro Runtime API entry symbols diff --git a/basic/source/inc/sbjsmod.hxx b/basic/source/inc/sbjsmod.hxx index a9b035e79da2..b4f680231f93 100644 --- a/basic/source/inc/sbjsmod.hxx +++ b/basic/source/inc/sbjsmod.hxx @@ -36,8 +36,8 @@ class SbJScriptModule : public SbModule { - virtual BOOL LoadData( SvStream&, USHORT ); - virtual BOOL StoreData( SvStream& ) const; + virtual sal_Bool LoadData( SvStream&, sal_uInt16 ); + virtual sal_Bool StoreData( SvStream& ) const; public: SBX_DECL_PERSIST_NODATA(SBXCR_SBX,SBXID_JSCRIPTMOD,1); TYPEINFO(); diff --git a/basic/source/inc/sbtrace.hxx b/basic/source/inc/sbtrace.hxx index 50e344fb63d2..d91c7bdf16e8 100755 --- a/basic/source/inc/sbtrace.hxx +++ b/basic/source/inc/sbtrace.hxx @@ -33,12 +33,12 @@ #ifdef DBG_TRACE_BASIC void dbg_InitTrace( void ); void dbg_DeInitTrace( void ); -void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl ); -void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave = false ); -void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl ); -void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC, +void dbg_traceStep( SbModule* pModule, sal_uInt32 nPC, sal_Int32 nCallLvl ); +void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, sal_Int32 nCallLvl, bool bLeave = false ); +void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, sal_Int32 nCallLvl ); +void dbg_RegisterTraceTextForPC( SbModule* pModule, sal_uInt32 nPC, const String& aTraceStr_STMNT, const String& aTraceStr_PCode ); -void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_TraceCommand( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); #endif #endif diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx index 051ceedfbc78..5c9d58e8ce55 100644 --- a/basic/source/inc/sbunoobj.hxx +++ b/basic/source/inc/sbunoobj.hxx @@ -51,8 +51,8 @@ class SbUnoObject: public SbxObject ::com::sun::star::uno::Reference< ::com::sun::star::script::XInvocation > mxInvocation; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactName; ::com::sun::star::uno::Reference< ::com::sun::star::beans::XExactName > mxExactNameInvocation; - BOOL bNeedIntrospection; - BOOL bNativeCOMObject; + sal_Bool bNeedIntrospection; + sal_Bool bNativeCOMObject; ::com::sun::star::uno::Any maTmpUnoObj; // Only to save obj for doIntrospection! // Hilfs-Methode zum Anlegen der dbg_-Properties @@ -135,7 +135,7 @@ class SbUnoProperty : public SbxProperty // Daten der Uno-Property ::com::sun::star::beans::Property aUnoProp; - INT32 nId; + sal_Int32 nId; bool mbInvocation; // Property is based on invocation @@ -143,7 +143,7 @@ class SbUnoProperty : public SbxProperty public: TYPEINFO(); SbUnoProperty( const String& aName_, SbxDataType eSbxType, - const ::com::sun::star::beans::Property& aUnoProp_, INT32 nId_, bool bInvocation ); + const ::com::sun::star::beans::Property& aUnoProp_, sal_Int32 nId_, bool bInvocation ); bool isInvocationBased( void ) { return mbInvocation; } @@ -153,7 +153,7 @@ public: class SbUnoFactory : public SbxFactory { public: - virtual SbxBase* Create( UINT16 nSbxId, UINT32 = SBXCR_SBX ); + virtual SbxBase* Create( sal_uInt16 nSbxId, sal_uInt32 = SBXCR_SBX ); virtual SbxObject* CreateObject( const String& ); }; @@ -292,15 +292,15 @@ public: class StarBASIC; // Impl-Methoden fuer RTL -void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); -void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_CreateUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_CreateUnoService( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_CreateUnoServiceWithArguments( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_CreateUnoValue( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_GetProcessServiceManager( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_HasInterfaces( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_IsUnoStruct( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); +void RTL_Impl_GetDefaultContext( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); void disposeComVariablesForBasic( StarBASIC* pBasic ); void clearNativeObjectWrapperVector( void ); @@ -320,8 +320,8 @@ class BasicCollection : public SbxObject virtual ~BasicCollection(); virtual void SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, const SfxHint& rHint, const TypeId& rHintType ); - INT32 implGetIndex( SbxVariable* pIndexVar ); - INT32 implGetIndexForName( const String& rName ); + sal_Int32 implGetIndex( SbxVariable* pIndexVar ); + sal_Int32 implGetIndexForName( const String& rName ); void CollAdd( SbxArray* pPar_ ); void CollItem( SbxArray* pPar_ ); void CollRemove( SbxArray* pPar_ ); diff --git a/basic/source/inc/scanner.hxx b/basic/source/inc/scanner.hxx index 9738e8763a1a..0c2c27f72b2f 100644 --- a/basic/source/inc/scanner.hxx +++ b/basic/source/inc/scanner.hxx @@ -58,33 +58,33 @@ protected: short nCol; // aktuelle Spaltennummer short nErrors; // Anzahl Fehler short nColLock; // Lock-Zaehler fuer Col1 - INT32 nBufPos; // aktuelle Buffer-Pos - USHORT nLine; // aktuelle Zeile - USHORT nCol1, nCol2; // aktuelle 1. und 2. Spalte - BOOL bSymbol; // TRUE: Symbol gescannt - BOOL bNumber; // TRUE: Zahl gescannt - BOOL bSpaces; // TRUE: Whitespace vor Token - BOOL bErrors; // TRUE: Fehler generieren - BOOL bAbort; // TRUE: abbrechen - BOOL bHash; // TRUE: # eingelesen - BOOL bError; // TRUE: Fehler generieren - BOOL bUsedForHilite; // TRUE: Nutzung fuer Highlighting - BOOL bCompatible; // TRUE: OPTION Compatibl - BOOL bVBASupportOn; // TRUE: OPTION VBASupport 1 otherwise default False - BOOL bPrevLineExtentsComment; // TRUE: Previous line is comment and ends on "... _" + sal_Int32 nBufPos; // aktuelle Buffer-Pos + sal_uInt16 nLine; // aktuelle Zeile + sal_uInt16 nCol1, nCol2; // aktuelle 1. und 2. Spalte + sal_Bool bSymbol; // sal_True: Symbol gescannt + sal_Bool bNumber; // sal_True: Zahl gescannt + sal_Bool bSpaces; // sal_True: Whitespace vor Token + sal_Bool bErrors; // sal_True: Fehler generieren + sal_Bool bAbort; // sal_True: abbrechen + sal_Bool bHash; // sal_True: # eingelesen + sal_Bool bError; // sal_True: Fehler generieren + sal_Bool bUsedForHilite; // sal_True: Nutzung fuer Highlighting + sal_Bool bCompatible; // sal_True: OPTION Compatibl + sal_Bool bVBASupportOn; // sal_True: OPTION VBASupport 1 otherwise default False + sal_Bool bPrevLineExtentsComment; // sal_True: Previous line is comment and ends on "... _" void GenError( SbError ); public: SbiScanner( const ::rtl::OUString&, StarBASIC* = NULL ); ~SbiScanner(); - void EnableErrors() { bError = FALSE; } - BOOL IsHash() { return bHash; } - BOOL IsCompatible() { return bCompatible; } + void EnableErrors() { bError = sal_False; } + sal_Bool IsHash() { return bHash; } + sal_Bool IsCompatible() { return bCompatible; } void SetCompatible( bool b ) { bCompatible = b; } // #118206 - BOOL IsVBASupportOn() { return bVBASupportOn; } + sal_Bool IsVBASupportOn() { return bVBASupportOn; } void SetVBASupportOn( bool b ) { bVBASupportOn = b; } - BOOL WhiteSpace() { return bSpaces; } + sal_Bool WhiteSpace() { return bSpaces; } short GetErrors() { return nErrors; } short GetLine() { return nLine; } short GetCol1() { return nCol1; } @@ -95,9 +95,9 @@ public: void RestoreLine(void) { pLine = pSaveLine; } void LockColumn(); void UnlockColumn(); - BOOL DoesColonFollow(); + sal_Bool DoesColonFollow(); - BOOL NextSym(); // naechstes Symbol lesen + sal_Bool NextSym(); // naechstes Symbol lesen const String& GetSym() { return aSym; } SbxDataType GetType() { return eScanType; } double GetDbl() { return nVal; } @@ -123,22 +123,22 @@ class BasicSimpleCharClass static LetterTable aLetterTable; public: - static BOOL isAlpha( sal_Unicode c, bool bCompatible ) + static sal_Bool isAlpha( sal_Unicode c, bool bCompatible ) { - BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') + sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (bCompatible && aLetterTable.isLetter( c )); return bRet; } - static BOOL isDigit( sal_Unicode c ) + static sal_Bool isDigit( sal_Unicode c ) { - BOOL bRet = (c >= '0' && c <= '9'); + sal_Bool bRet = (c >= '0' && c <= '9'); return bRet; } - static BOOL isAlphaNumeric( sal_Unicode c, bool bCompatible ) + static sal_Bool isAlphaNumeric( sal_Unicode c, bool bCompatible ) { - BOOL bRet = isDigit( c ) || isAlpha( c, bCompatible ); + sal_Bool bRet = isDigit( c ) || isAlpha( c, bCompatible ); return bRet; } }; diff --git a/basic/source/inc/stdobj.hxx b/basic/source/inc/stdobj.hxx index 000e39973eb3..cdf3209624fb 100644 --- a/basic/source/inc/stdobj.hxx +++ b/basic/source/inc/stdobj.hxx @@ -45,7 +45,7 @@ class SbiStdObject : public SbxObject public: SbiStdObject( const String&, StarBASIC* ); virtual SbxVariable* Find( const String&, SbxClassType ); - virtual void SetModified( BOOL ); + virtual void SetModified( sal_Bool ); }; #endif diff --git a/basic/source/inc/symtbl.hxx b/basic/source/inc/symtbl.hxx index f2fbaa0ac1f1..c30445d87634 100644 --- a/basic/source/inc/symtbl.hxx +++ b/basic/source/inc/symtbl.hxx @@ -58,12 +58,12 @@ class SbiStringPool { // String-Pool public: SbiStringPool( SbiParser* ); ~SbiStringPool(); - USHORT GetSize() const { return aData.Count(); } - // AB 8.4.1999, Default wegen #64236 auf TRUE geaendert - // Wenn der Bug sauber behoben ist, wieder auf FALSE aendern. - short Add( const String&, BOOL=TRUE ); + sal_uInt16 GetSize() const { return aData.Count(); } + // AB 8.4.1999, Default wegen #64236 auf sal_True geaendert + // Wenn der Bug sauber behoben ist, wieder auf sal_False aendern. + short Add( const String&, sal_Bool=sal_True ); short Add( double, SbxDataType ); - const String& Find( USHORT ) const; + const String& Find( sal_uInt16 ) const; SbiParser* GetParser() { return pParser; } }; @@ -80,8 +80,8 @@ protected: SbiSymPool* pParent; // uebergeordneter Symbol-Pool SbiParser* pParser; // der Parser SbiSymScope eScope; // Scope des Pools - USHORT nProcId; // aktuelles ProcId fuer STATIC-Variable - USHORT nCur; // Iterator + sal_uInt16 nProcId; // aktuelles ProcId fuer STATIC-Variable + sal_uInt16 nCur; // Iterator public: SbiSymPool( SbiStringPool&, SbiSymScope ); ~SbiSymPool(); @@ -90,7 +90,7 @@ public: void SetParent( SbiSymPool* p ) { pParent = p; } void SetProcId( short n ) { nProcId = n; } - USHORT GetSize() const { return aData.Count(); } + sal_uInt16 GetSize() const { return aData.Count(); } SbiSymScope GetScope() const { return eScope; } void SetScope( SbiSymScope s ) { eScope = s; } SbiParser* GetParser() { return pParser; } @@ -99,12 +99,12 @@ public: SbiProcDef* AddProc( const String& );// Prozedur hinzufuegen void Add( SbiSymDef* ); // Symbol uebernehmen SbiSymDef* Find( const String& ) const;// Variablenname - SbiSymDef* FindId( USHORT ) const; // Variable per ID suchen - SbiSymDef* Get( USHORT ) const; // Variable per Position suchen + SbiSymDef* FindId( sal_uInt16 ) const; // Variable per ID suchen + SbiSymDef* Get( sal_uInt16 ) const; // Variable per Position suchen SbiSymDef* First(), *Next(); // Iteratoren - UINT32 Define( const String& ); // Label definieren - UINT32 Reference( const String& ); // Label referenzieren + sal_uInt32 Define( const String& ); // Label definieren + sal_uInt32 Reference( const String& ); // Label referenzieren void CheckRefs(); // offene Referenzen suchen }; @@ -119,21 +119,21 @@ protected: SbiSymPool* pPool; // Pool fuer Unterelemente short nLen; // Stringlaenge bei STRING*n short nDims; // Array-Dimensionen - USHORT nId; // Symbol-Nummer - USHORT nTypeId; // String-ID des Datentyps (Dim X AS Dytentyp) - USHORT nProcId; // aktuelles ProcId fuer STATIC-Variable - USHORT nPos; // Positions-Nummer - UINT32 nChain; // Backchain-Kette - BOOL bNew : 1; // TRUE: Dim As New... - BOOL bChained : 1; // TRUE: Symbol ist in Code definiert - BOOL bByVal : 1; // TRUE: ByVal-Parameter - BOOL bOpt : 1; // TRUE: optionaler Parameter - BOOL bStatic : 1; // TRUE: STATIC-Variable - BOOL bAs : 1; // TRUE: Datentyp per AS XXX definiert - BOOL bGlobal : 1; // TRUE: Global-Variable - BOOL bParamArray : 1; // TRUE: ParamArray parameter - BOOL bWithEvents : 1; // TRUE: Declared WithEvents - USHORT nDefaultId; // Symbol number of default value + sal_uInt16 nId; // Symbol-Nummer + sal_uInt16 nTypeId; // String-ID des Datentyps (Dim X AS Dytentyp) + sal_uInt16 nProcId; // aktuelles ProcId fuer STATIC-Variable + sal_uInt16 nPos; // Positions-Nummer + sal_uInt32 nChain; // Backchain-Kette + sal_Bool bNew : 1; // sal_True: Dim As New... + sal_Bool bChained : 1; // sal_True: Symbol ist in Code definiert + sal_Bool bByVal : 1; // sal_True: ByVal-Parameter + sal_Bool bOpt : 1; // sal_True: optionaler Parameter + sal_Bool bStatic : 1; // sal_True: STATIC-Variable + sal_Bool bAs : 1; // sal_True: Datentyp per AS XXX definiert + sal_Bool bGlobal : 1; // sal_True: Global-Variable + sal_Bool bParamArray : 1; // sal_True: ParamArray parameter + sal_Bool bWithEvents : 1; // sal_True: Declared WithEvents + sal_uInt16 nDefaultId; // Symbol number of default value short nFixedStringLength; // String length in: Dim foo As String*Length public: SbiSymDef( const String& ); @@ -145,42 +145,42 @@ public: virtual void SetType( SbxDataType ); const String& GetName(); SbiSymScope GetScope() const; - USHORT GetProcId() const{ return nProcId; } - UINT32 GetAddr() const { return nChain; } - USHORT GetId() const { return nId; } - USHORT GetTypeId() const{ return nTypeId; } - void SetTypeId( USHORT n ) { nTypeId = n; eType = SbxOBJECT; } - USHORT GetPos() const { return nPos; } + sal_uInt16 GetProcId() const{ return nProcId; } + sal_uInt32 GetAddr() const { return nChain; } + sal_uInt16 GetId() const { return nId; } + sal_uInt16 GetTypeId() const{ return nTypeId; } + void SetTypeId( sal_uInt16 n ) { nTypeId = n; eType = SbxOBJECT; } + sal_uInt16 GetPos() const { return nPos; } void SetLen( short n ){ nLen = n; } short GetLen() const { return nLen; } void SetDims( short n ) { nDims = n; } short GetDims() const { return nDims; } - BOOL IsDefined() const{ return bChained; } - void SetOptional() { bOpt = TRUE; } - void SetParamArray() { bParamArray = TRUE; } - void SetWithEvents() { bWithEvents = TRUE; } - void SetByVal( BOOL bByVal_ = TRUE ) + sal_Bool IsDefined() const{ return bChained; } + void SetOptional() { bOpt = sal_True; } + void SetParamArray() { bParamArray = sal_True; } + void SetWithEvents() { bWithEvents = sal_True; } + void SetByVal( sal_Bool bByVal_ = sal_True ) { bByVal = bByVal_; } - void SetStatic( BOOL bAsStatic = TRUE ) { bStatic = bAsStatic; } - void SetNew() { bNew = TRUE; } - void SetDefinedAs() { bAs = TRUE; } - void SetGlobal(BOOL b){ bGlobal = b; } - void SetDefaultId( USHORT n ) { nDefaultId = n; } - USHORT GetDefaultId( void ) { return nDefaultId; } - BOOL IsOptional() const{ return bOpt; } - BOOL IsParamArray() const{ return bParamArray; } - BOOL IsWithEvents() const{ return bWithEvents; } - BOOL IsByVal() const { return bByVal; } - BOOL IsStatic() const { return bStatic; } - BOOL IsNew() const { return bNew; } - BOOL IsDefinedAs() const { return bAs; } - BOOL IsGlobal() const { return bGlobal; } + void SetStatic( sal_Bool bAsStatic = sal_True ) { bStatic = bAsStatic; } + void SetNew() { bNew = sal_True; } + void SetDefinedAs() { bAs = sal_True; } + void SetGlobal(sal_Bool b){ bGlobal = b; } + void SetDefaultId( sal_uInt16 n ) { nDefaultId = n; } + sal_uInt16 GetDefaultId( void ) { return nDefaultId; } + sal_Bool IsOptional() const{ return bOpt; } + sal_Bool IsParamArray() const{ return bParamArray; } + sal_Bool IsWithEvents() const{ return bWithEvents; } + sal_Bool IsByVal() const { return bByVal; } + sal_Bool IsStatic() const { return bStatic; } + sal_Bool IsNew() const { return bNew; } + sal_Bool IsDefinedAs() const { return bAs; } + sal_Bool IsGlobal() const { return bGlobal; } short GetFixedStringLength( void ) const { return nFixedStringLength; } void SetFixedStringLength( short n ) { nFixedStringLength = n; } SbiSymPool& GetPool(); - UINT32 Define(); // Symbol in Code definieren - UINT32 Reference(); // Symbol in Code referenzieren + sal_uInt32 Define(); // Symbol in Code definieren + sal_uInt32 Reference(); // Symbol in Code referenzieren private: SbiSymDef( const SbiSymDef& ); @@ -192,14 +192,14 @@ class SbiProcDef : public SbiSymDef { // Prozedur-Definition (aus Basic): SbiSymPool aLabels; // lokale Sprungziele String aLibName; // LIB "name" String aAlias; // ALIAS "name" - USHORT nLine1, nLine2; // Zeilenbereich + sal_uInt16 nLine1, nLine2; // Zeilenbereich PropertyMode mePropMode; // Marks if this is a property procedure and which String maPropName; // Property name if property procedure (!= proc name) - BOOL bCdecl : 1; // TRUE: CDECL angegeben - BOOL bPublic : 1; // TRUE: proc ist PUBLIC - BOOL mbProcDecl : 1; // TRUE: instanciated by SbiParser::ProcDecl + sal_Bool bCdecl : 1; // sal_True: CDECL angegeben + sal_Bool bPublic : 1; // sal_True: proc ist PUBLIC + sal_Bool mbProcDecl : 1; // sal_True: instanciated by SbiParser::ProcDecl public: - SbiProcDef( SbiParser*, const String&, BOOL bProcDecl=false ); + SbiProcDef( SbiParser*, const String&, sal_Bool bProcDecl=false ); virtual ~SbiProcDef(); virtual SbiProcDef* GetProcDef(); virtual void SetType( SbxDataType ); @@ -208,15 +208,15 @@ public: SbiSymPool& GetLocals() { return GetPool();} String& GetLib() { return aLibName; } String& GetAlias() { return aAlias; } - void SetPublic( BOOL b ) { bPublic = b; } - BOOL IsPublic() const { return bPublic; } - void SetCdecl( BOOL b = TRUE) { bCdecl = b; } - BOOL IsCdecl() const { return bCdecl; } - BOOL IsUsedForProcDecl() const { return mbProcDecl; } - void SetLine1( USHORT n ) { nLine1 = n; } - USHORT GetLine1() const { return nLine1; } - void SetLine2( USHORT n ) { nLine2 = n; } - USHORT GetLine2() const { return nLine2; } + void SetPublic( sal_Bool b ) { bPublic = b; } + sal_Bool IsPublic() const { return bPublic; } + void SetCdecl( sal_Bool b = sal_True) { bCdecl = b; } + sal_Bool IsCdecl() const { return bCdecl; } + sal_Bool IsUsedForProcDecl() const { return mbProcDecl; } + void SetLine1( sal_uInt16 n ) { nLine1 = n; } + sal_uInt16 GetLine1() const { return nLine1; } + void SetLine2( sal_uInt16 n ) { nLine2 = n; } + sal_uInt16 GetLine2() const { return nLine2; } PropertyMode getPropertyMode() { return mePropMode; } void setPropertyMode( PropertyMode ePropMode ); const String& GetPropName() { return maPropName; } diff --git a/basic/source/inc/token.hxx b/basic/source/inc/token.hxx index 930f68910b78..3af2e235c077 100644 --- a/basic/source/inc/token.hxx +++ b/basic/source/inc/token.hxx @@ -142,25 +142,25 @@ class SbiTokenizer : public SbiScanner { protected: SbiToken eCurTok; // aktuelles Token SbiToken ePush; // Pushback-Token - USHORT nPLine, nPCol1, nPCol2; // Pushback-Location - BOOL bEof; // TRUE bei Dateiende - BOOL bEos; // TRUE bei Statement-Ende - BOOL bKeywords; // TRUE, falls Keywords geparst werden - BOOL bAs; // letztes Keyword war AS - BOOL bErrorIsSymbol; // Handle Error token as Symbol, not keyword + sal_uInt16 nPLine, nPCol1, nPCol2; // Pushback-Location + sal_Bool bEof; // sal_True bei Dateiende + sal_Bool bEos; // sal_True bei Statement-Ende + sal_Bool bKeywords; // sal_True, falls Keywords geparst werden + sal_Bool bAs; // letztes Keyword war AS + sal_Bool bErrorIsSymbol; // Handle Error token as Symbol, not keyword public: SbiTokenizer( const ::rtl::OUString&, StarBASIC* = NULL ); ~SbiTokenizer(); - inline BOOL IsEof() { return bEof; } - inline BOOL IsEos() { return bEos; } + inline sal_Bool IsEof() { return bEof; } + inline sal_Bool IsEos() { return bEos; } void Push( SbiToken ); // Pushback eines Tokens const String& Symbol( SbiToken );// Rueckumwandlung SbiToken Peek(); // das naechste Token lesen SbiToken Next(); // Ein Token lesen - BOOL MayBeLabel( BOOL= FALSE ); // Kann es ein Label sein? + sal_Bool MayBeLabel( sal_Bool= sal_False ); // Kann es ein Label sein? void Hilite( SbTextPortions& ); // Syntax-Highlighting @@ -169,14 +169,14 @@ public: void Error( SbError, const char* ); void Error( SbError, String ); - void Keywords( BOOL b ) { bKeywords = b; } + void Keywords( sal_Bool b ) { bKeywords = b; } - static BOOL IsEoln( SbiToken t ) - { return BOOL( t == EOS || t == EOLN || t == REM ); } - static BOOL IsKwd( SbiToken t ) - { return BOOL( t >= FIRSTKWD && t <= LASTKWD ); } - static BOOL IsExtra( SbiToken t ) - { return BOOL( t >= FIRSTEXTRA ); } + static sal_Bool IsEoln( SbiToken t ) + { return sal_Bool( t == EOS || t == EOLN || t == REM ); } + static sal_Bool IsKwd( SbiToken t ) + { return sal_Bool( t >= FIRSTKWD && t <= LASTKWD ); } + static sal_Bool IsExtra( SbiToken t ) + { return sal_Bool( t >= FIRSTEXTRA ); } }; diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx index 799caf0cd954..0cf81e30d9a6 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -54,8 +54,8 @@ BasicDLL::BasicDLL() ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILocale(); pSttResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(stt), aLocale ); pBasResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(sb), aLocale ); - bDebugMode = FALSE; - bBreakEnabled = TRUE; + bDebugMode = sal_False; + bBreakEnabled = sal_True; } BasicDLL::~BasicDLL() @@ -64,7 +64,7 @@ BasicDLL::~BasicDLL() delete pBasResMgr; } -void BasicDLL::EnableBreak( BOOL bEnable ) +void BasicDLL::EnableBreak( sal_Bool bEnable ) { BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: Noch keine Instanz!" ); @@ -72,7 +72,7 @@ void BasicDLL::EnableBreak( BOOL bEnable ) pThis->bBreakEnabled = bEnable; } -void BasicDLL::SetDebugMode( BOOL bDebugMode ) +void BasicDLL::SetDebugMode( sal_Bool bDebugMode ) { BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: Noch keine Instanz!" ); @@ -85,7 +85,7 @@ void BasicDLL::BasicBreak() { //bJustStopping: Wenn jemand wie wild x-mal STOP drueckt, aber das Basic // nicht schnell genug anhaelt, kommt die Box ggf. oefters... - static BOOL bJustStopping = FALSE; + static sal_Bool bJustStopping = sal_False; BasicDLL* pThis = *(BasicDLL**)GetAppData(SHL_BASIC); DBG_ASSERT( pThis, "BasicDLL::EnableBreak: Noch keine Instanz!" ); @@ -93,11 +93,11 @@ void BasicDLL::BasicBreak() { if ( StarBASIC::IsRunning() && !bJustStopping && ( pThis->bBreakEnabled || pThis->bDebugMode ) ) { - bJustStopping = TRUE; + bJustStopping = sal_True; StarBASIC::Stop(); String aMessageStr( BasResId( IDS_SBERR_TERMINATED ) ); InfoBox( 0, aMessageStr ).Execute(); - bJustStopping = FALSE; + bJustStopping = sal_False; } } } diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index 89d473099f0b..5e8775159c38 100644 --- a/basic/source/runtime/ddectrl.cxx +++ b/basic/source/runtime/ddectrl.cxx @@ -93,12 +93,12 @@ SbiDdeControl::~SbiDdeControl() delete pConvList; } -INT16 SbiDdeControl::GetFreeChannel() +sal_Int16 SbiDdeControl::GetFreeChannel() { - INT16 nListSize = (INT16)pConvList->Count(); + sal_Int16 nListSize = (sal_Int16)pConvList->Count(); DdeConnection* pPtr = pConvList->First(); pPtr = pConvList->Next(); // nullten eintrag ueberspringen - INT16 nChannel; + sal_Int16 nChannel; for( nChannel = 1; nChannel < nListSize; nChannel++ ) { if( pPtr == DDE_FREECHANNEL ) @@ -111,7 +111,7 @@ INT16 SbiDdeControl::GetFreeChannel() } SbError SbiDdeControl::Initiate( const String& rService, const String& rTopic, - INT16& rnHandle ) + sal_Int16& rnHandle ) { SbError nErr; DdeConnection* pConv = new DdeConnection( rService, rTopic ); @@ -123,26 +123,26 @@ SbError SbiDdeControl::Initiate( const String& rService, const String& rTopic, } else { - INT16 nChannel = GetFreeChannel(); - pConvList->Replace( pConv, (ULONG)nChannel ); + sal_Int16 nChannel = GetFreeChannel(); + pConvList->Replace( pConv, (sal_uIntPtr)nChannel ); rnHandle = nChannel; } return 0; } -SbError SbiDdeControl::Terminate( INT16 nChannel ) +SbError SbiDdeControl::Terminate( sal_Int16 nChannel ) { - DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + DdeConnection* pConv = pConvList->GetObject( (sal_uIntPtr)nChannel ); if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) return SbERR_DDE_NO_CHANNEL; - pConvList->Replace( DDE_FREECHANNEL, (ULONG)nChannel ); + pConvList->Replace( DDE_FREECHANNEL, (sal_uIntPtr)nChannel ); delete pConv; return 0L; } SbError SbiDdeControl::TerminateAll() { - INT16 nChannel = (INT16)pConvList->Count(); + sal_Int16 nChannel = (sal_Int16)pConvList->Count(); while( nChannel ) { nChannel--; @@ -156,9 +156,9 @@ SbError SbiDdeControl::TerminateAll() return 0; } -SbError SbiDdeControl::Request( INT16 nChannel, const String& rItem, String& rResult ) +SbError SbiDdeControl::Request( sal_Int16 nChannel, const String& rItem, String& rResult ) { - DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + DdeConnection* pConv = pConvList->GetObject( (sal_uIntPtr)nChannel ); if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) return SbERR_DDE_NO_CHANNEL; @@ -169,9 +169,9 @@ SbError SbiDdeControl::Request( INT16 nChannel, const String& rItem, String& rRe return GetLastErr( pConv ); } -SbError SbiDdeControl::Execute( INT16 nChannel, const String& rCommand ) +SbError SbiDdeControl::Execute( sal_Int16 nChannel, const String& rCommand ) { - DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + DdeConnection* pConv = pConvList->GetObject( (sal_uIntPtr)nChannel ); if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) return SbERR_DDE_NO_CHANNEL; DdeExecute aRequest( *pConv, rCommand, 30000 ); @@ -179,9 +179,9 @@ SbError SbiDdeControl::Execute( INT16 nChannel, const String& rCommand ) return GetLastErr( pConv ); } -SbError SbiDdeControl::Poke( INT16 nChannel, const String& rItem, const String& rData ) +SbError SbiDdeControl::Poke( sal_Int16 nChannel, const String& rItem, const String& rData ) { - DdeConnection* pConv = pConvList->GetObject( (ULONG)nChannel ); + DdeConnection* pConv = pConvList->GetObject( (sal_uIntPtr)nChannel ); if( !nChannel || !pConv || pConv == DDE_FREECHANNEL ) return SbERR_DDE_NO_CHANNEL; DdePoke aRequest( *pConv, rItem, DdeData(rData), 30000 ); diff --git a/basic/source/runtime/ddectrl.hxx b/basic/source/runtime/ddectrl.hxx index c1e9da823a20..a99575308fa8 100644 --- a/basic/source/runtime/ddectrl.hxx +++ b/basic/source/runtime/ddectrl.hxx @@ -43,7 +43,7 @@ class SbiDdeControl private: DECL_LINK( Data, DdeData* ); SbError GetLastErr( DdeConnection* ); - INT16 GetFreeChannel(); + sal_Int16 GetFreeChannel(); DdeConnections* pConvList; String aData; @@ -53,12 +53,12 @@ public: ~SbiDdeControl(); SbError Initiate( const String& rService, const String& rTopic, - INT16& rnHandle ); - SbError Terminate( INT16 nChannel ); + sal_Int16& rnHandle ); + SbError Terminate( sal_Int16 nChannel ); SbError TerminateAll(); - SbError Request( INT16 nChannel, const String& rItem, String& rResult ); - SbError Execute( INT16 nChannel, const String& rCommand ); - SbError Poke( INT16 nChannel, const String& rItem, const String& rData ); + SbError Request( sal_Int16 nChannel, const String& rItem, String& rResult ); + SbError Execute( sal_Int16 nChannel, const String& rCommand ); + SbError Poke( sal_Int16 nChannel, const String& rItem, const String& rData ); }; #endif diff --git a/basic/source/runtime/dllmgr.cxx b/basic/source/runtime/dllmgr.cxx index 04f1ee0a8acc..28201226333a 100644 --- a/basic/source/runtime/dllmgr.cxx +++ b/basic/source/runtime/dllmgr.cxx @@ -168,7 +168,7 @@ std::size_t alignment(SbxVariable * variable) { std::size_t n = 1; SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())-> GetProperties(); - for (USHORT i = 0; i < props->Count(); ++i) { + for (sal_uInt16 i = 0; i < props->Count(); ++i) { n = std::max(n, alignment(props->Get(i))); } return n; @@ -183,9 +183,9 @@ std::size_t alignment(SbxVariable * variable) { } else { SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject()); int dims = arr->GetDims(); - std::vector< INT32 > low(dims); + std::vector< sal_Int32 > low(dims); for (int i = 0; i < dims; ++i) { - INT32 up; + sal_Int32 up; arr->GetDim32(i + 1, low[i], up); } return alignment(arr->Get32(&low[0])); @@ -219,7 +219,7 @@ SbError marshalStruct( OSL_ASSERT(variable != 0); SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())-> GetProperties(); - for (USHORT i = 0; i < props->Count(); ++i) { + for (sal_uInt16 i = 0; i < props->Count(); ++i) { SbError e = marshal(false, props->Get(i), false, blob, offset, data); if (e != ERRCODE_NONE) { return e; @@ -235,12 +235,12 @@ SbError marshalArray( OSL_ASSERT(variable != 0); SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject()); int dims = arr->GetDims(); - std::vector< INT32 > low(dims); - std::vector< INT32 > up(dims); + std::vector< sal_Int32 > low(dims); + std::vector< sal_Int32 > up(dims); for (int i = 0; i < dims; ++i) { arr->GetDim32(i + 1, low[i], up[i]); } - for (std::vector< INT32 > idx = low;;) { + for (std::vector< sal_Int32 > idx = low;;) { SbError e = marshal( false, arr->Get32(&idx[0]), false, blob, offset, data); if (e != ERRCODE_NONE) { @@ -405,7 +405,7 @@ void const * unmarshal(SbxVariable * variable, void const * data) { alignment(variable))); SbxArray * props = PTR_CAST(SbxObject, variable->GetObject())-> GetProperties(); - for (USHORT i = 0; i < props->Count(); ++i) { + for (sal_uInt16 i = 0; i < props->Count(); ++i) { data = unmarshal(props->Get(i), data); } break; @@ -423,12 +423,12 @@ void const * unmarshal(SbxVariable * variable, void const * data) { } else { SbxDimArray * arr = PTR_CAST(SbxDimArray, variable->GetObject()); int dims = arr->GetDims(); - std::vector< INT32 > low(dims); - std::vector< INT32 > up(dims); + std::vector< sal_Int32 > low(dims); + std::vector< sal_Int32 > up(dims); for (int i = 0; i < dims; ++i) { arr->GetDim32(i + 1, low[i], up[i]); } - for (std::vector< INT32 > idx = low;;) { + for (std::vector< sal_Int32 > idx = low;;) { data = unmarshal(arr->Get32(&idx[0]), data); int i = dims - 1; while (idx[i] == up[i]) { @@ -488,7 +488,7 @@ SbError call( RTL_CONSTASCII_STRINGPARAM("KERNEL32.DLL")) && (proc.name == rtl::OString(RTL_CONSTASCII_STRINGPARAM("GetLogicalDriveStringsA"))); - for (USHORT i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) { + for (sal_uInt16 i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) { SbError e = marshal( true, arguments->Get(i), special && i == 2, stack, stack.size(), data); @@ -550,7 +550,7 @@ SbError call( OSL_ASSERT(false); break; } - for (USHORT i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) { + for (sal_uInt16 i = 1; i < (arguments == 0 ? 0 : arguments->Count()); ++i) { arguments->Get(i)->ResetFlag(SBX_REFERENCE); //TODO: skipped for errors?!? } diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index 17b98ad7addd..c43519a9b2de 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -162,14 +162,14 @@ RTLFUNC(InputBox) (void)pBasic; (void)bWrite; - ULONG nArgCount = rPar.Count(); + sal_uIntPtr nArgCount = rPar.Count(); if ( nArgCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { String aTitle; String aDefault; - INT32 nX = -1, nY = -1; // zentrieren + sal_Int32 nX = -1, nY = -1; // zentrieren const String& rPrompt = rPar.Get(1)->GetString(); if ( nArgCount > 2 && !rPar.Get(2)->IsErr() ) aTitle = rPar.Get(2)->GetString(); diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 9940890286b4..06faa7c0aba5 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -217,13 +217,13 @@ void SbiStream::MapError() // Hack for #83750 -BOOL runsInSetup( void ); +sal_Bool runsInSetup( void ); -BOOL needSecurityRestrictions( void ) +sal_Bool needSecurityRestrictions( void ) { #ifdef _USE_UNO - static BOOL bNeedInit = TRUE; - static BOOL bRetVal = TRUE; + static sal_Bool bNeedInit = sal_True; + static sal_Bool bRetVal = sal_True; if( bNeedInit ) { @@ -232,11 +232,11 @@ BOOL needSecurityRestrictions( void ) if( runsInSetup() ) { // Setup is not critical - bRetVal = FALSE; + bRetVal = sal_False; return bRetVal; } - bNeedInit = FALSE; + bNeedInit = sal_False; // Get system user to compare to portal user oslSecurity aSecurity = osl_getCurrentSecurity(); @@ -245,12 +245,12 @@ BOOL needSecurityRestrictions( void ) if( !bRet ) { // No valid security! -> Secure mode! - return TRUE; + return sal_True; } Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); if( !xSMgr.is() ) - return TRUE; + return sal_True; Reference< XBridgeFactory > xBridgeFac( xSMgr->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.bridge.BridgeFactory" ) ), UNO_QUERY ); @@ -265,13 +265,13 @@ BOOL needSecurityRestrictions( void ) if( nBridgeCount == 0 ) { // No bridges -> local - bRetVal = FALSE; + bRetVal = sal_False; return bRetVal; } // Iterate through all bridges to find (portal) user property const Reference< XBridge >* pBridges = aBridgeSeq.getConstArray(); - bRetVal = FALSE; // Now only TRUE if user different from portal user is found + bRetVal = sal_False; // Now only sal_True if user different from portal user is found sal_Int32 i; for( i = 0 ; i < nBridgeCount ; i++ ) { @@ -289,7 +289,7 @@ BOOL needSecurityRestrictions( void ) else { // Different user -> Secure mode! - bRetVal = TRUE; + bRetVal = sal_True; break; } } @@ -299,27 +299,27 @@ BOOL needSecurityRestrictions( void ) return bRetVal; #else - return FALSE; + return sal_False; #endif } -// Returns TRUE if UNO is available, otherwise the old file +// Returns sal_True if UNO is available, otherwise the old file // system implementation has to be used // #89378 New semantic: Don't just ask for UNO but for UCB -BOOL hasUno( void ) +sal_Bool hasUno( void ) { #ifdef _USE_UNO - static BOOL bNeedInit = TRUE; - static BOOL bRetVal = TRUE; + static sal_Bool bNeedInit = sal_True; + static sal_Bool bRetVal = sal_True; if( bNeedInit ) { - bNeedInit = FALSE; + bNeedInit = sal_False; Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory(); if( !xSMgr.is() ) { // No service manager at all - bRetVal = FALSE; + bRetVal = sal_False; } else { @@ -329,13 +329,13 @@ BOOL hasUno( void ) if ( !( xManager.is() && xManager->queryContentProvider( ::rtl::OUString::createFromAscii( "file:///" ) ).is() ) ) { // No UCB - bRetVal = FALSE; + bRetVal = sal_False; } } } return bRetVal; #else - return FALSE; + return sal_False; #endif } @@ -351,11 +351,11 @@ class OslStream : public SvStream public: OslStream( const String& rName, short nStrmMode ); ~OslStream(); - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); virtual void FlushData(); - virtual void SetSize( ULONG nSize ); + virtual void SetSize( sal_uIntPtr nSize ); }; OslStream::OslStream( const String& rName, short nStrmMode ) @@ -396,23 +396,23 @@ OslStream::~OslStream() maFile.close(); } -ULONG OslStream::GetData( void* pData, ULONG nSize ) +sal_uIntPtr OslStream::GetData( void* pData, sal_uIntPtr nSize ) { sal_uInt64 nBytesRead = nSize; FileBase::RC nRet = FileBase::E_None; nRet = maFile.read( pData, nBytesRead, nBytesRead ); - return (ULONG)nBytesRead; + return (sal_uIntPtr)nBytesRead; } -ULONG OslStream::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr OslStream::PutData( const void* pData, sal_uIntPtr nSize ) { sal_uInt64 nBytesWritten; FileBase::RC nRet = FileBase::E_None; nRet = maFile.write( pData, (sal_uInt64)nSize, nBytesWritten ); - return (ULONG)nBytesWritten; + return (sal_uIntPtr)nBytesWritten; } -ULONG OslStream::SeekPos( ULONG nPos ) +sal_uIntPtr OslStream::SeekPos( sal_uIntPtr nPos ) { FileBase::RC nRet; if( nPos == STREAM_SEEK_TO_END ) @@ -425,14 +425,14 @@ ULONG OslStream::SeekPos( ULONG nPos ) } sal_uInt64 nRealPos; nRet = maFile.getPos( nRealPos ); - return sal::static_int_cast(nRealPos); + return sal::static_int_cast(nRealPos); } void OslStream::FlushData() { } -void OslStream::SetSize( ULONG nSize ) +void OslStream::SetSize( sal_uIntPtr nSize ) { FileBase::RC nRet = FileBase::E_None; nRet = maFile.setSize( (sal_uInt64)nSize ); @@ -454,17 +454,17 @@ public: UCBStream( Reference< XOutputStream > & xOS ); UCBStream( Reference< XStream > & xS ); ~UCBStream(); - virtual ULONG GetData( void* pData, ULONG nSize ); - virtual ULONG PutData( const void* pData, ULONG nSize ); - virtual ULONG SeekPos( ULONG nPos ); + virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ); + virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ); virtual void FlushData(); - virtual void SetSize( ULONG nSize ); + virtual void SetSize( sal_uIntPtr nSize ); }; /* -ULONG UCBErrorToSvStramError( ucb::IOErrorCode nError ) +sal_uIntPtr UCBErrorToSvStramError( ucb::IOErrorCode nError ) { - ULONG eReturn = ERRCODE_IO_GENERAL; + sal_uIntPtr eReturn = ERRCODE_IO_GENERAL; switch( nError ) { case ucb::IOErrorCode_ABORT: eReturn = SVSTREAM_GENERALERROR; break; @@ -535,7 +535,7 @@ UCBStream::~UCBStream() } } -ULONG UCBStream::GetData( void* pData, ULONG nSize ) +sal_uIntPtr UCBStream::GetData( void* pData, sal_uIntPtr nSize ) { try { @@ -564,7 +564,7 @@ ULONG UCBStream::GetData( void* pData, ULONG nSize ) return 0; } -ULONG UCBStream::PutData( const void* pData, ULONG nSize ) +sal_uIntPtr UCBStream::PutData( const void* pData, sal_uIntPtr nSize ) { try { @@ -591,13 +591,13 @@ ULONG UCBStream::PutData( const void* pData, ULONG nSize ) return 0; } -ULONG UCBStream::SeekPos( ULONG nPos ) +sal_uIntPtr UCBStream::SeekPos( sal_uIntPtr nPos ) { try { if( xSeek.is() ) { - ULONG nLen = sal::static_int_cast( xSeek->getLength() ); + sal_uIntPtr nLen = sal::static_int_cast( xSeek->getLength() ); if( nPos > nLen ) nPos = nLen; xSeek->seek( nPos ); @@ -631,7 +631,7 @@ void UCBStream::FlushData() } } -void UCBStream::SetSize( ULONG nSize ) +void UCBStream::SetSize( sal_uIntPtr nSize ) { (void)nSize; @@ -738,7 +738,7 @@ SbError SbiStream::Close() return nError; } -SbError SbiStream::Read( ByteString& rBuf, USHORT n, bool bForceReadingPerByte ) +SbError SbiStream::Read( ByteString& rBuf, sal_uInt16 n, bool bForceReadingPerByte ) { nExpandOnWriteTo = 0; if( !bForceReadingPerByte && IsText() ) @@ -777,10 +777,10 @@ void SbiStream::ExpandFile() { if ( nExpandOnWriteTo ) { - ULONG nCur = pStrm->Seek(STREAM_SEEK_TO_END); + sal_uIntPtr nCur = pStrm->Seek(STREAM_SEEK_TO_END); if( nCur < nExpandOnWriteTo ) { - ULONG nDiff = nExpandOnWriteTo - nCur; + sal_uIntPtr nDiff = nExpandOnWriteTo - nCur; char c = 0; while( nDiff-- ) *pStrm << c; @@ -793,7 +793,7 @@ void SbiStream::ExpandFile() } } -SbError SbiStream::Write( const ByteString& rBuf, USHORT n ) +SbError SbiStream::Write( const ByteString& rBuf, sal_uInt16 n ) { ExpandFile(); if( IsAppend() ) @@ -804,7 +804,7 @@ SbError SbiStream::Write( const ByteString& rBuf, USHORT n ) aLine += rBuf; // Raus damit, wenn das Ende ein LF ist, aber CRLF vorher // strippen, da der SvStrm ein CRLF anfuegt! - USHORT nLineLen = aLine.Len(); + sal_uInt16 nLineLen = aLine.Len(); if( nLineLen && aLine.GetBuffer()[ --nLineLen ] == 0x0A ) { aLine.Erase( nLineLen ); @@ -1023,8 +1023,8 @@ void SbiIoSystem::ReadCon( ByteString& rIn ) void SbiIoSystem::WriteCon( const ByteString& rText ) { aOut += rText; - USHORT n1 = aOut.Search( '\n' ); - USHORT n2 = aOut.Search( '\r' ); + sal_uInt16 n1 = aOut.Search( '\n' ); + sal_uInt16 n2 = aOut.Search( '\r' ); if( n1 != STRING_NOTFOUND || n2 != STRING_NOTFOUND ) { if( n1 == STRING_NOTFOUND ) n1 = n2; diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 97f6ed227d47..de3149d7892e 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -154,7 +154,7 @@ static CharClass& GetCharClass( void ) return aCharClass; } -static inline BOOL isFolder( FileStatus::Type aType ) +static inline sal_Bool isFolder( FileStatus::Type aType ) { return ( aType == FileStatus::Directory || aType == FileStatus::Volume ); } @@ -220,8 +220,8 @@ static com::sun::star::uno::Reference< XSimpleFileAccess3 > getFileAccess( void -// Properties und Methoden legen beim Get (bPut = FALSE) den Returnwert -// im Element 0 des Argv ab; beim Put (bPut = TRUE) wird der Wert aus +// Properties und Methoden legen beim Get (bPut = sal_False) den Returnwert +// im Element 0 des Argv ab; beim Put (bPut = sal_True) wird der Wert aus // Element 0 gespeichert. // CreateObject( class ) @@ -254,7 +254,7 @@ RTLFUNC(Error) { String aErrorMsg; SbError nErr = 0L; - INT32 nCode = 0; + sal_Int32 nCode = 0; if( rPar.Count() == 1 ) { nErr = StarBASIC::GetErrBasic(); @@ -266,7 +266,7 @@ RTLFUNC(Error) if( nCode > 65535L ) StarBASIC::Error( SbERR_CONVERSION ); else - nErr = StarBASIC::GetSfxFromVBError( (USHORT)nCode ); + nErr = StarBASIC::GetSfxFromVBError( (sal_uInt16)nCode ); } bool bVBA = SbiRuntime::isVBAEnabled(); @@ -452,7 +452,7 @@ RTLFUNC(CurDir) int nSize = _PATH_INCR; char* pMem; - while( TRUE ) + while( sal_True ) { pMem = new char[nSize]; if( !pMem ) @@ -489,17 +489,17 @@ RTLFUNC(ChDir) // JSM { #ifdef _ENABLE_CUR_DIR String aPath = rPar.Get(1)->GetString(); - BOOL bError = FALSE; + sal_Bool bError = sal_False; #ifdef WNT // #55997 Laut MI hilft es bei File-URLs einen DirEntry zwischenzuschalten // #40996 Harmoniert bei Verwendung der WIN32-Funktion nicht mit getdir DirEntry aEntry( aPath ); ByteString aFullPath( aEntry.GetFull(), gsl_getSystemTextEncoding() ); if( chdir( aFullPath.GetBuffer()) ) - bError = TRUE; + bError = sal_True; #else if (!DirEntry(aPath).SetCWD()) - bError = TRUE; + bError = sal_True; #endif if( bError ) StarBASIC::Error( SbERR_PATH_NOT_FOUND ); @@ -880,7 +880,7 @@ RTLFUNC(FileLen) { SbxVariableRef pArg = rPar.Get( 1 ); String aStr( pArg->GetString() ); - INT32 nLen = 0; + sal_Int32 nLen = 0; // <-- UCB if( hasUno() ) { @@ -908,7 +908,7 @@ RTLFUNC(FileLen) FileBase::RC nRet = DirectoryItem::get( getFullPathUNC( aStr ), aItem ); FileStatus aFileStatus( FileStatusMask_FileSize ); nRet = aItem.getFileStatus( aFileStatus ); - nLen = (INT32)aFileStatus.getFileSize(); + nLen = (sal_Int32)aFileStatus.getFileSize(); #endif } rPar.Get(0)->PutLong( (long)nLen ); @@ -942,23 +942,23 @@ RTLFUNC(InStr) (void)pBasic; (void)bWrite; - ULONG nArgCount = rPar.Count()-1; + sal_uIntPtr nArgCount = rPar.Count()-1; if ( nArgCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - USHORT nStartPos = 1; + sal_uInt16 nStartPos = 1; - USHORT nFirstStringPos = 1; + sal_uInt16 nFirstStringPos = 1; if ( nArgCount >= 3 ) { - INT32 lStartPos = rPar.Get(1)->GetLong(); + sal_Int32 lStartPos = rPar.Get(1)->GetLong(); if( lStartPos <= 0 || lStartPos > 0xffff ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); lStartPos = 1; } - nStartPos = (USHORT)lStartPos; + nStartPos = (sal_uInt16)lStartPos; nFirstStringPos++; } @@ -968,7 +968,7 @@ RTLFUNC(InStr) if( bCompatibility ) { SbiRuntime* pRT = pInst ? pInst->pRun : NULL; - bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE; + bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False; } else { @@ -977,7 +977,7 @@ RTLFUNC(InStr) if ( nArgCount == 4 ) bTextMode = rPar.Get(4)->GetInteger(); - USHORT nPos; + sal_uInt16 nPos; const String& rToken = rPar.Get(nFirstStringPos+1)->GetString(); // #97545 Always find empty string @@ -1024,7 +1024,7 @@ RTLFUNC(InStrRev) (void)pBasic; (void)bWrite; - ULONG nArgCount = rPar.Count()-1; + sal_uIntPtr nArgCount = rPar.Count()-1; if ( nArgCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -1032,7 +1032,7 @@ RTLFUNC(InStrRev) String aStr1 = rPar.Get(1)->GetString(); String aToken = rPar.Get(2)->GetString(); - INT32 lStartPos = -1; + sal_Int32 lStartPos = -1; if ( nArgCount >= 3 ) { lStartPos = rPar.Get(3)->GetLong(); @@ -1049,7 +1049,7 @@ RTLFUNC(InStrRev) if( bCompatibility ) { SbiRuntime* pRT = pInst ? pInst->pRun : NULL; - bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE; + bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False; } else { @@ -1058,13 +1058,13 @@ RTLFUNC(InStrRev) if ( nArgCount == 4 ) bTextMode = rPar.Get(4)->GetInteger(); - USHORT nStrLen = aStr1.Len(); - USHORT nStartPos = lStartPos == -1 ? nStrLen : (USHORT)lStartPos; + sal_uInt16 nStrLen = aStr1.Len(); + sal_uInt16 nStartPos = lStartPos == -1 ? nStrLen : (sal_uInt16)lStartPos; - USHORT nPos = 0; + sal_uInt16 nPos = 0; if( nStartPos <= nStrLen ) { - USHORT nTokenLen = aToken.Len(); + sal_uInt16 nTokenLen = aToken.Len(); if( !nTokenLen ) { // Always find empty string @@ -1080,7 +1080,7 @@ RTLFUNC(InStrRev) if( nRet == -1 ) nPos = 0; else - nPos = (USHORT)nRet + 1; + nPos = (sal_uInt16)nRet + 1; } else { @@ -1094,7 +1094,7 @@ RTLFUNC(InStrRev) if( nRet == -1 ) nPos = 0; else - nPos = (USHORT)nRet + 1; + nPos = (sal_uInt16)nRet + 1; } } } @@ -1178,7 +1178,7 @@ RTLFUNC(Left) else { String aStr( rPar.Get(1)->GetString() ); - INT32 lResultLen = rPar.Get(2)->GetLong(); + sal_Int32 lResultLen = rPar.Get(2)->GetLong(); if( lResultLen > 0xffff ) { lResultLen = 0xffff; @@ -1188,7 +1188,7 @@ RTLFUNC(Left) lResultLen = 0; StarBASIC::Error( SbERR_BAD_ARGUMENT ); } - aStr.Erase( (USHORT)lResultLen ); + aStr.Erase( (sal_uInt16)lResultLen ); rPar.Get(0)->PutString( aStr ); } } @@ -1237,7 +1237,7 @@ RTLFUNC(Mid) (void)pBasic; (void)bWrite; - ULONG nArgCount = rPar.Count()-1; + sal_uIntPtr nArgCount = rPar.Count()-1; if ( nArgCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -1247,23 +1247,23 @@ RTLFUNC(Mid) // Anders als im Original kann in dieser Variante der 3. Parameter // nLength nicht weggelassen werden. Ist ueber bWrite schon vorgesehen. if( nArgCount == 4 ) - bWrite = TRUE; + bWrite = sal_True; String aArgStr = rPar.Get(1)->GetString(); - USHORT nStartPos = (USHORT)(rPar.Get(2)->GetLong() ); + sal_uInt16 nStartPos = (sal_uInt16)(rPar.Get(2)->GetLong() ); if ( nStartPos == 0 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { nStartPos--; - USHORT nLen = 0xffff; + sal_uInt16 nLen = 0xffff; bool bWriteNoLenParam = false; if ( nArgCount == 3 || bWrite ) { - INT32 n = rPar.Get(3)->GetLong(); + sal_Int32 n = rPar.Get(3)->GetLong(); if( bWrite && n == -1 ) bWriteNoLenParam = true; - nLen = (USHORT)n; + nLen = (sal_uInt16)n; } String aResultStr; if ( bWrite ) @@ -1272,7 +1272,7 @@ RTLFUNC(Mid) bool bCompatibility = ( pInst && pInst->IsCompatibility() ); if( bCompatibility ) { - USHORT nArgLen = aArgStr.Len(); + sal_uInt16 nArgLen = aArgStr.Len(); if( nStartPos + 1 > nArgLen ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1280,8 +1280,8 @@ RTLFUNC(Mid) } String aReplaceStr = rPar.Get(4)->GetString(); - USHORT nReplaceStrLen = aReplaceStr.Len(); - USHORT nReplaceLen; + sal_uInt16 nReplaceStrLen = aReplaceStr.Len(); + sal_uInt16 nReplaceLen; if( bWriteNoLenParam ) { nReplaceLen = nReplaceStrLen; @@ -1293,12 +1293,12 @@ RTLFUNC(Mid) nReplaceLen = nReplaceStrLen; } - USHORT nReplaceEndPos = nStartPos + nReplaceLen; + sal_uInt16 nReplaceEndPos = nStartPos + nReplaceLen; if( nReplaceEndPos > nArgLen ) nReplaceLen -= (nReplaceEndPos - nArgLen); aResultStr = aArgStr; - USHORT nErase = nReplaceLen; + sal_uInt16 nErase = nReplaceLen; aResultStr.Erase( nStartPos, nErase ); aResultStr.Insert( aReplaceStr, 0, nReplaceLen, nStartPos ); } @@ -1346,7 +1346,7 @@ RTLFUNC(Replace) (void)pBasic; (void)bWrite; - ULONG nArgCount = rPar.Count()-1; + sal_uIntPtr nArgCount = rPar.Count()-1; if ( nArgCount < 3 || nArgCount > 6 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -1355,7 +1355,7 @@ RTLFUNC(Replace) String aFindStr = rPar.Get(2)->GetString(); String aReplaceStr = rPar.Get(3)->GetString(); - INT32 lStartPos = 1; + sal_Int32 lStartPos = 1; if ( nArgCount >= 4 ) { if( rPar.Get(4)->GetType() != SbxEMPTY ) @@ -1367,7 +1367,7 @@ RTLFUNC(Replace) } } - INT32 lCount = -1; + sal_Int32 lCount = -1; if( nArgCount >=5 ) { if( rPar.Get(5)->GetType() != SbxEMPTY ) @@ -1385,7 +1385,7 @@ RTLFUNC(Replace) if( bCompatibility ) { SbiRuntime* pRT = pInst ? pInst->pRun : NULL; - bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE; + bTextMode = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False; } else { @@ -1394,14 +1394,14 @@ RTLFUNC(Replace) if ( nArgCount == 6 ) bTextMode = rPar.Get(6)->GetInteger(); - USHORT nExpStrLen = aExpStr.Len(); - USHORT nFindStrLen = aFindStr.Len(); - USHORT nReplaceStrLen = aReplaceStr.Len(); + sal_uInt16 nExpStrLen = aExpStr.Len(); + sal_uInt16 nFindStrLen = aFindStr.Len(); + sal_uInt16 nReplaceStrLen = aReplaceStr.Len(); if( lStartPos <= nExpStrLen ) { - USHORT nPos = static_cast( lStartPos - 1 ); - USHORT nCounts = 0; + sal_uInt16 nPos = static_cast( lStartPos - 1 ); + sal_uInt16 nCounts = 0; while( lCount == -1 || lCount > nCounts ) { String aSrcStr( aExpStr ); @@ -1423,7 +1423,7 @@ RTLFUNC(Replace) } } } - rPar.Get(0)->PutString( aExpStr.Copy( static_cast(lStartPos - 1) ) ); + rPar.Get(0)->PutString( aExpStr.Copy( static_cast(lStartPos - 1) ) ); } } @@ -1437,7 +1437,7 @@ RTLFUNC(Right) else { const String& rStr = rPar.Get(1)->GetString(); - INT32 lResultLen = rPar.Get(2)->GetLong(); + sal_Int32 lResultLen = rPar.Get(2)->GetLong(); if( lResultLen > 0xffff ) { lResultLen = 0xffff; @@ -1447,8 +1447,8 @@ RTLFUNC(Right) lResultLen = 0; StarBASIC::Error( SbERR_BAD_ARGUMENT ); } - USHORT nResultLen = (USHORT)lResultLen; - USHORT nStrLen = rStr.Len(); + sal_uInt16 nResultLen = (sal_uInt16)lResultLen; + sal_uInt16 nStrLen = rStr.Len(); if ( nResultLen > nStrLen ) nResultLen = nStrLen; String aResultStr = rStr.Copy( nStrLen-nResultLen ); @@ -1489,7 +1489,7 @@ RTLFUNC(Sgn) else { double aDouble = rPar.Get(1)->GetDouble(); - INT16 nResult = 0; + sal_Int16 nResult = 0; if ( aDouble > 0 ) nResult = 1; else if ( aDouble < 0 ) @@ -1508,7 +1508,7 @@ RTLFUNC(Space) else { String aStr; - aStr.Fill( (USHORT)(rPar.Get(1)->GetLong() )); + aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() )); rPar.Get(0)->PutString( aStr ); } } @@ -1523,7 +1523,7 @@ RTLFUNC(Spc) else { String aStr; - aStr.Fill( (USHORT)(rPar.Get(1)->GetLong() )); + aStr.Fill( (sal_uInt16)(rPar.Get(1)->GetLong() )); rPar.Get(0)->PutString( aStr ); } } @@ -1573,11 +1573,11 @@ RTLFUNC(Str) const sal_Unicode* pBuf = aStr.GetBuffer(); bool bNeg = ( pBuf[0] == '-' ); - USHORT iZeroSearch = 0; + sal_uInt16 iZeroSearch = 0; if( bNeg ) iZeroSearch++; - USHORT iNext = iZeroSearch + 1; + sal_uInt16 iNext = iZeroSearch + 1; if( pBuf[iZeroSearch] == '0' && nLen > iNext && pBuf[iNext] == '.' ) { aStr.Erase( iZeroSearch, 1 ); @@ -1608,16 +1608,16 @@ RTLFUNC(StrComp) const String& rStr2 = rPar.Get(2)->GetString(); SbiInstance* pInst = pINST; - INT16 nTextCompare; + sal_Int16 nTextCompare; bool bCompatibility = ( pInst && pInst->IsCompatibility() ); if( bCompatibility ) { SbiRuntime* pRT = pInst ? pInst->pRun : NULL; - nTextCompare = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : FALSE; + nTextCompare = pRT ? pRT->GetImageFlag( SBIMG_COMPARETEXT ) : sal_False; } else { - nTextCompare = TRUE; + nTextCompare = sal_True; } if ( rPar.Count() == 4 ) nTextCompare = rPar.Get(3)->GetInteger(); @@ -1653,7 +1653,7 @@ RTLFUNC(StrComp) nRetValue = 1; } - rPar.Get(0)->PutInteger( sal::static_int_cast< INT16 >( nRetValue ) ); + rPar.Get(0)->PutInteger( sal::static_int_cast< sal_Int16 >( nRetValue ) ); } RTLFUNC(String) @@ -1667,10 +1667,10 @@ RTLFUNC(String) { String aStr; sal_Unicode aFiller; - INT32 lCount = rPar.Get(1)->GetLong(); + sal_Int32 lCount = rPar.Get(1)->GetLong(); if( lCount < 0 || lCount > 0xffff ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); - USHORT nCount = (USHORT)lCount; + sal_uInt16 nCount = (sal_uInt16)lCount; if( rPar.Get(2)->GetType() == SbxINTEGER ) aFiller = (sal_Unicode)rPar.Get(2)->GetInteger(); else @@ -1728,7 +1728,7 @@ RTLFUNC(Val) String aStr( rPar.Get(1)->GetString() ); // lt. Mikkysoft bei Kommas abbrechen! -// for( USHORT n=0; n < aStr.Len(); n++ ) +// for( sal_uInt16 n=0; n < aStr.Len(); n++ ) // if( aStr[n] == ',' ) aStr[n] = '.'; FilterWhiteSpace( aStr ); @@ -1743,7 +1743,7 @@ RTLFUNC(Val) if ( nRadix != 10 ) { ByteString aByteStr( aStr, gsl_getSystemTextEncoding() ); - INT16 nlResult = (INT16)strtol( aByteStr.GetBuffer()+2, &pEndPtr, nRadix); + sal_Int16 nlResult = (sal_Int16)strtol( aByteStr.GetBuffer()+2, &pEndPtr, nRadix); nResult = (double)nlResult; } } @@ -1761,46 +1761,46 @@ RTLFUNC(Val) // Helper functions for date conversion -INT16 implGetDateDay( double aDate ) +sal_Int16 implGetDateDay( double aDate ) { aDate -= 2.0; // normieren: 1.1.1900 => 0.0 Date aRefDate( 1, 1, 1900 ); if ( aDate >= 0.0 ) { aDate = floor( aDate ); - aRefDate += (ULONG)aDate; + aRefDate += (sal_uIntPtr)aDate; } else { aDate = ceil( aDate ); - aRefDate -= (ULONG)(-1.0 * aDate); + aRefDate -= (sal_uIntPtr)(-1.0 * aDate); } - INT16 nRet = (INT16)( aRefDate.GetDay() ); + sal_Int16 nRet = (sal_Int16)( aRefDate.GetDay() ); return nRet; } -INT16 implGetDateMonth( double aDate ) +sal_Int16 implGetDateMonth( double aDate ) { Date aRefDate( 1,1,1900 ); long nDays = (long)aDate; nDays -= 2; // normieren: 1.1.1900 => 0.0 aRefDate += nDays; - INT16 nRet = (INT16)( aRefDate.GetMonth() ); + sal_Int16 nRet = (sal_Int16)( aRefDate.GetMonth() ); return nRet; } -INT16 implGetDateYear( double aDate ) +sal_Int16 implGetDateYear( double aDate ) { Date aRefDate( 1,1,1900 ); long nDays = (long) aDate; nDays -= 2; // normieren: 1.1.1900 => 0.0 aRefDate += nDays; - INT16 nRet = (INT16)( aRefDate.GetYear() ); + sal_Int16 nRet = (sal_Int16)( aRefDate.GetYear() ); return nRet; } -BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ) +sal_Bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ) { if ( nYear < 30 && SbiRuntime::isVBAEnabled() ) nYear += 2000; @@ -1810,7 +1810,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ) if ((nYear < 100 || nYear > 9999) ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); - return FALSE; + return sal_False; } if ( !SbiRuntime::isVBAEnabled() ) { @@ -1818,7 +1818,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ) (nDay < 1 || nDay > 31 ) ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); - return FALSE; + return sal_False; } } else @@ -1833,7 +1833,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ) { // inacurrate around leap year, don't use days to calculate, // just modify the months directory - INT16 nYearAdj = ( nMonth /12 ); // default to positive months inputed + sal_Int16 nYearAdj = ( nMonth /12 ); // default to positive months inputed if ( nMonth <=0 ) nYearAdj = ( ( nMonth -12 ) / 12 ); aCurDate.SetYear( aCurDate.GetYear() + nYearAdj ); @@ -1850,7 +1850,7 @@ BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ) long nDiffDays = GetDayDiff( aCurDate ); rdRet = (double)nDiffDays; - return TRUE; + return sal_True; } // Function to convert date to ISO 8601 date format @@ -1884,14 +1884,14 @@ RTLFUNC(CDateFromIso) if ( rPar.Count() == 2 ) { String aStr = rPar.Get(1)->GetString(); - INT16 iMonthStart = aStr.Len() - 4; + sal_Int16 iMonthStart = aStr.Len() - 4; String aYearStr = aStr.Copy( 0, iMonthStart ); String aMonthStr = aStr.Copy( iMonthStart, 2 ); String aDayStr = aStr.Copy( iMonthStart+2, 2 ); double dDate; - if( implDateSerial( (INT16)aYearStr.ToInt32(), - (INT16)aMonthStr.ToInt32(), (INT16)aDayStr.ToInt32(), dDate ) ) + if( implDateSerial( (sal_Int16)aYearStr.ToInt32(), + (sal_Int16)aMonthStr.ToInt32(), (sal_Int16)aDayStr.ToInt32(), dDate ) ) { rPar.Get(0)->PutDate( dDate ); } @@ -1910,9 +1910,9 @@ RTLFUNC(DateSerial) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nYear = rPar.Get(1)->GetInteger(); - INT16 nMonth = rPar.Get(2)->GetInteger(); - INT16 nDay = rPar.Get(3)->GetInteger(); + sal_Int16 nYear = rPar.Get(1)->GetInteger(); + sal_Int16 nMonth = rPar.Get(2)->GetInteger(); + sal_Int16 nDay = rPar.Get(3)->GetInteger(); double dDate; if( implDateSerial( nYear, nMonth, nDay, dDate ) ) @@ -1929,11 +1929,11 @@ RTLFUNC(TimeSerial) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nHour = rPar.Get(1)->GetInteger(); + sal_Int16 nHour = rPar.Get(1)->GetInteger(); if ( nHour == 24 ) nHour = 0; // Wegen UNO DateTimes, die bis 24 Uhr gehen - INT16 nMinute = rPar.Get(2)->GetInteger(); - INT16 nSecond = rPar.Get(3)->GetInteger(); + sal_Int16 nMinute = rPar.Get(2)->GetInteger(); + sal_Int16 nSecond = rPar.Get(3)->GetInteger(); if ((nHour < 0 || nHour > 23) || (nMinute < 0 || nMinute > 59 ) || (nSecond < 0 || nSecond > 59 )) @@ -1942,7 +1942,7 @@ RTLFUNC(TimeSerial) return; } - INT32 nSeconds = nHour; + sal_Int32 nSeconds = nHour; nSeconds *= 3600; nSeconds += nMinute * 60; nSeconds += nSecond; @@ -1972,7 +1972,7 @@ RTLFUNC(DateValue) sal_uInt32 nIndex; double fResult; String aStr( rPar.Get(1)->GetString() ); - BOOL bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult ); + sal_Bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult ); short nType = pFormatter->GetType( nIndex ); // DateValue("February 12, 1969") raises error if the system locale is not en_US @@ -2033,7 +2033,7 @@ RTLFUNC(TimeValue) sal_uInt32 nIndex; double fResult; - BOOL bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetString(), + sal_Bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetString(), nIndex, fResult ); short nType = pFormatter->GetType(nIndex); if(bSuccess && (nType==NUMBERFORMAT_TIME||nType==NUMBERFORMAT_DATETIME)) @@ -2064,7 +2064,7 @@ RTLFUNC(Day) SbxVariableRef pArg = rPar.Get( 1 ); double aDate = pArg->GetDate(); - INT16 nDay = implGetDateDay( aDate ); + sal_Int16 nDay = implGetDateDay( aDate ); rPar.Get(0)->PutInteger( nDay ); } } @@ -2078,19 +2078,19 @@ RTLFUNC(Year) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - INT16 nYear = implGetDateYear( rPar.Get(1)->GetDate() ); + sal_Int16 nYear = implGetDateYear( rPar.Get(1)->GetDate() ); rPar.Get(0)->PutInteger( nYear ); } } -INT16 implGetHour( double dDate ) +sal_Int16 implGetHour( double dDate ) { if( dDate < 0.0 ) dDate *= -1.0; double nFrac = dDate - floor( dDate ); nFrac *= 86400.0; - INT32 nSeconds = (INT32)(nFrac + 0.5); - INT16 nHour = (INT16)(nSeconds / 3600); + sal_Int32 nSeconds = (sal_Int32)(nFrac + 0.5); + sal_Int16 nHour = (sal_Int16)(nSeconds / 3600); return nHour; } @@ -2104,20 +2104,20 @@ RTLFUNC(Hour) else { double nArg = rPar.Get(1)->GetDate(); - INT16 nHour = implGetHour( nArg ); + sal_Int16 nHour = implGetHour( nArg ); rPar.Get(0)->PutInteger( nHour ); } } -INT16 implGetMinute( double dDate ) +sal_Int16 implGetMinute( double dDate ) { if( dDate < 0.0 ) dDate *= -1.0; double nFrac = dDate - floor( dDate ); nFrac *= 86400.0; - INT32 nSeconds = (INT32)(nFrac + 0.5); - INT16 nTemp = (INT16)(nSeconds % 3600); - INT16 nMin = nTemp / 60; + sal_Int32 nSeconds = (sal_Int32)(nFrac + 0.5); + sal_Int16 nTemp = (sal_Int16)(nSeconds % 3600); + sal_Int16 nMin = nTemp / 60; return nMin; } @@ -2131,7 +2131,7 @@ RTLFUNC(Minute) else { double nArg = rPar.Get(1)->GetDate(); - INT16 nMin = implGetMinute( nArg ); + sal_Int16 nMin = implGetMinute( nArg ); rPar.Get(0)->PutInteger( nMin ); } } @@ -2145,24 +2145,24 @@ RTLFUNC(Month) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - INT16 nMonth = implGetDateMonth( rPar.Get(1)->GetDate() ); + sal_Int16 nMonth = implGetDateMonth( rPar.Get(1)->GetDate() ); rPar.Get(0)->PutInteger( nMonth ); } } -INT16 implGetSecond( double dDate ) +sal_Int16 implGetSecond( double dDate ) { if( dDate < 0.0 ) dDate *= -1.0; double nFrac = dDate - floor( dDate ); nFrac *= 86400.0; - INT32 nSeconds = (INT32)(nFrac + 0.5); - INT16 nTemp = (INT16)(nSeconds / 3600); + sal_Int32 nSeconds = (sal_Int32)(nFrac + 0.5); + sal_Int16 nTemp = (sal_Int16)(nSeconds / 3600); nSeconds -= nTemp * 3600; - nTemp = (INT16)(nSeconds / 60); + nTemp = (sal_Int16)(nSeconds / 60); nSeconds -= nTemp * 60; - INT16 nRet = (INT16)nSeconds; + sal_Int16 nRet = (sal_Int16)nSeconds; return nRet; } @@ -2176,7 +2176,7 @@ RTLFUNC(Second) else { double nArg = rPar.Get(1)->GetDate(); - INT16 nSecond = implGetSecond( nArg ); + sal_Int16 nSecond = implGetSecond( nArg ); rPar.Get(0)->PutInteger( nSecond ); } } @@ -2328,7 +2328,7 @@ RTLFUNC(IsArray) if ( rPar.Count() < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else - rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) ? TRUE : FALSE ); + rPar.Get(0)->PutBool((rPar.Get(1)->GetType() & SbxARRAY) ? sal_True : sal_False ); } RTLFUNC(IsObject) @@ -2347,7 +2347,7 @@ RTLFUNC(IsObject) SbxBase::ResetError(); SbUnoClass* pUnoClass; - BOOL bObject; + sal_Bool bObject; if( pObj && NULL != ( pUnoClass=PTR_CAST(SbUnoClass,pObj) ) ) { bObject = pUnoClass->getUnoClass().is(); @@ -2369,14 +2369,14 @@ RTLFUNC(IsDate) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - // #46134 Nur String wird konvertiert, andere Typen ergeben FALSE + // #46134 Nur String wird konvertiert, andere Typen ergeben sal_False SbxVariableRef xArg = rPar.Get( 1 ); SbxDataType eType = xArg->GetType(); - BOOL bDate = FALSE; + sal_Bool bDate = sal_False; if( eType == SbxDATE ) { - bDate = TRUE; + bDate = sal_True; } else if( eType == SbxSTRING ) { @@ -2432,12 +2432,12 @@ RTLFUNC(IsNull) // #51475 Wegen Uno-Objekten auch true liefern, // wenn der pObj-Wert NULL ist SbxVariableRef pArg = rPar.Get( 1 ); - BOOL bNull = rPar.Get(1)->IsNull(); + sal_Bool bNull = rPar.Get(1)->IsNull(); if( !bNull && pArg->GetType() == SbxOBJECT ) { SbxBase* pObj = pArg->GetObject(); if( !pObj ) - bNull = TRUE; + bNull = sal_True; } rPar.Get( 0 )->PutBool( bNull ); } @@ -2577,7 +2577,7 @@ inline sal_Bool implCheckWildcard( const String& rName, SbiRTLData* pRTLData ) bool isRootDir( String aDirURLStr ) { INetURLObject aDirURLObj( aDirURLStr ); - BOOL bRoot = FALSE; + sal_Bool bRoot = sal_False; // Check if it's a root directory sal_Int32 nCount = aDirURLObj.getSegmentCount(); @@ -2585,22 +2585,22 @@ bool isRootDir( String aDirURLStr ) // No segment means Unix root directory "file:///" if( nCount == 0 ) { - bRoot = TRUE; + bRoot = sal_True; } // Exactly one segment needs further checking, because it // can be Unix "file:///foo/" -> no root // or Windows "file:///c:/" -> root else if( nCount == 1 ) { - ::rtl::OUString aSeg1 = aDirURLObj.getName( 0, TRUE, + ::rtl::OUString aSeg1 = aDirURLObj.getName( 0, sal_True, INetURLObject::DECODE_WITH_CHARSET ); if( aSeg1.getStr()[1] == (sal_Unicode)':' ) { - bRoot = TRUE; + bRoot = sal_True; } } // More than one segments can never be root - // so bRoot remains FALSE + // so bRoot remains sal_False return bRoot; } @@ -2612,7 +2612,7 @@ RTLFUNC(Dir) String aPath; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount > 3 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -2667,7 +2667,7 @@ RTLFUNC(Dir) rPar.Get(0)->PutString( aEmptyStr ); } - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; if ( nParCount > 2 ) pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); else @@ -2681,7 +2681,7 @@ RTLFUNC(Dir) // #78651 Add "." and ".." directories for VB compatibility if( bIncludeFolders ) { - BOOL bRoot = isRootDir( aDirURLStr ); + sal_Bool bRoot = isRootDir( aDirURLStr ); // If it's no root directory we flag the need for // the "." and ".." directories by the value -2 @@ -2751,7 +2751,7 @@ RTLFUNC(Dir) } INetURLObject aURL( aFile ); - aPath = aURL.getName( INetURLObject::LAST_SEGMENT, TRUE, + aPath = aURL.getName( INetURLObject::LAST_SEGMENT, sal_True, INetURLObject::DECODE_WITH_CHARSET ); } @@ -2782,7 +2782,7 @@ RTLFUNC(Dir) rPar.Get(0)->PutString( aEntry.GetName() ); return; } - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; if ( nParCount > 2 ) pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); else @@ -2794,7 +2794,7 @@ RTLFUNC(Dir) else { // Die richtige Auswahl treffen - USHORT nMode = FSYS_KIND_FILE; + sal_uInt16 nMode = FSYS_KIND_FILE; if( nFlags & Sb_ATTR_DIRECTORY ) nMode |= FSYS_KIND_DIR; if( nFlags == Sb_ATTR_DIRECTORY ) @@ -2829,7 +2829,7 @@ RTLFUNC(Dir) String aDirURL = implSetupWildcard( aFileParam, pRTLData ); - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; if ( nParCount > 2 ) pRTLData->nDirFlags = nFlags = rPar.Get(2)->GetInteger(); else @@ -2851,7 +2851,7 @@ RTLFUNC(Dir) pRTLData->nCurDirPos = 0; if( bIncludeFolders ) { - BOOL bRoot = isRootDir( aDirURL ); + sal_Bool bRoot = isRootDir( aDirURL ); // If it's no root directory we flag the need for // the "." and ".." directories by the value -2 @@ -2931,7 +2931,7 @@ RTLFUNC(GetAttr) if ( rPar.Count() == 2 ) { - INT16 nFlags = 0; + sal_Int16 nFlags = 0; // In Windows, We want to use Windows API to get the file attributes // for VBA interoperability. @@ -2948,7 +2948,7 @@ RTLFUNC(GetAttr) { if (nRealFlags == FILE_ATTRIBUTE_NORMAL) nRealFlags = 0; - nFlags = (INT16) (nRealFlags); + nFlags = (sal_Int16) (nRealFlags); } else StarBASIC::Error( SbERR_FILE_NOT_FOUND ); @@ -3114,7 +3114,7 @@ RTLFUNC(EOF) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); // nChannel--; // macht MD beim Oeffnen auch nicht SbiIoSystem* pIO = pINST->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); @@ -3123,7 +3123,7 @@ RTLFUNC(EOF) StarBASIC::Error( SbERR_BAD_CHANNEL ); return; } - BOOL bIsEof; + sal_Bool bIsEof; SvStream* pSvStrm = pSbStrm->GetStrm(); if ( pSbStrm->IsText() ) { @@ -3154,7 +3154,7 @@ RTLFUNC(FileAttr) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); // nChannel--; SbiIoSystem* pIO = pINST->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); @@ -3163,9 +3163,9 @@ RTLFUNC(FileAttr) StarBASIC::Error( SbERR_BAD_CHANNEL ); return; } - INT16 nRet; + sal_Int16 nRet; if ( rPar.Get(2)->GetInteger() == 1 ) - nRet = (INT16)(pSbStrm->GetMode()); + nRet = (sal_Int16)(pSbStrm->GetMode()); else nRet = 0; // System file handle not supported @@ -3182,7 +3182,7 @@ RTLFUNC(Loc) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); SbiIoSystem* pIO = pINST->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3191,7 +3191,7 @@ RTLFUNC(Loc) return; } SvStream* pSvStrm = pSbStrm->GetStrm(); - ULONG nPos; + sal_uIntPtr nPos; if( pSbStrm->IsRandom()) { short nBlockLen = pSbStrm->GetBlockLen(); @@ -3206,7 +3206,7 @@ RTLFUNC(Loc) nPos = ( pSvStrm->Tell()+1 ) / 128; else nPos = pSvStrm->Tell(); - rPar.Get(0)->PutLong( (INT32)nPos ); + rPar.Get(0)->PutLong( (sal_Int32)nPos ); } } @@ -3220,7 +3220,7 @@ RTLFUNC(Lof) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); SbiIoSystem* pIO = pINST->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); if ( !pSbStrm ) @@ -3229,10 +3229,10 @@ RTLFUNC(Lof) return; } SvStream* pSvStrm = pSbStrm->GetStrm(); - ULONG nOldPos = pSvStrm->Tell(); - ULONG nLen = pSvStrm->Seek( STREAM_SEEK_TO_END ); + sal_uIntPtr nOldPos = pSvStrm->Tell(); + sal_uIntPtr nLen = pSvStrm->Seek( STREAM_SEEK_TO_END ); pSvStrm->Seek( nOldPos ); - rPar.Get(0)->PutLong( (INT32)nLen ); + rPar.Get(0)->PutLong( (sal_Int32)nLen ); } } @@ -3249,7 +3249,7 @@ RTLFUNC(Seek) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); // nChannel--; SbiIoSystem* pIO = pINST->GetIoSystem(); SbiStream* pSbStrm = pIO->GetStream( nChannel ); @@ -3262,15 +3262,15 @@ RTLFUNC(Seek) if ( nArgs == 2 ) // Seek-Function { - ULONG nPos = pStrm->Tell(); + sal_uIntPtr nPos = pStrm->Tell(); if( pSbStrm->IsRandom() ) nPos = nPos / pSbStrm->GetBlockLen(); nPos++; // Basic zaehlt ab 1 - rPar.Get(0)->PutLong( (INT32)nPos ); + rPar.Get(0)->PutLong( (sal_Int32)nPos ); } else // Seek-Statement { - INT32 nPos = rPar.Get(2)->GetLong(); + sal_Int32 nPos = rPar.Get(2)->GetLong(); if ( nPos < 1 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -3280,7 +3280,7 @@ RTLFUNC(Seek) pSbStrm->SetExpandOnWriteTo( 0 ); if ( pSbStrm->IsRandom() ) nPos *= pSbStrm->GetBlockLen(); - pStrm->Seek( (ULONG)nPos ); + pStrm->Seek( (sal_uIntPtr)nPos ); pSbStrm->SetExpandOnWriteTo( nPos ); } } @@ -3290,7 +3290,7 @@ RTLFUNC(Format) (void)pBasic; (void)bWrite; - USHORT nArgCount = (USHORT)rPar.Count(); + sal_uInt16 nArgCount = (sal_uInt16)rPar.Count(); if ( nArgCount < 2 || nArgCount > 3 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -3314,11 +3314,11 @@ RTLFUNC(Randomize) if ( rPar.Count() > 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); - INT16 nSeed; + sal_Int16 nSeed; if( rPar.Count() == 2 ) - nSeed = (INT16)rPar.Get(1)->GetInteger(); + nSeed = (sal_Int16)rPar.Get(1)->GetInteger(); else - nSeed = (INT16)rand(); + nSeed = (sal_Int16)rand(); srand( nSeed ); } @@ -3339,7 +3339,7 @@ RTLFUNC(Rnd) // -// Syntax: Shell("Path",[ Window-Style,[ "Params", [ bSync = FALSE ]]]) +// Syntax: Shell("Path",[ Window-Style,[ "Params", [ bSync = sal_False ]]]) // // WindowStyles (VBA-kompatibel): // 2 == Minimized @@ -3363,7 +3363,7 @@ RTLFUNC(Shell) return; } - ULONG nArgCount = rPar.Count(); + sal_uIntPtr nArgCount = rPar.Count(); if ( nArgCount < 2 || nArgCount > 5 ) { rPar.Get(0)->PutLong(0); @@ -3371,7 +3371,7 @@ RTLFUNC(Shell) } else { - USHORT nOptions = vos::OProcess::TOption_SearchPath| + sal_uInt16 nOptions = vos::OProcess::TOption_SearchPath| vos::OProcess::TOption_Detached; String aCmdLine = rPar.Get(1)->GetString(); // Zusaetzliche Parameter anhaengen, es muss eh alles geparsed werden @@ -3385,13 +3385,13 @@ RTLFUNC(Shell) // Spezial-Behandlung (leere Liste) vermeiden aCmdLine.AppendAscii( " " ); } - USHORT nLen = aCmdLine.Len(); + sal_uInt16 nLen = aCmdLine.Len(); // #55735 Wenn Parameter dabei sind, muessen die abgetrennt werden // #72471 Auch die einzelnen Parameter trennen std::list aTokenList; String aToken; - USHORT i = 0; + sal_uInt16 i = 0; sal_Unicode c; while( i < nLen ) { @@ -3405,7 +3405,7 @@ RTLFUNC(Shell) if( c == '\"' || c == '\'' ) { - USHORT iFoundPos = aCmdLine.Search( c, i + 1 ); + sal_uInt16 iFoundPos = aCmdLine.Search( c, i + 1 ); // Wenn nichts gefunden wurde, Rest kopieren if( iFoundPos == STRING_NOTFOUND ) @@ -3421,9 +3421,9 @@ RTLFUNC(Shell) } else { - USHORT iFoundSpacePos = aCmdLine.Search( ' ', i ); - USHORT iFoundTabPos = aCmdLine.Search( '\t', i ); - USHORT iFoundPos = Min( iFoundSpacePos, iFoundTabPos ); + sal_uInt16 iFoundSpacePos = aCmdLine.Search( ' ', i ); + sal_uInt16 iFoundTabPos = aCmdLine.Search( '\t', i ); + sal_uInt16 iFoundPos = Min( iFoundSpacePos, iFoundTabPos ); // Wenn nichts gefunden wurde, Rest kopieren if( iFoundPos == STRING_NOTFOUND ) @@ -3443,7 +3443,7 @@ RTLFUNC(Shell) } // #55735 / #72471 Ende - INT16 nWinStyle = 0; + sal_Int16 nWinStyle = 0; if( nArgCount >= 3 ) { nWinStyle = rPar.Get(2)->GetInteger(); @@ -3460,7 +3460,7 @@ RTLFUNC(Shell) break; } - BOOL bSync = FALSE; + sal_Bool bSync = sal_False; if( nArgCount >= 5 ) bSync = rPar.Get(4)->GetBool(); if( bSync ) @@ -3478,7 +3478,7 @@ RTLFUNC(Shell) iter++; - USHORT nParamCount = sal::static_int_cast< USHORT >( + sal_uInt16 nParamCount = sal::static_int_cast< sal_uInt16 >( aTokenList.size() - 1 ); ::rtl::OUString* pArgumentList = NULL; //const char** pParamList = NULL; @@ -3486,7 +3486,7 @@ RTLFUNC(Shell) { pArgumentList = new ::rtl::OUString[ nParamCount ]; //pParamList = new const char*[ nParamCount ]; - USHORT iList = 0; + sal_uInt16 iList = 0; while( iter != aTokenList.end() ) { const String& rParamStr = (*iter); @@ -3499,7 +3499,7 @@ RTLFUNC(Shell) //const char* pParams = aParams.Len() ? aParams.GetStr() : 0; vos::OProcess* pApp; pApp = new vos::OProcess( aOUStrProgUNC ); - BOOL bSucc; + sal_Bool bSucc; if( nParamCount == 0 ) { bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; @@ -3515,7 +3515,7 @@ RTLFUNC(Shell) pApp = new vos::OProcess( pProg ); else pApp = new vos::OProcess( pProg, pParamList, nParamCount ); - BOOL bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; + sal_Bool bSucc = pApp->execute( eOptions ) == vos::OProcess::E_None; */ delete pApp; @@ -3537,7 +3537,7 @@ RTLFUNC(VarType) else { SbxDataType eType = rPar.Get(1)->GetType(); - rPar.Get(0)->PutInteger( (INT16)eType ); + rPar.Get(0)->PutInteger( (sal_Int16)eType ); } } @@ -3587,7 +3587,7 @@ String getBasicTypeName( SbxDataType eType ) }; int nPos = ((int)eType) & 0x0FFF; - USHORT nTypeNameCount = sizeof( pTypeNames ) / sizeof( char* ); + sal_uInt16 nTypeNameCount = sizeof( pTypeNames ) / sizeof( char* ); if ( nPos < 0 || nPos >= nTypeNameCount ) nPos = nTypeNameCount - 1; String aRetStr = String::CreateFromAscii( pTypeNames[nPos] ); @@ -3604,7 +3604,7 @@ RTLFUNC(TypeName) else { SbxDataType eType = rPar.Get(1)->GetType(); - BOOL bIsArray = ( ( eType & SbxARRAY ) != 0 ); + sal_Bool bIsArray = ( ( eType & SbxARRAY ) != 0 ); String aRetStr = getBasicTypeName( eType ); if( bIsArray ) aRetStr.AppendAscii( "()" ); @@ -3622,7 +3622,7 @@ RTLFUNC(Len) else { const String& rStr = rPar.Get(1)->GetString(); - rPar.Get(0)->PutLong( (INT32)rStr.Len() ); + rPar.Get(0)->PutLong( (sal_Int32)rStr.Len() ); } } @@ -3648,7 +3648,7 @@ RTLFUNC(DDEInitiate) const String& rTopic = rPar.Get(2)->GetString(); SbiDdeControl* pDDE = pINST->GetDdeControl(); - INT16 nChannel; + sal_Int16 nChannel; SbError nDdeErr = pDDE->Initiate( rApp, rTopic, nChannel ); if( nDdeErr ) StarBASIC::Error( nDdeErr ); @@ -3675,7 +3675,7 @@ RTLFUNC(DDETerminate) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); SbiDdeControl* pDDE = pINST->GetDdeControl(); SbError nDdeErr = pDDE->Terminate( nChannel ); if( nDdeErr ) @@ -3727,7 +3727,7 @@ RTLFUNC(DDERequest) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); const String& rItem = rPar.Get(2)->GetString(); SbiDdeControl* pDDE = pINST->GetDdeControl(); String aResult; @@ -3757,7 +3757,7 @@ RTLFUNC(DDEExecute) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); const String& rCommand = rPar.Get(2)->GetString(); SbiDdeControl* pDDE = pINST->GetDdeControl(); SbError nDdeErr = pDDE->Execute( nChannel, rCommand ); @@ -3784,7 +3784,7 @@ RTLFUNC(DDEPoke) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nChannel = rPar.Get(1)->GetInteger(); + sal_Int16 nChannel = rPar.Get(1)->GetInteger(); const String& rItem = rPar.Get(2)->GetString(); const String& rData = rPar.Get(3)->GetString(); SbiDdeControl* pDDE = pINST->GetDdeControl(); @@ -3824,7 +3824,7 @@ RTLFUNC(LBound) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if ( nParCount != 3 && nParCount != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -3834,7 +3834,7 @@ RTLFUNC(LBound) SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj); if( pArr ) { - INT32 nLower, nUpper; + sal_Int32 nLower, nUpper; short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1; if( !pArr->GetDim32( nDim, nLower, nUpper ) ) StarBASIC::Error( SbERR_OUT_OF_RANGE ); @@ -3850,7 +3850,7 @@ RTLFUNC(UBound) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if ( nParCount != 3 && nParCount != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -3861,7 +3861,7 @@ RTLFUNC(UBound) SbxDimArray* pArr = PTR_CAST(SbxDimArray,pParObj); if( pArr ) { - INT32 nLower, nUpper; + sal_Int32 nLower, nUpper; short nDim = (nParCount == 3) ? (short)rPar.Get(2)->GetInteger() : 1; if( !pArr->GetDim32( nDim, nLower, nUpper ) ) StarBASIC::Error( SbERR_OUT_OF_RANGE ); @@ -3883,10 +3883,10 @@ RTLFUNC(RGB) return; } - ULONG nRed = rPar.Get(1)->GetInteger() & 0xFF; - ULONG nGreen = rPar.Get(2)->GetInteger() & 0xFF; - ULONG nBlue = rPar.Get(3)->GetInteger() & 0xFF; - ULONG nRGB; + sal_uIntPtr nRed = rPar.Get(1)->GetInteger() & 0xFF; + sal_uIntPtr nGreen = rPar.Get(2)->GetInteger() & 0xFF; + sal_uIntPtr nBlue = rPar.Get(3)->GetInteger() & 0xFF; + sal_uIntPtr nRGB; SbiInstance* pInst = pINST; bool bCompatibility = ( pInst && pInst->IsCompatibility() ); @@ -3906,7 +3906,7 @@ RTLFUNC(QBColor) (void)pBasic; (void)bWrite; - static const INT32 pRGB[] = + static const sal_Int32 pRGB[] = { 0x000000, 0x800000, @@ -3932,13 +3932,13 @@ RTLFUNC(QBColor) return; } - INT16 nCol = rPar.Get(1)->GetInteger(); + sal_Int16 nCol = rPar.Get(1)->GetInteger(); if( nCol < 0 || nCol > 15 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT32 nRGB = pRGB[ nCol ]; + sal_Int32 nRGB = pRGB[ nCol ]; rPar.Get(0)->PutLong( nRGB ); } @@ -3948,7 +3948,7 @@ RTLFUNC(StrConv) (void)pBasic; (void)bWrite; - ULONG nArgCount = rPar.Count()-1; + sal_uIntPtr nArgCount = rPar.Count()-1; if( nArgCount < 2 || nArgCount > 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -3956,16 +3956,16 @@ RTLFUNC(StrConv) } String aOldStr = rPar.Get(1)->GetString(); - INT32 nConversion = rPar.Get(2)->GetLong(); + sal_Int32 nConversion = rPar.Get(2)->GetLong(); - USHORT nLanguage = LANGUAGE_SYSTEM; + sal_uInt16 nLanguage = LANGUAGE_SYSTEM; if( nArgCount == 3 ) { // LCID not supported now //nLanguage = rPar.Get(3)->GetInteger(); } - USHORT nOldLen = aOldStr.Len(); + sal_uInt16 nOldLen = aOldStr.Len(); if( nOldLen == 0 ) { // null string,return @@ -3973,7 +3973,7 @@ RTLFUNC(StrConv) return; } - INT32 nType = 0; + sal_Int32 nType = 0; if ( (nConversion & 0x03) == 3 ) // vbProperCase { CharClass& rCharClass = GetCharClass(); @@ -4007,10 +4007,10 @@ RTLFUNC(StrConv) if ( (nConversion & 0x40) == 64 ) // vbUnicode { // convert the string to byte string, preserving unicode (2 bytes per character) - USHORT nSize = aNewStr.Len()*2; + sal_uInt16 nSize = aNewStr.Len()*2; const sal_Unicode* pSrc = aNewStr.GetBuffer(); sal_Char* pChar = new sal_Char[nSize+1]; - for( USHORT i=0; i < nSize; i++ ) + for( sal_uInt16 i=0; i < nSize; i++ ) { pChar[i] = static_cast< sal_Char >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff ); if( i%2 ) @@ -4031,7 +4031,7 @@ RTLFUNC(StrConv) // there is no concept about default codepage in unix. so it is incorrectly in unix ::rtl::OString aOStr = ::rtl::OUStringToOString(aNewStr,osl_getThreadTextEncoding()); const sal_Char* pChar = aOStr.getStr(); - USHORT nArraySize = static_cast< USHORT >( aOStr.getLength() ); + sal_uInt16 nArraySize = static_cast< sal_uInt16 >( aOStr.getLength() ); SbxDimArray* pArray = new SbxDimArray(SbxBYTE); bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); if(nArraySize) @@ -4046,7 +4046,7 @@ RTLFUNC(StrConv) pArray->unoAddDim( 0, -1 ); } - for( USHORT i=0; i< nArraySize; i++) + for( sal_uInt16 i=0; i< nArraySize; i++) { SbxVariable* pNew = new SbxVariable( SbxBYTE ); pNew->PutByte(*pChar); @@ -4059,7 +4059,7 @@ RTLFUNC(StrConv) } SbxVariableRef refVar = rPar.Get(0); - USHORT nFlags = refVar->GetFlags(); + sal_uInt16 nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); @@ -4215,17 +4215,17 @@ RTLFUNC(MsgBox) WB_YES_NO, // MB_YESNO WB_RETRY_CANCEL // MB_RETRYCANCEL }; - static const INT16 nButtonMap[] = + static const sal_Int16 nButtonMap[] = { - 2, // #define RET_CANCEL FALSE - 1, // #define RET_OK TRUE + 2, // #define RET_CANCEL sal_False + 1, // #define RET_OK sal_True 6, // #define RET_YES 2 7, // #define RET_NO 3 4 // #define RET_RETRY 4 }; - USHORT nArgCount = (USHORT)rPar.Count(); + sal_uInt16 nArgCount = (sal_uInt16)rPar.Count(); if( nArgCount < 2 || nArgCount > 6 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -4292,11 +4292,11 @@ RTLFUNC(MsgBox) pBox = new MessBox( pParent, nWinBits, aTitle, aMsg ); } pBox->SetText( aTitle ); - USHORT nRet = (USHORT)pBox->Execute(); - if( nRet == TRUE ) + sal_uInt16 nRet = (sal_uInt16)pBox->Execute(); + if( nRet == sal_True ) nRet = 1; - INT16 nMappedRet; + sal_Int16 nMappedRet; if( nStyle == 2 ) { nMappedRet = nRet; @@ -4319,7 +4319,7 @@ RTLFUNC(SetAttr) // JSM if ( rPar.Count() == 3 ) { String aStr = rPar.Get(1)->GetString(); - INT16 nFlags = rPar.Get(2)->GetInteger(); + sal_Int16 nFlags = rPar.Get(2)->GetInteger(); // <-- UCB if( hasUno() ) @@ -4395,7 +4395,7 @@ RTLFUNC(DumpAllObjects) (void)pBasic; (void)bWrite; - USHORT nArgCount = (USHORT)rPar.Count(); + sal_uInt16 nArgCount = (sal_uInt16)rPar.Count(); if( nArgCount < 2 || nArgCount > 3 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else if( !pBasic ) @@ -4423,7 +4423,7 @@ RTLFUNC(FileExists) if ( rPar.Count() == 2 ) { String aStr = rPar.Get(1)->GetString(); - BOOL bExists = FALSE; + sal_Bool bExists = sal_False; // <-- UCB if( hasUno() ) @@ -4470,10 +4470,10 @@ RTLFUNC(Partition) return; } - INT32 nNumber = rPar.Get(1)->GetLong(); - INT32 nStart = rPar.Get(2)->GetLong(); - INT32 nStop = rPar.Get(3)->GetLong(); - INT32 nInterval = rPar.Get(4)->GetLong(); + sal_Int32 nNumber = rPar.Get(1)->GetLong(); + sal_Int32 nStart = rPar.Get(2)->GetLong(); + sal_Int32 nStop = rPar.Get(3)->GetLong(); + sal_Int32 nInterval = rPar.Get(4)->GetLong(); if( nStart < 0 || nStop <= nStart || nInterval < 1 ) { @@ -4490,9 +4490,9 @@ RTLFUNC(Partition) // calculate the maximun number of characters before lowervalue and uppervalue ::rtl::OUString aBeforeStart = ::rtl::OUString::valueOf( nStart - 1 ); ::rtl::OUString aAfterStop = ::rtl::OUString::valueOf( nStop + 1 ); - INT32 nLen1 = aBeforeStart.getLength(); - INT32 nLen2 = aAfterStop.getLength(); - INT32 nLen = nLen1 >= nLen2 ? nLen1:nLen2; + sal_Int32 nLen1 = aBeforeStart.getLength(); + sal_Int32 nLen2 = aAfterStop.getLength(); + sal_Int32 nLen = nLen1 >= nLen2 ? nLen1:nLen2; ::rtl::OUStringBuffer aRetStr( nLen * 2 + 1); ::rtl::OUString aLowerValue; @@ -4507,8 +4507,8 @@ RTLFUNC(Partition) } else { - INT32 nLowerValue = nNumber; - INT32 nUpperValue = nLowerValue; + sal_Int32 nLowerValue = nNumber; + sal_Int32 nUpperValue = nLowerValue; if( nInterval > 1 ) { nLowerValue = ((( nNumber - nStart ) / nInterval ) * nInterval ) + nStart; @@ -4525,14 +4525,14 @@ RTLFUNC(Partition) if( nLen > nLen1 ) { // appending the leading spaces for the lowervalue - for ( INT32 i= (nLen - nLen1) ; i > 0; --i ) + for ( sal_Int32 i= (nLen - nLen1) ; i > 0; --i ) aRetStr.appendAscii(" "); } aRetStr.append( aLowerValue ).appendAscii(":"); if( nLen > nLen2 ) { // appending the leading spaces for the uppervalue - for ( INT32 i= (nLen - nLen2) ; i > 0; --i ) + for ( sal_Int32 i= (nLen - nLen2) ; i > 0; --i ) aRetStr.appendAscii(" "); } aRetStr.append( aUpperValue ); diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 6b955fed3d8a..2f6d18685803 100755 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -117,13 +117,13 @@ RTLFUNC(CallByName) (void)pBasic; (void)bWrite; - const INT16 vbGet = 2; - const INT16 vbLet = 4; - const INT16 vbMethod = 1; - const INT16 vbSet = 8; + const sal_Int16 vbGet = 2; + const sal_Int16 vbLet = 4; + const sal_Int16 vbMethod = 1; + const sal_Int16 vbSet = 8; // At least 3 parameter needed plus function itself -> 4 - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if ( nParCount < 4 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -150,7 +150,7 @@ RTLFUNC(CallByName) String aNameStr = rPar.Get(2)->GetString(); // 3. parameter is CallType - INT16 nCallType = rPar.Get(3)->GetInteger(); + sal_Int16 nCallType = rPar.Get(3)->GetInteger(); //SbxObject* pFindObj = NULL; SbxVariable* pFindVar = pObj->Find( aNameStr, SbxCLASS_DONTCARE ); @@ -209,11 +209,11 @@ RTLFUNC(CallByName) // Setup parameters SbxArrayRef xArray; - USHORT nMethParamCount = nParCount - 4; + sal_uInt16 nMethParamCount = nParCount - 4; if( nMethParamCount > 0 ) { xArray = new SbxArray; - for( USHORT i = 0 ; i < nMethParamCount ; i++ ) + for( sal_uInt16 i = 0 ; i < nMethParamCount ; i++ ) { SbxVariable* pPar = rPar.Get( i + 4 ); xArray->Put( pPar, i + 1 ); @@ -238,7 +238,7 @@ RTLFUNC(CBool) // JSM (void)pBasic; (void)bWrite; - BOOL bVal = FALSE; + sal_Bool bVal = sal_False; if ( rPar.Count() == 2 ) { SbxVariable *pSbxVariable = rPar.Get(1); @@ -255,7 +255,7 @@ RTLFUNC(CByte) // JSM (void)pBasic; (void)bWrite; - BYTE nByte = 0; + sal_uInt8 nByte = 0; if ( rPar.Count() == 2 ) { SbxVariable *pSbxVariable = rPar.Get(1); @@ -356,7 +356,7 @@ RTLFUNC(CInt) // JSM (void)pBasic; (void)bWrite; - INT16 nVal = 0; + sal_Int16 nVal = 0; if ( rPar.Count() == 2 ) { SbxVariable *pSbxVariable = rPar.Get(1); @@ -373,7 +373,7 @@ RTLFUNC(CLng) // JSM (void)pBasic; (void)bWrite; - INT32 nVal = 0; + sal_Int32 nVal = 0; if ( rPar.Count() == 2 ) { SbxVariable *pSbxVariable = rPar.Get(1); @@ -399,7 +399,7 @@ RTLFUNC(CSng) // JSM // AB #41690 , String holen double dVal = 0.0; String aScanStr = pSbxVariable->GetString(); - SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/TRUE ); + SbError Error = SbxValue::ScanNumIntnl( aScanStr, dVal, /*bSingle=*/sal_True ); if( SbxBase::GetError() == SbxERR_OK && Error != SbxERR_OK ) StarBASIC::Error( Error ); nVal = (float)dVal; @@ -454,7 +454,7 @@ RTLFUNC(CVErr) (void)pBasic; (void)bWrite; - INT16 nErrCode = 0; + sal_Int16 nErrCode = 0; if ( rPar.Count() == 2 ) { SbxVariable *pSbxVariable = rPar.Get(1); @@ -525,10 +525,10 @@ RTLFUNC(Red) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - ULONG nRGB = (ULONG)rPar.Get(1)->GetLong(); + sal_uIntPtr nRGB = (sal_uIntPtr)rPar.Get(1)->GetLong(); nRGB &= 0x00FF0000; nRGB >>= 16; - rPar.Get(0)->PutInteger( (INT16)nRGB ); + rPar.Get(0)->PutInteger( (sal_Int16)nRGB ); } } @@ -541,10 +541,10 @@ RTLFUNC(Green) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - ULONG nRGB = (ULONG)rPar.Get(1)->GetLong(); + sal_uIntPtr nRGB = (sal_uIntPtr)rPar.Get(1)->GetLong(); nRGB &= 0x0000FF00; nRGB >>= 8; - rPar.Get(0)->PutInteger( (INT16)nRGB ); + rPar.Get(0)->PutInteger( (sal_Int16)nRGB ); } } @@ -557,9 +557,9 @@ RTLFUNC(Blue) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else { - ULONG nRGB = (ULONG)rPar.Get(1)->GetLong(); + sal_uIntPtr nRGB = (sal_uIntPtr)rPar.Get(1)->GetLong(); nRGB &= 0x000000FF; - rPar.Get(0)->PutInteger( (INT16)nRGB ); + rPar.Get(0)->PutInteger( (sal_Int16)nRGB ); } } @@ -569,11 +569,11 @@ RTLFUNC(Switch) (void)pBasic; (void)bWrite; - USHORT nCount = rPar.Count(); + sal_uInt16 nCount = rPar.Count(); if( !(nCount & 0x0001 )) // Anzahl der Argumente muss ungerade sein StarBASIC::Error( SbERR_BAD_ARGUMENT ); - USHORT nCurExpr = 1; + sal_uInt16 nCurExpr = 1; while( nCurExpr < (nCount-1) ) { if( rPar.Get( nCurExpr )->GetBool()) @@ -671,8 +671,8 @@ RTLFUNC(Choose) if ( rPar.Count() < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); - INT16 nIndex = rPar.Get(1)->GetInteger(); - USHORT nCount = rPar.Count(); + sal_Int16 nIndex = rPar.Get(1)->GetInteger(); + sal_uInt16 nCount = rPar.Count(); nCount--; if( nCount == 1 || nIndex > (nCount-1) || nIndex < 1 ) { @@ -704,7 +704,7 @@ RTLFUNC(GetSolarVersion) (void)pBasic; (void)bWrite; - rPar.Get(0)->PutLong( (INT32)SUPD ); + rPar.Get(0)->PutLong( (sal_Int32)SUPD ); } RTLFUNC(TwipsPerPixelX) @@ -712,7 +712,7 @@ RTLFUNC(TwipsPerPixelX) (void)pBasic; (void)bWrite; - INT32 nResult = 0; + sal_Int32 nResult = 0; Size aSize( 100,0 ); MapMode aMap( MAP_TWIP ); OutputDevice* pDevice = Application::GetDefaultDevice(); @@ -729,7 +729,7 @@ RTLFUNC(TwipsPerPixelY) (void)pBasic; (void)bWrite; - INT32 nResult = 0; + sal_Int32 nResult = 0; Size aSize( 0,100 ); MapMode aMap( MAP_TWIP ); OutputDevice* pDevice = Application::GetDefaultDevice(); @@ -756,7 +756,7 @@ bool IsBaseIndexOne() bool result = false; if ( pINST && pINST->pRun ) { - USHORT res = pINST->pRun->GetBase(); + sal_uInt16 res = pINST->pRun->GetBase(); if ( res ) result = true; } @@ -769,7 +769,7 @@ RTLFUNC(Array) (void)bWrite; SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); - USHORT nArraySize = rPar.Count() - 1; + sal_uInt16 nArraySize = rPar.Count() - 1; // Option Base zunaechst ignorieren (kennt leider nur der Compiler) bool bIncIndex = (IsBaseIndexOne() && SbiRuntime::isVBAEnabled() ); @@ -786,10 +786,10 @@ RTLFUNC(Array) } // Parameter ins Array uebernehmen - // ATTENTION: Using type USHORT for loop variable is + // ATTENTION: Using type sal_uInt16 for loop variable is // mandatory to workaround a problem with the // Solaris Intel compiler optimizer! See i104354 - for( USHORT i = 0 ; i < nArraySize ; i++ ) + for( sal_uInt16 i = 0 ; i < nArraySize ; i++ ) { SbxVariable* pVar = rPar.Get(i+1); SbxVariable* pNew = new SbxVariable( *pVar ); @@ -802,7 +802,7 @@ RTLFUNC(Array) // Array zurueckliefern SbxVariableRef refVar = rPar.Get(0); - USHORT nFlags = refVar->GetFlags(); + sal_uInt16 nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); @@ -823,12 +823,12 @@ RTLFUNC(DimArray) (void)bWrite; SbxDimArray * pArray = new SbxDimArray( SbxVARIANT ); - USHORT nArrayDims = rPar.Count() - 1; + sal_uInt16 nArrayDims = rPar.Count() - 1; if( nArrayDims > 0 ) { - for( USHORT i = 0; i < nArrayDims ; i++ ) + for( sal_uInt16 i = 0; i < nArrayDims ; i++ ) { - INT32 ub = rPar.Get(i+1)->GetLong(); + sal_Int32 ub = rPar.Get(i+1)->GetLong(); if( ub < 0 ) { StarBASIC::Error( SbERR_OUT_OF_RANGE ); @@ -842,7 +842,7 @@ RTLFUNC(DimArray) // Array zurueckliefern SbxVariableRef refVar = rPar.Get(0); - USHORT nFlags = refVar->GetFlags(); + sal_uInt16 nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); @@ -961,12 +961,12 @@ RTLFUNC(FindPropertyObject) -BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, - BOOL bBinary, short nBlockLen, BOOL bIsArray ) +sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, + sal_Bool bBinary, short nBlockLen, sal_Bool bIsArray ) { - ULONG nFPos = pStrm->Tell(); + sal_uIntPtr nFPos = pStrm->Tell(); - BOOL bIsVariant = !rVar.IsFixed(); + sal_Bool bIsVariant = !rVar.IsFixed(); SbxDataType eType = rVar.GetType(); switch( eType ) @@ -975,7 +975,7 @@ BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxCHAR: case SbxBYTE: if( bIsVariant ) - *pStrm << (USHORT)SbxBYTE; // VarType Id + *pStrm << (sal_uInt16)SbxBYTE; // VarType Id *pStrm << rVar.GetByte(); break; @@ -987,7 +987,7 @@ BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxINT: case SbxUINT: if( bIsVariant ) - *pStrm << (USHORT)SbxINTEGER; // VarType Id + *pStrm << (sal_uInt16)SbxINTEGER; // VarType Id *pStrm << rVar.GetInteger(); break; @@ -996,13 +996,13 @@ BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxLONG64: case SbxULONG64: if( bIsVariant ) - *pStrm << (USHORT)SbxLONG; // VarType Id + *pStrm << (sal_uInt16)SbxLONG; // VarType Id *pStrm << rVar.GetLong(); break; case SbxSINGLE: if( bIsVariant ) - *pStrm << (USHORT)eType; // VarType Id + *pStrm << (sal_uInt16)eType; // VarType Id *pStrm << rVar.GetSingle(); break; @@ -1010,7 +1010,7 @@ BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxCURRENCY: case SbxDATE: if( bIsVariant ) - *pStrm << (USHORT)eType; // VarType Id + *pStrm << (sal_uInt16)eType; // VarType Id *pStrm << rVar.GetDouble(); break; @@ -1021,7 +1021,7 @@ BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, if( !bBinary || bIsArray ) { if( bIsVariant ) - *pStrm << (USHORT)SbxSTRING; + *pStrm << (sal_uInt16)SbxSTRING; pStrm->WriteByteString( rStr, gsl_getSystemTextEncoding() ); //*pStrm << rStr; } @@ -1038,31 +1038,31 @@ BOOL lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, default: StarBASIC::Error( SbERR_BAD_ARGUMENT ); - return FALSE; + return sal_False; } if( nBlockLen ) pStrm->Seek( nFPos + nBlockLen ); - return pStrm->GetErrorCode() ? FALSE : TRUE; + return pStrm->GetErrorCode() ? sal_False : sal_True; } -BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, - BOOL bBinary, short nBlockLen, BOOL bIsArray ) +sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, + sal_Bool bBinary, short nBlockLen, sal_Bool bIsArray ) { (void)bBinary; (void)bIsArray; double aDouble; - ULONG nFPos = pStrm->Tell(); + sal_uIntPtr nFPos = pStrm->Tell(); - BOOL bIsVariant = !rVar.IsFixed(); + sal_Bool bIsVariant = !rVar.IsFixed(); SbxDataType eVarType = rVar.GetType(); SbxDataType eSrcType = eVarType; if( bIsVariant ) { - USHORT nTemp; + sal_uInt16 nTemp; *pStrm >> nTemp; eSrcType = (SbxDataType)nTemp; } @@ -1073,7 +1073,7 @@ BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, case SbxCHAR: case SbxBYTE: { - BYTE aByte; + sal_uInt8 aByte; *pStrm >> aByte; rVar.PutByte( aByte ); } @@ -1087,7 +1087,7 @@ BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, case SbxINT: case SbxUINT: { - INT16 aInt; + sal_Int16 aInt; *pStrm >> aInt; rVar.PutInteger( aInt ); } @@ -1098,7 +1098,7 @@ BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, case SbxLONG64: case SbxULONG64: { - INT32 aInt; + sal_Int32 aInt; *pStrm >> aInt; rVar.PutLong( aInt ); } @@ -1138,23 +1138,23 @@ BOOL lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm, default: StarBASIC::Error( SbERR_BAD_ARGUMENT ); - return FALSE; + return sal_False; } if( nBlockLen ) pStrm->Seek( nFPos + nBlockLen ); - return pStrm->GetErrorCode() ? FALSE : TRUE; + return pStrm->GetErrorCode() ? sal_False : sal_True; } // nCurDim = 1...n -BOOL lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, - BOOL bBinary, short nCurDim, short* pOtherDims, BOOL bWrite ) +sal_Bool lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, + sal_Bool bBinary, short nCurDim, short* pOtherDims, sal_Bool bWrite ) { DBG_ASSERT( nCurDim > 0,"Bad Dim"); short nLower, nUpper; if( !rArr.GetDim( nCurDim, nLower, nUpper ) ) - return FALSE; + return sal_False; for( short nCur = nLower; nCur <= nUpper; nCur++ ) { pOtherDims[ nCurDim-1 ] = nCur; @@ -1163,19 +1163,19 @@ BOOL lcl_WriteReadSbxArray( SbxDimArray& rArr, SvStream* pStrm, else { SbxVariable* pVar = rArr.Get( (const short*)pOtherDims ); - BOOL bRet; + sal_Bool bRet; if( bWrite ) - bRet = lcl_WriteSbxVariable(*pVar, pStrm, bBinary, 0, TRUE ); + bRet = lcl_WriteSbxVariable(*pVar, pStrm, bBinary, 0, sal_True ); else - bRet = lcl_ReadSbxVariable(*pVar, pStrm, bBinary, 0, TRUE ); + bRet = lcl_ReadSbxVariable(*pVar, pStrm, bBinary, 0, sal_True ); if( !bRet ) - return FALSE; + return sal_False; } } - return TRUE; + return sal_True; } -void PutGet( SbxArray& rPar, BOOL bPut ) +void PutGet( SbxArray& rPar, sal_Bool bPut ) { // Wir brauchen 3 Parameter if ( rPar.Count() != 4 ) @@ -1183,9 +1183,9 @@ void PutGet( SbxArray& rPar, BOOL bPut ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nFileNo = rPar.Get(1)->GetInteger(); + sal_Int16 nFileNo = rPar.Get(1)->GetInteger(); SbxVariable* pVar2 = rPar.Get(2); - BOOL bHasRecordNo = (BOOL)(pVar2->GetType() != SbxEMPTY); + sal_Bool bHasRecordNo = (sal_Bool)(pVar2->GetType() != SbxEMPTY); long nRecordNo = pVar2->GetLong(); if ( nFileNo < 1 || ( bHasRecordNo && nRecordNo < 1 ) ) { @@ -1203,7 +1203,7 @@ void PutGet( SbxArray& rPar, BOOL bPut ) } SvStream* pStrm = pSbStrm->GetStrm(); - BOOL bRandom = pSbStrm->IsRandom(); + sal_Bool bRandom = pSbStrm->IsRandom(); short nBlockLen = bRandom ? pSbStrm->GetBlockLen() : 0; if( bPut ) @@ -1215,7 +1215,7 @@ void PutGet( SbxArray& rPar, BOOL bPut ) // auf die Startposition seeken if( bHasRecordNo ) { - ULONG nFilePos = bRandom ? (ULONG)(nBlockLen*nRecordNo) : (ULONG)nRecordNo; + sal_uIntPtr nFilePos = bRandom ? (sal_uIntPtr)(nBlockLen*nRecordNo) : (sal_uIntPtr)nRecordNo; pStrm->Seek( nFilePos ); } @@ -1227,11 +1227,11 @@ void PutGet( SbxArray& rPar, BOOL bPut ) pArr = PTR_CAST(SbxDimArray,pParObj); } - BOOL bRet; + sal_Bool bRet; if( pArr ) { - ULONG nFPos = pStrm->Tell(); + sal_uIntPtr nFPos = pStrm->Tell(); short nDims = pArr->GetDims(); short* pDims = new short[ nDims ]; bRet = lcl_WriteReadSbxArray(*pArr,pStrm,!bRandom,nDims,pDims,bPut); @@ -1242,9 +1242,9 @@ void PutGet( SbxArray& rPar, BOOL bPut ) else { if( bPut ) - bRet = lcl_WriteSbxVariable(*pVar, pStrm, !bRandom, nBlockLen, FALSE); + bRet = lcl_WriteSbxVariable(*pVar, pStrm, !bRandom, nBlockLen, sal_False); else - bRet = lcl_ReadSbxVariable(*pVar, pStrm, !bRandom, nBlockLen, FALSE); + bRet = lcl_ReadSbxVariable(*pVar, pStrm, !bRandom, nBlockLen, sal_False); } if( !bRet || pStrm->GetErrorCode() ) StarBASIC::Error( SbERR_IO_ERROR ); @@ -1255,7 +1255,7 @@ RTLFUNC(Put) (void)pBasic; (void)bWrite; - PutGet( rPar, TRUE ); + PutGet( rPar, sal_True ); } RTLFUNC(Get) @@ -1263,7 +1263,7 @@ RTLFUNC(Get) (void)pBasic; (void)bWrite; - PutGet( rPar, FALSE ); + PutGet( rPar, sal_False ); } RTLFUNC(Environ) @@ -1285,7 +1285,7 @@ RTLFUNC(Environ) rPar.Get(0)->PutString( aResult ); } -static double GetDialogZoomFactor( BOOL bX, long nValue ) +static double GetDialogZoomFactor( sal_Bool bX, long nValue ) { OutputDevice* pDevice = Application::GetDefaultDevice(); double nResult = 0; @@ -1325,7 +1325,7 @@ RTLFUNC(GetDialogZoomFactorX) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - rPar.Get(0)->PutDouble( GetDialogZoomFactor( TRUE, rPar.Get(1)->GetLong() )); + rPar.Get(0)->PutDouble( GetDialogZoomFactor( sal_True, rPar.Get(1)->GetLong() )); } RTLFUNC(GetDialogZoomFactorY) @@ -1338,7 +1338,7 @@ RTLFUNC(GetDialogZoomFactorY) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - rPar.Get(0)->PutDouble( GetDialogZoomFactor( FALSE, rPar.Get(1)->GetLong())); + rPar.Get(0)->PutDouble( GetDialogZoomFactor( sal_False, rPar.Get(1)->GetLong())); } @@ -1407,7 +1407,7 @@ RTLFUNC(TypeLen) else { SbxDataType eType = rPar.Get(1)->GetType(); - INT16 nLen = 0; + sal_Int16 nLen = 0; switch( eType ) { case SbxEMPTY: @@ -1462,7 +1462,7 @@ RTLFUNC(TypeLen) case SbxLPWSTR: case SbxCoreSTRING: case SbxSTRING: - nLen = (INT16)rPar.Get(1)->GetString().Len(); + nLen = (sal_Int16)rPar.Get(1)->GetString().Len(); break; default: @@ -1561,7 +1561,7 @@ RTLFUNC(EqualUnoObjects) // Instanciate "com.sun.star.awt.UnoControlDialog" on basis // of a DialogLibrary entry: Convert from XML-ByteSequence // and attach events. Implemented in classes\eventatt.cxx -void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ); +void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ); RTLFUNC(CreateUnoDialog) { @@ -1646,7 +1646,7 @@ RTLFUNC(Join) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if ( nParCount != 3 && nParCount != 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1687,7 +1687,7 @@ RTLFUNC(Split) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if ( nParCount < 2 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1705,7 +1705,7 @@ RTLFUNC(Split) else aDelim = String::CreateFromAscii( " " ); - INT32 nCount = -1; + sal_Int32 nCount = -1; if( nParCount == 4 ) nCount = rPar.Get(3)->GetLong(); @@ -1759,7 +1759,7 @@ RTLFUNC(Split) // Array zurueckliefern SbxVariableRef refVar = rPar.Get(0); - USHORT nFlags = refVar->GetFlags(); + sal_uInt16 nFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nFlags ); @@ -1772,7 +1772,7 @@ RTLFUNC(MonthName) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount != 2 && nParCount != 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1788,14 +1788,14 @@ RTLFUNC(MonthName) Sequence< CalendarItem > aMonthSeq = xCalendar->getMonths(); sal_Int32 nMonthCount = aMonthSeq.getLength(); - INT16 nVal = rPar.Get(1)->GetInteger(); + sal_Int16 nVal = rPar.Get(1)->GetInteger(); if( nVal < 1 || nVal > nMonthCount ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - BOOL bAbbreviate = false; + sal_Bool bAbbreviate = false; if( nParCount == 3 ) bAbbreviate = rPar.Get(2)->GetBool(); @@ -1812,7 +1812,7 @@ RTLFUNC(WeekdayName) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount < 2 || nParCount > 4 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -1827,9 +1827,9 @@ RTLFUNC(WeekdayName) } Sequence< CalendarItem > aDaySeq = xCalendar->getDays(); - INT16 nDayCount = (INT16)aDaySeq.getLength(); - INT16 nDay = rPar.Get(1)->GetInteger(); - INT16 nFirstDay = 0; + sal_Int16 nDayCount = (sal_Int16)aDaySeq.getLength(); + sal_Int16 nDay = rPar.Get(1)->GetInteger(); + sal_Int16 nFirstDay = 0; if( nParCount == 4 ) { nFirstDay = rPar.Get(3)->GetInteger(); @@ -1840,7 +1840,7 @@ RTLFUNC(WeekdayName) } } if( nFirstDay == 0 ) - nFirstDay = INT16( xCalendar->getFirstDayOfWeek() + 1 ); + nFirstDay = sal_Int16( xCalendar->getFirstDayOfWeek() + 1 ); nDay = 1 + (nDay + nDayCount + nFirstDay - 2) % nDayCount; if( nDay < 1 || nDay > nDayCount ) @@ -1849,7 +1849,7 @@ RTLFUNC(WeekdayName) return; } - BOOL bAbbreviate = false; + sal_Bool bAbbreviate = false; if( nParCount >= 3 ) { SbxVariable* pPar2 = rPar.Get(2); @@ -1864,16 +1864,16 @@ RTLFUNC(WeekdayName) rPar.Get(0)->PutString( String(aRetStr) ); } -INT16 implGetWeekDay( double aDate, bool bFirstDayParam = false, INT16 nFirstDay = 0 ) +sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ) { Date aRefDate( 1,1,1900 ); long nDays = (long) aDate; nDays -= 2; // normieren: 1.1.1900 => 0 aRefDate += nDays; DayOfWeek aDay = aRefDate.GetDayOfWeek(); - INT16 nDay; + sal_Int16 nDay; if ( aDay != SUNDAY ) - nDay = (INT16)aDay + 2; + nDay = (sal_Int16)aDay + 2; else nDay = 1; // 1==Sonntag @@ -1893,7 +1893,7 @@ INT16 implGetWeekDay( double aDate, bool bFirstDayParam = false, INT16 nFirstDay StarBASIC::Error( SbERR_INTERNAL_ERROR ); return 0; } - nFirstDay = INT16( xCalendar->getFirstDayOfWeek() + 1 ); + nFirstDay = sal_Int16( xCalendar->getFirstDayOfWeek() + 1 ); } nDay = 1 + (nDay + 7 - nFirstDay) % 7; } @@ -1905,7 +1905,7 @@ RTLFUNC(Weekday) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if ( nParCount < 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); else @@ -1913,13 +1913,13 @@ RTLFUNC(Weekday) double aDate = rPar.Get(1)->GetDate(); bool bFirstDay = false; - INT16 nFirstDay = 0; + sal_Int16 nFirstDay = 0; if ( nParCount > 2 ) { nFirstDay = rPar.Get(2)->GetInteger(); bFirstDay = true; } - INT16 nDay = implGetWeekDay( aDate, bFirstDay, nFirstDay ); + sal_Int16 nDay = implGetWeekDay( aDate, bFirstDay, nFirstDay ); rPar.Get(0)->PutInteger( nDay ); } } @@ -1973,7 +1973,7 @@ static IntervalInfo pIntervalTable[] = IntervalInfo* getIntervalInfo( const String& rStringCode ) { IntervalInfo* pInfo = NULL; - INT16 i = 0; + sal_Int16 i = 0; while( (pInfo = pIntervalTable + i)->mpStringCode != NULL ) { if( rStringCode.EqualsIgnoreCaseAscii( pInfo->mpStringCode ) ) @@ -1984,30 +1984,30 @@ IntervalInfo* getIntervalInfo( const String& rStringCode ) } // From methods.cxx -BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ); -INT16 implGetDateDay( double aDate ); -INT16 implGetDateMonth( double aDate ); -INT16 implGetDateYear( double aDate ); +sal_Bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); +sal_Int16 implGetDateDay( double aDate ); +sal_Int16 implGetDateMonth( double aDate ); +sal_Int16 implGetDateYear( double aDate ); -INT16 implGetHour( double dDate ); -INT16 implGetMinute( double dDate ); -INT16 implGetSecond( double dDate ); +sal_Int16 implGetHour( double dDate ); +sal_Int16 implGetMinute( double dDate ); +sal_Int16 implGetSecond( double dDate ); -inline void implGetDayMonthYear( INT16& rnYear, INT16& rnMonth, INT16& rnDay, double dDate ) +inline void implGetDayMonthYear( sal_Int16& rnYear, sal_Int16& rnMonth, sal_Int16& rnDay, double dDate ) { rnDay = implGetDateDay( dDate ); rnMonth = implGetDateMonth( dDate ); rnYear = implGetDateYear( dDate ); } -inline INT16 limitToINT16( INT32 n32 ) +inline sal_Int16 limitToINT16( sal_Int32 n32 ) { if( n32 > 32767 ) n32 = 32767; else if( n32 < -32768 ) n32 = -32768; - return (INT16)n32; + return (sal_Int16)n32; } RTLFUNC(DateAdd) @@ -2015,7 +2015,7 @@ RTLFUNC(DateAdd) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount != 4 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2030,7 +2030,7 @@ RTLFUNC(DateAdd) return; } - INT32 lNumber = rPar.Get(2)->GetLong(); + sal_Int32 lNumber = rPar.Get(2)->GetLong(); double dDate = rPar.Get(3)->GetDate(); double dNewDate = 0; if( pInfo->mbSimple ) @@ -2043,15 +2043,15 @@ RTLFUNC(DateAdd) // Keep hours, minutes, seconds double dHoursMinutesSeconds = dDate - floor( dDate ); - BOOL bOk = TRUE; - INT16 nYear, nMonth, nDay; - INT16 nTargetYear16 = 0, nTargetMonth = 0; + sal_Bool bOk = sal_True; + sal_Int16 nYear, nMonth, nDay; + sal_Int16 nTargetYear16 = 0, nTargetMonth = 0; implGetDayMonthYear( nYear, nMonth, nDay, dDate ); switch( pInfo->meInterval ) { case INTERVAL_YYYY: { - INT32 nTargetYear = lNumber + nYear; + sal_Int32 nTargetYear = lNumber + nYear; nTargetYear16 = limitToINT16( nTargetYear ); nTargetMonth = nMonth; bOk = implDateSerial( nTargetYear16, nTargetMonth, nDay, dNewDate ); @@ -2063,20 +2063,20 @@ RTLFUNC(DateAdd) bool bNeg = (lNumber < 0); if( bNeg ) lNumber = -lNumber; - INT32 nYearsAdd; - INT16 nMonthAdd; + sal_Int32 nYearsAdd; + sal_Int16 nMonthAdd; if( pInfo->meInterval == INTERVAL_Q ) { nYearsAdd = lNumber / 4; - nMonthAdd = (INT16)( 3 * (lNumber % 4) ); + nMonthAdd = (sal_Int16)( 3 * (lNumber % 4) ); } else { nYearsAdd = lNumber / 12; - nMonthAdd = (INT16)( lNumber % 12 ); + nMonthAdd = (sal_Int16)( lNumber % 12 ); } - INT32 nTargetYear; + sal_Int32 nTargetYear; if( bNeg ) { nTargetMonth = nMonth - nMonthAdd; @@ -2085,7 +2085,7 @@ RTLFUNC(DateAdd) nTargetMonth += 12; nYearsAdd++; } - nTargetYear = (INT32)nYear - nYearsAdd; + nTargetYear = (sal_Int32)nYear - nYearsAdd; } else { @@ -2095,7 +2095,7 @@ RTLFUNC(DateAdd) nTargetMonth -= 12; nYearsAdd++; } - nTargetYear = (INT32)nYear + nYearsAdd; + nTargetYear = (sal_Int32)nYear + nYearsAdd; } nTargetYear16 = limitToINT16( nTargetYear ); bOk = implDateSerial( nTargetYear16, nTargetMonth, nDay, dNewDate ); @@ -2107,14 +2107,14 @@ RTLFUNC(DateAdd) if( bOk ) { // Overflow? - INT16 nNewYear, nNewMonth, nNewDay; + sal_Int16 nNewYear, nNewMonth, nNewDay; implGetDayMonthYear( nNewYear, nNewMonth, nNewDay, dNewDate ); if( nNewYear > 9999 || nNewYear < 100 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - INT16 nCorrectionDay = nDay; + sal_Int16 nCorrectionDay = nDay; while( nNewMonth > nTargetMonth ) { nCorrectionDay--; @@ -2140,7 +2140,7 @@ RTLFUNC(DateDiff) // DateDiff(interval, date1, date2[, firstdayofweek[, firstweekofyear]]) - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount < 4 || nParCount > 6 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2163,30 +2163,30 @@ RTLFUNC(DateDiff) { case INTERVAL_YYYY: { - INT16 nYear1 = implGetDateYear( dDate1 ); - INT16 nYear2 = implGetDateYear( dDate2 ); + sal_Int16 nYear1 = implGetDateYear( dDate1 ); + sal_Int16 nYear2 = implGetDateYear( dDate2 ); dRet = nYear2 - nYear1; break; } case INTERVAL_Q: { - INT16 nYear1 = implGetDateYear( dDate1 ); - INT16 nYear2 = implGetDateYear( dDate2 ); - INT16 nQ1 = 1 + (implGetDateMonth( dDate1 ) - 1) / 3; - INT16 nQ2 = 1 + (implGetDateMonth( dDate2 ) - 1) / 3; - INT16 nQGes1 = 4 * nYear1 + nQ1; - INT16 nQGes2 = 4 * nYear2 + nQ2; + sal_Int16 nYear1 = implGetDateYear( dDate1 ); + sal_Int16 nYear2 = implGetDateYear( dDate2 ); + sal_Int16 nQ1 = 1 + (implGetDateMonth( dDate1 ) - 1) / 3; + sal_Int16 nQ2 = 1 + (implGetDateMonth( dDate2 ) - 1) / 3; + sal_Int16 nQGes1 = 4 * nYear1 + nQ1; + sal_Int16 nQGes2 = 4 * nYear2 + nQ2; dRet = nQGes2 - nQGes1; break; } case INTERVAL_M: { - INT16 nYear1 = implGetDateYear( dDate1 ); - INT16 nYear2 = implGetDateYear( dDate2 ); - INT16 nMonth1 = implGetDateMonth( dDate1 ); - INT16 nMonth2 = implGetDateMonth( dDate2 ); - INT16 nMonthGes1 = 12 * nYear1 + nMonth1; - INT16 nMonthGes2 = 12 * nYear2 + nMonth2; + sal_Int16 nYear1 = implGetDateYear( dDate1 ); + sal_Int16 nYear2 = implGetDateYear( dDate2 ); + sal_Int16 nMonth1 = implGetDateMonth( dDate1 ); + sal_Int16 nMonth2 = implGetDateMonth( dDate2 ); + sal_Int16 nMonthGes1 = 12 * nYear1 + nMonth1; + sal_Int16 nMonthGes2 = 12 * nYear2 + nMonth2; dRet = nMonthGes2 - nMonthGes1; break; } @@ -2205,7 +2205,7 @@ RTLFUNC(DateDiff) double dDays2 = floor( dDate2 ); if( pInfo->meInterval == INTERVAL_WW ) { - INT16 nFirstDay = 1; // Default + sal_Int16 nFirstDay = 1; // Default if( nParCount >= 5 ) { nFirstDay = rPar.Get(4)->GetInteger(); @@ -2222,17 +2222,17 @@ RTLFUNC(DateDiff) StarBASIC::Error( SbERR_INTERNAL_ERROR ); return; } - nFirstDay = INT16( xCalendar->getFirstDayOfWeek() + 1 ); + nFirstDay = sal_Int16( xCalendar->getFirstDayOfWeek() + 1 ); } } - INT16 nDay1 = implGetWeekDay( dDate1 ); - INT16 nDay1_Diff = nDay1 - nFirstDay; + sal_Int16 nDay1 = implGetWeekDay( dDate1 ); + sal_Int16 nDay1_Diff = nDay1 - nFirstDay; if( nDay1_Diff < 0 ) nDay1_Diff += 7; dDays1 -= nDay1_Diff; - INT16 nDay2 = implGetWeekDay( dDate2 ); - INT16 nDay2_Diff = nDay2 - nFirstDay; + sal_Int16 nDay2 = implGetWeekDay( dDate2 ); + sal_Int16 nDay2_Diff = nDay2 - nFirstDay; if( nDay2_Diff < 0 ) nDay2_Diff += 7; dDays2 -= nDay2_Diff; @@ -2267,7 +2267,7 @@ RTLFUNC(DateDiff) } double implGetDateOfFirstDayInFirstWeek - ( INT16 nYear, INT16& nFirstDay, INT16& nFirstWeek, bool* pbError = NULL ) + ( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = NULL ) { SbError nError = 0; if( nFirstDay < 0 || nFirstDay > 7 ) @@ -2293,9 +2293,9 @@ double implGetDateOfFirstDayInFirstWeek } if( nFirstDay == 0 ) - nFirstDay = INT16( xCalendar->getFirstDayOfWeek() + 1 ); + nFirstDay = sal_Int16( xCalendar->getFirstDayOfWeek() + 1 ); - INT16 nFirstWeekMinDays = 0; // Not used for vbFirstJan1 = default + sal_Int16 nFirstWeekMinDays = 0; // Not used for vbFirstJan1 = default if( nFirstWeek == 0 ) { nFirstWeekMinDays = xCalendar->getMinimumNumberOfDaysForFirstWeek(); @@ -2318,14 +2318,14 @@ double implGetDateOfFirstDayInFirstWeek implDateSerial( nYear, 1, 1, dBaseDate ); double dRetDate = dBaseDate; - INT16 nWeekDay0101 = implGetWeekDay( dBaseDate ); - INT16 nDayDiff = nWeekDay0101 - nFirstDay; + sal_Int16 nWeekDay0101 = implGetWeekDay( dBaseDate ); + sal_Int16 nDayDiff = nWeekDay0101 - nFirstDay; if( nDayDiff < 0 ) nDayDiff += 7; if( nFirstWeekMinDays ) { - INT16 nThisWeeksDaysInYearCount = 7 - nDayDiff; + sal_Int16 nThisWeeksDaysInYearCount = 7 - nDayDiff; if( nThisWeeksDaysInYearCount < nFirstWeekMinDays ) nDayDiff -= 7; } @@ -2340,7 +2340,7 @@ RTLFUNC(DatePart) // DatePart(interval, date[,firstdayofweek[, firstweekofyear]]) - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount < 3 || nParCount > 5 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2357,7 +2357,7 @@ RTLFUNC(DatePart) double dDate = rPar.Get(2)->GetDate(); - INT32 nRet = 0; + sal_Int32 nRet = 0; switch( pInfo->meInterval ) { case INTERVAL_YYYY: @@ -2377,10 +2377,10 @@ RTLFUNC(DatePart) } case INTERVAL_Y: { - INT16 nYear = implGetDateYear( dDate ); + sal_Int16 nYear = implGetDateYear( dDate ); double dBaseDate; implDateSerial( nYear, 1, 1, dBaseDate ); - nRet = 1 + INT32( dDate - dBaseDate ); + nRet = 1 + sal_Int32( dDate - dBaseDate ); break; } case INTERVAL_D: @@ -2391,7 +2391,7 @@ RTLFUNC(DatePart) case INTERVAL_W: { bool bFirstDay = false; - INT16 nFirstDay = 1; // Default + sal_Int16 nFirstDay = 1; // Default if( nParCount >= 4 ) { nFirstDay = rPar.Get(3)->GetInteger(); @@ -2402,15 +2402,15 @@ RTLFUNC(DatePart) } case INTERVAL_WW: { - INT16 nFirstDay = 1; // Default + sal_Int16 nFirstDay = 1; // Default if( nParCount >= 4 ) nFirstDay = rPar.Get(3)->GetInteger(); - INT16 nFirstWeek = 1; // Default + sal_Int16 nFirstWeek = 1; // Default if( nParCount == 5 ) nFirstWeek = rPar.Get(4)->GetInteger(); - INT16 nYear = implGetDateYear( dDate ); + sal_Int16 nYear = implGetDateYear( dDate ); bool bError = false; double dYearFirstDay = implGetDateOfFirstDayInFirstWeek( nYear, nFirstDay, nFirstWeek, &bError ); if( !bError ) @@ -2430,7 +2430,7 @@ RTLFUNC(DatePart) // Calculate week double dDiff = dDate - dYearFirstDay; - nRet = 1 + INT32( dDiff / 7 ); + nRet = 1 + sal_Int32( dDiff / 7 ); } break; } @@ -2461,7 +2461,7 @@ RTLFUNC(FormatDateTime) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount < 2 || nParCount > 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2469,7 +2469,7 @@ RTLFUNC(FormatDateTime) } double dDate = rPar.Get(1)->GetDate(); - INT16 nNamedFormat = 0; + sal_Int16 nNamedFormat = 0; if( nParCount > 2 ) { nNamedFormat = rPar.Get(2)->GetInteger(); @@ -2519,7 +2519,7 @@ RTLFUNC(FormatDateTime) } LanguageType eLangType = GetpApp()->GetSettings().GetLanguage(); - ULONG nIndex = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_LONG, eLangType ); + sal_uIntPtr nIndex = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_LONG, eLangType ); Color* pCol; pFormatter->GetOutputString( dDate, nIndex, aRetStr, &pCol ); @@ -2564,7 +2564,7 @@ RTLFUNC(Round) (void)pBasic; (void)bWrite; - USHORT nParCount = rPar.Count(); + sal_uInt16 nParCount = rPar.Count(); if( nParCount != 2 && nParCount != 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2583,7 +2583,7 @@ RTLFUNC(Round) dVal = -dVal; } - INT16 numdecimalplaces = 0; + sal_Int16 numdecimalplaces = 0; if( nParCount == 3 ) { numdecimalplaces = rPar.Get(2)->GetInteger(); @@ -2641,7 +2641,7 @@ RTLFUNC(CompatibilityMode) (void)bWrite; bool bEnabled = false; - USHORT nCount = rPar.Count(); + sal_uInt16 nCount = rPar.Count(); if ( nCount != 1 && nCount != 2 ) StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -2668,8 +2668,8 @@ RTLFUNC(Input) return; } - USHORT nByteCount = rPar.Get(1)->GetUShort(); - INT16 nFileNumber = rPar.Get(2)->GetInteger(); + sal_uInt16 nByteCount = rPar.Get(1)->GetUShort(); + sal_Int16 nFileNumber = rPar.Get(2)->GetInteger(); SbiIoSystem* pIosys = pINST->GetIoSystem(); SbiStream* pSbStrm = pIosys->GetStream( nFileNumber ); diff --git a/basic/source/runtime/props.cxx b/basic/source/runtime/props.cxx index 663d12fbcd72..032b687b987b 100644 --- a/basic/source/runtime/props.cxx +++ b/basic/source/runtime/props.cxx @@ -34,8 +34,8 @@ #include "errobject.hxx" -// Properties und Methoden legen beim Get (bWrite = FALSE) den Returnwert -// im Element 0 des Argv ab; beim Put (bWrite = TRUE) wird der Wert aus +// Properties und Methoden legen beim Get (bWrite = sal_False) den Returnwert +// im Element 0 des Argv ab; beim Put (bWrite = sal_True) wird der Wert aus // Element 0 gespeichert. RTLFUNC(Erl) @@ -59,9 +59,9 @@ RTLFUNC(Err) { if( bWrite ) { - INT32 nVal = rPar.Get( 0 )->GetLong(); + sal_Int32 nVal = rPar.Get( 0 )->GetLong(); if( nVal <= 65535L ) - StarBASIC::Error( StarBASIC::GetSfxFromVBError( (USHORT) nVal ) ); + StarBASIC::Error( StarBASIC::GetSfxFromVBError( (sal_uInt16) nVal ) ); } else rPar.Get( 0 )->PutLong( StarBASIC::GetVBErrorCode( StarBASIC::GetErrBasic() ) ); @@ -73,7 +73,7 @@ RTLFUNC(False) (void)pBasic; (void)bWrite; - rPar.Get(0)->PutBool( FALSE ); + rPar.Get(0)->PutBool( sal_False ); } RTLFUNC(Empty) @@ -114,7 +114,7 @@ RTLFUNC(True) (void)pBasic; (void)bWrite; - rPar.Get( 0 )->PutBool( TRUE ); + rPar.Get( 0 )->PutBool( sal_True ); } RTLFUNC(ATTR_NORMAL) diff --git a/basic/source/runtime/rtlproto.hxx b/basic/source/runtime/rtlproto.hxx index ba7af48c8472..bb8687ee0db6 100644 --- a/basic/source/runtime/rtlproto.hxx +++ b/basic/source/runtime/rtlproto.hxx @@ -28,10 +28,10 @@ #include #include "sbtrace.hxx" -#define RTLFUNC( name ) void SbRtl_##name( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite ) +#define RTLFUNC( name ) void SbRtl_##name( StarBASIC* pBasic, SbxArray& rPar, sal_Bool bWrite ) #define RTLNAME( name ) &SbRtl_##name -typedef void( *RtlCall ) ( StarBASIC* p, SbxArray& rArgs, BOOL bWrite ); +typedef void( *RtlCall ) ( StarBASIC* p, SbxArray& rArgs, sal_Bool bWrite ); // Properties diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 62aa639e4c7e..10d25cc2292b 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -59,13 +59,13 @@ bool SbiRuntime::isVBAEnabled() } // #91147 Global reschedule flag -static BOOL bStaticGlobalEnableReschedule = TRUE; +static sal_Bool bStaticGlobalEnableReschedule = sal_True; -void StarBASIC::StaticEnableReschedule( BOOL bReschedule ) +void StarBASIC::StaticEnableReschedule( sal_Bool bReschedule ) { bStaticGlobalEnableReschedule = bReschedule; } -void StarBASIC::SetVBAEnabled( BOOL bEnabled ) +void StarBASIC::SetVBAEnabled( sal_Bool bEnabled ) { if ( bDocBasic ) { @@ -73,15 +73,15 @@ void StarBASIC::SetVBAEnabled( BOOL bEnabled ) } } -BOOL StarBASIC::isVBAEnabled() +sal_Bool StarBASIC::isVBAEnabled() { if ( bDocBasic ) { if( SbiRuntime::isVBAEnabled() ) - return TRUE; + return sal_True; return bVBAEnabled; } - return FALSE; + return sal_False; } @@ -253,12 +253,12 @@ SbiRTLData::~SbiRTLData() // (siehe auch step2.cxx, SbiRuntime::StepSTMNT() ) // Hilfsfunktion, um den BreakCallLevel gemaess der der Debug-Flags zu ermitteln -void SbiInstance::CalcBreakCallLevel( USHORT nFlags ) +void SbiInstance::CalcBreakCallLevel( sal_uInt16 nFlags ) { // Break-Flag wegfiltern - nFlags &= ~((USHORT)SbDEBUG_BREAK); + nFlags &= ~((sal_uInt16)SbDEBUG_BREAK); - USHORT nRet; + sal_uInt16 nRet; switch( nFlags ) { case SbDEBUG_STEPINTO: @@ -291,8 +291,8 @@ SbiInstance::SbiInstance( StarBASIC* p ) nBreakCallLvl = 0; nErr = nErl = 0; - bReschedule = TRUE; - bCompatibility = FALSE; + bReschedule = sal_True; + bCompatibility = sal_False; } SbiInstance::~SbiInstance() @@ -450,7 +450,7 @@ void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const String& rMsg ) { if( !bWatchMode ) { - SbError n = StarBASIC::GetSfxFromVBError( static_cast< USHORT >( nVBNumber ) ); + SbError n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) ); if ( !n ) n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors @@ -464,7 +464,7 @@ void SbiInstance::ErrorVB( sal_Int32 nVBNumber, const String& rMsg ) void SbiInstance::setErrorVB( sal_Int32 nVBNumber, const String& rMsg ) { - SbError n = StarBASIC::GetSfxFromVBError( static_cast< USHORT >( nVBNumber ) ); + SbError n = StarBASIC::GetSfxFromVBError( static_cast< sal_uInt16 >( nVBNumber ) ); if( !n ) n = nVBNumber; // force orig number, probably should have a specific table of vb ( localized ) errors @@ -515,7 +515,7 @@ SbModule* SbiInstance::GetActiveModule() return NULL; } -SbMethod* SbiInstance::GetCaller( USHORT nLevel ) +SbMethod* SbiInstance::GetCaller( sal_uInt16 nLevel ) { SbiRuntime* p = pRun; while( nLevel-- && p ) @@ -543,7 +543,7 @@ SbxArray* SbiInstance::GetLocals( SbMethod* pMeth ) // Achtung: pMeth kann auch NULL sein (beim Aufruf des Init-Codes) -SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart ) +SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart ) : rBasic( *(StarBASIC*)pm->pParent ), pInst( pINST ), pMod( pm ), pMeth( pe ), pImg( pMod->pImage ), m_nLastTime(0) { @@ -558,11 +558,11 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, UINT32 nStart ) pRestart = NULL; pNext = NULL; pCode = - pStmnt = (const BYTE* ) pImg->GetCode() + nStart; + pStmnt = (const sal_uInt8* ) pImg->GetCode() + nStart; bRun = - bError = TRUE; - bInError = FALSE; - bBlocked = FALSE; + bError = sal_True; + bInError = sal_False; + bBlocked = sal_False; nLine = 0; nCol1 = 0; nCol2 = 0; @@ -615,10 +615,10 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) refParams->Put( pMeth, 0 ); SbxInfo* pInfo = pMeth ? pMeth->GetInfo() : NULL; - USHORT nParamCount = pParams ? pParams->Count() : 1; + sal_uInt16 nParamCount = pParams ? pParams->Count() : 1; if( nParamCount > 1 ) { - for( USHORT i = 1 ; i < nParamCount ; i++ ) + for( sal_uInt16 i = 1 ; i < nParamCount ; i++ ) { const SbxParamInfo* p = pInfo ? pInfo->GetParam( i ) : NULL; @@ -626,9 +626,9 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) if( p && (p->nUserData & PARAM_INFO_PARAMARRAY) != 0 ) { SbxDimArray* pArray = new SbxDimArray( SbxVARIANT ); - USHORT nParamArrayParamCount = nParamCount - i; + sal_uInt16 nParamArrayParamCount = nParamCount - i; pArray->unoAddDim( 0, nParamArrayParamCount - 1 ); - for( USHORT j = i ; j < nParamCount ; j++ ) + for( sal_uInt16 j = i ; j < nParamCount ; j++ ) { SbxVariable* v = pParams->Get( j ); short nDimIndex = j - i; @@ -646,16 +646,16 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) SbxVariable* v = pParams->Get( i ); // Methoden sind immer byval! - BOOL bByVal = v->IsA( TYPE(SbxMethod) ); + sal_Bool bByVal = v->IsA( TYPE(SbxMethod) ); SbxDataType t = v->GetType(); if( p ) { - bByVal |= BOOL( ( p->eType & SbxBYREF ) == 0 ); + bByVal |= sal_Bool( ( p->eType & SbxBYREF ) == 0 ); t = (SbxDataType) ( p->eType & 0x0FFF ); if( !bByVal && t != SbxVARIANT && (!v->IsFixed() || (SbxDataType)(v->GetType() & 0x0FFF ) != t) ) - bByVal = TRUE; + bByVal = sal_True; } if( bByVal ) { @@ -701,7 +701,7 @@ void SbiRuntime::SetParameters( SbxArray* pParams ) // Einen P-Code ausfuehren -BOOL SbiRuntime::Step() +sal_Bool SbiRuntime::Step() { if( bRun ) { @@ -724,12 +724,12 @@ BOOL SbiRuntime::Step() } #ifdef DBG_TRACE_BASIC - UINT32 nPC = ( pCode - (const BYTE* )pImg->GetCode() ); + sal_uInt32 nPC = ( pCode - (const sal_uInt8* )pImg->GetCode() ); dbg_traceStep( pMod, nPC, pINST->nCallLvl ); #endif SbiOpcode eOp = (SbiOpcode ) ( *pCode++ ); - UINT32 nOp1, nOp2; + sal_uInt32 nOp1, nOp2; if( eOp <= SbOP0_END ) { (this->*( aStep0[ eOp ] ) )(); @@ -784,7 +784,7 @@ BOOL SbiRuntime::Step() // Im Error Handler? Dann Std-Error if ( !bInError ) { - bInError = TRUE; + bInError = sal_True; if( !bError ) // On Error Resume Next StepRESUME( 1 ); @@ -809,7 +809,7 @@ BOOL SbiRuntime::Step() while( NULL != (pRt = pRt->pNext) ) { // Gibt es einen Error-Handler? - if( pRt->bError == FALSE || pRt->pError != NULL ) + if( pRt->bError == sal_False || pRt->pError != NULL ) { pRtErrHdl = pRt; break; @@ -832,7 +832,7 @@ BOOL SbiRuntime::Step() // Fehler setzen pRt->nError = err; if( pRt != pRtErrHdl ) - pRt->bRun = FALSE; + pRt->bRun = sal_False; // In Error-Stack eintragen SbErrorStackEntry *pEntry = new SbErrorStackEntry @@ -928,7 +928,7 @@ sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, String& rMsg ) { // TEST, has to be vb here always #ifdef DBG_UTIL - SbError nTmp = StarBASIC::GetSfxFromVBError( (USHORT)nError ); + SbError nTmp = StarBASIC::GetSfxFromVBError( (sal_uInt16)nError ); DBG_ASSERT( nTmp, "No VB error!" ); #endif @@ -938,7 +938,7 @@ sal_Int32 SbiRuntime::translateErrorToVba( SbError nError, String& rMsg ) rMsg = String( RTL_CONSTASCII_USTRINGPARAM("Internal Object Error:") ); } // no num? most likely then it *is* really a vba err - USHORT nVBErrorCode = StarBASIC::GetVBErrorCode( nError ); + sal_uInt16 nVBErrorCode = StarBASIC::GetVBErrorCode( nError ); sal_Int32 nVBAErrorNumber = ( nVBErrorCode == 0 ) ? nError : nVBErrorCode; return nVBAErrorNumber; } @@ -999,7 +999,7 @@ SbxVariableRef SbiRuntime::PopVar() return xVar; } -BOOL SbiRuntime::ClearExprStack() +sal_Bool SbiRuntime::ClearExprStack() { // Achtung: Clear() reicht nicht, da Methods geloescht werden muessen while ( nExprLvl ) @@ -1007,7 +1007,7 @@ BOOL SbiRuntime::ClearExprStack() PopVar(); } refExprStk->Clear(); - return FALSE; + return sal_False; } // Variable auf dem Expression-Stack holen, ohne sie zu entfernen @@ -1023,7 +1023,7 @@ SbxVariable* SbiRuntime::GetTOS( short n ) return new SbxVariable; } #endif - return refExprStk->Get( (USHORT) n ); + return refExprStk->Get( (sal_uInt16) n ); } // Sicherstellen, dass TOS eine temporaere Variable ist @@ -1041,7 +1041,7 @@ void SbiRuntime::TOSMakeTemp() // Der GOSUB-Stack nimmt Returnadressen fuer GOSUBs auf -void SbiRuntime::PushGosub( const BYTE* pc ) +void SbiRuntime::PushGosub( const sal_uInt8* pc ) { if( ++nGosubLvl > MAXRECURSION ) StarBASIC::FatalError( SbERR_STACK_OVERFLOW ); @@ -1248,7 +1248,7 @@ void SbiRuntime::DllCall const String& aDLLName, // Name der DLL SbxArray* pArgs, // Parameter (ab Index 1, kann NULL sein) SbxDataType eResType, // Returnwert - BOOL bCDecl ) // TRUE: nach C-Konventionen + sal_Bool bCDecl ) // sal_True: nach C-Konventionen { // No DllCall for "virtual" portal users if( needSecurityRestrictions() ) @@ -1275,13 +1275,13 @@ void SbiRuntime::DllCall Error( nErr ); PushVar( pRes ); } -USHORT -SbiRuntime::GetImageFlag( USHORT n ) const + +sal_uInt16 SbiRuntime::GetImageFlag( sal_uInt16 n ) const { return pImg->GetFlag( n ); } -USHORT -SbiRuntime::GetBase() + +sal_uInt16 SbiRuntime::GetBase() { return pImg->GetBase(); } diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx index 39f92afdea4a..ecc0dfb3321b 100644 --- a/basic/source/runtime/stdobj.cxx +++ b/basic/source/runtime/stdobj.cxx @@ -66,7 +66,7 @@ struct Methods { SbxDataType eType; // Datentyp short nArgs; // Argumente und Flags RtlCall pFunc; // Function Pointer - USHORT nHash; // Hashcode + sal_uInt16 nHash; // Hashcode }; static Methods aMethods[] = { @@ -673,11 +673,11 @@ SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t ) if( !pVar ) { // sonst suchen - USHORT nHash_ = SbxVariable::MakeHashCode( rName ); + sal_uInt16 nHash_ = SbxVariable::MakeHashCode( rName ); Methods* p = aMethods; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; short nIndex = 0; - USHORT nSrchMask = _TYPEMASK; + sal_uInt16 nSrchMask = _TYPEMASK; switch( t ) { case SbxCLASS_METHOD: nSrchMask = _METHOD; break; @@ -691,12 +691,12 @@ SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t ) && ( p->nHash == nHash_ ) && ( rName.EqualsIgnoreCaseAscii( p->pName ) ) ) { - bFound = TRUE; + bFound = sal_True; if( p->nArgs & _COMPTMASK ) { SbiInstance* pInst = pINST; if( !pInst || !pInst->IsCompatibility() ) - bFound = FALSE; + bFound = sal_False; } break; } @@ -726,7 +726,7 @@ SbxVariable* SbiStdObject::Find( const String& rName, SbxClassType t ) } // SetModified muß bei der RTL abgklemmt werden -void SbiStdObject::SetModified( BOOL ) +void SbiStdObject::SetModified( sal_Bool ) { } @@ -741,17 +741,17 @@ void SbiStdObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - ULONG t = pHint->GetId(); - USHORT nCallId = (USHORT) pVar->GetUserData(); + sal_uIntPtr t = pHint->GetId(); + sal_uInt16 nCallId = (sal_uInt16) pVar->GetUserData(); if( nCallId ) { if( t == SBX_HINT_INFOWANTED ) pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); else { - BOOL bWrite = FALSE; + sal_Bool bWrite = sal_False; if( t == SBX_HINT_DATACHANGED ) - bWrite = TRUE; + bWrite = sal_True; if( t == SBX_HINT_DATAWANTED || bWrite ) { RtlCall p = (RtlCall) aMethods[ nCallId-1 ].pFunc; @@ -786,7 +786,7 @@ SbxInfo* SbiStdObject::GetInfo( short nIdx ) { p++; String aName_ = String::CreateFromAscii( p->pName ); - USHORT nFlags_ = ( p->nArgs >> 8 ) & 0x03; + sal_uInt16 nFlags_ = ( p->nArgs >> 8 ) & 0x03; if( p->nArgs & _OPT ) nFlags_ |= SBX_OPTIONAL; pInfo_->AddParam( aName_, p->eType, nFlags_ ); diff --git a/basic/source/runtime/stdobj1.cxx b/basic/source/runtime/stdobj1.cxx index 94b7973c7e77..29cbf16125c7 100644 --- a/basic/source/runtime/stdobj1.cxx +++ b/basic/source/runtime/stdobj1.cxx @@ -71,7 +71,7 @@ SbxObject* SbStdFactory::CreateObject( const String& rClassName ) -void SbStdPicture::PropType( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdPicture::PropType( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) { @@ -80,7 +80,7 @@ void SbStdPicture::PropType( SbxVariable* pVar, SbxArray*, BOOL bWrite ) } GraphicType eType = aGraphic.GetType(); - INT16 nType = 0; + sal_Int16 nType = 0; if( eType == GRAPHIC_BITMAP ) nType = 1; @@ -92,7 +92,7 @@ void SbStdPicture::PropType( SbxVariable* pVar, SbxArray*, BOOL bWrite ) } -void SbStdPicture::PropWidth( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdPicture::PropWidth( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) { @@ -104,10 +104,10 @@ void SbStdPicture::PropWidth( SbxVariable* pVar, SbxArray*, BOOL bWrite ) aSize = GetpApp()->GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() ); aSize = GetpApp()->GetAppWindow()->PixelToLogic( aSize, MapMode( MAP_TWIP ) ); - pVar->PutInteger( (INT16)aSize.Width() ); + pVar->PutInteger( (sal_Int16)aSize.Width() ); } -void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) { @@ -119,7 +119,7 @@ void SbStdPicture::PropHeight( SbxVariable* pVar, SbxArray*, BOOL bWrite ) aSize = GetpApp()->GetAppWindow()->LogicToPixel( aSize, aGraphic.GetPrefMapMode() ); aSize = GetpApp()->GetAppWindow()->PixelToLogic( aSize, MapMode( MAP_TWIP ) ); - pVar->PutInteger( (INT16)aSize.Height() ); + pVar->PutInteger( (sal_Int16)aSize.Height() ); } @@ -169,8 +169,8 @@ void SbStdPicture::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - USHORT nWhich = (USHORT)pVar->GetUserData(); - BOOL bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + sal_uInt16 nWhich = (sal_uInt16)pVar->GetUserData(); + sal_Bool bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; // Propteries switch( nWhich ) @@ -186,7 +186,7 @@ void SbStdPicture::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, //----------------------------------------------------------------------------- -void SbStdFont::PropBold( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdFont::PropBold( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) SetBold( pVar->GetBool() ); @@ -194,7 +194,7 @@ void SbStdFont::PropBold( SbxVariable* pVar, SbxArray*, BOOL bWrite ) pVar->PutBool( IsBold() ); } -void SbStdFont::PropItalic( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdFont::PropItalic( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) SetItalic( pVar->GetBool() ); @@ -202,7 +202,7 @@ void SbStdFont::PropItalic( SbxVariable* pVar, SbxArray*, BOOL bWrite ) pVar->PutBool( IsItalic() ); } -void SbStdFont::PropStrikeThrough( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdFont::PropStrikeThrough( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) SetStrikeThrough( pVar->GetBool() ); @@ -210,7 +210,7 @@ void SbStdFont::PropStrikeThrough( SbxVariable* pVar, SbxArray*, BOOL bWrite ) pVar->PutBool( IsStrikeThrough() ); } -void SbStdFont::PropUnderline( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdFont::PropUnderline( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) SetUnderline( pVar->GetBool() ); @@ -218,15 +218,15 @@ void SbStdFont::PropUnderline( SbxVariable* pVar, SbxArray*, BOOL bWrite ) pVar->PutBool( IsUnderline() ); } -void SbStdFont::PropSize( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdFont::PropSize( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) - SetSize( (USHORT)pVar->GetInteger() ); + SetSize( (sal_uInt16)pVar->GetInteger() ); else - pVar->PutInteger( (INT16)GetSize() ); + pVar->PutInteger( (sal_Int16)GetSize() ); } -void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, BOOL bWrite ) +void SbStdFont::PropName( SbxVariable* pVar, SbxArray*, sal_Bool bWrite ) { if( bWrite ) SetFontName( pVar->GetString() ); @@ -291,8 +291,8 @@ void SbStdFont::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - USHORT nWhich = (USHORT)pVar->GetUserData(); - BOOL bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + sal_uInt16 nWhich = (sal_uInt16)pVar->GetUserData(); + sal_Bool bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; // Propteries switch( nWhich ) @@ -348,7 +348,7 @@ sal_Bool TransferableHelperImpl::GetData( const ::com::sun::star::datatransfer:: } */ -void SbStdClipboard::MethClear( SbxVariable*, SbxArray* pPar_, BOOL ) +void SbStdClipboard::MethClear( SbxVariable*, SbxArray* pPar_, sal_Bool ) { if( pPar_ && (pPar_->Count() > 1) ) { @@ -359,7 +359,7 @@ void SbStdClipboard::MethClear( SbxVariable*, SbxArray* pPar_, BOOL ) //Clipboard::Clear(); } -void SbStdClipboard::MethGetData( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SbStdClipboard::MethGetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { (void)pVar; @@ -369,7 +369,7 @@ void SbStdClipboard::MethGetData( SbxVariable* pVar, SbxArray* pPar_, BOOL ) return; } - USHORT nFormat = pPar_->Get(1)->GetInteger(); + sal_uInt16 nFormat = pPar_->Get(1)->GetInteger(); if( !nFormat || nFormat > 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -392,7 +392,7 @@ void SbStdClipboard::MethGetData( SbxVariable* pVar, SbxArray* pPar_, BOOL ) */ } -void SbStdClipboard::MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SbStdClipboard::MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { if( !pPar_ || (pPar_->Count() != 2) ) { @@ -400,18 +400,18 @@ void SbStdClipboard::MethGetFormat( SbxVariable* pVar, SbxArray* pPar_, BOOL ) return; } - USHORT nFormat = pPar_->Get(1)->GetInteger(); + sal_uInt16 nFormat = pPar_->Get(1)->GetInteger(); if( !nFormat || nFormat > 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } - pVar->PutBool( FALSE ); + pVar->PutBool( sal_False ); //pVar->PutBool( Clipboard::HasFormat( nFormat ) ); } -void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { if( pPar_ && (pPar_->Count() > 1) ) { @@ -423,7 +423,7 @@ void SbStdClipboard::MethGetText( SbxVariable* pVar, SbxArray* pPar_, BOOL ) //pVar->PutString( Clipboard::PasteString() ); } -void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { (void)pVar; @@ -433,7 +433,7 @@ void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar_, BOOL ) return; } - USHORT nFormat = pPar_->Get(2)->GetInteger(); + sal_uInt16 nFormat = pPar_->Get(2)->GetInteger(); if( !nFormat || nFormat > 3 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -457,7 +457,7 @@ void SbStdClipboard::MethSetData( SbxVariable* pVar, SbxArray* pPar_, BOOL ) */ } -void SbStdClipboard::MethSetText( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SbStdClipboard::MethSetText( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { (void)pVar; @@ -530,8 +530,8 @@ void SbStdClipboard::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - USHORT nWhich = (USHORT)pVar->GetUserData(); - BOOL bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; + sal_uInt16 nWhich = (sal_uInt16)pVar->GetUserData(); + sal_Bool bWrite = pHint->GetId() == SBX_HINT_DATACHANGED; // Methods switch( nWhich ) diff --git a/basic/source/runtime/step0.cxx b/basic/source/runtime/step0.cxx index c686b0ed80ed..43c930e975d2 100644 --- a/basic/source/runtime/step0.cxx +++ b/basic/source/runtime/step0.cxx @@ -147,7 +147,7 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) if( !pTRUE ) { pTRUE = new SbxVariable; - pTRUE->PutBool( TRUE ); + pTRUE->PutBool( sal_True ); pTRUE->AddRef(); } PushVar( pTRUE ); @@ -157,7 +157,7 @@ void SbiRuntime::StepCompare( SbxOperator eOp ) if( !pFALSE ) { pFALSE = new SbxVariable; - pFALSE->PutBool( FALSE ); + pFALSE->PutBool( sal_False ); pFALSE->AddRef(); } PushVar( pFALSE ); @@ -320,7 +320,7 @@ void SbiRuntime::StepIS() eType2 = refVar2->GetType(); } - BOOL bRes = BOOL( eType1 == SbxOBJECT && eType2 == SbxOBJECT ); + sal_Bool bRes = sal_Bool( eType1 == SbxOBJECT && eType2 == SbxOBJECT ); if ( bVBAEnabled && !bRes ) Error( SbERR_INVALID_USAGE_OBJECT ); bRes = ( bRes && refVar1->GetObject() == refVar2->GetObject() ); @@ -379,11 +379,11 @@ void SbiRuntime::StepPUT() SbxVariableRef refVal = PopVar(); SbxVariableRef refVar = PopVar(); // Store auf die eigene Methode (innerhalb einer Function)? - BOOL bFlagsChanged = FALSE; - USHORT n = 0; + sal_Bool bFlagsChanged = sal_False; + sal_uInt16 n = 0; if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { - bFlagsChanged = TRUE; + bFlagsChanged = sal_True; n = refVar->GetFlags(); refVar->SetFlag( SBX_WRITE ); } @@ -515,11 +515,11 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b else { // Store auf die eigene Methode (innerhalb einer Function)? - BOOL bFlagsChanged = FALSE; - USHORT n = 0; + sal_Bool bFlagsChanged = sal_False; + sal_uInt16 n = 0; if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) { - bFlagsChanged = TRUE; + bFlagsChanged = sal_True; n = refVar->GetFlags(); refVar->SetFlag( SBX_WRITE ); } @@ -569,13 +569,13 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b } // Handle Dim As New - BOOL bDimAsNew = bVBAEnabled && refVar->IsSet( SBX_DIM_AS_NEW ); + sal_Bool bDimAsNew = bVBAEnabled && refVar->IsSet( SBX_DIM_AS_NEW ); SbxBaseRef xPrevVarObj; if( bDimAsNew ) xPrevVarObj = refVar->GetObject(); // Handle withevents - BOOL bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); + sal_Bool bWithEvents = refVar->IsSet( SBX_WITH_EVENTS ); if ( bWithEvents ) { Reference< XInterface > xComListener; @@ -704,14 +704,14 @@ void SbiRuntime::StepLSET() else { // Store auf die eigene Methode (innerhalb einer Function)? - USHORT n = refVar->GetFlags(); + sal_uInt16 n = refVar->GetFlags(); if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) refVar->SetFlag( SBX_WRITE ); String aRefVarString = refVar->GetString(); String aRefValString = refVal->GetString(); - USHORT nVarStrLen = aRefVarString.Len(); - USHORT nValStrLen = aRefValString.Len(); + sal_uInt16 nVarStrLen = aRefVarString.Len(); + sal_uInt16 nValStrLen = aRefValString.Len(); String aNewStr; if( nVarStrLen > nValStrLen ) { @@ -740,14 +740,14 @@ void SbiRuntime::StepRSET() else { // Store auf die eigene Methode (innerhalb einer Function)? - USHORT n = refVar->GetFlags(); + sal_uInt16 n = refVar->GetFlags(); if( (SbxVariable*) refVar == (SbxVariable*) pMeth ) refVar->SetFlag( SBX_WRITE ); String aRefVarString = refVar->GetString(); String aRefValString = refVal->GetString(); - USHORT nPos = 0; - USHORT nVarStrLen = aRefVarString.Len(); + sal_uInt16 nPos = 0; + sal_uInt16 nVarStrLen = aRefVarString.Len(); if( nVarStrLen > aRefValString.Len() ) { aRefVarString.Fill(nVarStrLen,' '); @@ -797,10 +797,10 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar ) // AB 2.4.1996, auch Arrays ohne Dimensionsangaben zulassen (VB-komp.) if( pDims ) { - for( USHORT i = 1; i < pDims->Count(); ) + for( sal_uInt16 i = 1; i < pDims->Count(); ) { - INT32 lb = pDims->Get( i++ )->GetLong(); - INT32 ub = pDims->Get( i++ )->GetLong(); + sal_Int32 lb = pDims->Get( i++ )->GetLong(); + sal_Int32 ub = pDims->Get( i++ )->GetLong(); if( ub < lb ) Error( SbERR_OUT_OF_RANGE ), ub = lb; pArray->AddDim32( lb, ub ); @@ -814,7 +814,7 @@ void SbiRuntime::DimImpl( SbxVariableRef refVar ) // Uno-Sequences der Laenge 0 eine Dimension anlegen pArray->unoAddDim( 0, -1 ); } - USHORT nSavFlags = refVar->GetFlags(); + sal_uInt16 nSavFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->PutObject( pArray ); refVar->SetFlags( nSavFlags ); @@ -876,7 +876,7 @@ void SbiRuntime::StepREDIMP() short nDimsNew = pNewArray->GetDims(); short nDimsOld = pOldArray->GetDims(); short nDims = nDimsNew; - BOOL bRangeError = FALSE; + sal_Bool bRangeError = sal_False; // Store dims to use them for copying later sal_Int32* pLowerBounds = new sal_Int32[nDims]; @@ -885,7 +885,7 @@ void SbiRuntime::StepREDIMP() if( nDimsOld != nDimsNew ) { - bRangeError = TRUE; + bRangeError = sal_True; } else { @@ -902,7 +902,7 @@ void SbiRuntime::StepREDIMP() // All bounds but the last have to be the same if( i < nDims && ( lBoundNew != lBoundOld || uBoundNew != uBoundOld ) ) { - bRangeError = TRUE; + bRangeError = sal_True; break; } else @@ -961,7 +961,7 @@ void SbiRuntime::StepREDIMP_ERASE() } // As in ERASE - USHORT nSavFlags = refVar->GetFlags(); + sal_uInt16 nSavFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->SetType( SbxDataType(eType & 0x0FFF) ); refVar->SetFlags( nSavFlags ); @@ -976,7 +976,7 @@ void SbiRuntime::StepREDIMP_ERASE() void lcl_clearImpl( SbxVariableRef& refVar, SbxDataType& eType ) { - USHORT nSavFlags = refVar->GetFlags(); + sal_uInt16 nSavFlags = refVar->GetFlags(); refVar->ResetFlag( SBX_FIXED ); refVar->SetType( SbxDataType(eType & 0x0FFF) ); refVar->SetFlags( nSavFlags ); @@ -1148,7 +1148,7 @@ void SbiRuntime::StepINPUT() // zu fuellen, dann mit einem Stringwert if( !pVar->IsFixed() || pVar->IsNumeric() ) { - USHORT nLen = 0; + sal_uInt16 nLen = 0; if( !pVar->Scan( s, &nLen ) ) { err = SbxBase::GetError(); @@ -1271,7 +1271,7 @@ void SbiRuntime::StepENDCASE() void SbiRuntime::StepSTDERROR() { - pError = NULL; bError = TRUE; + pError = NULL; bError = sal_True; pInst->aErrorMsg = String(); pInst->nErr = 0L; pInst->nErl = 0; @@ -1286,14 +1286,14 @@ void SbiRuntime::StepNOERROR() pInst->nErl = 0; nError = 0L; SbxErrObject::getUnoErrObject()->Clear(); - bError = FALSE; + bError = sal_False; } // UP verlassen void SbiRuntime::StepLEAVE() { - bRun = FALSE; + bRun = sal_False; // If VBA and we are leaving an ErrorHandler then clear the error ( it's been processed ) if ( bInError && pError ) SbxErrObject::getUnoErrObject()->Clear(); @@ -1428,7 +1428,7 @@ void SbiRuntime::StepEMPTY() void SbiRuntime::StepERROR() { SbxVariableRef refCode = PopVar(); - USHORT n = refCode->GetUShort(); + sal_uInt16 n = refCode->GetUShort(); SbError error = StarBASIC::GetSfxFromVBError( n ); if ( bVBAEnabled ) pInst->Error( error ); diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx index e23ef864218e..0a9572906cc8 100644 --- a/basic/source/runtime/step1.cxx +++ b/basic/source/runtime/step1.cxx @@ -43,14 +43,14 @@ bool checkUnoObjectType( SbUnoObject* refVal, // Laden einer numerischen Konstanten (+ID) -void SbiRuntime::StepLOADNC( UINT32 nOp1 ) +void SbiRuntime::StepLOADNC( sal_uInt32 nOp1 ) { SbxVariable* p = new SbxVariable( SbxDOUBLE ); // #57844 Lokalisierte Funktion benutzen String aStr = pImg->GetString( static_cast( nOp1 ) ); // Auch , zulassen !!! - USHORT iComma = aStr.Search( ',' ); + sal_uInt16 iComma = aStr.Search( ',' ); if( iComma != STRING_NOTFOUND ) { String aStr1 = aStr.Copy( 0, iComma ); @@ -67,7 +67,7 @@ void SbiRuntime::StepLOADNC( UINT32 nOp1 ) // Laden einer Stringkonstanten (+ID) -void SbiRuntime::StepLOADSC( UINT32 nOp1 ) +void SbiRuntime::StepLOADSC( sal_uInt32 nOp1 ) { SbxVariable* p = new SbxVariable; p->PutString( pImg->GetString( static_cast( nOp1 ) ) ); @@ -76,16 +76,16 @@ void SbiRuntime::StepLOADSC( UINT32 nOp1 ) // Immediate Load (+Wert) -void SbiRuntime::StepLOADI( UINT32 nOp1 ) +void SbiRuntime::StepLOADI( sal_uInt32 nOp1 ) { SbxVariable* p = new SbxVariable; - p->PutInteger( static_cast( nOp1 ) ); + p->PutInteger( static_cast( nOp1 ) ); PushVar( p ); } // Speichern eines named Arguments in Argv (+Arg-Nr ab 1!) -void SbiRuntime::StepARGN( UINT32 nOp1 ) +void SbiRuntime::StepARGN( sal_uInt32 nOp1 ) { if( !refArgv ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); @@ -100,13 +100,13 @@ void SbiRuntime::StepARGN( UINT32 nOp1 ) // Konvertierung des Typs eines Arguments in Argv fuer DECLARE-Fkt. (+Typ) -void SbiRuntime::StepARGTYP( UINT32 nOp1 ) +void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 ) { if( !refArgv ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); else { - BOOL bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL verlangt? + sal_Bool bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL verlangt? SbxDataType t = (SbxDataType) (nOp1 & 0x7FFF); SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // letztes Arg @@ -145,7 +145,7 @@ void SbiRuntime::StepARGTYP( UINT32 nOp1 ) // String auf feste Laenge bringen (+Laenge) -void SbiRuntime::StepPAD( UINT32 nOp1 ) +void SbiRuntime::StepPAD( sal_uInt32 nOp1 ) { SbxVariable* p = GetTOS(); String& s = (String&)(const String&) *p; @@ -157,20 +157,20 @@ void SbiRuntime::StepPAD( UINT32 nOp1 ) // Sprung (+Target) -void SbiRuntime::StepJUMP( UINT32 nOp1 ) +void SbiRuntime::StepJUMP( sal_uInt32 nOp1 ) { #ifdef DBG_UTIL // #QUESTION shouln't this be - // if( (BYTE*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() ) + // if( (sal_uInt8*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() ) if( nOp1 >= pImg->GetCodeSize() ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); #endif - pCode = (const BYTE*) pImg->GetCode() + nOp1; + pCode = (const sal_uInt8*) pImg->GetCode() + nOp1; } // TOS auswerten, bedingter Sprung (+Target) -void SbiRuntime::StepJUMPT( UINT32 nOp1 ) +void SbiRuntime::StepJUMPT( sal_uInt32 nOp1 ) { SbxVariableRef p = PopVar(); if( p->GetBool() ) @@ -179,7 +179,7 @@ void SbiRuntime::StepJUMPT( UINT32 nOp1 ) // TOS auswerten, bedingter Sprung (+Target) -void SbiRuntime::StepJUMPF( UINT32 nOp1 ) +void SbiRuntime::StepJUMPF( sal_uInt32 nOp1 ) { SbxVariableRef p = PopVar(); if( !p->GetBool() ) @@ -194,36 +194,36 @@ void SbiRuntime::StepJUMPF( UINT32 nOp1 ) // ... //Falls im Operanden 0x8000 gesetzt ist, Returnadresse pushen (ON..GOSUB) -void SbiRuntime::StepONJUMP( UINT32 nOp1 ) +void SbiRuntime::StepONJUMP( sal_uInt32 nOp1 ) { SbxVariableRef p = PopVar(); - INT16 n = p->GetInteger(); + sal_Int16 n = p->GetInteger(); if( nOp1 & 0x8000 ) { nOp1 &= 0x7FFF; //PushGosub( pCode + 3 * nOp1 ); PushGosub( pCode + 5 * nOp1 ); } - if( n < 1 || static_cast(n) > nOp1 ) - n = static_cast( nOp1 + 1 ); - //nOp1 = (UINT32) ( (const char*) pCode - pImg->GetCode() ) + 3 * --n; - nOp1 = (UINT32) ( (const char*) pCode - pImg->GetCode() ) + 5 * --n; + if( n < 1 || static_cast(n) > nOp1 ) + n = static_cast( nOp1 + 1 ); + //nOp1 = (sal_uInt32) ( (const char*) pCode - pImg->GetCode() ) + 3 * --n; + nOp1 = (sal_uInt32) ( (const char*) pCode - pImg->GetCode() ) + 5 * --n; StepJUMP( nOp1 ); } // UP-Aufruf (+Target) -void SbiRuntime::StepGOSUB( UINT32 nOp1 ) +void SbiRuntime::StepGOSUB( sal_uInt32 nOp1 ) { PushGosub( pCode ); if( nOp1 >= pImg->GetCodeSize() ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); - pCode = (const BYTE*) pImg->GetCode() + nOp1; + pCode = (const sal_uInt8*) pImg->GetCode() + nOp1; } // UP-Return (+0 oder Target) -void SbiRuntime::StepRETURN( UINT32 nOp1 ) +void SbiRuntime::StepRETURN( sal_uInt32 nOp1 ) { PopGosub(); if( nOp1 ) @@ -232,7 +232,7 @@ void SbiRuntime::StepRETURN( UINT32 nOp1 ) // FOR-Variable testen (+Endlabel) -void SbiRuntime::StepTESTFOR( UINT32 nOp1 ) +void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 ) { if( !pForStk ) { @@ -295,7 +295,7 @@ void SbiRuntime::StepTESTFOR( UINT32 nOp1 ) { BasicCollection* pCollection = (BasicCollection*)(SbxVariable*)pForStk->refEnd; SbxArrayRef xItemArray = pCollection->xItemArray; - INT32 nCount = xItemArray->Count32(); + sal_Int32 nCount = xItemArray->Count32(); if( pForStk->nCurCollectionIndex < nCount ) { SbxVariable* pRes = xItemArray->Get32( pForStk->nCurCollectionIndex ); @@ -334,7 +334,7 @@ void SbiRuntime::StepTESTFOR( UINT32 nOp1 ) // Tos+1 <= Tos+2 <= Tos, 2xremove (+Target) -void SbiRuntime::StepCASETO( UINT32 nOp1 ) +void SbiRuntime::StepCASETO( sal_uInt32 nOp1 ) { if( !refCaseStk || !refCaseStk->Count() ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); @@ -350,9 +350,9 @@ void SbiRuntime::StepCASETO( UINT32 nOp1 ) // Fehler-Handler -void SbiRuntime::StepERRHDL( UINT32 nOp1 ) +void SbiRuntime::StepERRHDL( sal_uInt32 nOp1 ) { - const BYTE* p = pCode; + const sal_uInt8* p = pCode; StepJUMP( nOp1 ); pError = pCode; pCode = p; @@ -365,7 +365,7 @@ void SbiRuntime::StepERRHDL( UINT32 nOp1 ) // Resume nach Fehlern (+0=statement, 1=next or Label) -void SbiRuntime::StepRESUME( UINT32 nOp1 ) +void SbiRuntime::StepRESUME( sal_uInt32 nOp1 ) { // AB #32714 Resume ohne Error? -> Fehler if( !bInError ) @@ -376,8 +376,8 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 ) if( nOp1 ) { // Code-Zeiger auf naechstes Statement setzen - USHORT n1, n2; - pCode = pMod->FindNextStmnt( pErrCode, n1, n2, TRUE, pImg ); + sal_uInt16 n1, n2; + pCode = pMod->FindNextStmnt( pErrCode, n1, n2, sal_True, pImg ); } else pCode = pErrStmnt; @@ -390,7 +390,7 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 ) pInst->nErr = 0; pInst->nErl = 0; nError = 0; - bInError = FALSE; + bInError = sal_False; // Error-Stack loeschen SbErrorStack*& rErrStack = GetSbData()->pErrStack; @@ -399,7 +399,7 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 ) } // Kanal schliessen (+Kanal, 0=Alle) -void SbiRuntime::StepCLOSE( UINT32 nOp1 ) +void SbiRuntime::StepCLOSE( sal_uInt32 nOp1 ) { SbError err; if( !nOp1 ) @@ -418,7 +418,7 @@ void SbiRuntime::StepCLOSE( UINT32 nOp1 ) // Zeichen ausgeben (+char) -void SbiRuntime::StepPRCHAR( UINT32 nOp1 ) +void SbiRuntime::StepPRCHAR( sal_uInt32 nOp1 ) { ByteString s( (char) nOp1 ); pIosys->Write( s ); @@ -509,7 +509,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal, return bOk; } -void SbiRuntime::StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt ) +void SbiRuntime::StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt ) { SbxVariableRef refVal = PopVar(); SbxVariableRef refVar = PopVar(); @@ -520,17 +520,17 @@ void SbiRuntime::StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt ) StepSET_Impl( refVal, refVar, bHandleDflt ); // don't do handle dflt prop for a "proper" set } -void SbiRuntime::StepVBASETCLASS( UINT32 nOp1 ) +void SbiRuntime::StepVBASETCLASS( sal_uInt32 nOp1 ) { StepSETCLASS_impl( nOp1, false ); } -void SbiRuntime::StepSETCLASS( UINT32 nOp1 ) +void SbiRuntime::StepSETCLASS( sal_uInt32 nOp1 ) { StepSETCLASS_impl( nOp1, true ); } -void SbiRuntime::StepTESTCLASS( UINT32 nOp1 ) +void SbiRuntime::StepTESTCLASS( sal_uInt32 nOp1 ) { SbxVariableRef xObjVal = PopVar(); String aClass( pImg->GetString( static_cast( nOp1 ) ) ); @@ -544,7 +544,7 @@ void SbiRuntime::StepTESTCLASS( UINT32 nOp1 ) // Library fuer anschliessenden Declare-Call definieren -void SbiRuntime::StepLIB( UINT32 nOp1 ) +void SbiRuntime::StepLIB( sal_uInt32 nOp1 ) { aLibName = pImg->GetString( static_cast( nOp1 ) ); } @@ -553,14 +553,14 @@ void SbiRuntime::StepLIB( UINT32 nOp1 ) // Dieser Opcode wird vor DIM/REDIM-Anweisungen gepusht, // wenn nur ein Index angegeben wurde. -void SbiRuntime::StepBASED( UINT32 nOp1 ) +void SbiRuntime::StepBASED( sal_uInt32 nOp1 ) { SbxVariable* p1 = new SbxVariable; SbxVariableRef x2 = PopVar(); // #109275 Check compatiblity mode bool bCompatible = ((nOp1 & 0x8000) != 0); - USHORT uBase = static_cast(nOp1 & 1); // Can only be 0 or 1 + sal_uInt16 uBase = static_cast(nOp1 & 1); // Can only be 0 or 1 p1->PutInteger( uBase ); if( !bCompatible ) x2->Compute( SbxPLUS, *p1 ); diff --git a/basic/source/runtime/step2.cxx b/basic/source/runtime/step2.cxx index 64a9d86ab940..02b22a35b732 100755 --- a/basic/source/runtime/step2.cxx +++ b/basic/source/runtime/step2.cxx @@ -58,7 +58,7 @@ SbxVariable* getVBAConstant( const String& rName ); // 0x8000 - Argv ist belegt SbxVariable* SbiRuntime::FindElement - ( SbxObject* pObj, UINT32 nOp1, UINT32 nOp2, SbError nNotFound, BOOL bLocal, BOOL bStatic ) + ( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError nNotFound, sal_Bool bLocal, sal_Bool bStatic ) { bool bIsVBAInterOp = SbiRuntime::isVBAEnabled(); if( bIsVBAInterOp ) @@ -76,7 +76,7 @@ SbxVariable* SbiRuntime::FindElement } else { - BOOL bFatalError = FALSE; + sal_Bool bFatalError = sal_False; SbxDataType t = (SbxDataType) nOp2; String aName( pImg->GetString( static_cast( nOp1 & 0x7FFF ) ) ); // Hacky capture of Evaluate [] syntax @@ -109,8 +109,8 @@ SbxVariable* SbiRuntime::FindElement if( !pElem ) { // Die RTL brauchen wir nicht mehr zu durchsuchen! - BOOL bSave = rBasic.bNoRtl; - rBasic.bNoRtl = TRUE; + sal_Bool bSave = rBasic.bNoRtl; + rBasic.bNoRtl = sal_True; pElem = pObj->Find( aName, SbxCLASS_DONTCARE ); // #110004, #112015: Make private really private @@ -181,14 +181,14 @@ SbxVariable* SbiRuntime::FindElement // Nicht da und nicht im Objekt? // Hat das Ding Parameter, nicht einrichten! if( nOp1 & 0x8000 ) - bFatalError = TRUE; + bFatalError = sal_True; // ALT: StarBASIC::FatalError( nNotFound ); // Sonst, falls keine Parameter sind, anderen Error Code verwenden if( !bLocal || pImg->GetFlag( SBIMG_EXPLICIT ) ) { // #39108 Bei explizit und als ELEM immer ein Fatal Error - bFatalError = TRUE; + bFatalError = sal_True; // Falls keine Parameter sind, anderen Error Code verwenden if( !( nOp1 & 0x8000 ) && nNotFound == SbERR_PROC_UNDEFINED ) @@ -233,19 +233,19 @@ SbxVariable* SbiRuntime::FindElement { // Soll der Typ konvertiert werden? SbxDataType t2 = pElem->GetType(); - BOOL bSet = FALSE; + sal_Bool bSet = sal_False; if( !( pElem->GetFlags() & SBX_FIXED ) ) { if( t != SbxVARIANT && t != t2 && t >= SbxINTEGER && t <= SbxSTRING ) - pElem->SetType( t ), bSet = TRUE; + pElem->SetType( t ), bSet = sal_True; } // pElem auf eine Ref zuweisen, um ggf. eine Temp-Var zu loeschen SbxVariableRef refTemp = pElem; // Moegliche Reste vom letzten Aufruf der SbxMethod beseitigen // Vorher Schreiben freigeben, damit kein Error gesetzt wird. - USHORT nSavFlags = pElem->GetFlags(); + sal_uInt16 nSavFlags = pElem->GetFlags(); pElem->SetFlag( SBX_READWRITE | SBX_NO_BROADCAST ); pElem->SbxValue::Clear(); pElem->SetFlags( nSavFlags ); @@ -314,8 +314,8 @@ SbxBase* SbiRuntime::FindElementExtern( const String& rName ) SbxInfo* pInfo = pMeth->GetInfo(); if( pInfo && refParams ) { - USHORT nParamCount = refParams->Count(); - USHORT j = 1; + sal_uInt16 nParamCount = refParams->Count(); + sal_uInt16 j = 1; const SbxParamInfo* pParam = pInfo->GetParam( j ); while( pParam ) { @@ -342,8 +342,8 @@ SbxBase* SbiRuntime::FindElementExtern( const String& rName ) if( !pElem ) { // RTL nicht durchsuchen! - BOOL bSave = rBasic.bNoRtl; - rBasic.bNoRtl = TRUE; + sal_Bool bSave = rBasic.bNoRtl; + rBasic.bNoRtl = sal_True; pElem = pMod->Find( rName, SbxCLASS_DONTCARE ); rBasic.bNoRtl = bSave; } @@ -355,20 +355,20 @@ SbxBase* SbiRuntime::FindElementExtern( const String& rName ) // Dabei auch die Argumente umsetzen, falls benannte Parameter // verwendet wurden -void SbiRuntime::SetupArgs( SbxVariable* p, UINT32 nOp1 ) +void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 ) { if( nOp1 & 0x8000 ) { if( !refArgv ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); - BOOL bHasNamed = FALSE; - USHORT i; - USHORT nArgCount = refArgv->Count(); + sal_Bool bHasNamed = sal_False; + sal_uInt16 i; + sal_uInt16 nArgCount = refArgv->Count(); for( i = 1 ; i < nArgCount ; i++ ) { if( refArgv->GetAlias( i ).Len() ) { - bHasNamed = TRUE; break; + bHasNamed = sal_True; break; } } if( bHasNamed ) @@ -395,7 +395,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, UINT32 nOp1 ) { bError_ = false; - USHORT nCurPar = 1; + sal_uInt16 nCurPar = 1; AutomationNamedArgsSbxArray* pArg = new AutomationNamedArgsSbxArray( nArgCount ); ::rtl::OUString* pNames = pArg->getNames().getArray(); @@ -444,7 +444,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, UINT32 nOp1 ) } else { - USHORT nCurPar = 1; + sal_uInt16 nCurPar = 1; SbxArray* pArg = new SbxArray; for( i = 1 ; i < nArgCount ; i++ ) { @@ -453,7 +453,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, UINT32 nOp1 ) if( rName.Len() ) { // nCurPar wird auf den gefundenen Parameter gesetzt - USHORT j = 1; + sal_uInt16 j = 1; const SbxParamInfo* pParam = pInfo->GetParam( j ); while( pParam ) { @@ -544,7 +544,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) // Haben wir Index-Access? if( xIndexAccess.is() ) { - UINT32 nParamCount = (UINT32)pPar->Count() - 1; + sal_uInt32 nParamCount = (sal_uInt32)pPar->Count() - 1; if( nParamCount != 1 ) { StarBASIC::Error( SbERR_BAD_ARGUMENT ); @@ -552,7 +552,7 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) } // Index holen - INT32 nIndex = pPar->Get( 1 )->GetLong(); + sal_Int32 nIndex = pPar->Get( 1 )->GetLong(); Reference< XInterface > xRet; try { @@ -635,13 +635,13 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) // Laden eines Elements aus der Runtime-Library (+StringID+Typ) -void SbiRuntime::StepRTL( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepRTL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { - PushVar( FindElement( rBasic.pRtl, nOp1, nOp2, SbERR_PROC_UNDEFINED, FALSE ) ); + PushVar( FindElement( rBasic.pRtl, nOp1, nOp2, SbERR_PROC_UNDEFINED, sal_False ) ); } void -SbiRuntime::StepFIND_Impl( SbxObject* pObj, UINT32 nOp1, UINT32 nOp2, SbError nNotFound, BOOL bLocal, BOOL bStatic ) +SbiRuntime::StepFIND_Impl( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt32 nOp2, SbError nNotFound, sal_Bool bLocal, sal_Bool bStatic ) { if( !refLocals ) refLocals = new SbxArray; @@ -649,34 +649,34 @@ SbiRuntime::StepFIND_Impl( SbxObject* pObj, UINT32 nOp1, UINT32 nOp2, SbError nN } // Laden einer lokalen/globalen Variablen (+StringID+Typ) -void SbiRuntime::StepFIND( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepFIND( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { - StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, TRUE ); + StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, sal_True ); } // Search inside a class module (CM) to enable global search in time -void SbiRuntime::StepFIND_CM( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepFIND_CM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { SbClassModuleObject* pClassModuleObject = PTR_CAST(SbClassModuleObject,pMod); if( pClassModuleObject ) pMod->SetFlag( SBX_GBLSEARCH ); - StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, TRUE ); + StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, sal_True ); if( pClassModuleObject ) pMod->ResetFlag( SBX_GBLSEARCH ); } -void SbiRuntime::StepFIND_STATIC( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepFIND_STATIC( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { - StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, TRUE, TRUE ); + StepFIND_Impl( pMod, nOp1, nOp2, SbERR_PROC_UNDEFINED, sal_True, sal_True ); } // Laden eines Objekt-Elements (+StringID+Typ) // Das Objekt liegt auf TOS -void SbiRuntime::StepELEM( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepELEM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { // Liegt auf dem TOS ein Objekt? SbxVariableRef pObjVar = PopVar(); @@ -695,7 +695,7 @@ void SbiRuntime::StepELEM( UINT32 nOp1, UINT32 nOp2 ) if( pObj ) SaveRef( (SbxVariable*)pObj ); - PushVar( FindElement( pObj, nOp1, nOp2, SbERR_NO_METHOD, FALSE ) ); + PushVar( FindElement( pObj, nOp1, nOp2, SbERR_NO_METHOD, sal_False ) ); } // Laden eines Parameters (+Offset+Typ) @@ -703,17 +703,17 @@ void SbiRuntime::StepELEM( UINT32 nOp1, UINT32 nOp2 ) // Der Datentyp SbxEMPTY zeigt an, daa kein Parameter angegeben ist. // Get( 0 ) darf EMPTY sein -void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepPARAM( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { - USHORT i = static_cast( nOp1 & 0x7FFF ); + sal_uInt16 i = static_cast( nOp1 & 0x7FFF ); SbxDataType t = (SbxDataType) nOp2; SbxVariable* p; // #57915 Missing sauberer loesen - USHORT nParamCount = refParams->Count(); + sal_uInt16 nParamCount = refParams->Count(); if( i >= nParamCount ) { - INT16 iLoop = i; + sal_Int16 iLoop = i; while( iLoop >= nParamCount ) { p = new SbxVariable(); @@ -739,7 +739,7 @@ void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 ) //if( p->GetType() == SbxEMPTY && ( i ) ) { // Wenn ein Parameter fehlt, kann er OPTIONAL sein - BOOL bOpt = FALSE; + sal_Bool bOpt = sal_False; if( pMeth ) { SbxInfo* pInfo = pMeth->GetInfo(); @@ -749,7 +749,7 @@ void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 ) if( pParam && ( (pParam->nFlags & SBX_OPTIONAL) != 0 ) ) { // Default value? - USHORT nDefaultId = sal::static_int_cast< USHORT >( + sal_uInt16 nDefaultId = sal::static_int_cast< sal_uInt16 >( pParam->nUserData & 0xffff ); if( nDefaultId > 0 ) { @@ -758,11 +758,11 @@ void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 ) p->PutString( aDefaultStr ); refParams->Put( p, i ); } - bOpt = TRUE; + bOpt = sal_True; } } } - if( bOpt == FALSE ) + if( bOpt == sal_False ) Error( SbERR_NOT_OPTIONAL ); } else if( t != SbxVARIANT && (SbxDataType)(p->GetType() & 0x0FFF ) != t ) @@ -778,7 +778,7 @@ void SbiRuntime::StepPARAM( UINT32 nOp1, UINT32 nOp2 ) // Case-Test (+True-Target+Test-Opcode) -void SbiRuntime::StepCASEIS( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepCASEIS( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { if( !refCaseStk || !refCaseStk->Count() ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); @@ -794,13 +794,13 @@ void SbiRuntime::StepCASEIS( UINT32 nOp1, UINT32 nOp2 ) // Aufruf einer DLL-Prozedur (+StringID+Typ) // Auch hier zeigt das MSB des StringIDs an, dass Argv belegt ist -void SbiRuntime::StepCALL( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepCALL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { String aName = pImg->GetString( static_cast( nOp1 & 0x7FFF ) ); SbxArray* pArgs = NULL; if( nOp1 & 0x8000 ) pArgs = refArgv; - DllCall( aName, aLibName, pArgs, (SbxDataType) nOp2, FALSE ); + DllCall( aName, aLibName, pArgs, (SbxDataType) nOp2, sal_False ); aLibName = String(); if( nOp1 & 0x8000 ) PopArgv(); @@ -809,13 +809,13 @@ void SbiRuntime::StepCALL( UINT32 nOp1, UINT32 nOp2 ) // Aufruf einer DLL-Prozedur nach CDecl (+StringID+Typ) // Auch hier zeigt das MSB des StringIDs an, dass Argv belegt ist -void SbiRuntime::StepCALLC( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepCALLC( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { String aName = pImg->GetString( static_cast( nOp1 & 0x7FFF ) ); SbxArray* pArgs = NULL; if( nOp1 & 0x8000 ) pArgs = refArgv; - DllCall( aName, aLibName, pArgs, (SbxDataType) nOp2, TRUE ); + DllCall( aName, aLibName, pArgs, (SbxDataType) nOp2, sal_True ); aLibName = String(); if( nOp1 & 0x8000 ) PopArgv(); @@ -824,14 +824,14 @@ void SbiRuntime::StepCALLC( UINT32 nOp1, UINT32 nOp2 ) // Beginn eines Statements (+Line+Col) -void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepSTMNT( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { // Wenn der Expr-Stack am Anfang einen Statements eine Variable enthaelt, // hat ein Trottel X als Funktion aufgerufen, obwohl es eine Variable ist! - BOOL bFatalExpr = FALSE; + sal_Bool bFatalExpr = sal_False; String sUnknownMethodName; if( nExprLvl > 1 ) - bFatalExpr = TRUE; + bFatalExpr = sal_True; else if( nExprLvl ) { SbxVariable* p = refExprStk->Get( 0 ); @@ -839,7 +839,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) && refLocals.Is() && refLocals->Find( p->GetName(), p->GetClass() ) ) { sUnknownMethodName = p->GetName(); - bFatalExpr = TRUE; + bFatalExpr = sal_True; } } // Der Expr-Stack ist nun nicht mehr notwendig @@ -859,7 +859,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) return; } pStmnt = pCode - 9; - USHORT nOld = nLine; + sal_uInt16 nOld = nLine; nLine = static_cast( nOp1 ); // #29955 & 0xFF, um for-Schleifen-Ebene wegzufiltern @@ -871,8 +871,8 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) // around the final column of this statement to set nCol2 = 0xffff; - USHORT n1, n2; - const BYTE* p = pMod->FindNextStmnt( pCode, n1, n2 ); + sal_uInt16 n1, n2; + const sal_uInt8* p = pMod->FindNextStmnt( pCode, n1, n2 ); if( p ) { if( n1 == nOp1 ) @@ -886,7 +886,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) if( !bInError ) { // (Bei Sprüngen aus Schleifen tritt hier eine Differenz auf) - USHORT nExspectedForLevel = static_cast( nOp2 / 0x100 ); + sal_uInt16 nExspectedForLevel = static_cast( nOp2 / 0x100 ); if( pGosubStk ) nExspectedForLevel = nExspectedForLevel + pGosubStk->nStartForLvl; @@ -902,7 +902,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) //if( nFlags & SbDEBUG_STEPINTO ) { StarBASIC* pStepBasic = GetCurrentBasic( &rBasic ); - USHORT nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 ); + sal_uInt16 nNewFlags = pStepBasic->StepPoint( nLine, nCol1, nCol2 ); // Neuen BreakCallLevel ermitteln pInst->CalcBreakCallLevel( nNewFlags ); @@ -911,10 +911,10 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) // Breakpoints nur bei STMNT-Befehlen in neuer Zeile! else if( ( nOp1 != nOld ) && ( nFlags & SbDEBUG_BREAK ) - && pMod->IsBP( static_cast( nOp1 ) ) ) + && pMod->IsBP( static_cast( nOp1 ) ) ) { StarBASIC* pBreakBasic = GetCurrentBasic( &rBasic ); - USHORT nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 ); + sal_uInt16 nNewFlags = pBreakBasic->BreakPoint( nLine, nCol1, nCol2 ); // Neuen BreakCallLevel ermitteln pInst->CalcBreakCallLevel( nNewFlags ); @@ -929,7 +929,7 @@ void SbiRuntime::StepSTMNT( UINT32 nOp1, UINT32 nOp2 ) // Kanalnummer // Dateiname -void SbiRuntime::StepOPEN( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepOPEN( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { SbxVariableRef pName = PopVar(); SbxVariableRef pChan = PopVar(); @@ -944,7 +944,7 @@ void SbiRuntime::StepOPEN( UINT32 nOp1, UINT32 nOp2 ) // Objekt kreieren (+StringID+StringID) -void SbiRuntime::StepCREATE( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepCREATE( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { String aClass( pImg->GetString( static_cast( nOp2 ) ) ); SbxObject *pObj = SbxBase::CreateObject( aClass ); @@ -962,12 +962,12 @@ void SbiRuntime::StepCREATE( UINT32 nOp1, UINT32 nOp2 ) } } -void SbiRuntime::StepDCREATE( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepDCREATE( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { StepDCREATE_IMPL( nOp1, nOp2 ); } -void SbiRuntime::StepDCREATE_REDIMP( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepDCREATE_REDIMP( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { StepDCREATE_IMPL( nOp1, nOp2 ); } @@ -994,7 +994,7 @@ void implCopyDimArray_DCREATE( SbxDimArray* pNewArray, SbxDimArray* pOldArray, s } // #56204 Objekt-Array kreieren (+StringID+StringID), DCREATE == Dim-Create -void SbiRuntime::StepDCREATE_IMPL( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepDCREATE_IMPL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { SbxVariableRef refVar = PopVar(); @@ -1016,11 +1016,11 @@ void SbiRuntime::StepDCREATE_IMPL( UINT32 nOp1, UINT32 nOp2 ) // Dimensionen auswerten short nDims = pArray->GetDims(); - INT32 nTotalSize = 0; + sal_Int32 nTotalSize = 0; // es muss ein eindimensionales Array sein - INT32 nLower, nUpper, nSize; - INT32 i; + sal_Int32 nLower, nUpper, nSize; + sal_Int32 i; for( i = 0 ; i < nDims ; i++ ) { pArray->GetDim32( i+1, nLower, nUpper ); @@ -1058,7 +1058,7 @@ void SbiRuntime::StepDCREATE_IMPL( UINT32 nOp1, UINT32 nOp2 ) short nDimsNew = pArray->GetDims(); short nDimsOld = pOldArray->GetDims(); short nDims = nDimsNew; - BOOL bRangeError = FALSE; + sal_Bool bRangeError = sal_False; // Store dims to use them for copying later sal_Int32* pLowerBounds = new sal_Int32[nDims]; @@ -1066,7 +1066,7 @@ void SbiRuntime::StepDCREATE_IMPL( UINT32 nOp1, UINT32 nOp2 ) sal_Int32* pActualIndices = new sal_Int32[nDims]; if( nDimsOld != nDimsNew ) { - bRangeError = TRUE; + bRangeError = sal_True; } else { @@ -1109,7 +1109,7 @@ void SbiRuntime::StepDCREATE_IMPL( UINT32 nOp1, UINT32 nOp2 ) SbxObject* createUserTypeImpl( const String& rClassName ); // sb.cxx -void SbiRuntime::StepTCREATE( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepTCREATE( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { String aName( pImg->GetString( static_cast( nOp1 ) ) ); String aClass( pImg->GetString( static_cast( nOp2 ) ) ); @@ -1123,7 +1123,7 @@ void SbiRuntime::StepTCREATE( UINT32 nOp1, UINT32 nOp2 ) PushVar( pNew ); } -void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, UINT32 nOp2 ) +void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, sal_uInt32 nOp2 ) { bool bWithEvents = ((t & 0xff) == SbxOBJECT && (nOp2 & SBX_TYPE_WITH_EVENTS_FLAG) != 0); if( bWithEvents ) @@ -1136,7 +1136,7 @@ void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, UINT32 nO bool bFixedString = ((t & 0xff) == SbxSTRING && (nOp2 & SBX_FIXED_LEN_STRING_FLAG) != 0); if( bFixedString ) { - USHORT nCount = static_cast( nOp2 >> 17 ); // len = all bits above 0x10000 + sal_uInt16 nCount = static_cast( nOp2 >> 17 ); // len = all bits above 0x10000 String aStr; aStr.Fill( nCount, 0 ); pVar->PutString( aStr ); @@ -1145,7 +1145,7 @@ void SbiRuntime::implHandleSbxFlags( SbxVariable* pVar, SbxDataType t, UINT32 nO // Einrichten einer lokalen Variablen (+StringID+Typ) -void SbiRuntime::StepLOCAL( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepLOCAL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { if( !refLocals.Is() ) refLocals = new SbxArray; @@ -1162,11 +1162,11 @@ void SbiRuntime::StepLOCAL( UINT32 nOp1, UINT32 nOp2 ) // Einrichten einer modulglobalen Variablen (+StringID+Typ) -void SbiRuntime::StepPUBLIC_Impl( UINT32 nOp1, UINT32 nOp2, bool bUsedForClassModule ) +void SbiRuntime::StepPUBLIC_Impl( sal_uInt32 nOp1, sal_uInt32 nOp2, bool bUsedForClassModule ) { String aName( pImg->GetString( static_cast( nOp1 ) ) ); SbxDataType t = (SbxDataType)(SbxDataType)(nOp2 & 0xffff);; - BOOL bFlag = pMod->IsSet( SBX_NO_MODIFY ); + sal_Bool bFlag = pMod->IsSet( SBX_NO_MODIFY ); pMod->SetFlag( SBX_NO_MODIFY ); SbxVariableRef p = pMod->Find( aName, SbxCLASS_PROPERTY ); if( p.Is() ) @@ -1186,12 +1186,12 @@ void SbiRuntime::StepPUBLIC_Impl( UINT32 nOp1, UINT32 nOp2, bool bUsedForClassMo } } -void SbiRuntime::StepPUBLIC( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepPUBLIC( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { StepPUBLIC_Impl( nOp1, nOp2, false ); } -void SbiRuntime::StepPUBLIC_P( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepPUBLIC_P( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { // Creates module variable that isn't reinitialised when // between invocations ( for VBASupport & document basic only ) @@ -1204,7 +1204,7 @@ void SbiRuntime::StepPUBLIC_P( UINT32 nOp1, UINT32 nOp2 ) // Einrichten einer globalen Variablen (+StringID+Typ) -void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepGLOBAL( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { if( pImg->GetFlag( SBIMG_CLASSMODULE ) ) StepPUBLIC_Impl( nOp1, nOp2, true ); @@ -1222,7 +1222,7 @@ void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 ) pMod->AddVarName( aName ); } - BOOL bFlag = pStorage->IsSet( SBX_NO_MODIFY ); + sal_Bool bFlag = pStorage->IsSet( SBX_NO_MODIFY ); rBasic.SetFlag( SBX_NO_MODIFY ); SbxVariableRef p = pStorage->Find( aName, SbxCLASS_PROPERTY ); if( p.Is() ) @@ -1242,7 +1242,7 @@ void SbiRuntime::StepGLOBAL( UINT32 nOp1, UINT32 nOp2 ) // Creates global variable that isn't reinitialised when // basic is restarted, P=PERSIST (+StringID+Typ) -void SbiRuntime::StepGLOBAL_P( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepGLOBAL_P( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { if( pMod->pImage->bFirstInit ) { @@ -1254,7 +1254,7 @@ void SbiRuntime::StepGLOBAL_P( UINT32 nOp1, UINT32 nOp2 ) // Searches for global variable, behavior depends on the fact // if the variable is initialised for the first time -void SbiRuntime::StepFIND_G( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepFIND_G( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { if( pMod->pImage->bFirstInit ) { @@ -1292,7 +1292,7 @@ SbxVariable* SbiRuntime::StepSTATIC_Impl( String& aName, SbxDataType& t ) return p; } // Einrichten einer statischen Variablen (+StringID+Typ) -void SbiRuntime::StepSTATIC( UINT32 nOp1, UINT32 nOp2 ) +void SbiRuntime::StepSTATIC( sal_uInt32 nOp1, sal_uInt32 nOp2 ) { String aName( pImg->GetString( static_cast( nOp1 ) ) ); SbxDataType t = (SbxDataType) nOp2; diff --git a/basic/source/sample/collelem.cxx b/basic/source/sample/collelem.cxx index 887917048c61..0ada7b60ea6a 100644 --- a/basic/source/sample/collelem.cxx +++ b/basic/source/sample/collelem.cxx @@ -55,7 +55,7 @@ void SampleElement::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - ULONG t = pHint->GetId(); + sal_uIntPtr t = pHint->GetId(); if( t == SBX_HINT_DATAWANTED && pVar->GetUserData() == 0x12345678 ) { // Die Say-Methode: diff --git a/basic/source/sample/object.cxx b/basic/source/sample/object.cxx index 3c5fbeb3478c..15ad6b0168f8 100644 --- a/basic/source/sample/object.cxx +++ b/basic/source/sample/object.cxx @@ -77,7 +77,7 @@ #define _BWRITE 0x0200 // kann as Lvalue verwendet werden #define _LVALUE _BWRITE // kann as Lvalue verwendet werden #define _READWRITE 0x0300 // beides -#define _OPT 0x0400 // TRUE: optionaler Parameter +#define _OPT 0x0400 // sal_True: optionaler Parameter #define _METHOD 0x1000 // Masken-Bit fuer eine Methode #define _PROPERTY 0x2000 // Masken-Bit fuer eine Property #define _COLL 0x4000 // Masken-Bit fuer eine Collection @@ -133,12 +133,12 @@ SbxVariable* SampleObject::Find( const String& rName, SbxClassType t ) // sonst suchen Methods* p = aMethods; short nIndex = 0; - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; while( p->nArgs != -1 ) { if( rName.EqualsIgnoreCaseAscii( p->pName ) ) { - bFound = TRUE; break; + bFound = sal_True; break; } nIndex += ( p->nArgs & _ARGSMASK ) + 1; p = aMethods + nIndex; @@ -175,22 +175,22 @@ void SampleObject::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCT, { SbxVariable* pVar = pHint->GetVar(); SbxArray* pPar_ = pVar->GetParameters(); - USHORT nIndex = (USHORT) pVar->GetUserData(); + sal_uInt16 nIndex = (sal_uInt16) pVar->GetUserData(); // kein Index: weiterreichen! if( nIndex ) { - ULONG t = pHint->GetId(); + sal_uIntPtr t = pHint->GetId(); if( t == SBX_HINT_INFOWANTED ) pVar->SetInfo( GetInfo( (short) pVar->GetUserData() ) ); else { - BOOL bWrite = FALSE; + sal_Bool bWrite = sal_False; if( t == SBX_HINT_DATACHANGED ) - bWrite = TRUE; + bWrite = sal_True; if( t == SBX_HINT_DATAWANTED || bWrite ) { // Parameter-Test fuer Methoden: - USHORT nPar = aMethods[ --nIndex ].nArgs & 0x00FF; + sal_uInt16 nPar = aMethods[ --nIndex ].nArgs & 0x00FF; // Element 0 ist der Returnwert if( ( !pPar_ && nPar ) || ( pPar_->Count() != nPar+1 ) ) @@ -220,7 +220,7 @@ SbxInfo* SampleObject::GetInfo( short nIdx ) { p++; String aName_ = String::CreateFromAscii( p->pName ); - USHORT nFlags_ = ( p->nArgs >> 8 ) & 0x03; + sal_uInt16 nFlags_ = ( p->nArgs >> 8 ) & 0x03; if( p->nArgs & _OPT ) nFlags_ |= SBX_OPTIONAL; pInfo_->AddParam( aName_, p->eType, nFlags_ ); @@ -230,13 +230,13 @@ SbxInfo* SampleObject::GetInfo( short nIdx ) //////////////////////////////////////////////////////////////////////////// -// Properties und Methoden legen beim Get (bPut = FALSE) den Returnwert -// im Element 0 des Argv ab; beim Put (bPut = TRUE) wird der Wert aus +// Properties und Methoden legen beim Get (bPut = sal_False) den Returnwert +// im Element 0 des Argv ab; beim Put (bPut = sal_True) wird der Wert aus // Element 0 gespeichert. // Die Methoden: -void SampleObject::Display( SbxVariable*, SbxArray* pPar_, BOOL ) +void SampleObject::Display( SbxVariable*, SbxArray* pPar_, sal_Bool ) { // GetString() loest u.U. auch einen Error aus! String s( pPar_->Get( 1 )->GetString() ); @@ -244,7 +244,7 @@ void SampleObject::Display( SbxVariable*, SbxArray* pPar_, BOOL ) InfoBox( NULL, s ).Execute(); } -void SampleObject::Square( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SampleObject::Square( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { double n = pPar_->Get( 1 )->GetDouble(); pVar->PutDouble( n * n ); @@ -252,14 +252,14 @@ void SampleObject::Square( SbxVariable* pVar, SbxArray* pPar_, BOOL ) // Callback nach BASIC: -void SampleObject::Event( SbxVariable*, SbxArray* pPar_, BOOL ) +void SampleObject::Event( SbxVariable*, SbxArray* pPar_, sal_Bool ) { Call( pPar_->Get( 1 )->GetString(), NULL ); } // Neues Element anlegen -void SampleObject::Create( SbxVariable* pVar, SbxArray* pPar_, BOOL ) +void SampleObject::Create( SbxVariable* pVar, SbxArray* pPar_, sal_Bool ) { pVar->PutObject( MakeObject( pPar_->Get( 1 )->GetString(), String( RTL_CONSTASCII_USTRINGPARAM("SampleElement") ) ) ); diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index 67e7ce71aded..7a68f2ea5a31 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -35,8 +35,8 @@ using namespace std; struct SbxDim { // eine Array-Dimension: SbxDim* pNext; // Link - INT32 nLbound, nUbound; // Begrenzungen - INT32 nSize; // Anzahl Elemente + sal_Int32 nLbound, nUbound; // Begrenzungen + sal_Int32 nSize; // Anzahl Elemente }; class SbxVarEntry : public SbxVariableRef { @@ -88,7 +88,7 @@ SbxArray& SbxArray::operator=( const SbxArray& rArray ) eType = rArray.eType; Clear(); SbxVarRefs* pSrc = rArray.pData; - for( UINT32 i = 0; i < pSrc->size(); i++ ) + for( sal_uInt32 i = 0; i < pSrc->size(); i++ ) { SbxVarEntryPtr pSrcRef = (*pSrc)[i]; const SbxVariable* pSrc_ = *pSrcRef; @@ -126,8 +126,8 @@ SbxClassType SbxArray::GetClass() const void SbxArray::Clear() { - UINT32 nSize = pData->size(); - for( UINT32 i = 0 ; i < nSize ; i++ ) + sal_uInt32 nSize = pData->size(); + for( sal_uInt32 i = 0 ; i < nSize ; i++ ) { SbxVarEntry* pEntry = (*pData)[i]; delete pEntry; @@ -135,19 +135,19 @@ void SbxArray::Clear() pData->clear(); } -UINT32 SbxArray::Count32() const +sal_uInt32 SbxArray::Count32() const { return pData->size(); } -USHORT SbxArray::Count() const +sal_uInt16 SbxArray::Count() const { - UINT32 nCount = pData->size(); + sal_uInt32 nCount = pData->size(); DBG_ASSERT( nCount <= SBX_MAXINDEX, "SBX: Array-Index > SBX_MAXINDEX" ); - return (USHORT)nCount; + return (sal_uInt16)nCount; } -SbxVariableRef& SbxArray::GetRef32( UINT32 nIdx ) +SbxVariableRef& SbxArray::GetRef32( sal_uInt32 nIdx ) { // Array ggf. vergroessern DBG_ASSERT( nIdx <= SBX_MAXINDEX32, "SBX: Array-Index > SBX_MAXINDEX32" ); @@ -165,7 +165,7 @@ SbxVariableRef& SbxArray::GetRef32( UINT32 nIdx ) return *((*pData)[nIdx]); } -SbxVariableRef& SbxArray::GetRef( USHORT nIdx ) +SbxVariableRef& SbxArray::GetRef( sal_uInt16 nIdx ) { // Array ggf. vergroessern DBG_ASSERT( nIdx <= SBX_MAXINDEX, "SBX: Array-Index > SBX_MAXINDEX" ); @@ -183,7 +183,7 @@ SbxVariableRef& SbxArray::GetRef( USHORT nIdx ) return *((*pData)[nIdx]); } -SbxVariable* SbxArray::Get32( UINT32 nIdx ) +SbxVariable* SbxArray::Get32( sal_uInt32 nIdx ) { if( !CanRead() ) { @@ -202,7 +202,7 @@ SbxVariable* SbxArray::Get32( UINT32 nIdx ) return rRef; } -SbxVariable* SbxArray::Get( USHORT nIdx ) +SbxVariable* SbxArray::Get( sal_uInt16 nIdx ) { if( !CanRead() ) { @@ -221,7 +221,7 @@ SbxVariable* SbxArray::Get( USHORT nIdx ) return rRef; } -void SbxArray::Put32( SbxVariable* pVar, UINT32 nIdx ) +void SbxArray::Put32( SbxVariable* pVar, sal_uInt32 nIdx ) { if( !CanWrite() ) SetError( SbxERR_PROP_READONLY ); @@ -241,7 +241,7 @@ void SbxArray::Put32( SbxVariable* pVar, UINT32 nIdx ) } } -void SbxArray::Put( SbxVariable* pVar, USHORT nIdx ) +void SbxArray::Put( SbxVariable* pVar, sal_uInt16 nIdx ) { if( !CanWrite() ) SetError( SbxERR_PROP_READONLY ); @@ -261,7 +261,7 @@ void SbxArray::Put( SbxVariable* pVar, USHORT nIdx ) } } -const XubString& SbxArray::GetAlias( USHORT nIdx ) +const XubString& SbxArray::GetAlias( sal_uInt16 nIdx ) { if( !CanRead() ) { @@ -280,7 +280,7 @@ const XubString& SbxArray::GetAlias( USHORT nIdx ) return *rRef.pAlias; } -void SbxArray::PutAlias( const XubString& rAlias, USHORT nIdx ) +void SbxArray::PutAlias( const XubString& rAlias, sal_uInt16 nIdx ) { if( !CanWrite() ) SetError( SbxERR_PROP_READONLY ); @@ -294,7 +294,7 @@ void SbxArray::PutAlias( const XubString& rAlias, USHORT nIdx ) } } -void SbxArray::Insert32( SbxVariable* pVar, UINT32 nIdx ) +void SbxArray::Insert32( SbxVariable* pVar, sal_uInt32 nIdx ) { DBG_ASSERT( pData->size() <= SBX_MAXINDEX32, "SBX: Array wird zu gross" ); if( pData->size() > SBX_MAXINDEX32 ) @@ -317,7 +317,7 @@ void SbxArray::Insert32( SbxVariable* pVar, UINT32 nIdx ) SetFlag( SBX_MODIFIED ); } -void SbxArray::Insert( SbxVariable* pVar, USHORT nIdx ) +void SbxArray::Insert( SbxVariable* pVar, sal_uInt16 nIdx ) { DBG_ASSERT( pData->size() <= 0x3FF0, "SBX: Array wird zu gross" ); if( pData->size() > 0x3FF0 ) @@ -325,7 +325,7 @@ void SbxArray::Insert( SbxVariable* pVar, USHORT nIdx ) Insert32( pVar, nIdx ); } -void SbxArray::Remove32( UINT32 nIdx ) +void SbxArray::Remove32( sal_uInt32 nIdx ) { if( nIdx < pData->size() ) { @@ -336,7 +336,7 @@ void SbxArray::Remove32( UINT32 nIdx ) } } -void SbxArray::Remove( USHORT nIdx ) +void SbxArray::Remove( sal_uInt16 nIdx ) { if( nIdx < pData->size() ) { @@ -351,7 +351,7 @@ void SbxArray::Remove( SbxVariable* pVar ) { if( pVar ) { - for( UINT32 i = 0; i < pData->size(); i++ ) + for( sal_uInt32 i = 0; i < pData->size(); i++ ) { SbxVariableRef* pRef = (*pData)[i]; // SbxVariableRef* pRef = pData->GetObject( i ); @@ -370,8 +370,8 @@ void SbxArray::Merge( SbxArray* p ) { if( p ) { - UINT32 nSize = p->Count(); - for( UINT32 i = 0; i < nSize; i++ ) + sal_uInt32 nSize = p->Count(); + for( sal_uInt32 i = 0; i < nSize; i++ ) { SbxVarEntryPtr pRef1 = (*(p->pData))[i]; // Ist das Element by name schon drin? @@ -380,8 +380,8 @@ void SbxArray::Merge( SbxArray* p ) if( pVar ) { XubString aName = pVar->GetName(); - USHORT nHash = pVar->GetHashCode(); - for( UINT32 j = 0; j < pData->size(); j++ ) + sal_uInt16 nHash = pVar->GetHashCode(); + for( sal_uInt32 j = 0; j < pData->size(); j++ ) { SbxVariableRef* pRef2 = (*pData)[j]; if( (*pRef2)->GetHashCode() == nHash @@ -408,10 +408,10 @@ void SbxArray::Merge( SbxArray* p ) // Suchen eines Elements ueber die Userdaten. Falls ein Element // ein Objekt ist, wird dieses ebenfalls durchsucht. -SbxVariable* SbxArray::FindUserData( UINT32 nData ) +SbxVariable* SbxArray::FindUserData( sal_uInt32 nData ) { SbxVariable* p = NULL; - for( UINT32 i = 0; i < pData->size(); i++ ) + for( sal_uInt32 i = 0; i < pData->size(); i++ ) { SbxVariableRef* pRef = (*pData)[i]; SbxVariable* pVar = *pRef; @@ -431,7 +431,7 @@ SbxVariable* SbxArray::FindUserData( UINT32 nData ) case SbxCLASS_OBJECT: { // Objekte duerfen ihren Parent nicht durchsuchen - USHORT nOld = pVar->GetFlags(); + sal_uInt16 nOld = pVar->GetFlags(); pVar->ResetFlag( SBX_GBLSEARCH ); p = ((SbxObject*) pVar)->FindUserData( nData ); pVar->SetFlags( nOld ); @@ -459,12 +459,12 @@ SbxVariable* SbxArray::FindUserData( UINT32 nData ) SbxVariable* SbxArray::Find( const XubString& rName, SbxClassType t ) { SbxVariable* p = NULL; - UINT32 nCount = pData->size(); + sal_uInt32 nCount = pData->size(); if( !nCount ) return NULL; - BOOL bExtSearch = IsSet( SBX_EXTSEARCH ); - USHORT nHash = SbxVariable::MakeHashCode( rName ); - for( UINT32 i = 0; i < nCount; i++ ) + sal_Bool bExtSearch = IsSet( SBX_EXTSEARCH ); + sal_uInt16 nHash = SbxVariable::MakeHashCode( rName ); + for( sal_uInt32 i = 0; i < nCount; i++ ) { SbxVariableRef* pRef = (*pData)[i]; SbxVariable* pVar = *pRef; @@ -472,7 +472,7 @@ SbxVariable* SbxArray::Find( const XubString& rName, SbxClassType t ) { // Die ganz sichere Suche klappt auch, wenn es // keinen Hascode gibt! - USHORT nVarHash = pVar->GetHashCode(); + sal_uInt16 nVarHash = pVar->GetHashCode(); if( ( !nVarHash || nVarHash == nHash ) && ( t == SbxCLASS_DONTCARE || pVar->GetClass() == t ) && ( pVar->GetName().EqualsIgnoreCaseAscii( rName ) ) ) @@ -489,7 +489,7 @@ SbxVariable* SbxArray::Find( const XubString& rName, SbxClassType t ) case SbxCLASS_OBJECT: { // Objekte duerfen ihren Parent nicht durchsuchen - USHORT nOld = pVar->GetFlags(); + sal_uInt16 nOld = pVar->GetFlags(); pVar->ResetFlag( SBX_GBLSEARCH ); p = ((SbxObject*) pVar)->Find( rName, t ); pVar->SetFlags( nOld ); @@ -511,18 +511,18 @@ SbxVariable* SbxArray::Find( const XubString& rName, SbxClassType t ) return p; } -BOOL SbxArray::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxArray::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { - UINT16 nElem; + sal_uInt16 nElem; Clear(); - BOOL bRes = TRUE; - USHORT f = nFlags; + sal_Bool bRes = sal_True; + sal_uInt16 f = nFlags; nFlags |= SBX_WRITE; rStrm >> nElem; nElem &= 0x7FFF; - for( UINT32 n = 0; n < nElem; n++ ) + for( sal_uInt32 n = 0; n < nElem; n++ ) { - UINT16 nIdx; + sal_uInt16 nIdx; rStrm >> nIdx; SbxVariable* pVar = (SbxVariable*) Load( rStrm ); if( pVar ) @@ -532,7 +532,7 @@ BOOL SbxArray::LoadData( SvStream& rStrm, USHORT nVer ) } else { - bRes = FALSE; break; + bRes = sal_False; break; } } if( bRes ) @@ -541,10 +541,10 @@ BOOL SbxArray::LoadData( SvStream& rStrm, USHORT nVer ) return bRes; } -BOOL SbxArray::StoreData( SvStream& rStrm ) const +sal_Bool SbxArray::StoreData( SvStream& rStrm ) const { - UINT32 nElem = 0; - UINT32 n; + sal_uInt32 nElem = 0; + sal_uInt32 n; // Welche Elemente sind ueberhaupt definiert? for( n = 0; n < pData->size(); n++ ) { @@ -553,23 +553,23 @@ BOOL SbxArray::StoreData( SvStream& rStrm ) const if( p && !( p->GetFlags() & SBX_DONTSTORE ) ) nElem++; } - rStrm << (UINT16) nElem; + rStrm << (sal_uInt16) nElem; for( n = 0; n < pData->size(); n++ ) { SbxVariableRef* pRef = (*pData)[n]; SbxVariable* p = *pRef; if( p && !( p->GetFlags() & SBX_DONTSTORE ) ) { - rStrm << (UINT16) n; + rStrm << (sal_uInt16) n; if( !p->Store( rStrm ) ) - return FALSE; + return sal_False; } } return StorePrivateData( rStrm ); } // #100883 Method to set method directly to parameter array -void SbxArray::PutDirect( SbxVariable* pVar, UINT32 nIdx ) +void SbxArray::PutDirect( SbxVariable* pVar, sal_uInt32 nIdx ) { SbxVariableRef& rRef = GetRef32( nIdx ); rRef = pVar; @@ -632,7 +632,7 @@ void SbxDimArray::Clear() // Dimension hinzufuegen -void SbxDimArray::AddDimImpl32( INT32 lb, INT32 ub, BOOL bAllowSize0 ) +void SbxDimArray::AddDimImpl32( sal_Int32 lb, sal_Int32 ub, sal_Bool bAllowSize0 ) { SbxError eRes = SbxERR_OK; if( ub < lb && !bAllowSize0 ) @@ -656,51 +656,51 @@ void SbxDimArray::AddDimImpl32( INT32 lb, INT32 ub, BOOL bAllowSize0 ) void SbxDimArray::AddDim( short lb, short ub ) { - AddDimImpl32( lb, ub, FALSE ); + AddDimImpl32( lb, ub, sal_False ); } void SbxDimArray::unoAddDim( short lb, short ub ) { - AddDimImpl32( lb, ub, TRUE ); + AddDimImpl32( lb, ub, sal_True ); } -void SbxDimArray::AddDim32( INT32 lb, INT32 ub ) +void SbxDimArray::AddDim32( sal_Int32 lb, sal_Int32 ub ) { - AddDimImpl32( lb, ub, FALSE ); + AddDimImpl32( lb, ub, sal_False ); } -void SbxDimArray::unoAddDim32( INT32 lb, INT32 ub ) +void SbxDimArray::unoAddDim32( sal_Int32 lb, sal_Int32 ub ) { - AddDimImpl32( lb, ub, TRUE ); + AddDimImpl32( lb, ub, sal_True ); } // Dimensionsdaten auslesen -BOOL SbxDimArray::GetDim32( INT32 n, INT32& rlb, INT32& rub ) const +sal_Bool SbxDimArray::GetDim32( sal_Int32 n, sal_Int32& rlb, sal_Int32& rub ) const { if( n < 1 || n > nDim ) { - SetError( SbxERR_BOUNDS ); rub = rlb = 0; return FALSE; + SetError( SbxERR_BOUNDS ); rub = rlb = 0; return sal_False; } SbxDim* p = pFirst; while( --n ) p = p->pNext; rub = p->nUbound; rlb = p->nLbound; - return TRUE; + return sal_True; } -BOOL SbxDimArray::GetDim( short n, short& rlb, short& rub ) const +sal_Bool SbxDimArray::GetDim( short n, short& rlb, short& rub ) const { - INT32 rlb32, rub32; - BOOL bRet = GetDim32( n, rlb32, rub32 ); + sal_Int32 rlb32, rub32; + sal_Bool bRet = GetDim32( n, rlb32, rub32 ); if( bRet ) { if( rlb32 < -SBX_MAXINDEX || rub32 > SBX_MAXINDEX ) { SetError( SbxERR_BOUNDS ); - return FALSE; + return sal_False; } rub = (short)rub32; rlb = (short)rlb32; @@ -710,15 +710,15 @@ BOOL SbxDimArray::GetDim( short n, short& rlb, short& rub ) const // Element-Ptr anhand einer Index-Liste -UINT32 SbxDimArray::Offset32( const INT32* pIdx ) +sal_uInt32 SbxDimArray::Offset32( const sal_Int32* pIdx ) { - UINT32 nPos = 0; + sal_uInt32 nPos = 0; for( SbxDim* p = pFirst; p; p = p->pNext ) { - INT32 nIdx = *pIdx++; + sal_Int32 nIdx = *pIdx++; if( nIdx < p->nLbound || nIdx > p->nUbound ) { - nPos = (UINT32)SBX_MAXINDEX32 + 1; break; + nPos = (sal_uInt32)SBX_MAXINDEX32 + 1; break; } nPos = nPos * p->nSize + nIdx - p->nLbound; } @@ -729,7 +729,7 @@ UINT32 SbxDimArray::Offset32( const INT32* pIdx ) return nPos; } -USHORT SbxDimArray::Offset( const short* pIdx ) +sal_uInt16 SbxDimArray::Offset( const short* pIdx ) { long nPos = 0; for( SbxDim* p = pFirst; p; p = p->pNext ) @@ -745,7 +745,7 @@ USHORT SbxDimArray::Offset( const short* pIdx ) { SetError( SbxERR_BOUNDS ); nPos = 0; } - return (USHORT) nPos; + return (sal_uInt16) nPos; } SbxVariableRef& SbxDimArray::GetRef( const short* pIdx ) @@ -763,17 +763,17 @@ void SbxDimArray::Put( SbxVariable* p, const short* pIdx ) SbxArray::Put( p, Offset( pIdx ) ); } -SbxVariableRef& SbxDimArray::GetRef32( const INT32* pIdx ) +SbxVariableRef& SbxDimArray::GetRef32( const sal_Int32* pIdx ) { return SbxArray::GetRef32( Offset32( pIdx ) ); } -SbxVariable* SbxDimArray::Get32( const INT32* pIdx ) +SbxVariable* SbxDimArray::Get32( const sal_Int32* pIdx ) { return SbxArray::Get32( Offset32( pIdx ) ); } -void SbxDimArray::Put32( SbxVariable* p, const INT32* pIdx ) +void SbxDimArray::Put32( SbxVariable* p, const sal_Int32* pIdx ) { SbxArray::Put32( p, Offset32( pIdx ) ); } @@ -781,38 +781,38 @@ void SbxDimArray::Put32( SbxVariable* p, const INT32* pIdx ) // Element-Nr anhand eines Parameter-Arrays -UINT32 SbxDimArray::Offset32( SbxArray* pPar ) +sal_uInt32 SbxDimArray::Offset32( SbxArray* pPar ) { if( nDim == 0 || !pPar || ( ( nDim != ( pPar->Count() - 1 ) ) && SbiRuntime::isVBAEnabled() ) ) { SetError( SbxERR_BOUNDS ); return 0; } - UINT32 nPos = 0; - USHORT nOff = 1; // Nicht Element 0! + sal_uInt32 nPos = 0; + sal_uInt16 nOff = 1; // Nicht Element 0! for( SbxDim* p = pFirst; p && !IsError(); p = p->pNext ) { - INT32 nIdx = pPar->Get( nOff++ )->GetLong(); + sal_Int32 nIdx = pPar->Get( nOff++ )->GetLong(); if( nIdx < p->nLbound || nIdx > p->nUbound ) { - nPos = (UINT32) SBX_MAXINDEX32+1; break; + nPos = (sal_uInt32) SBX_MAXINDEX32+1; break; } nPos = nPos * p->nSize + nIdx - p->nLbound; } - if( nPos > (UINT32) SBX_MAXINDEX32 ) + if( nPos > (sal_uInt32) SBX_MAXINDEX32 ) { SetError( SbxERR_BOUNDS ); nPos = 0; } return nPos; } -USHORT SbxDimArray::Offset( SbxArray* pPar ) +sal_uInt16 SbxDimArray::Offset( SbxArray* pPar ) { - UINT32 nPos = Offset32( pPar ); + sal_uInt32 nPos = Offset32( pPar ); if( nPos > (long) SBX_MAXINDEX ) { SetError( SbxERR_BOUNDS ); nPos = 0; } - return (USHORT) nPos; + return (sal_uInt16) nPos; } SbxVariableRef& SbxDimArray::GetRef( SbxArray* pPar ) @@ -830,27 +830,27 @@ void SbxDimArray::Put( SbxVariable* p, SbxArray* pPar ) SbxArray::Put32( p, Offset32( pPar ) ); } -BOOL SbxDimArray::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxDimArray::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { short nDimension; rStrm >> nDimension; for( short i = 0; i < nDimension && rStrm.GetError() == SVSTREAM_OK; i++ ) { - INT16 lb, ub; + sal_Int16 lb, ub; rStrm >> lb >> ub; AddDim( lb, ub ); } return SbxArray::LoadData( rStrm, nVer ); } -BOOL SbxDimArray::StoreData( SvStream& rStrm ) const +sal_Bool SbxDimArray::StoreData( SvStream& rStrm ) const { - rStrm << (INT16) nDim; + rStrm << (sal_Int16) nDim; for( short i = 0; i < nDim; i++ ) { short lb, ub; GetDim( i, lb, ub ); - rStrm << (INT16) lb << (INT16) ub; + rStrm << (sal_Int16) lb << (sal_Int16) ub; } return SbxArray::StoreData( rStrm ); } diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index 60bb9fe505e7..54e45c79a8d2 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -108,13 +108,13 @@ void SbxBase::Clear() DBG_CHKTHIS( SbxBase, 0 ); } -BOOL SbxBase::IsFixed() const +sal_Bool SbxBase::IsFixed() const { DBG_CHKTHIS( SbxBase, 0 ); return IsSet( SBX_FIXED ); } -void SbxBase::SetModified( BOOL b ) +void SbxBase::SetModified( sal_Bool b ) { DBG_CHKTHIS( SbxBase, 0 ); if( IsSet( SBX_NO_MODIFY ) ) @@ -137,9 +137,9 @@ void SbxBase::SetError( SbxError e ) p->eSbxError = e; } -BOOL SbxBase::IsError() +sal_Bool SbxBase::IsError() { - return BOOL( GetSbxData_Impl()->eSbxError != SbxERR_OK ); + return sal_Bool( GetSbxData_Impl()->eSbxError != SbxERR_OK ); } void SbxBase::ResetError() @@ -153,7 +153,7 @@ void SbxBase::AddFactory( SbxFactory* pFac ) const SbxFactory* pTemp = pFac; // AB, 6.3.96: HandleLast-Flag beruecksichtigen - USHORT nPos = p->aFacs.Count(); // Einfuege-Position + sal_uInt16 nPos = p->aFacs.Count(); // Einfuege-Position if( !pFac->IsHandleLast() ) // Nur, wenn nicht selbst HandleLast { // Neue Factory vor Factories mit HandleLast einordnen @@ -167,7 +167,7 @@ void SbxBase::AddFactory( SbxFactory* pFac ) void SbxBase::RemoveFactory( SbxFactory* pFac ) { SbxAppData* p = GetSbxData_Impl(); - for( USHORT i = 0; i < p->aFacs.Count(); i++ ) + for( sal_uInt16 i = 0; i < p->aFacs.Count(); i++ ) { if( p->aFacs.GetObject( i ) == pFac ) { @@ -177,7 +177,7 @@ void SbxBase::RemoveFactory( SbxFactory* pFac ) } -SbxBase* SbxBase::Create( UINT16 nSbxId, UINT32 nCreator ) +SbxBase* SbxBase::Create( sal_uInt16 nSbxId, sal_uInt32 nCreator ) { // #91626: Hack to skip old Basic dialogs // Problem: There does not exist a factory any more, @@ -203,7 +203,7 @@ SbxBase* SbxBase::Create( UINT16 nSbxId, UINT32 nCreator ) // Unbekanter Typ: ber die Factories gehen! SbxAppData* p = GetSbxData_Impl(); SbxBase* pNew = NULL; - for( USHORT i = 0; i < p->aFacs.Count(); i++ ) + for( sal_uInt16 i = 0; i < p->aFacs.Count(); i++ ) { SbxFactory* pFac = p->aFacs.GetObject( i ); pNew = pFac->Create( nSbxId, nCreator ); @@ -225,7 +225,7 @@ SbxObject* SbxBase::CreateObject( const XubString& rClass ) { SbxAppData* p = GetSbxData_Impl(); SbxObject* pNew = NULL; - for( USHORT i = 0; i < p->aFacs.Count(); i++ ) + for( sal_uInt16 i = 0; i < p->aFacs.Count(); i++ ) { pNew = p->aFacs.GetObject( i )->CreateObject( rClass ); if( pNew ) @@ -243,15 +243,15 @@ SbxObject* SbxBase::CreateObject( const XubString& rClass ) return pNew; } -static BOOL bStaticEnableBroadcasting = TRUE; +static sal_Bool bStaticEnableBroadcasting = sal_True; // Sbx-Loesung als Ersatz fuer SfxBroadcaster::Enable() -void SbxBase::StaticEnableBroadcasting( BOOL bEnable ) +void SbxBase::StaticEnableBroadcasting( sal_Bool bEnable ) { bStaticEnableBroadcasting = bEnable; } -BOOL SbxBase::StaticIsEnabledBroadcasting( void ) +sal_Bool SbxBase::StaticIsEnabledBroadcasting( void ) { return bStaticEnableBroadcasting; } @@ -259,15 +259,15 @@ BOOL SbxBase::StaticIsEnabledBroadcasting( void ) SbxBase* SbxBase::Load( SvStream& rStrm ) { - UINT16 nSbxId, nFlags, nVer; - UINT32 nCreator, nSize; + sal_uInt16 nSbxId, nFlags, nVer; + sal_uInt32 nCreator, nSize; rStrm >> nCreator >> nSbxId >> nFlags >> nVer; // Eine Dummheit meinerseits korrigieren: if( nFlags & SBX_RESERVED ) nFlags = ( nFlags & ~SBX_RESERVED ) | SBX_GBLSEARCH; - ULONG nOldPos = rStrm.Tell(); + sal_uIntPtr nOldPos = rStrm.Tell(); rStrm >> nSize; SbxBase* p = Create( nSbxId, nCreator ); if( p ) @@ -275,7 +275,7 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) p->nFlags = nFlags; if( p->LoadData( rStrm, nVer ) ) { - ULONG nNewPos = rStrm.Tell(); + sal_uIntPtr nNewPos = rStrm.Tell(); nOldPos += nSize; DBG_ASSERT( nOldPos >= nNewPos, "SBX: Zu viele Daten eingelesen" ); if( nOldPos != nNewPos ) @@ -303,81 +303,81 @@ SbxBase* SbxBase::Load( SvStream& rStrm ) // Sbx-Objekt im Stream ueberspringen void SbxBase::Skip( SvStream& rStrm ) { - UINT16 nSbxId, nFlags, nVer; - UINT32 nCreator, nSize; + sal_uInt16 nSbxId, nFlags, nVer; + sal_uInt32 nCreator, nSize; rStrm >> nCreator >> nSbxId >> nFlags >> nVer; - ULONG nStartPos = rStrm.Tell(); + sal_uIntPtr nStartPos = rStrm.Tell(); rStrm >> nSize; rStrm.Seek( nStartPos + nSize ); } -BOOL SbxBase::Store( SvStream& rStrm ) +sal_Bool SbxBase::Store( SvStream& rStrm ) { DBG_CHKTHIS( SbxBase, 0 ); if( !( nFlags & SBX_DONTSTORE ) ) { - rStrm << (UINT32) GetCreator() - << (UINT16) GetSbxId() - << (UINT16) GetFlags() - << (UINT16) GetVersion(); - ULONG nOldPos = rStrm.Tell(); - rStrm << (UINT32) 0L; - BOOL bRes = StoreData( rStrm ); - ULONG nNewPos = rStrm.Tell(); + rStrm << (sal_uInt32) GetCreator() + << (sal_uInt16) GetSbxId() + << (sal_uInt16) GetFlags() + << (sal_uInt16) GetVersion(); + sal_uIntPtr nOldPos = rStrm.Tell(); + rStrm << (sal_uInt32) 0L; + sal_Bool bRes = StoreData( rStrm ); + sal_uIntPtr nNewPos = rStrm.Tell(); rStrm.Seek( nOldPos ); - rStrm << (UINT32) ( nNewPos - nOldPos ); + rStrm << (sal_uInt32) ( nNewPos - nOldPos ); rStrm.Seek( nNewPos ); if( rStrm.GetError() != SVSTREAM_OK ) - bRes = FALSE; + bRes = sal_False; if( bRes ) bRes = StoreCompleted(); return bRes; } else - return TRUE; + return sal_True; } -BOOL SbxBase::LoadData( SvStream&, USHORT ) +sal_Bool SbxBase::LoadData( SvStream&, sal_uInt16 ) { DBG_CHKTHIS( SbxBase, 0 ); - return FALSE; + return sal_False; } -BOOL SbxBase::StoreData( SvStream& ) const +sal_Bool SbxBase::StoreData( SvStream& ) const { DBG_CHKTHIS( SbxBase, 0 ); - return FALSE; + return sal_False; } -BOOL SbxBase::LoadPrivateData( SvStream&, USHORT ) +sal_Bool SbxBase::LoadPrivateData( SvStream&, sal_uInt16 ) { DBG_CHKTHIS( SbxBase, 0 ); - return TRUE; + return sal_True; } -BOOL SbxBase::StorePrivateData( SvStream& ) const +sal_Bool SbxBase::StorePrivateData( SvStream& ) const { DBG_CHKTHIS( SbxBase, 0 ); - return TRUE; + return sal_True; } -BOOL SbxBase::LoadCompleted() +sal_Bool SbxBase::LoadCompleted() { DBG_CHKTHIS( SbxBase, 0 ); - return TRUE; + return sal_True; } -BOOL SbxBase::StoreCompleted() +sal_Bool SbxBase::StoreCompleted() { DBG_CHKTHIS( SbxBase, 0 ); - return TRUE; + return sal_True; } //////////////////////////////// SbxFactory //////////////////////////////// -SbxBase* SbxFactory::Create( UINT16, UINT32 ) +SbxBase* SbxFactory::Create( sal_uInt16, sal_uInt32 ) { return NULL; } @@ -393,7 +393,7 @@ SbxInfo::~SbxInfo() {} void SbxInfo::AddParam - ( const XubString& rName, SbxDataType eType, USHORT nFlags ) + ( const XubString& rName, SbxDataType eType, sal_uInt16 nFlags ) { const SbxParamInfo* p = new SbxParamInfo( rName, eType, nFlags ); aParams.Insert( p, aParams.Count() ); @@ -406,7 +406,7 @@ void SbxInfo::AddParam( const SbxParamInfo& r ) aParams.Insert( p, aParams.Count() ); } -const SbxParamInfo* SbxInfo::GetParam( USHORT n ) const +const SbxParamInfo* SbxInfo::GetParam( sal_uInt16 n ) const { if( n < 1 || n > aParams.Count() ) return NULL; @@ -414,18 +414,18 @@ const SbxParamInfo* SbxInfo::GetParam( USHORT n ) const return aParams.GetObject( n-1 ); } -BOOL SbxInfo::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { aParams.Remove( 0, aParams.Count() ); - UINT16 nParam; + sal_uInt16 nParam; rStrm.ReadByteString( aComment, RTL_TEXTENCODING_ASCII_US ); rStrm.ReadByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US ); rStrm >> nHelpId >> nParam; while( nParam-- ) { XubString aName; - UINT16 nType, nFlags; - UINT32 nUserData = 0; + sal_uInt16 nType, nFlags; + sal_uInt32 nUserData = 0; rStrm.ReadByteString( aName, RTL_TEXTENCODING_ASCII_US ); rStrm >> nType >> nFlags; if( nVer > 1 ) @@ -434,22 +434,22 @@ BOOL SbxInfo::LoadData( SvStream& rStrm, USHORT nVer ) SbxParamInfo* p = aParams.GetObject( aParams.Count() - 1 ); p->nUserData = nUserData; } - return TRUE; + return sal_True; } -BOOL SbxInfo::StoreData( SvStream& rStrm ) const +sal_Bool SbxInfo::StoreData( SvStream& rStrm ) const { rStrm.WriteByteString( aComment, RTL_TEXTENCODING_ASCII_US ); rStrm.WriteByteString( aHelpFile, RTL_TEXTENCODING_ASCII_US ); rStrm << nHelpId << aParams.Count(); - for( USHORT i = 0; i < aParams.Count(); i++ ) + for( sal_uInt16 i = 0; i < aParams.Count(); i++ ) { SbxParamInfo* p = aParams.GetObject( i ); rStrm.WriteByteString( p->aName, RTL_TEXTENCODING_ASCII_US ); - rStrm << (UINT16) p->eType - << (UINT16) p->nFlags - << (UINT32) p->nUserData; + rStrm << (sal_uInt16) p->eType + << (sal_uInt16) p->nFlags + << (sal_uInt32) p->nUserData; } - return TRUE; + return sal_True; } diff --git a/basic/source/sbx/sbxbool.cxx b/basic/source/sbx/sbxbool.cxx index c3ed0d09b134..7b9ffe8a1136 100644 --- a/basic/source/sbx/sbxbool.cxx +++ b/basic/source/sbx/sbxbool.cxx @@ -94,15 +94,15 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) else if( !p->pOUString->equalsIgnoreAsciiCase( SbxRes( STRING_FALSE ) ) ) { // Jetzt kann es noch in eine Zahl konvertierbar sein - BOOL bError = TRUE; + sal_Bool bError = sal_True; double n; SbxDataType t; - USHORT nLen = 0; + sal_uInt16 nLen = 0; if( ImpScan( *p->pOUString, n, t, &nLen ) == SbxERR_OK ) { if( nLen == p->pOUString->getLength() ) { - bError = FALSE; + bError = sal_False; if( n != 0.0 ) nRes = SbxTRUE; } @@ -159,7 +159,7 @@ enum SbxBOOL ImpGetBool( const SbxValues* p ) return nRes; } -void ImpPutBool( SbxValues* p, INT16 n ) +void ImpPutBool( SbxValues* p, sal_Int16 n ) { if( n ) n = SbxTRUE; @@ -168,17 +168,17 @@ void ImpPutBool( SbxValues* p, INT16 n ) case SbxCHAR: p->nChar = (xub_Unicode) n; break; case SbxUINT: - p->nByte = (BYTE) n; break; + p->nByte = (sal_uInt8) n; break; case SbxINTEGER: case SbxBOOL: p->nInteger = n; break; case SbxLONG: p->nLong = n; break; case SbxULONG: - p->nULong = (UINT32) n; break; + p->nULong = (sal_uInt32) n; break; case SbxERROR: case SbxUSHORT: - p->nUShort = (UINT16) n; break; + p->nUShort = (sal_uInt16) n; break; case SbxSINGLE: p->nSingle = n; break; case SbxDATE: @@ -189,13 +189,13 @@ void ImpPutBool( SbxValues* p, INT16 n ) case SbxSALUINT64: p->uInt64 = n; break; case SbxULONG64: - p->nULong64.Set( (UINT32)n ); break; + p->nULong64.Set( (sal_uInt32)n ); break; case SbxLONG64: case SbxCURRENCY: - p->nLong64.Set( (INT32)n ); break; + p->nLong64.Set( (sal_Int32)n ); break; case SbxDECIMAL: case SbxBYREF | SbxDECIMAL: - ImpCreateDecimal( p )->setInt( (INT16)n ); + ImpCreateDecimal( p )->setInt( (sal_Int16)n ); break; case SbxBYREF | SbxSTRING: @@ -211,7 +211,7 @@ void ImpPutBool( SbxValues* p, INT16 n ) { SbxValue* pVal = PTR_CAST(SbxValue,p->pObj); if( pVal ) - pVal->PutBool( BOOL( n != 0 ) ); + pVal->PutBool( sal_Bool( n != 0 ) ); else SbxBase::SetError( SbxERR_NO_OBJECT ); break; @@ -219,17 +219,17 @@ void ImpPutBool( SbxValues* p, INT16 n ) case SbxBYREF | SbxCHAR: *p->pChar = (xub_Unicode) n; break; case SbxBYREF | SbxBYTE: - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: *p->pLong = n; break; case SbxBYREF | SbxULONG: - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSINGLE: *p->pSingle = n; break; case SbxBYREF | SbxDATE: @@ -240,10 +240,10 @@ void ImpPutBool( SbxValues* p, INT16 n ) case SbxBYREF | SbxSALUINT64: *p->puInt64 = n; break; case SbxBYREF | SbxULONG64: - p->pULong64->Set( (UINT32)n ); break; + p->pULong64->Set( (sal_uInt32)n ); break; case SbxBYREF | SbxLONG64: case SbxBYREF | SbxCURRENCY: - p->pLong64->Set( (INT32)n ); break; + p->pLong64->Set( (sal_Int32)n ); break; default: SbxBase::SetError( SbxERR_CONVERSION ); diff --git a/basic/source/sbx/sbxbyte.cxx b/basic/source/sbx/sbxbyte.cxx index e13c63967fc3..1a9c80f1dd06 100644 --- a/basic/source/sbx/sbxbyte.cxx +++ b/basic/source/sbx/sbxbyte.cxx @@ -31,10 +31,10 @@ #include #include "sbxconv.hxx" -BYTE ImpGetByte( const SbxValues* p ) +sal_uInt8 ImpGetByte( const SbxValues* p ) { SbxValues aTmp; - BYTE nRes; + sal_uInt8 nRes; start: switch( +p->eType ) { @@ -48,10 +48,10 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) p->nChar; + nRes = (sal_uInt8) p->nChar; break; case SbxBYTE: - nRes = (BYTE) p->nByte; break; + nRes = (sal_uInt8) p->nByte; break; case SbxINTEGER: case SbxBOOL: if( p->nInteger > SbxMAXBYTE ) @@ -63,16 +63,16 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) p->nInteger; + nRes = (sal_uInt8) p->nInteger; break; case SbxERROR: case SbxUSHORT: - if( p->nUShort > (USHORT) SbxMAXBYTE ) + if( p->nUShort > (sal_uInt16) SbxMAXBYTE ) { SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; } else - nRes = (BYTE) p->nUShort; + nRes = (sal_uInt8) p->nUShort; break; case SbxLONG: if( p->nLong > SbxMAXBYTE ) @@ -84,7 +84,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) p->nLong; + nRes = (sal_uInt8) p->nLong; break; case SbxULONG: if( p->nULong > SbxMAXBYTE ) @@ -92,7 +92,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; } else - nRes = (BYTE) p->nULong; + nRes = (sal_uInt8) p->nULong; break; case SbxSALINT64: if( p->nInt64 > SbxMAXBYTE ) @@ -104,7 +104,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) p->nInt64; + nRes = (sal_uInt8) p->nInt64; break; case SbxSALUINT64: if( p->uInt64 > SbxMAXBYTE ) @@ -112,7 +112,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXBYTE; } else - nRes = (BYTE) p->uInt64; + nRes = (sal_uInt8) p->uInt64; break; case SbxSINGLE: if( p->nSingle > SbxMAXBYTE ) @@ -124,7 +124,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) ImpRound( p->nSingle ); + nRes = (sal_uInt8) ImpRound( p->nSingle ); break; case SbxDATE: case SbxDOUBLE: @@ -159,7 +159,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) ImpRound( dVal ); + nRes = (sal_uInt8) ImpRound( dVal ); break; } case SbxBYREF | SbxSTRING: @@ -182,7 +182,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (BYTE) ( d + 0.5 ); + nRes = (sal_uInt8) ( d + 0.5 ); } break; case SbxOBJECT: @@ -237,7 +237,7 @@ start: return nRes; } -void ImpPutByte( SbxValues* p, BYTE n ) +void ImpPutByte( SbxValues* p, sal_uInt8 n ) { switch( +p->eType ) { diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 7bd32900ecc9..1c95591e28dd 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -41,7 +41,7 @@ static const char* pCount; static const char* pAdd; static const char* pItem; static const char* pRemove; -static USHORT nCountHash = 0, nAddHash, nItemHash, nRemoveHash; +static sal_uInt16 nCountHash = 0, nAddHash, nItemHash, nRemoveHash; ///////////////////////////////////////////////////////////////////////// @@ -61,7 +61,7 @@ SbxCollection::SbxCollection( const XubString& rClass ) } Initialize(); // Fuer Zugriffe auf sich selbst - StartListening( GetBroadcaster(), TRUE ); + StartListening( GetBroadcaster(), sal_True ); } SbxCollection::SbxCollection( const SbxCollection& rColl ) @@ -101,7 +101,7 @@ void SbxCollection::Initialize() p->SetFlag( SBX_DONTSTORE ); } -SbxVariable* SbxCollection::FindUserData( UINT32 nData ) +SbxVariable* SbxCollection::FindUserData( sal_uInt32 nData ) { if( GetParameters() ) { @@ -129,9 +129,9 @@ void SbxCollection::SFX_NOTIFY( SfxBroadcaster& rCst, const TypeId& rId1, const SbxHint* p = PTR_CAST(SbxHint,&rHint); if( p ) { - ULONG nId = p->GetId(); - BOOL bRead = BOOL( nId == SBX_HINT_DATAWANTED ); - BOOL bWrite = BOOL( nId == SBX_HINT_DATACHANGED ); + sal_uIntPtr nId = p->GetId(); + sal_Bool bRead = sal_Bool( nId == SBX_HINT_DATAWANTED ); + sal_Bool bWrite = sal_Bool( nId == SBX_HINT_DATACHANGED ); SbxVariable* pVar = p->GetVar(); SbxArray* pArg = pVar->GetParameters(); if( bRead || bWrite ) @@ -191,7 +191,7 @@ void SbxCollection::CollItem( SbxArray* pPar_ ) { short n = p->GetInteger(); if( n >= 1 && n <= (short) pObjs->Count() ) - pRes = pObjs->Get( (USHORT) n - 1 ); + pRes = pObjs->Get( (sal_uInt16) n - 1 ); } if( !pRes ) SetError( SbxERR_BAD_INDEX ); @@ -211,13 +211,13 @@ void SbxCollection::CollRemove( SbxArray* pPar_ ) if( n < 1 || n > (short) pObjs->Count() ) SetError( SbxERR_BAD_INDEX ); else - Remove( pObjs->Get( (USHORT) n - 1 ) ); + Remove( pObjs->Get( (sal_uInt16) n - 1 ) ); } } -BOOL SbxCollection::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { - BOOL bRes = SbxObject::LoadData( rStrm, nVer ); + sal_Bool bRes = SbxObject::LoadData( rStrm, nVer ); Initialize(); return bRes; } @@ -225,7 +225,7 @@ BOOL SbxCollection::LoadData( SvStream& rStrm, USHORT nVer ) ///////////////////////////////////////////////////////////////////////// SbxStdCollection::SbxStdCollection - ( const XubString& rClass, const XubString& rElem, BOOL b ) + ( const XubString& rClass, const XubString& rElem, sal_Bool b ) : SbxCollection( rClass ), aElemClass( rElem ), bAddRemoveOk( b ) {} @@ -277,9 +277,9 @@ void SbxStdCollection::CollRemove( SbxArray* pPar_ ) SbxCollection::CollRemove( pPar_ ); } -BOOL SbxStdCollection::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxStdCollection::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { - BOOL bRes = SbxCollection::LoadData( rStrm, nVer ); + sal_Bool bRes = SbxCollection::LoadData( rStrm, nVer ); if( bRes ) { rStrm.ReadByteString( aElemClass, RTL_TEXTENCODING_ASCII_US ); @@ -288,9 +288,9 @@ BOOL SbxStdCollection::LoadData( SvStream& rStrm, USHORT nVer ) return bRes; } -BOOL SbxStdCollection::StoreData( SvStream& rStrm ) const +sal_Bool SbxStdCollection::StoreData( SvStream& rStrm ) const { - BOOL bRes = SbxCollection::StoreData( rStrm ); + sal_Bool bRes = SbxCollection::StoreData( rStrm ); if( bRes ) { rStrm.WriteByteString( aElemClass, RTL_TEXTENCODING_ASCII_US ); diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx index 16fec542cded..61edeef3a4fa 100644 --- a/basic/source/sbx/sbxconv.hxx +++ b/basic/source/sbx/sbxconv.hxx @@ -33,19 +33,19 @@ class SbxArray; // SBXSCAN.CXX -extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString=FALSE ); +extern void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreString=sal_False ); extern SbxError ImpScan - ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, USHORT* pLen, - BOOL bAllowIntntl=FALSE, BOOL bOnlyIntntl=FALSE ); + ( const ::rtl::OUString& rSrc, double& nVal, SbxDataType& rType, sal_uInt16* pLen, + sal_Bool bAllowIntntl=sal_False, sal_Bool bOnlyIntntl=sal_False ); -// mit erweiterter Auswertung (International, "TRUE"/"FALSE") -extern BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ); +// mit erweiterter Auswertung (International, "sal_True"/"sal_False") +extern sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ); // SBXINT.CXX double ImpRound( double ); -INT16 ImpGetInteger( const SbxValues* ); -void ImpPutInteger( SbxValues*, INT16 ); +sal_Int16 ImpGetInteger( const SbxValues* ); +void ImpPutInteger( SbxValues*, sal_Int16 ); sal_Int64 ImpGetInt64( const SbxValues* ); void ImpPutInt64( SbxValues*, sal_Int64 ); sal_uInt64 ImpGetUInt64( const SbxValues* ); @@ -57,8 +57,8 @@ double ImpSalUInt64ToDouble( sal_uInt64 n ); // SBXLNG.CXX -INT32 ImpGetLong( const SbxValues* ); -void ImpPutLong( SbxValues*, INT32 ); +sal_Int32 ImpGetLong( const SbxValues* ); +void ImpPutLong( SbxValues*, sal_Int32 ); // SBXSNG.CXX @@ -68,7 +68,7 @@ void ImpPutSingle( SbxValues*, float ); // SBXDBL.CXX double ImpGetDouble( const SbxValues* ); -void ImpPutDouble( SbxValues*, double, BOOL bCoreString=FALSE ); +void ImpPutDouble( SbxValues*, double, sal_Bool bCoreString=sal_False ); #if FALSE // SBX64.CXX @@ -87,10 +87,10 @@ SbxINT64 ImpDoubleToINT64( double ); double ImpINT64ToDouble( const SbxINT64& ); #if TRUE -INT32 ImpGetCurrLong( const SbxValues* ); -void ImpPutCurrLong( SbxValues*, INT32 ); -INT32 ImpDoubleToCurrLong( double ); -double ImpCurrLongToDouble( INT32 ); +sal_Int32 ImpGetCurrLong( const SbxValues* ); +void ImpPutCurrLong( SbxValues*, sal_Int32 ); +sal_Int32 ImpDoubleToCurrLong( double ); +double ImpCurrLongToDouble( sal_Int32 ); #endif SbxINT64 ImpGetCurrency( const SbxValues* ); @@ -126,23 +126,23 @@ sal_Unicode ImpGetChar( const SbxValues* ); void ImpPutChar( SbxValues*, sal_Unicode ); // SBXBYTE.CXX -BYTE ImpGetByte( const SbxValues* ); -void ImpPutByte( SbxValues*, BYTE ); +sal_uInt8 ImpGetByte( const SbxValues* ); +void ImpPutByte( SbxValues*, sal_uInt8 ); // SBXUINT.CXX -UINT16 ImpGetUShort( const SbxValues* ); -void ImpPutUShort( SbxValues*, UINT16 ); +sal_uInt16 ImpGetUShort( const SbxValues* ); +void ImpPutUShort( SbxValues*, sal_uInt16 ); // SBXULNG.CXX -UINT32 ImpGetULong( const SbxValues* ); -void ImpPutULong( SbxValues*, UINT32 ); +sal_uInt32 ImpGetULong( const SbxValues* ); +void ImpPutULong( SbxValues*, sal_uInt32 ); // SBXBOOL.CXX enum SbxBOOL ImpGetBool( const SbxValues* ); -void ImpPutBool( SbxValues*, INT16 ); +void ImpPutBool( SbxValues*, sal_Int16 ); // ByteArry <--> String SbxArray* StringToByteArray(const ::rtl::OUString& rStr); diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx index 1ac8c254ca6b..1d0b81ed98f6 100644 --- a/basic/source/sbx/sbxdate.cxx +++ b/basic/source/sbx/sbxdate.cxx @@ -125,13 +125,13 @@ double ImpGetDate( const SbxValues* p ) pFormatter->PutandConvertEntry( aStr, nCheckPos, nType, nIndex, LANGUAGE_GERMAN, eLangType ); - BOOL bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes ); + sal_Bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes ); if ( bSuccess ) { short nType_ = pFormatter->GetType( nIndex ); if(!(nType_ & ( NUMBERFORMAT_DATETIME | NUMBERFORMAT_DATE | NUMBERFORMAT_TIME | NUMBERFORMAT_DEFINED ))) - bSuccess = FALSE; + bSuccess = sal_False; } if ( !bSuccess ) @@ -328,7 +328,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: if( n > SbxMAXINT ) @@ -339,7 +339,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; } - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: if( n > SbxMAXUINT ) @@ -350,7 +350,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: if( n > SbxMAXLNG ) { @@ -360,7 +360,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG; } - *p->pLong = (INT32) n; break; + *p->pLong = (sal_Int32) n; break; case SbxBYREF | SbxULONG: if( n > SbxMAXULNG ) { @@ -370,7 +370,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSINGLE: if( n > SbxMAXSNG ) { diff --git a/basic/source/sbx/sbxdbl.cxx b/basic/source/sbx/sbxdbl.cxx index be55d3409131..efbad5521f3b 100644 --- a/basic/source/sbx/sbxdbl.cxx +++ b/basic/source/sbx/sbxdbl.cxx @@ -140,7 +140,7 @@ double ImpGetDouble( const SbxValues* p ) return nRes; } -void ImpPutDouble( SbxValues* p, double n, BOOL bCoreString ) +void ImpPutDouble( SbxValues* p, double n, sal_Bool bCoreString ) { SbxValues aTmp; start: @@ -220,7 +220,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: if( n > SbxMAXINT ) @@ -231,7 +231,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; } - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: if( n > SbxMAXUINT ) @@ -242,7 +242,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: if( n > SbxMAXLNG ) { @@ -252,7 +252,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG; } - *p->pLong = (INT32) n; break; + *p->pLong = (sal_Int32) n; break; case SbxBYREF | SbxULONG: if( n > SbxMAXULNG ) { @@ -262,7 +262,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSINGLE: if( n > SbxMAXSNG ) { diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx index 2191d91c8d82..3a0e65c142e2 100644 --- a/basic/source/sbx/sbxdec.cxx +++ b/basic/source/sbx/sbxdec.cxx @@ -158,32 +158,32 @@ SbxDecimal::CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight void SbxDecimal::setChar( sal_Unicode val ) { - VarDecFromUI2( (USHORT)val, &maDec ); + VarDecFromUI2( (sal_uInt16)val, &maDec ); } -void SbxDecimal::setByte( BYTE val ) +void SbxDecimal::setByte( sal_uInt8 val ) { - VarDecFromUI1( (BYTE)val, &maDec ); + VarDecFromUI1( (sal_uInt8)val, &maDec ); } -void SbxDecimal::setShort( INT16 val ) +void SbxDecimal::setShort( sal_Int16 val ) { VarDecFromI2( (short)val, &maDec ); } -void SbxDecimal::setLong( INT32 val ) +void SbxDecimal::setLong( sal_Int32 val ) { VarDecFromI4( (long)val, &maDec ); } -void SbxDecimal::setUShort( UINT16 val ) +void SbxDecimal::setUShort( sal_uInt16 val ) { - VarDecFromUI2( (USHORT)val, &maDec ); + VarDecFromUI2( (sal_uInt16)val, &maDec ); } -void SbxDecimal::setULong( UINT32 val ) +void SbxDecimal::setULong( sal_uInt32 val ) { - VarDecFromUI4( (ULONG)val, &maDec ); + VarDecFromUI4( (sal_uIntPtr)val, &maDec ); } bool SbxDecimal::setSingle( float val ) @@ -200,12 +200,12 @@ bool SbxDecimal::setDouble( double val ) void SbxDecimal::setInt( int val ) { - setLong( (INT32)val ); + setLong( (sal_Int32)val ); } void SbxDecimal::setUInt( unsigned int val ) { - setULong( (UINT32)val ); + setULong( (sal_uInt32)val ); } // sbxscan.cxx @@ -261,31 +261,31 @@ bool SbxDecimal::getChar( sal_Unicode& rVal ) return bRet; } -bool SbxDecimal::getByte( BYTE& rVal ) +bool SbxDecimal::getByte( sal_uInt8& rVal ) { bool bRet = ( VarUI1FromDec( &maDec, &rVal ) == S_OK ); return bRet; } -bool SbxDecimal::getShort( INT16& rVal ) +bool SbxDecimal::getShort( sal_Int16& rVal ) { bool bRet = ( VarI2FromDec( &maDec, &rVal ) == S_OK ); return bRet; } -bool SbxDecimal::getLong( INT32& rVal ) +bool SbxDecimal::getLong( sal_Int32& rVal ) { bool bRet = ( VarI4FromDec( &maDec, &rVal ) == S_OK ); return bRet; } -bool SbxDecimal::getUShort( UINT16& rVal ) +bool SbxDecimal::getUShort( sal_uInt16& rVal ) { bool bRet = ( VarUI2FromDec( &maDec, &rVal ) == S_OK ); return bRet; } -bool SbxDecimal::getULong( UINT32& rVal ) +bool SbxDecimal::getULong( sal_uInt32& rVal ) { bool bRet = ( VarUI4FromDec( &maDec, &rVal ) == S_OK ); return bRet; @@ -305,7 +305,7 @@ bool SbxDecimal::getDouble( double& rVal ) bool SbxDecimal::getInt( int& rVal ) { - INT32 TmpVal; + sal_Int32 TmpVal; bool bRet = getLong( TmpVal ); rVal = TmpVal; return bRet; @@ -313,7 +313,7 @@ bool SbxDecimal::getInt( int& rVal ) bool SbxDecimal::getUInt( unsigned int& rVal ) { - UINT32 TmpVal; + sal_uInt32 TmpVal; bool bRet = getULong( TmpVal ); rVal = TmpVal; return bRet; @@ -364,11 +364,11 @@ SbxDecimal::CmpResult compare( const SbxDecimal &rLeft, const SbxDecimal &rRight } void SbxDecimal::setChar( sal_Unicode val ) { (void)val; } -void SbxDecimal::setByte( BYTE val ) { (void)val; } -void SbxDecimal::setShort( INT16 val ) { (void)val; } -void SbxDecimal::setLong( INT32 val ) { (void)val; } -void SbxDecimal::setUShort( UINT16 val ) { (void)val; } -void SbxDecimal::setULong( UINT32 val ) { (void)val; } +void SbxDecimal::setByte( sal_uInt8 val ) { (void)val; } +void SbxDecimal::setShort( sal_Int16 val ) { (void)val; } +void SbxDecimal::setLong( sal_Int32 val ) { (void)val; } +void SbxDecimal::setUShort( sal_uInt16 val ) { (void)val; } +void SbxDecimal::setULong( sal_uInt32 val ) { (void)val; } bool SbxDecimal::setSingle( float val ) { (void)val; return false; } bool SbxDecimal::setDouble( double val ) { (void)val; return false; } void SbxDecimal::setInt( int val ) { (void)val; } @@ -376,11 +376,11 @@ void SbxDecimal::setUInt( unsigned int val ) { (void)val; } bool SbxDecimal::setString( ::rtl::OUString* pOUString ) { (void)pOUString; return false; } bool SbxDecimal::getChar( sal_Unicode& rVal ) { (void)rVal; return false; } -bool SbxDecimal::getByte( BYTE& rVal ) { (void)rVal; return false; } -bool SbxDecimal::getShort( INT16& rVal ) { (void)rVal; return false; } -bool SbxDecimal::getLong( INT32& rVal ) { (void)rVal; return false; } -bool SbxDecimal::getUShort( UINT16& rVal ) { (void)rVal; return false; } -bool SbxDecimal::getULong( UINT32& rVal ) { (void)rVal; return false; } +bool SbxDecimal::getByte( sal_uInt8& rVal ) { (void)rVal; return false; } +bool SbxDecimal::getShort( sal_Int16& rVal ) { (void)rVal; return false; } +bool SbxDecimal::getLong( sal_Int32& rVal ) { (void)rVal; return false; } +bool SbxDecimal::getUShort( sal_uInt16& rVal ) { (void)rVal; return false; } +bool SbxDecimal::getULong( sal_uInt32& rVal ) { (void)rVal; return false; } bool SbxDecimal::getSingle( float& rVal ) { (void)rVal; return false; } bool SbxDecimal::getDouble( double& rVal ) { (void)rVal; return false; } bool SbxDecimal::getInt( int& rVal ) { (void)rVal; return false; } diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx index cd80bbad282e..6b8cd7e31336 100644 --- a/basic/source/sbx/sbxdec.hxx +++ b/basic/source/sbx/sbxdec.hxx @@ -61,7 +61,7 @@ class SbxDecimal #ifdef WIN32 DECIMAL maDec; #endif - INT32 mnRefCount; + sal_Int32 mnRefCount; public: SbxDecimal( void ); @@ -76,11 +76,11 @@ public: void fillAutomationDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ); void setChar( sal_Unicode val ); - void setByte( BYTE val ); - void setShort( INT16 val ); - void setLong( INT32 val ); - void setUShort( UINT16 val ); - void setULong( UINT32 val ); + void setByte( sal_uInt8 val ); + void setShort( sal_Int16 val ); + void setLong( sal_Int32 val ); + void setUShort( sal_uInt16 val ); + void setULong( sal_uInt32 val ); bool setSingle( float val ); bool setDouble( double val ); void setInt( int val ); @@ -97,11 +97,11 @@ public: } bool getChar( sal_Unicode& rVal ); - bool getByte( BYTE& rVal ); - bool getShort( INT16& rVal ); - bool getLong( INT32& rVal ); - bool getUShort( UINT16& rVal ); - bool getULong( UINT32& rVal ); + bool getByte( sal_uInt8& rVal ); + bool getShort( sal_Int16& rVal ); + bool getLong( sal_Int32& rVal ); + bool getUShort( sal_uInt16& rVal ); + bool getULong( sal_uInt32& rVal ); bool getSingle( float& rVal ); bool getDouble( double& rVal ); bool getInt( int& rVal ); diff --git a/basic/source/sbx/sbxexec.cxx b/basic/source/sbx/sbxexec.cxx index c602b130fc5e..9b43a94873f0 100644 --- a/basic/source/sbx/sbxexec.cxx +++ b/basic/source/sbx/sbxexec.cxx @@ -37,21 +37,21 @@ class SbxSimpleCharClass { public: - BOOL isAlpha( sal_Unicode c ) const + sal_Bool isAlpha( sal_Unicode c ) const { - BOOL bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); + sal_Bool bRet = (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); return bRet; } - BOOL isDigit( sal_Unicode c ) const + sal_Bool isDigit( sal_Unicode c ) const { - BOOL bRet = (c >= '0' && c <= '9'); + sal_Bool bRet = (c >= '0' && c <= '9'); return bRet; } - BOOL isAlphaNumeric( sal_Unicode c ) const + sal_Bool isAlphaNumeric( sal_Unicode c ) const { - BOOL bRet = isDigit( c ) || isAlpha( c ); + sal_Bool bRet = isDigit( c ) || isAlpha( c ); return bRet; } }; @@ -73,7 +73,7 @@ static const xub_Unicode* SkipWhitespace( const xub_Unicode* p ) static const xub_Unicode* Symbol( const xub_Unicode* p, XubString& rSym, const SbxSimpleCharClass& rCharClass ) { - USHORT nLen = 0; + sal_uInt16 nLen = 0; // Haben wir ein Sondersymbol? if( *p == '[' ) { @@ -143,7 +143,7 @@ static SbxVariable* QualifiedName // eine Funktion (mit optionalen Parametern) sein. static SbxVariable* Operand - ( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, BOOL bVar ) + ( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf, sal_Bool bVar ) { static SbxSimpleCharClass aCharClass; @@ -155,7 +155,7 @@ static SbxVariable* Operand || *p == '&' ) ) { // Eine Zahl kann direkt eingescant werden! - USHORT nLen; + sal_uInt16 nLen; if( !refVar->Scan( XubString( p ), &nLen ) ) refVar.Clear(); else @@ -193,12 +193,12 @@ static SbxVariable* Operand static SbxVariable* MulDiv( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf ) { const xub_Unicode* p = *ppBuf; - SbxVariableRef refVar( Operand( pObj, pGbl, &p, FALSE ) ); + SbxVariableRef refVar( Operand( pObj, pGbl, &p, sal_False ) ); p = SkipWhitespace( p ); while( refVar.Is() && ( *p == '*' || *p == '/' ) ) { xub_Unicode cOp = *p++; - SbxVariableRef refVar2( Operand( pObj, pGbl, &p, FALSE ) ); + SbxVariableRef refVar2( Operand( pObj, pGbl, &p, sal_False ) ); if( refVar2.Is() ) { // temporaere Variable! @@ -257,7 +257,7 @@ static SbxVariable* PlusMinus( SbxObject* pObj, SbxObject* pGbl, const xub_Unico static SbxVariable* Assign( SbxObject* pObj, SbxObject* pGbl, const xub_Unicode** ppBuf ) { const xub_Unicode* p = *ppBuf; - SbxVariableRef refVar( Operand( pObj, pGbl, &p, TRUE ) ); + SbxVariableRef refVar( Operand( pObj, pGbl, &p, sal_True ) ); p = SkipWhitespace( p ); if( refVar.Is() ) { @@ -305,7 +305,7 @@ static SbxVariable* Element SbxVariableRef refVar; if( aSym.Len() ) { - USHORT nOld = pObj->GetFlags(); + sal_uInt16 nOld = pObj->GetFlags(); if( pObj == pGbl ) pObj->SetFlag( SBX_GBLSEARCH ); refVar = pObj->Find( aSym, t ); @@ -319,7 +319,7 @@ static SbxVariable* Element { p++; SbxArrayRef refPar = new SbxArray; - USHORT nArg = 0; + sal_uInt16 nArg = 0; // Wird sind mal relaxed und akzeptieren auch // das Zeilen- oder Komandoende als Begrenzer // Parameter immer global suchen! diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx index b53612f1e642..46b6e6caa445 100644 --- a/basic/source/sbx/sbxform.cxx +++ b/basic/source/sbx/sbxform.cxx @@ -151,7 +151,7 @@ void SbxBasicFormater::ShowError( char * sErrMsg ) // um eine Position zu gr"osseren Indizes, d.h. es wird Platz f"ur // ein neues (einzuf"ugendes) Zeichen geschafft. // ACHTUNG: der String MUSS gross genug sein ! -inline void SbxBasicFormater::ShiftString( String& sStrg, USHORT nStartPos ) +inline void SbxBasicFormater::ShiftString( String& sStrg, sal_uInt16 nStartPos ) { sStrg.Erase( nStartPos,1 ); } @@ -174,7 +174,7 @@ void SbxBasicFormater::AppendDigit( String& sStrg, short nDigit ) // verschiebt den Dezimal-Punkt um eine Stelle nach links void SbxBasicFormater::LeftShiftDecimalPoint( String& sStrg ) { - USHORT nPos = sStrg.Search( cDecPoint ); + sal_uInt16 nPos = sStrg.Search( cDecPoint ); if( nPos!=STRING_NOTFOUND ) { @@ -188,13 +188,13 @@ void SbxBasicFormater::LeftShiftDecimalPoint( String& sStrg ) // es wird ein Flag zur"uckgeliefert, falls ein Overflow auftrat, // d.h. 99.99 --> 100.00, d.h. ein Gr"ossenordung ge"andert wurde // (geschieht beim Runden einer 9). -void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, BOOL& bOverflow ) +void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, sal_Bool& bOverflow ) { // wurde ggf ein falscher Index uebergeben --> Aufruf ignorieren if( nPos<0 ) return; - bOverflow = FALSE; + bOverflow = sal_False; // "uberspringe den Dezimalpunkt und Tausender-Trennzeichen sal_Unicode c = sStrg.GetChar( nPos ); if( nPos>0 && (c == cDecPoint || c == cThousandSep) ) @@ -218,7 +218,7 @@ void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, BOOL& bOverflow ShiftString( sStrg,0 ); // f"uhrende 1 einf"ugen: z.B. 99.99 f"ur 0.0 sStrg.SetChar( 0, '1' ); - bOverflow = TRUE; + bOverflow = sal_True; } else { @@ -243,7 +243,7 @@ void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, BOOL& bOverflow ShiftString( sStrg,nPos+1 ); // f"uhrende 1 einf"ugen sStrg.SetChar( nPos+1, '1' ); - bOverflow = TRUE; + bOverflow = sal_True; } } } @@ -251,7 +251,7 @@ void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos, BOOL& bOverflow // rundet in einem String die Ziffer an der angegebenen Stelle void SbxBasicFormater::StrRoundDigit( String& sStrg, short nPos ) { - BOOL bOverflow; + sal_Bool bOverflow; StrRoundDigit( sStrg,nPos,bOverflow ); } @@ -302,7 +302,7 @@ void SbxBasicFormater::InitExp( double _dNewExp ) // bestimmt die Ziffer an der angegebenen Stelle (gedacht zur Anwendung im // Scan-Durchlauf) -short SbxBasicFormater::GetDigitAtPosScan( short nPos, BOOL& bFoundFirstDigit ) +short SbxBasicFormater::GetDigitAtPosScan( short nPos, sal_Bool& bFoundFirstDigit ) { // Versuch eine gr"ossere Ziffer zu lesen, // z.B. Stelle 4 in 1.234, @@ -312,18 +312,18 @@ short SbxBasicFormater::GetDigitAtPosScan( short nPos, BOOL& bFoundFirstDigit ) return _NO_DIGIT; // bestimme den Index der Stelle in dem Number-String: // "uberlese das Vorzeichen - USHORT no = 1; + sal_uInt16 no = 1; // falls notwendig den Dezimal-Punkt "uberlesen: if( nPos Flag setzen if( nPos==nNumExp ) - bFoundFirstDigit = TRUE; + bFoundFirstDigit = sal_True; return (short)(sSciNumStrg.GetChar( no ) - ASCII_0); } -short SbxBasicFormater::GetDigitAtPosExpScan( short nPos, BOOL& bFoundFirstDigit ) +short SbxBasicFormater::GetDigitAtPosExpScan( short nPos, sal_Bool& bFoundFirstDigit ) { // ist die abgefragte Stelle zu gross f"ur den Exponenten ? if( nPos>nExpExp ) @@ -331,11 +331,11 @@ short SbxBasicFormater::GetDigitAtPosExpScan( short nPos, BOOL& bFoundFirstDigit // bestimme den Index der Stelle in dem Number-String: // "uberlese das Vorzeichen - USHORT no = 1; + sal_uInt16 no = 1; no += nExpExp-nPos; // Abfrage der ersten (g"ultigen) Ziffer der Zahl --> Flag setzen if( nPos==nExpExp ) - bFoundFirstDigit = TRUE; + bFoundFirstDigit = sal_True; return (short)(sNumExpStrg.GetChar( no ) - ASCII_0); } @@ -343,7 +343,7 @@ short SbxBasicFormater::GetDigitAtPosExpScan( short nPos, BOOL& bFoundFirstDigit // Zahl ggf. NICHT normiert (z.B. 1.2345e-03) dargestellt werden soll, // sondern eventuell 123.345e-3 ! short SbxBasicFormater::GetDigitAtPosExpScan( double dNewExponent, short nPos, - BOOL& bFoundFirstDigit ) + sal_Bool& bFoundFirstDigit ) { // neuer Exponent wurde "ubergeben, aktualisiere // die tempor"aren Klassen-Variablen @@ -381,7 +381,7 @@ TODO: ggf einen 'intelligenten' Peek-Parser um Rundungsfehler bei // // ACHTUNG: anscheinend gibt es manchmal noch Probleme mit Rundungs-Fehlern! short SbxBasicFormater::GetDigitAtPos( double dNumber, short nPos, - double& dNextNumber, BOOL& bFoundFirstDigit ) + double& dNextNumber, sal_Bool& bFoundFirstDigit ) // ACHTUNG: nPos kann auch negativ werden, f"ur Stellen nach dem Dezimal-Punkt { double dTemp = dNumber; @@ -400,7 +400,7 @@ short SbxBasicFormater::GetDigitAtPos( double dNumber, short nPos, if( nMaxDigit=0 ) return _NO_DIGIT; // Ziffer gefunden, setze Flag: - bFoundFirstDigit = TRUE; + bFoundFirstDigit = sal_True; for( short i=nMaxDigit; i>=nPos; i-- ) { double dI = (double)i; @@ -432,14 +432,14 @@ short SbxBasicFormater::RoundDigit( double dNumber ) // und liefert diesen zur"uck. // Somit wird ein neuer String erzeugt, der vom Aufrufer wieder freigegeben // werden muss -String SbxBasicFormater::GetPosFormatString( const String& sFormatStrg, BOOL & bFound ) +String SbxBasicFormater::GetPosFormatString( const String& sFormatStrg, sal_Bool & bFound ) { - bFound = FALSE; // default... - USHORT nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); + bFound = sal_False; // default... + sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); if( nPos!=STRING_NOTFOUND ) { - bFound = TRUE; + bFound = sal_True; // der Format-String f"ur die positiven Zahlen ist alles // vor dem ersten ';' return sFormatStrg.Copy( 0,nPos ); @@ -451,10 +451,10 @@ String SbxBasicFormater::GetPosFormatString( const String& sFormatStrg, BOOL & b } // siehe auch GetPosFormatString() -String SbxBasicFormater::GetNegFormatString( const String& sFormatStrg, BOOL & bFound ) +String SbxBasicFormater::GetNegFormatString( const String& sFormatStrg, sal_Bool & bFound ) { - bFound = FALSE; // default... - USHORT nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); + bFound = sal_False; // default... + sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); if( nPos!=STRING_NOTFOUND ) { @@ -464,7 +464,7 @@ String SbxBasicFormater::GetNegFormatString( const String& sFormatStrg, BOOL & b String sTempStrg = sFormatStrg.Copy( nPos+1 ); // und suche darin ggf. ein weiteres ';' nPos = sTempStrg.Search( FORMAT_SEPARATOR ); - bFound = TRUE; + bFound = sal_True; if( nPos==STRING_NOTFOUND ) // keins gefunden, liefere alles... return sTempStrg; @@ -478,10 +478,10 @@ String SbxBasicFormater::GetNegFormatString( const String& sFormatStrg, BOOL & b } // siehe auch GetPosFormatString() -String SbxBasicFormater::Get0FormatString( const String& sFormatStrg, BOOL & bFound ) +String SbxBasicFormater::Get0FormatString( const String& sFormatStrg, sal_Bool & bFound ) { - bFound = FALSE; // default... - USHORT nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); + bFound = sal_False; // default... + sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); if( nPos!=STRING_NOTFOUND ) { @@ -493,7 +493,7 @@ String SbxBasicFormater::Get0FormatString( const String& sFormatStrg, BOOL & bFo nPos = sTempStrg.Search( FORMAT_SEPARATOR ); if( nPos!=STRING_NOTFOUND ) { - bFound = TRUE; + bFound = sal_True; sTempStrg = sTempStrg.Copy( nPos+1 ); nPos = sTempStrg.Search( FORMAT_SEPARATOR ); if( nPos==STRING_NOTFOUND ) @@ -510,10 +510,10 @@ String SbxBasicFormater::Get0FormatString( const String& sFormatStrg, BOOL & bFo } // siehe auch GetPosFormatString() -String SbxBasicFormater::GetNullFormatString( const String& sFormatStrg, BOOL & bFound ) +String SbxBasicFormater::GetNullFormatString( const String& sFormatStrg, sal_Bool & bFound ) { - bFound = FALSE; // default... - USHORT nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); + bFound = sal_False; // default... + sal_uInt16 nPos = sFormatStrg.Search( FORMAT_SEPARATOR ); if( nPos!=STRING_NOTFOUND ) { @@ -530,7 +530,7 @@ String SbxBasicFormater::GetNullFormatString( const String& sFormatStrg, BOOL & nPos = sTempStrg.Search( FORMAT_SEPARATOR ); if( nPos!=STRING_NOTFOUND ) { - bFound = TRUE; + bFound = sal_True; return sTempStrg.Copy( nPos+1 ); } } @@ -547,11 +547,11 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, short& nNoOfDigitsLeft, short& nNoOfDigitsRight, short& nNoOfOptionalDigitsLeft, short& nNoOfExponentDigits, short& nNoOfOptionalExponentDigits, - BOOL& bPercent, BOOL& bCurrency, BOOL& bScientific, - BOOL& bGenerateThousandSeparator, + sal_Bool& bPercent, sal_Bool& bCurrency, sal_Bool& bScientific, + sal_Bool& bGenerateThousandSeparator, short& nMultipleThousandSeparators ) { - USHORT nLen; + sal_uInt16 nLen; short nState = 0; nLen = sFormatStrg.Len(); @@ -561,9 +561,9 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, nNoOfOptionalDigitsLeft = 0; nNoOfExponentDigits = 0; nNoOfOptionalExponentDigits = 0; - bPercent = FALSE; - bCurrency = FALSE; - bScientific = FALSE; + bPercent = sal_False; + bCurrency = sal_False; + bScientific = sal_False; // ab 11.7.97: sobald ein Komma in dem Format String gefunden wird, // werden alle 3 Zehnerpotenzen markiert (d.h. tausender, milionen, ...) // bisher wurde nur an den gesetzten Position ein Tausender-Separator @@ -572,7 +572,7 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, bGenerateThousandSeparator = sFormatStrg.Search( ',' ) != STRING_NOTFOUND; nMultipleThousandSeparators = 0; // und untersuche den Format-String nach den gew"unschten Informationen - for( USHORT i=0; i1 ) @@ -623,7 +623,7 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, */ break; case '(': - bCurrency = TRUE; + bCurrency = sal_True; break; case ',': { @@ -639,7 +639,7 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, if( nNoOfDigitsLeft > 0 || nNoOfDigitsRight > 0 ) { nState = -1; // breche jetzt das Z"ahlen der Stellen ab - bScientific = TRUE; + bScientific = sal_True; } /* old: bScientific++; @@ -654,7 +654,7 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, i++; break; case CREATE_1000SEP_CHAR: - bGenerateThousandSeparator = TRUE; + bGenerateThousandSeparator = sal_True; break; } } @@ -665,12 +665,12 @@ short SbxBasicFormater::AnalyseFormatString( const String& sFormatStrg, // erzeugt werden soll void SbxBasicFormater::ScanFormatString( double dNumber, const String& sFormatStrg, String& sReturnStrg, - BOOL bCreateSign ) + sal_Bool bCreateSign ) { short /*nErr,*/nNoOfDigitsLeft,nNoOfDigitsRight,nNoOfOptionalDigitsLeft, nNoOfExponentDigits,nNoOfOptionalExponentDigits, nMultipleThousandSeparators; - BOOL bPercent,bCurrency,bScientific,bGenerateThousandSeparator; + sal_Bool bPercent,bCurrency,bScientific,bGenerateThousandSeparator; // Initialisiere den Return-String sReturnStrg = String(); @@ -721,12 +721,12 @@ void SbxBasicFormater::ScanFormatString( double dNumber, double dExponent; short i,nLen; short nState,nDigitPos,nExponentPos,nMaxDigit,nMaxExponentDigit; - BOOL bFirstDigit,bFirstExponentDigit,bFoundFirstDigit, + sal_Bool bFirstDigit,bFirstExponentDigit,bFoundFirstDigit, bIsNegative,bZeroSpaceOn, bSignHappend,bDigitPosNegative; // Initialisierung der Arbeits-Variablen - bSignHappend = FALSE; - bFoundFirstDigit = FALSE; + bSignHappend = sal_False; + bFoundFirstDigit = sal_False; bIsNegative = dNumber<0.0; nLen = sFormatStrg.Len(); dExponent = get_number_of_digits( dNumber ); @@ -750,8 +750,8 @@ void SbxBasicFormater::ScanFormatString( double dNumber, // hier ben"otigt man keine Exponent-Daten ! bDigitPosNegative = (nDigitPos < 0); } - bFirstDigit = TRUE; - bFirstExponentDigit = TRUE; + bFirstDigit = sal_True; + bFirstExponentDigit = sal_True; nState = 0; // 0 --> Mantisse; 1 --> Exponent bZeroSpaceOn = 0; @@ -781,14 +781,14 @@ void SbxBasicFormater::ScanFormatString( double dNumber, // Behandlung der Mantisse if( bFirstDigit ) { - //org:bFirstDigit = FALSE; + //org:bFirstDigit = sal_False; // ggf. Vorzeichen erzeugen // Bem.: bei bCurrency soll das negative // Vorzeichen durch () angezeigt werden if( bIsNegative && !bCreateSign/*!bCurrency*/ && !bSignHappend ) { // nur einmal ein Vorzeichen ausgeben - bSignHappend = TRUE; + bSignHappend = sal_True; StrAppendChar( sReturnStrg,'-' ); } // hier jetzt "uberz"ahlige Stellen ausgeben, @@ -806,7 +806,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, // wurde wirklich eine Ziffer eingefuegt ? if( nTempDigit!=_NO_DIGIT ) // jetzt wurde wirklich eine Ziffer ausgegeben, Flag setzen - bFirstDigit = FALSE; + bFirstDigit = sal_False; // muss ggf. ein Tausender-Trennzeichen erzeugt werden? if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit>=nDigitPos ) && j>0 && (j % 3 == 0) ) StrAppendChar( sReturnStrg,cThousandSep ); @@ -818,7 +818,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, { AppendDigit( sReturnStrg,0 ); // Ja // jetzt wurde wirklich eine Ziffer ausgegeben, Flag setzen - bFirstDigit = FALSE; + bFirstDigit = sal_False; bZeroSpaceOn = 1; // BEM.: bei Visual-Basic schaltet die erste 0 f"ur alle // nachfolgenden # (bis zum Dezimal-Punkt) die 0 ein, @@ -838,7 +838,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, // wurde wirklich eine Ziffer eingefuegt ? if( nTempDigit!=_NO_DIGIT ) // jetzt wurde wirklich eine Ziffer ausgegeben, Flag setzen - bFirstDigit = FALSE; + bFirstDigit = sal_False; // muss ggf. ein Tausender-Trennzeichen erzeugt werden? if( bGenerateThousandSeparator && ( c=='0' || nMaxDigit>=nDigitPos ) && nDigitPos>0 && (nDigitPos % 3 == 0) ) StrAppendChar( sReturnStrg,cThousandSep ); @@ -852,7 +852,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, if( bFirstExponentDigit ) { // Vorzeichen wurde schon bei e/E ausgegeben - bFirstExponentDigit = FALSE; + bFirstExponentDigit = sal_False; if( nMaxExponentDigit>nExponentPos ) // hier jetzt "uberz"ahlige Stellen ausgeben, // d.h. vom Format-String nicht erfasste Stellen @@ -913,7 +913,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, break; } - BOOL bOverflow = FALSE; + sal_Bool bOverflow = sal_False; #ifdef _with_sprintf short nNextDigit = GetDigitAtPosScan( nDigitPos,bFoundFirstDigit ); #else @@ -1047,7 +1047,7 @@ void SbxBasicFormater::ScanFormatString( double dNumber, String SbxBasicFormater::BasicFormatNull( String sFormatStrg ) { - BOOL bNullFormatFound; + sal_Bool bNullFormatFound; String sNullFormatStrg = GetNullFormatString( sFormatStrg,bNullFormatFound ); if( bNullFormatFound ) @@ -1059,7 +1059,7 @@ String SbxBasicFormater::BasicFormatNull( String sFormatStrg ) String SbxBasicFormater::BasicFormat( double dNumber, String sFormatStrg ) { - BOOL bPosFormatFound,bNegFormatFound,b0FormatFound; + sal_Bool bPosFormatFound,bNegFormatFound,b0FormatFound; // analysiere Format-String auf vordefinierte Formate: if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_GENERALNUMBER ) ) @@ -1108,7 +1108,7 @@ String SbxBasicFormater::BasicFormat( double dNumber, String sFormatStrg ) // verwende String fuer positive Werte sTempStrg = sPosFormatStrg; } - ScanFormatString( dNumber, sTempStrg, sReturnStrg,/*bCreateSign=*/FALSE ); + ScanFormatString( dNumber, sTempStrg, sReturnStrg,/*bCreateSign=*/sal_False ); } else { @@ -1137,32 +1137,32 @@ String SbxBasicFormater::BasicFormat( double dNumber, String sFormatStrg ) { ScanFormatString( dNumber, (/*sPosFormatStrg!=EMPTYFORMATSTRING*/bPosFormatFound ? sPosFormatStrg : sFormatStrg), - sReturnStrg,/*bCreateSign=*/FALSE ); + sReturnStrg,/*bCreateSign=*/sal_False ); } } return sReturnStrg; } -BOOL SbxBasicFormater::isBasicFormat( String sFormatStrg ) +sal_Bool SbxBasicFormater::isBasicFormat( String sFormatStrg ) { if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_GENERALNUMBER ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_CURRENCY ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_FIXED ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_STANDARD ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_PERCENT ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_SCIENTIFIC ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_YESNO ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_TRUEFALSE ) ) - return TRUE; + return sal_True; if( sFormatStrg.EqualsIgnoreCaseAscii( BASICFORMAT_ONOFF ) ) - return TRUE; - return FALSE; + return sal_True; + return sal_False; } diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx index 47c38aecb1c2..4c4b3959e7a0 100644 --- a/basic/source/sbx/sbxint.cxx +++ b/basic/source/sbx/sbxint.cxx @@ -36,10 +36,10 @@ double ImpRound( double d ) return d + ( d < 0 ? -0.5 : 0.5 ); } -INT16 ImpGetInteger( const SbxValues* p ) +sal_Int16 ImpGetInteger( const SbxValues* p ) { SbxValues aTmp; - INT16 nRes; + sal_Int16 nRes; start: switch( +p->eType ) { @@ -56,12 +56,12 @@ start: nRes = p->nInteger; break; case SbxERROR: case SbxUSHORT: - if( p->nUShort > (USHORT) SbxMAXINT ) + if( p->nUShort > (sal_uInt16) SbxMAXINT ) { SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; } else - nRes = (INT16) p->nUShort; + nRes = (sal_Int16) p->nUShort; break; case SbxLONG: if( p->nLong > SbxMAXINT ) @@ -73,7 +73,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; } else - nRes = (INT16) p->nLong; + nRes = (sal_Int16) p->nLong; break; case SbxULONG: if( p->nULong > SbxMAXINT ) @@ -81,7 +81,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; } else - nRes = (INT16) p->nULong; + nRes = (sal_Int16) p->nULong; break; case SbxSINGLE: if( p->nSingle > SbxMAXINT ) @@ -93,7 +93,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; } else - nRes = (INT16) ImpRound( p->nSingle ); + nRes = (sal_Int16) ImpRound( p->nSingle ); break; case SbxSALINT64: if( p->nInt64 > SbxMAXINT ) @@ -105,7 +105,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; } else - nRes = (INT16) p->nInt64; + nRes = (sal_Int16) p->nInt64; break; case SbxSALUINT64: if( p->uInt64 > SbxMAXINT ) @@ -113,7 +113,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXINT; } else - nRes = (INT16) p->uInt64; + nRes = (sal_Int16) p->uInt64; break; case SbxDATE: case SbxDOUBLE: @@ -148,7 +148,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; } else - nRes = (INT16) ImpRound( dVal ); + nRes = (sal_Int16) ImpRound( dVal ); break; } case SbxLPSTR: @@ -171,7 +171,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMININT; } else - nRes = (INT16) ImpRound( d ); + nRes = (sal_Int16) ImpRound( d ); } break; case SbxOBJECT: @@ -226,7 +226,7 @@ start: return nRes; } -void ImpPutInteger( SbxValues* p, INT16 n ) +void ImpPutInteger( SbxValues* p, sal_Int16 n ) { SbxValues aTmp; start: @@ -303,7 +303,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: *p->pInteger = n; break; @@ -313,15 +313,15 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: - *p->pLong = (INT32) n; break; + *p->pLong = (sal_Int32) n; break; case SbxBYREF | SbxULONG: if( n < 0 ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSALINT64: *p->pnInt64 = n; break; case SbxBYREF | SbxSALUINT64: @@ -610,7 +610,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: if( n > SbxMAXINT ) @@ -621,7 +621,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; } - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: if( n > SbxMAXUINT ) @@ -632,7 +632,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: if( n > SbxMAXLNG ) { @@ -642,7 +642,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMINLNG; } - *p->pLong = (INT32) n; break; + *p->pLong = (sal_Int32) n; break; case SbxBYREF | SbxULONG: if( n > SbxMAXULNG ) { @@ -652,7 +652,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSINGLE: *p->pSingle = (float) n; break; case SbxBYREF | SbxDATE: @@ -907,33 +907,33 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: if( n > SbxMAXINT ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; } - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: if( n > SbxMAXUINT ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: if( n > SbxMAXLNG ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; } - *p->pLong = (INT32) n; break; + *p->pLong = (sal_Int32) n; break; case SbxBYREF | SbxULONG: if( n > SbxMAXULNG ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXULNG; } - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSINGLE: *p->pDouble = (float)ImpSalUInt64ToDouble( n ); break; case SbxBYREF | SbxDATE: diff --git a/basic/source/sbx/sbxlng.cxx b/basic/source/sbx/sbxlng.cxx index 1cf2d84061f9..ae873d8eba1b 100644 --- a/basic/source/sbx/sbxlng.cxx +++ b/basic/source/sbx/sbxlng.cxx @@ -31,10 +31,10 @@ #include #include "sbxconv.hxx" -INT32 ImpGetLong( const SbxValues* p ) +sal_Int32 ImpGetLong( const SbxValues* p ) { SbxValues aTmp; - INT32 nRes; + sal_Int32 nRes; start: switch( +p->eType ) { @@ -60,7 +60,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMAXLNG; } else - nRes = (INT32) p->nULong; + nRes = (sal_Int32) p->nULong; break; case SbxSINGLE: if( p->nSingle > SbxMAXLNG ) @@ -72,7 +72,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (INT32) ImpRound( p->nSingle ); + nRes = (sal_Int32) ImpRound( p->nSingle ); break; case SbxDATE: case SbxDOUBLE: @@ -113,7 +113,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (INT32) ImpRound( dVal ); + nRes = (sal_Int32) ImpRound( dVal ); break; } case SbxBYREF | SbxSTRING: @@ -136,7 +136,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = SbxMINLNG; } else - nRes = (INT32) ImpRound( d ); + nRes = (sal_Int32) ImpRound( d ); } break; case SbxOBJECT: @@ -191,7 +191,7 @@ start: return nRes; } -void ImpPutLong( SbxValues* p, INT32 n ) +void ImpPutLong( SbxValues* p, sal_Int32 n ) { SbxValues aTmp; @@ -272,7 +272,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: if( n > SbxMAXINT ) @@ -283,7 +283,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMININT; } - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: if( n > SbxMAXUINT ) @@ -294,7 +294,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: *p->pLong = n; break; case SbxBYREF | SbxULONG: @@ -302,7 +302,7 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = 0; } - *p->pULong = (UINT32) n; break; + *p->pULong = (sal_uInt32) n; break; case SbxBYREF | SbxSALINT64: *p->pnInt64 = n; break; case SbxBYREF | SbxSALUINT64: diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 6628973b29e8..d4aaf281a042 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -41,7 +41,7 @@ TYPEINIT2(SbxObject,SbxVariable,SfxListener) static const char* pNameProp; // Name-Property static const char* pParentProp; // Parent-Property -static USHORT nNameHash = 0, nParentHash = 0; +static sal_uInt16 nNameHash = 0, nParentHash = 0; ///////////////////////////////////////////////////////////////////////// @@ -86,18 +86,18 @@ SbxObject& SbxObject::operator=( const SbxObject& r ) pDfltProp = r.pDfltProp; SetName( r.GetName() ); SetFlags( r.GetFlags() ); - SetModified( TRUE ); + SetModified( sal_True ); } return *this; } static void CheckParentsOnDelete( SbxObject* pObj, SbxArray* p ) { - for( USHORT i = 0; i < p->Count(); i++ ) + for( sal_uInt16 i = 0; i < p->Count(); i++ ) { SbxVariableRef& rRef = p->GetRef( i ); if( rRef->IsBroadcaster() ) - pObj->EndListening( rRef->GetBroadcaster(), TRUE ); + pObj->EndListening( rRef->GetBroadcaster(), sal_True ); // Hat das Element mehr als eine Referenz und noch einen Listener? if( rRef->GetRefCount() > 1 ) { @@ -139,7 +139,7 @@ void SbxObject::Clear() p->ResetFlag( SBX_WRITE ); p->SetFlag( SBX_DONTSTORE ); pDfltProp = NULL; - SetModified( FALSE ); + SetModified( sal_False ); } void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, @@ -148,14 +148,14 @@ void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, const SbxHint* p = PTR_CAST(SbxHint,&rHint); if( p ) { - ULONG nId = p->GetId(); - BOOL bRead = BOOL( nId == SBX_HINT_DATAWANTED ); - BOOL bWrite = BOOL( nId == SBX_HINT_DATACHANGED ); + sal_uIntPtr nId = p->GetId(); + sal_Bool bRead = sal_Bool( nId == SBX_HINT_DATAWANTED ); + sal_Bool bWrite = sal_Bool( nId == SBX_HINT_DATACHANGED ); SbxVariable* pVar = p->GetVar(); if( bRead || bWrite ) { XubString aVarName( pVar->GetName() ); - USHORT nHash_ = MakeHashCode( aVarName ); + sal_uInt16 nHash_ = MakeHashCode( aVarName ); if( nHash_ == nNameHash && aVarName.EqualsIgnoreCaseAscii( pNameProp ) ) { @@ -176,12 +176,12 @@ void SbxObject::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, } } -BOOL SbxObject::IsClass( const XubString& rName ) const +sal_Bool SbxObject::IsClass( const XubString& rName ) const { - return BOOL( aClassName.EqualsIgnoreCaseAscii( rName ) ); + return sal_Bool( aClassName.EqualsIgnoreCaseAscii( rName ) ); } -SbxVariable* SbxObject::FindUserData( UINT32 nData ) +SbxVariable* SbxObject::FindUserData( sal_uInt32 nData ) { if( !GetAll( SbxCLASS_DONTCARE ) ) return NULL; @@ -198,10 +198,10 @@ SbxVariable* SbxObject::FindUserData( UINT32 nData ) while( !pRes && pCur->pParent ) { // Ich selbst bin schon durchsucht worden! - USHORT nOwn = pCur->GetFlags(); + sal_uInt16 nOwn = pCur->GetFlags(); pCur->ResetFlag( SBX_EXTSEARCH ); // Ich suche bereits global! - USHORT nPar = pCur->pParent->GetFlags(); + sal_uInt16 nPar = pCur->pParent->GetFlags(); pCur->pParent->ResetFlag( SBX_GBLSEARCH ); pRes = pCur->pParent->FindUserData( nData ); pCur->SetFlags( nOwn ); @@ -215,7 +215,7 @@ SbxVariable* SbxObject::FindUserData( UINT32 nData ) SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t ) { #ifdef DBG_UTIL - static USHORT nLvl = 0; + static sal_uInt16 nLvl = 0; static const char* pCls[] = { "DontCare","Array","Value","Variable","Method","Property","Object" }; ByteString aNameStr1( (const UniString&)rName, RTL_TEXTENCODING_ASCII_US ); @@ -265,10 +265,10 @@ SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t ) while( !pRes && pCur->pParent ) { // Ich selbst bin schon durchsucht worden! - USHORT nOwn = pCur->GetFlags(); + sal_uInt16 nOwn = pCur->GetFlags(); pCur->ResetFlag( SBX_EXTSEARCH ); // Ich suche bereits global! - USHORT nPar = pCur->pParent->GetFlags(); + sal_uInt16 nPar = pCur->pParent->GetFlags(); pCur->pParent->ResetFlag( SBX_GBLSEARCH ); pRes = pCur->pParent->Find( rName, t ); pCur->SetFlags( nOwn ); @@ -293,7 +293,7 @@ SbxVariable* SbxObject::Find( const XubString& rName, SbxClassType t ) // Das ganze rekursiv, da Call() ueberladen sein kann // Qualified Names sind zugelassen -BOOL SbxObject::Call( const XubString& rName, SbxArray* pParam ) +sal_Bool SbxObject::Call( const XubString& rName, SbxArray* pParam ) { SbxVariable* pMeth = FindQualified( rName, SbxCLASS_DONTCARE); if( pMeth && pMeth->ISA(SbxMethod) ) @@ -303,10 +303,10 @@ BOOL SbxObject::Call( const XubString& rName, SbxArray* pParam ) pMeth->SetParameters( pParam ); pMeth->Broadcast( SBX_HINT_DATAWANTED ); pMeth->SetParameters( NULL ); - return TRUE; + return sal_True; } SetError( SbxERR_NO_METHOD ); - return FALSE; + return sal_False; } SbxProperty* SbxObject::GetDfltProperty() @@ -324,14 +324,14 @@ void SbxObject::SetDfltProperty( const XubString& rName ) if ( rName != aDfltPropName ) pDfltProp = NULL; aDfltPropName = rName; - SetModified( TRUE ); + SetModified( sal_True ); } void SbxObject::SetDfltProperty( SbxProperty* p ) { if( p ) { - USHORT n; + sal_uInt16 n; SbxArray* pArray = FindVar( p, n ); pArray->Put( p, n ); if( p->GetParent() != this ) @@ -339,14 +339,14 @@ void SbxObject::SetDfltProperty( SbxProperty* p ) Broadcast( SBX_HINT_OBJECTCHANGED ); } pDfltProp = p; - SetModified( TRUE ); + SetModified( sal_True ); } // Suchen einer bereits vorhandenen Variablen. Falls sie gefunden wurde, // wird der Index gesetzt, sonst wird der Count des Arrays geliefert. // In jedem Fall wird das korrekte Array geliefert. -SbxArray* SbxObject::FindVar( SbxVariable* pVar, USHORT& nArrayIdx ) +SbxArray* SbxObject::FindVar( SbxVariable* pVar, sal_uInt16& nArrayIdx ) { SbxArray* pArray = NULL; if( pVar ) switch( pVar->GetClass() ) @@ -365,7 +365,7 @@ SbxArray* SbxObject::FindVar( SbxVariable* pVar, USHORT& nArrayIdx ) pArray->ResetFlag( SBX_EXTSEARCH ); SbxVariable* pOld = pArray->Find( pVar->GetName(), pVar->GetClass() ); if( pOld ) - for( USHORT i = 0; i < pArray->Count(); i++ ) + for( sal_uInt16 i = 0; i < pArray->Count(); i++ ) { SbxVariableRef& rRef = pArray->GetRef( i ); if( (SbxVariable*) rRef == pOld ) @@ -435,9 +435,9 @@ SbxVariable* SbxObject::Make( const XubString& rName, SbxClassType ct, SbxDataTy } pVar->SetParent( this ); pArray->Put( pVar, pArray->Count() ); - SetModified( TRUE ); + SetModified( sal_True ); // Das Objekt lauscht immer - StartListening( pVar->GetBroadcaster(), TRUE ); + StartListening( pVar->GetBroadcaster(), sal_True ); Broadcast( SBX_HINT_OBJECTCHANGED ); return pVar; } @@ -473,9 +473,9 @@ SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClas pVar->SetName( rName ); pVar->SetParent( this ); pObjs->Put( pVar, pObjs->Count() ); - SetModified( TRUE ); + SetModified( sal_True ); // Das Objekt lauscht immer - StartListening( pVar->GetBroadcaster(), TRUE ); + StartListening( pVar->GetBroadcaster(), sal_True ); Broadcast( SBX_HINT_OBJECTCHANGED ); } return pVar; @@ -483,7 +483,7 @@ SbxObject* SbxObject::MakeObject( const XubString& rName, const XubString& rClas void SbxObject::Insert( SbxVariable* pVar ) { - USHORT nIdx; + sal_uInt16 nIdx; SbxArray* pArray = FindVar( pVar, nIdx ); if( pArray ) { @@ -515,7 +515,7 @@ void SbxObject::Insert( SbxVariable* pVar ) } #endif */ - EndListening( pOld->GetBroadcaster(), TRUE ); + EndListening( pOld->GetBroadcaster(), sal_True ); if( pVar->GetClass() == SbxCLASS_PROPERTY ) { if( pOld == pDfltProp ) @@ -523,11 +523,11 @@ void SbxObject::Insert( SbxVariable* pVar ) } } } - StartListening( pVar->GetBroadcaster(), TRUE ); + StartListening( pVar->GetBroadcaster(), sal_True ); pArray->Put( pVar, nIdx ); if( pVar->GetParent() != this ) pVar->SetParent( this ); - SetModified( TRUE ); + SetModified( sal_True ); Broadcast( SBX_HINT_OBJECTCHANGED ); #ifdef DBG_UTIL static const char* pCls[] = @@ -564,11 +564,11 @@ void SbxObject::QuickInsert( SbxVariable* pVar ) } if( pArray ) { - StartListening( pVar->GetBroadcaster(), TRUE ); + StartListening( pVar->GetBroadcaster(), sal_True ); pArray->Put( pVar, pArray->Count() ); if( pVar->GetParent() != this ) pVar->SetParent( this ); - SetModified( TRUE ); + SetModified( sal_True ); #ifdef DBG_UTIL static const char* pCls[] = { "DontCare","Array","Value","Variable","Method","Property","Object" }; @@ -603,11 +603,11 @@ void SbxObject::VCPtrInsert( SbxVariable* pVar ) } if( pArray ) { - StartListening( pVar->GetBroadcaster(), TRUE ); + StartListening( pVar->GetBroadcaster(), sal_True ); pArray->Put( pVar, pArray->Count() ); if( pVar->GetParent() != this ) pVar->SetParent( this ); - SetModified( TRUE ); + SetModified( sal_True ); Broadcast( SBX_HINT_OBJECTCHANGED ); } } @@ -619,7 +619,7 @@ void SbxObject::Remove( const XubString& rName, SbxClassType t ) void SbxObject::Remove( SbxVariable* pVar ) { - USHORT nIdx; + sal_uInt16 nIdx; SbxArray* pArray = FindVar( pVar, nIdx ); if( pArray && nIdx < pArray->Count() ) { @@ -632,13 +632,13 @@ void SbxObject::Remove( SbxVariable* pVar ) #endif SbxVariableRef pVar_ = pArray->Get( nIdx ); if( pVar_->IsBroadcaster() ) - EndListening( pVar_->GetBroadcaster(), TRUE ); + EndListening( pVar_->GetBroadcaster(), sal_True ); if( (SbxVariable*) pVar_ == pDfltProp ) pDfltProp = NULL; pArray->Remove( nIdx ); if( pVar_->GetParent() == this ) pVar_->SetParent( NULL ); - SetModified( TRUE ); + SetModified( sal_True ); Broadcast( SBX_HINT_OBJECTCHANGED ); } } @@ -646,26 +646,26 @@ void SbxObject::Remove( SbxVariable* pVar ) // AB 23.3.1997, Loeschen per Pointer fuer Controls (doppelte Namen!) void SbxObject::VCPtrRemove( SbxVariable* pVar ) { - USHORT nIdx; + sal_uInt16 nIdx; // Neu FindVar-Methode, sonst identisch mit normaler Methode SbxArray* pArray = VCPtrFindVar( pVar, nIdx ); if( pArray && nIdx < pArray->Count() ) { SbxVariableRef xVar = pArray->Get( nIdx ); if( xVar->IsBroadcaster() ) - EndListening( xVar->GetBroadcaster(), TRUE ); + EndListening( xVar->GetBroadcaster(), sal_True ); if( (SbxVariable*) xVar == pDfltProp ) pDfltProp = NULL; pArray->Remove( nIdx ); if( xVar->GetParent() == this ) xVar->SetParent( NULL ); - SetModified( TRUE ); + SetModified( sal_True ); Broadcast( SBX_HINT_OBJECTCHANGED ); } } // AB 23.3.1997, Zugehoerige Spezial-Methode, nur ueber Pointer suchen -SbxArray* SbxObject::VCPtrFindVar( SbxVariable* pVar, USHORT& nArrayIdx ) +SbxArray* SbxObject::VCPtrFindVar( SbxVariable* pVar, sal_uInt16& nArrayIdx ) { SbxArray* pArray = NULL; if( pVar ) switch( pVar->GetClass() ) @@ -680,7 +680,7 @@ SbxArray* SbxObject::VCPtrFindVar( SbxVariable* pVar, USHORT& nArrayIdx ) if( pArray ) { nArrayIdx = pArray->Count(); - for( USHORT i = 0; i < pArray->Count(); i++ ) + for( sal_uInt16 i = 0; i < pArray->Count(); i++ ) { SbxVariableRef& rRef = pArray->GetRef( i ); if( (SbxVariable*) rRef == pVar ) @@ -694,9 +694,9 @@ SbxArray* SbxObject::VCPtrFindVar( SbxVariable* pVar, USHORT& nArrayIdx ) -void SbxObject::SetPos( SbxVariable* pVar, USHORT nPos ) +void SbxObject::SetPos( SbxVariable* pVar, sal_uInt16 nPos ) { - USHORT nIdx; + sal_uInt16 nIdx; SbxArray* pArray = FindVar( pVar, nIdx ); if( pArray ) { @@ -709,41 +709,41 @@ void SbxObject::SetPos( SbxVariable* pVar, USHORT nPos ) pArray->Insert( refVar, nPos ); } } -// SetModified( TRUE ); +// SetModified( sal_True ); // Broadcast( SBX_HINT_OBJECTCHANGED ); } -static BOOL LoadArray( SvStream& rStrm, SbxObject* pThis, SbxArray* pArray ) +static sal_Bool LoadArray( SvStream& rStrm, SbxObject* pThis, SbxArray* pArray ) { SbxArrayRef p = (SbxArray*) SbxBase::Load( rStrm ); if( !p.Is() ) - return FALSE; - for( USHORT i = 0; i < p->Count(); i++ ) + return sal_False; + for( sal_uInt16 i = 0; i < p->Count(); i++ ) { SbxVariableRef& r = p->GetRef( i ); SbxVariable* pVar = r; if( pVar ) { pVar->SetParent( pThis ); - pThis->StartListening( pVar->GetBroadcaster(), TRUE ); + pThis->StartListening( pVar->GetBroadcaster(), sal_True ); } } pArray->Merge( p ); - return TRUE; + return sal_True; } // Der Load eines Objekts ist additiv! -BOOL SbxObject::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxObject::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { - // Hilfe fuer das Einlesen alter Objekte: einfach TRUE zurueck, + // Hilfe fuer das Einlesen alter Objekte: einfach sal_True zurueck, // LoadPrivateData() muss Default-Zustand herstellen if( !nVer ) - return TRUE; + return sal_True; pDfltProp = NULL; if( !SbxVariable::LoadData( rStrm, nVer ) ) - return FALSE; + return sal_False; // Wenn kein fremdes Objekt enthalten ist, uns selbst eintragen if( aData.eType == SbxOBJECT && !aData.pObj ) aData.pObj = this; @@ -751,11 +751,11 @@ BOOL SbxObject::LoadData( SvStream& rStrm, USHORT nVer ) XubString aDfltProp; rStrm.ReadByteString( aClassName, RTL_TEXTENCODING_ASCII_US ); rStrm.ReadByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US ); - ULONG nPos = rStrm.Tell(); + sal_uIntPtr nPos = rStrm.Tell(); rStrm >> nSize; if( !LoadPrivateData( rStrm, nVer ) ) - return FALSE; - ULONG nNewPos = rStrm.Tell(); + return sal_False; + sal_uIntPtr nNewPos = rStrm.Tell(); nPos += nSize; DBG_ASSERT( nPos >= nNewPos, "SBX: Zu viele Daten eingelesen" ); if( nPos != nNewPos ) @@ -763,39 +763,39 @@ BOOL SbxObject::LoadData( SvStream& rStrm, USHORT nVer ) if( !LoadArray( rStrm, this, pMethods ) || !LoadArray( rStrm, this, pProps ) || !LoadArray( rStrm, this, pObjs ) ) - return FALSE; + return sal_False; // Properties setzen if( aDfltProp.Len() ) pDfltProp = (SbxProperty*) pProps->Find( aDfltProp, SbxCLASS_PROPERTY ); - SetModified( FALSE ); - return TRUE; + SetModified( sal_False ); + return sal_True; } -BOOL SbxObject::StoreData( SvStream& rStrm ) const +sal_Bool SbxObject::StoreData( SvStream& rStrm ) const { if( !SbxVariable::StoreData( rStrm ) ) - return FALSE; + return sal_False; XubString aDfltProp; if( pDfltProp ) aDfltProp = pDfltProp->GetName(); rStrm.WriteByteString( aClassName, RTL_TEXTENCODING_ASCII_US ); rStrm.WriteByteString( aDfltProp, RTL_TEXTENCODING_ASCII_US ); - ULONG nPos = rStrm.Tell(); - rStrm << (UINT32) 0L; + sal_uIntPtr nPos = rStrm.Tell(); + rStrm << (sal_uInt32) 0L; if( !StorePrivateData( rStrm ) ) - return FALSE; - ULONG nNew = rStrm.Tell(); + return sal_False; + sal_uIntPtr nNew = rStrm.Tell(); rStrm.Seek( nPos ); - rStrm << (UINT32) ( nNew - nPos ); + rStrm << (sal_uInt32) ( nNew - nPos ); rStrm.Seek( nNew ); if( !pMethods->Store( rStrm ) ) - return FALSE; + return sal_False; if( !pProps->Store( rStrm ) ) - return FALSE; + return sal_False; if( !pObjs->Store( rStrm ) ) - return FALSE; - ((SbxObject*) this)->SetModified( FALSE ); - return TRUE; + return sal_False; + ((SbxObject*) this)->SetModified( sal_False ); + return sal_True; } XubString SbxObject::GenerateSource( const XubString &rLinePrefix, @@ -804,8 +804,8 @@ XubString SbxObject::GenerateSource( const XubString &rLinePrefix, // Properties in einem String einsammeln XubString aSource; SbxArrayRef xProps( GetProperties() ); - FASTBOOL bLineFeed = FALSE; - for ( USHORT nProp = 0; nProp < xProps->Count(); ++nProp ) + int bLineFeed = sal_False; + for ( sal_uInt16 nProp = 0; nProp < xProps->Count(); ++nProp ) { SbxPropertyRef xProp = (SbxProperty*) xProps->Get(nProp); XubString aPropName( xProp->GetName() ); @@ -817,7 +817,7 @@ XubString SbxObject::GenerateSource( const XubString &rLinePrefix, if ( bLineFeed ) aSource.AppendAscii( "\n" ); else - bLineFeed = TRUE; + bLineFeed = sal_True; aSource += rLinePrefix; aSource += '.'; @@ -853,7 +853,7 @@ XubString SbxObject::GenerateSource( const XubString &rLinePrefix, return aSource; } -static BOOL CollectAttrs( const SbxBase* p, XubString& rRes ) +static sal_Bool CollectAttrs( const SbxBase* p, XubString& rRes ) { XubString aAttrs; if( p->IsHidden() ) @@ -881,19 +881,19 @@ static BOOL CollectAttrs( const SbxBase* p, XubString& rRes ) rRes.AssignAscii( " (" ); rRes += aAttrs; rRes += ')'; - return TRUE; + return sal_True; } else { rRes.Erase(); - return FALSE; + return sal_False; } } -void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) +void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) { // Einr"uckung - static USHORT nLevel = 0; + static sal_uInt16 nLevel = 0; if ( nLevel > 10 ) { rStrm << "" << endl; @@ -901,7 +901,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) } ++nLevel; String aIndent; - for ( USHORT n = 1; n < nLevel; ++n ) + for ( sal_uInt16 n = 1; n < nLevel; ++n ) aIndent.AppendAscii( " " ); // ggf. Objekt vervollst"andigen @@ -912,7 +912,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) ByteString aNameStr( (const UniString&)GetName(), RTL_TEXTENCODING_ASCII_US ); ByteString aClassNameStr( (const UniString&)aClassName, RTL_TEXTENCODING_ASCII_US ); rStrm << "Object( " - << ByteString::CreateFromInt64( (ULONG) this ).GetBuffer() << "=='" + << ByteString::CreateFromInt64( (sal_uIntPtr) this ).GetBuffer() << "=='" << ( aNameStr.Len() ? aNameStr.GetBuffer() : "" ) << "', " << "of class '" << aClassNameStr.GetBuffer() << "', " << "counts " @@ -922,7 +922,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) { ByteString aParentNameStr( (const UniString&)GetName(), RTL_TEXTENCODING_ASCII_US ); rStrm << "in parent " - << ByteString::CreateFromInt64( (ULONG) GetParent() ).GetBuffer() + << ByteString::CreateFromInt64( (sal_uIntPtr) GetParent() ).GetBuffer() << "=='" << ( aParentNameStr.Len() ? aParentNameStr.GetBuffer() : "" ) << "'"; } else @@ -941,7 +941,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) // Methods rStrm << aIndentNameStr.GetBuffer() << "- Methods:" << endl; - for( USHORT i = 0; i < pMethods->Count(); i++ ) + for( sal_uInt16 i = 0; i < pMethods->Count(); i++ ) { SbxVariableRef& r = pMethods->GetRef( i ); SbxVariable* pVar = r; @@ -974,7 +974,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) // Properties rStrm << aIndentNameStr.GetBuffer() << "- Properties:" << endl; { - for( USHORT i = 0; i < pProps->Count(); i++ ) + for( sal_uInt16 i = 0; i < pProps->Count(); i++ ) { SbxVariableRef& r = pProps->GetRef( i ); SbxVariable* pVar = r; @@ -1008,7 +1008,7 @@ void SbxObject::Dump( SvStream& rStrm, BOOL bFill ) // Objects rStrm << aIndentNameStr.GetBuffer() << "- Objects:" << endl; { - for( USHORT i = 0; i < pObjs->Count(); i++ ) + for( sal_uInt16 i = 0; i < pObjs->Count(); i++ ) { SbxVariableRef& r = pObjs->GetRef( i ); SbxVariable* pVar = r; @@ -1032,7 +1032,7 @@ SvDispatch* SbxObject::GetSvDispatch() return NULL; } -BOOL SbxMethod::Run( SbxValues* pValues ) +sal_Bool SbxMethod::Run( SbxValues* pValues ) { SbxValues aRes; if( !pValues ) @@ -1051,7 +1051,7 @@ SbxClassType SbxProperty::GetClass() const return SbxCLASS_PROPERTY; } -void SbxObject::GarbageCollection( ULONG nObjects ) +void SbxObject::GarbageCollection( sal_uIntPtr nObjects ) /* [Beschreibung] @@ -1066,14 +1066,14 @@ void SbxObject::GarbageCollection( ULONG nObjects ) { (void)nObjects; - static BOOL bInGarbageCollection = FALSE; + static sal_Bool bInGarbageCollection = sal_False; if ( bInGarbageCollection ) return; - bInGarbageCollection = TRUE; + bInGarbageCollection = sal_True; #if 0 // erstes Object dieser Runde anspringen - BOOL bAll = !nObjects; + sal_Bool bAll = !nObjects; if ( bAll ) rObjects.First(); SbxObject *pObj = rObjects.GetCurObject(); @@ -1088,7 +1088,7 @@ void SbxObject::GarbageCollection( ULONG nObjects ) { // dann alle Properies des Objects durchsuchen SbxArray *pProps = pObj->GetProperties(); - for ( USHORT n = 0; n < pProps->Count(); ++n ) + for ( sal_uInt16 n = 0; n < pProps->Count(); ++n ) { // verweist die Property auf den Parent des Object? SbxVariable *pProp = pProps->Get(n); @@ -1126,12 +1126,12 @@ void SbxObject::GarbageCollection( ULONG nObjects ) if ( rVars.Count() > 200 && rVars.Count() < 210 ) { SvFileStream aStream( "d:\\tmp\\dump.sbx", STREAM_STD_WRITE ); - SfxBroadcaster::Enable(FALSE); - for ( ULONG n = 0; n < rVars.Count(); ++n ) + SfxBroadcaster::Enable(sal_False); + for ( sal_uIntPtr n = 0; n < rVars.Count(); ++n ) { SbxVariable *pVar = rVars.GetObject(n); SbxObject *pObj = PTR_CAST(SbxObject, pVar); - USHORT nFlags = pVar->GetFlags(); + sal_uInt16 nFlags = pVar->GetFlags(); pVar->SetFlag(SBX_NO_BROADCAST); if ( pObj ) pObj->Dump(aStream); @@ -1139,10 +1139,10 @@ void SbxObject::GarbageCollection( ULONG nObjects ) pVar->Dump(aStream); pVar->SetFlags(nFlags); } - SfxBroadcaster::Enable(TRUE); + SfxBroadcaster::Enable(sal_True); } #endif #endif - bInGarbageCollection = FALSE; + bInGarbageCollection = sal_False; } diff --git a/basic/source/sbx/sbxres.cxx b/basic/source/sbx/sbxres.cxx index 369349e72069..ec1e1f4c900e 100644 --- a/basic/source/sbx/sbxres.cxx +++ b/basic/source/sbx/sbxres.cxx @@ -80,12 +80,12 @@ static const char* pSbxRes[] = { "True" }; -const char* GetSbxRes( USHORT nId ) +const char* GetSbxRes( sal_uInt16 nId ) { return ( ( nId > SBXRES_MAX ) ? "???" : pSbxRes[ nId ] ); } -SbxRes::SbxRes( USHORT nId ) +SbxRes::SbxRes( sal_uInt16 nId ) : ::rtl::OUString( ::rtl::OUString::createFromAscii( GetSbxRes( nId ) ) ) {} diff --git a/basic/source/sbx/sbxres.hxx b/basic/source/sbx/sbxres.hxx index 8ed3c7054278..75fddc0d90fe 100644 --- a/basic/source/sbx/sbxres.hxx +++ b/basic/source/sbx/sbxres.hxx @@ -78,10 +78,10 @@ class SbxRes : public ::rtl::OUString { public: - SbxRes( USHORT ); + SbxRes( sal_uInt16 ); }; -const char* GetSbxRes( USHORT ); +const char* GetSbxRes( sal_uInt16 ); #endif diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx index b8aad9bbf2e4..d1bf716234a8 100644 --- a/basic/source/sbx/sbxscan.cxx +++ b/basic/source/sbx/sbxscan.cxx @@ -72,7 +72,7 @@ void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep ) // Fixed ist und das ganze nicht hineinpasst! SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType, - USHORT* pLen, BOOL bAllowIntntl, BOOL bOnlyIntntl ) + sal_uInt16* pLen, sal_Bool bAllowIntntl, sal_Bool bOnlyIntntl ) { ::rtl::OString aBStr( ::rtl::OUStringToOString( rWSrc, RTL_TEXTENCODING_ASCII_US ) ); @@ -103,15 +103,15 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType const char* pStart = aBStr.getStr(); const char* p = pStart; char buf[ 80 ], *q = buf; - BOOL bRes = TRUE; - BOOL bMinus = FALSE; + sal_Bool bRes = sal_True; + sal_Bool bMinus = sal_False; nVal = 0; SbxDataType eScanType = SbxSINGLE; // Whitespace wech while( *p &&( *p == ' ' || *p == '\t' ) ) p++; // Zahl? Dann einlesen und konvertieren. if( *p == '-' ) - p++, bMinus = TRUE; + p++, bMinus = sal_True; if( isdigit( *p ) ||( (*p == cNonIntntlComma || *p == cIntntlComma || *p == cIntntl1000) && isdigit( *(p+1 ) ) ) ) { @@ -172,7 +172,7 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType *q = 0; // Komma, Exponent mehrfach vorhanden? if( comma > 1 || exp > 1 ) - bRes = FALSE; + bRes = sal_False; // Kann auf Integer gefaltet werden? if( !comma && !exp ) { @@ -204,7 +204,7 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType { case 'O': cmp = "01234567"; base = 8; ndig = 11; break; case 'H': break; - default : bRes = FALSE; + default : bRes = sal_False; } long l = 0; int i; @@ -213,7 +213,7 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType char ch = sal::static_int_cast< char >( toupper( *p ) ); p++; if( strchr( cmp, ch ) ) *q++ = ch; - else bRes = FALSE; + else bRes = sal_False; } *q = 0; for( q = buf; *q; q++ ) @@ -222,7 +222,7 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType if( i > 9 ) i -= 7; l =( l * base ) + i; if( !ndig-- ) - bRes = FALSE; + bRes = sal_False; } if( *p == '&' ) p++; nVal = (double) l; @@ -235,7 +235,7 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType return SbxERR_CONVERSION; } if( pLen ) - *pLen = (USHORT) ( p - pStart ); + *pLen = (sal_uInt16) ( p - pStart ); if( !bRes ) return SbxERR_CONVERSION; if( bMinus ) @@ -245,12 +245,12 @@ SbxError ImpScan( const ::rtl::OUString& rWSrc, double& nVal, SbxDataType& rType } // Schnittstelle fuer CDbl im Basic -SbxError SbxValue::ScanNumIntnl( const String& rSrc, double& nVal, BOOL bSingle ) +SbxError SbxValue::ScanNumIntnl( const String& rSrc, double& nVal, sal_Bool bSingle ) { SbxDataType t; - USHORT nLen = 0; + sal_uInt16 nLen = 0; SbxError nRetError = ImpScan( rSrc, nVal, t, &nLen, - /*bAllowIntntl*/FALSE, /*bOnlyIntntl*/TRUE ); + /*bAllowIntntl*/sal_False, /*bOnlyIntntl*/sal_True ); // Komplett gelesen? if( nRetError == SbxERR_OK && nLen != rSrc.Len() ) nRetError = SbxERR_CONVERSION; @@ -271,20 +271,20 @@ static double roundArray[] = { /*************************************************************************** |* -|* void myftoa( double, char *, short, short, BOOL, BOOL ) +|* void myftoa( double, char *, short, short, sal_Bool, sal_Bool ) |* |* Beschreibung: Konversion double --> ASCII |* Parameter: double die Zahl. |* char * der Zielpuffer |* short Anzahl Nachkommastellen |* short Weite des Exponenten( 0=kein E ) -|* BOOL TRUE: mit 1000er Punkten -|* BOOL TRUE: formatfreie Ausgabe +|* sal_Bool sal_True: mit 1000er Punkten +|* sal_Bool sal_True: formatfreie Ausgabe |* ***************************************************************************/ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, - BOOL bPt, BOOL bFix, sal_Unicode cForceThousandSep = 0 ) + sal_Bool bPt, sal_Bool bFix, sal_Unicode cForceThousandSep = 0 ) { short nExp = 0; // Exponent @@ -391,7 +391,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth, #pragma warning(disable: 4748) // "... because optimizations are disabled ..." #endif -void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreString ) +void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, sal_Bool bCoreString ) { char *q; char cBuf[ 40 ], *p = cBuf; @@ -407,7 +407,7 @@ void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreStrin } double dMaxNumWithoutExp = (nPrec == 6) ? 1E6 : 1E14; myftoa( nNum, p, nPrec,( nNum &&( nNum < 1E-1 || nNum > dMaxNumWithoutExp ) ) ? 4:0, - FALSE, TRUE, cDecimalSep ); + sal_False, sal_True, cDecimalSep ); // Trailing Zeroes weg: for( p = cBuf; *p &&( *p != 'E' ); p++ ) {} q = p; p--; @@ -422,10 +422,10 @@ void ImpCvtNum( double nNum, short nPrec, ::rtl::OUString& rRes, BOOL bCoreStrin #pragma optimize( "", on ) #endif -BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) +sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) { // Merken, ob ueberhaupt was geaendert wurde - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; ::rtl::OUString aNewString; // Nur Spezial-Fälle behandeln, als Default tun wir nichts @@ -451,25 +451,25 @@ BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) { sal_Unicode* pStr = (sal_Unicode*)aNewString.getStr(); pStr[nPos] = (sal_Unicode)'.'; - bChanged = TRUE; + bChanged = sal_True; } } break; } - // Bei BOOL TRUE und FALSE als String pruefen + // Bei sal_Bool sal_True und sal_False als String pruefen case SbxBOOL: { if( rSrc.equalsIgnoreAsciiCaseAscii( "true" ) ) { aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxTRUE ); - bChanged = TRUE; + bChanged = sal_True; } else if( rSrc.equalsIgnoreAsciiCaseAscii( "false" ) ) { aNewString = ::rtl::OUString::valueOf( (sal_Int32)SbxFALSE ); - bChanged = TRUE; + bChanged = sal_True; } break; } @@ -490,7 +490,7 @@ BOOL ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType ) // lasse diesen Code vorl"aufig drin, zum 'abgucken' // der bisherigen Implementation -static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt ) +static sal_uInt16 printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt ) { const String& rFmt = rWFmt; char cFill = ' '; // Fuellzeichen @@ -499,10 +499,10 @@ static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt short nPrec = 0; // Anzahl Nachkommastellen short nWidth = 0; // Zahlenweite gesamnt short nLen; // Laenge konvertierte Zahl - BOOL bPoint = FALSE; // TRUE: mit 1000er Kommas - BOOL bTrail = FALSE; // TRUE, wenn folgendes Minus - BOOL bSign = FALSE; // TRUE: immer mit Vorzeichen - BOOL bNeg = FALSE; // TRUE: Zahl ist negativ + sal_Bool bPoint = sal_False; // sal_True: mit 1000er Kommas + sal_Bool bTrail = sal_False; // sal_True, wenn folgendes Minus + sal_Bool bSign = sal_False; // sal_True: immer mit Vorzeichen + sal_Bool bNeg = sal_False; // sal_True: Zahl ist negativ char cBuf [1024]; // Zahlenpuffer char * p; const char* pFmt = rFmt; @@ -518,7 +518,7 @@ static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt case 0: break; case '+': - bSign = TRUE; nWidth++; break; + bSign = sal_True; nWidth++; break; case '*': nWidth++; cFill = '*'; if( *pFmt == '$' ) nWidth++, pFmt++, cPre = '$'; @@ -537,7 +537,7 @@ static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt // 1000er Kommas? if( *pFmt == ',' ) { - nWidth++; pFmt++; bPoint = TRUE; + nWidth++; pFmt++; bPoint = sal_True; } else break; } // Nachkomma: @@ -551,14 +551,14 @@ static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt pFmt++, nExpDig++, nWidth++; // Folgendes Minus: if( !bSign && *pFmt == '-' ) - pFmt++, bTrail = TRUE; + pFmt++, bTrail = sal_True; // Zahl konvertieren: if( nPrec > 15 ) nPrec = 15; - if( nNum < 0.0 ) nNum = -nNum, bNeg = TRUE; + if( nNum < 0.0 ) nNum = -nNum, bNeg = sal_True; p = cBuf; if( bSign ) *p++ = bNeg ? '-' : '+'; - myftoa( nNum, p, nPrec, nExpDig, bPoint, FALSE ); + myftoa( nNum, p, nPrec, nExpDig, bPoint, sal_False ); nLen = strlen( cBuf ); // Ueberlauf? @@ -573,12 +573,12 @@ static USHORT printfmtnum( double nNum, XubString& rRes, const XubString& rWFmt if( bTrail ) rRes += bNeg ? '-' : ' '; - return (USHORT) ( pFmt - (const char*) rFmt ); + return (sal_uInt16) ( pFmt - (const char*) rFmt ); } #endif //_old_format_code_ -static USHORT printfmtstr( const XubString& rStr, XubString& rRes, const XubString& rFmt ) +static sal_uInt16 printfmtstr( const XubString& rStr, XubString& rRes, const XubString& rFmt ) { const xub_Unicode* pStr = rStr.GetBuffer(); const xub_Unicode* pFmtStart = rFmt.GetBuffer(); @@ -603,12 +603,12 @@ static USHORT printfmtstr( const XubString& rStr, XubString& rRes, const XubStri rRes = rStr; break; } - return (USHORT) ( pFmt - pFmtStart ); + return (sal_uInt16) ( pFmt - pFmtStart ); } ///////////////////////////////////////////////////////////////////////// -BOOL SbxValue::Scan( const XubString& rSrc, USHORT* pLen ) +sal_Bool SbxValue::Scan( const XubString& rSrc, sal_uInt16* pLen ) { SbxError eRes = SbxERR_OK; if( !CanWrite() ) @@ -627,10 +627,10 @@ BOOL SbxValue::Scan( const XubString& rSrc, USHORT* pLen ) } if( eRes ) { - SetError( eRes ); return FALSE; + SetError( eRes ); return sal_False; } else - return TRUE; + return sal_True; } @@ -648,7 +648,7 @@ ResMgr* implGetResMgr( void ) class SbxValueFormatResId : public ResId { public: - SbxValueFormatResId( USHORT nId ) + SbxValueFormatResId( sal_uInt16 nId ) : ResId( nId, *implGetResMgr() ) {} }; @@ -693,7 +693,7 @@ static VbaFormatInfo pFormatInfoTable[] = VbaFormatInfo* getFormatInfo( const String& rFmt ) { VbaFormatInfo* pInfo = NULL; - INT16 i = 0; + sal_Int16 i = 0; while( (pInfo = pFormatInfoTable + i )->mpVbaFormat != NULL ) { if( rFmt.EqualsIgnoreCaseAscii( pInfo->mpVbaFormat ) ) @@ -713,11 +713,11 @@ VbaFormatInfo* getFormatInfo( const String& rFmt ) #define VBAFORMAT_UPPERCASE ">" // From methods1.cxx -INT16 implGetWeekDay( double aDate, bool bFirstDayParam = false, INT16 nFirstDay = 0 ); +sal_Int16 implGetWeekDay( double aDate, bool bFirstDayParam = false, sal_Int16 nFirstDay = 0 ); // from methods.cxx -INT16 implGetMinute( double dDate ); -INT16 implGetDateYear( double aDate ); -BOOL implDateSerial( INT16 nYear, INT16 nMonth, INT16 nDay, double& rdRet ); +sal_Int16 implGetMinute( double dDate ); +sal_Int16 implGetDateYear( double aDate ); +sal_Bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, double& rdRet ); void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const { @@ -753,7 +753,7 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const double nNumber; Color* pCol; - BOOL bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, nNumber ); + sal_Bool bSuccess = aFormatter.IsNumberFormat( aStr, nIndex, nNumber ); // number format, use SvNumberFormatter to handle it. if( bSuccess ) @@ -804,7 +804,7 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_N ) || aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_NN )) { - INT32 nMin = implGetMinute( nNumber ); + sal_Int32 nMin = implGetMinute( nNumber ); if( nMin < 10 && aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_NN ) ) { // Minute in two digits @@ -819,15 +819,15 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const } else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_W )) { - INT32 nWeekDay = implGetWeekDay( nNumber ); + sal_Int32 nWeekDay = implGetWeekDay( nNumber ); rRes = String::CreateFromInt32( nWeekDay ); } else if( aFmtStr.EqualsIgnoreCaseAscii( VBAFORMAT_Y )) { - INT16 nYear = implGetDateYear( nNumber ); + sal_Int16 nYear = implGetDateYear( nNumber ); double dBaseDate; implDateSerial( nYear, 1, 1, dBaseDate ); - INT32 nYear32 = 1 + INT32( nNumber - dBaseDate ); + sal_Int32 nYear32 = 1 + sal_Int32( nNumber - dBaseDate ); rRes = String::CreateFromInt32( nYear32 ); } else @@ -948,7 +948,7 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const // #45355 wenn es numerisch ist, muss gewandelt werden if( IsNumericRTL() ) { - ScanNumIntnl( GetString(), d, /*bSingle*/FALSE ); + ScanNumIntnl( GetString(), d, /*bSingle*/sal_False ); goto cvt2; } else diff --git a/basic/source/sbx/sbxstr.cxx b/basic/source/sbx/sbxstr.cxx index b4156a116ddc..3a73c2757579 100644 --- a/basic/source/sbx/sbxstr.cxx +++ b/basic/source/sbx/sbxstr.cxx @@ -154,9 +154,9 @@ using namespace rtl; XubString aRes; aTmp.eType = SbxSTRING; if( p->eType == SbxDOUBLE ) - ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/TRUE ); + ImpPutDouble( &aTmp, p->nDouble, /*bCoreString=*/sal_True ); else - ImpPutDouble( &aTmp, *p->pDouble, /*bCoreString=*/TRUE ); + ImpPutDouble( &aTmp, *p->pDouble, /*bCoreString=*/sal_True ); return aRes; } else @@ -234,7 +234,7 @@ void ImpPutString( SbxValues* p, const ::rtl::OUString* n ) case SbxBYREF | SbxINTEGER: *p->pInteger = ImpGetInteger( p ); break; case SbxBYREF | SbxBOOL: - *p->pUShort = sal::static_int_cast< UINT16 >( ImpGetBool( p ) ); + *p->pUShort = sal::static_int_cast< sal_uInt16 >( ImpGetBool( p ) ); break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: @@ -276,10 +276,10 @@ SbxArray* StringToByteArray(const ::rtl::OUString& rStr) pArray->unoAddDim( 0, -1 ); } - for( USHORT i=0; i< nArraySize; i++) + for( sal_uInt16 i=0; i< nArraySize; i++) { SbxVariable* pNew = new SbxVariable( SbxBYTE ); - BYTE aByte = static_cast< BYTE >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff ); + sal_uInt8 aByte = static_cast< sal_uInt8 >( i%2 ? ((*pSrc) >> 8) & 0xff : (*pSrc) & 0xff ); pNew->PutByte( aByte ); pNew->SetFlag( SBX_WRITE ); pArray->Put( pNew, i ); @@ -292,10 +292,10 @@ SbxArray* StringToByteArray(const ::rtl::OUString& rStr) // Convert an array of bytes to string (2bytes per character) ::rtl::OUString ByteArrayToString(SbxArray* pArr) { - USHORT nCount = pArr->Count(); + sal_uInt16 nCount = pArr->Count(); OUStringBuffer aStrBuf; sal_Unicode aChar = 0; - for( USHORT i = 0 ; i < nCount ; i++ ) + for( sal_uInt16 i = 0 ; i < nCount ; i++ ) { sal_Unicode aTempChar = pArr->Get(i)->GetByte(); if( i%2 ) diff --git a/basic/source/sbx/sbxulng.cxx b/basic/source/sbx/sbxulng.cxx index e0f6f3fa421d..7322863f3475 100644 --- a/basic/source/sbx/sbxulng.cxx +++ b/basic/source/sbx/sbxulng.cxx @@ -31,10 +31,10 @@ #include #include "sbxconv.hxx" -UINT32 ImpGetULong( const SbxValues* p ) +sal_uInt32 ImpGetULong( const SbxValues* p ) { SbxValues aTmp; - UINT32 nRes; + sal_uInt32 nRes; start: switch( +p->eType ) { @@ -80,7 +80,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (UINT32) ( p->nSingle + 0.5 ); + nRes = (sal_uInt32) ( p->nSingle + 0.5 ); break; case SbxDATE: case SbxDOUBLE: @@ -121,7 +121,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (UINT32) ( dVal + 0.5 ); + nRes = (sal_uInt32) ( dVal + 0.5 ); break; } case SbxBYREF | SbxSTRING: @@ -144,7 +144,7 @@ start: SbxBase::SetError( SbxERR_OVERFLOW ); nRes = 0; } else - nRes = (UINT32) ( d + 0.5 ); + nRes = (sal_uInt32) ( d + 0.5 ); } break; case SbxOBJECT: @@ -199,7 +199,7 @@ start: return nRes; } -void ImpPutULong( SbxValues* p, UINT32 n ) +void ImpPutULong( SbxValues* p, sal_uInt32 n ) { SbxValues aTmp; start: @@ -270,27 +270,27 @@ start: { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXBYTE; } - *p->pByte = (BYTE) n; break; + *p->pByte = (sal_uInt8) n; break; case SbxBYREF | SbxINTEGER: case SbxBYREF | SbxBOOL: if( n > SbxMAXINT ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXINT; } - *p->pInteger = (INT16) n; break; + *p->pInteger = (sal_Int16) n; break; case SbxBYREF | SbxERROR: case SbxBYREF | SbxUSHORT: if( n > SbxMAXUINT ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXUINT; } - *p->pUShort = (UINT16) n; break; + *p->pUShort = (sal_uInt16) n; break; case SbxBYREF | SbxLONG: if( n > SbxMAXLNG ) { SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXLNG; } - *p->pLong = (INT32) n; break; + *p->pLong = (sal_Int32) n; break; case SbxBYREF | SbxULONG: *p->pULong = n; break; case SbxBYREF | SbxSINGLE: diff --git a/basic/source/sbx/sbxvals.cxx b/basic/source/sbx/sbxvals.cxx index e63a352879ed..71a3bfc7f0d8 100644 --- a/basic/source/sbx/sbxvals.cxx +++ b/basic/source/sbx/sbxvals.cxx @@ -48,21 +48,21 @@ SbxValues::SbxValues( const BigInt &rBig ) : eType(SbxCURRENCY) #pragma warning(disable: 4273) #endif -BOOL BigInt::INT64( SbxINT64 *p ) const +sal_Bool BigInt::INT64( SbxINT64 *p ) const { if( bIsBig ) { if( nLen > 4 || (nNum[3] & 0x8000) ) - return FALSE; + return sal_False; - p->nLow = ((UINT32)nNum[1] << 16) | (UINT32)nNum[0]; - p->nHigh = ((UINT32)nNum[3] << 16) | (UINT32)nNum[2]; + p->nLow = ((sal_uInt32)nNum[1] << 16) | (sal_uInt32)nNum[0]; + p->nHigh = ((sal_uInt32)nNum[3] << 16) | (sal_uInt32)nNum[2]; if( bIsNeg ) p->CHS(); } else - p->Set( (INT32)nVal ); + p->Set( (sal_Int32)nVal ); - return TRUE; + return sal_True; } BigInt::BigInt( const SbxINT64 &r ) @@ -72,28 +72,28 @@ BigInt::BigInt( const SbxINT64 &r ) *this = r.nHigh; if( r.nHigh ) *this *= a10000; - *this += (USHORT)(r.nLow >> 16); + *this += (sal_uInt16)(r.nLow >> 16); *this *= a10000; - *this += (USHORT)r.nLow; + *this += (sal_uInt16)r.nLow; } -BOOL BigInt::UINT64( SbxUINT64 *p ) const +sal_Bool BigInt::UINT64( SbxUINT64 *p ) const { if( bIsBig ) { if( bIsNeg || nLen > 4 ) - return FALSE; + return sal_False; - p->nLow = ((UINT32)nNum[1] << 16) | (UINT32)nNum[0]; - p->nHigh = ((UINT32)nNum[3] << 16) | (UINT32)nNum[2]; + p->nLow = ((sal_uInt32)nNum[1] << 16) | (sal_uInt32)nNum[0]; + p->nHigh = ((sal_uInt32)nNum[3] << 16) | (sal_uInt32)nNum[2]; } else { if( nVal < 0 ) - return FALSE; + return sal_False; - p->Set( (UINT32)nVal ); + p->Set( (sal_uInt32)nVal ); } - return TRUE; + return sal_True; } BigInt::BigInt( const SbxUINT64 &r ) @@ -103,7 +103,7 @@ BigInt::BigInt( const SbxUINT64 &r ) *this = BigInt(r.nHigh); if( r.nHigh ) *this *= a10000; - *this += (USHORT)(r.nLow >> 16); + *this += (sal_uInt16)(r.nLow >> 16); *this *= a10000; - *this += (USHORT)r.nLow; + *this += (sal_uInt16)r.nLow; } diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index a5e80e8921c6..d7a3e27603ab 100755 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -202,7 +202,7 @@ int matherr( struct _exception* p ) #endif default: SbxBase::SetError( SbxERR_NOTIMP ); break; } - return TRUE; + return sal_True; } #endif @@ -228,21 +228,21 @@ SbxValue::SbxValue( SbxDataType t, void* p ) : SbxBase() if( p ) switch( t & 0x0FFF ) { - case SbxINTEGER: n |= SbxBYREF; aData.pInteger = (INT16*) p; break; + case SbxINTEGER: n |= SbxBYREF; aData.pInteger = (sal_Int16*) p; break; case SbxULONG64: n |= SbxBYREF; aData.pULong64 = (SbxUINT64*) p; break; case SbxLONG64: case SbxCURRENCY: n |= SbxBYREF; aData.pLong64 = (SbxINT64*) p; break; - case SbxLONG: n |= SbxBYREF; aData.pLong = (INT32*) p; break; + case SbxLONG: n |= SbxBYREF; aData.pLong = (sal_Int32*) p; break; case SbxSINGLE: n |= SbxBYREF; aData.pSingle = (float*) p; break; case SbxDATE: case SbxDOUBLE: n |= SbxBYREF; aData.pDouble = (double*) p; break; case SbxSTRING: n |= SbxBYREF; aData.pOUString = (::rtl::OUString*) p; break; case SbxERROR: case SbxUSHORT: - case SbxBOOL: n |= SbxBYREF; aData.pUShort = (UINT16*) p; break; - case SbxULONG: n |= SbxBYREF; aData.pULong = (UINT32*) p; break; + case SbxBOOL: n |= SbxBYREF; aData.pUShort = (sal_uInt16*) p; break; + case SbxULONG: n |= SbxBYREF; aData.pULong = (sal_uInt32*) p; break; case SbxCHAR: n |= SbxBYREF; aData.pChar = (xub_Unicode*) p; break; - case SbxBYTE: n |= SbxBYREF; aData.pByte = (BYTE*) p; break; + case SbxBYTE: n |= SbxBYREF; aData.pByte = (sal_uInt8*) p; break; case SbxINT: n |= SbxBYREF; aData.pInt = (int*) p; break; case SbxOBJECT: aData.pObj = (SbxBase*) p; @@ -363,8 +363,8 @@ SbxValue::~SbxValue() { HACK(nicht bei Parent-Prop - sonst CyclicRef) SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); - BOOL bParentProp = pThisVar && 5345 == - ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ); + sal_Bool bParentProp = pThisVar && 5345 == + ( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) ); if ( !bParentProp ) aData.pObj->ReleaseRef(); } @@ -394,8 +394,8 @@ void SbxValue::Clear() { HACK(nicht bei Parent-Prop - sonst CyclicRef) SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); - BOOL bParentProp = pThisVar && 5345 == - ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ); + sal_Bool bParentProp = pThisVar && 5345 == + ( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) ); if ( !bParentProp ) aData.pObj->ReleaseRef(); } @@ -420,7 +420,7 @@ void SbxValue::Clear() // Dummy -void SbxValue::Broadcast( ULONG ) +void SbxValue::Broadcast( sal_uIntPtr ) {} //////////////////////////// Daten auslesen ////////////////////////////// @@ -432,13 +432,13 @@ void SbxValue::Broadcast( ULONG ) SbxValue* SbxValue::TheRealValue() const { - return TheRealValue( TRUE ); + return TheRealValue( sal_True ); } // #55226 Zusaetzliche Info transportieren bool handleToStringForCOMObjects( SbxObject* pObj, SbxValue* pVal ); // sbunoobj.cxx -SbxValue* SbxValue::TheRealValue( BOOL bObjInObjError ) const +SbxValue* SbxValue::TheRealValue( sal_Bool bObjInObjError ) const { SbxValue* p = (SbxValue*) this; for( ;; ) @@ -511,9 +511,9 @@ SbxValue* SbxValue::TheRealValue( BOOL bObjInObjError ) const return p; } -BOOL SbxValue::Get( SbxValues& rRes ) const +sal_Bool SbxValue::Get( SbxValues& rRes ) const { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; SbxError eOld = GetError(); if( eOld != SbxERR_OK ) ResetError(); @@ -548,7 +548,7 @@ BOOL SbxValue::Get( SbxValues& rRes ) const case SbxDECIMAL: rRes.pDecimal = ImpGetDecimal( &p->aData ); break; case SbxDATE: rRes.nDouble = ImpGetDate( &p->aData ); break; case SbxBOOL: - rRes.nUShort = sal::static_int_cast< UINT16 >( + rRes.nUShort = sal::static_int_cast< sal_uInt16 >( ImpGetBool( &p->aData ) ); break; case SbxCHAR: rRes.nChar = ImpGetChar( &p->aData ); break; @@ -603,18 +603,18 @@ BOOL SbxValue::Get( SbxValues& rRes ) const } if( !IsError() ) { - bRes = TRUE; + bRes = sal_True; if( eOld != SbxERR_OK ) SetError( eOld ); } return bRes; } -BOOL SbxValue::GetNoBroadcast( SbxValues& rRes ) +sal_Bool SbxValue::GetNoBroadcast( SbxValues& rRes ) { - USHORT nFlags_ = GetFlags(); + sal_uInt16 nFlags_ = GetFlags(); SetFlag( SBX_NO_BROADCAST ); - BOOL bRes = Get( rRes ); + sal_Bool bRes = Get( rRes ); SetFlags( nFlags_ ); return bRes; } @@ -654,7 +654,7 @@ const XubString& SbxValue::GetCoreString() const return aResult; } -BOOL SbxValue::HasObject() const +sal_Bool SbxValue::HasObject() const { ErrCode eErr = GetError(); SbxValues aRes; @@ -664,33 +664,33 @@ BOOL SbxValue::HasObject() const return 0 != aRes.pObj; } -BOOL SbxValue::GetBool() const +sal_Bool SbxValue::GetBool() const { SbxValues aRes; aRes.eType = SbxBOOL; Get( aRes ); - return BOOL( aRes.nUShort != 0 ); + return sal_Bool( aRes.nUShort != 0 ); } #define GET( g, e, t, m ) \ t SbxValue::g() const { SbxValues aRes(e); Get( aRes ); return aRes.m; } -GET( GetByte, SbxBYTE, BYTE, nByte ) +GET( GetByte, SbxBYTE, sal_uInt8, nByte ) GET( GetChar, SbxCHAR, xub_Unicode, nChar ) GET( GetCurrency, SbxCURRENCY, SbxINT64, nLong64 ) GET( GetDate, SbxDATE, double, nDouble ) GET( GetData, SbxDATAOBJECT, void*, pData ) GET( GetDouble, SbxDOUBLE, double, nDouble ) -GET( GetErr, SbxERROR, UINT16, nUShort ) +GET( GetErr, SbxERROR, sal_uInt16, nUShort ) GET( GetInt, SbxINT, int, nInt ) -GET( GetInteger, SbxINTEGER, INT16, nInteger ) -GET( GetLong, SbxLONG, INT32, nLong ) +GET( GetInteger, SbxINTEGER, sal_Int16, nInteger ) +GET( GetLong, SbxLONG, sal_Int32, nLong ) GET( GetLong64, SbxLONG64, SbxINT64, nLong64 ) GET( GetObject, SbxOBJECT, SbxBase*, pObj ) GET( GetSingle, SbxSINGLE, float, nSingle ) -GET( GetULong, SbxULONG, UINT32, nULong ) +GET( GetULong, SbxULONG, sal_uInt32, nULong ) GET( GetULong64, SbxULONG64, SbxUINT64, nULong64 ) -GET( GetUShort, SbxUSHORT, UINT16, nUShort ) +GET( GetUShort, SbxUSHORT, sal_uInt16, nUShort ) GET( GetInt64, SbxSALINT64, sal_Int64, nInt64 ) GET( GetUInt64, SbxSALUINT64, sal_uInt64, uInt64 ) GET( GetDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) @@ -698,9 +698,9 @@ GET( GetDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) //////////////////////////// Daten schreiben ///////////////////////////// -BOOL SbxValue::Put( const SbxValues& rVal ) +sal_Bool SbxValue::Put( const SbxValues& rVal ) { - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; SbxError eOld = GetError(); if( eOld != SbxERR_OK ) ResetError(); @@ -714,7 +714,7 @@ BOOL SbxValue::Put( const SbxValues& rVal ) // die wahren Werte suchen SbxValue* p = this; if( rVal.eType != SbxOBJECT ) - p = TheRealValue( FALSE ); // #55226 Hier keinen Fehler erlauben + p = TheRealValue( sal_False ); // #55226 Hier keinen Fehler erlauben if( p ) { if( !p->CanWrite() ) @@ -743,16 +743,16 @@ BOOL SbxValue::Put( const SbxValues& rVal ) case SbxSTRING: ImpPutString( &p->aData, rVal.pOUString ); break; case SbxINT: #if SAL_TYPES_SIZEOFINT == 2 - ImpPutInteger( &p->aData, (INT16) rVal.nInt ); + ImpPutInteger( &p->aData, (sal_Int16) rVal.nInt ); #else - ImpPutLong( &p->aData, (INT32) rVal.nInt ); + ImpPutLong( &p->aData, (sal_Int32) rVal.nInt ); #endif break; case SbxUINT: #if SAL_TYPES_SIZEOFINT == 2 - ImpPutUShort( &p->aData, (UINT16) rVal.nUInt ); + ImpPutUShort( &p->aData, (sal_uInt16) rVal.nUInt ); #else - ImpPutULong( &p->aData, (UINT32) rVal.nUInt ); + ImpPutULong( &p->aData, (sal_uInt32) rVal.nUInt ); #endif break; case SbxOBJECT: @@ -777,8 +777,8 @@ BOOL SbxValue::Put( const SbxValues& rVal ) } HACK(nicht bei Parent-Prop - sonst CyclicRef) SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); - BOOL bParentProp = pThisVar && 5345 == - ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ); + sal_Bool bParentProp = pThisVar && 5345 == + ( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) ); if ( !bParentProp ) p->aData.pObj->AddRef(); } @@ -798,11 +798,11 @@ BOOL SbxValue::Put( const SbxValues& rVal ) } if( !IsError() ) { - p->SetModified( TRUE ); + p->SetModified( sal_True ); p->Broadcast( SBX_HINT_DATACHANGED ); if( eOld != SbxERR_OK ) SetError( eOld ); - bRes = TRUE; + bRes = sal_True; } } } @@ -816,7 +816,7 @@ BOOL SbxValue::Put( const SbxValues& rVal ) // werden koennen, wenn Floats mit ',' als Dezimaltrenner oder BOOLs // explizit mit "TRUE" oder "FALSE" angegeben werden. // Implementierung in ImpConvStringExt (SBXSCAN.CXX) -BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) +sal_Bool SbxValue::PutStringExt( const ::rtl::OUString& r ) { // Kopieren, bei Unicode gleich konvertieren ::rtl::OUString aStr( r ); @@ -831,7 +831,7 @@ BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) // Nur, wenn wirklich was konvertiert wurde, Kopie nehmen, // sonst Original (Unicode bleibt erhalten) - BOOL bRet; + sal_Bool bRet; if( ImpConvStringExt( aStr, eTargetType ) ) aRes.pOUString = (::rtl::OUString*)&aStr; else @@ -839,7 +839,7 @@ BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) // #34939: Bei Strings. die eine Zahl enthalten und wenn this einen // Num-Typ hat, Fixed-Flag setzen, damit der Typ nicht veraendert wird - USHORT nFlags_ = GetFlags(); + sal_uInt16 nFlags_ = GetFlags(); if( ( eTargetType >= SbxINTEGER && eTargetType <= SbxCURRENCY ) || ( eTargetType >= SbxCHAR && eTargetType <= SbxUINT ) || eTargetType == SbxBOOL ) @@ -851,7 +851,7 @@ BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) } Put( aRes ); - bRet = BOOL( !IsError() ); + bRet = sal_Bool( !IsError() ); // Falls das mit dem FIXED einen Error gegeben hat, zuruecksetzen // (UI-Aktion sollte keinen Error ergeben, sondern nur scheitern) @@ -862,104 +862,104 @@ BOOL SbxValue::PutStringExt( const ::rtl::OUString& r ) return bRet; } -BOOL SbxValue::PutString( const xub_Unicode* p ) +sal_Bool SbxValue::PutString( const xub_Unicode* p ) { ::rtl::OUString aVal( p ); SbxValues aRes; aRes.eType = SbxSTRING; aRes.pOUString = &aVal; Put( aRes ); - return BOOL( !IsError() ); + return sal_Bool( !IsError() ); } -BOOL SbxValue::PutBool( BOOL b ) +sal_Bool SbxValue::PutBool( sal_Bool b ) { SbxValues aRes; aRes.eType = SbxBOOL; - aRes.nUShort = sal::static_int_cast< UINT16 >(b ? SbxTRUE : SbxFALSE); + aRes.nUShort = sal::static_int_cast< sal_uInt16 >(b ? SbxTRUE : SbxFALSE); Put( aRes ); - return BOOL( !IsError() ); + return sal_Bool( !IsError() ); } -BOOL SbxValue::PutEmpty() +sal_Bool SbxValue::PutEmpty() { - BOOL bRet = SetType( SbxEMPTY ); - SetModified( TRUE ); + sal_Bool bRet = SetType( SbxEMPTY ); + SetModified( sal_True ); return bRet; } -BOOL SbxValue::PutNull() +sal_Bool SbxValue::PutNull() { - BOOL bRet = SetType( SbxNULL ); + sal_Bool bRet = SetType( SbxNULL ); if( bRet ) - SetModified( TRUE ); + SetModified( sal_True ); return bRet; } // Special decimal methods -BOOL SbxValue::PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ) +sal_Bool SbxValue::PutDecimal( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ) { SbxValue::Clear(); aData.pDecimal = new SbxDecimal( rAutomationDec ); aData.pDecimal->addRef(); aData.eType = SbxDECIMAL; - return TRUE; + return sal_True; } -BOOL SbxValue::fillAutomationDecimal +sal_Bool SbxValue::fillAutomationDecimal ( com::sun::star::bridge::oleautomation::Decimal& rAutomationDec ) { SbxDecimal* pDecimal = GetDecimal(); if( pDecimal != NULL ) { pDecimal->fillAutomationDecimal( rAutomationDec ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } -BOOL SbxValue::PutpChar( const xub_Unicode* p ) +sal_Bool SbxValue::PutpChar( const xub_Unicode* p ) { ::rtl::OUString aVal( p ); SbxValues aRes; aRes.eType = SbxLPSTR; aRes.pOUString = &aVal; Put( aRes ); - return BOOL( !IsError() ); + return sal_Bool( !IsError() ); } -BOOL SbxValue::PutString( const ::rtl::OUString& r ) +sal_Bool SbxValue::PutString( const ::rtl::OUString& r ) { SbxValues aRes; aRes.eType = SbxSTRING; aRes.pOUString = (::rtl::OUString*) &r; Put( aRes ); - return BOOL( !IsError() ); + return sal_Bool( !IsError() ); } #define PUT( p, e, t, m ) \ -BOOL SbxValue::p( t n ) \ -{ SbxValues aRes(e); aRes.m = n; Put( aRes ); return BOOL( !IsError() ); } +sal_Bool SbxValue::p( t n ) \ +{ SbxValues aRes(e); aRes.m = n; Put( aRes ); return sal_Bool( !IsError() ); } -PUT( PutByte, SbxBYTE, BYTE, nByte ) +PUT( PutByte, SbxBYTE, sal_uInt8, nByte ) PUT( PutChar, SbxCHAR, xub_Unicode, nChar ) PUT( PutCurrency, SbxCURRENCY, const SbxINT64&, nLong64 ) PUT( PutDate, SbxDATE, double, nDouble ) PUT( PutData, SbxDATAOBJECT, void*, pData ) PUT( PutDouble, SbxDOUBLE, double, nDouble ) -PUT( PutErr, SbxERROR, UINT16, nUShort ) +PUT( PutErr, SbxERROR, sal_uInt16, nUShort ) PUT( PutInt, SbxINT, int, nInt ) -PUT( PutInteger, SbxINTEGER, INT16, nInteger ) -PUT( PutLong, SbxLONG, INT32, nLong ) +PUT( PutInteger, SbxINTEGER, sal_Int16, nInteger ) +PUT( PutLong, SbxLONG, sal_Int32, nLong ) PUT( PutLong64, SbxLONG64, const SbxINT64&, nLong64 ) PUT( PutObject, SbxOBJECT, SbxBase*, pObj ) PUT( PutSingle, SbxSINGLE, float, nSingle ) -PUT( PutULong, SbxULONG, UINT32, nULong ) +PUT( PutULong, SbxULONG, sal_uInt32, nULong ) PUT( PutULong64, SbxULONG64, const SbxUINT64&, nULong64 ) -PUT( PutUShort, SbxUSHORT, UINT16, nUShort ) +PUT( PutUShort, SbxUSHORT, sal_uInt16, nUShort ) PUT( PutInt64, SbxSALINT64, sal_Int64, nInt64 ) PUT( PutUInt64, SbxSALUINT64, sal_uInt64, uInt64 ) PUT( PutDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) @@ -967,7 +967,7 @@ PUT( PutDecimal, SbxDECIMAL, SbxDecimal*, pDecimal ) ////////////////////////// Setzen des Datentyps /////////////////////////// -BOOL SbxValue::IsFixed() const +sal_Bool SbxValue::IsFixed() const { return ( (GetFlags() & SBX_FIXED) | (aData.eType & SbxBYREF) ) != 0; } @@ -976,22 +976,22 @@ BOOL SbxValue::IsFixed() const // oder einen vollstaendig konvertierbaren String enthaelt // #41692, fuer RTL und Basic-Core getrennt implementieren -BOOL SbxValue::IsNumeric() const +sal_Bool SbxValue::IsNumeric() const { - return ImpIsNumeric( /*bOnlyIntntl*/FALSE ); + return ImpIsNumeric( /*bOnlyIntntl*/sal_False ); } -BOOL SbxValue::IsNumericRTL() const +sal_Bool SbxValue::IsNumericRTL() const { - return ImpIsNumeric( /*bOnlyIntntl*/TRUE ); + return ImpIsNumeric( /*bOnlyIntntl*/sal_True ); } -BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const +sal_Bool SbxValue::ImpIsNumeric( sal_Bool bOnlyIntntl ) const { if( !CanRead() ) { - SetError( SbxERR_PROP_WRITEONLY ); return FALSE; + SetError( SbxERR_PROP_WRITEONLY ); return sal_False; } // Downcast pruefen!!! if( this->ISA(SbxVariable) ) @@ -1004,14 +1004,14 @@ BOOL SbxValue::ImpIsNumeric( BOOL bOnlyIntntl ) const ::rtl::OUString s( *aData.pOUString ); double n; SbxDataType t2; - USHORT nLen = 0; - if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/FALSE, bOnlyIntntl ) == SbxERR_OK ) - return BOOL( nLen == s.getLength() ); + sal_uInt16 nLen = 0; + if( ImpScan( s, n, t2, &nLen, /*bAllowIntntl*/sal_False, bOnlyIntntl ) == SbxERR_OK ) + return sal_Bool( nLen == s.getLength() ); } - return FALSE; + return sal_False; } else - return BOOL( t == SbxEMPTY + return sal_Bool( t == SbxEMPTY || ( t >= SbxINTEGER && t <= SbxCURRENCY ) || ( t >= SbxCHAR && t <= SbxUINT ) ); } @@ -1031,19 +1031,19 @@ SbxDataType SbxValue::GetFullType() const return aData.eType; } -BOOL SbxValue::SetType( SbxDataType t ) +sal_Bool SbxValue::SetType( SbxDataType t ) { DBG_ASSERT( !( t & 0xF000 ), "Setzen von BYREF|ARRAY verboten!" ); if( ( t == SbxEMPTY && aData.eType == SbxVOID ) || ( aData.eType == SbxEMPTY && t == SbxVOID ) ) - return TRUE; + return sal_True; if( ( t & 0x0FFF ) == SbxVARIANT ) { // Versuch, den Datentyp auf Variant zu setzen ResetFlag( SBX_FIXED ); if( IsFixed() ) { - SetError( SbxERR_CONVERSION ); return FALSE; + SetError( SbxERR_CONVERSION ); return sal_False; } t = SbxEMPTY; } @@ -1051,7 +1051,7 @@ BOOL SbxValue::SetType( SbxDataType t ) { if( !CanWrite() || IsFixed() ) { - SetError( SbxERR_CONVERSION ); return FALSE; + SetError( SbxERR_CONVERSION ); return sal_False; } else { @@ -1066,12 +1066,12 @@ BOOL SbxValue::SetType( SbxDataType t ) { HACK(nicht bei Parent-Prop - sonst CyclicRef) SbxVariable *pThisVar = PTR_CAST(SbxVariable, this); - UINT16 nSlotId = pThisVar - ? ( (INT16) ( pThisVar->GetUserData() & 0xFFFF ) ) + sal_uInt16 nSlotId = pThisVar + ? ( (sal_Int16) ( pThisVar->GetUserData() & 0xFFFF ) ) : 0; DBG_ASSERT( nSlotId != 5345 || pThisVar->GetName() == UniString::CreateFromAscii( "Parent" ), "SID_PARENTOBJECT heisst nicht 'Parent'" ); - BOOL bParentProp = 5345 == nSlotId; + sal_Bool bParentProp = 5345 == nSlotId; if ( !bParentProp ) aData.pObj->ReleaseRef(); } @@ -1083,31 +1083,31 @@ BOOL SbxValue::SetType( SbxDataType t ) aData.eType = t; } } - return TRUE; + return sal_True; } -BOOL SbxValue::Convert( SbxDataType eTo ) +sal_Bool SbxValue::Convert( SbxDataType eTo ) { eTo = SbxDataType( eTo & 0x0FFF ); if( ( aData.eType & 0x0FFF ) == eTo ) - return TRUE; + return sal_True; if( !CanWrite() ) - return FALSE; + return sal_False; if( eTo == SbxVARIANT ) { // Versuch, den Datentyp auf Variant zu setzen ResetFlag( SBX_FIXED ); if( IsFixed() ) { - SetError( SbxERR_CONVERSION ); return FALSE; + SetError( SbxERR_CONVERSION ); return sal_False; } else - return TRUE; + return sal_True; } // Convert from Null geht niemals. Einmal Null, immer Null! if( aData.eType == SbxNULL ) { - SetError( SbxERR_CONVERSION ); return FALSE; + SetError( SbxERR_CONVERSION ); return sal_False; } // Konversion der Daten: @@ -1121,17 +1121,17 @@ BOOL SbxValue::Convert( SbxDataType eTo ) { SetType( eTo ); Put( aNew ); - SetModified( TRUE ); + SetModified( sal_True ); } Broadcast( SBX_HINT_CONVERTED ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } ////////////////////////////////// Rechnen ///////////////////////////////// -BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) +sal_Bool SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp ) { bool bVBAInterop = SbiRuntime::isVBAEnabled(); @@ -1457,19 +1457,19 @@ Lbl_OpIsDouble: } Lbl_OpIsEmpty: - BOOL bRes = BOOL( !IsError() ); + sal_Bool bRes = sal_Bool( !IsError() ); if( bRes && eOld != SbxERR_OK ) SetError( eOld ); return bRes; } -// Die Vergleichs-Routine liefert TRUE oder FALSE. +// Die Vergleichs-Routine liefert sal_True oder sal_False. -BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const +sal_Bool SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const { bool bVBAInterop = SbiRuntime::isVBAEnabled(); - BOOL bRes = FALSE; + sal_Bool bRes = sal_False; SbxError eOld = GetError(); if( eOld != SbxERR_OK ) ResetError(); @@ -1477,24 +1477,24 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const SetError( SbxERR_PROP_WRITEONLY ); else if( GetType() == SbxNULL && rOp.GetType() == SbxNULL && !bVBAInterop ) { - bRes = TRUE; + bRes = sal_True; } else if( GetType() == SbxEMPTY && rOp.GetType() == SbxEMPTY ) - bRes = !bVBAInterop ? TRUE : ( eOp == SbxEQ ? TRUE : FALSE ); + bRes = !bVBAInterop ? sal_True : ( eOp == SbxEQ ? sal_True : sal_False ); // Sonderregel 1: Ist ein Operand Null, ist das Ergebnis FALSE else if( GetType() == SbxNULL || rOp.GetType() == SbxNULL ) - bRes = FALSE; + bRes = sal_False; // Sonderregel 2: Wenn beide Variant sind und einer ist numerisch, // und der andere ein String, ist num < str else if( !IsFixed() && !rOp.IsFixed() && ( rOp.GetType() == SbxSTRING && GetType() != SbxSTRING && IsNumeric() ) && !bVBAInterop ) - bRes = BOOL( eOp == SbxLT || eOp == SbxLE || eOp == SbxNE ); + bRes = sal_Bool( eOp == SbxLT || eOp == SbxLE || eOp == SbxNE ); else if( !IsFixed() && !rOp.IsFixed() && ( GetType() == SbxSTRING && rOp.GetType() != SbxSTRING && rOp.IsNumeric() ) && !bVBAInterop ) - bRes = BOOL( eOp == SbxGT || eOp == SbxGE || eOp == SbxNE ); + bRes = sal_Bool( eOp == SbxGT || eOp == SbxGE || eOp == SbxNE ); else { SbxValues aL, aR; @@ -1506,17 +1506,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const if( Get( aL ) && rOp.Get( aR ) ) switch( eOp ) { case SbxEQ: - bRes = BOOL( *aL.pOUString == *aR.pOUString ); break; + bRes = sal_Bool( *aL.pOUString == *aR.pOUString ); break; case SbxNE: - bRes = BOOL( *aL.pOUString != *aR.pOUString ); break; + bRes = sal_Bool( *aL.pOUString != *aR.pOUString ); break; case SbxLT: - bRes = BOOL( *aL.pOUString < *aR.pOUString ); break; + bRes = sal_Bool( *aL.pOUString < *aR.pOUString ); break; case SbxGT: - bRes = BOOL( *aL.pOUString > *aR.pOUString ); break; + bRes = sal_Bool( *aL.pOUString > *aR.pOUString ); break; case SbxLE: - bRes = BOOL( *aL.pOUString <= *aR.pOUString ); break; + bRes = sal_Bool( *aL.pOUString <= *aR.pOUString ); break; case SbxGE: - bRes = BOOL( *aL.pOUString >= *aR.pOUString ); break; + bRes = sal_Bool( *aL.pOUString >= *aR.pOUString ); break; default: SetError( SbxERR_NOTIMP ); } @@ -1530,17 +1530,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const switch( eOp ) { case SbxEQ: - bRes = BOOL( aL.nSingle == aR.nSingle ); break; + bRes = sal_Bool( aL.nSingle == aR.nSingle ); break; case SbxNE: - bRes = BOOL( aL.nSingle != aR.nSingle ); break; + bRes = sal_Bool( aL.nSingle != aR.nSingle ); break; case SbxLT: - bRes = BOOL( aL.nSingle < aR.nSingle ); break; + bRes = sal_Bool( aL.nSingle < aR.nSingle ); break; case SbxGT: - bRes = BOOL( aL.nSingle > aR.nSingle ); break; + bRes = sal_Bool( aL.nSingle > aR.nSingle ); break; case SbxLE: - bRes = BOOL( aL.nSingle <= aR.nSingle ); break; + bRes = sal_Bool( aL.nSingle <= aR.nSingle ); break; case SbxGE: - bRes = BOOL( aL.nSingle >= aR.nSingle ); break; + bRes = sal_Bool( aL.nSingle >= aR.nSingle ); break; default: SetError( SbxERR_NOTIMP ); } @@ -1556,17 +1556,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const switch( eOp ) { case SbxEQ: - bRes = BOOL( eRes == SbxDecimal::EQ ); break; + bRes = sal_Bool( eRes == SbxDecimal::EQ ); break; case SbxNE: - bRes = BOOL( eRes != SbxDecimal::EQ ); break; + bRes = sal_Bool( eRes != SbxDecimal::EQ ); break; case SbxLT: - bRes = BOOL( eRes == SbxDecimal::LT ); break; + bRes = sal_Bool( eRes == SbxDecimal::LT ); break; case SbxGT: - bRes = BOOL( eRes == SbxDecimal::GT ); break; + bRes = sal_Bool( eRes == SbxDecimal::GT ); break; case SbxLE: - bRes = BOOL( eRes != SbxDecimal::GT ); break; + bRes = sal_Bool( eRes != SbxDecimal::GT ); break; case SbxGE: - bRes = BOOL( eRes != SbxDecimal::LT ); break; + bRes = sal_Bool( eRes != SbxDecimal::LT ); break; default: SetError( SbxERR_NOTIMP ); } @@ -1589,17 +1589,17 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const switch( eOp ) { case SbxEQ: - bRes = BOOL( aL.nDouble == aR.nDouble ); break; + bRes = sal_Bool( aL.nDouble == aR.nDouble ); break; case SbxNE: - bRes = BOOL( aL.nDouble != aR.nDouble ); break; + bRes = sal_Bool( aL.nDouble != aR.nDouble ); break; case SbxLT: - bRes = BOOL( aL.nDouble < aR.nDouble ); break; + bRes = sal_Bool( aL.nDouble < aR.nDouble ); break; case SbxGT: - bRes = BOOL( aL.nDouble > aR.nDouble ); break; + bRes = sal_Bool( aL.nDouble > aR.nDouble ); break; case SbxLE: - bRes = BOOL( aL.nDouble <= aR.nDouble ); break; + bRes = sal_Bool( aL.nDouble <= aR.nDouble ); break; case SbxGE: - bRes = BOOL( aL.nDouble >= aR.nDouble ); break; + bRes = sal_Bool( aL.nDouble >= aR.nDouble ); break; default: SetError( SbxERR_NOTIMP ); } @@ -1611,7 +1611,7 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const if ( bVBAInterop && eOp == SbxEQ && GetError() == SbxERR_CONVERSION ) { ResetError(); - bRes = FALSE; + bRes = sal_False; } } } @@ -1623,10 +1623,10 @@ BOOL SbxValue::Compare( SbxOperator eOp, const SbxValue& rOp ) const ///////////////////////////// Lesen/Schreiben //////////////////////////// -BOOL SbxValue::LoadData( SvStream& r, USHORT ) +sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) { SbxValue::Clear(); - UINT16 nType; + sal_uInt16 nType; r >> nType; aData.eType = SbxDataType( nType ); switch( nType ) @@ -1646,7 +1646,7 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) if( ImpScan( aVal, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) { aData.nSingle = 0.0F; - return FALSE; + return sal_False; } aData.nSingle = (float) d; break; @@ -1661,7 +1661,7 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) if( ImpScan( aVal, aData.nDouble, t, NULL ) != SbxERR_OK ) { aData.nDouble = 0.0; - return FALSE; + return sal_False; } break; } @@ -1691,7 +1691,7 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) r >> aData.nUShort; break; case SbxOBJECT: { - BYTE nMode; + sal_uInt8 nMode; r >> nMode; switch( nMode ) { @@ -1700,7 +1700,7 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) break; case 1: aData.pObj = SbxBase::Load( r ); - return BOOL( aData.pObj != NULL ); + return sal_Bool( aData.pObj != NULL ); case 2: aData.pObj = this; break; @@ -1720,7 +1720,7 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) r >> aData.nULong; break; case SbxINT: { - BYTE n; + sal_uInt8 n; r >> n; // Passt der Int auf diesem System? if( n > SAL_TYPES_SIZEOFINT ) @@ -1731,7 +1731,7 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) } case SbxUINT: { - BYTE n; + sal_uInt8 n; r >> n; // Passt der UInt auf diesem System? if( n > SAL_TYPES_SIZEOFINT ) @@ -1756,14 +1756,14 @@ BOOL SbxValue::LoadData( SvStream& r, USHORT ) ResetFlag(SBX_FIXED); aData.eType = SbxNULL; DBG_ASSERT( !this, "Nicht unterstuetzer Datentyp geladen" ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -BOOL SbxValue::StoreData( SvStream& r ) const +sal_Bool SbxValue::StoreData( SvStream& r ) const { - UINT16 nType = sal::static_int_cast< UINT16 >(aData.eType); + sal_uInt16 nType = sal::static_int_cast< sal_uInt16 >(aData.eType); r << nType; switch( nType & 0x0FFF ) { @@ -1813,14 +1813,14 @@ BOOL SbxValue::StoreData( SvStream& r ) const { if( PTR_CAST(SbxValue,aData.pObj) != this ) { - r << (BYTE) 1; + r << (sal_uInt8) 1; return aData.pObj->Store( r ); } else - r << (BYTE) 2; + r << (sal_uInt8) 2; } else - r << (BYTE) 0; + r << (sal_uInt8) 0; break; case SbxCHAR: { @@ -1834,13 +1834,13 @@ BOOL SbxValue::StoreData( SvStream& r ) const r << aData.nULong; break; case SbxINT: { - BYTE n = SAL_TYPES_SIZEOFINT; + sal_uInt8 n = SAL_TYPES_SIZEOFINT; r << n << (sal_Int32)aData.nInt; break; } case SbxUINT: { - BYTE n = SAL_TYPES_SIZEOFINT; + sal_uInt8 n = SAL_TYPES_SIZEOFINT; r << n << (sal_uInt32)aData.nUInt; break; } @@ -1857,8 +1857,8 @@ BOOL SbxValue::StoreData( SvStream& r ) const break; default: DBG_ASSERT( !this, "Speichern eines nicht unterstuetzten Datentyps" ); - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 12a6d29672a9..fdc90acb8d5b 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -47,9 +47,9 @@ using namespace com::sun::star::uno; TYPEINIT1(SbxVariable,SbxValue) TYPEINIT1(SbxHint,SfxSimpleHint) -extern UINT32 nVarCreator; // in SBXBASE.CXX, fuer LoadData() +extern sal_uInt32 nVarCreator; // in SBXBASE.CXX, fuer LoadData() #ifdef DBG_UTIL -static ULONG nVar = 0; +static sal_uIntPtr nVar = 0; #endif ///////////////////////////// SbxVariableImpl //////////////////////////// @@ -166,7 +166,7 @@ SfxBroadcaster& SbxVariable::GetBroadcaster() // Eines Tages kann man vielleicht den Parameter 0 schleifen, // dann entfaellt die Kopiererei... -void SbxVariable::Broadcast( ULONG nHintId ) +void SbxVariable::Broadcast( sal_uIntPtr nHintId ) { if( pCst && !IsSet( SBX_NO_BROADCAST ) && StaticIsEnabledBroadcasting() ) { @@ -181,7 +181,7 @@ void SbxVariable::Broadcast( ULONG nHintId ) // Weitere Broadcasts verhindern SfxBroadcaster* pSave = pCst; pCst = NULL; - USHORT nSaveFlags = GetFlags(); + sal_uInt16 nSaveFlags = GetFlags(); SetFlag( SBX_READWRITE ); if( mpPar.Is() ) // this, als Element 0 eintragen, aber den Parent nicht umsetzen! @@ -199,7 +199,7 @@ SbxInfo* SbxVariable::GetInfo() { Broadcast( SBX_HINT_INFOWANTED ); if( pInfo.Is() ) - SetModified( TRUE ); + SetModified( sal_True ); } return pInfo; } @@ -246,7 +246,7 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const aTmp += cType; } aTmp += '('; - for( USHORT i = 0; i < pInfo->aParams.Count(); i++ ) + for( sal_uInt16 i = 0; i < pInfo->aParams.Count(); i++ ) { const SbxParamInfo* q = pInfo->aParams.GetObject( i ); int nt = q->eType & 0x0FFF; @@ -280,7 +280,7 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const aTmp += String( SbxRes( STRING_AS ) ); if( nt < 32 ) aTmp += String( SbxRes( - sal::static_int_cast< USHORT >( STRING_TYPES + nt ) ) ); + sal::static_int_cast< sal_uInt16 >( STRING_TYPES + nt ) ) ); else aTmp += String( SbxRes( STRING_ANY ) ); } @@ -293,7 +293,7 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const aTmp += String( SbxRes( STRING_AS ) ); if( et < 32 ) aTmp += String( SbxRes( - sal::static_int_cast< USHORT >( STRING_TYPES + et ) ) ); + sal::static_int_cast< sal_uInt16 >( STRING_TYPES + et ) ) ); else aTmp += String( SbxRes( STRING_ANY ) ); } @@ -303,21 +303,21 @@ const XubString& SbxVariable::GetName( SbxNameType t ) const // Einen simplen Hashcode erzeugen: Es werden die ersten 6 Zeichen gewertet. -USHORT SbxVariable::MakeHashCode( const XubString& rName ) +sal_uInt16 SbxVariable::MakeHashCode( const XubString& rName ) { - USHORT n = 0; - USHORT nLen = rName.Len(); + sal_uInt16 n = 0; + sal_uInt16 nLen = rName.Len(); if( nLen > 6 ) nLen = 6; const xub_Unicode* p = rName.GetBuffer(); while( nLen-- ) { - BYTE c = (BYTE)*p; + sal_uInt8 c = (sal_uInt8)*p; p++; // Falls wir ein Schweinezeichen haben, abbrechen!! if( c >= 0x80 ) return 0; - n = sal::static_int_cast< USHORT >( ( n << 3 ) + toupper( c ) ); + n = sal::static_int_cast< sal_uInt16 >( ( n << 3 ) + toupper( c ) ); } return n; } @@ -356,7 +356,7 @@ SbxClassType SbxVariable::GetClass() const return SbxCLASS_VARIABLE; } -void SbxVariable::SetModified( BOOL b ) +void SbxVariable::SetModified( sal_Bool b ) { if( IsSet( SBX_NO_MODIFY ) ) return; @@ -372,11 +372,11 @@ void SbxVariable::SetParent( SbxObject* p ) if ( p && ISA(SbxObject) ) { // dann mu\s dieses auch Child vom neuen Parent sein - BOOL bFound = FALSE; + sal_Bool bFound = sal_False; SbxArray *pChilds = p->GetObjects(); if ( pChilds ) { - for ( USHORT nIdx = 0; !bFound && nIdx < pChilds->Count(); ++nIdx ) + for ( sal_uInt16 nIdx = 0; !bFound && nIdx < pChilds->Count(); ++nIdx ) bFound = ( this == pChilds->Get(nIdx) ); } if ( !bFound ) @@ -432,17 +432,17 @@ void SbxVariable::ClearComListener( void ) ////////////////////////////// Laden/Speichern ///////////////////////////// -BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) +sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) { - UINT16 nType; - BYTE cMark; + sal_uInt16 nType; + sal_uInt8 cMark; rStrm >> cMark; if( cMark == 0xFF ) { if( !SbxValue::LoadData( rStrm, nVer ) ) - return FALSE; + return sal_False; rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US ); - UINT32 nTemp; + sal_uInt32 nTemp; rStrm >> nTemp; nUserData = nTemp; } @@ -451,7 +451,7 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) rStrm.SeekRel( -1L ); rStrm >> nType; rStrm.ReadByteString( maName, RTL_TEXTENCODING_ASCII_US ); - UINT32 nTemp; + sal_uInt32 nTemp; rStrm >> nTemp; nUserData = nTemp; // Korrektur: Alte Methoden haben statt SbxNULL jetzt SbxEMPTY @@ -479,7 +479,7 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) if( ImpScan( aTmpString, d, t, NULL ) != SbxERR_OK || t == SbxDOUBLE ) { aTmp.nSingle = 0; - return FALSE; + return sal_False; } aTmp.nSingle = (float) d; break; @@ -493,7 +493,7 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) if( ImpScan( aTmpString, aTmp.nDouble, t, NULL ) != SbxERR_OK ) { aTmp.nDouble = 0; - return FALSE; + return sal_False; } break; } @@ -507,11 +507,11 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) default: aData.eType = SbxNULL; DBG_ASSERT( !this, "Nicht unterstuetzer Datentyp geladen" ); - return FALSE; + return sal_False; } // Wert putten if( nType != SbxNULL && nType != SbxEMPTY && !Put( aTmp ) ) - return FALSE; + return sal_False; } rStrm >> cMark; // cMark ist auch eine Versionsnummer! @@ -520,29 +520,29 @@ BOOL SbxVariable::LoadData( SvStream& rStrm, USHORT nVer ) if( cMark ) { if( cMark > 2 ) - return FALSE; + return sal_False; pInfo = new SbxInfo; - pInfo->LoadData( rStrm, (USHORT) cMark ); + pInfo->LoadData( rStrm, (sal_uInt16) cMark ); } // Privatdaten nur laden, wenn es eine SbxVariable ist if( GetClass() == SbxCLASS_VARIABLE && !LoadPrivateData( rStrm, nVer ) ) - return FALSE; + return sal_False; ((SbxVariable*) this)->Broadcast( SBX_HINT_DATACHANGED ); nHash = MakeHashCode( maName ); - SetModified( TRUE ); - return TRUE; + SetModified( sal_True ); + return sal_True; } -BOOL SbxVariable::StoreData( SvStream& rStrm ) const +sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const { - rStrm << (BYTE) 0xFF; // Marker - BOOL bValStore; + rStrm << (sal_uInt8) 0xFF; // Marker + sal_Bool bValStore; if( this->IsA( TYPE(SbxMethod) ) ) { // #50200 Verhindern, dass Objekte, die zur Laufzeit als Return-Wert // in der Methode als Value gespeichert sind, mit gespeichert werden SbxVariable* pThis = (SbxVariable*)this; - USHORT nSaveFlags = GetFlags(); + sal_uInt16 nSaveFlags = GetFlags(); pThis->SetFlag( SBX_WRITE ); pThis->SbxValue::Clear(); pThis->SetFlags( nSaveFlags ); @@ -556,23 +556,23 @@ BOOL SbxVariable::StoreData( SvStream& rStrm ) const else bValStore = SbxValue::StoreData( rStrm ); if( !bValStore ) - return FALSE; + return sal_False; // if( !SbxValue::StoreData( rStrm ) ) - // return FALSE; + // return sal_False; rStrm.WriteByteString( maName, RTL_TEXTENCODING_ASCII_US ); - rStrm << (UINT32)nUserData; + rStrm << (sal_uInt32)nUserData; if( pInfo.Is() ) { - rStrm << (BYTE) 2; // Version 2: mit UserData! + rStrm << (sal_uInt8) 2; // Version 2: mit UserData! pInfo->StoreData( rStrm ); } else - rStrm << (BYTE) 0; + rStrm << (sal_uInt8) 0; // Privatdaten nur speichern, wenn es eine SbxVariable ist if( GetClass() == SbxCLASS_VARIABLE ) return StorePrivateData( rStrm ); else - return TRUE; + return sal_True; } ////////////////////////////// SbxInfo /////////////////////////////////// @@ -580,7 +580,7 @@ BOOL SbxVariable::StoreData( SvStream& rStrm ) const SbxInfo::SbxInfo() : aHelpFile(), nHelpId( 0 ), aParams() {} -SbxInfo::SbxInfo( const String& r, UINT32 n ) +SbxInfo::SbxInfo( const String& r, sal_uInt32 n ) : aHelpFile( r ), nHelpId( n ), aParams() {} @@ -613,7 +613,7 @@ SbxAlias::~SbxAlias() EndListening( xAlias->GetBroadcaster() ); } -void SbxAlias::Broadcast( ULONG nHt ) +void SbxAlias::Broadcast( sal_uIntPtr nHt ) { if( xAlias.Is() && StaticIsEnabledBroadcasting() ) { @@ -643,7 +643,7 @@ void SbxAlias::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, } } -void SbxVariable::Dump( SvStream& rStrm, BOOL bFill ) +void SbxVariable::Dump( SvStream& rStrm, sal_Bool bFill ) { ByteString aBNameStr( (const UniString&)GetName( SbxNAME_SHORT_TYPES ), RTL_TEXTENCODING_ASCII_US ); rStrm << "Variable( " diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index 004b61fbf198..f173ae5f18ff 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -139,7 +139,7 @@ bool writeOasis2OOoLibraryElement( if (! xSMgr.is()) { - return FALSE; + return sal_False; } Reference< xml::sax::XParser > xParser( @@ -161,7 +161,7 @@ bool writeOasis2OOoLibraryElement( if ( !xParser.is() || !xWriter.is() ) { - return FALSE; + return sal_False; } Sequence aArgs( 1 ); @@ -182,7 +182,7 @@ bool writeOasis2OOoLibraryElement( xParser->parseStream( source ); - return TRUE; + return sal_True; } void SAL_CALL SfxDialogLibraryContainer::writeLibraryElement @@ -201,13 +201,13 @@ void SAL_CALL SfxDialogLibraryContainer::writeLibraryElement Reference< XInputStream > xInput( xISP->createInputStream() ); - bool bComplete = FALSE; + bool bComplete = sal_False; if ( mbOasis2OOoFormat ) { bComplete = writeOasis2OOoLibraryElement( xInput, xOutput ); } - if ( bComplete == FALSE ) + if ( bComplete == sal_False ) { Sequence< sal_Int8 > bytes; sal_Int32 nRead = xInput->readBytes( bytes, xInput->available() ); @@ -246,7 +246,7 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e { // if we cannot get the version then the // Oasis2OOoTransformer will not be used - OSL_ASSERT(FALSE); + OSL_ASSERT(sal_False); } } @@ -329,7 +329,7 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement { OSL_ENSURE( 0, "Parsing error\n" ); SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFile ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); return aRetAny; } diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx index f44846972710..fbf1429f9753 100644 --- a/basic/source/uno/namecont.cxx +++ b/basic/source/uno/namecont.cxx @@ -736,7 +736,7 @@ sal_Bool SfxLibraryContainer::init_Impl( if( nPass == 0 ) { SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFileName ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } } @@ -758,7 +758,7 @@ sal_Bool SfxLibraryContainer::init_Impl( { xInput.clear(); SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFileName ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } } @@ -1490,7 +1490,7 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib, throw; SfxErrorContext aEc( ERRCTX_SFX_SAVEDOC, aElementPath ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } } @@ -1603,7 +1603,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib, throw; SfxErrorContext aEc( ERRCTX_SFX_SAVEDOC, aLibInfoPath ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } } @@ -1678,7 +1678,7 @@ sal_Bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib, if( !GbMigrationSuppressErrors ) { SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aLibInfoPath ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } } @@ -1705,7 +1705,7 @@ sal_Bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib, // makeAny( e ) ); OSL_ENSURE( 0, "Parsing error\n" ); SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aLibInfoPath ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); return sal_False; } @@ -2034,7 +2034,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto } catch( uno::Exception& ) { - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } } @@ -2056,7 +2056,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto { xOut.clear(); SfxErrorContext aEc( ERRCTX_SFX_SAVEDOC, aLibInfoPath ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } @@ -2086,7 +2086,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto catch( uno::Exception& ) { OSL_ENSURE( sal_False, "Problem during storing of libraries!\n" ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx index d99f98589b31..f51ce54cd7ee 100644 --- a/basic/source/uno/scriptcont.cxx +++ b/basic/source/uno/scriptcont.cxx @@ -299,7 +299,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement catch( Exception& ) { SfxErrorContext aEc( ERRCTX_SFX_LOADBASIC, aFile ); - ULONG nErrorCode = ERRCODE_IO_GENERAL; + sal_uIntPtr nErrorCode = ERRCODE_IO_GENERAL; ErrorHandler::HandleError( nErrorCode ); } @@ -653,7 +653,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, throw uno::RuntimeException(); SvMemoryStream aMemStream; - /*BOOL bStore = */pMod->StoreBinaryData( aMemStream ); + /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream ); sal_Int32 nSize = (sal_Int32)aMemStream.Tell(); Sequence< sal_Int8 > aBinSeq( nSize ); @@ -794,7 +794,7 @@ sal_Bool SfxScriptLibraryContainer::implStorePasswordLibrary( SfxLibrary* pLib, embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ); SvMemoryStream aMemStream; - /*BOOL bStore = */pMod->StoreBinaryData( aMemStream ); + /*sal_Bool bStore = */pMod->StoreBinaryData( aMemStream ); sal_Int32 nSize = (sal_Int32)aMemStream.Tell(); Sequence< sal_Int8 > aBinSeq( nSize ); @@ -951,7 +951,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary if( !pMod ) { pMod = pBasicLib->MakeModule( aElementName, String() ); - pBasicLib->SetModified( FALSE ); + pBasicLib->SetModified( sal_False ); } //OUString aCodeStreamName( RTL_CONSTASCII_USTRINGPARAM("code.bin") ); @@ -973,7 +973,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary throw task::ErrorCodeIOException( ::rtl::OUString(), uno::Reference< uno::XInterface >(), nError ); } - /*BOOL bRet = */pMod->LoadBinaryData( *pStream ); + /*sal_Bool bRet = */pMod->LoadBinaryData( *pStream ); // TODO: Check return value delete pStream; @@ -1063,7 +1063,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary if( !pMod ) { pMod = pBasicLib->MakeModule( aElementName, String() ); - pBasicLib->SetModified( FALSE ); + pBasicLib->SetModified( sal_False ); } try { @@ -1082,7 +1082,7 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary nError ); } - /*BOOL bRet = */pMod->LoadBinaryData( *pStream ); + /*sal_Bool bRet = */pMod->LoadBinaryData( *pStream ); // TODO: Check return value delete pStream; diff --git a/basic/workben/mgrtest.cxx b/basic/workben/mgrtest.cxx index c56506d7ae31..7e3efc597ac1 100644 --- a/basic/workben/mgrtest.cxx +++ b/basic/workben/mgrtest.cxx @@ -85,7 +85,7 @@ private: BasicManager* pBasMgr; void CheckError(); - USHORT nLibX; + sal_uInt16 nLibX; DECL_LINK( BasicErrorHdl, StarBASIC * ); @@ -125,7 +125,7 @@ TestWindow::TestWindow() : aFont.SetSize( Size( 0, 6 ) ); aFont.SetPitch( PITCH_VARIABLE ); aFont.SetFamily( FAMILY_SWISS ); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); aFont.SetAlign( ALIGN_TOP ); aToolBox.SetFont( aFont ); SetFont( aFont ); @@ -197,7 +197,7 @@ void TestWindow::ShowInfo() if ( pBasMgr ) { Point aPos( 10, aToolBox.GetSizePixel().Height()+5 ); - for ( USHORT nLib = 0; nLib < pBasMgr->GetLibCount(); nLib++ ) + for ( sal_uInt16 nLib = 0; nLib < pBasMgr->GetLibCount(); nLib++ ) { String aOutStr( nLib ); aOutStr +=": "; @@ -212,7 +212,7 @@ void TestWindow::ShowInfo() aOutStr += ">, Storage='"; aOutStr += pBasMgr->GetLibStorageName( nLib ); aOutStr += "', bLoaded="; - aOutStr += (USHORT)pBasMgr->IsLibLoaded( nLib ); + aOutStr += (sal_uInt16)pBasMgr->IsLibLoaded( nLib ); DrawText( aPos, aOutStr ); aPos.Y() += nH; } @@ -223,22 +223,22 @@ void TestWindow::UpdateToolBox() { // View of some buttons as checked or disabled if // wished by tests - aToolBox.EnableItem( TB_ORG, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_ORG, (sal_Bool)(sal_uIntPtr)pBasMgr ); - aToolBox.EnableItem( TB_CREATELIB1, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_CREATELIB2, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_CREATELIB3, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_CREATELIB1, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_CREATELIB2, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_CREATELIB3, (sal_Bool)(sal_uIntPtr)pBasMgr ); - aToolBox.EnableItem( TB_LOADLIB1, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_LOADLIB2, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_LOADLIB3, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_LOADLIB1, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_LOADLIB2, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_LOADLIB3, (sal_Bool)(sal_uIntPtr)pBasMgr ); - aToolBox.EnableItem( TB_STORELIBX, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_EXECX, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_UNLOADX, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_LOADX, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_REMOVEX, (BOOL)(ULONG)pBasMgr ); - aToolBox.EnableItem( TB_REMOVEDELX, (BOOL)(ULONG)pBasMgr ); + aToolBox.EnableItem( TB_STORELIBX, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_EXECX, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_UNLOADX, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_LOADX, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_REMOVEX, (sal_Bool)(sal_uIntPtr)pBasMgr ); + aToolBox.EnableItem( TB_REMOVEDELX, (sal_Bool)(sal_uIntPtr)pBasMgr ); aToolBox.CheckItem( TB_LIB0, nLibX == 0 ); aToolBox.CheckItem( TB_LIB1, nLibX == 1 ); @@ -248,8 +248,8 @@ void TestWindow::UpdateToolBox() IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) { - USHORT nId = aToolBox.GetCurItemId(); - BOOL bChecked = aToolBox.IsItemChecked( nId ); + sal_uInt16 nId = aToolBox.GetCurItemId(); + sal_Bool bChecked = aToolBox.IsItemChecked( nId ); switch ( nId ) { case TB_NEW: @@ -289,7 +289,7 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) { if ( pBasMgr ) { - USHORT nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib1Str ) ); + sal_uInt16 nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib1Str ) ); if ( nLib != LIB_NOTFOUND ) { pBasMgr->SetLibStorageName( nLib, "d:\\mystore.svs" ); @@ -309,7 +309,7 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) { if ( pBasMgr ) { - USHORT nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib2Str ) ); + sal_uInt16 nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib2Str ) ); if ( nLib != LIB_NOTFOUND ) { pBasMgr->SetLibStorageName( nLib, "d:\\mystore.svs" ); @@ -328,7 +328,7 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) if ( pBasMgr ) { // liegt in einem anderen Storage !!! - USHORT nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib3Str ) ); + sal_uInt16 nLib = pBasMgr->GetLibId( pBasMgr->CreateLib( pLib3Str ) ); if ( nLib != LIB_NOTFOUND ) { pBasMgr->SetLibStorageName( nLib, "d:\\mystore2.svs" ); @@ -347,7 +347,7 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) if ( pBasMgr ) { SvStorageRef xStorage = new SvStorage( "d:\\mystore.svs" ); - if ( !pBasMgr->AddLib( *xStorage, pLib1Str, FALSE ) ) + if ( !pBasMgr->AddLib( *xStorage, pLib1Str, sal_False ) ) Sound::Beep(); } } @@ -357,7 +357,7 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) if ( pBasMgr ) { SvStorageRef xStorage = new SvStorage( "d:\\mystore.svs" ); - if ( !pBasMgr->AddLib( *xStorage, pLib2Str, FALSE ) ) + if ( !pBasMgr->AddLib( *xStorage, pLib2Str, sal_False ) ) Sound::Beep(); } } @@ -368,7 +368,7 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) { // liegt in einem anderen Storage !!! SvStorageRef xStorage = new SvStorage( "d:\\mystore2.svs" ); - if ( !pBasMgr->AddLib( *xStorage, pLib3Str, FALSE ) ) + if ( !pBasMgr->AddLib( *xStorage, pLib3Str, sal_False ) ) Sound::Beep(); } } @@ -394,13 +394,13 @@ IMPL_LINK( TestWindow, TBSelect, ToolBox *, p ) case TB_REMOVEX: { if ( pBasMgr ) - pBasMgr->RemoveLib( nLibX, FALSE ); + pBasMgr->RemoveLib( nLibX, sal_False ); } break; case TB_REMOVEDELX: { if ( pBasMgr ) - pBasMgr->RemoveLib( nLibX, TRUE ); + pBasMgr->RemoveLib( nLibX, sal_True ); } break; case TB_EXECX: @@ -527,7 +527,7 @@ void __EXPORT TestWindow::Resize() void __EXPORT TestWindow::KeyInput( const KeyEvent& rKEvt ) { char nCharCode = rKEvt.GetCharCode(); - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); // Nur bei Alt-Return if ( ( nCode == KEY_RETURN ) && rKEvt.GetKeyCode().IsMod2() ) -- cgit v1.2.3 From fcad8a5c8b77bfc6b3cb41d7465147ad157d0124 Mon Sep 17 00:00:00 2001 From: Andreas Bregas Date: Fri, 11 Feb 2011 15:06:12 +0100 Subject: ab80: Adding changes of cws mib21, ab77, ab77run2, dr77i to dev300 ab77: #163789# Handle class module factories document specific ab77: #163732# Defer removal of documents until XCloseListener::notifyClosing ab77: #163808# make VBA symbols Application.ScreenUpdating and Application.Interactive work globally on all documents ab77: wae ab77: #163840# read UTF-8 BOM ab77: #163732# VBA UserForm_Terminate triggered too late while closing document ab77: minor correction ab77: assertion: do not call ::rtl::OUString::copy() with negative index ab77run2: #163869# do not call Class_Terminate VBA macros when document disposes dr77i: #163941# do not update drawing layer when pasting from clipboard after cut mib21: #163944# ignore trailing whitespace in Basic source lines mib21: #163948# allow to manually pack MSVC DLLs into extensions mib21: #163948# multiprocess build fix Authors: Andreas Bregas Daniel Rentz [dr] Eike Rathke [er] --- basic/inc/basic/sbstar.hxx | 2 + basic/source/basmgr/makefile.mk | 3 +- basic/source/classes/sb.cxx | 193 +++++++++++++++++++--- basic/source/classes/sbxmod.cxx | 103 ++++++++---- basic/source/comp/scanner.cxx | 20 ++- ucb/source/ucp/tdoc/tdoc_docmgr.cxx | 105 ++++++++++-- ucb/source/ucp/tdoc/tdoc_docmgr.hxx | 34 +++- vbahelper/source/vbahelper/vbaapplicationbase.cxx | 13 +- vbahelper/source/vbahelper/vbadocumentbase.cxx | 13 +- vbahelper/source/vbahelper/vbadocumentsbase.cxx | 61 ++++++- 10 files changed, 447 insertions(+), 100 deletions(-) (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/sbstar.hxx b/basic/inc/basic/sbstar.hxx index db67836890e9..00bfd4a9717b 100644 --- a/basic/inc/basic/sbstar.hxx +++ b/basic/inc/basic/sbstar.hxx @@ -48,6 +48,7 @@ class BasicLibInfo; // info block for basic manager class SbTextPortions; class SbMethod; class BasicManager; +class DocBasicItem; class StarBASICImpl; @@ -57,6 +58,7 @@ class StarBASIC : public SbxObject friend class SbiExpression; // Access to RTL friend class SbiInstance; friend class SbiRuntime; + friend class DocBasicItem; StarBASICImpl* mpStarBASICImpl; diff --git a/basic/source/basmgr/makefile.mk b/basic/source/basmgr/makefile.mk index e08e9cc753bd..d177379f32b8 100644 --- a/basic/source/basmgr/makefile.mk +++ b/basic/source/basmgr/makefile.mk @@ -39,7 +39,8 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES= \ $(SLO)$/basmgr.obj \ - $(SLO)$/basicmanagerrepository.obj + $(SLO)$/basicmanagerrepository.obj \ + $(SLO)$/vbahelper.obj # --- Targets ------------------------------------------------------------- diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 30e01892fab9..87c26805b18f 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -55,8 +55,12 @@ #include "sb.hrc" #include #include +#include #include +#include +#include #include "errobject.hxx" +#include #include #include @@ -80,6 +84,143 @@ using com::sun::star::lang::XMultiServiceFactory; const static String aThisComponent( RTL_CONSTASCII_USTRINGPARAM("ThisComponent") ); const static String aVBAHook( RTL_CONSTASCII_USTRINGPARAM( "VBAGlobals" ) ); +// ============================================================================ + +class DocBasicItem : public ::cppu::WeakImplHelper1< util::XCloseListener > +{ +public: + explicit DocBasicItem( StarBASIC& rDocBasic ); + virtual ~DocBasicItem(); + + inline const SbxObjectRef& getClassModules() const { return mxClassModules; } + inline bool isDocClosed() const { return mbDocClosed; } + + void clearDependingVarsOnDelete( StarBASIC& rDeletedBasic ); + + void startListening(); + void stopListening(); + + virtual void SAL_CALL queryClosing( const lang::EventObject& rSource, sal_Bool bGetsOwnership ) throw (util::CloseVetoException, uno::RuntimeException); + virtual void SAL_CALL notifyClosing( const lang::EventObject& rSource ) throw (uno::RuntimeException); + virtual void SAL_CALL disposing( const lang::EventObject& rSource ) throw (uno::RuntimeException); + +private: + StarBASIC& mrDocBasic; + SbxObjectRef mxClassModules; + bool mbDocClosed; + bool mbDisposed; +}; + +// ---------------------------------------------------------------------------- + +DocBasicItem::DocBasicItem( StarBASIC& rDocBasic ) : + mrDocBasic( rDocBasic ), + mxClassModules( new SbxObject( String() ) ), + mbDocClosed( false ), + mbDisposed( false ) +{ +} + +DocBasicItem::~DocBasicItem() +{ + stopListening(); +} + +void DocBasicItem::clearDependingVarsOnDelete( StarBASIC& rDeletedBasic ) +{ + mrDocBasic.implClearDependingVarsOnDelete( &rDeletedBasic ); +} + +void DocBasicItem::startListening() +{ + Any aThisComp; + mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp ); + Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY ); + if( xCloseBC.is() ) + try { xCloseBC->addCloseListener( this ); } catch( uno::Exception& ) {} +} + +void DocBasicItem::stopListening() +{ + if( mbDisposed ) return; + mbDisposed = true; + Any aThisComp; + mrDocBasic.GetUNOConstant( "ThisComponent", aThisComp ); + Reference< util::XCloseBroadcaster > xCloseBC( aThisComp, UNO_QUERY ); + if( xCloseBC.is() ) + try { xCloseBC->removeCloseListener( this ); } catch( uno::Exception& ) {} +} + +void SAL_CALL DocBasicItem::queryClosing( const lang::EventObject& /*rSource*/, sal_Bool /*bGetsOwnership*/ ) throw (util::CloseVetoException, uno::RuntimeException) +{ +} + +void SAL_CALL DocBasicItem::notifyClosing( const lang::EventObject& /*rEvent*/ ) throw (uno::RuntimeException) +{ + stopListening(); + mbDocClosed = true; +} + +void SAL_CALL DocBasicItem::disposing( const lang::EventObject& /*rEvent*/ ) throw (uno::RuntimeException) +{ + stopListening(); +} + +// ---------------------------------------------------------------------------- + +namespace { + +typedef ::rtl::Reference< DocBasicItem > DocBasicItemRef; +typedef std::map< const StarBASIC*, DocBasicItemRef > DocBasicItemMap; +static DocBasicItemMap GaDocBasicItems; + +const DocBasicItem* lclFindDocBasicItem( const StarBASIC* pDocBasic ) +{ + DocBasicItemMap::iterator it = GaDocBasicItems.find( pDocBasic ); + return (it != GaDocBasicItems.end()) ? it->second.get() : 0; +} + +void lclInsertDocBasicItem( StarBASIC& rDocBasic ) +{ + DocBasicItemRef& rxDocBasicItem = GaDocBasicItems[ &rDocBasic ]; + rxDocBasicItem.set( new DocBasicItem( rDocBasic ) ); + rxDocBasicItem->startListening(); +} + +void lclRemoveDocBasicItem( StarBASIC& rDocBasic ) +{ + DocBasicItemMap::iterator it = GaDocBasicItems.find( &rDocBasic ); + if( it != GaDocBasicItems.end() ) + { + it->second->stopListening(); + GaDocBasicItems.erase( it ); + } + DocBasicItemMap::iterator it_end = GaDocBasicItems.end(); + for( it = GaDocBasicItems.begin(); it != it_end; ++it ) + it->second->clearDependingVarsOnDelete( rDocBasic ); +} + +StarBASIC* lclGetDocBasicForModule( SbModule* pModule ) +{ + StarBASIC* pRetBasic = NULL; + SbxObject* pCurParent = pModule; + while( pCurParent->GetParent() != NULL ) + { + pCurParent = pCurParent->GetParent(); + StarBASIC* pDocBasic = PTR_CAST( StarBASIC, pCurParent ); + if( pDocBasic != NULL && pDocBasic->IsDocBasic() ) + { + pRetBasic = pDocBasic; + break; + } + } + return pRetBasic; +} + +} // namespace + +// ============================================================================ + SbxObject* StarBASIC::getVBAGlobals( ) { if ( !pVBAGlobals ) @@ -461,6 +602,7 @@ SbxObject* createUserTypeImpl( const String& rClassName ) return pRetObj; } + TYPEINIT1(SbClassModuleObject,SbModule) SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) @@ -610,8 +752,12 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule ) SbClassModuleObject::~SbClassModuleObject() { + // do not trigger termination event when document is already closed if( StarBASIC::IsRunning() ) - triggerTerminateEvent(); + if( StarBASIC* pDocBasic = lclGetDocBasicForModule( this ) ) + if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) ) + if( !pDocBasicItem->isDocClosed() ) + triggerTerminateEvent(); // Must be deleted by base class dtor because this data // is not owned by the SbClassModuleObject object @@ -699,8 +845,14 @@ SbClassFactory::~SbClassFactory() void SbClassFactory::AddClassModule( SbModule* pClassModule ) { + SbxObjectRef xToUseClassModules = xClassModules; + + if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pClassModule ) ) + if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) ) + xToUseClassModules = pDocBasicItem->getClassModules(); + SbxObject* pParent = pClassModule->GetParent(); - xClassModules->Insert( pClassModule ); + xToUseClassModules->Insert( pClassModule ); pClassModule->SetParent( pParent ); } @@ -717,12 +869,19 @@ SbxBase* SbClassFactory::Create( UINT16, UINT32 ) SbxObject* SbClassFactory::CreateObject( const String& rClassName ) { - SbxVariable* pVar = xClassModules->Find( rClassName, SbxCLASS_DONTCARE ); + SbxObjectRef xToUseClassModules = xClassModules; + + if( SbModule* pMod = pMOD ) + if( StarBASIC* pDocBasic = lclGetDocBasicForModule( pMod ) ) + if( const DocBasicItem* pDocBasicItem = lclFindDocBasicItem( pDocBasic ) ) + xToUseClassModules = pDocBasicItem->getClassModules(); + + SbxVariable* pVar = xToUseClassModules->Find( rClassName, SbxCLASS_OBJECT ); SbxObject* pRet = NULL; if( pVar ) { - SbModule* pMod = (SbModule*)pVar; - pRet = new SbClassModuleObject( pMod ); + SbModule* pVarMod = (SbModule*)pVar; + pRet = new SbClassModuleObject( pVarMod ); } return pRet; } @@ -734,9 +893,6 @@ SbModule* SbClassFactory::FindClass( const String& rClassName ) return pMod; } -typedef std::vector< StarBASIC* > DocBasicVector; -static DocBasicVector GaDocBasics; - StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) : SbxObject( String( RTL_CONSTASCII_USTRINGPARAM("StarBASIC") ) ), bDocBasic( bIsDocBasic ) { @@ -768,7 +924,7 @@ StarBASIC::StarBASIC( StarBASIC* p, BOOL bIsDocBasic ) bQuit = FALSE; if( bDocBasic ) - GaDocBasics.push_back( this ); + lclInsertDocBasicItem( *this ); } // #51727 Override SetModified so that the modified state @@ -780,6 +936,9 @@ void StarBASIC::SetModified( BOOL b ) StarBASIC::~StarBASIC() { + // Needs to be first action as it can trigger events + disposeComVariablesForBasic( this ); + if( !--GetSbData()->nInst ) { RemoveFactory( pSBFAC ); @@ -812,20 +971,7 @@ StarBASIC::~StarBASIC() { SbxError eOld = SbxBase::GetError(); - DocBasicVector::iterator it; - for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it ) - { - if( *it == this ) - { - GaDocBasics.erase( it ); - break; - } - } - for( it = GaDocBasics.begin() ; it != GaDocBasics.end() ; ++it ) - { - StarBASIC* pBasic = *it; - pBasic->implClearDependingVarsOnDelete( this ); - } + lclRemoveDocBasicItem( *this ); SbxBase::ResetError(); if( eOld != SbxERR_OK ) @@ -845,7 +991,6 @@ StarBASIC::~StarBASIC() } clearUnoMethodsForBasic( this ); - disposeComVariablesForBasic( this ); } // Override new() operator, so that everyone can create a new instance diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 0f807db7cf8f..541f3d8d6c82 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -54,11 +54,15 @@ #include #include #include -#include +#include +#include +#include #include #include #include #include +#include +#include using namespace com::sun::star; @@ -496,24 +500,18 @@ IMPL_LINK( AsyncQuitHandler, OnAsyncQuit, void*, /*pNull*/ ) return 0L; } -bool VBAUnlockControllers( StarBASIC* pBasic ) +void VBAUnlockDocuments( StarBASIC* pBasic ) { - bool bRes = false; if ( pBasic && pBasic->IsDocBasic() ) { SbUnoObject* pGlobs = dynamic_cast< SbUnoObject* >( pBasic->Find( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ThisComponent" ) ), SbxCLASS_DONTCARE ) ); - if ( pGlobs ) try - { - uno::Reference< frame::XModel > xModel( pGlobs->getUnoAny(), uno::UNO_QUERY_THROW ); - if ( xModel->hasControllersLocked() ) - xModel->unlockControllers(); - bRes = true; - } - catch( uno::Exception& ) + if ( pGlobs ) { + uno::Reference< frame::XModel > xModel( pGlobs->getUnoAny(), uno::UNO_QUERY ); + ::basic::vba::lockControllersOfAllDocuments( xModel, sal_False ); + ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, sal_True ); } } - return bRes; } ///////////////////////////////////////////////////////////////////////////// @@ -1182,7 +1180,7 @@ USHORT SbModule::Run( SbMethod* pMeth ) // VBA always ensures screenupdating is enabled after completing if ( mbVBACompat ) - VBAUnlockControllers( PTR_CAST( StarBASIC, GetParent() ) ); + VBAUnlockDocuments( PTR_CAST( StarBASIC, GetParent() ) ); #ifdef DBG_TRACE_BASIC dbg_DeInitTrace(); @@ -2162,22 +2160,27 @@ void SbObjModule::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType, } -typedef ::cppu::WeakImplHelper2< awt::XTopWindowListener, awt::XWindowListener > FormObjEventListener_BASE; +typedef ::cppu::WeakImplHelper3< + awt::XTopWindowListener, + awt::XWindowListener, + document::XEventListener > FormObjEventListener_BASE; class FormObjEventListenerImpl : public FormObjEventListener_BASE { SbUserFormModule* mpUserForm; uno::Reference< lang::XComponent > mxComponent; + uno::Reference< frame::XModel > mxModel; bool mbDisposed; sal_Bool mbOpened; sal_Bool mbActivated; sal_Bool mbShowing; - FormObjEventListenerImpl(); // not defined + FormObjEventListenerImpl(const FormObjEventListenerImpl&); // not defined + FormObjEventListenerImpl& operator=(const FormObjEventListenerImpl&); // not defined public: - FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent ) : - mpUserForm( pUserForm ), mxComponent( xComponent) , + FormObjEventListenerImpl( SbUserFormModule* pUserForm, const uno::Reference< lang::XComponent >& xComponent, const uno::Reference< frame::XModel >& xModel ) : + mpUserForm( pUserForm ), mxComponent( xComponent), mxModel( xModel ), mbDisposed( false ), mbOpened( sal_False ), mbActivated( sal_False ), mbShowing( sal_False ) { if ( mxComponent.is() ) @@ -2194,6 +2197,15 @@ public: } catch( uno::Exception& ) {} } + + if ( mxModel.is() ) + { + try + { + uno::Reference< document::XEventBroadcaster >( mxModel, uno::UNO_QUERY_THROW )->addEventListener( this ); + } + catch( uno::Exception& ) {} + } } virtual ~FormObjEventListenerImpl() @@ -2220,6 +2232,16 @@ public: catch( uno::Exception& ) {} } mxComponent.clear(); + + if ( mxModel.is() && !mbDisposed ) + { + try + { + uno::Reference< document::XEventBroadcaster >( mxModel, uno::UNO_QUERY_THROW )->removeEventListener( this ); + } + catch( uno::Exception& ) {} + } + mxModel.clear(); } virtual void SAL_CALL windowOpened( const lang::EventObject& /*e*/ ) throw (uno::RuntimeException) @@ -2327,13 +2349,25 @@ public: { } + virtual void SAL_CALL notifyEvent( const document::EventObject& rEvent ) throw (uno::RuntimeException) + { + // early dosposing on document event "OnUnload", to be sure Basic still exists when calling VBA "UserForm_Terminate" + if( rEvent.EventName == GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ) ) + { + removeListener(); + mbDisposed = true; + if ( mpUserForm ) + mpUserForm->ResetApiObj(); // will trigger "UserForm_Terminate" + } + } + virtual void SAL_CALL disposing( const lang::EventObject& /*Source*/ ) throw (uno::RuntimeException) { OSL_TRACE("** Userform/Dialog disposing"); + removeListener(); mbDisposed = true; - mxComponent.clear(); if ( mpUserForm ) - mpUserForm->ResetApiObj(); + mpUserForm->ResetApiObj( false ); // pass false (too late to trigger VBA events here) } }; @@ -2567,30 +2601,27 @@ void SbUserFormModule::InitObject() aArgs[ 2 ] <<= m_xModel; aArgs[ 3 ] <<= rtl::OUString( GetParent()->GetName() ); pDocObject = new SbUnoObject( GetName(), uno::makeAny( xVBAFactory->createInstanceWithArguments( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.UserForm")), aArgs ) ) ); - uno::Reference< lang::XComponent > xComponent( aArgs[ 1 ], uno::UNO_QUERY_THROW ); + + uno::Reference< lang::XComponent > xComponent( m_xDialog, uno::UNO_QUERY_THROW ); // the dialog must be disposed at the end! - if( xComponent.is() ) + StarBASIC* pParentBasic = NULL; + SbxObject* pCurObject = this; + do { - StarBASIC* pParentBasic = NULL; - SbxObject* pCurObject = this; - do - { - SbxObject* pObjParent = pCurObject->GetParent(); - pParentBasic = PTR_CAST( StarBASIC, pObjParent ); - pCurObject = pObjParent; - } - while( pParentBasic == NULL && pCurObject != NULL ); - - OSL_ASSERT( pParentBasic != NULL ); - registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); + SbxObject* pObjParent = pCurObject->GetParent(); + pParentBasic = PTR_CAST( StarBASIC, pObjParent ); + pCurObject = pObjParent; } + while( pParentBasic == NULL && pCurObject != NULL ); + OSL_ASSERT( pParentBasic != NULL ); + registerComponentToBeDisposedForBasic( xComponent, pParentBasic ); - // remove old listener if it exists - if ( m_DialogListener.get() ) + // if old listener object exists, remove it from dialog and document model + if( m_DialogListener.is() ) m_DialogListener->removeListener(); - m_DialogListener = new FormObjEventListenerImpl( this, xComponent ); + m_DialogListener.set( new FormObjEventListenerImpl( this, xComponent, m_xModel ) ); triggerInitializeEvent(); } diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx index 26c6af53cc56..4b917e61e179 100644 --- a/basic/source/comp/scanner.cxx +++ b/basic/source/comp/scanner.cxx @@ -152,6 +152,16 @@ static SbxDataType GetSuffixType( sal_Unicode c ) // Returnwert ist FALSE bei EOF oder Fehlern #define BUF_SIZE 80 +namespace { + +/** Returns true, if the passed character is a white space character. */ +inline bool lclIsWhitespace( sal_Unicode cChar ) +{ + return (cChar == ' ') || (cChar == '\t') || (cChar == '\f'); +} + +} // namespace + BOOL SbiScanner::NextSym() { // Fuer den EOLN-Fall merken @@ -177,7 +187,11 @@ BOOL SbiScanner::NextSym() p2 += n; while( ( n < nLen ) && ( *p2 != '\n' ) && ( *p2 != '\r' ) ) p2++, n++; - aLine = aBuf.copy( nBufPos, n - nBufPos ); + // #163944# ignore trailing whitespace + sal_Int32 nCopyEndPos = n; + while( (nBufPos < nCopyEndPos) && lclIsWhitespace( aBuf[ nCopyEndPos - 1 ] ) ) + --nCopyEndPos; + aLine = aBuf.copy( nBufPos, nCopyEndPos - nBufPos ); if( n < nLen ) { if( *p2 == '\r' && *( p2+1 ) == '\n' ) @@ -193,7 +207,7 @@ BOOL SbiScanner::NextSym() } // Leerstellen weg: - while( *pLine && (( *pLine == ' ' ) || ( *pLine == '\t' ) || ( *pLine == '\f' )) ) + while( lclIsWhitespace( *pLine ) ) pLine++, nCol++, bSpaces = TRUE; nCol1 = nCol; @@ -230,7 +244,7 @@ BOOL SbiScanner::NextSym() { const sal_Unicode* pTestLine = pLine; short nTestCol = nCol; - while( *pTestLine && (( *pTestLine == ' ' ) || ( *pTestLine == '\t' )) ) + while( lclIsWhitespace( *pTestLine ) ) { pTestLine++; nTestCol++; diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx index 46aa1ae69ec3..5bd774d618d5 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.cxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.cxx @@ -27,14 +27,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_ucb.hxx" + /************************************************************************** TODO ************************************************************************** - - filter unwanted models notified by global document event broadcaster - - help documents - - others, which I don't know yet - *************************************************************************/ #include "osl/diagnose.h" @@ -44,12 +41,13 @@ #include "comphelper/namedvaluecollection.hxx" #include "comphelper/documentinfo.hxx" +#include "com/sun/star/awt/XTopWindow.hpp" #include "com/sun/star/beans/XPropertySet.hpp" #include "com/sun/star/container/XEnumerationAccess.hpp" +#include "com/sun/star/document/XStorageBasedDocument.hpp" #include "com/sun/star/frame/XStorable.hpp" #include "com/sun/star/lang/DisposedException.hpp" -#include "com/sun/star/document/XStorageBasedDocument.hpp" -#include "com/sun/star/awt/XTopWindow.hpp" +#include "com/sun/star/util/XCloseBroadcaster.hpp" #include "tdoc_docmgr.hxx" @@ -57,6 +55,53 @@ using namespace com::sun::star; using namespace tdoc_ucp; using ::comphelper::DocumentInfo; +//========================================================================= +//========================================================================= +// +// OfficeDocumentsCloseListener Implementation. +// +//========================================================================= +//========================================================================= + +//========================================================================= +// +// util::XCloseListener +// +//========================================================================= + +// virtual +void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::queryClosing( + const lang::EventObject& /*Source*/, sal_Bool /*GetsOwnership*/ ) + throw ( util::CloseVetoException, + uno::RuntimeException ) +{ +} + +//========================================================================= +void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::notifyClosing( + const lang::EventObject& Source ) + throw ( uno::RuntimeException ) +{ + document::EventObject aDocEvent; + aDocEvent.Source = Source.Source; + aDocEvent.EventName = rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) ); + m_pManager->notifyEvent( aDocEvent ); +} + +//========================================================================= +// +// lang::XEventListener (base of util::XCloseListener) +// +//========================================================================= + +// virtual +void SAL_CALL OfficeDocumentsManager::OfficeDocumentsCloseListener::disposing( + const lang::EventObject& /*Source*/ ) + throw ( uno::RuntimeException ) +{ +} + //========================================================================= //========================================================================= // @@ -70,7 +115,8 @@ OfficeDocumentsManager::OfficeDocumentsManager( OfficeDocumentsEventListener * pDocEventListener ) : m_xSMgr( xSMgr ), m_xDocEvtNotifier( createDocumentEventNotifier( xSMgr ) ), - m_pDocEventListener( pDocEventListener ) + m_pDocEventListener( pDocEventListener ), + m_xDocCloseListener( new OfficeDocumentsCloseListener( this ) ) { if ( m_xDocEvtNotifier.is() ) { @@ -188,10 +234,19 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( OSL_ENSURE( xStorage.is(), "Got no document storage!" ); rtl:: OUString aDocId = getDocumentId( Event.Source ); - rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); + rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( + uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); m_aDocs[ aDocId ] = StorageInfo( aTitle, xStorage, xModel ); + uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( + Event.Source, uno::UNO_QUERY ); + OSL_ENSURE( xCloseBroadcaster.is(), + "OnLoadFinished/OnCreate event: got no close broadcaster!" ); + + if ( xCloseBroadcaster.is() ) + xCloseBroadcaster->addCloseListener( m_xDocCloseListener ); + // Propagate document closure. OSL_ENSURE( m_pDocEventListener, "OnLoadFinished/OnCreate event: no owner for insert event propagation!" ); @@ -202,12 +257,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( } } else if ( Event.EventName.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM( "OnUnload" ) ) ) + RTL_CONSTASCII_STRINGPARAM( "OfficeDocumentsListener::notifyClosing" ) ) ) { if ( isOfficeDocument( Event.Source ) ) { // Document has been closed (unloaded) + // #163732# - Official event "OnUnload" does not work here. Event + // gets fired to early. Other OnUnload listeners called after this + // listener may still need TDOC access to the document. Remove the + // document from TDOC docs list on XCloseListener::notifyClosing. + // See OfficeDocumentsManager::OfficeDocumentsListener::notifyClosing. + osl::MutexGuard aGuard( m_aMtx ); uno::Reference< frame::XModel > @@ -228,8 +289,6 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( rtl::OUString aDocId( (*it).first ); m_pDocEventListener->notifyDocumentClosed( aDocId ); } - - break; } ++it; @@ -238,8 +297,18 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( OSL_ENSURE( it != m_aDocs.end(), "OnUnload event notified for unknown document!" ); - if( it != m_aDocs.end() ) + if ( it != m_aDocs.end() ) + { + uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( + Event.Source, uno::UNO_QUERY ); + OSL_ENSURE( xCloseBroadcaster.is(), + "OnUnload event: got no XCloseBroadcaster from XModel" ); + + if ( xCloseBroadcaster.is() ) + xCloseBroadcaster->removeCloseListener( m_xDocCloseListener ); + m_aDocs.erase( it ); + } } } else if ( Event.EventName.equalsAsciiL( @@ -307,7 +376,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( (*it).second.xStorage = xStorage; // Adjust title. - (*it).second.aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); + (*it).second.aTitle = DocumentInfo::getDocumentTitle( xModel ); break; } ++it; @@ -334,7 +403,7 @@ void SAL_CALL OfficeDocumentsManager::notifyEvent( if ( (*it).second.xModel == xModel ) { // Adjust title. - rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( uno::Reference< frame::XModel >( Event.Source, uno::UNO_QUERY ) ); + rtl:: OUString aTitle = DocumentInfo::getDocumentTitle( xModel ); (*it).second.aTitle = aTitle; // Adjust storage. @@ -475,6 +544,14 @@ void OfficeDocumentsManager::buildDocumentsList() m_aDocs[ aDocId ] = StorageInfo( aTitle, xStorage, xModel ); + + uno::Reference< util::XCloseBroadcaster > xCloseBroadcaster( + xModel, uno::UNO_QUERY ); + OSL_ENSURE( xCloseBroadcaster.is(), + "buildDocumentsList: got no close broadcaster!" ); + + if ( xCloseBroadcaster.is() ) + xCloseBroadcaster->addCloseListener( m_xDocCloseListener ); } } } diff --git a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx index 8f8b2fc117f0..b1c0ed41d9d9 100644 --- a/ucb/source/ucp/tdoc/tdoc_docmgr.hxx +++ b/ucb/source/ucp/tdoc/tdoc_docmgr.hxx @@ -39,6 +39,7 @@ #include "com/sun/star/embed/XStorage.hpp" #include "com/sun/star/frame/XModel.hpp" #include "com/sun/star/frame/XModuleManager.hpp" +#include "com/sun/star/util/XCloseListener.hpp" namespace tdoc_ucp { @@ -88,6 +89,33 @@ namespace tdoc_ucp { class OfficeDocumentsManager : public cppu::WeakImplHelper1< com::sun::star::document::XEventListener > { + class OfficeDocumentsCloseListener : + public cppu::WeakImplHelper1< com::sun::star::util::XCloseListener > + + { + public: + OfficeDocumentsCloseListener( OfficeDocumentsManager * pMgr ) + : m_pManager( pMgr ) {}; + + // util::XCloseListener + virtual void SAL_CALL queryClosing( + const ::com::sun::star::lang::EventObject& Source, + ::sal_Bool GetsOwnership ) + throw (::com::sun::star::util::CloseVetoException, + ::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL notifyClosing( + const ::com::sun::star::lang::EventObject& Source ) + throw (::com::sun::star::uno::RuntimeException); + + // lang::XEventListener (base of util::XCloseListener) + virtual void SAL_CALL disposing( + const com::sun::star::lang::EventObject & Source ) + throw ( com::sun::star::uno::RuntimeException ); + private: + OfficeDocumentsManager * m_pManager; + }; + public: OfficeDocumentsManager( const com::sun::star::uno::Reference< @@ -131,7 +159,9 @@ namespace tdoc_ucp { createDocumentEventNotifier( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rXSMgr ); + void buildDocumentsList(); + bool isOfficeDocument( const com::sun::star::uno::Reference< @@ -163,9 +193,11 @@ namespace tdoc_ucp { com::sun::star::uno::Reference< com::sun::star::document::XEventBroadcaster > m_xDocEvtNotifier; com::sun::star::uno::Reference< - com::sun::star::frame::XModuleManager > m_xModuleMgr; + com::sun::star::frame::XModuleManager > m_xModuleMgr; DocumentList m_aDocs; OfficeDocumentsEventListener * m_pDocEventListener; + com::sun::star::uno::Reference< + com::sun::star::util::XCloseListener > m_xDocCloseListener; }; } // namespace tdoc_ucp diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index bddd756f6836..54d280094f2c 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -50,6 +50,7 @@ #include #include #include +#include #include "vbacommandbars.hxx" @@ -200,10 +201,8 @@ void SAL_CALL VbaApplicationBase::setScreenUpdating(sal_Bool bUpdate) throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - if (bUpdate) - xModel->unlockControllers(); - else - xModel->lockControllers(); + // #163808# use helper from module "basic" to lock all documents of this application + ::basic::vba::lockControllersOfAllDocuments( xModel, !bUpdate ); } sal_Bool SAL_CALL @@ -262,10 +261,8 @@ void SAL_CALL VbaApplicationBase::setInteractive( ::sal_Bool bInteractive ) throw (uno::RuntimeException) { uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); - uno::Reference< frame::XFrame > xFrame( xModel->getCurrentController()->getFrame(), uno::UNO_QUERY_THROW ); - uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); - - xWindow->setEnable( bInteractive ); + // #163808# use helper from module "basic" to enable/disable all container windows of all documents of this application + ::basic::vba::enableContainerWindowsOfAllDocuments( xModel, bInteractive ); } sal_Bool SAL_CALL VbaApplicationBase::getVisible() throw (uno::RuntimeException) diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index 0df38b003556..087e7188c8f6 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -86,11 +86,14 @@ VbaDocumentBase::getName() throw (uno::RuntimeException) ::rtl::OUString VbaDocumentBase::getPath() throw (uno::RuntimeException) { - INetURLObject aURL( getModel()->getURL() ); - rtl::OUString sURL( aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ) ); - sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 ); - rtl::OUString sPath; - ::osl::File::getSystemPathFromFileURL( sURL, sPath ); + INetURLObject aURL( getModel()->getURL() ); + rtl::OUString sURL = aURL.GetMainURL( INetURLObject::DECODE_TO_IURI ); + rtl::OUString sPath; + if( sURL.getLength() > 0 ) + { + sURL = sURL.copy( 0, sURL.getLength() - aURL.GetLastName().getLength() - 1 ); + ::osl::File::getSystemPathFromFileURL( sURL, sPath ); + } return sPath; } diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index f2b70ab231c7..b65a58542b92 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -24,7 +24,9 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include + +#include "vbahelper/vbadocumentsbase.hxx" + #include #include #include @@ -49,10 +51,12 @@ #include #include #include -#include #include #include +#include "vbahelper/vbahelper.hxx" +#include "vbahelper/vbaapplicationbase.hxx" + using namespace ::ooo::vba; using namespace ::com::sun::star; @@ -213,8 +217,39 @@ VbaDocumentsBase::VbaDocumentsBase( const uno::Reference< XHelperInterface >& xP { } +namespace { + +void lclSetupComponent( const uno::Reference< lang::XComponent >& rxComponent, sal_Bool bScreenUpdating, sal_Bool bInteractive ) +{ + if( !bScreenUpdating ) try + { + uno::Reference< frame::XModel >( rxComponent, uno::UNO_QUERY_THROW )->lockControllers(); + } + catch( uno::Exception& ) + { + } + + if( !bInteractive ) try + { + uno::Reference< frame::XModel > xModel( rxComponent, uno::UNO_QUERY_THROW ); + uno::Reference< frame::XController > xController( xModel->getCurrentController(), uno::UNO_SET_THROW ); + uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); + uno::Reference< awt::XWindow >( xFrame->getContainerWindow(), uno::UNO_SET_THROW )->setEnable( sal_False ); + } + catch( uno::Exception& ) + { + } +} + +} // namespace + uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) { + // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened) + uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY ); + sal_Bool bScreenUpdating = !xApplication.is() || xApplication->getScreenUpdating(); + sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive(); + uno::Reference< lang::XMultiComponentFactory > xSMgr( mxContext->getServiceManager(), uno::UNO_QUERY_THROW ); @@ -240,6 +275,10 @@ uno::Any VbaDocumentsBase::createDocument() throw (uno::RuntimeException) sURL , rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_blank") ), 0, aMediaDesc.getAsConstPropertyValueList() ); + + // #163808# lock document controllers and container window if specified by application + lclSetupComponent( xComponent, bScreenUpdating, bInteractive ); + return uno::makeAny( xComponent ); } @@ -259,6 +298,11 @@ void VbaDocumentsBase::closeDocuments() throw (uno::RuntimeException) // #TODO# #FIXME# can any of the unused params below be used? uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const uno::Any& ReadOnly, const uno::Sequence< beans::PropertyValue >& rProps ) throw (uno::RuntimeException) { + // #163808# determine state of Application.ScreenUpdating and Application.Interactive symbols (before new document is opened) + uno::Reference< XApplicationBase > xApplication( Application(), uno::UNO_QUERY ); + sal_Bool bScreenUpdating = !xApplication.is() || xApplication->getScreenUpdating(); + sal_Bool bInteractive = !xApplication.is() || xApplication->getInteractive(); + // we need to detect if this is a URL, if not then assume its a file path rtl::OUString aURL; INetURLObject aObj; @@ -282,19 +326,16 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u uno::Sequence< beans::PropertyValue > sProps( rProps ); sProps.realloc( sProps.getLength() + 1 ); sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("MacroExecutionMode") ); - sProps[ sProps.getLength() - 1 ].Value <<= uno::makeAny( document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN ); - - sal_Int32 nIndex = sProps.getLength() - 1; + sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; if ( ReadOnly.hasValue() ) { sal_Bool bIsReadOnly = sal_False; ReadOnly >>= bIsReadOnly; if ( bIsReadOnly ) { - static const rtl::OUString sReadOnly( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); sProps.realloc( sProps.getLength() + 1 ); - sProps[ nIndex ].Name = sReadOnly; - sProps[ nIndex++ ].Value = uno::makeAny( (sal_Bool)sal_True ); + sProps[ sProps.getLength() - 1 ].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ReadOnly") ); + sProps[ sProps.getLength() - 1 ].Value <<= true; } } @@ -302,6 +343,10 @@ uno::Any VbaDocumentsBase::openDocument( const rtl::OUString& rFileName, const u rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("_default") ), frame::FrameSearchFlag::CREATE, sProps); + + // #163808# lock document controllers and container window if specified by application + lclSetupComponent( xComponent, bScreenUpdating, bInteractive ); + return uno::makeAny( xComponent ); } -- cgit v1.2.3 From 2ea89ad160dd6b03bfbbc0758ef95b49a02256ba Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 21 Feb 2011 12:34:10 +0100 Subject: masterfix DEV300: #i10000# added missing file --- basic/inc/basic/vbahelper.hxx | 86 ++++++++++++++++ basic/source/basmgr/makefile.mk | 4 +- basic/source/basmgr/vbahelper.cxx | 212 ++++++++++++++++++++++++++++++++++++++ basic/source/classes/sbxmod.cxx | 2 +- 4 files changed, 301 insertions(+), 3 deletions(-) create mode 100755 basic/inc/basic/vbahelper.hxx create mode 100755 basic/source/basmgr/vbahelper.cxx (limited to 'basic/inc/basic') diff --git a/basic/inc/basic/vbahelper.hxx b/basic/inc/basic/vbahelper.hxx new file mode 100755 index 000000000000..0d99387965fe --- /dev/null +++ b/basic/inc/basic/vbahelper.hxx @@ -0,0 +1,86 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef BASIC_VBAHELPR_HXX +#define BASIC_VBAHELPR_HXX + +#include + +namespace basic { +namespace vba { + +/* This header contains public helper functions for VBA used from this module + and from other VBA implementation modules such as vbahelper. + */ + +// ============================================================================ + +/** Locks or unlocks the controllers of all documents that have the same type + as the specified document. + + First, the global module manager (com.sun.star.frame.ModuleManager) is + asked for the type of the passed model, and all open documents with the + same type will be locked or unlocked. + + @param rxModel + A document model determining the type of the documents to be locked or + unlocked. + + @param bLockControllers + Passing true will lock all controllers, passing false will unlock them. + */ +void lockControllersOfAllDocuments( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, + sal_Bool bLockControllers ); + +// ============================================================================ + +/** Enables or disables the container windows of all controllers of all + documents that have the same type as the specified document. + + First, the global module manager (com.sun.star.frame.ModuleManager) is + asked for the type of the passed model, and the container windows of all + open documents with the same type will be enabled or disabled. + + @param rxModel + A document model determining the type of the documents to be enabled or + disabled. + + @param bEnableWindows + Passing true will enable all container windows of all controllers, + passing false will disable them. + */ +void enableContainerWindowsOfAllDocuments( + const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, + sal_Bool bEnableWindows ); + +// ============================================================================ + +} // namespace vba +} // namespace basic + +#endif diff --git a/basic/source/basmgr/makefile.mk b/basic/source/basmgr/makefile.mk index b4855d5bb950..615a8e8465ef 100644 --- a/basic/source/basmgr/makefile.mk +++ b/basic/source/basmgr/makefile.mk @@ -39,8 +39,8 @@ ENABLE_EXCEPTIONS=TRUE SLOFILES= \ $(SLO)$/basmgr.obj \ - $(SLO)$/basicmanagerrepository.obj -# $(SLO)$/vbahelper.obj + $(SLO)$/basicmanagerrepository.obj\ + $(SLO)$/vbahelper.obj # --- Targets ------------------------------------------------------------- diff --git a/basic/source/basmgr/vbahelper.cxx b/basic/source/basmgr/vbahelper.cxx new file mode 100755 index 000000000000..a09446f2e40b --- /dev/null +++ b/basic/source/basmgr/vbahelper.cxx @@ -0,0 +1,212 @@ +/************************************************************************* + * + * 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 + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_basic.hxx" + +#include "basic/vbahelper.hxx" +#include +#include +#include +#include +#include +#include + +namespace basic { +namespace vba { + +using namespace ::com::sun::star; + +// ============================================================================ + +namespace { + +/** Creates the global module manager needed to identify the type of documents. + */ +uno::Reference< frame::XModuleManager > lclCreateModuleManager() +{ + uno::Reference< frame::XModuleManager > xModuleManager; + try + { + uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW ); + xModuleManager.set( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ) ) ), uno::UNO_QUERY ); + } + catch( uno::Exception& ) + { + } + OSL_ENSURE( xModuleManager.is(), "::basic::vba::lclCreateModuleManager - cannot create module manager" ); + return xModuleManager; +} + +// ---------------------------------------------------------------------------- + +/** Returns the document service name of the specified document. + */ +::rtl::OUString lclIdentifyDocument( const uno::Reference< frame::XModuleManager >& rxModuleManager, const uno::Reference< frame::XModel >& rxModel ) +{ + ::rtl::OUString aServiceName; + if( rxModuleManager.is() ) + { + try + { + aServiceName = rxModuleManager->identify( rxModel ); + } + catch( uno::Exception& ) + { + } + OSL_ENSURE( aServiceName.getLength() > 0, "::basic::vba::lclIdentifyDocument - cannot identify document" ); + } + return aServiceName; +} + +// ---------------------------------------------------------------------------- + +/** Returns an enumeration of all open documents. + */ +uno::Reference< container::XEnumeration > lclCreateDocumentEnumeration() +{ + uno::Reference< container::XEnumeration > xEnumeration; + try + { + uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), uno::UNO_SET_THROW ); + uno::Reference< frame::XDesktop > xDesktop( xFactory->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ) ), uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumerationAccess > xComponentsEA( xDesktop->getComponents(), uno::UNO_SET_THROW ); + xEnumeration = xComponentsEA->createEnumeration(); + + } + catch( uno::Exception& ) + { + } + OSL_ENSURE( xEnumeration.is(), "::basic::vba::lclCreateDocumentEnumeration - cannot create enumeration of all documents" ); + return xEnumeration; +} + +// ---------------------------------------------------------------------------- + +/** Locks or unlocks the controllers of the specified document model. + */ +void lclLockControllers( const uno::Reference< frame::XModel >& rxModel, sal_Bool bLockControllers ) +{ + if( rxModel.is() ) try + { + if( bLockControllers ) + rxModel->lockControllers(); + else + rxModel->unlockControllers(); + } + catch( uno::Exception& ) + { + } +} + +// ---------------------------------------------------------------------------- + +/** Enables or disables the container windows of all controllers of the + specified document model. + */ +void lclEnableContainerWindows( const uno::Reference< frame::XModel >& rxModel, sal_Bool bEnableWindows ) +{ + try + { + uno::Reference< frame::XModel2 > xModel2( rxModel, uno::UNO_QUERY_THROW ); + uno::Reference< container::XEnumeration > xControllersEnum( xModel2->getControllers(), uno::UNO_SET_THROW ); + // iterate over all controllers + while( xControllersEnum->hasMoreElements() ) + { + try + { + uno::Reference< frame::XController > xController( xControllersEnum->nextElement(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XFrame > xFrame( xController->getFrame(), uno::UNO_SET_THROW ); + uno::Reference< awt::XWindow > xWindow( xFrame->getContainerWindow(), uno::UNO_SET_THROW ); + xWindow->setEnable( bEnableWindows ); + } + catch( uno::Exception& ) + { + } + } + } + catch( uno::Exception& ) + { + } +} + +// ---------------------------------------------------------------------------- + +typedef void (*ModifyDocumentFunc)( const uno::Reference< frame::XModel >&, sal_Bool ); + +/** Implementation iterating over all documents that have the same type as the + specified model, and calling the passed functor. + */ +void lclIterateDocuments( ModifyDocumentFunc pModifyDocumentFunc, const uno::Reference< frame::XModel >& rxModel, sal_Bool bModificator ) +{ + uno::Reference< frame::XModuleManager > xModuleManager = lclCreateModuleManager(); + uno::Reference< container::XEnumeration > xDocumentsEnum = lclCreateDocumentEnumeration(); + ::rtl::OUString aIdentifier = lclIdentifyDocument( xModuleManager, rxModel ); + if( xModuleManager.is() && xDocumentsEnum.is() && (aIdentifier.getLength() > 0) ) + { + // iterate over all open documents + while( xDocumentsEnum->hasMoreElements() ) + { + try + { + uno::Reference< frame::XModel > xCurrModel( xDocumentsEnum->nextElement(), uno::UNO_QUERY_THROW ); + ::rtl::OUString aCurrIdentifier = lclIdentifyDocument( xModuleManager, xCurrModel ); + if( aCurrIdentifier == aIdentifier ) + pModifyDocumentFunc( xCurrModel, bModificator ); + } + catch( uno::Exception& ) + { + } + } + } + else + { + // no module manager, no documents enumeration, no identifier -> at least process the passed document + pModifyDocumentFunc( rxModel, bModificator ); + } +} + +} // namespace + +// ============================================================================ + +void lockControllersOfAllDocuments( const uno::Reference< frame::XModel >& rxModel, sal_Bool bLockControllers ) +{ + lclIterateDocuments( &lclLockControllers, rxModel, bLockControllers ); +} + +// ============================================================================ + +void enableContainerWindowsOfAllDocuments( const uno::Reference< frame::XModel >& rxModel, sal_Bool bEnableWindows ) +{ + lclIterateDocuments( &lclEnableContainerWindows, rxModel, bEnableWindows ); +} + +// ============================================================================ + +} // namespace vba +} // namespace basic diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 2cf098655d8f..592d69c514a0 100755 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -54,7 +54,7 @@ #include #include #include -//#include +#include #include #include #include -- cgit v1.2.3