summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx17
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.hxx4
2 files changed, 8 insertions, 13 deletions
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 846e757ad3e3..5ea2d42db9a4 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -1408,15 +1408,10 @@ void LwpTableLayout::ConvertDefaultRow(rtl::Reference<XFTable> const & pXFTable,
* @param nRow - row id
* @param nCol - column id
*/
-void LwpTableLayout::SetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol,XFCell* pXFCell)
+void LwpTableLayout::SetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol, XFCell* pXFCell)
{
- std::pair<std::pair<sal_uInt16,sal_uInt8>,XFCell*> cell;
- std::pair<sal_uInt16,sal_uInt8> pos;
- pos.first = nRow;
- pos.second = nCol;
- cell.first = pos;
- cell.second = pXFCell;
- m_CellsMap.insert(cell);
+ // combine the 16bit nRow and 8bit nCol into a single 32bit number
+ m_CellsMap.insert(std::make_pair((nRow << 8) | nCol, pXFCell));
}
/**
@@ -1425,11 +1420,9 @@ void LwpTableLayout::SetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol,XFCell* pXFCell)
* @param nCol - column id
* @return pXFCell
*/
-XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow,sal_uInt8 nCol)
+XFCell* LwpTableLayout::GetCellsMap(sal_uInt16 nRow, sal_uInt8 nCol)
{
- std::pair<sal_uInt16,sal_uInt8> pos;
- pos.first = nRow;
- pos.second = nCol;
+ RowCol pos = (nRow << 8) | nCol;
auto iter = m_CellsMap.find(pos);
if (iter == m_CellsMap.end())
return nullptr;
diff --git a/lotuswordpro/source/filter/lwptablelayout.hxx b/lotuswordpro/source/filter/lwptablelayout.hxx
index 9eebb2b391c1..21ab84ec1c67 100644
--- a/lotuswordpro/source/filter/lwptablelayout.hxx
+++ b/lotuswordpro/source/filter/lwptablelayout.hxx
@@ -67,6 +67,7 @@
#include <vector>
#include <map>
#include <memory>
+#include <unordered_map>
class XFTableStyle;
class XFTable;
@@ -164,7 +165,8 @@ private:
void SplitConflictCells();
rtl::Reference<XFTable> m_pXFTable;
bool m_bConverted;
- std::map<std::pair<sal_uInt16,sal_uInt8>,XFCell*> m_CellsMap;
+ typedef sal_Int32 RowCol;
+ std::unordered_map<RowCol, XFCell*> m_CellsMap;
void PutCellVals(LwpFoundry* pFoundry, LwpObjectID aTableID);
};