Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


Hello,
This is my patch for bug 73588. Currently when working in RTL mode in calc
if a user wrote in a language that was written from left to right, calc
failed to automatically left align the text as it had in previous versions.
To fix this, I've added a statement that checks that the cell begins with a
RTL character before right aligning it. I've attached my patch. Let me know
if there's anything I need to change.

Thank you
Hannah
From fef47ce123eb8f7b6fe4486e93d6f2a690302ebf Mon Sep 17 00:00:00 2001
From: hannah <hdlyhne1@gmail.com>
Date: Tue, 1 Apr 2014 07:55:39 -0400
Subject: [PATCH] Bug fix for 73588; fix default alignment in RTL mode

Change-Id: Icb932ee51dbf32d8baf4382aa00e89a680f5a41d
---
 sc/source/ui/view/output2.cxx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 54f977c..9005e48 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1434,7 +1434,10 @@ static SvxCellHorJustify getAlignmentFromContext( SvxCellHorJustify 
eInHorJust,
         else if (nDirection == FRMDIR_ENVIRONMENT)
         {
             SAL_WARN_IF( !pDoc, "sc.ui", "getAlignmentFromContext - pDoc==NULL");
-            eHorJustContext = (pDoc && pDoc->IsLayoutRTL(nTab)) ? SVX_HOR_JUSTIFY_RIGHT : 
SVX_HOR_JUSTIFY_LEFT;
+            // fdo#73588: The content of the cell must also
+            // begin with a RTL character to be right
+            // aligned; otherwise, it should be left aligned.
+            eHorJustContext = (pDoc && pDoc->IsLayoutRTL(nTab) && (beginsWithRTLCharacter( 
rText))) ? SVX_HOR_JUSTIFY_RIGHT : SVX_HOR_JUSTIFY_LEFT;
         }
         else
             eHorJustContext = SVX_HOR_JUSTIFY_RIGHT;
-- 
1.8.1.2


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.