From a381e73c6f0693d2de99a4963343806361a62748 Mon Sep 17 00:00:00 2001 From: "Philipp Lohmann [pl]" Date: Fri, 4 Jun 2010 13:46:22 +0200 Subject: changehid: #i111874# remove SmartId, make HID of type rtl::OString, fill in dummies for all explicit help ids --- dbaccess/source/ui/misc/UITools.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 930dd089951a..4979718ad41f 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1651,7 +1651,8 @@ sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Boo if ( _bAll ) { aAsk.AddButton(String(ModuleRes(STR_BUTTON_TEXT_ALL)), RET_ALL, 0); - aAsk.GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL); + // FIXME: HELPID + aAsk.GetPushButton(RET_ALL)->SetHelpId(""/*HID_CONFIRM_DROP_BUTTON_ALL*/); } return aAsk.Execute(); } -- cgit From d1f6ae4254c5f3b6047551d95fe341ac8d6dd56b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sat, 10 Jul 2010 18:21:24 +0200 Subject: CWS changehid: #i111874#: change code to support HelpIds as byte strings --- dbaccess/source/ui/misc/UITools.cxx | 7 +++---- dbaccess/source/ui/misc/WTypeSelect.cxx | 2 ++ dbaccess/source/ui/misc/WizardPages.src | 3 ++- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 4979718ad41f..9656a9f90d37 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1497,13 +1497,13 @@ namespace } // annonymous // ......................................................................... // ----------------------------------------------------------------------------- -::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const sal_Int32 _nHelpId) +::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName, const rtl::OString& sHelpId) { ::com::sun::star::util::URL aURL; aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.help://" ) ); aURL.Complete += _sModuleName; aURL.Complete += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); - aURL.Complete += ::rtl::OUString::valueOf(_nHelpId); + aURL.Complete += ::rtl::OUString(sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8); ::rtl::OUString sAnchor; ::rtl::OUString sTempURL = aURL.Complete; @@ -1651,8 +1651,7 @@ sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Boo if ( _bAll ) { aAsk.AddButton(String(ModuleRes(STR_BUTTON_TEXT_ALL)), RET_ALL, 0); - // FIXME: HELPID - aAsk.GetPushButton(RET_ALL)->SetHelpId(""/*HID_CONFIRM_DROP_BUTTON_ALL*/); + aAsk.GetPushButton(RET_ALL)->SetHelpId(HID_CONFIRM_DROP_BUTTON_ALL); } return aAsk.Execute(); } diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index f33c82abecb7..fa72a03269cc 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -70,6 +70,8 @@ #include "FieldControls.hxx" #endif +#include "dbaccess_slotid.hrc" + using namespace ::dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src index 9871c3f7d810..624be87c898e 100644 --- a/dbaccess/source/ui/misc/WizardPages.src +++ b/dbaccess/source/ui/misc/WizardPages.src @@ -35,6 +35,7 @@ #include "dbaccess_helpid.hrc" #endif +#include "dbaccess_slotid.hrc" #define WINDOW_SIZE_X 276 #define WINDOW_SIZE_Y 185 @@ -308,7 +309,7 @@ Menu RID_SBA_RTF_PKEYPOPUP MenuItem { Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - HelpID = SID_TABLEDESIGN_TABED_PRIMARYKEY ; + HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ; Checkable = TRUE ; Text [ en-US ] = "Primary Key" ; }; -- cgit From d35a99db3cfc6a13fc36143c26e2d1a95a7ea391 Mon Sep 17 00:00:00 2001 From: Caol?n McNamara Date: Sat, 10 Jul 2010 20:27:12 +0100 Subject: cmcfixes76: #i113071# NULLs that should be sal_False --- dbaccess/source/ui/misc/TokenWriter.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 7c41a0fbfa04..c0c67984f7ca 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -100,7 +100,7 @@ ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& const Reference< XMultiServiceFactory >& _rM, const Reference< ::com::sun::star::util::XNumberFormatter >& _rxNumberF, const String& rExchange) - :m_bBookmarkSelection( NULL ) + :m_bBookmarkSelection(sal_False) ,m_xFormatter(_rxNumberF) ,m_xFactory(_rM) ,m_nCommandType(CommandType::TABLE) @@ -131,7 +131,7 @@ ODatabaseImportExport::ODatabaseImportExport(const ::svx::ODataAccessDescriptor& // import data ODatabaseImportExport::ODatabaseImportExport( const ::dbtools::SharedConnection& _rxConnection, const Reference< XNumberFormatter >& _rxNumberF, const Reference< XMultiServiceFactory >& _rM ) - :m_bBookmarkSelection( NULL ) + :m_bBookmarkSelection(sal_False) ,m_xConnection(_rxConnection) ,m_xFormatter(_rxNumberF) ,m_xFactory(_rM) -- cgit From f45cf6b4635a31861c11b8bc69d39691e27baacf Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 3 Sep 2010 17:53:47 +0200 Subject: dba34a: removed SvLBox'es (and friends) Set/GetWindowBits. They were used in parallel to Window's Set/GetStyle, with WB_* values which overlapped with existing (generic) WB_* bits. Since this overlapping has been removed, there's no need to have both Style and WindowBits at those classes. Should remove some source of confusion and error (and, well, perhaps introduce some new errors :) ). --- dbaccess/source/ui/misc/WNameMatch.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index d54a056f863e..803554a0094f 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -92,8 +92,8 @@ OWizNameMatching::OWizNameMatching( Window* pParent) m_CTRL_RIGHT.SetSelectHdl(LINK(this,OWizNameMatching,TableListRightSelectHdl)); m_CTRL_RIGHT.EnableCheckButton( NULL ); - m_CTRL_LEFT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); - m_CTRL_RIGHT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); + m_CTRL_LEFT.SetStyle( m_CTRL_LEFT.GetStyle() | WB_FORCE_MAKEVISIBLE ); + m_CTRL_RIGHT.SetStyle( m_CTRL_RIGHT.GetStyle() | WB_FORCE_MAKEVISIBLE ); m_sSourceText = m_FT_TABLE_LEFT.GetText(); m_sSourceText.AppendAscii("\n"); @@ -405,7 +405,7 @@ OColumnTreeBox::OColumnTreeBox( Window* pParent, const ResId& rResId ) { SetDragDropMode( 0 ); EnableInplaceEditing( sal_False ); - SetWindowBits(WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); + SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); SetSelectionMode( SINGLE_SELECTION ); } //------------------------------------------------------------------------ -- cgit From 8e88ac109dc9eba88db92940d13933fc3a4393d8 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 10 Sep 2010 13:10:07 +0200 Subject: sb129: #i113189# change UNO components to use passive registration --- dbaccess/source/ui/misc/uiservices.cxx | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/uiservices.cxx b/dbaccess/source/ui/misc/uiservices.cxx index d206e2854da6..0c5a37e31378 100644 --- a/dbaccess/source/ui/misc/uiservices.cxx +++ b/dbaccess/source/ui/misc/uiservices.cxx @@ -124,28 +124,6 @@ extern "C" DBACCESS_DLLPUBLIC void SAL_CALL component_getImplementationEnvironme *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -//--------------------------------------------------------------------------------------- -extern "C" DBACCESS_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - writeDBLoaderInfo(pRegistryKey); - return ::dbaui::OModuleRegistration::writeComponentInfos( - static_cast(pServiceManager), - static_cast(pRegistryKey)); - } - catch (InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - //--------------------------------------------------------------------------------------- extern "C" DBACCESS_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, -- cgit From 06bbadbd5a5c2f22be8cd32a53beaa1f79b6806a Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Fri, 17 Sep 2010 09:08:55 +0200 Subject: dba34a: #i113475# SRB->ORB --- dbaccess/source/ui/misc/dbumiscres.src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src index 552a076147d5..22bc80670cf6 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -96,5 +96,5 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS String RID_STR_EXTENSION_NOT_PRESENT { // #i96130# use hard coded name - Text [ en-US ] = "The report, \"$file$\", requires the extension Sun Report Builder."; + Text [ en-US ] = "The report, \"$file$\", requires the extension Oracle Report Builder."; }; -- cgit From 91ff13dd6a625dcd75e3783474c2bee8b6675304 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Mon, 11 Oct 2010 17:56:12 +0200 Subject: CWS changehid: generate former auto hids into src files --- dbaccess/source/ui/misc/WizardPages.src | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src index 624be87c898e..d9c9772d2a41 100644 --- a/dbaccess/source/ui/misc/WizardPages.src +++ b/dbaccess/source/ui/misc/WizardPages.src @@ -68,6 +68,7 @@ String STR_WIZ_NAME_MATCHING_TITEL ModalDialog WIZ_RTFCOPYTABLE { + HelpID = "dbaccess:ModalDialog:WIZ_RTFCOPYTABLE"; Text [ en-US ] = "Copy RTF Table" ; @@ -92,12 +93,14 @@ ModalDialog WIZ_RTFCOPYTABLE }; PushButton PB_PREV { + HelpID = "dbaccess:PushButton:WIZ_RTFCOPYTABLE:PB_PREV"; TabStop = TRUE ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; Text [ en-US ] = "< ~Back"; }; PushButton PB_NEXT { + HelpID = "dbaccess:PushButton:WIZ_RTFCOPYTABLE:PB_NEXT"; TabStop = TRUE ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; Text [ en-US ] = "~Next>"; @@ -131,6 +134,7 @@ TabPage TAB_WIZ_COLUMN_SELECT MultiListBox LB_ORG_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_COLUMN_SELECT:LB_ORG_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( WINDOW_BORDER_X , WINDOW_BORDER_Y ) ; Size = MAP_APPFONT ( 95 , WINDOW_SIZE_Y - 23 ) ; @@ -143,6 +147,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMN_RH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMN_RH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 25 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -162,6 +167,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMNS_RH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMNS_RH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 45 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE; @@ -182,6 +188,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMN_LH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMN_LH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 65) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -201,6 +208,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMNS_LH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMNS_LH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 85) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -221,6 +229,7 @@ TabPage TAB_WIZ_COLUMN_SELECT MultiListBox LB_NEW_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_COLUMN_SELECT:LB_NEW_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 157, WINDOW_BORDER_Y) ; Size = MAP_APPFONT ( 95 , WINDOW_SIZE_Y - 23 ) ; @@ -246,6 +255,7 @@ TabPage TAB_WIZ_TYPE_SELECT MultiListBox LB_NEW_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_TYPE_SELECT:LB_NEW_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 87 , WINDOW_SIZE_Y - 12 ) ; @@ -265,6 +275,7 @@ TabPage TAB_WIZ_TYPE_SELECT TabPage CONTROL_CONTAINER { + HelpID = "dbaccess:TabPage:CONTROL_CONTAINER"; Pos = MAP_APPFONT ( 102 , WINDOW_BORDER_Y ) ; Size = MAP_APPFONT ( WINDOW_SIZE_X - 111, WINDOW_SIZE_Y - WINDOW_BORDER_Y - 67 ); SVLook = TRUE; @@ -287,6 +298,7 @@ TabPage TAB_WIZ_TYPE_SELECT NumericField ET_AUTO { + HelpID = "dbaccess:NumericField:TAB_WIZ_TYPE_SELECT:ET_AUTO"; Border = TRUE ; Pos = MAP_APPFONT ( 151 , WINDOW_SIZE_Y - WINDOW_BORDER_Y - 29) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -295,6 +307,7 @@ TabPage TAB_WIZ_TYPE_SELECT PushButton PB_AUTO { + HelpID = "dbaccess:PushButton:TAB_WIZ_TYPE_SELECT:PB_AUTO"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 62 , WINDOW_SIZE_Y - WINDOW_BORDER_Y - 30 ) ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; TabStop = TRUE ; @@ -320,6 +333,7 @@ Menu RID_SBA_RTF_PKEYPOPUP //================================================================== TabPage TAB_WIZ_NAME_MATCHING { + HelpID = "dbaccess:TabPage:TAB_WIZ_NAME_MATCHING"; SVLook = TRUE ; Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; @@ -361,6 +375,7 @@ TabPage TAB_WIZ_NAME_MATCHING ImageButton IB_COLUMN_UP { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_UP"; Pos = MAP_APPFONT ( 19 , 45 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -381,6 +396,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_DOWN { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_DOWN"; Pos = MAP_APPFONT ( 19 , 63 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -400,6 +416,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_UP_RIGHT { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_UP_RIGHT"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 33, 45 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -420,6 +437,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_DOWN_RIGHT { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_DOWN_RIGHT"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 33, 63) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -440,6 +458,7 @@ TabPage TAB_WIZ_NAME_MATCHING PushButton PB_ALL { + HelpID = "dbaccess:PushButton:TAB_WIZ_NAME_MATCHING:PB_ALL"; Pos = MAP_APPFONT ( 6, 83) ; Size = MAP_APPFONT ( 40 , 14 ) ; TabStop = TRUE ; @@ -448,6 +467,7 @@ TabPage TAB_WIZ_NAME_MATCHING PushButton PB_NONE { + HelpID = "dbaccess:PushButton:TAB_WIZ_NAME_MATCHING:PB_NONE"; Pos = MAP_APPFONT ( 6, 103) ; Size = MAP_APPFONT ( 40 , 14 ) ; TabStop = TRUE ; @@ -486,12 +506,14 @@ TabPage TAB_WIZ_COPYTABLE }; RadioButton RB_DEFDATA { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_DEFDATA"; Pos = MAP_APPFONT ( 12 , 35 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "De~finition and data" ; }; RadioButton RB_DEF { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_DEF"; Pos = MAP_APPFONT ( 12, 49 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "Def~inition" ; @@ -499,6 +521,7 @@ TabPage TAB_WIZ_COPYTABLE RadioButton RB_VIEW { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_VIEW"; Pos = MAP_APPFONT ( 12, 63 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "A~s table view"; @@ -506,6 +529,7 @@ TabPage TAB_WIZ_COPYTABLE RadioButton RB_APPENDDATA { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_APPENDDATA"; Pos = MAP_APPFONT ( 12, 77 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "Append ~data" ; @@ -513,6 +537,7 @@ TabPage TAB_WIZ_COPYTABLE CheckBox CB_USEHEADERLINE { + HelpID = "dbaccess:CheckBox:TAB_WIZ_COPYTABLE:CB_USEHEADERLINE"; Pos = MAP_APPFONT ( 12, 93 ) ; Size = MAP_APPFONT ( WINDOW_SIZE_X - 18, 10 ) ; Text [ en-US ] = "Use first ~line as column names" ; @@ -520,6 +545,7 @@ TabPage TAB_WIZ_COPYTABLE CheckBox CB_PRIMARY_COLUMN { + HelpID = "dbaccess:CheckBox:TAB_WIZ_COPYTABLE:CB_PRIMARY_COLUMN"; Pos = MAP_APPFONT ( 12, 107 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Crea~te primary key"; @@ -533,6 +559,7 @@ TabPage TAB_WIZ_COPYTABLE Edit ET_KEYNAME { + HelpID = "dbaccess:Edit:TAB_WIZ_COPYTABLE:ET_KEYNAME"; Pos = MAP_APPFONT ( 80, 120 ) ; Size = MAP_APPFONT ( 65 , 12 ) ; TabStop = TRUE ; -- cgit From d5ff5c6f6810ed06b054d105416908f5a5028922 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Mon, 1 Nov 2010 15:32:54 +0100 Subject: undoapi: moved the last remaining method of SfxMacroConfig (::Call) into the SfxApplication, and got rid of the class completely --- dbaccess/source/ui/misc/linkeddocuments.cxx | 3 --- 1 file changed, 3 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 4d3472e623b7..553050f961e9 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -114,9 +114,6 @@ #ifndef _SB_SBUNO_HXX #include #endif -#ifndef _SFX_MACROCONF_HXX -#include -#endif #ifndef _EHDL_HXX #include #endif -- cgit From 784ea715b333655894b2702d721fd119f81bd394 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 17 Nov 2010 09:11:03 +0100 Subject: undoapi: carry the SfxUndoManager around as &, not as * --- dbaccess/source/ui/misc/singledoccontroller.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 87ddfa1f197b..48c83609d7af 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -530,9 +530,9 @@ namespace dbaui InvalidateFeature(_nId); } // ----------------------------------------------------------------------------- - SfxUndoManager* OSingleDocumentController::getUndoMgr() + SfxUndoManager& OSingleDocumentController::GetUndoManager() { - return &m_aUndoManager; + return m_aUndoManager; } // ----------------------------------------------------------------------------- void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) -- cgit From 39a689148061da7eeb5348abba6c064b6111f1a8 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 17 Nov 2010 10:44:38 +0100 Subject: undoapi: implement XUndoManager/Supplier for Base sub components --- dbaccess/source/ui/misc/dbaundomanager.cxx | 395 ++++++++++++++++++++++++ dbaccess/source/ui/misc/dbaundomanager.hxx | 101 ++++++ dbaccess/source/ui/misc/makefile.mk | 74 ++--- dbaccess/source/ui/misc/singledoccontroller.cxx | 39 ++- 4 files changed, 560 insertions(+), 49 deletions(-) create mode 100755 dbaccess/source/ui/misc/dbaundomanager.cxx create mode 100755 dbaccess/source/ui/misc/dbaundomanager.hxx (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/dbaundomanager.cxx b/dbaccess/source/ui/misc/dbaundomanager.cxx new file mode 100755 index 000000000000..1e60a027a693 --- /dev/null +++ b/dbaccess/source/ui/misc/dbaundomanager.cxx @@ -0,0 +1,395 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_dbaccess.hxx" + +#include "dbaundomanager.hxx" + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::document::XUndoManager; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::document::UndoContextNotClosedException; + using ::com::sun::star::document::UndoFailedException; + using ::com::sun::star::document::EmptyUndoStackException; + using ::com::sun::star::util::InvalidStateException; + using ::com::sun::star::document::XUndoAction; + using ::com::sun::star::lang::IllegalArgumentException; + using ::com::sun::star::document::XUndoManagerListener; + using ::com::sun::star::util::NotLockedException; + using ::com::sun::star::lang::NoSupportException; + /** === end UNO using === **/ + + //================================================================================================================== + //= UndoManager_Impl + //================================================================================================================== + struct UndoManager_Impl : public ::framework::IUndoManagerImplementation + { + UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :rAntiImpl( i_antiImpl ) + ,rParent( i_parent ) + ,rMutex( i_mutex ) + ,bDisposed( false ) + ,aUndoManager() + ,aUndoHelper( *this ) + { + } + + virtual ~UndoManager_Impl() + { + } + + UndoManager& rAntiImpl; + ::cppu::OWeakObject& rParent; + ::osl::Mutex& rMutex; + bool bDisposed; + SfxUndoManager aUndoManager; + ::framework::UndoManagerHelper aUndoHelper; + + // IUndoManagerImplementation + virtual ::svl::IUndoManager& getImplUndoManager(); + virtual Reference< XUndoManager > getThis(); + }; + + //------------------------------------------------------------------------------------------------------------------ + ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager() + { + return aUndoManager; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XUndoManager > UndoManager_Impl::getThis() + { + return static_cast< XUndoManager* >( &rAntiImpl ); + } + + //============================================================================================================== + //= OslMutexFacade + //============================================================================================================== + class OslMutexFacade : public ::framework::IMutex + { + public: + OslMutexFacade( ::osl::Mutex& i_mutex ) + :m_rMutex( i_mutex ) + { + } + + virtual void acquire(); + virtual void release(); + + private: + ::osl::Mutex& m_rMutex; + }; + + //-------------------------------------------------------------------------------------------------------------- + void OslMutexFacade::acquire() + { + m_rMutex.acquire(); + } + + //-------------------------------------------------------------------------------------------------------------- + void OslMutexFacade::release() + { + m_rMutex.release(); + } + + //============================================================================================================== + //= UndoManagerMethodGuard + //============================================================================================================== + /** guard for public UNO methods of the UndoManager + */ + class UndoManagerMethodGuard : public ::framework::IMutexGuard + { + public: + UndoManagerMethodGuard( UndoManager_Impl& i_impl ) + :m_aGuard( i_impl.rMutex ) + ,m_aMutexFacade( i_impl.rMutex ) + { + // throw if the instance is already disposed + if ( i_impl.bDisposed ) + throw DisposedException( ::rtl::OUString(), i_impl.getThis() ); + } + virtual ~UndoManagerMethodGuard() + { + } + + // IMutexGuard + virtual ::framework::IMutex& getGuardedMutex(); + + // IGuard + virtual void clear(); + virtual void reset(); + + private: + ::osl::ResettableMutexGuard m_aGuard; + OslMutexFacade m_aMutexFacade; + }; + + //-------------------------------------------------------------------------------------------------------------- + ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex() + { + return m_aMutexFacade; + } + + //-------------------------------------------------------------------------------------------------------------- + void UndoManagerMethodGuard::clear() + { + m_aGuard.clear(); + } + + //-------------------------------------------------------------------------------------------------------------- + void UndoManagerMethodGuard::reset() + { + m_aGuard.reset(); + } + + //================================================================================================================== + //= UndoManager + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :m_pImpl( new UndoManager_Impl( *this, i_parent, i_mutex ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + UndoManager::~UndoManager() + { + } + + //------------------------------------------------------------------------------------------------------------------ + SfxUndoManager& UndoManager::GetSfxUndoManager() const + { + return m_pImpl->aUndoManager; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::acquire( ) throw () + { + m_pImpl->rParent.acquire(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::release( ) throw () + { + m_pImpl->rParent.release(); + } + + //------------------------------------------------------------------------------------------------------------------ + void UndoManager::disposing() + { + { + ::osl::MutexGuard aGuard( m_pImpl->rMutex ); + m_pImpl->bDisposed = true; + } + m_pImpl->aUndoHelper.disposing(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.enterUndoContext( i_title, aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.enterHiddenUndoContext( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.leaveUndoContext( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.addUndoAction( i_action, aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + // (all our UndoActions work directly on VCL code, usually, so ...) + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.undo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException) + { + ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); + // (all our UndoActions work directly on VCL code, usually, so ...) + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.redo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isUndoPossible( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isUndoPossible(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isRedoPossible( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isRedoPossible(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getCurrentUndoActionTitle(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getCurrentRedoActionTitle(); + } + + //------------------------------------------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getAllUndoActionTitles(); + } + + //------------------------------------------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getAllRedoActionTitles(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.clear( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.clearRedo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::reset( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.reset( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.addUndoManagerListener( i_listener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.removeUndoManagerListener( i_listener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::lock( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.lock(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::unlock( ) throw (NotLockedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.unlock(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isLocked( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isLocked(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XInterface > SAL_CALL UndoManager::getParent( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return *&m_pImpl->rParent; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException) + { + (void)i_parent; + throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() ); + } + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... diff --git a/dbaccess/source/ui/misc/dbaundomanager.hxx b/dbaccess/source/ui/misc/dbaundomanager.hxx new file mode 100755 index 000000000000..99ff86cb39bf --- /dev/null +++ b/dbaccess/source/ui/misc/dbaundomanager.hxx @@ -0,0 +1,101 @@ +/************************************************************************* + * 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 DBACCESS_DBAUNDOMANAGER_HXX +#define DBACCESS_DBAUNDOMANAGER_HXX + +/** === begin UNO includes === **/ +#include +/** === end UNO includes === **/ + +#include + +#include + +class SfxUndoManager; + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + //================================================================================================================== + //= UndoManager + //================================================================================================================== + struct UndoManager_Impl; + typedef ::cppu::ImplHelper1< ::com::sun::star::document::XUndoManager > UndoManager_Base; + class UndoManager : public UndoManager_Base + { + public: + UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ); + virtual ~UndoManager(); + + SfxUndoManager& GetSfxUndoManager() const; + + // XInterface + virtual void SAL_CALL acquire( ) throw (); + virtual void SAL_CALL release( ) throw (); + + // XComponent equivalents + void disposing(); + + // XUndoManager + virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); + + // XLockable (base of XUndoManager) + virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException); + + // XChild (base of XUndoManager) + virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + private: + ::boost::scoped_ptr< UndoManager_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... + +#endif // DBACCESS_DBAUNDOMANAGER_HXX diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 7f9bbed56023..62276292224e 100644 --- a/dbaccess/source/ui/misc/makefile.mk +++ b/dbaccess/source/ui/misc/makefile.mk @@ -25,8 +25,8 @@ # #************************************************************************* -PRJ=..$/..$/.. -PRJINC=$(PRJ)$/source +PRJ=../../.. +PRJINC=$(PRJ)/source PRJNAME=dbaccess TARGET=uimisc @@ -35,50 +35,52 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- .INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk +.INCLUDE : $(PRJ)/util/makefile.pmk # --- Files ------------------------------------- # ... resource files ............................ SRS1NAME=$(TARGET) -SRC1FILES = \ - dbumiscres.src \ +SRC1FILES = \ + dbumiscres.src \ WizardPages.src # ... object files ............................ -SLOFILES= \ - $(SLO)$/asyncmodaldialog.obj \ - $(SLO)$/imageprovider.obj \ - $(SLO)$/singledoccontroller.obj \ - $(SLO)$/datasourceconnector.obj \ - $(SLO)$/linkeddocuments.obj \ - $(SLO)$/indexcollection.obj \ - $(SLO)$/UITools.obj \ - $(SLO)$/WCPage.obj \ - $(SLO)$/WCopyTable.obj \ - $(SLO)$/WTypeSelect.obj \ - $(SLO)$/TokenWriter.obj \ - $(SLO)$/HtmlReader.obj \ - $(SLO)$/RtfReader.obj \ - $(SLO)$/propertysetitem.obj \ - $(SLO)$/databaseobjectview.obj \ - $(SLO)$/DExport.obj \ - $(SLO)$/uiservices.obj \ - $(SLO)$/RowSetDrop.obj \ - $(SLO)$/TableCopyHelper.obj \ - $(SLO)$/moduledbu.obj \ - $(SLO)$/WColumnSelect.obj \ - $(SLO)$/WExtendPages.obj \ - $(SLO)$/WNameMatch.obj \ - $(SLO)$/ToolBoxHelper.obj \ - $(SLO)$/stringlistitem.obj \ - $(SLO)$/charsets.obj \ - $(SLO)$/defaultobjectnamecheck.obj \ - $(SLO)$/dsmeta.obj \ - $(SLO)$/controllerframe.obj \ - $(SLO)$/propertystorage.obj +SLOFILES= \ + $(SLO)/asyncmodaldialog.obj \ + $(SLO)/imageprovider.obj \ + $(SLO)/singledoccontroller.obj \ + $(SLO)/datasourceconnector.obj \ + $(SLO)/linkeddocuments.obj \ + $(SLO)/indexcollection.obj \ + $(SLO)/UITools.obj \ + $(SLO)/WCPage.obj \ + $(SLO)/WCopyTable.obj \ + $(SLO)/WTypeSelect.obj \ + $(SLO)/TokenWriter.obj \ + $(SLO)/HtmlReader.obj \ + $(SLO)/RtfReader.obj \ + $(SLO)/propertysetitem.obj \ + $(SLO)/databaseobjectview.obj \ + $(SLO)/DExport.obj \ + $(SLO)/uiservices.obj \ + $(SLO)/RowSetDrop.obj \ + $(SLO)/TableCopyHelper.obj \ + $(SLO)/moduledbu.obj \ + $(SLO)/WColumnSelect.obj \ + $(SLO)/WExtendPages.obj \ + $(SLO)/WNameMatch.obj \ + $(SLO)/ToolBoxHelper.obj \ + $(SLO)/stringlistitem.obj \ + $(SLO)/charsets.obj \ + $(SLO)/defaultobjectnamecheck.obj \ + $(SLO)/dsmeta.obj \ + $(SLO)/controllerframe.obj \ + $(SLO)/propertystorage.obj \ + $(SLO)/dbaundomanager.obj \ + # --- Targets ---------------------------------- .INCLUDE : target.mk diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 48c83609d7af..c074aed76392 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -35,9 +35,10 @@ #include "dbustrings.hrc" #include "moduledbu.hxx" #include "singledoccontroller.hxx" -#include +#include "dbaundomanager.hxx" /** === begin UNO includes === **/ +#include #include #include #include @@ -95,6 +96,7 @@ namespace dbaui using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::frame::XUntitledNumbers; using ::com::sun::star::beans::PropertyVetoException; + using ::com::sun::star::document::XUndoManager; /** === end UNO using === **/ class DataSourceHolder @@ -148,6 +150,8 @@ namespace dbaui SharedConnection m_xConnection; ::dbtools::DatabaseMetaData m_aSdbMetaData; // + ::boost::scoped_ptr< UndoManager > + m_pUndoManager; ::rtl::OUString m_sDataSourceName; // the data source we're working for DataSourceHolder m_aDataSource; Reference< XModel > m_xDocument; @@ -158,9 +162,10 @@ namespace dbaui sal_Bool m_bModified; // is the data modified bool m_bNotAttached; - OSingleDocumentControllerImpl( ::osl::Mutex& i_rMutex ) + OSingleDocumentControllerImpl( OSingleDocumentController& i_antiImpl, ::osl::Mutex& i_rMutex ) :m_aDocScriptSupport() ,m_aModifyListeners( i_rMutex ) + ,m_pUndoManager( new UndoManager( i_antiImpl, i_rMutex ) ) ,m_nDocStartNumber(0) ,m_bSuspended( sal_False ) ,m_bEditable(sal_True) @@ -190,7 +195,7 @@ namespace dbaui //-------------------------------------------------------------------- OSingleDocumentController::OSingleDocumentController(const Reference< XMultiServiceFactory >& _rxORB) :OSingleDocumentController_Base( _rxORB ) - ,m_pImpl( new OSingleDocumentControllerImpl( getMutex() ) ) + ,m_pImpl( new OSingleDocumentControllerImpl( *this, getMutex() ) ) { } @@ -368,12 +373,13 @@ namespace dbaui void SAL_CALL OSingleDocumentController::disposing() { OSingleDocumentController_Base::disposing(); - m_aUndoManager.Clear(); + GetUndoManager().Clear(); disconnect(); attachFrame( Reference < XFrame >() ); + m_pImpl->m_pUndoManager->disposing(); m_pImpl->m_aDataSource.clear(); } @@ -483,22 +489,22 @@ namespace dbaui switch (_nId) { case ID_BROWSER_UNDO: - aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetUndoActionCount() != 0; + aReturn.bEnabled = m_pImpl->m_bEditable && GetUndoManager().GetUndoActionCount() != 0; if ( aReturn.bEnabled ) { String sUndo(ModuleRes(STR_UNDO_COLON)); sUndo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); - sUndo += m_aUndoManager.GetUndoActionComment(); + sUndo += GetUndoManager().GetUndoActionComment(); aReturn.sTitle = sUndo; } break; case ID_BROWSER_REDO: - aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetRedoActionCount() != 0; + aReturn.bEnabled = m_pImpl->m_bEditable && GetUndoManager().GetRedoActionCount() != 0; if ( aReturn.bEnabled ) { String sRedo(ModuleRes(STR_REDO_COLON)); sRedo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); - sRedo += m_aUndoManager.GetRedoActionComment(); + sRedo += GetUndoManager().GetRedoActionComment(); aReturn.sTitle = sRedo; } break; @@ -516,11 +522,11 @@ namespace dbaui closeTask(); return; case ID_BROWSER_UNDO: - m_aUndoManager.Undo(); + GetUndoManager().Undo(); InvalidateFeature(ID_BROWSER_REDO); break; case ID_BROWSER_REDO: - m_aUndoManager.Redo(); + GetUndoManager().Redo(); InvalidateFeature(ID_BROWSER_UNDO); break; default: @@ -530,15 +536,15 @@ namespace dbaui InvalidateFeature(_nId); } // ----------------------------------------------------------------------------- - SfxUndoManager& OSingleDocumentController::GetUndoManager() + SfxUndoManager& OSingleDocumentController::GetUndoManager() const { - return m_aUndoManager; + return m_pImpl->m_pUndoManager->GetSfxUndoManager(); } // ----------------------------------------------------------------------------- void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) { // add undo action - m_aUndoManager.AddUndoAction(_pAction); + GetUndoManager().AddUndoAction(_pAction); // when we add an undo action the controller was modified setModified(sal_True); // now inform me that or states changed @@ -676,6 +682,13 @@ namespace dbaui return sTitle.makeStringAndClear(); } + + // ----------------------------------------------------------------------------- + Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( ) throw (RuntimeException) + { + return m_pImpl->m_pUndoManager.get(); + } + // ----------------------------------------------------------------------------- sal_Int32 OSingleDocumentController::getCurrentStartNumber() const { -- cgit From 4c4bdf1aaa3645bd15644f983c8f4f8a6307d444 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Wed, 24 Nov 2010 13:53:52 +0100 Subject: undoapi: remove unused IEnvironment interface --- dbaccess/source/ui/misc/singledoccontroller.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index c074aed76392..a382f245347a 100644 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -141,7 +141,7 @@ namespace dbaui public: OModuleClient m_aModuleClient; - ::dbtools::SQLExceptionInfo m_aCurrentError; // contains the current error which can be set through IEnvironment + ::dbtools::SQLExceptionInfo m_aCurrentError; ::cppu::OInterfaceContainerHelper m_aModifyListeners; @@ -367,6 +367,7 @@ namespace dbaui { // our connection was disposed so we need a new one reconnect( sal_True ); + InvalidateAll(); } //-------------------------------------------------------------------- -- cgit From f9416a7fd8c2fddab7633dfd0543887ef7b8a148 Mon Sep 17 00:00:00 2001 From: "Ocke.Janssen" Date: Thu, 25 Nov 2010 11:23:27 +0100 Subject: dba34b: #i115655# new ui setting for max row scan for text db --- dbaccess/source/ui/misc/dsmeta.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index 08b5ea49f2bd..052d013f47a4 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -93,6 +93,7 @@ namespace dbaui { DSID_IGNORECURRENCY, "IgnoreCurrency" }, { DSID_ESCAPE_DATETIME, "EscapeDateTime" }, { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" }, + { DSID_MAX_ROW_SCAN, "MaxRowScan" }, { 0, NULL } }; return s_aMappings; -- cgit From 5cf47c0008eb4126cfc41c59fbeeb4d73c8e22b1 Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 25 Nov 2010 14:28:03 +0100 Subject: undoapi: split OSingleDocumentController into DBSubComponentController (which the report design's controller will be derived from) and the still-so-named OSingleDocumentController. Module reportdesign does not compile with this change, this is yet to come. --- .../source/ui/misc/dbsubcomponentcontroller.cxx | 672 ++++++++++++++++++++ dbaccess/source/ui/misc/makefile.mk | 1 + dbaccess/source/ui/misc/singledoccontroller.cxx | 703 ++------------------- 3 files changed, 743 insertions(+), 633 deletions(-) create mode 100644 dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx mode change 100644 => 100755 dbaccess/source/ui/misc/singledoccontroller.cxx (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx new file mode 100644 index 000000000000..eb1b34710ff8 --- /dev/null +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -0,0 +1,672 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_dbaccess.hxx" + +#include "browserids.hxx" +#include "commontypes.hxx" +#include "dataview.hxx" +#include "dbu_misc.hrc" +#include "dbustrings.hrc" +#include "moduledbu.hxx" +#include "dbsubcomponentcontroller.hxx" + +/** === begin UNO includes === **/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +/** === end UNO includes === **/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//........................................................................ +namespace dbaui +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::Reference; + using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::sdbc::XConnection; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::container::XChild; + using ::com::sun::star::sdbc::XDataSource; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::util::XNumberFormatsSupplier; + using ::com::sun::star::frame::XFrame; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::sdbc::SQLException; + using ::com::sun::star::lang::EventObject; + using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::frame::XModel; + using ::com::sun::star::sdb::XOfficeDatabaseDocument; + using ::com::sun::star::awt::XWindow; + using ::com::sun::star::sdbc::XDatabaseMetaData; + using ::com::sun::star::sdb::XDocumentDataSource; + using ::com::sun::star::document::XEmbeddedScripts; + using ::com::sun::star::lang::IllegalArgumentException; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::frame::XUntitledNumbers; + using ::com::sun::star::beans::PropertyVetoException; + /** === end UNO using === **/ + + class DataSourceHolder + { + public: + DataSourceHolder() + { + } + + DataSourceHolder( const Reference< XDataSource >& _rxDataSource ) + { + m_xDataSource = _rxDataSource; + Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY ); + if ( xDocDS.is() ) + m_xDocument = xDocDS->getDatabaseDocument(); + + m_xDataSourceProps.set( m_xDataSource, UNO_QUERY ); + } + + const Reference< XDataSource >& getDataSource() const { return m_xDataSource; } + const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; } + const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; } + + bool is() const { return m_xDataSource.is(); } + + void clear() + { + m_xDataSource.clear(); + m_xDocument.clear(); + } + + private: + Reference< XDataSource > m_xDataSource; + Reference< XPropertySet > m_xDataSourceProps; + Reference< XOfficeDatabaseDocument > m_xDocument; + }; + + struct DBSubComponentController_Impl + { + private: + ::boost::optional< bool > m_aDocScriptSupport; + + public: + OModuleClient m_aModuleClient; + ::dbtools::SQLExceptionInfo m_aCurrentError; + + ::cppu::OInterfaceContainerHelper + m_aModifyListeners; + + // + SharedConnection m_xConnection; + ::dbtools::DatabaseMetaData m_aSdbMetaData; + // + ::rtl::OUString m_sDataSourceName; // the data source we're working for + DataSourceHolder m_aDataSource; + Reference< XModel > m_xDocument; + Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier + sal_Int32 m_nDocStartNumber; + sal_Bool m_bSuspended; // is true when the controller was already suspended + sal_Bool m_bEditable; // is the control readonly or not + sal_Bool m_bModified; // is the data modified + bool m_bNotAttached; + + DBSubComponentController_Impl( ::osl::Mutex& i_rMutex ) + :m_aDocScriptSupport() + ,m_aModifyListeners( i_rMutex ) + ,m_nDocStartNumber(0) + ,m_bSuspended( sal_False ) + ,m_bEditable(sal_True) + ,m_bModified(sal_False) + ,m_bNotAttached(true) + { + } + + bool documentHasScriptSupport() const + { + OSL_PRECOND( !!m_aDocScriptSupport, + "DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); + return !!m_aDocScriptSupport && *m_aDocScriptSupport; + } + + void setDocumentScriptSupport( const bool _bSupport ) + { + OSL_PRECOND( !m_aDocScriptSupport, + "DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" ); + m_aDocScriptSupport = ::boost::optional< bool >( _bSupport ); + } + }; + + //==================================================================== + //= DBSubComponentController + //==================================================================== + //-------------------------------------------------------------------- + DBSubComponentController::DBSubComponentController(const Reference< XMultiServiceFactory >& _rxORB) + :DBSubComponentController_Base( _rxORB ) + ,m_pImpl( new DBSubComponentController_Impl( getMutex() ) ) + { + } + + //-------------------------------------------------------------------- + DBSubComponentController::~DBSubComponentController() + { + } + + //-------------------------------------------------------------------- + void DBSubComponentController::impl_initialize() + { + OGenericUnoController::impl_initialize(); + + const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); + + Reference< XConnection > xConnection; + xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); + + if ( !xConnection.is() ) + ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); + + if ( xConnection.is() ) + initializeConnection( xConnection ); + + bool bShowError = true; + if ( !isConnected() ) + { + reconnect( sal_False ); + bShowError = false; + } + if ( !isConnected() ) + { + if ( bShowError ) + connectionLostMessage(); + throw IllegalArgumentException(); + } + } + + //-------------------------------------------------------------------- + Any SAL_CALL DBSubComponentController::queryInterface(const Type& _rType) throw (RuntimeException) + { + if ( _rType.equals( XScriptInvocationContext::static_type() ) ) + { + if ( m_pImpl->documentHasScriptSupport() ) + return makeAny( Reference< XScriptInvocationContext >( this ) ); + return Any(); + } + + return DBSubComponentController_Base::queryInterface( _rType ); + } + + //-------------------------------------------------------------------- + Sequence< Type > SAL_CALL DBSubComponentController::getTypes( ) throw (RuntimeException) + { + Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() ); + if ( !m_pImpl->documentHasScriptSupport() ) + { + Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); + ::std::remove_copy_if( + aTypes.getConstArray(), + aTypes.getConstArray() + aTypes.getLength(), + aStrippedTypes.getArray(), + ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() ) + ); + aTypes = aStrippedTypes; + } + return aTypes; + } + + //-------------------------------------------------------------------- + void DBSubComponentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) + { + DBG_ASSERT( !isConnected(), "DBSubComponentController::initializeConnection: not to be called when already connected!" ); + // usually this gets called from within initialize of derived classes ... + if ( isConnected() ) + disconnect(); + + m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); + m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); + startConnectionListening( m_pImpl->m_xConnection ); + + // get the data source the connection belongs to + try + { + // determine our data source + OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: already a data source in this phase?" ); + { + Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); + Reference< XDataSource > xDS; + if ( xConnAsChild.is() ) + xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); + + // (take the indirection through XDataSource to ensure we have a correct object ....) + m_pImpl->m_aDataSource = xDS; + } + OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: unable to obtain the data source object!" ); + + if ( m_pImpl->m_bNotAttached ) + { + Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + } + + // determine the availability of script support in our document. Our own XScriptInvocationContext + // interface depends on this + m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); + + // get a number formatter + Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); + xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; + DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "DBSubComponentController::initializeConnection: invalid data source name!" ); + Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); + if(xSupplier.is()) + { + m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB() + ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); + m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); + } + OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //-------------------------------------------------------------------- + void DBSubComponentController::reconnect( sal_Bool _bUI ) + { + OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!"); + + stopConnectionListening( m_pImpl->m_xConnection ); + m_pImpl->m_aSdbMetaData.reset( NULL ); + m_pImpl->m_xConnection.clear(); + + // reconnect + sal_Bool bReConnect = sal_True; + if ( _bUI ) + { + QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) ); + bReConnect = ( RET_YES == aQuery.Execute() ); + } + + // now really reconnect ... + if ( bReConnect ) + { + m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership ); + m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); + } + + // invalidate all slots + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::disconnect() + { + stopConnectionListening(m_pImpl->m_xConnection); + m_pImpl->m_aSdbMetaData.reset( NULL ); + m_pImpl->m_xConnection.clear(); + + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::losingConnection() + { + // our connection was disposed so we need a new one + reconnect( sal_True ); + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::disposing() + { + DBSubComponentController_Base::disposing(); + + disconnect(); + + attachFrame( Reference < XFrame >() ); + + m_pImpl->m_aDataSource.clear(); + } + + //-------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::disposing(const EventObject& _rSource) throw( RuntimeException ) + { + if ( _rSource.Source == getConnection() ) + { + if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect + && !getBroadcastHelper().bInDispose + && !getBroadcastHelper().bDisposed + && isConnected() + ) + { + losingConnection(); + } + else + { + m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership ); + // this prevents the "disposeComponent" call in disconnect + disconnect(); + } + } + else + DBSubComponentController_Base::disposing( _rSource ); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState, + const sal_Int32 _nErrorCode ) + { + m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ), + _nErrorCode ); + } + //-------------------------------------------------------------------- + void DBSubComponentController::clearError() + { + m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + } + + //-------------------------------------------------------------------- + sal_Bool DBSubComponentController::hasError() const + { + return m_pImpl->m_aCurrentError.isValid(); + } + + //-------------------------------------------------------------------- + const ::dbtools::SQLExceptionInfo& DBSubComponentController::getError() const + { + return m_pImpl->m_aCurrentError; + } + + //-------------------------------------------------------------------- + void DBSubComponentController::displayError() + { + showError( m_pImpl->m_aCurrentError ); + } + + //-------------------------------------------------------------------- + sal_Bool SAL_CALL DBSubComponentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) + { + m_pImpl->m_bSuspended = bSuspend; + if ( !bSuspend && !isConnected() ) + reconnect(sal_True); + + + return sal_True; + } + + // ----------------------------------------------------------------------------- + sal_Bool SAL_CALL DBSubComponentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) + { + if ( !_rxModel.is() ) + return sal_False; + if ( !DBSubComponentController_Base::attachModel( _rxModel ) ) + return sal_False; + + m_pImpl->m_bNotAttached = false; + if ( m_pImpl->m_nDocStartNumber == 1 ) + releaseNumberForComponent(); + + Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + + return sal_True; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs) + { + if ( _nId == ID_BROWSER_CLOSE ) + { + closeTask(); + return; + } + + DBSubComponentController_Base::Execute( _nId, _rArgs ); + InvalidateFeature( _nId ); + } + + // ----------------------------------------------------------------------------- + ::rtl::OUString DBSubComponentController::getDataSourceName() const + { + ::rtl::OUString sName; + Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() ); + if ( xDataSourceProps.is() ) + xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName; + return sName; + } + // ----------------------------------------------------------------------------- + void DBSubComponentController::connectionLostMessage() const + { + String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); + Reference< XWindow > xWindow = getTopMostContainerWindow(); + Window* pWin = NULL; + if ( xWindow.is() ) + pWin = VCLUnoHelper::GetWindow(xWindow); + if ( !pWin ) + pWin = getView()->Window::GetParent(); + + InfoBox(pWin, aMessage).Execute(); + } + // ----------------------------------------------------------------------------- + const Reference< XConnection >& DBSubComponentController::getConnection() const + { + return m_pImpl->m_xConnection; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isReadOnly() const + { + return !m_pImpl->m_bEditable; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isEditable() const + { + return m_pImpl->m_bEditable; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::setEditable(sal_Bool _bEditable) + { + m_pImpl->m_bEditable = _bEditable; + } + + // ----------------------------------------------------------------------------- + const ::dbtools::DatabaseMetaData& DBSubComponentController::getSdbMetaData() const + { + return m_pImpl->m_aSdbMetaData; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isConnected() const + { + return m_pImpl->m_xConnection.is(); + } + + // ----------------------------------------------------------------------------- + Reference< XDatabaseMetaData > DBSubComponentController::getMetaData( ) const + { + Reference< XDatabaseMetaData > xMeta; + try + { + if ( isConnected() ) + xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return xMeta; + } + + // ----------------------------------------------------------------------------- + const Reference< XPropertySet >& DBSubComponentController::getDataSource() const + { + return m_pImpl->m_aDataSource.getDataSourceProps(); + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::haveDataSource() const + { + return m_pImpl->m_aDataSource.is(); + } + + // ----------------------------------------------------------------------------- + Reference< XModel > DBSubComponentController::getDatabaseDocument() const + { + return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY ); + } + + // ----------------------------------------------------------------------------- + Reference< XNumberFormatter > DBSubComponentController::getNumberFormatter() const + { + return m_pImpl->m_xFormatter; + } + + // ----------------------------------------------------------------------------- + Reference< XModel > DBSubComponentController::getPrivateModel() const + { + return getDatabaseDocument(); + } + // ----------------------------------------------------------------------------- + // XTitle + ::rtl::OUString SAL_CALL DBSubComponentController::getTitle() + throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + if ( m_bExternalTitle ) + return impl_getTitleHelper_throw()->getTitle (); + + ::rtl::OUStringBuffer sTitle; + Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); + if ( xTitle.is() ) + { + sTitle.append( xTitle->getTitle() ); + sTitle.appendAscii(" : "); + } + sTitle.append( getPrivateTitle() ); + return sTitle.makeStringAndClear(); + } + + // ----------------------------------------------------------------------------- + sal_Int32 DBSubComponentController::getCurrentStartNumber() const + { + return m_pImpl->m_nDocStartNumber; + } + + // ----------------------------------------------------------------------------- + Reference< XEmbeddedScripts > SAL_CALL DBSubComponentController::getScriptContainer() throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + if ( !m_pImpl->documentHasScriptSupport() ) + return NULL; + + return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW ); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + m_pImpl->m_aModifyListeners.addInterface( i_Listener ); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + m_pImpl->m_aModifyListeners.removeInterface( i_Listener ); + } + + // ----------------------------------------------------------------------------- + ::sal_Bool SAL_CALL DBSubComponentController::isModified( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + return impl_isModified(); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException) + { + ::osl::ClearableMutexGuard aGuard( getMutex() ); + + if ( m_pImpl->m_bModified == i_bModified ) + return; + + m_pImpl->m_bModified = i_bModified; + impl_onModifyChanged(); + + EventObject aEvent( *this ); + aGuard.clear(); + m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::impl_isModified() const + { + return m_pImpl->m_bModified; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::impl_onModifyChanged() + { + InvalidateFeature( ID_BROWSER_SAVEDOC ); + if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) ) + InvalidateFeature( ID_BROWSER_SAVEASDOC ); + } + +//........................................................................ +} // namespace dbaui +//........................................................................ + diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 62276292224e..534d90e3995c 100644 --- a/dbaccess/source/ui/misc/makefile.mk +++ b/dbaccess/source/ui/misc/makefile.mk @@ -52,6 +52,7 @@ SLOFILES= \ $(SLO)/asyncmodaldialog.obj \ $(SLO)/imageprovider.obj \ $(SLO)/singledoccontroller.obj \ + $(SLO)/dbsubcomponentcontroller.obj \ $(SLO)/datasourceconnector.obj \ $(SLO)/linkeddocuments.obj \ $(SLO)/indexcollection.obj \ diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx old mode 100644 new mode 100755 index a382f245347a..2e8c002a2097 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -1,5 +1,4 @@ /************************************************************************* - * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. @@ -25,472 +24,128 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" +#include "dbaundomanager.hxx" +#include "singledoccontroller.hxx" #include "browserids.hxx" -#include "commontypes.hxx" -#include "dataview.hxx" #include "dbu_misc.hrc" #include "dbustrings.hrc" #include "moduledbu.hxx" -#include "singledoccontroller.hxx" -#include "dbaundomanager.hxx" /** === begin UNO includes === **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include /** === end UNO includes === **/ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include -//........................................................................ +#include + +//...................................................................................................................... namespace dbaui { -//........................................................................ +//...................................................................................................................... /** === begin UNO using === **/ - using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; - using ::com::sun::star::beans::XPropertySet; - using ::com::sun::star::util::XNumberFormatter; - using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; - using ::com::sun::star::sdbc::XConnection; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::container::XChild; - using ::com::sun::star::sdbc::XDataSource; - using ::com::sun::star::util::XNumberFormatter; - using ::com::sun::star::util::XNumberFormatsSupplier; - using ::com::sun::star::frame::XFrame; - using ::com::sun::star::uno::Exception; - using ::com::sun::star::sdbc::SQLException; - using ::com::sun::star::lang::EventObject; - using ::com::sun::star::beans::PropertyValue; - using ::com::sun::star::frame::XModel; - using ::com::sun::star::sdb::XOfficeDatabaseDocument; - using ::com::sun::star::awt::XWindow; - using ::com::sun::star::sdbc::XDatabaseMetaData; - using ::com::sun::star::sdb::XDocumentDataSource; - using ::com::sun::star::document::XEmbeddedScripts; - using ::com::sun::star::lang::IllegalArgumentException; - using ::com::sun::star::uno::UNO_SET_THROW; - using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::com::sun::star::frame::XUntitledNumbers; - using ::com::sun::star::beans::PropertyVetoException; using ::com::sun::star::document::XUndoManager; + using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::lang::EventObject; /** === end UNO using === **/ - class DataSourceHolder + //================================================================================================================== + //= OSingleDocumentController_Data + //================================================================================================================== + struct OSingleDocumentController_Data { - public: - DataSourceHolder() - { - } - - DataSourceHolder( const Reference< XDataSource >& _rxDataSource ) - { - m_xDataSource = _rxDataSource; - Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY ); - if ( xDocDS.is() ) - m_xDocument = xDocDS->getDatabaseDocument(); - - m_xDataSourceProps.set( m_xDataSource, UNO_QUERY ); - } - - const Reference< XDataSource >& getDataSource() const { return m_xDataSource; } - const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; } - const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; } + ::boost::scoped_ptr< UndoManager > m_pUndoManager; - bool is() const { return m_xDataSource.is(); } - - void clear() + OSingleDocumentController_Data( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :m_pUndoManager( new UndoManager( i_parent, i_mutex ) ) { - m_xDataSource.clear(); - m_xDocument.clear(); } - - private: - Reference< XDataSource > m_xDataSource; - Reference< XPropertySet > m_xDataSourceProps; - Reference< XOfficeDatabaseDocument > m_xDocument; }; - struct OSingleDocumentControllerImpl - { - private: - ::boost::optional< bool > m_aDocScriptSupport; - - public: - OModuleClient m_aModuleClient; - ::dbtools::SQLExceptionInfo m_aCurrentError; - - ::cppu::OInterfaceContainerHelper - m_aModifyListeners; - - // - SharedConnection m_xConnection; - ::dbtools::DatabaseMetaData m_aSdbMetaData; - // - ::boost::scoped_ptr< UndoManager > - m_pUndoManager; - ::rtl::OUString m_sDataSourceName; // the data source we're working for - DataSourceHolder m_aDataSource; - Reference< XModel > m_xDocument; - Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier - sal_Int32 m_nDocStartNumber; - sal_Bool m_bSuspended; // is true when the controller was already suspended - sal_Bool m_bEditable; // is the control readonly or not - sal_Bool m_bModified; // is the data modified - bool m_bNotAttached; - - OSingleDocumentControllerImpl( OSingleDocumentController& i_antiImpl, ::osl::Mutex& i_rMutex ) - :m_aDocScriptSupport() - ,m_aModifyListeners( i_rMutex ) - ,m_pUndoManager( new UndoManager( i_antiImpl, i_rMutex ) ) - ,m_nDocStartNumber(0) - ,m_bSuspended( sal_False ) - ,m_bEditable(sal_True) - ,m_bModified(sal_False) - ,m_bNotAttached(true) - { - } - - bool documentHasScriptSupport() const - { - OSL_PRECOND( !!m_aDocScriptSupport, - "OSingleDocumentControllerImpl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); - return !!m_aDocScriptSupport && *m_aDocScriptSupport; - } - - void setDocumentScriptSupport( const bool _bSupport ) - { - OSL_PRECOND( !m_aDocScriptSupport, - "OSingleDocumentControllerImpl::setDocumentScriptSupport: already initialized!" ); - m_aDocScriptSupport = ::boost::optional< bool >( _bSupport ); - } - }; - - //==================================================================== + //================================================================================================================== //= OSingleDocumentController - //==================================================================== - //-------------------------------------------------------------------- - OSingleDocumentController::OSingleDocumentController(const Reference< XMultiServiceFactory >& _rxORB) + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + OSingleDocumentController::OSingleDocumentController( const Reference< XMultiServiceFactory >& _rxORB ) :OSingleDocumentController_Base( _rxORB ) - ,m_pImpl( new OSingleDocumentControllerImpl( *this, getMutex() ) ) + ,m_pData( new OSingleDocumentController_Data( *this, getMutex() ) ) { } - //-------------------------------------------------------------------- + //------------------------------------------------------------------------------------------------------------------ OSingleDocumentController::~OSingleDocumentController() { } - //-------------------------------------------------------------------- - void OSingleDocumentController::impl_initialize() - { - OGenericUnoController::impl_initialize(); - - const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); - - Reference< XConnection > xConnection; - xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); - - if ( !xConnection.is() ) - ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); - - if ( xConnection.is() ) - initializeConnection( xConnection ); - - bool bShowError = true; - if ( !isConnected() ) - { - reconnect( sal_False ); - bShowError = false; - } - if ( !isConnected() ) - { - if ( bShowError ) - connectionLostMessage(); - throw IllegalArgumentException(); - } - } - - //-------------------------------------------------------------------- - Any SAL_CALL OSingleDocumentController::queryInterface(const Type& _rType) throw (RuntimeException) - { - if ( _rType.equals( XScriptInvocationContext::static_type() ) ) - { - if ( m_pImpl->documentHasScriptSupport() ) - return makeAny( Reference< XScriptInvocationContext >( this ) ); - return Any(); - } - - return OSingleDocumentController_Base::queryInterface( _rType ); - } - - //-------------------------------------------------------------------- - Sequence< Type > SAL_CALL OSingleDocumentController::getTypes( ) throw (RuntimeException) - { - Sequence< Type > aTypes( OSingleDocumentController_Base::getTypes() ); - if ( !m_pImpl->documentHasScriptSupport() ) - { - Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); - ::std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), - aStrippedTypes.getArray(), - ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() ) - ); - aTypes = aStrippedTypes; - } - return aTypes; - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) - { - DBG_ASSERT( !isConnected(), "OSingleDocumentController::initializeConnection: not to be called when already connected!" ); - // usually this gets called from within initialize of derived classes ... - if ( isConnected() ) - disconnect(); - - m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); - m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); - startConnectionListening( m_pImpl->m_xConnection ); - - // get the data source the connection belongs to - try - { - // determine our data source - OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: already a data source in this phase?" ); - { - Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); - Reference< XDataSource > xDS; - if ( xConnAsChild.is() ) - xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); - - // (take the indirection through XDataSource to ensure we have a correct object ....) - m_pImpl->m_aDataSource = xDS; - } - OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: unable to obtain the data source object!" ); - - if ( m_pImpl->m_bNotAttached ) - { - Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); - m_pImpl->m_nDocStartNumber = 1; - if ( xUntitledProvider.is() ) - m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); - } - - // determine the availability of script support in our document. Our own XScriptInvocationContext - // interface depends on this - m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); - - // get a number formatter - Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); - xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; - DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "OSingleDocumentController::initializeConnection: invalid data source name!" ); - Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); - if(xSupplier.is()) - { - m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB() - ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); - m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); - } - OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::reconnect( sal_Bool _bUI ) - { - OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!"); - - stopConnectionListening( m_pImpl->m_xConnection ); - m_pImpl->m_aSdbMetaData.reset( NULL ); - m_pImpl->m_xConnection.clear(); - - // reconnect - sal_Bool bReConnect = sal_True; - if ( _bUI ) - { - QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) ); - bReConnect = ( RET_YES == aQuery.Execute() ); - } - - // now really reconnect ... - if ( bReConnect ) - { - m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership ); - m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); - } - - // invalidate all slots - InvalidateAll(); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::disconnect() - { - stopConnectionListening(m_pImpl->m_xConnection); - m_pImpl->m_aSdbMetaData.reset( NULL ); - m_pImpl->m_xConnection.clear(); - - InvalidateAll(); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::losingConnection() - { - // our connection was disposed so we need a new one - reconnect( sal_True ); - InvalidateAll(); - } - - //-------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void SAL_CALL OSingleDocumentController::disposing() { OSingleDocumentController_Base::disposing(); - GetUndoManager().Clear(); - - disconnect(); - - attachFrame( Reference < XFrame >() ); - - m_pImpl->m_pUndoManager->disposing(); - m_pImpl->m_aDataSource.clear(); - } - - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::Construct(Window* _pParent) - { - DBG_ASSERT( getView(), "OSingleDocumentController::Construct: have no view!" ); - if ( getView() ) - getView()->enableSeparator( ); - - return OSingleDocumentController_Base::Construct( _pParent ); - } - - //-------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::disposing(const EventObject& _rSource) throw( RuntimeException ) - { - if ( _rSource.Source == getConnection() ) - { - if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect - && !getBroadcastHelper().bInDispose - && !getBroadcastHelper().bDisposed - && isConnected() - ) - { - losingConnection(); - } - else - { - m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership ); - // this prevents the "disposeComponent" call in disconnect - disconnect(); - } - } - else - OSingleDocumentController_Base::disposing( _rSource ); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState, - const sal_Int32 _nErrorCode ) - { - m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ), - _nErrorCode ); - } - //-------------------------------------------------------------------- - void OSingleDocumentController::clearError() - { - m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + ClearUndoManager(); + m_pData->m_pUndoManager->disposing(); } - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::hasError() const + // ----------------------------------------------------------------------------- + void SAL_CALL OSingleDocumentController::disposing( const EventObject& i_event ) throw( RuntimeException ) { - return m_pImpl->m_aCurrentError.isValid(); + // simply disambiguate + OSingleDocumentController_Base::disposing( i_event ); } - //-------------------------------------------------------------------- - const ::dbtools::SQLExceptionInfo& OSingleDocumentController::getError() const + // ----------------------------------------------------------------------------- + void OSingleDocumentController::ClearUndoManager() { - return m_pImpl->m_aCurrentError; + GetUndoManager().Clear(); } - //-------------------------------------------------------------------- - void OSingleDocumentController::displayError() + // ----------------------------------------------------------------------------- + SfxUndoManager& OSingleDocumentController::GetUndoManager() const { - showError( m_pImpl->m_aCurrentError ); + return m_pData->m_pUndoManager->GetSfxUndoManager(); } - //-------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) + // ----------------------------------------------------------------------------- + void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) { - m_pImpl->m_bSuspended = bSuspend; - if ( !bSuspend && !isConnected() ) - reconnect(sal_True); + // add undo action + GetUndoManager().AddUndoAction( _pAction ); + // when we add an undo action the controller was modified + setModified( sal_True ); - return sal_True; + // now inform me that or states changed + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); } // ----------------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) + Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( ) throw (RuntimeException) { - if ( !_rxModel.is() ) - return sal_False; - if ( !OSingleDocumentController_Base::attachModel( _rxModel ) ) - return sal_False; - - m_pImpl->m_bNotAttached = false; - if ( m_pImpl->m_nDocStartNumber == 1 ) - releaseNumberForComponent(); - - Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); - m_pImpl->m_nDocStartNumber = 1; - if ( xUntitledProvider.is() ) - m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); - - return sal_True; + return m_pData->m_pUndoManager.get(); } // ----------------------------------------------------------------------------- FeatureState OSingleDocumentController::GetState(sal_uInt16 _nId) const { FeatureState aReturn; - // (disabled automatically) - aReturn.bEnabled = sal_True; - - switch (_nId) + switch ( _nId ) { case ID_BROWSER_UNDO: - aReturn.bEnabled = m_pImpl->m_bEditable && GetUndoManager().GetUndoActionCount() != 0; + aReturn.bEnabled = isEditable() && GetUndoManager().GetUndoActionCount() != 0; if ( aReturn.bEnabled ) { String sUndo(ModuleRes(STR_UNDO_COLON)); @@ -499,8 +154,9 @@ namespace dbaui aReturn.sTitle = sUndo; } break; + case ID_BROWSER_REDO: - aReturn.bEnabled = m_pImpl->m_bEditable && GetUndoManager().GetRedoActionCount() != 0; + aReturn.bEnabled = isEditable() && GetUndoManager().GetRedoActionCount() != 0; if ( aReturn.bEnabled ) { String sRedo(ModuleRes(STR_REDO_COLON)); @@ -509,255 +165,36 @@ namespace dbaui aReturn.sTitle = sRedo; } break; + default: aReturn = OSingleDocumentController_Base::GetState(_nId); } return aReturn; } // ----------------------------------------------------------------------------- - void OSingleDocumentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs) + void OSingleDocumentController::Execute( sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs ) { - switch(_nId) + switch ( _nId ) { - case ID_BROWSER_CLOSE: - closeTask(); - return; case ID_BROWSER_UNDO: GetUndoManager().Undo(); - InvalidateFeature(ID_BROWSER_REDO); + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); break; + case ID_BROWSER_REDO: GetUndoManager().Redo(); - InvalidateFeature(ID_BROWSER_UNDO); + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); break; + default: OSingleDocumentController_Base::Execute( _nId, _rArgs ); break; } InvalidateFeature(_nId); } - // ----------------------------------------------------------------------------- - SfxUndoManager& OSingleDocumentController::GetUndoManager() const - { - return m_pImpl->m_pUndoManager->GetSfxUndoManager(); - } - // ----------------------------------------------------------------------------- - void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) - { - // add undo action - GetUndoManager().AddUndoAction(_pAction); - // when we add an undo action the controller was modified - setModified(sal_True); - // now inform me that or states changed - InvalidateFeature(ID_BROWSER_UNDO); - InvalidateFeature(ID_BROWSER_REDO); - } - - // ----------------------------------------------------------------------------- - ::rtl::OUString OSingleDocumentController::getDataSourceName() const - { - ::rtl::OUString sName; - Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() ); - if ( xDataSourceProps.is() ) - xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName; - return sName; - } - // ----------------------------------------------------------------------------- - void OSingleDocumentController::connectionLostMessage() const - { - String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); - Reference< XWindow > xWindow = getTopMostContainerWindow(); - Window* pWin = NULL; - if ( xWindow.is() ) - pWin = VCLUnoHelper::GetWindow(xWindow); - if ( !pWin ) - pWin = getView()->Window::GetParent(); - - InfoBox(pWin, aMessage).Execute(); - } - // ----------------------------------------------------------------------------- - const Reference< XConnection >& OSingleDocumentController::getConnection() const - { - return m_pImpl->m_xConnection; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isReadOnly() const - { - return !m_pImpl->m_bEditable; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isEditable() const - { - return m_pImpl->m_bEditable; - } - - // ----------------------------------------------------------------------------- - void OSingleDocumentController::setEditable(sal_Bool _bEditable) - { - m_pImpl->m_bEditable = _bEditable; - } - - // ----------------------------------------------------------------------------- - const ::dbtools::DatabaseMetaData& OSingleDocumentController::getSdbMetaData() const - { - return m_pImpl->m_aSdbMetaData; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isConnected() const - { - return m_pImpl->m_xConnection.is(); - } - - // ----------------------------------------------------------------------------- - Reference< XDatabaseMetaData > OSingleDocumentController::getMetaData( ) const - { - Reference< XDatabaseMetaData > xMeta; - try - { - if ( isConnected() ) - xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return xMeta; - } - - // ----------------------------------------------------------------------------- - const Reference< XPropertySet >& OSingleDocumentController::getDataSource() const - { - return m_pImpl->m_aDataSource.getDataSourceProps(); - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::haveDataSource() const - { - return m_pImpl->m_aDataSource.is(); - } - - // ----------------------------------------------------------------------------- - Reference< XModel > OSingleDocumentController::getDatabaseDocument() const - { - return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY ); - } - - // ----------------------------------------------------------------------------- - Reference< XNumberFormatter > OSingleDocumentController::getNumberFormatter() const - { - return m_pImpl->m_xFormatter; - } - - // ----------------------------------------------------------------------------- - Reference< XModel > OSingleDocumentController::getPrivateModel() const - { - return getDatabaseDocument(); - } - // ----------------------------------------------------------------------------- - // XTitle - ::rtl::OUString SAL_CALL OSingleDocumentController::getTitle() - throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - if ( m_bExternalTitle ) - return impl_getTitleHelper_throw()->getTitle (); - - ::rtl::OUStringBuffer sTitle; - Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); - if ( xTitle.is() ) - { - sTitle.append( xTitle->getTitle() ); - sTitle.appendAscii(" : "); - } - sTitle.append( getPrivateTitle() ); - // There can be only one view with the same object - //const sal_Int32 nCurrentView = getCurrentStartNumber(); - //if ( nCurrentView > 1 ) - //{ - // sTitle.appendAscii(" : "); - // sTitle.append(nCurrentView); - //} - - return sTitle.makeStringAndClear(); - } - - // ----------------------------------------------------------------------------- - Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( ) throw (RuntimeException) - { - return m_pImpl->m_pUndoManager.get(); - } - - // ----------------------------------------------------------------------------- - sal_Int32 OSingleDocumentController::getCurrentStartNumber() const - { - return m_pImpl->m_nDocStartNumber; - } - - // ----------------------------------------------------------------------------- - Reference< XEmbeddedScripts > SAL_CALL OSingleDocumentController::getScriptContainer() throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - if ( !m_pImpl->documentHasScriptSupport() ) - return NULL; - - return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW ); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - m_pImpl->m_aModifyListeners.addInterface( i_Listener ); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - m_pImpl->m_aModifyListeners.removeInterface( i_Listener ); - } - - // ----------------------------------------------------------------------------- - ::sal_Bool SAL_CALL OSingleDocumentController::isModified( ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - return impl_isModified(); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException) - { - ::osl::ClearableMutexGuard aGuard( getMutex() ); - - if ( m_pImpl->m_bModified == i_bModified ) - return; - - m_pImpl->m_bModified = i_bModified; - impl_onModifyChanged(); - - EventObject aEvent( *this ); - aGuard.clear(); - m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::impl_isModified() const - { - return m_pImpl->m_bModified; - } - - // ----------------------------------------------------------------------------- - void OSingleDocumentController::impl_onModifyChanged() - { - InvalidateFeature( ID_BROWSER_SAVEDOC ); - if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) ) - InvalidateFeature( ID_BROWSER_SAVEASDOC ); - } - -//........................................................................ -} // namespace dbaui -//........................................................................ +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... -- cgit From 4ae5573a0f94cc859ba2c30ac71bcd2ff8677f1f Mon Sep 17 00:00:00 2001 From: "Frank Schoenheit [fs]" Date: Thu, 25 Nov 2010 14:29:43 +0100 Subject: undoapi: migrated report designer to use an own, model-bound UndoManager, instead of the UndoManager formerly bound to the controller --- dbaccess/source/ui/misc/dbaundomanager.hxx | 101 ----------------------------- 1 file changed, 101 deletions(-) delete mode 100755 dbaccess/source/ui/misc/dbaundomanager.hxx (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/dbaundomanager.hxx b/dbaccess/source/ui/misc/dbaundomanager.hxx deleted file mode 100755 index 99ff86cb39bf..000000000000 --- a/dbaccess/source/ui/misc/dbaundomanager.hxx +++ /dev/null @@ -1,101 +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 DBACCESS_DBAUNDOMANAGER_HXX -#define DBACCESS_DBAUNDOMANAGER_HXX - -/** === begin UNO includes === **/ -#include -/** === end UNO includes === **/ - -#include - -#include - -class SfxUndoManager; - -//...................................................................................................................... -namespace dbaui -{ -//...................................................................................................................... - - //================================================================================================================== - //= UndoManager - //================================================================================================================== - struct UndoManager_Impl; - typedef ::cppu::ImplHelper1< ::com::sun::star::document::XUndoManager > UndoManager_Base; - class UndoManager : public UndoManager_Base - { - public: - UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ); - virtual ~UndoManager(); - - SfxUndoManager& GetSfxUndoManager() const; - - // XInterface - virtual void SAL_CALL acquire( ) throw (); - virtual void SAL_CALL release( ) throw (); - - // XComponent equivalents - void disposing(); - - // XUndoManager - virtual void SAL_CALL enterUndoContext( const ::rtl::OUString& i_title ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL enterHiddenUndoContext( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL leaveUndoContext( ) throw (::com::sun::star::util::InvalidStateException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addUndoAction( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoAction >& i_action ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL undo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL redo( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::document::UndoFailedException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isUndoPossible( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isRedoPossible( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getCurrentUndoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); - virtual ::rtl::OUString SAL_CALL getCurrentRedoActionTitle( ) throw (::com::sun::star::document::EmptyUndoStackException, ::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllUndoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAllRedoActionTitles( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL clear( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL clearRedo( ) throw (::com::sun::star::document::UndoContextNotClosedException, ::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL reset( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL addUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL removeUndoManagerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManagerListener >& i_listener ) throw (::com::sun::star::uno::RuntimeException); - - // XLockable (base of XUndoManager) - virtual void SAL_CALL lock( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL unlock( ) throw (::com::sun::star::util::NotLockedException, ::com::sun::star::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL isLocked( ) throw (::com::sun::star::uno::RuntimeException); - - // XChild (base of XUndoManager) - virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); - - private: - ::boost::scoped_ptr< UndoManager_Impl > m_pImpl; - }; - -//...................................................................................................................... -} // namespace dbaui -//...................................................................................................................... - -#endif // DBACCESS_DBAUNDOMANAGER_HXX -- cgit From 409873c1c1267b71eb53e4d5536fc240510438d9 Mon Sep 17 00:00:00 2001 From: Mikhail Voytenko Date: Fri, 14 Jan 2011 15:00:11 +0100 Subject: removetooltypes01: #i112600# remove tooltypes from dbaccess --- dbaccess/source/ui/misc/DExport.cxx | 14 ++++---- dbaccess/source/ui/misc/HtmlReader.cxx | 10 +++--- dbaccess/source/ui/misc/RowSetDrop.cxx | 10 +++--- dbaccess/source/ui/misc/RtfReader.cxx | 8 ++--- dbaccess/source/ui/misc/TokenWriter.cxx | 54 +++++++++++++++---------------- dbaccess/source/ui/misc/UITools.cxx | 2 +- dbaccess/source/ui/misc/WCPage.cxx | 6 ++-- dbaccess/source/ui/misc/WColumnSelect.cxx | 8 ++--- dbaccess/source/ui/misc/WNameMatch.cxx | 8 ++--- dbaccess/source/ui/misc/WTypeSelect.cxx | 6 ++-- dbaccess/source/ui/misc/imageprovider.cxx | 14 ++++---- 11 files changed, 70 insertions(+), 70 deletions(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index f4ff8064181d..9e134b784ea1 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -114,10 +114,10 @@ ODatabaseExport::ODatabaseExport(sal_Int32 nRows, ,m_nRows(1) ,m_nRowCount(0) ,m_nDefToken( gsl_getSystemTextEncoding() ) - ,m_bError(FALSE) - ,m_bInTbl(FALSE) - ,m_bHead(TRUE) - ,m_bDontAskAgain(FALSE) + ,m_bError(sal_False) + ,m_bInTbl(sal_False) + ,m_bHead(sal_True) + ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(_bAutoIncrementEnabled) ,m_bFoundTable(sal_False) ,m_bCheckOnly(sal_False) @@ -173,7 +173,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection, ,m_nDefToken( gsl_getSystemTextEncoding() ) ,m_bError(sal_False) ,m_bInTbl(sal_False) - ,m_bHead(TRUE) + ,m_bHead(sal_True) ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(sal_False) ,m_bFoundTable(sal_False) @@ -786,9 +786,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ); if (aBox.Execute() == RET_YES) - m_bDontAskAgain = TRUE; + m_bDontAskAgain = sal_True; else - m_bError = TRUE; + m_bError = sal_True; } // if(!m_bDontAskAgain) } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 9e3517ffb3af..d787d19a3305 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -110,7 +110,7 @@ OHTMLReader::OHTMLReader(SvStream& rIn,const SharedConnection& _rxConnection, DBG_CTOR(OHTMLReader,NULL); SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); } // --------------------------------------------------------------------------- OHTMLReader::OHTMLReader(SvStream& rIn, @@ -132,7 +132,7 @@ OHTMLReader::OHTMLReader(SvStream& rIn, DBG_CTOR(OHTMLReader,NULL); SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); } // --------------------------------------------------------------------------- OHTMLReader::~OHTMLReader() @@ -325,7 +325,7 @@ void OHTMLReader::NextToken( int nToken ) void OHTMLReader::fetchOptions() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::fetchOptions" ); - m_bInTbl = TRUE; + m_bInTbl = sal_True; const HTMLOptions* options = GetOptions(); sal_Int16 nArrLen = options->Count(); for ( sal_Int16 i = 0; i < nArrLen; i++ ) @@ -492,7 +492,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) // run through case HTML_TABLEHEADER_ON: TableDataOn(eVal,nTmpToken2); - bTableHeader = TRUE; + bTableHeader = sal_True; break; case HTML_TABLEDATA_OFF: // m_bAppendFirstLine = true; @@ -519,7 +519,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TITLE_ON: case HTML_CAPTION_ON: - bCaption = TRUE; + bCaption = sal_True; break; case HTML_TITLE_OFF: case HTML_CAPTION_OFF: diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index 145262376288..47e9c7788478 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -106,19 +106,19 @@ void ORowSetImportExport::initialize() } } // ----------------------------------------------------------------------------- -BOOL ORowSetImportExport::Write() +sal_Bool ORowSetImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORowSetImportExport::Write" ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ORowSetImportExport::Read() +sal_Bool ORowSetImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORowSetImportExport::Read" ); // check if there is any column to copy if(::std::find_if(m_aColumnMapping.begin(),m_aColumnMapping.end(), ::std::bind2nd(::std::greater(),0)) == m_aColumnMapping.end()) - return FALSE; + return sal_False; sal_Int32 nCurrentRow = 0; sal_Int32 nRowFilterIndex = 0; sal_Bool bContinue = sal_True; @@ -164,7 +164,7 @@ BOOL ORowSetImportExport::Read() } } } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- sal_Bool ORowSetImportExport::insertNewRow() diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx index 5df3a10b15b6..6caa215c7543 100644 --- a/dbaccess/source/ui/misc/RtfReader.cxx +++ b/dbaccess/source/ui/misc/RtfReader.cxx @@ -129,7 +129,7 @@ void ORTFReader::NextToken( int nToken ) { int nTmpToken2 = GetNextToken(); - sal_Bool bNext = TRUE; + sal_Bool bNext = sal_True; do { Color aColor; @@ -193,7 +193,7 @@ void ORTFReader::NextToken( int nToken ) eraseTokens(); } - m_bInTbl = TRUE; // jetzt befinden wir uns in einer Tabellenbeschreibung + m_bInTbl = sal_True; // jetzt befinden wir uns in einer Tabellenbeschreibung break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: @@ -250,7 +250,7 @@ void ORTFReader::NextToken( int nToken ) } break; case RTF_INTBL: - m_bInTbl = TRUE; + m_bInTbl = sal_True; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: @@ -295,7 +295,7 @@ sal_Bool ORTFReader::CreateTable(int nToken) if(m_bInTbl) aColumnName.Erase(); - m_bInTbl = TRUE; + m_bInTbl = sal_True; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index b66778138d57..29750de1f00b 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -362,24 +362,24 @@ void ODatabaseImportExport::initialize() m_bInInitialize = sal_False; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Write() +sal_Bool ODatabaseImportExport::Write() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); } // if ( m_bNeedToReInitialize ) - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Read() +sal_Bool ODatabaseImportExport::Read() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); } // if ( m_bNeedToReInitialize ) - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void ODatabaseImportExport::impl_initializeRowMember_throw() @@ -395,7 +395,7 @@ void ODatabaseImportExport::impl_initializeRowMember_throw() } } //====================================================================== -BOOL ORTFImportExport::Write() +sal_Bool ORTFImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORTFImportExport::Write" ); ODatabaseImportExport::Write(); @@ -451,10 +451,10 @@ BOOL ORTFImportExport::Write() } */ - BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); sal_Int32 nColor = 0; if(m_xObject.is()) @@ -618,7 +618,7 @@ BOOL ORTFImportExport::Write() } (*m_pStream) << '}' << ODatabaseImportExport::sNewLine; - (*m_pStream) << (BYTE) 0; + (*m_pStream) << (sal_uInt8) 0; return ((*m_pStream).GetError() == SVSTREAM_OK); } // ----------------------------------------------------------------------------- @@ -641,10 +641,10 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou (*m_pStream) << ODatabaseImportExport::sNewLine; } - const BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - const BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - const BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - const BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + const sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + const sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + const sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + const sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); static const ::rtl::OString aFS2("\\fs20\\f1\\cf0\\cb1"); ::comphelper::ComponentContext aContext(m_xFactory); Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); @@ -691,7 +691,7 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou ++k; } //------------------------------------------------------------------- -BOOL ORTFImportExport::Read() +sal_Bool ORTFImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORTFImportExport::Read" ); ODatabaseImportExport::Read(); @@ -727,7 +727,7 @@ const char __FAR_DATA OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t //======================================================================== #define OUT_PROLOGUE() ((*m_pStream) << sHTML30_Prologue << ODatabaseImportExport::sNewLine << ODatabaseImportExport::sNewLine) #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag ) -#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, FALSE ) +#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, sal_False ) #define OUT_STR( str ) HTMLOutFuncs::Out_String( (*m_pStream), str ) #define OUT_LF() (*m_pStream) << ODatabaseImportExport::sNewLine << GetIndentStr() #define lcl_OUT_LF() (*m_pStream) << ODatabaseImportExport::sNewLine @@ -745,7 +745,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) #ifdef DBG_UTIL - ,m_bCheckFont(FALSE) + ,m_bCheckFont(sal_False) #endif { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::OHTMLImportExport" ); @@ -756,7 +756,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD sIndent[0] = 0; } //------------------------------------------------------------------- -BOOL OHTMLImportExport::Write() +sal_Bool OHTMLImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::Write" ); ODatabaseImportExport::Write(); @@ -775,7 +775,7 @@ BOOL OHTMLImportExport::Write() return sal_False; } //------------------------------------------------------------------- -BOOL OHTMLImportExport::Read() +sal_Bool OHTMLImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::Read" ); ODatabaseImportExport::Read(); @@ -1067,12 +1067,12 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I { fVal = m_xFormatter->convertStringToNumber(nFormat,rValue); ByteString aTmpString(aStrTD); - HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, FALSE, fVal,nFormat, *pFormatter ); + HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, sal_False, fVal,nFormat, *pFormatter ); } catch(Exception&) { ByteString aTmpString(aStrTD); - HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, FALSE, fVal,nFormat, *pFormatter ); + HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, sal_False, fVal,nFormat, *pFormatter ); } } @@ -1080,10 +1080,10 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I FontOn(); - BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); if ( bBold ) TAG_ON( OOO_STRING_SVTOOLS_HTML_bold ); if ( bItalic ) TAG_ON( OOO_STRING_SVTOOLS_HTML_italic ); @@ -1110,7 +1110,7 @@ void OHTMLImportExport::FontOn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOn" ); #ifdef DBG_UTIL - m_bCheckFont = TRUE; + m_bCheckFont = sal_True; #endif // @@ -1143,7 +1143,7 @@ inline void OHTMLImportExport::FontOff() DBG_ASSERT(m_bCheckFont,"Kein FontOn() gerufen"); TAG_OFF( OOO_STRING_SVTOOLS_HTML_font ); #ifdef DBG_UTIL - m_bCheckFont = FALSE; + m_bCheckFont = sal_False; #endif } //----------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 77180a01ac05..0b555662116e 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1643,7 +1643,7 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType return pTypeInfo; } // ----------------------------------------------------------------------------- -sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) +sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) { vos::OGuard aGuard( Application::GetSolarMutex() ); String aMsg = String(ModuleRes(_nText)); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 64b8b536bafc..6dc59632ef4d 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -115,7 +115,7 @@ OCopyTable::OCopyTable( Window * pParent ) ,m_edKeyName( this, ModuleRes( ET_KEYNAME ) ) ,m_pPage2(NULL) ,m_pPage3(NULL) - ,m_bUseHeaderAllowed(TRUE) + ,m_bUseHeaderAllowed(sal_True) { DBG_CTOR(OCopyTable,NULL); @@ -126,7 +126,7 @@ OCopyTable::OCopyTable( Window * pParent ) if ( !m_pParent->supportsViews() ) m_aRB_View.Disable(); - m_aCB_UseHeaderLine.Check(TRUE); + m_aCB_UseHeaderLine.Check(sal_True); m_bPKeyAllowed = m_pParent->supportsPrimaryKey(); m_aCB_PrimaryColumn.Enable(m_bPKeyAllowed); @@ -297,7 +297,7 @@ sal_Bool OCopyTable::LeavePage() void OCopyTable::ActivatePage() { DBG_CHKTHIS(OCopyTable,NULL); - m_pParent->GetOKButton().Enable( TRUE ); + m_pParent->GetOKButton().Enable( sal_True ); m_nOldOperation = m_pParent->getOperation(); m_edTableName.GrabFocus(); m_aCB_UseHeaderLine.Check(m_pParent->UseHeaderLine()); diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 21df5b38b3e3..b4736d216681 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -173,7 +173,7 @@ void OWizColumnSelect::ActivatePage( ) ODatabaseExport::TColumnVector::const_iterator aEnd = pDestColumns->end(); for(;aIter != aEnd;++aIter) { - USHORT nPos = m_lbNewColumnNames.InsertEntry((*aIter)->first); + sal_uInt16 nPos = m_lbNewColumnNames.InsertEntry((*aIter)->first); m_lbNewColumnNames.SetEntryData(nPos,new OFieldDescription(*((*aIter)->second))); m_lbOrgColumnNames.RemoveEntry((*aIter)->first); } @@ -382,7 +382,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, OSL_ENSURE( aPos != pSrcVector->end(),"Invalid position for the iterator here!"); ODatabaseExport::TColumnVector::size_type nPos = (aPos - pSrcVector->begin()) - adjustColumnPosition(_pLeft, _sColumnName, (aPos - pSrcVector->begin()), _aCase); - _pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< USHORT >(nPos)),aSrcIter->second ); + _pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< sal_uInt16 >(nPos)),aSrcIter->second ); _rRightColumns.push_back((*aIter).first); m_pParent->removeColumnNameFromNameMap(_sColumnName); } @@ -393,12 +393,12 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, // not enough. We need to take into acccount what fields have // been removed earlier and adjust accordingly. Based on the // algorithm employed in moveColumn(). -USHORT OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, +sal_uInt16 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, const ::rtl::OUString& _sColumnName, ODatabaseExport::TColumnVector::size_type nCurrentPos, const ::comphelper::TStringMixEqualFunctor& _aCase) { - USHORT nAdjustedPos = 0; + sal_uInt16 nAdjustedPos = 0; // if returning all entries to their original position, // then there is no need to adjust the positions. diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 803554a0094f..9c475971a8d2 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -286,7 +286,7 @@ IMPL_LINK( OWizNameMatching, TableListClickHdl, void*, /*NOTINTERESTEDIN*/ ) SvLBoxEntry* pEntry = m_CTRL_LEFT.FirstSelected(); if(pEntry) { - ULONG nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pEntry); + sal_uLong nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pEntry); SvLBoxEntry* pOldEntry = m_CTRL_RIGHT.FirstSelected(); if(pOldEntry && nPos != m_CTRL_RIGHT.GetModel()->GetAbsPos(pOldEntry)) { @@ -295,7 +295,7 @@ IMPL_LINK( OWizNameMatching, TableListClickHdl, void*, /*NOTINTERESTEDIN*/ ) pOldEntry = m_CTRL_RIGHT.GetEntry(nPos); if(pOldEntry) { - ULONG nNewPos = m_CTRL_LEFT.GetModel()->GetAbsPos(m_CTRL_LEFT.GetFirstEntryInView()); + sal_uLong nNewPos = m_CTRL_LEFT.GetModel()->GetAbsPos(m_CTRL_LEFT.GetFirstEntryInView()); if ( nNewPos - nPos == 1 ) --nNewPos; m_CTRL_RIGHT.MakeVisible(m_CTRL_RIGHT.GetEntry(nNewPos),sal_True); @@ -320,7 +320,7 @@ IMPL_LINK( OWizNameMatching, TableListRightSelectHdl, void*, /*NOTINTERESTEDIN*/ SvLBoxEntry* pEntry = m_CTRL_RIGHT.FirstSelected(); if(pEntry) { - ULONG nPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(pEntry); + sal_uLong nPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(pEntry); SvLBoxEntry* pOldEntry = m_CTRL_LEFT.FirstSelected(); if(pOldEntry && nPos != m_CTRL_LEFT.GetModel()->GetAbsPos(pOldEntry)) { @@ -329,7 +329,7 @@ IMPL_LINK( OWizNameMatching, TableListRightSelectHdl, void*, /*NOTINTERESTEDIN*/ pOldEntry = m_CTRL_LEFT.GetEntry(nPos); if(pOldEntry) { - ULONG nNewPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(m_CTRL_RIGHT.GetFirstEntryInView()); + sal_uLong nNewPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(m_CTRL_RIGHT.GetFirstEntryInView()); if ( nNewPos - nPos == 1 ) nNewPos--; m_CTRL_LEFT.MakeVisible(m_CTRL_LEFT.GetEntry(nNewPos),sal_True); diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index fa72a03269cc..379236321a05 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -158,8 +158,8 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) if ( getMetaData().is() && !getMetaData()->supportsMixedCaseQuotedIdentifiers() ) { bCase = sal_False; - USHORT nCount = aListBox.GetEntryCount(); - for (USHORT i=0 ; !bDoubleName && i < nCount ; ++i) + sal_uInt16 nCount = aListBox.GetEntryCount(); + for (sal_uInt16 i=0 ; !bDoubleName && i < nCount ; ++i) { ::rtl::OUString sEntry(aListBox.GetEntry(i)); bDoubleName = sNewName.equalsIgnoreAsciiCase(sEntry); @@ -360,7 +360,7 @@ void OWizTypeSelect::ActivatePage( ) Reset(); m_bFirstTime = bOldFirstTime; - m_lbColumnNames.SelectEntryPos(static_cast(m_nDisplayRow)); + m_lbColumnNames.SelectEntryPos(static_cast(m_nDisplayRow)); m_nDisplayRow = 0; m_lbColumnNames.GetSelectHdl().Call(&m_lbColumnNames); } diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx index fb35bdcc9e73..ffeb18583ea9 100644 --- a/dbaccess/source/ui/misc/imageprovider.cxx +++ b/dbaccess/source/ui/misc/imageprovider.cxx @@ -99,7 +99,7 @@ namespace dbaui //................................................................ static void lcl_getTableImageResourceID_nothrow( const ImageProvider_Data& _rData, const ::rtl::OUString& _rName, - USHORT& _out_rResourceID, USHORT& _out_rResourceID_HC ) + sal_uInt16& _out_rResourceID, sal_uInt16& _out_rResourceID_HC ) { _out_rResourceID = _out_rResourceID_HC = 0; try @@ -173,8 +173,8 @@ namespace dbaui if ( !_out_rImage || !_out_rImageHC ) { // no -> determine by type - USHORT nImageResourceID = 0; - USHORT nImageResourceID_HC = 0; + sal_uInt16 nImageResourceID = 0; + sal_uInt16 nImageResourceID_HC = 0; lcl_getTableImageResourceID_nothrow( *m_pData, _rName, nImageResourceID, nImageResourceID_HC ); if ( nImageResourceID && !_out_rImage ) @@ -189,16 +189,16 @@ namespace dbaui Image ImageProvider::getDefaultImage( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) { Image aObjectImage; - USHORT nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType, _bHighContrast ) ); + sal_uInt16 nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType, _bHighContrast ) ); if ( nImageResourceID ) aObjectImage = Image( ModuleRes( nImageResourceID ) ); return aObjectImage; } //-------------------------------------------------------------------- - USHORT ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) + sal_uInt16 ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: @@ -223,7 +223,7 @@ namespace dbaui //-------------------------------------------------------------------- Image ImageProvider::getFolderImage( sal_Int32 _nDatabaseObjectType, bool _bHighContrast ) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: -- cgit From 96668046dda0d3a216966b5989ddeb6476f3478b Mon Sep 17 00:00:00 2001 From: Hans-Joachim Lankenau Date: Fri, 28 Jan 2011 12:49:53 +0100 Subject: gnumake3: remove comphelper version; fix including extract.hxx --- dbaccess/source/ui/misc/linkeddocuments.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'dbaccess/source/ui/misc') diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index 4d3472e623b7..67273487832e 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -74,7 +74,7 @@ #include #endif #ifndef _COMPHELPER_EXTRACT_HXX_ -#include +#include #endif #ifndef _COMPHELPER_TYPES_HXX_ #include -- cgit