summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin4.cxx
diff options
context:
space:
mode:
authorJian Fang Zhang <zhangjf@apache.org>2012-06-21 07:19:34 +0000
committerFridrich Štrba <fridrich.strba@bluewin.ch>2013-03-12 05:36:59 +0100
commitaaab3a79dfd762a64fa4c1d19dd29ae46c0b9dd0 (patch)
tree188563cd703994526098978c754392dbfc95de51 /sc/source/ui/view/gridwin4.cxx
parent3545b0398ef3516278c8ac7d55283ffdb7cc28b6 (diff)
Resolves: #i120017, filter button is not shown in merged cell
Patch by: zhao shao zhi, aoo.zhaoshzh@gmail.com Found by: Yan Ji,<yanji.yj@gmail.com> Review by: zhangjf (cherry picked from commit bcf01fd794ec169aaf2a3f8b86f986ec60e5beb8) Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch> Conflicts: sc/source/ui/view/gridwin.cxx Change-Id: Ie8a529c697979cf75c303bddcaddd2776f5b8047
Diffstat (limited to 'sc/source/ui/view/gridwin4.cxx')
-rw-r--r--sc/source/ui/view/gridwin4.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index f2b3ba1131ee..1103e5cf68e0 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1144,7 +1144,9 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, ScTableInfo& rTabInfo, Out
for (nCol=nX1; nCol<=nX2; nCol++)
{
CellInfo* pInfo = &pThisRowInfo->pCellInfo[nCol+1];
- if ( pInfo->bAutoFilter && !pInfo->bHOverlapped && !pInfo->bVOverlapped )
+ //if several columns merged on a row, there should be only one auto button at the end of the columns.
+ //if several rows merged on a column, the button may be in the middle, so "!pInfo->bVOverlapped" should not be used
+ if ( pInfo->bAutoFilter && !pInfo->bHOverlapped )
{
if (!pQueryParam)
pQueryParam = new ScQueryParam;
@@ -1197,7 +1199,13 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCCOL nX2, ScTableInfo& rTabInfo, Out
bool bArrowState = bSimpleQuery && bColumnFound;
long nSizeX;
long nSizeY;
- pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY );
+ SCCOL nStartCol= nCol;
+ SCROW nStartRow = nRow;
+ //if address(nCol,nRow) is not the start pos of the merge area, the value of the nSizeX will be incorrect, it will be the length of the cell.
+ //should first get the start pos of the merge area, then get the nSizeX through the start pos.
+ pDoc->ExtendOverlapped(nStartCol, nStartRow,nCol, nRow, nTab);//get nStartCol,nStartRow
+ pViewData->GetMergeSizePixel( nStartCol, nStartRow, nSizeX, nSizeY );//get nSizeX
+ nSizeY = pViewData->ToPixel(pDoc->GetRowHeight(nRow, nTab), pViewData->GetPPTY());
Point aScrPos = pViewData->GetScrPos( nCol, nRow, eWhich );
aCellBtn.setBoundingBox(aScrPos, Size(nSizeX-1, nSizeY-1), bLayoutRTL);