Tag: cws_src680_rptchart01
User: oj      
Date: 2008-01-25 13:56:03+0000
Modified:
   dba/reportdesign/source/filter/xml/makefile.mk
   dba/reportdesign/source/filter/xml/xmlCell.cxx
   dba/reportdesign/source/filter/xml/xmlEnums.hxx
   dba/reportdesign/source/filter/xml/xmlExport.cxx
   dba/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
   dba/reportdesign/source/filter/xml/xmlHelper.cxx
   dba/reportdesign/source/filter/xml/xmlHelper.hxx
   dba/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
   dba/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx
   dba/reportdesign/source/filter/xml/xmlMasterFields.cxx
   dba/reportdesign/source/filter/xml/xmlMasterFields.hxx
   dba/reportdesign/source/filter/xml/xmlReport.cxx
   dba/reportdesign/source/filter/xml/xmlReport.hxx
   dba/reportdesign/source/filter/xml/xmlfilter.cxx

Log:
 #i85225# export master detail different now

File Changes:

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

File [changed]: makefile.mk
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/makefile.mk?r1=1.2.70.1&r2=1.2.70.2
Delta lines:  +2 -3
-------------------
--- makefile.mk 2008-01-24 12:39:32+0000        1.2.70.1
+++ makefile.mk 2008-01-25 13:56:00+0000        1.2.70.2
@@ -4,9 +4,9 @@
 #
 #   $RCSfile: makefile.mk,v $
 #
-#   $Revision: 1.2.70.1 $
+#   $Revision: 1.2.70.2 $
 #
-#   last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+#   last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
 #
 #   The Contents of this file are made available subject to
 #   the terms of GNU Lesser General Public License Version 2.1.
@@ -46,7 +46,6 @@
 # --- Files -------------------------------------
 SLOFILES=      $(SLO)$/xmlfilter.obj                           \
                        $(SLO)$/xmlReport.obj                           \
-                       $(SLO)$/xmlSubDocument.obj                      \
                        $(SLO)$/xmlMasterFields.obj                     \
                        $(SLO)$/xmlGroup.obj                            \
                        $(SLO)$/xmlHelper.obj                           \

File [changed]: xmlCell.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlCell.cxx?r1=1.5.20.1&r2=1.5.20.2
Delta lines:  +13 -16
---------------------
--- xmlCell.cxx 2008-01-24 12:39:32+0000        1.5.20.1
+++ xmlCell.cxx 2008-01-25 13:56:00+0000        1.5.20.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlCell.cxx,v $
  *
- *  $Revision: 1.5.20.1 $
+ *  $Revision: 1.5.20.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -91,9 +91,6 @@
 #ifndef RPT_XMLIMAGE_HXX
 #include "xmlImage.hxx"
 #endif
-#ifndef RPT_XMLSUBDOCUMENT_HXX
-#include "xmlSubDocument.hxx"
-#endif
 #ifndef RPT_XMLFIXEDCONTENT_HXX
 #include "xmlFixedContent.hxx"
 #endif
@@ -207,17 +204,17 @@
                                        pContext = new OXMLImage( rImport, 
_nPrefix, _rLocalName,xAttrList,xControl.get(),m_pContainer);
                        }
                        break;
-        case XML_TOK_SUB_DOCUMENT:
-                       {
-                               rImport.GetProgressBarHelper()->Increment( 
PROGRESS_BAR_STEP );
-                Reference< XReportDefinition > 
xControl(xFactor->createInstance(SERVICE_REPORTDEFINITION),uno::UNO_QUERY);
-                
-                               OSL_ENSURE(xControl.is(),"Could not create 
ReportDefinition!");
-                setComponent(xControl.get());
-                               if ( xControl.is() )
-                                   pContext = new OXMLSubDocument( rImport, 
_nPrefix, _rLocalName,xControl.get(),m_pContainer);
-                       }
-                       break;
+   //     case XML_TOK_SUB_DOCUMENT:
+                       //{
+                       //      rImport.GetProgressBarHelper()->Increment( 
PROGRESS_BAR_STEP );
+   //             Reference< XReportDefinition > 
xControl(xFactor->createInstance(SERVICE_REPORTDEFINITION),uno::UNO_QUERY);
+   //             
+                       //      OSL_ENSURE(xControl.is(),"Could not create 
ReportDefinition!");
+   //             setComponent(xControl.get());
+                       //      if ( xControl.is() )
+                       //          pContext = new OXMLSubDocument( rImport, 
_nPrefix, _rLocalName,xControl.get(),m_pContainer);
+                       //}
+                       //break;
 
         case XML_TOK_P:
                        pContext = new OXMLCell( rImport, _nPrefix, 
_rLocalName,xAttrList ,m_pContainer,this);

