diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-01-18 00:18:52 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-01-18 00:37:49 +0100 |
commit | 602c87b4259d118e5db6d8a990c4695103f916dd (patch) | |
tree | 1cbc6cf8309b680476f5116cd5320f8f6a99c32a /sfx2 | |
parent | 849482c0ea88c4aa70ec56adfefe7e59b6060950 (diff) |
Window::PreNotify should return bool
Change-Id: Ic9903fd887f2c3fab2630ebeb20df39392177c8d
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/newhelp.cxx | 34 | ||||
-rw-r--r-- | sfx2/source/appl/newhelp.hxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/thumbnailviewitem.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/frame2.cxx | 8 |
4 files changed, 30 insertions, 30 deletions
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index f0314e536652..a1eed29606a5 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -907,7 +907,7 @@ void IndexTabPage_Impl::OpenKeyword() // class SearchBox_Impl -------------------------------------------------- -long SearchBox_Impl::PreNotify( NotifyEvent& rNEvt ) +bool SearchBox_Impl::PreNotify( NotifyEvent& rNEvt ) { sal_Bool bHandled = sal_False; if ( !IsInDropDown() && @@ -918,7 +918,7 @@ long SearchBox_Impl::PreNotify( NotifyEvent& rNEvt ) aSearchLink.Call( NULL ); bHandled = sal_True; } - return bHandled ? 1 : ComboBox::PreNotify( rNEvt ); + return bHandled || ComboBox::PreNotify( rNEvt ); } // ----------------------------------------------------------------------- @@ -1764,9 +1764,9 @@ void SfxHelpIndexWindow_Impl::Resize() // ----------------------------------------------------------------------- -long SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) +bool SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { - long nDone = 0; + bool nDone = false; sal_uInt16 nType = rNEvt.GetType(); if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() ) { @@ -1784,12 +1784,12 @@ long SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( !bCtrl && bShift && aActiveLB.HasChildPathFocus() ) { pControl->GrabFocus(); - nDone = 1; + nDone = true; } else if ( !bCtrl && !bShift && pControl->HasChildPathFocus() ) { aActiveLB.GrabFocus(); - nDone = 1; + nDone = true; } else if ( bCtrl ) { @@ -1800,7 +1800,7 @@ long SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) nPageId = HELP_INDEX_PAGE_FIRST; aTabCtrl.SetCurPageId( (sal_uInt16)nPageId ); ActivatePageHdl( &aTabCtrl ); - nDone = 1; + nDone = true; } } else if ( aTabCtrl.HasFocus() && ( KEY_LEFT == nCode || KEY_RIGHT == nCode ) ) @@ -1809,7 +1809,7 @@ long SfxHelpIndexWindow_Impl::PreNotify( NotifyEvent& rNEvt ) } } - return nDone ? nDone : Window::PreNotify( rNEvt ); + return nDone || Window::PreNotify( rNEvt ); } // ----------------------------------------------------------------------- @@ -2498,9 +2498,9 @@ void SfxHelpTextWindow_Impl::Resize() // ----------------------------------------------------------------------- -long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) +bool SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { - long nDone = 0; + bool nDone = false; sal_uInt16 nType = rNEvt.GetType(); if ( EVENT_COMMAND == nType && rNEvt.GetCommandEvent() ) { @@ -2592,7 +2592,7 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) sal_uInt16 nId = aMenu.Execute( this, aPos ); pHelpWin->DoAction( nId ); - nDone = 1; + nDone = true; } } else if ( EVENT_KEYINPUT == nType && rNEvt.GetKeyEvent() ) @@ -2604,22 +2604,22 @@ long SfxHelpTextWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( KEYGROUP_ALPHA == nKeyGroup && !isHandledKey( rKeyCode ) ) { // do nothing disables the writer accelerators - nDone = 1; + nDone = true; } else if ( rKeyCode.IsMod1() && ( KEY_F4 == nKey || KEY_W == nKey ) ) { // <CTRL><F4> or <CTRL><W> -> close top frame pHelpWin->CloseWindow(); - nDone = 1; + nDone = true; } else if ( KEY_TAB == nKey && aOnStartupCB.HasChildPathFocus() ) { aToolBox.GrabFocus(); - nDone = 1; + nDone = true; } } - return nDone ? nDone : Window::PreNotify( rNEvt ); + return nDone || Window::PreNotify( rNEvt ); } // ----------------------------------------------------------------------- @@ -3188,7 +3188,7 @@ SfxHelpWindow_Impl::~SfxHelpWindow_Impl() // ----------------------------------------------------------------------- -long SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt ) +bool SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { sal_Bool bHandled = sal_False; if ( rNEvt.GetType() == EVENT_KEYINPUT ) @@ -3209,7 +3209,7 @@ long SfxHelpWindow_Impl::PreNotify( NotifyEvent& rNEvt ) bHandled = sal_True; } } - return bHandled ? 1 : Window::PreNotify( rNEvt ); + return bHandled || Window::PreNotify( rNEvt ); } // ----------------------------------------------------------------------- diff --git a/sfx2/source/appl/newhelp.hxx b/sfx2/source/appl/newhelp.hxx index 3a5226afa041..69f92bb06d12 100644 --- a/sfx2/source/appl/newhelp.hxx +++ b/sfx2/source/appl/newhelp.hxx @@ -196,7 +196,7 @@ public: SearchBox_Impl( Window* pParent, const ResId& rResId ) : ComboBox( pParent, rResId ) { SetDropDownLineCount( 5 ); } - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); virtual void Select(); inline void SetSearchLink( const Link& rLink ) { aSearchLink = rLink; } @@ -340,7 +340,7 @@ public: ~SfxHelpIndexWindow_Impl(); virtual void Resize(); - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); virtual void DataChanged( const DataChangedEvent& rDCEvt ); void SetDoubleClickHdl( const Link& rLink ); @@ -478,7 +478,7 @@ public: ~SfxHelpTextWindow_Impl(); virtual void Resize(); - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); virtual void GetFocus(); virtual void DataChanged( const DataChangedEvent& rDCEvt ); @@ -546,7 +546,7 @@ public: Window* pParent, WinBits nBits ); ~SfxHelpWindow_Impl(); - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); void setContainerWindow( ::com::sun::star::uno::Reference < ::com::sun::star::awt::XWindow > xWin ); diff --git a/sfx2/source/control/thumbnailviewitem.cxx b/sfx2/source/control/thumbnailviewitem.cxx index 5ca236ee3ab5..2ed6c5d6b045 100644 --- a/sfx2/source/control/thumbnailviewitem.cxx +++ b/sfx2/source/control/thumbnailviewitem.cxx @@ -57,7 +57,7 @@ class ResizableMultiLineEdit : public VclMultiLineEdit void SetInGrabFocus(bool bInGrabFocus) { mbIsInGrabFocus = bInGrabFocus; } - virtual long PreNotify(NotifyEvent& rNEvt); + virtual bool PreNotify(NotifyEvent& rNEvt); virtual void Modify(); }; @@ -72,9 +72,9 @@ ResizableMultiLineEdit::~ResizableMultiLineEdit () { } -long ResizableMultiLineEdit::PreNotify(NotifyEvent& rNEvt) +bool ResizableMultiLineEdit::PreNotify(NotifyEvent& rNEvt) { - long nDone = 0; + bool nDone = false; if( rNEvt.GetType() == EVENT_KEYINPUT ) { const KeyEvent& rKEvt = *rNEvt.GetKeyEvent(); @@ -85,7 +85,7 @@ long ResizableMultiLineEdit::PreNotify(NotifyEvent& rNEvt) mpItem->setTitle( GetText() ); case KEY_ESCAPE: mpItem->setEditTitle(false); - nDone = 1; + nDone = true; break; default: break; @@ -96,7 +96,7 @@ long ResizableMultiLineEdit::PreNotify(NotifyEvent& rNEvt) mpItem->setTitle( GetText() ); mpItem->setEditTitle(false, false); } - return nDone ? nDone : VclMultiLineEdit::PreNotify(rNEvt); + return nDone || VclMultiLineEdit::PreNotify(rNEvt); } void ResizableMultiLineEdit::Modify() diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index bfca6b754a1e..fe8163d642d6 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -72,7 +72,7 @@ public: virtual void DataChanged( const DataChangedEvent& rDCEvt ); virtual void StateChanged( StateChangedType nStateChange ); - virtual long PreNotify( NotifyEvent& rNEvt ); + virtual bool PreNotify( NotifyEvent& rNEvt ); virtual bool Notify( NotifyEvent& rEvt ); virtual void Resize(); virtual void GetFocus(); @@ -138,7 +138,7 @@ bool SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt ) return Window::Notify( rNEvt ); } -long SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt ) +bool SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt ) { sal_uInt16 nType = rNEvt.GetType(); if ( nType == EVENT_KEYINPUT || nType == EVENT_KEYUP ) @@ -146,7 +146,7 @@ long SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt ) SfxViewFrame* pView = pFrame->GetCurrentViewFrame(); SfxViewShell* pShell = pView ? pView->GetViewShell() : NULL; if ( pShell && pShell->HasKeyListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) ) - return sal_True; + return true; } else if ( nType == EVENT_MOUSEBUTTONUP || nType == EVENT_MOUSEBUTTONDOWN ) { @@ -156,7 +156,7 @@ long SfxFrameWindow_Impl::PreNotify( NotifyEvent& rNEvt ) if ( pShell ) if ( pWindow == pShell->GetWindow() || pShell->GetWindow()->IsChild( pWindow ) ) if ( pShell->HasMouseClickListeners_Impl() && pShell->HandleNotifyEvent_Impl( rNEvt ) ) - return sal_True; + return true; } if ( nType == EVENT_MOUSEBUTTONDOWN ) |