Kaydet (Commit) 8fb84ee6 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

sal_Bool to bool in anyrefdg.[ch]xx

Change-Id: I4efa09c0185e7825d5b705ca0171f52b8aae17df
üst d342c9be
...@@ -62,7 +62,7 @@ class ScFormulaReferenceHelper ...@@ -62,7 +62,7 @@ class ScFormulaReferenceHelper
SfxBindings* m_pBindings; SfxBindings* m_pBindings;
::std::auto_ptr<Accelerator> ::std::auto_ptr<Accelerator>
pAccel; // for Enter/Escape pAccel; // for Enter/Escape
sal_Bool* pHiddenMarks; // Mark field for hidden Controls bool* pHiddenMarks; // Mark field for hidden Controls
SCTAB nRefTab; // used for ShowReference SCTAB nRefTab; // used for ShowReference
String sOldDialogText; // Original title of the dialog window String sOldDialogText; // Original title of the dialog window
...@@ -72,9 +72,9 @@ class ScFormulaReferenceHelper ...@@ -72,9 +72,9 @@ class ScFormulaReferenceHelper
Point aOldButtonPos; // Original position of the button Point aOldButtonPos; // Original position of the button
Window* mpOldEditParent; // Original parent of the edit field and the button Window* mpOldEditParent; // Original parent of the edit field and the button
sal_Bool bEnableColorRef; bool bEnableColorRef;
sal_Bool bHighLightRef; bool bHighLightRef;
sal_Bool bAccInserted; bool bAccInserted;
DECL_LINK( AccelSelectHdl, Accelerator* ); DECL_LINK( AccelSelectHdl, Accelerator* );
...@@ -89,25 +89,25 @@ public: ...@@ -89,25 +89,25 @@ public:
void ShowReference( const XubString& rStr ); void ShowReference( const XubString& rStr );
void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); void ReleaseFocus( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
void HideReference( sal_Bool bDoneRefMode = sal_True ); void HideReference( bool bDoneRefMode = true );
void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); void RefInputStart( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
void RefInputDone( sal_Bool bForced = false ); void RefInputDone( bool bForced = false );
void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL ); void ToggleCollapsed( formula::RefEdit* pEdit, formula::RefButton* pButton = NULL );
inline void SetWindow(Window* _pWindow) { m_pWindow = _pWindow; } inline void SetWindow(Window* _pWindow) { m_pWindow = _pWindow; }
sal_Bool DoClose( sal_uInt16 nId ); bool DoClose( sal_uInt16 nId );
void SetDispatcherLock( sal_Bool bLock ); void SetDispatcherLock( bool bLock );
void EnableSpreadsheets( sal_Bool bFlag = sal_True, sal_Bool bChildren = sal_True ); void EnableSpreadsheets( bool bFlag = true, bool bChildren = true );
void ViewShellChanged( ScTabViewShell* pScViewShell ); void ViewShellChanged( ScTabViewShell* pScViewShell );
static void enableInput(sal_Bool _bInput); static void enableInput(bool _bInput);
protected: protected:
Window * GetWindow(){ return m_pWindow; } Window * GetWindow(){ return m_pWindow; }
public: public:
bool CanInputStart( const formula::RefEdit *pEdit ){ return !!pEdit; } bool CanInputStart( const formula::RefEdit *pEdit ){ return !!pEdit; }
bool CanInputDone( sal_Bool bForced ){ return pRefEdit && (bForced || !pRefBtn); } bool CanInputDone( bool bForced ){ return pRefEdit && (bForced || !pRefBtn); }
}; };
//============================================================================ //============================================================================
...@@ -139,7 +139,7 @@ private: ...@@ -139,7 +139,7 @@ private:
protected: protected:
virtual sal_Bool DoClose( sal_uInt16 nId ); virtual sal_Bool DoClose( sal_uInt16 nId );
void SetDispatcherLock( sal_Bool bLock ); void SetDispatcherLock( bool bLock );
//Overwrite TWindow will implemented by ScRefHdlrImplBase //Overwrite TWindow will implemented by ScRefHdlrImplBase
//virtual long PreNotify( NotifyEvent& rNEvt ); //virtual long PreNotify( NotifyEvent& rNEvt );
......
...@@ -76,14 +76,14 @@ ScFormulaReferenceHelper::~ScFormulaReferenceHelper() ...@@ -76,14 +76,14 @@ ScFormulaReferenceHelper::~ScFormulaReferenceHelper()
// common cleanup for ScAnyRefDlg and ScFormulaDlg is done here // common cleanup for ScAnyRefDlg and ScFormulaDlg is done here
HideReference(); HideReference();
enableInput( sal_True ); enableInput( true );
ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(); ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl();
if ( pInputHdl ) if ( pInputHdl )
pInputHdl->ResetDelayTimer(); // stop the timer for disabling the input line pInputHdl->ResetDelayTimer(); // stop the timer for disabling the input line
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable ) void ScFormulaReferenceHelper::enableInput( bool bEnable )
{ {
TypeId aType(TYPE(ScDocShell)); TypeId aType(TYPE(ScDocShell));
ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType); ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
...@@ -105,8 +105,8 @@ void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable ) ...@@ -105,8 +105,8 @@ void ScFormulaReferenceHelper::enableInput( sal_Bool bEnable )
Window *pParent=pWin->GetParent(); Window *pParent=pWin->GetParent();
if(pParent) if(pParent)
{ {
pParent->EnableInput(bEnable,sal_True /* sal_False */); pParent->EnableInput(bEnable,true /* sal_False */);
if(sal_True /*bChildren*/) if(true /*bChildren*/)
pViewSh->EnableRefInput(bEnable); pViewSh->EnableRefInput(bEnable);
} }
} }
...@@ -123,7 +123,7 @@ void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr ) ...@@ -123,7 +123,7 @@ void ScFormulaReferenceHelper::ShowSimpleReference( const XubString& rStr )
{ {
if( bEnableColorRef ) if( bEnableColorRef )
{ {
bHighLightRef=sal_True; bHighLightRef=true;
ScViewData* pViewData=ScDocShell::GetViewData(); ScViewData* pViewData=ScDocShell::GetViewData();
if ( pViewData ) if ( pViewData )
{ {
...@@ -183,7 +183,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr ) ...@@ -183,7 +183,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr )
{ {
if( /*!pRefEdit &&*/ bEnableColorRef) if( /*!pRefEdit &&*/ bEnableColorRef)
{ {
bHighLightRef=sal_True; bHighLightRef=true;
ScViewData* pViewData=ScDocShell::GetViewData(); ScViewData* pViewData=ScDocShell::GetViewData();
if ( pViewData && pRefComp.get() ) if ( pViewData && pRefComp.get() )
{ {
...@@ -208,7 +208,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr ) ...@@ -208,7 +208,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr )
while(pToken!=NULL) while(pToken!=NULL)
{ {
sal_Bool bDoubleRef=(pToken->GetType()==formula::svDoubleRef); bool bDoubleRef=(pToken->GetType()==formula::svDoubleRef);
if(pToken->GetType()==formula::svSingleRef || bDoubleRef) if(pToken->GetType()==formula::svSingleRef || bDoubleRef)
...@@ -240,7 +240,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr ) ...@@ -240,7 +240,7 @@ void ScFormulaReferenceHelper::ShowFormulaReference( const XubString& rStr )
} }
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void ScFormulaReferenceHelper::HideReference( sal_Bool bDoneRefMode ) void ScFormulaReferenceHelper::HideReference( bool bDoneRefMode )
{ {
ScViewData* pViewData=ScDocShell::GetViewData(); ScViewData* pViewData=ScDocShell::GetViewData();
...@@ -310,7 +310,7 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit, formula::R ...@@ -310,7 +310,7 @@ void ScFormulaReferenceHelper::ReleaseFocus( formula::RefEdit* pEdit, formula::R
pViewShell->MoveCursorAbs( pRange->aStart.Col(), 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(), pViewShell->MoveCursorAbs( pRange->aEnd.Col(),
pRange->aEnd.Row(), SC_FOLLOW_JUMP, sal_True, false ); pRange->aEnd.Row(), SC_FOLLOW_JUMP, true, false );
m_pDlg->SetReference( *pRange, pDoc ); m_pDlg->SetReference( *pRange, pDoc );
} }
} }
...@@ -333,7 +333,7 @@ void ScFormulaReferenceHelper::Init() ...@@ -333,7 +333,7 @@ void ScFormulaReferenceHelper::Init()
pRefCell.reset( new ScFormulaCell( pDoc, aCursorPos, rStrExp ) ); pRefCell.reset( new ScFormulaCell( pDoc, aCursorPos, rStrExp ) );
pRefComp.reset( new ScCompiler( pDoc, aCursorPos) ); pRefComp.reset( new ScCompiler( pDoc, aCursorPos) );
pRefComp->SetGrammar( pDoc->GetGrammar() ); pRefComp->SetGrammar( pDoc->GetGrammar() );
pRefComp->SetCompileForFAP(sal_True); pRefComp->SetCompileForFAP(true);
nRefTab = nTab; nRefTab = nTab;
} }
...@@ -350,13 +350,13 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel ) ...@@ -350,13 +350,13 @@ IMPL_LINK( ScFormulaReferenceHelper, AccelSelectHdl, Accelerator *, pSelAccel )
case KEY_ESCAPE: case KEY_ESCAPE:
if( pRefEdit ) if( pRefEdit )
pRefEdit->GrabFocus(); pRefEdit->GrabFocus();
m_pDlg->RefInputDone( sal_True ); m_pDlg->RefInputDone( true );
break; break;
} }
return sal_True; return true;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void ScFormulaReferenceHelper::RefInputDone( sal_Bool bForced ) void ScFormulaReferenceHelper::RefInputDone( bool bForced )
{ {
if ( CanInputDone( bForced ) ) if ( CanInputDone( bForced ) )
{ {
...@@ -428,7 +428,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: ...@@ -428,7 +428,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
// Alle Elemente ausser EditCell und Button verstecken // Alle Elemente ausser EditCell und Button verstecken
sal_uInt16 nChildren = m_pWindow->GetChildCount(); sal_uInt16 nChildren = m_pWindow->GetChildCount();
pHiddenMarks = new sal_Bool [nChildren]; pHiddenMarks = new bool [nChildren];
for (sal_uInt16 i = 0; i < nChildren; i++) for (sal_uInt16 i = 0; i < nChildren; i++)
{ {
pHiddenMarks[i] = false; pHiddenMarks[i] = false;
...@@ -442,7 +442,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula:: ...@@ -442,7 +442,7 @@ void ScFormulaReferenceHelper::RefInputStart( formula::RefEdit* pEdit, formula::
; // do nothing ; // do nothing
else if (pWin->IsVisible()) else if (pWin->IsVisible())
{ {
pHiddenMarks[i] = sal_True; pHiddenMarks[i] = true;
pWin->Hide(); pWin->Hide();
} }
} }
...@@ -498,11 +498,11 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula ...@@ -498,11 +498,11 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula
if( pRefEdit == pEdit ) // is this the active ref edit field? if( pRefEdit == pEdit ) // is this the active ref edit field?
{ {
pRefEdit->GrabFocus(); // before RefInputDone() pRefEdit->GrabFocus(); // before RefInputDone()
m_pDlg->RefInputDone( sal_True ); // finish ref input m_pDlg->RefInputDone( true ); // finish ref input
} }
else else
{ {
m_pDlg->RefInputDone( sal_True ); // another active ref edit? m_pDlg->RefInputDone( true ); // another active ref edit?
m_pDlg->RefInputStart( pEdit, pButton ); // start ref input m_pDlg->RefInputStart( pEdit, pButton ); // start ref input
// pRefEdit might differ from pEdit after RefInputStart() (i.e. ScFormulaDlg) // pRefEdit might differ from pEdit after RefInputStart() (i.e. ScFormulaDlg)
if( pRefEdit ) if( pRefEdit )
...@@ -511,7 +511,7 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula ...@@ -511,7 +511,7 @@ void ScFormulaReferenceHelper::ToggleCollapsed( formula::RefEdit* pEdit, formula
} }
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId ) bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
{ {
SfxApplication* pSfxApp = SFX_APP(); SfxApplication* pSfxApp = SFX_APP();
...@@ -545,11 +545,11 @@ sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId ) ...@@ -545,11 +545,11 @@ sal_Bool ScFormulaReferenceHelper::DoClose( sal_uInt16 nId )
ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell(); ScTabViewShell* pScViewShell = ScTabViewShell::GetActiveViewShell();
if ( pScViewShell ) if ( pScViewShell )
pScViewShell->UpdateInputHandler(sal_True); pScViewShell->UpdateInputHandler(true);
return sal_True; return true;
} }
void ScFormulaReferenceHelper::SetDispatcherLock( sal_Bool bLock ) void ScFormulaReferenceHelper::SetDispatcherLock( bool bLock )
{ {
// lock / unlock only the dispatchers of Calc documents // lock / unlock only the dispatchers of Calc documents
...@@ -580,7 +580,7 @@ void ScFormulaReferenceHelper::ViewShellChanged(ScTabViewShell* /* pScViewShell ...@@ -580,7 +580,7 @@ void ScFormulaReferenceHelper::ViewShellChanged(ScTabViewShell* /* pScViewShell
EnableSpreadsheets(); EnableSpreadsheets();
} }
void ScFormulaReferenceHelper::EnableSpreadsheets(sal_Bool bFlag, sal_Bool bChildren) void ScFormulaReferenceHelper::EnableSpreadsheets(bool bFlag, bool bChildren)
{ {
TypeId aType(TYPE(ScDocShell)); TypeId aType(TYPE(ScDocShell));
ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType); ScDocShell* pDocShell = (ScDocShell*)SfxObjectShell::GetFirst(&aType);
...@@ -824,7 +824,7 @@ sal_Bool ScRefHandler::DoClose( sal_uInt16 nId ) ...@@ -824,7 +824,7 @@ sal_Bool ScRefHandler::DoClose( sal_uInt16 nId )
return sal_True; return sal_True;
} }
void ScRefHandler::SetDispatcherLock( sal_Bool bLock ) void ScRefHandler::SetDispatcherLock( bool bLock )
{ {
m_aHelper.SetDispatcherLock( bLock ); m_aHelper.SetDispatcherLock( bLock );
} }
......
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