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

convert include/editeng/splwrap.hxx from String to OUString

Change-Id: I52e6e34776fe494da431f8387f5f330b9aca36fe
üst 76fa859a
...@@ -463,7 +463,7 @@ IMPL_LINK( SpellDialog, ExtClickHdl, Button *, pBtn ) ...@@ -463,7 +463,7 @@ IMPL_LINK( SpellDialog, ExtClickHdl, Button *, pBtn )
const SpellErrorDescription* pSpellErrorDescription = m_pSentenceED->GetAlternatives(); const SpellErrorDescription* pSpellErrorDescription = m_pSentenceED->GetAlternatives();
if( pSpellErrorDescription ) if( pSpellErrorDescription )
{ {
String sWrong(pSpellErrorDescription->sErrorText); OUString sWrong(pSpellErrorDescription->sErrorText);
//if the word has not been edited in the MultiLineEdit then //if the word has not been edited in the MultiLineEdit then
//the current suggestion should be used //the current suggestion should be used
//if it's not the 'no suggestions' entry //if it's not the 'no suggestions' entry
...@@ -581,7 +581,7 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl) ...@@ -581,7 +581,7 @@ IMPL_LINK_NOARG(SpellDialog, ChangeAllHdl)
LanguageType eLang = GetSelectedLang_Impl(); LanguageType eLang = GetSelectedLang_Impl();
// add new word to ChangeAll list // add new word to ChangeAll list
String aOldWord( m_pSentenceED->GetErrorText() ); OUString aOldWord( m_pSentenceED->GetErrorText() );
SvxPrepareAutoCorrect( aOldWord, aString ); SvxPrepareAutoCorrect( aOldWord, aString );
Reference<XDictionary> aXDictionary( SvxGetChangeAllList(), UNO_QUERY ); Reference<XDictionary> aXDictionary( SvxGetChangeAllList(), UNO_QUERY );
sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary, sal_uInt8 nAdded = linguistic::AddEntryToDic( aXDictionary,
......
...@@ -150,7 +150,7 @@ void EditSpellWrapper::ScrollArea() ...@@ -150,7 +150,7 @@ void EditSpellWrapper::ScrollArea()
// still anywhere. // still anywhere.
} }
void EditSpellWrapper::ReplaceAll( const String &rNewText, void EditSpellWrapper::ReplaceAll( const OUString &rNewText,
sal_Int16 ) sal_Int16 )
{ {
// Is called when the word is in ReplaceList of the spell checker // Is called when the word is in ReplaceList of the spell checker
...@@ -158,7 +158,7 @@ void EditSpellWrapper::ReplaceAll( const String &rNewText, ...@@ -158,7 +158,7 @@ void EditSpellWrapper::ReplaceAll( const String &rNewText,
CheckSpellTo(); CheckSpellTo();
} }
void EditSpellWrapper::ChangeWord( const String& rNewWord, void EditSpellWrapper::ChangeWord( const OUString& rNewWord,
const sal_uInt16 ) const sal_uInt16 )
{ {
// Will be called when Word Button Change // Will be called when Word Button Change
...@@ -171,13 +171,13 @@ void EditSpellWrapper::ChangeWord( const String& rNewWord, ...@@ -171,13 +171,13 @@ void EditSpellWrapper::ChangeWord( const String& rNewWord,
CheckSpellTo(); CheckSpellTo();
} }
void EditSpellWrapper::ChangeThesWord( const String& rNewWord ) void EditSpellWrapper::ChangeThesWord( const OUString& rNewWord )
{ {
pEditView->InsertText( rNewWord ); pEditView->InsertText( rNewWord );
CheckSpellTo(); CheckSpellTo();
} }
void EditSpellWrapper::AutoCorrect( const String&, const String& ) void EditSpellWrapper::AutoCorrect( const OUString&, const OUString& )
{ {
} }
......
...@@ -47,14 +47,14 @@ private: ...@@ -47,14 +47,14 @@ private:
protected: protected:
virtual void SpellStart( SvxSpellArea eArea ); virtual void SpellStart( SvxSpellArea eArea );
virtual sal_Bool SpellContinue(); // Check area virtual sal_Bool SpellContinue(); // Check area
virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); virtual void ReplaceAll( const OUString &rNewText, sal_Int16 nLanguage );
virtual void SpellEnd(); virtual void SpellEnd();
virtual sal_Bool SpellMore(); virtual sal_Bool SpellMore();
virtual sal_Bool HasOtherCnt(); virtual sal_Bool HasOtherCnt();
virtual void ScrollArea(); virtual void ScrollArea();
virtual void ChangeWord( const String& rNewWord, const sal_uInt16 nLang ); virtual void ChangeWord( const OUString& rNewWord, const sal_uInt16 nLang );
virtual void ChangeThesWord( const String& rNewWord ); virtual void ChangeThesWord( const OUString& rNewWord );
virtual void AutoCorrect( const String& rOldWord, const String& rNewWord ); virtual void AutoCorrect( const OUString& rOldWord, const OUString& rNewWord );
public: public:
EditSpellWrapper( Window* pWin, EditSpellWrapper( Window* pWin,
......
...@@ -53,7 +53,7 @@ using namespace ::com::sun::star::linguistic2; ...@@ -53,7 +53,7 @@ using namespace ::com::sun::star::linguistic2;
// misc functions --------------------------------------------- // misc functions ---------------------------------------------
void SvxPrepareAutoCorrect( String &rOldText, String &rNewText ) void SvxPrepareAutoCorrect( OUString &rOldText, const OUString &rNewText )
{ {
// This function should be used to strip (or add) trailing '.' from // This function should be used to strip (or add) trailing '.' from
// the strings before passing them on to the autocorrect function in // the strings before passing them on to the autocorrect function in
...@@ -64,15 +64,15 @@ void SvxPrepareAutoCorrect( String &rOldText, String &rNewText ) ...@@ -64,15 +64,15 @@ void SvxPrepareAutoCorrect( String &rOldText, String &rNewText )
// rOldText: text to be replaced // rOldText: text to be replaced
// rNewText: replacement text // rNewText: replacement text
xub_StrLen nOldLen = rOldText.Len(), xub_StrLen nOldLen = rOldText.getLength(),
nNewLen = rNewText.Len(); nNewLen = rNewText.getLength();
if (nOldLen && nNewLen) if (nOldLen && nNewLen)
{ {
sal_Bool bOldHasDot = sal_Unicode( '.' ) == rOldText.GetChar( nOldLen - 1 ), bool bOldHasDot = '.' == rOldText[ nOldLen - 1 ],
bNewHasDot = sal_Unicode( '.' ) == rNewText.GetChar( nNewLen - 1 ); bNewHasDot = '.' == rNewText[ nNewLen - 1 ];
if (bOldHasDot && !bNewHasDot if (bOldHasDot && !bNewHasDot
/*this is: !(bOldHasDot && bNewHasDot) && bOldHasDot*/) /*this is: !(bOldHasDot && bNewHasDot) && bOldHasDot*/)
rOldText.Erase( nOldLen - 1 ); rOldText = rOldText.copy( 0, nOldLen - 1 );
} }
} }
...@@ -282,7 +282,7 @@ sal_Bool SvxSpellWrapper::SpellContinue() ...@@ -282,7 +282,7 @@ sal_Bool SvxSpellWrapper::SpellContinue()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxSpellWrapper::AutoCorrect( const String&, const String& ) void SvxSpellWrapper::AutoCorrect( const OUString&, const OUString& )
{ {
} }
...@@ -296,21 +296,21 @@ void SvxSpellWrapper::ScrollArea() ...@@ -296,21 +296,21 @@ void SvxSpellWrapper::ScrollArea()
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxSpellWrapper::ChangeWord( const String&, const sal_uInt16 ) void SvxSpellWrapper::ChangeWord( const OUString&, const sal_uInt16 )
{ // Insert Word { // Insert Word
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxSpellWrapper::ChangeThesWord( const String& ) void SvxSpellWrapper::ChangeThesWord( const OUString& )
{ {
// replace word due to Thesaurus. // replace word due to Thesaurus.
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxSpellWrapper::StartThesaurus( const String &rWord, sal_uInt16 nLanguage ) void SvxSpellWrapper::StartThesaurus( const OUString &rWord, sal_uInt16 nLanguage )
{ {
Reference< XThesaurus > xThes( SvxGetThesaurus() ); Reference< XThesaurus > xThes( SvxGetThesaurus() );
if (!xThes.is()) if (!xThes.is())
...@@ -332,7 +332,7 @@ void SvxSpellWrapper::StartThesaurus( const String &rWord, sal_uInt16 nLanguage ...@@ -332,7 +332,7 @@ void SvxSpellWrapper::StartThesaurus( const String &rWord, sal_uInt16 nLanguage
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
void SvxSpellWrapper::ReplaceAll( const String &, sal_Int16 ) void SvxSpellWrapper::ReplaceAll( const OUString &, sal_Int16 )
{ // Replace Word from the Replace list { // Replace Word from the Replace list
} }
......
...@@ -36,7 +36,7 @@ class Window; ...@@ -36,7 +36,7 @@ class Window;
// misc functions --------------------------------------------------------------- // misc functions ---------------------------------------------------------------
void EDITENG_DLLPUBLIC SvxPrepareAutoCorrect( String &rOldText, String &rNewText ); void EDITENG_DLLPUBLIC SvxPrepareAutoCorrect( OUString &rOldText, const OUString &rNewText );
/*-------------------------------------------------------------------- /*--------------------------------------------------------------------
Description: The SpellWrapper Description: The SpellWrapper
...@@ -129,19 +129,19 @@ protected: ...@@ -129,19 +129,19 @@ protected:
virtual void SpellStart( SvxSpellArea eSpell ); // Preparing the area virtual void SpellStart( SvxSpellArea eSpell ); // Preparing the area
virtual sal_Bool SpellContinue(); // Check Areas virtual sal_Bool SpellContinue(); // Check Areas
// Result available through GetLast // Result available through GetLast
virtual void ReplaceAll( const String &rNewText, sal_Int16 nLanguage ); //Replace word from the replace list virtual void ReplaceAll( const OUString &rNewText, sal_Int16 nLanguage ); //Replace word from the replace list
virtual void StartThesaurus( const String &rWord, sal_uInt16 nLang ); virtual void StartThesaurus( const OUString &rWord, sal_uInt16 nLang );
virtual ::com::sun::star::uno::Reference< virtual ::com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XDictionary > ::com::sun::star::linguistic2::XDictionary >
GetAllRightDic() const; GetAllRightDic() const;
virtual void SpellEnd(); // Finish area virtual void SpellEnd(); // Finish area
virtual void ScrollArea(); // Set ScrollArea virtual void ScrollArea(); // Set ScrollArea
// Replace word // Replace word
virtual void ChangeWord( const String& rNewWord, const sal_uInt16 nLang ); virtual void ChangeWord( const OUString& rNewWord, const sal_uInt16 nLang );
// Wort via Thesaurus ersetzen // Wort via Thesaurus ersetzen
virtual void ChangeThesWord( const String& rNewWord ); virtual void ChangeThesWord( const OUString& rNewWord );
virtual void SetLanguage( const sal_uInt16 nLang ); // Change Language virtual void SetLanguage( const sal_uInt16 nLang ); // Change Language
virtual void AutoCorrect( const String& rAktStr, const String& rNewStr ); virtual void AutoCorrect( const OUString& rAktStr, const OUString& rNewStr );
virtual void InsertHyphen( const sal_uInt16 nPos ); // Insert hyphen virtual void InsertHyphen( const sal_uInt16 nPos ); // Insert hyphen
}; };
......
...@@ -691,8 +691,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) ...@@ -691,8 +691,8 @@ void SwSpellPopup::Execute( sal_uInt16 nId )
// record only if it's NOT already present in autocorrection // record only if it's NOT already present in autocorrection
SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect(); SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get().GetAutoCorrect();
String aOrigWord( bGrammarResults ? OUString() : xSpellAlt->getWord() ) ; OUString aOrigWord( bGrammarResults ? OUString() : xSpellAlt->getWord() ) ;
String aNewWord( aSuggestions[ nAltIdx ] ); OUString aNewWord( aSuggestions[ nAltIdx ] );
SvxPrepareAutoCorrect( aOrigWord, aNewWord ); SvxPrepareAutoCorrect( aOrigWord, aNewWord );
if (MN_AUTOCORR_START <= nId && nId <= MN_AUTOCORR_END) if (MN_AUTOCORR_START <= nId && nId <= MN_AUTOCORR_END)
......
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