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

convert include/formula/formula.hxx from String to OUString

Change-Id: Id3c1dfa97805dfa3a1978cd264380d5ef4a2287a
üst f32da852
...@@ -120,7 +120,7 @@ namespace formula ...@@ -120,7 +120,7 @@ namespace formula
FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate); FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate);
void SetMeText(const String& _sText); void SetMeText(const String& _sText);
sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/); sal_Bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
void SetEdSelection(); void SetEdSelection();
...@@ -1511,18 +1511,17 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivSt ...@@ -1511,18 +1511,17 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivSt
} // if ( _bUpdate ) } // if ( _bUpdate )
return eMode; return eMode;
} }
sal_Bool FormulaDlg_Impl::CheckMatrix(String& aFormula) sal_Bool FormulaDlg_Impl::CheckMatrix(OUString& aFormula)
{ {
pMEdit->GrabFocus(); pMEdit->GrabFocus();
xub_StrLen nLen = aFormula.Len(); sal_Int32 nLen = aFormula.getLength();
sal_Bool bMatrix = nLen > 3 // Matrix-Formula sal_Bool bMatrix = nLen > 3 // Matrix-Formula
&& aFormula.GetChar(0) == '{' && aFormula[0] == '{'
&& aFormula.GetChar(1) == '=' && aFormula[1] == '='
&& aFormula.GetChar(nLen-1) == '}'; && aFormula[nLen-1] == '}';
if ( bMatrix ) if ( bMatrix )
{ {
aFormula.Erase( 0, 1 ); aFormula = aFormula.copy( 1, aFormula.getLength()-2 );
aFormula.Erase( aFormula.Len()-1, 1);
aBtnMatrix.Check( bMatrix ); aBtnMatrix.Check( bMatrix );
aBtnMatrix.Disable(); aBtnMatrix.Disable();
} // if ( bMatrix ) } // if ( bMatrix )
...@@ -1658,19 +1657,19 @@ FormulaModalDialog::~FormulaModalDialog() ...@@ -1658,19 +1657,19 @@ FormulaModalDialog::~FormulaModalDialog()
{ {
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void FormulaModalDialog::Update(const String& _sExp) void FormulaModalDialog::Update(const OUString& _sExp)
{ {
m_pImpl->Update(_sExp); m_pImpl->Update(_sExp);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void FormulaModalDialog::SetMeText(const String& _sText) void FormulaModalDialog::SetMeText(const OUString& _sText)
{ {
m_pImpl->SetMeText(_sText); m_pImpl->SetMeText(_sText);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool FormulaModalDialog::CheckMatrix(String& aFormula) sal_Bool FormulaModalDialog::CheckMatrix(OUString& aFormula)
{ {
return m_pImpl->CheckMatrix(aFormula); return m_pImpl->CheckMatrix(aFormula);
} }
...@@ -1747,19 +1746,19 @@ FormulaDlg::~FormulaDlg() ...@@ -1747,19 +1746,19 @@ FormulaDlg::~FormulaDlg()
{ {
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void FormulaDlg::Update(const String& _sExp) void FormulaDlg::Update(const OUString& _sExp)
{ {
m_pImpl->Update(_sExp); m_pImpl->Update(_sExp);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void FormulaDlg::SetMeText(const String& _sText) void FormulaDlg::SetMeText(const OUString& _sText)
{ {
m_pImpl->SetMeText(_sText); m_pImpl->SetMeText(_sText);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
FormulaDlgMode FormulaDlg::SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate) FormulaDlgMode FormulaDlg::SetMeText(const OUString& _sText, xub_StrLen PrivStart, xub_StrLen PrivEnd, sal_Bool bMatrix, sal_Bool _bSelect, sal_Bool _bUpdate)
{ {
return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate); return m_pImpl->SetMeText(_sText,PrivStart, PrivEnd,bMatrix,_bSelect,_bUpdate);
} }
...@@ -1769,12 +1768,12 @@ void FormulaDlg::CheckMatrix() ...@@ -1769,12 +1768,12 @@ void FormulaDlg::CheckMatrix()
m_pImpl->aBtnMatrix.Check(); m_pImpl->aBtnMatrix.Check();
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool FormulaDlg::CheckMatrix(String& aFormula) sal_Bool FormulaDlg::CheckMatrix(OUString& aFormula)
{ {
return m_pImpl->CheckMatrix(aFormula); return m_pImpl->CheckMatrix(aFormula);
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
String FormulaDlg::GetMeText() const OUString FormulaDlg::GetMeText() const
{ {
return m_pImpl->pMEdit->GetText(); return m_pImpl->pMEdit->GetText();
} }
...@@ -1846,7 +1845,7 @@ const IFunctionDescription* FormulaDlg::getCurrentFunctionDescription() const ...@@ -1846,7 +1845,7 @@ const IFunctionDescription* FormulaDlg::getCurrentFunctionDescription() const
return m_pImpl->pFuncDesc; return m_pImpl->pFuncDesc;
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
void FormulaDlg::UpdateParaWin(const Selection& _rSelection,const String& _sRefStr) void FormulaDlg::UpdateParaWin(const Selection& _rSelection,const OUString& _sRefStr)
{ {
m_pImpl->UpdateParaWin(_rSelection,_sRefStr); m_pImpl->UpdateParaWin(_rSelection,_sRefStr);
} }
......
...@@ -70,10 +70,10 @@ protected: ...@@ -70,10 +70,10 @@ protected:
void RefInputDoneAfter( sal_Bool bForced = sal_False ); void RefInputDoneAfter( sal_Bool bForced = sal_False );
void SetFocusWin(Window *pWin,const OString& nUniqueId); void SetFocusWin(Window *pWin,const OString& nUniqueId);
void SetMeText(const String& _sText); void SetMeText(const OUString& _sText);
void Update(); void Update();
sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/); sal_Bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
void Update(const String& _sExp); void Update(const OUString& _sExp);
void StoreFormEditData(FormEditData* pData); void StoreFormEditData(FormEditData* pData);
}; };
...@@ -113,19 +113,19 @@ protected: ...@@ -113,19 +113,19 @@ protected:
void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL ); void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL );
void RefInputDoneAfter( sal_Bool bForced = sal_False ); void RefInputDoneAfter( sal_Bool bForced = sal_False );
void SetFocusWin(Window *pWin,const OString& nUniqueId); void SetFocusWin(Window *pWin,const OString& nUniqueId);
void HighlightFunctionParas(const String& aFormula); void HighlightFunctionParas(const OUString& aFormula);
void SetMeText(const String& _sText); void SetMeText(const OUString& _sText);
FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate); FormulaDlgMode SetMeText(const OUString& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd, sal_Bool bMatrix, sal_Bool _bSelect, sal_Bool _bUpdate);
void Update(); void Update();
sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/); sal_Bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
String GetMeText() const; OUString GetMeText() const;
void Update(const String& _sExp); void Update(const OUString& _sExp);
void CheckMatrix(); void CheckMatrix();
void DoEnter(sal_Bool _bOk); void DoEnter(sal_Bool _bOk);
const IFunctionDescription* getCurrentFunctionDescription() const; const IFunctionDescription* getCurrentFunctionDescription() const;
sal_Bool UpdateParaWin(Selection& _rSelection); sal_Bool UpdateParaWin(Selection& _rSelection);
void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr); void UpdateParaWin(const Selection& _rSelection, const OUString& _sRefStr);
RefEdit* GetActiveEdit(); RefEdit* GetActiveEdit();
void SetEdSelection(); void SetEdSelection();
......
...@@ -53,14 +53,14 @@ FormulaDialog::FormulaDialog(Window* pParent ...@@ -53,14 +53,14 @@ FormulaDialog::FormulaDialog(Window* pParent
,m_pAddField(NULL) ,m_pAddField(NULL)
,m_xRowSet(_xRowSet) ,m_xRowSet(_xRowSet)
,m_pEdit(NULL) ,m_pEdit(NULL)
,m_sFormula(OUString("=")) ,m_sFormula("=")
,m_nStart(0) ,m_nStart(0)
,m_nEnd(1) ,m_nEnd(1)
{ {
if ( !_sFormula.isEmpty() ) if ( !_sFormula.isEmpty() )
{ {
if ( _sFormula.getStr()[0] != '=' ) if ( _sFormula[0] != '=' )
m_sFormula += String(_sFormula); m_sFormula += _sFormula;
else else
m_sFormula = _sFormula; m_sFormula = _sFormula;
} }
...@@ -141,9 +141,9 @@ void FormulaDialog::setCurrentFormula(const String& _sReplacement) ...@@ -141,9 +141,9 @@ void FormulaDialog::setCurrentFormula(const String& _sReplacement)
const xub_StrLen nOldLen = m_nEnd - m_nStart; const xub_StrLen nOldLen = m_nEnd - m_nStart;
const xub_StrLen nNewLen = _sReplacement.Len(); const xub_StrLen nNewLen = _sReplacement.Len();
if (nOldLen) if (nOldLen)
m_sFormula.Erase( m_nStart, nOldLen ); m_sFormula = m_sFormula.replaceAt( m_nStart, nOldLen, "" );
if (nNewLen) if (nNewLen)
m_sFormula.Insert( _sReplacement, m_nStart ); m_sFormula = m_sFormula.replaceAt( m_nStart, 0, _sReplacement );
m_nEnd = m_nStart + nNewLen; m_nEnd = m_nStart + nNewLen;
} }
void FormulaDialog::setSelection(xub_StrLen _nStart,xub_StrLen _nEnd) void FormulaDialog::setSelection(xub_StrLen _nStart,xub_StrLen _nEnd)
......
...@@ -47,7 +47,7 @@ class FormulaDialog : public formula::FormulaModalDialog, ...@@ -47,7 +47,7 @@ class FormulaDialog : public formula::FormulaModalDialog,
::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFormulaParser> m_xParser; ::com::sun::star::uno::Reference< ::com::sun::star::report::meta::XFormulaParser> m_xParser;
::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper; ::com::sun::star::uno::Reference< ::com::sun::star::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
formula::RefEdit* m_pEdit; formula::RefEdit* m_pEdit;
String m_sFormula; OUString m_sFormula;
xub_StrLen m_nStart; xub_StrLen m_nStart;
xub_StrLen m_nEnd; xub_StrLen m_nEnd;
......
...@@ -142,9 +142,9 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ...@@ -142,9 +142,9 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
// Formel vorhanden? Dann editieren // Formel vorhanden? Dann editieren
String aFormula; OUString aFormula;
pDoc->GetFormula( nCol, nRow, nTab, aFormula ); pDoc->GetFormula( nCol, nRow, nTab, aFormula );
sal_Bool bEdit = ( aFormula.Len() > 1 ); sal_Bool bEdit = ( aFormula.getLength() > 1 );
sal_Bool bMatrix = false; sal_Bool bMatrix = false;
if ( bEdit ) if ( bEdit )
{ {
...@@ -169,7 +169,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW, ...@@ -169,7 +169,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
if ( !bEdit ) if ( !bEdit )
{ {
OUString aNewFormula('='); OUString aNewFormula('=');
if ( aFormula.Len() > 0 && aFormula.GetChar(0) == '=' ) if ( !aFormula.isEmpty() && aFormula[0] == '=' )
aNewFormula = aFormula; aNewFormula = aFormula;
pScMod->InputReplaceSelection( aNewFormula ); pScMod->InputReplaceSelection( aNewFormula );
......
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