[Libreoffice-commits] .: 2 commits - sw/source

Lubos Lunak llunak at kemper.freedesktop.org
Mon Dec 20 08:01:15 PST 2010


 sw/source/filter/ww8/WW8TableInfo.cxx        |    6 ------
 sw/source/filter/ww8/docxattributeoutput.cxx |   11 +++++++++--
 2 files changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 1f5706cee09be87281943d27fe4797a4a98b13a2
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Dec 20 16:18:50 2010 +0100

    work around tables with many columns for msoffice (fdo#30860)
    
    Theoretically the .docx spec doesn't seem to have any limit
    on the number of table columns, but in practice msoffice seems
    to have a hardcoded limit of 63 columns and fails to open such
    documents. Since the expected use case with .docx is that
    somebody with msoffice will try to open it, keep the limit
    and merge exceeding items into the last column.

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b1d73ea..a9c38b3 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -255,8 +255,15 @@ void DocxAttributeOutput::FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointe
         const SwTable *pTable = pInner->getTable( );
         const SwTableLines& rLines = pTable->GetTabLines( );
         USHORT nLinesCount = rLines.Count( );
-
-        if ( pInner->isEndOfCell() )
+        // HACK
+        // fdo#30860 - msoffice seems to have an internal limitation of 63 columns for tables
+        // and refuses to load .docx with more, even though the spec seems to allow that;
+        // so simply if there are more columns, don't close the last one msoffice will handle
+        // and merge the contents of the remaining ones into it (since we don't close the cell
+        // here, following ones will not be opened)
+        bool limitWorkaround = ( pInner->getCell() >= 62 && !pInner->isEndOfLine());
+
+        if ( pInner->isEndOfCell() && !limitWorkaround )
         {
             if ( bForceEmptyParagraph )
                 m_pSerializer->singleElementNS( XML_w, XML_p, FSEND );
commit e847df0b0901b575d567563cd8bfc443380eb12c
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Dec 20 16:16:26 2010 +0100

    remove non-functional column count limit (part of fdo#30860)
    
    This limitation alone is a) wrong, since the limit is actually 63,
    b) incomplete, since mso2k7 fails to open such document anyway.

diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx
index ca8205d..8f2761a 100644
--- a/sw/source/filter/ww8/WW8TableInfo.cxx
+++ b/sw/source/filter/ww8/WW8TableInfo.cxx
@@ -252,9 +252,6 @@ WidthsPtr WW8TableNodeInfoInner::getWidthsOfRow()
         pWidths = WidthsPtr(new Widths);
         // number of cell written
         sal_uInt32 nBoxes = rTabBoxes.Count();
-        if ( nBoxes > 32 )
-            nBoxes = 32;
-        
         for (sal_uInt32 n = 0; n < nBoxes; n++)
         {
             const SwFrmFmt* pBoxFmt = rTabBoxes[ n ]->GetFrmFmt();
@@ -283,9 +280,6 @@ RowSpansPtr WW8TableNodeInfoInner::getRowSpansOfRow()
         const SwTableBoxes & rTabBoxes = pTabLine->GetTabBoxes();
 
         sal_uInt32 nBoxes = rTabBoxes.Count();
-        if (nBoxes > 32)
-            nBoxes = 32;
-        
         for (sal_uInt32 n = 0; n < nBoxes; ++n)
         {
             pResult->push_back(rTabBoxes[n]->getRowSpan());


More information about the Libreoffice-commits mailing list