diff options
author | David Tardon <dtardon@redhat.com> | 2013-03-23 11:29:34 +0100 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2013-03-24 14:35:53 +0100 |
commit | d2e3b282947432ae49043074644cf6aa63cb5757 (patch) | |
tree | 1844fdf0f126e10e338fdf6f7219c443d0292d8b /svx | |
parent | ef61bc2934bb9ae27b366fce6e707533cd73c862 (diff) |
fix crash after conversion to STL
Change-Id: I0a49ce4ddf53eede0f940b392aab20afb5dd2cbe
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdibrow.cxx | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/svx/source/svdraw/svdibrow.cxx b/svx/source/svdraw/svdibrow.cxx index 5ee5d0b43325..cb77ec4ba2ef 100644 --- a/svx/source/svdraw/svdibrow.cxx +++ b/svx/source/svdraw/svdibrow.cxx @@ -562,27 +562,31 @@ void _SdrItemBrowserControl::BrkChangeEntry() void _SdrItemBrowserControl::ImpSetEntry(const ImpItemListRow& rEntry, sal_uIntPtr nEntryNum) { - ImpItemListRow* pAktEntry=ImpGetEntry(nEntryNum); - if (pAktEntry==NULL) { + SAL_WARN_IF(nEntryNum > aList.size(), "svx", "trying to set item " << nEntryNum << "in a vector of size " << aList.size()); + if (nEntryNum >= aList.size()) { + nEntryNum = aList.size(); aList.push_back(new ImpItemListRow(rEntry)); RowInserted(nEntryNum); - } else if (*pAktEntry!=rEntry) { - bool bStateDiff=rEntry.eState!=pAktEntry->eState; - bool bValueDiff=!rEntry.aValue.equals(pAktEntry->aValue); - bool bAllDiff = true; - if (bStateDiff || bValueDiff) { - // check whether only state and/or value have changed - ImpItemListRow aTest(rEntry); - aTest.eState=pAktEntry->eState; - aTest.aValue=pAktEntry->aValue; - if (aTest==*pAktEntry) bAllDiff = false; - } - *pAktEntry=rEntry; - if (bAllDiff) { - RowModified(nEntryNum); - } else { - if (bStateDiff) RowModified(nEntryNum,ITEMBROWSER_STATECOL_ID); - if (bValueDiff) RowModified(nEntryNum,ITEMBROWSER_VALUECOL_ID); + } else { + ImpItemListRow* pAktEntry=ImpGetEntry(nEntryNum); + if (*pAktEntry!=rEntry) { + bool bStateDiff=rEntry.eState!=pAktEntry->eState; + bool bValueDiff=!rEntry.aValue.equals(pAktEntry->aValue); + bool bAllDiff = true; + if (bStateDiff || bValueDiff) { + // check whether only state and/or value have changed + ImpItemListRow aTest(rEntry); + aTest.eState=pAktEntry->eState; + aTest.aValue=pAktEntry->aValue; + if (aTest==*pAktEntry) bAllDiff = false; + } + *pAktEntry=rEntry; + if (bAllDiff) { + RowModified(nEntryNum); + } else { + if (bStateDiff) RowModified(nEntryNum,ITEMBROWSER_STATECOL_ID); + if (bValueDiff) RowModified(nEntryNum,ITEMBROWSER_VALUECOL_ID); + } } } } |