[Libreoffice-commits] .: 3 commits - basic/source cairo/cairo cairo/cairo.dlsym.lcdfilter.patch cppu/source dbaccess/source editeng/source idl/source sc/source sfx2/source svl/source svtools/source svx/source sw/source tools/inc tools/source vcl/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Jan 6 01:53:14 PST 2012
basic/source/basmgr/basmgr.cxx | 15 ++-----
basic/source/classes/image.cxx | 11 ++---
basic/source/classes/sbxmod.cxx | 4 --
basic/source/runtime/methods1.cxx | 3 -
cairo/cairo.dlsym.lcdfilter.patch | 56 ++++++++++++++++++++++++++++
cairo/cairo/makefile.mk | 4 +-
cppu/source/typelib/typelib.cxx | 2 -
dbaccess/source/ui/tabledesign/TableRow.cxx | 9 ++--
editeng/source/editeng/editobj.cxx | 6 +--
editeng/source/items/bulitem.cxx | 7 +--
editeng/source/items/flditem.cxx | 2 -
editeng/source/items/frmitems.cxx | 5 +-
editeng/source/items/textitem.cxx | 8 ++--
idl/source/objects/module.cxx | 2 -
sc/source/core/data/patattr.cxx | 2 -
sc/source/core/tool/autoform.cxx | 4 +-
sc/source/core/tool/ddelink.cxx | 6 +--
sc/source/core/tool/zforauto.cxx | 2 -
sfx2/source/appl/appmisc.cxx | 5 +-
svl/source/items/poolitem.cxx | 5 +-
svl/source/numbers/zformat.cxx | 2 -
svtools/source/misc/templatefoldercache.cxx | 6 +--
svtools/source/misc/transfer.cxx | 4 +-
svx/source/items/hlnkitem.cxx | 16 ++++----
svx/source/items/pageitem.cxx | 3 -
sw/source/core/doc/tblafmt.cxx | 8 ++--
sw/source/ui/config/uinums.cxx | 14 +++----
tools/inc/tools/stream.hxx | 2 -
tools/source/stream/stream.cxx | 21 +++++-----
vcl/source/gdi/font.cxx | 4 +-
vcl/source/gdi/metaact.cxx | 8 ++--
31 files changed, 143 insertions(+), 103 deletions(-)
New commits:
commit 79f5f4c97188e8584aceb6af98473c06f40f7500
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 6 09:37:16 2012 +0000
Resolves: fdo#44219 RHEL-4 buildbox doesn't have FT_Library_SetLcdFilter
diff --git a/cairo/cairo.dlsym.lcdfilter.patch b/cairo/cairo.dlsym.lcdfilter.patch
new file mode 100644
index 0000000..46f7ac7
--- /dev/null
+++ b/cairo/cairo.dlsym.lcdfilter.patch
@@ -0,0 +1,56 @@
+--- misc/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:09:21.500373823 +0000
++++ misc/build/cairo-1.10.2/src/cairo-ft-font.c 2012-01-06 09:31:01.645238786 +0000
+@@ -59,6 +59,8 @@
+
+ #if HAVE_FT_LIBRARY_SETLCDFILTER
+ #include FT_LCD_FILTER_H
++#elif HAVE_DLFCN_H
++#include <dlfcn.h>
+ #endif
+
+ /* Fontconfig version older than 2.6 didn't have these options */
+@@ -1217,6 +1219,26 @@
+ return CAIRO_STATUS_SUCCESS;
+ }
+
++static void try_FT_Library_SetLcdFilter( FT_Library library,
++ int lcd_filter )
++{
++#if HAVE_FT_LIBRARY_SETLCDFILTER
++ FT_Library_SetLcdFilter (library, lcd_filter);
++#elif HAVE_DLFCN_H
++ static void (*pFT_Library_SetLcdFilter) (FT_Library, int);
++ static int dlsymed = 0;
++
++ if (!dlsymed)
++ {
++ pFT_Library_SetLcdFilter = dlsym(RTLD_DEFAULT, "FT_Library_SetLcdFilter");
++ dlsymed = 1;
++ }
++
++ if (pFT_Library_SetLcdFilter)
++ (*pFT_Library_SetLcdFilter) (library, lcd_filter);
++#endif
++}
++
+ /* Converts an outline FT_GlyphSlot into an image
+ *
+ * This could go through _render_glyph_bitmap as well, letting
+@@ -1350,15 +1372,11 @@
+ break;
+ }
+
+-#if HAVE_FT_LIBRARY_SETLCDFILTER
+- FT_Library_SetLcdFilter (library, lcd_filter);
+-#endif
++ try_FT_Library_SetLcdFilter(library, lcd_filter);
+
+ fterror = FT_Render_Glyph (face->glyph, render_mode);
+
+-#if HAVE_FT_LIBRARY_SETLCDFILTER
+- FT_Library_SetLcdFilter (library, FT_LCD_FILTER_NONE);
+-#endif
++ try_FT_Library_SetLcdFilter(library, FT_LCD_FILTER_NONE);
+
+ if (fterror != 0)
+ return _cairo_error (CAIRO_STATUS_NO_MEMORY);
diff --git a/cairo/cairo/makefile.mk b/cairo/cairo/makefile.mk
index 7f84e3d..1c06c74 100644
--- a/cairo/cairo/makefile.mk
+++ b/cairo/cairo/makefile.mk
@@ -47,7 +47,9 @@ CAIROVERSION=1.10.2
TARFILE_NAME=$(PRJNAME)-$(CAIROVERSION)
TARFILE_MD5=f101a9e88b783337b20b2e26dfd26d5f
-PATCH_FILES=..$/$(TARFILE_NAME).patch
+PATCH_FILES=\
+ ..$/cairo-1.10.2.patch \
+ ..$/cairo.dlsym.lcdfilter.patch
.IF "$(OS)$(COM)" == "WNTMSC"
PATCH_FILES+= ..$/$(TARFILE_NAME).wntmsc.patch
commit 504e01e52e38583c6bcbd620973b314596633cdb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 6 08:59:45 2012 +0000
typo in OSL_DEBUG_LEVEL > 1 code
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index a0ed525..169d29d 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -737,7 +737,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
osl_incrementInterlockedCount(
- &Init::get()->InterfaceMethodTypeDescriptionCount );
+ &Init::get()->nInterfaceMethodTypeDescriptionCount );
#endif
pTmp->aBase.pMemberName = 0;
pTmp->pReturnTypeRef = 0;
commit 2d3203b2db5b44592e70e52c9927324b65a45e06
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 6 08:50:03 2012 +0000
make ReadUniOrByteString return a string
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index f452adc..3e5a0dd 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -643,18 +643,15 @@ BasicLibInfo* BasicLibInfo::Create( SotStorageStream& rSStream )
pInfo->bDoLoad = bDoLoad;
// The name of the lib...
- String aName;
- rSStream.ReadUniOrByteString(aName, rSStream.GetStreamCharSet());
+ String aName = rSStream.ReadUniOrByteString(rSStream.GetStreamCharSet());
pInfo->SetLibName( aName );
// Absolute path...
- String aStorageName;
- rSStream.ReadUniOrByteString(aStorageName, rSStream.GetStreamCharSet());
+ String aStorageName = rSStream.ReadUniOrByteString(rSStream.GetStreamCharSet());
pInfo->SetStorageName( aStorageName );
// Relative path...
- String aRelStorageName;
- rSStream.ReadUniOrByteString(aRelStorageName, rSStream.GetStreamCharSet());
+ String aRelStorageName = rSStream.ReadUniOrByteString(rSStream.GetStreamCharSet());
pInfo->SetRelStorageName( aRelStorageName );
if ( nVer >= 2 )
@@ -1041,8 +1038,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
// and it proceeds ...
}
xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator
- String aLibs;
- xManagerStream->ReadUniOrByteString(aLibs, xManagerStream->GetStreamCharSet());
+ String aLibs = xManagerStream->ReadUniOrByteString(xManagerStream->GetStreamCharSet());
xManagerStream->SetBufferSize( 0 );
xManagerStream.Clear(); // Close stream
@@ -1235,8 +1231,7 @@ sal_Bool BasicManager::ImpLoadLibary( BasicLibInfo* pLibInfo, SotStorage* pCurSt
*xBasicStream >> nPasswordMarker;
if ( ( nPasswordMarker == PASSWORD_MARKER ) && !xBasicStream->IsEof() )
{
- String aPassword;
- xBasicStream->ReadUniOrByteString(aPassword,
+ String aPassword = xBasicStream->ReadUniOrByteString(
xBasicStream->GetStreamCharSet());
pLibInfo->SetPassword( aPassword );
}
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 79b3765..af93ade 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -147,24 +147,21 @@ sal_Bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
switch( nSign )
{
case B_NAME:
- r.ReadUniOrByteString( aName, eCharSet );
+ aName = r.ReadUniOrByteString(eCharSet);
break;
case B_COMMENT:
- r.ReadUniOrByteString( aComment, eCharSet );
+ aComment = r.ReadUniOrByteString(eCharSet );
break;
case B_SOURCE:
{
- String aTmp;
- r.ReadUniOrByteString( aTmp, eCharSet );
- aOUSource = aTmp;
+ aOUSource = r.ReadUniOrByteString(eCharSet);
break;
}
case B_EXTSOURCE:
{
for( sal_uInt16 j = 0 ; j < nCount ; j++ )
{
- String aTmp;
- r.ReadUniOrByteString( aTmp, eCharSet );
+ String aTmp = r.ReadUniOrByteString(eCharSet);
aOUSource += aTmp;
}
break;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 975ecc2..ddb47c3 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -2001,9 +2001,7 @@ sal_Bool SbJScriptModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
return sal_False;
// Get the source string
- String aTmp;
- rStrm.ReadUniOrByteString( aTmp, osl_getThreadTextEncoding() );
- aOUSource = aTmp;
+ aOUSource = rStrm.ReadUniOrByteString( osl_getThreadTextEncoding() );
return sal_True;
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index 5b25252..0c863ef 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -1106,8 +1106,7 @@ sal_Bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
case SbxSTRING:
case SbxLPSTR:
{
- String aStr;
- pStrm->ReadUniOrByteString( aStr, osl_getThreadTextEncoding() );
+ String aStr = pStrm->ReadUniOrByteString(osl_getThreadTextEncoding());
rVar.PutString( aStr );
}
break;
diff --git a/dbaccess/source/ui/tabledesign/TableRow.cxx b/dbaccess/source/ui/tabledesign/TableRow.cxx
index 35be52c..2ed5451 100644
--- a/dbaccess/source/ui/tabledesign/TableRow.cxx
+++ b/dbaccess/source/ui/tabledesign/TableRow.cxx
@@ -169,13 +169,12 @@ namespace dbaui
{
OFieldDescription* pFieldDesc = new OFieldDescription();
_rRow.m_pActFieldDescr = pFieldDesc;
- String sValue;
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ String sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetName(sValue);
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetDescription(sValue);
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
pFieldDesc->SetHelpText(sValue);
_rStr >> nValue;
@@ -190,7 +189,7 @@ namespace dbaui
break;
}
case 2:
- _rStr.ReadUniOrByteString(sValue, _rStr.GetStreamCharSet());
+ sValue = _rStr.ReadUniOrByteString(_rStr.GetStreamCharSet());
aControlDefault <<= ::rtl::OUString(sValue);
break;
}
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index f039b12..b4555d8 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -1230,7 +1230,7 @@ void BinTextObject::CreateData( SvStream& rIStream )
pC->GetText() = rtl::OStringToOUString(aByteString, eSrcEncoding);
// StyleName and Family...
- rIStream.ReadUniOrByteString( pC->GetStyle(), eSrcEncoding );
+ pC->GetStyle() = rIStream.ReadUniOrByteString(eSrcEncoding);
sal_uInt16 nStyleFamily;
rIStream >> nStyleFamily;
pC->GetFamily() = (SfxStyleFamily)nStyleFamily;
@@ -1522,10 +1522,10 @@ void BinTextObject::CreateData300( SvStream& rIStream )
ContentInfo* pC = CreateAndInsertContent();
// The Text...
- rIStream.ReadUniOrByteString( pC->GetText(), rIStream.GetStreamCharSet() );
+ pC->GetText() = rIStream.ReadUniOrByteString(rIStream.GetStreamCharSet());
// StyleName and Family...
- rIStream.ReadUniOrByteString( pC->GetStyle(), rIStream.GetStreamCharSet() );
+ pC->GetStyle() = rIStream.ReadUniOrByteString(rIStream.GetStreamCharSet());
sal_uInt16 nStyleFamily;
rIStream >> nStyleFamily;
pC->GetFamily() = (SfxStyleFamily)nStyleFamily;
diff --git a/editeng/source/items/bulitem.cxx b/editeng/source/items/bulitem.cxx
index 106a5ab..b47a8e1 100644
--- a/editeng/source/items/bulitem.cxx
+++ b/editeng/source/items/bulitem.cxx
@@ -93,8 +93,7 @@ Font SvxBulletItem::CreateFont( SvStream& rStream, sal_uInt16 nVer )
rStream >> nTemp; aFont.SetItalic((FontItalic)nTemp);
// UNICODE: rStream >> aName; aFont.SetName( aName );
- String aName;
- rStream.ReadUniOrByteString(aName, rStream.GetStreamCharSet());
+ String aName = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
aFont.SetName( aName );
if( nVer == 1 )
@@ -166,10 +165,10 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich ) :
rStrm >> nScale;
// UNICODE: rStrm >> aPrevText;
- rStrm.ReadUniOrByteString(aPrevText, rStrm.GetStreamCharSet());
+ aPrevText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aFollowText;
- rStrm.ReadUniOrByteString(aFollowText, rStrm.GetStreamCharSet());
+ aFollowText = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
nValidMask = 0xFFFF;
}
diff --git a/editeng/source/items/flditem.cxx b/editeng/source/items/flditem.cxx
index bafb976..f1bfbd2 100644
--- a/editeng/source/items/flditem.cxx
+++ b/editeng/source/items/flditem.cxx
@@ -735,7 +735,7 @@ void SvxExtFileField::Load( SvPersistStream & rStm )
sal_uInt16 nType, nFormat;
// UNICODE: rStm >> aFile;
- rStm.ReadUniOrByteString(aFile, rStm.GetStreamCharSet());
+ aFile = rStm.ReadUniOrByteString(rStm.GetStreamCharSet());
rStm >> nType;
rStm >> nFormat;
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index ee8b297..a196a1e 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -3441,9 +3441,8 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
if ( nDoLoad & LOAD_LINK )
{
- String aRel;
// UNICODE: rStream >> aRel;
- rStream.ReadUniOrByteString(aRel, rStream.GetStreamCharSet());
+ String aRel = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
// TODO/MBA: how can we get a BaseURL here?!
OSL_FAIL("No BaseURL!");
@@ -3456,7 +3455,7 @@ SvxBrushItem::SvxBrushItem( SvStream& rStream, sal_uInt16 nVersion,
{
pStrFilter = new String;
// UNICODE: rStream >> *pStrFilter;
- rStream.ReadUniOrByteString(*pStrFilter, rStream.GetStreamCharSet());
+ *pStrFilter = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
}
rStream >> nPos;
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 374655d..e0117a5 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -424,10 +424,10 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
rStrm >> eFontTextEncoding;
// UNICODE: rStrm >> aName;
- rStrm.ReadUniOrByteString(aName, rStrm.GetStreamCharSet());
+ aName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aStyle;
- rStrm.ReadUniOrByteString(aStyle, rStrm.GetStreamCharSet());
+ aStyle = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// Set the "correct" textencoding
eFontTextEncoding = (sal_uInt8)GetSOLoadTextEncoding( eFontTextEncoding, (sal_uInt16)rStrm.GetVersion() );
@@ -442,8 +442,8 @@ SfxPoolItem* SvxFontItem::Create(SvStream& rStrm, sal_uInt16) const
rStrm >> nMagic;
if ( nMagic == STORE_UNICODE_MAGIC_MARKER )
{
- rStrm.ReadUniOrByteString( aName, RTL_TEXTENCODING_UNICODE );
- rStrm.ReadUniOrByteString( aStyle, RTL_TEXTENCODING_UNICODE );
+ aName = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
+ aStyle = rStrm.ReadUniOrByteString( RTL_TEXTENCODING_UNICODE );
}
else
{
diff --git a/idl/source/objects/module.cxx b/idl/source/objects/module.cxx
index c915316..7a8a943 100644
--- a/idl/source/objects/module.cxx
+++ b/idl/source/objects/module.cxx
@@ -65,7 +65,7 @@ void SvMetaModule::Load( SvPersistStream & rStm )
rStm >> aTypeList;
rStm >> aAttrList;
// browser
- rStm.ReadUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() );
+ aIdlFileName = rStm.ReadUniOrByteString( rStm.GetStreamCharSet() );
aHelpFileName.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
aSlotIdFile.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
aModulePrefix.setString(read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStm));
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 93adcfe..6de3e0a 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -172,7 +172,7 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */
{
short eFamDummy;
pStr = new String;
- rStream.ReadUniOrByteString( *pStr, rStream.GetStreamCharSet() );
+ *pStr = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream >> eFamDummy; // wg. altem Dateiformat
}
else
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index c938a17..d6c3a68 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -803,7 +803,7 @@ sal_Bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersion
RTL_TEXTENCODING_UTF8);
}
else
- rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
+ aName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
if( AUTOFORMAT_DATA_ID_552 <= nVer )
{
@@ -844,7 +844,7 @@ sal_Bool ScAutoFormatData::LoadOld( SvStream& rStream, const ScAfVersions& rVers
bRet = (rStream.GetError() == 0);
if (bRet && (nVal == AUTOFORMAT_OLD_DATA_ID))
{
- rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
+ aName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
sal_Bool b;
rStream >> b; bIncludeFont = b;
rStream >> b; bIncludeJustify = b;
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index ce67bb7..c53e739 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -93,9 +93,9 @@ ScDdeLink::ScDdeLink( ScDocument* pD, SvStream& rStream, ScMultipleReadHeader& r
rHdr.StartEntry();
rtl_TextEncoding eCharSet = rStream.GetStreamCharSet();
- rStream.ReadUniOrByteString( aAppl, eCharSet );
- rStream.ReadUniOrByteString( aTopic, eCharSet );
- rStream.ReadUniOrByteString( aItem, eCharSet );
+ aAppl = rStream.ReadUniOrByteString( eCharSet );
+ aTopic = rStream.ReadUniOrByteString( eCharSet );
+ aItem = rStream.ReadUniOrByteString( eCharSet );
sal_Bool bHasValue;
rStream >> bHasValue;
diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx
index 048c981..d3ddf04 100644
--- a/sc/source/core/tool/zforauto.cxx
+++ b/sc/source/core/tool/zforauto.cxx
@@ -61,7 +61,7 @@ ScNumFormatAbbrev::ScNumFormatAbbrev(sal_uLong nFormat,
void ScNumFormatAbbrev::Load( SvStream& rStream, CharSet eByteStrSet )
{
sal_uInt16 nSysLang, nLang;
- rStream.ReadUniOrByteString( sFormatstring, eByteStrSet );
+ sFormatstring = rStream.ReadUniOrByteString( eByteStrSet );
rStream >> nSysLang >> nLang;
eLnge = (LanguageType) nLang;
eSysLnge = (LanguageType) nSysLang;
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 0ec2e70..1e62b63 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -190,8 +190,7 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl()
if( bSlots && bSlotsEnabled )
{
// Read Slot file
- String aTitle;
- pStream->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet());
+ String aTitle = pStream->ReadUniOrByteString(pStream->GetStreamCharSet());
if ( aTitle.CompareToAscii("SfxSlotFile" ) == COMPARE_EQUAL )
{
sal_uInt16 nCount;
@@ -206,7 +205,7 @@ std::vector<sal_uInt16>* SfxApplication::GetDisabledSlotList_Impl()
pList->push_back( nSlot );
}
- pStream->ReadUniOrByteString(aTitle, pStream->GetStreamCharSet());
+ aTitle = pStream->ReadUniOrByteString(pStream->GetStreamCharSet());
if ( aTitle.CompareToAscii("END" ) != COMPARE_EQUAL || pStream->GetError() )
{
// Read failed
diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx
index 8970688..05ed277 100644
--- a/svl/source/items/poolitem.cxx
+++ b/svl/source/items/poolitem.cxx
@@ -187,7 +187,7 @@ SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const
// static
bool SfxPoolItem::readByteString(SvStream & rStream, UniString & rString)
{
- rStream.ReadUniOrByteString(rString, rStream.GetStreamCharSet());
+ rString = rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
}
@@ -204,8 +204,7 @@ void SfxPoolItem::writeByteString(SvStream & rStream,
bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString,
bool bUnicode)
{
- rStream.ReadUniOrByteString(rString,
- bUnicode ? RTL_TEXTENCODING_UCS2 :
+ rString = rStream.ReadUniOrByteString(bUnicode ? RTL_TEXTENCODING_UCS2 :
rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
}
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 8457f5b..13c4ab9 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -402,7 +402,7 @@ void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc,
rStream >> nAnz; //! noch nicht direkt nAnzStrings wg. Enlarge
Enlarge( nAnz );
aI.Load( rStream, nAnz );
- rStream.ReadUniOrByteString( sColorName, rStream.GetStreamCharSet() );
+ sColorName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rLoadedColorName = sColorName;
pColor = rSc.GetColor(sColorName);
}
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index ccf74ec..c4deeec 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -417,8 +417,7 @@ namespace svt
// initialize them with their (local) names
while ( nChildren-- )
{
- String sURL;
- m_rStorage.ReadUniOrByteString( sURL, m_rStorage.GetStreamCharSet() );
+ String sURL = m_rStorage.ReadUniOrByteString(m_rStorage.GetStreamCharSet());
sURL = m_xOfficeInstDirs->makeAbsoluteURL( sURL );
INetURLObject aChildURL( sURL );
rChildren.push_back( new TemplateContent( aChildURL ) );
@@ -735,8 +734,7 @@ namespace svt
m_aPreviousState.reserve( nRootDirectories );
while ( nRootDirectories-- )
{
- String sURL;
- m_pCacheStream->ReadUniOrByteString( sURL, m_pCacheStream->GetStreamCharSet() );
+ String sURL = m_pCacheStream->ReadUniOrByteString(m_pCacheStream->GetStreamCharSet());
// #116281# Keep office installtion relocatable. Never store
// any direct references to office installation directory.
sURL = getOfficeInstDirs()->makeAbsoluteURL( sURL );
diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx
index c8158d1..6faa7e5 100644
--- a/svtools/source/misc/transfer.cxx
+++ b/svtools/source/misc/transfer.cxx
@@ -96,8 +96,8 @@ SvStream& operator>>( SvStream& rIStm, TransferableObjectDescriptor& rObjDesc )
rIStm >> rObjDesc.maSize.Height();
rIStm >> rObjDesc.maDragStartPos.X();
rIStm >> rObjDesc.maDragStartPos.Y();
- rIStm.ReadUniOrByteString( rObjDesc.maTypeName, osl_getThreadTextEncoding() );
- rIStm.ReadUniOrByteString( rObjDesc.maDisplayName, osl_getThreadTextEncoding() );
+ rObjDesc.maTypeName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding());
+ rObjDesc.maDisplayName = rIStm.ReadUniOrByteString(osl_getThreadTextEncoding());
rIStm >> nSig1 >> nSig2;
rObjDesc.mnViewAspect = static_cast< sal_uInt16 >( nViewAspect );
diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx
index 1f6dfa8..bc663b2 100644
--- a/svx/source/items/hlnkitem.cxx
+++ b/svx/source/items/hlnkitem.cxx
@@ -131,13 +131,13 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
// simple data-types
// UNICODE: rStrm >> pNew->sName;
- rStrm.ReadUniOrByteString(pNew->sName, rStrm.GetStreamCharSet());
+ pNew->sName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> pNew->sURL;
- rStrm.ReadUniOrByteString(pNew->sURL, rStrm.GetStreamCharSet());
+ pNew->sURL = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> pNew->sTarget;
- rStrm.ReadUniOrByteString(pNew->sTarget, rStrm.GetStreamCharSet());
+ pNew->sTarget = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
rStrm >> nType;
pNew->eType = (SvxLinkInsertMode) nType;
@@ -149,7 +149,7 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
{
// new data
// UNICODE: rStrm >> pNew->sIntName;
- rStrm.ReadUniOrByteString(pNew->sIntName, rStrm.GetStreamCharSet());
+ pNew->sIntName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// macro-events
rStrm >> pNew->nMacroEvents;
@@ -164,10 +164,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
rStrm >> nCurKey;
// UNICODE: rStrm >> aLibName;
- rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet());
+ aLibName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aMacName;
- rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet());
+ aMacName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
pNew->SetMacro( nCurKey, SvxMacro( aMacName, aLibName, STARBASIC ) );
}
@@ -181,10 +181,10 @@ SfxPoolItem* SvxHyperlinkItem::Create( SvStream &rStrm, sal_uInt16 /*nItemVer
rStrm >> nCurKey;
// UNICODE: rStrm >> aLibName;
- rStrm.ReadUniOrByteString(aLibName, rStrm.GetStreamCharSet());
+ aLibName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
// UNICODE: rStrm >> aMacName;
- rStrm.ReadUniOrByteString(aMacName, rStrm.GetStreamCharSet());
+ aMacName = rStrm.ReadUniOrByteString(rStrm.GetStreamCharSet());
rStrm >> nScriptType;
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index 7dcffd0..b67d01f 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -245,13 +245,12 @@ bool SvxPageItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
SfxPoolItem* SvxPageItem::Create( SvStream& rStream, sal_uInt16 ) const
{
- XubString sStr;
sal_uInt8 eType;
sal_Bool bLand;
sal_uInt16 nUse;
// UNICODE: rStream >> sStr;
- rStream.ReadUniOrByteString( sStr, rStream.GetStreamCharSet() );
+ XubString sStr = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream >> eType;
rStream >> bLand;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 4ecbd2a..1fdb642 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -401,8 +401,8 @@ sal_Bool SwBoxAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions, s
sal_uInt16 eSys, eLge;
// --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVer >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
- rStream.ReadUniOrByteString( sNumFmtString, eCharSet )
- >> eSys >> eLge;
+ sNumFmtString = rStream.ReadUniOrByteString( eCharSet );
+ rStream >> eSys >> eLge;
eSysLanguage = (LanguageType) eSys;
eNumFmtLanguage = (LanguageType) eLge;
if ( eSysLanguage == LANGUAGE_SYSTEM ) // von alten Versionen (Calc)
@@ -780,7 +780,7 @@ sal_Bool SwTableAutoFmt::Load( SvStream& rStream, const SwAfVersions& rVersions
sal_Bool b;
// --- from 680/dr25 on: store strings as UTF-8
CharSet eCharSet = (nVal >= AUTOFORMAT_ID_680DR25) ? RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
- rStream.ReadUniOrByteString( aName, eCharSet );
+ aName = rStream.ReadUniOrByteString( eCharSet );
if( AUTOFORMAT_DATA_ID_552 <= nVal )
{
rStream >> nStrResId;
@@ -830,7 +830,7 @@ sal_Bool SwTableAutoFmt::LoadOld( SvStream& rStream, sal_uInt16 aLoadVer[] )
if( bRet && ( AUTOFORMAT_OLD_DATA_ID == nVal ))
{
sal_Bool b;
- rStream.ReadUniOrByteString( aName, rStream.GetStreamCharSet() );
+ aName = rStream.ReadUniOrByteString( rStream.GetStreamCharSet() );
rStream >> b; bInclFont = b;
rStream >> b; bInclJustify = b;
rStream >> b; bInclFrame = b;
diff --git a/sw/source/ui/config/uinums.cxx b/sw/source/ui/config/uinums.cxx
index c43a2f4..0079b1f 100644
--- a/sw/source/ui/config/uinums.cxx
+++ b/sw/source/ui/config/uinums.cxx
@@ -235,7 +235,7 @@ const SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName
SwNumRulesWithName::SwNumRulesWithName( SvStream &rStream, sal_uInt16 nVersion )
{
CharSet eEncoding = osl_getThreadTextEncoding();
- rStream.ReadUniOrByteString(aName, eEncoding);
+ aName = rStream.ReadUniOrByteString(eEncoding);
char c;
for(sal_uInt16 n = 0; n < MAXLEVEL; ++n )
@@ -354,9 +354,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
long nL;
rStream >> cChar; aFmt.SetStart( (sal_uInt16)cChar );
- rStream.ReadUniOrByteString(sStr, eEncoding);
+ sStr = rStream.ReadUniOrByteString(eEncoding);
aFmt.SetPrefix( sStr );
- rStream.ReadUniOrByteString(sStr, eEncoding);
+ sStr = rStream.ReadUniOrByteString(eEncoding);
aFmt.SetSuffix( sStr );
rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
rStream >> nL; aFmt.SetLSpace( lNumIndent );
@@ -366,9 +366,9 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
{
short nShort;
rStream >> nUS; aFmt.SetStart( nUS );
- rStream.ReadUniOrByteString(sStr, eEncoding);
+ sStr = rStream.ReadUniOrByteString(eEncoding);
aFmt.SetPrefix( sStr );
- rStream.ReadUniOrByteString(sStr, eEncoding);
+ sStr = rStream.ReadUniOrByteString(eEncoding);
aFmt.SetSuffix( sStr );
rStream >> nUS; aFmt.SetNumAdjust( SvxAdjust( nUS ) );
rStream >> nUS; aFmt.SetAbsLSpace( nUS );
@@ -385,7 +385,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
sal_uInt16 nPitch;
String aName;
- rStream.ReadUniOrByteString(aName, eEncoding);
+ aName = rStream.ReadUniOrByteString(eEncoding);
rStream >> nFamily >> nCharSet >> nWidth >> nHeight >> nPitch;
if( aName.Len() )
@@ -411,7 +411,7 @@ SwNumRulesWithName::_SwNumFmtGlobal::_SwNumFmtGlobal( SvStream& rStream,
{
sal_uInt16 nItemCount;
rStream >> nCharPoolId;
- rStream.ReadUniOrByteString(sCharFmtName, eEncoding);
+ sCharFmtName = rStream.ReadUniOrByteString(eEncoding);
rStream >> nItemCount;
while( nItemCount-- )
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 0ef6140..52ae394 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -409,7 +409,7 @@ public:
sal_Bool ReadUniStringLine( String& rStr );
/// Read a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
/// otherwise read a 16bit length prefixed sequence of bytes and convert from eSrcCharSet
- SvStream& ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet );
+ String ReadUniOrByteString(rtl_TextEncoding eSrcCharSet);
/// Write a 32bit length prefixed sequence of utf-16 if eSrcCharSet==RTL_TEXTENCODING_UNICODE,
/// otherwise convert to eSrcCharSet and write a 16bit length prefixed sequence of bytes
SvStream& WriteUniOrByteString( const UniString& rStr, rtl_TextEncoding eDestCharSet );
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index 8e2cbb0..1b31103 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -1489,36 +1489,37 @@ SvStream& SvStream::operator<< ( SvStream& rStream )
// -----------------------------------------------------------------------
-SvStream& SvStream::ReadUniOrByteString( UniString& rStr, rtl_TextEncoding eSrcCharSet )
+String SvStream::ReadUniOrByteString( rtl_TextEncoding eSrcCharSet )
{
// read UTF-16 string directly from stream ?
if (eSrcCharSet == RTL_TEXTENCODING_UNICODE)
{
- sal_uInt32 nLen;
+ String aStr;
+ sal_uInt32 nLen(0);
operator>> (nLen);
if (nLen)
{
- if (nLen > STRING_MAXLEN) {
+ if (nLen > STRING_MAXLEN)
+ {
SetError(SVSTREAM_GENERALERROR);
- return *this;
+ return aStr;
}
- sal_Unicode *pStr = rStr.AllocBuffer(
+ sal_Unicode *pStr = aStr.AllocBuffer(
static_cast< xub_StrLen >(nLen));
BOOST_STATIC_ASSERT(STRING_MAXLEN <= SAL_MAX_SIZE / 2);
Read( pStr, nLen << 1 );
if (bSwap)
+ {
for (sal_Unicode *pEnd = pStr + nLen; pStr < pEnd; pStr++)
SwapUShort(*pStr);
+ }
}
- else
- rStr.Erase();
- return *this;
+ return aStr;
}
- rStr = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(*this, eSrcCharSet);
- return *this;
+ return read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(*this, eSrcCharSet);
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/gdi/font.cxx b/vcl/source/gdi/font.cxx
index 059b1fe..a80c4c7 100644
--- a/vcl/source/gdi/font.cxx
+++ b/vcl/source/gdi/font.cxx
@@ -780,8 +780,8 @@ SvStream& operator>>( SvStream& rIStm, Impl_Font& rImpl_Font )
sal_Bool bTmp;
sal_uInt8 nTmp8;
- rIStm.ReadUniOrByteString( rImpl_Font.maFamilyName, rIStm.GetStreamCharSet() );
- rIStm.ReadUniOrByteString( rImpl_Font.maStyleName, rIStm.GetStreamCharSet() );
+ rImpl_Font.maFamilyName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet());
+ rImpl_Font.maStyleName = rIStm.ReadUniOrByteString(rIStm.GetStreamCharSet());
rIStm >> rImpl_Font.maSize;
rIStm >> nTmp16; rImpl_Font.meCharSet = (rtl_TextEncoding) nTmp16;
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 74881f6..6589f50 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -1278,7 +1278,7 @@ void MetaTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maPt;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnIndex;
rIStm >> mnLen;
@@ -1435,7 +1435,7 @@ void MetaTextArrayAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
COMPAT( rIStm );
rIStm >> maStartPt;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnIndex;
rIStm >> mnLen;
rIStm >> nAryLen;
@@ -1575,7 +1575,7 @@ void MetaStretchTextAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maPt;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnWidth;
rIStm >> mnIndex;
rIStm >> mnLen;
@@ -1668,7 +1668,7 @@ void MetaTextRectAction::Read( SvStream& rIStm, ImplMetaReadData* pData )
{
COMPAT( rIStm );
rIStm >> maRect;
- rIStm.ReadUniOrByteString( maStr, pData->meActualCharSet );
+ maStr = rIStm.ReadUniOrByteString(pData->meActualCharSet);
rIStm >> mnStyle;
if ( aCompat.GetVersion() >= 2 ) // Version 2
More information about the Libreoffice-commits
mailing list