Discussion:
[scribus] Another code question
Ralf Mattes
2018-06-26 21:40:51 UTC
Permalink
In a (c++) plugin I'm trying to iterate over the paragraphs of a story text. I guess this can be done
by repeatedly calling the nextBlockStart() of a story text object and then fetching the text with the text()
method. But what I wasn't able to find out is how to get the story text of a selected text frame. Any hints?

TIA RalfD


___
Scribus Mailing List: ***@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net
Ralf Mattes
2018-06-27 15:46:28 UTC
Permalink
Post by Ralf Mattes
In a (c++) plugin I'm trying to iterate over the paragraphs of a story text. I guess this can be done
by repeatedly calling the nextBlockStart() of a story text object and then fetching the text with the text()
method. But what I wasn't able to find out is how to get the story text of a selected text frame. Any hints?
Never mind, I found it.
But now I have a follow-up question: when I call storyText->paragraphStyle(pos) and then call the name() method
of the returned style that name is always an empty string. What am I doing wrong?

TIA RalfD



___
Scribus Mailing List: ***@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net
Václav Šmilauer
2018-06-28 08:21:44 UTC
Permalink
Post by Ralf Mattes
But now I have a follow-up question: when I call storyText->paragraphStyle(pos) and then call the name() method
of the returned style that name is always an empty string. What am I doing wrong?
I think you need to get the parent style, see the code for scripter
getStyle I referenced in the other thread. I was also puzzled by that,
maybe someone else can explain the internals better :) Cheers, v.

___
Scribus Mailing List: ***@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net
ale rimoldi
2018-06-29 08:48:32 UTC
Permalink
hi vaclav

you can have a look at the scripter or at the plugin API i'm creating
(https://github.com/aoloe/scribus-plugin-API/blob/master/src/scribusAPIDocumentItemText.cpp)

ciao
a.l.e

p.s.: currently, i'm cleaning up the API to have sane namespaces and
use as little as possible Qt...
it would be nice to see some discussion on the proposal and some
hints on how to improve it.

___
Scribus Mailing List: ***@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net

Ralf Mattes
2018-06-27 19:11:07 UTC
Permalink
Post by Ralf Mattes
But now I have a follow-up question: when I call storyText->paragraphStyle(pos) and then call the name() method
of the returned style that name is always an empty string. What am I doing wrong?
Seems like I need to call displayName() instead. But that adds a '+' at the end of all style names -- strange.

Cheers, RalfD







___
Scribus Mailing List: ***@lists.scribus.net
Edit your options or unsubscribe:
http://lists.scribus.net/mailman/listinfo/scribus
See also:
http://wiki.scribus.net
http://forums.scribus.net
Loading...