Kaydet (Commit) 08f73742 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

More on sal_Bool to bool (in method signatures).

üst 0735a355
...@@ -207,9 +207,9 @@ private: ...@@ -207,9 +207,9 @@ private:
DECL_LINK( PopupModeEndHdl, FloatingWindow* ); DECL_LINK( PopupModeEndHdl, FloatingWindow* );
DECL_LINK( PopupSpellingHdl, SpellCallbackInfo* ); DECL_LINK( PopupSpellingHdl, SpellCallbackInfo* );
sal_Bool TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ); bool TestMouse( const MouseEvent& rMEvt, bool bAction );
sal_Bool DoPageFieldSelection( SCCOL nCol, SCROW nRow ); bool DoPageFieldSelection( SCCOL nCol, SCROW nRow );
bool DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); bool DoAutoFilterButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt );
void DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt ); void DoPushButton( SCCOL nCol, SCROW nRow, const MouseEvent& rMEvt );
...@@ -231,9 +231,9 @@ private: ...@@ -231,9 +231,9 @@ private:
void PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp ); void PagebreakMove( const MouseEvent& rMEvt, sal_Bool bUp );
void UpdateDragRect( sal_Bool bShowRange, const Rectangle& rPosRect ); void UpdateDragRect( bool bShowRange, const Rectangle& rPosRect );
sal_Bool IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ); bool IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab );
void ExecFilter( sal_uLong nSel, SCCOL nCol, SCROW nRow, void ExecFilter( sal_uLong nSel, SCCOL nCol, SCROW nRow,
const String& aValue, bool bCheckForDates ); const String& aValue, bool bCheckForDates );
void FilterSelect( sal_uLong nSel ); void FilterSelect( sal_uLong nSel );
...@@ -242,9 +242,9 @@ private: ...@@ -242,9 +242,9 @@ private:
void ExecPageFieldSelect( SCCOL nCol, SCROW nRow, sal_Bool bHasSelection, const String& rStr ); void ExecPageFieldSelect( SCCOL nCol, SCROW nRow, sal_Bool bHasSelection, const String& rStr );
sal_Bool HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange ); bool HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange );
sal_Bool DropScroll( const Point& rMousePos ); bool DropScroll( const Point& rMousePos );
sal_Int8 AcceptPrivateDrop( const AcceptDropEvent& rEvt ); sal_Int8 AcceptPrivateDrop( const AcceptDropEvent& rEvt );
sal_Int8 ExecutePrivateDrop( const ExecuteDropEvent& rEvt ); sal_Int8 ExecutePrivateDrop( const ExecuteDropEvent& rEvt );
...@@ -253,16 +253,16 @@ private: ...@@ -253,16 +253,16 @@ private:
void HandleMouseButtonDown( const MouseEvent& rMEvt ); void HandleMouseButtonDown( const MouseEvent& rMEvt );
sal_Bool DrawMouseButtonDown(const MouseEvent& rMEvt); bool DrawMouseButtonDown(const MouseEvent& rMEvt);
sal_Bool DrawMouseButtonUp(const MouseEvent& rMEvt); bool DrawMouseButtonUp(const MouseEvent& rMEvt);
sal_Bool DrawMouseMove(const MouseEvent& rMEvt); bool DrawMouseMove(const MouseEvent& rMEvt);
sal_Bool DrawKeyInput(const KeyEvent& rKEvt); bool DrawKeyInput(const KeyEvent& rKEvt);
sal_Bool DrawCommand(const CommandEvent& rCEvt); bool DrawCommand(const CommandEvent& rCEvt);
sal_Bool DrawHasMarkedObj(); bool DrawHasMarkedObj();
void DrawEndAction(); void DrawEndAction();
void DrawMarkDropObj( SdrObject* pObj ); void DrawMarkDropObj( SdrObject* pObj );
SdrObject* GetEditObject(); SdrObject* GetEditObject();
sal_Bool IsMyModel(SdrEditView* pSdrView); bool IsMyModel(SdrEditView* pSdrView);
void DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer ); void DrawRedraw( ScOutputData& rOutputData, ScUpdateMode eMode, sal_uLong nLayer );
void DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pContentDev ); void DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pContentDev );
...@@ -271,9 +271,9 @@ private: ...@@ -271,9 +271,9 @@ private:
void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, OutputDevice* pContentDev ); void DrawPagePreview( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, OutputDevice* pContentDev );
sal_Bool GetEditUrl( const Point& rPos, bool GetEditUrl( const Point& rPos,
String* pName=0, String* pUrl=0, String* pTarget=0 ); String* pName=0, String* pUrl=0, String* pTarget=0 );
sal_Bool GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos, bool GetEditUrlOrError( bool bSpellErr, const Point& rPos,
String* pName=0, String* pUrl=0, String* pTarget=0 ); String* pName=0, String* pUrl=0, String* pTarget=0 );
bool HitRangeFinder( const Point& rMouse, bool& rCorner, sal_uInt16* pIndex = NULL, bool HitRangeFinder( const Point& rMouse, bool& rCorner, sal_uInt16* pIndex = NULL,
...@@ -338,7 +338,7 @@ public: ...@@ -338,7 +338,7 @@ public:
void UpdateFormulas(); void UpdateFormulas();
void DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSelect ); void DoAutoFilterMenue( SCCOL nCol, SCROW nRow, bool bDataSelect );
void DoScenarioMenue( const ScRange& rScenRange ); void DoScenarioMenue( const ScRange& rScenRange );
void LaunchPageFieldMenu( SCCOL nCol, SCROW nRow ); void LaunchPageFieldMenu( SCCOL nCol, SCROW nRow );
...@@ -353,21 +353,18 @@ public: ...@@ -353,21 +353,18 @@ public:
void Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, void Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
ScUpdateMode eMode = SC_UPDATE_ALL ); ScUpdateMode eMode = SC_UPDATE_ALL );
void InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
sal_Bool bTestMerge = false, sal_Bool bRepeat = false );
void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress); void CreateAnchorHandle(SdrHdlList& rHdl, const ScAddress& rAddress);
void HideCursor(); void HideCursor();
void ShowCursor(); void ShowCursor();
void UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange); void UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange);
void UpdateListValPos( sal_Bool bVisible, const ScAddress& rPos ); void UpdateListValPos( bool bVisible, const ScAddress& rPos );
sal_Bool ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKeyboard ); bool ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard );
void HideNoteMarker(); void HideNoteMarker();
MapMode GetDrawMapMode( sal_Bool bForce = false ); MapMode GetDrawMapMode( bool bForce = false );
void ContinueDrag(); void ContinueDrag();
......
...@@ -880,7 +880,7 @@ void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange ) ...@@ -880,7 +880,7 @@ void ScGridWindow::DoScenarioMenue( const ScRange& rScenRange )
CaptureMouse(); CaptureMouse();
} }
void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, sal_Bool bDataSelect ) void ScGridWindow::DoAutoFilterMenue( SCCOL nCol, SCROW nRow, bool bDataSelect )
{ {
delete pFilterBox; delete pFilterBox;
delete pFilterFloat; delete pFilterFloat;
...@@ -1352,7 +1352,7 @@ void ScGridWindow::MoveMouseStatus( ScGridWindow& rDestWin ) ...@@ -1352,7 +1352,7 @@ void ScGridWindow::MoveMouseStatus( ScGridWindow& rDestWin )
} }
} }
sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ) bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, bool bAction )
{ {
// MouseEvent buttons must only be checked if bAction==TRUE // MouseEvent buttons must only be checked if bAction==TRUE
// to allow changing the mouse pointer in MouseMove, // to allow changing the mouse pointer in MouseMove,
...@@ -1362,16 +1362,16 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ) ...@@ -1362,16 +1362,16 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
if ( bAction && !rMEvt.IsLeft() ) if ( bAction && !rMEvt.IsLeft() )
return false; return false;
sal_Bool bNewPointer = false; bool bNewPointer = false;
SfxInPlaceClient* pClient = pViewData->GetViewShell()->GetIPClient(); SfxInPlaceClient* pClient = pViewData->GetViewShell()->GetIPClient();
sal_Bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() ); bool bOleActive = ( pClient && pClient->IsObjectInPlaceActive() );
if ( pViewData->IsActive() && !bOleActive ) if ( pViewData->IsActive() && !bOleActive )
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab ); bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
// Auto-Fill // Auto-Fill
...@@ -1400,7 +1400,7 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ) ...@@ -1400,7 +1400,7 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
// where the Marking flag is set and MarkToSimple won't work anymore. // where the Marking flag is set and MarkToSimple won't work anymore.
pViewData->GetMarkData().MarkToSimple(); pViewData->GetMarkData().MarkToSimple();
} }
bNewPointer = sal_True; bNewPointer = true;
} }
} }
} }
...@@ -1421,9 +1421,9 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ) ...@@ -1421,9 +1421,9 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
aStartPos.X() += 2; aStartPos.X() += 2;
aEndPos.X() += 2; aEndPos.X() += 2;
} }
sal_Bool bTop = ( aMousePos.X() >= aStartPos.X()-3 && aMousePos.X() <= aStartPos.X()+1 && bool bTop = ( aMousePos.X() >= aStartPos.X()-3 && aMousePos.X() <= aStartPos.X()+1 &&
aMousePos.Y() >= aStartPos.Y()-3 && aMousePos.Y() <= aStartPos.Y()+1 ); aMousePos.Y() >= aStartPos.Y()-3 && aMousePos.Y() <= aStartPos.Y()+1 );
sal_Bool bBottom = ( aMousePos.X() >= aEndPos.X()-3 && aMousePos.X() <= aEndPos.X()+1 && bool bBottom = ( aMousePos.X() >= aEndPos.X()-3 && aMousePos.X() <= aEndPos.X()+1 &&
aMousePos.Y() >= aEndPos.Y()-3 && aMousePos.Y() <= aEndPos.Y()+1 ); aMousePos.Y() >= aEndPos.Y()-3 && aMousePos.Y() <= aEndPos.Y()+1 );
if ( bTop || bBottom ) if ( bTop || bBottom )
{ {
...@@ -1435,7 +1435,7 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction ) ...@@ -1435,7 +1435,7 @@ sal_Bool ScGridWindow::TestMouse( const MouseEvent& rMEvt, sal_Bool bAction )
aRange.aStart.Col(), aRange.aStart.Row(), aRange.aStart.Col(), aRange.aStart.Row(),
aRange.aEnd.Col(), aRange.aEnd.Row(), nMode ); aRange.aEnd.Col(), aRange.aEnd.Row(), nMode );
} }
bNewPointer = sal_True; bNewPointer = true;
} }
} }
} }
...@@ -3159,7 +3159,7 @@ void ScGridWindow::UpdateInputContext() ...@@ -3159,7 +3159,7 @@ void ScGridWindow::UpdateInputContext()
// sensitiver Bereich (Pixel) // sensitiver Bereich (Pixel)
#define SCROLL_SENSITIVE 20 #define SCROLL_SENSITIVE 20
sal_Bool ScGridWindow::DropScroll( const Point& rMousePos ) bool ScGridWindow::DropScroll( const Point& rMousePos )
{ {
SCsCOL nDx = 0; SCsCOL nDx = 0;
SCsROW nDy = 0; SCsROW nDy = 0;
...@@ -4431,7 +4431,7 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange) ...@@ -4431,7 +4431,7 @@ void ScGridWindow::UpdateAutoFillMark(bool bMarked, const ScRange& rMarkRange)
} }
} }
void ScGridWindow::UpdateListValPos( sal_Bool bVisible, const ScAddress& rPos ) void ScGridWindow::UpdateListValPos( bool bVisible, const ScAddress& rPos )
{ {
bool bOldButton = bListValButton; bool bOldButton = bListValButton;
ScAddress aOldPos = aListValPos; ScAddress aOldPos = aListValPos;
...@@ -4831,13 +4831,13 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, sal_Bool bUp ) ...@@ -4831,13 +4831,13 @@ void ScGridWindow::RFMouseMove( const MouseEvent& rMEvt, sal_Bool bUp )
//------------------------------------------------------------------------ //------------------------------------------------------------------------
sal_Bool ScGridWindow::GetEditUrl( const Point& rPos, bool ScGridWindow::GetEditUrl( const Point& rPos,
String* pName, String* pUrl, String* pTarget ) String* pName, String* pUrl, String* pTarget )
{ {
return GetEditUrlOrError( false, rPos, pName, pUrl, pTarget ); return GetEditUrlOrError( false, rPos, pName, pUrl, pTarget );
} }
sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos, bool ScGridWindow::GetEditUrlOrError( bool bSpellErr, const Point& rPos,
String* pName, String* pUrl, String* pTarget ) String* pName, String* pUrl, String* pTarget )
{ {
//! nPosX/Y mit uebergeben? //! nPosX/Y mit uebergeben?
...@@ -5014,14 +5014,14 @@ sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos, ...@@ -5014,14 +5014,14 @@ sal_Bool ScGridWindow::GetEditUrlOrError( sal_Bool bSpellErr, const Point& rPos,
return false; return false;
} }
sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange ) bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScenRange )
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
SCTAB nTabCount = pDoc->GetTableCount(); SCTAB nTabCount = pDoc->GetTableCount();
if ( nTab+1<nTabCount && pDoc->IsScenario(nTab+1) && !pDoc->IsScenario(nTab) ) if ( nTab+1<nTabCount && pDoc->IsScenario(nTab+1) && !pDoc->IsScenario(nTab) )
{ {
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab ); bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
Size aButSize = pViewData->GetScenButSize(); Size aButSize = pViewData->GetScenButSize();
long nBWidth = aButSize.Width(); long nBWidth = aButSize.Width();
...@@ -5047,7 +5047,7 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen ...@@ -5047,7 +5047,7 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen
// dadurch keine neuen nicht-ueberdeckten Zellen mit umrandet werden // dadurch keine neuen nicht-ueberdeckten Zellen mit umrandet werden
pDoc->ExtendTotalMerge( aRange ); pDoc->ExtendTotalMerge( aRange );
sal_Bool bTextBelow = ( aRange.aStart.Row() == 0 ); bool bTextBelow = ( aRange.aStart.Row() == 0 );
Point aButtonPos; Point aButtonPos;
if ( bTextBelow ) if ( bTextBelow )
...@@ -5070,7 +5070,7 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen ...@@ -5070,7 +5070,7 @@ sal_Bool ScGridWindow::HasScenarioButton( const Point& rPosPixel, ScRange& rScen
if ( aButRect.IsInside( rPosPixel ) ) if ( aButRect.IsInside( rPosPixel ) )
{ {
rScenRange = aRange; rScenRange = aRange;
return sal_True; return true;
} }
} }
} }
......
...@@ -118,12 +118,12 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW ...@@ -118,12 +118,12 @@ DataPilotFieldOrientation ScGridWindow::GetDPFieldOrientation( SCCOL nCol, SCROW
} }
// private method for mouse button handling // private method for mouse button handling
sal_Bool ScGridWindow::DoPageFieldSelection( SCCOL nCol, SCROW nRow ) bool ScGridWindow::DoPageFieldSelection( SCCOL nCol, SCROW nRow )
{ {
if (GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE) if (GetDPFieldOrientation( nCol, nRow ) == sheet::DataPilotFieldOrientation_PAGE)
{ {
LaunchPageFieldMenu( nCol, nRow ); LaunchPageFieldMenu( nCol, nRow );
return sal_True; return true;
} }
return false; return false;
} }
...@@ -627,7 +627,7 @@ void ScGridWindow::DPMouseButtonUp( const MouseEvent& rMEvt ) ...@@ -627,7 +627,7 @@ void ScGridWindow::DPMouseButtonUp( const MouseEvent& rMEvt )
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void ScGridWindow::UpdateDragRect( sal_Bool bShowRange, const Rectangle& rPosRect ) void ScGridWindow::UpdateDragRect( bool bShowRange, const Rectangle& rPosRect )
{ {
SCCOL nStartX = ( rPosRect.Left() >= 0 ) ? static_cast<SCCOL>(rPosRect.Left()) : SCCOL_MAX; SCCOL nStartX = ( rPosRect.Left() >= 0 ) ? static_cast<SCCOL>(rPosRect.Left()) : SCCOL_MAX;
SCROW nStartY = ( rPosRect.Top() >= 0 ) ? static_cast<SCROW>(rPosRect.Top()) : SCROW_MAX; SCROW nStartY = ( rPosRect.Top() >= 0 ) ? static_cast<SCROW>(rPosRect.Top()) : SCROW_MAX;
......
...@@ -54,9 +54,9 @@ ...@@ -54,9 +54,9 @@
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt) bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt)
{ {
sal_Bool bRet = false; bool bRet = false;
FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr(); FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr();
if (pDraw && !pViewData->IsRefMode()) if (pDraw && !pViewData->IsRefMode())
{ {
...@@ -65,7 +65,7 @@ sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt) ...@@ -65,7 +65,7 @@ sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt)
if ( pDraw->IsDetectiveHit( aLogicPos ) ) if ( pDraw->IsDetectiveHit( aLogicPos ) )
{ {
// auf Detektiv-Pfeilen gar nichts (Doppelklick wird bei ButtonUp ausgewertet) // auf Detektiv-Pfeilen gar nichts (Doppelklick wird bei ButtonUp ausgewertet)
bRet = sal_True; bRet = true;
} }
else else
{ {
...@@ -81,15 +81,15 @@ sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt) ...@@ -81,15 +81,15 @@ sal_Bool ScGridWindow::DrawMouseButtonDown(const MouseEvent& rMEvt)
if ( pDrView && !rMEvt.IsLeft() && !bRet ) if ( pDrView && !rMEvt.IsLeft() && !bRet )
{ {
pDrView->BrkAction(); pDrView->BrkAction();
bRet = sal_True; bRet = true;
} }
return bRet; return bRet;
} }
sal_Bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt) bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt)
{ {
ScViewFunc* pView = pViewData->GetView(); ScViewFunc* pView = pViewData->GetView();
sal_Bool bRet = false; bool bRet = false;
FuPoor* pDraw = pView->GetDrawFuncPtr(); FuPoor* pDraw = pView->GetDrawFuncPtr();
if (pDraw && !pViewData->IsRefMode()) if (pDraw && !pViewData->IsRefMode())
{ {
...@@ -103,7 +103,7 @@ sal_Bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt) ...@@ -103,7 +103,7 @@ sal_Bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt)
ScDrawView* pDrView = pViewData->GetScDrawView(); ScDrawView* pDrView = pViewData->GetScDrawView();
if ( pDrView ) if ( pDrView )
{ {
sal_Bool bReplaceAll = sal_True; bool bReplaceAll = true;
pDrView->SetAttrToMarked(*pDrawBrush, bReplaceAll); pDrView->SetAttrToMarked(*pDrawBrush, bReplaceAll);
} }
...@@ -115,13 +115,13 @@ sal_Bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt) ...@@ -115,13 +115,13 @@ sal_Bool ScGridWindow::DrawMouseButtonUp(const MouseEvent& rMEvt)
return bRet; return bRet;
} }
sal_Bool ScGridWindow::DrawMouseMove(const MouseEvent& rMEvt) bool ScGridWindow::DrawMouseMove(const MouseEvent& rMEvt)
{ {
FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr(); FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr();
if (pDraw && !pViewData->IsRefMode()) if (pDraw && !pViewData->IsRefMode())
{ {
pDraw->SetWindow( this ); pDraw->SetWindow( this );
sal_Bool bRet = pDraw->MouseMove( rMEvt ); bool bRet = pDraw->MouseMove( rMEvt );
if ( bRet ) if ( bRet )
UpdateStatusPosSize(); UpdateStatusPosSize();
return bRet; return bRet;
...@@ -146,7 +146,7 @@ void ScGridWindow::DrawEndAction() ...@@ -146,7 +146,7 @@ void ScGridWindow::DrawEndAction()
// ReleaseMouse beim Aufruf // ReleaseMouse beim Aufruf
} }
sal_Bool ScGridWindow::DrawCommand(const CommandEvent& rCEvt) bool ScGridWindow::DrawCommand(const CommandEvent& rCEvt)
{ {
ScDrawView* pDrView = pViewData->GetScDrawView(); ScDrawView* pDrView = pViewData->GetScDrawView();
FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr(); FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr();
...@@ -157,30 +157,30 @@ sal_Bool ScGridWindow::DrawCommand(const CommandEvent& rCEvt) ...@@ -157,30 +157,30 @@ sal_Bool ScGridWindow::DrawCommand(const CommandEvent& rCEvt)
if( nUsed == SC_CMD_USED ) if( nUsed == SC_CMD_USED )
nButtonDown = 0; // MouseButtonUp wird verschluckt... nButtonDown = 0; // MouseButtonUp wird verschluckt...
if( nUsed || pDrView->IsAction() ) if( nUsed || pDrView->IsAction() )
return sal_True; return true;
} }
return false; return false;
} }
sal_Bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt) bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt)
{ {
ScDrawView* pDrView = pViewData->GetScDrawView(); ScDrawView* pDrView = pViewData->GetScDrawView();
FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr(); FuPoor* pDraw = pViewData->GetView()->GetDrawFuncPtr();
if (pDrView && pDraw && !pViewData->IsRefMode()) if (pDrView && pDraw && !pViewData->IsRefMode())
{ {
pDraw->SetWindow( this ); pDraw->SetWindow( this );
sal_Bool bOldMarked = pDrView->AreObjectsMarked(); bool bOldMarked = pDrView->AreObjectsMarked();
if (pDraw->KeyInput( rKEvt )) if (pDraw->KeyInput( rKEvt ))
{ {
sal_Bool bLeaveDraw = false; bool bLeaveDraw = false;
sal_Bool bUsed = sal_True; bool bUsed = true;
sal_Bool bNewMarked = pDrView->AreObjectsMarked(); bool bNewMarked = pDrView->AreObjectsMarked();
if ( !pViewData->GetView()->IsDrawSelMode() ) if ( !pViewData->GetView()->IsDrawSelMode() )
if ( !bNewMarked ) if ( !bNewMarked )
{ {
pViewData->GetViewShell()->SetDrawShell( false ); pViewData->GetViewShell()->SetDrawShell( false );
bLeaveDraw = sal_True; bLeaveDraw = true;
if ( !bOldMarked && if ( !bOldMarked &&
rKEvt.GetKeyCode().GetCode() == KEY_DELETE ) rKEvt.GetKeyCode().GetCode() == KEY_DELETE )
bUsed = false; // nichts geloescht bUsed = false; // nichts geloescht
...@@ -245,7 +245,7 @@ void ScGridWindow::DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pCo ...@@ -245,7 +245,7 @@ void ScGridWindow::DrawSdrGrid( const Rectangle& rDrawingRect, OutputDevice* pCo
} }
} }
MapMode ScGridWindow::GetDrawMapMode( sal_Bool bForce ) MapMode ScGridWindow::GetDrawMapMode( bool bForce )
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
...@@ -382,7 +382,7 @@ void ScGridWindow::UpdateStatusPosSize() ...@@ -382,7 +382,7 @@ void ScGridWindow::UpdateStatusPosSize()
pViewData->GetBindings().SetState(aSet); pViewData->GetBindings().SetState(aSet);
} }
sal_Bool ScGridWindow::DrawHasMarkedObj() bool ScGridWindow::DrawHasMarkedObj()
{ {
ScDrawView* p = pViewData->GetScDrawView(); ScDrawView* p = pViewData->GetScDrawView();
return p ? p->AreObjectsMarked() : false; return p ? p->AreObjectsMarked() : false;
......
...@@ -1308,7 +1308,7 @@ Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos ) ...@@ -1308,7 +1308,7 @@ Rectangle ScGridWindow::GetListValButtonRect( const ScAddress& rButtonPos )
return Rectangle( aPos, aBtnSize ); return Rectangle( aPos, aBtnSize );
} }
sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ) bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab )
{ {
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab ); ScDBData* pDBData = pDoc->GetDBAtCursor( nCol, nRow, nTab );
...@@ -1321,8 +1321,8 @@ sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ) ...@@ -1321,8 +1321,8 @@ sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab )
OSL_FAIL("Auto-Filter-Button ohne DBData"); OSL_FAIL("Auto-Filter-Button ohne DBData");
} }
sal_Bool bSimpleQuery = sal_True; bool bSimpleQuery = true;
sal_Bool bColumnFound = false; bool bColumnFound = false;
SCSIZE nQuery; SCSIZE nQuery;
if ( !aQueryParam.bInplace ) if ( !aQueryParam.bInplace )
...@@ -1344,179 +1344,6 @@ sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab ) ...@@ -1344,179 +1344,6 @@ sal_Bool ScGridWindow::IsAutoFilterActive( SCCOL nCol, SCROW nRow, SCTAB nTab )
return ( bSimpleQuery && bColumnFound ); return ( bSimpleQuery && bColumnFound );
} }
void ScGridWindow::InvertSimple( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2,
sal_Bool bTestMerge, sal_Bool bRepeat )
{
//! if INVERT_HIGHLIGHT swaps foreground and background (like on Mac),
//! use INVERT_HIGHLIGHT only for cells that have no background color set
//! (here and in ScOutputData::DrawMark)
PutInOrder( nX1, nX2 );
PutInOrder( nY1, nY2 );
ScMarkData& rMark = pViewData->GetMarkData();
ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo();
sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab );
long nLayoutSign = bLayoutRTL ? -1 : 1;
SCCOL nTestX2 = nX2;
SCROW nTestY2 = nY2;
if (bTestMerge)
pDoc->ExtendMerge( nX1,nY1, nTestX2,nTestY2, nTab );
SCCOL nPosX = pViewData->GetPosX( eHWhich );
SCROW nPosY = pViewData->GetPosY( eVWhich );
if (nTestX2 < nPosX || nTestY2 < nPosY)
return; // unsichtbar
SCCOL nRealX1 = nX1;
if (nX1 < nPosX)
nX1 = nPosX;
if (nY1 < nPosY)
nY1 = nPosY;
SCCOL nXRight = nPosX + pViewData->VisibleCellsX(eHWhich);
if (nXRight > MAXCOL) nXRight = MAXCOL;
SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
if (nYBottom > MAXROW) nYBottom = MAXROW;
if (nX1 > nXRight || nY1 > nYBottom)
return; // unsichtbar
if (nX2 > nXRight) nX2 = nXRight;
if (nY2 > nYBottom) nY2 = nYBottom;
MapMode aOld = GetMapMode(); SetMapMode(MAP_PIXEL); // erst nach den return's !!!
double nPPTX = pViewData->GetPPTX();
double nPPTY = pViewData->GetPPTY();
ScInvertMerger aInvert( this );
Point aScrPos = pViewData->GetScrPos( nX1, nY1, eWhich );
long nScrY = aScrPos.Y();
sal_Bool bWasHidden = false;
for (SCROW nY=nY1; nY<=nY2; nY++)
{
sal_Bool bFirstRow = ( nY == nPosY ); // first visible row?
sal_Bool bDoHidden = false; // versteckte nachholen ?
sal_uInt16 nHeightTwips = pDoc->GetRowHeight( nY,nTab );
sal_Bool bDoRow = ( nHeightTwips != 0 );
if (bDoRow)
{
if (bTestMerge)
if (bWasHidden) // auf versteckte zusammengefasste testen
{
bDoHidden = true;
bDoRow = true;
}
bWasHidden = false;
}
else
{
bWasHidden = sal_True;
if (bTestMerge)
if (nY==nY2)
bDoRow = sal_True; // letzte Zeile aus Block
}
if ( bDoRow )
{
SCCOL nLoopEndX = nX2;
if (nX2 < nX1) // Rest von zusammengefasst
{
SCCOL nStartX = nX1;
while ( ((const ScMergeFlagAttr*)pDoc->
GetAttr(nStartX,nY,nTab,ATTR_MERGE_FLAG))->IsHorOverlapped() )
--nStartX;
if (nStartX <= nX2)
nLoopEndX = nX1;
}
long nEndY = nScrY + ScViewData::ToPixel( nHeightTwips, nPPTY ) - 1;
long nScrX = aScrPos.X();
for (SCCOL nX=nX1; nX<=nLoopEndX; nX++)
{
long nWidth = ScViewData::ToPixel( pDoc->GetColWidth( nX,nTab ), nPPTX );
if ( nWidth > 0 )
{
long nEndX = nScrX + ( nWidth - 1 ) * nLayoutSign;
if (bTestMerge)
{
SCROW nThisY = nY;
const ScPatternAttr* pPattern = pDoc->GetPattern( nX, nY, nTab );
const ScMergeFlagAttr* pMergeFlag = (const ScMergeFlagAttr*) &pPattern->
GetItem(ATTR_MERGE_FLAG);
if ( pMergeFlag->IsVerOverlapped() && ( bDoHidden || bFirstRow ) )
{
while ( pMergeFlag->IsVerOverlapped() && nThisY > 0 &&
(pDoc->RowHidden(nThisY-1, nTab) || bFirstRow) )
{
--nThisY;
pPattern = pDoc->GetPattern( nX, nThisY, nTab );
pMergeFlag = (const ScMergeFlagAttr*) &pPattern->GetItem(ATTR_MERGE_FLAG);
}
}
// nur Rest von zusammengefasster zu sehen ?
SCCOL nThisX = nX;
if ( pMergeFlag->IsHorOverlapped() && nX == nPosX && nX > nRealX1 )
{
while ( pMergeFlag->IsHorOverlapped() )
{
--nThisX;
pPattern = pDoc->GetPattern( nThisX, nThisY, nTab );
pMergeFlag = (const ScMergeFlagAttr*) &pPattern->GetItem(ATTR_MERGE_FLAG);
}
}
if ( rMark.IsCellMarked( nThisX, nThisY, sal_True ) == bRepeat )
{
if ( !pMergeFlag->IsOverlapped() )
{
ScMergeAttr* pMerge = (ScMergeAttr*)&pPattern->GetItem(ATTR_MERGE);
if (pMerge->GetColMerge() > 0 || pMerge->GetRowMerge() > 0)
{
Point aEndPos = pViewData->GetScrPos(
nThisX + pMerge->GetColMerge(),
nThisY + pMerge->GetRowMerge(), eWhich );
if ( aEndPos.X() * nLayoutSign > nScrX * nLayoutSign && aEndPos.Y() > nScrY )
{
aInvert.AddRect( Rectangle( nScrX,nScrY,
aEndPos.X()-nLayoutSign,aEndPos.Y()-1 ) );
}
}
else if ( nEndX * nLayoutSign >= nScrX * nLayoutSign && nEndY >= nScrY )
{
aInvert.AddRect( Rectangle( nScrX,nScrY,nEndX,nEndY ) );
}
}
}
}
else // !bTestMerge
{
if ( rMark.IsCellMarked( nX, nY, sal_True ) == bRepeat &&
nEndX * nLayoutSign >= nScrX * nLayoutSign && nEndY >= nScrY )
{
aInvert.AddRect( Rectangle( nScrX,nScrY,nEndX,nEndY ) );
}
}
nScrX = nEndX + nLayoutSign;
}
}
nScrY = nEndY + 1;
}
}
aInvert.Flush(); // before restoring MapMode
SetMapMode(aOld);
CheckInverted();
}
void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects ) void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
{ {
ScMarkData aMultiMark( pViewData->GetMarkData() ); ScMarkData aMultiMark( pViewData->GetMarkData() );
......
...@@ -92,16 +92,16 @@ ScHideTextCursor::~ScHideTextCursor() ...@@ -92,16 +92,16 @@ ScHideTextCursor::~ScHideTextCursor()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKeyboard ) bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, bool bKeyboard )
{ {
sal_Bool bDone = false; bool bDone = false;
ScDocument* pDoc = pViewData->GetDocument(); ScDocument* pDoc = pViewData->GetDocument();
SCTAB nTab = pViewData->GetTabNo(); SCTAB nTab = pViewData->GetTabNo();
ScAddress aCellPos( nPosX, nPosY, nTab ); ScAddress aCellPos( nPosX, nPosY, nTab );
String aTrackText; String aTrackText;
sal_Bool bLeftEdge = false; bool bLeftEdge = false;
// Change-Tracking // Change-Tracking
...@@ -175,7 +175,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey ...@@ -175,7 +175,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
// bei geloeschten Spalten: Pfeil auf die linke Seite der Zelle // bei geloeschten Spalten: Pfeil auf die linke Seite der Zelle
if ( pFound->GetType() == SC_CAT_DELETE_COLS ) if ( pFound->GetType() == SC_CAT_DELETE_COLS )
bLeftEdge = sal_True; bLeftEdge = true;
DateTime aDT = pFound->GetDateTime(); DateTime aDT = pFound->GetDateTime();
aTrackText = pFound->GetUser(); aTrackText = pFound->GetUser();
...@@ -202,14 +202,14 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey ...@@ -202,14 +202,14 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
const ScPostIt* pNote = pDoc->GetNote( aCellPos ); const ScPostIt* pNote = pDoc->GetNote( aCellPos );
if ( (aTrackText.Len() > 0) || (pNote && !pNote->IsCaptionShown()) ) if ( (aTrackText.Len() > 0) || (pNote && !pNote->IsCaptionShown()) )
{ {
sal_Bool bNew = sal_True; bool bNew = true;
sal_Bool bFast = false; bool bFast = false;
if ( pNoteMarker ) // schon eine Notiz angezeigt if ( pNoteMarker ) // schon eine Notiz angezeigt
{ {
if ( pNoteMarker->GetDocPos() == aCellPos ) // dieselbe if ( pNoteMarker->GetDocPos() == aCellPos ) // dieselbe
bNew = false; // dann stehenlassen bNew = false; // dann stehenlassen
else else
bFast = sal_True; // sonst sofort bFast = true; // sonst sofort
// marker which was shown for ctrl-F1 isn't removed by mouse events // marker which was shown for ctrl-F1 isn't removed by mouse events
if ( pNoteMarker->IsByKeyboard() && !bKeyboard ) if ( pNoteMarker->IsByKeyboard() && !bKeyboard )
...@@ -218,7 +218,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey ...@@ -218,7 +218,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
if ( bNew ) if ( bNew )
{ {
if ( bKeyboard ) if ( bKeyboard )
bFast = sal_True; // keyboard also shows the marker immediately bFast = true; // keyboard also shows the marker immediately
delete pNoteMarker; delete pNoteMarker;
...@@ -233,7 +233,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey ...@@ -233,7 +233,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
/* If caption is shown from right or bottom windows, adjust /* If caption is shown from right or bottom windows, adjust
mapmode to include size of top-left window. */ mapmode to include size of top-left window. */
MapMode aMapMode = GetDrawMapMode( sal_True ); MapMode aMapMode = GetDrawMapMode( true );
Size aLeftSize = pLeft->PixelToLogic( pLeft->GetOutputSizePixel(), aMapMode ); Size aLeftSize = pLeft->PixelToLogic( pLeft->GetOutputSizePixel(), aMapMode );
Point aOrigin = aMapMode.GetOrigin(); Point aOrigin = aMapMode.GetOrigin();
if( (this == pRight) || (this == pDiagonal) ) if( (this == pRight) || (this == pDiagonal) )
...@@ -247,7 +247,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey ...@@ -247,7 +247,7 @@ sal_Bool ScGridWindow::ShowNoteMarker( SCsCOL nPosX, SCsROW nPosY, sal_Bool bKey
aMapMode, bLeftEdge, bFast, bKeyboard ); aMapMode, bLeftEdge, bFast, bKeyboard );
} }
bDone = sal_True; // something is shown (old or new) bDone = true; // something is shown (old or new)
} }
return bDone; return bDone;
...@@ -412,7 +412,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt) ...@@ -412,7 +412,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
Window::RequestHelp( rHEvt ); Window::RequestHelp( rHEvt );
} }
sal_Bool ScGridWindow::IsMyModel(SdrEditView* pSdrView) bool ScGridWindow::IsMyModel(SdrEditView* pSdrView)
{ {
return pSdrView && return pSdrView &&
pSdrView->GetModel() == pViewData->GetDocument()->GetDrawLayer(); pSdrView->GetModel() == pViewData->GetDocument()->GetDrawLayer();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment