[Libreoffice-commits] .: 2 commits - binfilter/bf_sfx2 binfilter/bf_svtools binfilter/bf_svx binfilter/bf_sw
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Dec 22 01:08:39 PST 2011
binfilter/bf_sfx2/source/doc/sfx2_objserv.cxx | 6 +++---
binfilter/bf_svtools/source/misc/tl_tstring.cxx | 5 ++---
binfilter/bf_svtools/source/misc1/svt_inettype.cxx | 5 ++---
binfilter/bf_svx/source/editeng/svx_editobj.cxx | 16 ++++++++--------
binfilter/bf_sw/source/core/tox/sw_tox.cxx | 2 +-
binfilter/bf_sw/source/core/unocore/sw_unofield.cxx | 8 ++++----
binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx | 8 ++++----
7 files changed, 24 insertions(+), 26 deletions(-)
New commits:
commit 9fcec545b6adb1ab76e9e0e4a25c89c9b5278ac0
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 21 23:07:01 2011 +0000
WaE: tweak body-less for loop
diff --git a/binfilter/bf_sfx2/source/doc/sfx2_objserv.cxx b/binfilter/bf_sfx2/source/doc/sfx2_objserv.cxx
index 982f4ad..fd03b51 100644
--- a/binfilter/bf_sfx2/source/doc/sfx2_objserv.cxx
+++ b/binfilter/bf_sfx2/source/doc/sfx2_objserv.cxx
@@ -122,11 +122,11 @@ AsynchronLink* pPendingCloser = 0;
/*N*/ if( !aFilterName.Len() )
/*N*/ {
/*N*/ sal_uInt16 nActFilt = 0;
-/*N*/ const SfxFilter* pFilt = GetFactory().GetFilter( 0 ); for( ;
-/*N*/ pFilt && ( !pFilt->CanExport()
+/*N*/ const SfxFilter* pFilt = GetFactory().GetFilter( 0 );
+/*N*/ for( ; pFilt && ( !pFilt->CanExport()
/*N*/ || (!bSaveTo && !pFilt->CanImport()) // SaveAs case
/*N*/ || pFilt->IsInternal() );
-/*N*/ pFilt = GetFactory().GetFilter( ++nActFilt ) );
+/*N*/ pFilt = GetFactory().GetFilter( ++nActFilt ) ) ;
/*N*/
/*N*/ DBG_ASSERT( pFilt, "No default filter!\n" );
/*N*/
commit e52eb303ba507e92d07a8c26f8b5d0a81f25f446
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Dec 21 22:52:57 2011 +0000
reduce ByteString
diff --git a/binfilter/bf_svtools/source/misc/tl_tstring.cxx b/binfilter/bf_svtools/source/misc/tl_tstring.cxx
index b30bd1e..c05e505 100644
--- a/binfilter/bf_svtools/source/misc/tl_tstring.cxx
+++ b/binfilter/bf_svtools/source/misc/tl_tstring.cxx
@@ -35,9 +35,8 @@ namespace binfilter
{
sal_Char aBuf[RTL_STR_MAX_VALUEOFINT32];
BOOST_STATIC_ASSERT(RTL_STR_MAX_VALUEOFINT32 <= STRING_MAXLEN);
- return ByteString(
- aBuf,
- static_cast< xub_StrLen >(rtl_str_valueOfInt32( aBuf, n, nRadix )) );
+ return rtl::OString(
+ aBuf, rtl_str_valueOfInt32( aBuf, n, nRadix ) );
}
sal_Unicode ConvertToUnicode( const char* pChar, sal_Size* pLen, rtl_TextEncoding eTextEncoding )
diff --git a/binfilter/bf_svtools/source/misc1/svt_inettype.cxx b/binfilter/bf_svtools/source/misc1/svt_inettype.cxx
index ec5e5ea..a4419af 100644
--- a/binfilter/bf_svtools/source/misc1/svt_inettype.cxx
+++ b/binfilter/bf_svtools/source/misc1/svt_inettype.cxx
@@ -786,7 +786,7 @@ bool INetContentTypes::parse(ByteString const & rMediaType,
}
if (p == pToken)
return false;
- rType = ByteString(pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
+ rType = rtl::OString(pToken, (p - pToken));
if (bDowncase)
rType.ToLowerAscii();
@@ -804,8 +804,7 @@ bool INetContentTypes::parse(ByteString const & rMediaType,
}
if (p == pToken)
return false;
- rSubType = ByteString(
- pToken, sal::static_int_cast< xub_StrLen >(p - pToken));
+ rSubType = rtl::OString(pToken, (p - pToken));
if (bDowncase)
rSubType.ToLowerAscii();
diff --git a/binfilter/bf_svx/source/editeng/svx_editobj.cxx b/binfilter/bf_svx/source/editeng/svx_editobj.cxx
index f9dde52..55ac6dc 100644
--- a/binfilter/bf_svx/source/editeng/svx_editobj.cxx
+++ b/binfilter/bf_svx/source/editeng/svx_editobj.cxx
@@ -541,8 +541,8 @@ void BinTextObject::CreateData( SvStream& rIStream )
ContentInfo* pC = CreateAndInsertContent();
// Der Text...
- ByteString aByteString = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStream);
- pC->GetText() = String( aByteString, eSrcEncoding );
+ rtl::OString aByteString = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rIStream);
+ pC->GetText() = rtl::OStringToOUString(aByteString, eSrcEncoding);
// StyleName und Family...
rIStream.ReadUniOrByteString( pC->GetStyle(), eSrcEncoding );
@@ -575,7 +575,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
{
if ( pItem->Which() == EE_FEATURE_NOTCONV )
{
- pC->GetText().SetChar( nStart, ByteString_ConvertToUnicode( aByteString.GetChar( nStart ), ((SvxCharSetColorItem*)pItem)->GetCharSet() ) );
+ pC->GetText().SetChar( nStart, ByteString_ConvertToUnicode( aByteString[nStart], ((SvxCharSetColorItem*)pItem)->GetCharSet() ) );
}
else
{
@@ -585,8 +585,8 @@ void BinTextObject::CreateData( SvStream& rIStream )
if ( ( nLclWhich >= EE_FEATURE_START ) && ( nLclWhich <= EE_FEATURE_END ) )
{
// Convert CH_FEATURE to CH_FEATURE_OLD
- DBG_ASSERT( (BYTE) aByteString.GetChar( nStart ) == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" );
- if ( (BYTE) aByteString.GetChar( nStart ) == CH_FEATURE_OLD )
+ DBG_ASSERT( (BYTE) aByteString[nStart] == CH_FEATURE_OLD, "CreateData: CH_FEATURE expected!" );
+ if ( (BYTE) aByteString[nStart] == CH_FEATURE_OLD )
pC->GetText().SetChar( nStart, CH_FEATURE );
}
}
@@ -613,7 +613,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
const SvxFontItem& rFontItem = (const SvxFontItem&)pC->GetParaAttribs().Get( EE_CHAR_FONTINFO );
if ( rFontItem.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
{
- pC->GetText() = String( aByteString, RTL_TEXTENCODING_SYMBOL );
+ pC->GetText() = rtl::OStringToOUString(aByteString, RTL_TEXTENCODING_SYMBOL);
bSymbolPara = TRUE;
}
}
@@ -628,8 +628,8 @@ void BinTextObject::CreateData( SvStream& rIStream )
|| ( bSymbolPara && ( rFontItem.GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
{
// Not correctly converted
- ByteString aPart( aByteString, pAttr->GetStart(), pAttr->GetEnd()-pAttr->GetStart() );
- String aNew( aPart, rFontItem.GetCharSet() );
+ rtl::OString aPart(aByteString.copy(pAttr->GetStart(), pAttr->GetEnd()-pAttr->GetStart()));
+ rtl::OUString aNew(rtl::OStringToOUString(aPart, rFontItem.GetCharSet()));
pC->GetText().Erase( pAttr->GetStart(), pAttr->GetEnd()-pAttr->GetStart() );
pC->GetText().Insert( aNew, pAttr->GetStart() );
}
diff --git a/binfilter/bf_sw/source/core/tox/sw_tox.cxx b/binfilter/bf_sw/source/core/tox/sw_tox.cxx
index 786c2ab..44d8b07 100644
--- a/binfilter/bf_sw/source/core/tox/sw_tox.cxx
+++ b/binfilter/bf_sw/source/core/tox/sw_tox.cxx
@@ -300,7 +300,7 @@ String lcl_GetAuthPattern(USHORT nTypeId)
/*N*/ if( TOX_AUTHORITIES != nType)
/*N*/ {
/*N*/ sBStr += SwForm::aFormTab;
-/*N*/ ByteString sTmp( RTL_CONSTASCII_STRINGPARAM( " ,65535,0," ));
+/*N*/ ByteString sTmp(rtl::OString(RTL_CONSTASCII_STRINGPARAM(" ,65535,0,")));
/*N*/ if(TOX_CONTENT == nType)
/*N*/ {
/*N*/ //the most right tab stop is "most_right_aligned"
diff --git a/binfilter/bf_sw/source/core/unocore/sw_unofield.cxx b/binfilter/bf_sw/source/core/unocore/sw_unofield.cxx
index fa52854..f595f52 100644
--- a/binfilter/bf_sw/source/core/unocore/sw_unofield.cxx
+++ b/binfilter/bf_sw/source/core/unocore/sw_unofield.cxx
@@ -73,6 +73,7 @@
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
#include <com/sun/star/beans/PropertyChangeEvent.hpp>
+#include <rtl/strbuf.hxx>
//undef to prevent error (from bf_sfx2/docfile.cxx)
#undef SEQUENCE
#include <com/sun/star/text/SetVariableType.hpp>
@@ -464,10 +465,9 @@ BOOL SwXFieldMaster::supportsService(const OUString& rServiceName) throw( Runtim
}
if( pEntry )
{
- ByteString aTmp( RTL_CONSTASCII_STRINGPARAM(
- "com.sun.star.text.fieldmaster."));
- aTmp.Append( pEntry );
- bRet = rServiceName.equalsAsciiL(aTmp.GetBuffer(), aTmp.Len());
+ rtl::OString aTmp(rtl::OStringBuffer(RTL_CONSTASCII_STRINGPARAM(
+ "com.sun.star.text.fieldmaster.")).append(pEntry).makeStringAndClear());
+ bRet = rServiceName.equalsAsciiL(aTmp.getStr(), aTmp.getLength());
}
}
return bRet;
diff --git a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
index d1c867f..53d7079 100644
--- a/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
+++ b/binfilter/bf_sw/source/filter/sw6/sw_sw6par.cxx
@@ -3482,18 +3482,18 @@ size_t Sw6Layout::PutRest(String &rStr,sal_Char *pCtrl)
else
if (TextBefehl("INDEX",&pCtrl[1]))
{
- ByteString aString(&pCtrl[8],(BYTE)pCtrl[1]-6);
+ ByteString aString(rtl::OString(&pCtrl[8],(BYTE)pCtrl[1]-6));
AddXForm('X',aString,rStr);
}
else
if (TextBefehl("INHALT",&pCtrl[1]))
{
- ByteString aString(&pCtrl[9],(BYTE)pCtrl[1]-7);
+ ByteString aString(rtl::OString(&pCtrl[9],(BYTE)pCtrl[1]-7));
AddXForm('V',aString,rStr);
}
else
{
- ByteString aTmp( &pCtrl[2], pCtrl[1] );
+ ByteString aTmp(rtl::OString(&pCtrl[2], pCtrl[1]));
aTmp = rtl::OUStringToOString(
rtl::OStringToOUString(aTmp, RTL_TEXTENCODING_IBM_850),
osl_getThreadTextEncoding());
@@ -3566,7 +3566,7 @@ size_t Sw6Layout::PutRest(String &rStr,sal_Char *pCtrl)
else if ( (*pCtrl>='A' && *pCtrl<='Z') ||
(*pCtrl>='a' && *pCtrl<='z') )
{
- ByteString aFld(pCtrl,p-pCtrl);
+ ByteString aFld(rtl::OString(pCtrl,p-pCtrl));
aFld = rtl::OUStringToOString(
rtl::OStringToOUString(aFld,
RTL_TEXTENCODING_IBM_850),
More information about the Libreoffice-commits
mailing list