diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-27 22:58:50 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-11-27 23:00:06 -0600 |
commit | c617be8307033394bde4255c05b72dbd01ae0056 (patch) | |
tree | bda35b72f8b61d71f22517a197517ec3bbffa0b0 | |
parent | ae0fa7cc62e1f57d22e68b2ef45086aeb1dfe41c (diff) |
remove legacy String svl's Put*Entry family of function and convert users
Change-Id: Iebf4017ce4c2c48389716eac1bbf7f386ac7a296
-rw-r--r-- | sc/source/filter/excel/xestyle.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/excel/xistyle.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/lotus/tool.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/bastyp/sfxhtml.cxx | 9 | ||||
-rw-r--r-- | svl/inc/svl/zforlist.hxx | 11 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 48 | ||||
-rw-r--r-- | svtools/source/control/fmtfield.cxx | 4 | ||||
-rw-r--r-- | svx/source/items/numfmtsh.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/fields/fldbas.cxx | 20 | ||||
-rw-r--r-- | sw/source/filter/ww8/writerwordglue.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/dbui/dbinsdlg.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/shells/tabsh.cxx | 4 |
15 files changed, 51 insertions, 105 deletions
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx index 655594ca8cfc..5b3354aeb307 100644 --- a/sc/source/filter/excel/xestyle.cxx +++ b/sc/source/filter/excel/xestyle.cxx @@ -1340,10 +1340,10 @@ String GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberF LanguageType eLang = pEntry->GetLanguage(); if( eLang != LANGUAGE_ENGLISH_US ) { - xub_StrLen nCheckPos; + sal_Int32 nCheckPos; short nType = NUMBERFORMAT_DEFINED; sal_uInt32 nKey; - String aTemp( pEntry->GetFormatstring() ); + OUString aTemp( pEntry->GetFormatstring() ); xFormatter->PutandConvertEntry( aTemp, nCheckPos, nType, nKey, eLang, LANGUAGE_ENGLISH_US ); OSL_ENSURE( nCheckPos == 0, "XclExpNumFmtBuffer::WriteFormatRecord - format code not convertible" ); pEntry = xFormatter->GetEntry( nKey ); diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 760cf4ad878b..dd24da424aee 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -659,14 +659,14 @@ void XclImpNumFmtBuffer::CreateScFormats() const XclNumFmt& rNumFmt = aIt->second; // insert/convert the Excel number format - xub_StrLen nCheckPos; + sal_Int32 nCheckPos; short nType = NUMBERFORMAT_DEFINED; sal_uInt32 nKey; if( rNumFmt.maFormat.Len() ) { - String aFormat( rNumFmt.maFormat ); + OUString aFormat( rNumFmt.maFormat ); rFormatter.PutandConvertEntry( aFormat, nCheckPos, - nType, nKey, LANGUAGE_ENGLISH_US, rNumFmt.meLanguage ); + nType, nKey, LANGUAGE_ENGLISH_US, rNumFmt.meLanguage ); } else nKey = rFormatter.GetFormatIndex( rNumFmt.meOffset, rNumFmt.meLanguage ); diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx index b1b3b2da5b89..96f4e605e4a9 100644 --- a/sc/source/filter/lotus/tool.cxx +++ b/sc/source/filter/lotus/tool.cxx @@ -203,7 +203,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) // neues Format erzeugen sal_uInt8 nL, nH; // Low-/High-Nibble sal_uInt8 nForm = nFormat; - String aFormString; + OUString aFormString; sal_Int16 eType = NUMBERFORMAT_ALL; sal_uInt32 nIndex1; sal_uInt32 nHandle; @@ -373,7 +373,7 @@ SfxUInt32Item* FormCache::NewAttr( sal_uInt8 nFormat, sal_uInt8 nSt ) nHandle = pFormTable->GetFormatIndex( eIndexTableOffset, eLanguage); else { - xub_StrLen nDummy; + sal_Int32 nDummy; pFormTable->PutEntry( aFormString, nDummy, eType, nHandle, eLanguage ); } diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index f93c2554163a..efbeeb356e72 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -282,13 +282,13 @@ static void lcl_setScalesToColumns(ScDocument& rDoc, const vector<long>& rScales pOldEntry->GetFormatSpecialInfo(bThousand, bNegRed, nPrecision, nLeading); nPrecision = static_cast<sal_uInt16>(rScales[i]); - String aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLang, - bThousand, bNegRed, nPrecision, nLeading); + OUString aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLang, + bThousand, bNegRed, nPrecision, nLeading); sal_uInt32 nNewFormat = pFormatter->GetEntryKey(aNewPicture, eLang); if (nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND) { - xub_StrLen nErrPos = 0; + sal_Int32 nErrPos = 0; short nNewType = 0; bool bOk = pFormatter->PutEntry( aNewPicture, nErrPos, nNewType, nNewFormat, eLang); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index f695475ac17e..cd3e2f539608 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2614,8 +2614,8 @@ void ScViewFunc::SetNumFmtByStr( const String& rCode ) { // enter new - String aFormat = rCode; // will be changed - xub_StrLen nErrPos = 0; + OUString aFormat = rCode; // will be changed + sal_Int32 nErrPos = 0; short nType = 0; //! ??? bOk = pFormatter->PutEntry( aFormat, nErrPos, nType, nNumberFormat, eLanguage ); } @@ -2724,13 +2724,14 @@ void ScViewFunc::ChangeNumFmtDecimals( sal_Bool bIncrement ) if (!bError) { - String aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLanguage, - bThousand, bNegRed, nPrecision, nLeading); + OUString aNewPicture = pFormatter->GenerateFormat(nOldFormat, eLanguage, + bThousand, bNegRed, + nPrecision, nLeading); nNewFormat = pFormatter->GetEntryKey( aNewPicture, eLanguage ); if ( nNewFormat == NUMBERFORMAT_ENTRY_NOT_FOUND ) { - xub_StrLen nErrPos = 0; + sal_Int32 nErrPos = 0; short nNewType = 0; sal_Bool bOk = pFormatter->PutEntry( aNewPicture, nErrPos, nNewType, nNewFormat, eLanguage ); diff --git a/sfx2/source/bastyp/sfxhtml.cxx b/sfx2/source/bastyp/sfxhtml.cxx index 8bc4946ca118..66be8a6cf101 100644 --- a/sfx2/source/bastyp/sfxhtml.cxx +++ b/sfx2/source/bastyp/sfxhtml.cxx @@ -335,8 +335,7 @@ double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm, SvNumberFormatter& rFormatter ) { LanguageType eParseLang = (LanguageType )aNumStr.ToInt32(); - sal_uInt32 nParseForm = - rFormatter.GetFormatForLanguageIfBuiltIn( 0, eParseLang ); + sal_uInt32 nParseForm = rFormatter.GetFormatForLanguageIfBuiltIn( 0, eParseLang ); double fVal; rFormatter.IsNumberFormat( aValStr, nParseForm, fVal ); if ( comphelper::string::getTokenCount(aNumStr, ';') > 2 ) @@ -344,14 +343,14 @@ double SfxHTMLParser::GetTableDataOptionsValNum( sal_uInt32& nNumForm, eNumLang = (LanguageType)aNumStr.GetToken( 1, ';' ).ToInt32(); xub_StrLen nPos = aNumStr.Search( ';' ); nPos = aNumStr.Search( ';', nPos + 1 ); - String aFormat( aNumStr.Copy( nPos + 1 ) ); - xub_StrLen nCheckPos; + OUString aFormat( aNumStr.Copy( nPos + 1 ) ); + sal_Int32 nCheckPos; short nType; if ( eNumLang != LANGUAGE_SYSTEM ) rFormatter.PutEntry( aFormat, nCheckPos, nType, nNumForm, eNumLang ); else rFormatter.PutandConvertEntry( aFormat, nCheckPos, nType, nNumForm, - eParseLang, eNumLang ); + eParseLang, eNumLang ); } else { diff --git a/svl/inc/svl/zforlist.hxx b/svl/inc/svl/zforlist.hxx index 2b2d2586cbdd..b20d89c5b496 100644 --- a/svl/inc/svl/zforlist.hxx +++ b/svl/inc/svl/zforlist.hxx @@ -389,19 +389,12 @@ public: nType contains the type of the format. nKey contains the index key of the format. */ - bool PutEntry( String& rString, xub_StrLen& nCheckPos, short& nType, sal_uInt32& nKey, - LanguageType eLnge = LANGUAGE_DONTKNOW ); - bool PutEntry( OUString& rString, sal_Int32& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge = LANGUAGE_DONTKNOW ); /** Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge */ - bool PutandConvertEntry( String& rString, xub_StrLen& nCheckPos, - short& nType, sal_uInt32& nKey, - LanguageType eLnge, LanguageType eNewLnge ); - bool PutandConvertEntry( OUString& rString, sal_Int32& nCheckPos, short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); @@ -414,10 +407,6 @@ public: short& nType, sal_uInt32& nKey, LanguageType eLnge, LanguageType eNewLnge ); - bool PutandConvertEntrySystem( String& rString, xub_StrLen& nCheckPos, - short& nType, sal_uInt32& nKey, - LanguageType eLnge, LanguageType eNewLnge ); - /** Similar to <method>PutEntry</method> and <method>PutandConvertEntry</method> or <method>PutandConvertEntrySystem</method>, the format code string diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 8592ebab702e..0440835e9214 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -562,36 +562,6 @@ bool SvNumberFormatter::PutEntry(OUString& rString, return bCheck; } -bool SvNumberFormatter::PutEntry(String& rString, xub_StrLen& nCheckPos, - short& nType, sal_uInt32& nKey, - LanguageType eLnge) -{ - // Wrapper to allow String to be used. - OUString aStr(rString); - sal_Int32 nPos = (nCheckPos == (xub_StrLen)0xFFFF) ? -1 : (sal_Int32)nCheckPos; - bool bRet = PutEntry(aStr, nPos, nType, nKey, eLnge); - rString = aStr; - nCheckPos = nPos < 0 ? (xub_StrLen)0xFFFF : (xub_StrLen)nPos; - return bRet; -} - -bool SvNumberFormatter::PutandConvertEntry(String& rString, - xub_StrLen& nCheckPos, - short& nType, - sal_uInt32& nKey, - LanguageType eLnge, - LanguageType eNewLnge) -{ - bool bRes; - if (eNewLnge == LANGUAGE_DONTKNOW) - eNewLnge = IniLnge; - - pFormatScanner->SetConvertMode(eLnge, eNewLnge); - bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge); - pFormatScanner->SetConvertMode(false); - return bRes; -} - bool SvNumberFormatter::PutandConvertEntry(OUString& rString, sal_Int32& nCheckPos, short& nType, @@ -628,24 +598,6 @@ bool SvNumberFormatter::PutandConvertEntrySystem(OUString& rString, return bRes; } -bool SvNumberFormatter::PutandConvertEntrySystem(String& rString, - xub_StrLen& nCheckPos, - short& nType, - sal_uInt32& nKey, - LanguageType eLnge, - LanguageType eNewLnge) -{ - bool bRes; - if (eNewLnge == LANGUAGE_DONTKNOW) - { - eNewLnge = IniLnge; - } - pFormatScanner->SetConvertMode(eLnge, eNewLnge, true); - bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge); - pFormatScanner->SetConvertMode(false); - return bRes; -} - sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( String & rString, LanguageType eLnge, LanguageType eSysLnge, short & rType, bool & rNewInserted, xub_StrLen & rCheckPos ) diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index 375a3f6edc46..181bc7166dc6 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -667,9 +667,9 @@ sal_Bool FormattedField::SetFormat(const OUString& rFormatString, LanguageType e sal_uInt32 nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang); if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND) { - sal_uInt16 nCheckPos; + sal_Int32 nCheckPos; short nType; - XubString rFormat(rFormatString); + OUString rFormat(rFormatString); if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey, eLang)) return sal_False; DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !"); diff --git a/svx/source/items/numfmtsh.cxx b/svx/source/items/numfmtsh.cxx index 9ba7e2a75d64..7e72d3356767 100644 --- a/svx/source/items/numfmtsh.cxx +++ b/svx/source/items/numfmtsh.cxx @@ -252,9 +252,14 @@ bool SvxNumberFormatShell::AddFormat( String& rFormat, xub_StrLen& rErrPos, } else // neues Format { - bInserted = pFormatter->PutEntry( rFormat, rErrPos, + OUString sTemp(rFormat); + sal_Int32 nPos; + bInserted = pFormatter->PutEntry( sTemp, nPos, nCurCategory, nAddKey, eCurLanguage ); + rErrPos = (nPos >= 0) ? (xub_StrLen)nPos : 0xFFFF; + rFormat = sTemp; + if (bInserted) { // May be sorted under a different locale if LCID was parsed. diff --git a/sw/source/core/fields/fldbas.cxx b/sw/source/core/fields/fldbas.cxx index b8cafaa6447d..d542331c60a3 100644 --- a/sw/source/core/fields/fldbas.cxx +++ b/sw/source/core/fields/fldbas.cxx @@ -474,7 +474,7 @@ String SwValueFieldType::ExpandValue( const double& rVal, if (rVal >= DBL_MAX) // FehlerString fuer Calculator return ViewShell::GetShellRes()->aCalc_Error; - String sExpand; + OUString sExpand; SvNumberFormatter* pFormatter = pDoc->GetNumberFormatter(); Color* pCol = 0; @@ -484,7 +484,7 @@ String SwValueFieldType::ExpandValue( const double& rVal, if( nFmt < SV_COUNTRY_LANGUAGE_OFFSET && LANGUAGE_SYSTEM != nFmtLng ) { short nType = NUMBERFORMAT_DEFINED; - xub_StrLen nDummy; + sal_Int32 nDummy; const SvNumberformat* pEntry = pFormatter->GetEntry(nFmt); @@ -496,7 +496,7 @@ String SwValueFieldType::ExpandValue( const double& rVal, if (nNewFormat == nFmt) { // Warscheinlich benutzerdefiniertes Format - String sFmt(pEntry->GetFormatstring()); + OUString sFmt(pEntry->GetFormatstring()); pFormatter->PutandConvertEntry(sFmt, nDummy, nType, nFmt, pEntry->GetLanguage(), nFmtLng ); @@ -512,9 +512,7 @@ String SwValueFieldType::ExpandValue( const double& rVal, String sValue; DoubleToString(sValue, rVal, nFmtLng); OUString sTempIn(sValue); - OUString sTempOut(sExpand); - pFormatter->GetOutputString(sTempIn, nFmt, sTempOut, &pCol); - sExpand = sTempOut; + pFormatter->GetOutputString(sTempIn, nFmt, sExpand, &pCol); } else { @@ -608,13 +606,13 @@ sal_uInt32 SwValueField::GetSystemFormat(SvNumberFormatter* pFormatter, sal_uInt { // Warscheinlich benutzerdefiniertes Format short nType = NUMBERFORMAT_DEFINED; - xub_StrLen nDummy; + sal_Int32 nDummy; - String sFmt(pEntry->GetFormatstring()); + OUString sFmt(pEntry->GetFormatstring()); sal_uInt32 nFormat = nFmt; pFormatter->PutandConvertEntry(sFmt, nDummy, nType, - nFormat, pEntry->GetLanguage(), nLng); + nFormat, pEntry->GetLanguage(), nLng); nFmt = nFormat; } else @@ -654,8 +652,8 @@ void SwValueField::SetLanguage( sal_uInt16 nLng ) { // Warscheinlich benutzerdefiniertes Format short nType = NUMBERFORMAT_DEFINED; - xub_StrLen nDummy; - String sFmt( pEntry->GetFormatstring() ); + sal_Int32 nDummy; + OUString sFmt( pEntry->GetFormatstring() ); pFormatter->PutandConvertEntry( sFmt, nDummy, nType, nNewFormat, pEntry->GetLanguage(), diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index a515b2c44503..2e08a761ba68 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -734,7 +734,7 @@ namespace sw sal_uInt16 nDocLang) { // tell the Formatter about the new entry - sal_uInt16 nCheckPos = 0; + sal_Int32 nCheckPos = 0; short nType = NUMBERFORMAT_DEFINED; sal_uInt32 nKey = 0; @@ -949,7 +949,9 @@ namespace sw if (bHijri) rParams.Insert(rtl::OUString("[~hijri]"), 0); - pFormatter->PutEntry(rParams, nCheckPos, nType, nKey, rLang); + OUString sTemp(rParams); + pFormatter->PutEntry(sTemp, nCheckPos, nType, nKey, rLang); + rParams = sTemp; return nKey; } diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 037c4bed7c8f..1075590ab09a 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -633,12 +633,14 @@ short SwWW8ImplReader::GetTimeDatePara(String& rStr, sal_uInt32& rFormat, if (bHijri) sParams.Insert(rtl::OUString("[~hijri]"), 0); - sal_uInt16 nCheckPos = 0; - sal_Int16 nType = NUMBERFORMAT_DEFINED; + sal_Int32 nCheckPos = 0; + short nType = NUMBERFORMAT_DEFINED; rFormat = 0; - pFormatter->PutandConvertEntry(sParams, nCheckPos, nType, rFormat, - LANGUAGE_ENGLISH_US, rLang); + OUString sTemp(sParams); + pFormatter->PutandConvertEntry(sTemp, nCheckPos, nType, rFormat, + LANGUAGE_ENGLISH_US, rLang); + sParams = sTemp; return bHasTime ? NUMBERFORMAT_DATETIME : NUMBERFORMAT_DATE; } diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 076a8dd9421d..1198fb780297 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1850,12 +1850,10 @@ void SwInsertDBColAutoPilot::Load() rGet.eUsrNumFmtLng ); if( NUMBERFORMAT_ENTRY_NOT_FOUND == rSet.nUsrNumFmt ) { - xub_StrLen nCheckPos; + sal_Int32 nCheckPos; short nType; - String sTmpFmt = rGet.sUsrNumFmt; - rNFmtr.PutEntry( sTmpFmt, nCheckPos, nType, + rNFmtr.PutEntry( rGet.sUsrNumFmt, nCheckPos, nType, rSet.nUsrNumFmt, rGet.eUsrNumFmtLng ); - rGet.sUsrNumFmt = sTmpFmt; } } break; diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx index 56c788f575c4..defbad8eb502 100644 --- a/sw/source/ui/shells/tabsh.cxx +++ b/sw/source/ui/shells/tabsh.cxx @@ -1443,12 +1443,12 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq) if( pItem ) { // Index fuer String bestimmen - String aCode( ((const SfxStringItem*)pItem)->GetValue() ); + OUString aCode( ((const SfxStringItem*)pItem)->GetValue() ); nNumberFormat = pFormatter->GetEntryKey( aCode, eLang ); if( NUMBERFORMAT_ENTRY_NOT_FOUND == nNumberFormat ) { // neu eintragen - xub_StrLen nErrPos; + sal_Int32 nErrPos; short nType; if( !pFormatter->PutEntry( aCode, nErrPos, nType, nNumberFormat, eLang )) |