User: hr      
Date: 2007-08-03 09:58:25+0000
Modified:
   dba/reportdesign/source/filter/xml/xmlTable.cxx

Log:
 INTEGRATION: CWS rpt23fix02 (1.2.4); FILE MERGED
 2007/08/02 08:17:11 oj 1.2.4.4: #i79942# correct simple import export failure
 2007/07/30 05:53:18 oj 1.2.4.3: #80154# repeat-section corrected
 2007/07/24 08:34:23 oj 1.2.4.2: #i79942# handle shapes correctly
 2007/07/24 08:32:44 oj 1.2.4.1: #i79942# handle shapes correctly

File Changes:

Directory: /dba/reportdesign/source/filter/xml/
===============================================

File [changed]: xmlTable.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlTable.cxx?r1=1.2&r2=1.3
Delta lines:  +60 -51
---------------------
--- xmlTable.cxx        2007-07-09 11:56:18+0000        1.2
+++ xmlTable.cxx        2007-08-03 09:58:22+0000        1.3
@@ -147,9 +147,7 @@
                            case XML_TOK_KEEP_TOGETHER:
                                    m_xSection->setKeepTogether(sValue == 
s_sTRUE);
                                    break;
-                           case XML_TOK_REPEAT_SECTION:
-                                   m_xSection->setRepeatSection(sValue == 
s_sTRUE );
-                                   break;
+                           
                            case XML_TOK_SECTION_NAME:
                                    m_xSection->setName(sValue);
                                    break;
@@ -251,9 +249,13 @@
                 for (sal_Int32 j = 0; aColIter != aColEnd; ++aColIter,++j)
                 {
                     TCell& rCell = *aColIter;
-                    if ( rCell.xElement.is())
+                    if ( !rCell.xElements.empty())
+                    {
+                        ::std::vector< uno::Reference< 
report::XReportComponent> >::iterator aCellIter = rCell.xElements.begin();
+                        const ::std::vector< uno::Reference< 
report::XReportComponent> >::iterator aCellEnd = rCell.xElements.end();
+                        for (;aCellIter != aCellEnd ; ++aCellIter)
                     {
-                        uno::Reference<report::XShape> 
xShape(rCell.xElement,uno::UNO_QUERY);
+                            uno::Reference<report::XShape> 
xShape(*aCellIter,uno::UNO_QUERY);
                         if ( xShape.is() )
                         {
                             xShape->setPositionX(xShape->getPositionX() + 
nLeftMargin);
@@ -283,7 +285,7 @@
                                     --nRowSpan;
                                 }
                             }
-                            Reference<XFixedLine> 
xFixedLine(rCell.xElement,uno::UNO_QUERY);
+                                Reference<XFixedLine> 
xFixedLine(*aCellIter,uno::UNO_QUERY);
                             if ( xFixedLine.is() && 
xFixedLine->getOrientation() == 1 ) // vertical
                             {
                                 OSL_ENSURE(static_cast<sal_uInt32>(j+1) < 
m_aWidth.size(),"Illegal pos of col iter. There should be an empty cell for the 
next line part.");
@@ -292,8 +294,8 @@
                             }
                             try
                             {
-                                
rCell.xElement->setSize(awt::Size(nWidth,nHeight));
-                                
rCell.xElement->setPosition(awt::Point(nPosX,nPosY));                           
     
+                                    
(*aCellIter)->setSize(awt::Size(nWidth,nHeight));
+                                    
(*aCellIter)->setPosition(awt::Point(nPosX,nPosY));                             
   
                             }
                             catch(beans::PropertyVetoException)
                             {
@@ -301,6 +303,7 @@
                             }
                         }
                     }
+                    }
                     nPosX += m_aWidth[j];
                 }
                 nPosY += m_aHeight[i];
@@ -315,18 +318,24 @@
 // 
-----------------------------------------------------------------------------
 void OXMLTable::addCell(const Reference<XReportComponent>& _xElement)
 {
+    uno::Reference<report::XShape> xShape(_xElement,uno::UNO_QUERY);
     OSL_ENSURE(static_cast<sal_uInt32>(m_nRowIndex-1 ) < m_aGrid.size() && 
static_cast<sal_uInt32>( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size(),
         "OXMLTable::addCell: Invalid column and row index");
     if ( static_cast<sal_uInt32>(m_nRowIndex-1 ) < m_aGrid.size() && 
static_cast<sal_uInt32>( m_nColumnIndex-1 ) < m_aGrid[m_nRowIndex-1].size() )
     {
         TCell& rCell = m_aGrid[m_nRowIndex-1][m_nColumnIndex-1];
-        rCell.xElement = _xElement;
+        if ( _xElement.is() )
+            rCell.xElements.push_back( _xElement );
+        if ( !xShape.is() )
+        {
         rCell.nWidth   = m_aWidth[m_nColumnIndex-1];
         rCell.nHeight  = m_aHeight[m_nRowIndex-1];
         rCell.nColSpan = m_nColSpan;
         rCell.nRowSpan = m_nRowSpan;
     }
+    }
 
+    if ( !xShape.is() )
     m_nColSpan = m_nRowSpan = 1;
 }
 // 
-----------------------------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to