Index: sc/source/ui/inc/viewfunc.hxx =================================================================== RCS file: /cvs/sc/sc/source/ui/inc/viewfunc.hxx,v retrieving revision 1.20 diff -u -w -r1.20 viewfunc.hxx --- sc/source/ui/inc/viewfunc.hxx 4 Jun 2004 11:45:53 -0000 1.20 +++ sc/source/ui/inc/viewfunc.hxx 31 Aug 2004 01:57:38 -0000 @@ -272,6 +272,7 @@ double fStart, double fStep, double fMax, BOOL bRecord = TRUE ); void FillAuto( FillDir eDir, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, ULONG 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.55 diff -u -w -r1.55 gridwin.cxx --- sc/source/ui/view/gridwin.cxx 8 Jun 2004 10:29:49 -0000 1.55 +++ sc/source/ui/view/gridwin.cxx 31 Aug 2004 01:57:39 -0000 @@ -1621,11 +1621,16 @@ return; } - BOOL bAutoFill = TestMouse( rMEvt, TRUE ); - if (bAutoFill) + 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 ); @@ -1641,7 +1646,7 @@ if (!bFormulaMode && !bEditMode && rMEvt.IsLeft()) { - if ( !bAutoFill && DrawMouseButtonDown(rMEvt) ) + if ( !bCrossPointer && DrawMouseButtonDown(rMEvt) ) { //if (DrawHasMarkedObj()) // pViewData->GetViewShell()->SetDrawShellOrSub(); // Draw-Objekt selektiert @@ -1759,7 +1764,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.23 diff -u -w -r1.23 viewfun2.cxx --- sc/source/ui/view/viewfun2.cxx 4 Jun 2004 12:09:45 -0000 1.23 +++ sc/source/ui/view/viewfun2.cxx 31 Aug 2004 01:57:40 -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(); + + SCTAB nTab = GetViewData()->GetCurPos().Tab(); + SCCOL nStartX = aRange.aStart.Col(); + SCROW nStartY = aRange.aStart.Row(); + SCCOL nEndX = aRange.aEnd.Col(); + SCROW 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 ) + { + SCCOL nMovX = nStartX - 1; + SCROW 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 ) + { + SCCOL nMovX = nEndX + 1; + SCROW 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();