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/miscdlgs/anyrefdg.cxx | |
parent | 99745dbcbb25b61437914c9782475d0b67a4b0bd (diff) | |
parent | ce6308e4fad2281241bf4ca78280eba29f744d43 (diff) |
Merge commit 'ooo/DEV300_m101' into integration/dev300_m101
Diffstat (limited to 'sc/source/ui/miscdlgs/anyrefdg.cxx')
-rw-r--r-- | sc/source/ui/miscdlgs/anyrefdg.cxx | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index c7676c9166c6..2a3e02fa9eeb 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -71,8 +71,8 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi , pAccel( NULL ) , pHiddenMarks(NULL) , nRefTab(0) - , bHighLightRef( FALSE ) - , bAccInserted( FALSE ) + , bHighLightRef( false ) + , bAccInserted( false ) { ScInputOptions aInputOption=SC_MOD()->GetInputOptions(); bEnableColorRef=aInputOption.GetRangeFinder(); @@ -86,14 +86,14 @@ ScFormulaReferenceHelper::~ScFormulaReferenceHelper() // common cleanup for ScAnyRefDlg and ScFormulaDlg is done here HideReference(); - enableInput( TRUE ); + enableInput( sal_True ); ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(); if ( pInputHdl ) pInputHdl->ResetDelayTimer(); // stop the timer for disabling the input line } // ----------------------------------------------------------------------------- -void ScFormulaReferenceHelper::enableInput( BOOL bEnable ) +void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable ) { TypeId aType(TYPE(ScDocShell)); ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType); @@ -115,8 +115,8 @@ void ScFormulaReferenceHelper::enableInput( BOOL bEnable ) Window *pParent=pWin->GetParent(); if(pParent) { - pParent->EnableInput(bEnable,TRUE /* FALSE */); - if(TRUE /*bChilds*/) + pParent->EnableInput(bEnable,sal_True /* sal_False */); + if(sal_True /*bChilds*/) pViewSh->EnableRefInput(bEnable); } } @@ -133,7 +133,7 @@ void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr ) { if( bEnableColorRef ) { - bHighLightRef=TRUE; + bHighLightRef=sal_True; ScViewData* pViewData=ScDocShell::GetViewData(); if ( pViewData ) { @@ -142,7 +142,7 @@ void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr ) ScRangeList aRangeList; - pTabViewShell->DoneRefMode( FALSE ); + pTabViewShell->DoneRefMode( false ); pTabViewShell->ClearHighlightRanges(); if( ParseWithNames( aRangeList, rStr, pDoc ) ) @@ -171,7 +171,7 @@ bool ScFormulaReferenceHelper::ParseWithNames( ScRangeList& rRanges, const Strin ScRange aRange; String aRangeStr( rStr.GetToken( nToken ) ); - USHORT nFlags = aRange.ParseAny( aRangeStr, pDoc, aDetails ); + sal_uInt16 nFlags = aRange.ParseAny( aRangeStr, pDoc, aDetails ); if ( nFlags & SCA_VALID ) { if ( (nFlags & SCA_TAB_3D) == 0 ) @@ -193,7 +193,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr ) { if( /*!pRefEdit &&*/ bEnableColorRef) { - bHighLightRef=TRUE; + bHighLightRef=sal_True; ScViewData* pViewData=ScDocShell::GetViewData(); if ( pViewData && pRefComp.get() ) { @@ -208,17 +208,17 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr ) if(pTabViewShell!=NULL && pScTokA!=NULL) { - pTabViewShell->DoneRefMode( FALSE ); + pTabViewShell->DoneRefMode( false ); pTabViewShell->ClearHighlightRanges(); pScTokA->Reset(); const ScToken* pToken = static_cast<const ScToken*>(pScTokA->GetNextReference()); - USHORT nIndex=0; + sal_uInt16 nIndex=0; while(pToken!=NULL) { - BOOL bDoubleRef=(pToken->GetType()==formula::svDoubleRef); + sal_Bool bDoubleRef=(pToken->GetType()==formula::svDoubleRef); if(pToken->GetType()==formula::svSingleRef || bDoubleRef) @@ -250,7 +250,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr ) } } // ----------------------------------------------------------------------------- -void ScFormulaReferenceHelper::HideReference( BOOL bDoneRefMode ) +void ScFormulaReferenceHelper::HideReference( sal_Bool bDoneRefMode ) { ScViewData* pViewData=ScDocShell::GetViewData(); @@ -260,14 +260,14 @@ void ScFormulaReferenceHelper::HideReference( BOOL bDoneRefMode ) if(pTabViewShell!=NULL) { - // bDoneRefMode is FALSE when called from before SetReference. + // bDoneRefMode is sal_False when called from before SetReference. // In that case, RefMode was just started and must not be ended now. if ( bDoneRefMode ) - pTabViewShell->DoneRefMode( FALSE ); + pTabViewShell->DoneRefMode( false ); pTabViewShell->ClearHighlightRanges(); } - bHighLightRef=FALSE; + bHighLightRef=false; } } // ----------------------------------------------------------------------------- @@ -318,9 +318,9 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit, formula::R const ScRange* pRange = aRangeList.front(); pViewShell->SetTabNo( pRange->aStart.Tab() ); pViewShell->MoveCursorAbs( pRange->aStart.Col(), - pRange->aStart.Row(), SC_FOLLOW_JUMP, FALSE, FALSE ); + pRange->aStart.Row(), SC_FOLLOW_JUMP, false, false ); pViewShell->MoveCursorAbs( pRange->aEnd.Col(), - pRange->aEnd.Row(), SC_FOLLOW_JUMP, TRUE, FALSE ); + pRange->aEnd.Row(), SC_FOLLOW_JUMP, sal_True, false ); m_pDlg->SetReference( *pRange, pDoc ); } } @@ -343,7 +343,7 @@ void ScFormulaReferenceHelper::Init() pRefCell.reset( new ScFormulaCell( pDoc, aCursorPos, rStrExp ) ); pRefComp.reset( new ScCompiler( pDoc, aCursorPos) ); pRefComp->SetGrammar( pDoc->GetGrammar() ); - pRefComp->SetCompileForFAP(TRUE); + pRefComp->SetCompileForFAP(sal_True); nRefTab = nTab; } @@ -360,20 +360,20 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel ) case KEY_ESCAPE: if( pRefEdit ) pRefEdit->GrabFocus(); - m_pDlg->RefInputDone( TRUE ); + m_pDlg->RefInputDone( sal_True ); break; } - return TRUE; + return sal_True; } //---------------------------------------------------------------------------- -void ScFormulaReferenceHelper::RefInputDone( BOOL bForced ) +void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced ) { if ( CanInputDone( bForced ) ) { if (bAccInserted) // Accelerator wieder abschalten { Application::RemoveAccel( pAccel.get() ); - bAccInserted = FALSE; + bAccInserted = false; } // Fenstertitel anpassen @@ -393,8 +393,8 @@ void ScFormulaReferenceHelper::RefInputDone( BOOL bForced ) } // Alle anderen: Show(); - USHORT nChildren = m_pWindow->GetChildCount(); - for ( USHORT i = 0; i < nChildren; i++ ) + sal_uInt16 nChildren = m_pWindow->GetChildCount(); + for ( sal_uInt16 i = 0; i < nChildren; i++ ) if (pHiddenMarks[i]) { m_pWindow->GetChild(i)->GetWindow( WINDOW_CLIENT )->Show(); @@ -420,11 +420,11 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: sNewDialogText.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ": " )); // Alle Elemente ausser EditCell und Button verstecken - USHORT nChildren = m_pWindow->GetChildCount(); - pHiddenMarks = new BOOL [nChildren]; - for (USHORT i = 0; i < nChildren; i++) + sal_uInt16 nChildren = m_pWindow->GetChildCount(); + pHiddenMarks = new sal_Bool [nChildren]; + for (sal_uInt16 i = 0; i < nChildren; i++) { - pHiddenMarks[i] = FALSE; + pHiddenMarks[i] = false; Window* pWin = m_pWindow->GetChild(i); pWin = pWin->GetWindow( WINDOW_CLIENT ); if (pWin == (Window*)pRefEdit) @@ -435,7 +435,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: ; // do nothing else if (pWin->IsVisible()) { - pHiddenMarks[i] = TRUE; + pHiddenMarks[i] = sal_True; pWin->Hide(); } } @@ -487,7 +487,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: pAccel->SetSelectHdl( LINK( this, ScFormulaReferenceHelper, AccelSelectHdl ) ); } Application::InsertAccel( pAccel.get() ); - bAccInserted = TRUE; + bAccInserted = true; } } // ----------------------------------------------------------------------------- @@ -498,11 +498,11 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula if( pRefEdit == pEdit ) // is this the active ref edit field? { pRefEdit->GrabFocus(); // before RefInputDone() - m_pDlg->RefInputDone( TRUE ); // finish ref input + m_pDlg->RefInputDone( sal_True ); // finish ref input } else { - m_pDlg->RefInputDone( TRUE ); // another active ref edit? + m_pDlg->RefInputDone( sal_True ); // another active ref edit? m_pDlg->RefInputStart( pEdit, pButton ); // start ref input // pRefEdit might differ from pEdit after RefInputStart() (i.e. ScFormulaDlg) if( pRefEdit ) @@ -511,11 +511,11 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula } } // ----------------------------------------------------------------------------- -BOOL ScFormulaReferenceHelper::DoClose( USHORT nId ) +sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId ) { SfxApplication* pSfxApp = SFX_APP(); - SetDispatcherLock( FALSE ); //! here and in dtor ? + SetDispatcherLock( false ); //! here and in dtor ? SfxViewFrame* pViewFrm = SfxViewFrame::Current(); if ( pViewFrm && pViewFrm->HasChildWindow(FID_INPUTLINE_STATUS) ) @@ -539,17 +539,17 @@ BOOL ScFormulaReferenceHelper::DoClose( USHORT nId ) if (pMyDisp) pMyViewFrm = pMyDisp->GetFrame(); } - SC_MOD()->SetRefDialog( nId, FALSE, pMyViewFrm ); + SC_MOD()->SetRefDialog( nId, false, pMyViewFrm ); pSfxApp->Broadcast( SfxSimpleHint( FID_KILLEDITVIEW ) ); ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); if ( pScViewShell ) - pScViewShell->UpdateInputHandler(TRUE); + pScViewShell->UpdateInputHandler(sal_True); - return TRUE; + return sal_True; } -void ScFormulaReferenceHelper::SetDispatcherLock( BOOL bLock ) +void ScFormulaReferenceHelper::SetDispatcherLock( sal_Bool bLock ) { // lock / unlock only the dispatchers of Calc documents @@ -576,11 +576,11 @@ void ScFormulaReferenceHelper::SetDispatcherLock( BOOL bLock ) // ----------------------------------------------------------------------------- void ScFormulaReferenceHelper::ViewShellChanged(ScTabViewShell* /* pScViewShell */) { - enableInput( FALSE ); + enableInput( false ); EnableSpreadsheets(); } -void ScFormulaReferenceHelper::EnableSpreadsheets(BOOL bFlag, BOOL bChilds) +void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChilds) { TypeId aType(TYPE(ScDocShell)); ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType); @@ -602,7 +602,7 @@ void ScFormulaReferenceHelper::EnableSpreadsheets(BOOL bFlag, BOOL bChilds) Window *pParent=pWin->GetParent(); if(pParent) { - pParent->EnableInput(bFlag,FALSE); + pParent->EnableInput(bFlag,false); if(bChilds) pViewSh->EnableRefInput(bFlag); } @@ -670,7 +670,7 @@ void lcl_HideAllReferences() //---------------------------------------------------------------------------- ScRefHandler::ScRefHandler( Window &rWindow, SfxBindings* pB/*, SfxChildWindow* pCW, - Window* pParent, USHORT nResId*/, bool bBindRef ) + Window* pParent, sal_uInt16 nResId*/, bool bBindRef ) : //SfxModelessDialog ( pB, pCW, pParent, ScResId( nResId ) ), m_rWindow( rWindow ), m_bInRefMode( false ), @@ -679,7 +679,7 @@ ScRefHandler::ScRefHandler( Window &rWindow, SfxBindings* pB/*, SfxChildWindow* pActiveWin(NULL) { m_aHelper.SetWindow(/*this*/&m_rWindow); - if(m_rWindow.GetHelpId()==0) //Hack, da im SfxModelessDialog die HelpId + if(m_rWindow.GetHelpId().getLength()==0) //Hack, da im SfxModelessDialog die HelpId m_rWindow.SetHelpId(m_rWindow.GetUniqueId()); //fuer einen ModelessDialog entfernt und //in eine UniqueId gewandelt wird, machen //wir das an dieser Stelle rueckgaengig. @@ -711,7 +711,7 @@ bool ScRefHandler::EnterRefMode() { pScViewShell = PTR_CAST( ScTabViewShell, pMyViewFrm->GetViewShell() ); if( pScViewShell ) - pScViewShell->UpdateInputHandler(TRUE); + pScViewShell->UpdateInputHandler(sal_True); pParentDoc = pMyViewFrm->GetObjectShell(); } } @@ -728,13 +728,13 @@ bool ScRefHandler::EnterRefMode() if ( pInputHdl ) pInputHdl->NotifyChange( NULL ); - m_aHelper.enableInput( FALSE ); + m_aHelper.enableInput( false ); m_aHelper.EnableSpreadsheets(); m_aHelper.Init(); - m_aHelper.SetDispatcherLock( TRUE ); + m_aHelper.SetDispatcherLock( true ); return m_bInRefMode = true; } @@ -753,12 +753,12 @@ bool ScRefHandler::LeaveRefMode() lcl_HideAllReferences(); if( Dialog *pDlg = dynamic_cast<Dialog*>( static_cast<Window*>(*this) ) ) - pDlg->SetModalInputMode(FALSE); - SetDispatcherLock( FALSE ); //! here and in DoClose ? + pDlg->SetModalInputMode(false); + SetDispatcherLock( false ); //! here and in DoClose ? ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); if( pScViewShell ) - pScViewShell->UpdateInputHandler(TRUE); + pScViewShell->UpdateInputHandler(sal_True); lcl_InvalidateWindows(); @@ -798,7 +798,7 @@ void ScRefHandler::SwitchToDocument() //---------------------------------------------------------------------------- -BOOL ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0 +sal_Bool ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be 0 { // default: allow only same document (overridden in function dialog) String aCmpName; @@ -811,20 +811,20 @@ BOOL ScRefHandler::IsDocAllowed(SfxObjectShell* pDocSh) const // pDocSh may be //---------------------------------------------------------------------------- -BOOL ScRefHandler::IsRefInputMode() const +sal_Bool ScRefHandler::IsRefInputMode() const { return m_rWindow.IsVisible(); // nur wer sichtbar ist kann auch Referenzen bekommen } //---------------------------------------------------------------------------- -BOOL ScRefHandler::DoClose( USHORT nId ) +sal_Bool ScRefHandler::DoClose( sal_uInt16 nId ) { m_aHelper.DoClose(nId); - return TRUE; + return sal_True; } -void ScRefHandler::SetDispatcherLock( BOOL bLock ) +void ScRefHandler::SetDispatcherLock( sal_Bool bLock ) { m_aHelper.SetDispatcherLock( bLock ); } @@ -845,11 +845,11 @@ void ScRefHandler::AddRefEntry() //---------------------------------------------------------------------------- -BOOL ScRefHandler::IsTableLocked() const +sal_Bool ScRefHandler::IsTableLocked() const { // per Default kann bei Referenzeingabe auch die Tabelle umgeschaltet werden - return FALSE; + return false; } //---------------------------------------------------------------------------- @@ -881,7 +881,7 @@ INTRODUCE_TEMPLATE long ScRefHdlrImplBase<TWindow,bBindRef>::PreNotify( NotifyEv {\ if( bBindRef || m_bInRefMode )\ {\ - USHORT nSwitch=rNEvt.GetType();\ + sal_uInt16 nSwitch=rNEvt.GetType();\ if(nSwitch==EVENT_GETFOCUS)\ {\ pActiveWin=rNEvt.GetWindow();\ @@ -901,15 +901,15 @@ INTRODUCE_TEMPLATE void ScRefHdlrImplBase<TWindow,bBindRef>::StateChanged( State {\ if(m_rWindow.IsVisible())\ {\ - m_aHelper.enableInput( FALSE );\ + m_aHelper.enableInput( false );\ m_aHelper.EnableSpreadsheets();\ - m_aHelper.SetDispatcherLock( TRUE );\ + m_aHelper.SetDispatcherLock( sal_True );\ aTimer.Start();\ }\ else\ {\ - m_aHelper.enableInput( TRUE );\ - m_aHelper.SetDispatcherLock( FALSE ); /*//! here and in DoClose ?*/\ + m_aHelper.enableInput( sal_True );\ + m_aHelper.SetDispatcherLock( false ); /*//! here and in DoClose ?*/\ }\ }\ } @@ -933,7 +933,7 @@ bool ScRefHandler::ParseWithNames( ScRangeList& rRanges, const String& rStr, ScD return m_aHelper.ParseWithNames( rRanges, rStr, pDoc ); } // ----------------------------------------------------------------------------- -void ScRefHandler::HideReference( BOOL bDoneRefMode ) +void ScRefHandler::HideReference( sal_Bool bDoneRefMode ) { m_aHelper.HideReference( bDoneRefMode ); } @@ -948,7 +948,7 @@ void ScRefHandler::ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pB m_aHelper.ReleaseFocus( pEdit,pButton ); } //---------------------------------------------------------------------------- -void ScRefHandler::RefInputDone( BOOL bForced ) +void ScRefHandler::RefInputDone( sal_Bool bForced ) { m_aHelper.RefInputDone( bForced ); } |