diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-27 20:13:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-27 22:53:26 +0200 |
commit | b513ecce3e00e512947cd2d9fd61d1b80ba0d4bb (patch) | |
tree | f924ba7d956bde1652efd00711559227b7aa5e6c /lotuswordpro/source | |
parent | a7667f53c23bc88ed645f84a19896bc45f748f2a (diff) |
Related: ofz#27296 OOM std::map->std::vector
dbgutil massif peak of 3.1G -> 2.7G
GB
3.117^ #
| :::::::::::::::::::::::#
| ::::: #
| :@::::: #:
| :::@::::: #:
| :::::@::::: #:
| :::::::@::::: #::
| :::::::::@::::: #:@
| ::::::::::@::::: #:@:
| :::::::::::::@::::: #:@:
| :::::::::::::::@::::: #:@::
| :::::::::::::::::@::::: #:@::
| ::::::::::::::::::@::::: #:@::
| ::::::::::::::::::::@::::: #:@::@
| @:::::::::::::::::::::@::::: #:@::@
| @::@:::::::::::::::::::::@::::: #:@::@:
| ::@::@:::::::::::::::::::::@::::: #:@::@:
| @:::@::@:::::::::::::::::::::@::::: #:@::@:
| ::@:::@::@:::::::::::::::::::::@::::: #:@::@::
| ::::@:::@::@:::::::::::::::::::::@::::: #:@::@::
0 +----------------------------------------------------------------------->Gi
0 116.7
--->
GB
2.718^ :
| @######:
| @@@# :::
| @@@@# ::::
| @@@@@@@# :::::
| @@@ @@@@# ::::::
| :@@@@ @@@@# :::::::
| @::@@@@ @@@@# :::::::@:
| @@@::@@@@ @@@@# :::::::@::
| @@@@::@@@@ @@@@# :::::::@:::
| @@@@@@::@@@@ @@@@# :::::::@::::
| ::@@@@@@::@@@@ @@@@# :::::::@::::::
| @::@@@@@@::@@@@ @@@@# :::::::@:::::@:
| @@@::@@@@@@::@@@@ @@@@# :::::::@:::::@::
| @@@@@::@@@@@@::@@@@ @@@@# :::::::@:::::@:::
| @@@@@@@::@@@@@@::@@@@ @@@@# :::::::@:::::@::::
| @@@@@@@@@::@@@@@@::@@@@ @@@@# :::::::@:::::@:::::
| @ @@@@@@@::@@@@@@::@@@@ @@@@# :::::::@:::::@::::::@
| :@@@ @@@@@@@::@@@@@@::@@@@ @@@@# :::::::@:::::@::::::@:
| @@:@ @ @@@@@@@::@@@@@@::@@@@ @@@@# :::::::@:::::@::::::@::
0 +----------------------------------------------------------------------->Gi
0 34.29
Change-Id: Id56615e554d07a76a6a87476a40cc6190c0555da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121181
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/xfilter/xfrow.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/xfilter/xfrow.cxx b/lotuswordpro/source/filter/xfilter/xfrow.cxx index d4825f966aff..1bdfb8849a05 100644 --- a/lotuswordpro/source/filter/xfilter/xfrow.cxx +++ b/lotuswordpro/source/filter/xfilter/xfrow.cxx @@ -80,10 +80,10 @@ void XFRow::AddCell(rtl::Reference<XFCell> const & rCell) { if (!rCell) return; - sal_Int32 col = m_aCells.size()+1; + sal_Int32 col = m_aCells.size() + 1; rCell->SetCol(col); rCell->SetOwnerRow(this); - m_aCells[col] = rCell; + m_aCells.push_back(rCell); } sal_Int32 XFRow::GetCellCount() const @@ -91,12 +91,14 @@ sal_Int32 XFRow::GetCellCount() const return m_aCells.size(); } +// 1 based XFCell* XFRow::GetCell(sal_Int32 col) const { - if( m_aCells.find(col) == m_aCells.end() ) - return nullptr; - else - return m_aCells.find(col)->second.get(); + assert(col > 0); + size_t nIndex = col - 1; + if (nIndex < m_aCells.size()) + return m_aCells[nIndex].get(); + return nullptr; } void XFRow::ToXml(IXFStream *pStrm) @@ -111,12 +113,12 @@ void XFRow::ToXml(IXFStream *pStrm) pAttrList->AddAttribute( "table:number-rows-repeated", OUString::number(m_nRepeat) ); pStrm->StartElement( "table:table-row" ); - for (auto const& cell : m_aCells) + for (size_t nIndex = 0, nCount = m_aCells.size(); nIndex < nCount; ++nIndex) { - int col = cell.first; - XFCell *pCell = cell.second.get(); - if( !pCell ) + XFCell *pCell = m_aCells[nIndex].get(); + if (!pCell) continue; + int col = nIndex + 1; if( col>lastCol+1 ) { XFCell *pNULLCell = new XFCell(); |