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

lets get a XTest reference right away

Change-Id: Ib805a20cd3f121ae1d021a28e3b9908afdad4ab4
üst 84e71f3b
...@@ -4025,11 +4025,8 @@ uno::Sequence<OUString> SwXCellRange::getRowDescriptions(void) ...@@ -4025,11 +4025,8 @@ uno::Sequence<OUString> SwXCellRange::getRowDescriptions(void)
const sal_uInt16 nStart = m_bFirstRowAsLabel ? 1 : 0; const sal_uInt16 nStart = m_bFirstRowAsLabel ? 1 : 0;
for(sal_uInt16 i = nStart; i < nRowCount; i++) for(sal_uInt16 i = nStart; i < nRowCount; i++)
{ {
auto xCell = getCellByPosition(0, i); const uno::Reference<text::XText> xCell(getCellByPosition(0, i), uno::UNO_QUERY_THROW);
if(!xCell.is()) pArray[i - nStart] = xCell->getString();
throw uno::RuntimeException();
uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY);
pArray[i - nStart] = xText->getString();
} }
return aRet; return aRet;
} }
...@@ -4048,16 +4045,12 @@ uno::Sequence<OUString> SwXCellRange::getColumnDescriptions(void) ...@@ -4048,16 +4045,12 @@ uno::Sequence<OUString> SwXCellRange::getColumnDescriptions(void)
const sal_uInt16 nStart = m_bFirstColumnAsLabel ? 1 : 0; const sal_uInt16 nStart = m_bFirstColumnAsLabel ? 1 : 0;
for(sal_uInt16 i = nStart; i < nColumnCount; i++) for(sal_uInt16 i = nStart; i < nColumnCount; i++)
{ {
auto xCell = getCellByPosition(i, 0); const uno::Reference<text::XText> xCell(getCellByPosition(i, 0), uno::UNO_QUERY_THROW);
if(!xCell.is()) pArray[i - nStart] = xCell->getString();
throw uno::RuntimeException();
uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY);
pArray[i - nStart] = xText->getString();
} }
return aRet; return aRet;
} }
///@see SwXTextTable::setRowDescriptions (TODO: seems to be copy and paste programming here)
void SwXCellRange::setRowDescriptions(const uno::Sequence<OUString>& rRowDesc) void SwXCellRange::setRowDescriptions(const uno::Sequence<OUString>& rRowDesc)
throw(uno::RuntimeException, std::exception) throw(uno::RuntimeException, std::exception)
{ {
...@@ -4072,11 +4065,8 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence<OUString>& rRowDesc) ...@@ -4072,11 +4065,8 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence<OUString>& rRowDesc)
throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this)); throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this));
for(sal_uInt16 i = nStart; i < nRowCount; i++) for(sal_uInt16 i = nStart; i < nRowCount; i++)
{ {
uno::Reference<table::XCell> xCell = getCellByPosition(0, i); uno::Reference<text::XText> xCell(getCellByPosition(0, i), uno::UNO_QUERY_THROW);
if(!xCell.is()) xCell->setString(pArray[i-nStart]);
throw uno::RuntimeException();
uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY);
xText->setString(pArray[i-nStart]);
} }
} }
void SwXCellRange::setColumnDescriptions(const uno::Sequence<OUString>& rColumnDesc) void SwXCellRange::setColumnDescriptions(const uno::Sequence<OUString>& rColumnDesc)
...@@ -4093,11 +4083,8 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence<OUString>& rColumnD ...@@ -4093,11 +4083,8 @@ void SwXCellRange::setColumnDescriptions(const uno::Sequence<OUString>& rColumnD
const OUString* pArray = rColumnDesc.getConstArray(); const OUString* pArray = rColumnDesc.getConstArray();
for(sal_uInt16 i = nStart; i < nColumnCount; i++) for(sal_uInt16 i = nStart; i < nColumnCount; i++)
{ {
uno::Reference<table::XCell> xCell = getCellByPosition(i, 0); uno::Reference<text::XText> xCell(getCellByPosition(i, 0), uno::UNO_QUERY_THROW);
if(!xCell.is()) xCell->setString(pArray[i-nStart]);
throw uno::RuntimeException();
uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY);
xText->setString(pArray[i-nStart]);
} }
} }
......
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