Thanks - that is helpful - I've been looking for a way to change character
styles in the middle of a paragraph. However, I still can't make it work.
When I add addStyledContent() the paragraph can't be added to the document
anymore. For example, if I have a character style in my file called
"Emphasis", if I call addContent("Text here") everything works as expected.
But if I call paragraph.addStyledContent("Text here", "Emphasis") the whole
paragraph doesn't show up. I don't get an error, it just makes it so the
paragraph doesn't show up in the document.
Also, I've found that Paragraph.setStyle() doesn't work in jopendocument
1.3 or higher. If I revert back to jopendocument 1.2 it works fine, but 1.3
complains that it can't find the setStyle() method.
Thanks!
On Wednesday, March 4, 2015 at 6:37:04 AM UTC-5, ILM wrote:
>
> Le 03/03/2015 22:15, theminor a écrit :
> > I've gotten this to work now with add() under TextDocument - thanks!
> But
> > can someone point out how to use addStyledContent() instead of
> addContent()
> > on a Paragraph?
> >
> > When I use addStyledContent() it just adds content just like add(), with
> > the Default style in the document. For example, if
> addStyledContent("Added
> > Text", "Title"), where Title is a paragraph style defined in my
> styles.odt
> > document...
> >
> > Any ideas? I can't get this to work...
>
> Hi,
>
> addStyledContent() adds content inside an existing paragraph so I
> think you need to pass a text
> style name, not a paragraph style.
>
> Cheers,
> Sylvain
>
--
---
You received this message because you are subscribed to the Google Groups
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.