Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | sax: wrong usage of the function AddBytes | ||||||
---|---|---|---|---|---|---|---|
Product: | xml | Reporter: | pmladek <pmladek> | ||||
Component: | code | Assignee: | eric.savary | ||||
Status: | CLOSED FIXED | QA Contact: | issues@xml <issues> | ||||
Severity: | Trivial | ||||||
Priority: | P3 | CC: | issues, matthias.huetsch, pavel, stx123 | ||||
Version: | OOo 2.0.2 | ||||||
Target Milestone: | OOo 3.0 | ||||||
Hardware: | PC | ||||||
OS: | Linux, all | ||||||
Issue Type: | PATCH | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
Description
pmladek
2006-06-23 15:59:20 UTC
Created attachment 37301 [details]
My proposed fix.
Hi Michael, please take this over. Thank you for creating this patch. Regarding the free suggestions: - The first one seems to be correct. - I'm not sure about the 2nd and the 3rd one. For the 2nd, the current code seems to be correct (The buffer always is flushed after bytes have been added, so there should be enough space for a LF in any case. - For the third, you say the problem appears if (nCurrentPos + nLen + 1 == SEQUENCESIZE). In this case, but in this case, AddBytes is not called at all. The first change is important, see issue 70495. Invalid files are written (this is why I came across this). For the second change I agree with mib: That check is always done *after* incrementing nCurrentPos. Adding the check there would only make these semantics unclear to someone reading the code. For the third change, the problem with the old code is of course with nCurrentPos+nLen==SEQUENCESIZE, when the text without linefeed would fit into the buffer, but AddBytes is called for it. I'm not sure if this can really happen, or if startDocument is only ever called with an empty buffer. Even then, it looks like it would only cause an assertion message. It should probably be changed anyway. *** Issue 70495 has been marked as a duplicate of this issue. *** Sorry how to apply the diff to OpenOffice 2.2 under windows? I am from issue 70495. It has being bothering me so much and I am reluctant to stop using Calc since version 2.0. We should be able to at least apply the first patch for 2.3 "We should be able to at least apply the first patch for 2.3" First patch is enough. It seems sax is a core library or something that is not easy to fix... Thankyou mib. mib: this issue is type PATCH. is the patch ok? Is the target 2.3 still valid? Moving target because of no reply :-( *** Issue 79121 has been marked as a duplicate of this issue. *** *** Issue 71515 has been marked as a duplicate of this issue. *** Applied 1st and 3rd patch. To verify the issue in SRC680 m241: - load test.xls from i70495 - add an "a" into cell A2. - Save the doc in ODS. Without the patch, the ODS cannot be loaded, with the patch, it can be loaded. *** Issue 65027 has been marked as a duplicate of this issue. *** re-assigned mib: Thankyou very much. retargetted to 3.0 VERIFIED This issue is closed automatically and wasn't rechecked in a current version of OOo. The fixed issue should be integrated in OOo since more than half a year. If you think this issue isn't fixed in a current version (OOo 3.1), please reopen it and change the field 'Target Milestone' accordingly. If you want to download a current version of OOo => http://download.openoffice.org/index.html If you want to know more about the handling of fixed/verified issues => http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues |