On 02/24/09 17:14, maoyg wrote: > Last friday, I tested some questions about issue 8302# when inserting cells. > For example, the merged cells are from B1:D1,B2:D2,B3:D3 etc... > when I selected C column,inserting cell,the merged cells can't be > inserted rightly, > this problem have been solved on monday.I encounted the other problem > again, > the merged cells are from B2:D2,B3:D4,B5:D5,B6:D7,B8:D8,B9:D9 etc..., > the merged cells can't be inserted from B8:D8,B9:D9 etc... > so far,this problem haven't been solved. I debug the program, > I find the class ScDocAttrIterator exist some questions, when the merged > cell B6:D7 have been unmerged, > the data member "pArray->pData[nPos].nRow" will be changed in > ScAttrIterator::Next(...). > for example,firstly before inserting, pArray->pData[0].nRow = > 0,pArray->pData[1].nRow = 2,pArray->pData[2].nRow = 3, > pArray->pData[3].nRow = 5,pArray->pData[4].nRow = > 6,pArray->pData[5].nRow = 8,pArray->pData[6].nRow = 65535... > when the merged cell B6:D7 have been unmerged, pArray->pData[0].nRow = > 0,pArray->pData[1].nRow = 6, > pArray->pData[2].nRow = 8,pArray->pData[3].nRow = 65535... I don't know > how to solve this problem, > Have you any good idea?
I assume the data is for column C. Then it looks right. The AttrArray collects ranges of equal attributes in a column, not necessarily each merged range separately. The cells that are covered by a merged cell have a ScMergeFlagAttr that stores if the cells are overlapped horizontally or vertically. In the example "before inserting", row 0 (C1) is not overlapped. Row 1 (C2, part of B2:D2) and row 2 (C3, first row of B3:D4) are both overlapped horizontally, so they have the same attribute and only one entry in the AttrArray. Row 3 (C4, second row of B3:D4) is overlapped both horizontally and vertically. The remaining rows are treated similarly. After unmerging B6:D7 (and the cells above that, I assume), the rows up to 6 (C7) are not overlapped, 7 and 8 (C8 and C9) are overlapped horizontally. Row 0 is different because it still has the empty attribute ItemSet, and 1 to 6 contain an Item with the value "no overlap". If there is a problem, it's probably in how you use these values. Niklas --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@sc.openoffice.org For additional commands, e-mail: dev-h...@sc.openoffice.org