ooo-build r15310 - trunk/patches/dev300



Author: cbosdo
Date: Tue Feb 10 08:17:28 2009
New Revision: 15310
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15310&view=rev

Log:
Partial fix for docx tables import. Still have to implement table styles
support.


Added:
   trunk/patches/dev300/writerfilter-docx-import-tables.diff
Modified:
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Tue Feb 10 08:17:28 2009
@@ -1741,7 +1741,7 @@
 win32-installer-register-moox-types.diff
 
 writerfilter-module-writer.diff
-
+writerfilter-docx-import-tables.diff, i#90093, cbosdo
 writerfilter-source-dmapper-domainmapper-debug.diff
 
 buildfix-oox-depends-on-unotools.diff

Added: trunk/patches/dev300/writerfilter-docx-import-tables.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/writerfilter-docx-import-tables.diff	Tue Feb 10 08:17:28 2009
@@ -0,0 +1,135 @@
+Index: writerfilter/source/dmapper/DomainMapperTableHandler.cxx
+===================================================================
+--- writerfilter/source/dmapper/DomainMapperTableHandler.cxx	(rÃvision 267004)
++++ writerfilter/source/dmapper/DomainMapperTableHandler.cxx	(copie de travail)
+@@ -140,7 +140,7 @@
+     if( nTblPropSize )
+     {
+         const beans::PropertyValues aDebugTbl = m_aTableProperties->GetPropertyValues();
+-        for( sal_Int32  nDebug = 0; nDebug < nTblPropSize; ++nDebug)
++        for( sal_uInt32 nDebug = 0; nDebug < nTblPropSize; ++nDebug)
+         {
+             const ::rtl::OUString sName = aDebugTbl[nDebug].Name;
+             sNames += sName;
+@@ -156,6 +156,8 @@
+     sal_Int32 nLeftBorderDistance, nRightBorderDistance, nTopBorderDistance, nBottomBorderDistance;
+     nLeftBorderDistance = nRightBorderDistance = DEF_BORDER_DIST;
+     nTopBorderDistance = nBottomBorderDistance = 0;
++    table::TableBorder aTableBorder;
++
+     if( m_aTableProperties.get() )
+     {
+         //create properties from the table attributes
+@@ -177,9 +179,10 @@
+             if( pStyleSheet )
+             {
+                 PropertyMapPtr pMergedProperties = lcl_SearchParentStyleSheetAndMergeProperties(pStyleSheet, pStyleSheetTable);
+-               
+-                PropertyMap::const_iterator aStylePropIter = 
+-                    pMergedProperties->find(PropertyDefinition( META_PROP_CELL_MAR_TOP, false ) );
++
++                PropertyMap::const_iterator aStylePropIter;
++
++                aStylePropIter = pMergedProperties->find(PropertyDefinition( META_PROP_CELL_MAR_TOP, false ) );
+                 if( aStylePropIter != pMergedProperties->end() )
+                     aStylePropIter->second >>= nTopBorderDistance;    
+                 
+@@ -220,7 +223,6 @@
+         m_aTableProperties->Insert( PROP_TABLE_BORDER_DISTANCES, false, uno::makeAny( aDistances ) );
+         
+         //table border settings
+-        table::TableBorder aTableBorder;
+         
+         PropertyMap::iterator aTblBorderIter = m_aTableProperties->find( PropertyDefinition(PROP_TOP_BORDER, false) );
+         if( aTblBorderIter != m_aTableProperties->end() )
+@@ -266,7 +268,7 @@
+         }
+         aTableBorder.Distance = 0;
+         aTableBorder.IsDistanceValid = false;
+-        
++       
+         m_aTableProperties->Insert( PROP_TABLE_BORDER, false, uno::makeAny( aTableBorder ) );
+         
+         m_aTableProperties->Insert( PROP_LEFT_MARGIN, false, uno::makeAny( nLeftMargin - nGapHalf - nLeftBorderDistance));
+@@ -307,6 +309,13 @@
+         //contains the default border of the line
+         PropertyMapPtr aCellBorders( new PropertyMap );
+ 
++        // Fill the defaults with the table default borders
++        aCellBorders->Insert( PROP_TOP_BORDER, false, uno::makeAny( aTableBorder.TopLine ) );
++        aCellBorders->Insert( PROP_RIGHT_BORDER, false, uno::makeAny( aTableBorder.RightLine ) );
++        aCellBorders->Insert( PROP_LEFT_BORDER, false, uno::makeAny( aTableBorder.LeftLine ) );
++        aCellBorders->Insert( PROP_BOTTOM_BORDER, false, uno::makeAny( aTableBorder.BottomLine ) );
++
++
+         sal_Int32 nCell = 0;
+         pCellProperties[nRow].realloc( aRowOfCellsIterator->size() );
+         beans::PropertyValues* pSingleCellProperties = pCellProperties[nRow].getArray();
+@@ -318,7 +327,7 @@
+             //aCellIterator points to a PropertyMapPtr;
+             if( aCellIterator->get() )
+             {
+-                if( nCell && aCellBorders->size() )
++                if( aCellBorders->size() )
+                 {
+                     //now apply the default border
+                     //TODO: This overwrites the existing values!
+@@ -479,7 +488,7 @@
+         (void) nCellPropertiesProperties;
+         ++nCellPropertiesProperties;
+     }    
+-#endif            
++#endif           
+             m_xText->convertToTable(*m_pTableSeq, 
+                                     aCellProperties,
+                                     aRowProperties,
+@@ -492,6 +501,7 @@
+ #endif
+         }
+     }
++
+     m_aTableProperties.reset();
+     m_aCellProperties.clear();
+     m_aRowProperties.clear();
+@@ -529,7 +539,15 @@
+                                          TablePropertyMapPtr pProps )
+ {
+     sal_uInt32 nRow = m_aRowProperties.size();
+-    m_aCellProperties[nRow - 1].push_back( pProps );
++    if ( pProps.get( ) )
++        m_aCellProperties[nRow - 1].push_back( pProps );
++    else
++    {
++        // Adding an empty cell properties map to be able to get
++        // the table defaults properties
++        TablePropertyMapPtr pEmptyProps( new TablePropertyMap( ) );
++        m_aCellProperties[nRow - 1].push_back( pEmptyProps );
++    }
+     
+ #if OSL_DEBUG_LEVEL > 1
+     clog << "<table.cell>";
+Index: writerfilter/source/dmapper/ConversionHelper.cxx
+===================================================================
+--- writerfilter/source/dmapper/ConversionHelper.cxx	(rÃvision 267004)
++++ writerfilter/source/dmapper/ConversionHelper.cxx	(copie de travail)
+@@ -276,6 +276,10 @@
+         case 21:
+             eCodeIdx = double1;//  60 Twips for us
+             break;
++        case 0:
++        case 255:
++            eCodeIdx = none;
++            break;
+         default:
+             eCodeIdx = single0;
+             break;
+@@ -306,7 +310,8 @@
+         /*13*/  { DOUBLE_LINE7_OUT, DOUBLE_LINE7_IN, DOUBLE_LINE7_DIST },
+         /*14*/  { DOUBLE_LINE8_OUT, DOUBLE_LINE8_IN, DOUBLE_LINE8_DIST },
+         /*15*/  { DOUBLE_LINE9_OUT, DOUBLE_LINE9_IN, DOUBLE_LINE9_DIST },
+-        /*16*/  { DOUBLE_LINE10_OUT,DOUBLE_LINE10_IN,DOUBLE_LINE10_DIST}
++        /*16*/  { DOUBLE_LINE10_OUT,DOUBLE_LINE10_IN,DOUBLE_LINE10_DIST},
++        /*17*/  { 0, 0, 0 }
+     };
+ 
+     rToFill.Color = nLineColor;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]