diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-08 23:00:59 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2012-02-08 23:00:59 -0500 |
commit | ec84bbb208d59d042f8f0522fa96ed2ad94f2ca7 (patch) | |
tree | 7c4f6065338b3978f4effd048c2760c35ab76fb8 | |
parent | 57fce1ee55293f61ccbe56679f11cc8f90ab8dc2 (diff) |
String to rtl::OUString.
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 40 | ||||
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/app/scmod.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/inputhdl.hxx | 9 |
4 files changed, 25 insertions, 28 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index c5018eb2d2bb..fa102dd7d00c 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -794,7 +794,7 @@ void ScInputHandler::HideTip() nTipVisible = 0; pTipVisibleParent = NULL; } - aManualTip.Erase(); + aManualTip = rtl::OUString(); } void ScInputHandler::HideTipBelow() { @@ -806,7 +806,7 @@ void ScInputHandler::HideTipBelow() nTipVisibleSec = 0; pTipVisibleSecParent = NULL; } - aManualTip.Erase(); + aManualTip = rtl::OUString(); } void ScInputHandler::ShowTipCursor() @@ -1377,7 +1377,7 @@ String lcl_Calculate( const String& rFormula, ScDocument* pDoc, const ScAddress void ScInputHandler::FormulaPreview() { - String aValue; + rtl::OUString aValue; EditView* pActiveView = pTopView ? pTopView : pTableView; if ( pActiveView && pActiveViewSh ) { @@ -1388,7 +1388,7 @@ void ScInputHandler::FormulaPreview() aValue = lcl_Calculate( aPart, pDoc, aCursorPos ); } - if (aValue.Len()) + if (!aValue.isEmpty()) { ShowTip( aValue ); // als QuickHelp anzeigen aManualTip = aValue; // nach ShowTip setzen @@ -1404,8 +1404,8 @@ void ScInputHandler::PasteManualTip() // drei Punkte am Ende -> Bereichsreferenz -> nicht einfuegen // (wenn wir mal Matrix-Konstanten haben, kann das geaendert werden) - xub_StrLen nTipLen = aManualTip.Len(); - if ( nTipLen && ( nTipLen < 3 || !aManualTip.Copy( nTipLen-3 ).EqualsAscii("...") ) ) + sal_Int32 nTipLen = aManualTip.getLength(); + if ( nTipLen && ( nTipLen < 3 || !aManualTip.copy( nTipLen-3 ).equalsAscii("...") ) ) { DataChanging(); // kann nicht neu sein @@ -2817,7 +2817,7 @@ void ScInputHandler::EnterHandler( sal_uInt8 nBlockMode ) HideTipBelow(); nFormSelStart = nFormSelEnd = 0; - aFormText.Erase(); + aFormText = rtl::OUString(); bInOwnChange = false; bInEnterHandler = false; @@ -2869,7 +2869,7 @@ void ScInputHandler::CancelHandler() NotifyChange( pLastState, true ); nFormSelStart = nFormSelEnd = 0; - aFormText.Erase(); + aFormText = rtl::OUString(); bInOwnChange = false; } @@ -3116,7 +3116,7 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, bool bStartEdit /* = false PasteFunctionData(); bUsed = true; } - else if ( nModi == 0 && nTipVisible && aManualTip.Len() ) + else if ( nModi == 0 && nTipVisible && !aManualTip.isEmpty() ) { PasteManualTip(); bUsed = true; @@ -3840,19 +3840,24 @@ void ScInputHandler::InputSetSelection( xub_StrLen nStart, xub_StrLen nEnd ) //------------------------------------------------------------------------ -void ScInputHandler::InputReplaceSelection( const String& rStr ) +void ScInputHandler::InputReplaceSelection( const rtl::OUString& rStr ) { if (!pRefViewSh) pRefViewSh = pActiveViewSh; OSL_ENSURE(nFormSelEnd>=nFormSelStart,"Selektion kaputt..."); - xub_StrLen nOldLen = nFormSelEnd-nFormSelStart; - xub_StrLen nNewLen = rStr.Len(); + sal_Int32 nOldLen = nFormSelEnd - nFormSelStart; + sal_Int32 nNewLen = rStr.getLength(); + + rtl::OUStringBuffer aBuf(aFormText); if (nOldLen) - aFormText.Erase( nFormSelStart, nOldLen ); + aBuf.remove(nFormSelStart, nOldLen); if (nNewLen) - aFormText.Insert( rStr, nFormSelStart ); + aBuf.insert(nFormSelStart, rStr); + + aFormText = aBuf.makeStringAndClear(); + nFormSelEnd = nFormSelStart + nNewLen; EditView* pView = GetFuncEditView(); @@ -3866,13 +3871,6 @@ void ScInputHandler::InputReplaceSelection( const String& rStr ) bModified = true; } -//------------------------------------------------------------------------ - -String ScInputHandler::InputGetFormulaStr() -{ - return aFormText; //! eigene Membervariable? -} - //======================================================================== // ScInputHdlState //======================================================================== diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index ebdea66fb1ba..ccfde4806877 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -242,7 +242,7 @@ ScInputWindow::ScInputWindow( Window* pParent, SfxBindings* pBind ) : if (pInputHdl) pInputHdl->SetInputWindow( this ); - if ( pInputHdl && pInputHdl->GetFormString().Len() ) + if (pInputHdl && !pInputHdl->GetFormString().isEmpty()) { // Umschalten waehrend der Funktionsautopilot aktiv ist // -> Inhalt des Funktionsautopiloten wieder anzeigen diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 2b84ace0047b..d34847f49c83 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -1482,7 +1482,7 @@ String ScModule::InputGetFormulaStr() ScInputHandler* pHdl = GetInputHdl(); String aStr; if ( pHdl ) - aStr = pHdl->InputGetFormulaStr(); + aStr = pHdl->GetFormString(); return aStr; } diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 53c7d33d01bb..18cceb8a0118 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -80,12 +80,12 @@ private: sal_uLong nTipVisible; Window* pTipVisibleSecParent; sal_uLong nTipVisibleSec; - String aManualTip; + rtl::OUString aManualTip; rtl::OUString aAutoSearch; rtl::OUString aCurrentText; - String aFormText; // fuer Funktions-Autopilot + rtl::OUString aFormText; // fuer Funktions-Autopilot xub_StrLen nFormSelStart; // Selektion fuer Funktions-Autopilot xub_StrLen nFormSelEnd; @@ -180,7 +180,7 @@ public: bool IsTopMode() const { return (eMode == SC_INPUT_TOP); } const rtl::OUString& GetEditString(); - const String& GetFormString() const { return aFormText; } + const rtl::OUString& GetFormString() const { return aFormText; } const ScAddress& GetCursorPos() const { return aCursorPos; } @@ -242,8 +242,7 @@ public: // Kommunikation mit Funktionsautopilot void InputGetSelection ( xub_StrLen& rStart, xub_StrLen& rEnd ); void InputSetSelection ( xub_StrLen nStart, xub_StrLen nEnd ); - void InputReplaceSelection ( const String& rStr ); - String InputGetFormulaStr (); + void InputReplaceSelection ( const rtl::OUString& rStr ); bool IsFormulaMode() const { return bFormulaMode; } ScInputWindow* GetInputWindow() { return pInputWin; } |