use helpers some more

Change-Id: Ia448046b41d6d7594b1ff6f630dbbd4217e13732
This commit is contained in:
Bjoern Michaelsen
2015-04-02 05:04:02 +02:00
parent b878c2b833
commit c8cf6766fd

View File

@@ -2108,9 +2108,7 @@ uno::Reference< table::XTableColumns > SwXTextTable::getColumns(void) throw( un
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 )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
SwFrmFmt* pFmt(GetFrmFmt()); SwFrmFmt* pFmt = lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(!pFmt)
throw uno::RuntimeException();
SwTable* pTable = SwTable::FindTable(pFmt); SwTable* pTable = SwTable::FindTable(pFmt);
SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox(sCellName)); SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox(sCellName));
if(!pBox) if(!pBox)
@@ -2136,9 +2134,7 @@ uno::Reference<text::XTextTableCursor> SwXTextTable::createCursorByCellName(cons
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
SwFrmFmt* pFmt(GetFrmFmt()); SwFrmFmt* pFmt = lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(!pFmt)
throw uno::RuntimeException();
uno::Reference<text::XTextTableCursor> xRet; uno::Reference<text::XTextTableCursor> xRet;
SwTable* pTable = SwTable::FindTable(pFmt); SwTable* pTable = SwTable::FindTable(pFmt);
SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox(sCellName)); SwTableBox* pBox = const_cast<SwTableBox*>(pTable->GetTblBox(sCellName));
@@ -2230,18 +2226,14 @@ uno::Reference<text::XTextRange> SwXTextTable::getAnchor(void)
throw( uno::RuntimeException, std::exception ) throw( uno::RuntimeException, std::exception )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
SwFrmFmt* pFmt(GetFrmFmt()); SwFrmFmt* pFmt = lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(!pFmt)
throw uno::RuntimeException();
return new SwXTextRange(*pFmt); return new SwXTextRange(*pFmt);
} }
void SwXTextTable::dispose(void) throw( uno::RuntimeException, std::exception ) void SwXTextTable::dispose(void) throw( uno::RuntimeException, std::exception )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt(); SwFrmFmt* pFmt = lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(!pFmt)
throw uno::RuntimeException();
SwTable* pTable = SwTable::FindTable(pFmt); SwTable* pTable = SwTable::FindTable(pFmt);
SwSelBoxes aSelBoxes; SwSelBoxes aSelBoxes;
for(auto& rBox : pTable->GetTabSortBoxes() ) for(auto& rBox : pTable->GetTabSortBoxes() )
@@ -2345,12 +2337,8 @@ uno::Reference<table::XCellRange> SwXTextTable::getCellRangeByName(const OUStrin
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
uno::Reference< table::XCellRange > aRef; uno::Reference< table::XCellRange > aRef;
SwFrmFmt* pFmt(GetFrmFmt()); SwFrmFmt* pFmt = lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(pFmt) SwTable* pTable = lcl_EnsureTableNotComplex(SwTable::FindTable(pFmt), static_cast<cppu::OWeakObject*>(this));
{
SwTable* pTable = SwTable::FindTable( pFmt );
if(!pTable->IsTblComplex())
{
sal_Int32 nPos = 0; sal_Int32 nPos = 0;
const OUString sTLName(sRange.getToken(0, ':', nPos)); const OUString sTLName(sRange.getToken(0, ':', nPos));
const OUString sBRName(sRange.getToken(0, ':', nPos)); const OUString sBRName(sRange.getToken(0, ':', nPos));
@@ -2367,9 +2355,6 @@ uno::Reference<table::XCellRange> SwXTextTable::getCellRangeByName(const OUStrin
// point to the top-left and bottom-right cells // point to the top-left and bottom-right cells
aDesc.Normalize(); aDesc.Normalize();
return GetRangeByName(pFmt, pTable, sTLName, sBRName, aDesc); return GetRangeByName(pFmt, pTable, sTLName, sBRName, aDesc);
}
}
throw uno::RuntimeException();
} }
uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray() uno::Sequence< uno::Sequence< uno::Any > > SAL_CALL SwXTextTable::getDataArray()
@@ -2573,12 +2558,8 @@ void SwXTextTable::autoFormat(const OUString& sAutoFmtName)
std::exception) std::exception)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
SwFrmFmt* pFmt = GetFrmFmt(); SwFrmFmt* pFmt = lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(pFmt) SwTable* pTable = lcl_EnsureTableNotComplex(SwTable::FindTable(pFmt), static_cast<cppu::OWeakObject*>(this));
{
SwTable* pTable = SwTable::FindTable( pFmt );
if(!pTable->IsTblComplex())
{
SwTableAutoFmtTbl aAutoFmtTbl; SwTableAutoFmtTbl aAutoFmtTbl;
aAutoFmtTbl.Load(); aAutoFmtTbl.Load();
for (size_t i = aAutoFmtTbl.size(); i;) for (size_t i = aAutoFmtTbl.size(); i;)
@@ -2595,10 +2576,6 @@ void SwXTextTable::autoFormat(const OUString& sAutoFmtName)
pFmt->GetDoc()->SetTableAutoFmt( aBoxes, aAutoFmtTbl[i] ); pFmt->GetDoc()->SetTableAutoFmt( aBoxes, aAutoFmtTbl[i] );
break; break;
} }
}
}
else
throw uno::RuntimeException();
} }
uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException, std::exception ) uno::Reference< beans::XPropertySetInfo > SwXTextTable::getPropertySetInfo(void) throw( uno::RuntimeException, std::exception )
@@ -3622,24 +3599,16 @@ uno::Any SwXCellRange::getPropertyValue(const OUString& rPropertyName)
} }
void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) void SwXCellRange::addPropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{ { throw uno::RuntimeException("Not implemented", static_cast<cppu::OWeakObject*>(this)); }
OSL_FAIL("not implemented");
}
void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) void SwXCellRange::removePropertyChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{ { throw uno::RuntimeException("Not implemented", static_cast<cppu::OWeakObject*>(this)); }
OSL_FAIL("not implemented");
}
void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) void SwXCellRange::addVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{ { throw uno::RuntimeException("Not implemented", static_cast<cppu::OWeakObject*>(this)); }
OSL_FAIL("not implemented");
}
void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception ) void SwXCellRange::removeVetoableChangeListener(const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/) throw( beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException, std::exception )
{ { throw uno::RuntimeException("Not implemented", static_cast<cppu::OWeakObject*>(this)); }
OSL_FAIL("not implemented");
}
void SwXCellRange::GetDataSequence( void SwXCellRange::GetDataSequence(
uno::Sequence< uno::Any > *pAnySeq, //-> first pointer != 0 is used uno::Sequence< uno::Any > *pAnySeq, //-> first pointer != 0 is used