diff options
author | Noel Grandin <noel@peralex.com> | 2015-05-14 10:39:01 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-05-14 12:00:40 +0200 |
commit | 741d9990bf9d9dfcba1166a12ffb1d846c912181 (patch) | |
tree | da1b7e64be04904ce98ab143b47022125e14041d | |
parent | f30ce25c3c5954eb90e126dd4904eee5454f044c (diff) |
convert QUICKHELP constants to scoped enum
Change-Id: Ie7302c909feb2e83b8b5e62a5e6a1f901783fb49
33 files changed, 114 insertions, 104 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 55d67ac0185b..098c8d3bb1ed 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -382,7 +382,7 @@ void EditorWindow::RequestHelp( const HelpEvent& rHEvt ) } } } - Help::ShowQuickHelp( this, Rectangle( aTopLeft, Size( 1, 1 ) ), aHelpText, QUICKHELP_TOP|QUICKHELP_LEFT); + Help::ShowQuickHelp( this, Rectangle( aTopLeft, Size( 1, 1 ) ), aHelpText, QuickHelpFlags::Top|QuickHelpFlags::Left); bDone = true; } } diff --git a/dbaccess/source/ui/control/dbtreelistbox.cxx b/dbaccess/source/ui/control/dbtreelistbox.cxx index 2780a9c024c4..13a5565a55b6 100644 --- a/dbaccess/source/ui/control/dbtreelistbox.cxx +++ b/dbaccess/source/ui/control/dbtreelistbox.cxx @@ -302,7 +302,7 @@ void DBTreeListBox::RequestHelp( const HelpEvent& rHEvt ) Rectangle aScreenRect( OutputToScreenPixel( GetEntryPosition( pEntry ) ), aSize ); Help::ShowQuickHelp( this, aScreenRect, - sQuickHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER ); + sQuickHelpText, QuickHelpFlags::Left | QuickHelpFlags::VCenter ); return; } } diff --git a/dbaccess/source/ui/control/opendoccontrols.cxx b/dbaccess/source/ui/control/opendoccontrols.cxx index 65f1421b279f..7eb8ef00ac22 100644 --- a/dbaccess/source/ui/control/opendoccontrols.cxx +++ b/dbaccess/source/ui/control/opendoccontrols.cxx @@ -297,7 +297,7 @@ namespace dbaui OutputToScreenPixel( aItemRect.TopLeft() ), OutputToScreenPixel( aItemRect.BottomRight() ) ); OUString sHelpText = impl_getDocumentAtIndex( nItemIndex, true ).first; - Help::ShowQuickHelp( this, aItemRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER ); + Help::ShowQuickHelp( this, aItemRect, sHelpText, QuickHelpFlags::Left | QuickHelpFlags::VCenter ); } } diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx index dd631be58fc4..3a356ab28115 100644 --- a/editeng/source/editeng/editeng.cxx +++ b/editeng/source/editeng/editeng.cxx @@ -1342,7 +1342,7 @@ bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditView, v aPos = pEditView->pImpEditView->GetWindow()->LogicToPixel( aPos ); aPos = pEditView->GetWindow()->OutputToScreenPixel( aPos ); aPos.Y() -= 3; - Help::ShowQuickHelp( pEditView->GetWindow(), Rectangle( aPos, Size( 1, 1 ) ), aComplete, QUICKHELP_BOTTOM|QUICKHELP_LEFT ); + Help::ShowQuickHelp( pEditView->GetWindow(), Rectangle( aPos, Size( 1, 1 ) ), aComplete, QuickHelpFlags::Bottom|QuickHelpFlags::Left ); } } } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 934fada3201b..0fb7962a54da 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -2697,7 +2697,7 @@ void ImpEditEngine::SetAutoCompleteText(const OUString& rStr, bool bClearTipWind { aAutoCompleteText = rStr; if ( bClearTipWindow && pActiveView ) - Help::ShowQuickHelp( pActiveView->GetWindow(), Rectangle(), OUString(), 0 ); + Help::ShowQuickHelp( pActiveView->GetWindow(), Rectangle(), OUString() ); } namespace diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx index 42c9e55d540a..40dfcf2e4e0e 100644 --- a/include/vcl/help.hxx +++ b/include/vcl/help.hxx @@ -23,6 +23,7 @@ #include <rtl/ustring.hxx> #include <tools/solar.h> #include <vcl/dllapi.h> +#include <o3tl/typed_flags_set.hxx> class Point; class Rectangle; @@ -31,23 +32,30 @@ namespace vcl { class Window; } // - Help-Types - - -#define QUICKHELP_LEFT ((sal_uInt16)0x0001) -#define QUICKHELP_CENTER ((sal_uInt16)0x0002) -#define QUICKHELP_RIGHT ((sal_uInt16)0x0004) -#define QUICKHELP_TOP ((sal_uInt16)0x0008) -#define QUICKHELP_VCENTER ((sal_uInt16)0x0010) -#define QUICKHELP_BOTTOM ((sal_uInt16)0x0020) -#define QUICKHELP_NOAUTOPOS (QUICKHELP_LEFT | QUICKHELP_CENTER | QUICKHELP_RIGHT | QUICKHELP_TOP | QUICKHELP_VCENTER | QUICKHELP_BOTTOM) -#define QUICKHELP_CTRLTEXT ((sal_uInt16)0x0040) +enum class QuickHelpFlags +{ + NONE = 0x0000, + Left = 0x0001, + Center = 0x0002, + Right = 0x0004, + Top = 0x0008, + VCenter = 0x0010, + Bottom = 0x0020, + NoAutoPos = Left | Center | Right | Top | VCenter | Bottom, + CtrlText = 0x0040, /// force the existent tip window to be re-positioned, even if the previous incarnation has the same text. Applies to ShowBallon and ShowQuickHelp. -#define QUICKHELP_FORCE_REPOSITION ((sal_uInt16)0x0080) + ForceReposition = 0x0080, /// no delay when opening the quick help. Applies to ShowBallon and ShowQuickHelp -#define QUICKHELP_NO_DELAY ((sal_uInt16)0x0100) + NoDelay = 0x0100, /// force balloon-style in ShowTip -#define QUICKHELP_TIP_STYLE_BALLOON ((sal_uInt16)0x0200) -#define QUICKHELP_NOEVADEPOINTER ((sal_uInt16)0x4000) -#define QUICKHELP_BIDI_RTL ((sal_uInt16)0x8000) + TipStyleBalloon = 0x0200, + NoEvadePointer = 0x4000, + BiDiRtl = 0x8000, +}; +namespace o3tl +{ + template<> struct typed_flags<QuickHelpFlags> : is_typed_flags<QuickHelpFlags, 0xc3ff> {}; +} #define OOO_HELP_INDEX ".help:index" @@ -59,50 +67,50 @@ public: Help(); virtual ~Help(); - virtual bool Start( const OUString& rHelpId, const vcl::Window* pWindow ); - virtual bool SearchKeyword( const OUString& rKeyWord ); + virtual bool Start( const OUString& rHelpId, const vcl::Window* pWindow ); + virtual bool SearchKeyword( const OUString& rKeyWord ); virtual OUString GetHelpText( const OUString& aHelpURL, const vcl::Window* pWindow ); static void EnableContextHelp(); static void DisableContextHelp(); - static bool IsContextHelpEnabled(); + static bool IsContextHelpEnabled(); static void EnableExtHelp(); static void DisableExtHelp(); - static bool IsExtHelpEnabled(); - static bool StartExtHelp(); - static bool EndExtHelp(); + static bool IsExtHelpEnabled(); + static bool StartExtHelp(); + static bool EndExtHelp(); static void EnableBalloonHelp(); static void DisableBalloonHelp(); - static bool IsBalloonHelpEnabled(); - static bool ShowBalloon( vcl::Window* pParent, + static bool IsBalloonHelpEnabled(); + static bool ShowBalloon( vcl::Window* pParent, const Point& rScreenPos, const OUString& rHelpText ); - static bool ShowBalloon( vcl::Window* pParent, + static bool ShowBalloon( vcl::Window* pParent, const Point& rScreenPos, const Rectangle&, const OUString& rHelpText ); static void EnableQuickHelp(); static void DisableQuickHelp(); - static bool IsQuickHelpEnabled(); - static bool ShowQuickHelp( vcl::Window* pParent, + static bool IsQuickHelpEnabled(); + static bool ShowQuickHelp( vcl::Window* pParent, const Rectangle& rScreenRect, const OUString& rHelpText, const OUString& rLongHelpText, - sal_uInt16 nStyle = 0 ); - static bool ShowQuickHelp( vcl::Window* pParent, + QuickHelpFlags nStyle = QuickHelpFlags::NONE ); + static bool ShowQuickHelp( vcl::Window* pParent, const Rectangle& rScreenRect, const OUString& rHelpText, - sal_uInt16 nStyle = 0 ) + QuickHelpFlags nStyle = QuickHelpFlags::NONE ) { return Help::ShowQuickHelp( pParent, rScreenRect, rHelpText, OUString(), nStyle ); } static void HideBalloonAndQuickHelp(); static sal_uLong ShowTip( vcl::Window* pParent, const Rectangle& rScreenRect, - const OUString& rText, sal_uInt16 nStyle = 0 ); + const OUString& rText, QuickHelpFlags nStyle = QuickHelpFlags::NONE ); static void UpdateTip( sal_uLong nId, vcl::Window* pParent, const Rectangle& rScreenRect, diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index d15a66153f6a..2b6be65a197a 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1006,7 +1006,7 @@ void ScInputHandler::ShowTip( const OUString& rText ) aPos = pTipVisibleParent->OutputToScreenPixel( aPos ); Rectangle aRect( aPos, aPos ); - sal_uInt16 nAlign = QUICKHELP_LEFT|QUICKHELP_BOTTOM; + QuickHelpFlags nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom; nTipVisible = Help::ShowTip(pTipVisibleParent, aRect, rText, nAlign); pTipVisibleParent->AddEventListener( LINK( this, ScInputHandler, ShowHideTipVisibleParentListener ) ); } @@ -1030,7 +1030,7 @@ void ScInputHandler::ShowTipBelow( const OUString& rText ) } aPos = pTipVisibleSecParent->OutputToScreenPixel( aPos ); Rectangle aRect( aPos, aPos ); - sal_uInt16 nAlign = QUICKHELP_LEFT | QUICKHELP_TOP | QUICKHELP_NOEVADEPOINTER; + QuickHelpFlags nAlign = QuickHelpFlags::Left | QuickHelpFlags::Top | QuickHelpFlags::NoEvadePointer; nTipVisibleSec = Help::ShowTip(pTipVisibleSecParent, aRect, rText, nAlign); pTipVisibleSecParent->AddEventListener( LINK( this, ScInputHandler, ShowHideTipVisibleSecParentListener ) ); } diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 8b84cc632116..a9cd2b60be21 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2365,7 +2365,7 @@ void ScPosWnd::Modify() Rectangle aRect( aPos, aPos ); OUString aText = ScGlobal::GetRscString( nStrId ); - sal_uInt16 nAlign = QUICKHELP_LEFT|QUICKHELP_BOTTOM; + QuickHelpFlags nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom; nTipVisible = Help::ShowTip(pWin, aRect, aText, nAlign); } } diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 15407ea88133..fe37b96044fa 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -900,20 +900,20 @@ void ScHeaderControl::ShowDragHelp() Point aMousePos = OutputToScreenPixel(GetPointerPosPixel()); Rectangle aRect; - sal_uInt16 nAlign; + QuickHelpFlags nAlign; if (!bVertical) { // above aRect.Left() = aMousePos.X(); aRect.Top() = aPos.Y() - 4; - nAlign = QUICKHELP_BOTTOM|QUICKHELP_CENTER; + nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center; } else { // top right aRect.Left() = aPos.X() + aSize.Width() + 8; aRect.Top() = aMousePos.Y() - 2; - nAlign = QUICKHELP_LEFT|QUICKHELP_BOTTOM; + nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom; } aRect.Right() = aRect.Left(); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 7b72aba9a170..e0e05990006b 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -446,7 +446,7 @@ IMPL_LINK (ScPreviewShell,ScrollHandler, ScrollBar* ,pScroll ) Point aPos = pScroll->GetParent()->OutputToNormalizedScreenPixel( pScroll->GetPosPixel() ); OUString aHelpStr; Rectangle aRect; - sal_uInt16 nAlign; + QuickHelpFlags nAlign; if( nDelta < 0 ) { @@ -474,7 +474,7 @@ IMPL_LINK (ScPreviewShell,ScrollHandler, ScrollBar* ,pScroll ) aRect.Top() = aMousePos.Y(); aRect.Right() = aRect.Left(); aRect.Bottom() = aRect.Top(); - nAlign = QUICKHELP_BOTTOM|QUICKHELP_CENTER; + nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center; Help::ShowQuickHelp( pScroll->GetParent(), aRect, aHelpStr, nAlign ); } } diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 587ff94feca9..75cb5c4be2c8 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1084,7 +1084,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) OUString aHelpStr; Rectangle aRect; - sal_uInt16 nAlign; + QuickHelpFlags nAlign; if (bHoriz) { aHelpStr = ScGlobal::GetRscString(STR_COLUMN) + @@ -1092,7 +1092,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) aRect.Left() = aMousePos.X(); aRect.Top() = aPos.Y() - 4; - nAlign = QUICKHELP_BOTTOM|QUICKHELP_CENTER; + nAlign = QuickHelpFlags::Bottom|QuickHelpFlags::Center; } else { @@ -1102,7 +1102,7 @@ IMPL_LINK( ScTabView, ScrollHdl, ScrollBar*, pScroll ) // show quicktext always inside sheet area aRect.Left() = bLayoutRTL ? (aPos.X() + aSize.Width() + 8) : (aPos.X() - 8); aRect.Top() = aMousePos.Y(); - nAlign = (bLayoutRTL ? QUICKHELP_LEFT : QUICKHELP_RIGHT) | QUICKHELP_VCENTER; + nAlign = (bLayoutRTL ? QuickHelpFlags::Left : QuickHelpFlags::Right) | QuickHelpFlags::VCenter; } aRect.Right() = aRect.Left(); aRect.Bottom() = aRect.Top(); diff --git a/sc/source/ui/view/tabview4.cxx b/sc/source/ui/view/tabview4.cxx index 8d21f9cd66bc..3c47c9bd7f89 100644 --- a/sc/source/ui/view/tabview4.cxx +++ b/sc/source/ui/view/tabview4.cxx @@ -75,8 +75,8 @@ void ScTabView::ShowRefTip() Point aPos( bLeft ? aStart.X() : ( aEnd.X() + 3 ), bTop ? aStart.Y() : ( aEnd.Y() + 3 ) ); - sal_uInt16 nFlags = ( bLeft ? QUICKHELP_RIGHT : QUICKHELP_LEFT ) | - ( bTop ? QUICKHELP_BOTTOM : QUICKHELP_TOP ); + QuickHelpFlags nFlags = ( bLeft ? QuickHelpFlags::Right : QuickHelpFlags::Left ) | + ( bTop ? QuickHelpFlags::Bottom : QuickHelpFlags::Top ); // nicht ueber die editierte Formel if ( !bTop && aViewData.HasEditView( eWhich ) && @@ -84,7 +84,7 @@ void ScTabView::ShowRefTip() { // dann an der oberen Kante der editierten Zelle ausrichten aPos.Y() -= 2; // die 3 von oben - nFlags = ( nFlags & ~QUICKHELP_TOP ) | QUICKHELP_BOTTOM; + nFlags = ( nFlags & ~QuickHelpFlags::Top ) | QuickHelpFlags::Bottom; } Rectangle aRect( pWin->OutputToScreenPixel( aPos ), Size(1,1) ); @@ -275,7 +275,7 @@ void ScTabView::UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB nCurZ ) aPos.Y() += 4; aPos = pWin->OutputToScreenPixel( aPos ); Rectangle aRect( aPos, aPos ); - sal_uInt16 nAlign = QUICKHELP_LEFT|QUICKHELP_TOP; + QuickHelpFlags nAlign = QuickHelpFlags::Left|QuickHelpFlags::Top; Help::ShowQuickHelp(pWin, aRect, aHelpStr, nAlign); } } diff --git a/sc/workben/test.cxx b/sc/workben/test.cxx index 7e6688c01b22..f6b32ad1f5e3 100644 --- a/sc/workben/test.cxx +++ b/sc/workben/test.cxx @@ -170,7 +170,7 @@ void MyFixedText::RequestHelp( const HelpEvent& rHEvt ) Point aShowPoint= OutputToScreenPixel(Point(0,0)); if ( ( rHEvt.GetMode() & HELPMODE_QUICK ) == HELPMODE_QUICK && aTxtSize.Width()>GetSizePixel().Width()) - Help::ShowQuickHelp( Rectangle(aShowPoint,aTxtSize), aTxtStr, QUICKHELP_TOP|QUICKHELP_LEFT ); + Help::ShowQuickHelp( Rectangle(aShowPoint,aTxtSize), aTxtStr, QuickHelpFlags::Top|QuickHelpFlags::Left ); else FixedText::RequestHelp( rHEvt ); } diff --git a/sd/source/ui/slidesorter/view/SlsToolTip.cxx b/sd/source/ui/slidesorter/view/SlsToolTip.cxx index d5c00c8b8177..217888cff123 100644 --- a/sd/source/ui/slidesorter/view/SlsToolTip.cxx +++ b/sd/source/ui/slidesorter/view/SlsToolTip.cxx @@ -138,7 +138,7 @@ void ToolTip::DoShow() pWindow, aBox, msCurrentHelpText, - QUICKHELP_CENTER | QUICKHELP_TOP); + QuickHelpFlags::Center | QuickHelpFlags::Top); } } diff --git a/sd/source/ui/view/viewoverlaymanager.cxx b/sd/source/ui/view/viewoverlaymanager.cxx index f184bb89a177..333d3386142a 100644 --- a/sd/source/ui/view/viewoverlaymanager.cxx +++ b/sd/source/ui/view/viewoverlaymanager.cxx @@ -201,7 +201,7 @@ void ImageButtonHdl::onMouseEnter(const MouseEvent& rMEvt) OUString aHelpText( aResId ); Rectangle aScreenRect( pDev->LogicToPixel( GetPos() ), maImageSize ); - mnTip = Help::ShowTip( static_cast< vcl::Window* >( pHdlList->GetView()->GetFirstOutputDevice() ), aScreenRect, aHelpText, 0 ) ; + mnTip = Help::ShowTip( static_cast< vcl::Window* >( pHdlList->GetView()->GetFirstOutputDevice() ), aScreenRect, aHelpText ) ; } Touch(); } diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index daa9fab40a26..bda4806c4c89 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1339,7 +1339,7 @@ void CustomPropertiesDurationField::RequestHelp( const HelpEvent& rHEvt ) Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), GetText() ); else Help::ShowQuickHelp( this, aItemRect, GetText(), - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); } } diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index d5f610ccca78..0db2da34085e 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -3516,7 +3516,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) sHelpText = sQuickHelpText; else sHelpText = aEntryText; - Help::ShowQuickHelp( (vcl::Window*)pView, aOptTextRect, sHelpText, QUICKHELP_LEFT | QUICKHELP_VCENTER ); + Help::ShowQuickHelp( (vcl::Window*)pView, aOptTextRect, sHelpText, QuickHelpFlags::Left | QuickHelpFlags::VCenter ); } return true; diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index b50efab898e7..9431266717df 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -3210,7 +3210,7 @@ bool SvImpLBox::RequestHelp( const HelpEvent& rHEvt ) aItemRect.Bottom() = aPt.Y(); Help::ShowQuickHelp( pView, aItemRect, - static_cast<SvLBoxString*>(pItem)->GetText(), QUICKHELP_LEFT | QUICKHELP_VCENTER ); + static_cast<SvLBoxString*>(pItem)->GetText(), QuickHelpFlags::Left | QuickHelpFlags::VCenter ); return true; } } diff --git a/svtools/source/table/tabledatawindow.cxx b/svtools/source/table/tabledatawindow.cxx index 51709935ea7d..044f84642a35 100644 --- a/svtools/source/table/tabledatawindow.cxx +++ b/svtools/source/table/tabledatawindow.cxx @@ -74,7 +74,7 @@ namespace svt { namespace table } OUString sHelpText; - sal_uInt16 nHelpStyle = 0; + QuickHelpFlags nHelpStyle = QuickHelpFlags::NONE; Point const aMousePos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); RowPos const hitRow = m_rTableControl.getRowAtPoint( aMousePos ); @@ -112,7 +112,7 @@ namespace svt { namespace table pTableModel->getRenderer()->GetFormattedCellString( aCellToolTip, hitCol, hitRow, sHelpText ); if ( sHelpText.indexOf( '\n' ) >= 0 ) - nHelpStyle = QUICKHELP_TIP_STYLE_BALLOON; + nHelpStyle = QuickHelpFlags::TipStyleBalloon; } } diff --git a/sw/source/ui/fldui/FldRefTreeListBox.cxx b/sw/source/ui/fldui/FldRefTreeListBox.cxx index 03ed69ac663b..00d308eda173 100644 --- a/sw/source/ui/fldui/FldRefTreeListBox.cxx +++ b/sw/source/ui/fldui/FldRefTreeListBox.cxx @@ -62,7 +62,7 @@ void SwFldRefTreeListBox::RequestHelp( const HelpEvent& rHEvt ) aPos = OutputToScreenPixel(aPos); Rectangle aItemRect( aPos, aSize ); Help::ShowQuickHelp( this, aItemRect, sEntry, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); bCallBase = false; } } diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 0204ed3fc33f..9c5a03ffa1bd 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1797,7 +1797,7 @@ void SwIdxTreeListBox::RequestHelp( const HelpEvent& rHEvt ) aPos = OutputToScreenPixel(aPos); Rectangle aItemRect( aPos, aSize ); Help::ShowQuickHelp( this, aItemRect, sEntry, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); } } } @@ -3464,7 +3464,7 @@ bool SwTokenWindow::CreateQuickHelp(Control* pCtrl, } else Help::ShowQuickHelp( this, aItemRect, sEntry, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); bRet = true; } return bRet; diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index b1ec21dce153..7444167bf911 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -434,7 +434,7 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt ) + SwGlossaries::GetExtension(); Help::ShowQuickHelp( this, aItemRect, sMsg, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); } } } diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 388e7e5b6218..d00a14a2aa9e 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -910,7 +910,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt ) else sMsg = *static_cast<OUString*>(pEntry->GetUserData()); Help::ShowQuickHelp( this, aItemRect, sMsg, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); } } } diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index a0475d67056c..38e935e05d70 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5840,7 +5840,7 @@ void QuickHelpData::Start( SwWrtShell& rSh, sal_uInt16 nWrdLen ) aPt.Y() -= 3; nTipId = Help::ShowTip( &rWin, Rectangle( aPt, Size( 1, 1 )), m_aHelpStrings[ nCurArrPos ], - QUICKHELP_LEFT | QUICKHELP_BOTTOM ); + QuickHelpFlags::Left | QuickHelpFlags::Bottom ); } else { diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 67f85700fff7..9151379903b6 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -147,7 +147,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) if( rSh.GetContentAtPos( aPos, aCntntAtPos, false, &aFldRect ) ) { - sal_uInt16 nStyle = 0; // style of quick help + QuickHelpFlags nStyle = QuickHelpFlags::NONE; // style of quick help switch( aCntntAtPos.eCntntAtPos ) { case SwContentAtPos::SW_TABLEBOXFML: @@ -255,7 +255,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) ? STR_ENDNOTE : STR_FTNNOTE ) + sTmp; bBalloon = true; if( aCntntAtPos.IsInRTLText() ) - nStyle |= QUICKHELP_BIDI_RTL; + nStyle |= QuickHelpFlags::BiDiRtl; } break; diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 04d43c4acb68..1e93465e752c 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1425,7 +1425,7 @@ IMPL_LINK( SwPagePreview, ScrollHdl, SwScrollbar *, pScrollbar ) aRect.Bottom() = aRect.Top(); Help::ShowQuickHelp(pScrollbar, aRect, sStateStr, - QUICKHELP_RIGHT|QUICKHELP_VCENTER); + QuickHelpFlags::Right|QuickHelpFlags::VCenter); } else @@ -1444,7 +1444,7 @@ IMPL_LINK( SwPagePreview, EndScrollHdl, SwScrollbar *, pScrollbar ) if( !pScrollbar->IsHoriScroll() ) // scroll vertically { if ( Help::IsQuickHelpEnabled() ) - Help::ShowQuickHelp(pScrollbar, Rectangle(), OUString(), 0); + Help::ShowQuickHelp(pScrollbar, Rectangle(), OUString()); if ( GetViewShell()->PagePreviewLayout()->DoesPreviewLayoutRowsFitIntoWindow() ) { // Scroll how many pages ?? diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 1fa6a1721d7f..1dbd4eab9e1f 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -741,7 +741,7 @@ IMPL_LINK( SwView, EndScrollHdl, SwScrollbar *, pScrollbar ) if(nPgNum) { nPgNum = 0; - Help::ShowQuickHelp(pScrollbar, Rectangle(), OUString(), 0); + Help::ShowQuickHelp(pScrollbar, Rectangle(), OUString()); } Point aPos( m_aVisArea.TopLeft() ); bool bBorder = IsDocumentBorder(); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 5d2d3a412a89..85bd0b19ceda 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -2888,13 +2888,13 @@ void SwContentTree::RequestHelp( const HelpEvent& rHEvt ) } else Help::ShowQuickHelp( this, aItemRect, sEntry, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); bCallBase = false; } } else { - Help::ShowQuickHelp( this, Rectangle(), OUString(), 0 ); + Help::ShowQuickHelp( this, Rectangle(), OUString() ); bCallBase = false; } } diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index f60f7fe4d345..eba6232f3bba 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -497,7 +497,7 @@ void SwGlobalTree::RequestHelp( const HelpEvent& rHEvt ) } else Help::ShowQuickHelp( this, aItemRect, sEntry, - QUICKHELP_LEFT|QUICKHELP_VCENTER ); + QuickHelpFlags::Left|QuickHelpFlags::VCenter ); } } } diff --git a/vcl/inc/helpwin.hxx b/vcl/inc/helpwin.hxx index 60ecb61c9362..b553c6eb0540 100644 --- a/vcl/inc/helpwin.hxx +++ b/vcl/inc/helpwin.hxx @@ -23,6 +23,8 @@ #include <vcl/floatwin.hxx> #include <vcl/timer.hxx> +enum class QuickHelpFlags; + // - HelpTextWindow - class HelpTextWindow : public FloatingWindow @@ -39,7 +41,7 @@ private: Timer maHideTimer; sal_uInt16 mnHelpWinStyle; - sal_uInt16 mnStyle; + QuickHelpFlags mnStyle; protected: DECL_LINK_TYPED( TimerHdl, Timer*, void ); @@ -49,14 +51,14 @@ protected: void ImplShow(); public: - HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle ); + HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle ); virtual ~HelpTextWindow(); virtual void dispose() SAL_OVERRIDE; const OUString& GetHelpText() const { return maHelpText; } void SetHelpText( const OUString& rHelpText ); sal_uInt16 GetWinStyle() const { return mnHelpWinStyle; } - sal_uInt16 GetStyle() const { return mnStyle; } + QuickHelpFlags GetStyle() const { return mnStyle; } // Nur merken: void SetStatusText( const OUString& rStatusText ) { maStatusText = rStatusText; } @@ -70,11 +72,11 @@ public: virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE; }; -void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle, +void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString& rHelpText, const OUString& rStatusText, const Point& rScreenPos, const Rectangle* pHelpArea = NULL ); void ImplDestroyHelpWindow( bool bUpdateHideTime ); -void ImplSetHelpWindowPos( vcl::Window* pHelpWindow, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle, +void ImplSetHelpWindowPos( vcl::Window* pHelpWindow, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point& rPos, const Rectangle* pHelpArea ); #endif // INCLUDED_VCL_INC_HELPWIN_HXX diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx index a38d475efd11..7c4867310f06 100644 --- a/vcl/source/app/help.cxx +++ b/vcl/source/app/help.cxx @@ -150,7 +150,7 @@ bool Help::ShowBalloon( vcl::Window* pParent, const Point& rScreenPos, const OUString& rHelpText ) { - ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0, + ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, QuickHelpFlags::NONE, rHelpText, OUString(), rScreenPos ); return true; @@ -160,7 +160,7 @@ bool Help::ShowBalloon( vcl::Window* pParent, const Point& rScreenPos, const Rectangle& rRect, const OUString& rHelpText ) { - ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, 0, + ImplShowHelpWindow( pParent, HELPWINSTYLE_BALLOON, QuickHelpFlags::NONE, rHelpText, OUString(), rScreenPos, &rRect ); return true; @@ -185,7 +185,7 @@ bool Help::ShowQuickHelp( vcl::Window* pParent, const Rectangle& rScreenRect, const OUString& rHelpText, const OUString& rLongHelpText, - sal_uInt16 nStyle ) + QuickHelpFlags nStyle ) { ImplShowHelpWindow( pParent, HELPWINSTYLE_QUICK, nStyle, rHelpText, rLongHelpText, @@ -201,9 +201,9 @@ void Help::HideBalloonAndQuickHelp() } sal_uIntPtr Help::ShowTip( vcl::Window* pParent, const Rectangle& rScreenRect, - const OUString& rText, sal_uInt16 nStyle ) + const OUString& rText, QuickHelpFlags nStyle ) { - sal_uInt16 nHelpWinStyle = ( ( nStyle & QUICKHELP_TIP_STYLE_BALLOON ) != 0 ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK; + sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK; VclPtrInstance<HelpTextWindow> pHelpWin( pParent, rText, nHelpWinStyle, nStyle ); sal_uIntPtr nId = reinterpret_cast< sal_uIntPtr >( pHelpWin.get() ); @@ -238,7 +238,7 @@ void Help::HideTip( sal_uLong nId ) ImplGetSVData()->maHelpData.mnLastHelpHideTime = tools::Time::GetSystemTicks(); } -HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle ) : +HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle ) : FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window maHelpText( rText ) { @@ -269,7 +269,7 @@ HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal SetLineColor( COL_BLACK ); SetFillColor(); - if( mnStyle & QUICKHELP_BIDI_RTL ) + if( mnStyle & QuickHelpFlags::BiDiRtl ) { ComplexTextLayoutMode nLayoutMode = GetLayoutMode(); nLayoutMode |= TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT; @@ -310,7 +310,7 @@ void HelpTextWindow::SetHelpText( const OUString& rHelpText ) { Size aSize; aSize.Height() = GetTextHeight(); - if ( mnStyle & QUICKHELP_CTRLTEXT ) + if ( mnStyle & QuickHelpFlags::CtrlText ) aSize.Width() = GetCtrlTextWidth( maHelpText ); else aSize.Width() = GetTextWidth( maHelpText ); @@ -329,7 +329,7 @@ void HelpTextWindow::SetHelpText( const OUString& rHelpText ) Rectangle aTry1( aTmpPoint, aTmpSize ); sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK | TEXT_DRAW_LEFT | TEXT_DRAW_TOP; - if ( mnStyle & QUICKHELP_CTRLTEXT ) + if ( mnStyle & QuickHelpFlags::CtrlText ) nDrawFlags |= TEXT_DRAW_MNEMONIC; Rectangle aTextRect = GetTextRect( aTry1, maHelpText, nDrawFlags ); @@ -368,7 +368,7 @@ void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& // paint text if (mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN) { - if ( mnStyle & QUICKHELP_CTRLTEXT ) + if ( mnStyle & QuickHelpFlags::CtrlText ) rRenderContext.DrawCtrlText(maTextRect.TopLeft(), maHelpText); else rRenderContext.DrawText(maTextRect.TopLeft(), maHelpText); @@ -377,7 +377,7 @@ void HelpTextWindow::Paint( vcl::RenderContext& rRenderContext, const Rectangle& { sal_uInt16 nDrawFlags = TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK| TEXT_DRAW_LEFT|TEXT_DRAW_TOP; - if (mnStyle & QUICKHELP_CTRLTEXT) + if (mnStyle & QuickHelpFlags::CtrlText) nDrawFlags |= TEXT_DRAW_MNEMONIC; rRenderContext.DrawText(maTextRect, maHelpText, nDrawFlags); } @@ -468,7 +468,7 @@ OUString HelpTextWindow::GetText() const return FloatingWindow::CreateAccessible(); } -void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle, +void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString& rHelpText, const OUString& rStatusText, const Point& rScreenPos, const Rectangle* pHelpArea ) { @@ -503,7 +503,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, sal_uIn else { bool const bTextChanged = rHelpText != pHelpWin->GetHelpText(); - if ( bTextChanged || ( ( nStyle & QUICKHELP_FORCE_REPOSITION ) != 0 ) ) + if ( bTextChanged || ( nStyle & QuickHelpFlags::ForceReposition ) ) { vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow(); Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) ); @@ -523,7 +523,7 @@ void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, sal_uIn { sal_uInt64 nCurTime = tools::Time::GetSystemTicks(); if ( ( ( nCurTime - pSVData->maHelpData.mnLastHelpHideTime ) < pParent->GetSettings().GetHelpSettings().GetTipDelay() ) - || ( ( nStyle & QUICKHELP_NO_DELAY ) != 0 ) + || ( nStyle & QuickHelpFlags::NoDelay ) ) nDelayMode = HELPDELAY_NONE; @@ -565,7 +565,7 @@ void ImplDestroyHelpWindow( bool bUpdateHideTime ) } } -void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_uInt16 nStyle, +void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point& rPos, const Rectangle* pHelpArea ) { Point aPos = rPos; @@ -578,7 +578,7 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_ if ( nHelpWinStyle == HELPWINSTYLE_QUICK ) { - if ( !(nStyle & QUICKHELP_NOAUTOPOS) ) + if ( !(nStyle & QuickHelpFlags::NoAutoPos) ) { long nScreenHeight = aScreenRect.GetHeight(); aPos.X() -= 4; @@ -599,7 +599,7 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_ } } - if ( nStyle & QUICKHELP_NOAUTOPOS ) + if ( nStyle & QuickHelpFlags::NoAutoPos ) { if ( pHelpArea ) { @@ -611,28 +611,28 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_ // Welche Position vom Rechteck? aPos = devHelpArea.Center(); - if ( nStyle & QUICKHELP_LEFT ) + if ( nStyle & QuickHelpFlags::Left ) aPos.X() = devHelpArea.Left(); - else if ( nStyle & QUICKHELP_RIGHT ) + else if ( nStyle & QuickHelpFlags::Right ) aPos.X() = devHelpArea.Right(); - if ( nStyle & QUICKHELP_TOP ) + if ( nStyle & QuickHelpFlags::Top ) aPos.Y() = devHelpArea.Top(); - else if ( nStyle & QUICKHELP_BOTTOM ) + else if ( nStyle & QuickHelpFlags::Bottom ) aPos.Y() = devHelpArea.Bottom(); } // which direction? - if ( nStyle & QUICKHELP_LEFT ) + if ( nStyle & QuickHelpFlags::Left ) ; - else if ( nStyle & QUICKHELP_RIGHT ) + else if ( nStyle & QuickHelpFlags::Right ) aPos.X() -= aSz.Width(); else aPos.X() -= aSz.Width()/2; - if ( nStyle & QUICKHELP_TOP ) + if ( nStyle & QuickHelpFlags::Top ) ; - else if ( nStyle & QUICKHELP_BOTTOM ) + else if ( nStyle & QuickHelpFlags::Bottom ) aPos.Y() -= aSz.Height(); else aPos.Y() -= aSz.Height()/2; @@ -647,7 +647,7 @@ void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, sal_ else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() ) aPos.Y() = aScreenRect.Bottom() - aSz.Height(); - if( ! (nStyle & QUICKHELP_NOEVADEPOINTER) ) + if( ! (nStyle & QuickHelpFlags::NoEvadePointer) ) { /* the remark below should be obsolete by now as the helpwindow should not be focusable, leaving it as a hint. However it is sensible in most diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 41d232f64423..f19b1a13427d 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4250,7 +4250,7 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt ) Help::ShowBalloon( this, aHelpPos, aTempRect, aStr ); } else - Help::ShowQuickHelp( this, aTempRect, aStr, rHelpStr, QUICKHELP_CTRLTEXT ); + Help::ShowQuickHelp( this, aTempRect, aStr, rHelpStr, QuickHelpFlags::CtrlText ); return; } else if ( rHEvt.GetMode() & HelpEventMode::EXTENDED ) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 4a589c38e1ce..eddde5ccacec 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1979,7 +1979,7 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) OUString aHelpText; if ( !rStr.isEmpty() ) aHelpText = GetHelpText(); - Help::ShowQuickHelp( this, aRect, rStr, aHelpText, QUICKHELP_CTRLTEXT ); + Help::ShowQuickHelp( this, aRect, rStr, aHelpText, QuickHelpFlags::CtrlText ); } } else |