fix ptgList toArea conversion

This commit is contained in:
Viktor Andreev
2026-04-03 21:47:41 +06:00
parent d90c3aa3ac
commit 73b32984e2
2 changed files with 20 additions and 11 deletions

View File

@ -166,11 +166,16 @@ Ptg* PtgList::toArea()
{
tableRef.fromString(tableRefIndex->second);
tableRef.columnFirst += colFirst;
tableRef.columnLast = tableRef.columnFirst + (colLast - colFirst);
tableRef.columnLast = tableRef.columnFirst;
if(colLast > colFirst)
tableRef.columnLast += (colLast - colFirst);
if(rowType == 0x2) //headers
tableRef.rowLast = tableRef.rowFirst;
else if(rowType == 0x0) //data
{
tableRef.rowFirst++;
tableRef.rowLast--;
}
else if(rowType == 0x6) //dataheaders
tableRef.rowLast--;
else if(rowType == 0x0C) // datatotals
@ -178,7 +183,11 @@ Ptg* PtgList::toArea()
else if(rowType == 0x8) //totals
tableRef.rowFirst = tableRef.rowLast;
}
PtgArea3d* listArea = new PtgArea3d(0x3B, CellRef());
unsigned char ptgType = type_+1;
unsigned char areaType = 0x3B;
SETBITS(areaType,5,6, ptgType);
PtgArea3d* listArea = new PtgArea3d(areaType, CellRef());
listArea->ixti = ixti;
listArea->area = tableRef;
listArea->area.rowFirstRelative = false;

View File

@ -59,17 +59,17 @@ public:
//const std::wstring toString() const;
_UINT16 ixti;
BYTE columns;
BYTE rowType;
bool squareBracketSpace;
bool commaSpace;
_UINT16 ixti = 0;
BYTE columns = 0;
BYTE rowType = 0;
bool squareBracketSpace = false;
bool commaSpace = false;
BYTE type_;
bool invalid;
bool nonresident;
bool invalid = false;
bool nonresident = false;
_UINT32 listIndex;
_UINT16 colFirst;
_UINT16 colLast;
_UINT16 colFirst = 0;
_UINT16 colLast = 0;
private:
GlobalWorkbookInfoPtr global_info;