From 602c87b4259d118e5db6d8a990c4695103f916dd Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 18 Jan 2014 00:18:52 +0100 Subject: Window::PreNotify should return bool Change-Id: Ic9903fd887f2c3fab2630ebeb20df39392177c8d --- extensions/source/bibliography/bibcont.cxx | 8 ++++---- extensions/source/bibliography/bibcont.hxx | 2 +- extensions/source/bibliography/toolbar.cxx | 4 ++-- extensions/source/bibliography/toolbar.hxx | 2 +- extensions/source/propctrlr/browserlistbox.cxx | 4 ++-- extensions/source/propctrlr/browserlistbox.hxx | 2 +- extensions/source/propctrlr/commoncontrol.hxx | 6 +++--- extensions/source/propctrlr/standardcontrol.cxx | 10 +++++----- extensions/source/propctrlr/standardcontrol.hxx | 6 +++--- extensions/source/propctrlr/usercontrol.cxx | 4 ++-- extensions/source/propctrlr/usercontrol.hxx | 2 +- 11 files changed, 25 insertions(+), 25 deletions(-) (limited to 'extensions') diff --git a/extensions/source/bibliography/bibcont.cxx b/extensions/source/bibliography/bibcont.cxx index 123c146d51e0..21be478b5d48 100644 --- a/extensions/source/bibliography/bibcont.cxx +++ b/extensions/source/bibliography/bibcont.cxx @@ -210,9 +210,9 @@ void BibBookContainer::GetFocus() pBottomWin->GrabFocus(); } -long BibBookContainer::PreNotify( NotifyEvent& rNEvt ) +bool BibBookContainer::PreNotify( NotifyEvent& rNEvt ) { - long nHandled = 0; + bool nHandled = false; if( EVENT_KEYINPUT == rNEvt.GetType() ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); @@ -235,10 +235,10 @@ long BibBookContainer::PreNotify( NotifyEvent& rNEvt ) SetItemSize( nFirstWinId, nHeight ); SetItemSize( nSecondWinId, 100 - nHeight ); } - nHandled = 1; + nHandled = true; } else if( pKEvt->GetCharCode() && HandleShortCutKey( *pKEvt ) ) - nHandled = 1; + nHandled = true; } } diff --git a/extensions/source/bibliography/bibcont.hxx b/extensions/source/bibliography/bibcont.hxx index cb5bbee09bb1..f63fef02d5ab 100644 --- a/extensions/source/bibliography/bibcont.hxx +++ b/extensions/source/bibliography/bibcont.hxx @@ -79,7 +79,7 @@ class BibBookContainer: public BibSplitWindow virtual void Split(); - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); public: diff --git a/extensions/source/bibliography/toolbar.cxx b/extensions/source/bibliography/toolbar.cxx index 9b5139c72ee0..06cf39225a97 100644 --- a/extensions/source/bibliography/toolbar.cxx +++ b/extensions/source/bibliography/toolbar.cxx @@ -428,9 +428,9 @@ void BibToolBar::SetQueryString(const OUString& aStr) } -long BibToolBar::PreNotify( NotifyEvent& rNEvt ) +bool BibToolBar::PreNotify( NotifyEvent& rNEvt ) { - long nResult=sal_True; + bool nResult = true; sal_uInt16 nSwitch=rNEvt.GetType(); if(aEdQuery.HasFocus() && nSwitch==EVENT_KEYINPUT) diff --git a/extensions/source/bibliography/toolbar.hxx b/extensions/source/bibliography/toolbar.hxx index 58229c7c6084..c80b68953b32 100644 --- a/extensions/source/bibliography/toolbar.hxx +++ b/extensions/source/bibliography/toolbar.hxx @@ -143,7 +143,7 @@ class BibToolBar: public ToolBox void InitListener(); virtual void Select(); virtual void Click(); - long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); public: diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 1333185d9843..ac52c6aee332 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -1207,7 +1207,7 @@ namespace pcr } //------------------------------------------------------------------ - long OBrowserListBox::PreNotify( NotifyEvent& _rNEvt ) + bool OBrowserListBox::PreNotify( NotifyEvent& _rNEvt ) { switch ( _rNEvt.GetType() ) { @@ -1255,7 +1255,7 @@ namespace pcr } } - return 1L; + return true; // handled this. In particular, we also consume PageUp/Down events if we do not use them for scrolling, // otherwise they would be used to scroll the document view, which does not sound like it is desired by // the user. diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index 2001034dbec2..6b1da47ba8a9 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -134,7 +134,7 @@ namespace pcr void EnableUpdate(); void DisableUpdate(); bool Notify( NotifyEvent& _rNEvt ); - long PreNotify( NotifyEvent& _rNEvt ); + virtual bool PreNotify( NotifyEvent& _rNEvt ); void SetListener( IPropertyLineListener* _pListener ); void SetObserver( IPropertyControlObserver* _pObserver ); diff --git a/extensions/source/propctrlr/commoncontrol.hxx b/extensions/source/propctrlr/commoncontrol.hxx index f8aaa357c0cf..fe1405a604ec 100644 --- a/extensions/source/propctrlr/commoncontrol.hxx +++ b/extensions/source/propctrlr/commoncontrol.hxx @@ -58,7 +58,7 @@ namespace pcr protected: // Window overridables - inline virtual long PreNotify( NotifyEvent& rNEvt ); + inline virtual bool PreNotify( NotifyEvent& rNEvt ); }; //======================================================================== @@ -231,10 +231,10 @@ namespace pcr //------------------------------------------------------------------------ template< class WINDOW > - inline long ControlWindow< WINDOW >::PreNotify( NotifyEvent& rNEvt ) + inline bool ControlWindow< WINDOW >::PreNotify( NotifyEvent& rNEvt ) { if ( m_pHelper && m_pHelper->handlePreNotify( rNEvt ) ) - return 1; + return true; return WindowType::PreNotify( rNEvt ); } diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx index ced964c690e0..fe471ac93573 100644 --- a/extensions/source/propctrlr/standardcontrol.cxx +++ b/extensions/source/propctrlr/standardcontrol.cxx @@ -971,7 +971,7 @@ namespace pcr MultiLineEdit* getEdit() { return &m_aImplEdit; } protected: - virtual long PreNotify(NotifyEvent& _rNEvt); + virtual bool PreNotify(NotifyEvent& _rNEvt); }; //------------------------------------------------------------------ @@ -989,9 +989,9 @@ namespace pcr } //------------------------------------------------------------------ - long OMultilineFloatingEdit::PreNotify(NotifyEvent& _rNEvt) + bool OMultilineFloatingEdit::PreNotify(NotifyEvent& _rNEvt) { - long nResult = sal_True; + bool nResult = true; sal_uInt16 nSwitch = _rNEvt.GetType(); if (EVENT_KEYINPUT == nSwitch) @@ -1095,9 +1095,9 @@ namespace pcr } //------------------------------------------------------------------ - long DropDownEditControl::PreNotify( NotifyEvent& rNEvt ) + bool DropDownEditControl::PreNotify( NotifyEvent& rNEvt ) { - long nResult = 1; + bool nResult = true; if (rNEvt.GetType() == EVENT_KEYINPUT) { diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index b7cd14efb3c7..5d8f62718565 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -66,12 +66,12 @@ namespace pcr void SetModifyHdl( const Link& _rLink ) { ListBoxType::SetSelectHdl( _rLink ); } protected: - long PreNotify( NotifyEvent& _rNEvt ); + bool PreNotify( NotifyEvent& _rNEvt ); }; //------------------------------------------------------------------------ template< class LISTBOX_WINDOW > - long ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::PreNotify( NotifyEvent& _rNEvt ) + bool ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::PreNotify( NotifyEvent& _rNEvt ) { if ( _rNEvt.GetType() == EVENT_KEYINPUT ) { @@ -399,7 +399,7 @@ namespace pcr protected: // Window overridables - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); virtual void Resize(); protected: diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index 9433c6d0f559..833dd60df576 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -45,7 +45,7 @@ namespace pcr // NumberFormatSampleField //================================================================== //------------------------------------------------------------------ - long NumberFormatSampleField::PreNotify( NotifyEvent& rNEvt ) + bool NumberFormatSampleField::PreNotify( NotifyEvent& rNEvt ) { // want to handle two keys myself : Del/Backspace should empty the window (setting my prop to "standard" this way) if (EVENT_KEYINPUT == rNEvt.GetType()) @@ -57,7 +57,7 @@ namespace pcr SetText( "" ); if ( m_pHelper ) m_pHelper->ModifiedHdl( this ); - return 1; + return true; } } diff --git a/extensions/source/propctrlr/usercontrol.hxx b/extensions/source/propctrlr/usercontrol.hxx index c860b772398c..e87071134a44 100644 --- a/extensions/source/propctrlr/usercontrol.hxx +++ b/extensions/source/propctrlr/usercontrol.hxx @@ -49,7 +49,7 @@ namespace pcr void SetFormatSupplier( const SvNumberFormatsSupplierObj* pSupplier ); protected: - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); }; //======================================================================== -- cgit