diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-17 16:09:38 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-17 16:09:38 +0100 |
commit | 41bc9ff8d750b4af10d20a36539c57da14695dcf (patch) | |
tree | dc2ee437c54daba12ac442fd0e10baf97eadf184 /dbaccess/source/ui | |
parent | f6ccb8354a350fce31f8c6c7d04b86d5c0a126d1 (diff) | |
parent | e35c56815d43a06c53488e3efa35f062a6a2d60c (diff) |
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts:
dbaccess/source/core/misc/services.cxx
dbaccess/source/filter/migration/cfgimport.cxx
reportdesign/source/core/api/ReportDefinition.cxx
Diffstat (limited to 'dbaccess/source/ui')
230 files changed, 2928 insertions, 2395 deletions
diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index 6bd3ec193b6f..ee242ea29d33 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -483,10 +483,6 @@ sal_Bool OApplicationController::Construct(Window* _pParent) return sal_False; } - OSL_ENSURE( getView(), "OApplicationController::Construct: have no view!" ); - if ( getView() ) - getView()->enableSeparator( ); - // now that we have a view we can create the clipboard listener m_aSystemClipboard = TransferableDataHelper::CreateFromSystemClipboard( getView() ); m_aSystemClipboard.StartClipboardListening( ); diff --git a/dbaccess/source/ui/app/AppController.hxx b/dbaccess/source/ui/app/AppController.hxx index fd484c686616..8067846c2c1e 100644 --- a/dbaccess/source/ui/app/AppController.hxx +++ b/dbaccess/source/ui/app/AppController.hxx @@ -128,7 +128,7 @@ namespace dbaui OTableCopyHelper m_aTableCopyHelper; TransferableClipboardListener* m_pClipbordNotifier; // notifier for changes in the clipboard - ULONG m_nAsyncDrop; + sal_uLong m_nAsyncDrop; OAsyncronousLink m_aControllerConnectedEvent; OAsyncronousLink m_aSelectContainerEvent; PreviewMode m_ePreviewMode; // the mode of the preview diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index 2b29a33d2632..5d90d8a7c104 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -751,8 +751,8 @@ void OApplicationController::onLoadedMenu(const Reference< ::com::sun::star::fra MenuBar* pMenu = pSystemWindow ? pSystemWindow->GetMenuBar() : NULL; if ( pMenu ) { - USHORT nMenuItems = pMenu->GetItemCount(); - for ( USHORT i = 0; i < nMenuItems; ++i ) + sal_uInt16 nMenuItems = pMenu->GetItemCount(); + for ( sal_uInt16 i = 0; i < nMenuItems; ++i ) aMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) ); } // - the icons should use automatic ones diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 138e2d42f8ec..de34b955bd36 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -139,7 +139,7 @@ namespace class OTablePreviewWindow : public Window { DECL_LINK(OnDisableInput, void*); - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: @@ -162,7 +162,7 @@ namespace // ----------------------------------------------------------------------------- IMPL_LINK(OTablePreviewWindow, OnDisableInput, void*, EMPTYARG) { - EnableInput(FALSE); + EnableInput(sal_False); return 0L; } // ----------------------------------------------------------------------------- @@ -225,7 +225,7 @@ OAppDetailPageHelper::OAppDetailPageHelper(Window* _pParent,OAppBorderWindow& _r m_aTBPreview.SetHelpId(HID_APP_VIEW_PREVIEW_CB); m_aTBPreview.SetDropdownClickHdl( LINK( this, OAppDetailPageHelper, OnDropdownClickHdl ) ); m_aTBPreview.EnableMenuStrings(); - m_aTBPreview.Enable(TRUE); + m_aTBPreview.Enable(sal_True); m_aBorder.SetUniqueId(UID_APP_VIEW_PREVIEW_1); @@ -289,7 +289,7 @@ void OAppDetailPageHelper::selectAll() int nPos = getVisibleControlIndex(); if ( nPos < E_ELEMENT_TYPE_COUNT ) { - m_pLists[nPos]->SelectAll(TRUE); + m_pLists[nPos]->SelectAll(sal_True); } } // ----------------------------------------------------------------------------- @@ -453,7 +453,7 @@ void OAppDetailPageHelper::selectElements(const Sequence< ::rtl::OUString>& _aNa if ( nPos < E_ELEMENT_TYPE_COUNT ) { DBTreeListBox& rTree = *m_pLists[nPos]; - rTree.SelectAll(FALSE); + rTree.SelectAll(sal_False); const ::rtl::OUString* pIter = _aNames.getConstArray(); const ::rtl::OUString* pEnd = pIter + _aNames.getLength(); for(;pIter != pEnd;++pIter) @@ -602,7 +602,7 @@ SvLBoxEntry* OAppDetailPageHelper::getEntry( const Point& _aPosPixel) const SvLBoxEntry* pReturn = NULL; int nPos = getVisibleControlIndex(); if ( nPos < E_ELEMENT_TYPE_COUNT ) - pReturn = m_pLists[nPos]->GetEntry( _aPosPixel,TRUE ); + pReturn = m_pLists[nPos]->GetEntry( _aPosPixel,sal_True ); return pReturn; } // ----------------------------------------------------------------------------- @@ -634,14 +634,14 @@ void OAppDetailPageHelper::createTablesPage(const Reference< XConnection>& _xCon SvLBoxEntry* pEntry = m_pLists[E_TABLE]->First(); if ( pEntry ) m_pLists[E_TABLE]->Expand(pEntry); - m_pLists[E_TABLE]->SelectAll(FALSE); + m_pLists[E_TABLE]->SelectAll(sal_False); } setDetailPage(m_pLists[E_TABLE]); } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::getElementIcons( ElementType _eType, USHORT& _rImageId ) +void OAppDetailPageHelper::getElementIcons( ElementType _eType, sal_uInt16& _rImageId) { ImageProvider aImageProvider; _rImageId = 0; @@ -664,21 +664,22 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA { OSL_ENSURE(E_TABLE != _eType,"E_TABLE isn't allowed."); - USHORT nHelpId = 0, nImageId = 0; + sal_uInt16 nImageId = 0; + rtl::OString sHelpId; ImageProvider aImageProvider; Image aFolderImage; switch( _eType ) { case E_FORM: - nHelpId = HID_APP_FORM_TREE; + sHelpId = HID_APP_FORM_TREE; aFolderImage = aImageProvider.getFolderImage( DatabaseObject::FORM ); break; case E_REPORT: - nHelpId = HID_APP_REPORT_TREE; + sHelpId = HID_APP_REPORT_TREE; aFolderImage = aImageProvider.getFolderImage( DatabaseObject::REPORT ); break; case E_QUERY: - nHelpId = HID_APP_QUERY_TREE; + sHelpId = HID_APP_QUERY_TREE; aFolderImage = aImageProvider.getFolderImage( DatabaseObject::QUERY ); break; default: @@ -688,7 +689,7 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA if ( !m_pLists[_eType] ) { - m_pLists[_eType] = createSimpleTree( nHelpId, aFolderImage ); + m_pLists[_eType] = createSimpleTree( sHelpId, aFolderImage ); } if ( m_pLists[_eType] ) @@ -697,7 +698,7 @@ void OAppDetailPageHelper::createPage(ElementType _eType,const Reference< XNameA { fillNames( _xContainer, _eType, nImageId, NULL ); - m_pLists[_eType]->SelectAll(FALSE); + m_pLists[_eType]->SelectAll(sal_False); } setDetailPage(m_pLists[_eType]); } @@ -711,7 +712,7 @@ void OAppDetailPageHelper::setDetailPage(Window* _pWindow) pCurrent->Hide(); showPreview(NULL); - BOOL bHasFocus = FALSE; + sal_Bool bHasFocus = sal_False; m_aFL.Show(); { bHasFocus = pCurrent->HasChildPathFocus(); @@ -719,7 +720,7 @@ void OAppDetailPageHelper::setDetailPage(Window* _pWindow) } m_aTBPreview.Show(); m_aBorder.Show(); - switchPreview(m_ePreviewMode,TRUE); + switchPreview(m_ePreviewMode,sal_True); if ( bHasFocus ) _pWindow->GrabFocus(); @@ -743,7 +744,7 @@ namespace // ----------------------------------------------------------------------------- void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, SvLBoxEntry* _pParent ) + const sal_uInt16 _nImageId, SvLBoxEntry* _pParent ) { OSL_ENSURE(_xContainer.is(),"Data source is NULL! -> GPF"); OSL_ENSURE( ( _eType >= E_TABLE ) && ( _eType < E_ELEMENT_TYPE_COUNT ), "OAppDetailPageHelper::fillNames: invalid type!" ); @@ -766,7 +767,7 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine Reference<XNameAccess> xSubElements(_xContainer->getByName(*pIter),UNO_QUERY); if ( xSubElements.is() ) { - pEntry = pList->InsertEntry( *pIter, _pParent, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + pEntry = pList->InsertEntry( *pIter, _pParent, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); getBorderWin().getView()->getAppController().containerFound( Reference< XContainer >( xSubElements, UNO_QUERY ) ); fillNames( xSubElements, _eType, _nImageId, pEntry ); } @@ -782,10 +783,10 @@ void OAppDetailPageHelper::fillNames( const Reference< XNameAccess >& _xContaine } } // ----------------------------------------------------------------------------- -DBTreeListBox* OAppDetailPageHelper::createSimpleTree( ULONG _nHelpId, const Image& _rImage ) +DBTreeListBox* OAppDetailPageHelper::createSimpleTree( const rtl::OString& _sHelpId, const Image& _rImage) { DBTreeListBox* pTreeView = new DBTreeListBox(this,getBorderWin().getView()->getORB(),WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); - pTreeView->SetHelpId(_nHelpId); + pTreeView->SetHelpId( _sHelpId ); return createTree( pTreeView, _rImage ); } @@ -794,7 +795,7 @@ DBTreeListBox* OAppDetailPageHelper::createTree( DBTreeListBox* _pTreeView, cons { WaitObject aWaitCursor(this); - _pTreeView->SetWindowBits(WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); + _pTreeView->SetStyle(_pTreeView->GetStyle() | WB_HASLINES | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT | WB_TABSTOP); _pTreeView->GetModel()->SetSortMode(SortAscending); _pTreeView->EnableCheckButton( NULL ); // do not show any buttons _pTreeView->SetSelectionMode(MULTIPLE_SELECTION); @@ -892,13 +893,13 @@ SvLBoxEntry* OAppDetailPageHelper::elementAdded(ElementType _eType,const ::rtl:: } } - USHORT nImageId = 0; + sal_uInt16 nImageId = 0; getElementIcons( _eType, nImageId ); Reference<XNameAccess> xContainer(_rObject,UNO_QUERY); if ( xContainer.is() ) { const sal_Int32 nFolderIndicator = lcl_getFolderIndicatorForType( _eType ); - pRet = pTreeView->InsertEntry( _rName, pEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); + pRet = pTreeView->InsertEntry( _rName, pEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderIndicator ) ); fillNames( xContainer, _eType, nImageId, pRet ); } else @@ -1029,7 +1030,7 @@ sal_Bool OAppDetailPageHelper::isPreviewEnabled() return m_ePreviewMode != E_PREVIEWNONE; } // ----------------------------------------------------------------------------- -void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,BOOL _bForce) +void OAppDetailPageHelper::switchPreview(PreviewMode _eMode,sal_Bool _bForce) { if ( m_ePreviewMode != _eMode || _bForce ) { @@ -1254,7 +1255,7 @@ void OAppDetailPageHelper::KeyInput( const KeyEvent& rKEvt ) OSL_PRECOND( pCurrentView, "OAppDetailPageHelper::KeyInput: how this?" ); KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction(); (void)eFunc; - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); if ( ( KEY_RETURN == nCode ) && pCurrentView ) { @@ -1317,11 +1318,11 @@ OPreviewWindow::OPreviewWindow(Window* _pParent) ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------------- -BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const +sal_Bool OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const { const Size aWinSize( GetOutputSizePixel() ); Size aNewSize( LogicToPixel( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode() ) ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( aNewSize.Width() && aNewSize.Height() ) { @@ -1344,7 +1345,7 @@ BOOL OPreviewWindow::ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangl ( aWinSize.Height() - aNewSize.Height() ) >> 1 ); rResultRect = Rectangle( aNewPos, aNewSize ); - bRet = TRUE; + bRet = sal_True; } return bRet; diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx index 465299e10a23..69a050c8e2ea 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx @@ -70,8 +70,8 @@ namespace dbaui @return <TRUE/> when successfull */ - BOOL ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + sal_Bool ImplGetGraphicCenterRect( const Graphic& rGraphic, Rectangle& rResultRect ) const; + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: @@ -119,7 +119,7 @@ namespace dbaui /** retrieves the resource ids of the images representing elements of the given type */ - void getElementIcons( ElementType _eType, USHORT& _rImageId ); + void getElementIcons( ElementType _eType, sal_uInt16& _rImageId); /** fills the names in the listbox @param _xContainer @@ -133,7 +133,7 @@ namespace dbaui */ void fillNames( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xContainer, const ElementType _eType, - const USHORT _nImageId, + const sal_uInt16 _nImageId, SvLBoxEntry* _pParent ); /** sets the detail page @@ -160,7 +160,7 @@ namespace dbaui @return The new tree. */ - DBTreeListBox* createSimpleTree( ULONG _nHelpId, const Image& _rImage ); + DBTreeListBox* createSimpleTree( const rtl::OString& _sHelpId, const Image& _rImage); DECL_LINK( OnEntryDoubleClick, SvTreeListBox* ); DECL_LINK( OnEntrySelChange, void* ); @@ -344,7 +344,7 @@ namespace dbaui @param _bForce Force the preview to be resetted */ - void switchPreview(PreviewMode _eMode,BOOL _bForce = FALSE); + void switchPreview(PreviewMode _eMode,sal_Bool _bForce = sal_False); /** shows the Preview of the content when it is enabled. @param _xContent diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index 5069fe0643b3..a2259654a858 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -71,7 +71,7 @@ using ::com::sun::star::sdb::application::NamedDatabaseObject; #define SPACEBETWEENENTRIES 4 // ----------------------------------------------------------------------------- -TaskEntry::TaskEntry( const sal_Char* _pAsciiUNOCommand, USHORT _nHelpID, USHORT _nTitleResourceID, bool _bHideWhenDisabled ) +TaskEntry::TaskEntry( const sal_Char* _pAsciiUNOCommand, sal_uInt16 _nHelpID, sal_uInt16 _nTitleResourceID, bool _bHideWhenDisabled ) :sUNOCommand( ::rtl::OUString::createFromAscii( _pAsciiUNOCommand ) ) ,nHelpID( _nHelpID ) ,sTitle( ModuleRes( _nTitleResourceID ) ) @@ -86,7 +86,7 @@ OCreationList::OCreationList( OTasksWindow& _rParent ) ,m_pMouseDownEntry( NULL ) ,m_pLastActiveEntry( NULL ) { - USHORT nSize = SPACEBETWEENENTRIES; + sal_uInt16 nSize = SPACEBETWEENENTRIES; SetSpaceBetweenEntries(nSize); SetSelectionMode( NO_SELECTION ); SetExtendedWinBits( EWB_NO_AUTO_CURENTRY ); @@ -116,7 +116,7 @@ void OCreationList::PreparePaint( SvLBoxEntry* _pEntry ) { // draw a selection background bool bIsMouseDownEntry = ( _pEntry == m_pMouseDownEntry ); - DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, FALSE, TRUE, FALSE ); + DrawSelectionBackground( GetBoundingRect( _pEntry ), bIsMouseDownEntry ? 1 : 2, sal_False, sal_True, sal_False ); if ( bIsMouseDownEntry ) { @@ -148,7 +148,7 @@ void OCreationList::SelectSearchEntry( const void* _pEntry ) } // ----------------------------------------------------------------------------- -void OCreationList::ExecuteSearchEntry( const void* _pEntry ) +void OCreationList::ExecuteSearchEntry( const void* _pEntry ) const { SvLBoxEntry* pEntry = const_cast< SvLBoxEntry* >( static_cast< const SvLBoxEntry* >( _pEntry ) ); OSL_ENSURE( pEntry, "OCreationList::ExecuteSearchEntry: invalid entry!" ); @@ -307,7 +307,7 @@ bool OCreationList::setCurrentEntryInvalidate( SvLBoxEntry* _pEntry ) // ----------------------------------------------------------------------------- void OCreationList::updateHelpText() { - USHORT nHelpTextId = 0; + sal_uInt16 nHelpTextId = 0; if ( GetCurEntry() ) nHelpTextId = reinterpret_cast< TaskEntry* >( GetCurEntry()->GetUserData() )->nHelpID; m_rTaskWindow.setHelpText( nHelpTextId ); @@ -424,7 +424,7 @@ void OTasksWindow::ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_B m_aDescription.SetControlFont(aFont); } // ----------------------------------------------------------------------------- -void OTasksWindow::setHelpText(USHORT _nId) +void OTasksWindow::setHelpText(sal_uInt16 _nId) { DBG_CHKTHIS(OTasksWindow,NULL); if ( _nId ) @@ -518,7 +518,7 @@ void OTasksWindow::fillTaskEntryList( const TaskEntryList& _rList ) } m_aCreation.Show(); - m_aCreation.SelectAll(FALSE); + m_aCreation.SelectAll(sal_False); m_aHelpText.Show(); m_aDescription.Show(); m_aFL.Show(); diff --git a/dbaccess/source/ui/app/AppDetailView.hxx b/dbaccess/source/ui/app/AppDetailView.hxx index 06aa8ecb4411..df890bbafb4b 100644 --- a/dbaccess/source/ui/app/AppDetailView.hxx +++ b/dbaccess/source/ui/app/AppDetailView.hxx @@ -86,7 +86,7 @@ namespace dbaui // IMnemonicEntryList virtual void SelectSearchEntry( const void* _pEntry ); - virtual void ExecuteSearchEntry( const void* _pEntry ); + virtual void ExecuteSearchEntry( const void* _pEntry ) const; private: void onSelected( SvLBoxEntry* _pEntry ) const; @@ -99,14 +99,14 @@ namespace dbaui struct TaskEntry { ::rtl::OUString sUNOCommand; - USHORT nHelpID; + sal_uInt16 nHelpID; String sTitle; bool bHideWhenDisabled; // TODO: we should be consistent in the task pane and the menus/toolbars: // If an entry is disabled in the latter, it should also be disabled in the former. // If an entry is *hidden* in the former, it should also be hidden in the latter. - TaskEntry( const sal_Char* _pAsciiUNOCommand, USHORT _nHelpID, USHORT _nTitleResourceID, bool _bHideWhenDisabled = false ); + TaskEntry( const sal_Char* _pAsciiUNOCommand, sal_uInt16 _nHelpID, sal_uInt16 _nTitleResourceID, bool _bHideWhenDisabled = false ); }; typedef ::std::vector< TaskEntry > TaskEntryList; @@ -115,7 +115,7 @@ namespace dbaui /// the tasks available in the pane TaskEntryList aTasks; /// the resource ID for the title of the pane - USHORT nTitleId; + sal_uInt16 nTitleId; }; class OTasksWindow : public Window @@ -127,7 +127,7 @@ namespace dbaui OApplicationDetailView* m_pDetailView; DECL_LINK( OnEntrySelectHdl, SvTreeListBox* ); - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: @@ -148,7 +148,7 @@ namespace dbaui } void Clear(); - void setHelpText(USHORT _nId); + void setHelpText(sal_uInt16 _nId); }; //================================================================== class OApplicationDetailView : public OSplitterView @@ -162,7 +162,7 @@ namespace dbaui ::std::vector< TaskPaneData > m_aTaskPaneData; MnemonicGenerator m_aExternalMnemonics; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); diff --git a/dbaccess/source/ui/app/AppIconControl.cxx b/dbaccess/source/ui/app/AppIconControl.cxx index 2fb94bb6b77f..c6c3f2e480a2 100644 --- a/dbaccess/source/ui/app/AppIconControl.cxx +++ b/dbaccess/source/ui/app/AppIconControl.cxx @@ -53,9 +53,9 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent) struct CategoryDescriptor { - USHORT nLabelResId; + sal_uInt16 nLabelResId; ElementType eType; - USHORT nImageResId; + sal_uInt16 nImageResId; } aCategories[] = { { RID_STR_TABLES_CONTAINER, E_TABLE, IMG_TABLEFOLDER_TREE_L }, { RID_STR_QUERIES_CONTAINER, E_QUERY, IMG_QUERYFOLDER_TREE_L }, @@ -71,14 +71,14 @@ OApplicationIconControl::OApplicationIconControl(Window* _pParent) pEntry->SetUserData( new ElementType( aCategories[i].eType ) ); } - SetChoiceWithCursor( TRUE ); + SetChoiceWithCursor( sal_True ); SetSelectionMode(SINGLE_SELECTION); } // ----------------------------------------------------------------------------- OApplicationIconControl::~OApplicationIconControl() { - ULONG nCount = GetEntryCount(); - for ( ULONG i = 0; i < nCount; ++i ) + sal_uLong nCount = GetEntryCount(); + for ( sal_uLong i = 0; i < nCount; ++i ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry( i ); if ( pEntry ) diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx index fc8e885928e7..36475115d972 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.cxx +++ b/dbaccess/source/ui/app/AppSwapWindow.cxx @@ -124,7 +124,7 @@ void OApplicationSwapWindow::DataChanged( const DataChangedEvent& rDCEvt ) void OApplicationSwapWindow::clearSelection() { m_aIconControl.SetNoSelection(); - ULONG nPos = 0; + sal_uLong nPos = 0; SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); if ( pEntry ) m_aIconControl.InvalidateEntry(pEntry); @@ -151,7 +151,7 @@ bool OApplicationSwapWindow::interceptKeyInput( const KeyEvent& _rEvent ) // ----------------------------------------------------------------------------- ElementType OApplicationSwapWindow::getElementType() const { - ULONG nPos = 0; + sal_uLong nPos = 0; SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); return ( pEntry ) ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE; } @@ -176,7 +176,7 @@ bool OApplicationSwapWindow::onContainerSelected( ElementType _eType ) // ----------------------------------------------------------------------------- IMPL_LINK(OApplicationSwapWindow, OnContainerSelectHdl, SvtIconChoiceCtrl*, _pControl) { - ULONG nPos = 0; + sal_uLong nPos = 0; SvxIconChoiceCtrlEntry* pEntry = _pControl->GetSelectedEntry( nPos ); ElementType eType = E_NONE; if ( pEntry ) @@ -196,9 +196,9 @@ IMPL_LINK(OApplicationSwapWindow, ChangeToLastSelected, void*, EMPTYARG) // ----------------------------------------------------------------------------- void OApplicationSwapWindow::selectContainer(ElementType _eType) { - ULONG nCount = m_aIconControl.GetEntryCount(); + sal_uLong nCount = m_aIconControl.GetEntryCount(); SvxIconChoiceCtrlEntry* pEntry = NULL; - for (ULONG i=0; i < nCount; ++i) + for (sal_uLong i=0; i < nCount; ++i) { pEntry = m_aIconControl.GetEntry(i); if ( pEntry && *static_cast<ElementType*>(pEntry->GetUserData()) == _eType ) diff --git a/dbaccess/source/ui/app/AppSwapWindow.hxx b/dbaccess/source/ui/app/AppSwapWindow.hxx index bc5cd2abb1df..89d535806bd9 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.hxx +++ b/dbaccess/source/ui/app/AppSwapWindow.hxx @@ -44,7 +44,7 @@ namespace dbaui ElementType m_eLastType; OAppBorderWindow& m_rBorderWin; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); DECL_LINK( OnContainerSelectHdl, SvtIconChoiceCtrl* ); DECL_LINK( ChangeToLastSelected, void* ); @@ -65,8 +65,8 @@ namespace dbaui inline void cut() { } inline void paste() { } - inline ULONG GetEntryCount() const { return m_aIconControl.GetEntryCount(); } - inline SvxIconChoiceCtrlEntry* GetEntry( ULONG nPos ) const { return m_aIconControl.GetEntry(nPos); } + inline sal_uLong GetEntryCount() const { return m_aIconControl.GetEntryCount(); } + inline SvxIconChoiceCtrlEntry* GetEntry( sal_uLong nPos ) const { return m_aIconControl.GetEntry(nPos); } inline Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const { return m_aIconControl.GetBoundingBox(pEntry); } /** automatically creates mnemonics for the icon/texts in our left hand side panel diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx index f487353a5163..e2473432e8cc 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.cxx +++ b/dbaccess/source/ui/app/AppTitleWindow.cxx @@ -38,7 +38,7 @@ namespace dbaui { DBG_NAME(OTitleWindow) -OTitleWindow::OTitleWindow(Window* _pParent,USHORT _nTitleId,WinBits _nBits,BOOL _bShift) +OTitleWindow::OTitleWindow(Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,sal_Bool _bShift) : Window(_pParent,_nBits | WB_DIALOGCONTROL) , m_aSpace1(this) , m_aSpace2(this) @@ -100,7 +100,7 @@ void OTitleWindow::Resize() } } // ----------------------------------------------------------------------------- -void OTitleWindow::setTitle(USHORT _nTitleId) +void OTitleWindow::setTitle(sal_uInt16 _nTitleId) { if ( _nTitleId != 0 ) { diff --git a/dbaccess/source/ui/app/AppTitleWindow.hxx b/dbaccess/source/ui/app/AppTitleWindow.hxx index 8f230d9d9e1c..ab1719977f23 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.hxx +++ b/dbaccess/source/ui/app/AppTitleWindow.hxx @@ -38,12 +38,12 @@ namespace dbaui FixedText m_aSpace2; FixedText m_aTitle; Window* m_pChild; - BOOL m_bShift; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + sal_Bool m_bShift; + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); public: - OTitleWindow(Window* _pParent,USHORT _nTitleId,WinBits _nBits,BOOL _bShift = TRUE); + OTitleWindow(Window* _pParent,sal_uInt16 _nTitleId,WinBits _nBits,sal_Bool _bShift = sal_True); virtual ~OTitleWindow(); // window overloads @@ -67,7 +67,7 @@ namespace dbaui @param _nTitleId The resource id of the title text. */ - void setTitle(USHORT _nTitleId); + void setTitle(sal_uInt16 _nTitleId); /** Gets the min Width in Pixel which is needed to display the whole diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 19584f86646d..4974a3ef6333 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -83,7 +83,7 @@ OAppBorderWindow::OAppBorderWindow(OApplicationView* _pParent,PreviewMode _ePrev SetBorderStyle(WINDOW_BORDER_MONO); - m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL ,FALSE); + m_pPanel = new OTitleWindow(this,STR_DATABASE,WB_BORDER | WB_DIALOGCONTROL ,sal_False); m_pPanel->SetBorderStyle(WINDOW_BORDER_MONO); OApplicationSwapWindow* pSwap = new OApplicationSwapWindow( m_pPanel, *this ); pSwap->Show(); diff --git a/dbaccess/source/ui/app/app.src b/dbaccess/source/ui/app/app.src index b723d282bb14..431f434fcea3 100644 --- a/dbaccess/source/ui/app/app.src +++ b/dbaccess/source/ui/app/app.src @@ -111,14 +111,12 @@ Menu RID_MENU_APP_NEW MenuItem { Identifier = SID_APP_NEW_FORM; - HelpId = SID_APP_NEW_FORM; Command = ".uno:DBNewForm"; Text [ en-US ] = "Form..." ; }; MenuItem { Identifier = SID_APP_NEW_REPORT; - HelpId = SID_APP_NEW_REPORT; Command = ".uno:DBNewReport"; Text [ en-US ] = "Report..." ; }; @@ -154,7 +152,6 @@ Menu RID_MENU_APP_NEW MenuItem { Identifier = SID_DB_NEW_VIEW_SQL; - HelpId = SID_DB_NEW_VIEW_SQL; Command = ".uno:DBNewViewSQL"; Text [ en-US ] = "View (Simple)..." ; }; @@ -177,7 +174,6 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_PASTE_SPECIAL; - HelpID = SID_DB_APP_PASTE_SPECIAL ; Text[ en-US ] = "Paste Special..."; Command = ".uno:PasteSpecial"; }; @@ -188,42 +184,36 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_DELETE; - HelpID = SID_DB_APP_DELETE ; Text[ en-US ] = "Delete"; Command = ".uno:DBDelete"; }; MenuItem { Identifier = SID_DB_APP_RENAME; - HelpID = SID_DB_APP_RENAME ; Text[ en-US ] = "Rename"; Command = ".uno:DBRename"; }; MenuItem { Identifier = SID_DB_APP_EDIT; - HelpID = SID_DB_APP_EDIT ; Text[ en-US ] = "Edit"; Command = ".uno:DBEdit"; }; MenuItem { Identifier = SID_DB_APP_EDIT_SQL_VIEW; - HelpID = SID_DB_APP_EDIT_SQL_VIEW ; Text [ en-US ] = "Edit in SQL View..."; Command = ".uno:DBEditSqlView"; }; MenuItem { Identifier = SID_DB_APP_OPEN; - HelpID = SID_DB_APP_OPEN ; Text[ en-US ] = "Open"; Command = ".uno:DBOpen"; }; MenuItem { Identifier = SID_DB_APP_CONVERTTOVIEW; - HelpID = SID_DB_APP_CONVERTTOVIEW ; Text[ en-US ] = "Create as View"; Command = ".uno:DBConvertToView"; }; @@ -236,14 +226,12 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_APP_NEW_REPORT_PRE_SEL; - HelpId = SID_APP_NEW_REPORT_PRE_SEL; Command = ".uno:DBNewReportWithPreSelection"; Text [ en-US ] = "Report..." ; }; MenuItem { Identifier = SID_REPORT_CREATE_REPWIZ_PRE_SEL ; - HelpID = HID_DOCUMENT_CREATE_REPWIZ ; Text[ en-US ] = "Report Wizard..."; Command = ".uno:DBNewReportAutoPilotWithPreSelection"; @@ -255,7 +243,6 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_SELECTALL; - HelpID = SID_SELECTALL ; Text[ en-US ] = "Select All"; Command = ".uno:SelectAll"; }; @@ -274,21 +261,18 @@ Menu RID_MENU_APP_EDIT MenuItem { Identifier = SID_DB_APP_DSPROPS; - HelpID = SID_DB_APP_DSPROPS ; Text[ en-US ] = "Properties"; Command = ".uno:DBDSProperties"; }; MenuItem { Identifier = SID_DB_APP_DSCONNECTION_TYPE; - HelpID = SID_DB_APP_DSCONNECTION_TYPE ; Text[ en-US ] = "Connection Type"; Command = ".uno:DBDSConnectionType"; }; MenuItem { Identifier = SID_DB_APP_DSADVANCED_SETTINGS; - HelpID = SID_DB_APP_DSADVANCED_SETTINGS ; Text[ en-US ] = "Advanced Settings"; Command = ".uno:DBDSAdvancedSettings"; }; @@ -410,7 +394,6 @@ Menu RID_MENU_APP_PREVIEW MenuItem { Identifier = SID_DB_APP_DISABLE_PREVIEW; - HelpId = SID_DB_APP_DISABLE_PREVIEW; Text[ en-US ] = "None"; Command = ".uno:DBDisablePreview"; Checkable = TRUE; @@ -420,7 +403,6 @@ Menu RID_MENU_APP_PREVIEW MenuItem { Identifier = SID_DB_APP_VIEW_DOCINFO_PREVIEW; - HelpId = SID_DB_APP_VIEW_DOCINFO_PREVIEW; Text[ en-US ] = "Document Information"; Command = ".uno:DBShowDocInfoPreview"; Checkable = TRUE; @@ -430,7 +412,6 @@ Menu RID_MENU_APP_PREVIEW MenuItem { Identifier = SID_DB_APP_VIEW_DOC_PREVIEW; - HelpId = SID_DB_APP_VIEW_DOC_PREVIEW; Text[ en-US ] = "Document"; Command = ".uno:DBShowDocPreview"; Checkable = TRUE; diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx index da2acef4be09..0a60b4c9a2e9 100644 --- a/dbaccess/source/ui/browser/brwctrlr.cxx +++ b/dbaccess/source/ui/browser/brwctrlr.cxx @@ -739,6 +739,26 @@ sal_Bool SbaXDataBrowserController::reloadForm( const Reference< XLoadable >& _r if (::comphelper::getBOOL(xFormSet->getPropertyValue(PROPERTY_ESCAPE_PROCESSING))) xFormSet->getPropertyValue(PROPERTY_SINGLESELECTQUERYCOMPOSER) >>= m_xParser; + { + const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY ); + const Reference< XSingleSelectQueryAnalyzer > xAnalyzer( xRowSetProps->getPropertyValue( PROPERTY_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY ); + if ( xAnalyzer.is() ) + { + const Reference< XIndexAccess > xOrderColumns( xAnalyzer->getOrderColumns(), UNO_SET_THROW ); + const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); + for ( sal_Int32 c=0; c<nOrderColumns; ++c ) + { + const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); + ::rtl::OUString sColumnName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName); + ::rtl::OUString sTableName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName); + (void)sColumnName; + (void)sTableName; + } + } + } + Reference< XWarningsSupplier > xWarnings( _rxLoadable, UNO_QUERY ); if ( xWarnings.is() ) { @@ -809,7 +829,8 @@ sal_Bool SbaXDataBrowserController::Construct(Window* pParent) m_xColumnsSupplier.set(m_xRowSet,UNO_QUERY); m_xLoadable.set(m_xRowSet,UNO_QUERY); - if (!InitializeForm(m_xRowSet)) + Reference< XPropertySet > xFormProperties( m_xRowSet, UNO_QUERY ); + if ( !InitializeForm( xFormProperties ) ) return sal_False; m_xGridModel = CreateGridModel(); @@ -1207,11 +1228,7 @@ void SbaXDataBrowserController::propertyChange(const PropertyChangeEvent& evt) t } - // the filter or the sort criterias have changed ? -> update our parser - if (evt.PropertyName.equals(PROPERTY_ACTIVECOMMAND)) - { - } - else if (evt.PropertyName.equals(PROPERTY_FILTER)) + if (evt.PropertyName.equals(PROPERTY_FILTER)) { InvalidateFeature(ID_BROWSER_REMOVEFILTER); } @@ -1851,25 +1868,50 @@ void SbaXDataBrowserController::applyParserFilter(const ::rtl::OUString& _rOldFi setCurrentColumnPosition(nPos); } + //------------------------------------------------------------------------------ Reference< XSingleSelectQueryComposer > SbaXDataBrowserController::createParser_nothrow() { - Reference< XSingleSelectQueryComposer > xRet; + Reference< XSingleSelectQueryComposer > xComposer; try { - Reference< XPropertySet > xFormSet(getRowSet(), UNO_QUERY_THROW); - const Reference<XMultiServiceFactory> xFactory(::dbtools::getConnection(getRowSet()),UNO_QUERY_THROW); - xRet.set(xFactory->createInstance(SERVICE_NAME_SINGLESELECTQUERYCOMPOSER),UNO_QUERY_THROW); - xRet->setElementaryQuery(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ACTIVECOMMAND))); - xRet->setFilter(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_FILTER))); - xRet->setHavingClause(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_HAVING_CLAUSE))); - xRet->setOrder(::comphelper::getString(xFormSet->getPropertyValue(PROPERTY_ORDER))); + const Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); + const Reference< XMultiServiceFactory > xFactory( + xRowSetProps->getPropertyValue( PROPERTY_ACTIVE_CONNECTION ), UNO_QUERY_THROW ); + xComposer.set( xFactory->createInstance( SERVICE_NAME_SINGLESELECTQUERYCOMPOSER ), UNO_QUERY_THROW ); + + ::rtl::OUString sActiveCommand; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ACTIVECOMMAND ) >>= sActiveCommand ); + if ( sActiveCommand.getLength() > 0 ) + { + xComposer->setElementaryQuery( sActiveCommand ); + } + else + { + ::rtl::OUString sCommand; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND ) >>= sCommand ); + sal_Int32 nCommandType = CommandType::COMMAND; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_COMMAND_TYPE ) >>= nCommandType ); + xComposer->setCommand( sCommand, nCommandType ); + } + + ::rtl::OUString sFilter; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_FILTER ) >>= sFilter ); + xComposer->setFilter( sFilter ); + + ::rtl::OUString sHavingClause; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_HAVING_CLAUSE ) >>= sHavingClause ); + xComposer->setHavingClause( sHavingClause ); + + ::rtl::OUString sOrder; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ORDER ) >>= sOrder ); + xComposer->setOrder( sOrder ); } - catch(Exception&) + catch ( const Exception& ) { DBG_UNHANDLED_EXCEPTION(); } - return xRet; + return xComposer; } //------------------------------------------------------------------------------ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) @@ -1891,10 +1933,8 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter) { DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() ); String aFilter; - if(!aDlg.Execute()) - { - return; // if so we don't need to actualize the grid - } + if ( !aDlg.Execute() ) + return; // if so we don't need to update the grid aDlg.BuildWherePart(); } else diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index f7286e6a9377..337cd3b01177 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -334,8 +334,8 @@ long UnoDataBrowserView::PreNotify( NotifyEvent& rNEvt ) { const KeyEvent* pKeyEvt = rNEvt.GetKeyEvent(); const KeyCode& rKeyCode = pKeyEvt->GetKeyCode(); - if ( ( rKeyCode == KeyCode( KEY_E, TRUE, TRUE, FALSE, FALSE ) ) - || ( rKeyCode == KeyCode( KEY_TAB, TRUE, FALSE, FALSE, FALSE ) ) + if ( ( rKeyCode == KeyCode( KEY_E, sal_True, sal_True, sal_False, sal_False ) ) + || ( rKeyCode == KeyCode( KEY_TAB, sal_True, sal_False, sal_False, sal_False ) ) ) { if ( m_pTreeView && m_pVclControl && m_pTreeView->HasChildPathFocus() ) diff --git a/dbaccess/source/ui/browser/dataview.cxx b/dbaccess/source/ui/browser/dataview.cxx index c0e3157bfb75..ff4817eba056 100644 --- a/dbaccess/source/ui/browser/dataview.cxx +++ b/dbaccess/source/ui/browser/dataview.cxx @@ -35,7 +35,6 @@ #include <comphelper/namedvaluecollection.hxx> #include <sfx2/app.hxx> #include <sfx2/imgmgr.hxx> -#include <vcl/fixed.hxx> #include "IController.hxx" #include "UITools.hxx" #include <sfx2/sfx.hrc> @@ -84,11 +83,12 @@ namespace dbaui :Window(pParent,nStyle) ,m_xServiceFactory(_rFactory) ,m_rController( _rController ) - ,m_pSeparator( NULL ) + ,m_aSeparator( this ) { DBG_CTOR(ODataView,NULL); m_rController.acquire(); m_pAccel.reset(::svt::AcceleratorExecute::createAcceleratorHelper()); + m_aSeparator.Show(); } // ------------------------------------------------------------------------- @@ -101,30 +101,10 @@ namespace dbaui { DBG_DTOR(ODataView,NULL); - enableSeparator( sal_False ); m_rController.release(); } // ------------------------------------------------------------------------- - void ODataView::enableSeparator( const sal_Bool _bEnable ) - { - if ( _bEnable == isSeparatorEnabled() ) - // nothing to do - return; - - if ( _bEnable ) - { - m_pSeparator = new FixedLine( this ); - m_pSeparator->Show( ); - } - else - { - ::std::auto_ptr<FixedLine> aTemp(m_pSeparator); - m_pSeparator = NULL; - } - Resize(); - } - // ------------------------------------------------------------------------- void ODataView::resizeDocumentView( Rectangle& /*_rPlayground*/ ) { } @@ -148,15 +128,10 @@ namespace dbaui { Rectangle aPlayground( _rPlayground ); - // position thew separator - if ( m_pSeparator ) - { - Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); - - m_pSeparator->SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); - - aPlayground.Top() += aSeparatorSize.Height() + 1; - } + // position the separator + const Size aSeparatorSize = Size( aPlayground.GetWidth(), 2 ); + m_aSeparator.SetPosSizePixel( aPlayground.TopLeft(), aSeparatorSize ); + aPlayground.Top() += aSeparatorSize.Height() + 1; // position the controls of the document's view resizeDocumentView( aPlayground ); diff --git a/dbaccess/source/ui/browser/dbexchange.cxx b/dbaccess/source/ui/browser/dbexchange.cxx index 21b4fc2d2172..0273c7f5a746 100644 --- a/dbaccess/source/ui/browser/dbexchange.cxx +++ b/dbaccess/source/ui/browser/dbexchange.cxx @@ -180,7 +180,7 @@ namespace dbaui // ----------------------------------------------------------------------------- sal_Bool ODataClipboard::GetData( const DataFlavor& rFlavor ) { - const ULONG nFormat = SotExchange::GetFormat(rFlavor); + const sal_uLong nFormat = SotExchange::GetFormat(rFlavor); switch (nFormat) { case SOT_FORMAT_RTF: diff --git a/dbaccess/source/ui/browser/dbtreemodel.hxx b/dbaccess/source/ui/browser/dbtreemodel.hxx index b0afe70a5fe1..12ce3ed3925a 100644 --- a/dbaccess/source/ui/browser/dbtreemodel.hxx +++ b/dbaccess/source/ui/browser/dbtreemodel.hxx @@ -42,8 +42,8 @@ // tables holds the nameaccess for the tables // table holds the table -#define CONTAINER_QUERIES ULONG( 0 ) -#define CONTAINER_TABLES ULONG( 1 ) +#define CONTAINER_QUERIES sal_uLong( 0 ) +#define CONTAINER_TABLES sal_uLong( 1 ) namespace com { namespace sun { namespace star { namespace lang { class XMultiServiceFactory; } } } } diff --git a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx index 18a9b471e602..f9fe22be550b 100644 --- a/dbaccess/source/ui/browser/dsEntriesNoExp.cxx +++ b/dbaccess/source/ui/browser/dsEntriesNoExp.cxx @@ -243,8 +243,8 @@ void SbaTableQueryBrowser::notifyHiContrastChanged() } // find the proper item, and set its icons - USHORT nCount = pEntryLoop->ItemCount(); - for (USHORT i=0;i<nCount;++i) + sal_uInt16 nCount = pEntryLoop->ItemCount(); + for (sal_uInt16 i=0;i<nCount;++i) { SvLBoxItem* pItem = pEntryLoop->GetItem(i); if ( !pItem || ( pItem->IsA() != SV_ITEM_ID_LBOXCONTEXTBMP ) ) diff --git a/dbaccess/source/ui/browser/exsrcbrw.cxx b/dbaccess/source/ui/browser/exsrcbrw.cxx index 0b3e76a54115..68053fbbc234 100644 --- a/dbaccess/source/ui/browser/exsrcbrw.cxx +++ b/dbaccess/source/ui/browser/exsrcbrw.cxx @@ -124,7 +124,7 @@ Reference< XRowSet > SbaExternalSourceBrowser::CreateForm() } //------------------------------------------------------------------------------ -sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XRowSet > & /*xForm*/) +sal_Bool SbaExternalSourceBrowser::InitializeForm(const Reference< XPropertySet > & /*i_formProperties*/) { return sal_True; } diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx index d17750d96319..f82912466ef1 100644 --- a/dbaccess/source/ui/browser/genericcontroller.cxx +++ b/dbaccess/source/ui/browser/genericcontroller.cxx @@ -336,7 +336,7 @@ void SAL_CALL OGenericUnoController::initialize( const Sequence< Any >& aArgumen throw RuntimeException( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unable to create a view")), *this ); if ( m_bReadOnly || m_bPreview ) - pView->EnableInput( FALSE ); + pView->EnableInput( sal_False ); impl_initialize(); } @@ -635,6 +635,18 @@ void OGenericUnoController::InvalidateFeature_Impl() // ----------------------------------------------------------------------- void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, sal_Bool _bForceBroadcast ) { +#if OSL_DEBUG_LEVEL > 0 + if ( _nId != -1 ) + { + SupportedFeatures::iterator aFeaturePos = ::std::find_if( + m_aSupportedFeatures.begin(), + m_aSupportedFeatures.end(), + ::std::bind2nd( CompareFeatureById(), _nId ) + ); + OSL_ENSURE( aFeaturePos != m_aSupportedFeatures.end(), "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" ); + } +#endif + FeatureListener aListener; aListener.nId = _nId; aListener.xListener = _xListener; @@ -1318,9 +1330,9 @@ void OGenericUnoController::openHelpAgent(rtl::OUString const& _suHelpStringURL openHelpAgent( aURL ); } -void OGenericUnoController::openHelpAgent(sal_Int32 _nHelpId) +void OGenericUnoController::openHelpAgent(const rtl::OString& _sHelpId) { - openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _nHelpId ) ); + openHelpAgent( createHelpAgentURL( lcl_getModuleHelpModuleName( getFrame() ), _sHelpId ) ); } void OGenericUnoController::openHelpAgent( const URL& _rURL ) diff --git a/dbaccess/source/ui/browser/sbabrw.src b/dbaccess/source/ui/browser/sbabrw.src index 59a841993472..eebcc013788d 100644 --- a/dbaccess/source/ui/browser/sbabrw.src +++ b/dbaccess/source/ui/browser/sbabrw.src @@ -188,14 +188,12 @@ Menu RID_MENU_REFRESH_DATA MenuItem { MID_SBA_QRY_REFRESH - HelpId = SID_FM_REFRESH ; Command = ".uno:Refresh"; }; MenuItem { Identifier = ID_BROWSER_REFRESH_REBUILD; Command = ".uno:DBRebuildData"; - HelpId = HID_BROWSER_REFRESH_REBUILDVIEW; Text [ en-US ] = "Rebuild"; }; }; diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 1489be5f92b0..d80a80281ae3 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -811,7 +811,7 @@ SbaGridControl::SbaGridControl(Reference< XMultiServiceFactory > _rM, :FmGridControl(_rM,pParent, _pPeer, nBits) ,m_pMasterListener(NULL) ,m_nAsyncDropEvent(0) - ,m_nCurrentActionColId((USHORT)-1) + ,m_nCurrentActionColId((sal_uInt16)-1) ,m_bActivatingForDrop(sal_False) { DBG_CTOR(SbaGridControl ,NULL); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index f1e9e467dd45..418a1bdef48b 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -68,6 +68,7 @@ #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/XGridColumnFactory.hpp> #include <com/sun/star/form/XLoadable.hpp> +#include <com/sun/star/form/XReset.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <com/sun/star/lang/DisposedException.hpp> @@ -420,8 +421,146 @@ sal_Bool SbaTableQueryBrowser::Construct(Window* pParent) return sal_True; } -// ------------------------------------------------------------------------- -sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star::sdbc::XRowSet > & _rxForm) +// --------------------------------------------------------------------------------------------------------------------- +namespace +{ + // ----------------------------------------------------------------------------------------------------------------- + struct SelectValueByName : public ::std::unary_function< ::rtl::OUString, Any > + { + const Any& operator()( ::rtl::OUString const& i_name ) const + { + return m_rCollection.get( i_name ); + } + + SelectValueByName( ::comphelper::NamedValueCollection const& i_collection ) + :m_rCollection( i_collection ) + { + } + + ::comphelper::NamedValueCollection const& m_rCollection; + }; +} + +// --------------------------------------------------------------------------------------------------------------------- +void SbaTableQueryBrowser::impl_sanitizeRowSetClauses_nothrow() +{ + try + { + Reference< XPropertySet > xRowSetProps( getRowSet(), UNO_QUERY_THROW ); + sal_Bool bEscapeProcessing = sal_False; + OSL_VERIFY( xRowSetProps->getPropertyValue( PROPERTY_ESCAPE_PROCESSING ) >>= bEscapeProcessing ); + if ( !bEscapeProcessing ) + // don't touch or interpret anything if escape processing is disabled + return; + + Reference< XSingleSelectQueryComposer > xComposer( createParser_nothrow() ); + if ( !xComposer.is() ) + // can't do anything. Already reported via assertion in createParser_nothrow. + return; + + // the tables participating in the statement + const Reference< XTablesSupplier > xSuppTables( xComposer, UNO_QUERY_THROW ); + const Reference< XNameAccess > xTableNames( xSuppTables->getTables(), UNO_QUERY_THROW ); + + // the columns participating in the statement + const Reference< XColumnsSupplier > xSuppColumns( xComposer, UNO_QUERY_THROW ); + const Reference< XNameAccess > xColumnNames( xSuppColumns->getColumns(), UNO_QUERY_THROW ); + + // ............................................................................................................. + // check if the order columns apply to tables which really exist in the statement + const Reference< XIndexAccess > xOrderColumns( xComposer->getOrderColumns(), UNO_SET_THROW ); + const sal_Int32 nOrderColumns( xOrderColumns->getCount() ); + bool invalidColumn = false; + for ( sal_Int32 c=0; ( c < nOrderColumns ) && !invalidColumn; ++c ) + { + const Reference< XPropertySet > xOrderColumn( xOrderColumns->getByIndex(c), UNO_QUERY_THROW ); + ::rtl::OUString sTableName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_TABLENAME ) >>= sTableName ); + ::rtl::OUString sColumnName; + OSL_VERIFY( xOrderColumn->getPropertyValue( PROPERTY_NAME ) >>= sColumnName ); + + if ( sTableName.getLength() == 0 ) + { + if ( !xColumnNames->hasByName( sColumnName ) ) + { + invalidColumn = true; + break; + } + } + else + { + if ( !xTableNames->hasByName( sTableName ) ) + { + invalidColumn = true; + break; + } + + const Reference< XColumnsSupplier > xSuppTableColumns( xTableNames->getByName( sTableName ), UNO_QUERY_THROW ); + const Reference< XNameAccess > xTableColumnNames( xSuppTableColumns->getColumns(), UNO_QUERY_THROW ); + if ( !xTableColumnNames->hasByName( sColumnName ) ) + { + invalidColumn = true; + break; + } + } + } + + if ( invalidColumn ) + { + // reset the complete order statement at both the row set and the parser + const ::rtl::OUString sEmptyOrder; + xRowSetProps->setPropertyValue( PROPERTY_ORDER, makeAny( sEmptyOrder ) ); + xComposer->setOrder( sEmptyOrder ); + } + + // ............................................................................................................. + // check if the columns participating in the filter refer to existing tables + // TODO: there's no API at all for this. The method which comes nearest to what we need is + // "getStructuredFilter", but it returns pure column names only. That is, for a statement like + // "SELECT * FROM <table> WHERE <other_table>.<column> = <value>", it will return "<column>". But + // there's no API at all to retrieve the information about "<other_table>" - which is what would + // be needed here. + // That'd be a chance to replace getStructuredFilter with something more reasonable. This method + // has at least one other problem: For a clause like "<column> != <value>", it will return "<column>" + // as column name, "NOT_EQUAL" as operator, and "!= <value>" as value, effectively duplicating the + // information about the operator, and beding all clients to manually remove the "!=" from the value + // string. + // So, what really would be handy, is some + // XNormalizedFilter getNormalizedFilter(); + // with + // interface XDisjunctiveFilterExpression + // { + // XConjunctiveFilterTerm getTerm( int index ); + // } + // interface XConjunctiveFilterTerm + // { + // ComparisonPredicate getPredicate( int index ); + // } + // struct ComparisonPredicate + // { + // XComparisonOperand Lhs; + // SQLFilterOperator Operator; + // XComparisonOperand Rhs; + // } + // interface XComparisonOperand + // { + // SQLFilterOperand Type; + // XPropertySet getColumn(); + // string getLiteral(); + // ... + // } + // enum SQLFilterOperand { Column, Literal, ... } + // + // ... or something like this .... + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +// --------------------------------------------------------------------------------------------------------------------- +sal_Bool SbaTableQueryBrowser::InitializeForm( const Reference< XPropertySet > & i_formProperties ) { if(!m_pCurrentlyDisplayed) return sal_True; @@ -429,50 +568,46 @@ sal_Bool SbaTableQueryBrowser::InitializeForm(const Reference< ::com::sun::star: // this method set all format settings from the orignal table or query try { - // we send all properties at once, maybe the implementation is clever enough to handle one big PropertiesChanged - // more effective than many small PropertyChanged ;) - Sequence< ::rtl::OUString> aProperties(3); - Sequence< Any> aValues(3); - DBTreeListUserData* pData = static_cast<DBTreeListUserData*>(m_pCurrentlyDisplayed->GetUserData()); - OSL_ENSURE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" ); - OSL_ENSURE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" ); + ENSURE_OR_RETURN_FALSE( pData, "SbaTableQueryBrowser::InitializeForm: No user data set at the currently displayed entry!" ); + ENSURE_OR_RETURN_FALSE( pData->xObjectProperties.is(), "SbaTableQueryBrowser::InitializeForm: No table available!" ); + + Reference< XPropertySetInfo > xPSI( pData->xObjectProperties->getPropertySetInfo(), UNO_SET_THROW ); + + ::comphelper::NamedValueCollection aPropertyValues; - if ( pData->xObjectProperties.is() ) + const ::rtl::OUString aTransferProperties[] = { - sal_Int32 nPos = 0; - // is the filter intially applied ? - aProperties.getArray()[nPos] = PROPERTY_APPLYFILTER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_APPLYFILTER); + PROPERTY_APPLYFILTER, + PROPERTY_FILTER, + PROPERTY_HAVING_CLAUSE, + PROPERTY_ORDER + }; + for ( size_t i=0; i < sizeof( aTransferProperties ) / sizeof( aTransferProperties[0] ); ++i ) + { + if ( !xPSI->hasPropertyByName( aTransferProperties[i] ) ) + continue; + aPropertyValues.put( aTransferProperties[i], pData->xObjectProperties->getPropertyValue( aTransferProperties[i] ) ); + } - // the initial filter - aProperties.getArray()[nPos] = PROPERTY_FILTER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_FILTER); + const ::std::vector< ::rtl::OUString > aNames( aPropertyValues.getNames() ); + Sequence< ::rtl::OUString > aPropNames( aNames.size() ); + ::std::copy( aNames.begin(), aNames.end(), aPropNames.getArray() ); - if ( pData->xObjectProperties->getPropertySetInfo()->hasPropertyByName(PROPERTY_HAVING_CLAUSE) ) - { - aProperties.realloc(aProperties.getLength()+1); - aValues.realloc(aValues.getLength()+1); - // the initial having clause - aProperties.getArray()[nPos] = PROPERTY_HAVING_CLAUSE; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_HAVING_CLAUSE); - } + Sequence< Any > aPropValues( aNames.size() ); + ::std::transform( aNames.begin(), aNames.end(), aPropValues.getArray(), SelectValueByName( aPropertyValues ) ); - // the initial ordering - aProperties.getArray()[nPos] = PROPERTY_ORDER; - aValues.getArray()[nPos++] = pData->xObjectProperties->getPropertyValue(PROPERTY_ORDER); + Reference< XMultiPropertySet > xFormMultiSet( i_formProperties, UNO_QUERY_THROW ); + xFormMultiSet->setPropertyValues( aPropNames, aPropValues ); - Reference< XMultiPropertySet > xFormMultiSet(_rxForm, UNO_QUERY); - xFormMultiSet->setPropertyValues(aProperties, aValues); - } + impl_sanitizeRowSetClauses_nothrow(); } - catch(Exception&) + catch ( const Exception& ) { - OSL_FAIL("SbaTableQueryBrowser::InitializeForm : something went wrong !"); + DBG_UNHANDLED_EXCEPTION(); return sal_False; } - return sal_True; } @@ -481,8 +616,8 @@ void SbaTableQueryBrowser::initializePreviewMode() { if ( getBrowserView() && getBrowserView()->getVclControl() ) { - getBrowserView()->getVclControl()->AlwaysEnableInput( FALSE ); - getBrowserView()->getVclControl()->EnableInput( FALSE ); + getBrowserView()->getVclControl()->AlwaysEnableInput( sal_False ); + getBrowserView()->getVclControl()->EnableInput( sal_False ); getBrowserView()->getVclControl()->ForceHideScrollbars( sal_True ); } Reference< XPropertySet > xDataSourceSet(getRowSet(), UNO_QUERY); @@ -602,6 +737,7 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::std::vector< NamedValue > aInitialValues; ::std::vector< ::rtl::OUString > aCopyProperties; + Any aDefault; switch(nType) { @@ -618,6 +754,8 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "TriState" ) ), makeAny( sal_Bool( ColumnValue::NO_NULLS != nNullable ) ) ) ); + if ( ColumnValue::NO_NULLS == nNullable ) + aDefault <<= (sal_Int16)STATE_NOCHECK; } break; @@ -659,18 +797,17 @@ sal_Bool SbaTableQueryBrowser::InitializeGridModel(const Reference< ::com::sun:: Reference< XPropertySetInfo > xGridColPSI( xGridCol->getPropertySetInfo(), UNO_SET_THROW ); // calculate the default - Any aDefault; if ( xGridColPSI->hasPropertyByName( PROPERTY_CONTROLDEFAULT ) ) - aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT ); - - // default value - if ( nType == DataType::BIT || nType == DataType::BOOLEAN ) { - if ( aDefault.hasValue() ) - aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK; - else - aDefault <<= ((sal_Int16)STATE_DONTKNOW); - + aDefault = xColumn->getPropertyValue( PROPERTY_CONTROLDEFAULT ); + // default value + if ( nType == DataType::BIT || nType == DataType::BOOLEAN ) + { + if ( aDefault.hasValue() ) + aDefault <<= (comphelper::getString(aDefault).toInt32() == 0) ? (sal_Int16)STATE_NOCHECK : (sal_Int16)STATE_CHECK; + else + aDefault <<= ((sal_Int16)STATE_DONTKNOW); + } } if ( aDefault.hasValue() ) @@ -2004,7 +2141,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb m_pTreeView->getListBox().InsertEntry( _rQueryName, _rQueryImage, _rQueryImage, pDatasourceEntry, - TRUE /*ChildsOnDemand*/, LIST_APPEND, pQueriesData ); + sal_True /*ChildsOnDemand*/, LIST_APPEND, pQueriesData ); } // the child for the tables container @@ -2014,7 +2151,7 @@ void SbaTableQueryBrowser::implAddDatasource(const String& _rDbName, Image& _rDb m_pTreeView->getListBox().InsertEntry( _rTableName, _rTableImage, _rTableImage, pDatasourceEntry, - TRUE /*ChildsOnDemand*/, LIST_APPEND, pTablesData ); + sal_True /*ChildsOnDemand*/, LIST_APPEND, pTablesData ); } } @@ -2289,77 +2426,82 @@ sal_Bool SbaTableQueryBrowser::implSelect(const ::svx::ODataAccessDescriptor& _r sal_Bool SbaTableQueryBrowser::implLoadAnything(const ::rtl::OUString& _rDataSourceName, const ::rtl::OUString& _rCommand, const sal_Int32 _nCommandType, const sal_Bool _bEscapeProcessing, const SharedConnection& _rxConnection) { - Reference<XPropertySet> xProp(getRowSet(),UNO_QUERY); - if(xProp.is()) + try { - Reference< ::com::sun::star::form::XLoadable > xLoadable(xProp,UNO_QUERY); - try + Reference<XPropertySet> xProp( getRowSet(), UNO_QUERY_THROW ); + Reference< XLoadable > xLoadable( xProp, UNO_QUERY_THROW ); + // the values allowing the RowSet to re-execute + xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName)); + if(_rxConnection.is()) + xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) ); + + // set this _before_ setting the connection, else the rowset would rebuild it ... + xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(_nCommandType)); + xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand)); + xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing)); + if ( m_bPreview ) { - // the values allowing the RowSet to re-execute - xProp->setPropertyValue(PROPERTY_DATASOURCENAME, makeAny(_rDataSourceName)); - if(_rxConnection.is()) - xProp->setPropertyValue( PROPERTY_ACTIVE_CONNECTION, makeAny( _rxConnection.getTyped() ) ); - - // set this _before_ setting the connection, else the rowset would rebuild it ... - xProp->setPropertyValue(PROPERTY_COMMAND_TYPE, makeAny(_nCommandType)); - xProp->setPropertyValue(PROPERTY_COMMAND, makeAny(_rCommand)); - xProp->setPropertyValue(PROPERTY_ESCAPE_PROCESSING, ::cppu::bool2any(_bEscapeProcessing)); - if ( m_bPreview ) - { - xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); - } + xProp->setPropertyValue(PROPERTY_FETCHDIRECTION, makeAny(FetchDirection::FORWARD)); + } - // the formatter depends on the data source we're working on, so rebuild it here ... - initFormatter(); + // the formatter depends on the data source we're working on, so rebuild it here ... + initFormatter(); - // switch the grid to design mode while loading - getBrowserView()->getGridControl()->setDesignMode(sal_True); - InitializeForm(getRowSet()); + // switch the grid to design mode while loading + getBrowserView()->getGridControl()->setDesignMode(sal_True); + InitializeForm( xProp ); - sal_Bool bSuccess = sal_True; + sal_Bool bSuccess = sal_True; + { { - { - Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY); - // first we have to clear the grid - clearGridColumns(xColContainer); - } - FormErrorHelper aHelper(this); - // load the form - bSuccess = reloadForm(xLoadable); - - // initialize the model - InitializeGridModel(getFormComponent()); - - if ( m_bPreview ) - initializePreviewMode(); - - LoadFinished(sal_True); + Reference< XNameContainer > xColContainer(getFormComponent(), UNO_QUERY); + // first we have to clear the grid + clearGridColumns(xColContainer); } + FormErrorHelper aHelper(this); + // load the form + bSuccess = reloadForm(xLoadable); - InvalidateAll(); - return bSuccess; - } - catch( const SQLException& e ) - { - Any aException( ::cppu::getCaughtException() ); - showError( SQLExceptionInfo( aException ) ); - } - catch( const WrappedTargetException& e ) - { - SQLException aSql; - if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) - showError( SQLExceptionInfo( e.TargetException ) ); - else + // initialize the model + InitializeGridModel(getFormComponent()); + + Any aVal = xProp->getPropertyValue(PROPERTY_ISNEW); + if (aVal.hasValue() && ::comphelper::getBOOL(aVal)) { - DBG_UNHANDLED_EXCEPTION(); + // then set the default values and the parameters given from the parent + Reference< XReset> xReset(xProp, UNO_QUERY); + xReset->reset(); } + + if ( m_bPreview ) + initializePreviewMode(); + + LoadFinished(sal_True); } - catch(Exception&) + + InvalidateAll(); + return bSuccess; + } + catch( const SQLException& e ) + { + Any aException( ::cppu::getCaughtException() ); + showError( SQLExceptionInfo( aException ) ); + } + catch( const WrappedTargetException& e ) + { + SQLException aSql; + if ( e.TargetException.isExtractableTo( ::cppu::UnoType< SQLException >::get() ) ) + showError( SQLExceptionInfo( e.TargetException ) ); + else { DBG_UNHANDLED_EXCEPTION(); } } + catch(Exception&) + { + DBG_UNHANDLED_EXCEPTION(); + } InvalidateAll(); return sal_False; diff --git a/dbaccess/source/ui/control/ColumnControlWindow.cxx b/dbaccess/source/ui/control/ColumnControlWindow.cxx index db9bd6809d7a..36c89d858be5 100644 --- a/dbaccess/source/ui/control/ColumnControlWindow.cxx +++ b/dbaccess/source/ui/control/ColumnControlWindow.cxx @@ -93,7 +93,7 @@ void OColumnControlWindow::DeactivateAggregate( EControlType eType ) } } // ----------------------------------------------------------------------------- -void OColumnControlWindow::CellModified(long /*nRow*/, USHORT /*nColId*/ ) +void OColumnControlWindow::CellModified(long /*nRow*/, sal_uInt16 /*nColId*/ ) { saveCurrentFieldDescData(); } diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 484126c82da9..3e66ab51e027 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -814,7 +814,7 @@ void OFieldDescControl::ArrangeAggregates() { Control* pctrlInputControl; // das eigentliche Control zur Eingabe Control* pctrlTextControl; // das Label dazu - USHORT nPosSizeArgument; // das zweite Argument fuer SetPosSize + sal_uInt16 nPosSizeArgument; // das zweite Argument fuer SetPosSize }; AGGREGATE_DESCRIPTION adAggregates[] = { { m_pColumnName, m_pColumnNameText, 1}, @@ -1068,9 +1068,9 @@ void OFieldDescControl::ActivateAggregate( EControlType eType ) } } // ----------------------------------------------------------------------------- -void OFieldDescControl::InitializeControl(Control* _pControl,ULONG _nHelpId,bool _bAddChangeHandler) +void OFieldDescControl::InitializeControl(Control* _pControl,const ::rtl::OString& _sHelpId,bool _bAddChangeHandler) { - _pControl->SetHelpId(_nHelpId); + _pControl->SetHelpId(_sHelpId); if ( _bAddChangeHandler ) ((OPropListBoxCtrl*)_pControl)->SetSelectHdl(LINK(this,OFieldDescControl,ChangeHdl)); @@ -1079,7 +1079,7 @@ void OFieldDescControl::InitializeControl(Control* _pControl,ULONG _nHelpId,bool _pControl->EnableClipSiblings(); } // ----------------------------------------------------------------------------- -FixedText* OFieldDescControl::CreateText(USHORT _nTextRes) +FixedText* OFieldDescControl::CreateText(sal_uInt16 _nTextRes) { FixedText* pFixedText = new FixedText( this ); pFixedText->SetText( ModuleRes(_nTextRes) ); @@ -1087,15 +1087,15 @@ FixedText* OFieldDescControl::CreateText(USHORT _nTextRes) return pFixedText; } // ----------------------------------------------------------------------------- -OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(USHORT _nHelpStr,short _nProperty,ULONG _nHelpId) +OPropNumericEditCtrl* OFieldDescControl::CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const rtl::OString& _sHelpId) { OPropNumericEditCtrl* pControl = new OPropNumericEditCtrl( this, _nHelpStr, _nProperty, WB_BORDER ); pControl->SetDecimalDigits(0); pControl->SetMin(0); pControl->SetMax(0x7FFFFFFF); // soll draussen geaendert werden, wenn noetig - pControl->SetStrictFormat(TRUE); + pControl->SetStrictFormat(sal_True); - InitializeControl(pControl,_nHelpId,false); + InitializeControl(pControl,_sHelpId,false); return pControl; } @@ -1535,7 +1535,7 @@ void OFieldDescControl::DisplayData(OFieldDescription* pFieldDescr ) if(m_pType) { - USHORT nPos = pFieldType.get() ? m_pType->GetEntryPos(String(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; + sal_uInt16 nPos = pFieldType.get() ? m_pType->GetEntryPos(String(pFieldDescr->getTypeInfo()->aUIName)) : LISTBOX_ENTRY_NOTFOUND; if(nPos == LISTBOX_ENTRY_NOTFOUND) { const OTypeInfoMap* pMap = getTypeInfo(); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 2c9ab0b8b841..df2ac9b6e4b6 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -74,14 +74,14 @@ namespace dbaui Reference< XPropertySet> m_xDestDef; - void fillListBox(const Reference< XPropertySet>& _xDest,long nRow,USHORT nColumnId); + void fillListBox(const Reference< XPropertySet>& _xDest,long nRow,sal_uInt16 nColumnId); /** returns the column id for the editbrowsebox @param _nColId the column id SOURCE_COLUMN or DEST_COLUMN @return the current column id eihter SOURCE_COLUMN or DEST_COLUMN depends on the connection data */ - USHORT getColumnIdent( USHORT _nColId ) const; + sal_uInt16 getColumnIdent( sal_uInt16 _nColId ) const; public: ORelationControl( OTableListBoxControl* pParent,const OJoinTableView::OTableWindowMap* _pTableMap ); virtual ~ORelationControl(); @@ -107,16 +107,16 @@ namespace dbaui virtual long PreNotify(NotifyEvent& rNEvt ); - virtual BOOL IsTabAllowed(BOOL bForward) const; + virtual sal_Bool IsTabAllowed(sal_Bool bForward) const; virtual void Init(const TTableConnectionData::value_type& _pConnData); virtual void Init() { ORelationControl_Base::Init(); } - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol ); - virtual ::svt::CellController* GetController( long nRow, USHORT nCol ); - virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const; - virtual BOOL SeekRow( long nRow ); - virtual BOOL SaveModified(); - virtual String GetCellText( long nRow, USHORT nColId ) const; + virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ); + virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ); + virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId ) const; + virtual sal_Bool SeekRow( long nRow ); + virtual sal_Bool SaveModified(); + virtual String GetCellText( long nRow, sal_uInt16 nColId ) const; virtual void CellModified(); @@ -188,7 +188,7 @@ namespace dbaui // not the first call RowRemoved(0, GetRowCount()); - RowInserted(0, m_pConnData->GetConnLineDataList()->size() + 1, TRUE); // add one extra row + RowInserted(0, m_pConnData->GetConnLineDataList()->size() + 1, sal_True); // add one extra row } //------------------------------------------------------------------------------ void ORelationControl::Resize() @@ -227,20 +227,20 @@ namespace dbaui } //------------------------------------------------------------------------------ - BOOL ORelationControl::IsTabAllowed(BOOL bForward) const + sal_Bool ORelationControl::IsTabAllowed(sal_Bool bForward) const { DBG_CHKTHIS(ORelationControl,NULL); long nRow = GetCurRow(); - USHORT nCol = GetCurColumnId(); + sal_uInt16 nCol = GetCurColumnId(); - BOOL bRet = !(( ( bForward && (nCol == DEST_COLUMN) && (nRow == GetRowCount() - 1))) + sal_Bool bRet = !(( ( bForward && (nCol == DEST_COLUMN) && (nRow == GetRowCount() - 1))) || (!bForward && (nCol == SOURCE_COLUMN) && (nRow == 0))); return bRet && EditBrowseBox::IsTabAllowed(bForward); } //------------------------------------------------------------------------------ - BOOL ORelationControl::SaveModified() + sal_Bool ORelationControl::SaveModified() { DBG_CHKTHIS(ORelationControl,NULL); sal_Int32 nRow = GetCurRow(); @@ -267,19 +267,19 @@ namespace dbaui } } - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ - USHORT ORelationControl::getColumnIdent( USHORT _nColId ) const + sal_uInt16 ORelationControl::getColumnIdent( sal_uInt16 _nColId ) const { - USHORT nId = _nColId; + sal_uInt16 nId = _nColId; if ( m_pConnData->getReferencingTable() != m_pBoxControl->getReferencingTable() ) nId = ( _nColId == SOURCE_COLUMN) ? DEST_COLUMN : SOURCE_COLUMN; return nId; } //------------------------------------------------------------------------------ - String ORelationControl::GetCellText( long nRow, USHORT nColId ) const + String ORelationControl::GetCellText( long nRow, sal_uInt16 nColId ) const { DBG_CHKTHIS(ORelationControl,NULL); String sText; @@ -300,22 +300,22 @@ namespace dbaui } //------------------------------------------------------------------------------ - void ORelationControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId ) + void ORelationControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(ORelationControl,NULL); - ULONG nHelpId = HID_RELATIONDIALOG_LEFTFIELDCELL; + rtl::OString sHelpId( HID_RELATIONDIALOG_LEFTFIELDCELL ); Reference< XPropertySet> xDef; switch ( getColumnIdent(nColumnId) ) { case SOURCE_COLUMN: xDef = m_xSourceDef; - nHelpId = HID_RELATIONDIALOG_LEFTFIELDCELL; + sHelpId = HID_RELATIONDIALOG_LEFTFIELDCELL; break; case DEST_COLUMN: xDef = m_xDestDef; - nHelpId = HID_RELATIONDIALOG_RIGHTFIELDCELL; + sHelpId = HID_RELATIONDIALOG_RIGHTFIELDCELL; break; default: // ????????? @@ -333,27 +333,27 @@ namespace dbaui m_pListCell->SelectEntry( sName ); } - m_pListCell->SetHelpId(nHelpId); + m_pListCell->SetHelpId(sHelpId); } } //------------------------------------------------------------------------------ - CellController* ORelationControl::GetController( long /*nRow*/, USHORT /*nColumnId*/ ) + CellController* ORelationControl::GetController( long /*nRow*/, sal_uInt16 /*nColumnId*/ ) { DBG_CHKTHIS(ORelationControl,NULL); return new ListBoxCellController( m_pListCell.get() ); } //------------------------------------------------------------------------------ - BOOL ORelationControl::SeekRow( long nRow ) + sal_Bool ORelationControl::SeekRow( long nRow ) { DBG_CHKTHIS(ORelationControl,NULL); m_nDataPos = nRow; - return TRUE; + return sal_True; } //------------------------------------------------------------------------------ - void ORelationControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const + void ORelationControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(ORelationControl,NULL); String aText =const_cast< ORelationControl*>(this)->GetCellText( m_nDataPos, nColumnId ); @@ -371,7 +371,7 @@ namespace dbaui rDev.SetClipRegion(); } // ----------------------------------------------------------------------------- - void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest,long /*_nRow*/,USHORT /*nColumnId*/) + void ORelationControl::fillListBox(const Reference< XPropertySet>& _xDest,long /*_nRow*/,sal_uInt16 /*nColumnId*/) { m_pListCell->Clear(); try @@ -400,7 +400,7 @@ namespace dbaui void ORelationControl::setWindowTables(const OTableWindow* _pSource,const OTableWindow* _pDest) { // wenn ich hier gerade editiere, ausblenden - BOOL bWasEditing = IsEditing(); + sal_Bool bWasEditing = IsEditing(); if ( bWasEditing ) DeactivateCell(); @@ -636,7 +636,7 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent if ( pLines->size() >= static_cast<sal_uInt32>(m_pRC_Tables->GetRowCount()) ) { m_pRC_Tables->DeactivateCell(); - m_pRC_Tables->RowInserted(m_pRC_Tables->GetRowCount(), pLines->size() - static_cast<sal_uInt32>(m_pRC_Tables->GetRowCount()) + 1, TRUE); + m_pRC_Tables->RowInserted(m_pRC_Tables->GetRowCount(), pLines->size() - static_cast<sal_uInt32>(m_pRC_Tables->GetRowCount()) + 1, sal_True); m_pRC_Tables->ActivateCell(); } } @@ -691,9 +691,9 @@ OTableListBoxControl::OTableListBoxControl( Window* _pParent m_pRC_Tables->lateInit(); } // ----------------------------------------------------------------------------- - BOOL OTableListBoxControl::SaveModified() + sal_Bool OTableListBoxControl::SaveModified() { - BOOL bRet = m_pRC_Tables->SaveModified(); + sal_Bool bRet = m_pRC_Tables->SaveModified(); m_pRC_Tables->getData()->normalizeLines(); return bRet; } diff --git a/dbaccess/source/ui/control/TableGrantCtrl.cxx b/dbaccess/source/ui/control/TableGrantCtrl.cxx index 991dca50d804..afb6fa777352 100644 --- a/dbaccess/source/ui/control/TableGrantCtrl.cxx +++ b/dbaccess/source/ui/control/TableGrantCtrl.cxx @@ -46,14 +46,14 @@ using namespace ::com::sun::star::uno; using namespace ::dbaui; using namespace ::svt; -const USHORT COL_TABLE_NAME = 1; -const USHORT COL_SELECT = 2; -const USHORT COL_INSERT = 3; -const USHORT COL_DELETE = 4; -const USHORT COL_UPDATE = 5; -const USHORT COL_ALTER = 6; -const USHORT COL_REF = 7; -const USHORT COL_DROP = 8; +const sal_uInt16 COL_TABLE_NAME = 1; +const sal_uInt16 COL_SELECT = 2; +const sal_uInt16 COL_INSERT = 3; +const sal_uInt16 COL_DELETE = 4; +const sal_uInt16 COL_UPDATE = 5; +const sal_uInt16 COL_ALTER = 6; +const sal_uInt16 COL_REF = 7; +const sal_uInt16 COL_DROP = 8; DBG_NAME(OTableGrantControl) @@ -65,13 +65,13 @@ OTableGrantControl::OTableGrantControl( Window* pParent,const ResId& _RsId) ,m_pCheckCell( NULL ) ,m_pEdit( NULL ) ,m_nDataPos( 0 ) - ,m_bEnable(TRUE) + ,m_bEnable(sal_True) ,m_nDeactivateEvent(0) { DBG_CTOR(OTableGrantControl,NULL); ////////////////////////////////////////////////////////////////////// // Spalten einfuegen - USHORT i=1; + sal_uInt16 i=1; InsertDataColumn( i, String(ModuleRes(STR_TABLE_PRIV_NAME) ), 75); FreezeColumn(i++); InsertDataColumn( i++, String(ModuleRes(STR_TABLE_PRIV_SELECT)), 75); @@ -144,11 +144,11 @@ void OTableGrantControl::Init() if(!m_pCheckCell) { m_pCheckCell = new CheckBoxControl( &GetDataWindow() ); - m_pCheckCell->GetBox().EnableTriState(FALSE); + m_pCheckCell->GetBox().EnableTriState(sal_False); m_pEdit = new Edit( &GetDataWindow() ); m_pEdit->SetReadOnly(); - m_pEdit->Enable(FALSE); + m_pEdit->Enable(sal_False); } UpdateTables(); @@ -204,17 +204,17 @@ IMPL_LINK(OTableGrantControl, AsynchDeactivate, void*, EMPTYARG) } //------------------------------------------------------------------------------ -BOOL OTableGrantControl::IsTabAllowed(BOOL bForward) const +sal_Bool OTableGrantControl::IsTabAllowed(sal_Bool bForward) const { DBG_CHKTHIS(OTableGrantControl,NULL); long nRow = GetCurRow(); - USHORT nCol = GetCurColumnId(); + sal_uInt16 nCol = GetCurColumnId(); if (bForward && (nCol == 2) && (nRow == GetRowCount() - 1)) - return FALSE; + return sal_False; if (!bForward && (nCol == 1) && (nRow == 0)) - return FALSE; + return sal_False; return EditBrowseBox::IsTabAllowed(bForward); } @@ -226,16 +226,16 @@ BOOL OTableGrantControl::IsTabAllowed(BOOL bForward) const xAuth->revokePrivileges(sTableName,PrivilegeObject::TABLE,what) //------------------------------------------------------------------------------ -BOOL OTableGrantControl::SaveModified() +sal_Bool OTableGrantControl::SaveModified() { DBG_CHKTHIS(OTableGrantControl,NULL); sal_Int32 nRow = GetCurRow(); if(nRow == -1 || nRow >= m_aTableNames.getLength()) - return FALSE; + return sal_False; ::rtl::OUString sTableName = m_aTableNames[nRow]; - BOOL bErg = TRUE; + sal_Bool bErg = sal_True; try { @@ -274,7 +274,7 @@ BOOL OTableGrantControl::SaveModified() } catch(SQLException& e) { - bErg = FALSE; + bErg = sal_False; ::dbaui::showError(::dbtools::SQLExceptionInfo(e),GetParent(),m_xORB); } if(bErg && Controller().Is()) @@ -286,7 +286,7 @@ BOOL OTableGrantControl::SaveModified() } //------------------------------------------------------------------------------ -String OTableGrantControl::GetCellText( long nRow, USHORT nColId ) const +String OTableGrantControl::GetCellText( long nRow, sal_uInt16 nColId ) const { DBG_CHKTHIS(OTableGrantControl,NULL); if(COL_TABLE_NAME == nColId) @@ -301,7 +301,7 @@ String OTableGrantControl::GetCellText( long nRow, USHORT nColId ) const } //------------------------------------------------------------------------------ -void OTableGrantControl::InitController( CellControllerRef& /*rController*/, long nRow, USHORT nColumnId ) +void OTableGrantControl::InitController( CellControllerRef& /*rController*/, long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(OTableGrantControl,NULL); String sTablename = m_aTableNames[nRow]; @@ -312,7 +312,7 @@ void OTableGrantControl::InitController( CellControllerRef& /*rController*/, lon { // get the privileges from the user TTablePrivilegeMap::const_iterator aFind = findPrivilege(nRow); - m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() ? isAllowed(nColumnId,aFind->second.nRights) : FALSE); + m_pCheckCell->GetBox().Check(aFind != m_aPrivMap.end() ? isAllowed(nColumnId,aFind->second.nRights) : sal_False); } } // ----------------------------------------------------------------------------- @@ -347,7 +347,7 @@ void OTableGrantControl::fillPrivilege(sal_Int32 _nRow) const } } // ----------------------------------------------------------------------------- -sal_Bool OTableGrantControl::isAllowed(USHORT _nColumnId,sal_Int32 _nPrivilege) const +sal_Bool OTableGrantControl::isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivilege) const { sal_Bool bAllowed = sal_False; switch (_nColumnId) @@ -389,7 +389,7 @@ void OTableGrantControl::setGrantUser(const Reference< XAuthorizable>& _xGrantUs m_xGrantUser = _xGrantUser; } //------------------------------------------------------------------------------ -CellController* OTableGrantControl::GetController( long nRow, USHORT nColumnId ) +CellController* OTableGrantControl::GetController( long nRow, sal_uInt16 nColumnId ) { DBG_CHKTHIS(OTableGrantControl,NULL); @@ -417,7 +417,7 @@ CellController* OTableGrantControl::GetController( long nRow, USHORT nColumnId ) return pController; } //------------------------------------------------------------------------------ -BOOL OTableGrantControl::SeekRow( long nRow ) +sal_Bool OTableGrantControl::SeekRow( long nRow ) { DBG_CHKTHIS(OTableGrantControl,NULL); m_nDataPos = nRow; @@ -426,7 +426,7 @@ BOOL OTableGrantControl::SeekRow( long nRow ) } //------------------------------------------------------------------------------ -void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColumnId ) const +void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColumnId ) const { DBG_CHKTHIS(OTableGrantControl,NULL); @@ -436,7 +436,7 @@ void OTableGrantControl::PaintCell( OutputDevice& rDev, const Rectangle& rRect, if(aFind != m_aPrivMap.end()) PaintTristate(rDev, rRect, isAllowed(nColumnId,aFind->second.nRights) ? STATE_CHECK : STATE_NOCHECK,isAllowed(nColumnId,aFind->second.nWithGrant)); else - PaintTristate(rDev, rRect, STATE_NOCHECK,FALSE); + PaintTristate(rDev, rRect, STATE_NOCHECK,sal_False); } else { @@ -477,11 +477,11 @@ OTableGrantControl::TTablePrivilegeMap::const_iterator OTableGrantControl::findP // ----------------------------------------------------------------------------- Reference< XAccessible > OTableGrantControl::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos ) { - USHORT nColumnId = GetColumnId( _nColumnPos ); + sal_uInt16 nColumnId = GetColumnId( _nColumnPos ); if(nColumnId != COL_TABLE_NAME) { TriState eState = STATE_NOCHECK; - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; TTablePrivilegeMap::const_iterator aFind = findPrivilege(_nRow); if(aFind != m_aPrivMap.end()) { diff --git a/dbaccess/source/ui/control/charsetlistbox.cxx b/dbaccess/source/ui/control/charsetlistbox.cxx index 040e1fd41242..cc092ccfe3b3 100644 --- a/dbaccess/source/ui/control/charsetlistbox.cxx +++ b/dbaccess/source/ui/control/charsetlistbox.cxx @@ -99,7 +99,7 @@ namespace dbaui } //-------------------------------------------------------------------- - bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, const USHORT _nItemId ) + bool CharSetListBox::StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ) { bool bChangedSomething = false; if ( GetSelectEntryPos() != GetSavedValue() ) diff --git a/dbaccess/source/ui/control/curledit.cxx b/dbaccess/source/ui/control/curledit.cxx index 70d7a6450448..d649647e70b0 100644 --- a/dbaccess/source/ui/control/curledit.cxx +++ b/dbaccess/source/ui/control/curledit.cxx @@ -41,7 +41,7 @@ namespace dbaui //========================================================================= //= OConnectionURLEdit //========================================================================= -OConnectionURLEdit::OConnectionURLEdit(Window* _pParent, const ResId& _rResId,BOOL _bShowPrefix) +OConnectionURLEdit::OConnectionURLEdit(Window* _pParent, const ResId& _rResId,sal_Bool _bShowPrefix) :Edit(_pParent, _rResId) ,m_pTypeCollection(NULL) ,m_pForcedPrefix(NULL) @@ -144,7 +144,7 @@ String OConnectionURLEdit::GetText() const return Edit::GetText(); } // ----------------------------------------------------------------------------- -void OConnectionURLEdit::ShowPrefix(BOOL _bShowPrefix) +void OConnectionURLEdit::ShowPrefix(sal_Bool _bShowPrefix) { m_bShowPrefix = _bShowPrefix; if ( m_pForcedPrefix ) diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 5efe35ddf0cb..fe9da7403ab3 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -97,7 +97,7 @@ DBTreeListBox::DBTreeListBox( Window* pParent, const Reference< XMultiServiceFac // ----------------------------------------------------------------------------- void DBTreeListBox::init() { - USHORT nSize = SPACEBETWEENENTRIES; + sal_uInt16 nSize = SPACEBETWEENENTRIES; SetSpaceBetweenEntries(nSize); m_aTimer.SetTimeout(900); @@ -109,6 +109,8 @@ void DBTreeListBox::init() SetNodeDefaultImages( ); EnableContextMenuHandling(); + + SetStyle( GetStyle() | WB_QUICK_SEARCH ); } //------------------------------------------------------------------------ DBTreeListBox::~DBTreeListBox() @@ -124,8 +126,8 @@ SvLBoxEntry* DBTreeListBox::GetEntryPosByName( const String& aName, SvLBoxEntry* SvLBoxEntry* pEntry = NULL; if ( pChilds ) { - ULONG nCount = pChilds->Count(); - for (ULONG i=0; i < nCount; ++i) + sal_uLong nCount = pChilds->Count(); + for (sal_uLong i=0; i < nCount; ++i) { pEntry = static_cast<SvLBoxEntry*>(pChilds->GetObject(i)); SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING)); @@ -349,7 +351,7 @@ void DBTreeListBox::RequestHelp( const HelpEvent& rHEvt ) void DBTreeListBox::KeyInput( const KeyEvent& rKEvt ) { KeyFuncType eFunc = rKEvt.GetKeyCode().GetFunction(); - USHORT nCode = rKEvt.GetKeyCode().GetCode(); + sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); sal_Bool bHandled = sal_False; if(eFunc != KEYFUNC_DONTKNOW) @@ -409,12 +411,12 @@ void DBTreeListBox::KeyInput( const KeyEvent& rKEvt ) SvTreeListBox::KeyInput(rKEvt); } // ----------------------------------------------------------------------------- -BOOL DBTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& /*_aSelection*/) +sal_Bool DBTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& /*_aSelection*/) { return m_aEditingHandler.Call(pEntry) != 0; } // ----------------------------------------------------------------------------- -BOOL DBTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) +sal_Bool DBTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ) { DBTreeEditedEntry aEntry; aEntry.pEntry = pEntry; @@ -426,11 +428,11 @@ BOOL DBTreeListBox::EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText } SetEntryText(pEntry,aEntry.aNewText); - return FALSE; // we never want that the base change our text + return sal_False; // we never want that the base change our text } // ----------------------------------------------------------------------------- -BOOL DBTreeListBox::DoubleClickHdl() +sal_Bool DBTreeListBox::DoubleClickHdl() { long nResult = aDoubleClickHdl.Call( this ); // continue default processing if the DoubleClickHandler didn't handle it @@ -467,12 +469,12 @@ namespace if ( !_pPopup ) return; - USHORT nCount = _pPopup->GetItemCount(); - for (USHORT i=0; i < nCount; ++i) + sal_uInt16 nCount = _pPopup->GetItemCount(); + for (sal_uInt16 i=0; i < nCount; ++i) { if ( _pPopup->GetItemType(i) != MENUITEM_SEPARATOR ) { - USHORT nId = _pPopup->GetItemId(i); + sal_uInt16 nId = _pPopup->GetItemId(i); PopupMenu* pSubPopUp = _pPopup->GetPopupMenu(nId); if ( pSubPopUp ) { @@ -499,14 +501,14 @@ namespace { void lcl_adjustMenuItemIDs( Menu& _rMenu, IController& _rCommandController ) { - USHORT nCount = _rMenu.GetItemCount(); - for ( USHORT pos = 0; pos < nCount; ++pos ) + sal_uInt16 nCount = _rMenu.GetItemCount(); + for ( sal_uInt16 pos = 0; pos < nCount; ++pos ) { // do not adjust separators if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) continue; - USHORT nId = _rMenu.GetItemId(pos); + sal_uInt16 nId = _rMenu.GetItemId(pos); String aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); if ( pPopup ) @@ -515,7 +517,7 @@ namespace continue; } - const USHORT nCommandId = _rCommandController.registerCommandURL( aCommand ); + const sal_uInt16 nCommandId = _rCommandController.registerCommandURL( aCommand ); _rMenu.InsertItem( nCommandId, _rMenu.GetItemText( nId ), _rMenu.GetItemImage( nId ), _rMenu.GetItemBits( nId ), pos ); @@ -535,14 +537,14 @@ namespace uno::Reference< frame::XFrame> xFrame; if ( xController.is() ) xFrame = xController->getFrame(); - USHORT nCount = _rMenu.GetItemCount(); - for ( USHORT pos = 0; pos < nCount; ++pos ) + sal_uInt16 nCount = _rMenu.GetItemCount(); + for ( sal_uInt16 pos = 0; pos < nCount; ++pos ) { // do not adjust separators if ( _rMenu.GetItemType( pos ) == MENUITEM_SEPARATOR ) continue; - USHORT nId = _rMenu.GetItemId(pos); + sal_uInt16 nId = _rMenu.GetItemId(pos); String aCommand = _rMenu.GetItemCommand( nId ); PopupMenu* pPopup = _rMenu.GetPopupMenu( nId ); if ( pPopup ) @@ -552,7 +554,7 @@ namespace } if ( xFrame.is() ) - _rMenu.SetItemImage(nId,framework::GetImageFromURL(xFrame,aCommand,FALSE)); + _rMenu.SetItemImage(nId,framework::GetImageFromURL(xFrame,aCommand,sal_False)); } } // ========================================================================= @@ -696,7 +698,7 @@ PopupMenu* DBTreeListBox::CreateContextMenu( void ) } // ----------------------------------------------------------------------------- -void DBTreeListBox::ExcecuteContextMenuAction( USHORT _nSelectedPopupEntry ) +void DBTreeListBox::ExcecuteContextMenuAction( sal_uInt16 _nSelectedPopupEntry ) { if ( m_pContextMenuProvider && _nSelectedPopupEntry ) m_pContextMenuProvider->getCommandController().executeChecked( _nSelectedPopupEntry, Sequence< PropertyValue >() ); diff --git a/dbaccess/source/ui/control/listviewitems.cxx b/dbaccess/source/ui/control/listviewitems.cxx index 2f2c7afd2a60..74193e682409 100644 --- a/dbaccess/source/ui/control/listviewitems.cxx +++ b/dbaccess/source/ui/control/listviewitems.cxx @@ -55,7 +55,7 @@ namespace dbaui } //------------------------------------------------------------------------ - USHORT OBoldListboxString::IsA() + sal_uInt16 OBoldListboxString::IsA() { return SV_ITEM_ID_BOLDLBSTRING; } diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index c95a48c84079..e02b7c000501 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -197,8 +197,8 @@ namespace dbaui // Place icon left of text and both centered in the button. SetModeImage( GetCommandIcon( ".uno:Open", m_sModule ) ); - EnableImageDisplay( TRUE ); - EnableTextDisplay( TRUE ); + EnableImageDisplay( sal_True ); + EnableTextDisplay( sal_True ); SetImageAlign( IMAGEALIGN_LEFT ); SetStyle( GetStyle() | WB_CENTER ); } @@ -257,7 +257,7 @@ namespace dbaui String sDecodedURL = aURL.GetMainURL( INetURLObject::NO_DECODE ); - USHORT nPos = InsertEntry( sTitle ); + sal_uInt16 nPos = InsertEntry( sTitle ); m_aURLs.insert( MapIndexToStringPair::value_type( nPos, StringPair( sDecodedURL, sFilter ) ) ); } } @@ -272,7 +272,7 @@ namespace dbaui String OpenDocumentListBox::GetSelectedDocumentURL() const { String sURL; - USHORT nSelected = GetSelectEntryPos(); + sal_uInt16 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sURL = impl_getDocumentAtIndex( nSelected ).first; return sURL; @@ -282,14 +282,14 @@ namespace dbaui String OpenDocumentListBox::GetSelectedDocumentFilter() const { String sFilter; - USHORT nSelected = GetSelectEntryPos(); + sal_uInt16 nSelected = GetSelectEntryPos(); if ( LISTBOX_ENTRY_NOTFOUND != GetSelectEntryPos() ) sFilter = impl_getDocumentAtIndex( nSelected ).second; return sFilter; } //-------------------------------------------------------------------- - OpenDocumentListBox::StringPair OpenDocumentListBox::impl_getDocumentAtIndex( USHORT _nListIndex, bool _bSystemNotation ) const + OpenDocumentListBox::StringPair OpenDocumentListBox::impl_getDocumentAtIndex( sal_uInt16 _nListIndex, bool _bSystemNotation ) const { MapIndexToStringPair::const_iterator pos = m_aURLs.find( _nListIndex ); OSL_ENSURE( pos != m_aURLs.end(), "OpenDocumentListBox::impl_getDocumentAtIndex: invalid index!" ); @@ -316,7 +316,7 @@ namespace dbaui return; Point aRequestPos( ScreenToOutputPixel( _rHEvt.GetMousePosPixel() ) ); - USHORT nItemIndex = LISTBOX_ENTRY_NOTFOUND; + sal_uInt16 nItemIndex = LISTBOX_ENTRY_NOTFOUND; if ( GetIndexForPoint( aRequestPos, nItemIndex ) != -1 ) { Rectangle aItemRect( GetBoundingRectangle( nItemIndex ) ); diff --git a/dbaccess/source/ui/control/sqledit.cxx b/dbaccess/source/ui/control/sqledit.cxx index 3eee26f30959..1caa8917be8b 100644 --- a/dbaccess/source/ui/control/sqledit.cxx +++ b/dbaccess/source/ui/control/sqledit.cxx @@ -69,7 +69,7 @@ OSqlEdit::OSqlEdit( OQueryTextView* pParent, WinBits nWinStyle ) : m_ColorConfig.AddListener(this); //#i97044# - EnableFocusSelectionHide( FALSE ); + EnableFocusSelectionHide( sal_False ); } //------------------------------------------------------------------------------ @@ -127,11 +127,11 @@ IMPL_LINK(OSqlEdit, OnUndoActionTimer, void*, EMPTYARG) if(aText != m_strOrigText) { OJoinController& rController = m_pView->getContainerWindow()->getDesignView()->getController(); - SfxUndoManager* pUndoMgr = rController.getUndoMgr(); + SfxUndoManager& rUndoMgr = rController.GetUndoManager(); OSqlEditUndoAct* pUndoAct = new OSqlEditUndoAct( this ); pUndoAct->SetOriginalText( m_strOrigText ); - pUndoMgr->AddUndoAction( pUndoAct ); + rUndoMgr.AddUndoAction( pUndoAct ); rController.InvalidateFeature(SID_UNDO); rController.InvalidateFeature(SID_REDO); diff --git a/dbaccess/source/ui/control/tabletree.cxx b/dbaccess/source/ui/control/tabletree.cxx index 9dd0a24ebbbf..c1c12947cb9b 100644 --- a/dbaccess/source/ui/control/tabletree.cxx +++ b/dbaccess/source/ui/control/tabletree.cxx @@ -131,8 +131,8 @@ void OTableTreeListBox::notifyHiContrastChanged() SvLBoxEntry* pEntryLoop = First(); while (pEntryLoop) { - USHORT nCount = pEntryLoop->ItemCount(); - for (USHORT i=0;i<nCount;++i) + sal_uInt16 nCount = pEntryLoop->ItemCount(); + for (sal_uInt16 i=0;i<nCount;++i) { SvLBoxItem* pItem = pEntryLoop->GetItem(i); if ( pItem && pItem->IsA() == SV_ITEM_ID_LBOXCONTEXTBMP) @@ -298,7 +298,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn sRootEntryText = String(ModuleRes(STR_ALL_VIEWS)); else sRootEntryText = String(ModuleRes(STR_ALL_TABLES_AND_VIEWS)); - InsertEntry( sRootEntryText, NULL, FALSE, LIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); + InsertEntry( sRootEntryText, NULL, sal_False, LIST_APPEND, reinterpret_cast< void* >( DatabaseObjectContainer::TABLES ) ); } if ( _rTables.empty() ) @@ -344,7 +344,7 @@ void OTableTreeListBox::UpdateTableList( const Reference< XConnection >& _rxConn { SvLBoxEntry* pFolder = GetEntryPosByName( *folder, pRootEntry ); if ( !pFolder ) - pFolder = InsertEntry( *folder, pRootEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFolderType ) ); + pFolder = InsertEntry( *folder, pRootEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFolderType ) ); } } } @@ -481,7 +481,7 @@ SvLBoxEntry* OTableTreeListBox::implAddEntry( { SvLBoxEntry* pFolder = GetEntryPosByName( rFirstName, pParentEntry ); if ( !pFolder ) - pFolder = InsertEntry( rFirstName, pParentEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nFirstFolderType ) ); + pFolder = InsertEntry( rFirstName, pParentEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nFirstFolderType ) ); pParentEntry = pFolder; } @@ -489,14 +489,14 @@ SvLBoxEntry* OTableTreeListBox::implAddEntry( { SvLBoxEntry* pFolder = GetEntryPosByName( rSecondName, pParentEntry ); if ( !pFolder ) - pFolder = InsertEntry( rSecondName, pParentEntry, FALSE, LIST_APPEND, reinterpret_cast< void* >( nSecondFolderType ) ); + pFolder = InsertEntry( rSecondName, pParentEntry, sal_False, LIST_APPEND, reinterpret_cast< void* >( nSecondFolderType ) ); pParentEntry = pFolder; } SvLBoxEntry* pRet = NULL; if ( !_bCheckName || !GetEntryPosByName( sName, pParentEntry ) ) { - pRet = InsertEntry( sName, pParentEntry, FALSE, LIST_APPEND ); + pRet = InsertEntry( sName, pParentEntry, sal_False, LIST_APPEND ); Image aImage; m_pImageProvider->getImages( _rTableName, DatabaseObject::TABLE, aImage ); diff --git a/dbaccess/source/ui/control/toolboxcontroller.cxx b/dbaccess/source/ui/control/toolboxcontroller.cxx index 009f63edba3a..5f36c9678b99 100644 --- a/dbaccess/source/ui/control/toolboxcontroller.cxx +++ b/dbaccess/source/ui/control/toolboxcontroller.cxx @@ -67,7 +67,7 @@ namespace dbaui namespace { - void lcl_copy(Menu* _pMenu,USHORT _nMenuId,USHORT _nMenuPos,ToolBox* _pToolBox,USHORT _nToolId,const ::rtl::OUString& _sCommand) + void lcl_copy(Menu* _pMenu,sal_uInt16 _nMenuId,sal_uInt16 _nMenuPos,ToolBox* _pToolBox,sal_uInt16 _nToolId,const ::rtl::OUString& _sCommand) { if ( _pMenu->GetItemType(_nMenuPos) != MENUITEM_STRING ) _pToolBox->SetItemImage(_nToolId, _pMenu->GetItemImage(_nMenuId)); @@ -140,10 +140,10 @@ namespace dbaui ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent())); if ( pToolBox ) { - USHORT nCount = pToolBox->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + sal_uInt16 nCount = pToolBox->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { - USHORT nItemId = pToolBox->GetItemId(nPos); + sal_uInt16 nItemId = pToolBox->GetItemId(nPos); if ( pToolBox->GetItemCommand(nItemId) == String(m_aCommandURL) ) { m_nToolBoxId = nItemId; @@ -167,10 +167,10 @@ namespace dbaui if ( m_aCommandURL == aFind->first && !Event.IsEnabled ) { ::std::auto_ptr<PopupMenu> pMenu = getMenu(); - USHORT nCount = pMenu->GetItemCount(); - for (USHORT i = 0; i < nCount; ++i) + sal_uInt16 nCount = pMenu->GetItemCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { - USHORT nItemId = pMenu->GetItemId(i); + sal_uInt16 nItemId = pMenu->GetItemId(i); aFind = m_aStates.find(pMenu->GetItemCommand(nItemId)); if ( aFind != m_aStates.end() && aFind->second ) { @@ -202,13 +202,13 @@ namespace dbaui short nImageType = hasBigImages() ? ImageType::SIZE_LARGE : ImageType::SIZE_DEFAULT; Sequence< ::rtl::OUString> aSeq(1); - USHORT nCount = pMenu->GetItemCount(); - for (USHORT nPos = 0; nPos < nCount; ++nPos) + sal_uInt16 nCount = pMenu->GetItemCount(); + for (sal_uInt16 nPos = 0; nPos < nCount; ++nPos) { if ( pMenu->GetItemType( nPos ) == MENUITEM_SEPARATOR ) continue; - USHORT nItemId = pMenu->GetItemId(nPos); + sal_uInt16 nItemId = pMenu->GetItemId(nPos); aSeq[0] = pMenu->GetItemCommand(nItemId); Sequence< Reference<XGraphic> > aImages = xImageMgr->getImages(nImageType,aSeq); @@ -242,7 +242,7 @@ namespace dbaui ToolBox* pToolBox = static_cast<ToolBox*>(VCLUnoHelper::GetWindow(getParent())); ::std::auto_ptr<PopupMenu> pMenu = getMenu(); - USHORT nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN); + sal_uInt16 nSelected = pMenu->Execute(pToolBox, pToolBox->GetItemRect( m_nToolBoxId ),POPUPMENU_EXECUTE_DOWN); // "cleanup" the toolbox state Point aPoint = pToolBox->GetItemRect( m_nToolBoxId ).TopLeft(); MouseEvent aLeave( aPoint, 0, MOUSE_LEAVEWINDOW | MOUSE_SYNTHETIC ); diff --git a/dbaccess/source/ui/dlg/AdabasStat.cxx b/dbaccess/source/ui/dlg/AdabasStat.cxx index 26f6d9537086..25710d04abfc 100644 --- a/dbaccess/source/ui/dlg/AdabasStat.cxx +++ b/dbaccess/source/ui/dlg/AdabasStat.cxx @@ -119,8 +119,8 @@ OAdabasStatistics::OAdabasStatistics( Window* pParent, double nUsedPages = xRow->getInt(1) / 256; double nFreePages = xRow->getInt(2) / 256; - m_ET_SIZE.SetText(::rtl::OUString::valueOf((INT32)nUsedPages)); - m_ET_FREESIZE.SetText(::rtl::OUString::valueOf((INT32)nFreePages)); + m_ET_SIZE.SetText(::rtl::OUString::valueOf((sal_Int32)nUsedPages)); + m_ET_FREESIZE.SetText(::rtl::OUString::valueOf((sal_Int32)nFreePages)); m_ET_MEMORYUSING.SetValue(static_cast<sal_Int32>(((nUsedPages-nFreePages)/nUsedPages)*100)); } else diff --git a/dbaccess/source/ui/dlg/AdabasStat.src b/dbaccess/source/ui/dlg/AdabasStat.src index 418729d4564e..476750f7b531 100644 --- a/dbaccess/source/ui/dlg/AdabasStat.src +++ b/dbaccess/source/ui/dlg/AdabasStat.src @@ -37,6 +37,7 @@ ModalDialog DLG_ADABASSTAT { + HelpID = "dbaccess:ModalDialog:DLG_ADABASSTAT"; OutputSize = TRUE ; Moveable = TRUE ; Closeable = TRUE ; @@ -59,6 +60,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_SYSDEVSPACE { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_SYSDEVSPACE"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 14 ) ; Size = MAP_APPFONT ( 128 , 12 ) ; @@ -75,6 +77,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_TRANSACTIONLOG { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_TRANSACTIONLOG"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 31 ) ; Size = MAP_APPFONT ( 128 , 12 ) ; @@ -91,6 +94,7 @@ ModalDialog DLG_ADABASSTAT ListBox LB_DATADEVS { + HelpID = "dbaccess:ListBox:DLG_ADABASSTAT:LB_DATADEVS"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 48 ) ; Size = MAP_APPFONT ( 128 , 42 ) ; @@ -115,6 +119,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_SIZE { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_SIZE"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 109 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -131,6 +136,7 @@ ModalDialog DLG_ADABASSTAT Edit ET_FREESIZE { + HelpID = "dbaccess:Edit:DLG_ADABASSTAT:ET_FREESIZE"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 126 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -147,6 +153,7 @@ ModalDialog DLG_ADABASSTAT NumericField ET_MEMORYUSING { + HelpID = "dbaccess:NumericField:DLG_ADABASSTAT:ET_MEMORYUSING"; Border = TRUE ; Pos = MAP_APPFONT ( 120 , 144 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; diff --git a/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc b/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc index 425e713094f3..258eec3a2acf 100644 --- a/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc +++ b/dbaccess/source/ui/dlg/AutoControls_tmpl.hrc @@ -126,7 +126,7 @@ // ------------------------------------------------------------------------------------------------- -#define AUTO_BROWSECONTROLGROUP( AUTO_X, AUTO_Y, AUTOPAGE_X, AUTO_HID) \ +#define AUTO_BROWSECONTROLGROUP( AUTO_X, AUTO_Y, AUTOPAGE_X, AUTO_HID, AUTO_HID2) \ FixedText FT_AUTOBROWSEURL { \ Pos = MAP_APPFONT ( AUTO_X , AUTO_Y ) ; \ Size = MAP_APPFONT ( AUTOPAGE_X - AUTO_X - 6 , FIXEDTEXT_HEIGHT ) ; \ @@ -147,7 +147,7 @@ { \ Pos = MAP_APPFONT ( AUTOPAGE_X - BUTTON_WIDTH - 6 , AUTO_Y + FIXEDTEXT_HEIGHT + 2 ) ; \ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; \ - HelpId = (AUTO_HID + 1); \ + HelpId = AUTO_HID2; \ TabStop = TRUE ; \ Text[ en-US ] = "Browse"; \ }; @@ -214,7 +214,9 @@ // -------------------------------------------------------------------------------------------------- - +// MBA: the HID set in the FixText can't make any sense; in case this macro was called from within the +// AUTOHELP_JDBCCONTROLGROUP, the FixText would have got the same HID as an EditField from the +// also called AUTO_JDBCDRIVERCLASSGROUP macro; thus I conclude that we can remove the HID from the FixedText #define AUTO_PORTCONTROLGROUP(AUTO_Y, AUTO_HID) \ FixedText FT_AUTOPORTNUMBER \ { \ @@ -235,7 +237,6 @@ \ FixedText FT_AUTOPORTNUMBERDEFAULT \ { \ - HelpId = AUTO_HID + 1 ; \ Pos = MAP_APPFONT (EDIT_X + 22 + UNRELATED_CONTROLS, AUTO_Y +2) ; \ Size = MAP_APPFONT ( WIZARD_PAGE_X - EDIT_X - 22 - UNRELATED_CONTROLS , FIXEDTEXT_HEIGHT ) ; \ Text[ en-US ] = "" ; \ @@ -445,9 +446,9 @@ // -------------------------------------------------------------------------------------------------- -#define AUTO_HELP_BROWSECONTROLGROUP(AUTO_LINECOUNT, AUTO_HID) \ +#define AUTO_HELP_BROWSECONTROLGROUP(AUTO_LINECOUNT, AUTO_HID, AUTO_HID2) \ AUTO_WIZARDHELPTEXT(AUTO_LINECOUNT) \ - AUTO_BROWSECONTROLGROUP(START_X, INIT_Y + AUTO_LINECOUNT * FIXEDTEXT_HEIGHT + 2, WIZARD_PAGE_X, AUTO_HID) + AUTO_BROWSECONTROLGROUP(START_X, INIT_Y + AUTO_LINECOUNT * FIXEDTEXT_HEIGHT + 2, WIZARD_PAGE_X, AUTO_HID, AUTO_HID2) // -------------------------------------------------------------------------------------------------- @@ -455,7 +456,7 @@ // -------------------------------------------------------------------------------------------------- -#define AUTO_JDBCDRIVERCLASSGROUP(AUTO_Y, AUTO_HID) \ +#define AUTO_JDBCDRIVERCLASSGROUP(AUTO_Y, AUTO_HID, AUTO_HID2) \ \ FixedText FT_AUTOJDBCDRIVERCLASS \ { \ @@ -479,7 +480,7 @@ Pos = MAP_APPFONT ( WIZARD_PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , AUTO_Y + FIXEDTEXT_HEIGHT + 2) ; \ Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; \ Size = MAP_APPFONT (50, 14); \ - HelpId = AUTO_HID + 1; \ + HelpId = AUTO_HID2; \ Text[ en-US ] = "Test class" ; \ }; @@ -502,13 +503,13 @@ }; -#define AUTOHELP_JDBCCONTROLGROUP( AUTO_HID ) \ +#define AUTOHELP_JDBCCONTROLGROUP( AUTO_HID, AUTO_HID2, AUTO_HID3, AUTO_HID4, AUTO_HID5 ) \ AUTO_WIZARDHELPTEXT( 6 ) \ AUTO_NAMECONTROLGROUP( INIT_Y + 6 * FIXEDTEXT_HEIGHT + 2, AUTO_HID ) \ - AUTO_HOSTCONTROLGROUP(96, AUTO_HID + 1) \ - AUTO_PORTCONTROLGROUP(113, AUTO_HID + 2 ) \ + AUTO_HOSTCONTROLGROUP(96, AUTO_HID2) \ + AUTO_PORTCONTROLGROUP(113, AUTO_HID3 ) \ AUTO_SOCKETCONTROLGROUP(129) \ - AUTO_JDBCDRIVERCLASSGROUP(146, AUTO_HID + 3) + AUTO_JDBCDRIVERCLASSGROUP(146, AUTO_HID4, AUTO_HID5) // -------------------------------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/dlg/CollectionView.cxx b/dbaccess/source/ui/dlg/CollectionView.cxx index f250dad416cb..89e3a8d8439a 100644 --- a/dbaccess/source/ui/dlg/CollectionView.cxx +++ b/dbaccess/source/ui/dlg/CollectionView.cxx @@ -213,7 +213,7 @@ IMPL_LINK( OCollectionView, Save_Click, PushButton*, EMPTYARG ) return 0; } m_aName.SetText(sName); - EndDialog( TRUE ); + EndDialog( sal_True ); } } catch( const Exception& ) @@ -300,7 +300,7 @@ IMPL_LINK( OCollectionView, Dbl_Click_FileView, SvtFileView*, EMPTYARG ) // ----------------------------------------------------------------------------- void OCollectionView::initCurrentPath() { - BOOL bEnable = FALSE; + sal_Bool bEnable = sal_False; try { if ( m_xContent.is() ) diff --git a/dbaccess/source/ui/dlg/CollectionView.src b/dbaccess/source/ui/dlg/CollectionView.src index 0d26722a7033..e431a6502e81 100644 --- a/dbaccess/source/ui/dlg/CollectionView.src +++ b/dbaccess/source/ui/dlg/CollectionView.src @@ -62,6 +62,7 @@ ModalDialog DLG_COLLECTION_VIEW }; ImageButton BTN_EXPLORERFILE_NEWFOLDER { + HelpID = "dbaccess:ImageButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_NEWFOLDER"; TabStop = FALSE ; Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - RELATED_CONTROLS - 2*IMG_SIZE, UNRELATED_CONTROLS ) ; Size = MAP_APPFONT ( IMG_SIZE , IMG_SIZE ) ; @@ -69,6 +70,7 @@ ModalDialog DLG_COLLECTION_VIEW }; ImageButton BTN_EXPLORERFILE_UP { + HelpID = "dbaccess:ImageButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_UP"; TabStop = TRUE ; Pos = MAP_APPFONT ( WIN_X - UNRELATED_CONTROLS - IMG_SIZE, UNRELATED_CONTROLS ) ; Size = MAP_APPFONT ( IMG_SIZE , IMG_SIZE ) ; @@ -91,6 +93,7 @@ ModalDialog DLG_COLLECTION_VIEW }; Edit ED_EXPLORERFILE_FILENAME { + HelpID = "dbaccess:Edit:DLG_COLLECTION_VIEW:ED_EXPLORERFILE_FILENAME"; Pos = MAP_APPFONT ( RELATED_CONTROLS + UNRELATED_CONTROLS + 50 , WIN_Y - 3*UNRELATED_CONTROLS - BUTTON_HEIGHT - FIXEDLINE_HEIGHT - EDIT_HEIGHT) ; Size = MAP_APPFONT ( WIN_X - RELATED_CONTROLS - 2*UNRELATED_CONTROLS - 50 , EDIT_HEIGHT ) ; Border = TRUE ; @@ -105,6 +108,7 @@ ModalDialog DLG_COLLECTION_VIEW PushButton BTN_EXPLORERFILE_SAVE { + HelpID = "dbaccess:PushButton:DLG_COLLECTION_VIEW:BTN_EXPLORERFILE_SAVE"; Pos = MAP_APPFONT ( WIN_X - 2*UNRELATED_CONTROLS - RELATED_CONTROLS - 150, WIN_Y - UNRELATED_CONTROLS - BUTTON_HEIGHT ) ; Size = MAP_APPFONT ( 50 , BUTTON_HEIGHT ) ; DefButton = TRUE ; diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index 51838459da45..a82c26a13161 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -70,7 +70,7 @@ #include <tools/urlobj.hxx> #include <tools/diagnose_ex.h> #include <sfx2/docfilt.hxx> -#if !defined(WINDOWS_VISTA_PSDK) && (defined(WIN) || defined(WNT)) +#if !defined(WINDOWS_VISTA_PSDK) && defined(WNT) #define _ADO_DATALINK_BROWSE_ #endif @@ -142,7 +142,7 @@ DBG_NAME(OConnectionHelper) m_aConnectionURL.Show(); m_aConnectionURL.ShowPrefix( ::dbaccess::DST_JDBC == m_pCollection->determineType(m_eType) ); - BOOL bEnableBrowseButton = m_pCollection->supportsBrowsing( m_eType ); + sal_Bool bEnableBrowseButton = m_pCollection->supportsBrowsing( m_eType ); m_aPB_Connection.Show( bEnableBrowseButton ); SFX_ITEMSET_GET(_rSet, pUrlItem, SfxStringItem, DSID_CONNECTURL, sal_True); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.cxx b/dbaccess/source/ui/dlg/ConnectionPage.cxx index d4d210482ce2..63cac64f6095 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.cxx @@ -71,7 +71,7 @@ #include <tools/urlobj.hxx> #include <sfx2/docfilt.hxx> #include "dsnItem.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #define _ADO_DATALINK_BROWSE_ #endif @@ -133,6 +133,8 @@ namespace dbaui m_aTestJavaDriver.SetClickHdl(LINK(this,OConnectionTabPage,OnTestJavaClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aTestConnection ); } // ----------------------------------------------------------------------- @@ -257,7 +259,7 @@ namespace dbaui String sUrl = pUrlItem->GetValue(); setURL( sUrl ); - const BOOL bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC; + const sal_Bool bEnableJDBC = m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC; if ( !pJdbcDrvItem->GetValue().Len() ) { String sDefaultJdbcDriverName = m_pCollection->getJavaDriverClass(m_eType); @@ -347,7 +349,7 @@ namespace dbaui { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -356,7 +358,7 @@ namespace dbaui bool OConnectionTabPage::checkTestConnection() { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); - BOOL bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); if ( m_pCollection->determineType(m_eType) == ::dbaccess::DST_JDBC ) bEnableTestConnection = bEnableTestConnection && (m_aJavaDriver.GetText().Len() != 0); m_aTestConnection.Enable(bEnableTestConnection); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.hxx b/dbaccess/source/ui/dlg/ConnectionPage.hxx index 140ea6792efc..bd0034a22a91 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPage.hxx @@ -74,7 +74,7 @@ namespace dbaui public: static SfxTabPage* Create( Window* pParent, const SfxItemSet& _rAttrSet ); - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/ConnectionPage.src b/dbaccess/source/ui/dlg/ConnectionPage.src index 61515a2589a8..63c400b0a77a 100644 --- a/dbaccess/source/ui/dlg/ConnectionPage.src +++ b/dbaccess/source/ui/dlg/ConnectionPage.src @@ -42,6 +42,7 @@ //......................................................................... TabPage PAGE_CONNECTION { + HelpID = "dbaccess:TabPage:PAGE_CONNECTION"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -54,7 +55,7 @@ TabPage PAGE_CONNECTION Text[ en-US ] = "General"; }; - AUTO_BROWSECONTROLGROUP( 6, UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + RELATED_CONTROLS, PAGE_X, HID_DSADMIN_URL_GENERAL) + AUTO_BROWSECONTROLGROUP( 6, UNRELATED_CONTROLS + FIXEDTEXT_HEIGHT + RELATED_CONTROLS, PAGE_X, HID_DSADMIN_URL_GENERAL, HID_DSADMIN_BROWSECONN) FixedText FT_NO_ADDITIONAL_SETTINGS { @@ -88,6 +89,7 @@ TabPage PAGE_CONNECTION Edit ET_USERNAME { + HelpID = "dbaccess:Edit:PAGE_CONNECTION:ET_USERNAME"; Border = TRUE ; Pos = MAP_APPFONT ( 90 , 3*UNRELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS -1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT ) ; @@ -96,6 +98,7 @@ TabPage PAGE_CONNECTION CheckBox CB_PASSWORD_REQUIRED { + HelpID = "dbaccess:CheckBox:PAGE_CONNECTION:CB_PASSWORD_REQUIRED"; Pos = MAP_APPFONT ( 90 , 4*UNRELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT + 2*RELATED_CONTROLS ) ; Size = MAP_APPFONT ( 105 , CHECKBOX_HEIGHT ) ; Text [ en-US ] = "Password required"; @@ -128,6 +131,7 @@ TabPage PAGE_CONNECTION PushButton PB_TESTDRIVERCLASS { + HelpID = "dbaccess:PushButton:PAGE_CONNECTION:PB_TESTDRIVERCLASS"; TabStop = TRUE ; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , 5*UNRELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT + 3*RELATED_CONTROLS + CHECKBOX_HEIGHT -2 ) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; @@ -136,6 +140,7 @@ TabPage PAGE_CONNECTION PushButton PB_TESTCONNECTION { + HelpID = "dbaccess:PushButton:PAGE_CONNECTION:PB_TESTCONNECTION"; Pos = MAP_APPFONT ( PAGE_X - 75 - UNRELATED_CONTROLS, PAGE_Y - BUTTON_HEIGHT - UNRELATED_CONTROLS) ; Size = MAP_APPFONT ( 75 , BUTTON_HEIGHT ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx index a311acd6d8cf..6ee4c808aeb5 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.cxx @@ -133,7 +133,7 @@ namespace dbaui //= OConnectionTabPageSetup //======================================================================== DBG_NAME(OConnectionTabPageSetup) - OConnectionTabPageSetup::OConnectionTabPageSetup(Window* pParent, USHORT _rId, const SfxItemSet& _rCoreAttrs, USHORT _nHelpTextResId, USHORT _nHeaderResId, USHORT _nUrlResId) + OConnectionTabPageSetup::OConnectionTabPageSetup(Window* pParent, sal_uInt16 _rId, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId) :OConnectionHelper(pParent, ModuleRes(_rId), _rCoreAttrs) ,m_bUserGrabFocus(sal_True) ,m_aFT_HelpText(this, ModuleRes(FT_AUTOWIZARDHELPTEXT)) diff --git a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx index e5ad2d732f93..0fd31cf58101 100644 --- a/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx +++ b/dbaccess/source/ui/dlg/ConnectionPageSetup.hxx @@ -69,7 +69,7 @@ namespace dbaui static OGenericAdministrationPage* CreateUserDefinedTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual sal_Bool commitPage( ::svt::WizardTypes::CommitPageReason _eReason ); @@ -87,7 +87,7 @@ namespace dbaui protected: - OConnectionTabPageSetup(Window* pParent, USHORT _rId, const SfxItemSet& _rCoreAttrs, USHORT _nHelpTextResId, USHORT _nHeaderResId, USHORT _nUrlResId); + OConnectionTabPageSetup(Window* pParent, sal_uInt16 _rId, const SfxItemSet& _rCoreAttrs, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderResId, sal_uInt16 _nUrlResId); virtual bool checkTestConnection(); // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten virtual ~OConnectionTabPageSetup(); diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index aef7cdce199a..83506495c575 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -333,7 +333,7 @@ DBG_NAME(OMySQLIntroPageSetup) // ----------------------------------------------------------------------- - BOOL OMySQLIntroPageSetup::FillItemSet(SfxItemSet& /*_rSet*/) + sal_Bool OMySQLIntroPageSetup::FillItemSet(SfxItemSet& /*_rSet*/) { OSL_ENSURE(sal_False,"Who called me?! Please ask oj for more information."); return sal_True; @@ -421,7 +421,7 @@ DBG_NAME(OMySQLIntroPageSetup) //======================================================================== //= OMySQLJDBCConnectionPageSetup //======================================================================== - OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( Window* pParent,USHORT _nResId, const SfxItemSet& _rCoreAttrs ,USHORT _nPortId, USHORT _nDefaultPortResId, USHORT _nHelpTextResId, USHORT _nHeaderTextResId, USHORT _nDriverClassId) + OGeneralSpecialJDBCConnectionPageSetup::OGeneralSpecialJDBCConnectionPageSetup( Window* pParent,sal_uInt16 _nResId, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId, sal_uInt16 _nDefaultPortResId, sal_uInt16 _nHelpTextResId, sal_uInt16 _nHeaderTextResId, sal_uInt16 _nDriverClassId) :OGenericAdministrationPage(pParent, ModuleRes(_nResId), _rCoreAttrs) ,m_aFTHelpText (this, ModuleRes(FT_AUTOWIZARDHELPTEXT)) ,m_aFTDatabasename (this, ModuleRes(FT_AUTODATABASENAME)) @@ -579,7 +579,7 @@ DBG_NAME(OMySQLIntroPageSetup) { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -674,7 +674,7 @@ DBG_NAME(OMySQLIntroPageSetup) bool OJDBCConnectionPageSetup::checkTestConnection() { OSL_ENSURE(m_pAdminDialog,"No Admin dialog set! ->GPF"); - BOOL bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); + sal_Bool bEnableTestConnection = !m_aConnectionURL.IsVisible() || (m_aConnectionURL.GetTextNoPrefix().Len() != 0); bEnableTestConnection = bEnableTestConnection && (m_aETDriverClass.GetText().Len() != 0); return bEnableTestConnection; } @@ -698,7 +698,7 @@ DBG_NAME(OMySQLIntroPageSetup) { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -791,6 +791,8 @@ DBG_NAME(OAuthentificationPageSetup) m_aCBPasswordRequired.SetClickHdl(getControlModifiedLink()); m_aPBTestConnection.SetClickHdl(LINK(this,OGenericAdministrationPage,OnTestConnectionClickHdl)); FreeResource(); + + LayoutHelper::fitSizeRightAligned( m_aPBTestConnection ); } diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index 48c0931b946e..00fe40ffbce1 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -56,7 +56,7 @@ namespace dbaui class OSpreadSheetConnectionPageSetup : public OConnectionTabPageSetup { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateSpreadSheetTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OSpreadSheetConnectionPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs); @@ -77,7 +77,7 @@ namespace dbaui class OTextConnectionPageSetup : public OConnectionTabPageSetup { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateTextTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OTextConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs ); OTextConnectionHelper* m_pTextConnectionHelper; @@ -101,7 +101,7 @@ namespace dbaui class OLDAPConnectionPageSetup : public OGenericAdministrationPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateLDAPTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OLDAPConnectionPageSetup( Window* pParent, const SfxItemSet& _rCoreAttrs ); virtual Link getControlModifiedLink() { return LINK(this, OLDAPConnectionPageSetup, OnEditModified); } @@ -144,7 +144,7 @@ namespace dbaui virtual void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); virtual void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual Link getControlModifiedLink(); @@ -160,18 +160,18 @@ namespace dbaui { public: OGeneralSpecialJDBCConnectionPageSetup( Window* pParent - , USHORT _nResId + , sal_uInt16 _nResId , const SfxItemSet& _rCoreAttrs - , USHORT _nPortId - , USHORT _nDefaultPortResId - , USHORT _nHelpTextResId - , USHORT _nHeaderTextResId - , USHORT _nDriverClassId ); + , sal_uInt16 _nPortId + , sal_uInt16 _nDefaultPortResId + , sal_uInt16 _nHelpTextResId + , sal_uInt16 _nHeaderTextResId + , sal_uInt16 _nDriverClassId ); static OGenericAdministrationPage* CreateMySQLJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); static OGenericAdministrationPage* CreateOracleJDBCTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); protected: - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -194,7 +194,7 @@ namespace dbaui PushButton m_aPBTestJavaDriver; String m_sDefaultJdbcDriverName; - USHORT m_nPortId; + sal_uInt16 m_nPortId; }; @@ -210,7 +210,7 @@ namespace dbaui protected: virtual bool checkTestConnection(); - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -250,7 +250,7 @@ namespace dbaui protected: - virtual BOOL FillItemSet(SfxItemSet& _rSet); + virtual sal_Bool FillItemSet(SfxItemSet& _rSet); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -277,7 +277,7 @@ namespace dbaui class OAuthentificationPageSetup : public OGenericAdministrationPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateAuthentificationTabPage( Window* pParent, const SfxItemSet& _rAttrSet ); OAuthentificationPageSetup(Window* pParent, const SfxItemSet& _rCoreAttrs); @@ -304,7 +304,7 @@ namespace dbaui class OFinalDBPageSetup : public OGenericAdministrationPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); static OGenericAdministrationPage* CreateFinalDBTabPageSetup( Window* pParent, const SfxItemSet& _rAttrSet); FixedText m_aFTFinalHeader; diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx index 6b102c394253..968fc0127157 100644 --- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx +++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx @@ -108,7 +108,7 @@ using namespace com::sun::star::frame; //------------------------------------------------------------------------- namespace { - sal_Bool implCheckItemType( SfxItemSet& _rSet, const USHORT _nId, const TypeId _nExpectedItemType ) + sal_Bool implCheckItemType( SfxItemSet& _rSet, const sal_uInt16 _nId, const TypeId _nExpectedItemType ) { sal_Bool bCorrectType = sal_False; @@ -726,7 +726,7 @@ void ODbDataSourceAdministrationHelper::translateProperties(const SfxItemSet& _r ++aDirect ) { - const SfxPoolItem* pCurrentItem = _rSource.GetItem((USHORT)aDirect->first); + const SfxPoolItem* pCurrentItem = _rSource.GetItem((sal_uInt16)aDirect->first); if (pCurrentItem) { sal_Int16 nAttributes = PropertyAttribute::READONLY; @@ -785,7 +785,7 @@ void ODbDataSourceAdministrationHelper::fillDatasourceInfo(const SfxItemSet& _rS ::std::vector< sal_Int32>::iterator aDetailsEnd = aDetailIds.end(); for (::std::vector< sal_Int32>::iterator aIter = aDetailIds.begin();aIter != aDetailsEnd ; ++aIter) { - const SfxPoolItem* pCurrent = _rSource.GetItem((USHORT)*aIter); + const SfxPoolItem* pCurrent = _rSource.GetItem((sal_uInt16)*aIter); aTranslation = m_aIndirectPropTranslator.find(*aIter); if ( pCurrent && (m_aIndirectPropTranslator.end() != aTranslation) ) { @@ -1118,7 +1118,7 @@ void ODbDataSourceAdministrationHelper::convertUrl(SfxItemSet& _rDest) ::dbaccess::ODsnTypeCollection* pCollection = pTypeCollection->getCollection(); OSL_ENSURE(pCollection, "ODbAdminDialog::getDatasourceType: invalid type collection!"); - USHORT nPortNumberId = 0; + sal_uInt16 nPortNumberId = 0; sal_Int32 nPortNumber = -1; String sNewHostName; String sUrlPart; diff --git a/dbaccess/source/ui/dlg/DriverSettings.cxx b/dbaccess/source/ui/dlg/DriverSettings.cxx index 23390d34bba2..2408297e20cf 100644 --- a/dbaccess/source/ui/dlg/DriverSettings.cxx +++ b/dbaccess/source/ui/dlg/DriverSettings.cxx @@ -78,7 +78,7 @@ void ODriversSettings::getSupportedIndirectSettings( const ::rtl::OUString& _sUR } } #endif - typedef ::std::pair<USHORT, ::rtl::OUString> TProperties; + typedef ::std::pair<sal_uInt16, ::rtl::OUString> TProperties; TProperties aProps[] = { TProperties(DSID_SHOWDELETEDROWS,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowDeleted"))) ,TProperties(DSID_CHARSET,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharSet"))) ,TProperties(DSID_FIELDDELIMITER,::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FieldDelimiter"))) diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx b/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx deleted file mode 100644 index 9aa06d59e1d3..000000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.cxx +++ /dev/null @@ -1,208 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "precompiled_dbaccess.hxx" - -#include "dbaccess_helpid.hrc" -#include "dbu_resource.hrc" -#include "ExtensionNotPresent.hrc" -#include "ExtensionNotPresent.hxx" -#include "moduledbu.hxx" -#include "UITools.hxx" - -/** === begin UNO includes === **/ -#include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/lang/XMultiComponentFactory.hpp> -#include <com/sun/star/system/SystemShellExecuteFlags.hpp> -#include <com/sun/star/uno/XComponentContext.hpp> -/** === end UNO includes === **/ - -#include <connectivity/dbconversion.hxx> -#include <unotools/syslocale.hxx> -#include <svx/globlmn.hrc> -#include <svx/svxids.hrc> -#include <svtools/langhelp.hxx> -#include <tools/debug.hxx> -#include <tools/diagnose_ex.h> -#include <unotools/confignode.hxx> -#include <vcl/msgbox.hxx> - - -namespace dbaui -{ -using namespace ::com::sun::star; -using namespace ::comphelper; - -#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) - -DBG_NAME( dbu_OExtensionNotPresentDialog ) -//======================================================================== -// class OExtensionNotPresentDialog -//======================================================================== - OExtensionNotPresentDialog::OExtensionNotPresentDialog( Window* _pParent, uno::Reference< lang::XMultiServiceFactory > _xORB) - : ModalDialog( _pParent, ModuleRes(RID_EXTENSION_NOT_PRESENT_DLG) ) - ,m_aFI_WARNING(this, ModuleRes(FI_WARNING)) - ,m_aFT_TEXT(this, ModuleRes(FT_TEXT ) ) - ,m_aPB_DOWNLOAD(this, ModuleRes(PB_DOWNLOAD)) - ,m_aPB_CANCEL(this, ModuleRes(PB_CANCEL)) - ,m_xMultiServiceFactory(_xORB) -{ - DBG_CTOR( dbu_OExtensionNotPresentDialog, NULL); - - try - { - SvtSysLocale aSysLocale; - m_nLocale = aSysLocale.GetLocaleData().getLocale(); - } - catch(uno::Exception&) - { - } - - // set a ClickHandler for the 'Download' button - m_aPB_DOWNLOAD.SetClickHdl( LINK( this, OExtensionNotPresentDialog, Download_Click ) ); - - // get message string out of the resource - String sText = String( ModuleRes( RID_STR_EXTENSION_NOT_PRESENT ) ); - String sExtensionName = getFromConfigurationExtension("Name"); - sText.SearchAndReplaceAscii("%RPT_EXTENSION_NAME", sExtensionName); - - m_aFT_TEXT.SetText(sText); - - // calulate the size of the text field - Rectangle aPrimaryRect( Point(0,0), m_aFT_TEXT.GetSizePixel() ); - Rectangle aSuggestedRect( GetTextRect( aPrimaryRect, sText, TEXT_DRAW_MULTILINE | TEXT_DRAW_LEFT ) ); - - Size aTempSize = LogicToPixel( Size(LEFT_PADDING + RIGHT_PADDING, 1), MAP_APPFONT); // real pixel size of LEFT and RIGHT_PADDING - sal_Int32 nWidthWithoutFixedText = aTempSize.getWidth() ; - sal_Int32 nHeightWithoutFixedText = GetSizePixel().getHeight() - m_aFT_TEXT.GetSizePixel().getHeight(); - - Size aNewSize = aSuggestedRect.GetSize(); - m_aFT_TEXT.SetSizePixel( aNewSize ); - sal_Int32 nNewWidth = nWidthWithoutFixedText + aSuggestedRect.GetWidth(); - sal_Int32 nNewHeight = nHeightWithoutFixedText + aSuggestedRect.GetHeight(); - - // set new window width & height - Size aDialogWindowSize = GetSizePixel(); - aDialogWindowSize.setWidth( nNewWidth ); - aDialogWindowSize.setHeight( nNewHeight ); - SetSizePixel(aDialogWindowSize); - - // move Action items - sal_Int32 nWindowWidth = GetSizePixel().getWidth(); - sal_Int32 nWindowHeight = GetSizePixel().getHeight(); - - Size aButtonSize = LogicToPixel( Size(BUTTON_WIDTH, BUTTON_HEIGHT), MAP_APPFONT); // real pixel size of a button - - Point aNewPos = m_aPB_DOWNLOAD.GetPosPixel(); - aNewPos.setX(nWindowWidth / 2 - m_aPB_DOWNLOAD.GetSizePixel().getWidth() - 8); - aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5); - m_aPB_DOWNLOAD.SetPosPixel(aNewPos ); - - aNewPos = m_aPB_CANCEL.GetPosPixel(); - aNewPos.setX(nWindowWidth / 2 + 8); - aNewPos.setY(nWindowHeight - aButtonSize.getHeight() - 5); - m_aPB_CANCEL.SetPosPixel(aNewPos ); - - m_aFI_WARNING.SetImage(WarningBox::GetStandardImage()); - - Resize(); - FreeResource(); -} - -//------------------------------------------------------------------------ -OExtensionNotPresentDialog::~OExtensionNotPresentDialog() -{ - DBG_DTOR( dbu_OExtensionNotPresentDialog, NULL); -} -// ----------------------------------------------------------------------------- -short OExtensionNotPresentDialog::Execute() -{ - DBG_CHKTHIS( dbu_OExtensionNotPresentDialog,NULL); - short nRet = ModalDialog::Execute(); - // RET_OK - // RET_NO - return nRet; -} - -//------------------------------------------------------------------------------ - -uno::Reference< com::sun::star::system::XSystemShellExecute > OExtensionNotPresentDialog::getShellExecuter() const -{ - uno::Reference<com::sun::star::system::XSystemShellExecute> xExecuter( m_xMultiServiceFactory->createInstance( UNISTRING( "com.sun.star.system.SystemShellExecute" )), uno::UNO_QUERY_THROW); - return xExecuter; -} -// ----------------------------------------------------------------------------- -rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const -{ - // get the URL to open in a browser from Configuration - static const ::rtl::OUString sConfigName( RTL_CONSTASCII_USTRINGPARAM( "/org.openoffice.Office.ReportDesign/Extension" ) ); - - ::utl::OConfigurationTreeRoot aConfiguration( ::utl::OConfigurationTreeRoot::createWithServiceFactory( m_xMultiServiceFactory, sConfigName ) ); - - rtl::OUString aValue; - aConfiguration.getNodeValue( _sPropertyName ) >>= aValue; - return aValue; -} - -// ----------------------------------------------------------------------------- -rtl::OUString OExtensionNotPresentDialog::getFromConfigurationExtension(rtl::OString const& _sPropertyName) const -{ - return getFromConfigurationExtension(rtl::OStringToOUString( _sPropertyName, RTL_TEXTENCODING_UTF8) ); -} - -// ----------------------------------------------------------------------------- -// handle the click on the download button -IMPL_LINK( OExtensionNotPresentDialog, Download_Click, PushButton*, EMPTYARG ) -{ - try - { - EndDialog( TRUE ); - - rtl::OUString suDownloadURL = getFromConfigurationExtension("DownloadURL"); - if (suDownloadURL.getLength() == 0) - { - // fallback - suDownloadURL = UNISTRING("http://extensions.libreoffice.org"); - } - - // open such URL in a browser - localizeWebserviceURI(suDownloadURL); - uno::Reference< com::sun::star::system::XSystemShellExecute > xShellExecute( getShellExecuter() ); - xShellExecute->execute( suDownloadURL, ::rtl::OUString(), com::sun::star::system::SystemShellExecuteFlags::DEFAULTS ); - } - catch( const uno::Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return 0; -} - -// ============================================================================= -} // rptui -// ============================================================================= - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc b/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc deleted file mode 100644 index 712193982075..000000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.hrc +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBU_EXTENSIONNOTPRESENT_HRC -#define DBU_EXTENSIONNOTPRESENT_HRC - -#define FT_TEXT (1) -#define FI_WARNING (2) -#define PB_DOWNLOAD (10) -#define PB_CANCEL (11) - -#define FIXEDTEXT_HEIGHT 8 -#define CELL_PADDING 8 -#define BUTTON_HEIGHT 14 -#define BUTTON_WIDTH 55 -#define BROWSER_HEIGHT 75 -#define LEFT_PADDING 32 /* size for the icon */ -#define RIGHT_PADDING 16 -#define DLG_WIDTH ( 250 ) -#define ACTION_LINE_START (CELL_PADDING + ( 3 * FIXEDTEXT_HEIGHT ) + 2 * CELL_PADDING + 1 ) -#define DLG_HEIGHT (ACTION_LINE_START + BUTTON_HEIGHT + CELL_PADDING) - - -#endif /* DBU_EXTENSIONNOTPRESENT_HRC */ diff --git a/dbaccess/source/ui/dlg/ExtensionNotPresent.src b/dbaccess/source/ui/dlg/ExtensionNotPresent.src deleted file mode 100644 index b224714cd482..000000000000 --- a/dbaccess/source/ui/dlg/ExtensionNotPresent.src +++ /dev/null @@ -1,81 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#include "ExtensionNotPresent.hrc" -#include "dbaccess_helpid.hrc" -#include "dbu_resource.hrc" -#include <svx/globlmn.hrc> -#include <svx/svxids.hrc> - - -String RID_STR_EXTENSION_NOT_PRESENT -{ - // #i96130# use hard coded name - Text [ en-US ] = "To open a report you require the extension Sun™ Report Builder.\n\nClick 'Download...' to download and install the extension."; -}; - -ModalDialog RID_EXTENSION_NOT_PRESENT_DLG -{ - OutputSize = TRUE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( DLG_WIDTH , DLG_HEIGHT ) ; - Text [ en-US ] = "%PRODUCTNAME %PRODUCTVERSION" ; - HelpId = HID_EXTENSION_NOT_PRESENT_DLG; - Moveable = TRUE ; - Closeable = TRUE ; - - // most of the calulated values here are overridden by the ExtensionNotPresent ctor itself. - FixedImage FI_WARNING - { - Pos = MAP_APPFONT (CELL_PADDING / 2, CELL_PADDING) ; - Size = (32, 32); - Fixed=BMP_EXCEPTION_WARNING; - }; - - - FixedText FT_TEXT - { - Pos = MAP_APPFONT ( 32 , CELL_PADDING ) ; - Size = MAP_APPFONT ( DLG_WIDTH - LEFT_PADDING - RIGHT_PADDING , 3 * (FIXEDTEXT_HEIGHT + 2) ) ; - // Text will set outside from RID_STR_EXTENSION_NOT_PRESENT - }; - - PushButton PB_DOWNLOAD - { - Pos = MAP_APPFONT ( DLG_WIDTH / 2 - (CELL_PADDING/2) - BUTTON_WIDTH, ACTION_LINE_START ) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - DefButton = TRUE ; - TabStop = TRUE ; - Text [ en-US ] = "~Download..." ; - }; - - CancelButton PB_CANCEL - { - Pos = MAP_APPFONT ( DLG_WIDTH / 2 + (CELL_PADDING/2), ACTION_LINE_START) ; - Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; - TabStop = TRUE ; - }; -}; diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx index 947bec14a021..7618e732fd1a 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.cxx +++ b/dbaccess/source/ui/dlg/RelationDlg.cxx @@ -63,7 +63,7 @@ DBG_NAME(ORelationDialog) //======================================================================== ORelationDialog::ORelationDialog( OJoinTableView* pParent, const TTableConnectionData::value_type& pConnectionData, - BOOL bAllowTableSelect ) + sal_Bool bAllowTableSelect ) :ModalDialog( pParent, ModuleRes(DLG_REL_PROPERTIES) ) ,m_pTableMap(pParent->GetTabWinMap()) @@ -83,7 +83,7 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent, ,aPB_HELP( this, ModuleRes( PB_HELP ) ) ,m_pOrigConnData( pConnectionData ) - ,m_bTriedOneUpdate(FALSE) + ,m_bTriedOneUpdate(sal_False) { DBG_CTOR(ORelationDialog,NULL); @@ -121,18 +121,18 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD { case KeyRule::NO_ACTION: case KeyRule::RESTRICT: - aRB_NoCascUpd.Check( TRUE ); + aRB_NoCascUpd.Check( sal_True ); break; case KeyRule::CASCADE: - aRB_CascUpd.Check( TRUE ); + aRB_CascUpd.Check( sal_True ); break; case KeyRule::SET_NULL: - aRB_CascUpdNull.Check( TRUE ); + aRB_CascUpdNull.Check( sal_True ); break; case KeyRule::SET_DEFAULT: - aRB_CascUpdDefault.Check( TRUE ); + aRB_CascUpdDefault.Check( sal_True ); break; } @@ -141,18 +141,18 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD { case KeyRule::NO_ACTION: case KeyRule::RESTRICT: - aRB_NoCascDel.Check( TRUE ); + aRB_NoCascDel.Check( sal_True ); break; case KeyRule::CASCADE: - aRB_CascDel.Check( TRUE ); + aRB_CascDel.Check( sal_True ); break; case KeyRule::SET_NULL: - aRB_CascDelNull.Check( TRUE ); + aRB_CascDelNull.Check( sal_True ); break; case KeyRule::SET_DEFAULT: - aRB_CascDelDefault.Check( TRUE ); + aRB_CascDelDefault.Check( sal_True ); break; } } @@ -171,7 +171,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) { ////////////////////////////////////////////////////////////////////// // RadioButtons auslesen - UINT16 nAttrib = 0; + sal_uInt16 nAttrib = 0; // Delete Rules if( aRB_NoCascDel.IsChecked() ) @@ -200,7 +200,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) m_pTableControl->SaveModified(); - //// wenn die ComboBoxen fuer die Tabellenauswahl enabled sind (Constructor mit bAllowTableSelect==TRUE), dann muss ich in die + //// wenn die ComboBoxen fuer die Tabellenauswahl enabled sind (Constructor mit bAllowTableSelect==sal_True), dann muss ich in die //// Connection auch die Tabellennamen stecken //m_pConnData->SetSourceWinName(m_pTableControl->getSourceWinName()); //m_pConnData->SetDestWinName(m_pTableControl->getDestWinName()); @@ -227,7 +227,7 @@ IMPL_LINK( ORelationDialog, OKClickHdl, Button*, /*pButton*/ ) DBG_UNHANDLED_EXCEPTION(); } - m_bTriedOneUpdate = TRUE; + m_bTriedOneUpdate = sal_True; // this means that the original connection may be lost (if m_pConnData was not a newly created but an // existent conn to be modified), which we reflect by returning RET_NO (see ::Execute) diff --git a/dbaccess/source/ui/dlg/RelationDlg.src b/dbaccess/source/ui/dlg/RelationDlg.src index 908cbab62c92..90602e37c4a9 100644 --- a/dbaccess/source/ui/dlg/RelationDlg.src +++ b/dbaccess/source/ui/dlg/RelationDlg.src @@ -35,6 +35,7 @@ ModalDialog DLG_REL_PROPERTIES { + HelpID = "dbaccess:ModalDialog:DLG_REL_PROPERTIES"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 186 , 205 ) ; diff --git a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx index fe392d82cbe0..17fcf7861e51 100644 --- a/dbaccess/source/ui/dlg/TablesSingleDlg.cxx +++ b/dbaccess/source/ui/dlg/TablesSingleDlg.cxx @@ -31,13 +31,14 @@ #include "TablesSingleDlg.hxx" #include "DbAdminImpl.hxx" -#include "dbaccess_helpid.hrc" #include "tablespage.hxx" #include <vcl/msgbox.hxx> #include "dsitems.hxx" #include "propertysetitem.hxx" +#include "dbu_dlg.hrc" + //......................................................................... namespace dbaui { @@ -56,7 +57,7 @@ OTableSubscriptionDialog::OTableSubscriptionDialog(Window* pParent ,SfxItemSet* _pItems ,const Reference< XMultiServiceFactory >& _rxORB ,const ::com::sun::star::uno::Any& _aDataSourceName) - :SfxSingleTabDialog(pParent,UID_DLG_TABLE_FILTER,_pItems) + :SfxSingleTabDialog(pParent,DLG_TABLE_FILTER,_pItems) ,m_pImpl( new ODbDataSourceAdministrationHelper( _rxORB, pParent, this ) ) ,m_bStopExecution(sal_False) ,m_pOutSet(_pItems) diff --git a/dbaccess/source/ui/dlg/UserAdmin.src b/dbaccess/source/ui/dlg/UserAdmin.src index 34a42a048931..74c8c1ed8098 100644 --- a/dbaccess/source/ui/dlg/UserAdmin.src +++ b/dbaccess/source/ui/dlg/UserAdmin.src @@ -157,6 +157,7 @@ ModalDialog DLG_PASSWORD }; Edit ED_OLDPASSWORD { + HelpID = "dbaccess:Edit:DLG_PASSWORD:ED_OLDPASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 16 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; @@ -171,6 +172,7 @@ ModalDialog DLG_PASSWORD }; Edit ED_PASSWORD { + HelpID = "dbaccess:Edit:DLG_PASSWORD:ED_PASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 34 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; @@ -184,6 +186,7 @@ ModalDialog DLG_PASSWORD }; Edit ED_PASSWORD_REPEAT { + HelpID = "dbaccess:Edit:DLG_PASSWORD:ED_PASSWORD_REPEAT"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 51 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.cxx b/dbaccess/source/ui/dlg/UserAdminDlg.cxx index 5e7e28158777..2ef473cef14d 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.cxx +++ b/dbaccess/source/ui/dlg/UserAdminDlg.cxx @@ -134,7 +134,7 @@ DBG_NAME(OUserAdminDlg) return nRet; } //------------------------------------------------------------------------- - void OUserAdminDlg::PageCreated(USHORT _nId, SfxTabPage& _rPage) + void OUserAdminDlg::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB()); diff --git a/dbaccess/source/ui/dlg/UserAdminDlg.src b/dbaccess/source/ui/dlg/UserAdminDlg.src index 5509820d1828..5b07b43093b5 100644 --- a/dbaccess/source/ui/dlg/UserAdminDlg.src +++ b/dbaccess/source/ui/dlg/UserAdminDlg.src @@ -48,7 +48,6 @@ TabDialog DLG_DATABASE_USERADMIN { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_PAGETITLE_USERADMIN { diff --git a/dbaccess/source/ui/dlg/admincontrols.cxx b/dbaccess/source/ui/dlg/admincontrols.cxx index 25ffd31753d8..a8b11805dcb3 100644 --- a/dbaccess/source/ui/dlg/admincontrols.cxx +++ b/dbaccess/source/ui/dlg/admincontrols.cxx @@ -79,7 +79,7 @@ namespace dbaui private: const String m_sDisabledText; String m_sUserText; - BOOL m_bLastKnownEnabledState; + sal_Bool m_bLastKnownEnabledState; }; //-------------------------------------------------------------------- @@ -151,7 +151,7 @@ namespace dbaui //==================================================================== //-------------------------------------------------------------------- MySQLNativeSettings::MySQLNativeSettings( Window& _rParent, const Link& _rControlModificationLink ) - :Control( &_rParent, ModuleRes( RID_MYSQL_NATIVE_SETTINGS ).SetAutoRelease( FALSE ) ) + :Control( &_rParent, ModuleRes( RID_MYSQL_NATIVE_SETTINGS ).SetAutoRelease( sal_False ) ) ,m_aDatabaseNameLabel ( this, ModuleRes( FT_MYSQL_DATABASE_NAME ) ) ,m_aDatabaseName ( this, ModuleRes( ED_MYSQL_DATABASE_NAME ) ) ,m_aHostPortRadio ( this, ModuleRes( RB_MYSQL_HOST_PORT ) ) @@ -219,7 +219,7 @@ namespace dbaui } //-------------------------------------------------------------------- - BOOL MySQLNativeSettings::FillItemSet( SfxItemSet& _rSet ) + sal_Bool MySQLNativeSettings::FillItemSet( SfxItemSet& _rSet ) { sal_Bool bChangedSomething = sal_False; diff --git a/dbaccess/source/ui/dlg/admincontrols.hxx b/dbaccess/source/ui/dlg/admincontrols.hxx index cd3246cdc332..83353be4b8d0 100644 --- a/dbaccess/source/ui/dlg/admincontrols.hxx +++ b/dbaccess/source/ui/dlg/admincontrols.hxx @@ -70,7 +70,7 @@ namespace dbaui void fillControls( ::std::vector< ISaveValueWrapper* >& _rControlList ); void fillWindows( ::std::vector< ISaveValueWrapper* >& _rControlList ); - BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); void implInitControls( const SfxItemSet& _rSet ); bool canAdvance() const; diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index acfc272d2e7e..2bf12cf82740 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -215,7 +215,7 @@ namespace dbaui return true; } // ----------------------------------------------------------------------- - void OGenericAdministrationPage::fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, USHORT _nID, sal_Bool& _bChangedSomething, bool _bRevertValue ) + void OGenericAdministrationPage::fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, sal_uInt16 _nID, sal_Bool& _bChangedSomething, bool _bRevertValue ) { if ( (_pCheckBox != NULL ) && ( _pCheckBox->GetState() != _pCheckBox->GetSavedValue() ) ) { @@ -237,16 +237,16 @@ namespace dbaui } } // ----------------------------------------------------------------------- - void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething) + void OGenericAdministrationPage::fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething) { if( (_pEdit != NULL) && (_pEdit->GetValue() != _pEdit->GetSavedValue().ToInt32()) ) { - _rSet.Put(SfxInt32Item(_nID, static_cast<INT32>(_pEdit->GetValue()))); + _rSet.Put(SfxInt32Item(_nID, static_cast<sal_Int32>(_pEdit->GetValue()))); _bChangedSomething = sal_True; } } // ----------------------------------------------------------------------- - void OGenericAdministrationPage::fillString(SfxItemSet& _rSet,Edit* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething) + void OGenericAdministrationPage::fillString(SfxItemSet& _rSet,Edit* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething) { if( (_pEdit != NULL) && (_pEdit->GetText() != _pEdit->GetSavedValue()) ) { @@ -305,7 +305,7 @@ namespace dbaui return 0L; } - void OGenericAdministrationPage::SetHeaderText( USHORT _nFTResId, USHORT _StringResId) + void OGenericAdministrationPage::SetHeaderText( sal_uInt16 _nFTResId, sal_uInt16 _StringResId) { delete(m_pFT_HeaderText); m_pFT_HeaderText = new FixedText(this, ModuleRes(_nFTResId)); @@ -314,7 +314,6 @@ namespace dbaui SetControlFontWeight(m_pFT_HeaderText); } - //========================================================================= //= LayoutHelper //========================================================================= @@ -332,6 +331,24 @@ namespace dbaui _rControl.SetPosPixel( aControlPos ); } + //------------------------------------------------------------------------- + void LayoutHelper::fitSizeRightAligned( PushButton& io_button ) + { + const Point aOldPos = io_button.GetPosPixel(); + const Size aOldSize = io_button.GetSizePixel(); + const Size aMinSize( io_button.CalcMinimumSize() ); + if ( aMinSize.Width() > aOldSize.Width() ) + { + io_button.SetPosSizePixel( + aOldPos.X() + aOldSize.Width() - aMinSize.Width(), + 0, + aMinSize.Width(), + 0, + WINDOW_POSSIZE_X | WINDOW_POSSIZE_WIDTH + ); + } + } + //......................................................................... } // namespace dbaui //......................................................................... diff --git a/dbaccess/source/ui/dlg/adminpages.hxx b/dbaccess/source/ui/dlg/adminpages.hxx index 95a6f63d01ec..51fd7f025965 100644 --- a/dbaccess/source/ui/dlg/adminpages.hxx +++ b/dbaccess/source/ui/dlg/adminpages.hxx @@ -216,7 +216,7 @@ namespace dbaui @param _bRevertValue set to <TRUE/> if the display value should be reverted before putting it into the set */ - static void fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, USHORT _nID, sal_Bool& _bChangedSomething, bool _bRevertValue = false); + static void fillBool( SfxItemSet& _rSet, CheckBox* _pCheckBox, sal_uInt16 _nID, sal_Bool& _bChangedSomething, bool _bRevertValue = false); /** fills the int value into the item set when the value changed. @param _rSet @@ -228,7 +228,7 @@ namespace dbaui @param _bChangedSomething <TRUE/> if something changed otherwise <FALSE/> */ - static void fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething); + static void fillInt32(SfxItemSet& _rSet,NumericField* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething); /** fills the String value into the item set when the value changed. @param _rSet @@ -240,12 +240,12 @@ namespace dbaui @param _bChangedSomething <TRUE/> if something changed otherwise <FALSE/> */ - static void fillString(SfxItemSet& _rSet,Edit* _pEdit,USHORT _nID,sal_Bool& _bChangedSomething); + static void fillString(SfxItemSet& _rSet,Edit* _pEdit,sal_uInt16 _nID,sal_Bool& _bChangedSomething); protected: // used to set the right Pane header of a wizard to bold void SetControlFontWeight(Window* _pWindow, FontWeight _eWeight = WEIGHT_BOLD); - void SetHeaderText( USHORT _nFTResId, USHORT _StringResId); + void SetHeaderText( sal_uInt16 _nFTResId, sal_uInt16 _StringResId); /** This link be used for controls where the tabpage does not need to take any special action when the control is modified. The implementation just calls callModifiedHdl. @@ -277,6 +277,10 @@ namespace dbaui const ControlRelation _eRelation, const long _nIndentAppFont ); + /** fits the button size to be large enough to contain the buttons text + */ + static void fitSizeRightAligned( PushButton& io_button ); + // why is CalcMinimumSize not a virtual method of ::Window? }; //......................................................................... diff --git a/dbaccess/source/ui/dlg/adodatalinks.cxx b/dbaccess/source/ui/dlg/adodatalinks.cxx index a0f0365fb22b..9af7714a1cdc 100644 --- a/dbaccess/source/ui/dlg/adodatalinks.cxx +++ b/dbaccess/source/ui/dlg/adodatalinks.cxx @@ -30,7 +30,7 @@ #include "precompiled_dbaccess.hxx" -#if defined(WIN) || defined(WNT) +#if defined(WNT) #if defined _MSC_VER #pragma warning(push, 1) #pragma warning(disable: 4917) @@ -174,7 +174,7 @@ BSTR PromptEdit(long hWnd,BSTR connstr) // Prompt for connection information. hr = dlPrompt->PromptEdit((IDispatch **)&piTmpConnection,&pbSuccess); - if( SUCCEEDED( hr ) && FALSE == pbSuccess ) //if user press cancel then FALSE == pbSuccess + if( SUCCEEDED( hr ) && sal_False == pbSuccess ) //if user press cancel then sal_False == pbSuccess { piTmpConnection->Release( ); dlPrompt->Release( ); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index 3c0ca82d77fa..540e26982039 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -374,15 +374,15 @@ OAddTableDlg::OAddTableDlg( Window* pParent, IAddTableDialogContext& _rContext ) m_aQueryList.SetSelectHdl( LINK( this, OAddTableDlg, TableListSelectHdl ) ); ////////////////////////////////////////////////////////////////////// - m_aTableList.EnableInplaceEditing( FALSE ); - m_aTableList.SetWindowBits(WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); + m_aTableList.EnableInplaceEditing( sal_False ); + m_aTableList.SetStyle(m_aTableList.GetStyle() | WB_BORDER | WB_HASLINES |WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HASLINESATROOT | WB_SORT | WB_HSCROLL ); m_aTableList.EnableCheckButton( NULL ); // do not show any buttons m_aTableList.SetSelectionMode( SINGLE_SELECTION ); m_aTableList.notifyHiContrastChanged(); m_aTableList.suppressEmptyFolders(); ////////////////////////////////////////////////////////////////////// - m_aQueryList.EnableInplaceEditing( FALSE ); + m_aQueryList.EnableInplaceEditing( sal_False ); m_aQueryList.SetSelectionMode( SINGLE_SELECTION ); ////////////////////////////////////////////////////////////////////// @@ -419,15 +419,15 @@ void OAddTableDlg::impl_switchTo( ObjectList _eList ) switch ( _eList ) { case Tables: - m_aTableList.Show( TRUE ); m_aCaseTables.Check( TRUE ); - m_aQueryList.Show( FALSE ); m_aCaseQueries.Check( FALSE ); + m_aTableList.Show( sal_True ); m_aCaseTables.Check( sal_True ); + m_aQueryList.Show( sal_False ); m_aCaseQueries.Check( sal_False ); m_pCurrentList.reset( new TableListFacade( m_aTableList, m_rContext.getConnection() ) ); m_aTableList.GrabFocus(); break; case Queries: - m_aTableList.Show( FALSE ); m_aCaseTables.Check( FALSE ); - m_aQueryList.Show( TRUE ); m_aCaseQueries.Check( TRUE ); + m_aTableList.Show( sal_False ); m_aCaseTables.Check( sal_False ); + m_aQueryList.Show( sal_True ); m_aCaseQueries.Check( sal_True ); m_pCurrentList.reset( new QueryListFacade( m_aQueryList, m_rContext.getConnection() ) ); m_aQueryList.GrabFocus(); break; @@ -501,7 +501,7 @@ IMPL_LINK( OAddTableDlg, OnTypeSelected, void*, /*EMPTY_ARG*/ ) } //------------------------------------------------------------------------------ -BOOL OAddTableDlg::Close() +sal_Bool OAddTableDlg::Close() { m_rContext.onWindowClosing( this ); return ModelessDialog::Close(); diff --git a/dbaccess/source/ui/dlg/adtabdlg.src b/dbaccess/source/ui/dlg/adtabdlg.src index ecff324d7ec9..deb914dd831d 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.src +++ b/dbaccess/source/ui/dlg/adtabdlg.src @@ -38,7 +38,7 @@ ModelessDialog DLG_JOIN_TABADD { OutputSize = TRUE ; SVLook = TRUE ; - HelpID = DLG_JOIN_TABADD ; + HelpID = HID_DLG_JOIN_TABADD ; Size = MAP_APPFONT ( 178 , 147 ) ; Moveable = TRUE ; Closeable = TRUE ; @@ -46,6 +46,7 @@ ModelessDialog DLG_JOIN_TABADD RadioButton RB_CASE_TABLES { + HelpID = "dbaccess:RadioButton:DLG_JOIN_TABADD:RB_CASE_TABLES"; Pos = MAP_APPFONT( 6, 6 ); Size = MAP_APPFONT( 50, 8 ); Text [ en-US ] = "Tables"; @@ -53,6 +54,7 @@ ModelessDialog DLG_JOIN_TABADD RadioButton RB_CASE_QUERIES { + HelpID = "dbaccess:RadioButton:DLG_JOIN_TABADD:RB_CASE_QUERIES"; Pos = MAP_APPFONT( 62, 6 ); Size = MAP_APPFONT( 50, 8 ); Text [ en-US ] = "Queries"; @@ -70,6 +72,7 @@ ModelessDialog DLG_JOIN_TABADD PushButton PB_ADDTABLE { + HelpID = "dbaccess:PushButton:DLG_JOIN_TABADD:PB_ADDTABLE"; Pos = MAP_APPFONT ( 123 , 6 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; Text [ en-US ] = "~Add" ; diff --git a/dbaccess/source/ui/dlg/advancedsettings.cxx b/dbaccess/source/ui/dlg/advancedsettings.cxx index f64231b60dc2..d7dec225f1a8 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.cxx +++ b/dbaccess/source/ui/dlg/advancedsettings.cxx @@ -70,9 +70,9 @@ namespace dbaui struct BooleanSettingDesc { CheckBox** ppControl; // the dialog's control which displays this setting - USHORT nControlResId; // the resource ID to load the control from - USHORT nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting - bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is FALSE, and vice versa + sal_uInt16 nControlResId; // the resource ID to load the control from + sal_uInt16 nItemId; // the ID of the item (in an SfxItemSet) which corresponds to this setting + bool bInvertedDisplay; // true if and only if the checkbox is checked when the item is sal_False, and vice versa }; //======================================================================== @@ -98,9 +98,12 @@ namespace dbaui ,m_pPrimaryKeySupport(NULL) ,m_pBooleanComparisonModeLabel( NULL ) ,m_pBooleanComparisonMode( NULL ) + ,m_pMaxRowScanLabel( NULL ) + ,m_pMaxRowScan( NULL ) ,m_aControlDependencies() ,m_aBooleanSettings() ,m_bHasBooleanComparisonMode( _rDSMeta.getFeatureSet().has( DSID_BOOLEANCOMPARISON ) ) + ,m_bHasMaxRowScan( _rDSMeta.getFeatureSet().has( DSID_MAX_ROW_SCAN ) ) { impl_initBooleanSettings(); @@ -111,17 +114,17 @@ namespace dbaui ++setting ) { - USHORT nItemId = setting->nItemId; + sal_uInt16 nItemId = setting->nItemId; if ( rFeatures.has( nItemId ) ) { - USHORT nResourceId = setting->nControlResId; + sal_uInt16 nResourceId = setting->nControlResId; (*setting->ppControl) = new CheckBox( this, ModuleRes( nResourceId ) ); (*setting->ppControl)->SetClickHdl( getControlModifiedLink() ); // check whether this must be a tristate check box const SfxPoolItem& rItem = _rCoreAttrs.Get( nItemId ); if ( rItem.ISA( OptionalBoolItem ) ) - (*setting->ppControl)->EnableTriState( TRUE ); + (*setting->ppControl)->EnableTriState( sal_True ); } } @@ -165,6 +168,21 @@ namespace dbaui m_pBooleanComparisonModeLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) ); m_pBooleanComparisonMode->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) ); } + // create the controls for the max row scan + if ( m_bHasMaxRowScan ) + { + m_pMaxRowScanLabel = new FixedText( this, ModuleRes( FT_MAXROWSCAN ) ); + m_pMaxRowScan = new NumericField( this, ModuleRes( NF_MAXROWSCAN ) ); + m_pMaxRowScan->SetModifyHdl(getControlModifiedLink()); + m_pMaxRowScan->SetUseThousandSep(sal_False); + + Point aLabelPos( m_pMaxRowScanLabel->GetPosPixel() ); + Point aControlPos( m_pMaxRowScan->GetPosPixel() ); + long nMoveUp = aControlPos.Y() - aPos.Y(); + + m_pMaxRowScanLabel->SetPosPixel( Point( aLabelPos.X(), aLabelPos.Y() - nMoveUp ) ); + m_pMaxRowScan->SetPosPixel( Point( aControlPos.X(), aControlPos.Y() - nMoveUp ) ); + } FreeResource(); } @@ -191,6 +209,8 @@ namespace dbaui DELETEZ( m_pPrimaryKeySupport ); DELETEZ( m_pBooleanComparisonModeLabel ); DELETEZ( m_pBooleanComparisonMode ); + DELETEZ( m_pMaxRowScanLabel ); + DELETEZ( m_pMaxRowScan ); } // ----------------------------------------------------------------------- @@ -231,6 +251,10 @@ namespace dbaui { _rControlList.push_back( new ODisableWrapper< FixedText >( m_pBooleanComparisonModeLabel ) ); } + if ( m_bHasMaxRowScan ) + { + _rControlList.push_back( new ODisableWrapper< FixedText >( m_pMaxRowScanLabel ) ); + } } // ----------------------------------------------------------------------- @@ -249,6 +273,8 @@ namespace dbaui if ( m_bHasBooleanComparisonMode ) _rControlList.push_back( new OSaveValueWrapper< ListBox >( m_pBooleanComparisonMode ) ); + if ( m_bHasMaxRowScan ) + _rControlList.push_back(new OSaveValueWrapper<NumericField>(m_pMaxRowScan)); } // ----------------------------------------------------------------------- @@ -293,7 +319,7 @@ namespace dbaui } else { - BOOL bValue = *aValue; + sal_Bool bValue = *aValue; if ( setting->bInvertedDisplay ) bValue = !bValue; (*setting->ppControl)->Check( bValue ); @@ -304,7 +330,13 @@ namespace dbaui if ( m_bHasBooleanComparisonMode ) { SFX_ITEMSET_GET( _rSet, pBooleanComparison, SfxInt32Item, DSID_BOOLEANCOMPARISON, sal_True ); - m_pBooleanComparisonMode->SelectEntryPos( static_cast< USHORT >( pBooleanComparison->GetValue() ) ); + m_pBooleanComparisonMode->SelectEntryPos( static_cast< sal_uInt16 >( pBooleanComparison->GetValue() ) ); + } + + if ( m_bHasMaxRowScan ) + { + SFX_ITEMSET_GET(_rSet, pMaxRowScan, SfxInt32Item, DSID_MAX_ROW_SCAN, sal_True); + m_pMaxRowScan->SetValue(pMaxRowScan->GetValue()); } OGenericAdministrationPage::implInitControls(_rSet, _bSaveValue); @@ -335,6 +367,10 @@ namespace dbaui bChangedSomething = sal_True; } } + if ( m_bHasMaxRowScan ) + { + fillInt32(_rSet,m_pMaxRowScan,DSID_MAX_ROW_SCAN,bChangedSomething); + } return bChangedSomething; } @@ -487,7 +523,7 @@ namespace dbaui } //------------------------------------------------------------------------- - void AdvancedSettingsDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage) + void AdvancedSettingsDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB()); diff --git a/dbaccess/source/ui/dlg/advancedsettings.hrc b/dbaccess/source/ui/dlg/advancedsettings.hrc index 8abc5d8810d2..193fdf5f3853 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hrc +++ b/dbaccess/source/ui/dlg/advancedsettings.hrc @@ -69,7 +69,9 @@ #define FT_AUTOINCREMENTVALUE 1 #define FT_RETRIEVE_AUTO 2 #define FT_BOOLEANCOMPARISON 3 +#define FT_MAXROWSCAN 4 #define LB_BOOLEANCOMPARISON 1 +#define NF_MAXROWSCAN 1 #endif // DBAUI_ADVANCEDSETTINGS_HRC diff --git a/dbaccess/source/ui/dlg/advancedsettings.hxx b/dbaccess/source/ui/dlg/advancedsettings.hxx index f4c6e75e4f3f..6a6ae93f9f8e 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.hxx +++ b/dbaccess/source/ui/dlg/advancedsettings.hxx @@ -38,6 +38,7 @@ #include <svtools/dialogcontrolling.hxx> #include <vcl/lstbox.hxx> +#include <vcl/field.hxx> #include <vector> @@ -77,15 +78,19 @@ namespace dbaui FixedText* m_pBooleanComparisonModeLabel; ListBox* m_pBooleanComparisonMode; + FixedText* m_pMaxRowScanLabel; + NumericField* m_pMaxRowScan; + ::svt::ControlDependencyManager m_aControlDependencies; BooleanSettingDescs m_aBooleanSettings; bool m_bHasBooleanComparisonMode; + bool m_bHasMaxRowScan; public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); SpecialSettingsPage(Window* pParent, const SfxItemSet& _rCoreAttrs, const DataSourceMetaData& _rDSMeta ); @@ -123,7 +128,7 @@ namespace dbaui m_aControlDependencies; public: - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); GeneratedValuesPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: diff --git a/dbaccess/source/ui/dlg/advancedsettings.src b/dbaccess/source/ui/dlg/advancedsettings.src index 4c5a7d924d33..9a2dc467d586 100644 --- a/dbaccess/source/ui/dlg/advancedsettings.src +++ b/dbaccess/source/ui/dlg/advancedsettings.src @@ -249,10 +249,29 @@ WORKAROUND \ }; \ +#define AUTO_MAXROWSCAN(AUTO_Y) \ + FixedText FT_MAXROWSCAN \ + { \ + Pos = MAP_APPFONT ( START_X , AUTO_Y + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) ; \ + Size = MAP_APPFONT ( 100 , CHECKBOX_HEIGHT ); \ + Text [ en-US ] = "Rows to scan column types"; \ + }; \ + NumericField NF_MAXROWSCAN \ + { \ + Pos = MAP_APPFONT ( START_X + 100, AUTO_Y ) ; \ + Size = MAP_APPFONT ( 60 , EDIT_HEIGHT ) ; \ + TabStop = TRUE ; \ + NoThousandSep = TRUE; \ + Border = TRUE; \ + HelpId = HID_DSADMIN_MAXROWSCAN; \ + }; \ + + //------------------------------------------------------------------------- TabPage PAGE_GENERATED_VALUES { + HelpID = "dbaccess:TabPage:PAGE_GENERATED_VALUES"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( ADVANCED_PAGE_X , ADVANCED_PAGE_Y ) ; @@ -311,6 +330,7 @@ TabPage PAGE_GENERATED_VALUES TabPage PAGE_ADVANCED_SETTINGS_SPECIAL { + HelpID = "dbaccess:TabPage:PAGE_ADVANCED_SETTINGS_SPECIAL"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( ADVANCED_PAGE_X , ADVANCED_PAGE_Y ) ; @@ -332,6 +352,7 @@ TabPage PAGE_ADVANCED_SETTINGS_SPECIAL AUTO_ESCAPE_DATETIME( 14*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_PRIMARY_KEY_SUPPORT( 15*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 15*CHECKBOX_HEIGHT + RELATED_CONTROLS ) AUTO_BOOLEANCOMPARISON( 16*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) + AUTO_MAXROWSCAN( 17*RELATED_CONTROLS + FIXEDTEXT_HEIGHT + 14*CHECKBOX_HEIGHT + RELATED_CONTROLS + ( LISTBOX_HEIGHT - CHECKBOX_HEIGHT ) / 2 ) }; //------------------------------------------------------------------------- @@ -349,7 +370,6 @@ TabDialog DLG_DATABASE_ADVANCED { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_GENERATED_VALUE diff --git a/dbaccess/source/ui/dlg/dbadmin.cxx b/dbaccess/source/ui/dlg/dbadmin.cxx index 9b23a33cb20e..510b1864eb0b 100644 --- a/dbaccess/source/ui/dlg/dbadmin.cxx +++ b/dbaccess/source/ui/dlg/dbadmin.cxx @@ -109,7 +109,7 @@ short ODbAdminDialog::Ok() } //------------------------------------------------------------------------- -void ODbAdminDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage) +void ODbAdminDialog::PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage) { // register ourself as modified listener static_cast<OGenericAdministrationPage&>(_rPage).SetServiceFactory(m_pImpl->getORB()); @@ -124,7 +124,7 @@ void ODbAdminDialog::PageCreated(USHORT _nId, SfxTabPage& _rPage) } // ----------------------------------------------------------------------------- -void ODbAdminDialog::addDetailPage(USHORT _nPageId, USHORT _nTextId, CreateTabPage _pCreateFunc) +void ODbAdminDialog::addDetailPage(sal_uInt16 _nPageId, sal_uInt16 _nTextId, CreateTabPage _pCreateFunc) { // open our own resource block, as the page titles are strings local to this block LocalResourceAccess aDummy(DLG_DATABASE_ADMINISTRATION, RSC_TABDIALOG); @@ -409,6 +409,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp *pCounter++ = new SfxBoolItem(DSID_ESCAPE_DATETIME, sal_True); *pCounter++ = new SfxStringItem(DSID_NAMED_PIPE, String()); *pCounter++ = new OptionalBoolItem( DSID_PRIMARY_KEY_SUPPORT ); + *pCounter++ = new SfxInt32Item(DSID_MAX_ROW_SCAN, 100); // create the pool static SfxItemInfo const aItemInfos[DSID_LAST_ITEM_ID - DSID_FIRST_ITEM_ID + 1] = @@ -471,6 +472,7 @@ SfxItemSet* ODbAdminDialog::createItemSet(SfxItemSet*& _rpSet, SfxItemPool*& _rp {0,0}, {0,0}, {0,0}, + {0,0}, {0,0} }; diff --git a/dbaccess/source/ui/dlg/dbadmin.src b/dbaccess/source/ui/dlg/dbadmin.src index e0fb99ac299a..e5eae80b5406 100644 --- a/dbaccess/source/ui/dlg/dbadmin.src +++ b/dbaccess/source/ui/dlg/dbadmin.src @@ -112,7 +112,6 @@ TabDialog DLG_DATABASE_ADMINISTRATION { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; //......................................................................... @@ -146,7 +145,6 @@ ModalDialog DLG_DATABASE_TYPE_CHANGE { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; Text [ en-US ] = "Database properties" ; }; @@ -195,6 +193,7 @@ TabPage PAGE_GENERAL RadioButton RB_OPENEXISTINGDOC { + HelpID = "dbaccess:RadioButton:PAGE_GENERAL:RB_OPENEXISTINGDOC"; Pos = MAP_APPFONT (START_X + 6 , 97 ); Size = MAP_APPFONT ( 206 , 8 ) ; Text [ en-US ] = "Open an existing database ~file" ; @@ -209,6 +208,7 @@ TabPage PAGE_GENERAL ListBox LB_DOCUMENTLIST { + HelpID = "dbaccess:ListBox:PAGE_GENERAL:LB_DOCUMENTLIST"; Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 121 ); Size = MAP_APPFONT( 120, 14 ); DropDown = TRUE; @@ -217,6 +217,7 @@ TabPage PAGE_GENERAL PushButton PB_OPENDOCUMENT { + HelpID = "dbaccess:PushButton:PAGE_GENERAL:PB_OPENDOCUMENT"; Pos = MAP_APPFONT( START_X + INDENTED_X + INDENT_BELOW_RADIO, 139 ); Size = MAP_APPFONT( 50, 16 ); OutputSize = TRUE; @@ -418,6 +419,7 @@ TabPage PAGE_ADABAS }; Edit ET_HOSTNAME { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_HOSTNAME"; TabStop = TRUE ; Border = TRUE ; @@ -433,6 +435,7 @@ TabPage PAGE_ADABAS }; NumericField NF_CACHE_SIZE { + HelpID = "dbaccess:NumericField:PAGE_ADABAS:NF_CACHE_SIZE"; Pos = MAP_APPFONT ( EDIT_X , 2*UNRELATED_CONTROLS + RELATED_CONTROLS + 2*FIXEDTEXT_HEIGHT -1 ) ; Size = MAP_APPFONT ( 40 , EDIT_HEIGHT ) ; Border = TRUE ; @@ -450,6 +453,7 @@ TabPage PAGE_ADABAS }; NumericField NF_DATA_INCREMENT { + HelpID = "dbaccess:NumericField:PAGE_ADABAS:NF_DATA_INCREMENT"; Pos = MAP_APPFONT ( EDIT_X , 3*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT -1 ) ; Size = MAP_APPFONT ( 40 , EDIT_HEIGHT ) ; Border = TRUE ; @@ -472,6 +476,7 @@ TabPage PAGE_ADABAS }; Edit ET_CTRLUSERNAME { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_CTRLUSERNAME"; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X , 4*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 5*FIXEDTEXT_HEIGHT-1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT ) ; @@ -485,6 +490,7 @@ TabPage PAGE_ADABAS }; Edit ET_CTRLPASSWORD { + HelpID = "dbaccess:Edit:PAGE_ADABAS:ET_CTRLPASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X , 5*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 6*FIXEDTEXT_HEIGHT-1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT) ; @@ -494,6 +500,7 @@ TabPage PAGE_ADABAS CheckBox CB_SHUTDB { + HelpID = "dbaccess:CheckBox:PAGE_ADABAS:CB_SHUTDB"; Pos = MAP_APPFONT ( 6 , 6*UNRELATED_CONTROLS + 2*RELATED_CONTROLS + 7*FIXEDTEXT_HEIGHT ) ; Size = MAP_APPFONT ( 248 , CHECKBOX_HEIGHT ) ; Text[ en-US ] = "~Shut down service when closing %PRODUCTNAME"; @@ -501,6 +508,7 @@ TabPage PAGE_ADABAS PushButton PB_STAT { + HelpID = "dbaccess:PushButton:PAGE_ADABAS:PB_STAT"; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS, PAGE_Y - BUTTON_HEIGHT - UNRELATED_CONTROLS ) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; Text[ en-US ] = "E~xtended..."; @@ -516,6 +524,7 @@ TabPage PAGE_ADABAS TabPage PAGE_MYSQL_ODBC { + HelpID = "dbaccess:TabPage:PAGE_MYSQL_ODBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -526,6 +535,7 @@ TabPage PAGE_MYSQL_ODBC TabPage PAGE_MYSQL_JDBC { + HelpID = "dbaccess:TabPage:PAGE_MYSQL_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -544,6 +554,7 @@ TabPage PAGE_MYSQL_JDBC }; Edit ET_JDBCDRIVERCLASS { + HelpID = "dbaccess:Edit:PAGE_MYSQL_JDBC:ET_JDBCDRIVERCLASS"; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT -1 + EDIT_HEIGHT) ; Size = MAP_APPFONT ( 97 , EDIT_HEIGHT ) ; @@ -552,6 +563,7 @@ TabPage PAGE_MYSQL_JDBC }; PushButton PB_TESTDRIVERCLASS { + HelpID = "dbaccess:PushButton:PAGE_MYSQL_JDBC:PB_TESTDRIVERCLASS"; TabStop = TRUE ; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS , 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT -2 + EDIT_HEIGHT) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; @@ -563,6 +575,7 @@ TabPage PAGE_MYSQL_JDBC TabPage PAGE_MYSQL_NATIVE { + HelpID = "dbaccess:TabPage:PAGE_MYSQL_NATIVE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -584,6 +597,7 @@ TabPage PAGE_MYSQL_NATIVE }; Edit ET_USERNAME { + HelpID = "dbaccess:Edit:PAGE_MYSQL_NATIVE:ET_USERNAME"; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + 4*RELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 3*EDIT_HEIGHT - 1 ) ; Size = MAP_APPFONT ( 105 , EDIT_HEIGHT ) ; @@ -591,6 +605,7 @@ TabPage PAGE_MYSQL_NATIVE }; CheckBox CB_PASSWORD_REQUIRED { + HelpID = "dbaccess:CheckBox:PAGE_MYSQL_NATIVE:CB_PASSWORD_REQUIRED"; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + 5*RELATED_CONTROLS + 4*FIXEDTEXT_HEIGHT + 4*EDIT_HEIGHT ) ; Size = MAP_APPFONT ( 105, CHECKBOX_HEIGHT ) ; Text [ en-US ] = "Password required"; @@ -601,6 +616,7 @@ TabPage PAGE_MYSQL_NATIVE TabPage PAGE_ORACLE_JDBC { + HelpID = "dbaccess:TabPage:PAGE_ORACLE_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( PAGE_X , PAGE_Y ) ; @@ -620,6 +636,7 @@ TabPage PAGE_ORACLE_JDBC }; Edit ET_JDBCDRIVERCLASS { + HelpID = "dbaccess:Edit:PAGE_ORACLE_JDBC:ET_JDBCDRIVERCLASS"; Pos = MAP_APPFONT ( EDIT_X, 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + EDIT_HEIGHT + ( FIXEDTEXT_HEIGHT - EDIT_HEIGHT ) / 2 ) ; Size = MAP_APPFONT ( 97 , EDIT_HEIGHT ) ; @@ -628,6 +645,7 @@ TabPage PAGE_ORACLE_JDBC }; PushButton PB_TESTDRIVERCLASS { + HelpID = "dbaccess:PushButton:PAGE_ORACLE_JDBC:PB_TESTDRIVERCLASS"; TabStop = TRUE ; Pos = MAP_APPFONT ( PAGE_X - BUTTON_WIDTH - UNRELATED_CONTROLS, 4*UNRELATED_CONTROLS + RELATED_CONTROLS + 3*FIXEDTEXT_HEIGHT + EDIT_HEIGHT + ( FIXEDTEXT_HEIGHT - BUTTON_HEIGHT ) / 2 ) ; @@ -743,6 +761,7 @@ TabPage PAGE_USERDRIVER }; Edit ET_HOSTNAME { + HelpID = "dbaccess:Edit:PAGE_USERDRIVER:ET_HOSTNAME"; TabStop = TRUE ; Border = TRUE ; Pos = MAP_APPFONT ( EDIT_X , UNRELATED_CONTROLS -1 ) ; @@ -758,6 +777,7 @@ TabPage PAGE_USERDRIVER NumericField NF_PORTNUMBER { + HelpID = "dbaccess:NumericField:PAGE_USERDRIVER:NF_PORTNUMBER"; TabStop = TRUE ; Border = TRUE ; NoThousandSep = TRUE; @@ -774,6 +794,7 @@ TabPage PAGE_USERDRIVER }; Edit ET_OPTIONS { + HelpID = "dbaccess:Edit:PAGE_USERDRIVER:ET_OPTIONS"; Border = TRUE ; TabStop = TRUE ; }; diff --git a/dbaccess/source/ui/dlg/dbadmin2.src b/dbaccess/source/ui/dlg/dbadmin2.src index 0c0bd3a48504..44ef3f024e3a 100644 --- a/dbaccess/source/ui/dlg/dbadmin2.src +++ b/dbaccess/source/ui/dlg/dbadmin2.src @@ -52,11 +52,6 @@ String STR_ENTER_CONNECTION_PASSWORD Text [ en-US ] = "A password is needed to connect to the data source \"$name$\"."; }; -String STR_QUERY_DROP_ALL -{ - Text[ en-US ] = "Do you want to delete all selected items?"; -}; - String STR_ASK_FOR_DIRECTORY_CREATION { Text [ en-US ] = "The directory\n\n$path$\n\ndoes not exist. Should it be created?"; @@ -67,45 +62,10 @@ String STR_COULD_NOT_CREATE_DIRECTORY Text [ en-US ] = "The directory $name$ could not be created."; }; -String STR_ADDRESSBOOK_SYSTEM -{ - Text[ en-US ] = "Windows address book"; -}; - -String STR_ADDRESSBOOK_OUTLOOK -{ - Text[ en-US ] = "MS Outlook"; -}; - -String STR_ADDRESSBOOK_MOZILLA -{ - Text[ en-US ] = "Mozilla address book"; -}; - -String STR_ADDRESSBOOK_THUNDERBIRD -{ - Text[ en-US ] = "Thunderbird address book"; -}; -String STR_ADDRESSBOOK_EVOLUTION -{ - Text[ en-US ] = "Evolution address book"; -}; -String STR_ADDRESSBOOK_LDAP -{ - Text[ en-US ] = "LDAP address book"; -}; -String STR_HINT_READONLY_CONNECTION -{ - Text [ en-US ] = "(Connection is read-only)"; -}; -String STR_HINT_CONNECTION_NOT_CAPABLE -{ - Text [ en-US ] = "(Not supported by this connection)"; -}; #define EDIT_SIZE_X 50 #define FT_SIZE_X 90 @@ -114,6 +74,7 @@ String STR_HINT_CONNECTION_NOT_CAPABLE ModalDialog DLG_DOMAINPASSWORD { + HelpID = "dbaccess:ModalDialog:DLG_DOMAINPASSWORD"; Border = TRUE ; Moveable = TRUE ; OutputSize = TRUE ; @@ -130,6 +91,7 @@ ModalDialog DLG_DOMAINPASSWORD Edit ET_PASSWORD { + HelpID = "dbaccess:Edit:DLG_DOMAINPASSWORD:ET_PASSWORD"; Border = TRUE ; Pos = MAP_APPFONT ( 12 + FT_SIZE_X , 16 ) ; Size = MAP_APPFONT ( EDIT_SIZE_X , 12 ) ; diff --git a/dbaccess/source/ui/dlg/dbadminsetup.src b/dbaccess/source/ui/dlg/dbadminsetup.src index 8e0cd31b521e..ea4341914e82 100644 --- a/dbaccess/source/ui/dlg/dbadminsetup.src +++ b/dbaccess/source/ui/dlg/dbadminsetup.src @@ -56,7 +56,6 @@ ModalDialog DLG_DATABASE_WIZARD { OutputSize = TRUE ; HelpId = HID_DSADMIN_TABCONTROL; - SingleLine=TRUE; }; String STR_DBWIZARDTITLE @@ -150,6 +149,7 @@ String STR_DATABASEDEFAULTNAME TabPage PAGE_DBWIZARD_MYSQL_INTRO { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_INTRO"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -195,6 +195,7 @@ TabPage PAGE_DBWIZARD_MYSQL_INTRO }; RadioButton RB_CONNECTVIANATIVE { + HelpID = "dbaccess:RadioButton:PAGE_DBWIZARD_MYSQL_INTRO:RB_CONNECTVIANATIVE"; Pos = MAP_APPFONT (START_X + 6 , 115 ) ; Size = MAP_APPFONT ( 205 , 9 ) ; Text[ en-US ] = "Connect directly" ; @@ -206,6 +207,7 @@ TabPage PAGE_DBWIZARD_MYSQL_INTRO TabPage PAGE_DBWIZARD_AUTHENTIFICATION { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_AUTHENTIFICATION"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -262,6 +264,7 @@ TabPage PAGE_DBWIZARD_AUTHENTIFICATION TabPage PAGE_DBWIZARD_FINAL { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_FINAL"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -335,6 +338,7 @@ TabPage PAGE_DBWIZARD_FINAL TabPage PAGE_DBWIZARD_MYSQL_JDBC { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -361,11 +365,12 @@ TabPage PAGE_DBWIZARD_MYSQL_JDBC Text[ en-US ] = "Default: 3306"; }; - AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME) + AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_JDBC_ET_MYSQLDBNAME,HID_PAGE_DBWIZARD_JDBC_ET_MYSQLHOSTSERVER,HID_PAGE_DBWIZARD_JDBC_ET_MYSQLPORT,HID_PAGE_DBWIZARD_JDBC_ET_MYSQLCLASS,HID_PAGE_DBWIZARD_JDBC_PB_TESTMYSQLCLASS) }; TabPage PAGE_DBWIZARD_MYSQL_NATIVE { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MYSQL_NATIVE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0, 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -391,6 +396,7 @@ TabPage PAGE_DBWIZARD_MYSQL_NATIVE TabPage PAGE_DBWIZARD_DBASE { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_DBASE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -406,11 +412,12 @@ TabPage PAGE_DBWIZARD_DBASE Text[ en-US ] = "Select the folder where the dBASE files are stored." ; }; - AUTO_HELP_BROWSECONTROLGROUP( 3, HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION) + AUTO_HELP_BROWSECONTROLGROUP( 3, HID_PAGE_DBWIZARD_DBASE_ET_DBASELOCATION,HID_PAGE_DBWIZARD_DBASE_PB_DBASELOCATION) }; TabPage PAGE_DBWIZARD_TEXT { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_TEXT"; String STR_TEXT_HEADERTEXT { Text[ en-US ] = "Set up a connection to text files" ; @@ -425,12 +432,13 @@ TabPage PAGE_DBWIZARD_TEXT Text[ en-US ] = "Path to text files"; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE) + AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_TEXT_ET_LOCATIONTEXTFILE,HID_PAGE_DBWIZARD_TEXT_PB_LOCATIONTEXTFILE) AUTO_SEPARATORCONTROLGROUP(82, WIZARD_PAGE_X) }; TabPage PAGE_DBWIZARD_MSACCESS { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_MSACCESS"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -446,11 +454,12 @@ TabPage PAGE_DBWIZARD_MSACCESS Text[ en-US ] = "Please select the Microsoft Access file you want to access."; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION) + AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_MSACCESS_ET_MSACCESSLOCATION, HID_PAGE_DBWIZARD_MSACCESS_PB_MSACCESSLOCATION) }; TabPage PAGE_DBWIZARD_LDAP { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_LDAP"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -490,6 +499,7 @@ TabPage PAGE_DBWIZARD_LDAP TabPage PAGE_DBWIZARD_ADABAS { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ADABAS"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -504,11 +514,12 @@ TabPage PAGE_DBWIZARD_ADABAS Text[ en-US ] = "Enter the name of the Adabas D database you want to connect to.\nClick 'Browse...' to select an Adabas D database that is already registered in %PRODUCTNAME." ; }; - AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME) + AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_ADABAS_ET_ADABASNAME, HID_PAGE_DBWIZARD_ADABAS_PB_ADABASNAME) }; TabPage PAGE_DBWIZARD_ADO { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ADO"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -523,12 +534,13 @@ TabPage PAGE_DBWIZARD_ADO Text[ en-US ] = "Please enter the URL of the ADO data source you want to connect to.\nClick 'Browse' to configure provider-specific settings.\nPlease contact your system administrator if you are unsure about the following settings." ; }; - AUTO_HELP_BROWSECONTROLGROUP(5, HID_PAGE_DBWIZARD_ADO_ET_ADOURL) + AUTO_HELP_BROWSECONTROLGROUP(5, HID_PAGE_DBWIZARD_ADO_ET_ADOURL, HID_PAGE_DBWIZARD_ADO_PB_ADOURL) }; TabPage PAGE_DBWIZARD_ODBC { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ODBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -543,21 +555,23 @@ TabPage PAGE_DBWIZARD_ODBC Text[ en-US ] = "Enter the name of the ODBC database you want to connect to.\nClick 'Browse...' to select an ODBC database that is already registered in %PRODUCTNAME.\nPlease contact your system administrator if you are unsure about the following settings." ; }; - AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE) + AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_ODBC_ET_NAMEOFODBCDATASOURCE, HID_PAGE_DBWIZARD_ODBC_PB_NAMEOFODBCDATASOURCE) }; TabPage PAGE_DBWIZARD_USERDEFINED { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_USERDEFINED"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; Hide = TRUE ; - AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE) + AUTO_HELP_BROWSECONTROLGROUP(6, HID_PAGE_DBWIZARD_USERDEFINED_ET_BROWSE, HID_PAGE_DBWIZARD_USERDEFINED_BROWSE) }; TabPage PAGE_DBWIZARD_JDBC { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_JDBC"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -572,14 +586,15 @@ TabPage PAGE_DBWIZARD_JDBC Text[ en-US ] = "Please enter the required information to connect to a JDBC database.\nPlease contact your system administrator if you are unsure about the following settings." ; }; - AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL) - AUTO_JDBCDRIVERCLASSGROUP(119, HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS) + AUTO_HELP_BROWSECONTROLGROUP(4, HID_PAGE_DBWIZARD_JDBC_ET_JDBCURL, HID_PAGE_DBWIZARD_JDBC_PB_JDBCURL) + AUTO_JDBCDRIVERCLASSGROUP(119, HID_PAGE_DBWIZARD_JDBC_ET_JDBCCLASS, HID_PAGE_DBWIZARD_JDBC_PB_TESTJDBCCLASS) }; TabPage PAGE_DBWIZARD_ORACLE { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_ORACLE"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -603,12 +618,13 @@ TabPage PAGE_DBWIZARD_ORACLE Text[ en-US ] = "Please enter the required information to connect to an Oracle database.Note that a JDBC Driver Class must be installed on your system and registered with %PRODUCTNAME.\nPlease contact your system administrator if you are unsure about the following settings." ; }; - AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME) + AUTOHELP_JDBCCONTROLGROUP(HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEDBNAME,HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEHOSTSERVER,HID_PAGE_DBWIZARD_ORACLE_ET_ORACLEPORT,HID_PAGE_DBWIZARD_ORACLE_ET_ORACLECLASS,HID_PAGE_DBWIZARD_ORACLE_PB_TESTORACLECLASS) }; TabPage PAGE_DBWIZARD_SPREADSHEET { + HelpID = "dbaccess:TabPage:PAGE_DBWIZARD_SPREADSHEET"; SVLook = TRUE ; Pos = MAP_APPFONT ( 0 , 0 ) ; Size = MAP_APPFONT ( WIZARD_PAGE_X , WIZARD_PAGE_Y ) ; @@ -623,7 +639,7 @@ TabPage PAGE_DBWIZARD_SPREADSHEET Text[ en-US ] = "Click 'Browse...' to select a %PRODUCTNAME spreadsheet or Microsoft Excel workbook.\n%PRODUCTNAME will open this file in read-only mode." ; }; - AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH ) + AUTO_HELP_BROWSECONTROLGROUP(3, HID_PAGE_DBWIZARD_SPREADSHEET_ET_SPREADSHEETPATH,HID_PAGE_DBWIZARD_SPREADSHEET_PB_SPREADSHEETPATH ) String STR_SPREADSHEETPATH{ Text[ en-US ] = "~Location and file name" ; diff --git a/dbaccess/source/ui/dlg/dbfindex.hxx b/dbaccess/source/ui/dlg/dbfindex.hxx index 59b1f0f66f1e..c10b2362027b 100644 --- a/dbaccess/source/ui/dlg/dbfindex.hxx +++ b/dbaccess/source/ui/dlg/dbfindex.hxx @@ -126,7 +126,7 @@ protected: String m_aDSN; TableInfoList m_aTableInfoList; TableIndexList m_aFreeIndexList; - BOOL m_bCaseSensitiv; + sal_Bool m_bCaseSensitiv; void Init(); void SetCtrls(); diff --git a/dbaccess/source/ui/dlg/dbfindex.src b/dbaccess/source/ui/dlg/dbfindex.src index 8c253554ffde..ca8b6e4a3622 100644 --- a/dbaccess/source/ui/dlg/dbfindex.src +++ b/dbaccess/source/ui/dlg/dbfindex.src @@ -37,6 +37,7 @@ ModalDialog DLG_DBASE_INDEXES { + HelpID = "dbaccess:ModalDialog:DLG_DBASE_INDEXES"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( WIN_X , WIN_Y ) ; @@ -69,6 +70,7 @@ ModalDialog DLG_DBASE_INDEXES }; ComboBox CB_TABLES { + HelpID = "dbaccess:ComboBox:DLG_DBASE_INDEXES:CB_TABLES"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 62 , 5 ) ; @@ -90,6 +92,7 @@ ModalDialog DLG_DBASE_INDEXES }; ListBox LB_TABLEINDEXES { + HelpID = "dbaccess:ListBox:DLG_DBASE_INDEXES:LB_TABLEINDEXES"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 12 , 44 ) ; @@ -104,6 +107,7 @@ ModalDialog DLG_DBASE_INDEXES }; ListBox LB_FREEINDEXES { + HelpID = "dbaccess:ListBox:DLG_DBASE_INDEXES:LB_FREEINDEXES"; Border = TRUE ; SVLook = TRUE ; Pos = MAP_APPFONT ( 120 , 44 ) ; @@ -112,6 +116,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_ADD { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_ADD"; Pos = MAP_APPFONT ( 94 , 60 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -131,6 +136,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_ADDALL { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_ADDALL"; Pos = MAP_APPFONT ( 94 , 77 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -150,6 +156,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_REMOVE { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_REMOVE"; Pos = MAP_APPFONT ( 94 , 98 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -169,6 +176,7 @@ ModalDialog DLG_DBASE_INDEXES }; ImageButton IB_REMOVEALL { + HelpID = "dbaccess:ImageButton:DLG_DBASE_INDEXES:IB_REMOVEALL"; Pos = MAP_APPFONT ( 94, 114 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 4a35b421af0d..f23f340b5e78 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -258,7 +258,7 @@ void ODbTypeWizDialog::clearPassword() // ----------------------------------------------------------------------------- TabPage* ODbTypeWizDialog::createPage(WizardState _nState) { - USHORT nStringId = STR_PAGETITLE_ADVANCED; + sal_uInt16 nStringId = STR_PAGETITLE_ADVANCED; TabPage* pPage = NULL; switch(_nState) { diff --git a/dbaccess/source/ui/dlg/detailpages.cxx b/dbaccess/source/ui/dlg/detailpages.cxx index fb3a27decc66..c02f603c99eb 100644 --- a/dbaccess/source/ui/dlg/detailpages.cxx +++ b/dbaccess/source/ui/dlg/detailpages.cxx @@ -76,7 +76,7 @@ namespace dbaui //======================================================================== DBG_NAME(OCommonBehaviourTabPage) //------------------------------------------------------------------------ - OCommonBehaviourTabPage::OCommonBehaviourTabPage(Window* pParent, USHORT nResId, const SfxItemSet& _rCoreAttrs, + OCommonBehaviourTabPage::OCommonBehaviourTabPage(Window* pParent, sal_uInt16 nResId, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags,bool _bFreeResource) :OGenericAdministrationPage(pParent, ModuleRes(nResId), _rCoreAttrs) @@ -500,7 +500,7 @@ namespace dbaui //======================================================================== //= OMySQLJDBCDetailsPage //======================================================================== - OGeneralSpecialJDBCDetailsPage::OGeneralSpecialJDBCDetailsPage( Window* pParent,USHORT _nResId, const SfxItemSet& _rCoreAttrs ,USHORT _nPortId) + OGeneralSpecialJDBCDetailsPage::OGeneralSpecialJDBCDetailsPage( Window* pParent,sal_uInt16 _nResId, const SfxItemSet& _rCoreAttrs ,sal_uInt16 _nPortId) :OCommonBehaviourTabPage(pParent, _nResId, _rCoreAttrs, CBTP_USE_CHARSET ,false) ,m_aFL_1 (this, ModuleRes( FL_SEPARATOR1) ) ,m_aFTHostname (this, ModuleRes(FT_HOSTNAME)) @@ -531,9 +531,9 @@ namespace dbaui else { m_bUseClass = false; - m_aFTDriverClass.Show(FALSE); - m_aEDDriverClass.Show(FALSE); - m_aTestJavaDriver.Show(FALSE); + m_aFTDriverClass.Show(sal_False); + m_aEDDriverClass.Show(sal_False); + m_aTestJavaDriver.Show(sal_False); } m_aFTSocket.Show(PAGE_MYSQL_JDBC == _nResId && !m_bUseClass); @@ -648,7 +648,7 @@ namespace dbaui { } - USHORT nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; + sal_uInt16 nMessage = bSuccess ? STR_JDBCDRIVER_SUCCESS : STR_JDBCDRIVER_NO_SUCCESS; OSQLMessageBox aMsg( this, String( ModuleRes( nMessage ) ), String() ); aMsg.Execute(); return 0L; @@ -900,7 +900,7 @@ namespace dbaui IMPL_LINK( OAdabasDetailsPage, AttributesChangedHdl, void *, EMPTYARG ) { m_CB_SHUTDB.Enable(m_ET_CTRLUSERNAME.GetText().Len() && m_ET_CTRLPASSWORD.GetText().Len()); - bAttrsChanged = TRUE; + bAttrsChanged = sal_True; callModifiedHdl(); return 0; } diff --git a/dbaccess/source/ui/dlg/detailpages.hxx b/dbaccess/source/ui/dlg/detailpages.hxx index 2d304430e865..6d48d2fd2711 100644 --- a/dbaccess/source/ui/dlg/detailpages.hxx +++ b/dbaccess/source/ui/dlg/detailpages.hxx @@ -81,9 +81,9 @@ namespace dbaui sal_uInt32 m_nControlFlags; public: - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); - OCommonBehaviourTabPage(Window* pParent, USHORT nResId, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags,bool _bFreeResource = true); + OCommonBehaviourTabPage(Window* pParent, sal_uInt16 nResId, const SfxItemSet& _rCoreAttrs, sal_uInt32 nControlFlags,bool _bFreeResource = true); protected: // nControlFlags ist eine Kombination der CBTP_xxx-Konstanten @@ -105,7 +105,7 @@ namespace dbaui class ODbaseDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); ODbaseDetailsPage(Window* pParent, const SfxItemSet& _rCoreAttrs); private: @@ -148,7 +148,7 @@ namespace dbaui class OOdbcDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OOdbcDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -167,7 +167,7 @@ namespace dbaui class OUserDriverDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OUserDriverDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -198,15 +198,15 @@ namespace dbaui { public: OGeneralSpecialJDBCDetailsPage( Window* pParent - , USHORT _nResId + , sal_uInt16 _nResId , const SfxItemSet& _rCoreAttrs - , USHORT _nPortId + , sal_uInt16 _nPortId ); protected: - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -227,7 +227,7 @@ namespace dbaui PushButton m_aTestJavaDriver; String m_sDefaultJdbcDriverName; - USHORT m_nPortId; + sal_uInt16 m_nPortId; bool m_bUseClass; }; @@ -250,7 +250,7 @@ namespace dbaui CheckBox m_aPasswordRequired; protected: - virtual BOOL FillItemSet( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet( SfxItemSet& _rCoreAttrs ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); virtual void fillControls(::std::vector< ISaveValueWrapper* >& _rControlList); virtual void fillWindows(::std::vector< ISaveValueWrapper* >& _rControlList); @@ -262,7 +262,7 @@ namespace dbaui class OAdabasDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet (SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet (SfxItemSet& _rCoreAttrs); OAdabasDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -289,7 +289,7 @@ namespace dbaui CheckBox m_CB_SHUTDB; PushButton m_PB_STAT; String m_sUser; - BOOL bAttrsChanged; + sal_Bool bAttrsChanged; DECL_LINK( AttributesChangedHdl, void * ); DECL_LINK( UserSettingsHdl, void * ); @@ -303,7 +303,7 @@ namespace dbaui class OLDAPDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OLDAPDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); protected: @@ -343,7 +343,7 @@ namespace dbaui class OTextDetailsPage : public OCommonBehaviourTabPage { public: - virtual BOOL FillItemSet ( SfxItemSet& _rCoreAttrs ); + virtual sal_Bool FillItemSet ( SfxItemSet& _rCoreAttrs ); OTextDetailsPage( Window* pParent, const SfxItemSet& _rCoreAttrs ); OTextConnectionHelper* m_pTextConnectionHelper; diff --git a/dbaccess/source/ui/dlg/directsql.cxx b/dbaccess/source/ui/dlg/directsql.cxx index d964da262c30..99692ffc2961 100644 --- a/dbaccess/source/ui/dlg/directsql.cxx +++ b/dbaccess/source/ui/dlg/directsql.cxx @@ -171,7 +171,7 @@ DBG_NAME(DirectSQLDialog) { m_aStatementHistory.pop_front(); m_aNormalizedHistory.pop_front(); - m_pSQLHistory->RemoveEntry((USHORT)0); + m_pSQLHistory->RemoveEntry((sal_uInt16)0); } } @@ -299,7 +299,7 @@ DBG_NAME(DirectSQLDialog) if (_bUpdateListBox) { // selecte the normalized statement in the list box - m_pSQLHistory->SelectEntryPos((USHORT)_nHistoryPos); + m_pSQLHistory->SelectEntryPos((sal_uInt16)_nHistoryPos); OSL_ENSURE(m_pSQLHistory->GetSelectEntry() == m_aNormalizedHistory[_nHistoryPos], "DirectSQLDialog::switchToHistory: inconsistent listbox entries!"); } diff --git a/dbaccess/source/ui/dlg/directsql.src b/dbaccess/source/ui/dlg/directsql.src index 74d9b3b69775..5428535c365a 100644 --- a/dbaccess/source/ui/dlg/directsql.src +++ b/dbaccess/source/ui/dlg/directsql.src @@ -40,6 +40,7 @@ ModalDialog DLG_DIRECTSQL { + HelpID = "dbaccess:ModalDialog:DLG_DIRECTSQL"; OutputSize = TRUE ; Moveable = TRUE ; Closeable = TRUE ; @@ -60,6 +61,7 @@ ModalDialog DLG_DIRECTSQL }; MultiLineEdit ME_SQL { + HelpID = "dbaccess:MultiLineEdit:DLG_DIRECTSQL:ME_SQL"; Pos = MAP_APPFONT( 7, 26 ); Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 80 ); SVLook = TRUE; @@ -69,6 +71,7 @@ ModalDialog DLG_DIRECTSQL }; PushButton PB_EXECUTE { + HelpID = "dbaccess:PushButton:DLG_DIRECTSQL:PB_EXECUTE"; Pos = MAP_APPFONT( WINDOW_SIZE_X - BUTTON_SIZE_X - 7, 109 ); Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); Text [ en-US ] = "Execute"; @@ -82,6 +85,7 @@ ModalDialog DLG_DIRECTSQL }; ListBox LB_HISTORY { + HelpID = "dbaccess:ListBox:DLG_DIRECTSQL:LB_HISTORY"; Pos = MAP_APPFONT( 7, 121 + BUTTON_SIZE_Y + 3 ); Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 14 ); SvLook = TRUE; @@ -96,6 +100,7 @@ ModalDialog DLG_DIRECTSQL }; MultiLineEdit ME_STATUS { + HelpID = "dbaccess:MultiLineEdit:DLG_DIRECTSQL:ME_STATUS"; Pos = MAP_APPFONT( 7, 153 + BUTTON_SIZE_Y ); Size = MAP_APPFONT( WINDOW_SIZE_X - 14, 41 ); Border = TRUE; @@ -114,6 +119,7 @@ ModalDialog DLG_DIRECTSQL }; PushButton PB_CLOSE { + HelpID = "dbaccess:PushButton:DLG_DIRECTSQL:PB_CLOSE"; Pos = MAP_APPFONT( WINDOW_SIZE_X - 7 - BUTTON_SIZE_X, 207 + BUTTON_SIZE_Y ); Size = MAP_APPFONT( BUTTON_SIZE_X, BUTTON_SIZE_Y ); Text [ en-US ] = "Close"; diff --git a/dbaccess/source/ui/dlg/dlgattr.cxx b/dbaccess/source/ui/dlg/dlgattr.cxx index 4294d5e5b96e..e77c20704d26 100644 --- a/dbaccess/source/ui/dlg/dlgattr.cxx +++ b/dbaccess/source/ui/dlg/dlgattr.cxx @@ -51,7 +51,7 @@ using namespace dbaui; DBG_NAME(SbaSbAttrDlg) //================================================================== -SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, USHORT nFlags, BOOL bRow) +SbaSbAttrDlg::SbaSbAttrDlg(Window* pParent, const SfxItemSet* pCellAttrs, SvNumberFormatter* pFormatter, sal_uInt16 nFlags, sal_Bool bRow) : SfxTabDialog(pParent, ModuleRes( DLG_ATTR ), pCellAttrs ) ,aTitle(ModuleRes(ST_ROW)) { @@ -88,7 +88,7 @@ void SbaSbAttrDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ) { case RID_SVXPAGE_NUMBERFORMAT: { - aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const USHORT)SID_ATTR_NUMBERFORMAT_INFO)); + aSet.Put (SvxNumberInfoItem( pNumberInfoItem->GetNumberFormatter(), (const sal_uInt16)SID_ATTR_NUMBERFORMAT_INFO)); rTabPage.PageCreated(aSet); } break; diff --git a/dbaccess/source/ui/dlg/dlgsave.cxx b/dbaccess/source/ui/dlg/dlgsave.cxx index aa99429ed1f4..7d5738d1e7ff 100644 --- a/dbaccess/source/ui/dlg/dlgsave.cxx +++ b/dbaccess/source/ui/dlg/dlgsave.cxx @@ -185,7 +185,7 @@ namespace _rList.InsertEntry( sValue ); } - USHORT nPos = _rList.GetEntryPos( String( _rCurrent ) ); + sal_uInt16 nPos = _rList.GetEntryPos( String( _rCurrent ) ); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) _rList.SelectEntryPos( nPos ); else @@ -269,7 +269,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, sTable, ::dbtools::eInDataManipulation); - USHORT nPos = m_pImpl->m_aCatalog.GetEntryPos(String(sCatalog)); + sal_uInt16 nPos = m_pImpl->m_aCatalog.GetEntryPos(String(sCatalog)); if ( nPos != COMBOBOX_ENTRY_NOTFOUND ) m_pImpl->m_aCatalog.SelectEntryPos(nPos); @@ -289,7 +289,7 @@ OSaveAsDlg::OSaveAsDlg( Window * pParent, m_pImpl->m_aPB_CANCEL.SetPosPixel(Point(m_pImpl->m_aPB_CANCEL.GetPosPixel().X(),aPos.Y())); m_pImpl->m_aPB_HELP.SetPosPixel(Point(m_pImpl->m_aPB_HELP.GetPosPixel().X(),aPos.Y())); - USHORT nLength = m_pImpl->m_xMetaData.is() ? static_cast<USHORT>(m_pImpl->m_xMetaData->getMaxTableNameLength()) : 0; + sal_uInt16 nLength = m_pImpl->m_xMetaData.is() ? static_cast<sal_uInt16>(m_pImpl->m_xMetaData->getMaxTableNameLength()) : 0; nLength = nLength ? nLength : EDIT_NOLIMIT; m_pImpl->m_aTitle.SetMaxTextLen(nLength); diff --git a/dbaccess/source/ui/dlg/dlgsave.src b/dbaccess/source/ui/dlg/dlgsave.src index 5ebc5374155c..bc94b77eee37 100644 --- a/dbaccess/source/ui/dlg/dlgsave.src +++ b/dbaccess/source/ui/dlg/dlgsave.src @@ -61,6 +61,7 @@ ModalDialog DLG_SAVE_AS }; ComboBox ET_CATALOG { + HelpID = "dbaccess:ComboBox:DLG_SAVE_AS:ET_CATALOG"; Border = TRUE ; Pos = MAP_APPFONT ( 77 , 25 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; @@ -77,6 +78,7 @@ ModalDialog DLG_SAVE_AS }; ComboBox ET_SCHEMA { + HelpID = "dbaccess:ComboBox:DLG_SAVE_AS:ET_SCHEMA"; Border = TRUE ; Pos = MAP_APPFONT ( 77 , 42 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; @@ -92,6 +94,7 @@ ModalDialog DLG_SAVE_AS }; Edit ET_TITLE { + HelpID = "dbaccess:Edit:DLG_SAVE_AS:ET_TITLE"; Border = TRUE ; Pos = MAP_APPFONT ( 77 , 59 ) ; Size = MAP_APPFONT ( 89 , 12 ) ; diff --git a/dbaccess/source/ui/dlg/dlgsize.src b/dbaccess/source/ui/dlg/dlgsize.src index 875ee79b99f5..556c53974c9a 100644 --- a/dbaccess/source/ui/dlg/dlgsize.src +++ b/dbaccess/source/ui/dlg/dlgsize.src @@ -24,11 +24,6 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ - //--------------------------------------------------------------------------- - // - // (c) Copyright 1996 - 2000 by Star Division GmbH, Hamburg, Germany - // - //--------------------------------------------------------------------------- #ifndef DBAUI_DLGSIZE_HRC #include "dlgsize.hrc" @@ -56,6 +51,7 @@ ModalDialog DLG_ROWHEIGHT }; MetricField MF_VALUE { + HelpID = "dbaccess:MetricField:DLG_ROWHEIGHT:MF_VALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 36 , 6 ) ; Size = MAP_APPFONT ( 63 , 12 ) ; @@ -69,6 +65,7 @@ ModalDialog DLG_ROWHEIGHT }; CheckBox CB_STANDARD { + HelpID = "dbaccess:CheckBox:DLG_ROWHEIGHT:CB_STANDARD"; Pos = MAP_APPFONT ( 36 , 25 ) ; Size = MAP_APPFONT ( 62 , 12 ) ; TabStop = TRUE ; @@ -111,6 +108,7 @@ ModalDialog DLG_COLWIDTH }; MetricField MF_VALUE { + HelpID = "dbaccess:MetricField:DLG_COLWIDTH:MF_VALUE"; Border = TRUE ; Pos = MAP_APPFONT ( 36 , 6 ) ; Size = MAP_APPFONT ( 63 , 12 ) ; @@ -124,6 +122,7 @@ ModalDialog DLG_COLWIDTH }; CheckBox CB_STANDARD { + HelpID = "dbaccess:CheckBox:DLG_COLWIDTH:CB_STANDARD"; Pos = MAP_APPFONT ( 36 , 25 ) ; Size = MAP_APPFONT ( 62 , 12 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/dsselect.cxx b/dbaccess/source/ui/dlg/dsselect.cxx index 0f787bcc996d..e6bbb8494e16 100644 --- a/dbaccess/source/ui/dlg/dsselect.cxx +++ b/dbaccess/source/ui/dlg/dsselect.cxx @@ -182,7 +182,7 @@ IMPL_LINK( ODatasourceSelectDialog, CreateDBClickHdl, PushButton*, /*pButton*/ ) if ( xPropInfo->hasPropertyByName(PROPERTY_PASSWORD) ) { m_pOutputSet->Put(SfxStringItem(DSID_PASSWORD, ::comphelper::getString(xProp->getPropertyValue(PROPERTY_PASSWORD)))); - m_pOutputSet->Put(SfxBoolItem(DSID_PASSWORDREQUIRED, TRUE)); + m_pOutputSet->Put(SfxBoolItem(DSID_PASSWORDREQUIRED, sal_True)); } if ( xPropInfo->hasPropertyByName(PROPERTY_CACHESIZE) ) m_pOutputSet->Put(SfxInt32Item(DSID_CONN_CACHESIZE, ::comphelper::getINT32(xProp->getPropertyValue(PROPERTY_CACHESIZE)))); @@ -197,11 +197,11 @@ IMPL_LINK( ODatasourceSelectDialog, CreateDBClickHdl, PushButton*, /*pButton*/ ) } // ----------------------------------------------------------------------- -BOOL ODatasourceSelectDialog::Close() +sal_Bool ODatasourceSelectDialog::Close() { #ifdef HAVE_ODBC_ADMINISTRATION if ( m_pODBCManagement.get() && m_pODBCManagement->isRunning() ) - return FALSE; + return sal_False; #endif return ModalDialog::Close(); diff --git a/dbaccess/source/ui/dlg/dsselect.hxx b/dbaccess/source/ui/dlg/dsselect.hxx index 555464635b84..34050aff9cb9 100644 --- a/dbaccess/source/ui/dlg/dsselect.hxx +++ b/dbaccess/source/ui/dlg/dsselect.hxx @@ -76,7 +76,7 @@ public: inline String GetSelected() const { return m_aDatasource.GetSelectEntry();} void Select( const String& _rEntry ) { m_aDatasource.SelectEntry(_rEntry); } - virtual BOOL Close(); + virtual sal_Bool Close(); protected: DECL_LINK( ListDblClickHdl, ListBox * ); diff --git a/dbaccess/source/ui/dlg/dsselect.src b/dbaccess/source/ui/dlg/dsselect.src index 8c59a26d1a16..d6a8855559a2 100644 --- a/dbaccess/source/ui/dlg/dsselect.src +++ b/dbaccess/source/ui/dlg/dsselect.src @@ -35,6 +35,7 @@ ModalDialog DLG_DATASOURCE_SELECTION { + HelpID = "dbaccess:ModalDialog:DLG_DATASOURCE_SELECTION"; OutputSize = TRUE ; Moveable = TRUE ; Closeable = TRUE ; @@ -50,6 +51,7 @@ ModalDialog DLG_DATASOURCE_SELECTION }; ListBox LB_DATASOURCE { + HelpID = "dbaccess:ListBox:DLG_DATASOURCE_SELECTION:LB_DATASOURCE"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 19 ) ; Size = MAP_APPFONT ( 154 , 94 ) ; @@ -79,6 +81,7 @@ ModalDialog DLG_DATASOURCE_SELECTION }; PushButton PB_MANAGE { + HelpID = "dbaccess:PushButton:DLG_DATASOURCE_SELECTION:PB_MANAGE"; Pos = MAP_APPFONT ( 166 , 99 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; @@ -88,6 +91,7 @@ ModalDialog DLG_DATASOURCE_SELECTION }; PushButton PB_CREATE { + HelpID = "dbaccess:PushButton:DLG_DATASOURCE_SELECTION:PB_CREATE"; Pos = MAP_APPFONT ( 166 , 99 ) ; Size = MAP_APPFONT ( 50 , 14 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/generalpage.cxx b/dbaccess/source/ui/dlg/generalpage.cxx index 311bea0cc1ad..060f83d43853 100644 --- a/dbaccess/source/ui/dlg/generalpage.cxx +++ b/dbaccess/source/ui/dlg/generalpage.cxx @@ -505,7 +505,7 @@ namespace dbaui } //------------------------------------------------------------------------- - BOOL OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) + sal_Bool OGeneralPage::FillItemSet(SfxItemSet& _rCoreAttrs) { sal_Bool bChangedSomething = sal_False; @@ -530,7 +530,7 @@ namespace dbaui if ( bCommitTypeSelection ) { - USHORT nEntry = m_pDatasourceType->GetSelectEntryPos(); + sal_uInt16 nEntry = m_pDatasourceType->GetSelectEntryPos(); ::rtl::OUString sURLPrefix = m_aURLPrefixes[nEntry]; if (m_DBWizardMode) { diff --git a/dbaccess/source/ui/dlg/generalpage.hxx b/dbaccess/source/ui/dlg/generalpage.hxx index ad28e2dc0692..5bd2dbe189fa 100644 --- a/dbaccess/source/ui/dlg/generalpage.hxx +++ b/dbaccess/source/ui/dlg/generalpage.hxx @@ -132,7 +132,7 @@ namespace dbaui protected: // SfxTabPage overridables - virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet(SfxItemSet& _rCoreAttrs); virtual void Reset(const SfxItemSet& _rCoreAttrs); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/indexdialog.src b/dbaccess/source/ui/dlg/indexdialog.src index 05b294d3aa07..2071684c37b6 100644 --- a/dbaccess/source/ui/dlg/indexdialog.src +++ b/dbaccess/source/ui/dlg/indexdialog.src @@ -47,6 +47,7 @@ ModalDialog DLG_INDEXDESIGN { + HelpID = "dbaccess:ModalDialog:DLG_INDEXDESIGN"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( DIALOG_SIZE_X , DIALOG_SIZE_Y ) ; @@ -131,6 +132,7 @@ ModalDialog DLG_INDEXDESIGN }; CheckBox CB_UNIQUE { + HelpID = "dbaccess:CheckBox:DLG_INDEXDESIGN:CB_UNIQUE"; Pos = MAP_APPFONT ( LIST_WIDTH + 16, 34 ) ; Size = MAP_APPFONT ( DIALOG_SIZE_X - LIST_WIDTH - 22, 8 ) ; SVLook = TRUE; @@ -153,6 +155,7 @@ ModalDialog DLG_INDEXDESIGN }; PushButton PB_CLOSE { + HelpID = "dbaccess:PushButton:DLG_INDEXDESIGN:PB_CLOSE"; Pos = MAP_APPFONT ( DIALOG_SIZE_X - BUTTON_SIZE_X - 6 - BUTTON_SIZE_X - 6, DIALOG_SIZE_Y - BUTTON_SIZE_Y - 6 ) ; Size = MAP_APPFONT ( BUTTON_SIZE_X, BUTTON_SIZE_Y ); SVLook = TRUE; diff --git a/dbaccess/source/ui/dlg/makefile.mk b/dbaccess/source/ui/dlg/makefile.mk index 0a7ddefb13f9..8fa615d28a52 100644 --- a/dbaccess/source/ui/dlg/makefile.mk +++ b/dbaccess/source/ui/dlg/makefile.mk @@ -137,7 +137,6 @@ SLOFILES+= $(SLO)$/adodatalinks.obj .ENDIF # --- Targets ---------------------------------- - .INCLUDE : target.mk $(SLO)$/ConnectionHelper.obj : $(LOCALIZE_ME_DEST) diff --git a/dbaccess/source/ui/dlg/odbcconfig.cxx b/dbaccess/source/ui/dlg/odbcconfig.cxx index 8c340af17611..baf20415e4d6 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.cxx +++ b/dbaccess/source/ui/dlg/odbcconfig.cxx @@ -55,7 +55,7 @@ #ifdef HAVE_ODBC_SUPPORT -#if defined(WIN) || defined(OS2) +#if defined(OS2) #define ODBC_LIBRARY "ODBC.DLL" #define ODBC_UI_LIBRARY "ODBCINST.DLL" #endif @@ -77,7 +77,7 @@ // just to go with calling convention of windows // so don't touch this -#if defined(WIN) || defined(WNT) +#if defined(WNT) #define SQL_API __stdcall // At least under some circumstances, the below #include <odbc/sqlext.h> re- // defines SQL_API to an empty string, leading to a compiler warning on MSC; to @@ -87,7 +87,7 @@ #pragma warning(push) #pragma warning(disable: 4005) #endif -#endif // defined(WIN) || defined(WNT) +#endif // defined(WNT) #if defined(OS2) #define ALLREADY_HAVE_OS2_TYPES @@ -100,13 +100,13 @@ #include <odbc/sqlext.h> #endif -#if defined(WIN) || defined(WNT) +#if defined(WNT) #if defined _MSC_VER #pragma warning(pop) #endif #undef SQL_API #define SQL_API __stdcall -#endif // defined(WIN) || defined(WNT) +#endif // defined(WNT) // from here on you can do what you want to #if defined(OS2) diff --git a/dbaccess/source/ui/dlg/odbcconfig.hxx b/dbaccess/source/ui/dlg/odbcconfig.hxx index 479c0743953b..20b0adb0cb44 100644 --- a/dbaccess/source/ui/dlg/odbcconfig.hxx +++ b/dbaccess/source/ui/dlg/odbcconfig.hxx @@ -31,11 +31,11 @@ #include "commontypes.hxx" -#if defined(WIN) || defined(WNT) || defined (UNX) || defined (OS2) +#if defined(WNT) || defined (UNX) || defined (OS2) #define HAVE_ODBC_SUPPORT #endif -#if ( defined(WIN) || defined(WNT) || defined (OS2) ) && defined(HAVE_ODBC_SUPPORT) +#if ( defined(WNT) || defined (OS2) ) && defined(HAVE_ODBC_SUPPORT) #define HAVE_ODBC_ADMINISTRATION #endif diff --git a/dbaccess/source/ui/dlg/paramdialog.src b/dbaccess/source/ui/dlg/paramdialog.src index 6e8b61debff5..1f78123c6096 100644 --- a/dbaccess/source/ui/dlg/paramdialog.src +++ b/dbaccess/source/ui/dlg/paramdialog.src @@ -37,6 +37,7 @@ ModalDialog DLG_PARAMETERS { + HelpID = "dbaccess:ModalDialog:DLG_PARAMETERS"; OutputSize = TRUE ; SVLook = TRUE ; Size = MAP_APPFONT ( 6 + LIST_WIDTH + 3 + 6 + BUTTON_WIDTH + 6, 98 ) ; @@ -51,6 +52,7 @@ ModalDialog DLG_PARAMETERS }; ListBox LB_ALLPARAMS { + HelpID = "dbaccess:ListBox:DLG_PARAMETERS:LB_ALLPARAMS"; Pos = MAP_APPFONT ( 7 , 12 ) ; Size = MAP_APPFONT ( LIST_WIDTH , LIST_HEIGHT ) ; Border = TRUE; @@ -64,6 +66,7 @@ ModalDialog DLG_PARAMETERS }; Edit ET_PARAM { + HelpID = "dbaccess:Edit:DLG_PARAMETERS:ET_PARAM"; Border = TRUE ; Pos = MAP_APPFONT ( 7 , 12 + LIST_HEIGHT + 4 + 8 + 3 ) ; Size = MAP_APPFONT ( LIST_WIDTH , 12 ) ; @@ -71,6 +74,7 @@ ModalDialog DLG_PARAMETERS }; PushButton BT_TRAVELNEXT { + HelpID = "dbaccess:PushButton:DLG_PARAMETERS:BT_TRAVELNEXT"; Pos = MAP_APPFONT ( 4 + 3 + LIST_WIDTH + 3 + 6 , 12 + LIST_HEIGHT + 4 + 8 + 3 + ( 12 - BUTTON_HEIGHT ) / 2) ; Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/dlg/queryfilter.src b/dbaccess/source/ui/dlg/queryfilter.src index f93fe24b8766..6d273b5c53aa 100644 --- a/dbaccess/source/ui/dlg/queryfilter.src +++ b/dbaccess/source/ui/dlg/queryfilter.src @@ -44,6 +44,7 @@ ModalDialog DLG_FILTERCRIT HelpId = HID_DLG_FILTERCRIT ; ListBox LB_WHEREFIELD1 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHEREFIELD1"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 25 ) ; Size = MAP_APPFONT ( 60 , 90 ) ; @@ -52,6 +53,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOMP1 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOMP1"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 25 ) ; Size = MAP_APPFONT ( 49 , 72 ) ; @@ -62,6 +64,7 @@ ModalDialog DLG_FILTERCRIT }; Edit ET_WHEREVALUE1 { + HelpID = "dbaccess:Edit:DLG_FILTERCRIT:ET_WHEREVALUE1"; Border = TRUE ; Pos = MAP_APPFONT ( 177 , 25 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -69,6 +72,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOND2 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOND2"; Border = TRUE ; Pos = MAP_APPFONT ( 15 , 41 ) ; Size = MAP_APPFONT ( 41 , 36 ) ; @@ -83,6 +87,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHEREFIELD2 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHEREFIELD2"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 41 ) ; Size = MAP_APPFONT ( 60 , 90 ) ; @@ -91,6 +96,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOMP2 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOMP2"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 41 ) ; Size = MAP_APPFONT ( 49 , 72 ) ; @@ -101,6 +107,7 @@ ModalDialog DLG_FILTERCRIT }; Edit ET_WHEREVALUE2 { + HelpID = "dbaccess:Edit:DLG_FILTERCRIT:ET_WHEREVALUE2"; Border = TRUE ; Pos = MAP_APPFONT ( 177 , 41 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; @@ -108,6 +115,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOND3 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOND3"; Border = TRUE ; Pos = MAP_APPFONT ( 15 , 57 ) ; Size = MAP_APPFONT ( 41 , 36 ) ; @@ -122,6 +130,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHEREFIELD3 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHEREFIELD3"; Border = TRUE ; Pos = MAP_APPFONT ( 60 , 57 ) ; Size = MAP_APPFONT ( 60 , 90 ) ; @@ -130,6 +139,7 @@ ModalDialog DLG_FILTERCRIT }; ListBox LB_WHERECOMP3 { + HelpID = "dbaccess:ListBox:DLG_FILTERCRIT:LB_WHERECOMP3"; Border = TRUE ; Pos = MAP_APPFONT ( 124 , 57 ) ; Size = MAP_APPFONT ( 49 , 72 ) ; @@ -140,6 +150,7 @@ ModalDialog DLG_FILTERCRIT }; Edit ET_WHEREVALUE3 { + HelpID = "dbaccess:Edit:DLG_FILTERCRIT:ET_WHEREVALUE3"; Border = TRUE ; Pos = MAP_APPFONT ( 177 , 57 ) ; Size = MAP_APPFONT ( 60 , 12 ) ; diff --git a/dbaccess/source/ui/dlg/queryorder.cxx b/dbaccess/source/ui/dlg/queryorder.cxx index caa2b79e9a17..75f60ec28d81 100644 --- a/dbaccess/source/ui/dlg/queryorder.cxx +++ b/dbaccess/source/ui/dlg/queryorder.cxx @@ -89,7 +89,7 @@ DlgOrderCrit::DlgOrderCrit( Window * pParent, AllSettings aSettings( GetSettings() ); StyleSettings aStyle( aSettings.GetStyleSettings() ); - aStyle.SetAutoMnemonic( FALSE ); + aStyle.SetAutoMnemonic( sal_False ); aSettings.SetStyleSettings( aStyle ); SetSettings( aSettings ); diff --git a/dbaccess/source/ui/dlg/queryorder.src b/dbaccess/source/ui/dlg/queryorder.src index 318df3045aa1..7c349dda037b 100644 --- a/dbaccess/source/ui/dlg/queryorder.src +++ b/dbaccess/source/ui/dlg/queryorder.src @@ -42,6 +42,7 @@ ModalDialog DLG_ORDERCRIT Closeable = TRUE ; ListBox LB_ORDERFIELD1 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERFIELD1"; Border = TRUE ; Pos = MAP_APPFONT ( 59 , 25 ) ; Size = MAP_APPFONT ( 60 , 72 ) ; @@ -51,6 +52,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERVALUE1 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERVALUE1"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 25 ) ; Size = MAP_APPFONT ( 60 , 36 ) ; @@ -65,6 +67,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERFIELD2 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERFIELD2"; Border = TRUE ; Pos = MAP_APPFONT ( 59 , 41 ) ; Size = MAP_APPFONT ( 60 , 72 ) ; @@ -74,6 +77,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERVALUE2 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERVALUE2"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 41 ) ; Size = MAP_APPFONT ( 60 , 36 ) ; @@ -88,6 +92,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERFIELD3 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERFIELD3"; Border = TRUE ; Pos = MAP_APPFONT ( 59 , 57 ) ; Size = MAP_APPFONT ( 60 , 72 ) ; @@ -97,6 +102,7 @@ ModalDialog DLG_ORDERCRIT }; ListBox LB_ORDERVALUE3 { + HelpID = "dbaccess:ListBox:DLG_ORDERCRIT:LB_ORDERVALUE3"; Border = TRUE ; Pos = MAP_APPFONT ( 123 , 57 ) ; Size = MAP_APPFONT ( 60 , 36 ) ; diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index b643f52166b9..80a1378d6a5d 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -47,6 +47,8 @@ #include "UITools.hxx" #include "moduledbu.hxx" +#include <tools/urlobj.hxx> + #define BUTTONID_MORE BUTTONID_RETRY + 1 #define DIALOG_WIDTH 220 @@ -89,12 +91,12 @@ namespace class ImageProvider : public IImageProvider { private: - USHORT m_defaultImageID; + sal_uInt16 m_defaultImageID; mutable Image m_defaultImage; public: - ImageProvider( USHORT _defaultImageID ) + ImageProvider( sal_uInt16 _defaultImageID ) :m_defaultImageID( _defaultImageID ) { } @@ -113,7 +115,7 @@ namespace private: String m_label; public: - LabelProvider( USHORT _labelResourceID ) + LabelProvider( sal_uInt16 _labelResourceID ) :m_label( ModuleRes( _labelResourceID ) ) { } @@ -143,7 +145,7 @@ namespace ::boost::shared_ptr< IImageProvider > getImageProvider( SQLExceptionInfo::TYPE _eType ) const { ::boost::shared_ptr< IImageProvider >* ppProvider( &m_pErrorImage ); - USHORT nNormalImageID( BMP_EXCEPTION_ERROR ); + sal_uInt16 nNormalImageID( BMP_EXCEPTION_ERROR ); switch ( _eType ) { @@ -169,7 +171,7 @@ namespace ::boost::shared_ptr< ILabelProvider > getLabelProvider( SQLExceptionInfo::TYPE _eType, bool _bSubLabel ) const { ::boost::shared_ptr< ILabelProvider >* ppProvider( &m_pErrorLabel ); - USHORT nLabelID( STR_EXCEPTION_ERROR ); + sal_uInt16 nLabelID( STR_EXCEPTION_ERROR ); switch ( _eType ) { @@ -356,7 +358,7 @@ OExceptionChainDialog::OExceptionChainDialog( Window* pParent, const ExceptionDi m_aExceptionList.SetSelectionMode(SINGLE_SELECTION); m_aExceptionList.SetDragDropMode(0); m_aExceptionList.EnableInplaceEditing(sal_False); - m_aExceptionList.SetWindowBits(WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); + m_aExceptionList.SetStyle(m_aExceptionList.GetStyle() | WB_HASLINES | WB_HASBUTTONS | WB_HASBUTTONSATROOT | WB_HSCROLL); m_aExceptionList.SetSelectHdl(LINK(this, OExceptionChainDialog, OnExceptionSelected)); m_aExceptionList.SetNodeDefaultImages( ); @@ -470,7 +472,7 @@ namespace void lcl_addButton( ButtonDialog& _rDialog, StandardButtonType _eType, bool _bDefault ) { - USHORT nButtonID = 0; + sal_uInt16 nButtonID = 0; switch ( _eType ) { case BUTTON_YES: nButtonID = BUTTONID_YES; break; @@ -645,11 +647,14 @@ void OSQLMessageBox::impl_createStandardButtons( WinBits _nStyle ) { lcl_addButton( *this, BUTTON_HELP, false ); - SmartId aHelpId( m_sHelpURL ); - if ( m_sHelpURL.indexOfAsciiL( "HID:", 4 ) == 0 ) - aHelpId = SmartId( m_sHelpURL.copy( 4 ).toInt32() ); + rtl::OUString aTmp; + INetURLObject aHID( m_sHelpURL ); + if ( aHID.GetProtocol() == INET_PROT_HID ) + aTmp = aHID.GetURLPath(); + else + aTmp = m_sHelpURL; - SetSmartHelpId( aHelpId ); + SetHelpId( rtl::OUStringToOString( aTmp, RTL_TEXTENCODING_UTF8 ) ); } } diff --git a/dbaccess/source/ui/dlg/sqlmessage.src b/dbaccess/source/ui/dlg/sqlmessage.src index 979fdd3709df..94b2e394d527 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.src +++ b/dbaccess/source/ui/dlg/sqlmessage.src @@ -56,6 +56,7 @@ Image BMP_EXCEPTION_INFO ModalDialog DLG_SQLEXCEPTIONCHAIN { + HelpID = "dbaccess:ModalDialog:DLG_SQLEXCEPTIONCHAIN"; Moveable = TRUE ; Closeable = TRUE ; OutputSize = TRUE ; diff --git a/dbaccess/source/ui/dlg/tablespage.cxx b/dbaccess/source/ui/dlg/tablespage.cxx index cf04d792d241..9b5e771b2173 100644 --- a/dbaccess/source/ui/dlg/tablespage.cxx +++ b/dbaccess/source/ui/dlg/tablespage.cxx @@ -102,7 +102,7 @@ DBG_NAME(OTableSubscriptionPage) m_aTablesList.SetSelectionMode( MULTIPLE_SELECTION ); m_aTablesList.SetDragDropMode( 0 ); m_aTablesList.EnableInplaceEditing( sal_False ); - m_aTablesList.SetWindowBits(WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); + m_aTablesList.SetStyle(m_aTablesList.GetStyle() | WB_BORDER | WB_HASLINES | WB_HASLINESATROOT | WB_SORT | WB_HASBUTTONS | WB_HSCROLL |WB_HASBUTTONSATROOT); m_aTablesList.Clear(); @@ -583,7 +583,7 @@ DBG_NAME(OTableSubscriptionPage) } //------------------------------------------------------------------------ - BOOL OTableSubscriptionPage::FillItemSet( SfxItemSet& _rCoreAttrs ) + sal_Bool OTableSubscriptionPage::FillItemSet( SfxItemSet& _rCoreAttrs ) { sal_Bool bValid, bReadonly; getFlags(_rCoreAttrs, bValid, bReadonly); diff --git a/dbaccess/source/ui/dlg/tablespage.hxx b/dbaccess/source/ui/dlg/tablespage.hxx index a15e7e159e53..81566ed7faf5 100644 --- a/dbaccess/source/ui/dlg/tablespage.hxx +++ b/dbaccess/source/ui/dlg/tablespage.hxx @@ -68,7 +68,7 @@ namespace dbaui OTableSubscriptionDialog* m_pTablesDlg; public: - virtual BOOL FillItemSet(SfxItemSet& _rCoreAttrs); + virtual sal_Bool FillItemSet(SfxItemSet& _rCoreAttrs); virtual int DeactivatePage(SfxItemSet* _pSet); using OGenericAdministrationPage::DeactivatePage; @@ -105,7 +105,7 @@ namespace dbaui ::com::sun::star::uno::Sequence< ::rtl::OUString > collectDetailedSelection() const; /// (un)check all entries - void CheckAll( BOOL bCheck = sal_True ); + void CheckAll( sal_Bool bCheck = sal_True ); virtual void implInitControls(const SfxItemSet& _rSet, sal_Bool _bSaveValue); diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.src b/dbaccess/source/ui/dlg/textconnectionsettings.src index cca76e7f65a3..b34a056076a8 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.src +++ b/dbaccess/source/ui/dlg/textconnectionsettings.src @@ -34,6 +34,7 @@ ModalDialog DLG_TEXT_CONNECTION_SETTINGS { + HelpID = "dbaccess:ModalDialog:DLG_TEXT_CONNECTION_SETTINGS"; Size = MAP_APPFONT( DIALOG_WIDTH, DIALOG_HEIGHT ); OutputSize = TRUE ; diff --git a/dbaccess/source/ui/inc/ColumnControlWindow.hxx b/dbaccess/source/ui/inc/ColumnControlWindow.hxx index d0376cbf76dc..5cd8d93a337a 100644 --- a/dbaccess/source/ui/inc/ColumnControlWindow.hxx +++ b/dbaccess/source/ui/inc/ColumnControlWindow.hxx @@ -63,7 +63,7 @@ namespace dbaui virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos); virtual sal_Bool isAutoIncrementValueEnabled() const; virtual ::rtl::OUString getAutoIncrementValue() const; - virtual void CellModified(long nRow, USHORT nColId ); + virtual void CellModified(long nRow, sal_uInt16 nColId ); public: OColumnControlWindow(Window* pParent diff --git a/dbaccess/source/ui/inc/ConnectionLine.hxx b/dbaccess/source/ui/inc/ConnectionLine.hxx index a8070ecd183e..ff4640a3b3e2 100644 --- a/dbaccess/source/ui/inc/ConnectionLine.hxx +++ b/dbaccess/source/ui/inc/ConnectionLine.hxx @@ -67,13 +67,13 @@ namespace dbaui virtual OConnectionLine& operator=( const OConnectionLine& rLine ); Rectangle GetBoundingRect(); - BOOL RecalcLine(); + sal_Bool RecalcLine(); void Draw( OutputDevice* pOutDev ); bool CheckHit( const Point& rMousePos ) const; String GetSourceFieldName() const { return m_pData->GetSourceFieldName(); } String GetDestFieldName() const { return m_pData->GetDestFieldName(); } - BOOL IsValid() const; + sal_Bool IsValid() const; Rectangle GetSourceTextPos() const; Rectangle GetDestTextPos() const; diff --git a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx b/dbaccess/source/ui/inc/ExtensionNotPresent.hxx deleted file mode 100644 index dcea387599ea..000000000000 --- a/dbaccess/source/ui/inc/ExtensionNotPresent.hxx +++ /dev/null @@ -1,85 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef DBU_EXTENSIONNOTPRESENT_HXX -#define DBU_EXTENSIONNOTPRESENT_HXX - -#include <vcl/dialog.hxx> -#include <vcl/fixed.hxx> -#include <vcl/lstbox.hxx> -#include <vcl/field.hxx> -#include <vcl/button.hxx> -#include <com/sun/star/report/XReportDefinition.hpp> -#include <com/sun/star/lang/Locale.hpp> - -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/system/XSystemShellExecute.hpp> - -namespace dbaui -{ - -/************************************************************************* -|* -|* Groups and Sorting dialog -|* -\************************************************************************/ -class OExtensionNotPresentDialog : public ModalDialog -{ - FixedImage m_aFI_WARNING; - FixedText m_aFT_TEXT; - - PushButton m_aPB_DOWNLOAD; - CancelButton m_aPB_CANCEL; - - ::com::sun::star::lang::Locale m_nLocale; - com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xMultiServiceFactory; - - DECL_LINK(Download_Click,PushButton*); - - // not CopyCTOR, no self assignment - OExtensionNotPresentDialog(const OExtensionNotPresentDialog&); - void operator =(const OExtensionNotPresentDialog&); - - // get some values out of the configuration - rtl::OUString getFromConfigurationExtension(rtl::OUString const& _sPropertyName) const; - rtl::OUString getFromConfigurationExtension(rtl::OString const& _sPropertyName) const; // syntactic sugar - - ::com::sun::star::uno::Reference< ::com::sun::star::system::XSystemShellExecute > getShellExecuter() const; - -public: - OExtensionNotPresentDialog( Window* pParent, com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > ); - virtual ~OExtensionNotPresentDialog(); - virtual short Execute(); - - inline String getText() const { return m_aFT_TEXT.GetText(); } -}; -// ============================================================================= -} // namespace rptui -// ============================================================================= -#endif // DBU_EXTENSIONNOTPRESENT_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/source/ui/inc/FieldControls.hxx b/dbaccess/source/ui/inc/FieldControls.hxx index 5ccb33bb70dc..661f66a96bda 100644 --- a/dbaccess/source/ui/inc/FieldControls.hxx +++ b/dbaccess/source/ui/inc/FieldControls.hxx @@ -39,7 +39,7 @@ namespace dbaui { namespace { - void lcl_setSpecialReadOnly( BOOL _bReadOnly, Window* _pWin ) + void lcl_setSpecialReadOnly( sal_Bool _bReadOnly, Window* _pWin ) { StyleSettings aSystemStyle = Application::GetSettings().GetStyleSettings(); const Color& rNewColor = _bReadOnly ? aSystemStyle.GetDialogColor() : aSystemStyle.GetFieldColor(); @@ -55,14 +55,14 @@ namespace dbaui short m_nPos; String m_strHelpText; public: - inline OPropColumnEditCtrl(Window* pParent, ::rtl::OUString& _rAllowedChars, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropColumnEditCtrl(Window* pParent, ::rtl::OUString& _rAllowedChars, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline BOOL IsModified() const { return GetText() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); @@ -70,7 +70,7 @@ namespace dbaui }; inline OPropColumnEditCtrl::OPropColumnEditCtrl(Window* pParent, ::rtl::OUString& _rAllowedChars, - USHORT nHelpId, + sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :OSQLNameEdit(pParent, _rAllowedChars,nWinStyle) @@ -86,28 +86,28 @@ namespace dbaui String m_strHelpText; public: - inline OPropEditCtrl(Window* pParent, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline OPropEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition = -1); + inline OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition = -1); - inline BOOL IsModified() const { return GetText() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); } }; - inline OPropEditCtrl::OPropEditCtrl(Window* pParent, USHORT nHelpId, short nPosition, WinBits nWinStyle) + inline OPropEditCtrl::OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :Edit(pParent, nWinStyle) ,m_nPos(nPosition) { m_strHelpText =String(ModuleRes(nHelpId)); } - inline OPropEditCtrl::OPropEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition) + inline OPropEditCtrl::OPropEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :Edit(pParent, _rRes) ,m_nPos(nPosition) { @@ -121,28 +121,28 @@ namespace dbaui String m_strHelpText; public: - inline OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition = -1); + inline OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition = -1); - inline BOOL IsModified() const { return GetText() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetText() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); } }; - inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, short nPosition, WinBits nWinStyle) + inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :NumericField(pParent, nWinStyle) ,m_nPos(nPosition) { m_strHelpText =String(ModuleRes(nHelpId)); } - inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition) + inline OPropNumericEditCtrl::OPropNumericEditCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :NumericField(pParent, _rRes) ,m_nPos(nPosition) { @@ -156,28 +156,28 @@ namespace dbaui String m_strHelpText; public: - inline OPropListBoxCtrl(Window* pParent, USHORT nHelpId, short nPosition = -1, WinBits nWinStyle = 0); - inline OPropListBoxCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition = -1); + inline OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition = -1, WinBits nWinStyle = 0); + inline OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition = -1); - inline BOOL IsModified() const { return GetSelectEntryPos() != GetSavedValue(); } + inline sal_Bool IsModified() const { return GetSelectEntryPos() != GetSavedValue(); } short GetPos() const { return m_nPos; } String GetHelp() const { return m_strHelpText; } - virtual void SetSpecialReadOnly(BOOL _bReadOnly) + virtual void SetSpecialReadOnly(sal_Bool _bReadOnly) { SetReadOnly(_bReadOnly); lcl_setSpecialReadOnly(_bReadOnly,this); } }; - inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, USHORT nHelpId, short nPosition, WinBits nWinStyle) + inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, short nPosition, WinBits nWinStyle) :ListBox(pParent, nWinStyle) ,m_nPos(nPosition) { m_strHelpText =String(ModuleRes(nHelpId)); } - inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, USHORT nHelpId, const ResId& _rRes,short nPosition) + inline OPropListBoxCtrl::OPropListBoxCtrl(Window* pParent, sal_uInt16 nHelpId, const ResId& _rRes,short nPosition) :ListBox(pParent, _rRes) ,m_nPos(nPosition) { diff --git a/dbaccess/source/ui/inc/FieldDescControl.hxx b/dbaccess/source/ui/inc/FieldDescControl.hxx index 38c270610a5f..cd038229deab 100644 --- a/dbaccess/source/ui/inc/FieldDescControl.hxx +++ b/dbaccess/source/ui/inc/FieldDescControl.hxx @@ -115,7 +115,7 @@ namespace dbaui ScrollBar* m_pHorzScroll; TOTypeInfoSP m_pPreviousType; - USHORT nCurChildId; + sal_uInt16 nCurChildId; short m_nPos; XubString aYes; XubString aNo; @@ -124,7 +124,7 @@ namespace dbaui long m_nOldHThumb; sal_Int32 m_nWidth; - ULONG nDelayedGrabFocusEvent; + sal_uLong nDelayedGrabFocusEvent; sal_Bool m_bAdded; bool m_bRightAligned; @@ -143,16 +143,16 @@ namespace dbaui void UpdateFormatSample(OFieldDescription* pFieldDescr); void ArrangeAggregates(); - void SetPosSize( Control** ppControl, long nRow, USHORT nCol ); + void SetPosSize( Control** ppControl, long nRow, sal_uInt16 nCol ); void ScrollAggregate(Control* pText, Control* pInput, Control* pButton, long nDeltaX, long nDeltaY); void ScrollAllAggregates(); sal_Bool isTextFormat(const OFieldDescription* _pFieldDescr,sal_uInt32& _nFormatKey) const; void Contruct(); - OPropNumericEditCtrl* CreateNumericControl(USHORT _nHelpStr,short _nProperty,ULONG _nHelpId); - FixedText* CreateText(USHORT _nTextRes); - void InitializeControl(Control* _pControl,ULONG _nHelpId,bool _bAddChangeHandler); + OPropNumericEditCtrl* CreateNumericControl(sal_uInt16 _nHelpStr,short _nProperty,const rtl::OString& _sHelpId); + FixedText* CreateText(sal_uInt16 _nTextRes); + void InitializeControl(Control* _pControl,const rtl::OString& _sHelpId,bool _bAddChangeHandler); protected: inline void setRightAligned() { m_bRightAligned = true; } @@ -167,15 +167,15 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ); virtual void DeactivateAggregate( EControlType eType ); - virtual BOOL IsReadOnly() { return FALSE; }; + virtual sal_Bool IsReadOnly() { return sal_False; }; // Sind von den abgeleiteten Klassen zu impl. virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const = 0; virtual ::com::sun::star::lang::Locale GetLocale() const = 0; - virtual void CellModified(long nRow, USHORT nColId ) = 0; - virtual void SetModified(BOOL bModified); // base implementation is empty + virtual void CellModified(long nRow, sal_uInt16 nColId ) = 0; + virtual void SetModified(sal_Bool bModified); // base implementation is empty virtual TOTypeInfoSP getTypeInfo(sal_Int32 _nPos) = 0; virtual const OTypeInfoMap* getTypeInfo() const = 0; @@ -199,9 +199,9 @@ namespace dbaui void SaveData( OFieldDescription* pFieldDescr ); // void SaveData( OColumn* pColumn); - void SetControlText( USHORT nControlId, const String& rText ); - String GetControlText( USHORT nControlId ); - void SetReadOnly( BOOL bReadOnly ); + void SetControlText( sal_uInt16 nControlId, const String& rText ); + String GetControlText( sal_uInt16 nControlId ); + void SetReadOnly( sal_Bool bReadOnly ); // Resize aufegrufen void CheckScrollBars(); diff --git a/dbaccess/source/ui/inc/GeneralUndo.hxx b/dbaccess/source/ui/inc/GeneralUndo.hxx index 29e4d09e5670..de99bd3706f3 100644 --- a/dbaccess/source/ui/inc/GeneralUndo.hxx +++ b/dbaccess/source/ui/inc/GeneralUndo.hxx @@ -46,7 +46,7 @@ namespace dbaui public: TYPEINFO(); - OCommentUndoAction(USHORT nCommentID) { m_strComment = String(ModuleRes(nCommentID)); } + OCommentUndoAction(sal_uInt16 nCommentID) { m_strComment = String(ModuleRes(nCommentID)); } virtual UniString GetComment() const { return m_strComment; } }; diff --git a/dbaccess/source/ui/inc/JoinController.hxx b/dbaccess/source/ui/inc/JoinController.hxx index 5f7af2163220..cc35323db7fd 100644 --- a/dbaccess/source/ui/inc/JoinController.hxx +++ b/dbaccess/source/ui/inc/JoinController.hxx @@ -35,9 +35,7 @@ #include "JoinDesignView.hxx" #include "TableConnectionData.hxx" #include "TableWindowData.hxx" -#ifndef _MEMORY_ #include <memory> -#endif #include <boost/shared_ptr.hpp> namespace comphelper diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx index 72f5d054345e..48073242a301 100644 --- a/dbaccess/source/ui/inc/JoinTableView.hxx +++ b/dbaccess/source/ui/inc/JoinTableView.hxx @@ -103,7 +103,7 @@ namespace dbaui OTableConnection* m_pSelectedConn; - BOOL m_bTrackingInitiallyMoved; + sal_Bool m_bTrackingInitiallyMoved; DECL_LINK(OnDragScrollTimer, void*); @@ -137,7 +137,7 @@ namespace dbaui void NotifyTitleClicked( OTableWindow* pTabWin, const Point rMousePos ); - virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL bNewTable = FALSE); + virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool bNewTable = sal_False); virtual void RemoveTabWin( OTableWindow* pTabWin ); // alle TabWins verstecken (NICHT loeschen, sie werden in eine Undo-Action gepackt) @@ -165,8 +165,8 @@ namespace dbaui */ void addConnection(OTableConnection* _pConnection,sal_Bool _bAddData = sal_True); - BOOL ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars ); - ULONG GetTabWinCount(); + sal_Bool ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPaintScrollBars ); + sal_uLong GetTabWinCount(); Point GetScrollOffset() const { return m_aScrollOffset; } OJoinDesignView* getDesignView() const { return m_pView; } @@ -184,7 +184,7 @@ namespace dbaui const ::std::vector<OTableConnection*>* getTableConnections() const { return &m_vTableConnection; } - BOOL ExistsAConn(const OTableWindow* pFromWin) const; + sal_Bool ExistsAConn(const OTableWindow* pFromWin) const; /** getTableConnections searchs for all connections of a table @param _pFromWin the table for which connections should be found @@ -216,7 +216,7 @@ namespace dbaui virtual void ClearAll(); // wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen - virtual BOOL IsAddAllowed(); + virtual sal_Bool IsAddAllowed(); virtual long PreNotify(NotifyEvent& rNEvt); // DnD stuff @@ -250,7 +250,7 @@ namespace dbaui <TRUE/> if the area is visible otherwise <FALSE/> */ - BOOL isMovementAllowed(const Point& _rPoint,const Size& _rSize); + sal_Bool isMovementAllowed(const Point& _rPoint,const Size& _rSize); Size getRealOutputSize() const { return m_aOutputSize; } @@ -303,7 +303,7 @@ namespace dbaui private: void InitColors(); - BOOL ScrollWhileDragging(); + sal_Bool ScrollWhileDragging(); /** executePopup opens the context menu to delate a connection @param _aPos the position where the popup menu should appear diff --git a/dbaccess/source/ui/inc/QueryTableView.hxx b/dbaccess/source/ui/inc/QueryTableView.hxx index 5bd45e30ccb9..8089b1a2744b 100644 --- a/dbaccess/source/ui/inc/QueryTableView.hxx +++ b/dbaccess/source/ui/inc/QueryTableView.hxx @@ -72,14 +72,14 @@ namespace dbaui // Basisklasse ueberschrieben : Fenster kreieren und loeschen // (eigentlich nicht wirklich LOESCHEN, es geht in die Verantwortung einer UNDO-Action ueber) - virtual void AddTabWin( const ::rtl::OUString& _rTableName, const ::rtl::OUString& _rAliasName, BOOL bNewTable = FALSE ); + virtual void AddTabWin( const ::rtl::OUString& _rTableName, const ::rtl::OUString& _rAliasName, sal_Bool bNewTable = sal_False ); virtual void RemoveTabWin(OTableWindow* pTabWin); // und ein AddTabWin, das einen Alias vorgibt - void AddTabWin(const ::rtl::OUString& strDatabase, const ::rtl::OUString& strTableName, const ::rtl::OUString& strAlias, BOOL bNewTable = FALSE); + void AddTabWin(const ::rtl::OUString& strDatabase, const ::rtl::OUString& strTableName, const ::rtl::OUString& strAlias, sal_Bool bNewTable = sal_False); // TabWin suchen OQueryTableWindow* FindTable(const String& rAliasName); - BOOL FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, USHORT& rCnt); + sal_Bool FindTableFromField(const String& rFieldName, OTableFieldDescRef& rInfo, sal_uInt16& rCnt); // Basisklasse ueberschrieben : Connections kreieren und loeschen virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest); @@ -96,7 +96,7 @@ namespace dbaui // natuerlich alle Connections an diesen Fenstern und alle Abfrage-Spalten, die auf diesen Tabellen basierten. // TabWin anzeigen oder verstecken (NICHT kreieren oder loeschen) - BOOL ShowTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction,sal_Bool _bAppend); + sal_Bool ShowTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction,sal_Bool _bAppend); void HideTabWin(OQueryTableWindow* pTabWin, OQueryTabWinUndoAct* pUndoAction); // Sichbarkeit eines TabWins sicherstellen (+ Invalidieren der Connections) @@ -114,15 +114,15 @@ namespace dbaui virtual void ClearAll(); // wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen - //virtual BOOL IsAddAllowed(); + //virtual sal_Bool IsAddAllowed(); // eine neu Connection bekanntgeben und einfuegen lassen, wenn nicht schon existent - void NotifyTabConnection(const OQueryTableConnection& rNewConn, BOOL _bCreateUndoAction = TRUE); + void NotifyTabConnection(const OQueryTableConnection& rNewConn, sal_Bool _bCreateUndoAction = sal_True); Link SetTabWinsChangeHandler(const Link& lnk) { Link lnkRet = m_lnkTabWinsChangeHandler; m_lnkTabWinsChangeHandler = lnk; return lnkRet; } // der Handler bekommt einen Zeiger auf eine TabWinsChangeNotification-Struktur - BOOL ExistsAVisitedConn(const OQueryTableWindow* pFrom) const; + sal_Bool ExistsAVisitedConn(const OQueryTableWindow* pFrom) const; virtual OTableWindowData* CreateImpl(const ::rtl::OUString& _rComposedName ,const ::rtl::OUString& _sTableName diff --git a/dbaccess/source/ui/inc/RTableConnectionData.hxx b/dbaccess/source/ui/inc/RTableConnectionData.hxx index 184e0e97cbdb..096f97ba4675 100644 --- a/dbaccess/source/ui/inc/RTableConnectionData.hxx +++ b/dbaccess/source/ui/inc/RTableConnectionData.hxx @@ -35,10 +35,10 @@ namespace dbaui { - const UINT16 CARDINAL_UNDEFINED = 0x0000; - const UINT16 CARDINAL_ONE_MANY = 0x0001; - const UINT16 CARDINAL_MANY_ONE = 0x0002; - const UINT16 CARDINAL_ONE_ONE = 0x0004; + const sal_uInt16 CARDINAL_UNDEFINED = 0x0000; + const sal_uInt16 CARDINAL_ONE_MANY = 0x0001; + const sal_uInt16 CARDINAL_MANY_ONE = 0x0002; + const sal_uInt16 CARDINAL_ONE_ONE = 0x0004; class OConnectionLineData; //================================================================== @@ -54,9 +54,9 @@ namespace dbaui sal_Int32 m_nDeleteRules; sal_Int32 m_nCardinality; - BOOL checkPrimaryKey(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const; - BOOL IsSourcePrimKey() const { return checkPrimaryKey(getReferencingTable()->getTable(),JTCS_FROM); } - BOOL IsDestPrimKey() const { return checkPrimaryKey(getReferencedTable()->getTable(),JTCS_TO); } + sal_Bool checkPrimaryKey(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const; + sal_Bool IsSourcePrimKey() const { return checkPrimaryKey(getReferencingTable()->getTable(),JTCS_FROM); } + sal_Bool IsDestPrimKey() const { return checkPrimaryKey(getReferencedTable()->getTable(),JTCS_TO); } protected: virtual OConnectionLineDataRef CreateLineDataObj(); @@ -78,7 +78,7 @@ namespace dbaui @return true if successful */ - virtual BOOL Update(); + virtual sal_Bool Update(); void SetCardinality(); @@ -89,9 +89,9 @@ namespace dbaui inline sal_Int32 GetDeleteRules() const { return m_nDeleteRules; } inline sal_Int32 GetCardinality() const { return m_nCardinality; } - BOOL IsConnectionPossible(); + sal_Bool IsConnectionPossible(); void ChangeOrientation(); - BOOL DropRelation(); + sal_Bool DropRelation(); }; } diff --git a/dbaccess/source/ui/inc/RelationControl.hxx b/dbaccess/source/ui/inc/RelationControl.hxx index 55983b1dff6e..62b812f4f98f 100644 --- a/dbaccess/source/ui/inc/RelationControl.hxx +++ b/dbaccess/source/ui/inc/RelationControl.hxx @@ -74,7 +74,7 @@ namespace dbaui /** enables the relation control * - * \param _bEnable when TRUE enables it, otherwise disable it. + * \param _bEnable when sal_True enables it, otherwise disable it. */ void enableRelation(bool _bEnable); @@ -90,7 +90,7 @@ namespace dbaui void lateUIInit(Window* _pTableSeparator = NULL); void lateInit(); - BOOL SaveModified(); + sal_Bool SaveModified(); TTableWindowData::value_type getReferencingTable() const; diff --git a/dbaccess/source/ui/inc/RelationController.hxx b/dbaccess/source/ui/inc/RelationController.hxx index 3b0e375f8537..38253627fcc5 100644 --- a/dbaccess/source/ui/inc/RelationController.hxx +++ b/dbaccess/source/ui/inc/RelationController.hxx @@ -44,7 +44,7 @@ namespace dbaui { ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xTables; ::std::auto_ptr<WaitObject> m_pWaitObject; - ULONG m_nThreadEvent; + sal_uLong m_nThreadEvent; sal_Bool m_bRelationsPossible; protected: // all the features which should be handled by this class diff --git a/dbaccess/source/ui/inc/RelationDlg.hxx b/dbaccess/source/ui/inc/RelationDlg.hxx index bbd66b2ba7b8..7320a8d14908 100644 --- a/dbaccess/source/ui/inc/RelationDlg.hxx +++ b/dbaccess/source/ui/inc/RelationDlg.hxx @@ -71,12 +71,12 @@ namespace dbaui TTableConnectionData::value_type m_pOrigConnData; ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection; - BOOL m_bTriedOneUpdate; + sal_Bool m_bTriedOneUpdate; public: ORelationDialog(OJoinTableView* pParent, const TTableConnectionData::value_type& pConnectionData, - BOOL bAllowTableSelect = FALSE ); + sal_Bool bAllowTableSelect = sal_False ); virtual ~ORelationDialog(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(){ return m_xConnection; } diff --git a/dbaccess/source/ui/inc/RelationTableView.hxx b/dbaccess/source/ui/inc/RelationTableView.hxx index b7213e440754..d708cbac1424 100644 --- a/dbaccess/source/ui/inc/RelationTableView.hxx +++ b/dbaccess/source/ui/inc/RelationTableView.hxx @@ -47,7 +47,7 @@ namespace dbaui bool m_bInRemove; virtual void ConnDoubleClicked( OTableConnection* pConnection ); - virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL bNewTable = FALSE); + virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool bNewTable = sal_False); virtual OTableWindow* createWindow(const TTableWindowData::value_type& _pData); @@ -73,7 +73,7 @@ namespace dbaui void AddNewRelation(); // reisst den Dialog fuer eine voellig neue Relation hoch // wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen - virtual BOOL IsAddAllowed(); + virtual sal_Bool IsAddAllowed(); virtual void lookForUiActivities(); }; diff --git a/dbaccess/source/ui/inc/TableConnection.hxx b/dbaccess/source/ui/inc/TableConnection.hxx index 5eb3429ce931..8d4629c36425 100644 --- a/dbaccess/source/ui/inc/TableConnection.hxx +++ b/dbaccess/source/ui/inc/TableConnection.hxx @@ -53,7 +53,7 @@ namespace dbaui m_pData; OJoinTableView* m_pParent; - BOOL m_bSelected; + sal_Bool m_bSelected; void Init(); /** clearLineData loops through the vector and deletes all lines @@ -77,8 +77,8 @@ namespace dbaui void Select(); void Deselect(); - BOOL IsSelected() const { return m_bSelected; } - BOOL CheckHit( const Point& rMousePos ) const; + sal_Bool IsSelected() const { return m_bSelected; } + sal_Bool CheckHit( const Point& rMousePos ) const; bool InvalidateConnection(); void UpdateLineList(); diff --git a/dbaccess/source/ui/inc/TableConnectionData.hxx b/dbaccess/source/ui/inc/TableConnectionData.hxx index ec85e99dc825..79ccd802d564 100644 --- a/dbaccess/source/ui/inc/TableConnectionData.hxx +++ b/dbaccess/source/ui/inc/TableConnectionData.hxx @@ -78,14 +78,14 @@ namespace dbaui virtual OTableConnectionData* NewInstance() const; // (von OTableConnectionData abgeleitete Klasse muessen entsprechend eine Instanz ihrer Klasse liefern) - BOOL SetConnLine( USHORT nIndex, const String& rSourceFieldName, const String& rDestFieldName ); - BOOL AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ); - void ResetConnLines( BOOL bUseDefaults = TRUE ); + sal_Bool SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ); + sal_Bool AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ); + void ResetConnLines( sal_Bool bUseDefaults = sal_True ); /** normalizeLines moves the empty lines to the back */ void normalizeLines(); - // loescht die Liste der ConnLines, bei bUseDefaults == TRUE werden danach MAX_CONN_COUNT neue Dummy-Linien eingefuegt + // loescht die Liste der ConnLines, bei bUseDefaults == sal_True werden danach MAX_CONN_COUNT neue Dummy-Linien eingefuegt OConnectionLineDataVec* GetConnLineDataList(){ return &m_vConnLineData; } @@ -102,7 +102,7 @@ namespace dbaui @return true if successful */ - virtual BOOL Update(){ return TRUE; } + virtual sal_Bool Update(){ return sal_True; } }; typedef ::std::vector< ::boost::shared_ptr<OTableConnectionData> > TTableConnectionData; diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx index 5b61c5ada9eb..5747cd20ac10 100644 --- a/dbaccess/source/ui/inc/TableController.hxx +++ b/dbaccess/source/ui/inc/TableController.hxx @@ -110,9 +110,6 @@ namespace dbaui virtual void impl_onModifyChanged(); - // const ::connectivity::OSQLParseNode* getParseTree() const { return m_aSqlIterator.getParseTree();} - // need for undo's and redo's - SfxUndoManager* getUndoMgr(); inline ::std::vector< ::boost::shared_ptr<OTableRow> >* getRows() { return &m_vRowList; } /// returns the postion of the the first empty row diff --git a/dbaccess/source/ui/inc/TableDesignControl.hxx b/dbaccess/source/ui/inc/TableDesignControl.hxx index 9acd1fbf02eb..0e905a459cc2 100644 --- a/dbaccess/source/ui/inc/TableDesignControl.hxx +++ b/dbaccess/source/ui/inc/TableDesignControl.hxx @@ -49,25 +49,25 @@ namespace dbaui long m_nDataPos; // derzeit benoetigte Zeile long m_nCurrentPos; // Aktuelle Position der ausgewaehlten Column private: - USHORT m_nCurUndoActId; + sal_uInt16 m_nCurUndoActId; protected: - BOOL m_bCurrentModified; - BOOL m_bUpdatable; - BOOL m_bClipboardFilled; + sal_Bool m_bCurrentModified; + sal_Bool m_bUpdatable; + sal_Bool m_bClipboardFilled; public: OTableRowView(Window* pParent); virtual ~OTableRowView(); - virtual void SetCellData( long nRow, USHORT nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; - virtual void SetCellData( long nRow, USHORT nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; - virtual ::com::sun::star::uno::Any GetCellData( long nRow, USHORT nColId ) = 0; - virtual void SetControlText( long nRow, USHORT nColId, const String& rText ) = 0; - virtual String GetControlText( long nRow, USHORT nColId ) = 0; + virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0; + virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0; + virtual ::com::sun::star::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0; + virtual void SetControlText( long nRow, sal_uInt16 nColId, const String& rText ) = 0; + virtual String GetControlText( long nRow, sal_uInt16 nColId ) = 0; virtual OTableDesignView* GetView() const = 0; - USHORT GetCurUndoActId(){ return m_nCurUndoActId; } + sal_uInt16 GetCurUndoActId(){ return m_nCurUndoActId; } // IClipboardTest virtual void cut(); @@ -86,8 +86,8 @@ namespace dbaui virtual sal_Bool IsInsertNewAllowed( long nRow ) = 0; virtual sal_Bool IsDeleteAllowed( long nRow ) = 0; - virtual BOOL IsUpdatable() const {return m_bUpdatable;} - virtual void SetUpdatable( BOOL bUpdate=TRUE ); + virtual sal_Bool IsUpdatable() const {return m_bUpdatable;} + virtual void SetUpdatable( sal_Bool bUpdate=sal_True ); virtual RowStatus GetRowStatus(long nRow) const; virtual void KeyInput(const KeyEvent& rEvt); diff --git a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx index 71ce5f029b96..a3bef0769a8c 100644 --- a/dbaccess/source/ui/inc/TableDesignHelpBar.hxx +++ b/dbaccess/source/ui/inc/TableDesignHelpBar.hxx @@ -45,7 +45,7 @@ namespace dbaui private: String m_sHelpText; MultiLineEdit* m_pTextWin; - USHORT m_nDummy; + sal_uInt16 m_nDummy; protected: virtual void Resize(); diff --git a/dbaccess/source/ui/inc/TableDesignView.hxx b/dbaccess/source/ui/inc/TableDesignView.hxx index b7bc8356ed76..9f4a96b6844d 100644 --- a/dbaccess/source/ui/inc/TableDesignView.hxx +++ b/dbaccess/source/ui/inc/TableDesignView.hxx @@ -46,7 +46,7 @@ namespace dbaui OTableFieldDescWin* m_pFieldDescWin; OTableEditorCtrl* m_pEditorCtrl; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); void ArrangeChilds( long nSplitPos ,Rectangle& rRect); DECL_LINK( SplitHdl, Splitter* ); protected: diff --git a/dbaccess/source/ui/inc/TableGrantCtrl.hxx b/dbaccess/source/ui/inc/TableGrantCtrl.hxx index bc4679434a0f..a0010fdbc82d 100644 --- a/dbaccess/source/ui/inc/TableGrantCtrl.hxx +++ b/dbaccess/source/ui/inc/TableGrantCtrl.hxx @@ -62,8 +62,8 @@ class OTableGrantControl : public ::svt::EditBrowseBox ::svt::CheckBoxControl* m_pCheckCell; Edit* m_pEdit; long m_nDataPos; - BOOL m_bEnable; - ULONG m_nDeactivateEvent; + sal_Bool m_bEnable; + sal_uLong m_nDeactivateEvent; public: OTableGrantControl( Window* pParent,const ResId& _RsId); @@ -91,13 +91,13 @@ protected: virtual long PreNotify(NotifyEvent& rNEvt ); - virtual BOOL IsTabAllowed(BOOL bForward) const; - virtual void InitController( ::svt::CellControllerRef& rController, long nRow, USHORT nCol ); - virtual ::svt::CellController* GetController( long nRow, USHORT nCol ); - virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, USHORT nColId ) const; - virtual BOOL SeekRow( long nRow ); - virtual BOOL SaveModified(); - virtual String GetCellText( long nRow, USHORT nColId ) const; + virtual sal_Bool IsTabAllowed(sal_Bool bForward) const; + virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ); + virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ); + virtual void PaintCell( OutputDevice& rDev, const Rectangle& rRect, sal_uInt16 nColId ) const; + virtual sal_Bool SeekRow( long nRow ); + virtual sal_Bool SaveModified(); + virtual String GetCellText( long nRow, sal_uInt16 nColId ) const; virtual void CellModified(); @@ -105,7 +105,7 @@ private: DECL_LINK( AsynchActivate, void* ); DECL_LINK( AsynchDeactivate, void* ); - sal_Bool isAllowed(USHORT _nColumnId,sal_Int32 _nPrivilege) const; + sal_Bool isAllowed(sal_uInt16 _nColumnId,sal_Int32 _nPrivilege) const; void fillPrivilege(sal_Int32 _nRow) const; TTablePrivilegeMap::const_iterator findPrivilege(sal_Int32 _nRow) const; }; diff --git a/dbaccess/source/ui/inc/TableRow.hxx b/dbaccess/source/ui/inc/TableRow.hxx index 9f29ea2b1684..9e02a0df0662 100644 --- a/dbaccess/source/ui/inc/TableRow.hxx +++ b/dbaccess/source/ui/inc/TableRow.hxx @@ -59,8 +59,8 @@ namespace dbaui void SetFieldType( const TOTypeInfoSP& _pType, sal_Bool _bForce = sal_False ); - void SetPrimaryKey( BOOL bSet ); - BOOL IsPrimaryKey() const; + void SetPrimaryKey( sal_Bool bSet ); + sal_Bool IsPrimaryKey() const; /** returns the current position in the table. @return diff --git a/dbaccess/source/ui/inc/TableWindow.hxx b/dbaccess/source/ui/inc/TableWindow.hxx index 323656ca869d..382a278dee2c 100644 --- a/dbaccess/source/ui/inc/TableWindow.hxx +++ b/dbaccess/source/ui/inc/TableWindow.hxx @@ -45,11 +45,11 @@ namespace dbaui { ////////////////////////////////////////////////////////////////////////// // Flags fuer die Groessenanpassung der SbaJoinTabWins - const UINT16 SIZING_NONE = 0x0000; - const UINT16 SIZING_TOP = 0x0001; - const UINT16 SIZING_BOTTOM = 0x0002; - const UINT16 SIZING_LEFT = 0x0004; - const UINT16 SIZING_RIGHT = 0x0008; + const sal_uInt16 SIZING_NONE = 0x0000; + const sal_uInt16 SIZING_TOP = 0x0001; + const sal_uInt16 SIZING_BOTTOM = 0x0002; + const sal_uInt16 SIZING_LEFT = 0x0004; + const sal_uInt16 SIZING_RIGHT = 0x0008; class OTableWindowListBox; class OJoinDesignView; @@ -76,8 +76,8 @@ namespace dbaui m_pContainerListener; sal_Int32 m_nMoveCount; // how often the arrow keys was pressed sal_Int32 m_nMoveIncrement; // how many pixel we should move - UINT16 m_nSizingFlags; - BOOL m_bActive; + sal_uInt16 m_nSizingFlags; + sal_Bool m_bActive; void Draw3DBorder( const Rectangle& rRect ); // OContainerListener @@ -94,7 +94,7 @@ namespace dbaui virtual OTableWindowListBox* CreateListBox(); // wird im ERSTEN Init aufgerufen - BOOL FillListBox(); + sal_Bool FillListBox(); // wird in JEDEM Init aufgerufen virtual void OnEntryDoubleClicked(SvLBoxEntry* /*pEntry*/) { } @@ -106,7 +106,7 @@ namespace dbaui @return <TRUE/> when the table could handle the keyevent. */ - BOOL HandleKeyInput( const KeyEvent& rEvt ); + sal_Bool HandleKeyInput( const KeyEvent& rEvt ); /** delete the user data with the equal type as created within createUserData @param _pUserData @@ -137,7 +137,7 @@ namespace dbaui virtual ~OTableWindow(); // spaeter Constructor, siehe auch CreateListbox und FillListbox - virtual BOOL Init(); + virtual sal_Bool Init(); OJoinTableView* getTableView(); const OJoinTableView* getTableView() const; @@ -147,11 +147,11 @@ namespace dbaui void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ); String getTitle() const; - void SetBoldTitle( BOOL bBold ); + void SetBoldTitle( sal_Bool bBold ); void setActive(sal_Bool _bActive = sal_True); void Remove(); - BOOL IsActiveWindow(){ return m_bActive; } + sal_Bool IsActiveWindow(){ return m_bActive; } ::rtl::OUString GetTableName() const { return m_pData->GetTableName(); } ::rtl::OUString GetWinName() const { return m_pData->GetWinName(); } @@ -169,7 +169,7 @@ namespace dbaui inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > GetOriginalColumns() const { return m_pData->getColumns(); } inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetTable() const { return m_pData->getTable(); } - UINT16 GetSizingFlags() const { return m_nSizingFlags; } + sal_uInt16 GetSizingFlags() const { return m_nSizingFlags; } /** set the sizing flag to the direction @param _rPos The EndPosition after resizing. @@ -193,7 +193,7 @@ namespace dbaui virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); // habe ich Connections nach aussen ? - BOOL ExistsAConn() const; + sal_Bool ExistsAConn() const; void EnumValidFields(::std::vector< ::rtl::OUString>& arrstrFields); diff --git a/dbaccess/source/ui/inc/TableWindowData.hxx b/dbaccess/source/ui/inc/TableWindowData.hxx index aa44a8d6d5f5..9a3bd21f1664 100644 --- a/dbaccess/source/ui/inc/TableWindowData.hxx +++ b/dbaccess/source/ui/inc/TableWindowData.hxx @@ -80,16 +80,16 @@ namespace dbaui inline ::rtl::OUString GetWinName() const { return m_aWinName; } inline Point GetPosition() const { return m_aPosition; } inline Size GetSize() const { return m_aSize; } - inline BOOL IsShowAll() const { return m_bShowAll; } + inline sal_Bool IsShowAll() const { return m_bShowAll; } inline bool isQuery() const { return m_bIsQuery; } inline bool isValid() const { return m_bIsValid; } // it is either a table or query but it is known - BOOL HasPosition() const; - BOOL HasSize() const; + sal_Bool HasPosition() const; + sal_Bool HasSize() const; inline void SetWinName( const ::rtl::OUString& rWinName ) { m_aWinName = rWinName; } inline void SetPosition( const Point& rPos ) { m_aPosition=rPos; } inline void SetSize( const Size& rSize ) { m_aSize = rSize; } - inline void ShowAll( BOOL bAll ) { m_bShowAll = bAll; } + inline void ShowAll( sal_Bool bAll ) { m_bShowAll = bAll; } inline ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> getTable() const { ::osl::MutexGuard aGuard( m_aMutex ); return m_xTable; } inline ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess> getKeys() const { ::osl::MutexGuard aGuard( m_aMutex ); return m_xKeys; } diff --git a/dbaccess/source/ui/inc/TableWindowListBox.hxx b/dbaccess/source/ui/inc/TableWindowListBox.hxx index a3de07dac935..bf8fab0ac395 100644 --- a/dbaccess/source/ui/inc/TableWindowListBox.hxx +++ b/dbaccess/source/ui/inc/TableWindowListBox.hxx @@ -66,12 +66,12 @@ namespace dbaui Point m_aMousePos; OTableWindow* m_pTabWin; - ULONG m_nDropEvent; - ULONG m_nUiEvent; + sal_uLong m_nDropEvent; + sal_uLong m_nUiEvent; OJoinDropData m_aDropInfo; - BOOL m_bReallyScrolled : 1; - BOOL m_bDragSource : 1; + sal_Bool m_bReallyScrolled : 1; + sal_Bool m_bDragSource : 1; protected: virtual void LoseFocus(); diff --git a/dbaccess/source/ui/inc/TokenWriter.hxx b/dbaccess/source/ui/inc/TokenWriter.hxx index 637d6430d36e..e3b2ffcb3efb 100644 --- a/dbaccess/source/ui/inc/TokenWriter.hxx +++ b/dbaccess/source/ui/inc/TokenWriter.hxx @@ -124,8 +124,8 @@ namespace dbaui //for set the tablename void setSTableName(const ::rtl::OUString &_sTableName){ m_sDefaultTableName = _sTableName; } - virtual BOOL Write(); // Export - virtual BOOL Read(); // Import + virtual sal_Bool Write(); // Export + virtual sal_Bool Read(); // Import void initialize(const ::svx::ODataAccessDescriptor& _aDataDescriptor); void dispose(); @@ -161,8 +161,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); }; // ========================================================================= // HTML Im- und Export @@ -180,7 +180,7 @@ namespace dbaui char sIndent[nIndentMax+1]; sal_Int16 m_nIndent; #if OSL_DEBUG_LEVEL > 0 - BOOL m_bCheckFont; + sal_Bool m_bCheckFont; #endif void WriteHeader(); @@ -205,8 +205,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,_rxNumberF,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); }; // ========================================================================= @@ -242,8 +242,8 @@ namespace dbaui : ODatabaseImportExport(_rxConnection,NULL,_rM) {} - virtual BOOL Write(); - virtual BOOL Read(); + virtual sal_Bool Write(); + virtual sal_Bool Read(); private: using ODatabaseImportExport::initialize; diff --git a/dbaccess/source/ui/inc/UITools.hxx b/dbaccess/source/ui/inc/UITools.hxx index 6da9a71b2726..c4c8ccb96d74 100644 --- a/dbaccess/source/ui/inc/UITools.hxx +++ b/dbaccess/source/ui/inc/UITools.hxx @@ -292,7 +292,7 @@ namespace dbaui @param _xDatasource Asked for the properties. @param _rAutoIncrementValueEnabled - <OUT/> Set to TRUE when the property was set in the datasource. + <OUT/> Set to sal_True when the property was set in the datasource. @param _rsAutoIncrementValue <OUT/> Set to the value when the property was set in the datasource. */ @@ -304,7 +304,7 @@ namespace dbaui @param _xConnection Used to get the datasource as parent from the connection. @param _rAutoIncrementValueEnabled - <OUT/> Set to TRUE when the property was set in the datasource. + <OUT/> Set to sal_True when the property was set in the datasource. @param _rsAutoIncrementValue <OUT/> Set to the value when the property was set in the datasource. */ @@ -318,7 +318,7 @@ namespace dbaui @return The URL for the help agent to dispatch. */ - ::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const sal_Int32 _nHelpId); + ::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const rtl::OString& _rHelpId); /** set the evaluation flag at the number formatter @param _rxFormatter @@ -363,7 +363,7 @@ namespace dbaui @return RET_YES, RET_NO, RET_ALL */ - sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName); + sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const ::rtl::OUString& _sName); /** creates a new view from a query or table @param _sName diff --git a/dbaccess/source/ui/inc/UserAdminDlg.hxx b/dbaccess/source/ui/inc/UserAdminDlg.hxx index 3b510f9a8926..6315528cda88 100644 --- a/dbaccess/source/ui/inc/UserAdminDlg.hxx +++ b/dbaccess/source/ui/inc/UserAdminDlg.hxx @@ -59,7 +59,7 @@ namespace dbaui ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> m_xConnection; sal_Bool m_bOwnConnection; protected: - virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage); + virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage); public: OUserAdminDlg( Window* _pParent ,SfxItemSet* _pItems diff --git a/dbaccess/source/ui/inc/VertSplitView.hxx b/dbaccess/source/ui/inc/VertSplitView.hxx index 32f35779288e..b9d52b36fabd 100644 --- a/dbaccess/source/ui/inc/VertSplitView.hxx +++ b/dbaccess/source/ui/inc/VertSplitView.hxx @@ -40,7 +40,7 @@ namespace dbaui Window* m_pRight; sal_Bool m_bVertical; - void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground ); + void ImplInitSettings( sal_Bool bFont, sal_Bool bForeground, sal_Bool bBackground ); DECL_LINK( SplitHdl, Splitter* ); protected: virtual void DataChanged(const DataChangedEvent& rDCEvt); diff --git a/dbaccess/source/ui/inc/WCPage.hxx b/dbaccess/source/ui/inc/WCPage.hxx index d0f1eed2a761..f754e5d9429d 100644 --- a/dbaccess/source/ui/inc/WCPage.hxx +++ b/dbaccess/source/ui/inc/WCPage.hxx @@ -61,8 +61,8 @@ namespace dbaui OWizColumnSelect* m_pPage2; OWizNormalExtend* m_pPage3; - BOOL m_bPKeyAllowed; - BOOL m_bUseHeaderAllowed; + sal_Bool m_bPKeyAllowed; + sal_Bool m_bUseHeaderAllowed; DECL_LINK( AppendDataClickHdl, Button* ); @@ -75,17 +75,17 @@ namespace dbaui public: virtual void Reset(); virtual void ActivatePage(); - virtual BOOL LeavePage(); + virtual sal_Bool LeavePage(); virtual String GetTitle() const ; OCopyTable( Window * pParent ); virtual ~OCopyTable(); - inline BOOL IsOptionDefData() const { return m_aRB_DefData.IsChecked(); } - inline BOOL IsOptionDef() const { return m_aRB_Def.IsChecked(); } - inline BOOL IsOptionAppendData() const { return m_aRB_AppendData.IsChecked(); } - inline BOOL IsOptionView() const { return m_aRB_View.IsChecked(); } - inline BOOL UseHeaderLine() const { return m_aCB_UseHeaderLine.IsChecked(); } + inline sal_Bool IsOptionDefData() const { return m_aRB_DefData.IsChecked(); } + inline sal_Bool IsOptionDef() const { return m_aRB_Def.IsChecked(); } + inline sal_Bool IsOptionAppendData() const { return m_aRB_AppendData.IsChecked(); } + inline sal_Bool IsOptionView() const { return m_aRB_View.IsChecked(); } + inline sal_Bool UseHeaderLine() const { return m_aCB_UseHeaderLine.IsChecked(); } String GetKeyName() const { return m_edKeyName.GetText(); } void setCreateStyleAction(); @@ -95,7 +95,7 @@ namespace dbaui } inline void disallowUseHeaderLine() { - m_bUseHeaderAllowed = FALSE; + m_bUseHeaderAllowed = sal_False; m_aCB_UseHeaderLine.Disable(); } diff --git a/dbaccess/source/ui/inc/WColumnSelect.hxx b/dbaccess/source/ui/inc/WColumnSelect.hxx index 8c0f16228bd2..a0819255f615 100644 --- a/dbaccess/source/ui/inc/WColumnSelect.hxx +++ b/dbaccess/source/ui/inc/WColumnSelect.hxx @@ -83,7 +83,7 @@ namespace dbaui void enableButtons(); - USHORT adjustColumnPosition(ListBox* _pLeft, + sal_uInt16 adjustColumnPosition(ListBox* _pLeft, const ::rtl::OUString& _sColumnName, ODatabaseExport::TColumnVector::size_type nCurrentPos, const ::comphelper::TStringMixEqualFunctor& _aCase); diff --git a/dbaccess/source/ui/inc/adtabdlg.hxx b/dbaccess/source/ui/inc/adtabdlg.hxx index 214e5f9113e3..d2d7c6d8a98e 100644 --- a/dbaccess/source/ui/inc/adtabdlg.hxx +++ b/dbaccess/source/ui/inc/adtabdlg.hxx @@ -109,7 +109,7 @@ namespace dbaui IAddTableDialogContext& _rContext ); private: - virtual BOOL Close(); + virtual sal_Bool Close(); bool impl_isAddAllowed(); void impl_addTable(); diff --git a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx index 092afbb98108..6afc8f6ddd1c 100644 --- a/dbaccess/source/ui/inc/advancedsettingsdlg.hxx +++ b/dbaccess/source/ui/inc/advancedsettingsdlg.hxx @@ -59,7 +59,7 @@ namespace dbaui SfxItemSet* m_pItemSet; protected: - virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage); + virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage); public: AdvancedSettingsDialog( Window* _pParent diff --git a/dbaccess/source/ui/inc/brwctrlr.hxx b/dbaccess/source/ui/inc/brwctrlr.hxx index ccc53bc650c7..47c510a68840 100644 --- a/dbaccess/source/ui/inc/brwctrlr.hxx +++ b/dbaccess/source/ui/inc/brwctrlr.hxx @@ -123,7 +123,7 @@ namespace dbaui // members for asynchronous load operations FormControllerImpl* m_pFormControllerImpl; // implementing the XFormController - ULONG m_nPendingLoadFinished; // the event used to tell ourself that the load is finished + sal_uLong m_nPendingLoadFinished; // the event used to tell ourself that the load is finished sal_uInt16 m_nFormActionNestingLevel; // see enter-/leaveFormAction sal_Bool m_bLoadCanceled : 1; // the load was canceled somehow @@ -255,7 +255,8 @@ namespace dbaui // (probably this needs not to be overloaded, but you may return anything you want as long as it // supports the ::com::sun::star::form::DatabaseForm service. For instance you may want to create an adapter here which // is synchronized with a foreign ::com::sun::star::form::DatabaseForm you got elsewhere) - virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm) = 0; + virtual sal_Bool InitializeForm( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ) = 0; // called immediately after a successfull CreateForm // do any initialization (data source etc.) here. the form should be fully functional after that. // return sal_False if you didn't succeed (don't throw exceptions, they won't be caught) @@ -326,8 +327,11 @@ namespace dbaui /// loads or reloads the form virtual sal_Bool reloadForm(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XLoadable >& _rxLoadable); - virtual sal_Bool preReloadForm(){ return sal_False; } - virtual void postReloadForm(){} + virtual sal_Bool preReloadForm(){ return sal_False; } + virtual void postReloadForm(){} + + ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > + createParser_nothrow(); private: void setCurrentModified( sal_Bool _bSet ); @@ -347,7 +351,6 @@ namespace dbaui void addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel); void impl_checkForCannotSelectUnfiltered( const ::dbtools::SQLExceptionInfo& _rError ); - ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer > createParser_nothrow(); // time to check the CUT/COPY/PASTE-slot-states DECL_LINK( OnInvalidateClipboard, AutoTimer* ); diff --git a/dbaccess/source/ui/inc/charsetlistbox.hxx b/dbaccess/source/ui/inc/charsetlistbox.hxx index 0f581e61b670..c0fde800c2e4 100644 --- a/dbaccess/source/ui/inc/charsetlistbox.hxx +++ b/dbaccess/source/ui/inc/charsetlistbox.hxx @@ -53,7 +53,7 @@ namespace dbaui ~CharSetListBox(); void SelectEntryByIanaName( const String& _rIanaName ); - bool StoreSelectedCharSet( SfxItemSet& _rSet, const USHORT _nItemId ); + bool StoreSelectedCharSet( SfxItemSet& _rSet, const sal_uInt16 _nItemId ); private: OCharsetDisplay m_aCharSets; diff --git a/dbaccess/source/ui/inc/curledit.hxx b/dbaccess/source/ui/inc/curledit.hxx index 5983f252c8e5..1257cf31f4f1 100644 --- a/dbaccess/source/ui/inc/curledit.hxx +++ b/dbaccess/source/ui/inc/curledit.hxx @@ -52,10 +52,10 @@ class OConnectionURLEdit : public Edit m_pTypeCollection; FixedText* m_pForcedPrefix; String m_sSaveValueNoPrefix; - BOOL m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not + sal_Bool m_bShowPrefix; // when <TRUE> the prefix will be visible, otherwise not public: - OConnectionURLEdit(Window* pParent, const ResId& rResId,BOOL _bShowPrefix = FALSE); + OConnectionURLEdit(Window* pParent, const ResId& rResId,sal_Bool _bShowPrefix = sal_False); ~OConnectionURLEdit(); public: @@ -69,7 +69,7 @@ public: @param _bShowPrefix If <TRUE/> than the prefix will be visible, otherwise not. */ - void ShowPrefix(BOOL _bShowPrefix); + void ShowPrefix(sal_Bool _bShowPrefix); /// get the currently set text, excluding the prefix indicating the type virtual String GetTextNoPrefix() const; /// set a new text, leave the current prefix unchanged diff --git a/dbaccess/source/ui/inc/dbadmin.hxx b/dbaccess/source/ui/inc/dbadmin.hxx index c01550fb8647..a01314d188c1 100644 --- a/dbaccess/source/ui/inc/dbadmin.hxx +++ b/dbaccess/source/ui/inc/dbadmin.hxx @@ -62,7 +62,7 @@ private: sal_Bool m_bApplied : 1; /// sal_True if any changes have been applied while the dialog was executing sal_Bool m_bUIEnabled : 1; /// <TRUE/> if the UI is enabled, false otherwise. Cannot be switched back to <TRUE/>, once it is <FALSE/> - USHORT m_nMainPageID; + sal_uInt16 m_nMainPageID; public: /** ctor. The itemset given should have been created by <method>createItemSet</method> and should be destroyed @@ -104,9 +104,9 @@ public: protected: // adds a new detail page and remove all the old ones - void addDetailPage(USHORT _nPageId,USHORT _nTextId,CreateTabPage pCreateFunc); + void addDetailPage(sal_uInt16 _nPageId,sal_uInt16 _nTextId,CreateTabPage pCreateFunc); - virtual void PageCreated(USHORT _nId, SfxTabPage& _rPage); + virtual void PageCreated(sal_uInt16 _nId, SfxTabPage& _rPage); virtual short Ok(); protected: diff --git a/dbaccess/source/ui/inc/dbtreelistbox.hxx b/dbaccess/source/ui/inc/dbtreelistbox.hxx index 4a7cbf0131c6..86e8ee277226 100644 --- a/dbaccess/source/ui/inc/dbtreelistbox.hxx +++ b/dbaccess/source/ui/inc/dbtreelistbox.hxx @@ -132,13 +132,13 @@ namespace dbaui virtual void InitEntry( SvLBoxEntry* pEntry, const XubString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp, SvLBoxButtonKind eButtonKind); // enable editing for tables/views and queries - virtual BOOL EditingEntry( SvLBoxEntry* pEntry, Selection& ); - virtual BOOL EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); + virtual sal_Bool EditingEntry( SvLBoxEntry* pEntry, Selection& ); + virtual sal_Bool EditedEntry( SvLBoxEntry* pEntry, const XubString& rNewText ); - virtual BOOL DoubleClickHdl(); + virtual sal_Bool DoubleClickHdl(); virtual PopupMenu* CreateContextMenu( void ); - virtual void ExcecuteContextMenuAction( USHORT nSelectedPopupEntry ); + virtual void ExcecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ); void SetEnterKeyHdl(const Link& rNewHdl) {m_aEnterKeyHdl = rNewHdl;} diff --git a/dbaccess/source/ui/inc/dbu_dlg.hrc b/dbaccess/source/ui/inc/dbu_dlg.hrc index 7e1b7df0d100..b107a0014dbb 100644 --- a/dbaccess/source/ui/inc/dbu_dlg.hrc +++ b/dbaccess/source/ui/inc/dbu_dlg.hrc @@ -64,24 +64,24 @@ #define STR_ADABAS_ERROR_SYSTEMTABLES RID_STR_DLG_START + 6 #define STR_ERROR_PASSWORDS_NOT_IDENTICAL RID_STR_DLG_START + 7 #define STR_INDEXDESIGN_DOUBLE_COLUMN_NAME RID_STR_DLG_START + 8 -#define STR_DATASOURCE_DEFAULTNAME RID_STR_DLG_START + 9 -#define STR_ERR_EMPTY_DSN_NAME RID_STR_DLG_START + 10 + // FREE + // FREE #define STR_ERR_USE_CONNECT_TO RID_STR_DLG_START + 11 #define STR_ALREADYEXISTOVERWRITE RID_STR_DLG_START + 12 -#define STR_QUERY_DROP_ALL RID_STR_DLG_START + 13 + // FREE #define STR_INDEX_NAME_ALREADY_USED RID_STR_DLG_START + 14 #define STR_ASK_FOR_DIRECTORY_CREATION RID_STR_DLG_START + 15 #define STR_COULD_NOT_CREATE_DIRECTORY RID_STR_DLG_START + 16 -#define STR_ADDRESSBOOK_SYSTEM RID_STR_DLG_START + 17 -#define STR_ADDRESSBOOK_MOZILLA RID_STR_DLG_START + 18 -#define STR_ADDRESSBOOK_EVOLUTION RID_STR_DLG_START + 19 // FREE -#define STR_ADDRESSBOOK_LDAP RID_STR_DLG_START + 21 -#define STR_ADDRESSBOOK_OUTLOOK RID_STR_DLG_START + 22 + // FREE + // FREE + // FREE + // FREE + // FREE #define STR_COMMAND_EXECUTED_SUCCESSFULLY RID_STR_DLG_START + 23 #define STR_DIRECTSQL_CONNECTIONLOST RID_STR_DLG_START + 24 -#define STR_HINT_READONLY_CONNECTION RID_STR_DLG_START + 25 -#define STR_HINT_CONNECTION_NOT_CAPABLE RID_STR_DLG_START + 26 + // FREE + // FREE #define STR_USERADMIN_NOT_AVAILABLE RID_STR_DLG_START + 27 #define STR_TAB_INDEX_SORTORDER RID_STR_DLG_START + 28 #define STR_TAB_INDEX_FIELD RID_STR_DLG_START + 29 @@ -110,7 +110,7 @@ #define STR_NO_ADABASE_DATASOURCES RID_STR_DLG_START + 55 #define STR_NO_ADDITIONAL_SETTINGS RID_STR_DLG_START + 56 #define STR_HOSTNAME RID_STR_DLG_START + 57 -#define STR_ADDRESSBOOK_THUNDERBIRD RID_STR_DLG_START + 58 + // FREE #define STR_MOZILLA_PROFILE_NAME RID_STR_DLG_START + 59 #define STR_THUNDERBIRD_PROFILE_NAME RID_STR_DLG_START + 60 #define STR_EXPLAN_STRINGCONVERSION_ERROR RID_STR_DLG_START + 61 diff --git a/dbaccess/source/ui/inc/dbu_resource.hrc b/dbaccess/source/ui/inc/dbu_resource.hrc index c08d6597e829..7ba85bc6dfcb 100644 --- a/dbaccess/source/ui/inc/dbu_resource.hrc +++ b/dbaccess/source/ui/inc/dbu_resource.hrc @@ -118,7 +118,7 @@ #define DLG_DATABASE_WIZARD RID_DIALOG_START + 29 #define RID_EXTENSION_NOT_PRESENT_DLG RID_DIALOG_START + 30 #define DLG_TEXT_CONNECTION_SETTINGS RID_DIALOG_START + 31 - +#define DLG_TABLE_FILTER RID_DIALOG_START + 32 //======================================================================== // tab pages diff --git a/dbaccess/source/ui/inc/dlgattr.hxx b/dbaccess/source/ui/inc/dlgattr.hxx index a1a3c82ec76a..e4fe6e158c96 100644 --- a/dbaccess/source/ui/inc/dlgattr.hxx +++ b/dbaccess/source/ui/inc/dlgattr.hxx @@ -50,10 +50,10 @@ namespace dbaui SvxNumberInfoItem* pNumberInfoItem; public: - SbaSbAttrDlg( Window * pParent, const SfxItemSet*, SvNumberFormatter*, USHORT nFlags = TP_ATTR_CHAR , BOOL bRow = FALSE); + SbaSbAttrDlg( Window * pParent, const SfxItemSet*, SvNumberFormatter*, sal_uInt16 nFlags = TP_ATTR_CHAR , sal_Bool bRow = sal_False); ~SbaSbAttrDlg(); - virtual void PageCreated( USHORT nPageId, SfxTabPage& rTabPage ); + virtual void PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPage ); }; //......................................................................... } // namespace dbaui diff --git a/dbaccess/source/ui/inc/dlgsize.hxx b/dbaccess/source/ui/inc/dlgsize.hxx index 3617c72e4a47..7b2e0152d226 100644 --- a/dbaccess/source/ui/inc/dlgsize.hxx +++ b/dbaccess/source/ui/inc/dlgsize.hxx @@ -58,7 +58,7 @@ namespace dbaui HelpButton aPB_HELP; public: - DlgSize( Window * pParent, sal_Int32 nVal, BOOL bRow, sal_Int32 _nAlternativeStandard = -1 ); + DlgSize( Window * pParent, sal_Int32 nVal, sal_Bool bRow, sal_Int32 _nAlternativeStandard = -1 ); ~DlgSize(); sal_Int32 GetValue(); diff --git a/dbaccess/source/ui/inc/dsitems.hxx b/dbaccess/source/ui/inc/dsitems.hxx index 7437d8b54b6c..9cc4d85808c8 100644 --- a/dbaccess/source/ui/inc/dsitems.hxx +++ b/dbaccess/source/ui/inc/dsitems.hxx @@ -93,6 +93,7 @@ typedef sal_Int32 ItemID; #define DSID_ESCAPE_DATETIME 57 #define DSID_NAMED_PIPE 58 #define DSID_PRIMARY_KEY_SUPPORT 59 +#define DSID_MAX_ROW_SCAN 60 // don't forget to adjust DSID_LAST_ITEM_ID below! @@ -100,7 +101,7 @@ typedef sal_Int32 ItemID; //= item range. Adjust this if you introduce new items above #define DSID_FIRST_ITEM_ID DSID_NAME -#define DSID_LAST_ITEM_ID DSID_PRIMARY_KEY_SUPPORT +#define DSID_LAST_ITEM_ID DSID_MAX_ROW_SCAN #endif // _DBAUI_DATASOURCEITEMS_HXX_ diff --git a/dbaccess/source/ui/inc/dsmeta.hxx b/dbaccess/source/ui/inc/dsmeta.hxx index a7a0d5c6c80b..5efa09c0c3cb 100644 --- a/dbaccess/source/ui/inc/dsmeta.hxx +++ b/dbaccess/source/ui/inc/dsmeta.hxx @@ -133,6 +133,7 @@ namespace dbaui || has( DSID_IGNORECURRENCY ) || has( DSID_ESCAPE_DATETIME ) || has( DSID_PRIMARY_KEY_SUPPORT ) + || has( DSID_MAX_ROW_SCAN ) ; } diff --git a/dbaccess/source/ui/inc/exsrcbrw.hxx b/dbaccess/source/ui/inc/exsrcbrw.hxx index 2fbd64bc99d5..34b6e96ec86d 100644 --- a/dbaccess/source/ui/inc/exsrcbrw.hxx +++ b/dbaccess/source/ui/inc/exsrcbrw.hxx @@ -97,7 +97,7 @@ namespace dbaui ~SbaExternalSourceBrowser(); virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > CreateForm(); - virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm); + virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ); virtual sal_Bool LoadForm(); diff --git a/dbaccess/source/ui/inc/imageprovider.hxx b/dbaccess/source/ui/inc/imageprovider.hxx index b6563801c8c1..e3b5489203b0 100644 --- a/dbaccess/source/ui/inc/imageprovider.hxx +++ b/dbaccess/source/ui/inc/imageprovider.hxx @@ -125,7 +125,7 @@ namespace dbaui the resource ID image to be used for the object type. Must be fed into a ModuleRes instance to actually load the image. */ - USHORT getDefaultImageResourceID( + sal_uInt16 getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType ); diff --git a/dbaccess/source/ui/inc/listviewitems.hxx b/dbaccess/source/ui/inc/listviewitems.hxx index 6d5394667111..3cf5ba748681 100644 --- a/dbaccess/source/ui/inc/listviewitems.hxx +++ b/dbaccess/source/ui/inc/listviewitems.hxx @@ -52,7 +52,7 @@ namespace dbaui { } - virtual USHORT IsA(); + virtual sal_uInt16 IsA(); virtual void Paint(const Point& rPos, SvLBox& rDev, sal_uInt16 nFlags, SvLBoxEntry* pEntry); virtual void InitViewData( SvLBox* pView,SvLBoxEntry* pEntry, SvViewDataItem* _pViewData); diff --git a/dbaccess/source/ui/inc/moduledbu.hxx b/dbaccess/source/ui/inc/moduledbu.hxx index a57513f6c5e7..4297cdef693a 100644 --- a/dbaccess/source/ui/inc/moduledbu.hxx +++ b/dbaccess/source/ui/inc/moduledbu.hxx @@ -94,7 +94,7 @@ public: class ModuleRes : public ::ResId { public: - ModuleRes(USHORT _nId) : ResId(_nId, *OModule::getResManager()) { } + ModuleRes(sal_uInt16 _nId) : ResId(_nId, *OModule::getResManager()) { } }; //......................................................................... diff --git a/dbaccess/source/ui/inc/opendoccontrols.hxx b/dbaccess/source/ui/inc/opendoccontrols.hxx index 3e0e53e2d653..b4c73bfb9521 100644 --- a/dbaccess/source/ui/inc/opendoccontrols.hxx +++ b/dbaccess/source/ui/inc/opendoccontrols.hxx @@ -66,7 +66,7 @@ namespace dbaui { private: typedef ::std::pair< String, String > StringPair; - typedef ::std::map< USHORT, StringPair > MapIndexToStringPair; + typedef ::std::map< sal_uInt16, StringPair > MapIndexToStringPair; ::rtl::OUString m_sModule; MapIndexToStringPair m_aURLs; @@ -80,7 +80,7 @@ namespace dbaui protected: virtual void RequestHelp( const HelpEvent& _rHEvt ); - StringPair impl_getDocumentAtIndex( USHORT _nListIndex, bool _bSystemNotation = false ) const; + StringPair impl_getDocumentAtIndex( sal_uInt16 _nListIndex, bool _bSystemNotation = false ) const; private: void impl_init( const sal_Char* _pAsciiModuleName ); diff --git a/dbaccess/source/ui/inc/propertystorage.hxx b/dbaccess/source/ui/inc/propertystorage.hxx index ef88f585631e..689e7998f6cf 100644 --- a/dbaccess/source/ui/inc/propertystorage.hxx +++ b/dbaccess/source/ui/inc/propertystorage.hxx @@ -63,7 +63,7 @@ namespace dbaui //==================================================================== //= SetItemPropertyStorage //==================================================================== - typedef USHORT ItemId; + typedef sal_uInt16 ItemId; /** a PropertyStorage implementation which stores the value in an item set */ diff --git a/dbaccess/source/ui/inc/querycontroller.hxx b/dbaccess/source/ui/inc/querycontroller.hxx index 0f2813cd0b05..363c5517050e 100644 --- a/dbaccess/source/ui/inc/querycontroller.hxx +++ b/dbaccess/source/ui/inc/querycontroller.hxx @@ -100,7 +100,7 @@ namespace dbaui sal_Int32 m_nVisibleRows; // which rows the selection browse should show sal_Int32 m_nSplitPos; // the position of the splitter sal_Int32 m_nCommandType; // the type of the object we're designing - sal_Bool m_bGraphicalDesign; // are we in the graphical design mode (TRUE) or in the text design (FALSE)? + sal_Bool m_bGraphicalDesign; // are we in the graphical design mode (sal_True) or in the text design (sal_False)? sal_Bool m_bDistinct; // true when you want "select distinct" otherwise false sal_Bool m_bViewAlias; // show the alias row in the design view sal_Bool m_bViewTable; // show the table row in the design view diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx index bfb10cae1924..2e4dd3c9e662 100644 --- a/dbaccess/source/ui/inc/queryfilter.hxx +++ b/dbaccess/source/ui/inc/queryfilter.hxx @@ -115,10 +115,10 @@ namespace dbaui DECL_LINK( ListSelectHdl, ListBox * ); DECL_LINK( ListSelectCompHdl, ListBox * ); - void SetLine( USHORT nIdx,const ::com::sun::star::beans::PropertyValue& _rItem,sal_Bool _bOr ); + void SetLine( sal_uInt16 nIdx,const ::com::sun::star::beans::PropertyValue& _rItem,sal_Bool _bOr ); void EnableLines(); sal_Int32 GetOSQLPredicateType( const String& _rSelectedPredicate ) const; - USHORT GetSelectionPos(sal_Int32 eType,const ListBox& rListBox) const; + sal_uInt16 GetSelectionPos(sal_Int32 eType,const ListBox& rListBox) const; sal_Bool getCondition(const ListBox& _rField,const ListBox& _rComp,const Edit& _rValue,::com::sun::star::beans::PropertyValue& _rFilter) const; void fillLines(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > >& _aValues); diff --git a/dbaccess/source/ui/inc/sbagrid.hxx b/dbaccess/source/ui/inc/sbagrid.hxx index 0f91c8fa06d8..0d3dc746fa2b 100644 --- a/dbaccess/source/ui/inc/sbagrid.hxx +++ b/dbaccess/source/ui/inc/sbagrid.hxx @@ -240,7 +240,7 @@ namespace dbaui sal_Int32 m_nAsyncDropEvent; - USHORT m_nCurrentActionColId; + sal_uInt16 m_nCurrentActionColId; // ui actions (e.g. a context menu) may be performed on columns which aren't the current one // and aren't selected, so we have to track this column id diff --git a/dbaccess/source/ui/inc/singledoccontroller.hxx b/dbaccess/source/ui/inc/singledoccontroller.hxx new file mode 100755 index 000000000000..c738bd94e81c --- /dev/null +++ b/dbaccess/source/ui/inc/singledoccontroller.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef DBAUI_SINGLEDOCCONTROLLER_HXX +#define DBAUI_SINGLEDOCCONTROLLER_HXX + +#include "dbsubcomponentcontroller.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/document/XUndoManagerSupplier.hpp> +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> + +class SfxUndoAction; +class SfxUndoManager; + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + //================================================================================================================== + //= OSingleDocumentController + //================================================================================================================== + struct OSingleDocumentController_Data; + typedef ::cppu::ImplInheritanceHelper1 < DBSubComponentController + , ::com::sun::star::document::XUndoManagerSupplier + > OSingleDocumentController_Base; + class OSingleDocumentController : public OSingleDocumentController_Base + { + protected: + OSingleDocumentController( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxORB ); + virtual ~OSingleDocumentController(); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + public: + /// need for undo's and redo's + SfxUndoManager& GetUndoManager() const; + + /// complete clears the Undo/Redo stacks + void ClearUndoManager(); + + /** addUndoActionAndInvalidate adds an undo action to the undoManager, + additionally invalidates the UNDO and REDO slot + @param pAction the undo action to add + */ + void addUndoActionAndInvalidate( SfxUndoAction* pAction ); + + // OGenericUnoController + virtual FeatureState GetState( sal_uInt16 nId ) const; + virtual void Execute( sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs ); + + // XUndoManagerSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::document::XUndoManager > SAL_CALL getUndoManager( ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( ::com::sun::star::uno::RuntimeException ); + + private: + ::std::auto_ptr< OSingleDocumentController_Data > m_pData; + }; + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... + +#endif // DBAUI_SINGLEDOCCONTROLLER_HXX diff --git a/dbaccess/source/ui/inc/sqledit.hxx b/dbaccess/source/ui/inc/sqledit.hxx index 3ad5a4d93460..2e98ce3ac3c6 100644 --- a/dbaccess/source/ui/inc/sqledit.hxx +++ b/dbaccess/source/ui/inc/sqledit.hxx @@ -44,8 +44,8 @@ namespace dbaui Link m_lnkTextModifyHdl; String m_strOrigText; // wird beim Undo wiederhergestellt OQueryTextView* m_pView; - BOOL m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt - BOOL m_bStopTimer; + sal_Bool m_bAccelAction; // Wird bei Cut, Copy, Paste gesetzt + sal_Bool m_bStopTimer; utl::SourceViewConfig m_SourceViewConfig; svtools::ColorConfig m_ColorConfig; @@ -70,7 +70,7 @@ namespace dbaui using MultiLineEditSyntaxHighlight::SetText; // own functionality - BOOL IsInAccelAct(); + sal_Bool IsInAccelAct(); void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; } // bitte nicht SetModifyHdl benutzen, den brauche ich selber, der hier wird von dem damit gesetzten Handler diff --git a/dbaccess/source/ui/inc/unodatbr.hxx b/dbaccess/source/ui/inc/unodatbr.hxx index be184aa8acc2..ad026e81c9f2 100644 --- a/dbaccess/source/ui/inc/unodatbr.hxx +++ b/dbaccess/source/ui/inc/unodatbr.hxx @@ -120,12 +120,12 @@ namespace dbaui Splitter* m_pSplitter; SvLBoxTreeList* m_pTreeModel; // contains the datasources of the registry SvLBoxEntry* m_pCurrentlyDisplayed; - ULONG m_nAsyncDrop; + sal_uLong m_nAsyncDrop; - sal_Int16 m_nBorder; // TRUE when border should be shown + sal_Int16 m_nBorder; // sal_True when border should be shown sal_Bool m_bQueryEscapeProcessing : 1; // the escape processing flag of the query currently loaded (if any) - sal_Bool m_bShowMenu; // if TRUE the menu should be visible otherwise not + sal_Bool m_bShowMenu; // if sal_True the menu should be visible otherwise not sal_Bool m_bInSuspend; sal_Bool m_bEnableBrowser; ::boost::optional< bool > @@ -222,7 +222,7 @@ namespace dbaui protected: // SbaXDataBrowserController overridables - virtual sal_Bool InitializeForm(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet > & xForm); + virtual sal_Bool InitializeForm( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& i_formProperties ); virtual sal_Bool InitializeGridModel(const ::com::sun::star::uno::Reference< ::com::sun::star::form::XFormComponent > & xGrid); virtual sal_Bool preReloadForm(); @@ -485,6 +485,10 @@ namespace dbaui of the load process */ void initializePreviewMode(); + + /** checks whether the Order/Filter clauses set at our row set are valid, removes them if not so + */ + void impl_sanitizeRowSetClauses_nothrow(); }; // ......................................................................... diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx index c31a2da8c9e0..e0b0dd4d8a34 100644 --- a/dbaccess/source/ui/misc/DExport.cxx +++ b/dbaccess/source/ui/misc/DExport.cxx @@ -116,10 +116,10 @@ ODatabaseExport::ODatabaseExport(sal_Int32 nRows, ,m_nRows(1) ,m_nRowCount(0) ,m_nDefToken( gsl_getSystemTextEncoding() ) - ,m_bError(FALSE) - ,m_bInTbl(FALSE) - ,m_bHead(TRUE) - ,m_bDontAskAgain(FALSE) + ,m_bError(sal_False) + ,m_bInTbl(sal_False) + ,m_bHead(sal_True) + ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(_bAutoIncrementEnabled) ,m_bFoundTable(sal_False) ,m_bCheckOnly(sal_False) @@ -175,7 +175,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection, ,m_nDefToken( gsl_getSystemTextEncoding() ) ,m_bError(sal_False) ,m_bInTbl(sal_False) - ,m_bHead(TRUE) + ,m_bHead(sal_True) ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(sal_False) ,m_bFoundTable(sal_False) @@ -785,9 +785,9 @@ void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException OSQLWarningBox aBox( NULL, aMsg, WB_YES_NO | WB_DEF_NO ); if (aBox.Execute() == RET_YES) - m_bDontAskAgain = TRUE; + m_bDontAskAgain = sal_True; else - m_bError = TRUE; + m_bError = sal_True; } } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/HtmlReader.cxx b/dbaccess/source/ui/misc/HtmlReader.cxx index 414fc9e6cb4e..d4b4c4c5e329 100644 --- a/dbaccess/source/ui/misc/HtmlReader.cxx +++ b/dbaccess/source/ui/misc/HtmlReader.cxx @@ -111,7 +111,7 @@ OHTMLReader::OHTMLReader(SvStream& rIn,const SharedConnection& _rxConnection, DBG_CTOR(OHTMLReader,NULL); SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); } // --------------------------------------------------------------------------- OHTMLReader::OHTMLReader(SvStream& rIn, @@ -133,7 +133,7 @@ OHTMLReader::OHTMLReader(SvStream& rIn, DBG_CTOR(OHTMLReader,NULL); SetSrcEncoding( GetExtendedCompatibilityTextEncoding( RTL_TEXTENCODING_ISO_8859_1 ) ); // If the file starts with a BOM, switch to UCS2. - SetSwitchToUCS2( TRUE ); + SetSwitchToUCS2( sal_True ); } // --------------------------------------------------------------------------- OHTMLReader::~OHTMLReader() @@ -186,7 +186,7 @@ void OHTMLReader::NextToken( int nToken ) case HTML_THEAD_ON: case HTML_TBODY_ON: { - sal_uInt32 nTell = rInput.Tell(); // verndert vielleicht die Position des Streams + sal_uInt32 nTell = rInput.Tell(); // ver�ndert vielleicht die Position des Streams if ( !m_xTable.is() ) {// erste Zeile als Header verwenden m_bError = !CreateTable(nToken); @@ -326,7 +326,7 @@ void OHTMLReader::NextToken( int nToken ) void OHTMLReader::fetchOptions() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLReader::fetchOptions" ); - m_bInTbl = TRUE; + m_bInTbl = sal_True; const HTMLOptions* options = GetOptions(); sal_Int16 nArrLen = options->Count(); for ( sal_Int16 i = 0; i < nArrLen; i++ ) @@ -488,7 +488,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TABLEDATA_ON: case HTML_TABLEHEADER_ON: TableDataOn(eVal); - bTableHeader = TRUE; + bTableHeader = sal_True; break; case HTML_TABLEDATA_OFF: case HTML_TABLEHEADER_OFF: @@ -513,7 +513,7 @@ sal_Bool OHTMLReader::CreateTable(int nToken) case HTML_TITLE_ON: case HTML_CAPTION_ON: - bCaption = TRUE; + bCaption = sal_True; break; case HTML_TITLE_OFF: case HTML_CAPTION_OFF: diff --git a/dbaccess/source/ui/misc/RowSetDrop.cxx b/dbaccess/source/ui/misc/RowSetDrop.cxx index c8a2664f3771..4ac330a3fc87 100644 --- a/dbaccess/source/ui/misc/RowSetDrop.cxx +++ b/dbaccess/source/ui/misc/RowSetDrop.cxx @@ -107,19 +107,19 @@ void ORowSetImportExport::initialize() } } // ----------------------------------------------------------------------------- -BOOL ORowSetImportExport::Write() +sal_Bool ORowSetImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORowSetImportExport::Write" ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ORowSetImportExport::Read() +sal_Bool ORowSetImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORowSetImportExport::Read" ); // check if there is any column to copy if(::std::find_if(m_aColumnMapping.begin(),m_aColumnMapping.end(), ::std::bind2nd(::std::greater<sal_Int32>(),0)) == m_aColumnMapping.end()) - return FALSE; + return sal_False; sal_Bool bContinue = sal_True; if(m_aSelection.getLength()) { @@ -165,7 +165,7 @@ BOOL ORowSetImportExport::Read() } } } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- sal_Bool ORowSetImportExport::insertNewRow() diff --git a/dbaccess/source/ui/misc/RtfReader.cxx b/dbaccess/source/ui/misc/RtfReader.cxx index c6132232b1c8..fb25f77d70f1 100644 --- a/dbaccess/source/ui/misc/RtfReader.cxx +++ b/dbaccess/source/ui/misc/RtfReader.cxx @@ -162,7 +162,7 @@ void ORTFReader::NextToken( int nToken ) bool bInsertRow = true; if ( !m_xTable.is() ) // erste Zeile als Header verwenden { - sal_uInt32 nTell = rInput.Tell(); // verndert vielleicht die Position des Streams + sal_uInt32 nTell = rInput.Tell(); // ver�ndert vielleicht die Position des Streams m_bError = !CreateTable(nToken); bInsertRow = m_bAppendFirstLine; @@ -192,7 +192,7 @@ void ORTFReader::NextToken( int nToken ) eraseTokens(); } - m_bInTbl = TRUE; // jetzt befinden wir uns in einer Tabellenbeschreibung + m_bInTbl = sal_True; // jetzt befinden wir uns in einer Tabellenbeschreibung break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: @@ -215,7 +215,7 @@ void ORTFReader::NextToken( int nToken ) } break; case RTF_ROW: - // es kann vorkommen, da die letzte Celle nicht mit \cell abgeschlossen ist + // es kann vorkommen, da� die letzte Celle nicht mit \cell abgeschlossen ist try { insertValueIntoColumn(); @@ -249,7 +249,7 @@ void ORTFReader::NextToken( int nToken ) } break; case RTF_INTBL: - m_bInTbl = TRUE; + m_bInTbl = sal_True; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: @@ -294,7 +294,7 @@ sal_Bool ORTFReader::CreateTable(int nToken) if(m_bInTbl) aColumnName.Erase(); - m_bInTbl = TRUE; + m_bInTbl = sal_True; break; case RTF_TEXTTOKEN: case RTF_SINGLECHAR: diff --git a/dbaccess/source/ui/misc/TokenWriter.cxx b/dbaccess/source/ui/misc/TokenWriter.cxx index 3f7daabd1674..ae08c7a38630 100644 --- a/dbaccess/source/ui/misc/TokenWriter.cxx +++ b/dbaccess/source/ui/misc/TokenWriter.cxx @@ -362,24 +362,24 @@ void ODatabaseImportExport::initialize() m_bInInitialize = sal_False; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Write() +sal_Bool ODatabaseImportExport::Write() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- -BOOL ODatabaseImportExport::Read() +sal_Bool ODatabaseImportExport::Read() { if ( m_bNeedToReInitialize ) { if ( !m_bInInitialize ) initialize(); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void ODatabaseImportExport::impl_initializeRowMember_throw() @@ -395,7 +395,7 @@ void ODatabaseImportExport::impl_initializeRowMember_throw() } } //====================================================================== -BOOL ORTFImportExport::Write() +sal_Bool ORTFImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORTFImportExport::Write" ); ODatabaseImportExport::Write(); @@ -403,10 +403,10 @@ BOOL ORTFImportExport::Write() (*m_pStream) << OOO_STRING_SVTOOLS_RTF_ANSI << ODatabaseImportExport::sNewLine; rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252; - BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); sal_Int32 nColor = 0; if(m_xObject.is()) @@ -570,7 +570,7 @@ BOOL ORTFImportExport::Write() } (*m_pStream) << '}' << ODatabaseImportExport::sNewLine; - (*m_pStream) << (BYTE) 0; + (*m_pStream) << (sal_uInt8) 0; return ((*m_pStream).GetError() == SVSTREAM_OK); } // ----------------------------------------------------------------------------- @@ -593,10 +593,10 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou (*m_pStream) << ODatabaseImportExport::sNewLine; } - const BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - const BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - const BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - const BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + const sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + const sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + const sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + const sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); static const ::rtl::OString aFS2("\\fs20\\f1\\cf0\\cb1"); ::comphelper::ComponentContext aContext(m_xFactory); Reference< XRowSet > xRowSet(m_xRow,UNO_QUERY); @@ -641,7 +641,7 @@ void ORTFImportExport::appendRow(::rtl::OString* pHorzChar,sal_Int32 _nColumnCou ++k; } //------------------------------------------------------------------- -BOOL ORTFImportExport::Read() +sal_Bool ORTFImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "ORTFImportExport::Read" ); ODatabaseImportExport::Read(); @@ -677,7 +677,7 @@ const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\ //======================================================================== #define OUT_PROLOGUE() ((*m_pStream) << sHTML30_Prologue << ODatabaseImportExport::sNewLine << ODatabaseImportExport::sNewLine) #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag ) -#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, FALSE ) +#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, sal_False ) #define OUT_STR( str ) HTMLOutFuncs::Out_String( (*m_pStream), str ) #define OUT_LF() (*m_pStream) << ODatabaseImportExport::sNewLine << GetIndentStr() #define lcl_OUT_LF() (*m_pStream) << ODatabaseImportExport::sNewLine @@ -695,7 +695,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD : ODatabaseImportExport(_aDataDescriptor,_rM,_rxNumberF,rExchange) ,m_nIndent(0) #if OSL_DEBUG_LEVEL > 0 - ,m_bCheckFont(FALSE) + ,m_bCheckFont(sal_False) #endif { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::OHTMLImportExport" ); @@ -706,7 +706,7 @@ OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataD sIndent[0] = 0; } //------------------------------------------------------------------- -BOOL OHTMLImportExport::Write() +sal_Bool OHTMLImportExport::Write() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::Write" ); ODatabaseImportExport::Write(); @@ -725,7 +725,7 @@ BOOL OHTMLImportExport::Write() return sal_False; } //------------------------------------------------------------------- -BOOL OHTMLImportExport::Read() +sal_Bool OHTMLImportExport::Read() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::Read" ); ODatabaseImportExport::Read(); @@ -1015,12 +1015,12 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I { fVal = m_xFormatter->convertStringToNumber(nFormat,rValue); ByteString aTmpString(aStrTD); - HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, FALSE, fVal,nFormat, *pFormatter ); + HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, sal_False, fVal,nFormat, *pFormatter ); } catch(Exception&) { ByteString aTmpString(aStrTD); - HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, FALSE, fVal,nFormat, *pFormatter ); + HTMLOutFuncs::CreateTableDataOptionsValNum( aTmpString, sal_False, fVal,nFormat, *pFormatter ); } } @@ -1028,10 +1028,10 @@ void OHTMLImportExport::WriteCell( sal_Int32 nFormat,sal_Int32 nWidthPixel,sal_I FontOn(); - BOOL bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); - BOOL bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); - BOOL bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); - BOOL bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); + sal_Bool bBold = ( ::com::sun::star::awt::FontWeight::BOLD == m_aFont.Weight ); + sal_Bool bItalic = ( ::com::sun::star::awt::FontSlant_ITALIC == m_aFont.Slant ); + sal_Bool bUnderline = ( ::com::sun::star::awt::FontUnderline::NONE != m_aFont.Underline ); + sal_Bool bStrikeout = ( ::com::sun::star::awt::FontStrikeout::NONE != m_aFont.Strikeout ); if ( bBold ) TAG_ON( OOO_STRING_SVTOOLS_HTML_bold ); if ( bItalic ) TAG_ON( OOO_STRING_SVTOOLS_HTML_italic ); @@ -1058,7 +1058,7 @@ void OHTMLImportExport::FontOn() { RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "misc", "Ocke.Janssen@sun.com", "OHTMLImportExport::FontOn" ); #if OSL_DEBUG_LEVEL > 0 - m_bCheckFont = TRUE; + m_bCheckFont = sal_True; #endif // <FONT FACE="xxx"> @@ -1091,7 +1091,7 @@ inline void OHTMLImportExport::FontOff() OSL_ENSURE(m_bCheckFont,"Kein FontOn() gerufen"); TAG_OFF( OOO_STRING_SVTOOLS_HTML_font ); #if OSL_DEBUG_LEVEL > 0 - m_bCheckFont = FALSE; + m_bCheckFont = sal_False; #endif } //----------------------------------------------------------------------- diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx index 7dfb0152bf82..8f76cfeec73b 100644 --- a/dbaccess/source/ui/misc/UITools.cxx +++ b/dbaccess/source/ui/misc/UITools.cxx @@ -1306,13 +1306,13 @@ namespace } // annonymous // ......................................................................... // ----------------------------------------------------------------------------- -::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName,const sal_Int32 _nHelpId) +::com::sun::star::util::URL createHelpAgentURL(const ::rtl::OUString& _sModuleName, const rtl::OString& sHelpId) { ::com::sun::star::util::URL aURL; aURL.Complete = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.help://" ) ); aURL.Complete += _sModuleName; aURL.Complete += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ); - aURL.Complete += ::rtl::OUString::valueOf(_nHelpId); + aURL.Complete += ::rtl::OUString(sHelpId, sHelpId.getLength(), RTL_TEXTENCODING_UTF8); ::rtl::OUString sAnchor; ::rtl::OUString sTempURL = aURL.Complete; @@ -1451,7 +1451,7 @@ TOTypeInfoSP queryTypeInfoByType(sal_Int32 _nDataType,const OTypeInfoMap& _rType return pTypeInfo; } // ----------------------------------------------------------------------------- -sal_Int32 askForUserAction(Window* _pParent,USHORT _nTitle,USHORT _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) +sal_Int32 askForUserAction(Window* _pParent,sal_uInt16 _nTitle,sal_uInt16 _nText,sal_Bool _bAll,const ::rtl::OUString& _sName) { SolarMutexGuard aGuard; String aMsg = String(ModuleRes(_nText)); diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx index 8428db9fc420..b0df6f61f1b5 100644 --- a/dbaccess/source/ui/misc/WCPage.cxx +++ b/dbaccess/source/ui/misc/WCPage.cxx @@ -82,7 +82,7 @@ OCopyTable::OCopyTable( Window * pParent ) ,m_edKeyName( this, ModuleRes( ET_KEYNAME ) ) ,m_pPage2(NULL) ,m_pPage3(NULL) - ,m_bUseHeaderAllowed(TRUE) + ,m_bUseHeaderAllowed(sal_True) { DBG_CTOR(OCopyTable,NULL); @@ -93,7 +93,7 @@ OCopyTable::OCopyTable( Window * pParent ) if ( !m_pParent->supportsViews() ) m_aRB_View.Disable(); - m_aCB_UseHeaderLine.Check(TRUE); + m_aCB_UseHeaderLine.Check(sal_True); m_bPKeyAllowed = m_pParent->supportsPrimaryKey(); m_aCB_PrimaryColumn.Enable(m_bPKeyAllowed); @@ -263,7 +263,7 @@ sal_Bool OCopyTable::LeavePage() void OCopyTable::ActivatePage() { DBG_CHKTHIS(OCopyTable,NULL); - m_pParent->GetOKButton().Enable( TRUE ); + m_pParent->GetOKButton().Enable( sal_True ); m_nOldOperation = m_pParent->getOperation(); m_edTableName.GrabFocus(); m_aCB_UseHeaderLine.Check(m_pParent->UseHeaderLine()); diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx index 84a2a917ac27..07affc1c2015 100644 --- a/dbaccess/source/ui/misc/WColumnSelect.cxx +++ b/dbaccess/source/ui/misc/WColumnSelect.cxx @@ -147,7 +147,7 @@ void OWizColumnSelect::ActivatePage( ) ODatabaseExport::TColumnVector::const_iterator aEnd = pDestColumns->end(); for(;aIter != aEnd;++aIter) { - USHORT nPos = m_lbNewColumnNames.InsertEntry((*aIter)->first); + sal_uInt16 nPos = m_lbNewColumnNames.InsertEntry((*aIter)->first); m_lbNewColumnNames.SetEntryData(nPos,new OFieldDescription(*((*aIter)->second))); m_lbOrgColumnNames.RemoveEntry((*aIter)->first); } @@ -355,7 +355,7 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, OSL_ENSURE( aPos != pSrcVector->end(),"Invalid position for the iterator here!"); ODatabaseExport::TColumnVector::size_type nPos = (aPos - pSrcVector->begin()) - adjustColumnPosition(_pLeft, _sColumnName, (aPos - pSrcVector->begin()), _aCase); - _pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< USHORT >(nPos)),aSrcIter->second ); + _pRight->SetEntryData( _pRight->InsertEntry( (*aIter).first, sal::static_int_cast< sal_uInt16 >(nPos)),aSrcIter->second ); _rRightColumns.push_back((*aIter).first); m_pParent->removeColumnNameFromNameMap(_sColumnName); } @@ -366,12 +366,12 @@ void OWizColumnSelect::moveColumn( ListBox* _pRight, // not enough. We need to take into acccount what fields have // been removed earlier and adjust accordingly. Based on the // algorithm employed in moveColumn(). -USHORT OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, +sal_uInt16 OWizColumnSelect::adjustColumnPosition( ListBox* _pLeft, const ::rtl::OUString& _sColumnName, ODatabaseExport::TColumnVector::size_type nCurrentPos, const ::comphelper::TStringMixEqualFunctor& _aCase) { - USHORT nAdjustedPos = 0; + sal_uInt16 nAdjustedPos = 0; // if returning all entries to their original position, // then there is no need to adjust the positions. diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 779c8f4d7c92..8f3222181146 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -73,8 +73,8 @@ OWizNameMatching::OWizNameMatching( Window* pParent) m_CTRL_RIGHT.SetSelectHdl(LINK(this,OWizNameMatching,TableListRightSelectHdl)); m_CTRL_RIGHT.EnableCheckButton( NULL ); - m_CTRL_LEFT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); - m_CTRL_RIGHT.SetWindowBits( WB_FORCE_MAKEVISIBLE ); + m_CTRL_LEFT.SetStyle( m_CTRL_LEFT.GetStyle() | WB_FORCE_MAKEVISIBLE ); + m_CTRL_RIGHT.SetStyle( m_CTRL_RIGHT.GetStyle() | WB_FORCE_MAKEVISIBLE ); m_sSourceText = m_FT_TABLE_LEFT.GetText(); m_sSourceText.AppendAscii("\n"); @@ -258,7 +258,7 @@ IMPL_LINK( OWizNameMatching, TableListClickHdl, void*, /*NOTINTERESTEDIN*/ ) SvLBoxEntry* pEntry = m_CTRL_LEFT.FirstSelected(); if(pEntry) { - ULONG nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pEntry); + sal_uLong nPos = m_CTRL_LEFT.GetModel()->GetAbsPos(pEntry); SvLBoxEntry* pOldEntry = m_CTRL_RIGHT.FirstSelected(); if(pOldEntry && nPos != m_CTRL_RIGHT.GetModel()->GetAbsPos(pOldEntry)) { @@ -267,7 +267,7 @@ IMPL_LINK( OWizNameMatching, TableListClickHdl, void*, /*NOTINTERESTEDIN*/ ) pOldEntry = m_CTRL_RIGHT.GetEntry(nPos); if(pOldEntry) { - ULONG nNewPos = m_CTRL_LEFT.GetModel()->GetAbsPos(m_CTRL_LEFT.GetFirstEntryInView()); + sal_uLong nNewPos = m_CTRL_LEFT.GetModel()->GetAbsPos(m_CTRL_LEFT.GetFirstEntryInView()); if ( nNewPos - nPos == 1 ) --nNewPos; m_CTRL_RIGHT.MakeVisible(m_CTRL_RIGHT.GetEntry(nNewPos),sal_True); @@ -292,7 +292,7 @@ IMPL_LINK( OWizNameMatching, TableListRightSelectHdl, void*, /*NOTINTERESTEDIN*/ SvLBoxEntry* pEntry = m_CTRL_RIGHT.FirstSelected(); if(pEntry) { - ULONG nPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(pEntry); + sal_uLong nPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(pEntry); SvLBoxEntry* pOldEntry = m_CTRL_LEFT.FirstSelected(); if(pOldEntry && nPos != m_CTRL_LEFT.GetModel()->GetAbsPos(pOldEntry)) { @@ -301,7 +301,7 @@ IMPL_LINK( OWizNameMatching, TableListRightSelectHdl, void*, /*NOTINTERESTEDIN*/ pOldEntry = m_CTRL_LEFT.GetEntry(nPos); if(pOldEntry) { - ULONG nNewPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(m_CTRL_RIGHT.GetFirstEntryInView()); + sal_uLong nNewPos = m_CTRL_RIGHT.GetModel()->GetAbsPos(m_CTRL_RIGHT.GetFirstEntryInView()); if ( nNewPos - nPos == 1 ) nNewPos--; m_CTRL_LEFT.MakeVisible(m_CTRL_LEFT.GetEntry(nNewPos),sal_True); @@ -366,7 +366,7 @@ OColumnTreeBox::OColumnTreeBox( Window* pParent, const ResId& rResId ) { SetDragDropMode( 0 ); EnableInplaceEditing( sal_False ); - SetWindowBits(WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); + SetStyle(GetStyle() | WB_BORDER | WB_HASBUTTONS | WB_HSCROLL); SetSelectionMode( SINGLE_SELECTION ); } //------------------------------------------------------------------------ diff --git a/dbaccess/source/ui/misc/WTypeSelect.cxx b/dbaccess/source/ui/misc/WTypeSelect.cxx index 86007e933533..2991ba00bf32 100644 --- a/dbaccess/source/ui/misc/WTypeSelect.cxx +++ b/dbaccess/source/ui/misc/WTypeSelect.cxx @@ -43,6 +43,8 @@ #include "sqlmessage.hxx" #include "FieldControls.hxx" +#include "dbaccess_slotid.hrc" + using namespace ::dbaui; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -128,8 +130,8 @@ void OWizTypeSelectControl::CellModified(long nRow, sal_uInt16 nColId ) if ( getMetaData().is() && !getMetaData()->supportsMixedCaseQuotedIdentifiers() ) { bCase = sal_False; - USHORT nCount = aListBox.GetEntryCount(); - for (USHORT i=0 ; !bDoubleName && i < nCount ; ++i) + sal_uInt16 nCount = aListBox.GetEntryCount(); + for (sal_uInt16 i=0 ; !bDoubleName && i < nCount ; ++i) { ::rtl::OUString sEntry(aListBox.GetEntry(i)); bDoubleName = sNewName.equalsIgnoreAsciiCase(sEntry); @@ -330,7 +332,7 @@ void OWizTypeSelect::ActivatePage( ) Reset(); m_bFirstTime = bOldFirstTime; - m_lbColumnNames.SelectEntryPos(static_cast<USHORT>(m_nDisplayRow)); + m_lbColumnNames.SelectEntryPos(static_cast<sal_uInt16>(m_nDisplayRow)); m_nDisplayRow = 0; m_lbColumnNames.GetSelectHdl().Call(&m_lbColumnNames); } diff --git a/dbaccess/source/ui/misc/WizardPages.src b/dbaccess/source/ui/misc/WizardPages.src index c52576702594..360ab879a102 100644 --- a/dbaccess/source/ui/misc/WizardPages.src +++ b/dbaccess/source/ui/misc/WizardPages.src @@ -35,6 +35,7 @@ #include "dbaccess_helpid.hrc" #endif +#include "dbaccess_slotid.hrc" #define WINDOW_SIZE_X 276 #define WINDOW_SIZE_Y 185 @@ -67,6 +68,7 @@ String STR_WIZ_NAME_MATCHING_TITEL ModalDialog WIZ_RTFCOPYTABLE { + HelpID = "dbaccess:ModalDialog:WIZ_RTFCOPYTABLE"; Text [ en-US ] = "Copy RTF Table" ; @@ -90,12 +92,14 @@ ModalDialog WIZ_RTFCOPYTABLE }; PushButton PB_PREV { + HelpID = "dbaccess:PushButton:WIZ_RTFCOPYTABLE:PB_PREV"; TabStop = TRUE ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; Text [ en-US ] = "< ~Back"; }; PushButton PB_NEXT { + HelpID = "dbaccess:PushButton:WIZ_RTFCOPYTABLE:PB_NEXT"; TabStop = TRUE ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; Text [ en-US ] = "~Next>"; @@ -128,6 +132,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; MultiListBox LB_ORG_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_COLUMN_SELECT:LB_ORG_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( WINDOW_BORDER_X , WINDOW_BORDER_Y ) ; Size = MAP_APPFONT ( 95 , WINDOW_SIZE_Y - 23 ) ; @@ -140,6 +145,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMN_RH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMN_RH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 25 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -159,6 +165,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMNS_RH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMNS_RH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 45 ) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE; @@ -179,6 +186,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMN_LH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMN_LH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 65) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -198,6 +206,7 @@ TabPage TAB_WIZ_COLUMN_SELECT }; ImageButton IB_COLUMNS_LH { + HelpID = "dbaccess:ImageButton:TAB_WIZ_COLUMN_SELECT:IB_COLUMNS_LH"; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 116 , WINDOW_BORDER_Y + 85) ; Size = MAP_APPFONT ( 20 , 14 ) ; TabStop = TRUE ; @@ -218,6 +227,7 @@ TabPage TAB_WIZ_COLUMN_SELECT MultiListBox LB_NEW_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_COLUMN_SELECT:LB_NEW_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( WINDOW_BORDER_X + 157, WINDOW_BORDER_Y) ; Size = MAP_APPFONT ( 95 , WINDOW_SIZE_Y - 23 ) ; @@ -243,6 +253,7 @@ TabPage TAB_WIZ_TYPE_SELECT MultiListBox LB_NEW_COLUMN_NAMES { + HelpID = "dbaccess:MultiListBox:TAB_WIZ_TYPE_SELECT:LB_NEW_COLUMN_NAMES"; Border = TRUE ; Pos = MAP_APPFONT ( 6 , 6 ) ; Size = MAP_APPFONT ( 87 , WINDOW_SIZE_Y - 12 ) ; @@ -262,6 +273,7 @@ TabPage TAB_WIZ_TYPE_SELECT TabPage CONTROL_CONTAINER { + HelpID = "dbaccess:TabPage:CONTROL_CONTAINER"; Pos = MAP_APPFONT ( 102 , WINDOW_BORDER_Y ) ; Size = MAP_APPFONT ( WINDOW_SIZE_X - 111, WINDOW_SIZE_Y - WINDOW_BORDER_Y - 67 ); SVLook = TRUE; @@ -284,6 +296,7 @@ TabPage TAB_WIZ_TYPE_SELECT NumericField ET_AUTO { + HelpID = "dbaccess:NumericField:TAB_WIZ_TYPE_SELECT:ET_AUTO"; Border = TRUE ; Pos = MAP_APPFONT ( 151 , WINDOW_SIZE_Y - WINDOW_BORDER_Y - 29) ; Size = MAP_APPFONT ( 40 , 12 ) ; @@ -292,6 +305,7 @@ TabPage TAB_WIZ_TYPE_SELECT PushButton PB_AUTO { + HelpID = "dbaccess:PushButton:TAB_WIZ_TYPE_SELECT:PB_AUTO"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 62 , WINDOW_SIZE_Y - WINDOW_BORDER_Y - 30 ) ; Size = MAP_APPFONT ( BUTTON_SIZE_X , BUTTON_SIZE_Y ) ; TabStop = TRUE ; @@ -306,7 +320,7 @@ Menu RID_SBA_RTF_PKEYPOPUP MenuItem { Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - HelpID = SID_TABLEDESIGN_TABED_PRIMARYKEY ; + HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ; Checkable = TRUE ; Text [ en-US ] = "Primary Key" ; }; @@ -318,6 +332,7 @@ Menu RID_SBA_RTF_PKEYPOPUP //================================================================== TabPage TAB_WIZ_NAME_MATCHING { + HelpID = "dbaccess:TabPage:TAB_WIZ_NAME_MATCHING"; SVLook = TRUE ; Size = MAP_APPFONT ( WINDOW_SIZE_X , WINDOW_SIZE_Y ) ; @@ -359,6 +374,7 @@ TabPage TAB_WIZ_NAME_MATCHING ImageButton IB_COLUMN_UP { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_UP"; Pos = MAP_APPFONT ( 19 , 45 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -379,6 +395,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_DOWN { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_DOWN"; Pos = MAP_APPFONT ( 19 , 63 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -398,6 +415,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_UP_RIGHT { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_UP_RIGHT"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 33, 45 ) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE; @@ -418,6 +436,7 @@ TabPage TAB_WIZ_NAME_MATCHING }; ImageButton IB_COLUMN_DOWN_RIGHT { + HelpID = "dbaccess:ImageButton:TAB_WIZ_NAME_MATCHING:IB_COLUMN_DOWN_RIGHT"; Pos = MAP_APPFONT ( WINDOW_SIZE_X - 33, 63) ; Size = MAP_APPFONT ( 14 , 14 ) ; TabStop = TRUE ; @@ -438,6 +457,7 @@ TabPage TAB_WIZ_NAME_MATCHING PushButton PB_ALL { + HelpID = "dbaccess:PushButton:TAB_WIZ_NAME_MATCHING:PB_ALL"; Pos = MAP_APPFONT ( 6, 83) ; Size = MAP_APPFONT ( 40 , 14 ) ; TabStop = TRUE ; @@ -446,6 +466,7 @@ TabPage TAB_WIZ_NAME_MATCHING PushButton PB_NONE { + HelpID = "dbaccess:PushButton:TAB_WIZ_NAME_MATCHING:PB_NONE"; Pos = MAP_APPFONT ( 6, 103) ; Size = MAP_APPFONT ( 40 , 14 ) ; TabStop = TRUE ; @@ -485,12 +506,14 @@ TabPage TAB_WIZ_COPYTABLE }; RadioButton RB_DEFDATA { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_DEFDATA"; Pos = MAP_APPFONT ( 12 , 35 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "De~finition and data" ; }; RadioButton RB_DEF { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_DEF"; Pos = MAP_APPFONT ( 12, 49 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "Def~inition" ; @@ -498,6 +521,7 @@ TabPage TAB_WIZ_COPYTABLE RadioButton RB_VIEW { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_VIEW"; Pos = MAP_APPFONT ( 12, 63 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "A~s table view"; @@ -505,6 +529,7 @@ TabPage TAB_WIZ_COPYTABLE RadioButton RB_APPENDDATA { + HelpID = "dbaccess:RadioButton:TAB_WIZ_COPYTABLE:RB_APPENDDATA"; Pos = MAP_APPFONT ( 12, 77 ) ; Size = MAP_APPFONT ( 73 , 10 ) ; Text [ en-US ] = "Append ~data" ; @@ -512,6 +537,7 @@ TabPage TAB_WIZ_COPYTABLE CheckBox CB_USEHEADERLINE { + HelpID = "dbaccess:CheckBox:TAB_WIZ_COPYTABLE:CB_USEHEADERLINE"; Pos = MAP_APPFONT ( 12, 93 ) ; Size = MAP_APPFONT ( WINDOW_SIZE_X - 18, 10 ) ; Text [ en-US ] = "Use first ~line as column names" ; @@ -519,6 +545,7 @@ TabPage TAB_WIZ_COPYTABLE CheckBox CB_PRIMARY_COLUMN { + HelpID = "dbaccess:CheckBox:TAB_WIZ_COPYTABLE:CB_PRIMARY_COLUMN"; Pos = MAP_APPFONT ( 12, 107 ) ; Size = MAP_APPFONT ( 90 , 10 ) ; Text [ en-US ] = "Crea~te primary key"; @@ -532,6 +559,7 @@ TabPage TAB_WIZ_COPYTABLE Edit ET_KEYNAME { + HelpID = "dbaccess:Edit:TAB_WIZ_COPYTABLE:ET_KEYNAME"; Pos = MAP_APPFONT ( 80, 120 ) ; Size = MAP_APPFONT ( 65 , 12 ) ; TabStop = TRUE ; diff --git a/dbaccess/source/ui/misc/dbaundomanager.cxx b/dbaccess/source/ui/misc/dbaundomanager.cxx new file mode 100755 index 000000000000..83f55e0cbc5e --- /dev/null +++ b/dbaccess/source/ui/misc/dbaundomanager.cxx @@ -0,0 +1,394 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_dbaccess.hxx" + +#include "dbaundomanager.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <svl/undo.hxx> +#include <vcl/svapp.hxx> +#include <framework/undomanagerhelper.hxx> + +//...................................................................................................................... +namespace dbaui +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::document::XUndoManager; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::document::UndoContextNotClosedException; + using ::com::sun::star::document::UndoFailedException; + using ::com::sun::star::document::EmptyUndoStackException; + using ::com::sun::star::util::InvalidStateException; + using ::com::sun::star::document::XUndoAction; + using ::com::sun::star::lang::IllegalArgumentException; + using ::com::sun::star::document::XUndoManagerListener; + using ::com::sun::star::util::NotLockedException; + using ::com::sun::star::lang::NoSupportException; + /** === end UNO using === **/ + + //================================================================================================================== + //= UndoManager_Impl + //================================================================================================================== + struct UndoManager_Impl : public ::framework::IUndoManagerImplementation + { + UndoManager_Impl( UndoManager& i_antiImpl, ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :rAntiImpl( i_antiImpl ) + ,rParent( i_parent ) + ,rMutex( i_mutex ) + ,bDisposed( false ) + ,aUndoManager() + ,aUndoHelper( *this ) + { + } + + virtual ~UndoManager_Impl() + { + } + + UndoManager& rAntiImpl; + ::cppu::OWeakObject& rParent; + ::osl::Mutex& rMutex; + bool bDisposed; + SfxUndoManager aUndoManager; + ::framework::UndoManagerHelper aUndoHelper; + + // IUndoManagerImplementation + virtual ::svl::IUndoManager& getImplUndoManager(); + virtual Reference< XUndoManager > getThis(); + }; + + //------------------------------------------------------------------------------------------------------------------ + ::svl::IUndoManager& UndoManager_Impl::getImplUndoManager() + { + return aUndoManager; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XUndoManager > UndoManager_Impl::getThis() + { + return static_cast< XUndoManager* >( &rAntiImpl ); + } + + //============================================================================================================== + //= OslMutexFacade + //============================================================================================================== + class OslMutexFacade : public ::framework::IMutex + { + public: + OslMutexFacade( ::osl::Mutex& i_mutex ) + :m_rMutex( i_mutex ) + { + } + + virtual void acquire(); + virtual void release(); + + private: + ::osl::Mutex& m_rMutex; + }; + + //-------------------------------------------------------------------------------------------------------------- + void OslMutexFacade::acquire() + { + m_rMutex.acquire(); + } + + //-------------------------------------------------------------------------------------------------------------- + void OslMutexFacade::release() + { + m_rMutex.release(); + } + + //============================================================================================================== + //= UndoManagerMethodGuard + //============================================================================================================== + /** guard for public UNO methods of the UndoManager + */ + class UndoManagerMethodGuard : public ::framework::IMutexGuard + { + public: + UndoManagerMethodGuard( UndoManager_Impl& i_impl ) + :m_aGuard( i_impl.rMutex ) + ,m_aMutexFacade( i_impl.rMutex ) + { + // throw if the instance is already disposed + if ( i_impl.bDisposed ) + throw DisposedException( ::rtl::OUString(), i_impl.getThis() ); + } + virtual ~UndoManagerMethodGuard() + { + } + + // IMutexGuard + virtual ::framework::IMutex& getGuardedMutex(); + + // IGuard + virtual void clear(); + virtual void reset(); + + private: + ::osl::ResettableMutexGuard m_aGuard; + OslMutexFacade m_aMutexFacade; + }; + + //-------------------------------------------------------------------------------------------------------------- + ::framework::IMutex& UndoManagerMethodGuard::getGuardedMutex() + { + return m_aMutexFacade; + } + + //-------------------------------------------------------------------------------------------------------------- + void UndoManagerMethodGuard::clear() + { + m_aGuard.clear(); + } + + //-------------------------------------------------------------------------------------------------------------- + void UndoManagerMethodGuard::reset() + { + m_aGuard.reset(); + } + + //================================================================================================================== + //= UndoManager + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + UndoManager::UndoManager( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :m_pImpl( new UndoManager_Impl( *this, i_parent, i_mutex ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + UndoManager::~UndoManager() + { + } + + //------------------------------------------------------------------------------------------------------------------ + SfxUndoManager& UndoManager::GetSfxUndoManager() const + { + return m_pImpl->aUndoManager; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::acquire( ) throw () + { + m_pImpl->rParent.acquire(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::release( ) throw () + { + m_pImpl->rParent.release(); + } + + //------------------------------------------------------------------------------------------------------------------ + void UndoManager::disposing() + { + { + ::osl::MutexGuard aGuard( m_pImpl->rMutex ); + m_pImpl->bDisposed = true; + } + m_pImpl->aUndoHelper.disposing(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::enterUndoContext( const ::rtl::OUString& i_title ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.enterUndoContext( i_title, aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::enterHiddenUndoContext( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.enterHiddenUndoContext( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::leaveUndoContext( ) throw (InvalidStateException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.leaveUndoContext( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::addUndoAction( const Reference< XUndoAction >& i_action ) throw (IllegalArgumentException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.addUndoAction( i_action, aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::undo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException) + { + SolarMutexGuard aSolarGuard; + // (all our UndoActions work directly on VCL code, usually, so ...) + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.undo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::redo( ) throw (EmptyUndoStackException, UndoContextNotClosedException, UndoFailedException, RuntimeException) + { + SolarMutexGuard aSolarGuard; + // (all our UndoActions work directly on VCL code, usually, so ...) + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.redo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isUndoPossible( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isUndoPossible(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isRedoPossible( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isRedoPossible(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL UndoManager::getCurrentUndoActionTitle( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getCurrentUndoActionTitle(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::rtl::OUString SAL_CALL UndoManager::getCurrentRedoActionTitle( ) throw (EmptyUndoStackException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getCurrentRedoActionTitle(); + } + + //------------------------------------------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllUndoActionTitles( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getAllUndoActionTitles(); + } + + //------------------------------------------------------------------------------------------------------------------ + Sequence< ::rtl::OUString > SAL_CALL UndoManager::getAllRedoActionTitles( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.getAllRedoActionTitles(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::clear( ) throw (UndoContextNotClosedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.clear( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::clearRedo( ) throw (UndoContextNotClosedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.clearRedo( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::reset( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.reset( aGuard ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::addUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.addUndoManagerListener( i_listener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::removeUndoManagerListener( const Reference< XUndoManagerListener >& i_listener ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.removeUndoManagerListener( i_listener ); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::lock( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.lock(); + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::unlock( ) throw (NotLockedException, RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + m_pImpl->aUndoHelper.unlock(); + } + + //------------------------------------------------------------------------------------------------------------------ + ::sal_Bool SAL_CALL UndoManager::isLocked( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return m_pImpl->aUndoHelper.isLocked(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XInterface > SAL_CALL UndoManager::getParent( ) throw (RuntimeException) + { + UndoManagerMethodGuard aGuard( *m_pImpl ); + return *&m_pImpl->rParent; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL UndoManager::setParent( const Reference< XInterface >& i_parent ) throw (NoSupportException, RuntimeException) + { + (void)i_parent; + throw NoSupportException( ::rtl::OUString(), m_pImpl->getThis() ); + } + +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... diff --git a/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx new file mode 100644 index 000000000000..eb1b34710ff8 --- /dev/null +++ b/dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx @@ -0,0 +1,672 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_dbaccess.hxx" + +#include "browserids.hxx" +#include "commontypes.hxx" +#include "dataview.hxx" +#include "dbu_misc.hrc" +#include "dbustrings.hrc" +#include "moduledbu.hxx" +#include "dbsubcomponentcontroller.hxx" + +/** === begin UNO includes === **/ +#include <com/sun/star/frame/XUntitledNumbers.hpp> +#include <com/sun/star/beans/PropertyAttribute.hpp> +#include <com/sun/star/container/XChild.hpp> +#include <com/sun/star/container/XNameAccess.hpp> +#include <com/sun/star/sdb/XDocumentDataSource.hpp> +#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> +#include <com/sun/star/sdbc/XDataSource.hpp> +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <com/sun/star/frame/XUntitledNumbers.hpp> +/** === end UNO includes === **/ + +#include <comphelper/sequence.hxx> +#include <comphelper/types.hxx> +#include <connectivity/dbexception.hxx> +#include <connectivity/dbtools.hxx> +#include <cppuhelper/typeprovider.hxx> +#include <rtl/ustrbuf.hxx> +#include <toolkit/unohlp.hxx> +#include <tools/debug.hxx> +#include <tools/diagnose_ex.h> +#include <vcl/msgbox.hxx> + +//........................................................................ +namespace dbaui +{ +//........................................................................ + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::Reference; + using ::com::sun::star::beans::XPropertySet; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::sdbc::XConnection; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::container::XChild; + using ::com::sun::star::sdbc::XDataSource; + using ::com::sun::star::util::XNumberFormatter; + using ::com::sun::star::util::XNumberFormatsSupplier; + using ::com::sun::star::frame::XFrame; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::sdbc::SQLException; + using ::com::sun::star::lang::EventObject; + using ::com::sun::star::beans::PropertyValue; + using ::com::sun::star::frame::XModel; + using ::com::sun::star::sdb::XOfficeDatabaseDocument; + using ::com::sun::star::awt::XWindow; + using ::com::sun::star::sdbc::XDatabaseMetaData; + using ::com::sun::star::sdb::XDocumentDataSource; + using ::com::sun::star::document::XEmbeddedScripts; + using ::com::sun::star::lang::IllegalArgumentException; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::frame::XUntitledNumbers; + using ::com::sun::star::beans::PropertyVetoException; + /** === end UNO using === **/ + + class DataSourceHolder + { + public: + DataSourceHolder() + { + } + + DataSourceHolder( const Reference< XDataSource >& _rxDataSource ) + { + m_xDataSource = _rxDataSource; + Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY ); + if ( xDocDS.is() ) + m_xDocument = xDocDS->getDatabaseDocument(); + + m_xDataSourceProps.set( m_xDataSource, UNO_QUERY ); + } + + const Reference< XDataSource >& getDataSource() const { return m_xDataSource; } + const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; } + const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; } + + bool is() const { return m_xDataSource.is(); } + + void clear() + { + m_xDataSource.clear(); + m_xDocument.clear(); + } + + private: + Reference< XDataSource > m_xDataSource; + Reference< XPropertySet > m_xDataSourceProps; + Reference< XOfficeDatabaseDocument > m_xDocument; + }; + + struct DBSubComponentController_Impl + { + private: + ::boost::optional< bool > m_aDocScriptSupport; + + public: + OModuleClient m_aModuleClient; + ::dbtools::SQLExceptionInfo m_aCurrentError; + + ::cppu::OInterfaceContainerHelper + m_aModifyListeners; + + // <properties> + SharedConnection m_xConnection; + ::dbtools::DatabaseMetaData m_aSdbMetaData; + // </properties> + ::rtl::OUString m_sDataSourceName; // the data source we're working for + DataSourceHolder m_aDataSource; + Reference< XModel > m_xDocument; + Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier + sal_Int32 m_nDocStartNumber; + sal_Bool m_bSuspended; // is true when the controller was already suspended + sal_Bool m_bEditable; // is the control readonly or not + sal_Bool m_bModified; // is the data modified + bool m_bNotAttached; + + DBSubComponentController_Impl( ::osl::Mutex& i_rMutex ) + :m_aDocScriptSupport() + ,m_aModifyListeners( i_rMutex ) + ,m_nDocStartNumber(0) + ,m_bSuspended( sal_False ) + ,m_bEditable(sal_True) + ,m_bModified(sal_False) + ,m_bNotAttached(true) + { + } + + bool documentHasScriptSupport() const + { + OSL_PRECOND( !!m_aDocScriptSupport, + "DBSubComponentController_Impl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); + return !!m_aDocScriptSupport && *m_aDocScriptSupport; + } + + void setDocumentScriptSupport( const bool _bSupport ) + { + OSL_PRECOND( !m_aDocScriptSupport, + "DBSubComponentController_Impl::setDocumentScriptSupport: already initialized!" ); + m_aDocScriptSupport = ::boost::optional< bool >( _bSupport ); + } + }; + + //==================================================================== + //= DBSubComponentController + //==================================================================== + //-------------------------------------------------------------------- + DBSubComponentController::DBSubComponentController(const Reference< XMultiServiceFactory >& _rxORB) + :DBSubComponentController_Base( _rxORB ) + ,m_pImpl( new DBSubComponentController_Impl( getMutex() ) ) + { + } + + //-------------------------------------------------------------------- + DBSubComponentController::~DBSubComponentController() + { + } + + //-------------------------------------------------------------------- + void DBSubComponentController::impl_initialize() + { + OGenericUnoController::impl_initialize(); + + const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); + + Reference< XConnection > xConnection; + xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); + + if ( !xConnection.is() ) + ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); + + if ( xConnection.is() ) + initializeConnection( xConnection ); + + bool bShowError = true; + if ( !isConnected() ) + { + reconnect( sal_False ); + bShowError = false; + } + if ( !isConnected() ) + { + if ( bShowError ) + connectionLostMessage(); + throw IllegalArgumentException(); + } + } + + //-------------------------------------------------------------------- + Any SAL_CALL DBSubComponentController::queryInterface(const Type& _rType) throw (RuntimeException) + { + if ( _rType.equals( XScriptInvocationContext::static_type() ) ) + { + if ( m_pImpl->documentHasScriptSupport() ) + return makeAny( Reference< XScriptInvocationContext >( this ) ); + return Any(); + } + + return DBSubComponentController_Base::queryInterface( _rType ); + } + + //-------------------------------------------------------------------- + Sequence< Type > SAL_CALL DBSubComponentController::getTypes( ) throw (RuntimeException) + { + Sequence< Type > aTypes( DBSubComponentController_Base::getTypes() ); + if ( !m_pImpl->documentHasScriptSupport() ) + { + Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); + ::std::remove_copy_if( + aTypes.getConstArray(), + aTypes.getConstArray() + aTypes.getLength(), + aStrippedTypes.getArray(), + ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() ) + ); + aTypes = aStrippedTypes; + } + return aTypes; + } + + //-------------------------------------------------------------------- + void DBSubComponentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) + { + DBG_ASSERT( !isConnected(), "DBSubComponentController::initializeConnection: not to be called when already connected!" ); + // usually this gets called from within initialize of derived classes ... + if ( isConnected() ) + disconnect(); + + m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); + m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); + startConnectionListening( m_pImpl->m_xConnection ); + + // get the data source the connection belongs to + try + { + // determine our data source + OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: already a data source in this phase?" ); + { + Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); + Reference< XDataSource > xDS; + if ( xConnAsChild.is() ) + xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); + + // (take the indirection through XDataSource to ensure we have a correct object ....) + m_pImpl->m_aDataSource = xDS; + } + OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "DBSubComponentController::initializeConnection: unable to obtain the data source object!" ); + + if ( m_pImpl->m_bNotAttached ) + { + Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + } + + // determine the availability of script support in our document. Our own XScriptInvocationContext + // interface depends on this + m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); + + // get a number formatter + Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); + xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; + DBG_ASSERT( m_pImpl->m_sDataSourceName.getLength(), "DBSubComponentController::initializeConnection: invalid data source name!" ); + Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); + if(xSupplier.is()) + { + m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB() + ->createInstance(::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatter")), UNO_QUERY); + m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); + } + OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + } + + //-------------------------------------------------------------------- + void DBSubComponentController::reconnect( sal_Bool _bUI ) + { + OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!"); + + stopConnectionListening( m_pImpl->m_xConnection ); + m_pImpl->m_aSdbMetaData.reset( NULL ); + m_pImpl->m_xConnection.clear(); + + // reconnect + sal_Bool bReConnect = sal_True; + if ( _bUI ) + { + QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) ); + bReConnect = ( RET_YES == aQuery.Execute() ); + } + + // now really reconnect ... + if ( bReConnect ) + { + m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership ); + m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); + } + + // invalidate all slots + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::disconnect() + { + stopConnectionListening(m_pImpl->m_xConnection); + m_pImpl->m_aSdbMetaData.reset( NULL ); + m_pImpl->m_xConnection.clear(); + + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::losingConnection() + { + // our connection was disposed so we need a new one + reconnect( sal_True ); + InvalidateAll(); + } + + //-------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::disposing() + { + DBSubComponentController_Base::disposing(); + + disconnect(); + + attachFrame( Reference < XFrame >() ); + + m_pImpl->m_aDataSource.clear(); + } + + //-------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::disposing(const EventObject& _rSource) throw( RuntimeException ) + { + if ( _rSource.Source == getConnection() ) + { + if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect + && !getBroadcastHelper().bInDispose + && !getBroadcastHelper().bDisposed + && isConnected() + ) + { + losingConnection(); + } + else + { + m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership ); + // this prevents the "disposeComponent" call in disconnect + disconnect(); + } + } + else + DBSubComponentController_Base::disposing( _rSource ); + } + + //-------------------------------------------------------------------- + void DBSubComponentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState, + const sal_Int32 _nErrorCode ) + { + m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ), + _nErrorCode ); + } + //-------------------------------------------------------------------- + void DBSubComponentController::clearError() + { + m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + } + + //-------------------------------------------------------------------- + sal_Bool DBSubComponentController::hasError() const + { + return m_pImpl->m_aCurrentError.isValid(); + } + + //-------------------------------------------------------------------- + const ::dbtools::SQLExceptionInfo& DBSubComponentController::getError() const + { + return m_pImpl->m_aCurrentError; + } + + //-------------------------------------------------------------------- + void DBSubComponentController::displayError() + { + showError( m_pImpl->m_aCurrentError ); + } + + //-------------------------------------------------------------------- + sal_Bool SAL_CALL DBSubComponentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) + { + m_pImpl->m_bSuspended = bSuspend; + if ( !bSuspend && !isConnected() ) + reconnect(sal_True); + + + return sal_True; + } + + // ----------------------------------------------------------------------------- + sal_Bool SAL_CALL DBSubComponentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) + { + if ( !_rxModel.is() ) + return sal_False; + if ( !DBSubComponentController_Base::attachModel( _rxModel ) ) + return sal_False; + + m_pImpl->m_bNotAttached = false; + if ( m_pImpl->m_nDocStartNumber == 1 ) + releaseNumberForComponent(); + + Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); + m_pImpl->m_nDocStartNumber = 1; + if ( xUntitledProvider.is() ) + m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); + + return sal_True; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs) + { + if ( _nId == ID_BROWSER_CLOSE ) + { + closeTask(); + return; + } + + DBSubComponentController_Base::Execute( _nId, _rArgs ); + InvalidateFeature( _nId ); + } + + // ----------------------------------------------------------------------------- + ::rtl::OUString DBSubComponentController::getDataSourceName() const + { + ::rtl::OUString sName; + Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() ); + if ( xDataSourceProps.is() ) + xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName; + return sName; + } + // ----------------------------------------------------------------------------- + void DBSubComponentController::connectionLostMessage() const + { + String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); + Reference< XWindow > xWindow = getTopMostContainerWindow(); + Window* pWin = NULL; + if ( xWindow.is() ) + pWin = VCLUnoHelper::GetWindow(xWindow); + if ( !pWin ) + pWin = getView()->Window::GetParent(); + + InfoBox(pWin, aMessage).Execute(); + } + // ----------------------------------------------------------------------------- + const Reference< XConnection >& DBSubComponentController::getConnection() const + { + return m_pImpl->m_xConnection; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isReadOnly() const + { + return !m_pImpl->m_bEditable; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isEditable() const + { + return m_pImpl->m_bEditable; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::setEditable(sal_Bool _bEditable) + { + m_pImpl->m_bEditable = _bEditable; + } + + // ----------------------------------------------------------------------------- + const ::dbtools::DatabaseMetaData& DBSubComponentController::getSdbMetaData() const + { + return m_pImpl->m_aSdbMetaData; + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::isConnected() const + { + return m_pImpl->m_xConnection.is(); + } + + // ----------------------------------------------------------------------------- + Reference< XDatabaseMetaData > DBSubComponentController::getMetaData( ) const + { + Reference< XDatabaseMetaData > xMeta; + try + { + if ( isConnected() ) + xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW ); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return xMeta; + } + + // ----------------------------------------------------------------------------- + const Reference< XPropertySet >& DBSubComponentController::getDataSource() const + { + return m_pImpl->m_aDataSource.getDataSourceProps(); + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::haveDataSource() const + { + return m_pImpl->m_aDataSource.is(); + } + + // ----------------------------------------------------------------------------- + Reference< XModel > DBSubComponentController::getDatabaseDocument() const + { + return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY ); + } + + // ----------------------------------------------------------------------------- + Reference< XNumberFormatter > DBSubComponentController::getNumberFormatter() const + { + return m_pImpl->m_xFormatter; + } + + // ----------------------------------------------------------------------------- + Reference< XModel > DBSubComponentController::getPrivateModel() const + { + return getDatabaseDocument(); + } + // ----------------------------------------------------------------------------- + // XTitle + ::rtl::OUString SAL_CALL DBSubComponentController::getTitle() + throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + if ( m_bExternalTitle ) + return impl_getTitleHelper_throw()->getTitle (); + + ::rtl::OUStringBuffer sTitle; + Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); + if ( xTitle.is() ) + { + sTitle.append( xTitle->getTitle() ); + sTitle.appendAscii(" : "); + } + sTitle.append( getPrivateTitle() ); + return sTitle.makeStringAndClear(); + } + + // ----------------------------------------------------------------------------- + sal_Int32 DBSubComponentController::getCurrentStartNumber() const + { + return m_pImpl->m_nDocStartNumber; + } + + // ----------------------------------------------------------------------------- + Reference< XEmbeddedScripts > SAL_CALL DBSubComponentController::getScriptContainer() throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + if ( !m_pImpl->documentHasScriptSupport() ) + return NULL; + + return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW ); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + m_pImpl->m_aModifyListeners.addInterface( i_Listener ); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + m_pImpl->m_aModifyListeners.removeInterface( i_Listener ); + } + + // ----------------------------------------------------------------------------- + ::sal_Bool SAL_CALL DBSubComponentController::isModified( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( getMutex() ); + return impl_isModified(); + } + + // ----------------------------------------------------------------------------- + void SAL_CALL DBSubComponentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException) + { + ::osl::ClearableMutexGuard aGuard( getMutex() ); + + if ( m_pImpl->m_bModified == i_bModified ) + return; + + m_pImpl->m_bModified = i_bModified; + impl_onModifyChanged(); + + EventObject aEvent( *this ); + aGuard.clear(); + m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); + } + + // ----------------------------------------------------------------------------- + sal_Bool DBSubComponentController::impl_isModified() const + { + return m_pImpl->m_bModified; + } + + // ----------------------------------------------------------------------------- + void DBSubComponentController::impl_onModifyChanged() + { + InvalidateFeature( ID_BROWSER_SAVEDOC ); + if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) ) + InvalidateFeature( ID_BROWSER_SAVEASDOC ); + } + +//........................................................................ +} // namespace dbaui +//........................................................................ + diff --git a/dbaccess/source/ui/misc/dbumiscres.src b/dbaccess/source/ui/misc/dbumiscres.src index ae5979c0a96a..974b36e68005 100644 --- a/dbaccess/source/ui/misc/dbumiscres.src +++ b/dbaccess/source/ui/misc/dbumiscres.src @@ -96,5 +96,5 @@ String STR_NAMED_OBJECT_ALREADY_EXISTS String RID_STR_EXTENSION_NOT_PRESENT { // #i96130# use hard coded name - Text [ en-US ] = "The report, \"$file$\", requires the extension Sun Report Builder."; + Text [ en-US ] = "The report, \"$file$\", requires the extension Oracle Report Builder."; }; diff --git a/dbaccess/source/ui/misc/dsmeta.cxx b/dbaccess/source/ui/misc/dsmeta.cxx index cdf891af86df..945489cf7b62 100644 --- a/dbaccess/source/ui/misc/dsmeta.cxx +++ b/dbaccess/source/ui/misc/dsmeta.cxx @@ -94,6 +94,7 @@ namespace dbaui { DSID_IGNORECURRENCY, "IgnoreCurrency" }, { DSID_ESCAPE_DATETIME, "EscapeDateTime" }, { DSID_PRIMARY_KEY_SUPPORT, "PrimaryKeySupport" }, + { DSID_MAX_ROW_SCAN, "MaxRowScan" }, { 0, NULL } }; return s_aMappings; diff --git a/dbaccess/source/ui/misc/imageprovider.cxx b/dbaccess/source/ui/misc/imageprovider.cxx index ce798c5deba0..7f8522ee9070 100644 --- a/dbaccess/source/ui/misc/imageprovider.cxx +++ b/dbaccess/source/ui/misc/imageprovider.cxx @@ -97,7 +97,7 @@ namespace dbaui //................................................................ static void lcl_getTableImageResourceID_nothrow( const ImageProvider_Data& _rData, const ::rtl::OUString& _rName, - USHORT& _out_rResourceID ) + sal_uInt16& _out_rResourceID) { _out_rResourceID = 0; try @@ -165,7 +165,7 @@ namespace dbaui if ( !_out_rImage ) { // no -> determine by type - USHORT nImageResourceID = 0; + sal_uInt16 nImageResourceID = 0; lcl_getTableImageResourceID_nothrow( *m_pData, _rName, nImageResourceID ); if ( nImageResourceID && !_out_rImage ) @@ -178,16 +178,16 @@ namespace dbaui Image ImageProvider::getDefaultImage( sal_Int32 _nDatabaseObjectType ) { Image aObjectImage; - USHORT nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType ) ); + sal_uInt16 nImageResourceID( getDefaultImageResourceID( _nDatabaseObjectType) ); if ( nImageResourceID ) aObjectImage = Image( ModuleRes( nImageResourceID ) ); return aObjectImage; } //-------------------------------------------------------------------- - USHORT ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType ) + sal_uInt16 ImageProvider::getDefaultImageResourceID( sal_Int32 _nDatabaseObjectType) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: @@ -212,7 +212,7 @@ namespace dbaui //-------------------------------------------------------------------- Image ImageProvider::getFolderImage( sal_Int32 _nDatabaseObjectType ) { - USHORT nImageResourceID( 0 ); + sal_uInt16 nImageResourceID( 0 ); switch ( _nDatabaseObjectType ) { case DatabaseObject::QUERY: diff --git a/dbaccess/source/ui/misc/linkeddocuments.cxx b/dbaccess/source/ui/misc/linkeddocuments.cxx index fc9cf3a7fa1f..2207bbb541ad 100644 --- a/dbaccess/source/ui/misc/linkeddocuments.cxx +++ b/dbaccess/source/ui/misc/linkeddocuments.cxx @@ -46,7 +46,7 @@ #include <com/sun/star/ucb/OpenCommandArgument.hpp> #include <com/sun/star/ucb/OpenMode.hpp> #include <com/sun/star/task/XJobExecutor.hpp> -#include <cppuhelper/extract.hxx> +#include <comphelper/extract.hxx> #include <comphelper/types.hxx> #include <vcl/msgbox.hxx> #include <ucbhelper/content.hxx> @@ -60,7 +60,6 @@ #include <sfx2/app.hxx> #include <basic/sbx.hxx> #include <basic/sbuno.hxx> -#include <sfx2/macrconf.hxx> #include <svtools/ehdl.hxx> #include <svx/dataaccessdescriptor.hxx> #include <com/sun/star/container/XHierarchicalNameContainer.hpp> diff --git a/dbaccess/source/ui/misc/makefile.mk b/dbaccess/source/ui/misc/makefile.mk index 7f9bbed56023..534d90e3995c 100644 --- a/dbaccess/source/ui/misc/makefile.mk +++ b/dbaccess/source/ui/misc/makefile.mk @@ -25,8 +25,8 @@ # #************************************************************************* -PRJ=..$/..$/.. -PRJINC=$(PRJ)$/source +PRJ=../../.. +PRJINC=$(PRJ)/source PRJNAME=dbaccess TARGET=uimisc @@ -35,50 +35,53 @@ ENABLE_EXCEPTIONS=TRUE # --- Settings ---------------------------------- .INCLUDE : settings.mk -.INCLUDE : $(PRJ)$/util$/makefile.pmk +.INCLUDE : $(PRJ)/util/makefile.pmk # --- Files ------------------------------------- # ... resource files ............................ SRS1NAME=$(TARGET) -SRC1FILES = \ - dbumiscres.src \ +SRC1FILES = \ + dbumiscres.src \ WizardPages.src # ... object files ............................ -SLOFILES= \ - $(SLO)$/asyncmodaldialog.obj \ - $(SLO)$/imageprovider.obj \ - $(SLO)$/singledoccontroller.obj \ - $(SLO)$/datasourceconnector.obj \ - $(SLO)$/linkeddocuments.obj \ - $(SLO)$/indexcollection.obj \ - $(SLO)$/UITools.obj \ - $(SLO)$/WCPage.obj \ - $(SLO)$/WCopyTable.obj \ - $(SLO)$/WTypeSelect.obj \ - $(SLO)$/TokenWriter.obj \ - $(SLO)$/HtmlReader.obj \ - $(SLO)$/RtfReader.obj \ - $(SLO)$/propertysetitem.obj \ - $(SLO)$/databaseobjectview.obj \ - $(SLO)$/DExport.obj \ - $(SLO)$/uiservices.obj \ - $(SLO)$/RowSetDrop.obj \ - $(SLO)$/TableCopyHelper.obj \ - $(SLO)$/moduledbu.obj \ - $(SLO)$/WColumnSelect.obj \ - $(SLO)$/WExtendPages.obj \ - $(SLO)$/WNameMatch.obj \ - $(SLO)$/ToolBoxHelper.obj \ - $(SLO)$/stringlistitem.obj \ - $(SLO)$/charsets.obj \ - $(SLO)$/defaultobjectnamecheck.obj \ - $(SLO)$/dsmeta.obj \ - $(SLO)$/controllerframe.obj \ - $(SLO)$/propertystorage.obj +SLOFILES= \ + $(SLO)/asyncmodaldialog.obj \ + $(SLO)/imageprovider.obj \ + $(SLO)/singledoccontroller.obj \ + $(SLO)/dbsubcomponentcontroller.obj \ + $(SLO)/datasourceconnector.obj \ + $(SLO)/linkeddocuments.obj \ + $(SLO)/indexcollection.obj \ + $(SLO)/UITools.obj \ + $(SLO)/WCPage.obj \ + $(SLO)/WCopyTable.obj \ + $(SLO)/WTypeSelect.obj \ + $(SLO)/TokenWriter.obj \ + $(SLO)/HtmlReader.obj \ + $(SLO)/RtfReader.obj \ + $(SLO)/propertysetitem.obj \ + $(SLO)/databaseobjectview.obj \ + $(SLO)/DExport.obj \ + $(SLO)/uiservices.obj \ + $(SLO)/RowSetDrop.obj \ + $(SLO)/TableCopyHelper.obj \ + $(SLO)/moduledbu.obj \ + $(SLO)/WColumnSelect.obj \ + $(SLO)/WExtendPages.obj \ + $(SLO)/WNameMatch.obj \ + $(SLO)/ToolBoxHelper.obj \ + $(SLO)/stringlistitem.obj \ + $(SLO)/charsets.obj \ + $(SLO)/defaultobjectnamecheck.obj \ + $(SLO)/dsmeta.obj \ + $(SLO)/controllerframe.obj \ + $(SLO)/propertystorage.obj \ + $(SLO)/dbaundomanager.obj \ + # --- Targets ---------------------------------- .INCLUDE : target.mk diff --git a/dbaccess/source/ui/misc/singledoccontroller.cxx b/dbaccess/source/ui/misc/singledoccontroller.cxx index 590403c49fa9..4f6d7b909d55 100644..100755 --- a/dbaccess/source/ui/misc/singledoccontroller.cxx +++ b/dbaccess/source/ui/misc/singledoccontroller.cxx @@ -1,6 +1,5 @@ /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* - * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * Copyright 2000, 2010 Oracle and/or its affiliates. @@ -26,719 +25,180 @@ * ************************************************************************/ -// MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_dbaccess.hxx" +#include "dbaundomanager.hxx" +#include "singledoccontroller.hxx" #include "browserids.hxx" -#include "commontypes.hxx" -#include "dataview.hxx" #include "dbu_misc.hrc" #include "dbustrings.hrc" #include "moduledbu.hxx" -#include "singledoccontroller.hxx" -#include <com/sun/star/frame/XUntitledNumbers.hpp> /** === begin UNO includes === **/ -#include <com/sun/star/beans/PropertyAttribute.hpp> -#include <com/sun/star/container/XChild.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/sdb/XDocumentDataSource.hpp> -#include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp> -#include <com/sun/star/sdbc/XDataSource.hpp> -#include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <com/sun/star/frame/XUntitledNumbers.hpp> /** === end UNO includes === **/ -#include <comphelper/sequence.hxx> -#include <comphelper/types.hxx> -#include <connectivity/dbexception.hxx> -#include <connectivity/dbtools.hxx> -#include <cppuhelper/typeprovider.hxx> -#include <rtl/ustrbuf.hxx> -#include <toolkit/unohlp.hxx> -#include <tools/diagnose_ex.h> +#include <svl/undo.hxx> #include <osl/diagnose.h> -#include <vcl/msgbox.hxx> -//........................................................................ +#include <boost/scoped_ptr.hpp> + +//...................................................................................................................... namespace dbaui { -//........................................................................ +//...................................................................................................................... /** === begin UNO using === **/ - using ::com::sun::star::uno::Any; using ::com::sun::star::uno::Reference; - using ::com::sun::star::beans::XPropertySet; - using ::com::sun::star::util::XNumberFormatter; - using ::com::sun::star::lang::XMultiServiceFactory; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; using ::com::sun::star::uno::Sequence; using ::com::sun::star::uno::Type; - using ::com::sun::star::sdbc::XConnection; - using ::com::sun::star::uno::UNO_QUERY; - using ::com::sun::star::container::XChild; - using ::com::sun::star::sdbc::XDataSource; - using ::com::sun::star::util::XNumberFormatter; - using ::com::sun::star::util::XNumberFormatsSupplier; - using ::com::sun::star::frame::XFrame; - using ::com::sun::star::uno::Exception; - using ::com::sun::star::sdbc::SQLException; - using ::com::sun::star::lang::EventObject; + using ::com::sun::star::document::XUndoManager; + using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::beans::PropertyValue; - using ::com::sun::star::frame::XModel; - using ::com::sun::star::sdb::XOfficeDatabaseDocument; - using ::com::sun::star::awt::XWindow; - using ::com::sun::star::sdbc::XDatabaseMetaData; - using ::com::sun::star::sdb::XDocumentDataSource; - using ::com::sun::star::document::XEmbeddedScripts; - using ::com::sun::star::lang::IllegalArgumentException; - using ::com::sun::star::uno::UNO_SET_THROW; - using ::com::sun::star::uno::UNO_QUERY_THROW; - using ::com::sun::star::frame::XUntitledNumbers; - using ::com::sun::star::beans::PropertyVetoException; + using ::com::sun::star::lang::EventObject; /** === end UNO using === **/ - class DataSourceHolder + //================================================================================================================== + //= OSingleDocumentController_Data + //================================================================================================================== + struct OSingleDocumentController_Data { - public: - DataSourceHolder() - { - } + ::boost::scoped_ptr< UndoManager > m_pUndoManager; - DataSourceHolder( const Reference< XDataSource >& _rxDataSource ) + OSingleDocumentController_Data( ::cppu::OWeakObject& i_parent, ::osl::Mutex& i_mutex ) + :m_pUndoManager( new UndoManager( i_parent, i_mutex ) ) { - m_xDataSource = _rxDataSource; - Reference< XDocumentDataSource > xDocDS( m_xDataSource, UNO_QUERY ); - if ( xDocDS.is() ) - m_xDocument = xDocDS->getDatabaseDocument(); - - m_xDataSourceProps.set( m_xDataSource, UNO_QUERY ); } - - const Reference< XDataSource >& getDataSource() const { return m_xDataSource; } - const Reference< XPropertySet >& getDataSourceProps() const { return m_xDataSourceProps; } - const Reference< XOfficeDatabaseDocument > getDatabaseDocument() const { return m_xDocument; } - - bool is() const { return m_xDataSource.is(); } - - void clear() - { - m_xDataSource.clear(); - m_xDocument.clear(); - } - - private: - Reference< XDataSource > m_xDataSource; - Reference< XPropertySet > m_xDataSourceProps; - Reference< XOfficeDatabaseDocument > m_xDocument; }; - struct OSingleDocumentControllerImpl - { - private: - ::boost::optional< bool > m_aDocScriptSupport; - - public: - OModuleClient m_aModuleClient; - ::dbtools::SQLExceptionInfo m_aCurrentError; // contains the current error which can be set through IEnvironment - - ::cppu::OInterfaceContainerHelper - m_aModifyListeners; - - // <properties> - SharedConnection m_xConnection; - ::dbtools::DatabaseMetaData m_aSdbMetaData; - // </properties> - ::rtl::OUString m_sDataSourceName; // the data source we're working for - DataSourceHolder m_aDataSource; - Reference< XModel > m_xDocument; - Reference< XNumberFormatter > m_xFormatter; // a number formatter working with the connection's NumberFormatsSupplier - sal_Int32 m_nDocStartNumber; - sal_Bool m_bSuspended; // is true when the controller was already suspended - sal_Bool m_bEditable; // is the control readonly or not - sal_Bool m_bModified; // is the data modified - bool m_bNotAttached; - - OSingleDocumentControllerImpl( ::osl::Mutex& i_rMutex ) - :m_aDocScriptSupport() - ,m_aModifyListeners( i_rMutex ) - ,m_nDocStartNumber(0) - ,m_bSuspended( sal_False ) - ,m_bEditable(sal_True) - ,m_bModified(sal_False) - ,m_bNotAttached(true) - { - } - - bool documentHasScriptSupport() const - { - OSL_PRECOND( !!m_aDocScriptSupport, - "OSingleDocumentControllerImpl::documentHasScriptSupport: not completely initialized, yet - don't know!?" ); - return !!m_aDocScriptSupport && *m_aDocScriptSupport; - } - - void setDocumentScriptSupport( const bool _bSupport ) - { - OSL_PRECOND( !m_aDocScriptSupport, - "OSingleDocumentControllerImpl::setDocumentScriptSupport: already initialized!" ); - m_aDocScriptSupport = ::boost::optional< bool >( _bSupport ); - } - }; - - //==================================================================== + //================================================================================================================== //= OSingleDocumentController - //==================================================================== - //-------------------------------------------------------------------- - OSingleDocumentController::OSingleDocumentController(const Reference< XMultiServiceFactory >& _rxORB) + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + OSingleDocumentController::OSingleDocumentController( const Reference< XMultiServiceFactory >& _rxORB ) :OSingleDocumentController_Base( _rxORB ) - ,m_pImpl( new OSingleDocumentControllerImpl( getMutex() ) ) + ,m_pData( new OSingleDocumentController_Data( *this, getMutex() ) ) { } - //-------------------------------------------------------------------- + //------------------------------------------------------------------------------------------------------------------ OSingleDocumentController::~OSingleDocumentController() { } - //-------------------------------------------------------------------- - void OSingleDocumentController::impl_initialize() - { - OGenericUnoController::impl_initialize(); - - const ::comphelper::NamedValueCollection& rArguments( getInitParams() ); - - Reference< XConnection > xConnection; - xConnection = rArguments.getOrDefault( (::rtl::OUString)PROPERTY_ACTIVE_CONNECTION, xConnection ); - - if ( !xConnection.is() ) - ::dbtools::isEmbeddedInDatabase( getModel(), xConnection ); - - if ( xConnection.is() ) - initializeConnection( xConnection ); - - bool bShowError = true; - if ( !isConnected() ) - { - reconnect( sal_False ); - bShowError = false; - } - if ( !isConnected() ) - { - if ( bShowError ) - connectionLostMessage(); - throw IllegalArgumentException(); - } - } - - //-------------------------------------------------------------------- - Any SAL_CALL OSingleDocumentController::queryInterface(const Type& _rType) throw (RuntimeException) - { - if ( _rType.equals( XScriptInvocationContext::static_type() ) ) - { - if ( m_pImpl->documentHasScriptSupport() ) - return makeAny( Reference< XScriptInvocationContext >( this ) ); - return Any(); - } - - return OSingleDocumentController_Base::queryInterface( _rType ); - } - - //-------------------------------------------------------------------- - Sequence< Type > SAL_CALL OSingleDocumentController::getTypes( ) throw (RuntimeException) - { - Sequence< Type > aTypes( OSingleDocumentController_Base::getTypes() ); - if ( !m_pImpl->documentHasScriptSupport() ) - { - Sequence< Type > aStrippedTypes( aTypes.getLength() - 1 ); - ::std::remove_copy_if( - aTypes.getConstArray(), - aTypes.getConstArray() + aTypes.getLength(), - aStrippedTypes.getArray(), - ::std::bind2nd( ::std::equal_to< Type >(), XScriptInvocationContext::static_type() ) - ); - aTypes = aStrippedTypes; - } - return aTypes; - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::initializeConnection( const Reference< XConnection >& _rxForeignConn ) - { - OSL_ENSURE( !isConnected(), "OSingleDocumentController::initializeConnection: not to be called when already connected!" ); - // usually this gets called from within initialize of derived classes ... - if ( isConnected() ) - disconnect(); - - m_pImpl->m_xConnection.reset( _rxForeignConn, SharedConnection::NoTakeOwnership ); - m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); - startConnectionListening( m_pImpl->m_xConnection ); - - // get the data source the connection belongs to - try - { - // determine our data source - OSL_PRECOND( !m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: already a data source in this phase?" ); - { - Reference< XChild > xConnAsChild( m_pImpl->m_xConnection, UNO_QUERY ); - Reference< XDataSource > xDS; - if ( xConnAsChild.is() ) - xDS = Reference< XDataSource >( xConnAsChild->getParent(), UNO_QUERY ); - - // (take the indirection through XDataSource to ensure we have a correct object ....) - m_pImpl->m_aDataSource = xDS; - } - OSL_POSTCOND( m_pImpl->m_aDataSource.is(), "OSingleDocumentController::initializeConnection: unable to obtain the data source object!" ); - - if ( m_pImpl->m_bNotAttached ) - { - Reference< XUntitledNumbers > xUntitledProvider( getDatabaseDocument(), UNO_QUERY ); - m_pImpl->m_nDocStartNumber = 1; - if ( xUntitledProvider.is() ) - m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); - } - - // determine the availability of script support in our document. Our own XScriptInvocationContext - // interface depends on this - m_pImpl->setDocumentScriptSupport( Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY ).is() ); - - // get a number formatter - Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps(), UNO_SET_THROW ); - xDataSourceProps->getPropertyValue( PROPERTY_NAME ) >>= m_pImpl->m_sDataSourceName; - OSL_ENSURE( m_pImpl->m_sDataSourceName.getLength(), "OSingleDocumentController::initializeConnection: invalid data source name!" ); - Reference< XNumberFormatsSupplier> xSupplier = ::dbtools::getNumberFormats(m_pImpl->m_xConnection); - if(xSupplier.is()) - { - m_pImpl->m_xFormatter = Reference< XNumberFormatter >(getORB() - ->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatter"))), UNO_QUERY); - m_pImpl->m_xFormatter->attachNumberFormatsSupplier(xSupplier); - } - OSL_ENSURE(m_pImpl->m_xFormatter.is(),"No NumberFormatter!"); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::reconnect( sal_Bool _bUI ) - { - OSL_ENSURE(!m_pImpl->m_bSuspended, "Cannot reconnect while suspended!"); - - stopConnectionListening( m_pImpl->m_xConnection ); - m_pImpl->m_aSdbMetaData.reset( NULL ); - m_pImpl->m_xConnection.clear(); - - // reconnect - sal_Bool bReConnect = sal_True; - if ( _bUI ) - { - QueryBox aQuery( getView(), ModuleRes(QUERY_CONNECTION_LOST) ); - bReConnect = ( RET_YES == aQuery.Execute() ); - } - - // now really reconnect ... - if ( bReConnect ) - { - m_pImpl->m_xConnection.reset( connect( m_pImpl->m_aDataSource.getDataSource(), NULL ), SharedConnection::TakeOwnership ); - m_pImpl->m_aSdbMetaData.reset( m_pImpl->m_xConnection ); - } - - // invalidate all slots - InvalidateAll(); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::disconnect() - { - stopConnectionListening(m_pImpl->m_xConnection); - m_pImpl->m_aSdbMetaData.reset( NULL ); - m_pImpl->m_xConnection.clear(); - - InvalidateAll(); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::losingConnection() - { - // our connection was disposed so we need a new one - reconnect( sal_True ); - } - - //-------------------------------------------------------------------- + // ----------------------------------------------------------------------------- void SAL_CALL OSingleDocumentController::disposing() { OSingleDocumentController_Base::disposing(); - m_aUndoManager.Clear(); - - disconnect(); - - attachFrame( Reference < XFrame >() ); - - m_pImpl->m_aDataSource.clear(); - } - - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::Construct(Window* _pParent) - { - OSL_ENSURE( getView(), "OSingleDocumentController::Construct: have no view!" ); - if ( getView() ) - getView()->enableSeparator( ); - - return OSingleDocumentController_Base::Construct( _pParent ); - } - - //-------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::disposing(const EventObject& _rSource) throw( RuntimeException ) - { - if ( _rSource.Source == getConnection() ) - { - if ( !m_pImpl->m_bSuspended // when already suspended then we don't have to reconnect - && !getBroadcastHelper().bInDispose - && !getBroadcastHelper().bDisposed - && isConnected() - ) - { - losingConnection(); - } - else - { - m_pImpl->m_xConnection.reset( m_pImpl->m_xConnection, SharedConnection::NoTakeOwnership ); - // this prevents the "disposeComponent" call in disconnect - disconnect(); - } - } - else - OSingleDocumentController_Base::disposing( _rSource ); - } - - //-------------------------------------------------------------------- - void OSingleDocumentController::appendError( const ::rtl::OUString& _rErrorMessage, const ::dbtools::StandardSQLState _eSQLState, - const sal_Int32 _nErrorCode ) - { - m_pImpl->m_aCurrentError.append( ::dbtools::SQLExceptionInfo::SQL_EXCEPTION, _rErrorMessage, getStandardSQLStateAscii( _eSQLState ), - _nErrorCode ); - } - //-------------------------------------------------------------------- - void OSingleDocumentController::clearError() - { - m_pImpl->m_aCurrentError = ::dbtools::SQLExceptionInfo(); + ClearUndoManager(); + m_pData->m_pUndoManager->disposing(); } - //-------------------------------------------------------------------- - sal_Bool OSingleDocumentController::hasError() const + // ----------------------------------------------------------------------------- + void SAL_CALL OSingleDocumentController::disposing( const EventObject& i_event ) throw( RuntimeException ) { - return m_pImpl->m_aCurrentError.isValid(); + // simply disambiguate + OSingleDocumentController_Base::disposing( i_event ); } - //-------------------------------------------------------------------- - const ::dbtools::SQLExceptionInfo& OSingleDocumentController::getError() const + // ----------------------------------------------------------------------------- + void OSingleDocumentController::ClearUndoManager() { - return m_pImpl->m_aCurrentError; + GetUndoManager().Clear(); } - //-------------------------------------------------------------------- - void OSingleDocumentController::displayError() + // ----------------------------------------------------------------------------- + SfxUndoManager& OSingleDocumentController::GetUndoManager() const { - showError( m_pImpl->m_aCurrentError ); + return m_pData->m_pUndoManager->GetSfxUndoManager(); } - //-------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::suspend(sal_Bool bSuspend) throw( RuntimeException ) + // ----------------------------------------------------------------------------- + void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) { - m_pImpl->m_bSuspended = bSuspend; - if ( !bSuspend && !isConnected() ) - reconnect(sal_True); + // add undo action + GetUndoManager().AddUndoAction( _pAction ); + // when we add an undo action the controller was modified + setModified( sal_True ); - return sal_True; + // now inform me that or states changed + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); } // ----------------------------------------------------------------------------- - sal_Bool SAL_CALL OSingleDocumentController::attachModel( const Reference< XModel > & _rxModel) throw( RuntimeException ) + Reference< XUndoManager > SAL_CALL OSingleDocumentController::getUndoManager( ) throw (RuntimeException) { - if ( !_rxModel.is() ) - return sal_False; - if ( !OSingleDocumentController_Base::attachModel( _rxModel ) ) - return sal_False; - - m_pImpl->m_bNotAttached = false; - if ( m_pImpl->m_nDocStartNumber == 1 ) - releaseNumberForComponent(); - - Reference< XUntitledNumbers > xUntitledProvider( _rxModel, UNO_QUERY ); - m_pImpl->m_nDocStartNumber = 1; - if ( xUntitledProvider.is() ) - m_pImpl->m_nDocStartNumber = xUntitledProvider->leaseNumber( static_cast< XWeak* >( this ) ); - - return sal_True; + return m_pData->m_pUndoManager.get(); } // ----------------------------------------------------------------------------- FeatureState OSingleDocumentController::GetState(sal_uInt16 _nId) const { FeatureState aReturn; - // (disabled automatically) - aReturn.bEnabled = sal_True; - - switch (_nId) + switch ( _nId ) { case ID_BROWSER_UNDO: - aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetUndoActionCount() != 0; + aReturn.bEnabled = isEditable() && GetUndoManager().GetUndoActionCount() != 0; if ( aReturn.bEnabled ) { String sUndo(ModuleRes(STR_UNDO_COLON)); sUndo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); - sUndo += m_aUndoManager.GetUndoActionComment(); + sUndo += GetUndoManager().GetUndoActionComment(); aReturn.sTitle = sUndo; } break; + case ID_BROWSER_REDO: - aReturn.bEnabled = m_pImpl->m_bEditable && m_aUndoManager.GetRedoActionCount() != 0; + aReturn.bEnabled = isEditable() && GetUndoManager().GetRedoActionCount() != 0; if ( aReturn.bEnabled ) { String sRedo(ModuleRes(STR_REDO_COLON)); sRedo += String(RTL_CONSTASCII_USTRINGPARAM(" ")); - sRedo += m_aUndoManager.GetRedoActionComment(); + sRedo += GetUndoManager().GetRedoActionComment(); aReturn.sTitle = sRedo; } break; + default: aReturn = OSingleDocumentController_Base::GetState(_nId); } return aReturn; } // ----------------------------------------------------------------------------- - void OSingleDocumentController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs) + void OSingleDocumentController::Execute( sal_uInt16 _nId, const Sequence< PropertyValue >& _rArgs ) { - switch(_nId) + switch ( _nId ) { - case ID_BROWSER_CLOSE: - closeTask(); - return; case ID_BROWSER_UNDO: - m_aUndoManager.Undo(); - InvalidateFeature(ID_BROWSER_REDO); + GetUndoManager().Undo(); + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); break; + case ID_BROWSER_REDO: - m_aUndoManager.Redo(); - InvalidateFeature(ID_BROWSER_UNDO); + GetUndoManager().Redo(); + InvalidateFeature( ID_BROWSER_UNDO ); + InvalidateFeature( ID_BROWSER_REDO ); break; + default: OSingleDocumentController_Base::Execute( _nId, _rArgs ); break; } InvalidateFeature(_nId); } - // ----------------------------------------------------------------------------- - SfxUndoManager* OSingleDocumentController::getUndoMgr() - { - return &m_aUndoManager; - } - // ----------------------------------------------------------------------------- - void OSingleDocumentController::addUndoActionAndInvalidate(SfxUndoAction *_pAction) - { - // add undo action - m_aUndoManager.AddUndoAction(_pAction); - // when we add an undo action the controller was modified - setModified(sal_True); - // now inform me that or states changed - InvalidateFeature(ID_BROWSER_UNDO); - InvalidateFeature(ID_BROWSER_REDO); - } - - // ----------------------------------------------------------------------------- - ::rtl::OUString OSingleDocumentController::getDataSourceName() const - { - ::rtl::OUString sName; - Reference< XPropertySet > xDataSourceProps( m_pImpl->m_aDataSource.getDataSourceProps() ); - if ( xDataSourceProps.is() ) - xDataSourceProps->getPropertyValue(PROPERTY_NAME) >>= sName; - return sName; - } - // ----------------------------------------------------------------------------- - void OSingleDocumentController::connectionLostMessage() const - { - String aMessage(ModuleRes(RID_STR_CONNECTION_LOST)); - Reference< XWindow > xWindow = getTopMostContainerWindow(); - Window* pWin = NULL; - if ( xWindow.is() ) - pWin = VCLUnoHelper::GetWindow(xWindow); - if ( !pWin ) - pWin = getView()->Window::GetParent(); - - InfoBox(pWin, aMessage).Execute(); - } - // ----------------------------------------------------------------------------- - const Reference< XConnection >& OSingleDocumentController::getConnection() const - { - return m_pImpl->m_xConnection; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isReadOnly() const - { - return !m_pImpl->m_bEditable; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isEditable() const - { - return m_pImpl->m_bEditable; - } - - // ----------------------------------------------------------------------------- - void OSingleDocumentController::setEditable(sal_Bool _bEditable) - { - m_pImpl->m_bEditable = _bEditable; - } - - // ----------------------------------------------------------------------------- - const ::dbtools::DatabaseMetaData& OSingleDocumentController::getSdbMetaData() const - { - return m_pImpl->m_aSdbMetaData; - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::isConnected() const - { - return m_pImpl->m_xConnection.is(); - } - - // ----------------------------------------------------------------------------- - Reference< XDatabaseMetaData > OSingleDocumentController::getMetaData( ) const - { - Reference< XDatabaseMetaData > xMeta; - try - { - if ( isConnected() ) - xMeta.set( m_pImpl->m_xConnection->getMetaData(), UNO_SET_THROW ); - } - catch( const Exception& ) - { - DBG_UNHANDLED_EXCEPTION(); - } - return xMeta; - } - - // ----------------------------------------------------------------------------- - const Reference< XPropertySet >& OSingleDocumentController::getDataSource() const - { - return m_pImpl->m_aDataSource.getDataSourceProps(); - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::haveDataSource() const - { - return m_pImpl->m_aDataSource.is(); - } - - // ----------------------------------------------------------------------------- - Reference< XModel > OSingleDocumentController::getDatabaseDocument() const - { - return Reference< XModel >( m_pImpl->m_aDataSource.getDatabaseDocument(), UNO_QUERY ); - } - - // ----------------------------------------------------------------------------- - Reference< XNumberFormatter > OSingleDocumentController::getNumberFormatter() const - { - return m_pImpl->m_xFormatter; - } - - // ----------------------------------------------------------------------------- - Reference< XModel > OSingleDocumentController::getPrivateModel() const - { - return getDatabaseDocument(); - } - // ----------------------------------------------------------------------------- - // XTitle - ::rtl::OUString SAL_CALL OSingleDocumentController::getTitle() - throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - if ( m_bExternalTitle ) - return impl_getTitleHelper_throw()->getTitle (); - - ::rtl::OUStringBuffer sTitle; - Reference< XTitle > xTitle(getPrivateModel(),UNO_QUERY); - if ( xTitle.is() ) - { - sTitle.append( xTitle->getTitle() ); - sTitle.appendAscii(" : "); - } - sTitle.append( getPrivateTitle() ); - - return sTitle.makeStringAndClear(); - } - // ----------------------------------------------------------------------------- - sal_Int32 OSingleDocumentController::getCurrentStartNumber() const - { - return m_pImpl->m_nDocStartNumber; - } - - // ----------------------------------------------------------------------------- - Reference< XEmbeddedScripts > SAL_CALL OSingleDocumentController::getScriptContainer() throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - if ( !m_pImpl->documentHasScriptSupport() ) - return NULL; - - return Reference< XEmbeddedScripts >( getDatabaseDocument(), UNO_QUERY_THROW ); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::addModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - m_pImpl->m_aModifyListeners.addInterface( i_Listener ); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::removeModifyListener( const Reference< XModifyListener >& i_Listener ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - m_pImpl->m_aModifyListeners.removeInterface( i_Listener ); - } - - // ----------------------------------------------------------------------------- - ::sal_Bool SAL_CALL OSingleDocumentController::isModified( ) throw (RuntimeException) - { - ::osl::MutexGuard aGuard( getMutex() ); - return impl_isModified(); - } - - // ----------------------------------------------------------------------------- - void SAL_CALL OSingleDocumentController::setModified( ::sal_Bool i_bModified ) throw (PropertyVetoException, RuntimeException) - { - ::osl::ClearableMutexGuard aGuard( getMutex() ); - - if ( m_pImpl->m_bModified == i_bModified ) - return; - - m_pImpl->m_bModified = i_bModified; - impl_onModifyChanged(); - - EventObject aEvent( *this ); - aGuard.clear(); - m_pImpl->m_aModifyListeners.notifyEach( &XModifyListener::modified, aEvent ); - } - - // ----------------------------------------------------------------------------- - sal_Bool OSingleDocumentController::impl_isModified() const - { - return m_pImpl->m_bModified; - } - - // ----------------------------------------------------------------------------- - void OSingleDocumentController::impl_onModifyChanged() - { - InvalidateFeature( ID_BROWSER_SAVEDOC ); - if ( isFeatureSupported( ID_BROWSER_SAVEASDOC ) ) - InvalidateFeature( ID_BROWSER_SAVEASDOC ); - } -//........................................................................ -} // namespace dbaui -//........................................................................ +//...................................................................................................................... +} // namespace dbaui +//...................................................................................................................... -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/dbaccess/source/ui/misc/uiservices.cxx b/dbaccess/source/ui/misc/uiservices.cxx index 8ea14059692c..0a2dafc25bd0 100644 --- a/dbaccess/source/ui/misc/uiservices.cxx +++ b/dbaccess/source/ui/misc/uiservices.cxx @@ -118,28 +118,6 @@ extern "C" DBACCESS_DLLPUBLIC void SAL_CALL component_getImplementationEnvironme } //--------------------------------------------------------------------------------------- -extern "C" DBACCESS_DLLPUBLIC sal_Bool SAL_CALL component_writeInfo( - void* pServiceManager, - void* pRegistryKey - ) -{ - if (pRegistryKey) - try - { - writeDBLoaderInfo(pRegistryKey); - return ::dbaui::OModuleRegistration::writeComponentInfos( - static_cast<XMultiServiceFactory*>(pServiceManager), - static_cast<XRegistryKey*>(pRegistryKey)); - } - catch (InvalidRegistryException& ) - { - OSL_ENSURE(sal_False, "DBA::component_writeInfo : could not create a registry key ! ## InvalidRegistryException !"); - } - - return sal_False; -} - -//--------------------------------------------------------------------------------------- extern "C" DBACCESS_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* pImplementationName, void* pServiceManager, diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx index 7e44ea1c256f..91d67b82108c 100644 --- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx +++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx @@ -233,7 +233,7 @@ void calcPointX2(const OTableWindow* _pWin,Point& _rNewConPos,Point& _rNewDescrP _rNewConPos.X() -= DESCRIPT_LINE_WIDTH; } //------------------------------------------------------------------------ -BOOL OConnectionLine::RecalcLine() +sal_Bool OConnectionLine::RecalcLine() { ////////////////////////////////////////////////////////////////////// // Fenster und Entries muessen gesetzt sein @@ -241,7 +241,7 @@ BOOL OConnectionLine::RecalcLine() const OTableWindow* pDestWin = m_pTabConn->GetDestWin(); if( !pSourceWin || !pDestWin ) - return FALSE; + return sal_False; SvLBoxEntry* pSourceEntry = pSourceWin->GetListBox()->GetEntryFromText( GetData()->GetSourceFieldName() ); SvLBoxEntry* pDestEntry = pDestWin->GetListBox()->GetEntryFromText( GetData()->GetDestFieldName() ); @@ -284,14 +284,14 @@ BOOL OConnectionLine::RecalcLine() // aDestConnPosY bestimmen calcPointsYValue(pDestWin,pDestEntry,m_aDestConnPos,m_aDestDescrLinePos); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- //------------------------------------------------------------------------ void OConnectionLine::Draw( OutputDevice* pOutDev ) { - const UINT16 nRectSize = 3; + const sal_uInt16 nRectSize = 3; ////////////////////////////////////////////////////////////////////// // Neue Dimensionen berechnen @@ -324,7 +324,7 @@ void OConnectionLine::Draw( OutputDevice* pOutDev ) pOutDev->DrawRect( calcRect( m_aDestDescrLinePos,aVector) ); } // ----------------------------------------------------------------------------- -BOOL OConnectionLine::IsValid() const +sal_Bool OConnectionLine::IsValid() const { return m_pData.is(); } diff --git a/dbaccess/source/ui/querydesign/JoinController.cxx b/dbaccess/source/ui/querydesign/JoinController.cxx index 0d5a8204b02d..f4552253d84f 100644 --- a/dbaccess/source/ui/querydesign/JoinController.cxx +++ b/dbaccess/source/ui/querydesign/JoinController.cxx @@ -142,7 +142,7 @@ bool AddTableDialogContext::allowAddition() const // ----------------------------------------------------------------------------- void AddTableDialogContext::addTableWindow( const String& _rQualifiedTableName, const String& _rAliasName ) { - getTableView()->AddTabWin( _rQualifiedTableName, _rAliasName, TRUE ); + getTableView()->AddTabWin( _rQualifiedTableName, _rAliasName, sal_True ); } // ----------------------------------------------------------------------------- @@ -308,7 +308,7 @@ void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& if ( m_pAddTableDialog->IsVisible() ) { - m_pAddTableDialog->Show( FALSE ); + m_pAddTableDialog->Show( sal_False ); getView()->GrabFocus(); } else @@ -317,7 +317,7 @@ void OJoinController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& WaitObject aWaitCursor( getView() ); m_pAddTableDialog->Update(); } - m_pAddTableDialog->Show( TRUE ); + m_pAddTableDialog->Show( sal_True ); ::dbaui::notifySystemWindow(getView(),m_pAddTableDialog,::comphelper::mem_fun(&TaskPaneList::AddWindow)); } break; diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index 65399065dbce..f2d906e5017a 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -181,7 +181,7 @@ OJoinTableView::OJoinTableView( Window* pParent, OJoinDesignView* pView ) ,m_pDragWin( NULL ) ,m_pSizingWin( NULL ) ,m_pSelectedConn( NULL ) - ,m_bTrackingInitiallyMoved(FALSE) + ,m_bTrackingInitiallyMoved(sal_False) ,m_pLastFocusTabWin(NULL) ,m_pView( pView ) ,m_pAccessible(NULL) @@ -212,7 +212,7 @@ IMPL_LINK( OJoinTableView, ScrollHdl, ScrollBar*, pScrollBar ) { ////////////////////////////////////////////////////////////////////// // Alle Fenster verschieben - ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), FALSE ); + ScrollPane( pScrollBar->GetDelta(), (pScrollBar == GetHScrollBar()), sal_False ); return 0; } @@ -250,7 +250,7 @@ void OJoinTableView::Resize() } } //------------------------------------------------------------------------------ -ULONG OJoinTableView::GetTabWinCount() +sal_uLong OJoinTableView::GetTabWinCount() { DBG_CHKTHIS(OJoinTableView,NULL); return m_aTableMap.size(); @@ -333,7 +333,7 @@ OTableWindowData* OJoinTableView::CreateImpl(const ::rtl::OUString& _rComposedNa return new OTableWindowData( NULL,_rComposedName,_sTableName, _rWinName ); } //------------------------------------------------------------------------------ -void OJoinTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL /*bNewTable*/) +void OJoinTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool /*bNewTable*/) { DBG_CHKTHIS(OJoinTableView,NULL); OSL_ENSURE(_rComposedName.getLength(),"There must be a table name supplied!"); @@ -430,7 +430,7 @@ void OJoinTableView::RemoveTabWin( OTableWindow* pTabWin ) namespace { // ----------------------------------------------------------------------------- - BOOL isScrollAllowed( OJoinTableView* _pView,long nDelta, BOOL bHoriz) + sal_Bool isScrollAllowed( OJoinTableView* _pView,long nDelta, sal_Bool bHoriz) { ////////////////////////////////////////////////////////////////////// // adjust ScrollBar-Positions @@ -448,15 +448,15 @@ namespace if ( bHoriz ) { if( nNewThumbPos == _pView->GetScrollOffset().X() ) - return FALSE; + return sal_False; } else if ( nNewThumbPos == _pView->GetScrollOffset().Y() ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- - BOOL getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,long& _nScrollX,long& _nScrollY) + sal_Bool getMovementImpl(OJoinTableView* _pView,const Point& _rPoint,const Size& _rSize,long& _nScrollX,long& _nScrollY) { _nScrollY = _nScrollX = 0; // data about the tab win @@ -468,9 +468,9 @@ namespace // data about ourself Size aSize = _pView->getRealOutputSize(); //GetOutputSizePixel(); - BOOL bVisbile = TRUE; - BOOL bFitsHor = (aUpperLeft.X() >= 0) && (aLowerRight.X() <= aSize.Width()); - BOOL bFitsVert= (aUpperLeft.Y() >= 0) && (aLowerRight.Y() <= aSize.Height()); + sal_Bool bVisbile = sal_True; + sal_Bool bFitsHor = (aUpperLeft.X() >= 0) && (aLowerRight.X() <= aSize.Width()); + sal_Bool bFitsVert= (aUpperLeft.Y() >= 0) && (aLowerRight.Y() <= aSize.Height()); if (!bFitsHor || !bFitsVert) { if (!bFitsHor) @@ -495,10 +495,10 @@ namespace } if ( _nScrollX ) // aSize.Width() > _rSize.Width() && - bVisbile = isScrollAllowed(_pView,_nScrollX, TRUE); + bVisbile = isScrollAllowed(_pView,_nScrollX, sal_True); if ( _nScrollY ) // aSize.Height() > _rSize.Height() && - bVisbile = bVisbile && isScrollAllowed(_pView,_nScrollY, FALSE); + bVisbile = bVisbile && isScrollAllowed(_pView,_nScrollY, sal_False); if ( bVisbile ) { @@ -506,9 +506,9 @@ namespace sal_Int32 nVRangeMax = _pView->GetVScrollBar()->GetRangeMax(); if ( aSize.Width() + _pView->GetHScrollBar()->GetThumbPos() + _nScrollX > nHRangeMax ) - bVisbile = FALSE; + bVisbile = sal_False; if ( bVisbile && aSize.Height() + _pView->GetVScrollBar()->GetThumbPos() + _nScrollY > nVRangeMax ) - bVisbile = FALSE; + bVisbile = sal_False; } } @@ -517,7 +517,7 @@ namespace } } // end of ano namespace // ----------------------------------------------------------------------------- -BOOL OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize) +sal_Bool OJoinTableView::isMovementAllowed(const Point& _rPoint,const Size& _rSize) { long nX,nY; return getMovementImpl(this,_rPoint,_rSize,nX,nY); @@ -537,12 +537,12 @@ void OJoinTableView::EnsureVisible(const Point& _rPoint,const Size& _rSize) if ( getMovementImpl(this,_rPoint,_rSize,nScrollX,nScrollY) ) { - BOOL bVisbile = TRUE; + sal_Bool bVisbile = sal_True; if (nScrollX) - bVisbile = ScrollPane(nScrollX, TRUE, TRUE); + bVisbile = ScrollPane(nScrollX, sal_True, sal_True); if (nScrollY) - bVisbile = bVisbile && ScrollPane(nScrollY, FALSE, TRUE); + bVisbile = bVisbile && ScrollPane(nScrollY, sal_False, sal_True); } } @@ -557,8 +557,8 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) // Wenn kein Platz ist, wird die naechste Zeile ueberprueft. Size aOutSize = GetSizePixel(); Point aNewPos( 0,0 ); - USHORT nRow = 0; - BOOL bEnd = FALSE; + sal_uInt16 nRow = 0; + sal_Bool bEnd = sal_False; while( !bEnd ) { ////////////////////////////////////////////////////////////////// @@ -599,7 +599,7 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) if( (aNewPos.X()+TABWIN_WIDTH_STD)<aRowRect.Right() ) { aNewPos.Y() = aRowRect.Top() + TABWIN_SPACING_Y; - bEnd = TRUE; + bEnd = sal_True; } else { @@ -609,7 +609,7 @@ void OJoinTableView::SetDefaultTabWinPosSize( OTableWindow* pTabWin ) sal_Int32 nCount = m_aTableMap.size() % (nRow+1); ++nCount; aNewPos.Y() = nCount * TABWIN_SPACING_Y + (nCount-1)*CalcZoom(TABWIN_HEIGHT_STD); - bEnd = TRUE; + bEnd = sal_True; } else nRow++; @@ -671,7 +671,7 @@ void OJoinTableView::BeginChildMove( OTableWindow* pTabWin, const Point& rMouseP Point aMousePos = ScreenToOutputPixel( rMousePos ); m_aDragOffset = aMousePos - pTabWin->GetPosPixel(); m_pDragWin->SetZOrder(NULL, WINDOW_ZORDER_FIRST); - m_bTrackingInitiallyMoved = FALSE; + m_bTrackingInitiallyMoved = sal_False; StartTracking(); } @@ -696,10 +696,10 @@ void OJoinTableView::BeginChildSizing( OTableWindow* pTabWin, const Pointer& rPo } //------------------------------------------------------------------------------ -BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars ) +sal_Bool OJoinTableView::ScrollPane( long nDelta, sal_Bool bHoriz, sal_Bool bPaintScrollBars ) { DBG_CHKTHIS(OJoinTableView,NULL); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; ////////////////////////////////////////////////////////////////////// // ScrollBar-Positionen anpassen @@ -712,12 +712,12 @@ BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars if( nNewThumbPos < 0 ) { nNewThumbPos = 0; - bRet = FALSE; + bRet = sal_False; } if( nNewThumbPos > GetHScrollBar()->GetRange().Max() ) { nNewThumbPos = GetHScrollBar()->GetRange().Max(); - bRet = FALSE; + bRet = sal_False; } GetHScrollBar()->SetThumbPos( nNewThumbPos ); nDelta = GetHScrollBar()->GetThumbPos() - nOldThumbPos; @@ -729,12 +729,12 @@ BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars if( nNewThumbPos < 0 ) { nNewThumbPos = 0; - bRet = FALSE; + bRet = sal_False; } if( nNewThumbPos > GetVScrollBar()->GetRange().Max() ) { nNewThumbPos = GetVScrollBar()->GetRange().Max(); - bRet = FALSE; + bRet = sal_False; } GetVScrollBar()->SetThumbPos( nNewThumbPos ); nDelta = GetVScrollBar()->GetThumbPos() - nOldThumbPos; @@ -745,7 +745,7 @@ BOOL OJoinTableView::ScrollPane( long nDelta, BOOL bHoriz, BOOL bPaintScrollBars // Wenn ScrollOffset bereits an den Grenzen liegt, kein Neuzeichnen if( (GetHScrollBar()->GetThumbPos()==m_aScrollOffset.X()) && (GetVScrollBar()->GetThumbPos()==m_aScrollOffset.Y()) ) - return FALSE; + return sal_False; ////////////////////////////////////////////////////////////////////// // ScrollOffset neu setzen @@ -922,9 +922,9 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt ) void OJoinTableView::KeyInput( const KeyEvent& rEvt ) { DBG_CHKTHIS(OJoinTableView,NULL); - USHORT nCode = rEvt.GetKeyCode().GetCode(); - BOOL bShift = rEvt.GetKeyCode().IsShift(); - BOOL bCtrl = rEvt.GetKeyCode().IsMod1(); + sal_uInt16 nCode = rEvt.GetKeyCode().GetCode(); + sal_Bool bShift = rEvt.GetKeyCode().IsShift(); + sal_Bool bCtrl = rEvt.GetKeyCode().IsMod1(); if( !bCtrl && !bShift && (nCode==KEY_DELETE) ) { @@ -945,11 +945,11 @@ void OJoinTableView::DeselectConn(OTableConnection* pConn) // die zugehoerigen Eitnraege in der ListBox des Tabellenfenster deselektieren OTableWindow* pWin = pConn->GetSourceWin(); if (pWin && pWin->GetListBox()) - pWin->GetListBox()->SelectAll(FALSE); + pWin->GetListBox()->SelectAll(sal_False); pWin = pConn->GetDestWin(); if (pWin && pWin->GetListBox()) - pWin->GetListBox()->SelectAll(FALSE); + pWin->GetListBox()->SelectAll(sal_False); pConn->Deselect(); m_pSelectedConn = NULL; @@ -974,8 +974,8 @@ void OJoinTableView::SelectConn(OTableConnection* pConn) OTableWindowListBox* pDestBox = pConnDest->GetListBox(); if (pSourceBox && pDestBox) { - pSourceBox->SelectAll(FALSE); - pDestBox->SelectAll(FALSE); + pSourceBox->SelectAll(sal_False); + pDestBox->SelectAll(sal_False); SvLBoxEntry* pFirstSourceVisible = pSourceBox->GetFirstEntryInView(); SvLBoxEntry* pFirstDestVisible = pDestBox->GetFirstEntryInView(); @@ -989,14 +989,14 @@ void OJoinTableView::SelectConn(OTableConnection* pConn) SvLBoxEntry* pSourceEntry = pSourceBox->GetEntryFromText((*aIter)->GetData()->GetSourceFieldName()); if (pSourceEntry) { - pSourceBox->Select(pSourceEntry, TRUE); + pSourceBox->Select(pSourceEntry, sal_True); pSourceBox->MakeVisible(pSourceEntry); } SvLBoxEntry* pDestEntry = pDestBox->GetEntryFromText((*aIter)->GetData()->GetDestFieldName()); if (pDestEntry) { - pDestBox->Select(pDestEntry, TRUE); + pDestBox->Select(pDestEntry, sal_True); pDestBox->MakeVisible(pDestEntry); } @@ -1055,7 +1055,7 @@ sal_Int32 OJoinTableView::getConnectionCount(const OTableWindow* _pFromWin) cons ::std::bind2nd(::std::mem_fun(&OTableConnection::isTableConnection),_pFromWin)); } //------------------------------------------------------------------------------ -BOOL OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const +sal_Bool OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const { DBG_CHKTHIS(OJoinTableView,NULL); return getTableConnections(pFrom) != m_vTableConnection.end(); @@ -1064,7 +1064,7 @@ BOOL OJoinTableView::ExistsAConn(const OTableWindow* pFrom) const void OJoinTableView::ClearAll() { DBG_CHKTHIS(OJoinTableView,NULL); - SetUpdateMode(FALSE); + SetUpdateMode(sal_False); HideTabWins(); @@ -1079,13 +1079,13 @@ void OJoinTableView::ClearAll() m_pSelectedConn = NULL; // scroll to the upper left - ScrollPane(-GetScrollOffset().X(), TRUE, TRUE); - ScrollPane(-GetScrollOffset().Y(), FALSE, TRUE); + ScrollPane(-GetScrollOffset().X(), sal_True, sal_True); + ScrollPane(-GetScrollOffset().Y(), sal_False, sal_True); Invalidate(); } //------------------------------------------------------------------------ -BOOL OJoinTableView::ScrollWhileDragging() +sal_Bool OJoinTableView::ScrollWhileDragging() { DBG_CHKTHIS(OJoinTableView,NULL); OSL_ENSURE(m_pDragWin != NULL, "OJoinTableView::ScrollWhileDragging darf nur waehrend Dragging eines Fensters aufgerufen werden !"); @@ -1099,19 +1099,19 @@ BOOL OJoinTableView::ScrollWhileDragging() Point aLowerRight(aDragWinPos.X() + aDragWinSize.Width(), aDragWinPos.Y() + aDragWinSize.Height()); if (!m_bTrackingInitiallyMoved && (aDragWinPos == m_pDragWin->GetPosPixel())) - return TRUE; + return sal_True; // Darstellungsfehler vermeiden (wenn bei aktivem TrackingRect gescrollt wird) HideTracking(); - BOOL bScrolling = FALSE; - BOOL bNeedScrollTimer = FALSE; + sal_Bool bScrolling = sal_False; + sal_Bool bNeedScrollTimer = sal_False; // An Fenstergrenzen scrollen // TODO : nur dann abfangen, wenn das Fenster komplett verschwinden wuerde (nicht, solange noch ein Pixel sichtbar ist) if( aDragWinPos.X() < 5 ) { - bScrolling = ScrollPane( -LINE_SIZE, TRUE, TRUE ); + bScrolling = ScrollPane( -LINE_SIZE, sal_True, sal_True ); if( !bScrolling && (aDragWinPos.X()<0) ) aDragWinPos.X() = 0; @@ -1121,7 +1121,7 @@ BOOL OJoinTableView::ScrollWhileDragging() if( aLowerRight.X() > m_aOutputSize.Width() - 5 ) { - bScrolling = ScrollPane( LINE_SIZE, TRUE, TRUE ) ; + bScrolling = ScrollPane( LINE_SIZE, sal_True, sal_True ) ; if( !bScrolling && ( aLowerRight.X() > m_aOutputSize.Width() ) ) aDragWinPos.X() = m_aOutputSize.Width() - aDragWinSize.Width(); @@ -1131,7 +1131,7 @@ BOOL OJoinTableView::ScrollWhileDragging() if( aDragWinPos.Y() < 5 ) { - bScrolling = ScrollPane( -LINE_SIZE, FALSE, TRUE ); + bScrolling = ScrollPane( -LINE_SIZE, sal_False, sal_True ); if( !bScrolling && (aDragWinPos.Y()<0) ) aDragWinPos.Y() = 0; @@ -1140,7 +1140,7 @@ BOOL OJoinTableView::ScrollWhileDragging() if( aLowerRight.Y() > m_aOutputSize.Height() - 5 ) { - bScrolling = ScrollPane( LINE_SIZE, FALSE, TRUE ); + bScrolling = ScrollPane( LINE_SIZE, sal_False, sal_True ); if( !bScrolling && ( (aDragWinPos.Y() + aDragWinSize.Height()) > m_aOutputSize.Height() ) ) aDragWinPos.Y() = m_aOutputSize.Height() - aDragWinSize.Height(); @@ -1195,32 +1195,32 @@ void OJoinTableView::TabWinSized(OTableWindow* ptWhich, const Point& ptOldPositi } //------------------------------------------------------------------------------ -BOOL OJoinTableView::IsAddAllowed() +sal_Bool OJoinTableView::IsAddAllowed() { DBG_CHKTHIS(OJoinTableView,NULL); // nicht wenn Db readonly if (m_pView->getController().isReadOnly()) - return FALSE; + return sal_False; try { Reference< XConnection> xConnection = m_pView->getController().getConnection(); if(!xConnection.is()) - return FALSE; + return sal_False; // nicht wenn schon zuviele Tabellen Reference < XDatabaseMetaData > xMetaData( xConnection->getMetaData() ); sal_Int32 nMax = xMetaData.is() ? xMetaData->getMaxTablesInSelect() : 0; if (nMax && nMax <= (sal_Int32)m_aTableMap.size()) - return FALSE; + return sal_False; } catch(SQLException&) { - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void OJoinTableView::executePopup(const Point& _aPos,OTableConnection* _pSelConnection) @@ -1241,7 +1241,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) { DBG_CHKTHIS(OJoinTableView,NULL); - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rEvt.GetCommand()) { @@ -1280,7 +1280,7 @@ void OJoinTableView::Command(const CommandEvent& rEvt) } } } - bHandled = TRUE; + bHandled = sal_True; } } if (!bHandled) @@ -1296,7 +1296,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab if ((!pLhs || pLhs->ExistsAConn()) && (!pRhs || pRhs->ExistsAConn())) { - BOOL bFoundStart = _rpFirstAfter ? FALSE : TRUE; + sal_Bool bFoundStart = _rpFirstAfter ? sal_False : sal_True; ::std::vector<OTableConnection*>::const_iterator aIter = m_vTableConnection.begin(); ::std::vector<OTableConnection*>::const_iterator aEnd = m_vTableConnection.end(); @@ -1333,7 +1333,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab pConn = pData; if (pData == _rpFirstAfter) - bFoundStart = TRUE; + bFoundStart = sal_True; } } } @@ -1343,7 +1343,7 @@ OTableConnection* OJoinTableView::GetTabConn(const OTableWindow* pLhs,const OTab //------------------------------------------------------------------------------ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_COMMAND: @@ -1355,10 +1355,10 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) if (pData->GetMode() == COMMAND_WHEEL_SCROLL) { if (pData->GetDelta() > 0) - ScrollPane(-10 * pData->GetScrollLines(), pData->IsHorz(), TRUE); + ScrollPane(-10 * pData->GetScrollLines(), pData->IsHorz(), sal_True); else - ScrollPane(10 * pData->GetScrollLines(), pData->IsHorz(), TRUE); - bHandled = TRUE; + ScrollPane(10 * pData->GetScrollLines(), pData->IsHorz(), sal_True); + bHandled = sal_True; } } } @@ -1379,7 +1379,7 @@ long OJoinTableView::PreNotify(NotifyEvent& rNEvt) if (!HasChildPathFocus()) break; - BOOL bForward = !pKeyEvent->GetKeyCode().IsShift(); + sal_Bool bForward = !pKeyEvent->GetKeyCode().IsShift(); // is there an active tab win ? OTableWindowMapIterator aIter = m_aTableMap.begin(); OTableWindowMapIterator aEnd = m_aTableMap.end(); diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx index 991ef5733171..fc702cf94cfa 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.cxx @@ -160,9 +160,9 @@ OTableConnectionData* OQueryTableConnectionData::NewInstance() const return new OQueryTableConnectionData(); } // ----------------------------------------------------------------------------- -BOOL OQueryTableConnectionData::Update() +sal_Bool OQueryTableConnectionData::Update() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx index f7d2173907b1..0b4c78d394a5 100644 --- a/dbaccess/source/ui/querydesign/QTableConnectionData.hxx +++ b/dbaccess/source/ui/querydesign/QTableConnectionData.hxx @@ -66,7 +66,7 @@ namespace dbaui @return true if successful */ - virtual BOOL Update(); + virtual sal_Bool Update(); ::rtl::OUString GetAliasName(EConnectionSide nWhich) const; diff --git a/dbaccess/source/ui/querydesign/QTableWindow.hxx b/dbaccess/source/ui/querydesign/QTableWindow.hxx index deaad8621808..16b5097ca6d0 100644 --- a/dbaccess/source/ui/querydesign/QTableWindow.hxx +++ b/dbaccess/source/ui/querydesign/QTableWindow.hxx @@ -54,12 +54,12 @@ namespace dbaui } // spaeter Constructor, die Basisklasse ERZEUGT beim ersten Aufruf die Listbox - virtual BOOL Init(); + virtual sal_Bool Init(); inline sal_Int32 GetAliasNum() const { return m_nAliasNum; } - BOOL ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo); - BOOL ExistsAVisitedConn() const; + sal_Bool ExistsField(const ::rtl::OUString& strFieldName, OTableFieldDescRef& rInfo); + sal_Bool ExistsAVisitedConn() const; virtual ::rtl::OUString GetName() const { return GetWinName(); } diff --git a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx index 6cccdbcf9c34..92a79f257efd 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignFieldUndoAct.hxx @@ -43,16 +43,16 @@ namespace dbaui { protected: OSelectionBrowseBox* pOwner; - USHORT m_nColumnPostion; + sal_uInt16 m_nColumnPostion; virtual void Undo() = 0; virtual void Redo() = 0; public: - OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, USHORT nCommentID); + OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID); virtual ~OQueryDesignFieldUndoAct(); - inline void SetColumnPosition(USHORT _nColumnPostion) + inline void SetColumnPosition(sal_uInt16 _nColumnPostion) { m_nColumnPostion = _nColumnPostion; OSL_ENSURE(m_nColumnPostion != BROWSER_INVALIDID,"Column position was not set add the undo action!"); @@ -107,7 +107,7 @@ namespace dbaui OTableFieldDescRef pDescr; // geloeschte Spaltenbeschreibung public: - OTabFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, USHORT nCommentID) : OQueryDesignFieldUndoAct(pSelBrwBox, nCommentID) { } + OTabFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID) : OQueryDesignFieldUndoAct(pSelBrwBox, nCommentID) { } void SetTabFieldDescr(OTableFieldDescRef pDescription) { pDescr = pDescription; } }; diff --git a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx index 557a94c14204..f0f862cf3611 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryDesignUndoAction.hxx @@ -42,7 +42,7 @@ namespace dbaui OJoinTableView* m_pOwner; // in diesem Container spielt sich alles ab public: - OQueryDesignUndoAction(OJoinTableView* pOwner, USHORT nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { } + OQueryDesignUndoAction(OJoinTableView* pOwner, sal_uInt16 nCommentID) : OCommentUndoAction(nCommentID), m_pOwner(pOwner) { } }; } #endif // DBAUI_QUERYDESIGNUNDOACTION_HXX diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx index 66a7b76102b2..ccd9b3af9533 100644 --- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx +++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx @@ -728,7 +728,7 @@ namespace } Reference< XConnection> xConnection = static_cast<OQueryController&>(_pView->getController()).getConnection(); if(!xConnection.is()) - return FALSE; + return sal_False; try { const Reference< XDatabaseMetaData > xMetaData = xConnection->getMetaData(); @@ -953,7 +953,7 @@ namespace aWorkStr += ::dbtools::quoteName(aQuote, aColumnName); } aWorkStr += ::rtl::OUString(' '); - aWorkStr += String::CreateFromAscii( ";ASC;DESC" ).GetToken( (USHORT)eOrder ); + aWorkStr += String::CreateFromAscii( ";ASC;DESC" ).GetToken( (sal_uInt16)eOrder ); aWorkStr += ::rtl::OUString(','); } } @@ -1878,7 +1878,7 @@ namespace pJoinType = pNode->getChild(2); } - if (SQL_ISRULE(pJoinType,join_type) && SQL_ISTOKEN(pJoinType->getChild(0),INNER)) + if (SQL_ISRULE(pJoinType,join_type) && (!pJoinType->count() || SQL_ISTOKEN(pJoinType->getChild(0),INNER))) { eJoinType = INNER_JOIN; } @@ -2098,7 +2098,7 @@ namespace while ( false ); // Durch das Neuerzeugen wurden wieder Undo-Actions in den Manager gestellt - rController.getUndoMgr()->Clear(); + rController.ClearUndoManager(); _pSelectionBrw->Invalidate(); return eErrorCode; } @@ -2453,7 +2453,7 @@ namespace //------------------------------------------------------------------------------ String getParseErrorMessage( SqlParseError _eErrorCode ) { - USHORT nResId; + sal_uInt16 nResId; switch(_eErrorCode) { case eIllegalJoin: @@ -3149,7 +3149,7 @@ void OQueryDesignView::initByFieldDescriptions( const Sequence< PropertyValue >& InsertField( pField, sal_True, sal_False ); } - rController.getUndoMgr()->Clear(); + rController.ClearUndoManager(); m_pSelectionBox->Invalidate(); } diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx index 93775a1be43e..6f9a45d59228 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.cxx @@ -51,10 +51,10 @@ OQueryTabConnUndoAction::~OQueryTabConnUndoAction() } // ------------------------------------------------------------------------------------------------ -OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, USHORT nCommentID) +OQueryTabConnUndoAction::OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID) :OQueryDesignUndoAction(pOwner, nCommentID) ,m_pConnection(NULL) - ,m_bOwnerOfConn(FALSE) + ,m_bOwnerOfConn(sal_False) { DBG_CTOR(OQueryTabConnUndoAction,NULL); } @@ -67,13 +67,13 @@ OQueryAddTabConnUndoAction::OQueryAddTabConnUndoAction(OQueryTableView* pOwner) void OQueryAddTabConnUndoAction::Undo() { static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- void OQueryAddTabConnUndoAction::Redo() { static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner) @@ -84,13 +84,13 @@ OQueryDelTabConnUndoAction::OQueryDelTabConnUndoAction(OQueryTableView* pOwner) void OQueryDelTabConnUndoAction::Undo() { static_cast<OQueryTableView*>(m_pOwner)->GetConnection(m_pConnection); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- void OQueryDelTabConnUndoAction::Redo() { static_cast<OQueryTableView*>(m_pOwner)->DropConnection(m_pConnection); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- OQueryTabWinShowUndoAct::OQueryTabWinShowUndoAct(OQueryTableView* pOwner) @@ -105,13 +105,13 @@ OQueryTabWinShowUndoAct::~OQueryTabWinShowUndoAct() void OQueryTabWinShowUndoAct::Undo() { static_cast<OQueryTableView*>(m_pOwner)->HideTabWin(m_pTabWin, this); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- void OQueryTabWinShowUndoAct::Redo() { static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin(m_pTabWin, this,sal_True); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- OQueryTabWinDelUndoAct::OQueryTabWinDelUndoAct(OQueryTableView* pOwner) @@ -126,13 +126,13 @@ OQueryTabWinDelUndoAct::~OQueryTabWinDelUndoAct() void OQueryTabWinDelUndoAct::Undo() { static_cast<OQueryTableView*>(m_pOwner)->ShowTabWin( m_pTabWin, this,sal_True ); - SetOwnership(FALSE); + SetOwnership(sal_False); } // ----------------------------------------------------------------------------- void OQueryTabWinDelUndoAct::Redo() { static_cast<OQueryTableView*>(m_pOwner)->HideTabWin( m_pTabWin, this ); - SetOwnership(TRUE); + SetOwnership(sal_True); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx index 42a2e738bc53..186c522279d5 100644 --- a/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabConnUndoAction.hxx @@ -38,11 +38,11 @@ namespace dbaui { protected: OQueryTableConnection* m_pConnection; - BOOL m_bOwnerOfConn; + sal_Bool m_bOwnerOfConn; // bin ich alleiniger Eigentuemer der Connection ? (aendert sich mit jedem Redo oder Undo) public: - OQueryTabConnUndoAction(OQueryTableView* pOwner, USHORT nCommentID); + OQueryTabConnUndoAction(OQueryTableView* pOwner, sal_uInt16 nCommentID); virtual ~OQueryTabConnUndoAction(); virtual void Undo() = 0; @@ -50,7 +50,7 @@ namespace dbaui void SetConnection(OQueryTableConnection* pConn) { m_pConnection = pConn; } // anschliessend bitte SetOwnership - void SetOwnership(BOOL bTakeIt) { m_bOwnerOfConn = bTakeIt; } + void SetOwnership(sal_Bool bTakeIt) { m_bOwnerOfConn = bTakeIt; } }; } #endif // DBAUI_QUERYTABCONNUNDOACTION_HXX diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx index ff95ed986b25..599afe015379 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.cxx @@ -40,7 +40,7 @@ using namespace dbaui; DBG_NAME(OQueryDesignFieldUndoAct) -OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, USHORT nCommentID) +OQueryDesignFieldUndoAct::OQueryDesignFieldUndoAct(OSelectionBrowseBox* pSelBrwBox, sal_uInt16 nCommentID) : OCommentUndoAction(nCommentID) , pOwner(pSelBrwBox) , m_nColumnPostion(BROWSER_INVALIDID) @@ -57,7 +57,7 @@ OQueryDesignFieldUndoAct::~OQueryDesignFieldUndoAct() DBG_NAME(OQueryTabWinUndoAct ) // ------------------------------------------------------------------------------------------------ -OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID) +OQueryTabWinUndoAct::OQueryTabWinUndoAct(OQueryTableView* pOwner, sal_uInt16 nCommentID) :OQueryDesignUndoAction(pOwner, nCommentID) ,m_pTabWin(NULL) { @@ -95,7 +95,7 @@ void OTabFieldCellModifiedUndoAct::Undo() OSL_ENSURE(m_nColumnPostion < pOwner->GetColumnCount(),"Position outside the column count!"); if ( m_nColumnPostion != BROWSER_INVALIDID ) { - USHORT nColumnId = pOwner->GetColumnId(m_nColumnPostion); + sal_uInt16 nColumnId = pOwner->GetColumnId(m_nColumnPostion); String strNext = pOwner->GetCellContents(m_nCellIndex, nColumnId); pOwner->SetCellContents(m_nCellIndex, nColumnId, m_strNextCellContents); m_strNextCellContents = strNext; @@ -110,7 +110,7 @@ void OTabFieldSizedUndoAct::Undo() OSL_ENSURE(m_nColumnPostion != BROWSER_INVALIDID,"Column position was not set add the undo action!"); if ( m_nColumnPostion != BROWSER_INVALIDID ) { - USHORT nColumnId = pOwner->GetColumnId(m_nColumnPostion); + sal_uInt16 nColumnId = pOwner->GetColumnId(m_nColumnPostion); long nNextWidth = pOwner->GetColumnWidth(nColumnId); pOwner->SetColWidth(nColumnId, m_nNextWidth); m_nNextWidth = nNextWidth; @@ -125,9 +125,9 @@ void OTabFieldMovedUndoAct::Undo() if ( m_nColumnPostion != BROWSER_INVALIDID ) { sal_uInt16 nId = pDescr->GetColumnId(); - USHORT nOldPos = pOwner->GetColumnPos(nId); + sal_uInt16 nOldPos = pOwner->GetColumnPos(nId); pOwner->SetColumnPos(nId,m_nColumnPostion); - pOwner->ColumnMoved(nId,FALSE); + pOwner->ColumnMoved(nId,sal_False); m_nColumnPostion = nOldPos; } pOwner->LeaveUndoMode(); diff --git a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx index 1fa0df1f3a01..7afb6811e810 100644 --- a/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx +++ b/dbaccess/source/ui/querydesign/QueryTabWinUndoAct.hxx @@ -49,14 +49,14 @@ namespace dbaui protected: ::std::vector<OTableConnection*> m_vTableConnection; OQueryTableWindow* m_pTabWin; - BOOL m_bOwnerOfObjects; + sal_Bool m_bOwnerOfObjects; // bin ich alleiniger Eigentuemer der verwalteten Objekte ? (aendert sich mit jedem Redo oder Undo) public: - OQueryTabWinUndoAct(OQueryTableView* pOwner, USHORT nCommentID); + OQueryTabWinUndoAct(OQueryTableView* pOwner, sal_uInt16 nCommentID); virtual ~OQueryTabWinUndoAct(); - void SetOwnership(BOOL bTakeIt) { m_bOwnerOfObjects = bTakeIt; } + void SetOwnership(sal_Bool bTakeIt) { m_bOwnerOfObjects = bTakeIt; } virtual void Undo() = 0; @@ -67,7 +67,7 @@ namespace dbaui // anschliessend sollte das SetOwnership aufgerufen werden // Zugriff auf die verwalteten Connections - USHORT ConnCount() { return (USHORT)m_vTableConnection.size(); } + sal_uInt16 ConnCount() { return (sal_uInt16)m_vTableConnection.size(); } ::std::vector<OTableConnection*>* GetTabConnList() { return &m_vTableConnection; } diff --git a/dbaccess/source/ui/querydesign/QueryTableView.cxx b/dbaccess/source/ui/querydesign/QueryTableView.cxx index b32242652983..302b57cef86d 100644 --- a/dbaccess/source/ui/querydesign/QueryTableView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTableView.cxx @@ -131,7 +131,7 @@ namespace @return true when OK was pressed otherwise false */ - sal_Bool openJoinDialog(OQueryTableView* _pView,const TTableConnectionData::value_type& _pConnectionData,BOOL _bSelectableTables) + sal_Bool openJoinDialog(OQueryTableView* _pView,const TTableConnectionData::value_type& _pConnectionData,sal_Bool _bSelectableTables) { OQueryTableConnectionData* pData = static_cast< OQueryTableConnectionData*>(_pConnectionData.get()); @@ -690,7 +690,7 @@ void OQueryTableView::AddConnection(const OJoinExchangeData& jxdSource, const OJ void OQueryTableView::ConnDoubleClicked(OTableConnection* pConnection) { DBG_CHKTHIS(OQueryTableView,NULL); - if( openJoinDialog(this,pConnection->GetData(),FALSE) ) + if( openJoinDialog(this,pConnection->GetData(),sal_False) ) { connectionModified(this,pConnection,sal_False); SelectConn( pConnection ); @@ -700,7 +700,7 @@ void OQueryTableView::ConnDoubleClicked(OTableConnection* pConnection) void OQueryTableView::createNewConnection() { TTableConnectionData::value_type pData(new OQueryTableConnectionData()); - if( openJoinDialog(this,pData,TRUE) ) + if( openJoinDialog(this,pData,sal_True) ) { OTableWindowMap* pMap = GetTabWinMap(); OQueryTableWindow* pSourceWin = static_cast< OQueryTableWindow*>((*pMap)[pData->getReferencingTable()->GetWinName()]); @@ -785,8 +785,8 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) // mein Parent brauche ich, da es vom Loeschen erfahren soll OQueryDesignView* pParent = static_cast<OQueryDesignView*>(getDesignView()); - SfxUndoManager* pUndoMgr = m_pView->getController().getUndoMgr(); - pUndoMgr->EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); + SfxUndoManager& rUndoMgr = m_pView->getController().GetUndoManager(); + rUndoMgr.EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); // Undo-Action anlegen OQueryTabWinDelUndoAct* pUndoAction = new OQueryTabWinDelUndoAct(this); @@ -799,7 +799,7 @@ void OQueryTableView::RemoveTabWin(OTableWindow* pTabWin) pParent->TableDeleted( static_cast< OQueryTableWindowData*>(pTabWin->GetData().get())->GetAliasName() ); m_pView->getController().addUndoActionAndInvalidate( pUndoAction ); - pUndoMgr->LeaveListAction(); + rUndoMgr.LeaveListAction(); if (m_lnkTabWinsChangeHandler.IsSet()) { diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx index 3e19ab75aa62..3f403a4c4892 100644 --- a/dbaccess/source/ui/querydesign/QueryTextView.cxx +++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx @@ -57,7 +57,7 @@ OQueryTextView::OQueryTextView(OQueryContainerWindow* _pParent) { DBG_CTOR(OQueryTextView,NULL); m_pEdit = new OSqlEdit(this); - m_pEdit->SetRightToLeft(FALSE); + m_pEdit->SetRightToLeft(sal_False); m_pEdit->ClearModifyFlag(); m_pEdit->SaveValue(); m_pEdit->SetPosPixel( Point( 0, 0 ) ); diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx index 792d283ee8a3..0ad058656489 100644 --- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx +++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx @@ -280,7 +280,7 @@ bool OQueryViewSwitch::impl_postViewSwitch( const bool i_bGraphicalDesign, const if ( pContainer ) pContainer->Resize(); - m_pDesignView->getController().getUndoMgr()->Clear(); + m_pDesignView->getController().ClearUndoManager(); m_pDesignView->getController().InvalidateAll(); return i_bSuccess; diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index ae1ae932806b..f48ff8767b50 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -217,7 +217,7 @@ void OSelectionBrowseBox::initialize() m_aFunctionStrings += String(RTL_CONSTASCII_USTRINGPARAM(";")); m_aFunctionStrings += sGroup; - // Diese Funktionen stehen nur unter CORE zur Verfgung + // Diese Funktionen stehen nur unter CORE zur Verf�gung if ( lcl_SupportsCoreSQLGrammar(xConnection) ) { xub_StrLen nCount = m_aFunctionStrings.GetTokenCount(); @@ -303,15 +303,15 @@ BrowserHeader* OSelectionBrowseBox::imp_CreateHeaderBar(BrowseBox* /*pParent*/) return new OSelectionBrwBoxHeader(this); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::ColumnMoved( USHORT nColId,BOOL _bCreateUndo ) +void OSelectionBrowseBox::ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo ) { EditBrowseBox::ColumnMoved( nColId ); // swap the two columns - USHORT nNewPos = GetColumnPos( nColId ); + sal_uInt16 nNewPos = GetColumnPos( nColId ); OTableFields& rFields = getFields(); - if ( rFields.size() > USHORT(nNewPos-1) ) + if ( rFields.size() > sal_uInt16(nNewPos-1) ) { - USHORT nOldPos = 0; + sal_uInt16 nOldPos = 0; OTableFields::iterator aEnd = rFields.end(); OTableFields::iterator aIter = rFields.begin(); for (; aIter != aEnd && ( (*aIter)->GetColumnId() != nColId ); ++aIter,++nOldPos) @@ -484,7 +484,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon OSL_ENSURE(nColId != BROWSER_INVALIDID,"An Invalid Id was set!"); if ( nColId == BROWSER_INVALIDID ) return; - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); if ( nPos == 0 || nPos == BROWSER_INVALIDID || nPos > getFields().size() ) return; OTableFieldDescRef pEntry = getFields()[nPos-1]; @@ -556,7 +556,7 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon } break; case BROW_ORDER_ROW: m_pOrderCell->SelectEntryPos( - sal::static_int_cast< USHORT >(pEntry->GetOrderDir())); + sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir())); enableControl(pEntry,m_pOrderCell); break; case BROW_COLUMNALIAS_ROW: @@ -574,14 +574,14 @@ void OSelectionBrowseBox::InitController(CellControllerRef& /*rController*/, lon Controller()->ClearModified(); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,USHORT _nColumnId) +void OSelectionBrowseBox::notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { appendUndoAction(_sOldAlias,_sAlias,BROW_TABLE_ROW,_bListAction); if ( m_bVisibleRow[BROW_TABLE_ROW] ) RowModified(GetBrowseRow(BROW_TABLE_ROW), _nColumnId); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,USHORT _nColumnId) +void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { appendUndoAction(_sOldFunctionName,_sFunctionName,BROW_FUNCTION_ROW,_bListAction); if ( !m_bVisibleRow[BROW_FUNCTION_ROW] ) @@ -589,7 +589,7 @@ void OSelectionBrowseBox::notifyFunctionFieldChanged(const String& _sOldFunction RowModified(GetBrowseRow(BROW_FUNCTION_ROW), _nColumnId); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,USHORT _nColumnId) +void OSelectionBrowseBox::clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId) { if ( isFieldNameAsterix( _sFieldName ) && (!_pEntry->isNoneFunction() || _pEntry->IsGroupBy()) ) { @@ -754,14 +754,14 @@ sal_Bool OSelectionBrowseBox::saveField(const String& _sFieldName,OTableFieldDes ::comphelper::UStringMixEqual bCase(xMetaData->supportsMixedCaseQuotedIdentifiers()); OTableFieldDescRef aSelEntry = _pEntry; - USHORT nColumnId = aSelEntry->GetColumnId(); + sal_uInt16 nColumnId = aSelEntry->GetColumnId(); sal_uInt32 nCount = pSelection->count(); for (sal_uInt32 i = 0; i < nCount; ++i) { if ( i > 0 ) // may we have to append more than one field { - USHORT nColumnPostion; + sal_uInt16 nColumnPostion; aSelEntry = FindFirstFreeCol(nColumnPostion); if ( !aSelEntry.is() ) { @@ -919,8 +919,8 @@ sal_Bool OSelectionBrowseBox::SaveModified() DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); OTableFieldDescRef pEntry = NULL; - USHORT nCurrentColumnPos = GetColumnPos(GetCurColumnId()); - if(getFields().size() > static_cast<USHORT>(nCurrentColumnPos - 1)) + sal_uInt16 nCurrentColumnPos = GetColumnPos(GetCurColumnId()); + if(getFields().size() > static_cast<sal_uInt16>(nCurrentColumnPos - 1)) pEntry = getEntry(nCurrentColumnPos - 1); sal_Bool bWasEmpty = pEntry.is() ? pEntry->IsEmpty() : sal_False; @@ -972,9 +972,9 @@ sal_Bool OSelectionBrowseBox::SaveModified() strOldCellContents = pEntry->GetField(); bListAction = sal_True; if ( !m_bInUndoMode ) - rController.getUndoMgr()->EnterListAction(String(),String()); + rController.GetUndoManager().EnterListAction(String(),String()); - USHORT nPos = m_pFieldCell->GetEntryPos(aFieldName); + sal_uInt16 nPos = m_pFieldCell->GetEntryPos(aFieldName); String aAliasName = pEntry->GetAlias(); if ( nPos != COMBOBOX_ENTRY_NOTFOUND && !aAliasName.Len() && aFieldName.GetTokenCount('.') > 1 ) { // special case, we have a table field so we must cut the table name @@ -1001,7 +1001,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() { sNewValue = aFieldName; if ( !m_bInUndoMode ) - static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->LeaveListAction(); + static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().LeaveListAction(); bListAction = sal_False; } else @@ -1068,7 +1068,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() { strOldCellContents = pEntry->GetFunction(); sal_uInt16 nPos = m_pFunctionCell->GetSelectEntryPos(); - // Diese Funktionen stehen nur unter CORE zur Verfgung + // Diese Funktionen stehen nur unter CORE zur Verf�gung String sFunctionName = m_pFunctionCell->GetEntry(nPos); String sGroupFunctionName = m_aFunctionStrings.GetToken(m_aFunctionStrings.GetTokenCount()-1); sal_Bool bGroupBy = sal_False; @@ -1205,7 +1205,7 @@ sal_Bool OSelectionBrowseBox::SaveModified() if ( bAppendRow ) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1227,12 +1227,12 @@ sal_Bool OSelectionBrowseBox::SaveModified() RowModified(BROW_VIS_ROW, GetCurColumnId()); // wenn noetig neue freie Spalten anlegen - USHORT nDummy; + sal_uInt16 nDummy; CheckFreeColumns(nDummy); } if ( bListAction && !m_bInUndoMode ) - static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->LeaveListAction(); + static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().LeaveListAction(); return pEntry != NULL && !bError; } @@ -1257,7 +1257,7 @@ void OSelectionBrowseBox::PaintCell(OutputDevice& rDev, const Rectangle& rRect, rDev.SetClipRegion( rRect ); OTableFieldDescRef pEntry = NULL; - USHORT nPos = GetColumnPos(nColumnId); + sal_uInt16 nPos = GetColumnPos(nColumnId); if(getFields().size() > sal_uInt16(nPos - 1)) pEntry = getFields()[nPos - 1]; @@ -1289,12 +1289,12 @@ void OSelectionBrowseBox::PaintStatusCell(OutputDevice& rDev, const Rectangle& r } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::RemoveColumn(USHORT _nColumnId) +void OSelectionBrowseBox::RemoveColumn(sal_uInt16 _nColumnId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); - USHORT nPos = GetColumnPos(_nColumnId); + sal_uInt16 nPos = GetColumnPos(_nColumnId); // das Control sollte immer genau eine Spalte mehr haben, naemlich die HandleColumn OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::RemoveColumn : invalid parameter nColId"); // ColId ist bei mir gleichbedeutend mit Position, und da sollte die Bedingung natuerlich zutreffen @@ -1329,7 +1329,7 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryController& rController = static_cast<OQueryController&>(getDesignView()->getController()); - USHORT nPos = GetColumnPos(nColumnId); + sal_uInt16 nPos = GetColumnPos(nColumnId); OSL_ENSURE(getFields().size() > sal_uInt16(nPos-1),"ID is to great!"); OTableFieldDescRef pDesc = getEntry((sal_uInt32)(nPos - 1)) ; @@ -1352,7 +1352,7 @@ void OSelectionBrowseBox::RemoveField(sal_uInt16 nColumnId ) //------------------------------------------------------------------------------ void OSelectionBrowseBox::adjustSelectionMode( sal_Bool _bClickedOntoHeader, sal_Bool _bClickedOntoHandleCol ) { - // wenn ein Header selectiert wird, mu die selection angezeigt werden, sonst nicht) + // wenn ein Header selectiert wird, mu� die selection angezeigt werden, sonst nicht) if ( _bClickedOntoHeader ) { if (0 == GetSelectColumnCount() ) @@ -1471,7 +1471,7 @@ OTableFieldDescRef OSelectionBrowseBox::AppendNewCol( sal_uInt16 nCnt) { OTableFieldDescRef pEmptyEntry = new OTableFieldDesc(); getFields().push_back(pEmptyEntry); - USHORT nColumnId = sal::static_int_cast< USHORT >(getFields().size()); + sal_uInt16 nColumnId = sal::static_int_cast< sal_uInt16 >(getFields().size()); pEmptyEntry->SetColumnId( nColumnId ); InsertDataColumn( nColumnId , String(), DEFAULT_SIZE, HIB_STDSTYLE, HEADERBAR_APPEND); @@ -1495,7 +1495,7 @@ void OSelectionBrowseBox::DeleteFields(const String& rAliasName) OTableFields::reverse_iterator aIter = getFields().rbegin(); OTableFieldDescRef pEntry = NULL; - for(USHORT nPos=sal::static_int_cast< USHORT >(getFields().size());aIter != getFields().rend();++aIter,--nPos) + for(sal_uInt16 nPos=sal::static_int_cast< sal_uInt16 >(getFields().size());aIter != getFields().rend();++aIter,--nPos) { pEntry = *aIter; if ( pEntry->GetAlias().equals( rAliasName ) ) @@ -1547,7 +1547,7 @@ Rectangle OSelectionBrowseBox::GetInvalidRect( sal_uInt16 nColId ) } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColumnPostion) +void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, sal_uInt16& _nColumnPostion) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); // das Control sollte immer genau eine Spalte mehr haben, naemlich die HandleColumn @@ -1560,14 +1560,14 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu DeactivateCell(); // remember the column id of the current positon - USHORT nColumnId = GetColumnId(_nColumnPostion); + sal_uInt16 nColumnId = GetColumnId(_nColumnPostion); // Wenn zu klein oder zu gross, auf Ende der Liste setzen if ((_nColumnPostion == BROWSER_INVALIDID) || (_nColumnPostion >= getFields().size())) // Anhaengen des Feldes { if (FindFirstFreeCol(_nColumnPostion) == NULL) // keine freie Column mehr { AppendNewCol(1); - _nColumnPostion = sal::static_int_cast< USHORT >( + _nColumnPostion = sal::static_int_cast< sal_uInt16 >( getFields().size()); } else @@ -1580,14 +1580,14 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu // check if the column ids are identical, if not we have to move if ( pEntry->GetColumnId() != nColumnId ) { - USHORT nOldPosition = GetColumnPos(pEntry->GetColumnId()); + sal_uInt16 nOldPosition = GetColumnPos(pEntry->GetColumnId()); OSL_ENSURE( nOldPosition != 0,"Old position was 0. Not possible!"); SetColumnPos(pEntry->GetColumnId(),_nColumnPostion); // we have to delete an empty field for the fields list, because the columns must have equal length if ( nOldPosition > 0 && nOldPosition <= getFields().size() ) getFields()[nOldPosition - 1] = pEntry; - ColumnMoved(pEntry->GetColumnId(),FALSE); + ColumnMoved(pEntry->GetColumnId(),sal_False); } if ( pEntry->GetFunctionType() & (FKT_AGGREGATE) ) @@ -1611,7 +1611,7 @@ void OSelectionBrowseBox::InsertColumn(OTableFieldDescRef pEntry, USHORT& _nColu } //------------------------------------------------------------------------------ -OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxdSource, USHORT _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) +OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OQueryTableWindow* pSourceWin = static_cast<OQueryTableWindow*>(jxdSource.pListBox->GetTabWin()); @@ -1637,7 +1637,7 @@ OTableFieldDescRef OSelectionBrowseBox::InsertField(const OJoinExchangeData& jxd } //------------------------------------------------------------------------------ -OTableFieldDescRef OSelectionBrowseBox::InsertField(const OTableFieldDescRef& _rInfo, USHORT _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) +OTableFieldDescRef OSelectionBrowseBox::InsertField(const OTableFieldDescRef& _rInfo, sal_uInt16 _nColumnPostion, sal_Bool bVis, sal_Bool bActivate) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); @@ -1683,7 +1683,7 @@ sal_uInt16 OSelectionBrowseBox::FieldsCount() } //------------------------------------------------------------------------------ -OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(USHORT& _rColumnPosition ) +OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(sal_uInt16& _rColumnPosition ) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); OTableFields::iterator aIter = getFields().begin(); @@ -1704,7 +1704,7 @@ OTableFieldDescRef OSelectionBrowseBox::FindFirstFreeCol(USHORT& _rColumnPositio } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::CheckFreeColumns(USHORT& _rColumnPosition) +void OSelectionBrowseBox::CheckFreeColumns(sal_uInt16& _rColumnPosition) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); if (FindFirstFreeCol(_rColumnPosition) == NULL) @@ -1788,7 +1788,7 @@ void OSelectionBrowseBox::DuplicateConditionLevel( const sal_uInt16 nLevel) pEntry->SetCriteria( nNewLevel, sValue); if ( nNewLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1) ) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1836,7 +1836,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pEntry->SetCriteria( nLevel, rValue); if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1)) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1864,7 +1864,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pLastEntry->SetCriteria( nLevel, sCriteria); if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1)) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -1881,7 +1881,7 @@ void OSelectionBrowseBox::AddCondition( const OTableFieldDescRef& rInfo, const S pTmp->SetCriteria( nLevel, rValue); if(nLevel == (m_nVisibleCount-BROW_CRIT1_ROW-1)) { - RowInserted( GetRowCount()-1, 1, TRUE ); + RowInserted( GetRowCount()-1, 1, sal_True ); m_bVisibleRow.push_back(sal_True); ++m_nVisibleCount; } @@ -2022,7 +2022,7 @@ void OSelectionBrowseBox::Command(const CommandEvent& rEvt) if ( 1 == GetSelectColumnCount() ) { sal_uInt16 nSelId = GetColumnId( - sal::static_int_cast< USHORT >( + sal::static_int_cast< sal_uInt16 >( FirstSelectedColumn() ) ); ::Rectangle aColRect( GetFieldRectPixel( 0, nSelId, sal_False ) ); @@ -2145,8 +2145,8 @@ void OSelectionBrowseBox::SetRowVisible(sal_uInt16 _nWhich, sal_Bool _bVis) //------------------------------------------------------------------------------ long OSelectionBrowseBox::GetBrowseRow(long nRowId) const { - USHORT nCount(0); - for(USHORT i = 0 ; i < nRowId ; ++i) + sal_uInt16 nCount(0); + for(sal_uInt16 i = 0 ; i < nRowId ; ++i) { if ( m_bVisibleRow[i] ) ++nCount; @@ -2211,7 +2211,7 @@ String OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos-1]; OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... "); @@ -2238,7 +2238,7 @@ String OSelectionBrowseBox::GetCellText(long nRow, sal_uInt16 nColId) const } break; case BROW_ORDER_ROW: if (pEntry->GetOrderDir() != ORDER_NONE) - aText = String(ModuleRes(STR_QUERY_SORTTEXT) ).GetToken(sal::static_int_cast< USHORT >(pEntry->GetOrderDir())); + aText = String(ModuleRes(STR_QUERY_SORTTEXT) ).GetToken(sal::static_int_cast< sal_uInt16 >(pEntry->GetOrderDir())); break; case BROW_VIS_ROW: break; @@ -2330,13 +2330,13 @@ sal_Bool OSelectionBrowseBox::GetFunctionName(sal_uInt32 _nFunctionTokenId,Strin return bErg; } //------------------------------------------------------------------------------ -String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, USHORT nColId) +String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); if ( GetCurColumnId() == nColId && !m_bInUndoMode ) SaveModified(); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getFields()[nPos - 1]; OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::GetCellContents : invalid column id, prepare for GPF ... "); @@ -2357,14 +2357,14 @@ String OSelectionBrowseBox::GetCellContents(sal_Int32 nCellIndex, USHORT nColId) } //------------------------------------------------------------------------------ -void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, USHORT nColId, const String& strNewText) +void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, sal_uInt16 nColId, const String& strNewText) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - sal_Bool bWasEditing = IsEditing() && (GetCurColumnId() == nColId) && IsRowVisible(static_cast<USHORT>(nRow)) && (GetCurRow() == static_cast<USHORT>(GetBrowseRow(nRow))); + sal_Bool bWasEditing = IsEditing() && (GetCurColumnId() == nColId) && IsRowVisible(static_cast<sal_uInt16>(nRow)) && (GetCurRow() == static_cast<sal_uInt16>(GetBrowseRow(nRow))); if (bWasEditing) DeactivateCell(); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OTableFieldDescRef pEntry = getEntry(nPos - 1); OSL_ENSURE(pEntry != NULL, "OSelectionBrowseBox::SetCellContents : invalid column id, prepare for GPF ... "); @@ -2414,7 +2414,7 @@ void OSelectionBrowseBox::SetCellContents(sal_Int32 nRow, USHORT nColId, const S } long nCellIndex = GetRealRow(nRow); - if(IsRowVisible(static_cast<USHORT>(nRow))) + if(IsRowVisible(static_cast<sal_uInt16>(nRow))) RowModified(nCellIndex, nColId); // die entsprechende Feld-Beschreibung ist jetzt leer -> Visible auf sal_False (damit das konsistent mit normalen leeren Spalten ist) @@ -2448,7 +2448,7 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) // but the changes aren't permanent ... DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OSL_ENSURE(nPos <= getFields().size(),"ColumnResized:: nColId sollte nicht groesser als List::count sein!"); OTableFieldDescRef pEntry = getEntry(nPos-1); OSL_ENSURE(pEntry.is(), "OSelectionBrowseBox::ColumnResized : keine FieldDescription !"); @@ -2473,7 +2473,7 @@ void OSelectionBrowseBox::ColumnResized(sal_uInt16 nColId) sal_uInt32 OSelectionBrowseBox::GetTotalCellWidth(long nRowId, sal_uInt16 nColId) { DBG_CHKTHIS(OSelectionBrowseBox,NULL); - USHORT nPos = GetColumnPos(nColId); + sal_uInt16 nPos = GetColumnPos(nColId); OSL_ENSURE((nPos == 0) || (nPos <= getFields().size()), "OSelectionBrowseBox::GetTotalCellWidth : invalid parameter nColId"); OTableFieldDescRef pEntry = getFields()[nPos-1]; @@ -2592,7 +2592,7 @@ void OSelectionBrowseBox::appendUndoAction(const String& _rOldValue,const String if ( !_bListAction ) { _bListAction = sal_True; - static_cast<OQueryController&>(getDesignView()->getController()).getUndoMgr()->EnterListAction(String(),String()); + static_cast<OQueryController&>(getDesignView()->getController()).GetUndoManager().EnterListAction(String(),String()); } appendUndoAction(_rOldValue,_rNewValue,_nRow); } @@ -2643,12 +2643,12 @@ OTableFields& OSelectionBrowseBox::getFields() const // ----------------------------------------------------------------------------- void OSelectionBrowseBox::enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl) { - BOOL bEnable = !_rEntry->isCondition(); + sal_Bool bEnable = !_rEntry->isCondition(); _pControl->Enable(bEnable); _pControl->EnableInput(bEnable); } // ----------------------------------------------------------------------------- -void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,ULONG _nHelpId) +void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const rtl::OString& _sHelpId) { m_pTextCell->SetText(_sText); m_pTextCell->ClearModifyFlag(); @@ -2657,10 +2657,10 @@ void OSelectionBrowseBox::setTextCellContext(const OTableFieldDescRef& _rEntry,c enableControl(_rEntry,m_pTextCell); - if (m_pTextCell->GetHelpId() != _nHelpId) + if (m_pTextCell->GetHelpId() != _sHelpId) // da TextCell in verschiedenen Kontexten verwendet wird, muss ich den gecachten HelpText loeschen m_pTextCell->SetHelpText(String()); - m_pTextCell->SetHelpId(_nHelpId); + m_pTextCell->SetHelpId(_sHelpId); } // ----------------------------------------------------------------------------- void OSelectionBrowseBox::invalidateUndoRedo() @@ -2683,7 +2683,7 @@ OTableFieldDescRef OSelectionBrowseBox::getEntry(OTableFields::size_type _nPos) { pEntry = new OTableFieldDesc(); pEntry->SetColumnId( - GetColumnId(sal::static_int_cast< USHORT >(_nPos+1))); + GetColumnId(sal::static_int_cast< sal_uInt16 >(_nPos+1))); aFields[_nPos] = pEntry; } return pEntry; @@ -2754,7 +2754,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef& _pEntry) Reference< XConnection> xConnection = static_cast<OQueryController&>(getDesignView()->getController()).getConnection(); if ( xConnection.is() ) { - // Diese Funktionen stehen nur unter CORE zur Verfgung + // Diese Funktionen stehen nur unter CORE zur Verf�gung if ( lcl_SupportsCoreSQLGrammar(xConnection) ) { // if we have an asterix, no other function than count is allowed diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx index 8d25da432916..fc361d5fc16f 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.hxx @@ -99,10 +99,10 @@ namespace dbaui ~OSelectionBrowseBox(); void initialize(); - OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource, USHORT _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); - OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, USHORT _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); - void InsertColumn( OTableFieldDescRef pEntry, USHORT& _nColumnPostion ); - void RemoveColumn( USHORT _nColumnId ); + OTableFieldDescRef InsertField( const OJoinExchangeData& jxdSource, sal_uInt16 _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); + OTableFieldDescRef InsertField( const OTableFieldDescRef& rInfo, sal_uInt16 _nColumnPostion = BROWSER_INVALIDID, sal_Bool bVis=sal_True, sal_Bool bActivate=sal_True ); + void InsertColumn( OTableFieldDescRef pEntry, sal_uInt16& _nColumnPostion ); + void RemoveColumn( sal_uInt16 _nColumnId ); void DeleteFields( const String& rAliasName ); bool HasFieldByAliasName(const ::rtl::OUString& rFieldName, OTableFieldDescRef& rInfo) const; @@ -125,8 +125,8 @@ namespace dbaui void SetColWidth(sal_uInt16 nColId, long lNewWidth); // beachtet im Gegensatz zum SetColumnWidth der Basisklasse auch eine eventuell aktive Zelle in dieser Spalte - String GetCellContents(sal_Int32 nCellIndex, USHORT nColId); - void SetCellContents(sal_Int32 nCellIndex, USHORT nColId, const String& strNewText); + String GetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId); + void SetCellContents(sal_Int32 nCellIndex, sal_uInt16 nColId, const String& strNewText); // Zelleninhalt (als String formatiert) setzen/liefern sal_Int32 GetNoneVisibleRows() const; void SetNoneVisbleRow(long nRows); @@ -147,8 +147,8 @@ namespace dbaui virtual void GetFocus(); virtual void DeactivateCell(sal_Bool bUpdate = sal_True); - virtual void ColumnMoved( USHORT nColId ) { ColumnMoved(nColId,TRUE); } - void ColumnMoved( USHORT nColId,BOOL _bCreateUndo); + virtual void ColumnMoved( sal_uInt16 nColId ) { ColumnMoved(nColId,sal_True); } + void ColumnMoved( sal_uInt16 nColId,sal_Bool _bCreateUndo); void Fill(); void PreFill(); @@ -168,7 +168,7 @@ namespace dbaui @return the text out of the cell */ - virtual String GetCellText(long _nRow, USHORT _nColId) const; + virtual String GetCellText(long _nRow, sal_uInt16 _nColId) const; /** returns the description of the row. @param _nRow @@ -229,10 +229,10 @@ namespace dbaui void startTimer(); private: - OTableFieldDescRef FindFirstFreeCol(USHORT& _rColumnPosition); + OTableFieldDescRef FindFirstFreeCol(sal_uInt16& _rColumnPosition); // rCol enthaelt die Nummer (in pOTableFieldDescList) der ersten Spalte, die von sich sagt, dass sie leer ist // wenn es keine solche gibt, ist rCol undefiniert und der Rueckgabewert NULL - void CheckFreeColumns(USHORT& _rColumnPosition); + void CheckFreeColumns(sal_uInt16& _rColumnPosition); // testet, ob es noch freie Spalten gibt, wenn nicht, wird ein neuer Packen angefuegt // rCol enthaelt die Nummer der ersten freien Spalte (in pOTableFieldDescList) @@ -245,7 +245,7 @@ namespace dbaui void appendUndoAction(const String& _rOldValue,const String& _rNewValue,sal_Int32 _nRow); OTableFields& getFields() const; void enableControl(const OTableFieldDescRef& _rEntry,Window* _pControl); - void setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,ULONG _nHelpId); + void setTextCellContext(const OTableFieldDescRef& _rEntry,const String& _sText,const rtl::OString& _sHelpId); void invalidateUndoRedo(); OTableFieldDescRef getEntry(OTableFields::size_type _nPos); @@ -304,7 +304,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> */ - void notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,USHORT _nColumnId); + void notifyTableFieldChanged(const String& _sOldAlias,const String& _sAlias,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** append an undo action for the function field @param _sOldFunctionName @@ -314,7 +314,7 @@ namespace dbaui @param _bListAction Will be set to <TRUE/> when we are in a list action otherwise <FALSE/> */ - void notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,USHORT _nColumnId); + void notifyFunctionFieldChanged(const String& _sOldFunctionName,const String& _sFunctionName,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** clears the function fields of the submitted entry if it doesn't match the SQL standard and append an undo action. E.q. AGGREGATE functions are only valid when the field name isn't an asterix @@ -325,7 +325,7 @@ namespace dbaui @param _bListAction When <TRUE/> an list action will be created. */ - void clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,USHORT _nColumnId); + void clearEntryFunctionField(const String& _sFieldName,OTableFieldDescRef& _pEntry,sal_Bool& _bListAction,sal_uInt16 _nColumnId); /** remove or insert the necessary function types @param _pEntry diff --git a/dbaccess/source/ui/querydesign/TableConnection.cxx b/dbaccess/source/ui/querydesign/TableConnection.cxx index 964b54d00f25..db6a8efd328c 100644 --- a/dbaccess/source/ui/querydesign/TableConnection.cxx +++ b/dbaccess/source/ui/querydesign/TableConnection.cxx @@ -53,7 +53,7 @@ namespace dbaui :Window(_pContainer) ,m_pData( _pTabConnData ) ,m_pParent( _pContainer ) - ,m_bSelected( FALSE ) + ,m_bSelected( sal_False ) { DBG_CTOR(OTableConnection,NULL); Init(); @@ -168,19 +168,19 @@ namespace dbaui //------------------------------------------------------------------------ void OTableConnection::Select() { - m_bSelected = TRUE; + m_bSelected = sal_True; m_pParent->Invalidate( GetBoundingRect(), INVALIDATE_NOCHILDREN); } //------------------------------------------------------------------------ void OTableConnection::Deselect() { - m_bSelected = FALSE; + m_bSelected = sal_False; InvalidateConnection(); } //------------------------------------------------------------------------ - BOOL OTableConnection::CheckHit( const Point& rMousePos ) const + sal_Bool OTableConnection::CheckHit( const Point& rMousePos ) const { ////////////////////////////////////////////////////////////////////// // check if the point hit our line diff --git a/dbaccess/source/ui/querydesign/TableConnectionData.cxx b/dbaccess/source/ui/querydesign/TableConnectionData.cxx index 4679f686bd51..d820c5efa280 100644 --- a/dbaccess/source/ui/querydesign/TableConnectionData.cxx +++ b/dbaccess/source/ui/querydesign/TableConnectionData.cxx @@ -62,7 +62,7 @@ void OTableConnectionData::Init() ////////////////////////////////////////////////////////////////////// // LineDataList mit Defaults initialisieren OSL_ENSURE(m_vConnLineData.size() == 0, "OTableConnectionData::Init() : nur mit leere Linienliste aufzurufen !"); - ResetConnLines(TRUE); + ResetConnLines(sal_True); // das legt Defaults an } //------------------------------------------------------------------------ @@ -97,7 +97,7 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat m_aConnName = rConnData.GetConnName(); // clear line list - ResetConnLines(FALSE); + ResetConnLines(sal_False); // und kopieren OConnectionLineDataVec* pLineData = const_cast<OTableConnectionData*>(&rConnData)->GetConnLineDataList(); @@ -111,10 +111,10 @@ OTableConnectionData& OTableConnectionData::operator=( const OTableConnectionDat } //------------------------------------------------------------------------ -BOOL OTableConnectionData::SetConnLine( USHORT nIndex, const String& rSourceFieldName, const String& rDestFieldName ) +sal_Bool OTableConnectionData::SetConnLine( sal_uInt16 nIndex, const String& rSourceFieldName, const String& rDestFieldName ) { - if (USHORT(m_vConnLineData.size()) < nIndex) - return FALSE; + if (sal_uInt16(m_vConnLineData.size()) < nIndex) + return sal_False; // == ist noch erlaubt, das entspricht einem Append if (m_vConnLineData.size() == nIndex) @@ -126,11 +126,11 @@ BOOL OTableConnectionData::SetConnLine( USHORT nIndex, const String& rSourceFiel pConnLineData->SetSourceFieldName( rSourceFieldName ); pConnLineData->SetDestFieldName( rDestFieldName ); - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL OTableConnectionData::AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ) +sal_Bool OTableConnectionData::AppendConnLine( const ::rtl::OUString& rSourceFieldName, const ::rtl::OUString& rDestFieldName ) { OConnectionLineDataVec::iterator aIter = m_vConnLineData.begin(); OConnectionLineDataVec::iterator aEnd = m_vConnLineData.end(); @@ -143,15 +143,15 @@ BOOL OTableConnectionData::AppendConnLine( const ::rtl::OUString& rSourceFieldNa { OConnectionLineDataRef pNew = new OConnectionLineData(rSourceFieldName, rDestFieldName); if (!pNew.is()) - return FALSE; + return sal_False; m_vConnLineData.push_back(pNew); } - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -void OTableConnectionData::ResetConnLines( BOOL /*bUseDefaults*/ ) +void OTableConnectionData::ResetConnLines( sal_Bool /*bUseDefaults*/ ) { OConnectionLineDataVec().swap(m_vConnLineData); } diff --git a/dbaccess/source/ui/querydesign/TableWindow.cxx b/dbaccess/source/ui/querydesign/TableWindow.cxx index 7eca4f2f9b5b..57185506f84c 100644 --- a/dbaccess/source/ui/querydesign/TableWindow.cxx +++ b/dbaccess/source/ui/querydesign/TableWindow.cxx @@ -90,7 +90,7 @@ OTableWindow::OTableWindow( Window* pParent, const TTableWindowData::value_type& ,m_nMoveCount(0) ,m_nMoveIncrement(1) ,m_nSizingFlags( SIZING_NONE ) - ,m_bActive( FALSE ) + ,m_bActive( sal_False ) { DBG_CTOR(OTableWindow,NULL); @@ -178,7 +178,7 @@ OTableWindowListBox* OTableWindow::CreateListBox() } //------------------------------------------------------------------------------ -BOOL OTableWindow::FillListBox() +sal_Bool OTableWindow::FillListBox() { m_pListBox->Clear(); if ( !m_pContainerListener.is() ) @@ -237,7 +237,7 @@ BOOL OTableWindow::FillListBox() OSL_FAIL("Exception occurred!"); } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/) @@ -287,7 +287,7 @@ void OTableWindow::impl_updateImage() } //------------------------------------------------------------------------------ -BOOL OTableWindow::Init() +sal_Bool OTableWindow::Init() { // create list box if necessary if ( !m_pListBox ) @@ -305,9 +305,9 @@ BOOL OTableWindow::Init() // die Felder in die ListBox eintragen clearListBox(); - BOOL bSuccess = FillListBox(); + sal_Bool bSuccess = FillListBox(); if ( bSuccess ) - m_pListBox->SelectAll( FALSE ); + m_pListBox->SelectAll( sal_False ); impl_updateImage(); @@ -359,7 +359,7 @@ void OTableWindow::Draw3DBorder(const Rectangle& rRect) Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const { Rectangle aSizingRect = Rectangle( GetPosPixel(), GetSizePixel() ); - UINT16 nSizingFlags = GetSizingFlags(); + sal_uInt16 nSizingFlags = GetSizingFlags(); if( nSizingFlags & SIZING_TOP ) { @@ -509,7 +509,7 @@ void OTableWindow::Resize() } //------------------------------------------------------------------------------ -void OTableWindow::SetBoldTitle( BOOL bBold ) +void OTableWindow::SetBoldTitle( sal_Bool bBold ) { Font aFont = m_aTitle.GetFont(); aFont.SetWeight( bBold?WEIGHT_BOLD:WEIGHT_NORMAL ); @@ -531,7 +531,7 @@ void OTableWindow::setActive(sal_Bool _bActive) SetBoldTitle( _bActive ); m_bActive = _bActive; if (!_bActive && m_pListBox && m_pListBox->GetSelectionCount() != 0) - m_pListBox->SelectAll(FALSE); + m_pListBox->SelectAll(sal_False); } //------------------------------------------------------------------------------ @@ -544,25 +544,25 @@ void OTableWindow::Remove() pTabWinCont->Invalidate(); } //------------------------------------------------------------------------------ -BOOL OTableWindow::HandleKeyInput( const KeyEvent& rEvt ) +sal_Bool OTableWindow::HandleKeyInput( const KeyEvent& rEvt ) { const KeyCode& rCode = rEvt.GetKeyCode(); - USHORT nCode = rCode.GetCode(); - BOOL bShift = rCode.IsShift(); - BOOL bCtrl = rCode.IsMod1(); + sal_uInt16 nCode = rCode.GetCode(); + sal_Bool bShift = rCode.IsShift(); + sal_Bool bCtrl = rCode.IsMod1(); - BOOL bHandle = FALSE; + sal_Bool bHandle = sal_False; if( !bCtrl && !bShift && (nCode==KEY_DELETE) ) { Remove(); - bHandle = TRUE; + bHandle = sal_True; } return bHandle; } //------------------------------------------------------------------------------ -BOOL OTableWindow::ExistsAConn() const +sal_Bool OTableWindow::ExistsAConn() const { return getTableView()->ExistsAConn(this); } @@ -648,7 +648,7 @@ void OTableWindow::Command(const CommandEvent& rEvt) // ----------------------------------------------------------------------------- long OTableWindow::PreNotify(NotifyEvent& rNEvt) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_KEYINPUT: @@ -670,19 +670,19 @@ long OTableWindow::PreNotify(NotifyEvent& rNEvt) switch( rCode.GetCode() ) { case KEY_DOWN: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.Y() += m_nMoveIncrement; break; case KEY_UP: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.Y() += -m_nMoveIncrement; break; case KEY_LEFT: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.X() += -m_nMoveIncrement; break; case KEY_RIGHT: - bHandled = TRUE; + bHandled = sal_True; aStartPoint.X() += m_nMoveIncrement; break; } @@ -765,7 +765,7 @@ long OTableWindow::PreNotify(NotifyEvent& rNEvt) { const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); const KeyCode& rCode = pKeyEvent->GetKeyCode(); - USHORT nKeyCode = rCode.GetCode(); + sal_uInt16 nKeyCode = rCode.GetCode(); if ( rCode.IsMod2() && nKeyCode != KEY_UP && nKeyCode != KEY_DOWN && nKeyCode != KEY_LEFT && nKeyCode != KEY_RIGHT ) { m_nMoveCount = 0; // reset our movement count diff --git a/dbaccess/source/ui/querydesign/TableWindowData.cxx b/dbaccess/source/ui/querydesign/TableWindowData.cxx index 6a9d63372a88..56cad8c62fff 100644 --- a/dbaccess/source/ui/querydesign/TableWindowData.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowData.cxx @@ -61,7 +61,7 @@ OTableWindowData::OTableWindowData( const Reference< XPropertySet>& _xTable ,m_sComposedName(_rComposedName) ,m_aPosition( Point(-1,-1) ) ,m_aSize( Size(-1,-1) ) - ,m_bShowAll( TRUE ) + ,m_bShowAll( sal_True ) ,m_bIsQuery(false) ,m_bIsValid(true) { @@ -82,13 +82,13 @@ OTableWindowData::~OTableWindowData() } //------------------------------------------------------------------------------ -BOOL OTableWindowData::HasPosition() const +sal_Bool OTableWindowData::HasPosition() const { return ( (m_aPosition.X() != -1) && (m_aPosition.Y() != -1) ); } //------------------------------------------------------------------------------ -BOOL OTableWindowData::HasSize() const +sal_Bool OTableWindowData::HasSize() const { return ( (m_aSize.Width() != -1) && (m_aSize.Height() !=-1) ); } diff --git a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx index a606ea669a29..9d0f29701421 100644 --- a/dbaccess/source/ui/querydesign/TableWindowListBox.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowListBox.cxx @@ -49,7 +49,7 @@ OJoinExchangeData::OJoinExchangeData(OTableWindowListBox* pBox) , pEntry(pBox->FirstSelected()) { } -const ULONG SCROLLING_TIMESPAN = 500; +const sal_uLong SCROLLING_TIMESPAN = 500; const long LISTBOX_SCROLLING_AREA = 6; //================================================================== // class OTableWindowListBox @@ -107,7 +107,7 @@ SvLBoxEntry* OTableWindowListBox::GetEntryFromText( const String& rEntryText ) OJoinDesignView* pView = m_pTabWin->getDesignView(); OJoinController& rController = pView->getController(); - BOOL bCase = FALSE; + sal_Bool bCase = sal_False; try { Reference<XConnection> xConnection = rController.getConnection(); @@ -136,7 +136,7 @@ SvLBoxEntry* OTableWindowListBox::GetEntryFromText( const String& rEntryText ) //------------------------------------------------------------------------------ void OTableWindowListBox::NotifyScrolled() { - m_bReallyScrolled = TRUE; + m_bReallyScrolled = sal_True; } //------------------------------------------------------------------------------ @@ -147,13 +147,13 @@ void OTableWindowListBox::NotifyEndScroll() m_pTabWin->getTableView()->Invalidate(INVALIDATE_NOCHILDREN); // ohne das INVALIDATE_NOCHILDREN wuerden auch alle Tabellen neu gezeichnet werden, // sprich : es flackert - m_bReallyScrolled = FALSE; + m_bReallyScrolled = sal_False; } //------------------------------------------------------------------------------ long OTableWindowListBox::PreNotify(NotifyEvent& rNEvt) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_KEYINPUT: @@ -194,7 +194,7 @@ IMPL_LINK( OTableWindowListBox, ScrollUpHdl, SvTreeListBox*, /*pBox*/ ) { ScrollOutputArea( -1 ); pEntry = GetEntry( m_aMousePos ); - Select( pEntry, TRUE ); + Select( pEntry, sal_True ); } return 0; @@ -211,7 +211,7 @@ IMPL_LINK( OTableWindowListBox, ScrollDownHdl, SvTreeListBox*, /*pBox*/ ) { ScrollOutputArea( 1 ); pEntry = GetEntry( m_aMousePos ); - Select( pEntry, TRUE ); + Select( pEntry, sal_True ); } return 0; @@ -246,7 +246,7 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) // remove the selection if the dragging operation is leaving the window if (_rEvt.mbLeaving) - SelectAll(FALSE); + SelectAll(sal_False); else { // hit test @@ -288,8 +288,8 @@ sal_Int8 OTableWindowListBox::AcceptDrop( const AcceptDropEvent& _rEvt ) // Beim Drag automatisch den richtigen Eintrag selektieren if ((FirstSelected() != pEntry) || (FirstSelected() && NextSelected(FirstSelected()))) - SelectAll(FALSE); - Select(pEntry, TRUE); + SelectAll(sal_False); + Select(pEntry, sal_True); // Auf den ersten Eintrag (*) kann nicht gedroppt werden if(!( m_pTabWin->GetData()->IsShowAll() && (pEntry==First()) )) @@ -363,8 +363,8 @@ void OTableWindowListBox::GetFocus() if ( GetSelectionCount() == 0 || GetCurEntry() != FirstSelected() ) { if ( FirstSelected() ) - Select(FirstSelected(), FALSE); - Select(GetCurEntry(), TRUE); + Select(FirstSelected(), sal_False); + Select(GetCurEntry(), sal_True); } else ShowFocusRect(FirstSelected()); diff --git a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx index c4e9d279a03e..6c740fb6c52d 100644 --- a/dbaccess/source/ui/querydesign/TableWindowTitle.cxx +++ b/dbaccess/source/ui/querydesign/TableWindowTitle.cxx @@ -64,7 +64,7 @@ OTableWindowTitle::OTableWindowTitle( OTableWindow* pParent ) : SetTextColor(aSystemStyle.GetButtonTextColor()); Font aFont( GetFont() ); - aFont.SetTransparent( TRUE ); + aFont.SetTransparent( sal_True ); SetFont( aFont ); } diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index af5244bd281d..15fbc7611c75 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -183,7 +183,7 @@ namespace dbaui // ----------------------------------------------------------------------------- long OQueryContainerWindow::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch (rNEvt.GetType()) { case EVENT_GETFOCUS: diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index fe761cc4ca4f..52fa237d061d 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -245,13 +245,13 @@ namespace dbaui namespace { // ----------------------------------------------------------------------------- - String lcl_getObjectResourceString( USHORT _nResId, sal_Int32 _nCommandType ) + String lcl_getObjectResourceString( sal_uInt16 _nResId, sal_Int32 _nCommandType ) { String sMessageText = String( ModuleRes( _nResId ) ); String sObjectType; { LocalResourceAccess aLocalRes( RSC_QUERY_OBJECT_TYPE, RSC_RESOURCE ); - sObjectType = String( ModuleRes( (USHORT)( _nCommandType + 1 ) ) ); + sObjectType = String( ModuleRes( (sal_uInt16)( _nCommandType + 1 ) ) ); } sMessageText.SearchAndReplace( String::CreateFromAscii( "$object$" ), sObjectType ); return sMessageText; @@ -692,9 +692,9 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& break; case SID_BROWSER_CLEAR_QUERY: { - getUndoMgr()->EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); + GetUndoManager().EnterListAction( String( ModuleRes(STR_QUERY_UNDO_TABWINDELETE) ), String() ); getContainer()->clear(); - getUndoMgr()->LeaveListAction(); + GetUndoManager().LeaveListAction(); setStatement_fireEvent( ::rtl::OUString() ); if(m_bGraphicalDesign) @@ -1037,7 +1037,7 @@ void OQueryController::impl_initialize() } } - getUndoMgr()->Clear(); + ClearUndoManager(); if ( ( m_bGraphicalDesign ) && ( ( !m_sName.getLength() && !editingCommand() ) @@ -1788,7 +1788,7 @@ void OQueryController::reset() { impl_reset(); getContainer()->reset( NULL ); - getUndoMgr()->Clear(); + ClearUndoManager(); } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index d2fb74b53327..2b9e70e8d07b 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -75,7 +75,7 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, const TTableConnectionData::value_type& _pData, OJoinTableView::OTableWindowMap* _pTableMap, const Reference< XConnection >& _xConnection, - BOOL _bAllowTableSelect) + sal_Bool _bAllowTableSelect) :ModalDialog( pParent, ModuleRes(DLG_QRY_JOIN) ) ,aML_HelpText( this, ModuleRes(ML_HELPTEXT) ) ,aPB_OK( this, ModuleRes( PB_OK ) ) @@ -154,8 +154,8 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, } else { - const USHORT nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); - for (USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { const long nJoinTyp = reinterpret_cast<long>(m_pJoinControl->aLB_JoinType.GetEntryData(i)); if ( !bSupportFullJoin && nJoinTyp == ID_FULL_JOIN ) @@ -193,8 +193,8 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) String sFirstWinName = m_pConnData->getReferencingTable()->GetWinName(); String sSecondWinName = m_pConnData->getReferencedTable()->GetWinName(); const EJoinType eOldJoinType = eJoinType; - USHORT nResId = 0; - const USHORT nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos(); + sal_uInt16 nResId = 0; + const sal_uInt16 nPos = m_pJoinControl->aLB_JoinType.GetSelectEntryPos(); const long nJoinType = reinterpret_cast<long>(m_pJoinControl->aLB_JoinType.GetEntryData(nPos)); sal_Bool bAddHint = sal_True; switch ( nJoinType ) @@ -229,11 +229,11 @@ IMPL_LINK( DlgQryJoin, LBChangeHdl, ListBox*, /*pListBox*/ ) m_pConnData->ResetConnLines(); m_pTableControl->lateInit(); - m_pJoinControl->m_aCBNatural.Check(FALSE); + m_pJoinControl->m_aCBNatural.Check(sal_False); m_pTableControl->enableRelation(false); ::rtl::OUString sEmpty; m_pConnData->AppendConnLine(sEmpty,sEmpty); - aPB_OK.Enable(TRUE); + aPB_OK.Enable(sal_True); } break; } @@ -284,7 +284,7 @@ IMPL_LINK( DlgQryJoin, OKClickHdl, Button*, /*pButton*/ ) IMPL_LINK( DlgQryJoin, NaturalToggleHdl, CheckBox*, /*pButton*/ ) { DBG_CHKTHIS(DlgQryJoin,NULL); - BOOL bChecked = m_pJoinControl->m_aCBNatural.IsChecked(); + sal_Bool bChecked = m_pJoinControl->m_aCBNatural.IsChecked(); static_cast<OQueryTableConnectionData*>(m_pConnData.get())->setNatural(bChecked); m_pTableControl->enableRelation(!bChecked); if ( bChecked ) @@ -356,8 +356,8 @@ void DlgQryJoin::setJoinType(EJoinType _eNewJoinType) break; } - const USHORT nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); - for (USHORT i = 0; i < nCount; ++i) + const sal_uInt16 nCount = m_pJoinControl->aLB_JoinType.GetEntryCount(); + for (sal_uInt16 i = 0; i < nCount; ++i) { if ( nJoinType == reinterpret_cast<long>(m_pJoinControl->aLB_JoinType.GetEntryData(i)) ) { diff --git a/dbaccess/source/ui/querydesign/querydlg.hxx b/dbaccess/source/ui/querydesign/querydlg.hxx index 2e0b331fb13e..21f4aea129ef 100644 --- a/dbaccess/source/ui/querydesign/querydlg.hxx +++ b/dbaccess/source/ui/querydesign/querydlg.hxx @@ -79,7 +79,7 @@ namespace dbaui const TTableConnectionData::value_type& pData, OJoinTableView::OTableWindowMap* _pTableMap, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection, - BOOL _bAllowTableSelect); + sal_Bool _bAllowTableSelect); virtual ~DlgQryJoin(); EJoinType GetJoinType() const { return eJoinType; }; diff --git a/dbaccess/source/ui/querydesign/querydlg.src b/dbaccess/source/ui/querydesign/querydlg.src index fe8f32da49a1..e0aec2c49d84 100644 --- a/dbaccess/source/ui/querydesign/querydlg.src +++ b/dbaccess/source/ui/querydesign/querydlg.src @@ -82,6 +82,7 @@ ModalDialog DLG_QRY_JOIN }; CheckBox CB_NATURAL { + HelpID = "dbaccess:CheckBox:DLG_QRY_JOIN:CB_NATURAL"; Pos = MAP_APPFONT ( 101 , 31 ) ; Size = MAP_APPFONT ( 89 , 8 ) ; diff --git a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx index b4dc806ea161..713f2677b255 100644 --- a/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx +++ b/dbaccess/source/ui/relationdesign/RTableConnectionData.cxx @@ -97,7 +97,7 @@ ORelationTableConnectionData::~ORelationTableConnectionData() } //------------------------------------------------------------------------ -BOOL ORelationTableConnectionData::DropRelation() +sal_Bool ORelationTableConnectionData::DropRelation() { DBG_CHKTHIS(ORelationTableConnectionData,NULL); ::osl::MutexGuard aGuard( m_aMutex ); @@ -126,7 +126,7 @@ BOOL ORelationTableConnectionData::DropRelation() } } } - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -175,10 +175,10 @@ void ORelationTableConnectionData::SetCardinality() } // ----------------------------------------------------------------------------- -BOOL ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const +sal_Bool ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet>& i_xTable,EConnectionSide _eEConnectionSide) const { // check if Table has the primary key column dependig on _eEConnectionSide - USHORT nPrimKeysCount = 0, + sal_uInt16 nPrimKeysCount = 0, nValidLinesCount = 0; const Reference< XNameAccess> xKeyColumns = dbtools::getPrimaryKeyColumns_throw(i_xTable); if ( xKeyColumns.is() ) @@ -202,15 +202,15 @@ BOOL ORelationTableConnectionData::checkPrimaryKey(const Reference< XPropertySet } } if ( nPrimKeysCount != aKeyColumns.getLength() ) - return FALSE; + return sal_False; } if ( !nPrimKeysCount || nPrimKeysCount != nValidLinesCount ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } //------------------------------------------------------------------------ -BOOL ORelationTableConnectionData::IsConnectionPossible() +sal_Bool ORelationTableConnectionData::IsConnectionPossible() { DBG_CHKTHIS(ORelationTableConnectionData,NULL); ::osl::MutexGuard aGuard( m_aMutex ); @@ -220,7 +220,7 @@ BOOL ORelationTableConnectionData::IsConnectionPossible() if ( IsSourcePrimKey() && !IsDestPrimKey() ) ChangeOrientation(); - return TRUE; + return sal_True; } //------------------------------------------------------------------------ @@ -283,7 +283,7 @@ bool operator==(const ORelationTableConnectionData& lhs, const ORelationTableCon } } //------------------------------------------------------------------------ -BOOL ORelationTableConnectionData::Update() +sal_Bool ORelationTableConnectionData::Update() { ::osl::MutexGuard aGuard( m_aMutex ); //////////////////////////////////////////////////////////// @@ -291,7 +291,7 @@ BOOL ORelationTableConnectionData::Update() { DropRelation(); if( !IsConnectionPossible() ) - return FALSE; + return sal_False; } // reassign the keys because the orientaion could be changed @@ -299,7 +299,7 @@ BOOL ORelationTableConnectionData::Update() Reference< XIndexAccess> xKeys ( getReferencingTable()->getKeys()); if ( !xKeys.is() ) - return FALSE; + return sal_False; //////////////////////////////////////////////////////////// // Neue Relation erzeugen Reference<XDataDescriptorFactory> xKeyFactory(xKeys,UNO_QUERY); @@ -459,7 +459,7 @@ xKey.clear(); // Kardinalitaet bestimmen SetCardinality(); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------------- diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index eae22012b8b7..9af062981e78 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -368,7 +368,7 @@ namespace if ( aFind == m_aTableData.end() ) { aFind = m_aTableData.insert(TTableDataHelper::value_type(sSourceName,::boost::shared_ptr<OTableWindowData>(new OTableWindowData(xTableProp,sSourceName, sSourceName)))).first; - aFind->second->ShowAll(FALSE); + aFind->second->ShowAll(sal_False); } TTableWindowData::value_type pReferencingTable = aFind->second; Reference<XIndexAccess> xKeys = pReferencingTable->getKeys(); @@ -401,7 +401,7 @@ namespace { Reference<XPropertySet> xReferencedTable(m_xTables->getByName(sReferencedTable),UNO_QUERY); aRefFind = m_aTableData.insert(TTableDataHelper::value_type(sReferencedTable,::boost::shared_ptr<OTableWindowData>(new OTableWindowData(xReferencedTable,sReferencedTable, sReferencedTable)))).first; - aRefFind->second->ShowAll(FALSE); + aRefFind->second->ShowAll(sal_False); } else continue; // table name could not be found so we do not show this table releation @@ -490,7 +490,7 @@ IMPL_LINK( ORelationController, OnThreadFinished, void*, /*NOTINTERESTEDIN*/ ) { getView()->initialize(); // show the windows and fill with our informations getView()->Invalidate(INVALIDATE_NOERASE); - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet if(m_vTableData.empty()) diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index e42211609361..d334aa93b133 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -171,7 +171,7 @@ void ORelationTableView::ReSync() GetTabWinMap()->begin()->second->GrabFocus(); } //------------------------------------------------------------------------------ -BOOL ORelationTableView::IsAddAllowed() +sal_Bool ORelationTableView::IsAddAllowed() { DBG_CHKTHIS(ORelationTableView,NULL); @@ -274,9 +274,9 @@ void ORelationTableView::AddNewRelation() DBG_CHKTHIS(ORelationTableView,NULL); TTableConnectionData::value_type pNewConnData( new ORelationTableConnectionData() ); - ORelationDialog aRelDlg(this, pNewConnData, TRUE); + ORelationDialog aRelDlg(this, pNewConnData, sal_True); - BOOL bSuccess = (aRelDlg.Execute() == RET_OK); + sal_Bool bSuccess = (aRelDlg.Execute() == RET_OK); if (bSuccess) { // already updated by the dialog @@ -307,7 +307,7 @@ bool ORelationTableView::RemoveConnection( OTableConnection* pConn ,sal_Bool /*_ } //------------------------------------------------------------------------------ -void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, BOOL /*bNewTable*/) +void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool /*bNewTable*/) { DBG_CHKTHIS(ORelationTableView,NULL); OSL_ENSURE(_rComposedName.getLength(),"There must be a table name supplied!"); @@ -325,7 +325,7 @@ void ORelationTableView::AddTabWin(const ::rtl::OUString& _rComposedName, const ////////////////////////////////////////////////////////////////// // Neue Datenstruktur in DocShell eintragen TTableWindowData::value_type pNewTabWinData(createTableWindowData( _rComposedName, rWinName,rWinName )); - pNewTabWinData->ShowAll(FALSE); + pNewTabWinData->ShowAll(sal_False); ////////////////////////////////////////////////////////////////// // Neues Fenster in Fensterliste eintragen @@ -358,7 +358,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) OSQLWarningBox aDlg( this, ModuleRes( STR_QUERY_REL_DELETE_WINDOW ), WB_YES_NO | WB_DEF_YES ); if ( m_bInRemove || aDlg.Execute() == RET_YES ) { - m_pView->getController().getUndoMgr()->Clear(); + m_pView->getController().ClearUndoManager(); OJoinTableView::RemoveTabWin( pTabWin ); m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION); @@ -366,7 +366,7 @@ void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) m_pView->getController().InvalidateFeature(ID_BROWSER_REDO); } } -// ----------------------------------------------------------------------------- + void ORelationTableView::lookForUiActivities() { if(m_pExistingConnection) @@ -379,7 +379,7 @@ void ORelationTableView::lookForUiActivities() aDlg.AddButton( ModuleRes(STR_QUERY_REL_EDIT), BUTTONID_OK, BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON); aDlg.AddButton( ModuleRes(STR_QUERY_REL_CREATE), BUTTONID_YES, 0); aDlg.AddButton(BUTTON_CANCEL,BUTTONID_CANCEL,0); - UINT16 nRet = aDlg.Execute(); + sal_uInt16 nRet = aDlg.Execute(); if( nRet == RET_CANCEL) { m_pCurrentlyTabConnData.reset(); @@ -428,7 +428,7 @@ void ORelationTableView::_elementRemoved( const container::ContainerEvent& _rEve OTableWindow* pTableWindow = GetTabWindow(sName); if ( pTableWindow ) { - m_pView->getController().getUndoMgr()->Clear(); + m_pView->getController().ClearUndoManager(); OJoinTableView::RemoveTabWin( pTableWindow ); m_pView->getController().InvalidateFeature(SID_RELATION_ADD_RELATION); diff --git a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx index 87cbbe9fb928..d95ddefbebf6 100644 --- a/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx +++ b/dbaccess/source/ui/tabledesign/FieldDescGenWin.hxx @@ -56,9 +56,9 @@ namespace dbaui void DisplayData( OFieldDescription* pFieldDescr ); void SaveData( OFieldDescription* pFieldDescr ); - void SetControlText( USHORT nControlId, const String& rText ); - String GetControlText( USHORT nControlId ); - void SetReadOnly( BOOL bReadOnly ); + void SetControlText( sal_uInt16 nControlId, const String& rText ); + String GetControlText( sal_uInt16 nControlId ); + void SetReadOnly( sal_Bool bReadOnly ); #if OSL_DEBUG_LEVEL > 0 OTableEditorCtrl* GetEditorCtrl(); #endif diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx index 6afad1cd9040..d6e0c2703fa9 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.cxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx @@ -56,6 +56,8 @@ #include "TableFieldControl.hxx" #include "dsntypes.hxx" +#include "dbaccess_slotid.hrc" + using namespace ::dbaui; using namespace ::comphelper; using namespace ::svt; @@ -104,7 +106,7 @@ DBG_NAME(OTableEditorCtrl) //================================================================== DBG_NAME(ClipboardInvalidator) //------------------------------------------------------------------ -OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(ULONG nTimeout,OTableEditorCtrl* _pOwner) +OTableEditorCtrl::ClipboardInvalidator::ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl* _pOwner) : m_pOwner(_pOwner) { DBG_CTOR(ClipboardInvalidator,NULL); @@ -210,13 +212,13 @@ OTableEditorCtrl::OTableEditorCtrl(Window* pWindow) } //------------------------------------------------------------------------------ -SfxUndoManager* OTableEditorCtrl::GetUndoManager() const +SfxUndoManager& OTableEditorCtrl::GetUndoManager() const { - return GetView()->getController().getUndoMgr(); + return GetView()->getController().GetUndoManager(); } //------------------------------------------------------------------------------ -BOOL OTableEditorCtrl::IsReadOnly() +sal_Bool OTableEditorCtrl::IsReadOnly() { DBG_CHKTHIS(OTableEditorCtrl,NULL); return bReadOnly; @@ -330,7 +332,7 @@ OTableEditorCtrl::~OTableEditorCtrl() DBG_DTOR(OTableEditorCtrl,NULL); ////////////////////////////////////////////////////////////////////// // Undo-Manager zuruecksetzen - GetUndoManager()->Clear(); + GetUndoManager().Clear(); ////////////////////////////////////////////////////////////////////// // Moegliche Events aus Queue entfernen @@ -623,7 +625,7 @@ sal_Bool OTableEditorCtrl::SaveData(long nRow, sal_uInt16 nColId) // Wenn FieldDescr existiert, wurde Feld geloescht und alter Inhalt wird wiederhergestellt if (pActFieldDescr) { - GetUndoManager()->AddUndoAction(new OTableEditorTypeSelUndoAct(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo())); + GetUndoManager().AddUndoAction(new OTableEditorTypeSelUndoAct(this, nRow, FIELD_TYPE, pActFieldDescr->getTypeInfo())); SwitchType(TOTypeInfoSP()); pActFieldDescr = pActRow->GetActFieldDescr(); } @@ -789,7 +791,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) default: sActionDescription = String( ModuleRes( STR_CHANGE_COLUMN_ATTRIBUTE ) ); break; } - GetUndoManager()->EnterListAction( sActionDescription, String() ); + GetUndoManager().EnterListAction( sActionDescription, String() ); if (!pActFieldDescr) { const OTypeInfoMap* pTypeInfoMap = GetView()->getController().getTypeInfo(); @@ -806,20 +808,20 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) nInvalidateTypeEvent = Application::PostUserEvent( LINK(this, OTableEditorCtrl, InvalidateFieldType) ); pActFieldDescr = pActRow->GetActFieldDescr(); pDescrWin->DisplayData( pActFieldDescr ); - GetUndoManager()->AddUndoAction( new OTableEditorTypeSelUndoAct(this, nRow, nColId+1, TOTypeInfoSP()) ); + GetUndoManager().AddUndoAction( new OTableEditorTypeSelUndoAct(this, nRow, nColId+1, TOTypeInfoSP()) ); } if( nColId != FIELD_TYPE ) - GetUndoManager()->AddUndoAction( new OTableDesignCellUndoAct(this, nRow, nColId) ); + GetUndoManager().AddUndoAction( new OTableDesignCellUndoAct(this, nRow, nColId) ); else { - GetUndoManager()->AddUndoAction(new OTableEditorTypeSelUndoAct(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo())); + GetUndoManager().AddUndoAction(new OTableEditorTypeSelUndoAct(this, GetCurRow(), nColId, GetFieldDescr(GetCurRow())->getTypeInfo())); resetType(); } SaveData(nRow,nColId); // SaveData could create a undo action as well - GetUndoManager()->LeaveListAction(); + GetUndoManager().LeaveListAction(); RowModified(nRow); CellControllerRef xController(Controller()); if(xController.Is()) @@ -833,7 +835,7 @@ void OTableEditorCtrl::CellModified( long nRow, sal_uInt16 nColId ) // ----------------------------------------------------------------------------- void OTableEditorCtrl::resetType() { - USHORT nPos = pTypeCell->GetSelectEntryPos(); + sal_uInt16 nPos = pTypeCell->GetSelectEntryPos(); if(nPos != LISTBOX_ENTRY_NOTFOUND) SwitchType( GetView()->getController().getTypeInfo(nPos) ); else @@ -982,7 +984,7 @@ void OTableEditorCtrl::InsertRows( long nRow ) ////////////////////////////////////////////////////////////////////// // Undo-Action erzeugen - GetUndoManager()->AddUndoAction( new OTableEditorInsUndoAct(this, nRow,vInsertedUndoRedoRows) ); + GetUndoManager().AddUndoAction( new OTableEditorInsUndoAct(this, nRow,vInsertedUndoRedoRows) ); GetView()->getController().setModified( sal_True ); InvalidateFeatures(); } @@ -994,7 +996,7 @@ void OTableEditorCtrl::DeleteRows() OSL_ENSURE(GetView()->getController().isDropAllowed(),"Call of DeleteRows not valid here. Please check isDropAllowed!"); ////////////////////////////////////////////////////////////////////// // Undo-Action erzeugen - GetUndoManager()->AddUndoAction( new OTableEditorDelUndoAct(this) ); + GetUndoManager().AddUndoAction( new OTableEditorDelUndoAct(this) ); ////////////////////////////////////////////////////////////////////// @@ -1042,7 +1044,7 @@ void OTableEditorCtrl::InsertNewRows( long nRow ) long nInsertRows = GetSelectRowCount(); if( !nInsertRows ) nInsertRows = 1; - GetUndoManager()->AddUndoAction( new OTableEditorInsNewUndoAct(this, nRow, nInsertRows) ); + GetUndoManager().AddUndoAction( new OTableEditorInsNewUndoAct(this, nRow, nInsertRows) ); ////////////////////////////////////////////////////////////////////// // Zahl der selektierten Zeilen werden neu eingefuegt for( long i=nRow; i<(nRow+nInsertRows); i++ ) @@ -1578,7 +1580,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) if ( 1 == GetSelectColumnCount() ) { sal_uInt16 nSelId = GetColumnId( - sal::static_int_cast< USHORT >( + sal::static_int_cast< sal_uInt16 >( FirstSelectedColumn() ) ); ::Rectangle aColRect( GetFieldRectPixel( 0, nSelId, sal_False ) ); @@ -1813,7 +1815,7 @@ void OTableEditorCtrl::SetPrimaryKey( sal_Bool bSet ) } } - GetUndoManager()->AddUndoAction( new OPrimKeyUndoAct(this, aDeletedPrimKeys, aInsertedPrimKeys) ); + GetUndoManager().AddUndoAction( new OPrimKeyUndoAct(this, aDeletedPrimKeys, aInsertedPrimKeys) ); ////////////////////////////////////////////////////////////////////// // Handle-Spalte invalidieren @@ -1875,7 +1877,7 @@ void OTableEditorCtrl::SwitchType( const TOTypeInfoSP& _pType ) || ( GetView()->getController().getTypeInfo( nCurrentlySelected ) != _pType ) ) { - USHORT nEntryPos = 0; + sal_uInt16 nEntryPos = 0; const OTypeInfoMap* pTypeInfo = GetView()->getController().getTypeInfo(); OTypeInfoMap::const_iterator aIter = pTypeInfo->begin(); OTypeInfoMap::const_iterator aEnd = pTypeInfo->end(); diff --git a/dbaccess/source/ui/tabledesign/TEditControl.hxx b/dbaccess/source/ui/tabledesign/TEditControl.hxx index 1d154ee5be0d..3128d979b681 100644 --- a/dbaccess/source/ui/tabledesign/TEditControl.hxx +++ b/dbaccess/source/ui/tabledesign/TEditControl.hxx @@ -63,19 +63,19 @@ namespace dbaui ::boost::shared_ptr<OTableRow> pActRow; - ULONG nIndexEvent; - ULONG nCutEvent; - ULONG nPasteEvent; - ULONG nDeleteEvent; - ULONG nInsNewRowsEvent; - ULONG nInvalidateTypeEvent; - ULONG nEntryNotFoundEvent; + sal_uLong nIndexEvent; + sal_uLong nCutEvent; + sal_uLong nPasteEvent; + sal_uLong nDeleteEvent; + sal_uLong nInsNewRowsEvent; + sal_uLong nInvalidateTypeEvent; + sal_uLong nEntryNotFoundEvent; ChildFocusState m_eChildFocus; long nOldDataPos; - BOOL bSaveOnMove; - BOOL bReadOnly; + sal_Bool bSaveOnMove; + sal_Bool bReadOnly; //------------------------------------------------------------------ // Hilfsklasse class ClipboardInvalidator @@ -85,7 +85,7 @@ namespace dbaui OTableEditorCtrl* m_pOwner; public: - ClipboardInvalidator(ULONG nTimeout,OTableEditorCtrl*); + ClipboardInvalidator(sal_uLong nTimeout,OTableEditorCtrl*); ~ClipboardInvalidator(); protected: @@ -97,19 +97,19 @@ namespace dbaui protected: virtual void Command( const CommandEvent& rEvt ); - virtual BOOL SeekRow(long nRow); + virtual sal_Bool SeekRow(long nRow); virtual void PaintCell(OutputDevice& rDev, const Rectangle& rRect, - USHORT nColumnId ) const; + sal_uInt16 nColumnId ) const; virtual void CursorMoved(); virtual RowStatus GetRowStatus(long nRow) const; - virtual ::svt::CellController* GetController(long nRow, USHORT nCol); - virtual void InitController(::svt::CellControllerRef& rController, long nRow, USHORT nCol); + virtual ::svt::CellController* GetController(long nRow, sal_uInt16 nCol); + virtual void InitController(::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol); virtual void CellModified(); - virtual BOOL SaveModified(); // wird aufgerufen vor einem Zellenwechsel - // return FALSE, verhindert Zellenwechsel + virtual sal_Bool SaveModified(); // wird aufgerufen vor einem Zellenwechsel + // return sal_False, verhindert Zellenwechsel virtual void Undo(); virtual void Redo(); virtual String GetCellText(long nRow, sal_uInt16 nColId) const; @@ -126,8 +126,8 @@ namespace dbaui void ClearModified(); - void SetPrimaryKey( BOOL bSet ); - BOOL IsPrimaryKey(); + void SetPrimaryKey( sal_Bool bSet ); + sal_Bool IsPrimaryKey(); DECL_LINK(ControlPreNotifyHdl, NotifyEvent*); @@ -135,15 +135,15 @@ namespace dbaui // TYPEINFO(); OTableEditorCtrl(Window* pParentWin); virtual ~OTableEditorCtrl(); - virtual BOOL CursorMoving(long nNewRow, USHORT nNewCol); + virtual sal_Bool CursorMoving(long nNewRow, sal_uInt16 nNewCol); virtual void UpdateAll(); - SfxUndoManager* GetUndoManager() const; + SfxUndoManager& GetUndoManager() const; void SetDescrWin( OTableFieldDescWin* pWin ){ pDescrWin = pWin; if (pDescrWin && pActRow) pDescrWin->DisplayData(pActRow->GetActFieldDescr()); } - BOOL SaveCurRow(); + sal_Bool SaveCurRow(); void SwitchType( const TOTypeInfoSP& _pType ); - void DisplayData( long nRow, BOOL bGrabFocus = TRUE ); + void DisplayData( long nRow, sal_Bool bGrabFocus = sal_True ); // erzwingt das Anzeigen der genannten Zeile (selbst wenn es eigentlich schon die aktuelle ist) virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ); @@ -158,15 +158,15 @@ namespace dbaui ::boost::shared_ptr<OTableRow> GetActRow(){ return pActRow; } void CellModified( long nRow, sal_uInt16 nColId ); - void SetReadOnly( BOOL bRead=TRUE ); + void SetReadOnly( sal_Bool bRead=sal_True ); virtual void Init(); virtual void DeactivateCell(sal_Bool bUpdate = sal_True); - BOOL IsCutAllowed( long nRow = -1 ); - BOOL IsCopyAllowed( long nRow = -1 ); - BOOL IsPasteAllowed( long nRow = -1 ); - BOOL IsReadOnly(); + sal_Bool IsCutAllowed( long nRow = -1 ); + sal_Bool IsCopyAllowed( long nRow = -1 ); + sal_Bool IsPasteAllowed( long nRow = -1 ); + sal_Bool IsReadOnly(); OFieldDescription* GetFieldDescr( long nRow ); // window overloads @@ -191,11 +191,11 @@ namespace dbaui DECL_LINK( EntryNotFound, void* ); void InitCellController(); - INT32 HasFieldName( const String& rFieldName ); + sal_Int32 HasFieldName( const String& rFieldName ); String GenerateName( const String& rName ); - BOOL SetDataPtr( long nRow ); + sal_Bool SetDataPtr( long nRow ); - BOOL SaveData(long nRow, USHORT nColumnId); + sal_Bool SaveData(long nRow, sal_uInt16 nColumnId); /** AdjustFieldDescription set the needed values for the description @param _pFieldDesc the field description where to set the values @param _rMultiSel contains the postions which changed for undo/redo diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx index d3571d08f188..28450226eb81 100644 --- a/dbaccess/source/ui/tabledesign/TableController.cxx +++ b/dbaccess/source/ui/tabledesign/TableController.cxx @@ -566,7 +566,7 @@ void OTableController::impl_initialize() { loadData(); // fill the column information form the table getView()->initialize(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet } catch( const Exception& ) @@ -659,11 +659,6 @@ void OTableController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:EditDoc", ID_BROWSER_EDITDOC, CommandGroup::EDIT ); } // ----------------------------------------------------------------------------- -SfxUndoManager* OTableController::getUndoMgr() -{ - return &m_aUndoManager; -} -// ----------------------------------------------------------------------------- void OTableController::impl_onModifyChanged() { OSingleDocumentController::impl_onModifyChanged(); @@ -1511,7 +1506,7 @@ void OTableController::reSyncRows() } static_cast<OTableDesignView*>(getView())->reSync(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet } // ----------------------------------------------------------------------------- @@ -1567,7 +1562,7 @@ void OTableController::reload() { loadData(); // fill the column information form the table static_cast<OTableDesignView*>(getView())->reSync(); // show the windows and fill with our informations - getUndoMgr()->Clear(); // clear all undo redo things + ClearUndoManager(); setModified(sal_False); // and we are not modified yet static_cast<OTableDesignView*>(getView())->Invalidate(); } diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index e34436da74e6..0867deb7a4b7 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -55,9 +55,9 @@ OTableRowView::OTableRowView(Window* pParent) ,m_nDataPos(-1) ,m_nCurrentPos(-1) ,m_nCurUndoActId(0) - ,m_bCurrentModified(FALSE) - ,m_bUpdatable(FALSE) - ,m_bClipboardFilled(FALSE) + ,m_bCurrentModified(sal_False) + ,m_bUpdatable(sal_False) + ,m_bClipboardFilled(sal_False) { DBG_CTOR(OTableRowView,NULL); @@ -85,7 +85,7 @@ void OTableRowView::Init() SetFont(aFont); // HandleColumn, fuer maximal fuenf Ziffern einrichten - InsertHandleColumn(static_cast<USHORT>(GetTextWidth('0') * 4)/*, TRUE */); + InsertHandleColumn(static_cast<sal_uInt16>(GetTextWidth('0') * 4)/*, sal_True */); BrowserMode nMode = BROWSER_COLUMNSELECTION | BROWSER_MULTISELECTION | BROWSER_KEEPSELECTION | BROWSER_HLINESFULL | BROWSER_VLINESFULL | BROWSER_AUTOSIZE_LASTCOL; @@ -118,7 +118,7 @@ void OTableRowView::KeyInput( const KeyEvent& rEvt ) } //------------------------------------------------------------------------ -void OTableRowView::SetUpdatable( BOOL bUpdate ) +void OTableRowView::SetUpdatable( sal_Bool bUpdate ) { m_bUpdatable = bUpdate; @@ -138,7 +138,7 @@ void OTableRowView::Command(const CommandEvent& rEvt) return; } - USHORT nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); + sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); if ( nColId == HANDLE_ID ) diff --git a/dbaccess/source/ui/tabledesign/TableDesignView.cxx b/dbaccess/source/ui/tabledesign/TableDesignView.cxx index 39ffb23df34d..4c5882c7ef9e 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignView.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignView.cxx @@ -277,7 +277,7 @@ IMPL_LINK( OTableDesignView, SwitchHdl, Accelerator*, /*pAcc*/ ) //------------------------------------------------------------------------------ long OTableDesignView::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch(rNEvt.GetType()) { case EVENT_GETFOCUS: diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx index 4eb83be92c2b..97484d519948 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.cxx @@ -104,7 +104,7 @@ void OTableFieldControl::DeactivateAggregate( EControlType eType ) } } // ----------------------------------------------------------------------------- -void OTableFieldControl::SetModified(BOOL bModified) +void OTableFieldControl::SetModified(sal_Bool bModified) { GetCtrl()->GetView()->getController().setModified(bModified); } diff --git a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx index a45d2928889c..22a77811b51c 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldControl.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldControl.hxx @@ -44,9 +44,9 @@ namespace dbaui virtual void ActivateAggregate( EControlType eType ); virtual void DeactivateAggregate( EControlType eType ); // Sind von den abgeleiteten Klassen zu impl. - virtual void CellModified(long nRow, USHORT nColId ); - virtual BOOL IsReadOnly(); - virtual void SetModified(BOOL bModified); + virtual void CellModified(long nRow, sal_uInt16 nColId ); + virtual sal_Bool IsReadOnly(); + virtual void SetModified(sal_Bool bModified); virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > GetFormatter() const; virtual ::com::sun::star::lang::Locale GetLocale() const; diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx index 3e8548a32a50..ca2680fc09a8 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx @@ -303,7 +303,7 @@ void OTableFieldDescWin::LoseFocus() // ----------------------------------------------------------------------------- long OTableFieldDescWin::PreNotify( NotifyEvent& rNEvt ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; switch(rNEvt.GetType()) { case EVENT_GETFOCUS: diff --git a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx index f26a9b1471fc..5bfb03283cfc 100644 --- a/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx +++ b/dbaccess/source/ui/tabledesign/TableFieldDescWin.hxx @@ -70,16 +70,16 @@ namespace dbaui void DisplayData( OFieldDescription* pFieldDescr ); void SaveData( OFieldDescription* pFieldDescr ); - void SetReadOnly( BOOL bReadOnly ); + void SetReadOnly( sal_Bool bReadOnly ); // window overloads virtual long PreNotify( NotifyEvent& rNEvt ); virtual void GetFocus(); virtual void LoseFocus(); - void SetControlText( USHORT nControlId, const String& rText ) + void SetControlText( sal_uInt16 nControlId, const String& rText ) { m_pGenPage->SetControlText(nControlId,rText); } - String GetControlText( USHORT nControlId ) + String GetControlText( sal_uInt16 nControlId ) { return m_pGenPage->GetControlText(nControlId); } // short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; } diff --git a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx index ee2522df46c8..97a6f2d649f1 100644 --- a/dbaccess/source/ui/tabledesign/TableRowExchange.cxx +++ b/dbaccess/source/ui/tabledesign/TableRowExchange.cxx @@ -68,7 +68,7 @@ namespace dbaui // ----------------------------------------------------------------------------- sal_Bool OTableRowExchange::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor ) { - ULONG nFormat = SotExchange::GetFormat(rFlavor); + sal_uLong nFormat = SotExchange::GetFormat(rFlavor); if(nFormat == SOT_FORMATSTR_ID_SBA_TABED) return SetObject(&m_vTableRow,SOT_FORMATSTR_ID_SBA_TABED,rFlavor); return sal_False; diff --git a/dbaccess/source/ui/tabledesign/TableUndo.cxx b/dbaccess/source/ui/tabledesign/TableUndo.cxx index 794aefe3963b..36262c5a0ac1 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.cxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.cxx @@ -55,7 +55,7 @@ TYPEINIT1( OPrimKeyUndoAct, OTableEditorUndoAct ); // class OTableDesignUndoAct //============================================================================== DBG_NAME(OTableDesignUndoAct); -OTableDesignUndoAct::OTableDesignUndoAct( OTableRowView* pOwner,USHORT nCommentID ) : OCommentUndoAction(nCommentID) +OTableDesignUndoAct::OTableDesignUndoAct( OTableRowView* pOwner,sal_uInt16 nCommentID ) : OCommentUndoAction(nCommentID) ,m_pTabDgnCtrl( pOwner ) { DBG_CTOR(OTableDesignUndoAct,NULL); @@ -99,7 +99,7 @@ void OTableDesignUndoAct::Redo() // class OTableDesignCellUndoAct //============================================================================== DBG_NAME(OTableDesignCellUndoAct); -OTableDesignCellUndoAct::OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, USHORT nColumn ) : +OTableDesignCellUndoAct::OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn ) : OTableDesignUndoAct( pOwner ,STR_TABED_UNDO_CELLMODIFIED) ,m_nCol( nColumn ) ,m_nRow( nRowID ) @@ -153,7 +153,7 @@ void OTableDesignCellUndoAct::Redo() // class OTableEditorUndoAct //============================================================================== DBG_NAME(OTableEditorUndoAct); -OTableEditorUndoAct::OTableEditorUndoAct( OTableEditorCtrl* pOwner,USHORT _nCommentID ) : +OTableEditorUndoAct::OTableEditorUndoAct( OTableEditorCtrl* pOwner,sal_uInt16 _nCommentID ) : OTableDesignUndoAct( pOwner ,_nCommentID) ,pTabEdCtrl(pOwner) { @@ -170,7 +170,7 @@ OTableEditorUndoAct::~OTableEditorUndoAct() // class OTableEditorTypeSelUndoAct //============================================================================== DBG_NAME(OTableEditorTypeSelUndoAct); -OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, USHORT nColumn, const TOTypeInfoSP& _pOldType ) +OTableEditorTypeSelUndoAct::OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ) :OTableEditorUndoAct( pOwner ,STR_TABED_UNDO_TYPE_CHANGED) ,m_nCol( nColumn ) ,m_nRow( nRowID ) @@ -249,7 +249,7 @@ void OTableEditorDelUndoAct::Undo() { ////////////////////////////////////////////////////////////////////// // Geloeschte Zeilen wieder einfuegen - ULONG nPos; + sal_uLong nPos; ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_aDeletedRows.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_aDeletedRows.end(); @@ -273,7 +273,7 @@ void OTableEditorDelUndoAct::Redo() { ////////////////////////////////////////////////////////////////////// // Zeilen wieder loeschen - ULONG nPos; + sal_uLong nPos; ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aIter = m_aDeletedRows.begin(); ::std::vector< ::boost::shared_ptr<OTableRow> >::iterator aEnd = m_aDeletedRows.end(); ::std::vector< ::boost::shared_ptr<OTableRow> >* pOriginalRows = pTabEdCtrl->GetRowList(); @@ -322,7 +322,7 @@ void OTableEditorInsUndoAct::Undo() pOriginalRows->erase(pOriginalRows->begin()+i); } - pTabEdCtrl->RowRemoved( m_nInsPos, m_vInsertedRows.size(), TRUE ); + pTabEdCtrl->RowRemoved( m_nInsPos, m_vInsertedRows.size(), sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Undo(); @@ -345,7 +345,7 @@ void OTableEditorInsUndoAct::Redo() nInsertRow++; } - pTabEdCtrl->RowInserted( m_nInsPos, m_vInsertedRows.size(), TRUE ); + pTabEdCtrl->RowInserted( m_nInsPos, m_vInsertedRows.size(), sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Redo(); @@ -381,7 +381,7 @@ void OTableEditorInsNewUndoAct::Undo() pOriginalRows->erase(pOriginalRows->begin()+i); } - pTabEdCtrl->RowRemoved( m_nInsPos, m_nInsRows, TRUE ); + pTabEdCtrl->RowRemoved( m_nInsPos, m_nInsRows, sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Undo(); @@ -397,7 +397,7 @@ void OTableEditorInsNewUndoAct::Redo() for( long i=m_nInsPos; i<(m_nInsPos+m_nInsRows); i++ ) pRowList->insert( pRowList->begin()+i,::boost::shared_ptr<OTableRow>(new OTableRow()) ); - pTabEdCtrl->RowInserted( m_nInsPos, m_nInsRows, TRUE ); + pTabEdCtrl->RowInserted( m_nInsPos, m_nInsRows, sal_True ); pTabEdCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Redo(); @@ -437,7 +437,7 @@ void OPrimKeyUndoAct::Undo() { OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!"); pRow = (*pRowList)[nIndex]; - pRow->SetPrimaryKey( FALSE ); + pRow->SetPrimaryKey( sal_False ); } ////////////////////////////////////////////////////////////////////// @@ -446,7 +446,7 @@ void OPrimKeyUndoAct::Undo() { OSL_ENSURE(nIndex <= static_cast<long>(pRowList->size()),"Index for undo isn't valid!"); pRow = (*pRowList)[nIndex]; - pRow->SetPrimaryKey( TRUE ); + pRow->SetPrimaryKey( sal_True ); } m_pEditorCtrl->InvalidateHandleColumn(); @@ -462,12 +462,12 @@ void OPrimKeyUndoAct::Redo() ////////////////////////////////////////////////////////////////////// // Die geloeschten Keys loeschen for( nIndex = m_aDelKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aDelKeys.NextSelected() ) - (*pRowList)[nIndex]->SetPrimaryKey( FALSE ); + (*pRowList)[nIndex]->SetPrimaryKey( sal_False ); ////////////////////////////////////////////////////////////////////// // Die eingefuegten Keys herstellen for( nIndex = m_aInsKeys.FirstSelected(); nIndex != (long)SFX_ENDOFSELECTION; nIndex=m_aInsKeys.NextSelected() ) - (*pRowList)[nIndex]->SetPrimaryKey( TRUE ); + (*pRowList)[nIndex]->SetPrimaryKey( sal_True ); m_pEditorCtrl->InvalidateHandleColumn(); OTableEditorUndoAct::Redo(); diff --git a/dbaccess/source/ui/tabledesign/TableUndo.hxx b/dbaccess/source/ui/tabledesign/TableUndo.hxx index ff744b2f0d57..23ecf12b8e61 100644 --- a/dbaccess/source/ui/tabledesign/TableUndo.hxx +++ b/dbaccess/source/ui/tabledesign/TableUndo.hxx @@ -50,7 +50,7 @@ namespace dbaui virtual void Redo(); public: TYPEINFO(); - OTableDesignUndoAct( OTableRowView* pOwner ,USHORT nCommentID); + OTableDesignUndoAct( OTableRowView* pOwner ,sal_uInt16 nCommentID); virtual ~OTableDesignUndoAct(); }; @@ -63,7 +63,7 @@ namespace dbaui public: TYPEINFO(); - OTableEditorUndoAct( OTableEditorCtrl* pOwner,USHORT nCommentID ); + OTableEditorUndoAct( OTableEditorCtrl* pOwner,sal_uInt16 nCommentID ); virtual ~OTableEditorUndoAct(); }; @@ -72,7 +72,7 @@ namespace dbaui class OTableDesignCellUndoAct : public OTableDesignUndoAct { protected: - USHORT m_nCol; + sal_uInt16 m_nCol; long m_nRow; ::com::sun::star::uno::Any m_sOldText; ::com::sun::star::uno::Any m_sNewText; @@ -81,7 +81,7 @@ namespace dbaui virtual void Redo(); public: TYPEINFO(); - OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, USHORT nColumn ); + OTableDesignCellUndoAct( OTableRowView* pOwner, long nRowID, sal_uInt16 nColumn ); virtual ~OTableDesignCellUndoAct(); }; @@ -90,7 +90,7 @@ namespace dbaui class OTableEditorTypeSelUndoAct : public OTableEditorUndoAct { protected: - USHORT m_nCol; + sal_uInt16 m_nCol; long m_nRow; TOTypeInfoSP m_pOldType; TOTypeInfoSP m_pNewType; @@ -99,7 +99,7 @@ namespace dbaui virtual void Redo(); public: TYPEINFO(); - OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, USHORT nColumn, const TOTypeInfoSP& _pOldType ); + OTableEditorTypeSelUndoAct( OTableEditorCtrl* pOwner, long nRowID, sal_uInt16 nColumn, const TOTypeInfoSP& _pOldType ); virtual ~OTableEditorTypeSelUndoAct(); }; @@ -155,7 +155,7 @@ namespace dbaui protected: MultiSelection m_aDelKeys, m_aInsKeys; - BOOL m_bActPrimKeySet; + sal_Bool m_bActPrimKeySet; OTableEditorCtrl* m_pEditorCtrl; virtual void Undo(); diff --git a/dbaccess/source/ui/tabledesign/table.src b/dbaccess/source/ui/tabledesign/table.src index 0a9c5f4e46e5..8ae961bcbb80 100644 --- a/dbaccess/source/ui/tabledesign/table.src +++ b/dbaccess/source/ui/tabledesign/table.src @@ -190,7 +190,7 @@ Menu RID_TABLEDESIGNROWPOPUPMENU MenuItem { Identifier = SID_TABLEDESIGN_INSERTROWS ; - HelpID = SID_TABLEDESIGN_INSERTROWS ; + HelpID = HID_TABLEDESIGN_INSERTROWS ; Text [ en-US ] = "Insert Rows" ; }; MenuItem @@ -200,7 +200,7 @@ Menu RID_TABLEDESIGNROWPOPUPMENU MenuItem { Identifier = SID_TABLEDESIGN_TABED_PRIMARYKEY ; - HelpID = SID_TABLEDESIGN_TABED_PRIMARYKEY ; + HelpID = HID_TABLEDESIGN_TABED_PRIMARYKEY ; Checkable = TRUE ; Text [ en-US ] = "Primary Key" ; }; diff --git a/dbaccess/source/ui/uno/ColumnControl.cxx b/dbaccess/source/ui/uno/ColumnControl.cxx index c98e3ffa6d21..beac49e1513f 100644 --- a/dbaccess/source/ui/uno/ColumnControl.cxx +++ b/dbaccess/source/ui/uno/ColumnControl.cxx @@ -50,7 +50,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::sdbc; OColumnControl::OColumnControl(const Reference<XMultiServiceFactory>& _rxFactory) -: m_xORB(_rxFactory) + :UnoControl( _rxFactory ) { } // ----------------------------------------------------------------------------- @@ -76,7 +76,7 @@ void SAL_CALL OColumnControl::createPeer(const Reference< XToolkit >& /*rToolkit pParentWin = pParent->GetWindow(); } - OColumnPeer* pPeer = new OColumnPeer(pParentWin,m_xORB); + OColumnPeer* pPeer = new OColumnPeer( pParentWin, maContext.getLegacyServiceFactory() ); OSL_ENSURE(pPeer != NULL, "FmXGridControl::createPeer : imp_CreatePeer didn't return a peer !"); setPeer( pPeer ); diff --git a/dbaccess/source/ui/uno/ColumnControl.hxx b/dbaccess/source/ui/uno/ColumnControl.hxx index 08ef5e8f5fe5..7971357106d3 100644 --- a/dbaccess/source/ui/uno/ColumnControl.hxx +++ b/dbaccess/source/ui/uno/ColumnControl.hxx @@ -35,7 +35,6 @@ namespace dbaui { class OColumnControl : public UnoControl { - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xORB; public: OColumnControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index e3e86ae44b1b..3fb4b032e3bc 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -1179,8 +1179,15 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aSourceColTypes.reserve( nCount + 1 ); aSourceColTypes.push_back( -1 ); // just to avoid a everytime i-1 call + ::std::vector< sal_Int32 > aSourcePrec; + aSourcePrec.reserve( nCount + 1 ); + aSourcePrec.push_back( -1 ); // just to avoid a everytime i-1 call + for ( sal_Int32 k=1; k <= nCount; ++k ) + { aSourceColTypes.push_back( xMeta->getColumnType( k ) ); + aSourcePrec.push_back( xMeta->getPrecision( k ) ); + } // now create, fill and execute the prepared statement Reference< XPreparedStatement > xStatement( ODatabaseExport::createPreparedStatment( xDestMetaData, _rxDestTable, aColumnMapping ), UNO_SET_THROW ); @@ -1292,7 +1299,6 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou case DataType::LONGVARBINARY: case DataType::BINARY: case DataType::VARBINARY: - case DataType::BIT: aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); break; @@ -1308,6 +1314,13 @@ void CopyTableWizard::impl_copyRows_throw( const Reference< XResultSet >& _rxSou aTransfer.transferComplexValue( &XRow::getTimestamp, &XParameters::setTimestamp ); break; + case DataType::BIT: + if ( aSourcePrec[nSourceColumn] > 1 ) + { + aTransfer.transferComplexValue( &XRow::getBytes, &XParameters::setBytes ); + break; + } + // run through case DataType::BOOLEAN: aTransfer.transferValue( &XRow::getBoolean, &XParameters::setBoolean ); break; |