diff options
author | Noel Grandin <noel@peralex.com> | 2014-03-18 11:35:08 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-18 11:52:40 +0000 |
commit | 6181013d9989bb5c96e88ea1bc8d581b99c28421 (patch) | |
tree | db1d87291a081967d4341765b7db94e0a0c27579 /i18npool | |
parent | librelogo UI fixes, gradients, log10, improved random colors (diff) | |
download | core-6181013d9989bb5c96e88ea1bc8d581b99c28421.tar.gz core-6181013d9989bb5c96e88ea1bc8d581b99c28421.zip |
convert sal_Char* to OUString
I can see no reason to store sBulletName as an sal_Char* instead
of converting backwards and forwards from OUString
Change-Id: Ib16b9f04c5738aa2346c9b5b4f28461fc8b60c4f
Reviewed-on: https://gerrit.libreoffice.org/8641
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index a45bab178575..7af865c94957 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1354,7 +1354,7 @@ struct OutlineNumberingLevel_Impl sal_Int16 nNumType; //com::sun::star::style::NumberingType OUString sSuffix; sal_Unicode cBulletChar; - const sal_Char* sBulletFontName; + OUString sBulletFontName; sal_Int16 nParentNumbering; sal_Int32 nLeftMargin; sal_Int32 nSymbolTextDistance; @@ -1383,17 +1383,6 @@ public: virtual sal_Bool SAL_CALL hasElements( ) throw(RuntimeException, std::exception); }; -static sal_Char* U2C( const OUString& str ) -{ - sal_Char* s = new sal_Char[ str.getLength()+1 ]; - int i; - for( i = 0; i < str.getLength(); i++) - s[i] = sal::static_int_cast<sal_Char>( str[i] ); - s[i]='\0'; - return s; -} - - Sequence< Reference<container::XIndexAccess> > SAL_CALL LocaleDataImpl::getOutlineNumberingLevels( const lang::Locale& rLocale ) throw(RuntimeException) { @@ -1432,7 +1421,7 @@ LocaleDataImpl::getOutlineNumberingLevels( const lang::Locale& rLocale ) throw(R case 1: level[j].nNumType = sal::static_int_cast<sal_Int16>(tmp.toInt32()); break; case 2: level[j].sSuffix = tmp; break; case 3: level[j].cBulletChar = sal::static_int_cast<sal_Unicode>(tmp.toUInt32(16)); break; // base 16 - case 4: level[j].sBulletFontName = U2C( tmp ); break; + case 4: level[j].sBulletFontName = tmp; break; case 5: level[j].nParentNumbering = sal::static_int_cast<sal_Int16>(tmp.toInt32()); break; case 6: level[j].nLeftMargin = tmp.toInt32(); break; case 7: level[j].nSymbolTextDistance = tmp.toInt32(); break; @@ -1449,7 +1438,7 @@ LocaleDataImpl::getOutlineNumberingLevels( const lang::Locale& rLocale ) throw(R level[j].nNumType = 0; level[j].sSuffix = aEmptyStr; level[j].cBulletChar = 0; - level[j].sBulletFontName = 0; + level[j].sBulletFontName = aEmptyStr; level[j].nParentNumbering = 0; level[j].nLeftMargin = 0; level[j].nSymbolTextDistance = 0; @@ -1585,7 +1574,7 @@ Any OutlineNumbering::getByIndex( sal_Int32 nIndex ) pValues[3].Name = "BulletChar"; pValues[3].Value <<= OUString(&pTemp->cBulletChar, 1); pValues[4].Name = "BulletFontName"; - pValues[4].Value <<= OUString::createFromAscii(pTemp->sBulletFontName); + pValues[4].Value <<= pTemp->sBulletFontName; pValues[5].Name = "ParentNumbering"; pValues[5].Value <<= OUString::number(pTemp->nParentNumbering); pValues[6].Name = "LeftMargin"; |