Bug 66986 - KWord: openoffice.org import resizes tables to 0x0
Summary: KWord: openoffice.org import resizes tables to 0x0
Status: RESOLVED FIXED
Alias: None
Product: kword
Classification: Unmaintained
Component: filters (show other bugs)
Version: 1.5 or before
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Ariya Hidayat
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-01 09:49 UTC by Ben Burton
Modified: 2006-04-27 11:05 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
patch_oow_table.diff (6.51 KB, text/x-diff)
2003-11-15 05:34 UTC, Nicolas Goutte
Details
patch_oow_columns.diff (2.68 KB, text/x-diff)
2003-11-16 03:14 UTC, Nicolas Goutte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Burton 2003-11-01 09:49:38 UTC
Version:           1.2.94 (using KDE KDE 3.1.4)
OS:          Linux

Received through the Debian BTS (#202432).

The reporter of the debian bug listed above claimed that kword crashed when opening openoffice.org *.sxw documents containing tables.

I tried to reproduce this and kword didn't crash, but the table could not be seen.  It does show up in the document structure; AFAICT kword is resizing the table to 0x0.  There is a tiny grey dot in the document where the table should be.

An OOo document that produces this problem can be found at:

  http://people.debian.org/~bab/bugs/ooo-tables.sxw

Thanks - Ben. :)
Comment 1 Nicolas Goutte 2003-11-03 00:36:40 UTC
So after a first check, I have:
- when loaded in OOWriter 1.01, saved as RTF, loaded in KWord, it works (so it is probably a filter problem.)
- when loaded in OOWriter 1.01, saved as OO, loaded in KWord, it does not (so it is not a OO 1.1 problem.)
- a KWord table is generated when importing.
- I do not see anything of the table (not even a gray dot/zone/whatever.)

Have a nice day!
Comment 2 Nicolas Goutte 2003-11-05 20:05:30 UTC
Bad news: the table support of the OOWriter import filter has been broken. Not even the default OO table, with a number added per cell, works anymore. :-(

Have a nice day!
Comment 3 Nicolas Goutte 2003-11-05 20:18:43 UTC
Looking again in logs, I have found that the table support was never finished.

(I started it at the start of April 2003, not knowing that I could barely work
on KOffice for the next 4 months.)

So I am sorry, but it will probably still be unimplemented for KOffice 1.3. (I have corrected the documentation on KOffice.org.) 

I am sorry for the inconveniences.

Have a nice day!
Comment 4 Nicolas Goutte 2003-11-15 05:34:31 UTC
Subject: [PATCH] Basic OOWriter table import

The attached patch is for the directory koffice/filters/kword/oowriter.

It adds a basic support for importing tables. Now the column widths are 
correctly treated.

However:
- only up to 1023 columns are supported.
- the height of a cell is constantly 1 inch.

The 1023 columns are an implementation detail and could be made better.

However the fixed height is more of a problem (KWord element <FRAME>), as 
KWord does not stretch the cell height in any way, so one cannot give a very 
small height (for example 2pt) and then let KWord do the job.

This is a very big problem, as the current situation seems to mean that KWord 
1.4 would not be able to export tables back to KWord 1.3. (Of course, any 
idea is welcomed.)

Have a nice day!

Created an attachment (id=3233)
patch_oow_table.diff
Comment 5 Nicolas Goutte 2003-11-16 02:03:21 UTC
Subject: koffice/filters/kword/oowriter

CVS commit by goutte: 

Let KWord itself decide on how high the table rows should be
CCMAIL:koffice-devel@kde.org
CCMAIL:66986@bugs.kde.org


  M +3 -3      oowriterimport.cc   1.53


--- koffice/filters/kword/oowriter/oowriterimport.cc  #1.52:1.53
@@ -1470,8 +1470,8 @@ void OoWriterImport::parseInsideOfTable(
             frameElementOut.setAttribute("left",columnLefts.at(column));
             frameElementOut.setAttribute("right",columnLefts.at(column+1));
-            // We assume 1 inch as cell height (### TODO, but how?)
-            frameElementOut.setAttribute("top",72*row);
-            frameElementOut.setAttribute("bottom",72*row+72);
+            frameElementOut.setAttribute("top", 0);
+            frameElementOut.setAttribute("bottom", 0);
             frameElementOut.setAttribute("runaround",1);
+            frameElementOut.setAttribute("autoCreateNewFrame",0); // Very important for cell growing!
             // ### TODO: a few attributes are missing
             framesetElement.appendChild(frameElementOut);


Comment 6 Nicolas Goutte 2003-11-16 03:14:50 UTC
Subject: [PATCH] OOWriter import table columns

The attached patch is for koffice/filters/kword/oowriter (this time with diff 
-p !)

The patch fixes the limitation to 1023 columns (now 4 columns by default and 
increase by steps of 4 columns. The change uses the memory optimized option 
of QMemArray::resize.)

I have found another error: the paragraph in which the table is defined for 
KWord does not have a <LAYOUT> element. This is not fixed by this patch.

Have a nice day!

Created an attachment (id=3240)
patch_oow_columns.diff
Comment 7 Thomas Zander 2006-04-13 17:48:41 UTC
Thank you for your bug report.
The bug that you reported has been identified and has been fixed in the
latest development (SVN) version of KDE. The bug report will be closed.

Many thanks for leaving the doc there for this long so I could check! :)