Index: sc/source/ui/inc/viewfunc.hxx =================================================================== RCS file: /cvs/sc/sc/source/ui/inc/viewfunc.hxx,v retrieving revision 1.16.224.1 diff -u -r1.16.224.1 viewfunc.hxx --- sc/source/ui/inc/viewfunc.hxx 31 Oct 2003 16:10:00 -0000 1.16.224.1 +++ sc/source/ui/inc/viewfunc.hxx 6 Oct 2004 14:54:27 -0000 @@ -274,6 +274,7 @@ double fStart, double fStep, double fMax, BOOL bRecord = TRUE ); void FillAuto( FillDir eDir, USHORT nStartCol, USHORT nStartRow, USHORT nEndCol, USHORT nEndRow, USHORT nCount, BOOL bRecord = TRUE ); + void FillCrossDblClick(); void TransliterateText( sal_Int32 nType ); Index: sc/source/ui/view/gridwin.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/gridwin.cxx,v retrieving revision 1.43 diff -u -r1.43 gridwin.cxx --- sc/source/ui/view/gridwin.cxx 2 Jun 2003 07:28:42 -0000 1.43 +++ sc/source/ui/view/gridwin.cxx 6 Oct 2004 14:54:28 -0000 @@ -1403,11 +1403,16 @@ return; } - BOOL bAutoFill = TestMouse( rMEvt, TRUE ); - if (bAutoFill) - pScMod->InputEnterHandler(); // Autofill etc. + BOOL bCrossPointer = TestMouse( rMEvt, TRUE ); + if ( bCrossPointer ) + { + if ( bDouble ) + pViewData->GetView()->FillCrossDblClick(); + else + pScMod->InputEnterHandler(); // Autofill etc. + } - if (!bAutoFill) + if ( !bCrossPointer ) { nPagebreakMouse = HitPageBreak( rMEvt.GetPosPixel(), &aPagebreakSource, &nPagebreakBreak, &nPagebreakPrev ); @@ -1423,7 +1428,7 @@ if (!bFormulaMode && !bEditMode && rMEvt.IsLeft()) { - if ( !bAutoFill && DrawMouseButtonDown(rMEvt) ) + if ( !bCrossPointer && DrawMouseButtonDown(rMEvt) ) { //if (DrawHasMarkedObj()) // pViewData->GetViewShell()->SetDrawShellOrSub(); // Draw-Objekt selektiert @@ -1519,7 +1524,7 @@ if ( nMouseStatus != SC_GM_IGNORE && !bRefMode ) { - if (bDouble) + if ( bDouble && !bCrossPointer ) { if (nMouseStatus == SC_GM_TABDOWN) nMouseStatus = SC_GM_DBLDOWN; Index: sc/source/ui/view/viewfun2.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/viewfun2.cxx,v retrieving revision 1.19 diff -u -r1.19 viewfun2.cxx --- sc/source/ui/view/viewfun2.cxx 28 Apr 2003 15:46:04 -0000 1.19 +++ sc/source/ui/view/viewfun2.cxx 6 Oct 2004 14:54:28 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -1043,6 +1043,81 @@ //---------------------------------------------------------------------------- +/** Downward fill of selected cell(s) by double-clicking cross-hair cursor + + Extends a current selection down to the last non-empty cell of an adjacent + column when the lower-right corner of the selection is double-clicked. It + uses a left-adjoining non-empty column as a guide if such is available, + otherwise a right-adjoining non-empty column is used. + + @author Kohei Yoshida (kohei@openoffice.org) + + @return No return value + + @see #i12313# +*/ +void ScViewFunc::FillCrossDblClick() +{ + ScRange aRange; + GetViewData()->GetSimpleArea( aRange ); + aRange.Justify(); + + USHORT nTab = GetViewData()->GetCurPos().Tab(); + USHORT nStartX = aRange.aStart.Col(); + USHORT nStartY = aRange.aStart.Row(); + USHORT nEndX = aRange.aEnd.Col(); + USHORT nEndY = aRange.aEnd.Row(); + + ScDocument* pDoc = GetViewData()->GetDocument(); + + // Make sure the selection is not empty + if ( pDoc->IsBlockEmpty( nTab, nStartX, nStartY, nEndX, nEndY ) ) + return; + + if ( nEndY < MAXROW ) + { + if ( nStartX > 0 ) + { + USHORT nMovX = nStartX - 1; + USHORT nMovY = nStartY; + + if ( pDoc->HasData( nMovX, nStartY, nTab ) && + pDoc->HasData( nMovX, nStartY + 1, nTab ) ) + { + pDoc->FindAreaPos( nMovX, nMovY, nTab, 0, 1 ); + + if ( nMovY > nEndY ) + { + FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY, + nMovY - nEndY ); + return; + } + } + } + + if ( nEndX < MAXCOL ) + { + USHORT nMovX = nEndX + 1; + USHORT nMovY = nStartY; + + if ( pDoc->HasData( nMovX, nStartY, nTab ) && + pDoc->HasData( nMovX, nStartY + 1, nTab ) ) + { + pDoc->FindAreaPos( nMovX, nMovY, nTab, 0, 1 ); + + if ( nMovY > nEndY ) + { + FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY, + nMovY - nEndY ); + return; + } + } + } + } +} + +//---------------------------------------------------------------------------- + void ScViewFunc::TransliterateText( sal_Int32 nType ) { ScMarkData aFuncMark = GetViewData()->GetMarkData();