Index: sc/source/ui/inc/viewdata.hxx =================================================================== RCS file: /cvs/sc/sc/source/ui/inc/viewdata.hxx,v --- sc/source/ui/inc/viewdata.hxx 4 Jun 2004 11:45:36 -0000 1.14 +++ sc/source/ui/inc/viewdata.hxx 20 Jul 2004 03:02:55 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -219,6 +219,8 @@ BYTE nFillMode; // Modus BOOL bPagebreak; // Seitenumbruch-Vorschaumodus + BOOL bMod1KeyDown; + DECL_LINK (EmptyEditHdl, EditStatus*); DECL_LINK (EditEngineHdl, EditStatus*); @@ -308,6 +310,8 @@ void SetZoom( const Fraction& rNewX, const Fraction& rNewY ); + void SetMod1KeyStatus( BOOL bDown ) { bMod1KeyDown = bDown; } + const Fraction& GetZoomX() const { return bPagebreak ? aPageZoomX : aZoomX; } const Fraction& GetZoomY() const { return bPagebreak ? aPageZoomY : aZoomY; } @@ -467,6 +471,8 @@ const Size& GetScenButSize() const { return aScenButSize; } void SetScenButSize(const Size& rNew) { aScenButSize = rNew; } + BOOL IsMod1KeyDown() { return bMod1KeyDown; } + static inline long ToPixel( USHORT nTwips, double nFactor ); }; Index: sc/source/ui/view/gridwin.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/gridwin.cxx,v --- sc/source/ui/view/gridwin.cxx 8 Jun 2004 10:29:49 -0000 1.55 +++ sc/source/ui/view/gridwin.cxx 20 Jul 2004 03:02:57 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -1491,6 +1491,8 @@ SCROW nOldRowFBox = bWasFilterBox ? pFilterBox->GetRow() : 0; #endif + pViewData->SetMod1KeyStatus( rMEvt.IsMod1() ); + ClickExtern(); // loescht FilterBox, wenn vorhanden HideNoteMarker(); // Notiz-Anzeige @@ -2928,10 +2930,12 @@ void __EXPORT ScGridWindow::KeyInput(const KeyEvent& rKEvt) { + const KeyCode& rKeyCode = rKEvt.GetKeyCode(); + pViewData->SetMod1KeyStatus( rKeyCode.IsMod1() ); + // #96965# Cursor control for ref input dialog if( SC_MOD()->IsRefDialogOpen() ) { - const KeyCode& rKeyCode = rKEvt.GetKeyCode(); if( !rKeyCode.GetModifier() && (rKeyCode.GetCode() == KEY_F2) ) { SC_MOD()->EndReference(); Index: sc/source/ui/view/select.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/select.cxx,v --- sc/source/ui/view/select.cxx 4 Jun 2004 12:05:23 -0000 1.12 +++ sc/source/ui/view/select.cxx 20 Jul 2004 03:02:57 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -588,6 +588,8 @@ else { ScMarkData& rMark = pViewData->GetMarkData(); + SCCOL nOldX = pViewData->GetCurX(); + SCROW nOldY = pViewData->GetCurY(); if (rMark.IsMarked() || rMark.IsMultiMarked()) { pView->DoneBlockMode(TRUE); @@ -597,6 +599,19 @@ aAnchorPos.Set( nPosX, nPosY, nTab ); bStarted = TRUE; } + // #i3875# When a new cell is Ctrl-clicked with no selection present, it + // highlights that new cell as well as the old cell where the cursor is. + else if ( pViewData->IsMod1KeyDown() && ( nOldX != nPosX || nOldY != nPosY ) ) + { + pView->InitBlockMode( nOldX, nOldY, nTab, TRUE ); + pView->MarkCursor( (SCCOL) nOldX, (SCROW) nOldY, nTab ); + pView->DoneBlockMode( TRUE ); + pView->InitBlockMode( nPosX, nPosY, nTab, TRUE ); + pView->MarkCursor( (SCCOL) nPosX, (SCROW) nPosY, nTab ); + + aAnchorPos.Set( nPosX, nPosY, nTab ); + bStarted = TRUE; + } } pView->SetCursor( (SCCOL) nPosX, (SCROW) nPosY ); Index: sc/source/ui/view/viewdata.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/viewdata.cxx,v --- sc/source/ui/view/viewdata.cxx 4 Jun 2004 12:09:32 -0000 1.45 +++ sc/source/ui/view/viewdata.cxx 20 Jul 2004 03:03:00 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -326,7 +326,8 @@ bDelMarkValid( FALSE ), bActive ( TRUE ), //! wie initialisieren? bPagebreak ( FALSE ), - pSpellingView ( NULL ) + pSpellingView ( NULL ), + bMod1KeyDown( FALSE ) { SetGridMode ( TRUE ); @@ -391,7 +392,8 @@ bDelMarkValid( FALSE ), bActive ( TRUE ), //! wie initialisieren? bPagebreak ( rViewData.bPagebreak ), - pSpellingView ( rViewData.pSpellingView ) + pSpellingView ( rViewData.pSpellingView ), + bMod1KeyDown( rViewData.bMod1KeyDown ) { SetGridMode ( rViewData.IsGridMode() );