diff options
Diffstat (limited to 'lotuswordpro/source/filter/lwptablelayout.cxx')
-rw-r--r-- | lotuswordpro/source/filter/lwptablelayout.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx index 5ea2d42db9a4..2494501ff3d9 100644 --- a/lotuswordpro/source/filter/lwptablelayout.cxx +++ b/lotuswordpro/source/filter/lwptablelayout.cxx @@ -1402,16 +1402,17 @@ void LwpTableLayout::ConvertDefaultRow(rtl::Reference<XFTable> const & pXFTable, pXFTable->AddRow(xRow); } + /** * @short set cell map info * @param pXFCell - pointer to xfcell * @param nRow - row id * @param nCol - column id */ -void LwpTableLayout::SetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol, XFCell* pXFCell) +void LwpTableLayout::SetCellsMap(sal_uInt16 nRow1, sal_uInt8 nCol1, + sal_uInt16 nRow2, sal_uInt8 nCol2, XFCell* pXFCell) { - // combine the 16bit nRow and 8bit nCol into a single 32bit number - m_CellsMap.insert(std::make_pair((nRow << 8) | nCol, pXFCell)); + m_CellsMap.insert({{nRow1, nCol1}, {nRow2, nCol2}}, pXFCell); } /** @@ -1422,17 +1423,17 @@ void LwpTableLayout::SetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol, XFCell* pXFCel */ XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol) { - RowCol pos = (nRow << 8) | nCol; - auto iter = m_CellsMap.find(pos); - if (iter == m_CellsMap.end()) - return nullptr; - return iter->second; + auto results = m_CellsMap.search({{nRow, nCol}, {nRow, nCol}}, rt_type::search_type::overlap); + if (results.begin() == results.end()) + return nullptr; + // return the last thing inserted for this position + return *std::prev(results.end()); } /** * @descr Get row layout by row id * @param nRow - row id */ - LwpRowLayout* LwpTableLayout::GetRowLayout(sal_uInt16 nRow) +LwpRowLayout* LwpTableLayout::GetRowLayout(sal_uInt16 nRow) { LwpObjectID *pRowID = &GetChildHead(); LwpRowLayout * pRowLayout = dynamic_cast<LwpRowLayout *>(pRowID->obj().get()); |