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

simplify

Change-Id: Id48493c820e8052730e3f13270b5071161ba9f26
üst 2535e00e
...@@ -2065,26 +2065,19 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt) ...@@ -2065,26 +2065,19 @@ SwXTextTable::SwXTextTable(SwFrmFmt& rFrmFmt)
SwXTextTable::~SwXTextTable() SwXTextTable::~SwXTextTable()
{ delete pTableProps; } { delete pTableProps; }
uno::Reference<text::XTextTable> uno::Reference<text::XTextTable> SwXTextTable::CreateXTextTable(SwFrmFmt* const pFrmFmt)
SwXTextTable::CreateXTextTable(SwFrmFmt *const pFrmFmt)
{ {
uno::Reference<text::XTextTable> xTable; uno::Reference<text::XTextTable> xTable;
if (pFrmFmt) if(pFrmFmt)
{
xTable.set(pFrmFmt->GetXObject(), uno::UNO_QUERY); // cached? xTable.set(pFrmFmt->GetXObject(), uno::UNO_QUERY); // cached?
} if(xTable.is())
if (!xTable.is()) return xTable;
{ SwXTextTable* const pNew( (pFrmFmt) ? new SwXTextTable(*pFrmFmt) : new SwXTextTable());
SwXTextTable *const pNew( xTable.set(pNew);
(pFrmFmt) ? new SwXTextTable(*pFrmFmt) : new SwXTextTable()); if(pFrmFmt)
xTable.set(pNew); pFrmFmt->SetXObject(xTable);
if (pFrmFmt) // need a permanent Reference to initialize m_wThis
{ pNew->m_pImpl->m_wThis = xTable;
pFrmFmt->SetXObject(xTable);
}
// need a permanent Reference to initialize m_wThis
pNew->m_pImpl->m_wThis = xTable;
}
return xTable; return xTable;
} }
...@@ -2092,11 +2085,8 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc ...@@ -2092,11 +2085,8 @@ void SwXTextTable::initialize(sal_Int32 nR, sal_Int32 nC) throw( uno::RuntimeExc
{ {
if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX ) if(!bIsDescriptor || nR <= 0 || nC <= 0 || nR >= USHRT_MAX || nC >= USHRT_MAX )
throw uno::RuntimeException(); throw uno::RuntimeException();
else nRows = static_cast<sal_uInt16>(nR);
{ nColumns = static_cast<sal_uInt16>(nC);
nRows = (sal_uInt16)nR;
nColumns = (sal_uInt16)nC;
}
} }
uno::Reference< table::XTableRows > SwXTextTable::getRows(void) throw( uno::RuntimeException, std::exception ) uno::Reference< table::XTableRows > SwXTextTable::getRows(void) 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