Kaydet (Commit) dc8697e5 authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

use a WeakReference instead of meddling in SwClients

Change-Id: I9dcf00607bac820c3dbb26c6de9f6e326df7fb99
üst 97f08e06
...@@ -307,6 +307,8 @@ class SwXTextTable : public cppu::WeakImplHelper10 ...@@ -307,6 +307,8 @@ class SwXTextTable : public cppu::WeakImplHelper10
private: private:
class Impl; class Impl;
::sw::UnoImplPtr<Impl> m_pImpl; ::sw::UnoImplPtr<Impl> m_pImpl;
::com::sun::star::uno::WeakReference< ::com::sun::star::table::XTableRows > m_xRows;
::com::sun::star::uno::WeakReference< ::com::sun::star::table::XTableColumns > m_xColumns;
const SfxItemPropertySet* m_pPropSet; const SfxItemPropertySet* m_pPropSet;
......
...@@ -2258,33 +2258,27 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc ...@@ -2258,33 +2258,27 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc
uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException, std::exception ) uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException, std::exception )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Reference< table::XTableRows > xRet; uno::Reference<table::XTableRows> xResult(m_xRows);
if (SwFrmFmt* pFmt = GetFrmFmt()) if(xResult.is())
{ return xResult;
SwXTableRows* pRows = SwIterator<SwXTableRows,SwFmt>(*pFmt).First(); if(SwFrmFmt* pFmt = GetFrmFmt())
if (!pRows) m_xRows = xResult = new SwXTableRows(*pFmt);
pRows = new SwXTableRows(*pFmt); if(!xResult.is())
xRet = pRows;
}
if (!xRet.is())
throw uno::RuntimeException(); throw uno::RuntimeException();
return xRet; return xResult;
} }
uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException, std::exception ) uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException, std::exception )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Reference< table::XTableColumns > xRet; uno::Reference<table::XTableColumns> xResult(m_xColumns);
if (SwFrmFmt* pFmt = GetFrmFmt()) if(xResult.is())
{ return xResult;
SwXTableColumns* pCols = SwIterator<SwXTableColumns,SwFmt>(*pFmt).First(); if(SwFrmFmt* pFmt = GetFrmFmt())
if (!pCols) m_xColumns = xResult = new SwXTableColumns(*pFmt);
pCols = new SwXTableColumns(*pFmt); if(!xResult.is())
xRet = pCols;
}
if (!xRet.is())
throw uno::RuntimeException(); throw uno::RuntimeException();
return xRet; return xResult;
} }
uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& sCellName) throw( uno::RuntimeException, std::exception ) uno::Reference< table::XCell > SwXTextTable::getCellByName(const OUString& sCellName) throw( uno::RuntimeException, std::exception )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment