Mantis Issue Tracking for Scribus
· Hosting provided by Anduin.net / Øverby Consulting ·

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005484ScribusStylespublic07-Mar-25 06:2307-Apr-26 02:55
Reportermkoren 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusnewResolutionopen 
Platformx86OSDebian LinuxOS VersionSarge/Etch
Product Version1.3.3.8 
Target VersionFixed in Version 
Summary0005484: baseline offset and other new text attributes in parstyles are not applied from SE or text importer
DescriptionApplying a paragraph style via the SE or get text plugin does not apply baseline offset, tracking, or character scaling values from the style.

Only applying the style manually from the PP seems to work, making these attributes nearly useless in styles for long texts.

[Workaround: Creating and applying the style without these attributes, then editing the style to contain them later seems to work, though I wish I had noticed that a few weeks ago.... :( ]
Steps To ReproduceCreate a parstyle with a baseline offset.
Text frame->enter some text.
SE->apply the style->exit.
Enter text edit mode on canvas and observe from PP that offset is 0 (wrong).
Reapply style from PP and note offset is now ok for that paragraph.
Additional InformationThe SE, PP, etc. all seem to have their own way of applying styles, and dealing with text attribues in general. Will this be unified in the future? How much work would it be to group all the attributes in one struct or class used by all objects that need them, even in 133x, to avoid more problems like this? I could try if there's not a major snag I'm missing....

------

Looking in story.cpp, at least the following look suspicious:

* SEditor::updateProps() - in "if (Editor->currentParaStyle > 4)" block - fails to set

   Editor->CurrTextKern
   Editor->CurrTextScale
   Editor->CurrTextScaleV
   Editor->CurrTextBase

* StoryEditor::changeAlignSB() and changeAlign() - missing the same kind of thing in the "chars->at(s)" stuff (?), plus same as above in the toplevel else blocks
TagsNo tags attached.
Attached Filesdiff file icon story.cpp.patch2_loopinvert.1338.diff [^] (5,369 bytes) 07-Apr-26 02:51 [Show Content]
diff file icon story.cpp.patch3_consolidate.1338.diff [^] (23,099 bytes) 07-Apr-26 02:51 [Show Content]
diff file icon story.h.consolidate.1338.diff [^] (583 bytes) 07-Apr-26 02:52 [Show Content]
diff file icon story.cpp.patch4_attribfix.1338.diff [^] (2,672 bytes) 07-Apr-26 02:53 [Show Content]

- Relationships

-  Notes
(0015618)
mkoren (reporter)
07-Mar-25 23:42

I guess a better approach, if this were to be cleaned up for the stable series, would be to leave the attributes alone but define a struct (or use PtiSmall) that can be used by getter and setter methods in each relevant class.

That way the existing methods that set a single attribute can be left alone, but all the blocks of

   Editor->CurrTextKern = currItem->ExtraV;

type lines can be replaced by a single

   Editor.setAttributes(currItem.getAttributes);

I can try this next week on my spring break if you want.... :)
(0015624)
avox (administrator)
07-Mar-26 15:16

This has been done in 1.3.4 and I doubt we'll do the same again for 1.3.3.8.

1.3.3.x is a stable release which will only take small fixes, no large refactoring.
(0016013)
mkoren (reporter)
07-Apr-26 02:50

I split off the text importer part to 0005595, and the story editor part seems to be a duplicate of 0002436, but here's a set of patches to fix it in 1.3.3.8. They fix the problem of not setting these attributes when applying a style, as well as a similar problem updating the current attributes when scrolling to an empty styled paragraph.

I didn't refactor across classes, but I moved all the common style-setting code blocks to separate methods in the StoryEditor class so it was possible to clearly see what needed fixing and only fix it once. This also makes it easier to read the code, and will make it easier to fix at least one additional bug I want to fix.

I split the fix into three patches so it's clearer to see that the behavior didn't change except for the bugfix. The first just moves a loop inside an if/else block to make the next part work. The second consolidates all the style-setting code into separate methods, and the third is the actual fix to three of those methods that needed it.

Is this acceptable? I tried it and it works here.
(0016014)
mkoren (reporter)
07-Apr-26 02:55

Oh, they all apply against my patch from 0005577. The header file patch goes with the second patch here.

- Issue History
Date Modified Username Field Change
07-Mar-25 06:23 mkoren New Issue
07-Mar-25 23:42 mkoren Note Added: 0015618
07-Mar-26 15:16 avox Note Added: 0015624
07-Apr-26 02:50 mkoren Note Added: 0016013
07-Apr-26 02:51 mkoren File Added: story.cpp.patch2_loopinvert.1338.diff
07-Apr-26 02:51 mkoren File Added: story.cpp.patch3_consolidate.1338.diff
07-Apr-26 02:52 mkoren File Added: story.h.consolidate.1338.diff
07-Apr-26 02:53 mkoren File Added: story.cpp.patch4_attribfix.1338.diff
07-Apr-26 02:55 mkoren Note Added: 0016014



Copyright © 2000 - 2013 MantisBT Team
Powered by Mantis Bugtracker