diff options
author | Niklas Nebel <nn@openoffice.org> | 2002-10-15 16:23:41 +0000 |
---|---|---|
committer | Niklas Nebel <nn@openoffice.org> | 2002-10-15 16:23:41 +0000 |
commit | 0c243f3710f93b0f9b278a83fc886d28a8339939 (patch) | |
tree | f7cee11125237c4c6eb48005c92c18cb463efdf4 /sc/source/ui/view/output.cxx | |
parent | fce1a633a9a79b9910ce50b16f253cc52cf11333 (diff) |
#76760# handle clip marks for merged cells
Diffstat (limited to 'sc/source/ui/view/output.cxx')
-rw-r--r-- | sc/source/ui/view/output.cxx | 61 |
1 files changed, 49 insertions, 12 deletions
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index 69d7a5bc591d..bc69689a0573 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -2,9 +2,9 @@ * * $RCSfile: output.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: nn $ $Date: 2002-10-14 14:44:18 $ + * last change: $Author: nn $ $Date: 2002-10-15 17:23:40 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2715,6 +2715,7 @@ void ScOutputData::DrawClipMarks() aArrowFillCol = rStyleSettings.GetWindowTextColor(); } + Rectangle aCellRect; long nPosY = nScrY; for (USHORT nArrY=1; nArrY+1<nArrCount; nArrY++) { @@ -2730,19 +2731,33 @@ void ScOutputData::DrawClipMarks() { if (pInfo->bHOverlapped || pInfo->bVOverlapped) { - //! ... - } - - long nOutWidth = pRowInfo[0].pCellInfo[nX+1].nWidth; - long nOutHeight = pThisRowInfo->nHeight; + // merge origin may be outside of visible area - use document functions - if ( pInfo->bMerged && pInfo->pPatternAttr ) - { USHORT nOverX = nX; USHORT nOverY = nY; + long nStartPosX = nPosX; + long nStartPosY = nPosY; + + while ( nOverX > 0 && ( ((const ScMergeFlagAttr*)pDoc->GetAttr( + nOverX, nOverY, nTab, ATTR_MERGE_FLAG ))->GetValue() & SC_MF_HOR ) ) + { + --nOverX; + nStartPosX -= (long) ( pDoc->GetColWidth(nOverX,nTab) * nPPTX ); + } + + while ( nOverY > 0 && ( ((const ScMergeFlagAttr*)pDoc->GetAttr( + nOverX, nOverY, nTab, ATTR_MERGE_FLAG ))->GetValue() & SC_MF_VER ) ) + { + --nOverY; + nStartPosY -= (long) ( pDoc->GetRowHeight(nOverY,nTab) * nPPTY ); + } + + long nOutWidth = (long) ( pDoc->GetColWidth(nOverX,nTab) * nPPTX ); + long nOutHeight = (long) ( pDoc->GetRowHeight(nOverY,nTab) * nPPTY ); + USHORT i; - const ScMergeAttr* pMerge = - (ScMergeAttr*)&pInfo->pPatternAttr->GetItem(ATTR_MERGE); + const ScMergeAttr* pMerge = (const ScMergeAttr*) + pDoc->GetAttr( nOverX, nOverY, nTab, ATTR_MERGE ); USHORT nCountX = pMerge->GetColMerge(); for (i=1; i<nCountX; i++) nOutWidth += (long) ( pDoc->GetColWidth(nOverX+i,nTab) * nPPTX ); @@ -2750,9 +2765,31 @@ void ScOutputData::DrawClipMarks() for (i=1; i<nCountY; i++) nOutHeight += (long) ( pDoc->GetRowHeight(nOverY+i,nTab) * nPPTY ); + aCellRect = Rectangle( Point( nStartPosX, nStartPosY ), Size( nOutWidth, nOutHeight ) ); } + else + { + long nOutWidth = pRowInfo[0].pCellInfo[nX+1].nWidth; + long nOutHeight = pThisRowInfo->nHeight; - Rectangle aCellRect( Point( nPosX, nPosY ), Size( nOutWidth, nOutHeight ) ); + if ( pInfo->bMerged && pInfo->pPatternAttr ) + { + USHORT nOverX = nX; + USHORT nOverY = nY; + USHORT i; + const ScMergeAttr* pMerge = + (ScMergeAttr*)&pInfo->pPatternAttr->GetItem(ATTR_MERGE); + USHORT nCountX = pMerge->GetColMerge(); + for (i=1; i<nCountX; i++) + nOutWidth += (long) ( pDoc->GetColWidth(nOverX+i,nTab) * nPPTX ); + USHORT nCountY = pMerge->GetRowMerge(); + for (i=1; i<nCountY; i++) + nOutHeight += (long) ( pDoc->GetRowHeight(nOverY+i,nTab) * nPPTY ); + + } + + aCellRect = Rectangle( Point( nPosX, nPosY ), Size( nOutWidth, nOutHeight ) ); + } long nMarkPixel = (long)( SC_CLIPMARK_SIZE * nPPTX ); Size aMarkSize( nMarkPixel, (nMarkPixel-1)*2 ); |