View Issue Details

IDProjectCategoryView StatusLast Update
0013490ScribusStory Editor / Text Framespublic2015-11-18 18:09
Reporteraliyousuf Assigned Tocbradney  
PriorityhighSeveritytextReproducibilityalways
Status closedResolutionfixed 
Platformubuntu 14.04 
Product Version1.5.1svn 
Fixed in Version1.5.1svn 
Summary0013490: after inserting a footnote before an existing footnote the format of the new footnote text is wrong
Descriptioncreate doc
create text frame
insert paragraph
insert footnote in the middle of paragraph
type text for footnote
insert footnote in the first of paragraph
type text for footnote

Than see the size footnote character in the first of paragraph
TagsHOST-Oman, patch_tested_ok
PatchNo

Relationships

related to 0013092 new replace the current footnotes by in-frame footnotes 
child of 0012496 acknowledged Metabug: Marks & Footnotes & Weld (1.5.0.svn) 

Activities

aliyousuf

2015-11-03 11:09

reporter  

aliyousuf

2015-11-03 11:09

reporter  

aliyousuf

2015-11-03 11:30

reporter   ~0037175

I tried to give a solution for this issue.

Are superscript text in footnote important?

jghali

2015-11-03 12:20

administrator   ~0037176

>> Are superscript text in footnote important?

Yes, superscript is important.

aliyousuf

2015-11-03 13:08

reporter   ~0037181

why?

jghali

2015-11-03 13:21

administrator   ~0037182

Last edited: 2015-11-03 13:25

Because footnote indexes are usually layouted using superscript.

JLuc

2015-11-04 10:01

developer   ~0037213

I dont understand exactly your report. On your screenshots, both footnote looks the same size. What exactly is the issue ?

aliyousuf

2015-11-04 10:29

reporter  

problem.png (105,274 bytes)   
problem.png (105,274 bytes)   

aliyousuf

2015-11-04 11:06

reporter   ~0037214

that Image when apply the patch file
but look at the problem.png

ale

2015-11-04 13:49

manager   ~0037217

ok, it's now clear where the issue is!

i had a test at it and it's not related to the end of the paragraph...

i'll fix the title of this ticket.

JLuc

2015-11-04 14:56

developer   ~0037218

Last edited: 2015-11-04 15:20

I confirm the issue.

I tested the patch and found it's not OK
- in the footnote text, the recall of the note is not superscript anymore (the little "1)" in the footnote frame)
- when the 2nd note is inserted, it inserts 3 or 4 footnotes lines in the footnote frame at once !!

Not sure if patch is that bad, or if there's something wrong with my current source.

Cant somebody else test ?

aliyousouf : the footnote recall [ = little "1)" in the footnote frame ] should be superscript. Is it superscript when you test your patch ???

aliyousuf

2015-11-05 05:47

reporter   ~0037236

I tried to give a solution for this issue. please have a look to the patch

JLuc

2015-11-05 08:38

developer   ~0037239

Last edited: 2015-11-05 08:39

Aliyousouf : have you tested your new patch intensively ? Does it fix both of the issues i have found in your previous patch ? Have you found that it fixes all obvious issues related to guides management history recording and undo ? Have you found out that it doesnt introduce new issues ?

aliyousuf

2015-11-05 08:54

reporter   ~0037241

yes

aliyousuf

2015-11-05 08:55

reporter   ~0037242

you can check it

aliyousuf

2015-11-05 09:09

reporter   ~0037243

And I used "superscript" for all footnote indexes

aliyousuf

2015-11-05 09:14

reporter   ~0037244

the problem , there are an other style when insert footnote text
but I put "superscript" for all footnote text .

ale

2015-11-05 09:55

manager   ~0037245

mmm.. footnote text should not be superscript. only the mark...

aliyousuf

2015-11-06 17:11

reporter   ~0037286

ale,you mean that the first patch is correct

ale

2015-11-07 07:46

manager   ~0037296

hi aliyousuf,

as of yesterday discussion on irc, it seems that the issue is more complex than what can be fixed by a simple on/off switch in the code.

if you want, we can sit down (in a virtual way, of course!) and try to go through what happens in Scribus and what is in the code to figure out.

i can help you finding out what the problem is and how to solve it, but i want that it's you who does the research and the patch.
i can teach how to look for use cases that help you understand where to put your attention and what you can do there.

one of the bigger steps has already been done by you! you have found out where the given text is layouted.
now, we have to define what the issue exactly is and find out why the wrong result is given.

i estimate that it will take two to three more hours of fully concentrated work to get there.

if you're ready to dive into it, please ping me on irc and we will try to find a day and time when we can both be available for this!

aliyousuf

2015-11-09 06:49

reporter   ~0037332

