Kaydet (Commit) 9c0c5bc5 authored tarafından Noel Grandin's avatar Noel Grandin

convert FormulaDlgMode to scoped enum

and drop unused ARGS value

Change-Id: I9b9d0c9ea64a2174759dcf6406bdf6cd5be5862a
Reviewed-on: https://gerrit.libreoffice.org/63892
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 49b1107b
...@@ -150,8 +150,6 @@ include/editeng/borderline.hxx:128 ...@@ -150,8 +150,6 @@ include/editeng/borderline.hxx:128
enum SvxBorderLineStyle BORDER_LINE_STYLE_MAX enum SvxBorderLineStyle BORDER_LINE_STYLE_MAX
include/editeng/editdata.hxx:41 include/editeng/editdata.hxx:41
enum EESpellState LanguageNotInstalled enum EESpellState LanguageNotInstalled
include/formula/formula.hxx:52
enum formula::FormulaDlgMode FORMULA_FORMDLG_ARGS
include/i18nutil/transliteration.hxx:45 include/i18nutil/transliteration.hxx:45
enum TransliterationFlags NumToTextLower_zh_CN enum TransliterationFlags NumToTextLower_zh_CN
include/i18nutil/transliteration.hxx:47 include/i18nutil/transliteration.hxx:47
......
...@@ -1535,7 +1535,7 @@ include/editeng/svxrtf.hxx:223 ...@@ -1535,7 +1535,7 @@ include/editeng/svxrtf.hxx:223
include/filter/msfilter/msdffimp.hxx:377 include/filter/msfilter/msdffimp.hxx:377
enum DffSeekToContentMode SEEK_FROM_CURRENT enum DffSeekToContentMode SEEK_FROM_CURRENT
include/formula/formula.hxx:52 include/formula/formula.hxx:52
enum formula::FormulaDlgMode FORMULA_FORMDLG_EDIT enum formula::FormulaDlgMode FormulaDlgMode::Edit
include/formula/tokenarray.hxx:60 include/formula/tokenarray.hxx:60
enum ScRecalcMode ONLOAD_MUST enum ScRecalcMode ONLOAD_MUST
include/formula/tokenarray.hxx:62 include/formula/tokenarray.hxx:62
......
...@@ -368,9 +368,9 @@ void FormulaDlg_Impl::StoreFormEditData(FormEditData* pData) ...@@ -368,9 +368,9 @@ void FormulaDlg_Impl::StoreFormEditData(FormEditData* pData)
pData->SetSelection(m_pMEdit->GetSelection()); pData->SetSelection(m_pMEdit->GetSelection());
if (m_pTabCtrl->GetCurPageId() == TP_FUNCTION) if (m_pTabCtrl->GetCurPageId() == TP_FUNCTION)
pData->SetMode( sal_uInt16(FORMULA_FORMDLG_FORMULA) ); pData->SetMode( FormulaDlgMode::Formula );
else else
pData->SetMode( sal_uInt16(FORMULA_FORMDLG_EDIT) ); pData->SetMode( FormulaDlgMode::Edit );
pData->SetUndoStr(m_pMEdit->GetText()); pData->SetUndoStr(m_pMEdit->GetText());
pData->SetMatrixFlag(m_pBtnMatrix->IsChecked()); pData->SetMatrixFlag(m_pBtnMatrix->IsChecked());
} }
...@@ -1309,7 +1309,7 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin&, rPtr, void ) ...@@ -1309,7 +1309,7 @@ IMPL_LINK( FormulaDlg_Impl, FxHdl, ParaWin&, rPtr, void )
sal_Int32 n1 = m_aFormulaHelper.GetArgStart( aFormula, nFormulaStrPos, nEdFocus + pData->GetOffset() ); sal_Int32 n1 = m_aFormulaHelper.GetArgStart( aFormula, nFormulaStrPos, nEdFocus + pData->GetOffset() );
pData->SaveValues(); pData->SaveValues();
pData->SetMode( sal_uInt16(FORMULA_FORMDLG_FORMULA) ); pData->SetMode( FormulaDlgMode::Formula );
pData->SetFStart( n1 ); pData->SetFStart( n1 );
pData->SetUndoStr( aUndoStr ); pData->SetUndoStr( aUndoStr );
ClearAllParas(); ClearAllParas();
...@@ -1582,7 +1582,7 @@ void FormulaDlg_Impl::Update() ...@@ -1582,7 +1582,7 @@ void FormulaDlg_Impl::Update()
UpdateTokenArray(sExpression); UpdateTokenArray(sExpression);
FormulaCursorHdl(*m_pMEFormula); FormulaCursorHdl(*m_pMEFormula);
CalcStruct(sExpression); CalcStruct(sExpression);
if (pData->GetMode() == FORMULA_FORMDLG_FORMULA) if (pData->GetMode() == FormulaDlgMode::Formula)
m_pTabCtrl->SetCurPageId(TP_FUNCTION); m_pTabCtrl->SetCurPageId(TP_FUNCTION);
else else
m_pTabCtrl->SetCurPageId(TP_STRUCT); m_pTabCtrl->SetCurPageId(TP_STRUCT);
...@@ -1606,7 +1606,7 @@ void FormulaDlg_Impl::SetMeText(const OUString& _sText) ...@@ -1606,7 +1606,7 @@ void FormulaDlg_Impl::SetMeText(const OUString& _sText)
FormulaDlgMode FormulaDlg_Impl::SetMeText( const OUString& _sText, sal_Int32 PrivStart, sal_Int32 PrivEnd, bool bMatrix, bool _bSelect, bool _bUpdate) FormulaDlgMode FormulaDlg_Impl::SetMeText( const OUString& _sText, sal_Int32 PrivStart, sal_Int32 PrivEnd, bool bMatrix, bool _bSelect, bool _bUpdate)
{ {
FormulaDlgMode eMode = FORMULA_FORMDLG_FORMULA; FormulaDlgMode eMode = FormulaDlgMode::Formula;
if (!m_bEditFlag) if (!m_bEditFlag)
m_pMEdit->SetText(_sText); m_pMEdit->SetText(_sText);
...@@ -1617,7 +1617,7 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText( const OUString& _sText, sal_Int32 Pri ...@@ -1617,7 +1617,7 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText( const OUString& _sText, sal_Int32 Pri
m_pMEFormula->UpdateOldSel(); m_pMEFormula->UpdateOldSel();
m_pMEdit->Invalidate(); m_pMEdit->Invalidate();
m_pHelper->showReference(m_pMEdit->GetSelected()); m_pHelper->showReference(m_pMEdit->GetSelected());
eMode = FORMULA_FORMDLG_EDIT; eMode = FormulaDlgMode::Edit;
m_pBtnMatrix->Check( bMatrix ); m_pBtnMatrix->Check( bMatrix );
} // if ( _bUpdate ) } // if ( _bUpdate )
...@@ -1951,7 +1951,7 @@ void FormEditData::SaveValues() ...@@ -1951,7 +1951,7 @@ void FormEditData::SaveValues()
void FormEditData::Reset() void FormEditData::Reset()
{ {
nMode = 0; nMode = FormulaDlgMode::Formula;
nFStart = 0; nFStart = 0;
nOffset = 0; nOffset = 0;
bMatrix = false; bMatrix = false;
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
namespace formula namespace formula
{ {
enum class FormulaDlgMode;
class FORMULA_DLLPUBLIC FormEditData class FORMULA_DLLPUBLIC FormEditData
{ {
public: public:
...@@ -37,7 +39,7 @@ public: ...@@ -37,7 +39,7 @@ public:
virtual void SaveValues(); virtual void SaveValues();
sal_uInt16 GetMode() const { return nMode; } FormulaDlgMode GetMode() const { return nMode; }
sal_Int32 GetFStart() const { return nFStart; } sal_Int32 GetFStart() const { return nFStart; }
sal_uInt16 GetOffset() const { return nOffset; } sal_uInt16 GetOffset() const { return nOffset; }
const OUString& GetUndoStr() const { return aUndoStr; } const OUString& GetUndoStr() const { return aUndoStr; }
...@@ -45,7 +47,7 @@ public: ...@@ -45,7 +47,7 @@ public:
const VclPtr<vcl::Window>& GetFocusWindow()const { return xFocusWin; } const VclPtr<vcl::Window>& GetFocusWindow()const { return xFocusWin; }
const Selection& GetSelection()const { return aSelection;} const Selection& GetSelection()const { return aSelection;}
void SetMode( sal_uInt16 nNew ) { nMode = nNew; } void SetMode( FormulaDlgMode nNew ) { nMode = nNew; }
void SetFStart( sal_Int32 nNew ) { nFStart = nNew; } void SetFStart( sal_Int32 nNew ) { nFStart = nNew; }
void SetOffset( sal_uInt16 nNew ) { nOffset = nNew; } void SetOffset( sal_uInt16 nNew ) { nOffset = nNew; }
void SetUndoStr( const OUString& rNew ) { aUndoStr = rNew; } void SetUndoStr( const OUString& rNew ) { aUndoStr = rNew; }
...@@ -58,7 +60,7 @@ protected: ...@@ -58,7 +60,7 @@ protected:
FormEditData& operator=( const FormEditData& r ); FormEditData& operator=( const FormEditData& r );
private: private:
sal_uInt16 nMode; // enum ScFormulaDlgMode FormulaDlgMode nMode;
sal_Int32 nFStart; sal_Int32 nFStart;
sal_uInt16 nOffset; sal_uInt16 nOffset;
OUString aUndoStr; OUString aUndoStr;
......
...@@ -49,7 +49,7 @@ namespace formula ...@@ -49,7 +49,7 @@ namespace formula
#define STRUCT_FOLDER 2 #define STRUCT_FOLDER 2
#define STRUCT_ERROR 3 #define STRUCT_ERROR 3
enum FormulaDlgMode { FORMULA_FORMDLG_FORMULA, FORMULA_FORMDLG_ARGS, FORMULA_FORMDLG_EDIT }; enum class FormulaDlgMode { Formula, Edit };
class FormulaDlg_Impl; class FormulaDlg_Impl;
......
...@@ -130,7 +130,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ...@@ -130,7 +130,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
OSL_ENSURE(pData,"FormEditData not available"); OSL_ENSURE(pData,"FormEditData not available");
formula::FormulaDlgMode eMode = FORMULA_FORMDLG_FORMULA; // default... formula::FormulaDlgMode eMode = FormulaDlgMode::Formula; // default...
// edit if formula exists // edit if formula exists
...@@ -173,7 +173,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ...@@ -173,7 +173,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
pData->SetFStart( 1 ); // after "=" pData->SetFStart( 1 ); // after "="
} }
pData->SetMode( static_cast<sal_uInt16>(eMode) ); pData->SetMode( eMode );
OUString rStrExp = GetMeText(); OUString rStrExp = GetMeText();
Update(rStrExp); Update(rStrExp);
......
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