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 c87e0c332cc323a07e2f21ca33bacaf09aceee17
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Thu Apr 27 15:59:43 2023 -0400
Commit:     Henry Castro <hcas...@collabora.com>
CommitDate: Tue May 2 21:03:33 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

diff --git a/editeng/source/editeng/editview.cxx 
b/editeng/source/editeng/editview.cxx
index c522201ff917..72be1c9e4026 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1730,6 +1730,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 db71098c2590..461cbcd16faf 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -2746,4 +2746,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 67f98cf2cef3..fb5d18badbc3 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -234,6 +234,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:
@@ -244,6 +247,7 @@ private:
     tools::Rectangle maOutArea;
     Point maVisDocStartPos;
     MapUnit meUnit;
+    LOKSpecialFlags meFlags;
 };
 
 
@@ -467,6 +471,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 02a120cc9b07..005b02edf667 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -87,6 +87,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
@@ -379,6 +389,8 @@ public:
     tools::Rectangle GetLOKSpecialVisArea() const;
     bool HasLOKSpecialPositioning() const;
 
+    void SetLOKSpecialFlags(LOKSpecialFlags eFlags);
+
     void SuppressLOKMessages(bool bSet);
     bool IsSuppressLOKMessages() const;
 

Reply via email to