View Issue Details

IDProjectCategoryView StatusLast Update
0016034ScribusStory Editor / Text Framespublic2020-01-21 14:50
ReporterFahad Assigned ToFahad  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.5.6.svn 
Target VersionFixed in Version1.5.6.svn 
Summary0016034: First line indent doesn't work for single line RTL paragraph
DescriptionFollowing 0015106, there is one case I missed in last patch which is the indentation in one line only.

I propose a small patch for it.

TagsNo tags attached.
PatchYes

Activities

Fahad

2020-01-20 04:53

developer  

one-line-rtl-indentation (868 bytes)
From a587ec1d645f9ad49e1b75be56e661ea10fb0b10 Mon Sep 17 00:00:00 2001
From: Fahad Al-Saidi <fahad.alsaidi@gmail.com>
Date: Mon, 20 Jan 2020 06:42:52 +0400
Subject: fix right Indent when there is only one line


diff --git a/scribus/pageitem_textframe.cpp b/scribus/pageitem_textframe.cpp
index 2682adf4b..3a3d7d3af 100644
--- a/scribus/pageitem_textframe.cpp
+++ b/scribus/pageitem_textframe.cpp
@@ -2477,7 +2477,7 @@ void PageItem_TextFrame::layout()
 					regionMinY = qMax(0.0, current.lineData.y - current.lineData.ascent);
 					regionMaxY = current.lineData.y + current.lineData.descent;
 					EndX = current.endOfLine(m_availableRegion, style.rightMargin(), regionMinY, regionMaxY);
-					current.finishLine(EndX);
+					current.finishLine(EndX - current.rightIndent);
 					//addLine = true;
 					assert(current.addLine);
 					//current.startOfCol = false;

jghali

2020-01-20 11:21

administrator   ~0047340

Could you provide a sample document for my reference where this patch makes a difference?

Fahad

2020-01-20 19:31

developer   ~0047341

the sample attached, with screenshots of current & new behavior.

test-intend.sla (16,617 bytes)
current.png (288,981 bytes)
current.png (288,981 bytes)
new.png (380,369 bytes)
new.png (380,369 bytes)

jghali

2020-01-20 21:14

administrator   ~0047342

Thanks. When opening your document, I replaced the DejaVu Sans Book by Arial as I didn't have this font on my system. It then occured to me your patch was incomplete as in my case the first line indent was still not applied to the last paragraph. I had to modify line 2851 of pageitem_textframe.cpp in the same way you did with line 2480.

16034_rtl_first_line_indent_single_line_para.patch (991 bytes)
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 23448)
+++ scribus/pageitem_textframe.cpp	(working copy)
@@ -2477,7 +2477,7 @@
 					regionMinY = qMax(0.0, current.lineData.y - current.lineData.ascent);
 					regionMaxY = current.lineData.y + current.lineData.descent;
 					EndX = current.endOfLine(m_availableRegion, style.rightMargin(), regionMinY, regionMaxY);
-					current.finishLine(EndX);
+					current.finishLine(EndX - current.rightIndent);
 					//addLine = true;
 					assert(current.addLine);
 					//current.startOfCol = false;
@@ -2848,7 +2848,7 @@
 			}
 
 			EndX = current.endOfLine(m_availableRegion, style.rightMargin(), regionMinY, regionMaxY);
-			current.finishLine(EndX);
+			current.finishLine(EndX - current.rightIndent);
 
 			if (opticalMargins & ParagraphStyle::OM_RightHangingPunct)
 				current.lineData.width += current.opticalRightMargin(itemText);

jghali

2020-01-20 21:16

administrator   ~0047343

Patch applied with my additional fix!

Fahad

2020-01-21 02:32

developer   ~0047344

Thanks. I was hesitated to modify any new cases unless I encountered them.

Issue History

Date Modified Username Field Change
2020-01-20 04:53 Fahad New Issue
2020-01-20 04:53 Fahad File Added: one-line-rtl-indentation
2020-01-20 11:21 jghali Note Added: 0047340
2020-01-20 19:31 Fahad File Added: test-intend.sla
2020-01-20 19:31 Fahad File Added: current.png
2020-01-20 19:31 Fahad File Added: new.png
2020-01-20 19:31 Fahad Note Added: 0047341
2020-01-20 21:13 jghali Summary First line indent doesn't work RTL text in one line. => First line indent doesn't work for single line RTL paragraph
2020-01-20 21:14 jghali File Added: 16034_rtl_first_line_indent_single_line_para.patch
2020-01-20 21:14 jghali Note Added: 0047342
2020-01-20 21:15 jghali Assigned To => Fahad
2020-01-20 21:15 jghali Status new => resolved
2020-01-20 21:15 jghali Resolution open => fixed
2020-01-20 21:15 jghali Fixed in Version => 1.5.6.svn
2020-01-20 21:16 jghali Note Added: 0047343
2020-01-21 02:32 Fahad Note Added: 0047344
2020-01-21 14:50 jghali Product Version => 1.5.6.svn