File [changed]: xmlEnums.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlEnums.hxx?r1=1.3.20.1&r2=1.3.20.2
Delta lines:  +5 -5
-------------------
--- xmlEnums.hxx        2008-01-24 12:39:32+0000        1.3.20.1
+++ xmlEnums.hxx        2008-01-25 13:56:00+0000        1.3.20.2
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: xmlEnums.hxx,v $
  *
- *  $Revision: 1.3.20.1 $
+ *  $Revision: 1.3.20.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -66,7 +66,8 @@
         XML_TOK_REPORT_FUNCTION         ,
                XML_TOK_REPORT_ELEMENT          ,
         XML_TOK_REPORT_MIMETYPE         ,
-        XML_TOK_REPORT_NAME
+        XML_TOK_REPORT_NAME             ,
+        XML_TOK_MASTER_DETAIL_FIELDS
        };
        enum XMLGroup
        {
@@ -167,8 +168,7 @@
        };
     enum XMLSubDocument
        {
-                XML_TOK_MASTER_DETAIL_FIELDS
-               ,XML_TOK_MASTER_DETAIL_FIELD
+               XML_TOK_MASTER_DETAIL_FIELD
         ,XML_TOK_MASTER
         ,XML_TOK_SUB_DETAIL
        };

File [changed]: xmlExport.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlExport.cxx?r1=1.6.20.1&r2=1.6.20.2
Delta lines:  +4 -11
--------------------
--- xmlExport.cxx       2008-01-24 12:39:32+0000        1.6.20.1
+++ xmlExport.cxx       2008-01-25 13:56:00+0000        1.6.20.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlExport.cxx,v $
  *
- *  $Revision: 1.6.20.1 $
+ *  $Revision: 1.6.20.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -448,7 +448,7 @@
         SvXMLElementExport aElement(*this,XML_NAMESPACE_REPORT, 
XML_MASTER_DETAIL_FIELDS, sal_True, sal_True);
         const uno::Sequence< ::rtl::OUString> aDetailFields = 
_xReportDefinition->getDetailFields();
 
