basctl/source/basicide/baside2b.cxx | 2 dbaccess/source/ui/control/dbtreelistbox.cxx | 2 dbaccess/source/ui/control/opendoccontrols.cxx | 2 editeng/source/editeng/editattr.cxx | 2 editeng/source/editeng/editdoc.cxx | 2 editeng/source/editeng/editeng.cxx | 2 editeng/source/editeng/impedit.cxx | 2 editeng/source/editeng/impedit3.cxx | 4 - editeng/source/editeng/impedit4.cxx | 2 editeng/source/items/frmitems.cxx | 2 editeng/source/uno/unofdesc.cxx | 2 include/vcl/fntstyle.hxx | 14 ++++- include/vcl/graphicfilter.hxx | 47 ++++++++++------- include/vcl/help.hxx | 66 ++++++++++++++----------- include/vcl/inputctx.hxx | 29 +++++++--- oox/source/drawingml/shape.cxx | 2 sc/source/ui/app/inputhdl.cxx | 4 - sc/source/ui/app/inputwin.cxx | 2 sc/source/ui/view/gridwin.cxx | 2 sc/source/ui/view/hdrcont.cxx | 6 +- sc/source/ui/view/prevwsh.cxx | 4 - sc/source/ui/view/tabview.cxx | 6 +- sc/source/ui/view/tabview4.cxx | 8 +-- sc/workben/test.cxx | 2 sd/source/ui/dlg/PhotoAlbumDialog.cxx | 2 sd/source/ui/slidesorter/view/SlsToolTip.cxx | 2 sd/source/ui/view/viewoverlaymanager.cxx | 2 sfx2/source/dialog/dinfdlg.cxx | 2 sfx2/source/dialog/filedlghelper.cxx | 2 svtools/source/contnr/imivctl1.cxx | 2 svtools/source/contnr/svimpbox.cxx | 2 svtools/source/filter/exportdialog.cxx | 2 svtools/source/graphic/provider.cxx | 2 svtools/source/table/tabledatawindow.cxx | 4 - svx/source/fmcomp/fmgridif.cxx | 2 svx/source/svdraw/svdograf.cxx | 4 - sw/source/core/inc/swfont.hxx | 12 ++-- sw/source/core/text/atrstck.cxx | 6 +- sw/source/core/txtnode/fntcache.cxx | 4 - sw/source/core/txtnode/swfont.cxx | 12 ++-- sw/source/ui/fldui/FldRefTreeListBox.cxx | 2 sw/source/ui/index/cnttab.cxx | 4 - sw/source/ui/misc/glosbib.cxx | 2 sw/source/ui/misc/glossary.cxx | 2 sw/source/uibase/docvw/edtwin.cxx | 6 +- sw/source/uibase/docvw/edtwin2.cxx | 4 - sw/source/uibase/shells/basesh.cxx | 4 - sw/source/uibase/uiview/pview.cxx | 4 - sw/source/uibase/uiview/view.cxx | 16 +++--- sw/source/uibase/uiview/viewport.cxx | 2 sw/source/uibase/utlui/content.cxx | 4 - sw/source/uibase/utlui/glbltree.cxx | 2 sw/source/uibase/web/wview.cxx | 8 +-- toolkit/source/helper/vclunohelper.cxx | 2 vcl/inc/helpwin.hxx | 12 ++-- vcl/inc/osx/salframe.h | 2 vcl/inc/salwtype.hxx | 10 --- vcl/osx/salframe.cxx | 6 +- vcl/osx/salframeview.mm | 2 vcl/source/app/help.cxx | 52 +++++++++---------- vcl/source/control/edit.cxx | 2 vcl/source/edit/texteng.cxx | 2 vcl/source/edit/textview.cxx | 4 - vcl/source/filter/graphicfilter.cxx | 18 +++--- vcl/source/filter/jpeg/jpeg.cxx | 6 +- vcl/source/filter/jpeg/jpeg.hxx | 3 - vcl/source/gdi/font.cxx | 10 +-- vcl/source/outdev/font.cxx | 6 +- vcl/source/outdev/text.cxx | 2 vcl/source/window/toolbox.cxx | 2 vcl/source/window/window.cxx | 2 vcl/unx/generic/window/salframe.cxx | 16 +++--- vcl/unx/gtk/window/gtksalframe.cxx | 2 vcl/win/source/window/salframe.cxx | 4 - 74 files changed, 267 insertions(+), 236 deletions(-)
New commits: commit 68041a0546fc6a05608411365c8382937aafac79 Author: Noel Grandin <n...@peralex.com> Date: Thu May 14 12:00:19 2015 +0200 convert INPUTCONTEXT_ constants to scoped enum Change-Id: I5b99e42a3e85527b27d515c468d2ed66386fc9df diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 3f31452..676fc44 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -961,7 +961,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 { SvxFont aFont; pEditEngine->SeekCursor( aPaM.GetNode(), aPaM.GetIndex()+1, aFont ); - sal_uLong nContextFlags = INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT; + InputContextFlags nContextFlags = InputContextFlags::Text|InputContextFlags::ExtText; GetWindow()->SetInputContext( InputContext( aFont, nContextFlags ) ); } } diff --git a/include/vcl/inputctx.hxx b/include/vcl/inputctx.hxx index ae7c4e7..3cd78744 100644 --- a/include/vcl/inputctx.hxx +++ b/include/vcl/inputctx.hxx @@ -23,15 +23,24 @@ #include <tools/solar.h> #include <vcl/dllapi.h> #include <vcl/font.hxx> +#include <o3tl/typed_flags_set.hxx> // - InputContext-Flags - -#define INPUTCONTEXT_TEXT ((sal_uLong)0x00000001) -#define INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002) -#define INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004) -#define INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008) +enum class InputContextFlags +{ + NONE = 0x0000, + Text = 0x0001, + ExtText = 0x0002, + ExtTextOn = 0x0004, + ExtTextOff = 0x0008, +}; +namespace o3tl +{ + template<> struct typed_flags<InputContextFlags> : is_typed_flags<InputContextFlags, 0x000f> {}; +} // - InputContext - @@ -40,23 +49,23 @@ class VCL_DLLPUBLIC InputContext { private: - vcl::Font maFont; - sal_uLong mnOptions; + vcl::Font maFont; + InputContextFlags mnOptions; public: - InputContext() { mnOptions = 0; } + InputContext() { mnOptions = InputContextFlags::NONE; } InputContext( const InputContext& rInputContext ) : maFont( rInputContext.maFont ) { mnOptions = rInputContext.mnOptions; } - InputContext( const vcl::Font& rFont, sal_uLong nOptions = 0 ) : + InputContext( const vcl::Font& rFont, InputContextFlags nOptions = InputContextFlags::NONE ) : maFont( rFont ) { mnOptions = nOptions; } void SetFont( const vcl::Font& rFont ) { maFont = rFont; } const vcl::Font& GetFont() const { return maFont; } - void SetOptions( sal_uLong nOptions ) { mnOptions = nOptions; } - sal_uLong GetOptions() const { return mnOptions; } + void SetOptions( InputContextFlags nOptions ) { mnOptions = nOptions; } + InputContextFlags GetOptions() const { return mnOptions; } InputContext& operator=( const InputContext& rInputContext ); bool operator==( const InputContext& rInputContext ) const; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 71bca6f..9c2eaa4 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3523,7 +3523,7 @@ void ScGridWindow::StopMarking() void ScGridWindow::UpdateInputContext() { bool bReadOnly = pViewData->GetDocShell()->IsReadOnly(); - sal_uLong nOptions = bReadOnly ? 0 : ( INPUTCONTEXT_TEXT | INPUTCONTEXT_EXTTEXTINPUT ); + InputContextFlags nOptions = bReadOnly ? InputContextFlags::NONE : ( InputContextFlags::Text | InputContextFlags::ExtText ); // when font from InputContext is used, // it must be taken from the cursor position's cell attributes diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 38e935e..fe41345 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -4966,8 +4966,8 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView): if( !rMyView.GetDocShell()->IsReadOnly() ) { vcl::Font aFont; - SetInputContext( InputContext( aFont, INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT ) ); + SetInputContext( InputContext( aFont, InputContextFlags::Text | + InputContextFlags::ExtText ) ); } } diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 1a19951..3be5b83 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -2126,8 +2126,8 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet ) bool bVertical = rSh.IsInVerticalText(); aFont.SetOrientation(bVertical ? 2700 : 0); aFont.SetVertical(bVertical); - GetView().GetEditWin().SetInputContext( InputContext( aFont, INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT ) ); + GetView().GetEditWin().SetInputContext( InputContext( aFont, InputContextFlags::Text | + InputContextFlags::ExtText ) ); } } break; diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index 02c00d7..eb36925 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -422,11 +422,11 @@ void SwView::SelectShell() InputContext aCntxt( GetEditWin().GetInputContext() ); aCntxt.SetOptions( bSetExtInpCntxt ? (aCntxt.GetOptions() | - ( INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT )) + ( InputContextFlags::Text | + InputContextFlags::ExtText )) : (aCntxt.GetOptions() & ~ - ( INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT )) ); + InputContextFlags( InputContextFlags::Text | + InputContextFlags::ExtText )) ); GetEditWin().SetInputContext( aCntxt ); } @@ -665,11 +665,11 @@ void SwView::_CheckReadonlySelection() InputContext aCntxt( GetEditWin().GetInputContext() ); aCntxt.SetOptions( SW_DISABLE_ON_PROTECTED_CURSOR & nDisableFlags ? (aCntxt.GetOptions() & ~ - ( INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT )) + InputContextFlags( InputContextFlags::Text | + InputContextFlags::ExtText )) : (aCntxt.GetOptions() | - ( INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT )) ); + ( InputContextFlags::Text | + InputContextFlags::ExtText )) ); GetEditWin().SetInputContext( aCntxt ); } break; diff --git a/sw/source/uibase/web/wview.cxx b/sw/source/uibase/web/wview.cxx index ecd15c6..1a4e702 100644 --- a/sw/source/uibase/web/wview.cxx +++ b/sw/source/uibase/web/wview.cxx @@ -260,11 +260,11 @@ void SwWebView::SelectShell() InputContext aCntxt( GetEditWin().GetInputContext() ); aCntxt.SetOptions( bSetExtInpCntxt ? (aCntxt.GetOptions() | - ( INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT )) + ( InputContextFlags::Text | + InputContextFlags::ExtText )) : (aCntxt.GetOptions() & ~ - ( INPUTCONTEXT_TEXT | - INPUTCONTEXT_EXTTEXTINPUT )) ); + InputContextFlags( InputContextFlags::Text | + InputContextFlags::ExtText )) ); GetEditWin().SetInputContext( aCntxt ); } diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 4db73fb..b030d39 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -90,7 +90,7 @@ public: Rectangle maInvalidRect; - sal_uLong mnICOptions; + InputContextFlags mnICOptions; // To prevent display sleep during presentation IOPMAssertionID mnAssertionID; diff --git a/vcl/inc/salwtype.hxx b/vcl/inc/salwtype.hxx index c20c454..b464b5c 100644 --- a/vcl/inc/salwtype.hxx +++ b/vcl/inc/salwtype.hxx @@ -30,6 +30,7 @@ class SalObject; namespace vcl { class Window; } class FontSelectPattern; +enum class InputContextFlags; // - SalEvent - @@ -266,18 +267,11 @@ struct SalFrameState // - SalInputContext - -// Have to match DEFINEs in inputctx.hxx, as these are not converted -#define SAL_INPUTCONTEXT_TEXT ((sal_uLong)0x00000001) -#define SAL_INPUTCONTEXT_EXTTEXTINPUT ((sal_uLong)0x00000002) -#define SAL_INPUTCONTEXT_EXTTEXTINPUT_ON ((sal_uLong)0x00000004) -#define SAL_INPUTCONTEXT_EXTTEXTINPUT_OFF ((sal_uLong)0x00000008) -#define SAL_INPUTCONTEXT_CHANGELANGUAGE ((sal_uLong)0x00000010) - struct SalInputContext { FontSelectPattern* mpFont; LanguageType meLanguage; - sal_uLong mnOptions; + InputContextFlags mnOptions; }; struct SalSwipeEvent diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index b23b3e6..af1327f 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -76,7 +76,7 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, sal_uLong salFrameStyle ) : mePointerStyle( POINTER_ARROW ), mnTrackingRectTag( 0 ), mrClippingPath( 0 ), - mnICOptions( 0 ) + mnICOptions( InputContextFlags::NONE ) { maSysData.nSize = sizeof( SystemEnvData ); @@ -919,13 +919,13 @@ void AquaSalFrame::SetInputContext( SalInputContext* pContext ) { if (!pContext) { - mnICOptions = 0; + mnICOptions = InputContextFlags::NONE; return; } mnICOptions = pContext->mnOptions; - if(!(pContext->mnOptions & SAL_INPUTCONTEXT_TEXT)) + if(!(pContext->mnOptions & InputContextFlags::Text)) return; } diff --git a/vcl/osx/salframeview.mm b/vcl/osx/salframeview.mm index 2867295..8036a0f 100644 --- a/vcl/osx/salframeview.mm +++ b/vcl/osx/salframeview.mm @@ -1684,7 +1684,7 @@ private: #if OSL_DEBUG_LEVEL > 1 // fprintf( stderr, "SalFrameView: doCommandBySelector %s\n", (char*)aSelector ); #endif - if( (mpFrame->mnICOptions & SAL_INPUTCONTEXT_TEXT) != 0 && + if( (mpFrame->mnICOptions & InputContextFlags::Text) && aSelector != NULL && [self respondsToSelector: aSelector] ) { [self performSelector: aSelector]; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index c642282..3ff8746 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -1943,7 +1943,7 @@ void Edit::GetFocus() Invalidate(); } - SetInputContext( InputContext( GetFont(), !IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); + SetInputContext( InputContext( GetFont(), !IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } Control::GetFocus(); diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 7311148..a725932 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -210,7 +210,7 @@ void TextEngine::SetFont( const vcl::Font& rFont ) for ( sal_uInt16 nView = mpViews->size(); nView; ) { TextView* pView = (*mpViews)[ --nView ]; - pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); + pView->GetWindow()->SetInputContext( InputContext( GetFont(), !pView->IsReadOnly() ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } } } diff --git a/vcl/source/edit/textview.cxx b/vcl/source/edit/textview.cxx index a3758ec..691fba8 100644 --- a/vcl/source/edit/textview.cxx +++ b/vcl/source/edit/textview.cxx @@ -208,7 +208,7 @@ TextView::TextView( TextEngine* pEng, vcl::Window* pWindow ) : mpImpl->mpCursor = new vcl::Cursor; mpImpl->mpCursor->Show(); pWindow->SetCursor( mpImpl->mpCursor ); - pWindow->SetInputContext( InputContext( pEng->GetFont(), INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT ) ); + pWindow->SetInputContext( InputContext( pEng->GetFont(), InputContextFlags::Text|InputContextFlags::ExtText ) ); if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT ) mpImpl->mbHighlightSelection = true; @@ -1227,7 +1227,7 @@ void TextView::SetReadOnly( bool bReadOnly ) else HideCursor(); - GetWindow()->SetInputContext( InputContext( mpImpl->mpTextEngine->GetFont(), bReadOnly ? INPUTCONTEXT_TEXT|INPUTCONTEXT_EXTTEXTINPUT : 0 ) ); + GetWindow()->SetInputContext( InputContext( mpImpl->mpTextEngine->GetFont(), bReadOnly ? InputContextFlags::Text|InputContextFlags::ExtText : InputContextFlags::NONE ) ); } } diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index 610314a..4f428dc 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -2463,13 +2463,13 @@ void X11SalFrame::Sync() void X11SalFrame::SetInputContext( SalInputContext* pContext ) { - if (pContext == NULL) + if (pContext == NULL) return; - // 1. We should create an input context for this frame - // only when SAL_INPUTCONTEXT_TEXT is set. + // 1. We should create an input context for this frame + // only when InputContextFlags::Text is set. - if (!(pContext->mnOptions & SAL_INPUTCONTEXT_TEXT)) + if (!(pContext->mnOptions & InputContextFlags::Text)) { if( mpInputContext ) mpInputContext->Unmap( this ); @@ -2477,9 +2477,9 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) } // 2. We should use on-the-spot inputstyle - // only when SAL_INPUTCONTEXT_EXTTEXTINPUT is set. + // only when InputContextFlags::ExtTExt is set. - if (mpInputContext == NULL) + if (mpInputContext == NULL) { vcl::I18NStatus& rStatus( vcl::I18NStatus::get() ); rStatus.setParent( this ); @@ -2490,10 +2490,10 @@ void X11SalFrame::SetInputContext( SalInputContext* pContext ) if (mbInputFocus) mpInputContext->SetICFocus( this ); } - } + } else mpInputContext->Map( this ); - return; + return; } void X11SalFrame::EndExtTextInput( sal_uInt16 nFlags ) diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 7fea4a9..8ca6a53 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -2915,7 +2915,7 @@ void GtkSalFrame::SetInputContext( SalInputContext* pContext ) if( ! pContext ) return; - if( ! (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) ) + if( ! (pContext->mnOptions & InputContextFlags::Text) ) return; // create a new im context diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index 999cb66..fae12e6 100644 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2219,7 +2219,7 @@ void WinSalFrame::Sync() static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pContext ) { WinSalFrame* pFrame = GetWindowPtr( hWnd ); - bool bIME = (pContext->mnOptions & SAL_INPUTCONTEXT_TEXT) != 0; + bool bIME(pContext->mnOptions & InputContextFlags::Text); if ( bIME ) { if ( !pFrame->mbIME ) @@ -2238,7 +2238,7 @@ static void ImplSalFrameSetInputContext( HWND hWnd, const SalInputContext* pCont // When the application can't handle IME messages, then the // System should handle the IME handling - if ( !(pContext->mnOptions & SAL_INPUTCONTEXT_EXTTEXTINPUT) ) + if ( !(pContext->mnOptions & InputContextFlags::ExtText) ) pFrame->mbHandleIME = FALSE; // Set the Font for IME Handling commit 741d9990bf9d9dfcba1166a12ffb1d846c912181 Author: Noel Grandin <n...@peralex.com> Date: Thu May 14 10:39:01 2015 +0200 convert QUICKHELP constants to scoped enum Change-Id: Ie7302c909feb2e83b8b5e62a5e6a1f901783fb49 diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 55d67ac..098c8d3 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 2780a9c..13a5565 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 65f1421..7eb8ef0 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 dd631be..3a356ab 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 934fada..0fb7962 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 42c9e55..40dfcf2 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 d15a661..2b6be65 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 8b84cc6..a9cd2b6 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 15407ea..fe37b96 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 7b72aba..e0e0599 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 587ff94..75cb5c4 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 8d21f9c..3c47c9b 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 7e6688c..f6b32ad 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 d5c00c8..217888c 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 f184bb8..333d338 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 daa9fab4..bda4806 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 d5f610c..0db2da3 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 b50efab..9431266 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 5170993..044f846 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 03ed69a..00d308e 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 0204ed3..9c5a03f 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 b1ec21d..7444167 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 388e7e5..d00a14a 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 a0475d6..38e935e 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 67f8570..9151379 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 04d43c4..1e93465 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 1fa6a17..1dbd4ea 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 5d2d3a4..85bd0b1 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 f60f7fe..eba6232 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 60ecb61..b553c6e 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 a38d475..7c48673 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 41d232f..f19b1a1 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 4a589c3..eddde5c 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 commit f30ce25c3c5954eb90e126dd4904eee5454f044c Author: Noel Grandin <n...@peralex.com> Date: Thu May 14 09:44:40 2015 +0200 convert GRFILTER_I_FLAGS to scoped enum Change-Id: Ic1cb9b32fe252706cd607abb2ae1fd5a00999901 diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 5082302..50db586 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -3932,7 +3932,7 @@ const GraphicObject* SvxBrushItem::GetGraphicObject(OUString const & referer) co pImpl->pStream->Seek( STREAM_SEEK_TO_BEGIN ); nRes = GraphicFilter::GetGraphicFilter(). ImportGraphic( aGraphic, maStrLink, *pImpl->pStream, - GRFILTER_FORMAT_DONTKNOW, NULL, GRFILTER_I_FLAGS_DONT_SET_LOGSIZE_FOR_JPEG ); + GRFILTER_FORMAT_DONTKNOW, NULL, GraphicFilterImportFlags::DontSetLogsizeForJpeg ); if( nRes != GRFILTER_OK ) { diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index 4451193..5d34d0f 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -26,6 +26,7 @@ #include <vcl/dllapi.h> #include <vcl/field.hxx> #include <vcl/graph.hxx> +#include <o3tl/typed_flags_set.hxx> #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/beans/PropertyValue.hpp> @@ -48,10 +49,18 @@ struct ConvertData; #define GRFILTER_FORMAT_NOTFOUND ((sal_uInt16)0xFFFF) #define GRFILTER_FORMAT_DONTKNOW ((sal_uInt16)0xFFFF) -#define GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG 00000001 -#define GRFILTER_I_FLAGS_DONT_SET_LOGSIZE_FOR_JPEG 00000002 -#define GRFILTER_I_FLAGS_FOR_PREVIEW 00000004 -#define GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD 00000010 +enum class GraphicFilterImportFlags +{ + NONE = 0x000, + SetLogsizeForJpeg = 0x001, + DontSetLogsizeForJpeg = 0x002, + ForPreview = 0x004, + AllowPartialStreamRead = 0x010, +}; +namespace o3tl +{ + template<> struct typed_flags<GraphicFilterImportFlags> : is_typed_flags<GraphicFilterImportFlags, 0x0017> {}; +} #define IMP_BMP "SVBMP" #define IMP_MOV "SVMOV" @@ -133,8 +142,8 @@ class VCL_DLLPUBLIC GraphicDescriptor sal_uInt16 nBitsPerPixel; sal_uInt16 nPlanes; GraphicFileFormat nFormat; - bool bCompressed; - bool bOwnStream; + bool bCompressed; + bool bOwnStream; void ImpConstruct(); @@ -250,10 +259,10 @@ public: void SetFilterPath( const OUString& rFilterPath ) { aFilterPath = rFilterPath; }; - sal_uInt16 GetImportFormatCount(); - sal_uInt16 GetImportFormatNumber( const OUString& rFormatName ); - sal_uInt16 GetImportFormatNumberForMediaType( const OUString& rMediaType ); - sal_uInt16 GetImportFormatNumberForShortName( const OUString& rShortName ); + sal_uInt16 GetImportFormatCount(); + sal_uInt16 GetImportFormatNumber( const OUString& rFormatName ); + sal_uInt16 GetImportFormatNumberForMediaType( const OUString& rMediaType ); + sal_uInt16 GetImportFormatNumberForShortName( const OUString& rShortName ); sal_uInt16 GetImportFormatNumberForTypeName( const OUString& rType ); OUString GetImportFormatName( sal_uInt16 nFormat ); OUString GetImportFormatTypeName( sal_uInt16 nFormat ); @@ -263,10 +272,10 @@ public: OUString GetImportWildcard( sal_uInt16 nFormat, sal_Int32 nEntry = 0 ); bool IsImportPixelFormat( sal_uInt16 nFormat ); - sal_uInt16 GetExportFormatCount(); - sal_uInt16 GetExportFormatNumber( const OUString& rFormatName ); - sal_uInt16 GetExportFormatNumberForMediaType( const OUString& rShortName ); - sal_uInt16 GetExportFormatNumberForShortName( const OUString& rShortName ); + sal_uInt16 GetExportFormatCount(); + sal_uInt16 GetExportFormatNumber( const OUString& rFormatName ); + sal_uInt16 GetExportFormatNumberForMediaType( const OUString& rShortName ); + sal_uInt16 GetExportFormatNumberForShortName( const OUString& rShortName ); OUString GetExportInternalFilterName( sal_uInt16 nFormat ); sal_uInt16 GetExportFormatNumberForTypeName( const OUString& rType ); OUString GetExportFormatName( sal_uInt16 nFormat ); @@ -283,7 +292,7 @@ public: sal_uInt16 ExportGraphic( const Graphic& rGraphic, const OUString& rPath, SvStream& rOStm, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, const css::uno::Sequence< css::beans::PropertyValue >* pFilterData = NULL ); - long GetExportGraphicHint() const { return nExpGraphHint; } + long GetExportGraphicHint() const { return nExpGraphHint; } sal_uInt16 CanImportGraphic( const INetURLObject& rPath, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, @@ -291,7 +300,7 @@ public: sal_uInt16 ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, - sal_uInt16 * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0 ); + sal_uInt16 * pDeterminedFormat = NULL, GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE ); sal_uInt16 CanImportGraphic( const OUString& rPath, SvStream& rStream, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, @@ -300,17 +309,17 @@ public: sal_uInt16 ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rStream, sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW, - sal_uInt16 * pDeterminedFormat = NULL, sal_uInt32 nImportFlags = 0, + sal_uInt16 * pDeterminedFormat = NULL, GraphicFilterImportFlags nImportFlags = GraphicFilterImportFlags::NONE, WMF_EXTERNALHEADER *pExtHeader = NULL ); sal_uInt16 ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rStream, sal_uInt16 nFormat, - sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags, + sal_uInt16 * pDeterminedFormat, GraphicFilterImportFlags nImportFlags, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData, WMF_EXTERNALHEADER *pExtHeader = NULL ); - void Abort() { bAbort = true; } + void Abort() { bAbort = true; } const FilterErrorEx& GetLastError() const { return *pErrorEx;} void ResetLastError(); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 68e25fc..1f10a74 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1194,7 +1194,7 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase& rFilterBase ) Graphic aGraphic; GraphicFilter aFilter( false ); - if ( aFilter.ImportGraphic( aGraphic, "", mpTempStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, static_cast < Sequence < PropertyValue >* > ( NULL ), NULL ) != GRFILTER_OK ) + if ( aFilter.ImportGraphic( aGraphic, "", mpTempStream, GRFILTER_FORMAT_NOTFOUND, NULL, GraphicFilterImportFlags::NONE, static_cast < Sequence < PropertyValue >* > ( NULL ), NULL ) != GRFILTER_OK ) { SAL_WARN( "oox.drawingml", OSL_THIS_FUNC << "Unable to import rendered stream into graphic object" ); diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx index ecf89cf..d5dcd09 100644 --- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx +++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx @@ -602,7 +602,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl) aURLObj.SetSmartURL( sImgUrl ); } - sal_uInt32 nFilterImportFlags = GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG; + GraphicFilterImportFlags nFilterImportFlags = GraphicFilterImportFlags::SetLogsizeForJpeg; // remote? if ( INetProtocol::File != aURLObj.GetProtocol() ) { diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 4ca8364..a1a38f5 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -763,7 +763,7 @@ ErrCode FileDialogHelper_Impl::getGraphic( const OUString& rURL, ErrCode nRet = ERRCODE_NONE; - sal_uInt32 nFilterImportFlags = GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG; + GraphicFilterImportFlags nFilterImportFlags = GraphicFilterImportFlags::SetLogsizeForJpeg; // non-local? if ( INetProtocol::File != aURLObj.GetProtocol() ) { diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 9d16cc0..62eb286 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -502,7 +502,7 @@ Bitmap ExportDialog::GetGraphicBitmap( SvStream& rInputStream ) Bitmap aRet; Graphic aGraphic; GraphicFilter aFilter( false ); - if ( aFilter.ImportGraphic( aGraphic, "", rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, 0, static_cast<com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*>(NULL), NULL ) == GRFILTER_OK ) + if ( aFilter.ImportGraphic( aGraphic, "", rInputStream, GRFILTER_FORMAT_NOTFOUND, NULL, GraphicFilterImportFlags::NONE, static_cast<com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >*>(NULL), NULL ) == GRFILTER_OK ) { aRet = aGraphic.GetBitmap(); } diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index 9bfe058..292945d 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -486,7 +486,7 @@ uno::Reference< ::graphic::XGraphic > SAL_CALL GraphicProvider::queryGraphic( co pExtHeader = &aExtHeader; if( ( rFilter.ImportGraphic( aVCLGraphic, aPath, *pIStm, - GRFILTER_FORMAT_DONTKNOW, NULL, 0, pExtHeader ) == GRFILTER_OK ) && + GRFILTER_FORMAT_DONTKNOW, NULL, GraphicFilterImportFlags::NONE, pExtHeader ) == GRFILTER_OK ) && ( aVCLGraphic.GetType() != GRAPHIC_NONE ) ) { ::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic; diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 170a402..2fa62cc 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -99,7 +99,7 @@ const Graphic ImpLoadLinkedGraphic( const OUString& aFileName, const OUString& a // to interpret included links may fail. // Alternatively the path may be set at the result after this call when it is known // that it is a SVG graphic, but only because no one yet tried to interpret it. - rGF.ImportGraphic( aGraphic, aFileName, *pInStrm, nFilter, NULL, 0, &aFilterData ); + rGF.ImportGraphic( aGraphic, aFileName, *pInStrm, nFilter, NULL, GraphicFilterImportFlags::NONE, &aFilterData ); } return aGraphic; } @@ -1346,7 +1346,7 @@ IMPL_LINK( SdrGrafObj, ImpSwapHdl, GraphicObject*, pO ) if(!GraphicFilter::GetGraphicFilter().ImportGraphic( aGraphic, aUserData, *pStream, - GRFILTER_FORMAT_DONTKNOW, NULL, 0, pFilterData.get())) + GRFILTER_FORMAT_DONTKNOW, NULL, GraphicFilterImportFlags::NONE, pFilterData.get())) { const OUString aNewUserData( pGraphic->GetUserData() ); pGraphic->SetGraphic( aGraphic ); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 6886843..efa848b 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -1309,7 +1309,7 @@ sal_uInt16 GraphicFilter::CanImportGraphic( const OUString& rMainUrl, SvStream& //SJ: TODO, we need to create a GraphicImporter component sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath, - sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, sal_uInt32 nImportFlags ) + sal_uInt16 nFormat, sal_uInt16 * pDeterminedFormat, GraphicFilterImportFlags nImportFlags ) { sal_uInt16 nRetValue = GRFILTER_FORMATERROR; DBG_ASSERT( rPath.GetProtocol() != INetProtocol::NotValid, "GraphicFilter::ImportGraphic() : ProtType == INetProtocol::NotValid" ); @@ -1324,13 +1324,13 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& } sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream, - sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags, WMF_EXTERNALHEADER *pExtHeader ) + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags, WMF_EXTERNALHEADER *pExtHeader ) { return ImportGraphic( rGraphic, rPath, rIStream, nFormat, pDeterminedFormat, nImportFlags, NULL, pExtHeader ); } sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPath, SvStream& rIStream, - sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, sal_uInt32 nImportFlags, + sal_uInt16 nFormat, sal_uInt16* pDeterminedFormat, GraphicFilterImportFlags nImportFlags, com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >* pFilterData, WMF_EXTERNALHEADER *pExtHeader ) { @@ -1365,18 +1365,18 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat { aPreviewSizeHint = Size( aSize.Width, aSize.Height ); if ( aSize.Width || aSize.Height ) - nImportFlags |= GRFILTER_I_FLAGS_FOR_PREVIEW; + nImportFlags |= GraphicFilterImportFlags::ForPreview; else - nImportFlags &=~GRFILTER_I_FLAGS_FOR_PREVIEW; + nImportFlags &=~GraphicFilterImportFlags::ForPreview; } } else if ( (*pFilterData)[ i ].Name == "AllowPartialStreamRead" ) { (*pFilterData)[ i ].Value >>= bAllowPartialStreamRead; if ( bAllowPartialStreamRead ) - nImportFlags |= GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD; + nImportFlags |= GraphicFilterImportFlags::AllowPartialStreamRead; else - nImportFlags &=~GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD; + nImportFlags &=~GraphicFilterImportFlags::AllowPartialStreamRead; } else if ( (*pFilterData)[ i ].Name == "CreateNativeLink" ) { @@ -1496,8 +1496,8 @@ sal_uInt16 GraphicFilter::ImportGraphic( Graphic& rGraphic, const OUString& rPat // set LOGSIZE flag always, if not explicitly disabled // (see #90508 and #106763) - if( 0 == ( nImportFlags & GRFILTER_I_FLAGS_DONT_SET_LOGSIZE_FOR_JPEG ) ) - nImportFlags |= GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG; + if( !( nImportFlags & GraphicFilterImportFlags::DontSetLogsizeForJpeg ) ) + nImportFlags |= GraphicFilterImportFlags::SetLogsizeForJpeg; if( !ImportJPEG( rIStream, rGraphic, NULL, nImportFlags ) ) nStatus = GRFILTER_FILTERERROR; diff --git a/vcl/source/filter/jpeg/jpeg.cxx b/vcl/source/filter/jpeg/jpeg.cxx index 1f7d0e1..13c8552 100644 --- a/vcl/source/filter/jpeg/jpeg.cxx +++ b/vcl/source/filter/jpeg/jpeg.cxx @@ -25,7 +25,7 @@ #include <vcl/FilterConfigItem.hxx> #include <vcl/graphicfilter.hxx> -bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ) +bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, GraphicFilterImportFlags nImportFlags ) { ReadState eReadState; bool bReturn = true; @@ -34,10 +34,10 @@ bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, s if( !pJPEGReader ) { - pJPEGReader = new JPEGReader( rInputStream, pCallerData, ( nImportFlags & GRFILTER_I_FLAGS_SET_LOGSIZE_FOR_JPEG ) != 0 ); + pJPEGReader = new JPEGReader( rInputStream, pCallerData, bool( nImportFlags & GraphicFilterImportFlags::SetLogsizeForJpeg ) ); } - if( nImportFlags & GRFILTER_I_FLAGS_FOR_PREVIEW ) + if( nImportFlags & GraphicFilterImportFlags::ForPreview ) { pJPEGReader->SetPreviewSize( Size(128,128) ); } diff --git a/vcl/source/filter/jpeg/jpeg.hxx b/vcl/source/filter/jpeg/jpeg.hxx index 1280e8b..99cf499 100644 --- a/vcl/source/filter/jpeg/jpeg.hxx +++ b/vcl/source/filter/jpeg/jpeg.hxx @@ -21,12 +21,13 @@ #define INCLUDED_VCL_SOURCE_FILTER_JPEG_JPEG_HXX #include <vcl/graph.hxx> +#include <vcl/graphicfilter.hxx> #include <vcl/fltcall.hxx> #include <com/sun/star/uno/Sequence.h> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/task/XStatusIndicator.hpp> -bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, sal_Int32 nImportFlags ); +bool ImportJPEG( SvStream& rInputStream, Graphic& rGraphic, void* pCallerData, GraphicFilterImportFlags nImportFlags ); bool ExportJPEG(SvStream& rOutputStream, const Graphic& rGraphic, commit 19a32ddfd2b9c1beb17641e99f139ac0d3dcaf96 Author: Noel Grandin <n...@peralex.com> Date: Wed May 13 10:53:15 2015 +0200 convert KERNING_ constants to scoped enum Change-Id: I58031485aaa9ebdeb986a3ee0376f36a9f667947 diff --git a/editeng/source/editeng/editattr.cxx b/editeng/source/editeng/editattr.cxx index 3076ead..dcb9fa0 100644 --- a/editeng/source/editeng/editattr.cxx +++ b/editeng/source/editeng/editattr.cxx @@ -411,7 +411,7 @@ EditCharAttribPairKerning::EditCharAttribPairKerning( const SvxAutoKernItem& rAt void EditCharAttribPairKerning::SetFont( SvxFont& rFont, OutputDevice* ) { - rFont.SetKerning( static_cast<const SvxAutoKernItem*>(GetItem())->GetValue() ? KERNING_FONTSPECIFIC : 0 ); + rFont.SetKerning( static_cast<const SvxAutoKernItem*>(GetItem())->GetValue() ? FontKerning::FontSpecific : FontKerning::NONE ); } diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx index 33ea25b..c9fe975 100644 --- a/editeng/source/editeng/editdoc.cxx +++ b/editeng/source/editeng/editdoc.cxx @@ -2083,7 +2083,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S rFont.SetEscapement( nEsc ); } if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_PAIRKERNING ) == SfxItemState::SET ) ) - rFont.SetKerning( static_cast<const SvxAutoKernItem&>(rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ? KERNING_FONTSPECIFIC : 0 ); + rFont.SetKerning( static_cast<const SvxAutoKernItem&>(rSet.Get( EE_CHAR_PAIRKERNING )).GetValue() ? FontKerning::FontSpecific : FontKerning::NONE ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_KERNING ) == SfxItemState::SET ) ) rFont.SetFixKerning( static_cast<const SvxKerningItem&>(rSet.Get( EE_CHAR_KERNING )).GetValue() ); if ( bSearchInParent || ( rSet.GetItemState( EE_CHAR_WLM ) == SfxItemState::SET ) ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 7685e31..1a8ac4d 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2646,8 +2646,8 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo rFont.SetCJKContextLanguage( pCJKLanguageItem->GetLanguage() ); - if ( rFont.GetKerning() && IsKernAsianPunctuation() && ( nScriptTypeI18N == i18n::ScriptType::ASIAN ) ) - rFont.SetKerning( rFont.GetKerning() | KERNING_ASIAN ); + if ( (rFont.GetKerning() != FontKerning::NONE) && IsKernAsianPunctuation() && ( nScriptTypeI18N == i18n::ScriptType::ASIAN ) ) + rFont.SetKerning( rFont.GetKerning() | FontKerning::Asian ); if ( aStatus.DoNotUseColors() ) { diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx index c9555cc..c5d85a1 100644 --- a/editeng/source/uno/unofdesc.cxx +++ b/editeng/source/uno/unofdesc.cxx @@ -47,7 +47,7 @@ void SvxUnoFontDescriptor::ConvertToFont( const awt::FontDescriptor& rDesc, vcl: rFont.SetCharSet( (rtl_TextEncoding)rDesc.CharSet ); rFont.SetPitch( (FontPitch)rDesc.Pitch ); rFont.SetOrientation( (short)(rDesc.Orientation*10) ); - rFont.SetKerning( rDesc.Kerning ); + rFont.SetKerning( rDesc.Kerning ? FontKerning::FontSpecific : FontKerning::NONE ); rFont.SetWeight( VCLUnoHelper::ConvertFontWeight(rDesc.Weight) ); rFont.SetItalic( (FontItalic)rDesc.Slant ); rFont.SetUnderline( (FontUnderline)rDesc.Underline ); diff --git a/include/vcl/fntstyle.hxx b/include/vcl/fntstyle.hxx index e2fc652..481d0a2 100644 --- a/include/vcl/fntstyle.hxx +++ b/include/vcl/fntstyle.hxx @@ -21,12 +21,20 @@ #define INCLUDED_VCL_FNTSTYLE_HXX #include <sal/types.h> +#include <o3tl/typed_flags_set.hxx> enum FontRelief { RELIEF_NONE, RELIEF_EMBOSSED, RELIEF_ENGRAVED, FontRelief_FORCE_EQUAL_SIZE=SAL_MAX_ENUM }; -typedef sal_uInt8 FontKerning; -#define KERNING_FONTSPECIFIC ((FontKerning)0x01) -#define KERNING_ASIAN ((FontKerning)0x02) +enum class FontKerning +{ + NONE = 0x00, + FontSpecific = 0x01, + Asian = 0x02, +}; +namespace o3tl +{ + template<> struct typed_flags<FontKerning> : is_typed_flags<FontKerning, 0x03> {}; +} #endif // INCLUDED_VCL_FNTSTYLE_HXX diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 35b992a..e78f3a8 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -117,7 +117,7 @@ vcl::Font ImplCreateFont( const ::com::sun::star::awt::FontDescriptor& rDescr ) aFont.SetUnderline( (::FontUnderline)rDescr.Underline ); aFont.SetStrikeout( (::FontStrikeout)rDescr.Strikeout ); aFont.SetOrientation( (sal_Int16)rDescr.Orientation ); - aFont.SetKerning( rDescr.Kerning ); + aFont.SetKerning( static_cast<FontKerning>(rDescr.Kerning) ); aFont.SetWordLineMode( rDescr.WordLineMode ); return aFont; } diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 14cb4c8..266c5c5 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -98,7 +98,7 @@ class SwSubFont : public SvxFont inline void SetOutline( const bool bOutline ); inline void SetVertical( const sal_uInt16 nDir, const bool bVertFormat ); inline void SetShadow( const bool bShadow ); - inline void SetAutoKern( const sal_uInt8 nAutoKern ); + inline void SetAutoKern( FontKerning nAutoKern ); inline void SetWordLineMode( const bool bWordLineMode ); inline void SetEmphasisMark( const FontEmphasisMark eValue ); inline void SetRelief( const FontRelief eNew ); @@ -224,7 +224,7 @@ public: inline void SetOutline( const bool bOutline ); void SetVertical( sal_uInt16 nDir, const bool nVertLayout = false ); inline void SetShadow( const bool bShadow ); - inline void SetAutoKern( sal_uInt8 nAutoKern ); + inline void SetAutoKern( FontKerning nAutoKern ); inline void SetTransparent( const bool bTrans ); inline void SetWordLineMode( const bool bWordLineMode ); inline void SetFixKerning( const short nNewKern ); @@ -668,18 +668,18 @@ inline void SwFont::SetShadow( const bool bShadow ) } // encapsulated SV-Font-method -inline void SwSubFont::SetAutoKern( const sal_uInt8 nAutoKern ) +inline void SwSubFont::SetAutoKern( FontKerning nAutoKern ) { pMagic = 0; Font::SetKerning( nAutoKern ); } -inline void SwFont::SetAutoKern( sal_uInt8 nAutoKern ) +inline void SwFont::SetAutoKern( FontKerning nAutoKern ) { bFntChg = true; aSub[1].SetAutoKern( nAutoKern ); - if( nAutoKern ) - nAutoKern = KERNING_FONTSPECIFIC; + if( nAutoKern != FontKerning::NONE ) + nAutoKern = FontKerning::FontSpecific; aSub[0].SetAutoKern( nAutoKern ); aSub[2].SetAutoKern( nAutoKern ); } diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index 80f2dee..e3cbe00 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -727,11 +727,11 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush ) { rFnt.SetAutoKern( ( !mpIDocumentSettingAccess || !mpIDocumentSettingAccess->get(DocumentSettingId::KERN_ASIAN_PUNCTUATION) ) ? - KERNING_FONTSPECIFIC : - KERNING_ASIAN ); + FontKerning::FontSpecific : + FontKerning::Asian ); } else - rFnt.SetAutoKern( 0 ); + rFnt.SetAutoKern( FontKerning::NONE ); break; case RES_CHRATR_BLINK : rFnt.SetBlink( static_cast<const SvxBlinkItem&>(rItem).GetValue() ); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index a344a7e..0bf13eb 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -1574,7 +1574,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) // In case of Pair Kerning the printer influence on the positioning // grows - const int nMul = pPrtFont->GetKerning() ? 1 : 3; + const int nMul = pPrtFont->GetKerning() != FontKerning::NONE ? 1 : 3; const int nDiv = nMul+1; // nSpaceSum contains the sum of the intermediate space distributed @@ -1927,7 +1927,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) // In case of Pair Kerning the printer influence on the positioning // grows - const int nMul = pPrtFont->GetKerning() ? 1 : 3; + const int nMul = pPrtFont->GetKerning() != FontKerning::NONE ? 1 : 3; const int nDiv = nMul+1; for( sal_Int32 i = 1; i<nCnt; i++ ) { diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 4849954..c794956 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -626,11 +626,11 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { SetAutoKern( ( !pIDocumentSettingAccess || !pIDocumentSettingAccess->get(DocumentSettingId::KERN_ASIAN_PUNCTUATION) ) ? - KERNING_FONTSPECIFIC : - KERNING_ASIAN ); + FontKerning::FontSpecific : + FontKerning::Asian ); } else - SetAutoKern( 0 ); + SetAutoKern( FontKerning::NONE ); } if( SfxItemState::SET == pAttrSet->GetItemState( RES_CHRATR_WORDLINEMODE, true, &pItem )) @@ -826,11 +826,11 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, { SetAutoKern( ( !pIDocumentSettingAccess || !pIDocumentSettingAccess->get(DocumentSettingId::KERN_ASIAN_PUNCTUATION) ) ? - KERNING_FONTSPECIFIC : - KERNING_ASIAN ); + FontKerning::FontSpecific : + FontKerning::Asian ); } else - SetAutoKern( 0 ); + SetAutoKern( FontKerning::NONE ); SetWordLineMode( pAttrSet->GetWordLineMode().GetValue() ); const SvxEscapementItem &rEsc = pAttrSet->GetEscapement(); SetEscapement( rEsc.GetEsc() ); diff --git a/toolkit/source/helper/vclunohelper.cxx b/toolkit/source/helper/vclunohelper.cxx index 005cacc..d8245c8 100644 --- a/toolkit/source/helper/vclunohelper.cxx +++ b/toolkit/source/helper/vclunohelper.cxx @@ -412,7 +412,7 @@ vcl::Font VCLUnoHelper::CreateFont( const ::com::sun::star::awt::FontDescriptor& // Kein DONTKNOW aFont.SetOrientation( (short)rDescr.Orientation ); - aFont.SetKerning( rDescr.Kerning ); + aFont.SetKerning( static_cast<FontKerning>(rDescr.Kerning) ); aFont.SetWordLineMode( rDescr.WordLineMode ); return aFont; diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx index 5dd22f3..f8a1c83 100644 --- a/vcl/source/gdi/font.cxx +++ b/vcl/source/gdi/font.cxx @@ -56,7 +56,7 @@ Impl_Font::Impl_Font() : meRelief = RELIEF_NONE; meEmphasisMark = EMPHASISMARK_NONE; mnOrientation = 0; - mnKerning = 0; + mnKerning = FontKerning::NONE; mbWordLine = false; mbOutline = false; mbShadow = false; @@ -450,7 +450,7 @@ void Font::SetKerning( FontKerning nKerning ) bool Font::IsKerning() const { - return (mpImplFont->mnKerning & KERNING_FONTSPECIFIC) != 0; + return bool(mpImplFont->mnKerning & FontKerning::FontSpecific); } void Font::SetWeight( FontWeight eWeight ) @@ -637,7 +637,7 @@ void Font::Merge( const vcl::Font& rFont ) SetOrientation( rFont.GetOrientation() ); SetVertical( rFont.IsVertical() ); SetEmphasisMark( rFont.GetEmphasisMark() ); - SetKerning( rFont.IsKerning() ? KERNING_FONTSPECIFIC : 0 ); + SetKerning( rFont.IsKerning() ? FontKerning::FontSpecific : FontKerning::NONE ); SetOutline( rFont.IsOutline() ); SetShadow( rFont.IsShadow() ); SetRelief( rFont.GetRelief() ); @@ -681,7 +681,7 @@ SvStream& ReadImpl_Font( SvStream& rIStm, Impl_Font& rImpl_Font ) rIStm.ReadCharAsBool( bTmp ); rImpl_Font.mbWordLine = bTmp; rIStm.ReadCharAsBool( bTmp ); rImpl_Font.mbOutline = bTmp; rIStm.ReadCharAsBool( bTmp ); rImpl_Font.mbShadow = bTmp; - rIStm.ReadUChar( nTmp8 ); rImpl_Font.mnKerning = nTmp8; + rIStm.ReadUChar( nTmp8 ); rImpl_Font.mnKerning = static_cast<FontKerning>(nTmp8); if( aCompat.GetVersion() >= 2 ) { @@ -722,7 +722,7 @@ SvStream& WriteImpl_Font( SvStream& rOStm, const Impl_Font& rImpl_Font ) rOStm.WriteBool( rImpl_Font.mbWordLine ); rOStm.WriteBool( rImpl_Font.mbOutline ); rOStm.WriteBool( rImpl_Font.mbShadow ); - rOStm.WriteUChar( rImpl_Font.mnKerning ); + rOStm.WriteUChar( static_cast<sal_uInt8>(rImpl_Font.mnKerning) ); // new in version 2 rOStm.WriteUChar( rImpl_Font.meRelief ); diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 2d9dd97..eefa320 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -207,7 +207,7 @@ FontMetric OutputDevice::GetFontMetric() const else aMetric.SetOrientation( pMetric->mnOrientation ); if( !pEntry->maMetric.mbKernableFont ) - aMetric.SetKerning( maFont.GetKerning() & ~KERNING_FONTSPECIFIC ); + aMetric.SetKerning( maFont.GetKerning() & ~FontKerning::FontSpecific ); // set remaining metric fields aMetric.mpImplMetric->mnMiscFlags = 0; @@ -1584,7 +1584,7 @@ bool OutputDevice::ImplNewFont() const } // enable kerning array if requested - if ( maFont.GetKerning() & KERNING_FONTSPECIFIC ) + if ( maFont.GetKerning() & FontKerning::FontSpecific ) { // TODO: test if physical font supports kerning and disable if not if( pFontEntry->maMetric.mbKernableFont ) @@ -1592,7 +1592,7 @@ bool OutputDevice::ImplNewFont() const } else mbKerning = false; - if ( maFont.GetKerning() & KERNING_ASIAN ) + if ( maFont.GetKerning() & FontKerning::Asian ) mbKerning = true; // calculate EmphasisArea diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 9dc3aa5..d371f8e 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -1229,7 +1229,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, if( mbKerning ) nLayoutFlags |= SAL_LAYOUT_KERNING_PAIRS; - if( maFont.GetKerning() & KERNING_ASIAN ) + if( maFont.GetKerning() & FontKerning::Asian ) nLayoutFlags |= SAL_LAYOUT_KERNING_ASIAN; if( maFont.IsVertical() ) nLayoutFlags |= SAL_LAYOUT_VERTICAL; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits