[Libreoffice-commits] core.git: editeng/source include/vcl sw/source vcl/source vcl/unx
editeng/source/editeng/impedit3.cxx |2 ++ include/vcl/commandevent.hxx| 19 ++- sw/source/core/text/redlnitr.cxx|2 ++ vcl/source/control/edit.cxx |2 ++ vcl/source/edit/texteng.cxx |2 ++ vcl/unx/gtk3/gtkframe.cxx | 13 +++-- 6 files changed, 29 insertions(+), 11 deletions(-) New commits: commit d1cd19b56d5fefaa6f41a4d70e748331525820a4 Author: Caolán McNamara AuthorDate: Thu Nov 3 10:21:59 2022 + Commit: Caolán McNamara CommitDate: Thu Nov 3 20:48:37 2022 +0100 Related: tdf#149932 honour PANGO_UNDERLINE_DOUBLE for preedit underline we already have support for double underline so that's an easy add Change-Id: I1bba5620038e396765bd79050ff6a520096f9476 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142223 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index f932fd0df8ed..2d2a339658df 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -3061,6 +3061,8 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ]; if ( nAttr & ExtTextInputAttr::Underline ) rFont.SetUnderline( LINESTYLE_SINGLE ); +else if ( nAttr & ExtTextInputAttr::DoubleUnderline ) +rFont.SetUnderline( LINESTYLE_DOUBLE ); else if ( nAttr & ExtTextInputAttr::BoldUnderline ) rFont.SetUnderline( LINESTYLE_BOLD ); else if ( nAttr & ExtTextInputAttr::DottedUnderline ) diff --git a/include/vcl/commandevent.hxx b/include/vcl/commandevent.hxx index d5b043ddb97a..fc6ba290793f 100644 --- a/include/vcl/commandevent.hxx +++ b/include/vcl/commandevent.hxx @@ -48,18 +48,19 @@ enum class CommandEventId; enum class ExtTextInputAttr { NONE = 0x, -GrayWaveline = 0x0100, -Underline = 0x0200, -BoldUnderline = 0x0400, -DottedUnderline = 0x0800, -DashDotUnderline = 0x1000, -Highlight = 0x2000, -RedText = 0x4000, -HalfToneText = 0x8000 +GrayWaveline = 0x0010, +Underline = 0x0020, +BoldUnderline = 0x0040, +DottedUnderline = 0x0080, +DashDotUnderline = 0x0100, +DoubleUnderline = 0x0200, +Highlight = 0x0400, +RedText = 0x0800, +HalfToneText = 0x1000 }; namespace o3tl { -template<> struct typed_flags : is_typed_flags {}; +template<> struct typed_flags : is_typed_flags {}; } #define EXTTEXTINPUT_CURSOR_INVISIBLE (sal_uInt16(0x0001)) diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index 2b8c11693d20..2b77d86aa350 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -1049,6 +1049,8 @@ void SwExtend::ActualizeFont( SwFont , ExtTextInputAttr nAttr ) { if ( nAttr & ExtTextInputAttr::Underline ) rFnt.SetUnderline( LINESTYLE_SINGLE ); +else if ( nAttr & ExtTextInputAttr::DoubleUnderline ) +rFnt.SetUnderline( LINESTYLE_DOUBLE ); else if ( nAttr & ExtTextInputAttr::BoldUnderline ) rFnt.SetUnderline( LINESTYLE_BOLD ); else if ( nAttr & ExtTextInputAttr::DottedUnderline ) diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 1554f846ba95..a072a42ec467 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -639,6 +639,8 @@ void Edit::ImplRepaint(vcl::RenderContext& rRenderContext, const tools::Rectangl vcl::Font aFont = rRenderContext.GetFont(); if (nAttr & ExtTextInputAttr::Underline) aFont.SetUnderline(LINESTYLE_SINGLE); +else if (nAttr & ExtTextInputAttr::DoubleUnderline) +aFont.SetUnderline(LINESTYLE_DOUBLE); else if (nAttr & ExtTextInputAttr::BoldUnderline) aFont.SetUnderline( LINESTYLE_BOLD); else if (nAttr & ExtTextInputAttr::DottedUnderline) diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index 75d6085859e3..90140a58df11 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -1382,6 +1382,8 @@ void TextEngine::SeekCursor( sal_uInt32 nPara, sal_Int32 nPos, vcl::Font& rFont, ExtTextInputAttr nAttr = mpIMEInfos->pAttribs[ nPos - mpIMEInfos->aPos.GetIndex() - 1 ]; if ( nAttr & ExtTextInputAttr::Underline ) rFont.SetUnderline( LINESTYLE_SINGLE ); +else if ( nAttr & ExtTextInputAttr::DoubleUnderline ) +rFont.SetUnderline( LINESTYLE_DOUBLE ); else if ( nAttr & ExtTextInputAttr::BoldUnderline ) rFont.SetUnderline(
[Libreoffice-commits] core.git: editeng/source include/vcl sw/source vcl/source
editeng/source/editeng/editview.cxx |2 +- include/vcl/menu.hxx |9 + sw/source/uibase/inc/olmenu.hxx |2 +- sw/source/uibase/uiview/viewling.cxx |7 +-- vcl/source/window/menu.cxx |9 - 5 files changed, 24 insertions(+), 5 deletions(-) New commits: commit 8938e8b153f32f3f5926baddb87cb76c8e72755a Author: Jan HolesovskyDate: Thu Mar 8 21:07:40 2018 +0100 lokdialog: Tunnel the spell-checking context menu with recommendations. Change-Id: I1a7952e88a3f89346c97d2516628b4a7a0423de6 Reviewed-on: https://gerrit.libreoffice.org/51062 Reviewed-by: pranavk Tested-by: pranavk Reviewed-on: https://gerrit.libreoffice.org/51166 Tested-by: Jenkins Reviewed-by: Jan Holesovsky diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index 22b66cbce8c2..6e1d4ec481a1 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1025,7 +1025,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, LinkpEditEngine->pImpEditEngine->CreateEPaM(aPaM); EPaM aP2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEPaM(aPaM2); -sal_uInt16 nId = aPopupMenu->Execute( pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose ); +sal_uInt16 nId = aPopupMenu->Execute(pImpEditView->GetWindow(), aTempRect, PopupMenuFlags::NoMouseUpClose); aPaM2 = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP2); aPaM = pImpEditView->pEditEngine->pImpEditEngine->CreateEditPaM(aP); diff --git a/include/vcl/menu.hxx b/include/vcl/menu.hxx index 3ada2762fb6a..06a2e38680c6 100644 --- a/include/vcl/menu.hxx +++ b/include/vcl/menu.hxx @@ -60,6 +60,7 @@ namespace vcl class Window; struct MenuLayoutData; typedef OutputDevice RenderContext; // same as in include/vcl/outdev.hxx +class ILibreOfficeKitNotifier; } #define MENU_APPEND(sal_uInt16(0x)) @@ -483,6 +484,8 @@ class VCL_DLLPUBLIC PopupMenu : public Menu friend struct MenuItemData; private: +const vcl::ILibreOfficeKitNotifier* mpLOKNotifier; ///< To emit the LOK callbacks eg. for dialog tunneling. + SAL_DLLPRIVATE MenuFloatingWindow * ImplGetFloatingWindow() const; protected: @@ -517,6 +520,12 @@ public: static bool IsInExecute(); static PopupMenu* GetActivePopupMenu(); +/// Interface to register for dialog / window tunneling. +void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier* pNotifier) +{ +mpLOKNotifier = pNotifier; +} + PopupMenu& operator=( const PopupMenu& rMenu ); }; diff --git a/sw/source/uibase/inc/olmenu.hxx b/sw/source/uibase/inc/olmenu.hxx index a407f618810f..d37eb2edbfb5 100644 --- a/sw/source/uibase/inc/olmenu.hxx +++ b/sw/source/uibase/inc/olmenu.hxx @@ -128,7 +128,7 @@ public: ~SwSpellPopup(); -Menu& GetMenu() +PopupMenu& GetMenu() { return *m_xPopupMenu.get(); } diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index b59abdc05042..8ac2ccd217de 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -710,11 +711,10 @@ bool SwView::ExecSpellPopup(const Point& rPt) aEvent.ExecutePosition.Y = aPixPos.Y(); ScopedVclPtr pMenu; -OUString sMenuName = bUseGrammarContext ? +OUString sMenuName = bUseGrammarContext ? OUString("private:resource/GrammarContextMenu") : OUString("private:resource/SpellContextMenu"); if (TryContextMenuInterception(xPopup->GetMenu(), sMenuName, pMenu, aEvent)) { - //! happy hacking for context menu modifying extensions of this //! 'custom made' menu... *sigh* (code copied from sfx2 and framework) if ( pMenu ) @@ -762,6 +762,9 @@ bool SwView::ExecSpellPopup(const Point& rPt) } else { +if (comphelper::LibreOfficeKit::isActive()) + xPopup->GetMenu().SetLOKNotifier(SfxViewShell::Current()); + xPopup->Execute(aToFill.SVRect(), m_pEditWin); } } diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index b4ab69cccfee..6c6c4715047e 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -40,6 +41,7 @@ #include #include #include +#include #include #include @@ -2672,12 +2674,14 @@ MenuFloatingWindow *
[Libreoffice-commits] core.git: editeng/source include/vcl sw/source vcl/source
editeng/source/editeng/impedit.cxx |6 +++--- include/vcl/cursor.hxx | 14 -- sw/source/core/crsr/viscrs.cxx |6 +++--- vcl/source/window/cursor.cxx | 16 4 files changed, 22 insertions(+), 20 deletions(-) New commits: commit 3fd5f8919ec2256c70ff26c14cb9f8065c5cb2f1 Author: Noel Grandin n...@peralex.com Date: Thu May 7 17:06:34 2015 +0200 convert CURSOR_DIRECTION constants to scoped enum Change-Id: I444c61d0073b12740b55e316b2bb6e34f59dfe21 Reviewed-on: https://gerrit.libreoffice.org/15675 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Noel Grandin noelgran...@gmail.com diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 3d126ba..3f31452 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -942,16 +942,16 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor, sal_uInt16 libreOfficeKitCallback(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, sRect.getStr()); } -unsigned char nCursorDir = CURSOR_DIRECTION_NONE; +CursorDirection nCursorDir = CursorDirection::NONE; if ( IsInsertMode() !aEditSelection.HasRange() ( pEditEngine-pImpEditEngine-HasDifferentRTLLevels( aPaM.GetNode() ) ) ) { sal_uInt16 nTextPortion = pParaPortion-GetTextPortions().FindPortion( aPaM.GetIndex(), nTextPortionStart, (nShowCursorFlags GETCRSR_PREFERPORTIONSTART) != 0 ); const TextPortion* pTextPortion = pParaPortion-GetTextPortions()[nTextPortion]; sal_uInt16 nRTLLevel = pTextPortion-GetRightToLeft(); if ( nRTLLevel%2 ) -nCursorDir = CURSOR_DIRECTION_RTL; +nCursorDir = CursorDirection::RTL; else -nCursorDir = CURSOR_DIRECTION_LTR; +nCursorDir = CursorDirection::LTR; } GetCursor()-SetDirection( nCursorDir ); diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx index c56ef3c..3a1127e 100644 --- a/include/vcl/cursor.hxx +++ b/include/vcl/cursor.hxx @@ -31,9 +31,11 @@ namespace vcl { class Window; } // Cursor styles #define CURSOR_SHADOW ((sal_uInt16)0x0001) -#define CURSOR_DIRECTION_NONE ((unsigned char)0x00) -#define CURSOR_DIRECTION_LTR((unsigned char)0x01) -#define CURSOR_DIRECTION_RTL((unsigned char)0x02) + +enum class CursorDirection +{ +NONE, LTR, RTL +}; namespace vcl { @@ -49,7 +51,7 @@ private: short mnOrientation; sal_uInt16 mnStyle; boolmbVisible; -unsigned char mnDirection; +CursorDirection mnDirection; public: SAL_DLLPRIVATE void ImplDraw(); @@ -90,8 +92,8 @@ public: voidSetOrientation( short nOrientation = 0 ); short GetOrientation() const { return mnOrientation; } -voidSetDirection( unsigned char nDirection = 0 ); -unsigned char GetDirection() const { return mnDirection; } +voidSetDirection( CursorDirection nDirection = CursorDirection::NONE ); +CursorDirection GetDirection() const { return mnDirection; } Cursor operator=( const Cursor rCursor ); booloperator==( const Cursor rCursor ) const; diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index b30639d..991c554 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -128,7 +128,7 @@ void SwVisCrsr::_SetPosAndShow() } // check if cursor should show the current cursor bidi level -m_aTxtCrsr.SetDirection( CURSOR_DIRECTION_NONE ); +m_aTxtCrsr.SetDirection( CursorDirection::NONE ); const SwCursor* pTmpCrsr = m_pCrsrShell-_GetCrsr(); if ( pTmpCrsr !m_pCrsrShell-IsOverwriteCrsr() ) @@ -146,8 +146,8 @@ void SwVisCrsr::_SetPosAndShow() { m_aTxtCrsr.SetDirection( ( pTmpCrsr-GetCrsrBidiLevel() % 2 ) ? - CURSOR_DIRECTION_RTL : - CURSOR_DIRECTION_LTR ); + CursorDirection::RTL : + CursorDirection::LTR ); } if ( pFrm-IsRightToLeft() ) { diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index c313001..bd96802 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -35,8 +35,8 @@ struct ImplCursorData SizemaPixSize; // Pixel-Size longmnPixSlant; // Pixel-Slant short mnOrientation; // Pixel-Orientation -unsigned char mnDirection;// indicates writing direction -sal_uInt16 mnStyle;// Cursor-Style +CursorDirection mnDirection;// indicates writing direction +sal_uInt16 mnStyle;