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 26 Jul 2004 02:39:00 -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/cellsh3.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/cellsh3.cxx,v --- sc/source/ui/view/cellsh3.cxx 4 Jun 2004 11:58:22 -0000 1.13 +++ sc/source/ui/view/cellsh3.cxx 26 Jul 2004 02:39:01 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -204,9 +204,15 @@ case SID_STATUS_SELMODE_ERG: if ( pTabViewShell->GetLockedModifiers() & KEY_MOD1 ) + { pTabViewShell->LockModifiers( 0 ); + GetViewData()->SetMod1KeyStatus( FALSE ); // #i3875# *Hack* + } else + { pTabViewShell->LockModifiers( KEY_MOD1 ); + GetViewData()->SetMod1KeyStatus( TRUE ); // #i3875# *Hack* + } rBindings.Invalidate( SID_STATUS_SELMODE ); break; 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 26 Jul 2004 02:39:03 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -597,6 +597,28 @@ aAnchorPos.Set( nPosX, nPosY, nTab ); bStarted = TRUE; } + // #i3875# *Hack* When a new cell is Ctrl-clicked with no pre-selected cells, + // it highlights that new cell as well as the old cell where the cursor is + // positioned prior to the click. A selection mode via Shift-F8 should also + // follow the same behavior. + else if ( pViewData->IsMod1KeyDown() ) + { + SCCOL nOldX = pViewData->GetCurX(); + SCROW nOldY = pViewData->GetCurY(); + + pView->InitBlockMode( nOldX, nOldY, nTab, TRUE ); + pView->MarkCursor( (SCCOL) nOldX, (SCROW) nOldY, nTab ); + + if ( nOldX != nPosX || nOldY != nPosY ) + { + 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/tabview3.cxx =================================================================== RCS file: /cvs/sc/sc/source/ui/view/tabview3.cxx,v --- sc/source/ui/view/tabview3.cxx 4 Jun 2004 12:06:29 -0000 1.37 +++ sc/source/ui/view/tabview3.cxx 26 Jul 2004 02:39:05 -0000 @@ -54,7 +54,7 @@ * * All Rights Reserved. * - * Contributor(s): _______________________________________ + * Contributor(s): Kohei Yoshida__________________________ * * ************************************************************************/ @@ -931,12 +931,22 @@ BOOL ScTabView::SelMouseButtonDown( const MouseEvent& rMEvt ) { BOOL bRet = FALSE; + + // #i3875# *Hack* + BOOL bMod1Locked = aViewData.GetViewShell()->GetLockedModifiers() & KEY_MOD1 ? TRUE : FALSE; + aViewData.SetMod1KeyStatus( rMEvt.IsMod1() || bMod1Locked ); + if ( pSelEngine ) { bMoveIsShift = rMEvt.IsShift(); bRet = pSelEngine->SelMouseButtonDown( rMEvt ); bMoveIsShift = FALSE; } + + // #i3875# *Hack* + if ( !bMod1Locked ) + aViewData.SetMod1KeyStatus( FALSE ); + return bRet; } 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 26 Jul 2004 02:39:07 -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() );