-        OSL_ENSURE(aDetailFields.getLength() == aMasterFields.getLength(),"not 
equal length for amster and detail fields!");
+        OSL_ENSURE(aDetailFields.getLength() == aMasterFields.getLength(),"not 
equal length for master and detail fields!");
 
         const ::rtl::OUString* pDetailFieldsIter = 
aDetailFields.getConstArray();
         const ::rtl::OUString* pIter = aMasterFields.getConstArray();
@@ -469,6 +469,7 @@
        {
         exportFunctions(_xReportDefinition->getFunctions().get());
         exportGroupsExpressionAsFunction(_xReportDefinition->getGroups());
+        exportMasterDetailFields(_xReportDefinition);
                
                if ( _xReportDefinition->getReportHeaderOn() )
                {
@@ -1094,7 +1095,6 @@
                                     exportContainer(xSection);
                                 else if ( eToken == XML_SUB_DOCUMENT && 
xReportDefinition.is() )
                                 {
-                                    
exportMasterDetailFields(xReportDefinition);
                                     SvXMLElementExport aOfficeElement( *this, 
XML_NAMESPACE_OFFICE, XML_BODY,sal_True, sal_True );
                                                SvXMLElementExport aElem( 
*this, sal_True,
                                                                                
                XML_NAMESPACE_OFFICE, XML_REPORT,
@@ -1698,13 +1698,6 @@
         uno::Reference< XShape > 
xShape(_xSection->getByIndex(i),uno::UNO_QUERY);
         if ( xShape.is() )
         {
-            ::std::auto_ptr<SvXMLElementExport> pSubDocument;
-            Reference<XServiceInfo> xElement(xShape,uno::UNO_QUERY_THROW);
-            if ( 
xElement->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.OLE2Shape")))
 )
-            {
-                pSubDocument.reset(new 
SvXMLElementExport(*this,XML_NAMESPACE_REPORT, XML_SUB_DOCUMENT, sal_False, 
sal_False));
-            }
-
             AddAttribute( XML_NAMESPACE_TEXT, XML_ANCHOR_TYPE, XML_PARAGRAPH );
             
xShapeExport->exportShape(xShape.get(),SEF_DEFAULT|SEF_EXPORT_NO_WS,&aRefPoint);
         }

File [changed]: xmlExportDocumentHandler.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx?r1=1.1.2.1&r2=1.1.2.2
Delta lines:  +40 -3
--------------------
--- xmlExportDocumentHandler.cxx        2008-01-24 12:40:10+0000        1.1.2.1
+++ xmlExportDocumentHandler.cxx        2008-01-25 13:56:00+0000        1.1.2.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlExportDocumentHandler.cxx,v $
  *
- *  $Revision: 1.1.2.1 $
+ *  $Revision: 1.1.2.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:40:10 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -167,6 +167,29 @@
         
pList->AddAttribute(lcl_createAttribute(XML_NP_OFFICE,XML_MIMETYPE),MIMETYPE_OASIS_OPENDOCUMENT_CHART);
         
         
m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_REPORT),xNewAttribs);
+
+        const uno::Sequence< ::rtl::OUString > aDetailFields = 
m_xDatabaseDataProvider->getDetailFields();
+        if ( aDetailFields.getLength() )
+        {
+            
m_xDelegatee->startElement(lcl_createAttribute(XML_NP_RPT,XML_MASTER_DETAIL_FIELDS),NULL);
+            const uno::Sequence< ::rtl::OUString > aMasterFields = 
m_xDatabaseDataProvider->getMasterFields();
+            OSL_ENSURE(aDetailFields.getLength() == 
aMasterFields.getLength(),"not equal length for master and detail fields!");
+            const ::rtl::OUString sDetailToken = 
lcl_createAttribute(XML_NP_RPT, XML_DETAIL);
+            const ::rtl::OUString sMasterToken = 
lcl_createAttribute(XML_NP_RPT, XML_MASTER);
+            const ::rtl::OUString sElementToken = 
lcl_createAttribute(XML_NP_RPT,XML_MASTER_DETAIL_FIELD);
+            const ::rtl::OUString* pDetailFieldsIter = 
aDetailFields.getConstArray();
+            const ::rtl::OUString* pIter = aMasterFields.getConstArray();
+            const ::rtl::OUString* pEnd          = pIter + 
aMasterFields.getLength();
+            for(;pIter != pEnd;++pIter,++pDetailFieldsIter)
+            {
+                pList = new SvXMLAttributeList();
+                xNewAttribs = pList;
+                pList->AddAttribute( sMasterToken , *pIter );
+                if ( pDetailFieldsIter->getLength() )
+                    pList->AddAttribute( sDetailToken , *pDetailFieldsIter );
+                m_xDelegatee->startElement(sElementToken,xNewAttribs);
+            }
+        }
         bExport = false;
     }
     else if ( _sName.equalsAscii("table:table") )
@@ -209,7 +232,21 @@
     bool bExport = true;
     ::rtl::OUString sNewName = _sName;
     if ( _sName.equalsAscii("office:chart") )
+    {
+        const uno::Sequence< ::rtl::OUString > aDetailFields = 
m_xDatabaseDataProvider->getDetailFields();
+        if ( aDetailFields.getLength() )
+        {
+            const uno::Sequence< ::rtl::OUString > aMasterFields = 
m_xDatabaseDataProvider->getMasterFields();
+            OSL_ENSURE(aDetailFields.getLength() == 
aMasterFields.getLength(),"not equal length for master and detail fields!");
+            const ::rtl::OUString* pIter = aMasterFields.getConstArray();
+            const ::rtl::OUString* pEnd          = pIter + 
aMasterFields.getLength();
+            for(;pIter != pEnd;++pIter)
+                
m_xDelegatee->endElement(lcl_createAttribute(XML_NP_RPT,XML_MASTER_DETAIL_FIELD));
+            
m_xDelegatee->endElement(lcl_createAttribute(XML_NP_RPT,XML_MASTER_DETAIL_FIELDS));
+        }        
+        
         sNewName = lcl_createAttribute(XML_NP_OFFICE,XML_REPORT);
+    }
     else if ( _sName.equalsAscii("table:table") )
     {
         m_xDelegatee->endElement(_sName);

File [changed]: xmlHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlHelper.cxx?r1=1.4.62.1&r2=1.4.62.2
Delta lines:  +16 -2
--------------------
--- xmlHelper.cxx       2008-01-24 12:39:32+0000        1.4.62.1
+++ xmlHelper.cxx       2008-01-25 13:56:00+0000        1.4.62.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlHelper.cxx,v $
  *
- *  $Revision: 1.4.62.1 $
+ *  $Revision: 1.4.62.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -507,10 +507,24 @@
         { XML_NAMESPACE_REPORT,        XML_FUNCTION,                           
XML_TOK_REPORT_FUNCTION                 },
         { XML_NAMESPACE_OFFICE,        XML_MIMETYPE,                           
XML_TOK_REPORT_MIMETYPE                 },
         { XML_NAMESPACE_DRAW,  XML_NAME,                                   
XML_TOK_REPORT_NAME                     },
+        { XML_NAMESPACE_REPORT,        XML_MASTER_DETAIL_FIELDS,           
XML_TOK_MASTER_DETAIL_FIELDS    },
                XML_TOKEN_MAP_END
        };
     return new SvXMLTokenMap( aElemTokenMap );
 }
+// 
-----------------------------------------------------------------------------
+SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap()
+{
+       static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
+       {
+        { XML_NAMESPACE_REPORT,        XML_MASTER_DETAIL_FIELD,        
XML_TOK_MASTER_DETAIL_FIELD},
+        { XML_NAMESPACE_REPORT,        XML_MASTER,                     
XML_TOK_MASTER},
+        { XML_NAMESPACE_REPORT,        XML_DETAIL,                     
XML_TOK_SUB_DETAIL},
+               XML_TOKEN_MAP_END
+       };
+       return new SvXMLTokenMap( aElemTokenMap );
+}
+
 
 // 
-----------------------------------------------------------------------------
 } // rptxml

File [changed]: xmlHelper.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlHelper.hxx?r1=1.2.70.1&r2=1.2.70.2
Delta lines:  +3 -2
-------------------
--- xmlHelper.hxx       2008-01-24 12:39:32+0000        1.2.70.1
+++ xmlHelper.hxx       2008-01-25 13:56:00+0000        1.2.70.2
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: xmlHelper.hxx,v $
  *
- *  $Revision: 1.2.70.1 $
+ *  $Revision: 1.2.70.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -107,6 +107,7 @@
         static com::sun::star::uno::Reference< 
com::sun::star::beans::XPropertySet> createBorderPropertySet();
 
         static SvXMLTokenMap* GetReportElemTokenMap();
+        static SvXMLTokenMap* GetSubDocumentElemTokenMap();
        };
 // 
