Details
-
Bug
-
Resolution: Unresolved
-
Major
Description
Concerned module: xwiki-platform-gwt-user: https://github.com/xwiki-contrib/xwiki-platform-wiki30/tree/master/xwiki-platform-core/xwiki-platform-gwt/xwiki-platform-gwt-user
code at:
https://github.com/xwiki-contrib/xwiki-platform-wiki30/blob/master/xwiki-platform-core/xwiki-platform-gwt/xwiki-platform-gwt-user/src/main/java/org/xwiki/gwt/user/client/ui/rta/cmd/internal/ToggleInlineStyleExecutable.java
and
There is a issue in my oppinion regarding the design of these classes.
In ToggleInlineStyleExecutable the "executed" flag is updated only when the public method execute(String) is called, but not when the protected method execute(Range, String).
Because of this I can call the second method toggleInlineStyleExecutable.execute(Range, String)(which is inherited) to add some styling on a range, but the "executed" flag isn't updated, thus leading to the following problem:
the method TextFragment execute(Text text, int startIndex, int endIndex, String parameter) on ToggleInlineStyleExecutable does the wrong action(that is to add a style when it should remove it).
Workaround: either update the "executed" flag on every ingerited method that wants to execute some style, either use the getter "isExecuted()" in the method TextFragment execute(Text text, int startIndex, int endIndex, String parameter).