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