-----------------------------------------------------------------------------
 } // rptxml

File [changed]: xmlImportDocumentHandler.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx?r1=1.1.2.1&r2=1.1.2.2
Delta lines:  +53 -3
--------------------
--- xmlImportDocumentHandler.cxx        2008-01-24 12:40:30+0000        1.1.2.1
+++ xmlImportDocumentHandler.cxx        2008-01-25 13:56:00+0000        1.1.2.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlImportDocumentHandler.cxx,v $
  *
- *  $Revision: 1.1.2.1 $
+ *  $Revision: 1.1.2.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:40:30 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -179,8 +179,49 @@
         
m_xDelegatee->startElement(lcl_createAttribute(XML_NP_OFFICE,XML_CHART),NULL);
         bExport = false;
     }
+    else if ( _sName.equalsAscii("rpt:master-detail-field") )
+    {
+        const sal_Int16 nLength = (_xAttrList.is()) ? _xAttrList->getLength() 
: 0;
+        static const ::rtl::OUString s_sTRUE = 
::xmloff::token::GetXMLToken(XML_TRUE);
+        ::std::auto_ptr<SvXMLTokenMap> pMasterElemTokenMap( 
OXMLHelper::GetSubDocumentElemTokenMap());
+           try
+           {
+            ::rtl::OUString sMasterField,sDetailField;
+                   for(sal_Int16 i = 0; i < nLength; ++i)
+                   {
+                       ::rtl::OUString sLocalName;
+                           const rtl::OUString sAttrName = 
_xAttrList->getNameByIndex( i );
+                const sal_Int32 nColonPos = sAttrName.indexOf( 
sal_Unicode(':') );
+                if( -1L == nColonPos )
+                    sLocalName = sAttrName;
+                else
+                    sLocalName = sAttrName.copy( nColonPos + 1L );
+                           const rtl::OUString sValue = 
_xAttrList->getValueByIndex( i );
+
+                           switch( pMasterElemTokenMap->Get( 
XML_NAMESPACE_REPORT, sLocalName ) )
+                           {
+                                   case XML_TOK_MASTER: 
+                        sMasterField = sValue;
+                                           break;
+                                   case XML_TOK_SUB_DETAIL: 
+                        sDetailField = sValue;
+                                           break;
+                           }
+                   }
+            if ( !sDetailField.getLength() )
+                sDetailField = sMasterField;
+            m_aMasterFields.push_back(sMasterField);
+            m_aDetailFields.push_back(sDetailField);
+           }
+        catch(uno::Exception&)
+           {
+                   OSL_ENSURE(0,"Exception catched while filling the report 
definition props");
+           }
+        bExport = false;
+    }
     else if ( _sName.equalsAscii("rpt:detail") 
         ||    _sName.equalsAscii("rpt:formatted-text")
+        ||    _sName.equalsAscii("rpt:master-detail-fields")
         ||    _sName.equalsAscii("rpt:report-component")
         ||    _sName.equalsAscii("rpt:report-element"))
         bExport = false;
@@ -195,8 +236,17 @@
     ::rtl::OUString sNewName = _sName;
     if ( _sName.equalsAscii("office:report") )
         sNewName = lcl_createAttribute(XML_NP_OFFICE,XML_CHART);
+    else if ( _sName.equalsAscii("rpt:master-detail-fields") )
+    {
+        if ( !m_aMasterFields.empty() )
+            m_xDatabaseDataProvider->setMasterFields(uno::Sequence< 
::rtl::OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size()));
+        if ( !m_aDetailFields.empty() )
+            m_xDatabaseDataProvider->setDetailFields(uno::Sequence< 
::rtl::OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
+        bExport = false;
+    }
     else if ( _sName.equalsAscii("rpt:detail") 
         ||    _sName.equalsAscii("rpt:formatted-text")
+        ||    _sName.equalsAscii("rpt:master-detail-field")
         ||    _sName.equalsAscii("rpt:report-component")
         ||    _sName.equalsAscii("rpt:report-element"))
         bExport = false;

File [changed]: xmlImportDocumentHandler.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx?r1=1.1.2.1&r2=1.1.2.2
Delta lines:  +5 -3
-------------------
--- xmlImportDocumentHandler.hxx        2008-01-24 12:40:38+0000        1.1.2.1
+++ xmlImportDocumentHandler.hxx        2008-01-25 13:56:00+0000        1.1.2.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlImportDocumentHandler.hxx,v $
  *
- *  $Revision: 1.1.2.1 $
+ *  $Revision: 1.1.2.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:40:38 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -93,6 +93,8 @@
     virtual ~ImportDocumentHandler();
 
     ::osl::Mutex                                                               
         m_aMutex;
+    ::std::vector< ::rtl::OUString>                                            
         m_aMasterFields;
+    ::std::vector< ::rtl::OUString>                                            
         m_aDetailFields;
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext 
>        m_xContext;
     ::com::sun::star::uno::Reference< 
::com::sun::star::xml::sax::XDocumentHandler >    m_xDelegatee;
     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation >    
         m_xProxy;

File [changed]: xmlMasterFields.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlMasterFields.cxx?r1=1.4&r2=1.4.20.1
Delta lines:  +8 -10
--------------------
--- xmlMasterFields.cxx 2007-11-20 19:02:50+0000        1.4
+++ xmlMasterFields.cxx 2008-01-25 13:56:00+0000        1.4.20.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlMasterFields.cxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.4.20.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/20 19:02:50 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -52,9 +52,7 @@
 #ifndef RPT_XMLENUMS_HXX
 #include "xmlEnums.hxx"
 #endif
-#ifndef RPT_XMLSUBDOCUMENT_HXX
-#include "xmlSubDocument.hxx"
-#endif
+#include "xmlReport.hxx"
 #ifndef _TOOLS_DEBUG_HXX
 #include <tools/debug.hxx>
 #endif
@@ -71,10 +69,10 @@
 OXMLMasterFields::OXMLMasterFields( ORptFilter& rImport,
                                sal_uInt16 nPrfx, const ::rtl::OUString& rLName,
                                const Reference< XAttributeList > & _xAttrList
-                               ,OXMLSubDocument* _pSubDocument
+                               ,OXMLReport* _pReport
                 ) :
        SvXMLImportContext( rImport, nPrfx, rLName)
-,m_pSubDocument(_pSubDocument)
+,m_pReport(_pReport)
 {
     DBG_CTOR( rpt_OXMLMasterFields,NULL);
 
@@ -104,7 +102,7 @@
        }
     if ( !sDetailField.getLength() )
         sDetailField = sMasterField;
-    m_pSubDocument->addFieldPair(::std::pair< ::rtl::OUString,::rtl::OUString 
>(sMasterField,sDetailField));
+    m_pReport->addMasterDetailPair(::std::pair< 
::rtl::OUString,::rtl::OUString >(sMasterField,sDetailField));
 }
 // 
