summaryrefslogtreecommitdiffstats
path: root/sc/source/ui/view/hdrcont.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/hdrcont.cxx')
-rw-r--r--sc/source/ui/view/hdrcont.cxx134
1 files changed, 67 insertions, 67 deletions
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 25f3c1c8f10a..a3f30ba7ba59 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -66,7 +66,7 @@
//==================================================================
ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEngine,
- SCCOLROW nNewSize, USHORT nNewFlags ) :
+ SCCOLROW nNewSize, sal_uInt16 nNewFlags ) :
Window ( pParent ),
pSelEngine ( pSelectionEngine ),
nFlags ( nNewFlags ),
@@ -74,24 +74,24 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn
nSize ( nNewSize ),
nMarkStart ( 0 ),
nMarkEnd ( 0 ),
- bMarkRange ( FALSE ),
- bDragging ( FALSE ),
- bIgnoreMove ( FALSE )
+ bMarkRange ( sal_False ),
+ bDragging ( sal_False ),
+ bIgnoreMove ( sal_False )
{
// --- RTL --- no default mirroring for this window, the spreadsheet itself
// is also not mirrored
// #107811# mirror the vertical window for correct border drawing
// #106948# table layout depends on sheet format, not UI setting, so the
// borders of the vertical window have to be handled manually, too.
- EnableRTL( FALSE );
+ EnableRTL( sal_False );
aNormFont = GetFont();
- aNormFont.SetTransparent( TRUE ); //! WEIGHT_NORMAL hart setzen ???
+ aNormFont.SetTransparent( sal_True ); //! WEIGHT_NORMAL hart setzen ???
aBoldFont = aNormFont;
aBoldFont.SetWeight( WEIGHT_BOLD );
SetFont(aBoldFont);
- bBoldSet = TRUE;
+ bBoldSet = sal_True;
Size aSize = LogicToPixel( Size(
GetTextWidth( String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("8888")) ),
@@ -127,7 +127,7 @@ ScHeaderControl::~ScHeaderControl()
void ScHeaderControl::DoPaint( SCCOLROW nStart, SCCOLROW nEnd )
{
- BOOL bLayoutRTL = IsLayoutRTL();
+ sal_Bool bLayoutRTL = IsLayoutRTL();
long nLayoutSign = bLayoutRTL ? -1 : 1;
Rectangle aRect( Point(0,0), GetOutputSizePixel() );
@@ -144,15 +144,15 @@ void ScHeaderControl::DoPaint( SCCOLROW nStart, SCCOLROW nEnd )
Invalidate(aRect);
}
-void ScHeaderControl::SetMark( BOOL bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd )
+void ScHeaderControl::SetMark( sal_Bool bNewSet, SCCOLROW nNewStart, SCCOLROW nNewEnd )
{
- BOOL bEnabled = SC_MOD()->GetInputOptions().GetMarkHeader(); //! cachen?
+ sal_Bool bEnabled = SC_MOD()->GetInputOptions().GetMarkHeader(); //! cachen?
if (!bEnabled)
- bNewSet = FALSE;
+ bNewSet = sal_False;
// Variablen setzen
- BOOL bOldSet = bMarkRange;
+ sal_Bool bOldSet = bMarkRange;
SCCOLROW nOldStart = nMarkStart;
SCCOLROW nOldEnd = nMarkEnd;
PutInOrder( nNewStart, nNewEnd );
@@ -204,7 +204,7 @@ long ScHeaderControl::GetScrPos( SCCOLROW nEntryNo )
nScrPos = 0;
for (SCCOLROW i=GetPos(); i<nEntryNo && nScrPos<nMax; i++)
{
- USHORT nAdd = GetEntrySize(i);
+ sal_uInt16 nAdd = GetEntrySize(i);
if (nAdd)
nScrPos += nAdd;
else
@@ -269,8 +269,8 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
// Linien zusammengefasst
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- BOOL bHighContrast = rStyleSettings.GetHighContrastMode();
- BOOL bDark = rStyleSettings.GetFaceColor().IsDark();
+ sal_Bool bHighContrast = rStyleSettings.GetHighContrastMode();
+ sal_Bool bDark = rStyleSettings.GetFaceColor().IsDark();
// Use the same distinction for bDark as in Window::DrawSelectionBackground
Color aTextColor = rStyleSettings.GetButtonTextColor();
@@ -286,21 +286,21 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
Color aSelLineColor = rStyleSettings.GetHighlightColor();
aSelLineColor.Merge( aBlack, 0xe0 ); // darken just a little bit
- BOOL bLayoutRTL = IsLayoutRTL();
+ sal_Bool bLayoutRTL = IsLayoutRTL();
long nLayoutSign = bLayoutRTL ? -1 : 1;
- BOOL bMirrored = IsMirrored();
+ sal_Bool bMirrored = IsMirrored();
// const FunctionSet* pFuncSet = pSelEngine->GetFunctionSet();
String aString;
- USHORT nBarSize;
+ sal_uInt16 nBarSize;
Point aScrPos;
Size aTextSize;
// Size aSize = GetOutputSizePixel();
if (bVertical)
- nBarSize = (USHORT) GetSizePixel().Width();
+ nBarSize = (sal_uInt16) GetSizePixel().Width();
else
- nBarSize = (USHORT) GetSizePixel().Height();
+ nBarSize = (sal_uInt16) GetSizePixel().Height();
SCCOLROW nPos = GetPos();
@@ -333,7 +333,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
for (SCCOLROW i=nPos; i<nSize; i++)
{
- USHORT nSizePix = GetEntrySize( i );
+ sal_uInt16 nSizePix = GetEntrySize( i );
if (nSizePix)
{
nLineEnd += nSizePix * nLayoutSign;
@@ -464,7 +464,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
// borders, light border at top isn't used anymore
// use SC_HDRPAINT_SEL_BOTTOM for different color
- for (USHORT nPass = SC_HDRPAINT_SEL_BOTTOM; nPass < SC_HDRPAINT_COUNT; nPass++)
+ for (sal_uInt16 nPass = SC_HDRPAINT_SEL_BOTTOM; nPass < SC_HDRPAINT_COUNT; nPass++)
{
// set line color etc. before entry loop
switch ( nPass )
@@ -494,7 +494,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
else
aTransRect = Rectangle( nTransStart, 0, nTransEnd, nBarSize-1 );
SetBackground( Color( rStyleSettings.GetFaceColor() ) );
- DrawSelectionBackground( aTransRect, 0, TRUE, FALSE, FALSE );
+ DrawSelectionBackground( aTransRect, 0, sal_True, sal_False, sal_False );
SetBackground();
}
break;
@@ -514,7 +514,7 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
nScrPos = nPEnd + nLayoutSign; // beyond nPEnd -> stop
else
{
- USHORT nSizePix = GetEntrySize( nEntryNo );
+ sal_uInt16 nSizePix = GetEntrySize( nEntryNo );
if (nSizePix == 0)
{
@@ -530,8 +530,8 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
else
aEndPos = Point( aScrPos.X()+(nSizePix-1)*nLayoutSign, aScrPos.Y()+nBarSize-1 );
- BOOL bMark = bMarkRange && nEntryNo >= nMarkStart && nEntryNo <= nMarkEnd;
- BOOL bNextToMark = bMarkRange && nEntryNo + 1 >= nMarkStart && nEntryNo <= nMarkEnd;
+ sal_Bool bMark = bMarkRange && nEntryNo >= nMarkStart && nEntryNo <= nMarkEnd;
+ sal_Bool bNextToMark = bMarkRange && nEntryNo + 1 >= nMarkStart && nEntryNo <= nMarkEnd;
switch ( nPass )
{
@@ -609,9 +609,9 @@ void ScHeaderControl::Paint( const Rectangle& rRect )
// Maus - Handling
//
-SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, BOOL& rBorder )
+SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, sal_Bool& rBorder )
{
- BOOL bFound=FALSE;
+ sal_Bool bFound=sal_False;
SCCOLROW nCount = 1;
SCCOLROW nPos = GetPos();
SCCOLROW nHitNo = nPos;
@@ -621,7 +621,7 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, BOOL& rBorder )
Size aSize = GetOutputSizePixel();
long nWinSize = bVertical ? aSize.Height() : aSize.Width();
- BOOL bLayoutRTL = IsLayoutRTL();
+ sal_Bool bLayoutRTL = IsLayoutRTL();
long nLayoutSign = bLayoutRTL ? -1 : 1;
long nEndPos = bLayoutRTL ? -1 : nWinSize;
@@ -640,7 +640,7 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, BOOL& rBorder )
nDif = nMousePos - nScrPos;
if (nDif >= -2 && nDif <= 2 && nCount > 0)
{
- bFound=TRUE;
+ bFound=sal_True;
nHitNo=nEntryNo-1;
}
else if (nDif * nLayoutSign >= 0 && nEntryNo < nSize)
@@ -660,7 +660,7 @@ bool ScHeaderControl::IsSelectionAllowed(SCCOLROW nPos) const
return false;
ScViewData* pViewData = pViewSh->GetViewData();
- USHORT nTab = pViewData->GetTabNo();
+ sal_uInt16 nTab = pViewData->GetTabNo();
ScDocument* pDoc = pViewData->GetDocument();
const ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
bool bSelectAllowed = true;
@@ -697,10 +697,10 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
if (IsDisabled())
return;
- bIgnoreMove = FALSE;
+ bIgnoreMove = sal_False;
SelectWindow();
- BOOL bFound;
+ sal_Bool bFound;
SCCOLROW nHitNo = GetMousePos( rMEvt, bFound );
if (!IsSelectionAllowed(nHitNo))
return;
@@ -708,7 +708,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
if ( bFound && rMEvt.IsLeft() && ResizeAllowed() )
{
nDragNo = nHitNo;
- USHORT nClicks = rMEvt.GetClicks();
+ sal_uInt16 nClicks = rMEvt.GetClicks();
if ( nClicks && nClicks%2==0 )
{
SetEntrySize( nDragNo, HDR_SIZE_OPTIMUM );
@@ -726,8 +726,8 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
// CaptureMouse();
StartTracking();
- bDragging = TRUE;
- bDragMoved = FALSE;
+ bDragging = sal_True;
+ bDragMoved = sal_False;
}
}
else if (rMEvt.IsLeft())
@@ -741,7 +741,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt )
aVis.Top() = LONG_MIN, aVis.Bottom() = LONG_MAX;
pSelEngine->SetVisibleArea( aVis );
- SetMarking( TRUE ); // muss vor SelMouseButtonDown sein
+ SetMarking( sal_True ); // muss vor SelMouseButtonDown sein
pSelEngine->SelMouseButtonDown( rMEvt );
// #74215# In column/row headers a simple click already is a selection.
@@ -764,20 +764,20 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
if ( IsDisabled() )
return;
- SetMarking( FALSE );
- bIgnoreMove = FALSE;
-// BOOL bFound;
+ SetMarking( sal_False );
+ bIgnoreMove = sal_False;
+// sal_Bool bFound;
// SCCOLROW nHitNo = GetMousePos( rMEvt, bFound );
if ( bDragging )
{
DrawInvert( nDragPos );
ReleaseMouse();
- bDragging = FALSE;
+ bDragging = sal_False;
long nScrPos = GetScrPos( nDragNo );
long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X();
- BOOL bLayoutRTL = IsLayoutRTL();
+ sal_Bool bLayoutRTL = IsLayoutRTL();
long nNewWidth = bLayoutRTL ? ( nScrPos - nMousePos + 1 )
: ( nMousePos + 2 - nScrPos );
@@ -802,7 +802,7 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& rMEvt )
{
if (nNewWidth<0) nNewWidth=0;
if (bDragMoved)
- SetEntrySize( nDragNo, (USHORT) nNewWidth );
+ SetEntrySize( nDragNo, (sal_uInt16) nNewWidth );
}
}
else
@@ -820,7 +820,7 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
return;
}
- BOOL bFound;
+ sal_Bool bFound;
(void)GetMousePos( rMEvt, bFound );
if ( bDragging )
@@ -834,7 +834,7 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt )
DrawInvert( nDragPos );
if (nDragPos <= nDragStart-SC_DRAG_MIN || nDragPos >= nDragStart+SC_DRAG_MIN)
- bDragMoved = TRUE;
+ bDragMoved = sal_True;
}
}
else
@@ -864,7 +864,7 @@ void ScHeaderControl::Tracking( const TrackingEvent& rTEvt )
void ScHeaderControl::Command( const CommandEvent& rCEvt )
{
- USHORT nCmd = rCEvt.GetCommand();
+ sal_uInt16 nCmd = rCEvt.GetCommand();
if ( nCmd == COMMAND_CONTEXTMENU )
{
StopMarking(); // Selektion / Dragging beenden
@@ -885,7 +885,7 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
SC_MOD()->InputEnterHandler(); // always end edit mode
MouseEvent aMEvt( rCEvt.GetMousePosPixel() );
- BOOL bBorder;
+ sal_Bool bBorder;
SCCOLROW nPos = GetMousePos( aMEvt, bBorder );
if (!IsSelectionAllowed(nPos))
// Selecting this cell is not allowed, neither is context menu.
@@ -901,13 +901,13 @@ void ScHeaderControl::Command( const CommandEvent& rCEvt )
sal::static_int_cast<SCCOL>(nPos), MAXROW, nTab );
// see if any part of the range is already selected
- BOOL bSelected = FALSE;
+ sal_Bool bSelected = sal_False;
ScRangeList aRanges;
- pViewData->GetMarkData().FillRangeListWithMarks( &aRanges, FALSE );
- ULONG nRangeCount = aRanges.Count();
- for (ULONG i=0; i<nRangeCount && !bSelected; i++)
+ pViewData->GetMarkData().FillRangeListWithMarks( &aRanges, sal_False );
+ sal_uLong nRangeCount = aRanges.Count();
+ for (sal_uLong i=0; i<nRangeCount && !bSelected; i++)
if ( aRanges.GetObject(i)->Intersects( aNewRange ) )
- bSelected = TRUE;
+ bSelected = sal_True;
// select the range if no part of it was selected
if ( !bSelected )
@@ -929,11 +929,11 @@ void ScHeaderControl::StopMarking()
if ( bDragging )
{
DrawInvert( nDragPos );
- bDragging = FALSE;
+ bDragging = sal_False;
}
- SetMarking( FALSE );
- bIgnoreMove = TRUE;
+ SetMarking( sal_False );
+ bIgnoreMove = sal_True;
// #86260# don't call pSelEngine->Reset, so selection across the parts of
// a split/frozen view is possible
@@ -946,7 +946,7 @@ void ScHeaderControl::ShowDragHelp()
if (Help::IsQuickHelpEnabled())
{
long nScrPos = GetScrPos( nDragNo );
- BOOL bLayoutRTL = IsLayoutRTL();
+ sal_Bool bLayoutRTL = IsLayoutRTL();
long nVal = bLayoutRTL ? ( nScrPos - nDragPos + 1 )
: ( nDragPos + 2 - nScrPos );
@@ -957,7 +957,7 @@ void ScHeaderControl::ShowDragHelp()
Point aMousePos = OutputToScreenPixel(GetPointerPosPixel());
Rectangle aRect;
- USHORT nAlign;
+ sal_uInt16 nAlign;
if (!bVertical)
{
// oberhalb
@@ -985,7 +985,7 @@ void ScHeaderControl::RequestHelp( const HelpEvent& rHEvt )
// Wenn eigene QuickHelp angezeigt wird, nicht durch RequestHelp
// wieder wegnehmen lassen
- BOOL bOwn = bDragging && Help::IsQuickHelpEnabled();
+ sal_Bool bOwn = bDragging && Help::IsQuickHelpEnabled();
if (!bOwn)
Window::RequestHelp(rHEvt);
}
@@ -1005,24 +1005,24 @@ SCCOLROW ScHeaderControl::GetHiddenCount( SCCOLROW nEntryNo )
return nHidden;
}
-BOOL ScHeaderControl::IsLayoutRTL()
+sal_Bool ScHeaderControl::IsLayoutRTL()
{
- return FALSE;
+ return sal_False;
}
-BOOL ScHeaderControl::IsMirrored()
+sal_Bool ScHeaderControl::IsMirrored()
{
- return FALSE;
+ return sal_False;
}
-BOOL ScHeaderControl::IsDisabled()
+sal_Bool ScHeaderControl::IsDisabled()
{
- return FALSE;
+ return sal_False;
}
-BOOL ScHeaderControl::ResizeAllowed()
+sal_Bool ScHeaderControl::ResizeAllowed()
{
- return TRUE;
+ return sal_True;
}
void ScHeaderControl::SelectWindow()
@@ -1038,7 +1038,7 @@ String ScHeaderControl::GetDragHelp( long /* nVal */ )
return EMPTY_STRING;
}
-void ScHeaderControl::SetMarking( BOOL /* bSet */ )
+void ScHeaderControl::SetMarking( sal_Bool /* bSet */ )
{
}