Bug 60059 - Deprecate xslf.usermodel.Drawing* - was: Can't change text of DrawingParagraph
Summary: Deprecate xslf.usermodel.Drawing* - was: Can't change text of DrawingParagraph
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSLF (show other bugs)
Version: 3.16-dev
Hardware: All All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-28 16:04 UTC by NadavB
Modified: 2016-10-26 22:47 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description NadavB 2016-08-28 16:04:58 UTC
With DrawingParagraph, obtained by DrawingTextBody->getParagraphs() 
It's possible to do getText() to obtain the text, but there is no way how to change the text.

We need a way to change text in a given presentation.
Comment 1 Javen O'Neal 2016-09-10 23:53:53 UTC
Patches with corresponding unit tests are greatly appreciated!

Resources to get your started:
How to build POI: https://poi.apache.org/howtobuild.html
Submitting patches: https://poi.apache.org/guidelines.html
XSLF quick guide: https://poi.apache.org/slideshow/xslf-cookbook.html#Text
POI FAQ: https://poi.apache.org/faq.html

Here's the DrawingParagraph source code
https://svn.apache.org/viewvc/poi/trunk/src/ooxml/java/org/apache/poi/xslf/usermodel/DrawingParagraph.java?view=markup

A paragraph is constructed of multiple text runs (the formatting of each text run is the same--analogous to rich text strings).
You probably want a method that will return a list of text runs within a DrawingParagraph. Then you can set the text on each run.

CTRegularTextRun any any other CT* class are generated by the OOXML schema descriptors, but you can attach the interface to Eclipse to make it easier to develop these features.
You can also rename a .pptx file to .zip, unzip it, and examine the XML files inside (helpful to have an XML pretty printer).
Comment 2 Andreas Beeker 2016-10-26 22:47:11 UTC
Deprecated the old drawing classes via r1766746

Please iterate over the shapes of the slides and call the getText() and setText() methods of the TextShapes or TableCells