You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2010/09/13 12:00:54 UTC

DO NOT REPLY [Bug 49919] New: Implement support for BorderCode

https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

           Summary: Implement support for BorderCode
           Product: POI
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: HWPF
        AssignedTo: dev@poi.apache.org
        ReportedBy: a6537691@bofthew.com


I'd like to finish implementation and create a patch for BorderCodes. Currently
it reads only the Word 97 structure (4-byte), and the class does not provide
any getters or setters. Word 2000 and above use new 8-byte version, which is
changed in new SPRM, which are currently not processed.

I don't know how to do it best in regard of backward compatibility. Two
BorderCode structures should be supported. They have the same properties,
except for color, which is changed from 8-bit to 24-bit in word 2000.

I suggest this:
1. rename existing BorderCode to BorderCode97 and create new BorderCode2000.
These will read/write values as appropriate for particular version.
2. create new class BorderCode, which will delegete to BorderCode97 or
BorderCode2000. Will provide method returning boolean as whether 8 or 24-bit
color is valid. It will not contain following public methods from current
implementation: 
  - the public contructor
  - the toInt method
As such it will not be full backwards compatible, but I think this is not the
issue, as currently the class is useless.

Note, that there are different BorderCode structures for Word 95 and Word 1.0,
but as I understand, we do not support these.

Please let me know.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

--- Comment #2 from Nick Burch <ni...@alfresco.com> 2010-09-16 09:52:31 EDT ---
To answer the question - the TableXXXX classes extend from paragraph because in
the file format they're really just paragraphs with special properties!

In terms of table vs paragraph properties: For a table where the row has a
border, and a paragraph in it has one, do we need to merge the two properties?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

--- Comment #5 from a6537691@bofthew.com 2010-10-07 01:45:47 EDT ---
Created an attachment (id=26129)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26129)
Added files for the patch

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

Nick Burch <ni...@alfresco.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Nick Burch <ni...@alfresco.com> 2010-09-16 12:04:47 EDT ---
The patch looks good, thanks for that

Any chance of a quick unit test for it? I guess we'll need a word file with a
table in it, some rows with borders and some without. The test would then check
each row in turn, and ensure that the borders show up / don't show up as
expected. I'm happy to commit this to svn once we have a test to go with it

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

Yegor Kozlov <ye...@dinom.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from Yegor Kozlov <ye...@dinom.ru> 2010-10-07 09:58:13 EDT ---
Applied in r1005447

Thanks,
Yegor

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

a6537691@bofthew.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #26032|0                           |1
        is obsolete|                            |

--- Comment #4 from a6537691@bofthew.com 2010-10-07 01:45:18 EDT ---
Created an attachment (id=26128)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26128)
Patch to support borders (with testcase)

Updated patch with a testcase.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

--- Comment #1 from a6537691@bofthew.com 2010-09-16 07:52:03 EDT ---
Created an attachment (id=26032)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=26032)
Patch to support borders

Attached is the patch created by following the instructions in the Contribution
Guidelines. How it is implemented:

- no support for Word 2000 structure of BorderCode. The only difference is that
Word 2000 has 24-bit color while Word 97 version has only 16 colors. In my
tests Word 2003 and 2007 saves both structures, so you are able to read it
anyway.

- get methods for borders were added to TableRow: for some strange reason
TableRow extends Paragraph. Paragraph has getXxxBorder methods, but they return
incorrect values, because they read from _props superclas's field instead of
_tprops field

Please give feedback or merge.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 49919] Implement support for BorderCode

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=49919

a6537691@bofthew.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEEDINFO                    |NEW

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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