From c88a3d3e8c718bfc448b3030af388d1361efe015 Mon Sep 17 00:00:00 2001 From: Valentin Kettner Date: Mon, 9 Jun 2014 18:27:24 +0200 Subject: Refactored IDocumentChartDataProviderAccess in SwDoc. Into the new class DocumentChartDataProviderManager. Change-Id: I3be038ba276642546223c0c2fba3bea21980b33d --- sw/source/core/attr/format.cxx | 2 +- .../core/doc/DocumentChartDataProviderManager.cxx | 107 +++++++++++++++++++++ sw/source/core/doc/doc.cxx | 12 +++ sw/source/core/doc/docchart.cxx | 66 +------------ sw/source/core/doc/docnew.cxx | 11 +-- sw/source/core/doc/tblrwcl.cxx | 13 +-- sw/source/core/docnode/ndtbl.cxx | 3 +- sw/source/core/edit/edtab.cxx | 3 +- .../core/inc/DocumentChartDataProviderManager.hxx | 68 +++++++++++++ sw/source/core/undo/untbl.cxx | 10 +- sw/source/core/unocore/unochart.cxx | 7 +- sw/source/core/unocore/unocoll.cxx | 3 +- sw/source/uibase/app/docshini.cxx | 7 +- sw/source/uibase/shells/textsh.cxx | 1 + sw/source/uibase/table/chartins.cxx | 1 + sw/source/uibase/uno/unotxdoc.cxx | 1 + 16 files changed, 223 insertions(+), 92 deletions(-) create mode 100644 sw/source/core/doc/DocumentChartDataProviderManager.cxx create mode 100644 sw/source/core/inc/DocumentChartDataProviderManager.hxx (limited to 'sw/source') diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index e0be94b6e6ae..fba99b858304 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -765,7 +765,7 @@ const IDocumentLayoutAccess* SwFmt::getIDocumentLayoutAccess() const { return Ge IDocumentLayoutAccess* SwFmt::getIDocumentLayoutAccess() { return GetDoc(); } IDocumentTimerAccess* SwFmt::getIDocumentTimerAccess() { return GetDoc(); } IDocumentFieldsAccess* SwFmt::getIDocumentFieldsAccess() { return GetDoc(); } -IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return GetDoc(); } +IDocumentChartDataProviderAccess* SwFmt::getIDocumentChartDataProviderAccess() { return & GetDoc()->getIDocumentChartDataProviderAccess(); } void SwFmt::GetGrabBagItem(uno::Any& rVal) const { diff --git a/sw/source/core/doc/DocumentChartDataProviderManager.cxx b/sw/source/core/doc/DocumentChartDataProviderManager.cxx new file mode 100644 index 000000000000..7e8717e4d71a --- /dev/null +++ b/sw/source/core/doc/DocumentChartDataProviderManager.cxx @@ -0,0 +1,107 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include + + +using namespace com::sun::star; +using namespace com::sun::star::uno; + +namespace sw { + +DocumentChartDataProviderManager::DocumentChartDataProviderManager( SwDoc& i_rSwdoc ) : m_rSwdoc( i_rSwdoc ), + maChartDataProviderImplRef(), + mpChartControllerHelper( 0 ) +{ + +} + +SwChartDataProvider * DocumentChartDataProviderManager::GetChartDataProvider( bool bCreate ) const +{ + // since there must be only one instance of this object per document + // we need a mutex here + SolarMutexGuard aGuard; + + if (bCreate && !maChartDataProviderImplRef.is()) + { + maChartDataProviderImplRef = new SwChartDataProvider( & m_rSwdoc ); + } + return maChartDataProviderImplRef.get(); +} +} + +void DocumentChartDataProviderManager::CreateChartInternalDataProviders( const SwTable *pTable ) +{ + if (pTable) + { + OUString aName( pTable->GetFrmFmt()->GetName() ); + SwOLENode *pONd; + SwStartNode *pStNd; + SwNodeIndex aIdx( *m_rSwdoc.GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); + while (0 != (pStNd = aIdx.GetNode().GetStartNode())) + { + ++aIdx; + if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && + aName == pONd->GetChartTblName() /* OLE node is chart? */ && + 0 != (pONd->getLayoutFrm( m_rSwdoc.GetCurrentLayout() )) /* chart frame is not hidden */ ) + { + uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); + if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) + { + uno::Reference< chart2::XChartDocument > xChart( xIP->getComponent(), UNO_QUERY ); + if (xChart.is()) + xChart->createInternalDataProvider( sal_True ); + + // there may be more than one chart for each table thus we need to continue the loop... + } + } + aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); + } + } +} + +SwChartLockController_Helper & DocumentChartDataProviderManager::GetChartControllerHelper() +{ + if (!mpChartControllerHelper) + { + mpChartControllerHelper = new SwChartLockController_Helper( & m_rSwdoc ); + } + return *mpChartControllerHelper; +} + +DocumentChartDataProviderManager::~DocumentChartDataProviderManager() +{ + // clean up chart related structures... + // Note: the chart data provider gets already disposed in ~SwDocShell + // since all UNO API related functionality requires an existing SwDocShell + // this assures that dipose gets called if there is need for it. + maChartDataProviderImplRef.clear(); + delete mpChartControllerHelper; +} + +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index cfe2ef95afd1..4d0766017b8f 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -110,6 +110,7 @@ #include #include #include +#include #include #include @@ -215,6 +216,17 @@ IDocumentSettingAccess & SwDoc::getIDocumentSettingAccess() return *m_pDocumentSettingManager; } +/* IDocumentChartDataProviderAccess */ +IDocumentChartDataProviderAccess const & SwDoc::getIDocumentChartDataProviderAccess() const +{ + return *m_pDocumentChartDataProviderManager; +} + +IDocumentChartDataProviderAccess & SwDoc::getIDocumentChartDataProviderAccess() +{ + return *m_pDocumentChartDataProviderManager; +} + sal_uInt32 SwDoc::getRsid() const { return mnRsid; diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index 9902337ac2ec..4e294dede6f2 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -17,20 +17,16 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include - -#include - #include #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -40,13 +36,9 @@ #include #include #include -#include #include -using namespace com::sun::star; -using namespace com::sun::star::uno; - void SwTable::UpdateCharts() const { GetFrmFmt()->GetDoc()->UpdateCharts( GetFrmFmt()->GetName() ); @@ -127,7 +119,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, SwViewShell& rVSh ) const aName == pONd->GetChartTblName() && pONd->getLayoutFrm( rVSh.GetLayout() ) ) { - SwChartDataProvider *pPCD = GetChartDataProvider(); + SwChartDataProvider *pPCD = getIDocumentChartDataProviderAccess().GetChartDataProvider(); if (pPCD) pPCD->InvalidateTable( &rTbl ); // following this the framework will now take care of repainting @@ -187,7 +179,7 @@ void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const OUString &rNewName ) GetEditShell( &pVSh ); SwTable* pTable = SwTable::FindTable( &rTblFmt ); - SwChartDataProvider *pPCD = GetChartDataProvider(); + SwChartDataProvider *pPCD = getIDocumentChartDataProviderAccess().GetChartDataProvider(); if (pPCD) pPCD->InvalidateTable( pTable ); // following this the framework will now take care of repainting @@ -198,56 +190,4 @@ void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const OUString &rNewName ) SetModified(); } -SwChartDataProvider * SwDoc::GetChartDataProvider( bool bCreate ) const -{ - // since there must be only one instance of this object per document - // we need a mutex here - SolarMutexGuard aGuard; - - if (bCreate && !maChartDataProviderImplRef.is()) - { - maChartDataProviderImplRef = new SwChartDataProvider( this ); - } - return maChartDataProviderImplRef.get(); -} - -void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable ) -{ - if (pTable) - { - OUString aName( pTable->GetFrmFmt()->GetName() ); - SwOLENode *pONd; - SwStartNode *pStNd; - SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); - while (0 != (pStNd = aIdx.GetNode().GetStartNode())) - { - ++aIdx; - if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && - aName == pONd->GetChartTblName() /* OLE node is chart? */ && - 0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ ) - { - uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); - if ( svt::EmbeddedObjectRef::TryRunningState( xIP ) ) - { - uno::Reference< chart2::XChartDocument > xChart( xIP->getComponent(), UNO_QUERY ); - if (xChart.is()) - xChart->createInternalDataProvider( sal_True ); - - // there may be more than one chart for each table thus we need to continue the loop... - } - } - aIdx.Assign( *pStNd->EndOfSectionNode(), + 1 ); - } - } -} - -SwChartLockController_Helper & SwDoc::GetChartControllerHelper() -{ - if (!mpChartControllerHelper) - { - mpChartControllerHelper = new SwChartLockController_Helper( this ); - } - return *mpChartControllerHelper; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index 60a4df370413..e39e41a432ea 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -90,6 +90,7 @@ #include #include #include +#include #include #include @@ -195,6 +196,7 @@ SwDoc::SwDoc() m_pUndoManager(new ::sw::UndoManager( boost::shared_ptr(new SwNodes(this)), *m_pDocumentDrawModelManager, *this, *this)), m_pDocumentSettingManager(new ::sw::DocumentSettingManager(*this)), + m_pDocumentChartDataProviderManager( new sw::DocumentChartDataProviderManager( *this ) ), m_pDeviceAccess( new ::sw::DocumentDeviceManager( *this ) ), mpDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ), mpEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, mpDfltFrmFmt ) ), @@ -240,8 +242,6 @@ SwDoc::SwDoc() mpLayoutCache( 0 ), mpUnoCallBack(new SwModify(0)), mpGrammarContact(createGrammarContact()), - maChartDataProviderImplRef(), - mpChartControllerHelper( 0 ), mpListItemsList( new tImplSortedNodeNumList() ), // #i83479# m_pXmlIdRegistry(), mnAutoFmtRedlnCommentNo( 0 ), @@ -445,13 +445,6 @@ SwDoc::~SwDoc() delete mpListItemsList; mpListItemsList = 0; - // clean up chart related structures... - // Note: the chart data provider gets already disposed in ~SwDocShell - // since all UNO API related functionality requires an existing SwDocShell - // this assures that dipose gets called if there is need for it. - maChartDataProviderImplRef.clear(); - delete mpChartControllerHelper; - delete mpGrammarContact; mpGrammarContact = 0; diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index b5bad26e746a..951e6b110720 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -537,7 +538,7 @@ bool SwTable::InsertCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt, bRes = true; } - SwChartDataProvider *pPCD = pDoc->GetChartDataProvider(); + SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); if (pPCD && nCnt) pPCD->AddRowCols( *this, rBoxes, nCnt, bBehind ); pDoc->UpdateCharts( GetFrmFmt()->GetName() ); @@ -637,7 +638,7 @@ bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, CHECKBOXWIDTH; CHECKTABLELAYOUT; - SwChartDataProvider *pPCD = pDoc->GetChartDataProvider(); + SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); if (pPCD && nCnt) pPCD->AddRowCols( *this, rBoxes, nCnt, bBehind ); pDoc->UpdateCharts( GetFrmFmt()->GetName() ); @@ -1005,7 +1006,7 @@ bool SwTable::DeleteSel( PrepareDelBoxes( rBoxes ); - SwChartDataProvider *pPCD = pDoc->GetChartDataProvider(); + SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); // Delete boxes from last to first for (size_t n = 0; n < rBoxes.size(); ++n) { @@ -1047,7 +1048,7 @@ bool SwTable::OldSplitRow( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCn // TL_CHART2: splitting/merging of a number of cells or rows will usually make // the table too complex to be handled with chart. // Thus we tell the charts to use their own data provider and forget about this table - pDoc->CreateChartInternalDataProviders( this ); + pDoc->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( this ); SetHTMLTableLayout( 0 ); // Delete HTML Layout @@ -1189,7 +1190,7 @@ bool SwTable::SplitCol( SwDoc* pDoc, const SwSelBoxes& rBoxes, sal_uInt16 nCnt ) // TL_CHART2: splitting/merging of a number of cells or rows will usually make // the table too complex to be handled with chart. // Thus we tell the charts to use their own data provider and forget about this table - pDoc->CreateChartInternalDataProviders( this ); + pDoc->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( this ); SetHTMLTableLayout( 0 ); // Delete HTML Layout SwSelBoxes aSelBoxes(rBoxes); @@ -1641,7 +1642,7 @@ bool SwTable::OldMerge( SwDoc* pDoc, const SwSelBoxes& rBoxes, // TL_CHART2: splitting/merging of a number of cells or rows will usually make // the table too complex to be handled with chart. // Thus we tell the charts to use their own data provider and forget about this table - pDoc->CreateChartInternalDataProviders( this ); + pDoc->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( this ); SetHTMLTableLayout( 0 ); // Delete HTML Layout diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 327e9fa42a2e..ce9cb39904ca 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -3520,7 +3521,7 @@ bool SwNodes::MergeTable( const SwNodeIndex& rPos, bool bWithPrev, // TL_CHART2: // tell the charts about the table to be deleted and have them use their own data - GetDoc()->CreateChartInternalDataProviders( &rDelTbl ); + GetDoc()->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( &rDelTbl ); // Sync the TableFormat's Width { diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx index 3efe0e9cd924..8d1d1231c6a0 100644 --- a/sw/source/core/edit/edtab.cxx +++ b/sw/source/core/edit/edtab.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -149,7 +150,7 @@ bool SwEditShell::TableToText( sal_Unicode cCh ) // TL_CHART2: // tell the charts about the table to be deleted and have them use their own data - GetDoc()->CreateChartInternalDataProviders( &pTblNd->GetTable() ); + GetDoc()->getIDocumentChartDataProviderAccess().CreateChartInternalDataProviders( &pTblNd->GetTable() ); StartAllAction(); diff --git a/sw/source/core/inc/DocumentChartDataProviderManager.hxx b/sw/source/core/inc/DocumentChartDataProviderManager.hxx new file mode 100644 index 000000000000..e646adc704f8 --- /dev/null +++ b/sw/source/core/inc/DocumentChartDataProviderManager.hxx @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTCHARTDATAPROVIDEMANAGER_HXX +#define INCLUDED_SW_SOURCE_CORE_INC_DOCUMENTCHARTDATAPROVIDEMANAGER_HXX + +#include +#include + +#include + +namespace com { namespace sun { namespace star { namespace frame { + class XModel; +}}}} + +class SwTable; +class SwChartDataProvider; +class SwChartLockController_Helper; +class SwDoc; + + +namespace sw { + +class DocumentChartDataProviderManager : public IDocumentChartDataProviderAccess, + public ::boost::noncopyable +{ + +public: + + DocumentChartDataProviderManager( SwDoc& i_rSwdoc ); + + SwChartDataProvider * GetChartDataProvider( bool bCreate = false ) const SAL_OVERRIDE; + + void CreateChartInternalDataProviders( const SwTable *pTable ) SAL_OVERRIDE; + + SwChartLockController_Helper & GetChartControllerHelper() SAL_OVERRIDE; + + virtual ~DocumentChartDataProviderManager(); + +private: + + SwDoc& m_rSwdoc; + + mutable rtl::Reference maChartDataProviderImplRef; + SwChartLockController_Helper *mpChartControllerHelper; +}; + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index bc717389af72..240ed4c0c80e 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1008,7 +1009,8 @@ void _SaveTable::CreateNew( SwTable& rTbl, bool bCreateFrms, : nLineCount; SwDoc *pDoc = rTbl.GetFrmFmt()->GetDoc(); - SwChartDataProvider *pPCD = pDoc->GetChartDataProvider(); +<<<<<<< HEAD + SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); size_t n = 0; for( ; n < aParent.GetTabLines().size(); ++n ) { @@ -1691,7 +1693,7 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext & rContext) _FndBox aTmpBox( 0, 0 ); // ? TL_CHART2: notification or locking of controller required ? - SwChartDataProvider *pPCD = rDoc.GetChartDataProvider(); + SwChartDataProvider *pPCD = rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider(); SwSelBoxes aDelBoxes; std::vector< std::pair > aDelNodes; if( IsDelBox() ) @@ -1984,7 +1986,7 @@ CHECKTABLE(pTblNd->GetTable()) CHECKTABLE(pTblNd->GetTable()) - SwChartDataProvider *pPCD = rDoc.GetChartDataProvider(); + SwChartDataProvider *pPCD = rDoc.getIDocumentChartDataProviderAccess().GetChartDataProvider(); // 2. deleted the inserted boxes // delete nodes (from last to first) for( size_t n = aNewSttNds.size(); n; ) @@ -3065,7 +3067,7 @@ void SwUndoMergeTbl::UndoImpl(::sw::UndoRedoContext & rContext) ClearFEShellTabCols(); // TL_CHART2: need to inform chart of probably changed cell names - SwChartDataProvider *pPCD = pDoc->GetChartDataProvider(); + SwChartDataProvider *pPCD = pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider(); if (pPCD) { pDoc->UpdateCharts( pTbl->GetFrmFmt()->GetName() ); diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 4718c47df4f4..d4ab8778d3d3 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -1523,7 +1524,7 @@ void SwChartDataProvider::InvalidateTable( const SwTable *pTable ) if (pTable) { if (!bDisposed) - pTable->GetFrmFmt()->GetDoc()->GetChartControllerHelper().StartOrContinueLocking(); + pTable->GetFrmFmt()->GetDoc()->getIDocumentChartDataProviderAccess().GetChartControllerHelper().StartOrContinueLocking(); const Set_DataSequenceRef_t &rSet = aDataSequences[ pTable ]; Set_DataSequenceRef_t::const_iterator aIt( rSet.begin() ); @@ -1548,7 +1549,7 @@ bool SwChartDataProvider::DeleteBox( const SwTable *pTable, const SwTableBox &rB if (pTable) { if (!bDisposed) - pTable->GetFrmFmt()->GetDoc()->GetChartControllerHelper().StartOrContinueLocking(); + pTable->GetFrmFmt()->GetDoc()->getIDocumentChartDataProviderAccess().GetChartControllerHelper().StartOrContinueLocking(); Set_DataSequenceRef_t &rSet = aDataSequences[ pTable ]; @@ -1604,7 +1605,7 @@ void SwChartDataProvider::DisposeAllDataSequences( const SwTable *pTable ) if (pTable) { if (!bDisposed) - pTable->GetFrmFmt()->GetDoc()->GetChartControllerHelper().StartOrContinueLocking(); + pTable->GetFrmFmt()->GetDoc()->getIDocumentChartDataProviderAccess().GetChartControllerHelper().StartOrContinueLocking(); //! make a copy of the STL container! //! This is necessary since calling 'dispose' will implicitly remove an element diff --git a/sw/source/core/unocore/unocoll.cxx b/sw/source/core/unocore/unocoll.cxx index 25fc8b19b199..4c2e4af66231 100644 --- a/sw/source/core/unocore/unocoll.cxx +++ b/sw/source/core/unocore/unocoll.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -820,7 +821,7 @@ uno::Reference< uno::XInterface > SwXServiceProvider::MakeInstance(sal_uInt16 // charts using table data. OSL_ASSERT( pDoc->GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ); if( pDoc->GetDocShell()->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) - xRet = (cppu::OWeakObject*) pDoc->GetChartDataProvider( true /* create - if not yet available */ ); + xRet = (cppu::OWeakObject*) pDoc->getIDocumentChartDataProviderAccess().GetChartDataProvider( true /* create - if not yet available */ ); break; case SW_SERVICE_TYPE_META: xRet = static_cast< ::cppu::OWeakObject* >( new SwXMeta(pDoc) ); diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index 719282e6702e..20d8404c3d66 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -366,8 +367,8 @@ SwDocShell::~SwDocShell() // disable chart related objects now because in ~SwDoc it may be to late for this if( mpDoc ) { - mpDoc->GetChartControllerHelper().Disconnect(); - SwChartDataProvider *pPCD = mpDoc->GetChartDataProvider(); + mpDoc->getIDocumentChartDataProviderAccess().GetChartControllerHelper().Disconnect(); + SwChartDataProvider *pPCD = mpDoc->getIDocumentChartDataProvdiderAccess().GetChartDataProvider(); if (pPCD) pPCD->dispose(); } @@ -682,6 +683,6 @@ void SwDocShell::SubInitNew() */ IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return &mpDoc->getIDocumentDeviceAccess(); } const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return &mpDoc->getIDocumentSettingAccess(); } -IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return mpDoc; } +IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return &mpDoc->getIDocumentChartDataProviderAccess(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 190c81f23d82..4f27e883f077 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx index 9a59c52ad5d7..9750d2e178f7 100644 --- a/sw/source/uibase/table/chartins.cxx +++ b/sw/source/uibase/table/chartins.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 10f618579510..93c336fff758 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -97,6 +97,7 @@ #include #include #include +#include #include #include #include -- cgit