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

make SwXTextTable::getRowDescriptions reuse SwXCellRange

Change-Id: Ia8194ed8945e7b3ef0eb187545047fa949c4434b
üst f4b01361
...@@ -2530,45 +2530,13 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData ...@@ -2530,45 +2530,13 @@ void SwXTextTable::setData(const uno::Sequence< uno::Sequence< double > >& rData
} }
} }
uno::Sequence< OUString > SwXTextTable::getRowDescriptions(void) throw( uno::RuntimeException, std::exception ) uno::Sequence<OUString> SwXTextTable::getRowDescriptions(void)
throw(uno::RuntimeException, std::exception)
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
const sal_uInt16 nRowCount = getRowCount(); uno::Reference<chart::XChartDataArray> xAllRange(getCellRangeByPosition(0, 0, getColumnCount()-1, getRowCount()-1), uno::UNO_QUERY);
if(!nRowCount) static_cast<SwXCellRange*>(xAllRange.get())->SetLabels(m_bFirstRowAsLabel, m_bFirstColumnAsLabel);
{ return xAllRange->getRowDescriptions();
uno::RuntimeException aRuntime;
aRuntime.Message = "Table too complex";
throw aRuntime;
}
uno::Sequence< OUString > aRet(m_bFirstColumnAsLabel ? nRowCount - 1 : nRowCount);
SwFrmFmt* pFmt = GetFrmFmt();
if(pFmt)
{
OUString* pArray = aRet.getArray();
if(m_bFirstColumnAsLabel)
{
const sal_uInt16 nStart = m_bFirstRowAsLabel ? 1 : 0;
for(sal_uInt16 i = nStart; i < nRowCount; i++)
{
uno::Reference< table::XCell > xCell = getCellByPosition(0, i);
if(!xCell.is())
{
//exception ...
break;
}
uno::Reference< text::XText > xText(xCell, uno::UNO_QUERY);
pArray[i - nStart] = xText->getString();
}
}
else
{
OSL_FAIL("Where do these labels come from?");
}
}
else
throw uno::RuntimeException();
return aRet;
} }
void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) throw( uno::RuntimeException, std::exception ) void SwXTextTable::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) 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