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
private:
class Impl;
::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;
......
......@@ -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 )
{
SolarMutexGuard aGuard;
uno::Reference< table::XTableRows > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
SwXTableRows* pRows = SwIterator<SwXTableRows,SwFmt>(*pFmt).First();
if (!pRows)
pRows = new SwXTableRows(*pFmt);
xRet = pRows;
}
if (!xRet.is())
uno::Reference<table::XTableRows> xResult(m_xRows);
if(xResult.is())
return xResult;
if(SwFrmFmt* pFmt = GetFrmFmt())
m_xRows = xResult = new SwXTableRows(*pFmt);
if(!xResult.is())
throw uno::RuntimeException();
return xRet;
return xResult;
}
uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( uno::RuntimeException, std::exception )
{
SolarMutexGuard aGuard;
uno::Reference< table::XTableColumns > xRet;
if (SwFrmFmt* pFmt = GetFrmFmt())
{
SwXTableColumns* pCols = SwIterator<SwXTableColumns,SwFmt>(*pFmt).First();
if (!pCols)
pCols = new SwXTableColumns(*pFmt);
xRet = pCols;
}
if (!xRet.is())
uno::Reference<table::XTableColumns> xResult(m_xColumns);
if(xResult.is())
return xResult;
if(SwFrmFmt* pFmt = GetFrmFmt())
m_xColumns = xResult = new SwXTableColumns(*pFmt);
if(!xResult.is())
throw uno::RuntimeException();
return xRet;
return xResult;
}
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