editeng/source/editeng/editview.cxx | 5 +++++ editeng/source/editeng/impedit.cxx | 6 ++++++ editeng/source/editeng/impedit.hxx | 6 ++++++ include/editeng/editview.hxx | 12 ++++++++++++ 4 files changed, 29 insertions(+)
New commits: commit baf500ba9abed7f32439a1be60a1c51cc10f9d67 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Apr 27 15:59:43 2023 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Tue Jun 20 14:37:35 2023 +0200 lok: editeng: add LOK special flags The function "IsRightToLeft" fails in Hebrew language when Calc has a layout RTL, create a special flag to handle. Signed-off-by: Henry Castro <hcas...@collabora.com> Change-Id: I661f49dc5990f39807c6dba10970dea8c502643c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151145 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151971 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153322 Tested-by: Jenkins diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx index f6c90309747c..72e9aec2dc3d 100644 --- a/editeng/source/editeng/editview.cxx +++ b/editeng/source/editeng/editview.cxx @@ -1727,6 +1727,11 @@ bool EditView::HasLOKSpecialPositioning() const return pImpEditView->HasLOKSpecialPositioning(); } +void EditView::SetLOKSpecialFlags(LOKSpecialFlags eFlags) +{ + pImpEditView->SetLOKSpecialFlags(eFlags); +} + void EditView::SuppressLOKMessages(bool bSet) { pImpEditView->SuppressLOKMessages(bSet); diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 3074ca53d1ad..98ac03aceab6 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -2749,4 +2749,10 @@ bool ImpEditView::HasLOKSpecialPositioning() const return bool(mpLOKSpecialPositioning); } +void ImpEditView::SetLOKSpecialFlags(LOKSpecialFlags eFlags) +{ + assert(mpLOKSpecialPositioning); + mpLOKSpecialPositioning->SetFlags(eFlags); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index a5e2e3c89593..1a8f7fdc48f4 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -233,6 +233,9 @@ public: Point GetWindowPos(const Point& rDocPos, MapUnit eDocPosUnit) const; tools::Rectangle GetWindowPos(const tools::Rectangle& rDocRect, MapUnit eDocRectUnit) const; + void SetFlags(LOKSpecialFlags eFlags) { meFlags = eFlags; } + bool IsLayoutRTL() { return bool(meFlags & LOKSpecialFlags::LayoutRTL); } + Point GetRefPoint() const; private: @@ -243,6 +246,7 @@ private: tools::Rectangle maOutArea; Point maVisDocStartPos; MapUnit meUnit; + LOKSpecialFlags meFlags; }; @@ -466,6 +470,8 @@ public: tools::Rectangle GetLOKSpecialVisArea() const; bool HasLOKSpecialPositioning() const; + void SetLOKSpecialFlags(LOKSpecialFlags eFlags); + void SuppressLOKMessages(bool bSet) { mbSuppressLOKMessages = bSet; } bool IsSuppressLOKMessages() const { return mbSuppressLOKMessages; } diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx index 73d4c23f49a9..1ea777eb7d91 100644 --- a/include/editeng/editview.hxx +++ b/include/editeng/editview.hxx @@ -86,6 +86,16 @@ enum class ScrollRangeCheck PaperWidthTextSize = 2, // VisArea must be within paper width, Text Size }; +enum class LOKSpecialFlags { + NONE = 0x0000, + LayoutRTL = 0x0001, +}; + +namespace o3tl +{ + template<> struct typed_flags<LOKSpecialFlags> : is_typed_flags<LOKSpecialFlags, 0x77> {}; +} + // Helper class that allows to set a callback at the EditView. When // set, Invalidates and repaints are suppressed at the EditView, but // EditViewInvalidate() will be triggered to allow the consumer to @@ -377,6 +387,8 @@ public: tools::Rectangle GetLOKSpecialVisArea() const; bool HasLOKSpecialPositioning() const; + void SetLOKSpecialFlags(LOKSpecialFlags eFlags); + void SuppressLOKMessages(bool bSet); bool IsSuppressLOKMessages() const;