Tag: cws_src680_rpt23fix02
User: oj      
Date: 2007-07-31 06:56:28+0000
Modified:
   dba/reportdesign/source/filter/xml/xmlCell.cxx
   dba/reportdesign/source/filter/xml/xmlCell.hxx

Log:
 #i77152# shape include

File Changes:

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

File [changed]: xmlCell.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlCell.cxx?r1=1.2.4.1&r2=1.2.4.2
Delta lines:  +20 -10
---------------------
--- xmlCell.cxx 2007-07-24 08:32:44+0000        1.2.4.1
+++ xmlCell.cxx 2007-07-31 06:56:25+0000        1.2.4.2
@@ -73,6 +73,7 @@
 #ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HXX_
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #endif
+#include <com/sun/star/report/XShape.hpp>
 #include <com/sun/star/report/XFixedLine.hpp>
 #include <com/sun/star/table/BorderLine.hpp>
 #ifndef RPT_SHARED_XMLSTRINGS_HRC
@@ -117,7 +118,8 @@
        SvXMLImportContext( rImport, nPrfx, _sLocalName )
        ,m_pContainer(_pContainer)
     ,m_pCell(_pCell)
-    ,m_bShape(false)
+    ,m_nCurrentCount(0)
+    ,m_bContainsShape(false)
 {
     DBG_CTOR( rpt_OXMLCell,NULL);
     if ( !m_pCell )
@@ -225,15 +227,16 @@
             {
                 UniReference< XMLShapeImportHelper > xShapeImportHelper = 
rImport.GetShapeImport();
                 uno::Reference< drawing::XShapes > xShapes = 
m_pContainer->getSection().get();
+                m_nCurrentCount = m_pContainer->getSection()->getCount();
                 pContext = 
xShapeImportHelper->CreateGroupChildContext(rImport,_nPrefix,_rLocalName,xAttrList,xShapes);
-                m_bShape = true;
+                m_bContainsShape = true;
             }
             break;
         default:
             break;
        }
 
-    if ( m_xComponent.is() && !m_bShape )
+    if ( m_xComponent.is() && !m_bContainsShape )
         m_pContainer->addCell(m_xComponent);
 
        if( !pContext )
@@ -244,13 +247,20 @@
 // 
-----------------------------------------------------------------------------
 void OXMLCell::EndElement()
 {
-    if ( m_bShape )
+    if ( m_bContainsShape )
     {
-        
m_xComponent.set(m_pContainer->getSection()->getByIndex(m_pContainer->getSection()->getCount()-1),uno::UNO_QUERY);
-        m_pContainer->addCell(m_xComponent);
+        const sal_Int32 nCount = m_pContainer->getSection()->getCount();
+        for (sal_Int32 i = m_nCurrentCount; i < nCount; ++i)
+        {
+            uno::Reference<report::XShape> 
xShape(m_pContainer->getSection()->getByIndex(i),uno::UNO_QUERY);
+            if ( xShape.is() )
+                m_pContainer->addCell(xShape.get());
+        }
+        //m_xComponent.set(,uno::UNO_QUERY);
+        
         //m_pCell->setComponent(m_xComponent);
     }
-    else if ( m_pCell != this && m_sText.getLength() )
+    if ( m_pCell != this && m_sText.getLength() )
     {
         ORptFilter& rImport = GetOwnImport();
         Reference<XMultiServiceFactory> 
xFactor(rImport.GetModel(),uno::UNO_QUERY);

File [changed]: xmlCell.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlCell.hxx?r1=1.2&r2=1.2.4.1
Delta lines:  +5 -4
-------------------
--- xmlCell.hxx 2007-07-09 11:56:17+0000        1.2
+++ xmlCell.hxx 2007-07-31 06:56:25+0000        1.2.4.1
@@ -53,7 +53,8 @@
         OXMLCell*       m_pCell;
                ::rtl::OUString m_sStyleName;
         ::rtl::OUString m_sText;
-        bool            m_bShape;
+        sal_Int32       m_nCurrentCount;
+        bool            m_bContainsShape;
 
                ORptFilter& GetOwnImport();
         OXMLCell(const OXMLCell&);




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

Reply via email to