svx/source/sdr/contact/viewcontactofsdrpathobj.cxx |    3 ++-
 sw/source/core/text/itrform2.cxx                   |   14 +++++++++++---
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit df461b42126e440492fc919d2b1b2d6649962a90
Author:     Hossein <hoss...@libreoffice.org>
AuthorDate: Mon Apr 17 13:17:00 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed May 3 10:03:20 2023 +0200

    tdf#152246 Fix RTL content control field position
    
    With this patch, the horizonal position of the content control fields
    are corrected. Previously, they were calculated just like the fields in
    the LTR paragraphs. To implement this, I've used the
    GetTextFrame()->SwitchLTRtoRTL method.
    
    The remaining issue is that The exported fileds in the PDF are still LTR
    themselves. For example, the combo box will still be LTR.
    
    It should be pointed that handling vertical text is still an issue that
    should be addressed later. If you rotate the paragraph with content
    control field, the output does not obey, which is incorrect.
    
    Change-Id: I927d14f9ca90434b4397dcf175dbb9531dda0c7c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150515
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit 1466e2a58f40c869d8c2590a4479e85c093b3468)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151270
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index ea420b0a0b30..ab31c524ba40 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -1064,11 +1064,19 @@ bool SwContentControlPortion::DescribePDFControl(const 
SwTextPaintInfo& rInf) co
     auto pTextFrame = const_cast<SwTextFrame*>(rInf.GetTextFrame());
     SwTextSizeInfo aInf(pTextFrame);
     SwTextCursor aLine(pTextFrame, &aInf);
-    SwRect aStartRect;
+    SwRect aStartRect, aEndRect;
     aLine.GetCharRect(&aStartRect, nViewStart);
-    aLocation = aStartRect;
-    SwRect aEndRect;
     aLine.GetCharRect(&aEndRect, nViewEnd);
+
+    // Handling RTL text direction
+    if(rInf.GetTextFrame()->IsRightToLeft())
+    {
+        rInf.GetTextFrame()->SwitchLTRtoRTL( aStartRect );
+        rInf.GetTextFrame()->SwitchLTRtoRTL( aEndRect );
+    }
+    // TODO: handle rInf.GetTextFrame()->IsVertical()
+
+    aLocation = aStartRect;
     aLocation.Union(aEndRect);
     pDescriptor->Location = aLocation.SVRect();
 
commit baa397e9b7e2978602a8fe17421d6e9908145108
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Tue May 2 14:03:55 2023 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed May 3 10:03:13 2023 +0200

    fix mistake in commit "optimise ensureGeometry"
    
    In
        commit bfe32f3e50b5406810e740ac41368f101033e766
        Author: Noel Grandin <noel.gran...@collabora.co.uk>
        Date:   Wed Jan 12 20:51:39 2022 +0200
        optimise ensureGeometry
    
    I got the return value wrong for the early exit case.
    I am quite surprised this did not mess up something
    in the drawinglayer line handling.
    
    Change-Id: I6788ef8898575c89344f25f6e66c4ae0a999f013
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151268
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit 7a2435b4ae52bbbe8bd7d0fd0cf6a32ee42aac98)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151277
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx 
b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
index e2644489d6d1..0a03ace32df8 100644
--- a/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrpathobj.cxx
@@ -52,8 +52,9 @@ namespace sdr::contact
             for(auto const& rPolygon : std::as_const(rUnitPolyPolygon))
             {
                 nPointCount += rPolygon.count();
+                // return early if we definitely have geometry
                 if (nPointCount > 1)
-                    return false;
+                    return nPolyCount == 1;
             }
 
             if(!nPointCount)

Reply via email to