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

flatten and simplify

Change-Id: Iefcbf2ab06dcf18cdd0f0d82e4389ec1766927f9
üst 2049746a
...@@ -1523,37 +1523,28 @@ OUString SwXTextTableCursor::getRangeName() ...@@ -1523,37 +1523,28 @@ OUString SwXTextTableCursor::getRangeName()
throw (uno::RuntimeException, std::exception) throw (uno::RuntimeException, std::exception)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
OUString aRet;
SwUnoCrsr* pUnoCrsr = GetCrsr(); SwUnoCrsr* pUnoCrsr = GetCrsr();
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr); SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr);
//!! see also SwChartDataSequence::getSourceRangeRepresentation //!! see also SwChartDataSequence::getSourceRangeRepresentation
if (pTblCrsr) if(!pTblCrsr)
{ return OUString();
pTblCrsr->MakeBoxSels(); pTblCrsr->MakeBoxSels();
const SwStartNode* pNode = pTblCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode(); const SwStartNode* pNode = pTblCrsr->GetPoint()->nNode.GetNode().FindTableBoxStartNode();
const SwTable* pTable = SwTable::FindTable( GetFrmFmt() ); const SwTable* pTable = SwTable::FindTable(GetFrmFmt());
const SwTableBox* pEndBox = pTable->GetTblBox( pNode->GetIndex()); const SwTableBox* pEndBox = pTable->GetTblBox(pNode->GetIndex());
aRet = pEndBox->GetName();
if(pTblCrsr->HasMark()) if(pTblCrsr->HasMark())
{ {
pNode = pTblCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode(); pNode = pTblCrsr->GetMark()->nNode.GetNode().FindTableBoxStartNode();
const SwTableBox* pStartBox = pTable->GetTblBox( pNode->GetIndex()); const SwTableBox* pStartBox = pTable->GetTblBox(pNode->GetIndex());
if(pEndBox != pStartBox) if(pEndBox != pStartBox)
{ {
// need to switch start and end? // need to switch start and end?
if (*pTblCrsr->GetPoint() < *pTblCrsr->GetMark()) if(*pTblCrsr->GetPoint() < *pTblCrsr->GetMark())
{ std::swap(pStartBox, pEndBox);
const SwTableBox* pTmpBox = pStartBox; return pStartBox->GetName() + ":" + pEndBox->GetName();
pStartBox = pEndBox;
pEndBox = pTmpBox;
}
aRet = pStartBox->GetName() + ":" + pEndBox->GetName();
} }
} }
} return pEndBox->GetName();
return aRet;
} }
sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& sCellName, sal_Bool Expand) sal_Bool SwXTextTableCursor::gotoCellByName(const OUString& sCellName, sal_Bool Expand)
......
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