Details
-
Bug
-
Status: Resolved
-
Resolution: Fixed
-
1.8
-
None
-
None
-
Operating System: other
Platform: Other
Description
The following exception is thrown when trying to set, alter or remove a style
property from a <flowPara ../> element.
org.w3c.dom.DOMException:
at
org.apache.batik.css.dom.CSSOMStyleDeclaration$1.textChanged(CSSOMStyleDeclaration.java:288)
at org.apache.batik.css.dom.CSSOMValue.setCssText(CSSOMValue.java:127)
at br.reunion.widgets.svgeditor.Helper.setStylePropertyValue(Helper.java:121)
at
br.reunion.widgets.svgeditor.BasicSVGEditor$2.itemStateChanged(BasicSVGEditor.java:303)
at javax.swing.AbstractButton.fireItemStateChanged(Unknown Source)
at javax.swing.AbstractButton$Handler.itemStateChanged(Unknown Source)
...
I tryied two ways to set the css property, but both raise exceptions:
First way:
==========
CSSStyleDeclaration style = ((SVGStylableElement)svgElement).getStyle();
String propValue = style.getPropertyCSSValue("font-style").getCssText(); <<
error raised here!
Second way:
==========
CSSStyleDeclaration style = ((SVGStylableElement)svgElement).getStyle();
String propValue = style.getPropertyValue("font-weight"); << error raised here!
The same problems occurs for
style.setPropertyValue("font-weight", "bold", "");
style.removeProperty("font-weight");
Tested SVG code:
================
... <flowRoot
id="music-title-root"
xml:space="preserve"><flowRegion
id="flowRegion1313"><rect style="fill:none"
width="775.87134"
height="50.044106"
x="10"
y="10"
id="rect1315" /></flowRegion><flowDiv><flowPara
style="font-size:36px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:middle;line-height:125%;writing-mode:lr-tb;text-anchor:middle;fill:#ffbd00;fill-opacity:1;font-family:Arial"
id="music-title">I See the Lord</flowPara></flowDiv></flowRoot>...
These errors are a bit confusing because they don't occur everytime (but almost
all the time).
(I am using the lastest version of Batik from SVN)