Index: gridwin.cxx =================================================================== --- gridwin.cxx (revision 1343451) +++ gridwin.cxx (working copy) @@ -880,6 +880,7 @@ long nSizeY = 0; long nHeight = 0; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); + nSizeY = pViewData->ToPixel(pDoc->GetRowHeight(nRow, nTab), pViewData->GetPPTY()); Point aPos = pViewData->GetScrPos( nCol, nRow, eWhich ); if ( bLayoutRTL ) aPos.X() -= nSizeX; @@ -1674,12 +1675,23 @@ if ( !bDouble && !bFormulaMode && rMEvt.IsLeft() ) { + SCsCOL nRealPosX; + SCsROW nRealPosY; + pViewData->GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nRealPosX, nRealPosY, false );//the real row/col + ScMergeFlagAttr* pRealPosAttr = (ScMergeFlagAttr*) + pDoc->GetAttr( nRealPosX, nRealPosY, nTab, ATTR_MERGE_FLAG ); ScMergeFlagAttr* pAttr = (ScMergeFlagAttr*) pDoc->GetAttr( nPosX, nPosY, nTab, ATTR_MERGE_FLAG ); - if (pAttr->HasAutoFilter()) + if( pRealPosAttr->HasAutoFilter() ) { + SC_MOD()->InputEnterHandler(); + if (DoAutoFilterButton( nRealPosX, nRealPosY, rMEvt)) + return; + } + if( pAttr->HasAutoFilter() ) + { SC_MOD()->InputEnterHandler(); //Add for i85305 - if (DoAutoFilterButton(nPosX, nPosY, rMEvt)) + if (DoAutoFilterButton( nPosX, nPosY, rMEvt)) return; } if (pAttr->HasButton()) Index: gridwin2.cxx =================================================================== --- gridwin2.cxx (revision 1343451) +++ gridwin2.cxx (working copy) @@ -137,6 +137,7 @@ long nSizeX, nSizeY; pViewData->GetMergeSizePixel( nCol, nRow, nSizeX, nSizeY ); + nSizeY = pViewData->ToPixel(pDoc->GetRowHeight(nRow, nTab), pViewData->GetPPTY()); Size aScrSize(nSizeX-1, nSizeY-1); // Check if the mouse cursor is clicking on the popup arrow box. Index: gridwin4.cxx =================================================================== --- gridwin4.cxx (revision 1343451) +++ gridwin4.cxx (working copy) @@ -1236,7 +1236,7 @@ for (nCol=nX1; nCol<=nX2; nCol++) { CellInfo* pInfo = &pThisRowInfo->pCellInfo[nCol+1]; - if ( pInfo->bAutoFilter && !pInfo->bHOverlapped && !pInfo->bVOverlapped ) + if ( pInfo->bAutoFilter && !pInfo->bHOverlapped/* && !pInfo->bVOverlapped*/ ) { if (!pQueryParam) pQueryParam = new ScQueryParam; @@ -1288,7 +1288,13 @@ 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);