If you look at the "pagitem_textframe.cpp" at line 1519 we can see this code:

           StyleFlag s(itemText.charStyle(a).effects());
                    if (mark->isType(MARKNoteMasterType))
                    {
                        if (nStyle->isSuperscriptInMaster())
                            s |= ScStyle_Superscript;
                        else
                            s &= ~ScStyle_Superscript;
                    }
                    else
                    {
                        if (nStyle->isSuperscriptInNote())
                            s |= ScStyle_Superscript;
                        else
                            s &= ~ScStyle_Superscript;
                    }
                    if (s != itemText.charStyle(a).effects())
                    {
                        CharStyle haveSuperscript;
                        haveSuperscript.setFeatures(s.featureList());
                        itemText.applyCharStyle(a, 1, haveSuperscript);
                    }

On the above code, the style of mark note characters are changed to superscript on both frames (master frame and note frame).

If we look at file "pagitem_textframe.cpp" at line 1621:

    CharStyle charStyle = ((itemText.text(a) != SpecialChars::PARSEP) ? itemText.charStyle(a) : style.charStyle());

On the above code, the style of characters on both frames (master frame and note frame) is applied. If we change this code to "CharStyle charStyle = style.charStyle();", superscript on footnote frame and master frame mark is not applied.

If we change this code to "CharStyle charStyle = itemText.charStyle(a);" the superscript will be applied to both, footnote frame text and master frame mark. Thus, I implemented this code to give all footnotes text superscript style.

    if (isNoteFrame())
    {
         StyleFlag s(itemText.charStyle(a).effects());
         s |= ScStyle_Superscript;
         CharStyle haveSuperscript;
         haveSuperscript.setFeatures(s.featureList());
        itemText.applyCharStyle(a, 1, haveSuperscript);
    }

ale

2015-11-09 10:19

manager   ~0037335

Last edited: 2015-11-09 10:57

aliyousuf, i don't think you're going in the right direction.

if i understand your code correctly you're only exploring the case that

- you have found the cause of the bug
- there is a single point where you need to make a switch and you get to the solution.

i don't think that the bug is simply in the part applying (or not) the superscript.
i have tried a few use cases and it seems that the bug is (at least also) at a different place.


the offer to discuss how to tackle this bug is still open. ping me on irc and we can make an appointment for a deeper discussion on the topic.

ale

2015-11-09 11:00

manager   ~0037338

sorry, aliyousuf, after re-reading your comment above, i think that you now are heading in a good direction.

checking the styles is a much better idea than focusing on the superscript.

i cannot judge your code (even if at first sight it does not look 100% to me), but the styles are for sure a part of the solution.

JLuc

2015-11-09 19:12

developer   ~0037354

please say in case there is a tested correct code to be tested.

please say also in case we should delete one of the wrong provided patch.

aliyousuf

2015-11-10 17:26

reporter   ~0037393

Last edited: 2015-11-11 05:26

please test my patch.
apply the second patch

JLuc

2015-11-10 21:27

developer   ~0037403

Last edited: 2015-11-10 21:32

Patch tested and NOT OK. With your patch, the whole footnote is superscript when only the footnote recall should be. AMOF ale allready tested your patch and said it was wrong and explained to you why on 2015-11-05 10:55 : « mmm.. footnote text should not be superscript. only the mark... » as can be seen http://bugs.scribus.net/view.php?id=13490#c37245 And AMOF you have not provided a new patch and your patch is now rejected for same reason.
:-(

If that's not clear to you, please look at http://www.atlantiswordprocessor.com/en/help/images/footnotes_35.png : text layout is kindof the expected default result.

Note that this is only the default result look, because notes styles are user-defined in the "Edit" > "Note styles" menu entry : this is where you define the styles to be applied for the notecall mark in the text and the noterecall mark in the footnote.
This is where "superscript" is choosen or not, for the mark in the text and/or in the footnote.
The "mark character style" should be applied only to the mark (= note recall), and the "Note paragraph style" should be applied to the whole note paragraph.

aliyousuf

2015-11-12 05:07

reporter  

issue.patch (759 bytes)   
Index: scribus/pageitem_textframe.cpp
===================================================================
--- scribus/pageitem_textframe.cpp	(revision 20548)
+++ scribus/pageitem_textframe.cpp	(working copy)
@@ -1618,6 +1618,14 @@
 			}
 			if (current.itemsInLine == 0)
 				opticalMargins = style.opticalMargins();
+			if (isNoteFrame() && !mark)
+			{
+				StyleFlag s(itemText.charStyle(a).effects());
+				s &= ~ScStyle_Superscript;
+				CharStyle haveSuperscript;
+				haveSuperscript.setFeatures(s.featureList());
+				itemText.applyCharStyle(a, 1, haveSuperscript);
+			}
 			CharStyle charStyle = ((itemText.text(a) != SpecialChars::PARSEP) ? itemText.charStyle(a) : style.charStyle());
 			chstr = ExpandToken(a);
 			int chstrLen = chstr.length();
