You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/04/04 17:15:00 UTC

[jira] [Commented] (PDFBOX-4496) OCG enablement with string parameter is not well defined

    [ https://issues.apache.org/jira/browse/PDFBOX-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810096#comment-16810096 ] 

ASF subversion and git services commented on PDFBOX-4496:
---------------------------------------------------------

Commit 1856965 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1856965 ]

PDFBOX-4496: avoid ClassCastException

> OCG enablement with string parameter is not well defined
> --------------------------------------------------------
>
>                 Key: PDFBOX-4496
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4496
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.14
>            Reporter: Stefan Ziel
>            Assignee: Tilman Hausherr
>            Priority: Major
>              Labels: OCGs
>             Fix For: 2.0.15, 3.0.0 PDFBox
>
>         Attachments: PDFBOX-4496.patch, original.pdf
>
>
> The class {noformat} org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties
> {noformat}
> contains two methods
> {noformat} setGroupEnabled(String, boolean){noformat}  and {noformat} isGroupEnabled(String){noformat} 
> accessing the OCG's state using a name as parameter.
> As there can exist various OCG with the same name this access is not well defined. 
> The current implementation accesses the first group with this name it can find.
> To make the setter work a solution would be a loop over all groups with the given name and add them to ON or OFF. Consider to rename it to {noformat}setGroupsEnabledByName{noformat}
> The getter should return some error state if the groups diverge in state - or better drop it ...



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org