From a52f29216d2a70ea4a0a0347d71273cdbf8830e3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 10 Nov 2014 13:34:35 +0200 Subject: fdo#84938: replace HELPMODE_ constants with enum Change-Id: I44be5567e84cdabd8b10771ea37e28b8a88cc23e Reviewed-on: https://gerrit.libreoffice.org/12333 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- svtools/source/contnr/imivctl1.cxx | 2 +- svtools/source/contnr/svimpbox.cxx | 2 +- svtools/source/control/calendar.cxx | 4 ++-- svtools/source/control/headbar.cxx | 8 ++++---- svtools/source/control/tabbar.cxx | 8 ++++---- svtools/source/control/valueset.cxx | 2 +- svtools/source/table/tabledatawindow.cxx | 6 +++--- svtools/source/toolpanel/paneltabbar.cxx | 2 +- 8 files changed, 17 insertions(+), 17 deletions(-) (limited to 'svtools') diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index bee601135c16..cbcfb74d4924 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -3628,7 +3628,7 @@ sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) { - if ( !(rHEvt.GetMode() & HELPMODE_QUICK ) ) + if ( !(rHEvt.GetMode() & HelpEventMode::QUICK ) ) return false; Point aPos( pView->ScreenToOutputPixel(rHEvt.GetMousePosPixel() ) ); diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index aed04d3751ab..3a16820e7579 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -3181,7 +3181,7 @@ IMPL_LINK_NOARG(SvImpLBox, EditTimerCall) bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) { - if( rHEvt.GetMode() & HELPMODE_QUICK ) + if( rHEvt.GetMode() & HelpEventMode::QUICK ) { Point aPos( pView->ScreenToOutputPixel( rHEvt.GetMousePosPixel() )); if( !GetVisibleArea().IsInside( aPos )) diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx index acb7b0299ed7..3a27921ea1d7 100644 --- a/svtools/source/control/calendar.cxx +++ b/svtools/source/control/calendar.cxx @@ -1661,7 +1661,7 @@ void Calendar::Resize() void Calendar::RequestHelp( const HelpEvent& rHEvt ) { - if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) + if ( rHEvt.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON) ) { Date aDate = maCurDate; if ( GetDate( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), aDate ) ) @@ -1674,7 +1674,7 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt ) aDateRect.Right() = aPt.X(); aDateRect.Bottom() = aPt.Y(); - if ( rHEvt.GetMode() & HELPMODE_QUICK ) + if ( rHEvt.GetMode() & HelpEventMode::QUICK ) { maCalendarWrapper.setGregorianDateTime( aDate); sal_uInt16 nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR); diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx index 490ad89bcbf0..c26beda45b00 100644 --- a/svtools/source/control/headbar.cxx +++ b/svtools/source/control/headbar.cxx @@ -1112,7 +1112,7 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { - if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) + if ( rHEvt.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON) ) { Rectangle aItemRect = GetItemRect( nItemId ); Point aPt = OutputToScreenPixel( aItemRect.TopLeft() ); @@ -1123,7 +1123,7 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) aItemRect.Bottom() = aPt.Y(); OUString aStr = GetHelpText( nItemId ); - if ( aStr.isEmpty() || !(rHEvt.GetMode() & HELPMODE_BALLOON) ) + if ( aStr.isEmpty() || !(rHEvt.GetMode() & HelpEventMode::BALLOON) ) { ImplHeadItem* pItem = (*mpItemList)[ GetItemPos( nItemId ) ]; // Quick-help is only displayed if the text is not fully visible. @@ -1136,14 +1136,14 @@ void HeaderBar::RequestHelp( const HelpEvent& rHEvt ) if (!aStr.isEmpty()) { - if ( rHEvt.GetMode() & HELPMODE_BALLOON ) + if ( rHEvt.GetMode() & HelpEventMode::BALLOON ) Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr ); else Help::ShowQuickHelp( this, aItemRect, aStr ); return; } } - else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) + else if ( rHEvt.GetMode() & HelpEventMode::EXTENDED ) { OUString aHelpId( OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); if ( !aHelpId.isEmpty() ) diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 10fb75782778..3c6b7f7c716f 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -1491,7 +1491,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) sal_uInt16 nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { - if ( rHEvt.GetMode() & HELPMODE_BALLOON ) + if ( rHEvt.GetMode() & HelpEventMode::BALLOON ) { OUString aStr = GetHelpText( nItemId ); if (!aStr.isEmpty()) @@ -1507,7 +1507,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) return; } } - else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) + else if ( rHEvt.GetMode() & HelpEventMode::EXTENDED ) { OUString aHelpId( OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); if ( !aHelpId.isEmpty() ) @@ -1522,7 +1522,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) // show text for quick- or balloon-help // if this is isolated or not fully visible - if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) + if ( rHEvt.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON) ) { sal_uInt16 nPos = GetPagePos( nItemId ); ImplTabBarItem* pItem = (*mpItemList)[ nPos ]; @@ -1538,7 +1538,7 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt ) OUString aStr = (*mpItemList)[ nPos ]->maText; if (!aStr.isEmpty()) { - if ( rHEvt.GetMode() & HELPMODE_BALLOON ) + if ( rHEvt.GetMode() & HelpEventMode::BALLOON ) Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr ); else Help::ShowQuickHelp( this, aItemRect, aStr ); diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx index f0d6457c0f1a..10552e540a46 100644 --- a/svtools/source/control/valueset.cxx +++ b/svtools/source/control/valueset.cxx @@ -1461,7 +1461,7 @@ void ValueSet::Resize() void ValueSet::RequestHelp( const HelpEvent& rHelpEvent ) { - if ( (rHelpEvent.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON)) == HELPMODE_QUICK ) + if ( (rHelpEvent.GetMode() & (HelpEventMode::QUICK | HelpEventMode::BALLOON)) == HelpEventMode::QUICK ) { Point aPos = ScreenToOutputPixel( rHelpEvent.GetMousePosPixel() ); size_t nItemPos = ImplGetItem( aPos ); diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 5bb9fb1fe2b2..80a0557b1335 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -79,9 +79,9 @@ namespace svt { namespace table void TableDataWindow::RequestHelp( const HelpEvent& rHEvt ) { - sal_uInt16 const nHelpMode = rHEvt.GetMode(); - if ( ( IsMouseCaptured() ) - || ( ( nHelpMode & HELPMODE_QUICK ) == 0 ) + HelpEventMode const nHelpMode = rHEvt.GetMode(); + if ( IsMouseCaptured() + || !( nHelpMode & HelpEventMode::QUICK ) ) { Window::RequestHelp( rHEvt ); diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx index 3dc375124bb6..302d58e4c22b 100644 --- a/svtools/source/toolpanel/paneltabbar.cxx +++ b/svtools/source/toolpanel/paneltabbar.cxx @@ -1176,7 +1176,7 @@ namespace svt return; const OUString sItemText( rItem.pPanel->GetDisplayName() ); - if ( i_rHelpEvent.GetMode() == HELPMODE_BALLOON ) + if ( i_rHelpEvent.GetMode() == HelpEventMode::BALLOON ) Help::ShowBalloon( this, OutputToScreenPixel( rItem.GetCurrentRect().Center() ), rItem.GetCurrentRect(), sItemText ); else Help::ShowQuickHelp( this, rItem.GetCurrentRect(), sItemText ); -- cgit