diff options
author | Noel Grandin <noel@peralex.com> | 2013-10-16 09:32:03 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-10-18 09:59:22 +0200 |
commit | d6e321f8264188ce8371c060ebeb75b213f0c90f (patch) | |
tree | 6c08f4028e551ff3290091501b8db9e6f434efff /sw/source | |
parent | df1b20d47aba481f27c7ac3428267c8c9e5ae4b1 (diff) |
convert sw/source/core/doc/*.cxx from String to OUString
Change-Id: I08caf2c9b7b2368f715fd582c93d40d69de2c875
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/doc/acmplwrd.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/doc/dbgoutsw.cxx | 612 | ||||
-rw-r--r-- | sw/source/core/doc/doc.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/docchart.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/doc/doccomp.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/doc/docdde.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/doc/docfld.cxx | 83 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/docglbl.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/doclay.cxx | 58 | ||||
-rw-r--r-- | sw/source/core/doc/docnum.cxx | 50 | ||||
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/doctxm.cxx | 98 | ||||
-rw-r--r-- | sw/source/core/doc/fmtcol.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/list.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/poolfmt.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/swserv.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/doc/visiturl.cxx | 6 |
20 files changed, 540 insertions, 553 deletions
diff --git a/sw/source/core/doc/acmplwrd.cxx b/sw/source/core/doc/acmplwrd.cxx index c81d18a745bd..80043920507f 100644 --- a/sw/source/core/doc/acmplwrd.cxx +++ b/sw/source/core/doc/acmplwrd.cxx @@ -84,7 +84,7 @@ class SwAutoCompleteString #endif SwDocPtrVector aSourceDocs; public: - SwAutoCompleteString(const String& rStr, xub_StrLen nPos, xub_StrLen nLen); + SwAutoCompleteString(const OUString& rStr, xub_StrLen nPos, xub_StrLen nLen); ~SwAutoCompleteString(); void AddDocument(const SwDoc& rDoc); @@ -176,7 +176,7 @@ void SwAutoCompleteWord_Impl::RemoveDocument(const SwDoc& rDoc) } SwAutoCompleteString::SwAutoCompleteString( - const String& rStr, xub_StrLen const nPos, xub_StrLen const nLen) + const OUString& rStr, xub_StrLen const nPos, xub_StrLen const nLen) : editeng::IAutoCompleteString(String(rStr, nPos, nLen)) { #if OSL_DEBUG_LEVEL > 0 @@ -245,14 +245,14 @@ bool SwAutoCompleteWord::InsertWord( const OUString& rWord, SwDoc& rDoc ) return sal_False; } - String aNewWord(rWord); + OUString aNewWord(rWord); aNewWord = comphelper::string::remove(aNewWord, CH_TXTATR_INWORD); aNewWord = comphelper::string::remove(aNewWord, CH_TXTATR_BREAKWORD); pImpl->AddDocument(rDoc); bool bRet = false; - xub_StrLen nWrdLen = aNewWord.Len(); - while( nWrdLen && '.' == aNewWord.GetChar( nWrdLen-1 )) + xub_StrLen nWrdLen = aNewWord.getLength(); + while( nWrdLen && '.' == aNewWord[ nWrdLen-1 ]) --nWrdLen; if( !bLockWordLst && nWrdLen >= nMinWrdLen ) diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index 6b1e23417d5e..75c5c7187e24 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -51,7 +51,7 @@ static OString aDbgOutResult; bool bDbgOutStdErr = false; bool bDbgOutPrintAttrSet = false; -char* db_pretty_print(const String* str, int flags, char* fmt) +char* db_pretty_print(const OUString* str, int flags, char* fmt) { (void) fmt; (void) flags; @@ -59,22 +59,22 @@ char* db_pretty_print(const String* str, int flags, char* fmt) } template<class T> -static String lcl_dbg_out_SvPtrArr(const T & rArr) +static OUString lcl_dbg_out_SvPtrArr(const T & rArr) { - String aStr("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[ "); for (typename T::const_iterator i(rArr.begin()); i != rArr.end(); ++i) { if (i != rArr.begin()) - aStr += String(", ", RTL_TEXTENCODING_ASCII_US); + aStr += ", "; if (*i) aStr += lcl_dbg_out(**i); else - aStr += String("(null)", RTL_TEXTENCODING_ASCII_US); + aStr += "(null)"; } - aStr += String(" ]", RTL_TEXTENCODING_ASCII_US); + aStr += " ]"; return aStr; } @@ -85,12 +85,12 @@ SW_DLLPUBLIC const char * dbg_out(const void * pVoid) sprintf(sBuffer, "%p", pVoid); - String aTmpStr(sBuffer, RTL_TEXTENCODING_ASCII_US); + OUString aTmpStr(sBuffer, strlen(sBuffer), RTL_TEXTENCODING_ASCII_US); return dbg_out(aTmpStr); } -SW_DLLPUBLIC const char * dbg_out(const String & aStr) +SW_DLLPUBLIC const char * dbg_out(const OUString & aStr) { aDbgOutResult = OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US); @@ -100,13 +100,6 @@ SW_DLLPUBLIC const char * dbg_out(const String & aStr) return aDbgOutResult.getStr(); } -SW_DLLPUBLIC const char * dbg_out(const OUString & aStr) -{ - aDbgOutResult = OUStringToOString(aStr, RTL_TEXTENCODING_ASCII_US); - return aDbgOutResult.getStr(); -} - - struct CompareUShort { bool operator()(sal_uInt16 a, sal_uInt16 b) const @@ -115,137 +108,137 @@ struct CompareUShort } }; -map<sal_uInt16,String,CompareUShort> & GetItemWhichMap() +map<sal_uInt16,OUString,CompareUShort> & GetItemWhichMap() { - static map<sal_uInt16,String,CompareUShort> aItemWhichMap; + static map<sal_uInt16,OUString,CompareUShort> aItemWhichMap; static bool bInitialized = false; if (! bInitialized) { - aItemWhichMap[RES_CHRATR_CASEMAP] = String("CHRATR_CASEMAP", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CHARSETCOLOR] = String("CHRATR_CHARSETCOLOR", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_COLOR] = String("CHRATR_COLOR", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CONTOUR] = String("CHRATR_CONTOUR", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CROSSEDOUT] = String("CHRATR_CROSSEDOUT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_ESCAPEMENT] = String("CHRATR_ESCAPEMENT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_FONT] = String("CHRATR_FONT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_FONTSIZE] = String("CHRATR_FONTSIZE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_KERNING] = String("CHRATR_KERNING", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_LANGUAGE] = String("CHRATR_LANGUAGE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_POSTURE] = String("CHRATR_POSTURE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_PROPORTIONALFONTSIZE] = String("CHRATR_PROPORTIONALFONTSIZE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_SHADOWED] = String("CHRATR_SHADOWED", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_UNDERLINE] = String("CHRATR_UNDERLINE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_OVERLINE] = String("CHRATR_OVERLINE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_WEIGHT] = String("CHRATR_WEIGHT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_WORDLINEMODE] = String("CHRATR_WORDLINEMODE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_AUTOKERN] = String("CHRATR_AUTOKERN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_BLINK] = String("CHRATR_BLINK", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_NOHYPHEN] = String("CHRATR_NOHYPHEN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_NOLINEBREAK] = String("CHRATR_NOLINEBREAK", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_BACKGROUND] = String("CHRATR_BACKGROUND", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_HIGHLIGHT] = String("CHRATR_HIGHLIGHT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CJK_FONT] = String("CHRATR_CJK_FONT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CJK_FONTSIZE] = String("CHRATR_CJK_FONTSIZE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CJK_LANGUAGE] = String("CHRATR_CJK_LANGUAGE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CJK_POSTURE] = String("CHRATR_CJK_POSTURE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CJK_WEIGHT] = String("CHRATR_CJK_WEIGHT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CTL_FONT] = String("CHRATR_CTL_FONT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CTL_FONTSIZE] = String("CHRATR_CTL_FONTSIZE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CTL_LANGUAGE] = String("CHRATR_CTL_LANGUAGE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CTL_POSTURE] = String("CHRATR_CTL_POSTURE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_CTL_WEIGHT] = String("CHRATR_CTL_WEIGHT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_ROTATE] = String("CHRATR_ROTATE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_EMPHASIS_MARK] = String("CHRATR_EMPHASIS_MARK", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_TWO_LINES] = String("CHRATR_TWO_LINES", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_SCALEW] = String("CHRATR_SCALEW", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_RELIEF] = String("CHRATR_RELIEF", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_HIDDEN] = String("CHRATR_HIDDEN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_BOX] = String("CHRATR_BOX", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHRATR_SHADOW] = String("CHRATR_SHADOW", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_AUTOFMT] = String("TXTATR_AUTOFMT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_INETFMT] = String("TXTATR_INETFMT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_REFMARK] = String("TXTATR_REFMARK", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_TOXMARK] = String("TXTATR_TOXMARK", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_CHARFMT] = String("TXTATR_CHARFMT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_DUMMY5] = String("TXTATR_DUMMY5", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_CJK_RUBY] = String("TXTATR_CJK_RUBY", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_UNKNOWN_CONTAINER] = String("TXTATR_UNKNOWN_CONTAINER", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_META] = String("TXTATR_META", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_METAFIELD] = String("TXTATR_METAFIELD", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_FIELD] = String("TXTATR_FIELD", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_FLYCNT] = String("TXTATR_FLYCNT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_FTN] = String("TXTATR_FTN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_DUMMY4] = String("TXTATR_DUMMY4", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_DUMMY3] = String("TXTATR_DUMMY3", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_DUMMY1] = String("TXTATR_DUMMY1", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TXTATR_DUMMY2] = String("TXTATR_DUMMY2", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_LINESPACING] = String("PARATR_LINESPACING", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_ADJUST] = String("PARATR_ADJUST", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_SPLIT] = String("PARATR_SPLIT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_ORPHANS] = String("PARATR_ORPHANS", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_WIDOWS] = String("PARATR_WIDOWS", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_TABSTOP] = String("PARATR_TABSTOP", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_HYPHENZONE] = String("PARATR_HYPHENZONE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_DROP] = String("PARATR_DROP", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_REGISTER] = String("PARATR_REGISTER", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_NUMRULE] = String("PARATR_NUMRULE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_SCRIPTSPACE] = String("PARATR_SCRIPTSPACE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_HANGINGPUNCTUATION] = String("PARATR_HANGINGPUNCTUATION", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_FORBIDDEN_RULES] = String("PARATR_FORBIDDEN_RULES", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_VERTALIGN] = String("PARATR_VERTALIGN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_SNAPTOGRID] = String("PARATR_SNAPTOGRID", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PARATR_CONNECT_BORDER] = String("PARATR_CONNECT_BORDER", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_FILL_ORDER] = String("FILL_ORDER", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_FRM_SIZE] = String("FRM_SIZE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PAPER_BIN] = String("PAPER_BIN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_LR_SPACE] = String("LR_SPACE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_UL_SPACE] = String("UL_SPACE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PAGEDESC] = String("PAGEDESC", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_BREAK] = String("BREAK", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CNTNT] = String("CNTNT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_HEADER] = String("HEADER", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_FOOTER] = String("FOOTER", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PRINT] = String("PRINT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_OPAQUE] = String("OPAQUE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_PROTECT] = String("PROTECT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_SURROUND] = String("SURROUND", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_VERT_ORIENT] = String("VERT_ORIENT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_HORI_ORIENT] = String("HORI_ORIENT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_ANCHOR] = String("ANCHOR", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_BACKGROUND] = String("BACKGROUND", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_BOX] = String("BOX", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_SHADOW] = String("SHADOW", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_FRMMACRO] = String("FRMMACRO", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_COL] = String("COL", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_KEEP] = String("KEEP", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_URL] = String("URL", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_EDIT_IN_READONLY] = String("EDIT_IN_READONLY", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_LAYOUT_SPLIT] = String("LAYOUT_SPLIT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_CHAIN] = String("CHAIN", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_TEXTGRID] = String("TEXTGRID", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_LINENUMBER ] = String("LINENUMBER ", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_FTN_AT_TXTEND] = String("FTN_AT_TXTEND", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_END_AT_TXTEND] = String("END_AT_TXTEND", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_COLUMNBALANCE] = String("COLUMNBALANCE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_FRAMEDIR] = String("FRAMEDIR", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_HEADER_FOOTER_EAT_SPACING] = String("HEADER_FOOTER_EAT_SPACING", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_ROW_SPLIT] = String("ROW_SPLIT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_MIRRORGRF] = String("GRFATR_MIRRORGRF", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_CROPGRF] = String("GRFATR_CROPGRF", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_ROTATION] = String("GRFATR_ROTATION", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_LUMINANCE] = String("GRFATR_LUMINANCE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_CONTRAST] = String("GRFATR_CONTRAST", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_CHANNELR] = String("GRFATR_CHANNELR", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_CHANNELG] = String("GRFATR_CHANNELG", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_CHANNELB] = String("GRFATR_CHANNELB", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_GAMMA] = String("GRFATR_GAMMA", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_INVERT] = String("GRFATR_INVERT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_TRANSPARENCY] = String("GRFATR_TRANSPARENCY", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_GRFATR_DRAWMODE] = String("GRFATR_DRAWMODE", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_BOXATR_FORMAT] = String("BOXATR_FORMAT", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_BOXATR_FORMULA] = String("BOXATR_FORMULA", RTL_TEXTENCODING_ASCII_US); - aItemWhichMap[RES_BOXATR_VALUE] = String("BOXATR_VALUE", RTL_TEXTENCODING_ASCII_US); + aItemWhichMap[RES_CHRATR_CASEMAP] = OUString("CHRATR_CASEMAP"); + aItemWhichMap[RES_CHRATR_CHARSETCOLOR] = OUString("CHRATR_CHARSETCOLOR"); + aItemWhichMap[RES_CHRATR_COLOR] = OUString("CHRATR_COLOR"); + aItemWhichMap[RES_CHRATR_CONTOUR] = OUString("CHRATR_CONTOUR"); + aItemWhichMap[RES_CHRATR_CROSSEDOUT] = OUString("CHRATR_CROSSEDOUT"); + aItemWhichMap[RES_CHRATR_ESCAPEMENT] = OUString("CHRATR_ESCAPEMENT"); + aItemWhichMap[RES_CHRATR_FONT] = OUString("CHRATR_FONT"); + aItemWhichMap[RES_CHRATR_FONTSIZE] = OUString("CHRATR_FONTSIZE"); + aItemWhichMap[RES_CHRATR_KERNING] = OUString("CHRATR_KERNING"); + aItemWhichMap[RES_CHRATR_LANGUAGE] = OUString("CHRATR_LANGUAGE"); + aItemWhichMap[RES_CHRATR_POSTURE] = OUString("CHRATR_POSTURE"); + aItemWhichMap[RES_CHRATR_PROPORTIONALFONTSIZE] = OUString("CHRATR_PROPORTIONALFONTSIZE"); + aItemWhichMap[RES_CHRATR_SHADOWED] = OUString("CHRATR_SHADOWED"); + aItemWhichMap[RES_CHRATR_UNDERLINE] = OUString("CHRATR_UNDERLINE"); + aItemWhichMap[RES_CHRATR_OVERLINE] = OUString("CHRATR_OVERLINE"); + aItemWhichMap[RES_CHRATR_WEIGHT] = OUString("CHRATR_WEIGHT"); + aItemWhichMap[RES_CHRATR_WORDLINEMODE] = OUString("CHRATR_WORDLINEMODE"); + aItemWhichMap[RES_CHRATR_AUTOKERN] = OUString("CHRATR_AUTOKERN"); + aItemWhichMap[RES_CHRATR_BLINK] = OUString("CHRATR_BLINK"); + aItemWhichMap[RES_CHRATR_NOHYPHEN] = OUString("CHRATR_NOHYPHEN"); + aItemWhichMap[RES_CHRATR_NOLINEBREAK] = OUString("CHRATR_NOLINEBREAK"); + aItemWhichMap[RES_CHRATR_BACKGROUND] = OUString("CHRATR_BACKGROUND"); + aItemWhichMap[RES_CHRATR_HIGHLIGHT] = OUString("CHRATR_HIGHLIGHT"); + aItemWhichMap[RES_CHRATR_CJK_FONT] = OUString("CHRATR_CJK_FONT"); + aItemWhichMap[RES_CHRATR_CJK_FONTSIZE] = OUString("CHRATR_CJK_FONTSIZE"); + aItemWhichMap[RES_CHRATR_CJK_LANGUAGE] = OUString("CHRATR_CJK_LANGUAGE"); + aItemWhichMap[RES_CHRATR_CJK_POSTURE] = OUString("CHRATR_CJK_POSTURE"); + aItemWhichMap[RES_CHRATR_CJK_WEIGHT] = OUString("CHRATR_CJK_WEIGHT"); + aItemWhichMap[RES_CHRATR_CTL_FONT] = OUString("CHRATR_CTL_FONT"); + aItemWhichMap[RES_CHRATR_CTL_FONTSIZE] = OUString("CHRATR_CTL_FONTSIZE"); + aItemWhichMap[RES_CHRATR_CTL_LANGUAGE] = OUString("CHRATR_CTL_LANGUAGE"); + aItemWhichMap[RES_CHRATR_CTL_POSTURE] = OUString("CHRATR_CTL_POSTURE"); + aItemWhichMap[RES_CHRATR_CTL_WEIGHT] = OUString("CHRATR_CTL_WEIGHT"); + aItemWhichMap[RES_CHRATR_ROTATE] = OUString("CHRATR_ROTATE"); + aItemWhichMap[RES_CHRATR_EMPHASIS_MARK] = OUString("CHRATR_EMPHASIS_MARK"); + aItemWhichMap[RES_CHRATR_TWO_LINES] = OUString("CHRATR_TWO_LINES"); + aItemWhichMap[RES_CHRATR_SCALEW] = OUString("CHRATR_SCALEW"); + aItemWhichMap[RES_CHRATR_RELIEF] = OUString("CHRATR_RELIEF"); + aItemWhichMap[RES_CHRATR_HIDDEN] = OUString("CHRATR_HIDDEN"); + aItemWhichMap[RES_CHRATR_BOX] = OUString("CHRATR_BOX"); + aItemWhichMap[RES_CHRATR_SHADOW] = OUString("CHRATR_SHADOW"); + aItemWhichMap[RES_TXTATR_AUTOFMT] = OUString("TXTATR_AUTOFMT"); + aItemWhichMap[RES_TXTATR_INETFMT] = OUString("TXTATR_INETFMT"); + aItemWhichMap[RES_TXTATR_REFMARK] = OUString("TXTATR_REFMARK"); + aItemWhichMap[RES_TXTATR_TOXMARK] = OUString("TXTATR_TOXMARK"); + aItemWhichMap[RES_TXTATR_CHARFMT] = OUString("TXTATR_CHARFMT"); + aItemWhichMap[RES_TXTATR_DUMMY5] = OUString("TXTATR_DUMMY5"); + aItemWhichMap[RES_TXTATR_CJK_RUBY] = OUString("TXTATR_CJK_RUBY"); + aItemWhichMap[RES_TXTATR_UNKNOWN_CONTAINER] = OUString("TXTATR_UNKNOWN_CONTAINER"); + aItemWhichMap[RES_TXTATR_META] = OUString("TXTATR_META"); + aItemWhichMap[RES_TXTATR_METAFIELD] = OUString("TXTATR_METAFIELD"); + aItemWhichMap[RES_TXTATR_FIELD] = OUString("TXTATR_FIELD"); + aItemWhichMap[RES_TXTATR_FLYCNT] = OUString("TXTATR_FLYCNT"); + aItemWhichMap[RES_TXTATR_FTN] = OUString("TXTATR_FTN"); + aItemWhichMap[RES_TXTATR_DUMMY4] = OUString("TXTATR_DUMMY4"); + aItemWhichMap[RES_TXTATR_DUMMY3] = OUString("TXTATR_DUMMY3"); + aItemWhichMap[RES_TXTATR_DUMMY1] = OUString("TXTATR_DUMMY1"); + aItemWhichMap[RES_TXTATR_DUMMY2] = OUString("TXTATR_DUMMY2"); + aItemWhichMap[RES_PARATR_LINESPACING] = OUString("PARATR_LINESPACING"); + aItemWhichMap[RES_PARATR_ADJUST] = OUString("PARATR_ADJUST"); + aItemWhichMap[RES_PARATR_SPLIT] = OUString("PARATR_SPLIT"); + aItemWhichMap[RES_PARATR_ORPHANS] = OUString("PARATR_ORPHANS"); + aItemWhichMap[RES_PARATR_WIDOWS] = OUString("PARATR_WIDOWS"); + aItemWhichMap[RES_PARATR_TABSTOP] = OUString("PARATR_TABSTOP"); + aItemWhichMap[RES_PARATR_HYPHENZONE] = OUString("PARATR_HYPHENZONE"); + aItemWhichMap[RES_PARATR_DROP] = OUString("PARATR_DROP"); + aItemWhichMap[RES_PARATR_REGISTER] = OUString("PARATR_REGISTER"); + aItemWhichMap[RES_PARATR_NUMRULE] = OUString("PARATR_NUMRULE"); + aItemWhichMap[RES_PARATR_SCRIPTSPACE] = OUString("PARATR_SCRIPTSPACE"); + aItemWhichMap[RES_PARATR_HANGINGPUNCTUATION] = OUString("PARATR_HANGINGPUNCTUATION"); + aItemWhichMap[RES_PARATR_FORBIDDEN_RULES] = OUString("PARATR_FORBIDDEN_RULES"); + aItemWhichMap[RES_PARATR_VERTALIGN] = OUString("PARATR_VERTALIGN"); + aItemWhichMap[RES_PARATR_SNAPTOGRID] = OUString("PARATR_SNAPTOGRID"); + aItemWhichMap[RES_PARATR_CONNECT_BORDER] = OUString("PARATR_CONNECT_BORDER"); + aItemWhichMap[RES_FILL_ORDER] = OUString("FILL_ORDER"); + aItemWhichMap[RES_FRM_SIZE] = OUString("FRM_SIZE"); + aItemWhichMap[RES_PAPER_BIN] = OUString("PAPER_BIN"); + aItemWhichMap[RES_LR_SPACE] = OUString("LR_SPACE"); + aItemWhichMap[RES_UL_SPACE] = OUString("UL_SPACE"); + aItemWhichMap[RES_PAGEDESC] = OUString("PAGEDESC"); + aItemWhichMap[RES_BREAK] = OUString("BREAK"); + aItemWhichMap[RES_CNTNT] = OUString("CNTNT"); + aItemWhichMap[RES_HEADER] = OUString("HEADER"); + aItemWhichMap[RES_FOOTER] = OUString("FOOTER"); + aItemWhichMap[RES_PRINT] = OUString("PRINT"); + aItemWhichMap[RES_OPAQUE] = OUString("OPAQUE"); + aItemWhichMap[RES_PROTECT] = OUString("PROTECT"); + aItemWhichMap[RES_SURROUND] = OUString("SURROUND"); + aItemWhichMap[RES_VERT_ORIENT] = OUString("VERT_ORIENT"); + aItemWhichMap[RES_HORI_ORIENT] = OUString("HORI_ORIENT"); + aItemWhichMap[RES_ANCHOR] = OUString("ANCHOR"); + aItemWhichMap[RES_BACKGROUND] = OUString("BACKGROUND"); + aItemWhichMap[RES_BOX] = OUString("BOX"); + aItemWhichMap[RES_SHADOW] = OUString("SHADOW"); + aItemWhichMap[RES_FRMMACRO] = OUString("FRMMACRO"); + aItemWhichMap[RES_COL] = OUString("COL"); + aItemWhichMap[RES_KEEP] = OUString("KEEP"); + aItemWhichMap[RES_URL] = OUString("URL"); + aItemWhichMap[RES_EDIT_IN_READONLY] = OUString("EDIT_IN_READONLY"); + aItemWhichMap[RES_LAYOUT_SPLIT] = OUString("LAYOUT_SPLIT"); + aItemWhichMap[RES_CHAIN] = OUString("CHAIN"); + aItemWhichMap[RES_TEXTGRID] = OUString("TEXTGRID"); + aItemWhichMap[RES_LINENUMBER ] = OUString("LINENUMBER "); + aItemWhichMap[RES_FTN_AT_TXTEND] = OUString("FTN_AT_TXTEND"); + aItemWhichMap[RES_END_AT_TXTEND] = OUString("END_AT_TXTEND"); + aItemWhichMap[RES_COLUMNBALANCE] = OUString("COLUMNBALANCE"); + aItemWhichMap[RES_FRAMEDIR] = OUString("FRAMEDIR"); + aItemWhichMap[RES_HEADER_FOOTER_EAT_SPACING] = OUString("HEADER_FOOTER_EAT_SPACING"); + aItemWhichMap[RES_ROW_SPLIT] = OUString("ROW_SPLIT"); + aItemWhichMap[RES_GRFATR_MIRRORGRF] = OUString("GRFATR_MIRRORGRF"); + aItemWhichMap[RES_GRFATR_CROPGRF] = OUString("GRFATR_CROPGRF"); + aItemWhichMap[RES_GRFATR_ROTATION] = OUString("GRFATR_ROTATION"); + aItemWhichMap[RES_GRFATR_LUMINANCE] = OUString("GRFATR_LUMINANCE"); + aItemWhichMap[RES_GRFATR_CONTRAST] = OUString("GRFATR_CONTRAST"); + aItemWhichMap[RES_GRFATR_CHANNELR] = OUString("GRFATR_CHANNELR"); + aItemWhichMap[RES_GRFATR_CHANNELG] = OUString("GRFATR_CHANNELG"); + aItemWhichMap[RES_GRFATR_CHANNELB] = OUString("GRFATR_CHANNELB"); + aItemWhichMap[RES_GRFATR_GAMMA] = OUString("GRFATR_GAMMA"); + aItemWhichMap[RES_GRFATR_INVERT] = OUString("GRFATR_INVERT"); + aItemWhichMap[RES_GRFATR_TRANSPARENCY] = OUString("GRFATR_TRANSPARENCY"); + aItemWhichMap[RES_GRFATR_DRAWMODE] = OUString("GRFATR_DRAWMODE"); + aItemWhichMap[RES_BOXATR_FORMAT] = OUString("BOXATR_FORMAT"); + aItemWhichMap[RES_BOXATR_FORMULA] = OUString("BOXATR_FORMULA"); + aItemWhichMap[RES_BOXATR_VALUE] = OUString("BOXATR_VALUE"); bInitialized = true; } @@ -253,16 +246,16 @@ map<sal_uInt16,String,CompareUShort> & GetItemWhichMap() return aItemWhichMap; } -static const String lcl_dbg_out(const SfxPoolItem & rItem) +static const OUString lcl_dbg_out(const SfxPoolItem & rItem) { - String aStr("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[ "); if (GetItemWhichMap().find(rItem.Which()) != GetItemWhichMap().end()) aStr += GetItemWhichMap()[rItem.Which()]; else aStr += OUString::number(rItem.Which()); - aStr += String(" ]", RTL_TEXTENCODING_ASCII_US); + aStr += " ]"; return aStr; } @@ -274,35 +267,34 @@ SW_DLLPUBLIC const char * dbg_out(const SfxPoolItem & rItem) SW_DLLPUBLIC const char * dbg_out(const SfxPoolItem * pItem) { - return dbg_out(pItem ? lcl_dbg_out(*pItem) : - String("(nil)", RTL_TEXTENCODING_ASCII_US)); + return dbg_out(pItem ? lcl_dbg_out(*pItem) : OUString("(nil)")); } -static const String lcl_dbg_out(const SfxItemSet & rSet) +static const OUString lcl_dbg_out(const SfxItemSet & rSet) { SfxItemIter aIter(rSet); const SfxPoolItem * pItem; bool bFirst = true; - String aStr = String("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aStr = "[ "; pItem = aIter.FirstItem(); while (pItem ) { if (!bFirst) - aStr += String(", ", RTL_TEXTENCODING_ASCII_US); + aStr += ", "; if ((sal_uIntPtr)pItem != SAL_MAX_SIZE) aStr += lcl_dbg_out(*pItem); else - aStr += String("invalid", RTL_TEXTENCODING_ASCII_US); + aStr += "invalid"; bFirst = false; pItem = aIter.NextItem(); } - aStr += String(" ]", RTL_TEXTENCODING_ASCII_US); + aStr += " ]"; return aStr; } @@ -312,17 +304,17 @@ SW_DLLPUBLIC const char * dbg_out(const SfxItemSet & rSet) return dbg_out(lcl_dbg_out(rSet)); } -static const String lcl_dbg_out(const SwTxtAttr & rAttr) +static const OUString lcl_dbg_out(const SwTxtAttr & rAttr) { - String aStr("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[ "); aStr += OUString::number(*rAttr.GetStart()); - aStr += String("->", RTL_TEXTENCODING_ASCII_US); + aStr += "->"; aStr += OUString::number(*rAttr.GetEnd()); - aStr += String(" ", RTL_TEXTENCODING_ASCII_US); + aStr += " "; aStr += lcl_dbg_out(rAttr.GetAttr()); - aStr += String(" ]", RTL_TEXTENCODING_ASCII_US); + aStr += " ]"; return aStr; } @@ -332,18 +324,18 @@ SW_DLLPUBLIC const char * dbg_out(const SwTxtAttr & rAttr) return dbg_out(lcl_dbg_out(rAttr)); } -static const String lcl_dbg_out(const SwpHints & rHints) +static const OUString lcl_dbg_out(const SwpHints & rHints) { - String aStr("[ SwpHints\n", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[ SwpHints\n"); for (sal_uInt16 i = 0; i < rHints.Count(); i++) { - aStr += String(" ", RTL_TEXTENCODING_ASCII_US); + aStr += " "; aStr += lcl_dbg_out(*rHints[i]); - aStr += String("\n", RTL_TEXTENCODING_ASCII_US); + aStr += "\n"; } - aStr += String("]\n", RTL_TEXTENCODING_ASCII_US); + aStr += "]\n"; return aStr; } @@ -353,18 +345,18 @@ SW_DLLPUBLIC const char * dbg_out(const SwpHints &rHints) return dbg_out(lcl_dbg_out(rHints)); } -static String lcl_dbg_out(const SwPosition & rPos) +static OUString lcl_dbg_out(const SwPosition & rPos) { - String aStr("( ", RTL_TEXTENCODING_ASCII_US); + OUString aStr("( "); aStr += OUString::number(rPos.nNode.GetIndex()); - aStr += String(", ", RTL_TEXTENCODING_ASCII_US); + aStr += ", "; aStr += OUString::number(rPos.nContent.GetIndex()); - aStr += String(": ", RTL_TEXTENCODING_ASCII_US); + aStr += ": "; aStr += OUString::number (reinterpret_cast<sal_IntPtr>(rPos.nContent.GetIdxReg()), 16); - aStr += String(" )", RTL_TEXTENCODING_ASCII_US); + aStr += " )"; return aStr; } @@ -374,19 +366,19 @@ SW_DLLPUBLIC const char * dbg_out(const SwPosition & rPos) return dbg_out(lcl_dbg_out(rPos)); } -static String lcl_dbg_out(const SwPaM & rPam) +static OUString lcl_dbg_out(const SwPaM & rPam) { - String aStr("[ Pt: ", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[ Pt: "); aStr += lcl_dbg_out(*rPam.GetPoint()); if (rPam.HasMark()) { - aStr += String(", Mk: ", RTL_TEXTENCODING_ASCII_US); + aStr += ", Mk: "; aStr += lcl_dbg_out(*rPam.GetMark()); } - aStr += String(" ]", RTL_TEXTENCODING_ASCII_US); + aStr += " ]"; return aStr; } @@ -396,9 +388,9 @@ SW_DLLPUBLIC const char * dbg_out(const SwPaM & rPam) return dbg_out(lcl_dbg_out(rPam)); } -static String lcl_dbg_out(const SwNodeNum & ) +static OUString lcl_dbg_out(const SwNodeNum & ) { - return String();/*rNum.ToString();*/ + return OUString();/*rNum.ToString();*/ } SW_DLLPUBLIC const char * dbg_out(const SwNodeNum & rNum) @@ -406,19 +398,19 @@ SW_DLLPUBLIC const char * dbg_out(const SwNodeNum & rNum) return dbg_out(lcl_dbg_out(rNum)); } -static String lcl_dbg_out(const SwRect & rRect) +static OUString lcl_dbg_out(const SwRect & rRect) { - String aResult("[ [", RTL_TEXTENCODING_ASCII_US); + OUString aResult("[ ["); aResult += OUString::number(rRect.Left()); - aResult += String(", ", RTL_TEXTENCODING_ASCII_US); + aResult += ", "; aResult += OUString::number(rRect.Top()); - aResult += String("], [", RTL_TEXTENCODING_ASCII_US); + aResult += "], ["; aResult += OUString::number(rRect.Right()); - aResult += String(", ", RTL_TEXTENCODING_ASCII_US); + aResult += ", "; aResult += OUString::number(rRect.Bottom()); - aResult += String("] ]", RTL_TEXTENCODING_ASCII_US); + aResult += "] ]"; return aResult; } @@ -428,24 +420,24 @@ SW_DLLPUBLIC const char * dbg_out(const SwRect & rRect) return dbg_out(lcl_dbg_out(rRect)); } -static String lcl_dbg_out(const SwFrmFmt & rFrmFmt) +static OUString lcl_dbg_out(const SwFrmFmt & rFrmFmt) { - String aResult("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aResult("[ "); char sBuffer[256]; sprintf(sBuffer, "%p", &rFrmFmt); - aResult += String(sBuffer, RTL_TEXTENCODING_ASCII_US); - aResult += String("(", RTL_TEXTENCODING_ASCII_US); + aResult += OUString(sBuffer, strlen(sBuffer), RTL_TEXTENCODING_ASCII_US); + aResult += "("; aResult += rFrmFmt.GetName(); - aResult += String(")", RTL_TEXTENCODING_ASCII_US); + aResult += ")"; if (rFrmFmt.IsAuto()) - aResult += String("*", RTL_TEXTENCODING_ASCII_US); + aResult += "*"; - aResult += String(" ,", RTL_TEXTENCODING_ASCII_US); + aResult += " ,"; aResult += lcl_dbg_out(rFrmFmt.FindLayoutRect()); - aResult += String(" ]", RTL_TEXTENCODING_ASCII_US); + aResult += " ]"; return aResult; } @@ -455,9 +447,9 @@ SW_DLLPUBLIC const char * dbg_out(const SwFrmFmt & rFrmFmt) return dbg_out(lcl_dbg_out(rFrmFmt)); } -static const String lcl_AnchoredFrames(const SwNode & rNode) +static const OUString lcl_AnchoredFrames(const SwNode & rNode) { - String aResult("[", RTL_TEXTENCODING_ASCII_US); + OUString aResult("["); const SwDoc * pDoc = rNode.GetDoc(); if (pDoc) @@ -476,7 +468,7 @@ static const String lcl_AnchoredFrames(const SwNode & rNode) if (pPos && &pPos->nNode.GetNode() == &rNode) { if (! bFirst) - aResult += String(", ", RTL_TEXTENCODING_ASCII_US); + aResult += ", "; if (*i) aResult += lcl_dbg_out(**i); @@ -486,49 +478,43 @@ static const String lcl_AnchoredFrames(const SwNode & rNode) } } - aResult += String("]", RTL_TEXTENCODING_ASCII_US); + aResult += "]"; return aResult; } -static String lcl_dbg_out_NumType(sal_Int16 nType) +static OUString lcl_dbg_out_NumType(sal_Int16 nType) { - String aTmpStr; + OUString aTmpStr; switch (nType) { case SVX_NUM_NUMBER_NONE: - aTmpStr += String(" NONE", RTL_TEXTENCODING_ASCII_US); + aTmpStr += " NONE"; break; case SVX_NUM_CHARS_UPPER_LETTER: - aTmpStr += String(" CHARS_UPPER_LETTER", - RTL_TEXTENCODING_ASCII_US); + aTmpStr += " CHARS_UPPER_LETTER"; break; case SVX_NUM_CHARS_LOWER_LETTER: - aTmpStr += String(" CHARS_LOWER_LETTER", - RTL_TEXTENCODING_ASCII_US); + aTmpStr += " CHARS_LOWER_LETTER"; break; case SVX_NUM_ROMAN_UPPER: - aTmpStr += String(" ROMAN_UPPER", - RTL_TEXTENCODING_ASCII_US); + aTmpStr += " ROMAN_UPPER"; break; case SVX_NUM_ROMAN_LOWER: - aTmpStr += String(" ROMAN_LOWER", - RTL_TEXTENCODING_ASCII_US); + aTmpStr += " ROMAN_LOWER"; break; case SVX_NUM_ARABIC: - aTmpStr += String(" ARABIC", - RTL_TEXTENCODING_ASCII_US); + aTmpStr += " ARABIC"; break; default: - aTmpStr += String(" ??", - RTL_TEXTENCODING_ASCII_US); + aTmpStr += " ??"; break; } @@ -536,32 +522,32 @@ static String lcl_dbg_out_NumType(sal_Int16 nType) return aTmpStr; } -static String lcl_dbg_out(const SwNode & rNode) +static OUString lcl_dbg_out(const SwNode & rNode) { - String aTmpStr; + OUString aTmpStr; - aTmpStr += String("<node ", RTL_TEXTENCODING_ASCII_US); - aTmpStr += String("index=\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<node "; + aTmpStr += "index=\""; aTmpStr += OUString::number(rNode.GetIndex()); - aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "\""; #ifdef DBG_UTIL - aTmpStr += String(" serial=\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += " serial=\""; aTmpStr += OUString::number(rNode.GetSerial()); - aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "\""; #endif - aTmpStr += String(" type=\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += " type=\""; aTmpStr += OUString::number(sal_Int32( rNode.GetNodeType() ) ); - aTmpStr += String("\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "\""; - aTmpStr += String(" pointer=\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += " pointer=\""; char aBuffer[128]; sprintf(aBuffer, "%p", &rNode); - aTmpStr += String(aBuffer, RTL_TEXTENCODING_ASCII_US); + aTmpStr += OUString(aBuffer, strlen(aBuffer), RTL_TEXTENCODING_ASCII_US); - aTmpStr += String("\">", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "\">"; const SwTxtNode * pTxtNode = rNode.GetTxtNode(); @@ -569,29 +555,29 @@ static String lcl_dbg_out(const SwNode & rNode) { const SfxItemSet * pAttrSet = pTxtNode->GetpSwAttrSet(); - aTmpStr += String("<txt>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<txt>"; aTmpStr += pTxtNode->GetTxt().getLength() > 10 ? pTxtNode->GetTxt().copy(0, 10) : pTxtNode->GetTxt(); - aTmpStr += String("</txt>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</txt>"; if (rNode.IsTableNode()) - aTmpStr += String("<tbl/>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<tbl/>"; - aTmpStr += String("<outlinelevel>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<outlinelevel>"; aTmpStr += OUString::number(pTxtNode->GetAttrOutlineLevel()-1); - aTmpStr += String("</outlinelevel>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</outlinelevel>"; const SwNumRule * pNumRule = pTxtNode->GetNumRule(); if (pNumRule != NULL) { - aTmpStr += String("<number>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<number>"; if ( pTxtNode->GetNum() ) { aTmpStr += lcl_dbg_out(*(pTxtNode->GetNum())); } - aTmpStr += String("</number>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</number>"; - aTmpStr += String("<rule>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<rule>"; aTmpStr += pNumRule->GetName(); const SfxPoolItem * pItem = NULL; @@ -599,90 +585,90 @@ static String lcl_dbg_out(const SwNode & rNode) if (pAttrSet && SFX_ITEM_SET == pAttrSet->GetItemState(RES_PARATR_NUMRULE, sal_False, &pItem)) { - aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "("; aTmpStr += static_cast<const SwNumRuleItem *>(pItem)->GetValue(); - aTmpStr += String(")", RTL_TEXTENCODING_ASCII_US); - aTmpStr += String("*", RTL_TEXTENCODING_ASCII_US); + aTmpStr += ")"; + aTmpStr += "*"; } const SwNumFmt * pNumFmt = NULL; - aTmpStr += String("</rule>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</rule>"; if (pTxtNode->GetActualListLevel() > 0) pNumFmt = pNumRule->GetNumFmt( static_cast< sal_uInt16 >(pTxtNode->GetActualListLevel()) ); if (pNumFmt) { - aTmpStr += String("<numformat>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<numformat>"; aTmpStr += lcl_dbg_out_NumType(pNumFmt->GetNumberingType()); - aTmpStr += String("</numformat>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</numformat>"; } } if (pTxtNode->IsCountedInList()) - aTmpStr += String("<counted/>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<counted/>"; SwFmtColl * pColl = pTxtNode->GetFmtColl(); if (pColl) { - aTmpStr += String("<coll>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<coll>"; aTmpStr += pColl->GetName(); - aTmpStr += String("(", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "("; aTmpStr += OUString::number (static_cast<SwTxtFmtColl *>(pColl)->GetAssignedOutlineStyleLevel()); const SwNumRuleItem & rItem = static_cast<const SwNumRuleItem &> (pColl->GetFmtAttr(RES_PARATR_NUMRULE)); - const String sNumruleName = rItem.GetValue(); + const OUString sNumruleName = rItem.GetValue(); - if (sNumruleName.Len() > 0) + if (!sNumruleName.isEmpty()) { - aTmpStr += String(", ", RTL_TEXTENCODING_ASCII_US); + aTmpStr += ", "; aTmpStr += sNumruleName; } - aTmpStr += String(")", RTL_TEXTENCODING_ASCII_US); - aTmpStr += String("</coll>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += ")"; + aTmpStr += "</coll>"; } SwFmtColl * pCColl = pTxtNode->GetCondFmtColl(); if (pCColl) { - aTmpStr += String("<ccoll>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<ccoll>"; aTmpStr += pCColl->GetName(); - aTmpStr += String("</ccoll>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</ccoll>"; } - aTmpStr += String("<frms>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<frms>"; aTmpStr += lcl_AnchoredFrames(rNode); - aTmpStr += String("</frms>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</frms>"; if (bDbgOutPrintAttrSet) { - aTmpStr += String("<attrs>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<attrs>"; aTmpStr += lcl_dbg_out(pTxtNode->GetSwAttrSet()); - aTmpStr += String("</attrs>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</attrs>"; } } else if (rNode.IsStartNode()) { - aTmpStr += String("<start end=\"", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<start end=\""; const SwStartNode * pStartNode = dynamic_cast<const SwStartNode *> (&rNode); if (pStartNode != NULL) aTmpStr += OUString::number(pStartNode->EndOfSectionNode()->GetIndex()); - aTmpStr += String("\"/>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "\"/>"; } else if (rNode.IsEndNode()) - aTmpStr += String("<end/>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "<end/>"; - aTmpStr += String("</node>", RTL_TEXTENCODING_ASCII_US); + aTmpStr += "</node>"; return aTmpStr; } @@ -716,7 +702,7 @@ SW_DLLPUBLIC const char * dbg_out(const SwTxtNode * pNode) return NULL; } -static void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, sal_uLong & nIndex) +static void lcl_dbg_nodes_inner(OUString & aStr, SwNodes & rNodes, sal_uLong & nIndex) { SwNode * pNode = rNodes[nIndex]; SwStartNode * pStartNode = dynamic_cast<SwStartNode *> (pNode); @@ -730,17 +716,17 @@ static void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, sal_uLong & nIn bool bDone = false; - String aTag; + OUString aTag; if (pNode->IsTableNode()) - aTag += String("table", RTL_TEXTENCODING_ASCII_US); + aTag += "table"; else if (pNode->IsSectionNode()) - aTag += String("section", RTL_TEXTENCODING_ASCII_US); + aTag += "section"; else - aTag += String("nodes", RTL_TEXTENCODING_ASCII_US); + aTag += "nodes"; - aStr += String("<", RTL_TEXTENCODING_ASCII_US); + aStr += "<"; aStr += aTag; - aStr += String(">", RTL_TEXTENCODING_ASCII_US); + aStr += ">"; while (! bDone) { @@ -749,7 +735,7 @@ static void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, sal_uLong & nIn else { aStr += lcl_dbg_out(*pNode); - aStr += String("\n", RTL_TEXTENCODING_ASCII_US); + aStr += "\n"; nIndex++; } @@ -760,14 +746,14 @@ static void lcl_dbg_nodes_inner(String & aStr, SwNodes & rNodes, sal_uLong & nIn pNode = rNodes[nIndex]; } - aStr += String("</", RTL_TEXTENCODING_ASCII_US); + aStr += "</"; aStr += aTag; - aStr += String(">\n", RTL_TEXTENCODING_ASCII_US); + aStr += ">\n"; } -static String lcl_dbg_out(SwNodes & rNodes) +static OUString lcl_dbg_out(SwNodes & rNodes) { - String aStr("<nodes-array>", RTL_TEXTENCODING_ASCII_US); + OUString aStr("<nodes-array>"); sal_uLong nIndex = 0; sal_uLong nCount = rNodes.Count(); @@ -777,7 +763,7 @@ static String lcl_dbg_out(SwNodes & rNodes) lcl_dbg_nodes_inner(aStr, rNodes, nIndex); } - aStr += String("</nodes-array>\n", RTL_TEXTENCODING_ASCII_US); + aStr += "</nodes-array>\n"; return aStr; } @@ -787,16 +773,16 @@ SW_DLLPUBLIC const char * dbg_out(SwNodes & rNodes) return dbg_out(lcl_dbg_out(rNodes)); } -static String lcl_dbg_out(const SwUndo & rUndo) +static OUString lcl_dbg_out(const SwUndo & rUndo) { - String aStr("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[ "); aStr += OUString::number( static_cast<SfxUndoAction const&>(rUndo).GetId()); - aStr += String(": ", RTL_TEXTENCODING_ASCII_US); + aStr += ": "; aStr += rUndo.GetComment(); - aStr += String(" ]", RTL_TEXTENCODING_ASCII_US); + aStr += " ]"; return aStr; } @@ -806,17 +792,17 @@ SW_DLLPUBLIC const char * dbg_out(const SwUndo & rUndo) return dbg_out(lcl_dbg_out(rUndo)); } -static String lcl_dbg_out(SwOutlineNodes & rNodes) +static OUString lcl_dbg_out(SwOutlineNodes & rNodes) { - String aStr("[\n", RTL_TEXTENCODING_ASCII_US); + OUString aStr("[\n"); for (sal_uInt16 i = 0; i < rNodes.size(); i++) { aStr += lcl_dbg_out(*rNodes[i]); - aStr += String("\n", RTL_TEXTENCODING_ASCII_US); + aStr += "\n"; } - aStr += String("]\n", RTL_TEXTENCODING_ASCII_US); + aStr += "]\n"; return aStr; } @@ -827,10 +813,10 @@ SW_DLLPUBLIC const char * dbg_out(SwOutlineNodes & rNodes) } //FIXME: this method seems to do nothing at all -static String lcl_dbg_out(const SwRewriter & rRewriter) +static OUString lcl_dbg_out(const SwRewriter & rRewriter) { (void) rRewriter; - String aResult; + OUString aResult; //aResult = rRewriter.ToString(); @@ -842,33 +828,33 @@ SW_DLLPUBLIC const char * dbg_out(const SwRewriter & rRewriter) return dbg_out(lcl_dbg_out(rRewriter)); } -static String lcl_dbg_out(const SvxNumberFormat & rFmt) +static OUString lcl_dbg_out(const SvxNumberFormat & rFmt) { - String aResult; + OUString aResult; aResult = lcl_dbg_out_NumType(rFmt.GetNumberingType()); return aResult; } -static String lcl_dbg_out(const SwNumRule & rRule) +static OUString lcl_dbg_out(const SwNumRule & rRule) { - String aResult("[ ", RTL_TEXTENCODING_ASCII_US); + OUString aResult("[ "); aResult += rRule.GetName(); - aResult += String(" [", RTL_TEXTENCODING_ASCII_US); + aResult += " ["; for (sal_uInt8 n = 0; n < MAXLEVEL; n++) { if (n > 0) - aResult += String(", ", RTL_TEXTENCODING_ASCII_US); + aResult += ", "; aResult += lcl_dbg_out(rRule.Get(n)); } - aResult += String("]", RTL_TEXTENCODING_ASCII_US); + aResult += "]"; - aResult += String("]", RTL_TEXTENCODING_ASCII_US); + aResult += "]"; return aResult; } @@ -878,13 +864,13 @@ SW_DLLPUBLIC const char * dbg_out(const SwNumRule & rRule) return dbg_out(lcl_dbg_out(rRule)); } -static String lcl_dbg_out(const SwTxtFmtColl & rFmt) +static OUString lcl_dbg_out(const SwTxtFmtColl & rFmt) { - String aResult(rFmt.GetName()); + OUString aResult(rFmt.GetName()); - aResult += String("(", RTL_TEXTENCODING_ASCII_US); + aResult += "("; aResult += OUString::number(rFmt.GetAttrOutlineLevel()); - aResult += String(")", RTL_TEXTENCODING_ASCII_US); + aResult += ")"; return aResult; } @@ -894,7 +880,7 @@ SW_DLLPUBLIC const char * dbg_out(const SwTxtFmtColl & rFmt) return dbg_out(lcl_dbg_out(rFmt)); } -static String lcl_dbg_out(const SwFrmFmts & rFrmFmts) +static OUString lcl_dbg_out(const SwFrmFmts & rFrmFmts) { return lcl_dbg_out_SvPtrArr<SwFrmFmts>(rFrmFmts); } @@ -904,23 +890,23 @@ SW_DLLPUBLIC const char * dbg_out(const SwFrmFmts & rFrmFmts) return dbg_out(lcl_dbg_out(rFrmFmts)); } -static String lcl_dbg_out(const SwNumRuleTbl & rTbl) +static OUString lcl_dbg_out(const SwNumRuleTbl & rTbl) { - String aResult("[", RTL_TEXTENCODING_ASCII_US); + OUString aResult("["); for (size_t n = 0; n < rTbl.size(); n++) { if (n > 0) - aResult += String(", ", RTL_TEXTENCODING_ASCII_US); + aResult += ", "; aResult += rTbl[n]->GetName(); char sBuffer[256]; sprintf(sBuffer, "(%p)", rTbl[n]); - aResult += String(sBuffer, RTL_TEXTENCODING_ASCII_US); + aResult += OUString(sBuffer, strlen(sBuffer), RTL_TEXTENCODING_ASCII_US); } - aResult += String("]", RTL_TEXTENCODING_ASCII_US); + aResult += "]"; return aResult; } @@ -930,39 +916,39 @@ SW_DLLPUBLIC const char * dbg_out(const SwNumRuleTbl & rTbl) return dbg_out(lcl_dbg_out(rTbl)); } -static String lcl_TokenType2Str(FormTokenType nType) +static OUString lcl_TokenType2Str(FormTokenType nType) { switch(nType) { case TOKEN_ENTRY_NO: - return String("NO", RTL_TEXTENCODING_ASCII_US); + return OUString("NO"); case TOKEN_ENTRY_TEXT: - return String("ENTRY_TEXT", RTL_TEXTENCODING_ASCII_US); + return OUString("ENTRY_TEXT"); case TOKEN_ENTRY: - return String("ENTRY", RTL_TEXTENCODING_ASCII_US); + return OUString("ENTRY"); case TOKEN_TAB_STOP: - return String("TAB_STOP", RTL_TEXTENCODING_ASCII_US); + return OUString("TAB_STOP"); case TOKEN_TEXT: - return String("TOKEN_TEXT", RTL_TEXTENCODING_ASCII_US); + return OUString("TOKEN_TEXT"); case TOKEN_PAGE_NUMS: - return String("NUMS", RTL_TEXTENCODING_ASCII_US); + return OUString("NUMS"); case TOKEN_CHAPTER_INFO: - return String("CHAPTER_INFO", RTL_TEXTENCODING_ASCII_US); + return OUString("CHAPTER_INFO"); case TOKEN_LINK_START: - return String("LINK_START", RTL_TEXTENCODING_ASCII_US); + return OUString("LINK_START"); case TOKEN_LINK_END: - return String("LINK_END", RTL_TEXTENCODING_ASCII_US); + return OUString("LINK_END"); case TOKEN_AUTHORITY: - return String("AUTHORITY", RTL_TEXTENCODING_ASCII_US); + return OUString("AUTHORITY"); case TOKEN_END: - return String("END", RTL_TEXTENCODING_ASCII_US); + return OUString("END"); default: OSL_FAIL("should not be reached"); - return String("??", RTL_TEXTENCODING_ASCII_US); + return OUString("??"); } } -static String lcl_dbg_out(const SwFormToken & rToken) +static OUString lcl_dbg_out(const SwFormToken & rToken) { return rToken.GetString(); } @@ -972,23 +958,23 @@ SW_DLLPUBLIC const char * dbg_out(const SwFormToken & rToken) return dbg_out(lcl_dbg_out(rToken)); } -static String lcl_dbg_out(const SwFormTokens & rTokens) +static OUString lcl_dbg_out(const SwFormTokens & rTokens) { - String aStr("[", RTL_TEXTENCODING_ASCII_US); + OUString aStr("["); SwFormTokens::const_iterator aIt; for (aIt = rTokens.begin(); aIt != rTokens.end(); ++aIt) { if (aIt != rTokens.begin()) - aStr += String(", ", RTL_TEXTENCODING_ASCII_US); + aStr += ", "; aStr += lcl_TokenType2Str(aIt->eTokenType); - aStr += String(": ", RTL_TEXTENCODING_ASCII_US); + aStr += ": "; aStr += lcl_dbg_out(*aIt); } - aStr += String("]" , RTL_TEXTENCODING_ASCII_US); + aStr += "]"; return aStr; } @@ -998,15 +984,15 @@ SW_DLLPUBLIC const char * dbg_out(const SwFormTokens & rTokens) return dbg_out(lcl_dbg_out(rTokens)); } -static String lcl_dbg_out(const SwNodeRange & rRange) +static OUString lcl_dbg_out(const SwNodeRange & rRange) { - String aStr("[", RTL_TEXTENCODING_ASCII_US); + OUString aStr("["); aStr += lcl_dbg_out(SwPosition(rRange.aStart)); - aStr += String(", ", RTL_TEXTENCODING_ASCII_US); + aStr += ", "; aStr += lcl_dbg_out(SwPosition(rRange.aEnd)); - aStr += String("]" , RTL_TEXTENCODING_ASCII_US); + aStr += "]"; return aStr; } diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx index 394a203658bd..9da4abe72aa6 100644 --- a/sw/source/core/doc/doc.cxx +++ b/sw/source/core/doc/doc.cxx @@ -1843,7 +1843,7 @@ sal_uInt16 SwDoc::GetRefMarks( std::vector<OUString>* pNames ) const { if( pNames ) { - String pTmp(((SwFmtRefMark*)pItem)->GetRefName()); + OUString pTmp(((SwFmtRefMark*)pItem)->GetRefName()); pNames->insert(pNames->begin() + nCount, pTmp); } nCount ++; @@ -2420,10 +2420,10 @@ bool SwDoc::ConvertFieldsToText() nWhich != RES_REFPAGEGETFLD&& nWhich != RES_REFPAGESETFLD)) { - String sText = pField->ExpandField(true); + OUString sText = pField->ExpandField(true); //database fields should not convert their command into text if( RES_DBFLD == pCurType->Which() && !static_cast<const SwDBField*>(pField)->IsInitialized()) - sText.Erase(); + sText = ""; //now remove the field and insert the string SwPaM aPam1(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart()); @@ -2603,12 +2603,12 @@ OUString SwDoc::GetPaMDescr(const SwPaM & rPam) const xub_StrLen nStart = rPam.Start()->nContent.GetIndex(); xub_StrLen nEnd = rPam.End()->nContent.GetIndex(); - aResult += String(SW_RES(STR_START_QUOTE)); + aResult += SW_RES(STR_START_QUOTE); aResult += ShortenString(pTxtNode->GetTxt(). copy(nStart, nEnd - nStart), nUndoStringLength, - String(SW_RES(STR_LDOTS))); - aResult += String(SW_RES(STR_END_QUOTE)); + OUString(SW_RES(STR_LDOTS))); + aResult += SW_RES(STR_END_QUOTE); bOK = true; } @@ -2616,13 +2616,13 @@ OUString SwDoc::GetPaMDescr(const SwPaM & rPam) const else if (0 != rPam.GetNode(sal_True)) { if (0 != rPam.GetNode(sal_False)) - aResult += String(SW_RES(STR_PARAGRAPHS)); + aResult += SW_RES(STR_PARAGRAPHS); bOK = true; } if (! bOK) - aResult += String("??", RTL_TEXTENCODING_ASCII_US); + aResult += "??"; return aResult; } diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx index 4527b329ec3b..90031608f23b 100644 --- a/sw/source/core/doc/docchart.cxx +++ b/sw/source/core/doc/docchart.cxx @@ -58,15 +58,15 @@ bool SwTable::IsTblComplexForChart( const OUString& rSelection ) const if( 2 < rSelection.getLength() ) { // Remove brackets at the beginning and from the end - String sBox( rSelection ); - if( '<' == sBox.GetChar( 0 ) ) sBox.Erase( 0, 1 ); - if( '>' == sBox.GetChar( sBox.Len()-1 ) ) sBox.Erase( sBox.Len()-1 ); + OUString sBox( rSelection ); + if( '<' == sBox[0] ) sBox = sBox.copy( 0, 1 ); + if( '>' == sBox[ sBox.getLength()-1 ] ) sBox = sBox.copy( 0, sBox.getLength()-1 ); - xub_StrLen nSeparator = sBox.Search( ':' ); - OSL_ENSURE( STRING_NOTFOUND != nSeparator, "no valid selection" ); + sal_Int32 nSeparator = sBox.indexOf( ':' ); + OSL_ENSURE( -1 != nSeparator, "no valid selection" ); - pSttBox = GetTblBox( sBox.Copy( 0, nSeparator )); - pEndBox = GetTblBox( sBox.Copy( nSeparator+1 )); + pSttBox = GetTblBox( sBox.copy( 0, nSeparator )); + pEndBox = GetTblBox( sBox.copy( nSeparator+1 )); } else { @@ -116,7 +116,7 @@ void SwDoc::DoUpdateAllCharts() void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const { - String aName( rTbl.GetFrmFmt()->GetName() ); + OUString aName( rTbl.GetFrmFmt()->GetName() ); SwOLENode *pONd; SwStartNode *pStNd; SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); @@ -124,7 +124,7 @@ void SwDoc::_UpdateCharts( const SwTable& rTbl, ViewShell& rVSh ) const { ++aIdx; if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && - aName.Equals( pONd->GetChartTblName() ) && + aName == pONd->GetChartTblName() && pONd->getLayoutFrm( rVSh.GetLayout() ) ) { SwChartDataProvider *pPCD = GetChartDataProvider(); @@ -152,7 +152,7 @@ void SwDoc::UpdateCharts( const OUString &rName ) const void SwDoc::SetTableName( SwFrmFmt& rTblFmt, const OUString &rNewName ) { - const String aOldName( rTblFmt.GetName() ); + const OUString aOldName( rTblFmt.GetName() ); bool bNameFound = rNewName.isEmpty(); if( !bNameFound ) @@ -216,7 +216,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable ) { if (pTable) { - String aName( pTable->GetFrmFmt()->GetName() ); + OUString aName( pTable->GetFrmFmt()->GetName() ); SwOLENode *pONd; SwStartNode *pStNd; SwNodeIndex aIdx( *GetNodes().GetEndOfAutotext().StartOfSectionNode(), 1 ); @@ -224,7 +224,7 @@ void SwDoc::CreateChartInternalDataProviders( const SwTable *pTable ) { ++aIdx; if( 0 != ( pONd = aIdx.GetNode().GetOLENode() ) && - aName.Equals( pONd->GetChartTblName() ) /* OLE node is chart? */ && + aName == pONd->GetChartTblName() /* OLE node is chart? */ && 0 != (pONd->getLayoutFrm( GetCurrentLayout() )) /* chart frame is not hidden */ ) { uno::Reference < embed::XEmbeddedObject > xIP = pONd->GetOLEObj().GetOleRef(); diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx index 1fcf25e9079a..0749420a8f8d 100644 --- a/sw/source/core/doc/doccomp.cxx +++ b/sw/source/core/doc/doccomp.cxx @@ -967,7 +967,7 @@ public: const SwNode& GetEndNode() const; // for debugging - String GetText() const; + OUString GetText() const; }; class SwCompareData : public CompareData @@ -1027,9 +1027,9 @@ sal_uLong SwCompareLine::GetHashValue() const case ND_SECTIONNODE: { - String sStr( GetText() ); - for( xub_StrLen n = 0; n < sStr.Len(); ++n ) - ( nRet <<= 1 ) += sStr.GetChar( n ); + OUString sStr( GetText() ); + for( xub_StrLen n = 0; n < sStr.getLength(); ++n ) + ( nRet <<= 1 ) += sStr[ n ]; } break; @@ -1183,7 +1183,7 @@ bool SwCompareLine::CompareNode( const SwNode& rDstNd, const SwNode& rSrcNd ) return bRet; } -String SwCompareLine::GetText() const +OUString SwCompareLine::GetText() const { OUString sRet; switch( rNode.GetNodeType() ) @@ -1242,9 +1242,9 @@ String SwCompareLine::GetText() const sal_uLong SwCompareLine::GetTxtNodeHashValue( const SwTxtNode& rNd, sal_uLong nVal ) { - String sStr( rNd.GetExpandTxt() ); - for( xub_StrLen n = 0; n < sStr.Len(); ++n ) - ( nVal <<= 1 ) += sStr.GetChar( n ); + OUString sStr( rNd.GetExpandTxt() ); + for( xub_StrLen n = 0; n < sStr.getLength(); ++n ) + ( nVal <<= 1 ) += sStr[ n ]; return nVal; } @@ -1637,7 +1637,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo ) OSL_ENSURE(xDocProps.is(), "Doc has no DocumentProperties"); if( bUseDocInfo && xDocProps.is() ) { - String aTmp( 1 == xDocProps->getEditingCycles() + OUString aTmp( 1 == xDocProps->getEditingCycles() ? xDocProps->getAuthor() : xDocProps->getModifiedBy() ); util::DateTime uDT( 1 == xDocProps->getEditingCycles() @@ -1647,7 +1647,7 @@ void SwCompareData::SetRedlinesToDoc( sal_Bool bUseDocInfo ) Time t(uDT.Hours, uDT.Minutes, uDT.Seconds, uDT.NanoSeconds); DateTime aDT(d,t); - if( aTmp.Len() ) + if( !aTmp.isEmpty() ) { nAuthor = rDoc.InsertRedlineAuthor( aTmp ); aTimeStamp = aDT; diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx index 72aef84c8173..b2835b1e61ef 100644 --- a/sw/source/core/doc/docdde.cxx +++ b/sw/source/core/doc/docdde.cxx @@ -67,11 +67,11 @@ namespace struct _FindItem { - const String m_Item; + const OUString m_Item; SwTableNode* pTblNd; SwSectionNode* pSectNd; - _FindItem(const String& rS) + _FindItem(const OUString& rS) : m_Item(rS), pTblNd(0), pSectNd(0) {} }; @@ -81,12 +81,12 @@ static bool lcl_FindSection( const SwSectionFmt* pSectFmt, _FindItem * const pIt SwSection* pSect = pSectFmt->GetSection(); if( pSect ) { - String sNm( (bCaseSensitive) + OUString sNm( (bCaseSensitive) ? pSect->GetSectionName() : GetAppCharClass().lowercase( pSect->GetSectionName() )); - String sCompare( (bCaseSensitive) + OUString sCompare( (bCaseSensitive) ? pItem->m_Item - : String(GetAppCharClass().lowercase( pItem->m_Item ) )); + : GetAppCharClass().lowercase( pItem->m_Item ) ); if( sNm == sCompare ) { // found, so get the data @@ -107,8 +107,8 @@ static bool lcl_FindSection( const SwSectionFmt* pSectFmt, _FindItem * const pIt static bool lcl_FindTable( const SwFrmFmt* pTableFmt, _FindItem * const pItem ) { - String sNm( GetAppCharClass().lowercase( pTableFmt->GetName() )); - if (sNm.Equals( pItem->m_Item )) + OUString sNm( GetAppCharClass().lowercase( pTableFmt->GetName() )); + if ( sNm == pItem->m_Item ) { SwTable* pTmpTbl; SwTableBox* pFBox; @@ -140,7 +140,7 @@ bool SwDoc::GetData( const OUString& rItem, const OUString& rMimeType, return SwServerObject(*pBkmk).GetData(rValue, rMimeType); // Do we already have the Item? - String sItem( bCaseSensitive ? rItem : GetAppCharClass().lowercase(rItem)); + OUString sItem( bCaseSensitive ? rItem : GetAppCharClass().lowercase(rItem)); _FindItem aPara( sItem ); BOOST_FOREACH( const SwSectionFmt* pFmt, *mpSectionFmtTbl ) { @@ -183,7 +183,7 @@ bool SwDoc::SetData( const OUString& rItem, const OUString& rMimeType, return SwServerObject(*pBkmk).SetData(rMimeType, rValue); // Do we already have the Item? - String sItem( bCaseSensitive ? rItem : GetAppCharClass().lowercase(rItem)); + OUString sItem( bCaseSensitive ? rItem : GetAppCharClass().lowercase(rItem)); _FindItem aPara( sItem ); BOOST_FOREACH( const SwSectionFmt* pFmt, *mpSectionFmtTbl ) { @@ -200,7 +200,7 @@ bool SwDoc::SetData( const OUString& rItem, const OUString& rMimeType, bCaseSensitive = false; } - String sItem(GetAppCharClass().lowercase(rItem)); + OUString sItem(GetAppCharClass().lowercase(rItem)); _FindItem aPara( sItem ); BOOST_FOREACH( const SwFrmFmt* pFmt, *mpTblFrmFmtTbl ) { @@ -284,21 +284,21 @@ bool SwDoc::SelectServerObj( const OUString& rStr, SwPaM*& rpPam, rpPam = 0; rpRange = 0; - String sItem( INetURLObject::decode( rStr, INET_HEX_ESCAPE, + OUString sItem( INetURLObject::decode( rStr, INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8 )); - xub_StrLen nPos = sItem.Search( cMarkSeparator ); + sal_Int32 nPos = sItem.indexOf( cMarkSeparator ); const CharClass& rCC = GetAppCharClass(); // Extension for sections: not only link bookmarks/sections // but also frames (text!), tables, outlines: - if( STRING_NOTFOUND != nPos ) + if( -1 != nPos ) { bool bContinue = false; - String sName( sItem.Copy( 0, nPos ) ); - OUString sCmp( sItem.Copy( nPos + 1 )); + OUString sName( sItem.copy( 0, nPos ) ); + OUString sCmp( sItem.copy( nPos + 1 )); sItem = rCC.lowercase( sItem ); _FindItem aPara( sName ); @@ -384,7 +384,7 @@ bool SwDoc::SelectServerObj( const OUString& rStr, SwPaM*& rpPam, } // - _FindItem aPara( bCaseSensitive ? sItem : String(rCC.lowercase( sItem )) ); + _FindItem aPara( bCaseSensitive ? sItem : rCC.lowercase( sItem ) ); if( !mpSectionFmtTbl->empty() ) { diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx index c685253f5b6d..ea1a3f9aeafb 100644 --- a/sw/source/core/doc/docfld.cxx +++ b/sw/source/core/doc/docfld.cxx @@ -91,7 +91,7 @@ SwFieldType* SwDoc::InsertFldType(const SwFieldType &rFldTyp) case RES_DDEFLD: { const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); - String sFldNm( rFldTyp.GetName() ); + OUString sFldNm( rFldTyp.GetName() ); for( ; i < nSize; ++i ) if( nFldWhich == (*mpFldTypes)[i]->Which() && rSCmp.isEqual( sFldNm, (*mpFldTypes)[i]->GetName() )) @@ -158,7 +158,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp ) RES_DDEFLD == nFldWhich, "Wrong FldType" ); const ::utl::TransliterationWrapper& rSCmp = GetAppCmpStrIgnore(); - const String& rFldNm = rFldTyp.GetName(); + const OUString& rFldNm = rFldTyp.GetName(); SwFieldType* pFnd; for( ; i < nSize; ++i ) @@ -168,8 +168,7 @@ void SwDoc::InsDeletedFldType( SwFieldType& rFldTyp ) // find new name sal_uInt16 nNum = 1; do { - String sSrch( rFldNm ); - sSrch.Append( OUString::number( nNum )); + OUString sSrch = rFldNm + OUString::number( nNum ); for( i = INIT_FLDTYPES; i < nSize; ++i ) if( nFldWhich == (pFnd = (*mpFldTypes)[i])->Which() && rSCmp.isEqual( sSrch, pFnd->GetName() ) ) @@ -993,18 +992,18 @@ OUString LookString( SwHash** ppTbl, sal_uInt16 nSize, const OUString& rName, return OUString(); } -static String lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBFld ) +static OUString lcl_GetDBVarName( SwDoc& rDoc, SwDBNameInfField& rDBFld ) { SwDBData aDBData( rDBFld.GetDBData( &rDoc )); - String sDBNumNm; + OUString sDBNumNm; SwDBData aDocData = rDoc.GetDBData(); if( aDBData != aDocData ) { sDBNumNm = aDBData.sDataSource; - sDBNumNm += DB_DELIM; - sDBNumNm += String(aDBData.sCommand); - sDBNumNm += DB_DELIM; + sDBNumNm += OUString(DB_DELIM); + sDBNumNm += aDBData.sCommand; + sDBNumNm += OUString(DB_DELIM); } sDBNumNm += SwFieldType::GetTypeStr(TYP_DBSETNUMBERFLD); @@ -1057,7 +1056,7 @@ static void lcl_CalcFld( SwDoc& rDoc, SwCalc& rCalc, const _SetGetExpFld& rSGEFl !pMgr->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )) break; - String sDBNumNm(lcl_GetDBVarName( rDoc, *pDBFld)); + OUString sDBNumNm(lcl_GetDBVarName( rDoc, *pDBFld)); SwCalcExp* pExp = rCalc.VarLook( sDBNumNm ); if( pExp ) rCalc.VarChange( sDBNumNm, pExp->nValue.GetLong() + 1 ); @@ -1143,9 +1142,9 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, // set the new value in the hash table // is the formula a field? SwSetExpField* pSFld = (SwSetExpField*)pFld; - String aNew = LookString( ppHashTbl, rTblSize, pSFld->GetFormula() ); + OUString aNew = LookString( ppHashTbl, rTblSize, pSFld->GetFormula() ); - if( !aNew.Len() ) // nothing found, then the formula is + if( aNew.isEmpty() ) // nothing found, then the formula is aNew = pSFld->GetFormula(); // the new value // #i3141# - update expression of field as in method @@ -1168,13 +1167,13 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize, break; case RES_DBFLD: { - const String& rName = pFld->GetTyp()->GetName(); + const OUString& rName = pFld->GetTyp()->GetName(); // Insert entry in the hash table // Entry present? sal_uInt16 nPos; SwHash* pFnd = Find( rName, ppHashTbl, rTblSize, &nPos ); - String const value(pFld->ExpandField(IsClipBoard())); + OUString const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) { // modify entry in the hash table @@ -1231,8 +1230,8 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) { // Entry present? sal_uInt16 nPos; - const String& rNm = pFldType->GetName(); - String sExpand(((SwUserFieldType*)pFldType)->Expand(nsSwGetSetExpType::GSE_STRING, 0, 0)); + const OUString& rNm = pFldType->GetName(); + OUString sExpand(((SwUserFieldType*)pFldType)->Expand(nsSwGetSetExpType::GSE_STRING, 0, 0)); SwHash* pFnd = Find( rNm, pHashStrTbl, nStrFmtCnt, &nPos ); if( pFnd ) // modify entry in the hash table @@ -1252,7 +1251,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) // The array is filled with all fields; start calculation. SwCalc aCalc( *this ); - String sDBNumNm( SwFieldType::GetTypeStr( TYP_DBSETNUMBERFLD ) ); + OUString sDBNumNm( SwFieldType::GetTypeStr( TYP_DBSETNUMBERFLD ) ); // already set the current record number SwNewDBMgr* pMgr = GetNewDBMgr(); @@ -1267,7 +1266,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) nShownSections++; } - String aNew; + OUString aNew; for( _SetGetExpFlds::const_iterator it = mpUpdtFlds->GetSortLst()->begin(); it != mpUpdtFlds->GetSortLst()->end(); ++it ) { SwSection* pSect = (SwSection*)(*it)->GetSection(); @@ -1357,13 +1356,13 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) if( pMgr->IsDataSourceOpen(aTmpDBData.sDataSource, aTmpDBData.sCommand, sal_False)) aCalc.VarChange( sDBNumNm, pMgr->GetSelectedRecordId(aTmpDBData.sDataSource, aTmpDBData.sCommand, aTmpDBData.nCommandType)); - const String& rName = pFld->GetTyp()->GetName(); + const OUString& rName = pFld->GetTyp()->GetName(); // Add entry to hash table // Entry present? sal_uInt16 nPos; SwHash* pFnd = Find( rName, pHashStrTbl, nStrFmtCnt, &nPos ); - String const value(pFld->ExpandField(IsClipBoard())); + OUString const value(pFld->ExpandField(IsClipBoard())); if( pFnd ) { // Modify entry in the hash table @@ -1401,7 +1400,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) aNew = LookString( pHashStrTbl, nStrFmtCnt, pSFld->GetFormula() ); - if( !aNew.Len() ) // nothing found then the formula is the new value + if( aNew.isEmpty() ) // nothing found then the formula is the new value aNew = pSFld->GetFormula(); // only update one field @@ -1469,7 +1468,7 @@ void SwDoc::UpdateExpFlds( SwTxtFld* pUpdtFld, bool bUpdRefFlds ) } } - aNew += '='; + aNew += "="; aNew += pSFld->GetFormula(); SwSbxValue aValue = aCalc.Calculate( aNew ); @@ -1652,12 +1651,12 @@ void SwDoc::SetInitDBFields( sal_Bool b ) } /// Get all databases that are used by fields -static String lcl_DBDataToString(const SwDBData& rData) +static OUString lcl_DBDataToString(const SwDBData& rData) { - String sRet = rData.sDataSource; - sRet += DB_DELIM; - sRet += (String)rData.sCommand; - sRet += DB_DELIM; + OUString sRet = rData.sDataSource; + sRet += OUString(DB_DELIM); + sRet += rData.sCommand; + sRet += OUString(DB_DELIM); sRet += OUString::number(rData.nCommandType); return sRet; } @@ -1681,7 +1680,7 @@ void SwDoc::GetAllUsedDB( std::vector<OUString>& rDBNameList, if( pSect ) { - String aCond( pSect->GetCondition() ); + OUString aCond( pSect->GetCondition() ); AddUsedDBToList( rDBNameList, FindUsedDBs( *pAllDBNames, aCond, aUsedDBNames ) ); aUsedDBNames.clear(); @@ -1759,27 +1758,27 @@ std::vector<OUString>& SwDoc::FindUsedDBs( const std::vector<OUString>& rAllDBNa std::vector<OUString>& rUsedDBNames ) { const CharClass& rCC = GetAppCharClass(); - String sFormula(rFormula); + OUString sFormula(rFormula); #ifndef UNX sFormula = rCC.uppercase( sFormula ); #endif - xub_StrLen nPos; + sal_Int32 nPos; for (sal_uInt16 i = 0; i < rAllDBNames.size(); ++i ) { - String pStr(rAllDBNames[i]); + OUString pStr(rAllDBNames[i]); - if( STRING_NOTFOUND != (nPos = sFormula.Search( pStr )) && - sFormula.GetChar( nPos + pStr.Len() ) == '.' && + if( -1 != (nPos = sFormula.indexOf( pStr )) && + sFormula[ nPos + pStr.getLength() ] == '.' && (!nPos || !rCC.isLetterNumeric( sFormula, nPos - 1 ))) { // Look up table name - xub_StrLen nEndPos; - nPos += pStr.Len() + 1; - if( STRING_NOTFOUND != (nEndPos = sFormula.Search('.', nPos)) ) + sal_Int32 nEndPos; + nPos += pStr.getLength() + 1; + if( -1 != (nEndPos = sFormula.indexOf('.', nPos)) ) { - pStr.Append( DB_DELIM ); - pStr.Append( sFormula.Copy( nPos, nEndPos - nPos )); + pStr += OUString( DB_DELIM ); + pStr += sFormula.copy( nPos, nEndPos - nPos ); rUsedDBNames.push_back(pStr); } } @@ -2463,7 +2462,7 @@ void SwDocUpdtFld::GetBodyNode( const SwSectionNode& rSectNd ) void SwDocUpdtFld::InsertFldType( const SwFieldType& rType ) { - String sFldName; + OUString sFldName; switch( rType.Which() ) { case RES_USERFLD : @@ -2476,7 +2475,7 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType ) OSL_ENSURE( !this, "kein gueltiger FeldTyp" ); } - if( sFldName.Len() ) + if( !sFldName.isEmpty() ) { SetFieldsDirty( true ); // look up and remove from the hash table @@ -2496,7 +2495,7 @@ void SwDocUpdtFld::InsertFldType( const SwFieldType& rType ) void SwDocUpdtFld::RemoveFldType( const SwFieldType& rType ) { - String sFldName; + OUString sFldName; switch( rType.Which() ) { case RES_USERFLD : @@ -2507,7 +2506,7 @@ void SwDocUpdtFld::RemoveFldType( const SwFieldType& rType ) break; } - if( sFldName.Len() ) + if( !sFldName.isEmpty() ) { SetFieldsDirty( true ); // look up and remove from the hash table diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index 0330e5552e32..db0b4963e411 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1883,8 +1883,8 @@ SwTxtFmtColl* SwDoc::CopyTxtColl( const SwTxtFmtColl& rColl ) sal_False, &pItem )) { const SwNumRule* pRule; - const String& rName = ((SwNumRuleItem*)pItem)->GetValue(); - if( rName.Len() && + const OUString& rName = ((SwNumRuleItem*)pItem)->GetValue(); + if( !rName.isEmpty() && 0 != ( pRule = rColl.GetDoc()->FindNumRulePtr( rName )) && !pRule->IsAutoRule() ) { @@ -1926,7 +1926,7 @@ SwGrfFmtColl* SwDoc::CopyGrfColl( const SwGrfFmtColl& rColl ) return pNewColl; } -static SwPageDesc* lcl_FindPageDesc( const SwPageDescs& rArr, const String& rName ) +static SwPageDesc* lcl_FindPageDesc( const SwPageDescs& rArr, const OUString& rName ) { for( sal_uInt16 n = rArr.size(); n; ) { @@ -1981,7 +1981,7 @@ void SwDoc::CopyFmtArr( const SwFmtsBase& rSourceArr, ((SwFmtPageDesc*)pItem)->GetPageDesc() ) { SwFmtPageDesc aPageDesc( *(SwFmtPageDesc*)pItem ); - const String& rNm = aPageDesc.GetPageDesc()->GetName(); + const OUString& rNm = aPageDesc.GetPageDesc()->GetName(); SwPageDesc* pPageDesc = ::lcl_FindPageDesc( maPageDescs, rNm ); if( !pPageDesc ) { diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index a0a77bb7d1a8..48e90d880e2e 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -228,7 +228,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, } INetURLObject aEntry(rPath); - String sLeading(aEntry.GetBase()); + OUString sLeading(aEntry.GetBase()); aEntry.removeSegment(); OUString sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE ); utl::TempFile aTemp(sLeading,&sExt,&sPath ); @@ -262,7 +262,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, : GetNodes().GetEndOfContent() ); // Write out the Nodes completely - String sFileName; + OUString sFileName; if( pStartNd->GetIndex() + 1 < aEndIdx.GetIndex() ) { SfxObjectShellLock xDocSh( new SwDocShell( SFX_CREATE_MODE_INTERNAL )); @@ -334,13 +334,13 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, // do not insert a FileLinkSection in case of error if( xDocSh->GetError() ) - sFileName.Erase(); + sFileName = ""; } xDocSh->DoClose(); } // We can now insert the section - if( sFileName.Len() ) + if( !sFileName.isEmpty() ) { switch( eDocType ) { diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx index 4a4ea7b9f298..bdc899d6db05 100644 --- a/sw/source/core/doc/doclay.cxx +++ b/sw/source/core/doc/doclay.cxx @@ -548,7 +548,7 @@ SwFlyFrmFmt* SwDoc::_MakeFlySection( const SwPosition& rAnchPos, if( !pFrmFmt ) pFrmFmt = GetFrmFmtFromPool( RES_POOLFRM_FRAME ); - String sName; + OUString sName; if( !mbInReading ) switch( rNode.GetNodeType() ) { @@ -1126,10 +1126,10 @@ static void lcl_CpyAttr( SfxItemSet &rNewSet, const SfxItemSet &rOldSet, sal_uIn static SwFlyFrmFmt * lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, SwUndoInsertLabel *const pUndo, - SwLabelType const eType, String const& rTxt, String const& rSeparator, - const String& rNumberingSeparator, + SwLabelType const eType, OUString const& rTxt, OUString const& rSeparator, + const OUString& rNumberingSeparator, const sal_Bool bBefore, const sal_uInt16 nId, const sal_uLong nNdIdx, - const String& rCharacterStyle, + const OUString& rCharacterStyle, const sal_Bool bCpyBrd ) { ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); @@ -1368,8 +1368,8 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, { // #i61007# order of captions sal_Bool bOrderNumberingFirst = SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst(); - // Work up string - String aTxt; + // Work up OUString + OUString aTxt; if( bOrderNumberingFirst ) { aTxt = rNumberingSeparator; @@ -1378,14 +1378,14 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, { aTxt += pType->GetName(); if( !bOrderNumberingFirst ) - aTxt += ' '; + aTxt += " "; } - xub_StrLen nIdx = aTxt.Len(); - if( rTxt.Len() > 0 ) + xub_StrLen nIdx = aTxt.getLength(); + if( !rTxt.isEmpty() ) { aTxt += rSeparator; } - xub_StrLen nSepIdx = aTxt.Len(); + xub_StrLen nSepIdx = aTxt.getLength(); aTxt += rTxt; // Insert string @@ -1400,7 +1400,7 @@ lcl_InsertLabel(SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, nIdx = 0; SwFmtFld aFmt( aFld ); pNew->InsertItem( aFmt, nIdx, nIdx ); - if(rCharacterStyle.Len()) + if(!rCharacterStyle.isEmpty()) { SwCharFmt* pCharFmt = rDoc.FindCharFmtByName(rCharacterStyle); if( !pCharFmt ) @@ -1476,11 +1476,11 @@ SwDoc::InsertLabel( static SwFlyFrmFmt * lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, SwUndoInsertLabel *const pUndo, SwDrawFrmFmt *const pOldFmt, - String const& rTxt, - const String& rSeparator, - const String& rNumberSeparator, + OUString const& rTxt, + const OUString& rSeparator, + const OUString& rNumberSeparator, const sal_uInt16 nId, - const String& rCharacterStyle, + const OUString& rCharacterStyle, SdrObject& rSdrObj ) { ::sw::UndoGuard const undoGuard(rDoc.GetIDocumentUndoRedo()); @@ -1664,7 +1664,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, sal_Bool bOrderNumberingFirst = SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst(); // prepare string - String aTxt; + OUString aTxt; if( bOrderNumberingFirst ) { aTxt = rNumberSeparator; @@ -1673,11 +1673,11 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, { aTxt += pType->GetName(); if( !bOrderNumberingFirst ) - aTxt += ' '; + aTxt += " "; } - xub_StrLen nIdx = aTxt.Len(); + xub_StrLen nIdx = aTxt.getLength(); aTxt += rSeparator; - xub_StrLen nSepIdx = aTxt.Len(); + xub_StrLen nSepIdx = aTxt.getLength(); aTxt += rTxt; // insert text @@ -1692,7 +1692,7 @@ lcl_InsertDrawLabel( SwDoc & rDoc, SwTxtFmtColls *const pTxtFmtCollTbl, nIdx = 0; SwFmtFld aFmt( aFld ); pNew->InsertItem( aFmt, nIdx, nIdx ); - if ( rCharacterStyle.Len() ) + if ( !rCharacterStyle.isEmpty() ) { SwCharFmt * pCharFmt = rDoc.FindCharFmtByName(rCharacterStyle); if ( !pCharFmt ) @@ -1898,11 +1898,11 @@ IMPL_STATIC_LINK( SwDoc, BackgroundDone, SvxBrushItem*, EMPTYARG ) return 0; } -static String lcl_GetUniqueFlyName( const SwDoc* pDoc, sal_uInt16 nDefStrId ) +static OUString lcl_GetUniqueFlyName( const SwDoc* pDoc, sal_uInt16 nDefStrId ) { ResId aId( nDefStrId, *pSwResMgr ); - String aName( aId ); - xub_StrLen nNmLen = aName.Len(); + OUString aName( aId ); + xub_StrLen nNmLen = aName.getLength(); const SwFrmFmts& rFmts = *pDoc->GetSpzFrmFmts(); @@ -2009,9 +2009,9 @@ void SwDoc::SetAllUniqueFlyNames() ResId nFrmId( STR_FRAME_DEFNAME, *pSwResMgr ), nGrfId( STR_GRAPHIC_DEFNAME, *pSwResMgr ), nOLEId( STR_OBJECT_DEFNAME, *pSwResMgr ); - String sFlyNm( nFrmId ); - String sGrfNm( nGrfId ); - String sOLENm( nOLEId ); + OUString sFlyNm( nFrmId ); + OUString sGrfNm( nGrfId ); + OUString sOLENm( nOLEId ); if( 255 < ( n = GetSpzFrmFmts()->size() )) n = 255; @@ -2031,17 +2031,17 @@ void SwDoc::SetAllUniqueFlyNames() xub_StrLen nLen = 0; if ( aNm.startsWith(sGrfNm) ) { - nLen = sGrfNm.Len(); + nLen = sGrfNm.getLength(); pNum = &nGrfNum; } else if( aNm.startsWith(sFlyNm) ) { - nLen = sFlyNm.Len(); + nLen = sFlyNm.getLength(); pNum = &nFlyNum; } else if( aNm.startsWith(sOLENm) ) { - nLen = sOLENm.Len(); + nLen = sOLENm.getLength(); pNum = &nOLENum; } diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx index 5a142ecc483a..ad2f7aa0afb8 100644 --- a/sw/source/core/doc/docnum.cxx +++ b/sw/source/core/doc/docnum.cxx @@ -587,28 +587,28 @@ static sal_uInt16 lcl_FindOutlineName( const SwNodes& rNds, const OUString& rNam return nSavePos; } -static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) +static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, OUString& rName ) { // Valid numbers are (always just offsets!): // ([Number]+\.)+ (as a regular expression!) // (Number follwed by a period, with 5 repetitions) // i.e.: "1.1.", "1.", "1.1.1." sal_Int32 nPos = 0; - String sNum = rName.GetToken( 0, '.', nPos ); + OUString sNum = rName.getToken( 0, '.', nPos ); if( -1 == nPos ) return USHRT_MAX; // invalid number! sal_uInt16 nLevelVal[ MAXLEVEL ]; // numbers of all levels memset( nLevelVal, 0, MAXLEVEL * sizeof( nLevelVal[0] )); sal_uInt8 nLevel = 0; - String sName( rName ); + OUString sName( rName ); while( -1 != nPos ) { sal_uInt16 nVal = 0; sal_Unicode c; - for( sal_uInt16 n = 0; n < sNum.Len(); ++n ) - if( '0' <= ( c = sNum.GetChar( n )) && c <= '9' ) + for( sal_uInt16 n = 0; n < sNum.getLength(); ++n ) + if( '0' <= ( c = sNum[ n ]) && c <= '9' ) { nVal *= 10; nVal += c - '0'; } @@ -620,9 +620,9 @@ static sal_uInt16 lcl_FindOutlineNum( const SwNodes& rNds, String& rName ) if( MAXLEVEL > nLevel ) nLevelVal[ nLevel++ ] = nVal; - sName.Erase( 0, nPos ); + sName = sName.copy( nPos ); nPos = 0; - sNum = sName.GetToken( 0, '.', nPos ); + sNum = sName.getToken( 0, '.', nPos ); // #i4533# without this check all parts delimited by a dot are treated as outline numbers if(!comphelper::string::isdigitAsciiString(sNum)) nPos = -1; @@ -696,26 +696,26 @@ bool SwDoc::GotoOutline( SwPosition& rPos, const OUString& rName ) const const SwOutlineNodes& rOutlNds = GetNodes().GetOutLineNds(); // 1. step: via the Number: - String sName( rName ); + OUString sName( rName ); sal_uInt16 nFndPos = ::lcl_FindOutlineNum( GetNodes(), sName ); if( USHRT_MAX != nFndPos ) { SwTxtNode* pNd = rOutlNds[ nFndPos ]->GetTxtNode(); - String sExpandedText = pNd->GetExpandTxt(); + OUString sExpandedText = pNd->GetExpandTxt(); //#i4533# leading numbers followed by a dot have been remove while //searching for the outline position //to compensate this they must be removed from the paragraphs text content, too sal_Int32 nPos = 0; - String sTempNum; - while(sExpandedText.Len() && (sTempNum = sExpandedText.GetToken(0, '.', nPos)).Len() && + OUString sTempNum; + while(!sExpandedText.isEmpty() && !(sTempNum = sExpandedText.getToken(0, '.', nPos)).isEmpty() && -1 != nPos && comphelper::string::isdigitAsciiString(sTempNum)) { - sExpandedText.Erase(0, nPos); + sExpandedText = sExpandedText.copy(nPos); nPos = 0; } - if( !sExpandedText.Equals( sName ) ) + if( sExpandedText != sName ) { sal_uInt16 nTmp = ::lcl_FindOutlineName( GetNodes(), sName, true ); if( USHRT_MAX != nTmp ) // found via the Name @@ -739,7 +739,7 @@ bool SwDoc::GotoOutline( SwPosition& rPos, const OUString& rName ) const } // #i68289# additional search on hyperlink URL without its outline numbering part - if ( !sName.Equals( rName ) ) + if ( sName != rName ) { nFndPos = ::lcl_FindOutlineName( GetNodes(), sName, false ); if( USHRT_MAX != nFndPos ) @@ -865,7 +865,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam, { if ( bCreateNewList ) { - String sListId; + OUString sListId; if ( !bUpdateRule ) { // apply list id of list, which has been created for the new list style @@ -874,7 +874,7 @@ void SwDoc::SetNumRule( const SwPaM& rPam, else { // create new list and apply its list id - SwList* pNewList = createList( String(), pNew->GetName() ); + SwList* pNewList = createList( OUString(), pNew->GetName() ); OSL_ENSURE( pNewList, "<SwDoc::SetNumRule(..)> - could not create new list. Serious defect -> please inform OD." ); sListId = pNewList->GetListId(); @@ -1048,7 +1048,7 @@ bool SwDoc::DelNumRule( const OUString& rName, bool bBroadcast ) } // #i34097# DeleteAndDestroy deletes rName if // rName is directly taken from the numrule. - const String aTmpName( rName ); + const OUString aTmpName( rName ); delete (*mpNumRuleTbl)[ nPos ]; mpNumRuleTbl->erase( mpNumRuleTbl->begin() + nPos ); maNumRuleMap.erase(aTmpName); @@ -2176,7 +2176,7 @@ sal_uInt16 SwDoc::MakeNumRule( const OUString &rName, pNew->SetPoolFmtId( USHRT_MAX ); pNew->SetPoolHelpId( USHRT_MAX ); pNew->SetPoolHlpFileId( UCHAR_MAX ); - pNew->SetDefaultListId( String() ); + pNew->SetDefaultListId( OUString() ); } pNew->CheckCharFmts( this ); } @@ -2524,10 +2524,10 @@ SwList* SwDoc::createListForListStyle( const OUString& sListStyleName ) return 0; } - String sListId( pNumRule->GetDefaultListId() ); // can be empty String + OUString sListId( pNumRule->GetDefaultListId() ); // can be empty String if ( getListByName( sListId ) ) { - sListId = String(); + sListId = OUString(); } SwList* pNewList = createList( sListId, sListStyleName ); maListStyleLists[sListStyleName] = pNewList; @@ -2552,7 +2552,7 @@ SwList* SwDoc::getListForListStyle( const OUString& sListStyleName ) const void SwDoc::deleteListForListStyle( const OUString& sListStyleName ) { - String sListId; + OUString sListId; { SwList* pList = getListForListStyle( sListStyleName ); OSL_ENSURE( pList, @@ -2562,7 +2562,7 @@ void SwDoc::deleteListForListStyle( const OUString& sListStyleName ) sListId = pList->GetListId(); } } - if ( sListId.Len() > 0 ) + if ( !sListId.isEmpty() ) { maListStyleLists.erase( sListStyleName ); deleteList( sListId ); @@ -2585,11 +2585,11 @@ void SwDoc::trackChangeOfListStyleName( const OUString& sListStyleName, namespace listfunc { - const String MakeListIdUnique( const SwDoc& rDoc, - const String aSuggestedUniqueListId ) + const OUString MakeListIdUnique( const SwDoc& rDoc, + const OUString aSuggestedUniqueListId ) { long nHitCount = 0; - String aTmpStr = aSuggestedUniqueListId; + OUString aTmpStr = aSuggestedUniqueListId; while ( rDoc.getListByName( aTmpStr ) ) { ++nHitCount; diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 7b394252d523..915c19936da0 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -2119,7 +2119,7 @@ bool SwDoc::AcceptRedline( const SwPaM& rPam, bool bCallDelete ) } if (GetIDocumentUndoRedo().DoesUndo()) { - String aTmpStr; + OUString aTmpStr; { SwRewriter aRewriter; @@ -2229,7 +2229,7 @@ bool SwDoc::RejectRedline( const SwPaM& rPam, bool bCallDelete ) } if (GetIDocumentUndoRedo().DoesUndo()) { - String aTmpStr; + OUString aTmpStr; { SwRewriter aRewriter; @@ -3025,7 +3025,7 @@ OUString SwRedlineData::GetDescr() const { OUString aResult; - aResult += String(SW_RES(STR_REDLINE_INSERT + GetType())); + aResult += SW_RES(STR_REDLINE_INSERT + GetType()); return aResult; } @@ -3788,11 +3788,11 @@ OUString SwRedline::GetDescr(sal_uInt16 nPos) } // replace $1 in description by description of the redlines text - String aTmpStr; - aTmpStr += String(SW_RES(STR_START_QUOTE)); + OUString aTmpStr; + aTmpStr += SW_RES(STR_START_QUOTE); aTmpStr += ShortenString(pPaM->GetTxt(), nUndoStringLength, - String(SW_RES(STR_LDOTS))); - aTmpStr += String(SW_RES(STR_END_QUOTE)); + OUString(SW_RES(STR_LDOTS))); + aTmpStr += SW_RES(STR_END_QUOTE); SwRewriter aRewriter; aRewriter.AddRule(UndoArg1, aTmpStr); diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index fac5b52709bc..f272f4fab1a2 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -197,18 +197,18 @@ OUString SwSortTxtElement::GetKey(sal_uInt16 nId) const { SwTxtNode* pTxtNd = aPos.GetNode().GetTxtNode(); if( !pTxtNd ) - return aEmptyStr; + return aEmptyOUStr; // for TextNodes - const String& rStr = pTxtNd->GetTxt(); + const OUString& rStr = pTxtNd->GetTxt(); sal_Unicode nDeli = pOptions->cDeli; sal_uInt16 nDCount = pOptions->aKeys[nId]->nColumnId, i = 1; - xub_StrLen nStart = 0; + sal_Int32 nStart = 0; // Find the delimiter - while( nStart != STRING_NOTFOUND && i < nDCount) - if( STRING_NOTFOUND != ( nStart = rStr.Search( nDeli, nStart ) ) ) + while( nStart != -1 && i < nDCount) + if( -1 != ( nStart = rStr.indexOf( nDeli, nStart ) ) ) { nStart++; i++; @@ -216,8 +216,10 @@ OUString SwSortTxtElement::GetKey(sal_uInt16 nId) const // Found next delimiter or end of String // and copy - xub_StrLen nEnd = rStr.Search( nDeli, nStart+1 ); - return rStr.Copy( nStart, nEnd-nStart ); + sal_Int32 nEnd = rStr.indexOf( nDeli, nStart+1 ); + if (nEnd == -1) + return rStr.copy( nStart ); + return rStr.copy( nStart, nEnd-nStart ); } /// SortingElement for Tables diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 3a46959dd0a7..f1d61109331c 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -77,7 +77,7 @@ struct LinkStruct SwFmtINetFmt aINetFmt; xub_StrLen nStartTextPos, nEndTextPos; - LinkStruct( const String& rURL, xub_StrLen nStart, xub_StrLen nEnd ) + LinkStruct( const OUString& rURL, xub_StrLen nStart, xub_StrLen nEnd ) : aINetFmt( rURL, aEmptyStr), nStartTextPos( nStart), nEndTextPos(nEnd) {} @@ -339,7 +339,7 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( const SwPosition& rPos, { GetIDocumentUndoRedo().StartUndo( UNDO_INSTOX, NULL ); - String sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), rTOX.GetTOXName() ); + OUString sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), rTOX.GetTOXName() ); SwPaM aPam( rPos ); SwSectionData aSectionData( TOX_CONTENT_SECTION, sSectNm ); SwTOXBaseSection *const pNewSection = dynamic_cast<SwTOXBaseSection *>( @@ -398,7 +398,7 @@ const SwTOXBaseSection* SwDoc::InsertTableOf( sal_uLong nSttNd, sal_uLong nEndNd pSectNd = pSectNd->StartOfSectionNode()->FindSectionNode(); } - String sSectNm = GetUniqueTOXBaseName(*rTOX.GetTOXType(), rTOX.GetTOXName()); + OUString sSectNm = GetUniqueTOXBaseName(*rTOX.GetTOXType(), rTOX.GetTOXName()); SwSectionData aSectionData( TOX_CONTENT_SECTION, sSectNm ); @@ -671,7 +671,7 @@ bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const OUString& rName) "no TOXBaseSection!" ); SwTOXBaseSection* pTOX = (SwTOXBaseSection*)&rTOXBase; - String sTmp = GetUniqueTOXBaseName(*rTOXBase.GetTOXType(), rName); + OUString sTmp = GetUniqueTOXBaseName(*rTOXBase.GetTOXType(), rName); bool bRet = sTmp == rName; if(bRet) { @@ -963,8 +963,8 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, aSortArr[nCnt]->GetType() == TOX_SORT_INDEX) { const SwTOXMark& rMark = aSortArr[nCnt]->pTxtMark->GetTOXMark(); - const String sPrimKey = rMark.GetPrimaryKey(); - const String sSecKey = rMark.GetSecondaryKey(); + const OUString sPrimKey = rMark.GetPrimaryKey(); + const OUString sSecKey = rMark.GetSecondaryKey(); const SwTOXMark* pNextMark = 0; while(aSortArr.size() > (nCnt + nRange)&& aSortArr[nCnt + nRange]->GetType() == TOX_SORT_INDEX && @@ -1021,7 +1021,7 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr, void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl ) { SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc(); - String sDeli, sLastDeli; + OUString sDeli, sLastDeli; sal_uInt16 i = 0; while( i < aSortArr.size() ) { @@ -1037,10 +1037,10 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl ) aSortArr[i]->GetLocale() ); // Do we already have a Delimitter? - if( sDeli.Len() && sLastDeli != sDeli ) + if( !sDeli.isEmpty() && sLastDeli != sDeli ) { // We skip all that are less than a small Blank (these are special characters) - if( ' ' <= sDeli.GetChar( 0 ) ) + if( ' ' <= sDeli[0] ) { SwTOXCustom* pCst = new SwTOXCustom( TextAndReading(sDeli, OUString()), FORM_ALPHA_DELIMITTER, @@ -1062,8 +1062,8 @@ void SwTOXBaseSection::InsertAlphaDelimitter( const SwTOXInternational& rIntl ) SwTxtFmtColl* SwTOXBaseSection::GetTxtFmtColl( sal_uInt16 nLevel ) { SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc(); - const String& rName = GetTOXForm().GetTemplate( nLevel ); - SwTxtFmtColl* pColl = rName.Len() ? pDoc->FindTxtFmtCollByName(rName) :0; + const OUString& rName = GetTOXForm().GetTemplate( nLevel ); + SwTxtFmtColl* pColl = !rName.isEmpty() ? pDoc->FindTxtFmtCollByName(rName) :0; if( !pColl ) { sal_uInt16 nPoolFmt = 0; @@ -1210,12 +1210,12 @@ void SwTOXBaseSection::UpdateTemplate( const SwTxtNode* pOwnChapterNode ) SwDoc* pDoc = (SwDoc*)GetFmt()->GetDoc(); for(sal_uInt16 i = 0; i < MAXLEVEL; i++) { - String sTmpStyleNames = GetStyleNames(i); + OUString sTmpStyleNames = GetStyleNames(i); sal_uInt16 nTokenCount = comphelper::string::getTokenCount(sTmpStyleNames, TOX_STYLE_DELIMITER); for( sal_uInt16 nStyle = 0; nStyle < nTokenCount; ++nStyle ) { SwTxtFmtColl* pColl = pDoc->FindTxtFmtCollByName( - sTmpStyleNames.GetToken( nStyle, + sTmpStyleNames.getToken( nStyle, TOX_STYLE_DELIMITER )); //TODO: no outline Collections in content indexes if OutlineLevels are already included if( !pColl || @@ -1519,9 +1519,9 @@ void SwTOXBaseSection::UpdateTable( const SwTxtNode* pOwnChapterNode ) /// Generate String according to the Form and remove the /// special characters 0-31 and 255. -static String lcl_GetNumString( const SwTOXSortTabBase& rBase, bool bUsePrefix, sal_uInt8 nLevel ) +static OUString lcl_GetNumString( const SwTOXSortTabBase& rBase, bool bUsePrefix, sal_uInt8 nLevel ) { - String sRet; + OUString sRet; if( !rBase.pTxtMark && !rBase.aTOXSources.empty() ) { // only if it's not a Mark @@ -1576,8 +1576,8 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, // pTOXNd is only set at the first mark SwTxtNode* pTOXNd = (SwTxtNode*)aSortArr[nArrayIdx]->pTOXNd; - String& rTxt = (String&)pTOXNd->GetTxt(); - rTxt.Erase(); + OUString rTxt = pTOXNd->GetTxt(); + rTxt = ""; for(sal_uInt16 nIndex = nArrayIdx; nIndex < nArrayIdx + nCount; nIndex++) { if(nIndex > nArrayIdx) @@ -1589,8 +1589,8 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); xub_StrLen nLinkStartPosition = STRING_NOTFOUND; - String sLinkCharacterStyle; // default to "Default" character style - which is none - String sURL; + OUString sLinkCharacterStyle; // default to "Default" character style - which is none + OUString sURL; // create an enumerator // #i21237# SwFormTokens aPattern = GetTOXForm().GetPattern(nLvl); @@ -1599,17 +1599,17 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, while(aIt != aPattern.end()) // #i21237# { SwFormToken aToken = *aIt; // #i21237# - xub_StrLen nStartCharStyle = rTxt.Len(); + xub_StrLen nStartCharStyle = rTxt.getLength(); switch( aToken.eTokenType ) { case TOKEN_ENTRY_NO: // for TOC numbering - rTxt.Insert( lcl_GetNumString( rBase, aToken.nChapterFormat == CF_NUMBER, static_cast<sal_uInt8>(aToken.nOutlineLevel - 1)) ); + rTxt += lcl_GetNumString( rBase, aToken.nChapterFormat == CF_NUMBER, static_cast<sal_uInt8>(aToken.nOutlineLevel - 1) ) ; break; case TOKEN_ENTRY_TEXT: { - SwIndex aIdx( pTOXNd, rTxt.Len() ); + SwIndex aIdx( pTOXNd, rTxt.getLength() ); rBase.FillText( *pTOXNd, aIdx ); rTxt = lcl_RemoveLineBreaks(rTxt); } @@ -1618,9 +1618,9 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, case TOKEN_ENTRY: { // for TOC numbering - rTxt.Insert( lcl_GetNumString( rBase, true, MAXLEVEL )); + rTxt += lcl_GetNumString( rBase, true, MAXLEVEL ); - SwIndex aIdx( pTOXNd, rTxt.Len() ); + SwIndex aIdx( pTOXNd, rTxt.getLength() ); rBase.FillText( *pTOXNd, aIdx ); rTxt = lcl_RemoveLineBreaks(rTxt); } @@ -1628,7 +1628,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, case TOKEN_TAB_STOP: if (aToken.bWithTab) // #i21237# - rTxt.Append('\t'); + rTxt += "\t"; if(SVX_TAB_ADJUST_END > aToken.eTabAlign) { @@ -1702,7 +1702,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, break; case TOKEN_TEXT: - rTxt.Append( aToken.sText ); + rTxt += aToken.sText; break; case TOKEN_PAGE_NUMS: @@ -1712,14 +1712,14 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, size_t nSize = rBase.aTOXSources.size(); if (nSize > 0) { - String aInsStr = OUString(cNumRepl); + OUString aInsStr = OUString(cNumRepl); for (size_t i = 1; i < nSize; ++i) { aInsStr += sPageDeli; - aInsStr += cNumRepl; + aInsStr += OUString(cNumRepl); } - aInsStr += cEndPageNum; - rTxt.Append( aInsStr ); + aInsStr += OUString(cEndPageNum); + rTxt += aInsStr; } } break; @@ -1752,12 +1752,12 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, // would handle them. if ( CF_NUM_NOPREPST_TITLE == aToken.nChapterFormat || CF_NUMBER == aToken.nChapterFormat ) - rTxt.Insert(aFld.GetNumber()); // get the string number without pre/postfix + rTxt += aFld.GetNumber(); // get the string number without pre/postfix else if ( CF_NUMBER_NOPREPST == aToken.nChapterFormat || CF_NUM_TITLE == aToken.nChapterFormat ) { rTxt += aFld.GetNumber(); - rTxt += ' '; + rTxt += " "; rTxt += aFld.GetTitle(); } else if(CF_TITLE == aToken.nChapterFormat) @@ -1768,7 +1768,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, break; case TOKEN_LINK_START: - nLinkStartPosition = rTxt.Len(); + nLinkStartPosition = rTxt.getLength(); sLinkCharacterStyle = aToken.sCharStyleName; break; @@ -1778,19 +1778,19 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, { SwIndex aIdx( pTOXNd, nLinkStartPosition ); // pTOXNd->Erase( aIdx, SwForm::nFormLinkSttLen ); - xub_StrLen nEnd = rTxt.Len(); + xub_StrLen nEnd = rTxt.getLength(); - if( !sURL.Len() ) + if( sURL.isEmpty() ) { sURL = rBase.GetURL(); - if( !sURL.Len() ) + if( sURL.isEmpty() ) break; } LinkStruct* pNewLink = new LinkStruct(sURL, nLinkStartPosition, nEnd); pNewLink->aINetFmt.SetVisitedFmt(sLinkCharacterStyle); pNewLink->aINetFmt.SetINetFmt(sLinkCharacterStyle); - if(sLinkCharacterStyle.Len()) + if(!sLinkCharacterStyle.isEmpty()) { sal_uInt16 nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( sLinkCharacterStyle, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT ); @@ -1804,14 +1804,14 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, } aLinkArr.push_back(pNewLink); nLinkStartPosition = STRING_NOTFOUND; - sLinkCharacterStyle.Erase(); + sLinkCharacterStyle = ""; } break; case TOKEN_AUTHORITY: { ToxAuthorityField eField = (ToxAuthorityField)aToken.nAuthorityField; - SwIndex aIdx( pTOXNd, rTxt.Len() ); + SwIndex aIdx( pTOXNd, rTxt.getLength() ); rBase.FillText( *pTOXNd, aIdx, static_cast<sal_uInt16>(eField) ); } break; @@ -1830,7 +1830,7 @@ void SwTOXBaseSection::GenerateText( sal_uInt16 nArrayIdx, { SwFmtCharFmt aFmt( pCharFmt ); pTOXNd->InsertItem( aFmt, nStartCharStyle, - rTxt.Len(), nsSetAttrMode::SETATTR_DONTEXPAND ); + rTxt.getLength(), nsSetAttrMode::SETATTR_DONTEXPAND ); } } @@ -1877,8 +1877,8 @@ void SwTOXBaseSection::UpdatePageNum() aSortArr[nCnt]->GetType() == TOX_SORT_INDEX) { const SwTOXMark& rMark = aSortArr[nCnt]->pTxtMark->GetTOXMark(); - const String sPrimKey = rMark.GetPrimaryKey(); - const String sSecKey = rMark.GetSecondaryKey(); + const OUString sPrimKey = rMark.GetPrimaryKey(); + const OUString sSecKey = rMark.GetSecondaryKey(); const SwTOXMark* pNextMark = 0; while(aSortArr.size() > (nCnt + nRange)&& aSortArr[nCnt + nRange]->GetType() == TOX_SORT_INDEX && @@ -1997,7 +1997,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, sal_uInt16 nOld = rNums[0], nBeg = nOld, nCount = 0; - String aNumStr( SvxNumberType( rDescs[0]->GetNumType() ). + OUString aNumStr( SvxNumberType( rDescs[0]->GetNumType() ). GetNumStr( nBeg ) ); if( xCharStyleIdx && lcl_HasMainEntry( pMainEntryNums, nBeg )) { @@ -2049,7 +2049,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, else { if(nCount >= 2 ) - aNumStr += '-'; + aNumStr += "-"; else if(nCount == 1 ) aNumStr += sPageDeli; //#58127# If nCount == 0, then the only PageNumber is already in aNumStr! @@ -2063,7 +2063,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, //the change of the character style must apply after sPageDeli is appended if (xCharStyleIdx && bMainEntryChanges) { - xCharStyleIdx->push_back(aNumStr.Len()); + xCharStyleIdx->push_back(aNumStr.getLength()); } aNumStr += aType.GetNumStr( nBeg ); nCount = 0; @@ -2088,7 +2088,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, else { if(nCount >= 2) - aNumStr +='-'; + aNumStr += "-"; else if(nCount == 1) aNumStr += sPageDeli; //#58127# If nCount == 0, then the only PageNumber is already in aNumStr! @@ -2103,7 +2103,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, if(pPageNoCharFmt) { SwFmtCharFmt aCharFmt( pPageNoCharFmt ); - pNd->InsertItem(aCharFmt, nStartPos, nStartPos + aNumStr.Len(), nsSetAttrMode::SETATTR_DONTEXPAND); + pNd->InsertItem(aCharFmt, nStartPos, nStartPos + aNumStr.getLength(), nsSetAttrMode::SETATTR_DONTEXPAND); } // The main entries should get their character style @@ -2111,7 +2111,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, { // eventually the last index must me appended if (xCharStyleIdx->size()&0x01) - xCharStyleIdx->push_back(aNumStr.Len()); + xCharStyleIdx->push_back(aNumStr.getLength()); // search by name SwDoc* pDoc = pNd->GetDoc(); @@ -2125,7 +2125,7 @@ void SwTOXBaseSection::_UpdatePageNum( SwTxtNode* pNd, pCharFmt = pDoc->MakeCharFmt(GetMainEntryCharStyle(), 0); // find the page numbers in aNumStr and set the character style - xub_StrLen nOffset = pNd->GetTxt().getLength() - aNumStr.Len(); + xub_StrLen nOffset = pNd->GetTxt().getLength() - aNumStr.getLength(); SwFmtCharFmt aCharFmt(pCharFmt); for (sal_uInt16 j = 0; j < xCharStyleIdx->size(); j += 2) { diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index d4aa1f566e95..2dc66fede04e 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -62,8 +62,8 @@ namespace TxtFmtCollFunc } if ( pNewNumRuleItem ) { - String sNumRuleName = pNewNumRuleItem->GetValue(); - if ( sNumRuleName.Len() == 0 || + OUString sNumRuleName = pNewNumRuleItem->GetValue(); + if ( sNumRuleName.isEmpty() || sNumRuleName != pTxtFmtColl->GetDoc()->GetOutlineNumRule()->GetName() ) { // delete assignment of paragraph style to list level of outline style. @@ -81,8 +81,8 @@ namespace TxtFmtCollFunc rTxtFmtColl.GetItemState( RES_PARATR_NUMRULE, sal_False, (const SfxPoolItem**)&pNumRuleItem ); if ( pNumRuleItem ) { - const String sNumRuleName = pNumRuleItem->GetValue(); - if ( sNumRuleName.Len() > 0 ) + const OUString sNumRuleName = pNumRuleItem->GetValue(); + if ( !sNumRuleName.isEmpty() ) { pNumRule = rTxtFmtColl.GetDoc()->FindNumRulePtr( sNumRuleName ); } diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx index 2c5124f9fda6..a37778aa7bd4 100644 --- a/sw/source/core/doc/list.cxx +++ b/sw/source/core/doc/list.cxx @@ -30,14 +30,14 @@ class SwListImpl { public: - SwListImpl( const String sListId, + SwListImpl( const OUString sListId, SwNumRule& rDefaultListStyle, const SwNodes& rNodes ); ~SwListImpl(); - const String GetListId() const; + const OUString GetListId() const; - const String GetDefaultListStyleName() const; + const OUString GetDefaultListStyleName() const; void InsertListItem( SwNodeNum& rNodeNum, const int nLevel ); @@ -53,9 +53,9 @@ class SwListImpl private: // unique identifier of the list - const String msListId; + const OUString msListId; // default list style for the list items, identified by the list style name - String msDefaultListStyleName; + OUString msDefaultListStyleName; // list trees for certain document ranges typedef std::pair<SwNodeNum*, SwPaM*> tListTreeForRange; @@ -67,7 +67,7 @@ class SwListImpl void NotifyItemsOnListLevel( const int nLevel ); }; -SwListImpl::SwListImpl( const String sListId, +SwListImpl::SwListImpl( const OUString sListId, SwNumRule& rDefaultListStyle, const SwNodes& rNodes ) : msListId( sListId ), @@ -110,12 +110,12 @@ SwListImpl::~SwListImpl() } } -const String SwListImpl::GetListId() const +const OUString SwListImpl::GetListId() const { return msListId; } -const String SwListImpl::GetDefaultListStyleName() const +const OUString SwListImpl::GetDefaultListStyleName() const { return msDefaultListStyleName; } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index f162a0130d2f..0f74b0aedd09 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -86,7 +86,7 @@ inline bool GetRealURL( const SwGrfNode& rNd, OUString& rTxt ) return bRet; } -static void lcl_PaintReplacement( const SwRect &rRect, const String &rText, +static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText, const ViewShell &rSh, const SwNoTxtFrm *pFrm, bool bDefect ) { diff --git a/sw/source/core/doc/poolfmt.cxx b/sw/source/core/doc/poolfmt.cxx index 398eb7ca0a1f..54a0bead3e74 100644 --- a/sw/source/core/doc/poolfmt.cxx +++ b/sw/source/core/doc/poolfmt.cxx @@ -331,7 +331,7 @@ SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) return GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); ResId aResId( nResId + nId, *pSwResMgr ); - String aNm( aResId ); + OUString aNm( aResId ); // A Set for all to-be-set Attributes SwAttrSet aSet( GetAttrPool(), aTxtFmtCollSetRange ); @@ -1114,7 +1114,7 @@ SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId ) } ResId aResId( nRCId + nId, *pSwResMgr ); - String aNm( aResId ); + OUString aNm( aResId ); SwAttrSet aSet( GetAttrPool(), pWhichRange ); { @@ -1421,7 +1421,7 @@ SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) SwPageDesc* pNewPgDsc = 0; { const ResId aResId( sal_uInt32(RC_POOLPAGEDESC_BEGIN + nId - RES_POOLPAGE_BEGIN), *pSwResMgr ); - const String aNm( aResId ); + const OUString aNm( aResId ); const bool bIsModified = IsModified(); sal_uInt16 nPageDescIdx = 0; @@ -1610,7 +1610,7 @@ SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId ) } ResId aResId( sal_uInt32(RC_POOLNUMRULE_BEGIN + nId - RES_POOLNUMRULE_BEGIN), *pSwResMgr ); - String aNm( aResId ); + OUString aNm( aResId ); SwCharFmt *pNumCFmt = 0, *pBullCFmt = 0; diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx index ef7aaf285f06..7d02cd14c984 100644 --- a/sw/source/core/doc/swserv.cxx +++ b/sw/source/core/doc/swserv.cxx @@ -47,12 +47,12 @@ sal_Bool SwServerObject::GetData( uno::Any & rData, switch( SotExchange::GetFormatIdFromMimeType( rMimeType ) ) { case FORMAT_STRING: - ::GetASCWriter( aEmptyStr, String(), xWrt ); + ::GetASCWriter( aEmptyStr, OUString(), xWrt ); break; case FORMAT_RTF: // mba: no BaseURL for data exchange - ::GetRTFWriter( aEmptyStr, String(), xWrt ); + ::GetRTFWriter( aEmptyStr, OUString(), xWrt ); break; } diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx index 9687d8bd19ac..6f27b6198065 100644 --- a/sw/source/core/doc/visiturl.cxx +++ b/sw/source/core/doc/visiturl.cxx @@ -45,14 +45,14 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) { // This URL has been changed: const INetURLObject* pIURL = ((INetURLHistoryHint&)rHint).GetObject(); - String sURL( pIURL->GetMainURL( INetURLObject::NO_DECODE ) ), sBkmk; + OUString sURL( pIURL->GetMainURL( INetURLObject::NO_DECODE ) ), sBkmk; SwEditShell* pESh = pDoc->GetEditShell(); if( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() && // If this is our Doc, we can also have local jumps! pDoc->GetDocShell()->GetMedium()->GetName().equals(sURL) ) - (sBkmk = pIURL->GetMark()).Insert( INET_MARK_TOKEN, 0 ); + sBkmk = OUString(INET_MARK_TOKEN) + pIURL->GetMark(); bool bAction = false, bUnLockView = false; sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT ); @@ -60,7 +60,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint ) { const SwFmtINetFmt* pItem = (SwFmtINetFmt*)pDoc->GetAttrPool().GetItem2(RES_TXTATR_INETFMT, n ); if( pItem != 0 && - ( pItem->GetValue() == sURL || ( sBkmk.Len() && pItem->GetValue() == sBkmk ))) + ( pItem->GetValue() == sURL || ( !sBkmk.isEmpty() && pItem->GetValue() == sBkmk ))) { const SwTxtINetFmt* pTxtAttr = pItem->GetTxtINetFmt(); if (pTxtAttr != 0) |