issue.patch (759 bytes)   

aliyousuf

2015-11-12 05:11

reporter   ~0037439

JLuc,I do what you want?
I upload issue.patch file.
that is answer for this issue.

aliyousuf

2015-11-12 07:34

reporter   ~0037441

This is correct patch (issue.patch [^] (759 bytes) 2015-11-12 06:07)

JLuc

2015-11-12 09:46

developer   ~0037450

Yes it works now !

AliYousuf : thanks for going on and providing a fix.

Devs : please have a look and merge.

Kunda

2015-11-14 13:09

updater   ~0037477

Please test fix and report

Kunda

2015-11-18 18:09

updater   ~0037537

Fix committed by Craing in r20550
Patch proposed by aliyousuf :)
Thank you. Closing.

Issue History

Date Modified Username Field Change
2015-11-02 07:40 aliyousuf New Issue
2015-11-03 11:08 aliyousuf File Added: issue13490.patch
2015-11-03 11:09 aliyousuf File Added: Screenshot from 2015-11-03 14:57:54.png
2015-11-03 11:09 aliyousuf File Added: Screenshot from 2015-11-03 14:58:40.png
2015-11-03 11:30 aliyousuf Note Added: 0037175
2015-11-03 12:20 jghali Note Added: 0037176
2015-11-03 13:08 aliyousuf Note Added: 0037181
2015-11-03 13:21 jghali Note Added: 0037182
2015-11-03 13:25 jghali Note Edited: 0037182
2015-11-04 10:01 JLuc Note Added: 0037213
2015-11-04 10:29 aliyousuf File Added: problem.png
2015-11-04 11:06 aliyousuf Note Added: 0037214
2015-11-04 13:49 ale Note Added: 0037217
2015-11-04 13:50 ale Summary insert footnote in the middle of paragraph and insert footnote in the first of paragraph the size of character is different => after inserting a footnote before an existing footnote the format of the new footnote text is wrong
2015-11-04 14:56 JLuc Note Added: 0037218
2015-11-04 15:20 JLuc Note Edited: 0037218
2015-11-05 05:46 aliyousuf Tag Attached: HOST-Oman
2015-11-05 05:47 aliyousuf File Added: 0013490.patch
2015-11-05 05:47 aliyousuf Note Added: 0037236
2015-11-05 08:38 JLuc Note Added: 0037239
2015-11-05 08:39 JLuc Note Edited: 0037239
2015-11-05 08:54 aliyousuf Note Added: 0037241
2015-11-05 08:55 aliyousuf Note Added: 0037242
2015-11-05 09:09 aliyousuf Note Added: 0037243
2015-11-05 09:14 aliyousuf Note Added: 0037244
2015-11-05 09:55 ale Note Added: 0037245
2015-11-05 12:23 Kunda Sticky Issue No => Yes
2015-11-06 17:11 aliyousuf Note Added: 0037286
2015-11-07 07:46 ale Note Added: 0037296
2015-11-07 11:31 Kunda Relationship added related to 0013092
2015-11-09 06:49 aliyousuf Note Added: 0037332
2015-11-09 10:19 ale Note Added: 0037335
2015-11-09 10:56 ale Note Edited: 0037335
2015-11-09 10:57 ale Note Edited: 0037335
2015-11-09 11:00 ale Note Added: 0037338
2015-11-09 19:12 JLuc Note Added: 0037354
2015-11-10 17:26 aliyousuf Note Added: 0037393
2015-11-10 21:27 JLuc Note Added: 0037403
2015-11-10 21:28 JLuc Note Edited: 0037403
2015-11-10 21:32 JLuc Note Edited: 0037403
2015-11-11 05:26 aliyousuf Note Edited: 0037393
2015-11-12 05:07 aliyousuf File Added: issue.patch
2015-11-12 05:11 aliyousuf Note Added: 0037439
2015-11-12 07:34 aliyousuf Note Added: 0037441
2015-11-12 09:43 JLuc File Deleted: issue13490.patch
2015-11-12 09:43 JLuc File Deleted: 0013490.patch
2015-11-12 09:46 JLuc Note Added: 0037450
2015-11-12 09:46 JLuc Tag Attached: patch_tested_ok
2015-11-12 22:00 cbradney Status new => resolved
2015-11-12 22:00 cbradney Fixed in Version => 1.5.1svn
2015-11-12 22:00 cbradney Resolution open => fixed
2015-11-12 22:00 cbradney Assigned To => cbradney
2015-11-12 22:03 Kunda Sticky Issue Yes => No
2015-11-13 01:25 Kunda Relationship added child of 0012496
2015-11-14 13:09 Kunda Note Added: 0037477
2015-11-18 18:09 Kunda Note Added: 0037537
2015-11-18 18:09 Kunda Status resolved => closed