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

whops, fix subsequentcheck

Change-Id: Icd727e290b2d5851fc3b30e1a697a06a4ad54be0
üst 374d2bcf
...@@ -4242,7 +4242,7 @@ uno::Sequence<OUString> SwXCellRange::getRowDescriptions(void) ...@@ -4242,7 +4242,7 @@ uno::Sequence<OUString> SwXCellRange::getRowDescriptions(void)
uno::Sequence<OUString> aRet(bFirstColumnAsLabel ? nRowCount - 1 : nRowCount); uno::Sequence<OUString> aRet(bFirstColumnAsLabel ? nRowCount - 1 : nRowCount);
lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this)); lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
if(!bFirstColumnAsLabel) if(!bFirstColumnAsLabel)
throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this)); return {}; // without labels we have no descriptions
OUString* pArray = aRet.getArray(); OUString* pArray = aRet.getArray();
const sal_uInt16 nStart = bFirstRowAsLabel ? 1 : 0; const sal_uInt16 nStart = bFirstRowAsLabel ? 1 : 0;
for(sal_uInt16 i = nStart; i < nRowCount; i++) for(sal_uInt16 i = nStart; i < nRowCount; i++)
...@@ -4263,16 +4263,19 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc) ...@@ -4263,16 +4263,19 @@ void SwXCellRange::setRowDescriptions(const uno::Sequence< OUString >& rRowDesc)
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this)); lcl_EnsureCoreConnected(GetFrmFmt(), static_cast<cppu::OWeakObject*>(this));
const sal_uInt16 nRowCount = getRowCount(); const sal_uInt16 nRowCount = getRowCount();
if(!nRowCount || bFirstRowAsLabel|| rRowDesc.getLength() < nRowCount) if(!bFirstColumnAsLabel)
return; // if there are no labels we cannot set descriptions
if(!nRowCount || rRowDesc.getLength() < nRowCount)
throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this)); throw uno::RuntimeException("Illegal arguments", static_cast<cppu::OWeakObject*>(this));
const OUString* pArray = rRowDesc.getConstArray(); const OUString* pArray = rRowDesc.getConstArray();
for(sal_uInt16 i = 0; i < nRowCount; i++) const sal_uInt16 nStart = bFirstColumnAsLabel ? 1 : 0;
for(sal_uInt16 i = nStart; i < nRowCount; i++)
{ {
uno::Reference<table::XCell> xCell = getCellByPosition(0, i); uno::Reference<table::XCell> xCell = getCellByPosition(0, i);
if(!xCell.is()) if(!xCell.is())
throw uno::RuntimeException(); throw uno::RuntimeException();
uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY); uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY);
xText->setString(pArray[i]); 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