Summary: | RichTextRun.setBold and RichTextRun.setItalic corrupt the underlying StyleTextPropAtom. | ||
---|---|---|---|
Product: | POI | Reporter: | Yegor Kozlov <yegor> |
Component: | HSLF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other | ||
Attachments: |
test case which demonstrates the bug
Test which confirms that the problem exists |
Description
Yegor Kozlov
2006-04-17 15:47:39 UTC
Created attachment 18113 [details]
test case which demonstrates the bug
Bah. There had been a bug in how the mask textprops wrote themselves out. I guess I didn't quite get it right when I tried to fix it :( This is odd. I've just run your test, and it passes just fine for me.... Can you do a svn update, then an ant clean, then try your test again? Quite odd that it passes for me but not for you. (In reply to comment #3) > This is odd. I've just run your test, and it passes just fine for me.... > > Can you do a svn update, then an ant clean, then try your test again? Quite odd > that it passes for me but not for you. this is really odd! When I run tests in IntelliJ Idea 4.0 I got errors! When I run them by ant they pass! Probably something is wrong with my IDE. I need to investigate it in details. I've had similar problems with Eclipse, when its idea of where to build class files to differred from ant's Glad it's all fixed though :) Nick, It seems the order in which tests are running is important. Comment all tests in TestShapes but testTextBoxWrite, recompile, run and get this error! In our case JUnit first runs testTextBoxRead() and then testTextBoxWrite(). It looks like the first test affects the others! To make sure I created a standalone program with main() and confirmed that the error exists. I attached the new test case. Look at the line 45: new SlideShow(new HSLFSlideShow(filename)); With this line test succeeds. Comment it and the test fails! I debugged it a little bit. It seems some static initializes are not set properly. When test fails Variable subPropMasks in BitMaskTextProp.setSubValue is filled with 0, otherwise there are some values. Please check it. Yegor Created attachment 18146 [details]
Test which confirms that the problem exists
Forgot to mention:
It fails in both cases: under Ant and in IntelliJ Idea.
Oww oww, this bug hurts my head.... You weren't resetting sl after the load, which wasn't helping. However, I've now got my hands on the real data that gets written out for the StyleTextPropAtom, now to figure out why it's not correct! OK, I've found two bugs (and a fault in the test....) Firstly, there was a bug with the flag type TextProps, when created from scratch, which was biting us. This should be fixed, and should allow everything to behave properly. Due to a clone, we were seeing different behaviour on the first call Then, there was the bug in the test (which has been committed, working) Finally, after adding new TextBoxes, they weren't being registered with the PPDrawing, so they weren't always being correctly updated on write out. That's been fixed. Hopefully it now all works :) |