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