summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-11 13:55:05 +0200
committerNoel Grandin <noel@peralex.com>2013-09-17 08:04:41 +0200
commitf733ca910026daa2232f2e2de3394bd36134dd78 (patch)
tree35103115cb557912882c5cfd49139e28eb2b924b
parentf32da852f535bdaa04617da4ec56a923b530c344 (diff)
convert include/formula/formula.hxx from String to OUString
Change-Id: Id3c1dfa97805dfa3a1978cd264380d5ef4a2287a
-rw-r--r--formula/source/ui/dlg/formula.cxx33
-rw-r--r--include/formula/formula.hxx22
-rw-r--r--reportdesign/source/ui/dlg/Formula.cxx10
-rw-r--r--reportdesign/source/ui/inc/Formula.hxx2
-rw-r--r--sc/source/ui/formdlg/formula.cxx6
5 files changed, 36 insertions, 37 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 920338878c6f..e30fe609daa0 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -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);
void SetMeText(const String& _sText);
- sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
+ sal_Bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
void SetEdSelection();
@@ -1511,18 +1511,17 @@ FormulaDlgMode FormulaDlg_Impl::SetMeText(const String& _sText,xub_StrLen PrivSt
} // if ( _bUpdate )
return eMode;
}
-sal_Bool FormulaDlg_Impl::CheckMatrix(String& aFormula)
+sal_Bool FormulaDlg_Impl::CheckMatrix(OUString& aFormula)
{
pMEdit->GrabFocus();
- xub_StrLen nLen = aFormula.Len();
+ sal_Int32 nLen = aFormula.getLength();
sal_Bool bMatrix = nLen > 3 // Matrix-Formula
- && aFormula.GetChar(0) == '{'
- && aFormula.GetChar(1) == '='
- && aFormula.GetChar(nLen-1) == '}';
+ && aFormula[0] == '{'
+ && aFormula[1] == '='
+ && aFormula[nLen-1] == '}';
if ( bMatrix )
{
- aFormula.Erase( 0, 1 );
- aFormula.Erase( aFormula.Len()-1, 1);
+ aFormula = aFormula.copy( 1, aFormula.getLength()-2 );
aBtnMatrix.Check( bMatrix );
aBtnMatrix.Disable();
} // if ( bMatrix )
@@ -1658,19 +1657,19 @@ FormulaModalDialog::~FormulaModalDialog()
{
}
// -----------------------------------------------------------------------------
-void FormulaModalDialog::Update(const String& _sExp)
+void FormulaModalDialog::Update(const OUString& _sExp)
{
m_pImpl->Update(_sExp);
}
// -----------------------------------------------------------------------------
-void FormulaModalDialog::SetMeText(const String& _sText)
+void FormulaModalDialog::SetMeText(const OUString& _sText)
{
m_pImpl->SetMeText(_sText);
}
// -----------------------------------------------------------------------------
-sal_Bool FormulaModalDialog::CheckMatrix(String& aFormula)
+sal_Bool FormulaModalDialog::CheckMatrix(OUString& aFormula)
{
return m_pImpl->CheckMatrix(aFormula);
}
@@ -1747,19 +1746,19 @@ FormulaDlg::~FormulaDlg()
{
}
// -----------------------------------------------------------------------------
-void FormulaDlg::Update(const String& _sExp)
+void FormulaDlg::Update(const OUString& _sExp)
{
m_pImpl->Update(_sExp);
}
// -----------------------------------------------------------------------------
-void FormulaDlg::SetMeText(const String& _sText)
+void FormulaDlg::SetMeText(const OUString& _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);
}
@@ -1769,12 +1768,12 @@ void FormulaDlg::CheckMatrix()
m_pImpl->aBtnMatrix.Check();
}
// -----------------------------------------------------------------------------
-sal_Bool FormulaDlg::CheckMatrix(String& aFormula)
+sal_Bool FormulaDlg::CheckMatrix(OUString& aFormula)
{
return m_pImpl->CheckMatrix(aFormula);
}
// -----------------------------------------------------------------------------
-String FormulaDlg::GetMeText() const
+OUString FormulaDlg::GetMeText() const
{
return m_pImpl->pMEdit->GetText();
}
@@ -1846,7 +1845,7 @@ const IFunctionDescription* FormulaDlg::getCurrentFunctionDescription() const
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);
}
diff --git a/include/formula/formula.hxx b/include/formula/formula.hxx
index 8bb8047986bd..99a8752c7eb3 100644
--- a/include/formula/formula.hxx
+++ b/include/formula/formula.hxx
@@ -70,10 +70,10 @@ protected:
void RefInputDoneAfter( sal_Bool bForced = sal_False );
void SetFocusWin(Window *pWin,const OString& nUniqueId);
- void SetMeText(const String& _sText);
+ void SetMeText(const OUString& _sText);
void Update();
- sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
- void Update(const String& _sExp);
+ sal_Bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
+ void Update(const OUString& _sExp);
void StoreFormEditData(FormEditData* pData);
};
@@ -113,19 +113,19 @@ protected:
void RefInputStartAfter( RefEdit* pEdit, RefButton* pButton = NULL );
void RefInputDoneAfter( sal_Bool bForced = sal_False );
void SetFocusWin(Window *pWin,const OString& nUniqueId);
- void HighlightFunctionParas(const String& aFormula);
+ void HighlightFunctionParas(const OUString& aFormula);
- void SetMeText(const String& _sText);
- FormulaDlgMode SetMeText(const String& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd,sal_Bool bMatrix,sal_Bool _bSelect,sal_Bool _bUpdate);
+ void SetMeText(const OUString& _sText);
+ FormulaDlgMode SetMeText(const OUString& _sText,xub_StrLen PrivStart, xub_StrLen PrivEnd, sal_Bool bMatrix, sal_Bool _bSelect, sal_Bool _bUpdate);
void Update();
- sal_Bool CheckMatrix(String& aFormula /*IN/OUT*/);
- String GetMeText() const;
- void Update(const String& _sExp);
+ sal_Bool CheckMatrix(OUString& aFormula /*IN/OUT*/);
+ OUString GetMeText() const;
+ void Update(const OUString& _sExp);
void CheckMatrix();
void DoEnter(sal_Bool _bOk);
const IFunctionDescription* getCurrentFunctionDescription() const;
- sal_Bool UpdateParaWin(Selection& _rSelection);
- void UpdateParaWin(const Selection& _rSelection,const String& _sRefStr);
+ sal_Bool UpdateParaWin(Selection& _rSelection);
+ void UpdateParaWin(const Selection& _rSelection, const OUString& _sRefStr);
RefEdit* GetActiveEdit();
void SetEdSelection();
diff --git a/reportdesign/source/ui/dlg/Formula.cxx b/reportdesign/source/ui/dlg/Formula.cxx
index 6abf2f1ba6d2..1469c0557bfc 100644
--- a/reportdesign/source/ui/dlg/Formula.cxx
+++ b/reportdesign/source/ui/dlg/Formula.cxx
@@ -53,14 +53,14 @@ FormulaDialog::FormulaDialog(Window* pParent
,m_pAddField(NULL)
,m_xRowSet(_xRowSet)
,m_pEdit(NULL)
- ,m_sFormula(OUString("="))
+ ,m_sFormula("=")
,m_nStart(0)
,m_nEnd(1)
{
if ( !_sFormula.isEmpty() )
{
- if ( _sFormula.getStr()[0] != '=' )
- m_sFormula += String(_sFormula);
+ if ( _sFormula[0] != '=' )
+ m_sFormula += _sFormula;
else
m_sFormula = _sFormula;
}
@@ -141,9 +141,9 @@ void FormulaDialog::setCurrentFormula(const String& _sReplacement)
const xub_StrLen nOldLen = m_nEnd - m_nStart;
const xub_StrLen nNewLen = _sReplacement.Len();
if (nOldLen)
- m_sFormula.Erase( m_nStart, nOldLen );
+ m_sFormula = m_sFormula.replaceAt( m_nStart, nOldLen, "" );
if (nNewLen)
- m_sFormula.Insert( _sReplacement, m_nStart );
+ m_sFormula = m_sFormula.replaceAt( m_nStart, 0, _sReplacement );
m_nEnd = m_nStart + nNewLen;
}
void FormulaDialog::setSelection(xub_StrLen _nStart,xub_StrLen _nEnd)
diff --git a/reportdesign/source/ui/inc/Formula.hxx b/reportdesign/source/ui/inc/Formula.hxx
index c551bbdf95e0..a8670a6171cd 100644
--- a/reportdesign/source/ui/inc/Formula.hxx
+++ b/reportdesign/source/ui/inc/Formula.hxx
@@ -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::sheet::XFormulaOpCodeMapper> m_xOpCodeMapper;
formula::RefEdit* m_pEdit;
- String m_sFormula;
+ OUString m_sFormula;
xub_StrLen m_nStart;
xub_StrLen m_nEnd;
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index a907e0cf232b..6508fa90acd8 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -142,9 +142,9 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
// Formel vorhanden? Dann editieren
- String aFormula;
+ OUString aFormula;
pDoc->GetFormula( nCol, nRow, nTab, aFormula );
- sal_Bool bEdit = ( aFormula.Len() > 1 );
+ sal_Bool bEdit = ( aFormula.getLength() > 1 );
sal_Bool bMatrix = false;
if ( bEdit )
{
@@ -169,7 +169,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
if ( !bEdit )
{
OUString aNewFormula('=');
- if ( aFormula.Len() > 0 && aFormula.GetChar(0) == '=' )
+ if ( !aFormula.isEmpty() && aFormula[0] == '=' )
aNewFormula = aFormula;
pScMod->InputReplaceSelection( aNewFormula );