https://bz.apache.org/bugzilla/show_bug.cgi?id=57552
--- Comment #11 from mark.o <[email protected]> --- (In reply to Nick Burch from comment #9) > Some sort of helpful wrapper class would seem a cleaner fix to me, though > with the small disadvantage of breaking some existing code. However, with > the common SL code coming soon, people will need to tweak things anyway, so > maybe we just roll this change into that? I found the use of plain integers slightly fragile (or weird) too. A wrapper class would definitely be an improvement, even if the first incarnation is nothing better than a wrapped integer. In the longer term, I had figured it would be even more convenient to have an addPicture() method on the slide class (I think I've seen something similar in the ppt or the docx code). The user could then simply add a picture to the slide directly without worrying about any of the internal bookkeeping. In the background the method would do the 'if-exists-or-add-new' logic on the slide show. With this approach, it would be fairly easy to add a wrapper-class without immediately breaking any existing code. We could also provide extra XMLSlideShow.addPicture() methods that conveniently takes other parameters (eg,InputStream, File, etc) and returns the new wrapper-class. This would also provide an easy way to move forward without breaking existing code. The PictureDataXXX class could also be slightly extended to include its CRC and (for plain image data) its original dimensions. The would still be fairly lean but would make the existence lookups much easier. Retaining information about the original dimensions makes it easier to handle some other functionality that I've already started to code. Eg, /** Resize this picture into target rectangle, while maintaining its aspect ratio */ XSLFPictureShape.resize(Rectangle2D target, RectAlign align); I'm using this type of method to fit pictures to the placeholder dimensions. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