-----------------------------------------------------------------------------
 
@@ -127,7 +125,7 @@
                case XML_TOK_MASTER_DETAIL_FIELD:
                        {
                                GetImport().GetProgressBarHelper()->Increment( 
PROGRESS_BAR_STEP );
-                pContext = new 
OXMLMasterFields(static_cast<ORptFilter&>(GetImport()), _nPrefix, 
_rLocalName,xAttrList ,m_pSubDocument);
+                pContext = new 
OXMLMasterFields(static_cast<ORptFilter&>(GetImport()), _nPrefix, 
_rLocalName,xAttrList ,m_pReport);
             }
             break;
         default:

File [changed]: xmlMasterFields.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlMasterFields.hxx?r1=1.2&r2=1.2.70.1
Delta lines:  +5 -5
-------------------
--- xmlMasterFields.hxx 2007-07-09 11:56:18+0000        1.2
+++ xmlMasterFields.hxx 2008-01-25 13:56:00+0000        1.2.70.1
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: xmlMasterFields.hxx,v $
  *
- *  $Revision: 1.2 $
+ *  $Revision: 1.2.70.1 $
  *
- *  last change: $Author: rt $ $Date: 2007/07/09 11:56:18 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -41,10 +41,10 @@
 namespace rptxml
 {
        class ORptFilter;
-    class OXMLSubDocument;
+    class OXMLReport;
        class OXMLMasterFields : public SvXMLImportContext
        {
-        OXMLSubDocument* m_pSubDocument;
+        OXMLReport* m_pReport;
         OXMLMasterFields(const OXMLMasterFields&);
         void operator =(const OXMLMasterFields&);
        public:
@@ -52,7 +52,7 @@
                OXMLMasterFields( ORptFilter& rImport, sal_uInt16 nPrfx,
                                        const ::rtl::OUString& rLName,
                                        const ::com::sun::star::uno::Reference< 
::com::sun::star::xml::sax::XAttributeList > & xAttrList
-                    ,OXMLSubDocument* _pSubDocument);
+                    ,OXMLReport* _pReport);
                virtual ~OXMLMasterFields();
 
         virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,

File [changed]: xmlReport.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlReport.cxx?r1=1.5&r2=1.5.20.1
Delta lines:  +19 -3
--------------------
--- xmlReport.cxx       2007-11-20 19:03:08+0000        1.5
+++ xmlReport.cxx       2008-01-25 13:56:00+0000        1.5.20.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlReport.cxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.5.20.1 $
  *
- *  last change: $Author: ihi $ $Date: 2007/11/20 19:03:08 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -73,6 +73,7 @@
 #ifndef _COM_SUN_STAR_SDB_COMMANDTYPE_HPP_
 #include <com/sun/star/sdb/CommandType.hpp>
 #endif
+#include "xmlMasterFields.hxx"
 
 namespace rptxml
 {
@@ -202,6 +203,10 @@
                                pContext = new OXMLFunction( m_rImport, 
nPrefix, rLocalName,xAttrList,m_xComponent.get(),true);
                        }
                        break;
+        case XML_TOK_MASTER_DETAIL_FIELDS:
+                m_rImport.GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP 
);
+                pContext = new OXMLMasterFields(m_rImport, nPrefix, 
rLocalName,xAttrList ,this);
+            break;
                case XML_TOK_REPORT_HEADER:
                        {
                                m_rImport.GetProgressBarHelper()->Increment( 
PROGRESS_BAR_STEP );
@@ -259,6 +264,17 @@
     const ORptFilter::TGroupFunctionMap::const_iterator aEnd = 
aFunctions.end();
     for (; aIter != aEnd; ++aIter)
         
xFunctions->insertByIndex(xFunctions->getCount(),uno::makeAny(aIter->second));
+
+    if ( !m_aMasterFields.empty() )
+        m_xComponent->setMasterFields(Sequence< 
::rtl::OUString>(&*m_aMasterFields.begin(),m_aMasterFields.size()));
+    if ( !m_aDetailFields.empty() )
+        m_xComponent->setDetailFields(Sequence< 
::rtl::OUString>(&*m_aDetailFields.begin(),m_aDetailFields.size()));
+}
+// 
-----------------------------------------------------------------------------
+void OXMLReport::addMasterDetailPair(const ::std::pair< 
::rtl::OUString,::rtl::OUString >& _aPair)
+{
+    m_aMasterFields.push_back(_aPair.first);
+    m_aDetailFields.push_back(_aPair.second);
 }
 //----------------------------------------------------------------------------
 } // namespace rptxml

