This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
The following commit(s) were added to refs/heads/AOO42X by this push:
new a81d877742 Cleanup code for CornerButton (Calc)
a81d877742 is described below
commit a81d8777422c429cb4198d20bbaa46b5d7d70dc8
Author: mseidel <[email protected]>
AuthorDate: Wed Jan 28 21:50:36 2026 +0100
Cleanup code for CornerButton (Calc)
(cherry picked from commit 1277c5ae2e150303b6627eb4b54e336d0bb4e548)
---
main/sc/source/ui/inc/tabview.hxx | 87 ++++++++++++++++---------------
main/sc/source/ui/view/tabview.cxx | 103 ++++++++++++++-----------------------
2 files changed, 81 insertions(+), 109 deletions(-)
diff --git a/main/sc/source/ui/inc/tabview.hxx
b/main/sc/source/ui/inc/tabview.hxx
index b138867687..17fd32adae 100644
--- a/main/sc/source/ui/inc/tabview.hxx
+++ b/main/sc/source/ui/inc/tabview.hxx
@@ -64,20 +64,19 @@ namespace chart2 { namespace data {
#define SC_FORCEMODE_NONE 0xff
// ---------------------------------------------------------------------------
-// Hilfs - Fenster
+// Hilfs-Fenster
class ScCornerButton : public Window
{
private:
ScViewData* pViewData;
- sal_Bool bAdd;
protected:
virtual void Paint( const Rectangle& rRect );
virtual void Resize();
virtual void MouseButtonDown( const MouseEvent& rMEvt );
public:
- ScCornerButton( Window* pParent,
ScViewData* pData, sal_Bool bAdditional );
+ ScCornerButton( Window* pParent,
ScViewData* pData );
~ScCornerButton();
virtual void StateChanged( StateChangedType nType );
@@ -105,7 +104,7 @@ private:
Size aFrameSize;
// wie bei DoResize uebergeben
Point aBorderPos;
- sal_Bool bDrawSelMode;
// nur Zeichenobjekte selektieren ?
+ sal_Bool bDrawSelMode; // nur
Zeichenobjekte selektieren ?
FuPoor* pDrawActual;
FuPoor* pDrawOld;
@@ -131,9 +130,9 @@ private:
ScPageBreakData* pPageBreakData; // fuer
Seitenumbruch-Modus
ScHighlightRanges* pHighlightRanges;
- ScDocument* pBrushDocument; // cell formats for format
paint brush
- SfxItemSet* pDrawBrushSet; // drawing object
attributes for paint brush
- sal_Bool bLockPaintBrush; // keep for more than
one use?
+ ScDocument* pBrushDocument; // cell
formats for format paint brush
+ SfxItemSet* pDrawBrushSet; //
drawing object attributes for paintbrush
+ sal_Bool bLockPaintBrush; // keep
for more than one use?
Timer aScrollTimer;
ScGridWindow* pTimerWindow;
@@ -144,26 +143,26 @@ private:
sal_Bool bDragging;
// fuer Scrollbars
long nPrevDragPos;
- sal_Bool bIsBlockMode; //
Block markieren
- sal_Bool bBlockNeg;
// wird Markierung aufgehoben?
- sal_Bool bBlockCols;
// werden ganze Spalten markiert?
- sal_Bool bBlockRows;
// werden ganze Zeilen markiert?
+ sal_Bool bIsBlockMode; //
Block markieren
+ sal_Bool bBlockNeg;
// wird Markierung aufgehoben?
+ sal_Bool bBlockCols;
// werden ganze Spalten markiert?
+ sal_Bool bBlockRows;
// werden ganze Zeilen markiert?
SCCOL nBlockStartX;
- SCCOL nBlockStartXOrig;
+ SCCOL nBlockStartXOrig;
SCCOL nBlockEndX;
SCROW nBlockStartY;
- SCROW nBlockStartYOrig;
+ SCROW nBlockStartYOrig;
SCROW nBlockEndY;
SCTAB nBlockStartZ;
SCTAB nBlockEndZ;
- SCCOL nOldCurX;
- SCROW nOldCurY;
+ SCCOL nOldCurX;
+ SCROW nOldCurY;
- double mfPendingTabBarWidth; // Tab bar width relative to
frame window width.
+ double mfPendingTabBarWidth; // Tab bar width
relative to frame window width.
sal_Bool bMinimized;
sal_Bool bInUpdateHeader;
@@ -260,7 +259,7 @@ public:
void DrawDeselectAll();
void DrawMarkListHasChanged();
void UpdateAnchorHandles();
-//UNUSED2008-05 String GetSelectedChartName() const;
+//UNUSED2008-05 String GetSelectedChartName() const;
ScPageBreakData* GetPageBreakData() { return
pPageBreakData; }
ScHighlightRanges* GetHighlightRanges() { return pHighlightRanges; }
@@ -285,7 +284,7 @@ public:
// bSameTabButMoved = true if the same sheet as before is activated,
used after moving/copying/inserting/deleting a sheet
void TabChanged( bool bSameTabButMoved = false );
void SetZoom( const Fraction& rNewX, const Fraction&
rNewY, sal_Bool bAll );
- SC_DLLPUBLIC void RefreshZoom();
+ SC_DLLPUBLIC void RefreshZoom();
void SetPagebreakMode( sal_Bool bSet );
void UpdateLayerLocks();
@@ -301,7 +300,7 @@ public:
void UpdateRef( SCCOL nCurX, SCROW nCurY, SCTAB
nCurZ );
void StopRefMode();
-//UNUSED2008-05 void EndSelection();
+//UNUSED2008-05 void EndSelection();
void StopMarking();
void FakeButtonUp( ScSplitPos eWhich );
@@ -311,12 +310,12 @@ public:
ScSplitPos FindWindow( Window* pWindow ) const;
void SetActivePointer( const Pointer& rPointer );
-//UNUSED2008-05 void SetActivePointer( const ResId& rId );
+//UNUSED2008-05 void SetActivePointer( const ResId& rId );
void ActiveGrabFocus();
-//UNUSED2008-05 void ActiveCaptureMouse();
-//UNUSED2008-05 void ActiveReleaseMouse();
-//UNUSED2008-05 Point ActivePixelToLogic( const Point& rDevicePoint
);
+//UNUSED2008-05 void ActiveCaptureMouse();
+//UNUSED2008-05 void ActiveReleaseMouse();
+//UNUSED2008-05 Point ActivePixelToLogic( const Point&
rDevicePoint );
void ClickCursor( SCCOL nPosX, SCROW nPosY, sal_Bool
bControl );
@@ -334,8 +333,8 @@ public:
Point GetInsertPos();
- Point GetChartInsertPos( const Size& rSize, const ScRange&
rCellRange );
- Point GetChartDialogPos( const Size& rDialogSize, const
Rectangle& rLogicChart );
+ Point GetChartInsertPos( const Size& rSize, const
ScRange& rCellRange );
+ Point GetChartDialogPos( const Size& rDialogSize,
const Rectangle& rLogicChart );
void UpdateAutoFillMark();
@@ -347,13 +346,13 @@ public:
void AlignToCursor( SCsCOL nCurX, SCsROW nCurY,
ScFollowMode eMode,
const
ScSplitPos* pWhich = NULL );
- SvxZoomType GetZoomType() const;
- void SetZoomType( SvxZoomType eNew, sal_Bool bAll );
+ SvxZoomType GetZoomType() const;
+ void SetZoomType( SvxZoomType eNew, sal_Bool bAll );
sal_uInt16 CalcZoom( SvxZoomType eType, sal_uInt16
nOldZoom );
// void CalcZoom( SvxZoomType eType, sal_uInt16& rZoom,
SCCOL& rCol, SCROW& rRow );
- sal_Bool HasPageFieldDataAtCursor() const;
+ sal_Bool HasPageFieldDataAtCursor() const;
void StartDataSelect();
// MoveCursorAbs -
absolut
@@ -377,7 +376,7 @@ public:
void MoveCursorEnter( sal_Bool bShift );
// Shift fuer Richtung (kein Markieren)
- sal_Bool MoveCursorKeyInput( const KeyEvent& rKeyEvent );
+ sal_Bool MoveCursorKeyInput( const KeyEvent& rKeyEvent );
void FindNextUnprot( sal_Bool bShift, sal_Bool
bInSelection = sal_True );
@@ -385,7 +384,7 @@ public:
// bSameTabButMoved = true if the same sheet as before is activated,
used after moving/copying/inserting/deleting a sheet
SC_DLLPUBLIC void SetTabNo( SCTAB nTab, sal_Bool bNew = sal_False,
sal_Bool bExtendSelection = sal_False, bool bSameTabButMoved = false );
- void SelectNextTab( short nDir, sal_Bool bExtendSelection =
sal_False );
+ void SelectNextTab( short nDir, sal_Bool
bExtendSelection = sal_False );
void ActivateView( sal_Bool bActivate, sal_Bool
bFirst );
void ActivatePart( ScSplitPos eWhich );
@@ -408,11 +407,11 @@ public:
void InvertBlockMark(SCCOL nBlockStartX, SCROW
nBlockStartY,
SCCOL
nBlockEndX, SCROW nBlockEndY);
-//UNUSED2008-05 void DrawDragRect( SCCOL nStartX, SCROW nStartY,
SCCOL nEndX, SCROW nEndY,
-//UNUSED2008-05 ScSplitPos ePos );
-//UNUSED2008-05 void PaintCell( SCCOL nCol, SCROW nRow,
SCTAB nTab );
-//UNUSED2008-05 void PaintLeftRow( SCROW nRow );
-//UNUSED2008-05 void PaintTopCol( SCCOL nCol );
+//UNUSED2008-05 void DrawDragRect( SCCOL nStartX, SCROW
nStartY, SCCOL nEndX, SCROW nEndY,
+//UNUSED2008-05
ScSplitPos ePos );
+//UNUSED2008-05 void PaintCell( SCCOL nCol, SCROW nRow,
SCTAB nTab );
+//UNUSED2008-05 void PaintLeftRow( SCROW nRow );
+//UNUSED2008-05 void PaintTopCol( SCCOL nCol );
void PaintArea( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow,
ScUpdateMode eMode = SC_UPDATE_ALL );
@@ -431,9 +430,9 @@ public:
void CreateAnchorHandles(SdrHdlList& rHdl, const
ScAddress& rAddress);
- void UpdateSelectionOverlay();
- void UpdateShrinkOverlay();
- void UpdateAllOverlays();
+ void UpdateSelectionOverlay();
+ void UpdateShrinkOverlay();
+ void UpdateAllOverlays();
void UpdateFormulas();
void InterpretVisible();
@@ -444,7 +443,7 @@ public:
void ClearHighlightRanges();
void DoChartSelection( const
::com::sun::star::uno::Sequence<
-
::com::sun::star::chart2::data::HighlightedRange > & rHilightRanges );
+
::com::sun::star::chart2::data::HighlightedRange > & rHilightRanges );
long GetGridWidth( ScHSplitPos eWhich );
long GetGridHeight( ScVSplitPos eWhich );
@@ -462,10 +461,10 @@ public:
void SelectAll( sal_Bool bContinue = sal_False );
void SelectAllTables();
- void DeselectAllTables();
+ void DeselectAllTables();
void MarkCursor( SCCOL nCurX, SCROW nCurY, SCTAB
nCurZ,
- sal_Bool bCols = sal_False, sal_Bool bRows =
sal_False, sal_Bool bCellSelection = sal_False );
+ sal_Bool bCols
= sal_False, sal_Bool bRows = sal_False, sal_Bool bCellSelection = sal_False );
void InitBlockMode( SCCOL nCurX, SCROW nCurY, SCTAB
nCurZ,
sal_Bool bTestNeg = sal_False,
sal_Bool bCols = sal_False, sal_Bool bRows = sal_False, sal_Bool bForceNeg =
sal_False );
@@ -480,15 +479,15 @@ public:
void MarkMatrixFormula();
void Unmark();
- void MarkRange( const ScRange& rRange, sal_Bool bSetCursor =
sal_True, sal_Bool bContinue = sal_False );
+ void MarkRange( const ScRange& rRange, sal_Bool
bSetCursor = sal_True, sal_Bool bContinue = sal_False );
sal_Bool IsMarking( SCCOL nCol, SCROW nRow,
SCTAB nTab ) const;
void PaintMarks( SCCOL nStartCol, SCROW nStartRow,
SCCOL nEndCol, SCROW nEndRow );
void PaintBlock( sal_Bool bReset = sal_False );
- void SetMarkData( const ScMarkData& rNew );
- void MarkDataChanged();
+ void SetMarkData( const ScMarkData& rNew );
+ void MarkDataChanged();
void LockModifiers( sal_uInt16 nModifiers );
sal_uInt16 GetLockedModifiers() const;
diff --git a/main/sc/source/ui/view/tabview.cxx
b/main/sc/source/ui/view/tabview.cxx
index a5804fe333..96cb0febad 100644
--- a/main/sc/source/ui/view/tabview.cxx
+++ b/main/sc/source/ui/view/tabview.cxx
@@ -211,10 +211,9 @@ using namespace ::com::sun::star;
// Corner-Button
-ScCornerButton::ScCornerButton( Window* pParent, ScViewData* pData, sal_Bool
bAdditional ) :
+ScCornerButton::ScCornerButton( Window* pParent, ScViewData* pData ) :
Window( pParent, WinBits( 0 ) ),
- pViewData( pData ),
- bAdd( bAdditional )
+ pViewData( pData )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
SetBackground( rStyleSettings.GetFaceColor() );
@@ -238,32 +237,6 @@ void __EXPORT ScCornerButton::Paint( const Rectangle&
rRect )
sal_Bool bLayoutRTL = pViewData->GetDocument()->IsLayoutRTL(
pViewData->GetTabNo() );
long nDarkX = bLayoutRTL ? 0 : nPosX;
- if ( !bAdd && !rStyleSettings.GetHighContrastMode() )
- {
- // match the shaded look of column/row headers
-
- Color aFace( rStyleSettings.GetFaceColor() );
-// Color aWhite( COL_WHITE );
- Color aCenter( aFace );
-// aCenter.Merge( aWhite, 0xd0 ); // lighten up a bit
- Color aOuter( aFace );
-// aOuter.Merge( aWhite, 0xa0 ); // lighten up more
-
- long nCenterX = (aSize.Width() / 2) - 1;
- long nCenterY = (aSize.Height() / 2) - 1;
-
- SetLineColor();
- SetFillColor(aCenter);
- DrawRect( Rectangle( nCenterX, nCenterY, nCenterX, nPosY ) );
- DrawRect( Rectangle( nCenterX, nCenterY, nDarkX, nCenterY ) );
- SetFillColor(aOuter);
- DrawRect( Rectangle( 0, 0, nPosX, nCenterY-1 ) );
- if ( bLayoutRTL )
- DrawRect( Rectangle( nCenterX+1, nCenterY, nPosX, nPosY
) );
- else
- DrawRect( Rectangle( 0, nCenterY, nCenterX-1, nPosY ) );
- }
-
// both buttons have the same look now - only dark right/bottom lines
SetLineColor( rStyleSettings.GetDarkShadowColor() );
DrawLine( Point(0,nPosY), Point(nPosX,nPosY) );
@@ -347,33 +320,33 @@ sal_Bool lcl_HasRowOutline( const ScViewData& rViewData )
pHdrSelEng( NULL ),
\
aHdrFunc( &aViewData ),
\
pDrawView( NULL ),
\
- bDrawSelMode( sal_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 ),
\
- aTopButton( pFrameWin, &aViewData, sal_True ),
\
+ bDrawSelMode( sal_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 ),
\
+ aTopButton( pFrameWin, &aViewData ),
\
aScrollBarBox( pFrameWin, WB_SIZEABLE ),
\
pInputHintWindow( NULL ),
\
pPageBreakData( NULL ),
\
pHighlightRanges( NULL ),
\
- pBrushDocument( NULL ),
\
- pDrawBrushSet( NULL ),
\
- bLockPaintBrush( sal_False ),
\
+ pBrushDocument( NULL ),
\
+ pDrawBrushSet( NULL ),
\
+ bLockPaintBrush( sal_False ),
\
pTimerWindow( NULL ),
\
nTipVisible( 0 ),
\
- bDragging( sal_False ),
\
- bIsBlockMode( sal_False ),
\
- bBlockNeg( sal_False ),
\
- bBlockCols( sal_False ),
\
- bBlockRows( sal_False ),
\
- mfPendingTabBarWidth( -1.0 ),
\
- bMinimized( sal_False ),
\
- bInUpdateHeader( sal_False ),
\
- bInActivatePart( sal_False ),
\
- bInZoomUpdate( sal_False ),
\
- bMoveIsShift( sal_False ),
\
+ bDragging( sal_False ),
\
+ bIsBlockMode( sal_False ),
\
+ bBlockNeg( sal_False ),
\
+ bBlockCols( sal_False ),
\
+ bBlockRows( sal_False ),
\
+ mfPendingTabBarWidth( -1.0 ),
\
+ bMinimized( sal_False ),
\
+ bInUpdateHeader( sal_False ),
\
+ bInActivatePart( sal_False ),
\
+ bInZoomUpdate( sal_False ),
\
+ bMoveIsShift( sal_False ),
\
bNewStartIfMarking( sal_False )
ScTabView::ScTabView( Window* pParent, ScDocShell& rDocSh, ScTabViewShell*
pViewShell ) :
@@ -1108,7 +1081,7 @@ void ScTabView::ActiveGrabFocus()
ScSplitPos ScTabView::FindWindow( Window* pWindow ) const
{
- ScSplitPos eVal = SC_SPLIT_BOTTOMLEFT; // Default
+ ScSplitPos eVal = SC_SPLIT_BOTTOMLEFT; // Default
for (sal_uInt16 i=0; i<4; i++)
if ( pGridWin[i] == pWindow )
eVal = (ScSplitPos) i;
@@ -1154,10 +1127,10 @@ sal_Bool ScTabView::ScrollCommand( const CommandEvent&
rCEvt, ScSplitPos ePos )
const CommandWheelData* pData = rCEvt.GetWheelData();
if ( pData && pData->GetMode() == COMMAND_WHEEL_ZOOM )
{
- if ( !aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace()
)
+ if (
!aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace() )
{
- // for ole inplace editing, the scale is defined
by the visarea and client size
- // and can't be changed directly
+ // for ole inplace editing, the scale is defined by the
visarea and client size
+ // and can't be changed directly
const Fraction& rOldY = aViewData.GetZoomY();
long nOld = (long)(( rOldY.GetNumerator() * 100 ) /
rOldY.GetDenominator());
@@ -1169,17 +1142,17 @@ sal_Bool ScTabView::ScrollCommand( const CommandEvent&
rCEvt, ScSplitPos ePos )
if ( nNew != nOld )
{
- // scroll wheel doesn't set the AppOptions default
+ // scroll wheel doesn't set the AppOptions
default
- sal_Bool bSyncZoom =
SC_MOD()->GetAppOptions().GetSynchronizeZoom();
- SetZoomType( SVX_ZOOM_PERCENT, bSyncZoom );
+ sal_Bool bSyncZoom =
SC_MOD()->GetAppOptions().GetSynchronizeZoom();
+ SetZoomType( SVX_ZOOM_PERCENT, bSyncZoom );
Fraction aFract( nNew, 100 );
- SetZoom( aFract, aFract, bSyncZoom );
+ SetZoom( aFract, aFract, bSyncZoom );
PaintGrid();
PaintTop();
PaintLeft();
aViewData.GetBindings().Invalidate(
SID_ATTR_ZOOM );
- aViewData.GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER );
+ aViewData.GetBindings().Invalidate(
SID_ATTR_ZOOMSLIDER );
}
bDone = sal_True;
@@ -1215,9 +1188,9 @@ IMPL_LINK( ScTabView, EndScrollHdl, ScrollBar*, pScroll )
if ( pScroll == &aHScrollLeft || pScroll ==
&aHScrollRight )
{
- sal_Bool bMirror = aViewData.GetDocument()->IsLayoutRTL(
aViewData.GetTabNo() ) != Application::GetSettings().GetLayoutRTL();
+ sal_Bool bMirror =
aViewData.GetDocument()->IsLayoutRTL( aViewData.GetTabNo() ) !=
Application::GetSettings().GetLayoutRTL();
ScHSplitPos eWhich = (pScroll == &aHScrollLeft)
? SC_SPLIT_LEFT : SC_SPLIT_RIGHT;
- long nDelta = GetScrollBarPos( *pScroll, bMirror ) +
nScrollMin - aViewData.GetPosX(eWhich);
+ long nDelta = GetScrollBarPos( *pScroll,
bMirror ) + nScrollMin - aViewData.GetPosX(eWhich);
if (nDelta) ScrollX( nDelta, eWhich );
}
else
// VScroll...
@@ -2472,9 +2445,9 @@ void ScTabView::StartDataSelect()
if (!pWin)
return;
- switch (pWin->GetDPFieldOrientation(nCol, nRow))
- {
- case sheet::DataPilotFieldOrientation_PAGE:
+ switch (pWin->GetDPFieldOrientation(nCol, nRow))
+ {
+ case sheet::DataPilotFieldOrientation_PAGE:
// #i36598# If the cursor is on a page field's data cell,
// no meaningful input is possible anyway, so this function
// can be used to select a page field entry.
@@ -2486,7 +2459,7 @@ void ScTabView::StartDataSelect()
break;
default:
pWin->DoAutoFilterMenue( nCol, nRow, sal_True );
- }
+ }
}
void ScTabView::EnableRefInput(sal_Bool bFlag)