diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-28 23:41:09 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-29 00:04:24 -0500 |
commit | 8ea81446029b314ae78e45fddb64903ea6ac5509 (patch) | |
tree | 930cffd9abb2051fee22d1beadf1112f6233f5c9 /sc/source/ui/view/preview.cxx | |
parent | 2761dd4894a22ff63e5da3a786d51fffb4977aa1 (diff) |
sal_Bool cleanup in ScPreview.
Diffstat (limited to 'sc/source/ui/view/preview.cxx')
-rw-r--r-- | sc/source/ui/view/preview.cxx | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index c1dfa74ec3d1..fb72a8b74c41 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -98,7 +98,6 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView Window( pParent ), nPageNo( 0 ), nZoom( 100 ), - bValid( false ), nTabsTested( 0 ), nPages(), nFirstAttr(), @@ -106,16 +105,17 @@ ScPreview::ScPreview( Window* pParent, ScDocShell* pDocSh, ScPreviewShell* pView nTabStart( 0 ), nDisplayStart( 0 ), nTotalPages( 0 ), - bStateValid( false ), - bLocationValid( false ), pLocationData( NULL ), pDrawView( NULL ), nCurTab ( ScDocShell::GetCurTab() ), - bInPaint( false ), - bInSetZoom( false ), - bInGetState( false ), pDocShell( pDocSh ), pViewShell( pViewSh ), + bInGetState( false ), + bValid( false ), + bStateValid( false ), + bLocationValid( false ), + bInPaint( false ), + bInSetZoom( false ), bLeftRulerMove( false ), bRightRulerMove( false ), bTopRulerMove( false ), @@ -175,8 +175,8 @@ void ScPreview::UpdateDrawView() // nTab muss richtig sein pDrawView = new FmFormView( pModel, this ); // die DrawView uebernimmt den Design-Modus vom Model // (Einstellung "Im Entwurfsmodus oeffnen"), darum hier zuruecksetzen - pDrawView->SetDesignMode( sal_True ); - pDrawView->SetPrintPreview( sal_True ); + pDrawView->SetDesignMode( true ); + pDrawView->SetPrintPreview( true ); pDrawView->ShowSdrPage(pPage); } } @@ -298,8 +298,8 @@ void ScPreview::CalcPages( SCTAB /*nToWhichTab*/ ) aState.nDocPages = nTotalPages; - bValid = sal_True; - bStateValid = sal_True; + bValid = true; + bStateValid = true; DoInvalidate(); } @@ -311,11 +311,11 @@ void ScPreview::RecalcPages() // nur nPageNo geaendert SCTAB nOldTab = nTab; - sal_Bool bDone = false; + bool bDone = false; while (nPageNo >= nTotalPages && nTabsTested < nTabCount) { CalcPages( nTabsTested ); - bDone = sal_True; + bDone = true; } if (!bDone) @@ -360,8 +360,8 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) Fraction aHorPrevZoom( (long)( 100 * nZoom / pDocShell->GetOutputFactor() ), 10000 ); MapMode aMMMode( MAP_100TH_MM, Point(), aHorPrevZoom, aPreviewZoom ); - sal_Bool bDoPrint = ( pFillLocation == NULL ); - sal_Bool bValidPage = ( nPageNo < nTotalPages ); + bool bDoPrint = ( pFillLocation == NULL ); + bool bValidPage = ( nPageNo < nTotalPages ); ScModule* pScMod = SC_MOD(); const svtools::ColorConfig& rColorCfg = pScMod->GetColorConfig(); @@ -404,7 +404,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) pPrintFunc->SetOffset(aOffset); pPrintFunc->SetManualZoom(nZoom); pPrintFunc->SetDateTime(aDate,aTime); - pPrintFunc->SetClearFlag(sal_True); + pPrintFunc->SetClearFlag(true); pPrintFunc->SetUseStyleColor( pScMod->GetAccessOptions().GetIsForPagePreviews() ); pPrintFunc->SetDrawView( pDrawView ); @@ -480,7 +480,7 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) { pPrintFunc->GetPrintState( aState ); aState.nDocPages = nTotalPages; - bStateValid = sal_True; + bStateValid = true; } delete pPrintFunc; } @@ -494,8 +494,8 @@ void ScPreview::DoPrint( ScPreviewLocationData* pFillLocation ) Size aWinSize = GetOutputSize(); Point aWinEnd( aWinSize.Width(), aWinSize.Height() ); - sal_Bool bRight = nPageEndX <= aWinEnd.X(); - sal_Bool bBottom = nPageEndY <= aWinEnd.Y(); + bool bRight = nPageEndX <= aWinEnd.X(); + bool bBottom = nPageEndY <= aWinEnd.Y(); if( bPageMargin && bValidPage ) { @@ -599,7 +599,7 @@ void ScPreview::Command( const CommandEvent& rCEvt ) sal_uInt16 nCmd = rCEvt.GetCommand(); if ( nCmd == COMMAND_WHEEL || nCmd == COMMAND_STARTAUTOSCROLL || nCmd == COMMAND_AUTOSCROLL ) { - sal_Bool bDone = pViewShell->ScrollCommand( rCEvt ); + bool bDone = pViewShell->ScrollCommand( rCEvt ); if (!bDone) Window::Command(rCEvt); } @@ -617,7 +617,7 @@ void ScPreview::KeyInput( const KeyEvent& rKEvt ) const KeyCode& rKeyCode = rKEvt.GetKeyCode(); sal_uInt16 nKey = rKeyCode.GetCode(); - sal_Bool bHandled = false; + bool bHandled = false; if(!rKeyCode.GetModifier()) { sal_uInt16 nSlot = 0; @@ -629,7 +629,7 @@ void ScPreview::KeyInput( const KeyEvent& rKEvt ) } if(nSlot) { - bHandled = sal_True; + bHandled = true; pViewShell->GetViewFrame()->GetDispatcher()->Execute( nSlot, SFX_CALLMODE_ASYNCHRON ); } } @@ -650,13 +650,13 @@ const ScPreviewLocationData& ScPreview::GetLocationData() { pLocationData->Clear(); DoPrint( pLocationData ); - bLocationValid = sal_True; + bLocationValid = true; } return *pLocationData; } -void ScPreview::DataChanged(sal_Bool bNewTime) +void ScPreview::DataChanged(bool bNewTime) { if (bNewTime) { @@ -776,7 +776,7 @@ Size lcl_GetDocPageSize( ScDocument* pDoc, SCTAB nTab ) } -sal_uInt16 ScPreview::GetOptimalZoom(sal_Bool bWidthOnly) +sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly) { double nWinScaleX = ScGlobal::nScreenPPTX / pDocShell->GetOutputFactor(); double nWinScaleY = ScGlobal::nScreenPPTY; @@ -955,14 +955,14 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt ) if( bLeftRulerChange ) { DrawInvert( aButtonDownChangePoint.X(), POINTER_HSIZEBAR ); - bLeftRulerMove = sal_True; + bLeftRulerMove = true; bRightRulerMove = false; } else if( bRightRulerChange ) { DrawInvert( aButtonDownChangePoint.X(), POINTER_HSIZEBAR ); bLeftRulerMove = false; - bRightRulerMove = sal_True; + bRightRulerMove = true; } } @@ -972,26 +972,26 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt ) if( bTopRulerChange ) { DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR ); - bTopRulerMove = sal_True; + bTopRulerMove = true; bBottomRulerMove = false; } else if( bBottomRulerChange ) { DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR ); bTopRulerMove = false; - bBottomRulerMove = sal_True; + bBottomRulerMove = true; } else if( bHeaderRulerChange ) { DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR ); - bHeaderRulerMove = sal_True; + bHeaderRulerMove = true; bFooterRulerMove = false; } else if( bFooterRulerChange ) { DrawInvert( aButtonDownChangePoint.Y(), POINTER_VSIZEBAR ); bHeaderRulerMove = false; - bFooterRulerMove = sal_True; + bFooterRulerMove = true; } } @@ -1017,7 +1017,7 @@ void ScPreview::MouseButtonDown( const MouseEvent& rMEvt ) DrawInvert( PixelToLogic( Point( nRight[ nColNumberButttonDown-1 ], 0 ),aMMMode ).X() ,POINTER_HSPLIT ); DrawInvert( aButtonDownChangePoint.X(), POINTER_HSPLIT ); - bColRulerMove = sal_True; + bColRulerMove = true; } } @@ -1036,11 +1036,11 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) { SetPointer( Pointer( POINTER_ARROW ) ); - sal_Bool bMoveRulerAction= sal_True; + bool bMoveRulerAction= true; ScDocument * pDoc = pDocShell->GetDocument(); String aOldName = pDoc->GetPageStyle( nTab ); - sal_Bool bUndo( pDoc->IsUndoEnabled() ); + bool bUndo = pDoc->IsUndoEnabled(); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aOldName, SFX_STYLE_FAMILY_PAGE ); @@ -1120,7 +1120,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) { SetPointer( POINTER_ARROW ); - sal_Bool bMoveRulerAction = sal_True; + bool bMoveRulerAction = true; if( ( bTopRulerChange || bBottomRulerChange || bHeaderRulerChange || bFooterRulerChange ) && ( aButtonUpPt.Y() <= ( 0 - aOffset.Y() ) || aButtonUpPt.Y() > nHeight * HMM_PER_TWIPS -aOffset.Y() ) ) { bMoveRulerAction = false; @@ -1134,7 +1134,7 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) if( bMoveRulerAction ) { ScDocument * pDoc = pDocShell->GetDocument(); - sal_Bool bUndo( pDoc->IsUndoEnabled() ); + bool bUndo = pDoc->IsUndoEnabled(); ScStyleSheetPool* pStylePool = pDoc->GetStyleSheetPool(); SfxStyleSheetBase* pStyleSheet = pStylePool->Find( pDoc->GetPageStyle( nTab ), SFX_STYLE_FAMILY_PAGE ); OSL_ENSURE( pStyleSheet, "PageStyle not found" ); @@ -1225,8 +1225,8 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) { SetPointer(POINTER_ARROW); ScDocument* pDoc = pDocShell->GetDocument(); - sal_Bool bLayoutRTL = pDoc->IsLayoutRTL( nTab ); - sal_Bool bMoveRulerAction = sal_True; + bool bLayoutRTL = pDoc->IsLayoutRTL( nTab ); + bool bMoveRulerAction = true; if( aButtonDownPt.X() == aButtonUpPt.X() ) { bMoveRulerAction = false; @@ -1328,7 +1328,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) Point aHeaderLeft = LogicToPixel( Point( -aOffset.X(), nHeaderHeight ), aMMMode ); Point aFooderLeft = LogicToPixel( Point( -aOffset.X(), nFooterHeight ), aMMMode ); - sal_Bool bOnColRulerChange = false; + bool bOnColRulerChange = false; for( SCCOL i=aPageArea.aStart.Col(); i<= aPageArea.aEnd.Col(); i++ ) { @@ -1338,7 +1338,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) && ( aPixPt.Y() > aColumnTop.Y() ) && ( aPixPt.Y() < aColumnBottom.Y() ) && !bLeftRulerMove && !bRightRulerMove && !bTopRulerMove && !bBottomRulerMove && !bHeaderRulerMove && !bFooterRulerMove ) { - bOnColRulerChange = sal_True; + bOnColRulerChange = true; if( !rMEvt.GetButtons() && GetPointer() == POINTER_HSPLIT ) nColNumberButttonDown = i; break; @@ -1347,17 +1347,17 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) if( aPixPt.X() < ( aLeftTop.X() + 2 ) && aPixPt.X() > ( aLeftTop.X() - 2 ) && !bRightRulerMove ) { - bLeftRulerChange = sal_True; + bLeftRulerChange = true; bRightRulerChange = false; } else if( aPixPt.X() < ( aRightTop.X() + 2 ) && aPixPt.X() > ( aRightTop.X() - 2 ) && !bLeftRulerMove ) { bLeftRulerChange = false; - bRightRulerChange = sal_True; + bRightRulerChange = true; } else if( aPixPt.Y() < ( aTopLeft.Y() + 2 ) && aPixPt.Y() > ( aTopLeft.Y() - 2 ) && !bBottomRulerMove && !bHeaderRulerMove && !bFooterRulerMove ) { - bTopRulerChange = sal_True; + bTopRulerChange = true; bBottomRulerChange = false; bHeaderRulerChange = false; bFooterRulerChange = false; @@ -1365,7 +1365,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) else if( aPixPt.Y() < ( aBottomLeft.Y() + 2 ) && aPixPt.Y() > ( aBottomLeft.Y() - 2 ) && !bTopRulerMove && !bHeaderRulerMove && !bFooterRulerMove ) { bTopRulerChange = false; - bBottomRulerChange = sal_True; + bBottomRulerChange = true; bHeaderRulerChange = false; bFooterRulerChange = false; } @@ -1373,7 +1373,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) { bTopRulerChange = false; bBottomRulerChange = false; - bHeaderRulerChange = sal_True; + bHeaderRulerChange = true; bFooterRulerChange = false; } else if( aPixPt.Y() < ( aFooderLeft.Y() + 2 ) && aPixPt.Y() > ( aFooderLeft.Y() - 2 ) && !bTopRulerMove && !bBottomRulerMove && !bHeaderRulerMove ) @@ -1381,7 +1381,7 @@ void ScPreview::MouseMove( const MouseEvent& rMEvt ) bTopRulerChange = false; bBottomRulerChange = false; bHeaderRulerChange = false; - bFooterRulerChange = sal_True; + bFooterRulerChange = true; } if( bPageMargin ) |