File [changed]: xmlReport.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlReport.hxx?r1=1.3&r2=1.3.62.1
Delta lines:  +8 -3
-------------------
--- xmlReport.hxx       2007-08-02 14:34:08+0000        1.3
+++ xmlReport.hxx       2008-01-25 13:56:00+0000        1.3.62.1
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: xmlReport.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.3.62.1 $
  *
- *  last change: $Author: hr $ $Date: 2007/08/02 14:34:08 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -38,6 +38,7 @@
 #ifndef RPT_XMLREPORTELEMENTBASE_HXX
 #include "xmlReportElementBase.hxx"
 #endif
+#include <vector>
 
 namespace rptxml
 {
@@ -45,6 +46,8 @@
        class OXMLReport : public OXMLReportElementBase
        {
         ::com::sun::star::uno::Reference< 
::com::sun::star::report::XReportDefinition > m_xComponent;
+        ::std::vector< ::rtl::OUString> m_aMasterFields;
+        ::std::vector< ::rtl::OUString> m_aDetailFields;
         OXMLReport(const OXMLReport&);
         void operator =(const OXMLReport&);
        public:
@@ -62,6 +65,8 @@
 
         virtual void EndElement();
 
+        void addMasterDetailPair(const ::std::pair< 
::rtl::OUString,::rtl::OUString >& _aPair);
+
     private:
         /** initializes our object's properties whose runtime (API) default is 
different from the file
             format default.

File [changed]: xmlfilter.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/filter/xml/xmlfilter.cxx?r1=1.5.18.1&r2=1.5.18.2
Delta lines:  +3 -13
--------------------
--- xmlfilter.cxx       2008-01-24 12:39:32+0000        1.5.18.1
+++ xmlfilter.cxx       2008-01-25 13:56:00+0000        1.5.18.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: xmlfilter.cxx,v $
  *
- *  $Revision: 1.5.18.1 $
+ *  $Revision: 1.5.18.2 $
  *
- *  last change: $Author: oj $ $Date: 2008/01/24 12:39:32 $
+ *  last change: $Author: oj $ $Date: 2008/01/25 13:56:00 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -763,17 +763,7 @@
 const SvXMLTokenMap& ORptFilter::GetSubDocumentElemTokenMap() const
 {
        if ( !m_pSubDocumentElemTokenMap.get() )
-       {
-               static __FAR_DATA SvXMLTokenMapEntry aElemTokenMap[]=
-               {
-                       { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS,       
XML_TOK_MASTER_DETAIL_FIELDS},
-            { XML_NAMESPACE_REPORT,    XML_MASTER_DETAIL_FIELD,        
XML_TOK_MASTER_DETAIL_FIELD},
-            { XML_NAMESPACE_REPORT,    XML_MASTER,                     
XML_TOK_MASTER},
-            { XML_NAMESPACE_REPORT,    XML_DETAIL,                     
XML_TOK_SUB_DETAIL},
-                       XML_TOKEN_MAP_END
-               };
-               m_pSubDocumentElemTokenMap.reset(new SvXMLTokenMap( 
aElemTokenMap ));
-       }
+               
m_pSubDocumentElemTokenMap.reset(OXMLHelper::GetSubDocumentElemTokenMap());
        return *m_pSubDocumentElemTokenMap;
 }
 // 
-----------------------------------------------------------------------------




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

Reply via email to