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 2012/02/14 00:22:56 UTC

DO NOT REPLY [Bug 52658] New: [PATCH] Merge cells of a table (rowspan and colspan)

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

             Bug #: 52658
           Summary: [PATCH] Merge cells of a table (rowspan and colspan)
           Product: POI
           Version: 3.8-dev
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSLF
        AssignedTo: dev@poi.apache.org
        ReportedBy: dgen2@hotmail.com
    Classification: Unclassified


I was trying to merge table's cell in a Powerpoint document and found nothing
in the API. Searching on the net, I only found out that it's was simply not
implemented.

http://apache-poi.1045710.n5.nabble.com/HSLF-merging-tablecells-possible-td2294865.html

I made a quick patch in the XSLFTableCell class to expose the 'gridSpan',
'rowSpan', 'hMerge' and 'vMerge' attributes of the "tc" element (the table cell
node in the OOXML schema) and added a method in the XSLFTable class to merge
the desired cells :
  public void mergeCells(int firstRow, int lastRow, int firstCol, int lastCol);

In the client code :

   XSLFTable table = newSlide.createTable();
   ...
   XSLFTableRow row = table.addRow();
   ....
   table.mergeCells(0, 1, 0, 1);

Note : You need the full OOXML-schemas jar file (16 MB) to make the
(Powerpoint) table work in POI.  The lite version don't seem to work for me.

Due to project rush I only implemented what I need and didn't review side
effect s or alternative uses (exemple : merge all the cell in the table,
unmerge cells, etc ?)

-- 
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 52658] [PATCH] Merge cells of a table (rowspan and colspan)

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

--- Comment #1 from Ut Vu Phan <dg...@hotmail.com> 2012-02-13 23:24:15 UTC ---
Created attachment 28325
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=28325
SVN Diff created by the "ant -f patch" command

-- 
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 52658] [PATCH] Merge cells of a table (rowspan and colspan)

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

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

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

--- Comment #2 from Yegor Kozlov <ye...@dinom.ru> 2012-02-14 07:03:21 UTC ---
Patch applied in r1243793

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