diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 16:55:21 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-03-10 20:21:13 -0500 |
commit | 12343c15568dcc2c9209d8ca41fda2263122448f (patch) | |
tree | 3212a89c6cd8ea2e0aee7103aa9669bbb8a6f307 /sc/source/ui/view/tabvwsha.cxx | |
parent | 99745dbcbb25b61437914c9782475d0b67a4b0bd (diff) | |
parent | ce6308e4fad2281241bf4ca78280eba29f744d43 (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sc/source/ui/view/tabvwsha.cxx')
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 3f0d6c2118ee..e245db772527 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -35,7 +35,6 @@ #define _ZFORLIST_DECLARE_TABLE #include "scitems.hxx" -#include <svl/slstitm.hxx> #include <svl/stritem.hxx> #include <svl/whiter.hxx> #include <svl/zformat.hxx> @@ -69,7 +68,7 @@ #include "compiler.hxx" -BOOL ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode ) +sal_Bool ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode ) { String aStr; @@ -87,7 +86,7 @@ BOOL ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode ) return true; } - USHORT nGlobStrId = 0; + sal_uInt16 nGlobStrId = 0; switch (eFunc) { case SUBTOTAL_FUNC_AVE: nGlobStrId = STR_FUN_TEXT_AVG; break; @@ -146,10 +145,10 @@ BOOL ScTabViewShell::GetFunction( String& rFuncStr, sal_uInt16 nErrCode ) } rFuncStr = aStr; - return TRUE; + return sal_True; } - return FALSE; + return false; } @@ -171,16 +170,16 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) SCCOL nPosX = pViewData->GetCurX(); SCROW nPosY = pViewData->GetCurY(); SCTAB nTab = pViewData->GetTabNo(); - USHORT nMyId = 0; + sal_uInt16 nMyId = 0; SfxViewFrame* pThisFrame = GetViewFrame(); - BOOL bOle = GetViewFrame()->GetFrame().IsInPlace(); + sal_Bool bOle = GetViewFrame()->GetFrame().IsInPlace(); SCTAB nTabCount = pDoc->GetTableCount(); SCTAB nTabSelCount = rMark.GetSelectCount(); SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) { @@ -210,7 +209,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) if ( nTabSelCount > 1 ) { // #i22589# also take "Print Entire Sheet" into account here - BOOL bHas = FALSE; + sal_Bool bHas = false; for (SCTAB i=0; !bHas && i<nTabCount; i++) bHas = rMark.GetTableSelect(i) && (pDoc->GetPrintRangeCount(i) || pDoc->IsPrintEntireSheet(i)); if (!bHas) @@ -240,7 +239,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case SID_SEARCH_OPTIONS: { - USHORT nOptions = 0xffff; // alles erlaubt + sal_uInt16 nOptions = 0xffff; // alles erlaubt // wenn ReadOnly, kein Ersetzen: if (GetViewData()->GetDocShell()->IsReadOnly()) nOptions &= ~( SEARCH_OPTIONS_REPLACE | SEARCH_OPTIONS_REPLACE_ALL ); @@ -270,12 +269,12 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case FID_TOGGLEINPUTLINE: { - USHORT nId = ScInputWindowWrapper::GetChildWindowId(); + sal_uInt16 nId = ScInputWindowWrapper::GetChildWindowId(); if ( pThisFrame->KnowsChildWindow( nId ) ) { SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); - rSet.Put( SfxBoolItem( nWhich, pWnd ? TRUE : FALSE ) ); + rSet.Put( SfxBoolItem( nWhich, pWnd ? sal_True : false ) ); } else rSet.DisableItem( nWhich ); @@ -299,9 +298,9 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) if ( pStyleSheet ) { SfxItemSet& rStyleSet = pStyleSheet->GetItemSet(); - USHORT nScale = ((const SfxUInt16Item&) + sal_uInt16 nScale = ((const SfxUInt16Item&) rStyleSet.Get(ATTR_PAGE_SCALE)).GetValue(); - USHORT nPages = ((const SfxUInt16Item&) + sal_uInt16 nPages = ((const SfxUInt16Item&) rStyleSet.Get(ATTR_PAGE_SCALETOPAGES)).GetValue(); if ( nScale == 100 && nPages == 0 ) rSet.DisableItem( nWhich ); @@ -316,7 +315,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) else { const Fraction& rOldY = GetViewData()->GetZoomY(); - USHORT nZoom = (USHORT)(( rOldY.GetNumerator() * 100 ) + sal_uInt16 nZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator()); rSet.Put( SvxZoomItem( SVX_ZOOM_PERCENT, nZoom, nWhich ) ); } @@ -329,7 +328,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) else { const Fraction& rOldY = GetViewData()->GetZoomY(); - USHORT nCurrentZoom = (USHORT)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator()); + sal_uInt16 nCurrentZoom = (sal_uInt16)(( rOldY.GetNumerator() * 100 ) / rOldY.GetDenominator()); if( nCurrentZoom ) { @@ -352,7 +351,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case FID_TOGGLEFORMULA: { const ScViewOptions& rOpts = pViewData->GetOptions(); - BOOL bFormulaMode = rOpts.GetOption( VOPT_FORMULAS ); + sal_Bool bFormulaMode = rOpts.GetOption( VOPT_FORMULAS ); rSet.Put(SfxBoolItem(nWhich, bFormulaMode )); } break; @@ -465,7 +464,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case SID_PRINTPREVIEW: // Toggle-Slot braucht einen State - rSet.Put( SfxBoolItem( nWhich, FALSE ) ); + rSet.Put( SfxBoolItem( nWhich, false ) ); break; case SID_READONLY_MODE: @@ -483,7 +482,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) } //------------------------------------------------------------------ -void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, USHORT nTabPage ) +void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, sal_uInt16 nTabPage ) { SfxAbstractTabDialog * pDlg = NULL; ScDocument* pDoc = GetViewData()->GetDocument(); @@ -511,7 +510,7 @@ void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, USHORT nTabPage ) pOldSet->MergeRange( SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO ); pOldSet->Put(*pNumberInfoItem ); - bInFormatDialog = TRUE; + bInFormatDialog = true; ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); DBG_ASSERT(pFact, "ScAbstractFactory create fail!"); @@ -520,14 +519,14 @@ void ScTabViewShell::ExecuteCellFormatDlg( SfxRequest& rReq, USHORT nTabPage ) if ( nTabPage != 0xffff ) pDlg->SetCurPageId( nTabPage ); short nResult = pDlg->Execute(); - bInFormatDialog = FALSE; + bInFormatDialog = false; if ( nResult == RET_OK ) { const SfxItemSet* pOutSet = pDlg->GetOutputItemSet(); const SfxPoolItem* pItem=NULL; - if(pOutSet->GetItemState(SID_ATTR_NUMBERFORMAT_INFO,TRUE,&pItem)==SFX_ITEM_SET) + if(pOutSet->GetItemState(SID_ATTR_NUMBERFORMAT_INFO,sal_True,&pItem)==SFX_ITEM_SET) { UpdateNumberFormatter( pDoc,(const SvxNumberInfoItem&)*pItem); @@ -605,7 +604,7 @@ void ScTabViewShell::ExecuteInputDirect() //------------------------------------------------------------------ -void ScTabViewShell::UpdateInputHandler( BOOL bForce /* = FALSE */, BOOL bStopEditing /* = TRUE */ ) +void ScTabViewShell::UpdateInputHandler( sal_Bool bForce /* = sal_False */, sal_Bool bStopEditing /* = sal_True */ ) { ScInputHandler* pHdl = pInputHandler ? pInputHandler : SC_MOD()->GetInputHdl(); @@ -633,8 +632,8 @@ void ScTabViewShell::UpdateInputHandler( BOOL bForce /* = FALSE */, BOOL bStopEd PutInOrder( nStartRow, nEndRow ); PutInOrder( nStartTab, nEndTab ); - BOOL bHideFormula = FALSE; - BOOL bHideAll = FALSE; + sal_Bool bHideFormula = false; + sal_Bool bHideAll = false; if (pDoc->IsTabProtected(nTab)) { @@ -727,7 +726,7 @@ void ScTabViewShell::GetSaveState( SfxItemSet& rSet ) SfxShell* pDocSh = GetViewData()->GetDocShell(); SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while( nWhich ) { if ( nWhich != SID_SAVEDOC || !GetViewData()->GetDocShell()->IsDocShared() ) @@ -749,26 +748,26 @@ void ScTabViewShell::ExecuteUndo(SfxRequest& rReq) const SfxItemSet* pReqArgs = rReq.GetArgs(); ScDocShell* pDocSh = GetViewData()->GetDocShell(); - USHORT nSlot = rReq.GetSlot(); + sal_uInt16 nSlot = rReq.GetSlot(); switch ( nSlot ) { case SID_UNDO: case SID_REDO: if ( pUndoManager ) { - BOOL bIsUndo = ( nSlot == SID_UNDO ); + sal_Bool bIsUndo = ( nSlot == SID_UNDO ); - USHORT nCount = 1; + sal_uInt16 nCount = 1; const SfxPoolItem* pItem; - if ( pReqArgs && pReqArgs->GetItemState( nSlot, TRUE, &pItem ) == SFX_ITEM_SET ) + if ( pReqArgs && pReqArgs->GetItemState( nSlot, true, &pItem ) == SFX_ITEM_SET ) nCount = ((const SfxUInt16Item*)pItem)->GetValue(); // lock paint for more than one cell undo action (not for editing within a cell) - BOOL bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() ); + sal_Bool bLockPaint = ( nCount > 1 && pUndoManager == GetUndoManager() ); if ( bLockPaint ) pDocSh->LockPaint(); - for (USHORT i=0; i<nCount; i++) + for (sal_uInt16 i=0; i<nCount; i++) { if ( bIsUndo ) pUndoManager->Undo(0); @@ -779,7 +778,7 @@ void ScTabViewShell::ExecuteUndo(SfxRequest& rReq) if ( bLockPaint ) pDocSh->UnlockPaint(); - GetViewFrame()->GetBindings().InvalidateAll(sal_False); + GetViewFrame()->GetBindings().InvalidateAll(false); } break; } @@ -791,7 +790,7 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet) SfxUndoManager* pUndoManager = pSh->GetUndoManager(); SfxWhichIter aIter(rSet); - USHORT nWhich = aIter.FirstWhich(); + sal_uInt16 nWhich = aIter.FirstWhich(); while ( nWhich ) { switch (nWhich) @@ -803,9 +802,9 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet) if ( pUndoManager ) { List* pList = aStrLst.GetList(); - BOOL bIsUndo = ( nWhich == SID_GETUNDOSTRINGS ); - USHORT nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount(); - for (USHORT i=0; i<nCount; i++) + sal_Bool bIsUndo = ( nWhich == SID_GETUNDOSTRINGS ); + sal_uInt16 nCount = bIsUndo ? pUndoManager->GetUndoActionCount() : pUndoManager->GetRedoActionCount(); + for (sal_uInt16 i=0; i<nCount; i++) pList->Insert( new String( bIsUndo ? pUndoManager->GetUndoActionComment(i) : pUndoManager->GetRedoActionComment(i) ), LIST_APPEND ); @@ -833,11 +832,11 @@ void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq ) SfxBindings& rBindings = GetViewFrame()->GetBindings(); const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - USHORT nSlotId = rReq.GetSlot(); + sal_uInt16 nSlotId = rReq.GetSlot(); switch (nSlotId) { case SID_GRID_VISIBLE: - if ( pArgs && pArgs->GetItemState(nSlotId,TRUE,&pItem) == SFX_ITEM_SET ) + if ( pArgs && pArgs->GetItemState(nSlotId,sal_True,&pItem) == SFX_ITEM_SET ) { aGridOptions.SetGridVisible( ((const SfxBoolItem*)pItem)->GetValue() ); aViewOptions.SetGridOptions(aGridOptions); @@ -846,7 +845,7 @@ void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq ) break; case SID_GRID_USE: - if ( pArgs && pArgs->GetItemState(nSlotId,TRUE,&pItem) == SFX_ITEM_SET ) + if ( pArgs && pArgs->GetItemState(nSlotId,sal_True,&pItem) == SFX_ITEM_SET ) { aGridOptions.SetUseGridSnap( ((const SfxBoolItem*)pItem)->GetValue() ); aViewOptions.SetGridOptions(aGridOptions); @@ -855,7 +854,7 @@ void ScTabViewShell::ExecDrawOpt( SfxRequest& rReq ) break; case SID_HELPLINES_MOVE: - if ( pArgs && pArgs->GetItemState(nSlotId,TRUE,&pItem) == SFX_ITEM_SET ) + if ( pArgs && pArgs->GetItemState(nSlotId,sal_True,&pItem) == SFX_ITEM_SET ) { aViewOptions.SetOption( VOPT_HELPLINES, ((const SfxBoolItem*)pItem)->GetValue() ); rBindings.Invalidate(SID_HELPLINES_MOVE); |