diff options
Diffstat (limited to 'sc/source/ui/view/tabview.cxx')
-rw-r--r-- | sc/source/ui/view/tabview.cxx | 246 |
1 files changed, 79 insertions, 167 deletions
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 83bf1a4c9c12..a00c71b95918 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1,3 +1,4 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -30,36 +31,6 @@ //------------------------------------------------------------------ - -#if 0 -#define _MACRODLG_HXX -#define _BIGINT_HXX -#define _SVCONTNR_HXX -#define BASIC_NODIALOGS -#define _SFXMNUITEM_HXX -#define _SVDXOUT_HXX -#define _SVDATTR_HXX -#define _SFXMNUITEM_HXX -#define _DLGCFG_HXX -#define _SFXMNUMGR_HXX -#define _SFXBASIC_HXX -#define _MODALDLG_HXX -#define _SFX_TEMPLDLG_HXX -#define _SFXSTBMGR_HXX -#define _SFXTBXMGR_HXX -#define _BASE_DLGS_HXX -#define _SFXIMGMGR_HXX -#define _SFXMNUMGR_HXX -#define _SFXSTBITEM_HXX -#define _SFXTBXCTRL_HXX -#define _PASSWD_HXX -//#define _SFXFILEDLG_HXX -//#define _SFXREQUEST_HXX -#define _SFXOBJFACE_HXX - -#define _SDR_NOTRANSFORM -#define _SVDXOUT_HXX -#endif #include <vcl/svapp.hxx> /////////////////////////////////////////////////////////////////////////// @@ -68,31 +39,12 @@ // Die u.a. Aenderungen nehmen vorgeschlagene Konstante vorweg /////////////////////////////////////////////////////////////////////////// -#if 0 -#define _SDR_NOTRANSFORM // Transformationen, selten verwendet -#define _SDR_NOTOUCH // Hit-Tests, selten verwendet - -#define _SDR_NOUNDO // Undo-Objekte -#define _SDR_NOPAGEOBJ // SdrPageObj -#define _SDR_NOVIRTOBJ // SdrVirtObj -#define _SDR_NOGROUPOBJ // SdrGroupObj -#define _SDR_NOTEXTOBJ // SdrTextObj -#define _SDR_NOPATHOBJ // SdrPathObj -#define _SDR_NOEDGEOBJ // SdrEdgeObj -#define _SDR_NORECTOBJ // SdrRectObj -#define _SDR_NOCAPTIONOBJ // SdrCaptionObj -#define _SDR_NOCIRCLEOBJ // SdrCircleObj -#define _SDR_NOGRAFOBJ // SdrGrafObj -#define _SDR_NOOLE2OBJ // SdrOle2Obj -#endif - // Dieses define entfernt die VCControls aus SI.HXX #define _SI_HXX // VCControls ////////////////////// Umsetzen der Standard-Defines ////////////////////// -//#define _SVDDRAG_HXX // SdrDragStat #define _SVDPAGE_HXX // SdrPage #ifdef _SDR_NOSURROGATEOBJ @@ -163,13 +115,8 @@ #undef _SVDORECT_HXX #endif -//#ifdef _SDR_NOVIEWS -// #define _SVDDRAG_HXX -//#endif - ////////////////////// Ende der SVDRAW-Modifikationen ///////////////////// - // INCLUDE --------------------------------------------------------------- #include "scitems.hxx" @@ -196,6 +143,7 @@ #include "viewuno.hxx" #include "AccessibilityHints.hxx" #include "appoptio.hxx" +#include "attrib.hxx" #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> @@ -227,14 +175,14 @@ ScCornerButton::ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool bAd { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); SetBackground( rStyleSettings.GetFaceColor() ); - EnableRTL( sal_False ); + EnableRTL( false ); } -__EXPORT ScCornerButton::~ScCornerButton() +ScCornerButton::~ScCornerButton() { } -void __EXPORT ScCornerButton::Paint( const Rectangle& rRect ) +void ScCornerButton::Paint( const Rectangle& rRect ) { Size aSize = GetOutputSizePixel(); long nPosX = aSize.Width()-1; @@ -247,7 +195,7 @@ void __EXPORT ScCornerButton::Paint( const Rectangle& rRect ) sal_Bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL( pViewData->GetTabNo() ); long nDarkX = bLayoutRTL ? 0 : nPosX; - if ( !bAdd && !rStyleSettings.GetHighContrastMode() ) + if ( !bAdd ) { // match the shaded look of column/row headers @@ -300,12 +248,12 @@ void ScCornerButton::DataChanged( const DataChangedEvent& rDCEvt ) } -void __EXPORT ScCornerButton::Resize() +void ScCornerButton::Resize() { Invalidate(); } -void __EXPORT ScCornerButton::MouseButtonDown( const MouseEvent& rMEvt ) +void ScCornerButton::MouseButtonDown( const MouseEvent& rMEvt ) { ScModule* pScMod = SC_MOD(); sal_Bool bDisable = pScMod->IsFormulaMode() || pScMod->IsModalMode(); @@ -331,7 +279,7 @@ sal_Bool lcl_HasColOutline( const ScViewData& rViewData ) if ( pArray->GetDepth() > 0 ) return sal_True; } - return sal_False; + return false; } sal_Bool lcl_HasRowOutline( const ScViewData& rViewData ) @@ -343,7 +291,7 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData ) if ( pArray->GetDepth() > 0 ) return sal_True; } - return sal_False; + return false; } //================================================================== @@ -358,12 +306,12 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData ) pHdrSelEng( NULL ), \ aHdrFunc( &aViewData ), \ pDrawView( NULL ), \ - bDrawSelMode( sal_False ), \ + bDrawSelMode( false ), \ aVScrollTop( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ), \ aVScrollBottom( pFrameWin, WinBits( WB_VSCROLL | WB_DRAG ) ), \ aHScrollLeft( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ), \ aHScrollRight( pFrameWin, WinBits( WB_HSCROLL | WB_DRAG ) ), \ - aCornerButton( pFrameWin, &aViewData, sal_False ), \ + aCornerButton( pFrameWin, &aViewData, false ), \ aTopButton( pFrameWin, &aViewData, sal_True ), \ aScrollBarBox( pFrameWin, WB_SIZEABLE ), \ pInputHintWindow( NULL ), \ @@ -371,21 +319,20 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData ) pHighlightRanges( NULL ), \ pBrushDocument( NULL ), \ pDrawBrushSet( NULL ), \ - bLockPaintBrush( sal_False ), \ + bLockPaintBrush( false ), \ pTimerWindow( NULL ), \ nTipVisible( 0 ), \ - bDragging( sal_False ), \ - bIsBlockMode( sal_False ), \ - bBlockNeg( sal_False ), \ - bBlockCols( sal_False ), \ - bBlockRows( sal_False ), \ + bDragging( false ), \ + bIsBlockMode( false ), \ + bBlockNeg( false ), \ + bBlockCols( false ), \ + bBlockRows( false ), \ mfPendingTabBarWidth( -1.0 ), \ - bMinimized( sal_False ), \ - bInUpdateHeader( sal_False ), \ - bInActivatePart( sal_False ), \ - bInZoomUpdate( sal_False ), \ - bMoveIsShift( sal_False ), \ - bNewStartIfMarking( sal_False ) + bMinimized( false ), \ + bInUpdateHeader( false ), \ + bInActivatePart( false ), \ + bInZoomUpdate( false ), \ + bMoveIsShift( false ) ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pViewShell ) : @@ -398,22 +345,6 @@ ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell* pView Init(); } -//UNUSED2009-05 ScTabView::ScTabView( Window* pParent, const ScTabView& rScTabView, ScTabViewShell* pViewShell ) : -//UNUSED2009-05 pFrameWin( pParent ), -//UNUSED2009-05 aViewData( rScTabView.aViewData ), -//UNUSED2009-05 TABVIEW_INIT -//UNUSED2009-05 { -//UNUSED2009-05 RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "nn93723", "ScTabView::ScTabView" ); -//UNUSED2009-05 -//UNUSED2009-05 aViewData.SetViewShell( pViewShell ); -//UNUSED2009-05 Init(); -//UNUSED2009-05 -//UNUSED2009-05 UpdateShow(); -//UNUSED2009-05 if ( aViewData.GetActivePart() != SC_SPLIT_BOTTOMLEFT ) -//UNUSED2009-05 pGridWin[SC_SPLIT_BOTTOMLEFT]->Show(); -//UNUSED2009-05 -//UNUSED2009-05 InvalidateSplit(); -//UNUSED2009-05 } void ScTabView::InitScrollBar( ScrollBar& rScrollBar, long nMaxVal ) { @@ -443,7 +374,6 @@ void ScTabView::ResetTimer() IMPL_LINK( ScTabView, TimerHdl, Timer*, EMPTYARG ) { -// aScrollTimer.Stop(); if (pTimerWindow) pTimerWindow->MouseMove( aTimerMEvt ); @@ -493,12 +423,12 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn // Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden: SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode(); if ( eMode == SCROLLING_NO ) - bHScroll = bVScroll = sal_False; + bHScroll = bVScroll = false; else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO ) //! Auto ??? bHScroll = bVScroll = sal_True; if ( aViewData.GetDocShell()->IsPreview() ) - bHScroll = bVScroll = bTabControl = bHeaders = bOutlMode = bHOutline = bVOutline = sal_False; + bHScroll = bVScroll = bTabControl = bHeaders = bOutlMode = bHOutline = bVOutline = false; long nBarX = 0; long nBarY = 0; @@ -511,7 +441,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn long nPosY = rOffset.Y(); long nSizeX = rSize.Width(); long nSizeY = rSize.Height(); - long nSize1; bMinimized = ( nSizeX<=SC_ICONSIZE || nSizeY<=SC_ICONSIZE ); if ( bMinimized ) @@ -536,7 +465,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn if ( WhichH( aViewData.GetActivePart() ) == SC_SPLIT_RIGHT ) ActivatePart( SC_SPLIT_BOTTOMLEFT ); InvalidateSplit(); -// UpdateShow(); } if ( aViewData.GetVSplitMode() != SC_SPLIT_NONE ) if ( aViewData.GetVSplitPos() > nSizeY - SPLIT_MARGIN ) @@ -545,7 +473,6 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn if ( WhichV( aViewData.GetActivePart() ) == SC_SPLIT_TOP ) ActivatePart( SC_SPLIT_BOTTOMLEFT ); InvalidateSplit(); -// UpdateShow(); } UpdateShow(); @@ -555,13 +482,11 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn long nScrollBarSize = pFrameWin->GetSettings().GetStyleSettings().GetScrollBarSize(); if (bVScroll) { -// nBarX = aVScrollBottom.GetSizePixel().Width(); nBarX = nScrollBarSize; nSizeX -= nBarX - nOverlap; } if (bHScroll) { -// nBarY = aHScrollLeft.GetSizePixel().Height(); nBarY = nScrollBarSize; nSizeY -= nBarY - nOverlap; } @@ -682,7 +607,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn nBarY = aHScrollLeft.GetSizePixel().Height(); nBarX = aVScrollBottom.GetSizePixel().Width(); - nSize1 = nSizeX + nOverlap; + long nSize1 = nSizeX + nOverlap; long nTabSize = nSize1; if (nTabSize < 0) nTabSize = 0; @@ -876,7 +801,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, sal_Bool bInn UpdateScrollBars(); // Scrollbars nicht beim Scrollen neu setzen UpdateHeaderWidth(); - InterpretVisible(); // #69343# have everything calculated before painting + InterpretVisible(); // have everything calculated before painting } if (bHasHint) @@ -904,20 +829,20 @@ void ScTabView::UpdateVarZoom() if ( aNew != rOldX || aNew != rOldY ) { - SetZoom( aNew, aNew, sal_False ); // always separately per sheet + SetZoom( aNew, aNew, false ); // always separately per sheet PaintGrid(); PaintTop(); PaintLeft(); aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM ); aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); } - bInZoomUpdate = sal_False; + bInZoomUpdate = false; } } void ScTabView::UpdateFixPos() { - sal_Bool bResize = sal_False; + sal_Bool bResize = false; if ( aViewData.GetHSplitMode() == SC_SPLIT_FIX ) if (aViewData.UpdateFixX()) bResize = sal_True; @@ -925,7 +850,7 @@ void ScTabView::UpdateFixPos() if (aViewData.UpdateFixY()) bResize = sal_True; if (bResize) - RepeatResize(sal_False); + RepeatResize(false); } void ScTabView::RepeatResize( sal_Bool bUpdateFix ) @@ -992,7 +917,7 @@ IMPL_LINK( ScTabView, TabBarResize, void*, EMPTYARG ) // Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden: SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode(); if ( eMode == SCROLLING_NO ) - bHScrollMode = sal_False; + bHScrollMode = false; else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO ) //! Auto ??? bHScrollMode = sal_True; @@ -1079,17 +1004,8 @@ void ScTabView::SetActivePointer( const Pointer& rPointer ) for (sal_uInt16 i=0; i<4; i++) if (pGridWin[i]) pGridWin[i]->SetPointer( rPointer ); - -/* ScSplitPos ePos = aViewData.GetActivePart(); - if (pGridWin[ePos]) - pGridWin[ePos]->SetPointer( rPointer ); -*/ } -//UNUSED2008-05 void ScTabView::SetActivePointer( const ResId& ) -//UNUSED2008-05 { -//UNUSED2008-05 DBG_ERRORFILE( "keine Pointer mit ResId!" ); -//UNUSED2008-05 } void ScTabView::ActiveGrabFocus() { @@ -1098,28 +1014,6 @@ void ScTabView::ActiveGrabFocus() pGridWin[ePos]->GrabFocus(); } -//UNUSED2008-05 void ScTabView::ActiveCaptureMouse() -//UNUSED2008-05 { -//UNUSED2008-05 ScSplitPos ePos = aViewData.GetActivePart(); -//UNUSED2008-05 if (pGridWin[ePos]) -//UNUSED2008-05 pGridWin[ePos]->CaptureMouse(); -//UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 void ScTabView::ActiveReleaseMouse() -//UNUSED2008-05 { -//UNUSED2008-05 ScSplitPos ePos = aViewData.GetActivePart(); -//UNUSED2008-05 if (pGridWin[ePos]) -//UNUSED2008-05 pGridWin[ePos]->ReleaseMouse(); -//UNUSED2008-05 } -//UNUSED2008-05 -//UNUSED2008-05 Point ScTabView::ActivePixelToLogic( const Point& rDevicePoint ) -//UNUSED2008-05 { -//UNUSED2008-05 ScSplitPos ePos = aViewData.GetActivePart(); -//UNUSED2008-05 if (pGridWin[ePos]) -//UNUSED2008-05 return pGridWin[ePos]->PixelToLogic(rDevicePoint); -//UNUSED2008-05 else -//UNUSED2008-05 return Point(); -//UNUSED2008-05 } ScSplitPos ScTabView::FindWindow( Window* pWindow ) const { @@ -1165,7 +1059,7 @@ sal_Bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) { HideNoteMarker(); - sal_Bool bDone = sal_False; + sal_Bool bDone = false; const CommandWheelData* pData = rCEvt.GetWheelData(); if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM ) { @@ -1238,11 +1132,11 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll ) else // VScroll... { ScVSplitPos eWhich = (pScroll == &aVScrollTop) ? SC_SPLIT_TOP : SC_SPLIT_BOTTOM; - long nDelta = GetScrollBarPos( *pScroll, sal_False ) + nScrollMin - aViewData.GetPosY(eWhich); + long nDelta = GetScrollBarPos( *pScroll, false ) + nScrollMin - aViewData.GetPosY(eWhich); if (nDelta) ScrollY( nDelta, eWhich ); } } - bDragging = sal_False; + bDragging = false; } return 0; } @@ -1677,7 +1571,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY // auf VCL gibt's Update ohne Ende (jedes Update gilt fuer alle Fenster) //aCornerButton.Update(); // der bekommt sonst nie ein Update - bInUpdateHeader = sal_False; + bInUpdateHeader = false; } } @@ -1704,12 +1598,12 @@ void ScTabView::UpdateShow() // Scrollbar-Einstellungen koennen vom Sfx ueberschrieben werden: SfxScrollingMode eMode = aViewData.GetViewShell()->GetScrollingMode(); if ( eMode == SCROLLING_NO ) - bHScrollMode = bVScrollMode = sal_False; + bHScrollMode = bVScrollMode = false; else if ( eMode == SCROLLING_YES || eMode == SCROLLING_AUTO ) //! Auto ??? bHScrollMode = bVScrollMode = sal_True; if ( aViewData.GetDocShell()->IsPreview() ) - bHScrollMode = bVScrollMode = bTabMode = bHeader = bOutlMode = bHOutline = bVOutline = sal_False; + bHScrollMode = bVScrollMode = bTabMode = bHeader = bOutlMode = bHOutline = bVOutline = false; // // Windows anlegen @@ -1781,6 +1675,17 @@ void ScTabView::UpdateShow() //! neue Gridwindows eintragen } +void ScTabView::UpdateVisibleRange() +{ + for (int i = 0; i < 4; ++i) + { + if (!pGridWin[i] || !pGridWin[i]->IsVisible()) + continue; + + pGridWin[i]->UpdateVisibleRange(); + } +} + // --- Splitter -------------------------------------------------------- IMPL_LINK( ScTabView, SplitHdl, Splitter*, pSplitter ) @@ -1840,7 +1745,6 @@ void ScTabView::DoHSplit(long nSplitPos) else { nOldDelta = aViewData.GetPosX( SC_SPLIT_LEFT ); -// aViewData.SetPosX( SC_SPLIT_LEFT, nOldDelta ); long nLeftWidth = nSplitPos - pRowBar[SC_SPLIT_BOTTOM]->GetSizePixel().Width(); if ( nLeftWidth < 0 ) nLeftWidth = 0; nNewDelta = nOldDelta + aViewData.CellsAtX( nOldDelta, 1, SC_SPLIT_LEFT, @@ -1856,7 +1760,7 @@ void ScTabView::DoHSplit(long nSplitPos) SC_SPLIT_BOTTOMRIGHT : SC_SPLIT_TOPRIGHT ); } - // #61410# Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen + // Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen // dafuer muss hier schon der MapMode stimmen for (sal_uInt16 i=0; i<4; i++) if (pGridWin[i]) @@ -1928,7 +1832,7 @@ void ScTabView::DoVSplit(long nSplitPos) SC_SPLIT_BOTTOMLEFT : SC_SPLIT_BOTTOMRIGHT ); } - // #61410# Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen + // Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen // dafuer muss hier schon der MapMode stimmen for (sal_uInt16 i=0; i<4; i++) if (pGridWin[i]) @@ -2198,12 +2102,12 @@ sal_Bool lcl_MouseIsOverWin( const Point& rScreenPosPixel, Window* pWin ) aRel.Y() >= 0 && aRel.Y() < aWinSize.Height() + SPLIT_HANDLE_SIZE ) return sal_True; } - return sal_False; + return false; } void ScTabView::SnapSplitPos( Point& rScreenPosPixel ) { - sal_Bool bOverWin = sal_False; + sal_Bool bOverWin = false; sal_uInt16 i; for (i=0; i<4; i++) if (lcl_MouseIsOverWin(rScreenPosPixel,pGridWin[i])) @@ -2212,7 +2116,7 @@ void ScTabView::SnapSplitPos( Point& rScreenPosPixel ) if (!bOverWin) return; - // #74761# don't snap to cells if the scale will be modified afterwards + // don't snap to cells if the scale will be modified afterwards if ( GetZoomType() != SVX_ZOOM_PERCENT ) return; @@ -2223,15 +2127,15 @@ void ScTabView::SnapSplitPos( Point& rScreenPosPixel ) Window* pWin = pGridWin[ePos]; if (!pWin) { - DBG_ERROR("Window NULL"); + OSL_FAIL("Window NULL"); return; } Point aMouse = pWin->NormalizedScreenToOutputPixel( rScreenPosPixel ); SCsCOL nPosX; SCsROW nPosY; - // #52949# bNextIfLarge=FALSE: nicht auf naechste Zelle, wenn ausserhalb des Fensters - aViewData.GetPosFromPixel( aMouse.X(), aMouse.Y(), ePos, nPosX, nPosY, sal_True, sal_False, sal_False ); + // bNextIfLarge=FALSE: nicht auf naechste Zelle, wenn ausserhalb des Fensters + aViewData.GetPosFromPixel( aMouse.X(), aMouse.Y(), ePos, nPosX, nPosY, true, false, false ); sal_Bool bLeft; sal_Bool bTop; aViewData.GetMouseQuadrant( aMouse, ePos, nPosX, nPosY, bLeft, bTop ); @@ -2339,14 +2243,14 @@ void ScTabView::FreezeSplitters( sal_Bool bFreeze ) aViewData.SetVSplitMode( SC_SPLIT_NORMAL ); } - // #61410# Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen + // Form-Layer muss den sichtbaren Ausschnitt aller Fenster kennen // dafuer muss hier schon der MapMode stimmen for (sal_uInt16 i=0; i<4; i++) if (pGridWin[i]) pGridWin[i]->SetMapMode( pGridWin[i]->GetDrawMapMode() ); SetNewVisArea(); - RepeatResize(sal_False); + RepeatResize(false); UpdateShow(); PaintLeft(); @@ -2422,7 +2326,7 @@ void ScTabView::InvalidateSplit() void ScTabView::SetNewVisArea() { - // #63854# fuer die Controls muss bei VisAreaChanged der Draw-MapMode eingestellt sein + // fuer die Controls muss bei VisAreaChanged der Draw-MapMode eingestellt sein // (auch wenn ansonsten der Edit-MapMode gesetzt ist) MapMode aOldMode[4]; MapMode aDrawMode[4]; @@ -2476,7 +2380,7 @@ sal_Bool ScTabView::HasPageFieldDataAtCursor() const if (pWin) return pWin->GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE; - return sal_False; + return false; } void ScTabView::StartDataSelect() @@ -2495,14 +2399,22 @@ void ScTabView::StartDataSelect() // no meaningful input is possible anyway, so this function // can be used to select a page field entry. pWin->LaunchPageFieldMenu( nCol, nRow ); - break; + return; case sheet::DataPilotFieldOrientation_COLUMN: case sheet::DataPilotFieldOrientation_ROW: pWin->LaunchDPFieldMenu( nCol, nRow ); - break; + return; default: - pWin->DoAutoFilterMenue( nCol, nRow, sal_True ); + ; } + + // Do autofilter if the current cell has autofilter button. Otherwise do + // a normal data select popup. + const ScMergeFlagAttr* pAttr = static_cast<const ScMergeFlagAttr*>( + aViewData.GetDocument()->GetAttr( + nCol, nRow, aViewData.GetTabNo(), ATTR_MERGE_FLAG)); + + pWin->DoAutoFilterMenue(nCol, nRow, !pAttr->HasAutoFilter()); } void ScTabView::EnableRefInput(sal_Bool bFlag) @@ -2518,18 +2430,18 @@ void ScTabView::EnableRefInput(sal_Bool bFlag) if(pTabControl!=NULL) pTabControl->EnableInput(bFlag,sal_True); if(pGridWin[SC_SPLIT_BOTTOMLEFT]!=NULL) - pGridWin[SC_SPLIT_BOTTOMLEFT]->EnableInput(bFlag,sal_False); + pGridWin[SC_SPLIT_BOTTOMLEFT]->EnableInput(bFlag,false); if(pGridWin[SC_SPLIT_BOTTOMRIGHT]!=NULL) - pGridWin[SC_SPLIT_BOTTOMRIGHT]->EnableInput(bFlag,sal_False); + pGridWin[SC_SPLIT_BOTTOMRIGHT]->EnableInput(bFlag,false); if(pGridWin[SC_SPLIT_TOPLEFT]!=NULL) - pGridWin[SC_SPLIT_TOPLEFT]->EnableInput(bFlag,sal_False); + pGridWin[SC_SPLIT_TOPLEFT]->EnableInput(bFlag,false); if(pGridWin[SC_SPLIT_TOPRIGHT]!=NULL) - pGridWin[SC_SPLIT_TOPRIGHT]->EnableInput(bFlag,sal_False); + pGridWin[SC_SPLIT_TOPRIGHT]->EnableInput(bFlag,false); if(pColBar[SC_SPLIT_RIGHT]!=NULL) - pColBar[SC_SPLIT_RIGHT]->EnableInput(bFlag,sal_False); + pColBar[SC_SPLIT_RIGHT]->EnableInput(bFlag,false); if(pRowBar[SC_SPLIT_TOP]!=NULL) - pRowBar[SC_SPLIT_TOP]->EnableInput(bFlag,sal_False); + pRowBar[SC_SPLIT_TOP]->EnableInput(bFlag,false); } - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |