User: kz Date: 2008-03-05 17:58:39+0000 Modified: dba/reportdesign/source/core/sdr/RptModel.cxx
Log: INTEGRATION: CWS rptchart01_DEV300 (1.2.70); FILE MERGED 2008/01/24 12:39:31 oj 1.2.70.1: #i85225# changes for chart File Changes: Directory: /dba/reportdesign/source/core/sdr/ ============================================= File [changed]: RptModel.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/RptModel.cxx?r1=1.2&r2=1.3 Delta lines: +17 -13 --------------------- --- RptModel.cxx 2007-07-09 11:56:16+0000 1.2 +++ RptModel.cxx 2008-03-05 17:58:37+0000 1.3 @@ -52,6 +52,7 @@ #endif #include "UndoEnv.hxx" #include "ReportUndoFactory.hxx" +#include "ReportDefinition.hxx" #define ITEMID_COLOR 1 #define ITEMID_BRUSH 2 #define ITEMID_FONT 3 @@ -71,9 +72,10 @@ //---------------------------------------------------------------------------- -OReportModel::OReportModel() : - SdrModel(NULL,NULL) +OReportModel::OReportModel(::reportdesign::OReportDefinition* _pReportDefinition) : + SdrModel(NULL,_pReportDefinition) ,m_pController(NULL) + ,m_pReportDefinition(_pReportDefinition) { DBG_CTOR( rpt_OReportModel,0); SetAllowShapePropertyChangeListener(true); @@ -99,6 +101,7 @@ // ----------------------------------------------------------------------------- void OReportModel::detachController() { + m_pReportDefinition = NULL; m_pController = NULL; m_pUndoEnv->EndListening( *this ); ClearUndoBuffer(); @@ -149,7 +152,7 @@ return pPage; } // ----------------------------------------------------------------------------- -OReportPage* OReportModel::createNewPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection) +OReportPage* OReportModel::createNewPage(const uno::Reference< report::XSection >& _xSection) { OReportPage* pPage = new OReportPage( *this ,_xSection); InsertPage(pPage); @@ -157,7 +160,7 @@ return pPage; } // ----------------------------------------------------------------------------- -OReportPage* OReportModel::getPage(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XSection >& _xSection) +OReportPage* OReportModel::getPage(const uno::Reference< report::XSection >& _xSection) { OReportPage* pPage = NULL; USHORT nCount = GetPageCount(); @@ -181,14 +184,15 @@ // ----------------------------------------------------------------------------- uno::Reference< report::XReportDefinition > OReportModel::getReportDefinition() const { - if ( !m_pController ) - return NULL; - - uno::Reference< report::XReportDefinition > xReportDefinition( m_pController->getModel(), uno::UNO_QUERY ); + uno::Reference< report::XReportDefinition > xReportDefinition = m_pReportDefinition; OSL_ENSURE( xReportDefinition.is(), "OReportModel::getReportDefinition: invalid model at our controller!" ); return xReportDefinition; } - +// ----------------------------------------------------------------------------- +uno::Reference< uno::XInterface > OReportModel::createUnoModel() +{ + return uno::Reference< uno::XInterface >(getReportDefinition(),uno::UNO_QUERY); +} //================================================================== } //rptui //================================================================== --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
