[Libreoffice-commits] core.git: 48 commits - cui/source editeng/qa editeng/source include/editeng include/linguistic include/svl linguistic/source sc/source sd/source svx/source sw/inc sw/source
Noel Grandin
noel at peralex.com
Wed Sep 11 01:10:12 PDT 2013
cui/source/dialogs/SpellDialog.cxx | 4
cui/source/factory/dlgfact.cxx | 14
cui/source/factory/dlgfact.hxx | 60 ++-
cui/source/tabpages/autocdlg.cxx | 44 +-
cui/source/tabpages/backgrnd.cxx | 31 --
cui/source/tabpages/grfpage.cxx | 10
editeng/qa/unit/core-test.cxx | 18 -
editeng/source/accessibility/AccessibleEditableTextPara.cxx | 4
editeng/source/accessibility/AccessibleStringWrap.cxx | 6
editeng/source/editeng/editdbg.cxx | 2
editeng/source/editeng/editdoc.cxx | 38 +-
editeng/source/editeng/editdoc.hxx | 8
editeng/source/editeng/editeng.cxx | 20 -
editeng/source/editeng/editobj.cxx | 43 +-
editeng/source/editeng/editobj2.hxx | 14
editeng/source/editeng/editundo.cxx | 22 -
editeng/source/editeng/editundo.hxx | 26 -
editeng/source/editeng/editview.cxx | 52 +--
editeng/source/editeng/edtspell.cxx | 48 +--
editeng/source/editeng/edtspell.hxx | 24 -
editeng/source/editeng/eehtml.cxx | 31 --
editeng/source/editeng/eehtml.hxx | 10
editeng/source/editeng/eeobj.hxx | 8
editeng/source/editeng/eertfpar.cxx | 26 -
editeng/source/editeng/impedit.cxx | 16 -
editeng/source/editeng/impedit.hxx | 38 +-
editeng/source/editeng/impedit2.cxx | 120 +++----
editeng/source/editeng/impedit3.cxx | 50 +--
editeng/source/editeng/impedit4.cxx | 84 ++---
editeng/source/editeng/impedit5.cxx | 2
editeng/source/editeng/textconv.cxx | 22 -
editeng/source/editeng/textconv.hxx | 4
editeng/source/items/borderline.cxx | 9
editeng/source/items/bulitem.cxx | 2
editeng/source/items/frmitems.cxx | 186 ++++--------
editeng/source/items/numitem.cxx | 54 +--
editeng/source/items/paperinf.cxx | 4
editeng/source/items/svxfont.cxx | 134 ++++----
editeng/source/items/textitem.cxx | 10
editeng/source/misc/SvXMLAutoCorrectExport.cxx | 2
editeng/source/misc/SvXMLAutoCorrectImport.cxx | 11
editeng/source/misc/acorrcfg.cxx | 8
editeng/source/misc/hangulhanja.cxx | 2
editeng/source/misc/splwrap.cxx | 26 -
editeng/source/misc/svxacorr.cxx | 128 ++++----
editeng/source/misc/unolingu.cxx | 4
editeng/source/outliner/outleeng.cxx | 2
editeng/source/outliner/outleeng.hxx | 2
editeng/source/outliner/outlin2.cxx | 2
editeng/source/outliner/outliner.cxx | 26 -
editeng/source/outliner/outlvw.cxx | 14
editeng/source/rtf/svxrtf.cxx | 22 -
editeng/source/uno/unoedprx.cxx | 43 +-
editeng/source/uno/unofield.cxx | 6
editeng/source/uno/unotext.cxx | 6
include/editeng/AccessibleEditableTextPara.hxx | 2
include/editeng/AccessibleStringWrap.hxx | 4
include/editeng/brushitem.hxx | 17 -
include/editeng/bulletitem.hxx | 26 -
include/editeng/editdata.hxx | 4
include/editeng/editeng.hxx | 7
include/editeng/editobj.hxx | 2
include/editeng/editstat.hxx | 6
include/editeng/editview.hxx | 8
include/editeng/edtdlg.hxx | 56 +--
include/editeng/numitem.hxx | 20 -
include/editeng/outliner.hxx | 36 +-
include/editeng/paperinf.hxx | 3
include/editeng/pmdlitem.hxx | 4
include/editeng/splwrap.hxx | 12
include/editeng/svxacorr.hxx | 56 +--
include/editeng/svxfont.hxx | 30 -
include/editeng/svxrtf.hxx | 6
include/editeng/swafopt.hxx | 10
include/editeng/unoedsrc.hxx | 1
include/editeng/unolingu.hxx | 8
include/linguistic/misc.hxx | 14
include/svl/imageitm.hxx | 2
include/svl/urlbmk.hxx | 14
linguistic/source/convdic.cxx | 30 -
linguistic/source/convdic.hxx | 12
linguistic/source/convdiclist.cxx | 30 -
linguistic/source/convdicxml.cxx | 6
linguistic/source/dlistimp.cxx | 66 ++--
linguistic/source/dlistimp.hxx | 2
linguistic/source/hhconvdic.cxx | 2
linguistic/source/hhconvdic.hxx | 2
linguistic/source/hyphdsp.cxx | 24 -
linguistic/source/hyphdta.cxx | 10
linguistic/source/lngsvcmgr.cxx | 50 +--
linguistic/source/lngsvcmgr.hxx | 2
linguistic/source/misc.cxx | 18 -
linguistic/source/misc2.cxx | 10
linguistic/source/spelldsp.cxx | 16 -
linguistic/source/spelldta.cxx | 4
sc/source/filter/html/htmlexp.cxx | 14
sc/source/filter/html/htmlpars.cxx | 2
sc/source/ui/Accessibility/AccessiblePageHeader.cxx | 2
sd/source/filter/ppt/pptinanimations.cxx | 2
svx/source/sidebar/nbdtmg.cxx | 20 -
svx/source/svdraw/svdotextdecomposition.cxx | 8
svx/source/svdraw/svdotextpathdecomposition.cxx | 2
svx/source/svdraw/svdotxat.cxx | 2
svx/source/table/cell.cxx | 2
sw/inc/acmplwrd.hxx | 2
sw/source/core/doc/acmplwrd.cxx | 2
sw/source/core/edit/acorrect.cxx | 46 +-
sw/source/core/inc/acorrect.hxx | 15
sw/source/filter/html/htmlgrin.cxx | 8
sw/source/filter/html/htmltabw.cxx | 4
sw/source/filter/xml/xmlbrsh.cxx | 4
sw/source/filter/xml/xmlexpit.cxx | 4
sw/source/ui/docvw/AnnotationWin.cxx | 2
sw/source/ui/docvw/romenu.cxx | 16 -
sw/source/ui/frmdlg/frmpage.cxx | 4
sw/source/ui/lingu/olmenu.cxx | 4
sw/source/ui/shells/grfsh.cxx | 12
sw/source/ui/shells/txtnum.cxx | 10
118 files changed, 1169 insertions(+), 1252 deletions(-)
New commits:
commit 7c3bb56d60b5d33fc7da1cdef3a7f9f2aa956b12
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 16:58:04 2013 +0200
convert linguistic/source/*.cxx from String to OUString
Change-Id: I6f278d4b1a0eccf3757e1a7add6324402a09dfed
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 5fbe257..28f49e5 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -68,9 +68,9 @@ using namespace linguistic;
#define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary"
-void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport )
+void ReadThroughDic( const OUString &rMainURL, ConvDicXMLImport &rImport )
{
- if (rMainURL.Len() == 0)
+ if (rMainURL.isEmpty())
return;
DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL");
@@ -131,12 +131,12 @@ sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConv
return bRes;
// check if file extension matches CONV_DIC_EXT
- String aExt;
+ OUString aExt;
sal_Int32 nPos = rFileURL.lastIndexOf( '.' );
if (-1 != nPos)
aExt = rFileURL.copy( nPos + 1 );
- aExt.ToLowerAscii();
- if (!aExt.EqualsAscii( CONV_DIC_EXT ))
+ aExt = aExt.toAsciiLowerCase();
+ if (aExt != CONV_DIC_EXT)
return bRes;
// first argument being 0 should stop the file from being parsed
diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx
index e2402fc..dcd2bbb 100644
--- a/linguistic/source/convdiclist.cxx
+++ b/linguistic/source/convdiclist.cxx
@@ -64,7 +64,7 @@ bool operator == ( const Locale &r1, const Locale &r2 )
}
-String GetConvDicMainURL( const String &rDicName, const String &rDirectoryURL )
+OUString GetConvDicMainURL( const OUString &rDicName, const OUString &rDirectoryURL )
{
// build URL to use for new (persistent) dictionaries
@@ -76,7 +76,7 @@ String GetConvDicMainURL( const String &rDicName, const String &rDirectoryURL )
aURLObj.Append( aFullDicName, INetURLObject::ENCODE_ALL );
DBG_ASSERT(!aURLObj.HasError(), "invalid URL");
if (aURLObj.HasError())
- return String();
+ return OUString();
else
return aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI );
}
@@ -120,7 +120,7 @@ public:
// looks for conversion dictionaries with the specified extension
// in the directory and adds them to the container
- void AddConvDics( const String &rSearchDirPathURL, const String &rExtension );
+ void AddConvDics( const OUString &rSearchDirPathURL, const OUString &rExtension );
// calls Flush for the dictionaries that support XFlushable
void FlushDics() const;
@@ -293,8 +293,8 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName )
// physically remove dictionary
uno::Reference< XConversionDictionary > xDel = aConvDics.getArray()[nRplcIdx];
- String aName( xDel->getName() );
- String aDicMainURL( GetConvDicMainURL( aName, GetDictionaryWriteablePath() ) );
+ OUString aName( xDel->getName() );
+ OUString aDicMainURL( GetConvDicMainURL( aName, GetDictionaryWriteablePath() ) );
INetURLObject aObj( aDicMainURL );
DBG_ASSERT( aObj.GetProtocol() == INET_PROT_FILE, "+HangulHanjaOptionsDialog::OkHdl(): non-file URLs cannot be deleted" );
if( aObj.GetProtocol() == INET_PROT_FILE )
@@ -325,8 +325,8 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName )
void ConvDicNameContainer::AddConvDics(
- const String &rSearchDirPathURL,
- const String &rExtension )
+ const OUString &rSearchDirPathURL,
+ const OUString &rExtension )
{
const Sequence< OUString > aDirCnt(
utl::LocalFileHelper::GetFolderContents( rSearchDirPathURL, sal_False ) );
@@ -335,13 +335,13 @@ void ConvDicNameContainer::AddConvDics(
for (sal_Int32 i = 0; i < nEntries; ++i)
{
- String aURL( pDirCnt[i] );
+ OUString aURL( pDirCnt[i] );
- xub_StrLen nPos = aURL.SearchBackward('.');
- String aExt(aURL.Copy(nPos + 1));
- aExt.ToLowerAscii();
- String aSearchExt( rExtension );
- aSearchExt.ToLowerAscii();
+ sal_Int32 nPos = aURL.lastIndexOf('.');
+ OUString aExt(aURL.copy(nPos + 1));
+ aExt = aExt.toAsciiLowerCase();
+ OUString aSearchExt( rExtension );
+ aSearchExt = aSearchExt.toAsciiLowerCase();
if(aExt != aSearchExt)
continue; // skip other files
@@ -351,7 +351,7 @@ void ConvDicNameContainer::AddConvDics(
{
// get decoded dictionary file name
INetURLObject aURLObj( aURL );
- String aDicName = aURLObj.getBase( INetURLObject::LAST_SEGMENT,
+ OUString aDicName = aURLObj.getBase( INetURLObject::LAST_SEGMENT,
true, INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 );
@@ -486,7 +486,7 @@ uno::Reference< XConversionDictionary > SAL_CALL ConvDicList::addNewDictionary(
throw ElementExistException();
uno::Reference< XConversionDictionary > xRes;
- String aDicMainURL( GetConvDicMainURL( rName, GetDictionaryWriteablePath() ) );
+ OUString aDicMainURL( GetConvDicMainURL( rName, GetDictionaryWriteablePath() ) );
if (nLang == LANGUAGE_KOREAN &&
nConvDicType == ConversionDictionaryType::HANGUL_HANJA)
{
diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx
index 9b409bd..4bd17fc 100644
--- a/linguistic/source/convdicxml.cxx
+++ b/linguistic/source/convdicxml.cxx
@@ -71,12 +71,12 @@ static const OUString ConversionTypeToText( sal_Int16 nConversionType )
return aRes;
}
-static sal_Int16 GetConversionTypeFromText( const String &rText )
+static sal_Int16 GetConversionTypeFromText( const OUString &rText )
{
sal_Int16 nRes = -1;
- if (rText.EqualsAscii( CONV_TYPE_HANGUL_HANJA ))
+ if (rText == CONV_TYPE_HANGUL_HANJA)
nRes = ConversionDictionaryType::HANGUL_HANJA;
- else if (rText.EqualsAscii( CONV_TYPE_SCHINESE_TCHINESE ))
+ else if (rText == CONV_TYPE_SCHINESE_TCHINESE)
nRes = ConversionDictionaryType::SCHINESE_TCHINESE;
return nRes;
}
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 841f409..ec7853b 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -51,7 +51,7 @@ using namespace linguistic;
-static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg );
+static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg );
static void AddInternal( const uno::Reference< XDictionary > &rDic,
const OUString& rNew );
@@ -316,16 +316,16 @@ void DicList::SearchForDictionaries(
OUString aDCP("dcp");
for (sal_Int32 i = 0; i < nEntries; ++i)
{
- String aURL( pDirCnt[i] );
+ OUString aURL( pDirCnt[i] );
sal_uInt16 nLang = LANGUAGE_NONE;
sal_Bool bNeg = sal_False;
if(!::IsVers2OrNewer( aURL, nLang, bNeg ))
{
// When not
- xub_StrLen nPos = aURL.Search('.');
- String aExt(aURL.Copy(nPos + 1));
- aExt.ToLowerAscii();
+ sal_Int32 nPos = aURL.indexOf('.');
+ OUString aExt(aURL.copy(nPos + 1));
+ aExt = aExt.toAsciiLowerCase();
if (aDCN.equals(aExt)) // negativ
bNeg = sal_True;
@@ -338,11 +338,11 @@ void DicList::SearchForDictionaries(
// Record in the list of Dictoinaries
// When it already exists don't record
sal_Int16 nSystemLanguage = MsLangId::getSystemLanguage();
- String aTmp1 = ToLower( aURL, nSystemLanguage );
- xub_StrLen nPos = aTmp1.SearchBackward( '/' );
- if (STRING_NOTFOUND != nPos)
- aTmp1 = aTmp1.Copy( nPos + 1 );
- String aTmp2;
+ OUString aTmp1 = ToLower( aURL, nSystemLanguage );
+ sal_Int32 nPos = aTmp1.lastIndexOf( '/' );
+ if (-1 != nPos)
+ aTmp1 = aTmp1.copy( nPos + 1 );
+ OUString aTmp2;
size_t j;
size_t nCount = rDicList.size();
for(j = 0; j < nCount; j++)
@@ -356,7 +356,7 @@ void DicList::SearchForDictionaries(
{
// get decoded dictionary file name
INetURLObject aURLObj( aURL );
- String aDicName = aURLObj.getName( INetURLObject::LAST_SEGMENT,
+ OUString aDicName = aURLObj.getName( INetURLObject::LAST_SEGMENT,
true, INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 );
@@ -788,32 +788,32 @@ void * SAL_CALL DicList_getFactory( const sal_Char * pImplName,
}
-xub_StrLen lcl_GetToken( String &rToken,
- const String &rText, xub_StrLen nPos, const String &rDelim )
+xub_StrLen lcl_GetToken( OUString &rToken,
+ const OUString &rText, xub_StrLen nPos, const OUString &rDelim )
{
xub_StrLen nRes = STRING_LEN;
- if (rText.Len() == 0 || nPos >= rText.Len())
- rToken = String();
- else if (rDelim.Len() == 0)
+ if (rText.isEmpty() || nPos >= rText.getLength())
+ rToken = "";
+ else if (rDelim.isEmpty())
{
rToken = rText;
- if (rToken.Len())
- nRes = rText.Len();
+ if (!rToken.isEmpty())
+ nRes = rText.getLength();
}
else
{
xub_StrLen i;
- for (i = nPos; i < rText.Len(); ++i)
+ for (i = nPos; i < rText.getLength(); ++i)
{
- if (STRING_NOTFOUND != rDelim.Search( rText.GetChar(i) ))
+ if (-1 != rDelim.indexOf( rText[i] ))
break;
}
- if (i >= rText.Len()) // delimeter not found
- rToken = rText.Copy( nPos );
+ if (i >= rText.getLength()) // delimeter not found
+ rToken = rText.copy( nPos );
else
- rToken = rText.Copy( nPos, sal::static_int_cast< xub_StrLen >((sal_Int32) i - nPos) );
+ rToken = rText.copy( nPos, (sal_Int32) i - nPos );
nRes = i + 1; // continue after found delimeter
}
@@ -834,12 +834,12 @@ static void AddInternal(
OSL_ENSURE(aDelim.indexOf(static_cast<sal_Unicode>('.')) == -1,
"ensure no '.'");
- String aToken;
+ OUString aToken;
xub_StrLen nPos = 0;
while (STRING_LEN !=
(nPos = lcl_GetToken( aToken, rNew, nPos, aDelim )))
{
- if( aToken.Len() && !IsNumeric( aToken ) )
+ if( !aToken.isEmpty() && !IsNumeric( aToken ) )
{
rDic->add( aToken, sal_False, OUString() );
}
@@ -862,16 +862,16 @@ static void AddUserData( const uno::Reference< XDictionary > &rDic )
}
}
-static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg )
+static sal_Bool IsVers2OrNewer( const OUString& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg )
{
- if (rFileURL.Len() == 0)
+ if (rFileURL.isEmpty())
return sal_False;
OUString aDIC("dic");
- String aExt;
- xub_StrLen nPos = rFileURL.SearchBackward( '.' );
- if (STRING_NOTFOUND != nPos)
- aExt = rFileURL.Copy( nPos + 1 );
- aExt.ToLowerAscii();
+ OUString aExt;
+ sal_Int32 nPos = rFileURL.lastIndexOf( '.' );
+ if (-1 != nPos)
+ aExt = rFileURL.copy( nPos + 1 );
+ aExt = aExt.toAsciiLowerCase();
if (!aDIC.equals(aExt))
return sal_False;
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 3e5c260..a97ff13 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -269,10 +269,10 @@ Reference< XHyphenatedWord > SAL_CALL
OUString aChkWord( rWord );
// replace typographical apostroph by ascii apostroph
- String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
- DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" );
- if (aSingleQuote.Len())
- aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' );
+ OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
+ DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" );
+ if (!aSingleQuote.isEmpty())
+ aChkWord = aChkWord.replace( aSingleQuote[0], '\'' );
bWordModified |= RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
@@ -405,10 +405,10 @@ Reference< XHyphenatedWord > SAL_CALL
OUString aChkWord( rWord );
// replace typographical apostroph by ascii apostroph
- String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
- DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" );
- if (aSingleQuote.Len())
- aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' );
+ OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
+ DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" );
+ if (!aSingleQuote.isEmpty())
+ aChkWord = aChkWord.replace( aSingleQuote[0], '\'' );
bWordModified |= RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
@@ -529,10 +529,10 @@ Reference< XPossibleHyphens > SAL_CALL
OUString aChkWord( rWord );
// replace typographical apostroph by ascii apostroph
- String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
- DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" );
- if (aSingleQuote.Len())
- aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' );
+ OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
+ DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" );
+ if (!aSingleQuote.isEmpty())
+ aChkWord = aChkWord.replace( aSingleQuote[0], '\'' );
RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx
index f5ce5b1..b2dfad2 100644
--- a/linguistic/source/hyphdta.cxx
+++ b/linguistic/source/hyphdta.cxx
@@ -48,16 +48,16 @@ HyphenatedWord::HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16
nHyphenationPos (nHPos),
nLanguage (nLang)
{
- String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
- DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" );
- if (aSingleQuote.Len())
+ OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
+ DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" );
+ if (!aSingleQuote.isEmpty())
{
// ignore typographical apostrophes (which got replaced in original
// word when being checked for hyphenation) in results.
OUString aTmpWord( rWord );
OUString aTmpHyphWord( rHyphWord );
- aTmpWord = aTmpWord .replace( aSingleQuote.GetChar(0), '\'' );
- aTmpHyphWord = aTmpHyphWord.replace( aSingleQuote.GetChar(0), '\'' );
+ aTmpWord = aTmpWord .replace( aSingleQuote[0], '\'' );
+ aTmpHyphWord = aTmpHyphWord.replace( aSingleQuote[0], '\'' );
bIsAltSpelling = aTmpWord != aTmpHyphWord;
}
else
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index b7fe110..a8aeeed 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1291,8 +1291,8 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp )
sal_Int32 nLen = aNames.getLength();
// append path prefix need for 'GetProperties' call below
- String aPrefix( aNode );
- aPrefix.Append( (sal_Unicode) '/' );
+ OUString aPrefix( aNode );
+ aPrefix += "/";
for (int i = 0; i < nLen; ++i)
{
OUString aTmp( aPrefix );
@@ -1309,9 +1309,9 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp )
uno::Sequence< OUString > aSvcImplNames;
if (pValues[i] >>= aSvcImplNames)
{
- String aLocaleStr( pNames[i] );
- xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) );
- aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 );
+ OUString aLocaleStr( pNames[i] );
+ sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' );
+ aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 );
rSpellDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames );
}
}
@@ -1329,8 +1329,8 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp )
sal_Int32 nLen = aNames.getLength();
// append path prefix need for 'GetProperties' call below
- String aPrefix( aNode );
- aPrefix.Append( (sal_Unicode) '/' );
+ OUString aPrefix( aNode );
+ aPrefix += "/";
for (int i = 0; i < nLen; ++i)
{
OUString aTmp( aPrefix );
@@ -1351,9 +1351,9 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp )
if (aSvcImplNames.getLength() > 1)
aSvcImplNames.realloc(1);
- String aLocaleStr( pNames[i] );
- xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) );
- aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 );
+ OUString aLocaleStr( pNames[i] );
+ sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' );
+ aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 );
rGrammarDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames );
}
}
@@ -1371,8 +1371,8 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp )
sal_Int32 nLen = aNames.getLength();
// append path prefix need for 'GetProperties' call below
- String aPrefix( aNode );
- aPrefix.Append( (sal_Unicode) '/' );
+ OUString aPrefix( aNode );
+ aPrefix += "/";
for (int i = 0; i < nLen; ++i)
{
OUString aTmp( aPrefix );
@@ -1393,9 +1393,9 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp )
if (aSvcImplNames.getLength() > 1)
aSvcImplNames.realloc(1);
- String aLocaleStr( pNames[i] );
- xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) );
- aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 );
+ OUString aLocaleStr( pNames[i] );
+ sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' );
+ aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 );
rHyphDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames );
}
}
@@ -1413,8 +1413,8 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp )
sal_Int32 nLen = aNames.getLength();
// append path prefix need for 'GetProperties' call below
- String aPrefix( aNode );
- aPrefix.Append( (sal_Unicode) '/' );
+ OUString aPrefix( aNode );
+ aPrefix += "/";
for (int i = 0; i < nLen; ++i)
{
OUString aTmp( aPrefix );
@@ -1431,9 +1431,9 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp )
uno::Sequence< OUString > aSvcImplNames;
if (pValues[i] >>= aSvcImplNames)
{
- String aLocaleStr( pNames[i] );
- xub_StrLen nSeparatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) );
- aLocaleStr = aLocaleStr.Copy( nSeparatorPos + 1 );
+ OUString aLocaleStr( pNames[i] );
+ sal_Int32 nSeparatorPos = aLocaleStr.lastIndexOf( '/' );
+ aLocaleStr = aLocaleStr.copy( nSeparatorPos + 1 );
rThesDsp.SetServiceList( LanguageTag::convertToLocale(aLocaleStr), aSvcImplNames );
}
}
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index 9a1ebca..3b2e04f 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -302,10 +302,10 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
Locale aLocale( LanguageTag::convertToLocale( nLanguage ) );
// replace typographical apostroph by ascii apostroph
- String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
- DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" );
- if (aSingleQuote.Len())
- aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' );
+ OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
+ DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" );
+ if (!aSingleQuote.isEmpty())
+ aChkWord = aChkWord.replace( aSingleQuote[0], '\'' );
RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
@@ -469,10 +469,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
Locale aLocale( LanguageTag::convertToLocale( nLanguage ) );
// replace typographical apostroph by ascii apostroph
- String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
- DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" );
- if (aSingleQuote.Len())
- aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' );
+ OUString aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() );
+ DBG_ASSERT( 1 == aSingleQuote.getLength(), "unexpectend length of quotation mark" );
+ if (!aSingleQuote.isEmpty())
+ aChkWord = aChkWord.replace( aSingleQuote[0], '\'' );
RemoveHyphens( aChkWord );
if (IsIgnoreControlChars( rProperties, GetPropSet() ))
diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx
index 80c40a0..1d07dc1 100644
--- a/linguistic/source/spelldta.cxx
+++ b/linguistic/source/spelldta.cxx
@@ -92,13 +92,13 @@ void SearchSimilarText( const OUString &rText, sal_Int16 nLanguage,
sal_Int32 nLen = aEntries.getLength();
for (sal_Int32 k = 0; k < nLen; ++k)
{
- String aEntryTxt;
+ OUString aEntryTxt;
if (pEntries[k].is())
{
// remove characters used to determine hyphenation positions
aEntryTxt = comphelper::string::remove(pEntries[k]->getDictionaryWord(), '=');
}
- if (aEntryTxt.Len() > 0 && LevDistance( rText, aEntryTxt ) <= 2)
+ if (!aEntryTxt.isEmpty() && LevDistance( rText, aEntryTxt ) <= 2)
rDicListProps.push_back( aEntryTxt );
}
}
commit 5118cb286865a6617273cb1a8de963b893cdf86c
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 16:43:31 2013 +0200
convert linguistic/source/convdic.hxx from String to OUString
Change-Id: Id4dc56902722ea139e06e727a7090b9b10e3b347
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 323422a..5fbe257 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -123,18 +123,18 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport )
}
}
-sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType )
+sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType )
{
sal_Bool bRes = sal_False;
- if (rFileURL.Len() == 0)
+ if (rFileURL.isEmpty())
return bRes;
// check if file extension matches CONV_DIC_EXT
String aExt;
- xub_StrLen nPos = rFileURL.SearchBackward( '.' );
- if (STRING_NOTFOUND != nPos)
- aExt = rFileURL.Copy( nPos + 1 );
+ sal_Int32 nPos = rFileURL.lastIndexOf( '.' );
+ if (-1 != nPos)
+ aExt = rFileURL.copy( nPos + 1 );
aExt.ToLowerAscii();
if (!aExt.EqualsAscii( CONV_DIC_EXT ))
return bRes;
@@ -164,11 +164,11 @@ sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvTy
ConvDic::ConvDic(
- const String &rName,
+ const OUString &rName,
sal_Int16 nLang,
sal_Int16 nConvType,
- sal_Bool bBiDirectional,
- const String &rMainURL) :
+ sal_Bool bBiDirectional,
+ const OUString &rMainURL) :
aFlushListeners( GetLinguMutex() )
{
aName = rName;
@@ -188,7 +188,7 @@ ConvDic::ConvDic(
bIsModified = bIsActive = sal_False;
bIsReadonly = sal_False;
- if( rMainURL.Len() > 0 )
+ if( !rMainURL.isEmpty() )
{
sal_Bool bExists = sal_False;
bIsReadonly = IsReadOnly( rMainURL, &bExists );
@@ -232,7 +232,7 @@ void ConvDic::Load()
void ConvDic::Save()
{
DBG_ASSERT( !bNeedEntries, "saving while entries missing" );
- if (aMainURL.Len() == 0 || bNeedEntries)
+ if (aMainURL.isEmpty() || bNeedEntries)
return;
DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL");
diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx
index 375acbb..3261ffd 100644
--- a/linguistic/source/convdic.hxx
+++ b/linguistic/source/convdic.hxx
@@ -40,7 +40,7 @@
#define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary"
-sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType );
+sal_Bool IsConvDic( const OUString &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType );
struct StrLT
{
@@ -87,9 +87,9 @@ protected:
std::auto_ptr< PropTypeMap > pConvPropType;
- String aMainURL; // URL to file
- OUString aName;
- sal_Int16 nLanguage;
+ OUString aMainURL; // URL to file
+ OUString aName;
+ sal_Int16 nLanguage;
sal_Int16 nConversionType;
sal_Int16 nMaxLeftCharCount;
sal_Int16 nMaxRightCharCount;
@@ -108,11 +108,11 @@ protected:
void Save();
public:
- ConvDic( const String &rName,
+ ConvDic( const OUString &rName,
sal_Int16 nLanguage,
sal_Int16 nConversionType,
sal_Bool bBiDirectional,
- const String &rMainURL);
+ const OUString &rMainURL);
virtual ~ConvDic();
// XConversionDictionary
commit 6317e4fa97278c1b9f1ab76696bf816f3605a354
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 16:40:48 2013 +0200
convert linguistic/source/dlistimp.hxx from String to OUString
Change-Id: I6928f59bba5e744957f2b2aae34d2d057c147985
diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx
index 90cd018..841f409 100644
--- a/linguistic/source/dlistimp.cxx
+++ b/linguistic/source/dlistimp.cxx
@@ -302,7 +302,7 @@ DicList::~DicList()
void DicList::SearchForDictionaries(
DictionaryVec_t&rDicList,
- const String &rDicDirURL,
+ const OUString &rDicDirURL,
sal_Bool bIsWriteablePath )
{
osl::MutexGuard aGuard( GetLinguMutex() );
diff --git a/linguistic/source/dlistimp.hxx b/linguistic/source/dlistimp.hxx
index 5a824f7..620f4ea 100644
--- a/linguistic/source/dlistimp.hxx
+++ b/linguistic/source/dlistimp.hxx
@@ -88,7 +88,7 @@ class DicList :
void LaunchEvent(sal_Int16 nEvent, com::sun::star::uno::Sequence<
::com::sun::star::linguistic2::XDictionary > xDic);
void SearchForDictionaries( DictionaryVec_t &rDicList,
- const String &rDicDir, sal_Bool bIsWritePath );
+ const OUString &rDicDir, sal_Bool bIsWritePath );
sal_Int32 GetDicPos(const com::sun::star::uno::Reference<
::com::sun::star::linguistic2::XDictionary > &xDic);
commit 6629d1a1f277b60350b7df029ee436a208d532e7
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 16:39:52 2013 +0200
convert linguistic/source/hhconvdic.hxx from String to OUString
Change-Id: I6ab2fd0d66410f8e10ec4228d7261358c1d0afe2
diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx
index 829930e..a346442 100644
--- a/linguistic/source/hhconvdic.cxx
+++ b/linguistic/source/hhconvdic.cxx
@@ -84,7 +84,7 @@ sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType )
-HHConvDic::HHConvDic( const String &rName, const String &rMainURL ) :
+HHConvDic::HHConvDic( const OUString &rName, const OUString &rMainURL ) :
ConvDic( rName, LANGUAGE_KOREAN, ConversionDictionaryType::HANGUL_HANJA, sal_True, rMainURL )
{
}
diff --git a/linguistic/source/hhconvdic.hxx b/linguistic/source/hhconvdic.hxx
index a63a4ea..1ffda09 100644
--- a/linguistic/source/hhconvdic.hxx
+++ b/linguistic/source/hhconvdic.hxx
@@ -40,7 +40,7 @@ class HHConvDic :
HHConvDic & operator = (const HHConvDic &);
public:
- HHConvDic( const String &rName, const String &rMainURL );
+ HHConvDic( const OUString &rName, const OUString &rMainURL );
virtual ~HHConvDic();
// XConversionDictionary
commit 976075964e381bd277cd432d3e66ef75844068ea
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 16:38:50 2013 +0200
convert linguistic/source/lngsvcmgr.hxx from String to OUString
Change-Id: If9fd76687e1e361a6b29fe206edffd67a16cbb7f
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 3b7c5a4..b7fe110 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -1733,7 +1733,7 @@ void SAL_CALL
}
-sal_Bool LngSvcMgr::SaveCfgSvcs( const String &rServiceName )
+sal_Bool LngSvcMgr::SaveCfgSvcs( const OUString &rServiceName )
{
SAL_INFO( "linguistic", "linguistic: LngSvcMgr::SaveCfgSvcs" );
@@ -1742,28 +1742,28 @@ sal_Bool LngSvcMgr::SaveCfgSvcs( const String &rServiceName )
LinguDispatcher *pDsp = 0;
uno::Sequence< lang::Locale > aLocales;
- if (0 == rServiceName.CompareToAscii( SN_SPELLCHECKER ))
+ if (rServiceName == SN_SPELLCHECKER)
{
if (!pSpellDsp)
GetSpellCheckerDsp_Impl();
pDsp = pSpellDsp;
aLocales = getAvailableLocales( SN_SPELLCHECKER );
}
- else if (0 == rServiceName.CompareToAscii( SN_GRAMMARCHECKER ))
+ else if (rServiceName == SN_GRAMMARCHECKER)
{
if (!pGrammarDsp)
GetGrammarCheckerDsp_Impl();
pDsp = pGrammarDsp;
aLocales = getAvailableLocales( SN_GRAMMARCHECKER );
}
- else if (0 == rServiceName.CompareToAscii( SN_HYPHENATOR ))
+ else if (rServiceName == SN_HYPHENATOR)
{
if (!pHyphDsp)
GetHyphenatorDsp_Impl();
pDsp = pHyphDsp;
aLocales = getAvailableLocales( SN_HYPHENATOR );
}
- else if (0 == rServiceName.CompareToAscii( SN_THESAURUS ))
+ else if (rServiceName == SN_THESAURUS)
{
if (!pThesDsp)
GetThesaurusDsp_Impl();
diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx
index 0afdf5d..a21ae82 100644
--- a/linguistic/source/lngsvcmgr.hxx
+++ b/linguistic/source/lngsvcmgr.hxx
@@ -129,7 +129,7 @@ class LngSvcMgr :
void SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp );
void SetCfgServiceLists( ThesaurusDispatcher &rThesDsp );
- sal_Bool SaveCfgSvcs( const String &rServiceName );
+ sal_Bool SaveCfgSvcs( const OUString &rServiceName );
static void clearSvcInfoArray(SvcInfoArray *&rpInfo);
commit b2ff26cc4e9a012b67c7244ee75ab98898d02827
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 16:34:44 2013 +0200
convert include/linguistic/misc.hxx from String to OUString
Change-Id: I454c577d7b6c0994046de9cba076e6478a4ce309
diff --git a/include/linguistic/misc.hxx b/include/linguistic/misc.hxx
index 8e7b4b1..3d6321e 100644
--- a/include/linguistic/misc.hxx
+++ b/include/linguistic/misc.hxx
@@ -117,10 +117,10 @@ LNG_DLLPUBLIC bool LinguIsUnspecified( LanguageType nLanguage );
// checks if file pointed to by rURL is readonly
// and may also check return if such a file exists or not
-sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist = 0 );
+sal_Bool IsReadOnly( const OUString &rURL, sal_Bool *pbExist = 0 );
// checks if a file with the given URL exists
-sal_Bool FileExists( const String &rURL );
+sal_Bool FileExists( const OUString &rURL );
OUString GetDictionaryWriteablePath();
@@ -128,7 +128,7 @@ OUString GetDictionaryWriteablePath();
/// @returns an URL for a new and writable dictionary rDicName.
/// The URL will point to the path given by 'GetDictionaryWriteablePath'
-LNG_DLLPUBLIC String GetWritableDictionaryURL( const String &rDicName );
+LNG_DLLPUBLIC OUString GetWritableDictionaryURL( const OUString &rDicName );
LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPos );
@@ -139,14 +139,14 @@ LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const OUString &rTxt, sal_Int32 nPo
::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord );
-LNG_DLLPUBLIC sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage );
+LNG_DLLPUBLIC sal_Bool IsUpper( const OUString &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage );
-inline sal_Bool IsUpper( const String &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.Len(), nLanguage ); }
+inline sal_Bool IsUpper( const OUString &rText, sal_Int16 nLanguage ) { return IsUpper( rText, 0, rText.getLength(), nLanguage ); }
LNG_DLLPUBLIC CapType SAL_CALL capitalType(const OUString&, CharClass *);
-String ToLower( const String &rText, sal_Int16 nLanguage );
+OUString ToLower( const OUString &rText, sal_Int16 nLanguage );
LNG_DLLPUBLIC sal_Bool HasDigits( const OUString &rText );
-LNG_DLLPUBLIC sal_Bool IsNumeric( const String &rText );
+LNG_DLLPUBLIC sal_Bool IsNumeric( const OUString &rText );
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName );
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx
index d5b96bd..867dccf 100644
--- a/linguistic/source/misc.cxx
+++ b/linguistic/source/misc.cxx
@@ -392,12 +392,12 @@ uno::Sequence< sal_Int16 >
return aLangs;
}
-sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist )
+sal_Bool IsReadOnly( const OUString &rURL, sal_Bool *pbExist )
{
sal_Bool bRes = sal_False;
sal_Bool bExists = sal_False;
- if (rURL.Len() > 0)
+ if (!rURL.isEmpty())
{
try
{
@@ -583,7 +583,7 @@ osl::Mutex & lcl_GetCharClassMutex()
return aMutex;
}
-sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage )
+sal_Bool IsUpper( const OUString &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage )
{
MutexGuard aGuard( lcl_GetCharClassMutex() );
@@ -599,7 +599,7 @@ CapType SAL_CALL capitalType(const OUString& aTerm, CharClass * pCC)
sal_Int32 tlen = aTerm.getLength();
if ((pCC) && (tlen))
{
- String aStr(aTerm);
+ OUString aStr(aTerm);
sal_Int32 nc = 0;
for (sal_uInt16 tindex = 0; tindex < tlen; tindex++)
{
@@ -620,7 +620,7 @@ CapType SAL_CALL capitalType(const OUString& aTerm, CharClass * pCC)
return CAPTYPE_UNKNOWN;
}
-String ToLower( const String &rText, sal_Int16 nLanguage )
+OUString ToLower( const OUString &rText, sal_Int16 nLanguage )
{
MutexGuard aGuard( lcl_GetCharClassMutex() );
@@ -689,17 +689,17 @@ sal_Bool HasDigits( const OUString &rText )
return sal_False;
}
-sal_Bool IsNumeric( const String &rText )
+sal_Bool IsNumeric( const OUString &rText )
{
sal_Bool bRes = sal_False;
- xub_StrLen nLen = rText.Len();
- if (nLen)
+ if (!rText.isEmpty())
{
+ xub_StrLen nLen = rText.getLength();
bRes = sal_True;
xub_StrLen i = 0;
while (i < nLen)
{
- sal_Unicode cChar = rText.GetChar( i++ );
+ sal_Unicode cChar = rText[ i++ ];
if ( !((sal_Unicode)'0' <= cChar && cChar <= (sal_Unicode)'9') )
{
bRes = sal_False;
diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx
index eab239d..726493e 100644
--- a/linguistic/source/misc2.cxx
+++ b/linguistic/source/misc2.cxx
@@ -41,10 +41,10 @@ namespace linguistic
{
-sal_Bool FileExists( const String &rMainURL )
+sal_Bool FileExists( const OUString &rMainURL )
{
sal_Bool bExists = sal_False;
- if (rMainURL.Len())
+ if (!rMainURL.isEmpty())
{
try
{
@@ -123,7 +123,7 @@ OUString GetDictionaryWriteablePath()
{
uno::Sequence< OUString > aPaths( GetMultiPaths_Impl( "Dictionary", PATH_FLAG_WRITABLE ) );
DBG_ASSERT( aPaths.getLength() == 1, "Dictionary_writable path corrupted?" );
- String aRes;
+ OUString aRes;
if (aPaths.getLength() > 0)
aRes = aPaths[0];
return aRes;
@@ -134,10 +134,10 @@ uno::Sequence< OUString > GetDictionaryPaths( sal_Int16 nPathFlags )
return GetMultiPaths_Impl( "Dictionary", nPathFlags );
}
-String GetWritableDictionaryURL( const String &rDicName )
+OUString GetWritableDictionaryURL( const OUString &rDicName )
{
// new user writable dictionaries should be created in the 'writable' path
- String aDirName( GetDictionaryWriteablePath() );
+ OUString aDirName( GetDictionaryWriteablePath() );
// build URL to use for a new (persistent) dictionary
INetURLObject aURLObj;
commit f9ce731120f2e308e8fe71eb1a1d981590362afb
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 14:15:37 2013 +0200
convert include/svl/urlbmk.hxx from String to OUString
Change-Id: I68d54bf9f351130d0eab14c36b004ffbbb3185bc
diff --git a/include/svl/imageitm.hxx b/include/svl/imageitm.hxx
index 0a2e26f..66ae68f 100644
--- a/include/svl/imageitm.hxx
+++ b/include/svl/imageitm.hxx
@@ -23,8 +23,6 @@
#include "svl/svldllapi.h"
#include <svl/intitem.hxx>
-class String;
-
struct SfxImageItem_Impl;
class SVL_DLLPUBLIC SfxImageItem : public SfxInt16Item
{
diff --git a/include/svl/urlbmk.hxx b/include/svl/urlbmk.hxx
index cc04b22..672a9ec 100644
--- a/include/svl/urlbmk.hxx
+++ b/include/svl/urlbmk.hxx
@@ -37,23 +37,23 @@ class INetBookmark
*/
{
- String aUrl;
- String aDescr;
+ OUString aUrl;
+ OUString aDescr;
protected:
- void SetURL( const String& rS ) { aUrl = rS; }
- void SetDescription( const String& rS ) { aDescr = rS; }
+ void SetURL( const OUString& rS ) { aUrl = rS; }
+ void SetDescription( const OUString& rS ) { aDescr = rS; }
public:
- INetBookmark( const String &rUrl, const String &rDescr )
+ INetBookmark( const OUString &rUrl, const OUString &rDescr )
: aUrl( rUrl ), aDescr( rDescr )
{}
INetBookmark()
{}
- const String& GetURL() const { return aUrl; }
- const String& GetDescription() const { return aDescr; }
+ const OUString& GetURL() const { return aUrl; }
+ const OUString& GetDescription() const { return aDescr; }
};
commit 5926f48a4515f71fe33b5119e7d0255637ebf588
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 12:01:11 2013 +0200
convert some XubString to OUString in editeng
Change-Id: I49b9a4e148510d68807fbb720a8c32d542853f8b
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 4d4b41d..88d935d 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2751,9 +2751,9 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
for ( sal_Int32 nNode = nStartNode; nNode <= nEndNode; nNode++ )
{
ContentNode* pNode = aEditDoc.GetObject( nNode );
- const XubString& aNodeStr = pNode->GetString();
+ const OUString& aNodeStr = pNode->GetString();
xub_StrLen nStartPos = 0;
- xub_StrLen nEndPos = aNodeStr.Len();
+ xub_StrLen nEndPos = aNodeStr.getLength();
if ( nNode == nStartNode )
nStartPos = aSel.Min().GetIndex();
if ( nNode == nEndNode ) // can also be == nStart!
@@ -2827,7 +2827,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
nCurrentStart, nLen, &aOffsets ));
- if (!aNodeStr.Equals( aNewText, nCurrentStart, nLen ))
+ if (aNodeStr != aNewText.copy( nCurrentStart, nLen ))
{
aChgData.nStart = nCurrentStart;
aChgData.nLen = nLen;
@@ -2915,7 +2915,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
GetLanguage( EditPaM( pNode, nCurrentStart + 1 ) ),
nCurrentStart, nLen, &aOffsets ));
- if (!aNodeStr.Equals( aNewText, nCurrentStart, nLen ))
+ if ( aNodeStr != aNewText.copy( nCurrentStart, nLen ))
{
aChgData.nStart = nCurrentStart;
aChgData.nLen = nLen;
@@ -2953,7 +2953,7 @@ EditSelection ImpEditEngine::TransliterateText( const EditSelection& rSelection,
Sequence< sal_Int32 > aOffsets;
OUString aNewText( aTranslitarationWrapper.transliterate( aNodeStr, nLanguage, nCurrentStart, nLen, &aOffsets ) );
- if (!aNodeStr.Equals( aNewText, nCurrentStart, nLen ))
+ if (aNodeStr != aNewText.copy( nCurrentStart, nLen ))
{
aChgData.nStart = nCurrentStart;
aChgData.nLen = nLen;
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 6d6fed5..4861d73 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -164,12 +164,12 @@ class SvxDoCapitals
{
protected:
OutputDevice *pOut;
- const XubString &rTxt;
+ const OUString &rTxt;
const xub_StrLen nIdx;
const xub_StrLen nLen;
public:
- SvxDoCapitals( OutputDevice *_pOut, const XubString &_rTxt,
+ SvxDoCapitals( OutputDevice *_pOut, const OUString &_rTxt,
const xub_StrLen _nIdx, const xub_StrLen _nLen )
: pOut(_pOut), rTxt(_rTxt), nIdx(_nIdx), nLen(_nLen)
{ }
@@ -178,12 +178,12 @@ public:
virtual void DoSpace( const sal_Bool bDraw );
virtual void SetSpace();
- virtual void Do( const XubString &rTxt,
+ virtual void Do( const OUString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen,
const sal_Bool bUpper ) = 0;
inline OutputDevice *GetOut() { return pOut; }
- inline const XubString &GetTxt() const { return rTxt; }
+ inline const OUString &GetTxt() const { return rTxt; }
xub_StrLen GetIdx() const { return nIdx; }
xub_StrLen GetLen() const { return nLen; }
};
@@ -245,10 +245,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
// #108210#
// If strings differ work preparing the necessary snippet to address that
// potential difference
- const XubString aSnippet(rTxt, nIdx + nOldPos, nPos-nOldPos);
- XubString aNewText = CalcCaseMap(aSnippet);
+ const OUString aSnippet = rTxt.copy(nIdx + nOldPos, nPos-nOldPos);
+ OUString aNewText = CalcCaseMap(aSnippet);
- rDo.Do( aNewText, 0, aNewText.Len(), sal_True );
+ rDo.Do( aNewText, 0, aNewText.getLength(), sal_True );
}
else
{
@@ -275,10 +275,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
// #108210#
// If strings differ work preparing the necessary snippet to address that
// potential difference
- const XubString aSnippet(rTxt, nIdx + nOldPos, nPos - nOldPos);
- XubString aNewText = CalcCaseMap(aSnippet);
+ const OUString aSnippet = rTxt.copy(nIdx + nOldPos, nPos - nOldPos);
+ OUString aNewText = CalcCaseMap(aSnippet);
- rDo.Do( aNewText, 0, aNewText.Len(), sal_False );
+ rDo.Do( aNewText, 0, aNewText.getLength(), sal_False );
}
else
{
@@ -300,10 +300,10 @@ void SvxFont::DoOnCapitals(SvxDoCapitals &rDo, const xub_StrLen nPartLen) const
// #108210#
// If strings differ work preparing the necessary snippet to address that
// potential difference
- const XubString aSnippet(rTxt, nIdx + nOldPos, nPos - nOldPos);
- XubString aNewText = CalcCaseMap(aSnippet);
+ const OUString aSnippet = rTxt.copy(nIdx + nOldPos, nPos - nOldPos);
+ OUString aNewText = CalcCaseMap(aSnippet);
- rDo.Do( aNewText, 0, aNewText.Len(), sal_False );
+ rDo.Do( aNewText, 0, aNewText.getLength(), sal_False );
}
else
{
@@ -368,9 +368,9 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt,
{
// If strings differ work preparing the necessary snippet to address that
// potential difference
- const XubString aSnippet(rTxt, nIdx, nLen);
- XubString _aNewText = CalcCaseMap(aSnippet);
- nWidth = pOut->GetTextWidth( _aNewText, 0, _aNewText.Len() );
+ const OUString aSnippet = rTxt.copy(nIdx, nLen);
+ OUString _aNewText = CalcCaseMap(aSnippet);
+ nWidth = pOut->GetTextWidth( _aNewText, 0, _aNewText.getLength() );
}
else
{
@@ -590,7 +590,7 @@ protected:
short nKern;
public:
SvxDoGetCapitalSize( SvxFont *_pFnt, const OutputDevice *_pOut,
- const XubString &_rTxt, const xub_StrLen _nIdx,
+ const OUString &_rTxt, const xub_StrLen _nIdx,
const xub_StrLen _nLen, const short _nKrn )
: SvxDoCapitals( (OutputDevice*)_pOut, _rTxt, _nIdx, _nLen ),
pFont( _pFnt ),
@@ -599,13 +599,13 @@ public:
virtual ~SvxDoGetCapitalSize() {}
- virtual void Do( const XubString &rTxt, const xub_StrLen nIdx,
+ virtual void Do( const OUString &rTxt, const xub_StrLen nIdx,
const xub_StrLen nLen, const sal_Bool bUpper );
inline const Size &GetSize() const { return aTxtSize; };
};
-void SvxDoGetCapitalSize::Do( const XubString &_rTxt, const xub_StrLen _nIdx,
+void SvxDoGetCapitalSize::Do( const OUString &_rTxt, const xub_StrLen _nIdx,
const xub_StrLen _nLen, const sal_Bool bUpper )
{
Size aPartSize;
@@ -654,7 +654,7 @@ protected:
Point aSpacePos;
short nKern;
public:
- SvxDoDrawCapital( SvxFont *pFnt, OutputDevice *_pOut, const XubString &_rTxt,
+ SvxDoDrawCapital( SvxFont *pFnt, OutputDevice *_pOut, const OUString &_rTxt,
const xub_StrLen _nIdx, const xub_StrLen _nLen,
const Point &rPos, const short nKrn )
: SvxDoCapitals( _pOut, _rTxt, _nIdx, _nLen ),
@@ -666,7 +666,7 @@ public:
virtual ~SvxDoDrawCapital() {}
virtual void DoSpace( const sal_Bool bDraw );
virtual void SetSpace();
- virtual void Do( const XubString &rTxt, const xub_StrLen nIdx,
+ virtual void Do( const OUString &rTxt, const xub_StrLen nIdx,
const xub_StrLen nLen, const sal_Bool bUpper );
};
@@ -682,8 +682,7 @@ void SvxDoDrawCapital::DoSpace( const sal_Bool bDraw )
pFont->SetWordLineMode( sal_False );
pFont->SetTransparent( sal_True );
pFont->SetPhysFont( pOut );
- pOut->DrawStretchText( aSpacePos, nDiff, XubString( " ",
- RTL_TEXTENCODING_MS_1252 ), 0, 2 );
+ pOut->DrawStretchText( aSpacePos, nDiff, " ", 0, 2 );
pFont->SetWordLineMode( bWordWise );
pFont->SetTransparent( bTrans );
pFont->SetPhysFont( pOut );
@@ -697,7 +696,7 @@ void SvxDoDrawCapital::SetSpace()
aSpacePos.X() = aPos.X();
}
-void SvxDoDrawCapital::Do( const XubString &_rTxt, const xub_StrLen _nIdx,
+void SvxDoDrawCapital::Do( const OUString &_rTxt, const xub_StrLen _nIdx,
const xub_StrLen _nLen, const sal_Bool bUpper)
{
sal_uInt8 nProp = 0;
commit 3b8283a87ca937ed0d6c39d5ef71099e070fbb0c
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 11:57:22 2013 +0200
whack unused define REDUCEDSVXFONT
Change-Id: Id7be6b903a6acd526fa2cecd18347f40b9b4457d
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index c2b6507..6d6fed5 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -28,10 +28,7 @@
#include <editeng/svxfont.hxx>
#include <editeng/escapementitem.hxx>
-#ifndef REDUCEDSVXFONT
- const sal_Unicode CH_BLANK = sal_Unicode(' '); // ' ' Space character
- static sal_Char const sDoubleSpace[] = " ";
-#endif
+const sal_Unicode CH_BLANK = sal_Unicode(' '); // ' ' Space character
SvxFont::SvxFont()
@@ -685,7 +682,7 @@ void SvxDoDrawCapital::DoSpace( const sal_Bool bDraw )
pFont->SetWordLineMode( sal_False );
pFont->SetTransparent( sal_True );
pFont->SetPhysFont( pOut );
- pOut->DrawStretchText( aSpacePos, nDiff, XubString( sDoubleSpace,
+ pOut->DrawStretchText( aSpacePos, nDiff, XubString( " ",
RTL_TEXTENCODING_MS_1252 ), 0, 2 );
pFont->SetWordLineMode( bWordWise );
pFont->SetTransparent( bTrans );
commit be5b8202f80046546d855852e9e10cfd8f6fee85
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 11:37:13 2013 +0200
convert various bits in editeng from String to OUString
Change-Id: If8b0da1e6b6e3f1f0a0f4946c7741fd5aec66aa6
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index 80ef22b..45445c5 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -109,7 +109,7 @@ Paragraph* Outliner::Insert(const OUString& rText, sal_Int32 nAbsPos, sal_Int16
ImplBlockInsertionCallbacks( sal_True );
pPara = new Paragraph( nDepth );
pParaList->Insert( pPara, nAbsPos );
- pEditEngine->InsertParagraph( nAbsPos, String() );
+ pEditEngine->InsertParagraph( nAbsPos, OUString() );
DBG_ASSERT(pPara==pParaList->GetParagraph(nAbsPos),"Insert:Failed");
ImplInitDepth( nAbsPos, nDepth, sal_False );
pHdlParagraph = pPara;
@@ -749,8 +749,8 @@ void Outliner::ImplSetLevelDependendStyleSheet( sal_Int32 nPara, SfxStyleSheet*
if( nDepth < 0 )
nDepth = 0;
- String aNewStyleSheetName( pStyle->GetName() );
- aNewStyleSheetName.Erase( aNewStyleSheetName.Len()-1, 1 );
+ OUString aNewStyleSheetName( pStyle->GetName() );
+ aNewStyleSheetName = aNewStyleSheetName.copy( 0, aNewStyleSheetName.getLength()-1 );
aNewStyleSheetName += OUString::number( nDepth+1 );
SfxStyleSheet* pNewStyle = (SfxStyleSheet*)GetStyleSheetPool()->Find( aNewStyleSheetName, pStyle->GetFamily() );
DBG_ASSERT( pNewStyle, "AutoStyleSheetName - Style not found!" );
@@ -1522,7 +1522,7 @@ Size Outliner::ImplGetBulletSize( sal_Int32 nPara )
}
else if( pFmt->GetNumberingType() != SVX_NUM_BITMAP )
{
- String aBulletText = ImplGetBulletText( nPara );
+ OUString aBulletText = ImplGetBulletText( nPara );
OutputDevice* pRefDev = pEditEngine->GetRefDevice();
Font aBulletFont( ImpCalcBulletFont( nPara ) );
Font aRefFont( pRefDev->GetFont());
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 9e4e87e..829087d 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -77,7 +77,7 @@ void OutlinerView::Paint( const Rectangle& rRect, OutputDevice* pTargetDevice )
// For the first Paint/KeyInput/Drop an emty Outliner is turned into
// an Outliner with exactly one paragraph.
if( pOwner->bFirstParaIsEmpty )
- pOwner->Insert( String() );
+ pOwner->Insert( OUString() );
pEditView->Paint( rRect, pTargetDevice );
}
@@ -89,7 +89,7 @@ sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
// For the first Paint/KeyInput/Drop an emty Outliner is turned into
// an Outliner with exactly one paragraph.
if( pOwner->bFirstParaIsEmpty )
- pOwner->Insert( String() );
+ pOwner->Insert( OUString() );
sal_Bool bKeyProcessed = sal_False;
@@ -218,7 +218,7 @@ sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
SAL_WARN_IF( nTemp < 0, "editeng", "OutlinerView::PostKeyEvent - overflow");
if (nTemp >= 0)
{
- pOwner->Insert( String(),nTemp,pPara->GetDepth());
+ pOwner->Insert( OUString(),nTemp,pPara->GetDepth());
// Position the cursor
ESelection aTmpSel(nTemp,0,nTemp,0);
pEditView->SetSelection( aTmpSel );
@@ -236,7 +236,7 @@ sal_Bool OutlinerView::PostKeyEvent( const KeyEvent& rKEvt, Window* pFrameWin )
pOwner->UndoActionStart( OLUNDO_INSERT );
sal_Int32 nTemp = aSel.nEndPara;
nTemp++;
- pOwner->Insert( String(), nTemp, pPara->GetDepth()+1 );
+ pOwner->Insert( OUString(), nTemp, pPara->GetDepth()+1 );
// Position the cursor
ESelection aTmpSel(nTemp,0,nTemp,0);
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 893c2d1..1f6f744 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -460,7 +460,7 @@ void SvxRTFParser::ReadFontTable()
int _nOpenBrakets = 1; // the first was already detected earlier!!
Font* pFont = new Font();
short nFontNo(0), nInsFontNo (0);
- String sAltNm, sFntNm;
+ OUString sAltNm, sFntNm;
sal_Bool bIsAltFntNm = sal_False, bCheckNewFont;
CharSet nSystemChar = lcl_GetDefaultTextEncodingForRTF();
@@ -567,18 +567,18 @@ void SvxRTFParser::ReadFontTable()
break;
}
- if( bCheckNewFont && 1 >= _nOpenBrakets && sFntNm.Len() ) // one font is ready
+ if( bCheckNewFont && 1 >= _nOpenBrakets && !sFntNm.isEmpty() ) // one font is ready
{
// All data from the font is available, so off to the table
- if (sAltNm.Len())
- (sFntNm += ';' ) += sAltNm;
+ if (!sAltNm.isEmpty())
+ sFntNm = sFntNm + ";" + sAltNm;
pFont->SetName( sFntNm );
aFontTbl.insert( nInsFontNo, pFont );
pFont = new Font();
pFont->SetCharSet( nSystemChar );
- sAltNm.Erase();
- sFntNm.Erase();
+ sAltNm = "";
+ sFntNm = "";
}
}
// the last one we have to delete manually
commit d169dd267998ec503a855f7f5232a725596b7d30
Author: Noel Grandin <noel at peralex.com>
Date: Tue Sep 10 11:33:00 2013 +0200
convert editeng/source/editeng/*.cxx from String to OUString
Change-Id: I4063b427f050de0a179e6436fb647614bacd704c
diff --git a/editeng/source/editeng/editdbg.cxx b/editeng/source/editeng/editdbg.cxx
index 4006918..d250699 100644
--- a/editeng/source/editeng/editdbg.cxx
+++ b/editeng/source/editeng/editdbg.cxx
@@ -474,7 +474,7 @@ void EditDbg::ShowEditEngineData( EditEngine* pEE, sal_Bool bInfoBox )
}
fclose( fp );
if ( bInfoBox )
- InfoBox(0, String( RTL_CONSTASCII_USTRINGPARAM( "D:\\DEBUG.LOG !" ) ) ).Execute();
+ InfoBox(0, OUString( "D:\\DEBUG.LOG !" ) ).Execute();
}
#if OSL_DEBUG_LEVEL > 2
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 0a5e5a5..19f0186 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -2113,12 +2113,12 @@ OUString EditDoc::GetText( LineEnd eEnd ) const
sal_Int32 nLastNode = nNodes-1;
for ( sal_Int32 nNode = 0; nNode < nNodes; nNode++ )
{
- String aTmp( GetParaAsString( GetObject(nNode) ) );
- memcpy( pCur, aTmp.GetBuffer(), aTmp.Len()*sizeof(sal_Unicode) );
- pCur += aTmp.Len();
+ OUString aTmp( GetParaAsString( GetObject(nNode) ) );
+ memcpy( pCur, aTmp.getStr(), aTmp.getLength() * sizeof(sal_Unicode) );
+ pCur += aTmp.getLength();
if ( nSepSize && ( nNode != nLastNode ) )
{
- memcpy( pCur, aSep.getStr(), nSepSize*sizeof(sal_Unicode ) );
+ memcpy( pCur, aSep.getStr(), nSepSize * sizeof(sal_Unicode ) );
pCur += nSepSize;
}
}
@@ -3042,7 +3042,7 @@ SvxColorItem* SvxColorList::GetObject( size_t nIndex )
}
EditEngineItemPool::EditEngineItemPool( sal_Bool bPersistenRefCounts )
- : SfxItemPool( String( "EditEngineItemPool", RTL_TEXTENCODING_ASCII_US ), EE_ITEMS_START, EE_ITEMS_END,
+ : SfxItemPool( OUString( "EditEngineItemPool" ), EE_ITEMS_START, EE_ITEMS_END,
aItemInfos, 0, bPersistenRefCounts )
{
SetVersionMap( 1, 3999, 4015, aV1Map );
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index d45347c..8e8e15f 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -1307,7 +1307,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
EditPaM aStart( pImpEditEngine->WordLeft( aCurSel.Max() ) );
aCurSel = pImpEditEngine->InsertText(
EditSelection( aStart, aCurSel.Max() ), aAutoText );
- pImpEditEngine->SetAutoCompleteText( String(), sal_True );
+ pImpEditEngine->SetAutoCompleteText( OUString(), sal_True );
}
}
pImpEditEngine->UndoActionEnd( EDITUNDO_INSERT );
@@ -1362,10 +1362,10 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
( pImpEditEngine->aWordDelimiters.indexOf( aCurSel.Max().GetNode()->GetChar( nIndex ) ) != -1 ) )
{
EditPaM aStart( pImpEditEngine->WordLeft( aCurSel.Max() ) );
- String aWord = pImpEditEngine->GetSelected( EditSelection( aStart, aCurSel.Max() ) );
- if ( aWord.Len() >= 3 )
+ OUString aWord = pImpEditEngine->GetSelected( EditSelection( aStart, aCurSel.Max() ) );
+ if ( aWord.getLength() >= 3 )
{
- String aComplete;
+ OUString aComplete;
LanguageType eLang = pImpEditEngine->GetLanguage( EditPaM( aStart.GetNode(), aStart.GetIndex()+1));
LanguageTag aLanguageTag( eLang);
@@ -1394,7 +1394,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
}
}
- if ( !aComplete.Len() )
+ if ( aComplete.isEmpty() )
{
xItem = pImpEditEngine->xLocaleDataWrapper->getDefaultCalendarMonths();
sal_Int32 nMonthCount = xItem.getLength();
@@ -1410,7 +1410,7 @@ sal_Bool EditEngine::PostKeyEvent( const KeyEvent& rKeyEvent, EditView* pEditVie
}
}
- if( aComplete.Len() && ( ( aWord.Len() + 1 ) < aComplete.Len() ) )
+ if( !aComplete.isEmpty() && ( ( aWord.getLength() + 1 ) < aComplete.getLength() ) )
{
pImpEditEngine->SetAutoCompleteText( aComplete, sal_False );
Point aPos = pImpEditEngine->PaMtoEditCursor( aCurSel.Max() ).TopLeft();
@@ -2482,7 +2482,7 @@ void EditEngine::RemoveFields( sal_Bool bKeepFieldText, TypeId aType )
{
DBG_ASSERT( dynamic_cast<const SvxFieldItem*>(rAttr.GetItem()), "no field item..." );
EditSelection aSel( EditPaM(pNode, rAttr.GetStart()), EditPaM(pNode, rAttr.GetEnd()) );
- String aFieldText = static_cast<const EditCharAttribField&>(rAttr).GetFieldValue();
+ OUString aFieldText = static_cast<const EditCharAttribField&>(rAttr).GetFieldValue();
pImpEditEngine->ImpInsertText( aSel, aFieldText );
}
}
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index 5099309..8e35a57 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1106,7 +1106,7 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
|| ( bSymbolPara && ( rFontItem.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
{
// Not correctly converted
- String aPart( rC.GetText(), rAttr.GetStart(), rAttr.GetEnd() - rAttr.GetStart() );
+ OUString aPart = rC.GetText().copy( rAttr.GetStart(), rAttr.GetEnd() - rAttr.GetStart() );
OString aNew(OUStringToOString(aPart, rFontItem.GetCharSet()));
aBuffer.remove(rAttr.GetStart(), rAttr.GetEnd() - rAttr.GetStart());
aBuffer.insert(rAttr.GetStart(), aNew);
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 3819cda..8f331c8 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -873,7 +873,7 @@ static Image lcl_GetImageFromPngUrl( const OUString &rFileUrl )
// aTmp = lcl_Win_GetShortPathName( aTmp );
#endif
Graphic aGraphic;
- const String aFilterName( IMP_PNG );
+ const OUString aFilterName( IMP_PNG );
if( GRFILTER_OK == GraphicFilter::LoadGraphic( aTmp, aFilterName, aGraphic ) )
{
aRes = Image( aGraphic.GetBitmapEx() );
@@ -903,7 +903,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
aPaM2.GetIndex()++;
// Are there any replace suggestions?
- String aSelected( GetSelected() );
+ OUString aSelected( GetSelected() );
//
// restrict the maximal number of suggestions displayed
// in the context menu.
@@ -931,7 +931,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
LanguageType nGuessLangPara = LANGUAGE_NONE;
if (xSpellAlt.is() && xLangGuesser.is())
{
- String aParaText;
+ OUString aParaText;
ContentNode *pNode = aPaM.GetNode();
if (pNode)
{
@@ -954,12 +954,12 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
nGuessLangPara = nGuessLangWord;
aPopupMenu.InsertSeparator();
- String aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
- String aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
- String aWordStr( EE_RESSTR( RID_STR_WORD ) );
- aWordStr.SearchAndReplace( String( "%x" ), aTmpWord );
- String aParaStr( EE_RESSTR( RID_STR_PARAGRAPH ) );
- aParaStr.SearchAndReplace( String( "%x" ), aTmpPara );
+ OUString aTmpWord( SvtLanguageTable::GetLanguageString( nGuessLangWord ) );
+ OUString aTmpPara( SvtLanguageTable::GetLanguageString( nGuessLangPara ) );
+ OUString aWordStr( EE_RESSTR( RID_STR_WORD ) );
+ aWordStr = aWordStr.replaceFirst( "%x", aTmpWord );
+ OUString aParaStr( EE_RESSTR( RID_STR_PARAGRAPH ) );
+ aParaStr = aParaStr.replaceFirst( "%x", aTmpPara );
aPopupMenu.InsertItem( MN_WORDLANGUAGE, aWordStr );
aPopupMenu.SetHelpId( MN_WORDLANGUAGE, HID_EDITENG_SPELLER_WORDLANGUAGE );
aPopupMenu.InsertItem( MN_PARALANGUAGE, aParaStr );
@@ -983,7 +983,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
{
for ( sal_uInt16 nW = 0; nW < nWords; nW++ )
{
- String aAlternate( pAlt[nW] );
+ OUString aAlternate( pAlt[nW] );
aPopupMenu.InsertItem( MN_ALTSTART+nW, aAlternate, 0, OString(), nW );
pAutoMenu->InsertItem( MN_AUTOSTART+nW, aAlternate, 0, OString(), nW );
}
@@ -1058,7 +1058,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
sal_uInt16 nId = aPopupMenu.Execute( pImpEditView->GetWindow(), aTempRect, POPUPMENU_NOMOUSEUPCLOSE );
if ( nId == MN_IGNORE )
{
- String aWord = pImpEditView->SpellIgnoreOrAddWord( sal_False );
+ OUString aWord = pImpEditView->SpellIgnoreOrAddWord( sal_False );
if ( pCallBack )
{
SpellCallbackInfo aInf( SPELLCMD_IGNOREWORD, aWord );
@@ -1109,13 +1109,13 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
}
else
{
- SpellCallbackInfo aInf( SPELLCMD_STARTSPELLDLG, String() );
+ SpellCallbackInfo aInf( SPELLCMD_STARTSPELLDLG, OUString() );
pCallBack->Call( &aInf );
}
}
else if ( nId >= MN_DICTSTART || nId == MN_INSERT_SINGLE )
{
- String aDicName;
+ OUString aDicName;
if (nId >= MN_DICTSTART)
aDicName = pInsertMenu->GetItemText(nId);
else
@@ -1126,7 +1126,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
xDic = xDicList->getDictionaryByName( aDicName );
if (xDic.is())
- xDic->add( aSelected, sal_False, String() );
+ xDic->add( aSelected, sal_False, OUString() );
// save modified user-dictionary if it is persistent
Reference< frame::XStorable > xSavDic( xDic, UNO_QUERY );
if (xSavDic.is())
@@ -1145,7 +1145,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
else if ( nId >= MN_AUTOSTART )
{
DBG_ASSERT(nId - MN_AUTOSTART < aAlt.getLength(), "index out of range");
- String aWord = pAlt[nId - MN_AUTOSTART];
+ OUString aWord = pAlt[nId - MN_AUTOSTART];
SvxAutoCorrect* pAutoCorrect = SvxAutoCorrCfg::Get().GetAutoCorrect();
if ( pAutoCorrect )
pAutoCorrect->PutText( aSelected, aWord, PIMPEE->GetLanguage( aPaM2 ) );
@@ -1154,7 +1154,7 @@ void EditView::ExecuteSpellPopup( const Point& rPosPixel, Link* pCallBack )
else if ( nId >= MN_ALTSTART ) // Replace
{
DBG_ASSERT(nId - MN_ALTSTART < aAlt.getLength(), "index out of range");
- String aWord = pAlt[nId - MN_ALTSTART];
+ OUString aWord = pAlt[nId - MN_ALTSTART];
InsertText( aWord );
}
else
@@ -1448,13 +1448,13 @@ Selection EditView::GetSurroundingTextSelection() const
{
EditSelection aSel( pImpEditView->GetEditSelection() );
aSel.Adjust( PIMPE->GetEditDoc() );
- String aStr = PIMPE->GetSelected(aSel);
+ OUString aStr = PIMPE->GetSelected(aSel);
// Stop reconversion if the selected text includes a line break.
- if ( aStr.Search( 0x0A ) == STRING_NOTFOUND )
- return Selection( 0, aSelection.nEndPos - aSelection.nStartPos );
+ if ( aStr.indexOf( 0x0A ) == -1 )
+ return Selection( 0, aSelection.nEndPos - aSelection.nStartPos );
else
- return Selection( 0, 0 );
+ return Selection( 0, 0 );
}
else
{
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index dc42980..4ac3157 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -166,7 +166,7 @@ void EditSpellWrapper::ChangeWord( const OUString& rNewWord,
// If there is a dot Punkt after the word, this dot will be stripped away.
// If '"' => PreStripped.
- String aNewWord( rNewWord );
+ OUString aNewWord( rNewWord );
pEditView->InsertText( aNewWord );
CheckSpellTo();
}
@@ -677,7 +677,7 @@ sal_Bool EdtAutoCorrDoc::SetINetAttr( sal_uInt16 nStt, sal_uInt16 nEnd,
{
// Turn the Text into a command field ...
EditSelection aSel( EditPaM( pCurNode, nStt ), EditPaM( pCurNode, nEnd ) );
- String aText = mpEditEngine->GetSelected(aSel);
+ OUString aText = mpEditEngine->GetSelected(aSel);
aSel = mpEditEngine->DeleteSelection(aSel);
SAL_WARN_IF(nCursor < nEnd, "editeng",
"Cursor in the heart of the action?!");
@@ -735,10 +735,10 @@ sal_Bool EdtAutoCorrDoc::ChgAutoCorrWord( sal_uInt16& rSttPos,
// shortcut in Auto
bAllowUndoAction = false; // Not anymore ...
- String aShort( pCurNode->Copy( rSttPos, nEndPos - rSttPos ) );
+ OUString aShort( pCurNode->Copy( rSttPos, nEndPos - rSttPos ) );
bool bRet = false;
- if( !aShort.Len() )
+ if( aShort.isEmpty() )
return bRet;
LanguageType eLang = mpEditEngine->GetLanguage( EditPaM( pCurNode, rSttPos+1 ) );
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index 6b6f35d..7106ee4 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -169,7 +169,7 @@ void EditHTMLParser::NextToken( int nToken )
{
if ( bInPara )
{
- ImpInsertText( String( RTL_CONSTASCII_USTRINGPARAM( " " ) ) );
+ ImpInsertText( OUString( " " ) );
}
}
break;
@@ -189,10 +189,10 @@ void EditHTMLParser::NextToken( int nToken )
if ( !bInPara )
StartPara( false );
- String aText = aToken;
- if ( aText.Len() && ( aText.GetChar( 0 ) == ' ' )
+ OUString aText = aToken;
+ if ( !aText.isEmpty() && ( aText[ 0 ] == ' ' )
&& ThrowAwayBlank() && !IsReadPRE() )
- aText.Erase( 0, 1 );
+ aText = aText.copy( 1 );
if ( pCurAnchor )
{
@@ -203,12 +203,11 @@ void EditHTMLParser::NextToken( int nToken )
// Only written until HTML with 319?
if ( IsReadPRE() )
{
- sal_uInt16 nTabPos = aText.Search( '\t', 0 );
- while ( nTabPos != STRING_NOTFOUND )
+ sal_Int32 nTabPos = aText.indexOf( '\t');
+ while ( nTabPos != -1 )
{
- aText.Erase( nTabPos, 1 );
- aText.Insert( String( RTL_CONSTASCII_USTRINGPARAM( " " ) ), nTabPos );
- nTabPos = aText.Search( '\t', nTabPos+8 );
+ aText = aText.replaceAt( nTabPos, 1, " " );
+ nTabPos = aText.indexOf( '\t', nTabPos+8 );
}
}
ImpInsertText( aText );
@@ -669,7 +668,7 @@ void EditHTMLParser::ImpSetStyleSheet( sal_uInt16 nHLevel )
void EditHTMLParser::ImpInsertText( const OUString& rText )
{
- String aText( rText );
+ OUString aText( rText );
if (mpEditEngine->IsImportHandlerSet())
{
ImportInfo aImportInfo(HTMLIMP_INSERTTEXT, this, mpEditEngine->CreateESelection(aCurSel));
@@ -769,7 +768,7 @@ void EditHTMLParser::AnchorStart()
if ( !pCurAnchor )
{
const HTMLOptions& aOptions = GetOptions();
- String aRef;
+ OUString aRef;
for ( size_t i = 0, n = aOptions.size(); i < n; ++i )
{
@@ -782,10 +781,10 @@ void EditHTMLParser::AnchorStart()
}
}
- if ( aRef.Len() )
+ if ( !aRef.isEmpty() )
{
- String aURL = aRef;
- if ( aURL.Len() && ( aURL.GetChar( 0 ) != '#' ) )
+ OUString aURL = aRef;
+ if ( !aURL.isEmpty() && ( aURL[ 0 ] != '#' ) )
{
INetURLObject aTargetURL;
INetURLObject aRootURL( aBaseURL );
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index e5989b9..9e2e265 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -235,7 +235,7 @@ void EditRTFParser::UnknownAttrToken( int nToken, SfxItemSet* )
void EditRTFParser::InsertText()
{
- String aText( aToken );
+ OUString aText( aToken );
if (mpEditEngine->IsImportHandlerSet())
{
ImportInfo aImportInfo(RTFIMP_INSERTTEXT, this, mpEditEngine->CreateESelection(aCurSel));
@@ -439,8 +439,8 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle )
if ( pStyle )
return pStyle;
- String aName( pRTFStyle->sName );
- String aParent;
+ OUString aName( pRTFStyle->sName );
+ OUString aParent;
if ( pRTFStyle->nBasedOn )
{
SvxRTFStyleTbl::iterator it = GetStyleTbl().find( pRTFStyle->nBasedOn );
@@ -458,7 +458,7 @@ SfxStyleSheet* EditRTFParser::CreateStyleSheet( SvxRTFStyleType* pRTFStyle )
ConvertAndPutItems( pStyle->GetItemSet(), pRTFStyle->aAttrSet );
// 2) As long as Parent is not in the pool, also create this ...
- if ( aParent.Len() && ( aParent != aName ) )
+ if ( !aParent.isEmpty() && ( aParent != aName ) )
{
SfxStyleSheet* pS = (SfxStyleSheet*)mpEditEngine->GetStyleSheetPool()->Find( aParent, SFX_STYLE_FAMILY_ALL );
if ( !pS )
@@ -502,8 +502,8 @@ void EditRTFParser::ReadField()
int _nOpenBrakets = 1; // the first was already detected earlier
sal_Bool bFldInst = sal_False;
sal_Bool bFldRslt = sal_False;
- String aFldInst;
- String aFldRslt;
+ OUString aFldInst;
+ OUString aFldRslt;
while( _nOpenBrakets && IsParserWorking() )
{
@@ -542,17 +542,17 @@ void EditRTFParser::ReadField()
break;
}
}
- if ( aFldInst.Len() )
+ if ( !aFldInst.isEmpty() )
{
- String aHyperLinkMarker( RTL_CONSTASCII_USTRINGPARAM( "HYPERLINK " ) );
- if ( aFldInst.CompareIgnoreCaseToAscii( aHyperLinkMarker, aHyperLinkMarker.Len() ) == COMPARE_EQUAL )
+ OUString aHyperLinkMarker( "HYPERLINK " );
+ if ( aFldInst.startsWithIgnoreAsciiCase( aHyperLinkMarker ) )
{
- aFldInst.Erase( 0, aHyperLinkMarker.Len() );
+ aFldInst = aFldInst.copy( aHyperLinkMarker.getLength() );
aFldInst = comphelper::string::strip(aFldInst, ' ');
- aFldInst.Erase( 0, 1 ); // "
- aFldInst.Erase( aFldInst.Len()-1, 1 ); // "
+ // strip start and end quotes
+ aFldInst = aFldInst.copy( 1, aFldInst.getLength()-2 );
- if ( !aFldRslt.Len() )
+ if ( aFldRslt.isEmpty() )
aFldRslt = aFldInst;
SvxFieldItem aField( SvxURLField( aFldInst, aFldRslt, SVXURLFORMAT_REPR ), EE_FEATURE_FIELD );
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 6b610a4..0b33f13 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1128,7 +1128,7 @@ OUString ImpEditView::SpellIgnoreOrAddWord( sal_Bool bAdd )
{
Reference< XDictionary > xDic( SvxGetIgnoreAllList(), UNO_QUERY );
if (xDic.is())
- xDic->add( aWord, sal_False, String() );
+ xDic->add( aWord, sal_False, OUString() );
}
EditDoc& rDoc = pEditEngine->GetEditDoc();
sal_Int32 nNodes = rDoc.Count();
@@ -1304,8 +1304,8 @@ void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::dat
uno::Any aData = xDataObj->getTransferData( aFlavor );
OUString aTmpText;
aData >>= aTmpText;
- String aText(convertLineEnd(aTmpText, LINEEND_LF));
- aText.SearchAndReplaceAll( LINE_SEP, ' ' );
+ OUString aText(convertLineEnd(aTmpText, LINEEND_LF));
+ aText = aText.replaceAll( OUString(LINE_SEP), " " );
aSel = pEditEngine->InsertText(aSel, aText);
}
catch( ... )
@@ -1317,7 +1317,7 @@ void ImpEditView::Paste( ::com::sun::star::uno::Reference< ::com::sun::star::dat
else
{
aSel = pEditEngine->InsertText(
- xDataObj, String(), aSel.Min(),
+ xDataObj, OUString(), aSel.Min(),
bUseSpecial && pEditEngine->GetInternalEditStatus().AllowPasteSpecial());
}
@@ -1728,7 +1728,7 @@ void ImpEditView::drop( const ::com::sun::star::datatransfer::dnd::DropTargetDro
pEditEngine->HandleBeginPasteOrDrop(aPasteOrDropInfos);
EditSelection aNewSel = pEditEngine->InsertText(
- xDataObj, String(), aPaM, pEditEngine->GetInternalEditStatus().AllowPasteSpecial());
+ xDataObj, OUString(), aPaM, pEditEngine->GetInternalEditStatus().AllowPasteSpecial());
aPasteOrDropInfos.nEndPara = pEditEngine->GetEditDoc().GetPos( aNewSel.Max().GetNode() );
pEditEngine->HandleEndPasteOrDrop(aPasteOrDropInfos);
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 46c3b61..d348219 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -271,7 +271,7 @@ OUString ImpEditEngine::GetSelected( const EditSelection& rSel, const LineEnd eE
if ( !rSel.HasRange() )
return aText;
- String aSep = EditDoc::GetSepStr( eEnd );
+ OUString aSep = EditDoc::GetSepStr( eEnd );
EditSelection aSel( rSel );
aSel.Adjust( aEditDoc );
@@ -309,7 +309,7 @@ sal_Bool ImpEditEngine::MouseButtonDown( const MouseEvent& rMEvt, EditView* pVie
SetActiveView( pView );
if (!GetAutoCompleteText().isEmpty())
- SetAutoCompleteText( String(), sal_True );
+ SetAutoCompleteText( OUString(), sal_True );
GetSelEngine().SelMouseButtonDown( rMEvt );
// Special treatment
@@ -353,10 +353,10 @@ void ImpEditEngine::Command( const CommandEvent& rCEvt, EditView* pView )
pView->DeleteSelected();
delete mpIMEInfos;
EditPaM aPaM = pView->GetImpEditView()->GetEditSelection().Max();
- String aOldTextAfterStartPos = aPaM.GetNode()->Copy( aPaM.GetIndex() );
- sal_uInt16 nMax = aOldTextAfterStartPos.Search( CH_FEATURE );
- if ( nMax != STRING_NOTFOUND ) // don't overwrite features!
- aOldTextAfterStartPos.Erase( nMax );
+ OUString aOldTextAfterStartPos = aPaM.GetNode()->Copy( aPaM.GetIndex() );
+ sal_Int32 nMax = aOldTextAfterStartPos.indexOf( CH_FEATURE );
+ if ( nMax != -1 ) // don't overwrite features!
+ aOldTextAfterStartPos = aOldTextAfterStartPos.copy( 0, nMax );
mpIMEInfos = new ImplIMEInfos( aPaM, aOldTextAfterStartPos );
mpIMEInfos->bWasCursorOverwrite = !pView->IsInsertMode();
UndoActionStart( EDITUNDO_INSERT );
@@ -929,17 +929,17 @@ EditPaM ImpEditEngine::CursorVisualStartEnd( EditView* pEditView, const EditPaM&
if ( !bEmptyLine )
{
- String aLine(aPaM.GetNode()->GetString(), pLine->GetStart(), pLine->GetEnd() - pLine->GetStart());
+ OUString aLine = aPaM.GetNode()->GetString().copy(pLine->GetStart(), pLine->GetEnd() - pLine->GetStart());
- const sal_Unicode* pLineString = aLine.GetBuffer();
+ const sal_Unicode* pLineString = aLine.getStr();
UErrorCode nError = U_ZERO_ERROR;
- UBiDi* pBidi = ubidi_openSized( aLine.Len(), 0, &nError );
+ UBiDi* pBidi = ubidi_openSized( aLine.getLength(), 0, &nError );
const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/;
- ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW
+ ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.getLength(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW
- sal_uInt16 nVisPos = bStart ? 0 : aLine.Len()-1;
+ sal_uInt16 nVisPos = bStart ? 0 : aLine.getLength()-1;
sal_uInt16 nLogPos = (sal_uInt16)ubidi_getLogicalIndex( pBidi, nVisPos, &nError );
ubidi_close( pBidi );
@@ -1048,20 +1048,20 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM
sal_Bool bGotoStartOfNextLine = sal_False;
sal_Bool bGotoEndOfPrevLine = sal_False;
- String aLine(aPaM.GetNode()->GetString(), pLine->GetStart(), pLine->GetEnd() - pLine->GetStart());
+ OUString aLine = aPaM.GetNode()->GetString().copy(pLine->GetStart(), pLine->GetEnd() - pLine->GetStart());
sal_uInt16 nPosInLine = aPaM.GetIndex() - pLine->GetStart();
- const sal_Unicode* pLineString = aLine.GetBuffer();
+ const sal_Unicode* pLineString = aLine.getStr();
UErrorCode nError = U_ZERO_ERROR;
- UBiDi* pBidi = ubidi_openSized( aLine.Len(), 0, &nError );
+ UBiDi* pBidi = ubidi_openSized( aLine.getLength(), 0, &nError );
const UBiDiLevel nBidiLevel = IsRightToLeft( nPara ) ? 1 /*RTL*/ : 0 /*LTR*/;
- ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW
+ ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(pLineString), aLine.getLength(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW
if ( !pEditView->IsInsertMode() )
{
- sal_Bool bEndOfLine = nPosInLine == aLine.Len();
+ sal_Bool bEndOfLine = nPosInLine == aLine.getLength();
sal_uInt16 nVisPos = (sal_uInt16)ubidi_getVisualIndex( pBidi, !bEndOfLine ? nPosInLine : nPosInLine-1, &nError );
if ( bVisualToLeft )
{
@@ -1071,7 +1071,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM
}
else
{
- bGotoStartOfNextLine = nVisPos == (aLine.Len() - 1);
+ bGotoStartOfNextLine = nVisPos == (aLine.getLength() - 1);
if ( !bEndOfLine )
nVisPos++;
}
@@ -1109,7 +1109,7 @@ EditPaM ImpEditEngine::CursorVisualLeftRight( EditView* pEditView, const EditPaM
}
bGotoEndOfPrevLine = nVisPos < 0;
- bGotoStartOfNextLine = nVisPos >= aLine.Len();
+ bGotoStartOfNextLine = nVisPos >= aLine.getLength();
if ( !bGotoEndOfPrevLine && !bGotoStartOfNextLine )
{
@@ -1553,8 +1553,8 @@ EditSelection ImpEditEngine::SelectSentence( const EditSelection& rCurSel )
const EditPaM& rPaM = rCurSel.Min();
const ContentNode* pNode = rPaM.GetNode();
// #i50710# line breaks are marked with 0x01 - the break iterator prefers 0x0a for that
- String sParagraph = pNode->GetString();
- sParagraph.SearchAndReplaceAll(0x01,0x0a);
+ OUString sParagraph = pNode->GetString();
+ sParagraph = sParagraph.replaceAll(OUString(0x01), OUString(0x0a));
//return Null if search starts at the beginning of the string
sal_Int32 nStart = rPaM.GetIndex() ? _xBI->beginOfSentence( sParagraph, rPaM.GetIndex(), GetLocale( rPaM ) ) : 0;
@@ -1590,11 +1590,11 @@ sal_Bool ImpEditEngine::IsInputSequenceCheckingRequired( sal_Unicode nChar, cons
return bIsSequenceChecking;
}
-static bool lcl_HasStrongLTR ( const String& rTxt, xub_StrLen nStart, xub_StrLen nEnd )
+static bool lcl_HasStrongLTR ( const OUString& rTxt, xub_StrLen nStart, xub_StrLen nEnd )
{
for ( xub_StrLen nCharIdx = nStart; nCharIdx < nEnd; ++nCharIdx )
{
- const UCharDirection nCharDir = u_charDirection ( rTxt.GetChar ( nCharIdx ));
+ const UCharDirection nCharDir = u_charDirection ( rTxt[ nCharIdx ]);
if ( nCharDir == U_LEFT_TO_RIGHT ||
nCharDir == U_LEFT_TO_RIGHT_EMBEDDING ||
nCharDir == U_LEFT_TO_RIGHT_OVERRIDE )
@@ -1616,7 +1616,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
{
uno::Reference < i18n::XBreakIterator > _xBI( ImplGetBreakIterator() );
- String aText = pNode->GetString();
+ OUString aText = pNode->GetString();
// To handle fields put the character from the field in the string,
// because endOfScript( ... ) will skip the CH_FEATURE, because this is WEAK
@@ -1626,7 +1626,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
OUString aFldText = static_cast<const EditCharAttribField*>(pField)->GetFieldValue();
if ( !aFldText.isEmpty() )
{
- aText.SetChar( pField->GetStart(), aFldText.getStr()[0] );
+ aText = aText.replaceAt( pField->GetStart(), 1, aFldText.copy(0,1) );
short nFldScriptType = _xBI->getScriptType( aFldText, 0 );
for ( sal_uInt16 nCharInField = 1; nCharInField < aFldText.getLength(); nCharInField++ )
@@ -1637,14 +1637,14 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara )
if ( nFldScriptType == i18n::ScriptType::WEAK )
{
nFldScriptType = nTmpType;
- aText.SetChar( pField->GetStart(), aFldText.getStr()[nCharInField] );
+ aText = aText.replaceAt( pField->GetStart(), 1, aFldText.copy(nCharInField,1) );
}
// ... but if the first one is LATIN, and there are CJK or CTL chars too,
// we prefer that ScripType because we need an other font.
if ( ( nTmpType == i18n::ScriptType::ASIAN ) || ( nTmpType == i18n::ScriptType::COMPLEX ) )
{
- aText.SetChar( pField->GetStart(), aFldText.getStr()[nCharInField] );
+ aText = aText.replaceAt( pField->GetStart(), 1, aFldText.copy(nCharInField,1) );
break;
}
}
@@ -1894,16 +1894,16 @@ void ImpEditEngine::InitWritingDirections( sal_Int32 nPara )
if ( ( bCTL || ( nBidiLevel == 1 /*RTL*/ ) ) && pParaPortion->GetNode()->Len() )
{
- String aText = pParaPortion->GetNode()->GetString();
+ OUString aText = pParaPortion->GetNode()->GetString();
//
// Bidi functions from icu 2.0
//
UErrorCode nError = U_ZERO_ERROR;
- UBiDi* pBidi = ubidi_openSized( aText.Len(), 0, &nError );
+ UBiDi* pBidi = ubidi_openSized( aText.getLength(), 0, &nError );
nError = U_ZERO_ERROR;
- ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.GetBuffer()), aText.Len(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW
+ ubidi_setPara( pBidi, reinterpret_cast<const UChar *>(aText.getStr()), aText.getLength(), nBidiLevel, NULL, &nError ); // UChar != sal_Unicode in MinGW
nError = U_ZERO_ERROR;
size_t nCount = ubidi_countRuns( pBidi, &nError );
@@ -2539,7 +2539,7 @@ EditPaM ImpEditEngine::AutoCorrect( const EditSelection& rCurSel, sal_Unicode c,
sal_uInt16 nIndex = aSel.Max().GetIndex();
EdtAutoCorrDoc aAuto(pEditEngine, pNode, nIndex, c);
// FIXME: this _must_ be called with reference to the actual node text!
- String const& rNodeString(pNode->GetString());
+ OUString const& rNodeString(pNode->GetString());
pAutoCorrect->DoAutoCorrect(
aAuto, rNodeString, nIndex, c, !bOverwrite, pFrameWin );
aSel.Max().SetIndex( aAuto.GetCursor() );
@@ -2613,12 +2613,12 @@ EditPaM ImpEditEngine::InsertText( const EditSelection& rCurSel,
pOldTxt[nChgPos] == pNewTxt[nChgPos] )
++nChgPos;
- String aChgText( aNewText.copy( nChgPos ) );
+ OUString aChgText( aNewText.copy( nChgPos ) );
// select text from first pos to be changed to current pos
EditSelection aSel( EditPaM( aPaM.GetNode(), (sal_uInt16) nChgPos ), aPaM );
- if (aChgText.Len())
+ if (!aChgText.isEmpty())
return InsertText( aSel, aChgText ); // implicitly handles undo
else
return aPaM;
@@ -2676,7 +2676,7 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin
if ( GetStatus().DoOnlineSpelling() )
aCurWord = SelectWord( aCurPaM, i18n::WordType::DICTIONARY_WORD );
- XubString aText(convertLineEnd(rStr, LINEEND_LF));
+ OUString aText(convertLineEnd(rStr, LINEEND_LF));
SfxVoidItem aTabItem( EE_FEATURE_TAB );
// Converts to linesep = \n
@@ -2685,43 +2685,41 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin
// fdo#39869 The loop run variable must be capable to hold STRLEN_MAX+1,
// that with STRING32 would be SAL_MAX_INT32+1 but with 16-bit is 0xFFFF+1
- sal_uInt32 nStart = 0;
- while ( nStart < aText.Len() )
+ sal_Int32 nStart = 0;
+ while ( nStart < aText.getLength() )
{
- sal_uInt32 nEnd = aText.Search( LINE_SEP, static_cast<xub_StrLen>(nStart) );
- if ( nEnd == STRING_NOTFOUND )
- nEnd = aText.Len(); // not dereference!
+ sal_Int32 nEnd = aText.indexOf( LINE_SEP, nStart );
+ if ( nEnd == -1 )
+ nEnd = aText.getLength(); // not dereference!
// Start == End => empty line
if ( nEnd > nStart )
{
- XubString aLine( aText, nStart, static_cast<xub_StrLen>(nEnd-nStart) );
- xub_StrLen nChars = aPaM.GetNode()->Len() + aLine.Len();
+ OUString aLine = aText.copy( nStart, nEnd-nStart );
+ xub_StrLen nChars = aPaM.GetNode()->Len() + aLine.getLength();
if ( nChars > MAXCHARSINPARA )
{
xub_StrLen nMaxNewChars = MAXCHARSINPARA-aPaM.GetNode()->Len();
- nEnd -= ( aLine.Len() - nMaxNewChars ); // Then the characters end up in the next paragraph.
- aLine.Erase( nMaxNewChars ); // Delete the Rest...
+ nEnd -= ( aLine.getLength() - nMaxNewChars ); // Then the characters end up in the next paragraph.
+ aLine = aLine.copy( 0, nMaxNewChars ); // Delete the Rest...
}
if ( IsUndoEnabled() && !IsInUndo() )
InsertUndo(new EditUndoInsertChars(pEditEngine, CreateEPaM(aPaM), aLine));
// Tabs ?
- if ( aLine.Search( '\t' ) == STRING_NOTFOUND )
+ if ( aLine.indexOf( '\t' ) == -1 )
aPaM = aEditDoc.InsertText( aPaM, aLine );
else
{
- sal_uInt32 nStart2 = 0;
- while ( nStart2 < aLine.Len() )
+ sal_Int32 nStart2 = 0;
+ while ( nStart2 < aLine.getLength() )
{
- sal_uInt32 nEnd2 = aLine.Search( '\t', static_cast<xub_StrLen>(nStart2) );
- if ( nEnd2 == STRING_NOTFOUND )
- nEnd2 = aLine.Len(); // not dereference!
+ sal_Int32 nEnd2 = aLine.indexOf( "\t", nStart2 );
+ if ( nEnd2 == -1 )
+ nEnd2 = aLine.getLength(); // not dereference!
if ( nEnd2 > nStart2 )
- aPaM = aEditDoc.InsertText( aPaM, XubString( aLine,
- static_cast<xub_StrLen>(nStart2),
- static_cast<xub_StrLen>(nEnd2-nStart2) ) );
- if ( nEnd2 < aLine.Len() )
+ aPaM = aEditDoc.InsertText( aPaM, aLine.copy( nStart2, nEnd2-nStart2 ) );
+ if ( nEnd2 < aLine.getLength() )
{
aPaM = aEditDoc.InsertFeature( aPaM, aTabItem );
}
@@ -2738,12 +2736,12 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin
if (pWrongs && !pWrongs->empty())
pWrongs->ClearWrongs( aCurWord.Min().GetIndex(), aPaM.GetIndex(), aPaM.GetNode() );
// ... and mark both words as 'to be checked again'
- pPortion->MarkInvalid( aCurWord.Min().GetIndex(), aLine.Len() );
+ pPortion->MarkInvalid( aCurWord.Min().GetIndex(), aLine.getLength() );
}
else
- pPortion->MarkInvalid( aCurPaM.GetIndex(), aLine.Len() );
+ pPortion->MarkInvalid( aCurPaM.GetIndex(), aLine.getLength() );
}
- if ( nEnd < aText.Len() )
+ if ( nEnd < aText.getLength() )
aPaM = ImpInsertParaBreak( aPaM );
nStart = nEnd+1;
@@ -3477,7 +3475,7 @@ uno::Reference< datatransfer::XTransferable > ImpEditEngine::CreateTransferable(
if ( pFld && pFld->ISA( SvxURLField ) )
{
// Office-Bookmark
- String aURL( ((const SvxURLField*)pFld)->GetURL() );
+ OUString aURL( ((const SvxURLField*)pFld)->GetURL() );
pDataObj->GetURL() = aURL;
}
}
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 42340d8..4d4b41d 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -153,7 +153,7 @@ EditPaM ImpEditEngine::ReadXML( SvStream& rInput, EditSelection aSel )
EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
{
#if (OSL_DEBUG_LEVEL > 2) && !defined( UNX )
- SvFileStream aRTFOut( String( RTL_CONSTASCII_USTRINGPARAM ( "d:\\rtf_in.rtf" ) ), STREAM_WRITE );
+ SvFileStream aRTFOut( OUString( "d:\\rtf_in.rtf" ), STREAM_WRITE );
aRTFOut << rInput;
aRTFOut.Close();
rInput.Seek( 0 );
@@ -690,7 +690,7 @@ sal_uInt32 ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel )
#if (OSL_DEBUG_LEVEL > 2) && !defined( UNX )
{
- SvFileStream aStream( String( RTL_CONSTASCII_USTRINGPARAM ( "d:\\rtf_out.rtf" ) ), STREAM_WRITE|STREAM_TRUNC );
+ SvFileStream aStream( OUString( "d:\\rtf_out.rtf" ), STREAM_WRITE|STREAM_TRUNC );
sal_uLong nP = rOutput.Tell();
rOutput.Seek( 0 );
aStream << rOutput;
@@ -1685,7 +1685,7 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang,
// looks for next convertible text portion to be passed on to the wrapper
- String aRes;
+ OUString aRes;
LanguageType nResLang = LANGUAGE_NONE;
/* ContentNode* pLastNode = */ aEditDoc.GetObject( aEditDoc.Count()-1 );
@@ -1693,9 +1693,9 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang,
EditPaM aPos( CreateEditPaM( pConvInfo->aConvContinue ) );
EditSelection aCurSel = EditSelection( aPos, aPos );
- String aWord;
+ OUString aWord;
- while (!aRes.Len())
+ while (aRes.isEmpty())
{
// empty paragraph found that needs to have language and font set?
if (bAllowImplicitChangesForNotConvertibleText &&
@@ -1825,11 +1825,11 @@ void ImpEditEngine::ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang,
aWord = GetSelected( aCurSel );
- if ( aWord.Len() > 0 /* && bLangOk */)
+ if ( !aWord.isEmpty() /* && bLangOk */)
aRes = aWord;
// move to next word/paragraph if necessary
- if ( !aRes.Len() )
+ if ( aRes.isEmpty() )
aCurSel = WordRight( aCurSel.Min(), ::com::sun::star::i18n::WordType::DICTIONARY_WORD );
pConvInfo->aConvContinue = CreateEPaM( aCurSel.Max() );
@@ -1854,7 +1854,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() );
aCurSel.Min() = aCurSel.Max();
- String aWord;
+ OUString aWord;
Reference< XSpellAlternatives > xSpellAlt;
Sequence< PropertyValue > aEmptySeq;
while (!xSpellAlt.is())
@@ -1882,17 +1882,17 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView )
// If afterwards a dot, this must be handed over!
// If an abbreviation ...
- if ( aWord.Len() && ( aCurSel.Max().GetIndex() < aCurSel.Max().GetNode()->Len() ) )
+ if ( !aWord.isEmpty() && ( aCurSel.Max().GetIndex() < aCurSel.Max().GetNode()->Len() ) )
{
sal_Unicode cNext = aCurSel.Max().GetNode()->GetChar( aCurSel.Max().GetIndex() );
if ( cNext == '.' )
{
aCurSel.Max().GetIndex()++;
- aWord += cNext;
+ aWord += OUString(cNext);
}
}
- if ( aWord.Len() > 0 )
+ if ( !aWord.isEmpty() )
{
LanguageType eLang = GetLanguage( aCurSel.Max() );
SvxSpellWrapper::CheckSpellLang( xSpeller, eLang );
@@ -1924,7 +1924,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpFindNextError(EditSelection& r
aEditDoc.GetObject( (aEditDoc.Count()-1) );
EditSelection aCurSel( rSelection.Min() );
- String aWord;
+ OUString aWord;
Reference< XSpellAlternatives > xSpellAlt;
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list