readUnicodeString can just return the string

seeing as no-one checks the return value, we don't need
the intermediate temporary string
This commit is contained in:
Caolán McNamara
2012-03-26 10:18:32 +01:00
parent 723613ab5c
commit e443216ce2
25 changed files with 130 additions and 138 deletions

View File

@@ -213,7 +213,7 @@ DlgEditor::DlgEditor( const ::com::sun::star::uno::Reference< ::com::sun::star::
SdrLayerAdmin& rAdmin = pDlgEdModel->GetLayerAdmin(); SdrLayerAdmin& rAdmin = pDlgEdModel->GetLayerAdmin();
rAdmin.NewLayer( rAdmin.GetControlLayerName() ); rAdmin.NewLayer( rAdmin.GetControlLayerName() );
rAdmin.NewLayer( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ) ); rAdmin.NewLayer( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HiddenLayer")) );
pDlgEdPage = new DlgEdPage( *pDlgEdModel ); pDlgEdPage = new DlgEdPage( *pDlgEdModel );
pDlgEdModel->InsertPage( pDlgEdPage ); pDlgEdModel->InsertPage( pDlgEdPage );
@@ -270,7 +270,7 @@ void DlgEditor::SetWindow( Window* pWindow_ )
pDlgEdView = new DlgEdView( pDlgEdModel, pWindow_, this ); pDlgEdView = new DlgEdView( pDlgEdModel, pWindow_, this );
pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0)); pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0));
pDlgEdView->SetLayerVisible( UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "HiddenLayer" ) ), sal_False ); pDlgEdView->SetLayerVisible( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("HiddenLayer")), sal_False );
pDlgEdView->SetMoveSnapOnlyTopLeft( sal_True ); pDlgEdView->SetMoveSnapOnlyTopLeft( sal_True );
pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) ); pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) );

View File

@@ -748,17 +748,19 @@ namespace cppcanvas
filter.ImportGraphic (graphic, String (), mfStream); filter.ImportGraphic (graphic, String (), mfStream);
// debug code - write the stream to debug file /tmp/emf-stream.emf // debug code - write the stream to debug file /tmp/emf-stream.emf
EMFP_DEBUG(mfStream.Seek(0); EMFP_DEBUG(
static int emfp_debug_stream_numnber = 0; mfStream.Seek(0);
UniString emfp_debug_filename = UniString::CreateFromAscii( "/tmp/emf-embedded-stream" ); static int emfp_debug_stream_numnber = 0;
emfp_debug_filename.Append( UniString::CreateFromInt32( emfp_debug_stream_numnber++ )); rtl::OUString emfp_debug_filename("/tmp/emf-embedded-stream");
emfp_debug_filename.Append( UniString::CreateFromAscii( ".emf" )); emfp_debug_filename += rtl::OUString::valueOf(emfp_debug_stream_numnber++);
emfp_debug_filename += rtl::OUString(".emf");
SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC ); SvFileStream file( emfp_debug_filename, STREAM_WRITE | STREAM_TRUNC );
mfStream >> file; mfStream >> file;
file.Flush(); file.Flush();
file.Close()); file.Close()
);
} }
} }
}; };
@@ -766,33 +768,33 @@ namespace cppcanvas
struct EMFPFont : public EMFPObject struct EMFPFont : public EMFPObject
{ {
sal_uInt32 version; sal_uInt32 version;
float emSize; float emSize;
sal_uInt32 sizeUnit; sal_uInt32 sizeUnit;
sal_Int32 fontFlags; sal_Int32 fontFlags;
rtl::OUString family; rtl::OUString family;
void Read (SvMemoryStream &s) void Read (SvMemoryStream &s)
{ {
sal_uInt32 header; sal_uInt32 header;
sal_uInt32 reserved; sal_uInt32 reserved;
sal_uInt32 length; sal_uInt32 length;
s >> header >> emSize >> sizeUnit >> fontFlags >> reserved >> length; s >> header >> emSize >> sizeUnit >> fontFlags >> reserved >> length;
OSL_ASSERT( ( header >> 12 ) == 0xdbc01 ); OSL_ASSERT( ( header >> 12 ) == 0xdbc01 );
EMFP_DEBUG (printf ("EMF+\tfont\nEMF+\theader: 0x%08x version: 0x%08x size: %f unit: 0x%08x\n",(unsigned int) header >> 12, (unsigned int)header & 0x1fff, emSize, (unsigned int)sizeUnit)); EMFP_DEBUG (printf ("EMF+\tfont\nEMF+\theader: 0x%08x version: 0x%08x size: %f unit: 0x%08x\n",(unsigned int) header >> 12, (unsigned int)header & 0x1fff, emSize, (unsigned int)sizeUnit));
EMFP_DEBUG (printf ("EMF+\tflags: 0x%08x reserved: 0x%08x length: 0x%08x\n", (unsigned int)fontFlags, (unsigned int)reserved, (unsigned int)length)); EMFP_DEBUG (printf ("EMF+\tflags: 0x%08x reserved: 0x%08x length: 0x%08x\n", (unsigned int)fontFlags, (unsigned int)reserved, (unsigned int)length));
if( length > 0 && length < 0x4000 ) { if( length > 0 && length < 0x4000 ) {
sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length ); sal_Unicode *chars = (sal_Unicode *) alloca( sizeof( sal_Unicode ) * length );
for( sal_uInt32 i = 0; i < length; i++ ) for( sal_uInt32 i = 0; i < length; i++ )
s >> chars[ i ]; s >> chars[ i ];
family = ::rtl::OUString( chars, length ); family = ::rtl::OUString( chars, length );
EMFP_DEBUG (printf ("EMF+\tfamily: %s\n", rtl::OUStringToOString( family, RTL_TEXTENCODING_UTF8).getStr())); EMFP_DEBUG (printf ("EMF+\tfamily: %s\n", rtl::OUStringToOString( family, RTL_TEXTENCODING_UTF8).getStr()));
} }
} }
}; };
@@ -893,7 +895,7 @@ namespace cppcanvas
rState.isFillColorSet = true; rState.isFillColorSet = true;
rState.isLineColorSet = false; rState.isLineColorSet = false;
SET_FILL_COLOR(brushIndexOrColor); SET_FILL_COLOR(brushIndexOrColor);
pPolyAction = ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, rParms.mrCanvas, rState ) ); pPolyAction = ActionSharedPtr ( internal::PolyPolyActionFactory::createPolyPolyAction( localPolygon, rParms.mrCanvas, rState ) );

View File

@@ -34,9 +34,9 @@
// forward --------------------------------------------------------------- // forward ---------------------------------------------------------------
#define CUI_MGR() (*CuiResMgr::GetResMgr()) #define CUI_MGR() (*CuiResMgr::GetResMgr())
#define CUI_RES(i) ResId(i,CUI_MGR()) #define CUI_RES(i) ResId(i,CUI_MGR())
#define CUI_RESSTR(i) UniString(ResId(i,CUI_MGR())) #define CUI_RESSTR(i) ResId::toString(ResId(i,CUI_MGR()))
class ResMgr; class ResMgr;
struct CuiResMgr struct CuiResMgr

View File

@@ -601,7 +601,7 @@ sal_Bool EdtAutoCorrDoc::SetAttr( sal_uInt16 nStt, sal_uInt16 nEnd,
{ {
SfxItemPool* pPool = &pImpEE->GetEditDoc().GetItemPool(); SfxItemPool* pPool = &pImpEE->GetEditDoc().GetItemPool();
while ( pPool->GetSecondaryPool() && while ( pPool->GetSecondaryPool() &&
!pPool->GetName().EqualsAscii( "EditEngineItemPool" ) ) !pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")) )
{ {
pPool = pPool->GetSecondaryPool(); pPool = pPool->GetSecondaryPool();

View File

@@ -169,12 +169,14 @@ EditPaM ImpEditEngine::ReadRTF( SvStream& rInput, EditSelection aSel )
// The SvRTF parser expects the Which-mapping passed on in the pool, not // The SvRTF parser expects the Which-mapping passed on in the pool, not
// dependant on a secondary. // dependant on a secondary.
SfxItemPool* pPool = &aEditDoc.GetItemPool(); SfxItemPool* pPool = &aEditDoc.GetItemPool();
while ( pPool->GetSecondaryPool() && !pPool->GetName().EqualsAscii( "EditEngineItemPool" ) ) while (pPool->GetSecondaryPool() && !pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")))
{ {
pPool = pPool->GetSecondaryPool(); pPool = pPool->GetSecondaryPool();
} }
DBG_ASSERT( pPool && pPool->GetName().EqualsAscii( "EditEngineItemPool" ), "ReadRTF: no EditEnginePool!" );
DBG_ASSERT(pPool && pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EditEngineItemPool")),
"ReadRTF: no EditEnginePool!");
EditRTFParserRef xPrsr = new EditRTFParser( rInput, aSel, *pPool, this ); EditRTFParserRef xPrsr = new EditRTFParser( rInput, aSel, *pPool, this );
SvParserState eState = xPrsr->CallParser(); SvParserState eState = xPrsr->CallParser();

View File

@@ -4108,7 +4108,7 @@ SvxBrushItem::SvxBrushItem( const CntWallpaperItem& rItem, sal_uInt16 _nWhich )
{ {
aColor = rItem.GetColor(); aColor = rItem.GetColor();
if( rItem.GetBitmapURL().Len() ) if (!rItem.GetBitmapURL().isEmpty())
{ {
pStrLink = new String( rItem.GetBitmapURL() ); pStrLink = new String( rItem.GetBitmapURL() );
SetGraphicPos( WallpaperStyle2GraphicPos((WallpaperStyle)rItem.GetStyle() ) ); SetGraphicPos( WallpaperStyle2GraphicPos((WallpaperStyle)rItem.GetStyle() ) );

View File

@@ -1197,7 +1197,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ )
const SfxItemPool *pPool = SfxItemPool::GetStoringPool(); const SfxItemPool *pPool = SfxItemPool::GetStoringPool();
const bool bStoreDefTabs = pPool const bool bStoreDefTabs = pPool
&& pPool->GetName().EqualsAscii("SWG") && pPool->GetName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SWG"))
&& ::IsDefaultItem( this ); && ::IsDefaultItem( this );
const short nTabs = Count(); const short nTabs = Count();

View File

@@ -40,9 +40,9 @@ class SvStream;
class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem class SVL_DLLPUBLIC CntWallpaperItem : public SfxPoolItem
{ {
private: private:
UniString _aURL; rtl::OUString _aURL;
Color _nColor; Color _nColor;
sal_uInt16 _nStyle; sal_uInt16 _nStyle;
public: public:
TYPEINFO(); TYPEINFO();
@@ -64,13 +64,13 @@ public:
virtual bool PutValue ( const com::sun::star::uno::Any& rVal, virtual bool PutValue ( const com::sun::star::uno::Any& rVal,
sal_uInt8 nMemberId = 0 ); sal_uInt8 nMemberId = 0 );
void SetBitmapURL( const UniString& rURL ) { _aURL = rURL; } void SetBitmapURL( const rtl::OUString& rURL ) { _aURL = rURL; }
void SetColor( Color nColor ) { _nColor = nColor; } void SetColor( Color nColor ) { _nColor = nColor; }
void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; } void SetStyle( sal_uInt16 nStyle ) { _nStyle = nStyle; }
const UniString& GetBitmapURL() const { return _aURL; } const rtl::OUString& GetBitmapURL() const { return _aURL; }
Color GetColor() const { return _nColor; } Color GetColor() const { return _nColor; }
sal_uInt16 GetStyle() const { return _nStyle; } sal_uInt16 GetStyle() const { return _nStyle; }
}; };
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@@ -106,10 +106,10 @@ struct CntHTTPCookie
void read (SvStream& rStrm, bool bUnicode) void read (SvStream& rStrm, bool bUnicode)
{ {
SfxPoolItem::readUnicodeString(rStrm, m_aName, bUnicode); m_aName = SfxPoolItem::readUnicodeString(rStrm, bUnicode);
SfxPoolItem::readUnicodeString(rStrm, m_aValue, bUnicode); m_aValue = SfxPoolItem::readUnicodeString(rStrm, bUnicode);
SfxPoolItem::readUnicodeString(rStrm, m_aDomain, bUnicode); m_aDomain = SfxPoolItem::readUnicodeString(rStrm, bUnicode);
SfxPoolItem::readUnicodeString(rStrm, m_aPath, bUnicode); m_aPath = SfxPoolItem::readUnicodeString(rStrm, bUnicode);
sal_uInt32 nValue = 0; sal_uInt32 nValue = 0;
rStrm >> nValue; rStrm >> nValue;

View File

@@ -144,7 +144,7 @@ protected:
public: public:
SfxItemPool( const SfxItemPool &rPool, SfxItemPool( const SfxItemPool &rPool,
sal_Bool bCloneStaticDefaults = sal_False ); sal_Bool bCloneStaticDefaults = sal_False );
SfxItemPool( const UniString &rName, SfxItemPool( const rtl::OUString &rName,
sal_uInt16 nStart, sal_uInt16 nEnd, sal_uInt16 nStart, sal_uInt16 nEnd,
const SfxItemInfo *pItemInfos, const SfxItemInfo *pItemInfos,
SfxPoolItem **pDefaults = 0, SfxPoolItem **pDefaults = 0,
@@ -173,7 +173,7 @@ public:
const IntlWrapper * pIntlWrapper const IntlWrapper * pIntlWrapper
= 0 ) const; = 0 ) const;
virtual SfxItemPool* Clone() const; virtual SfxItemPool* Clone() const;
const UniString& GetName() const; const rtl::OUString& GetName() const;
virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 ); virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 );
virtual void Remove( const SfxPoolItem& ); virtual void Remove( const SfxPoolItem& );

View File

@@ -245,7 +245,7 @@ public:
@return True if the string was successfuly read and reconstructed. @return True if the string was successfuly read and reconstructed.
*/ */
static bool readByteString(SvStream & rStream, UniString & rString); static rtl::OUString readByteString(SvStream & rStream);
/** Write a byte string representation of a Unicode string into a stream. /** Write a byte string representation of a Unicode string into a stream.
@@ -255,7 +255,7 @@ public:
@param rString Some Unicode string. @param rString Some Unicode string.
*/ */
static void writeByteString(SvStream & rStream, static void writeByteString(SvStream & rStream,
UniString const & rString); const rtl::OUString& rString);
/** Read in a Unicode string from either a streamed Unicode or byte string /** Read in a Unicode string from either a streamed Unicode or byte string
representation. representation.
@@ -263,15 +263,12 @@ public:
@param rStream Some (input) stream. If bUnicode is false, its @param rStream Some (input) stream. If bUnicode is false, its
Stream/TargetCharSets must be set to correct values! Stream/TargetCharSets must be set to correct values!
@param rString On success, returns the reconstructed Unicode string.
@param bUnicode Whether to read in a stream Unicode (true) or byte @param bUnicode Whether to read in a stream Unicode (true) or byte
string (false) representation. string (false) representation.
@return True if the string was successfuly read and reconstructed. @return On success, returns the reconstructed Unicode string.
*/ */
static bool readUnicodeString(SvStream & rStream, UniString & rString, static rtl::OUString readUnicodeString(SvStream & rStream, bool bUnicode);
bool bUnicode);
/** Write a Unicode string representation of a Unicode string into a /** Write a Unicode string representation of a Unicode string into a
stream. stream.
@@ -281,7 +278,7 @@ public:
@param rString Some Unicode string. @param rString Some Unicode string.
*/ */
static void writeUnicodeString(SvStream & rStream, static void writeUnicodeString(SvStream & rStream,
UniString const & rString); const rtl::OUString& rString);
private: private:
SfxPoolItem& operator=( const SfxPoolItem& ); // n.i.!! SfxPoolItem& operator=( const SfxPoolItem& ); // n.i.!!

View File

@@ -43,7 +43,6 @@ namespace com { namespace sun { namespace star {
} } } } } }
namespace rtl { class OUString; } namespace rtl { class OUString; }
class CharClass; class CharClass;
class UniString;
//============================================================================ //============================================================================
namespace URIHelper { namespace URIHelper {
@@ -61,9 +60,9 @@ namespace URIHelper {
existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false existence (see URIHelper::GetMaybeFileHdl), or use bCheckFileExists = false
if you want to generate file URLs without checking for their existence. if you want to generate file URLs without checking for their existence.
*/ */
SVL_DLLPUBLIC UniString SVL_DLLPUBLIC rtl::OUString
SmartRel2Abs(INetURLObject const & rTheBaseURIRef, SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
UniString const & rTheRelURIRef, rtl::OUString const & rTheRelURIRef,
Link const & rMaybeFileHdl = Link(), Link const & rMaybeFileHdl = Link(),
bool bCheckFileExists = true, bool bCheckFileExists = true,
bool bIgnoreFragment = false, bool bIgnoreFragment = false,
@@ -133,8 +132,8 @@ SVL_DLLPUBLIC rtl::OUString simpleNormalizedMakeRelative(
rtl::OUString const & baseUriReference, rtl::OUString const & uriReference); rtl::OUString const & baseUriReference, rtl::OUString const & uriReference);
//============================================================================ //============================================================================
SVL_DLLPUBLIC UniString SVL_DLLPUBLIC rtl::OUString
FindFirstURLInText(UniString const & rText, FindFirstURLInText(rtl::OUString const & rText,
xub_StrLen & rBegin, xub_StrLen & rBegin,
xub_StrLen & rEnd, xub_StrLen & rEnd,
CharClass const & rCharClass, CharClass const & rCharClass,
@@ -170,8 +169,8 @@ FindFirstURLInText(UniString const & rText,
@return The input URI with any password component removed. @return The input URI with any password component removed.
*/ */
SVL_DLLPUBLIC UniString SVL_DLLPUBLIC rtl::OUString
removePassword(UniString const & rURI, removePassword(rtl::OUString const & rURI,
INetURLObject::EncodeMechanism eEncodeMechanism INetURLObject::EncodeMechanism eEncodeMechanism
= INetURLObject::WAS_ENCODED, = INetURLObject::WAS_ENCODED,
INetURLObject::DecodeMechanism eDecodeMechanism INetURLObject::DecodeMechanism eDecodeMechanism

View File

@@ -77,7 +77,7 @@ struct SfxItemPool_Impl
SfxBroadcaster aBC; SfxBroadcaster aBC;
std::vector<SfxPoolItemArray_Impl*> maPoolItems; std::vector<SfxPoolItemArray_Impl*> maPoolItems;
std::vector<SfxItemPoolUser*> maSfxItemPoolUsers; /// ObjectUser section std::vector<SfxItemPoolUser*> maSfxItemPoolUsers; /// ObjectUser section
UniString aName; rtl::OUString aName;
SfxPoolItem** ppPoolDefaults; SfxPoolItem** ppPoolDefaults;
SfxPoolItem** ppStaticDefaults; SfxPoolItem** ppStaticDefaults;
SfxItemPool* mpMaster; SfxItemPool* mpMaster;
@@ -98,7 +98,7 @@ struct SfxItemPool_Impl
bool bStreaming; // in Load() bzw. Store() bool bStreaming; // in Load() bzw. Store()
bool mbPersistentRefCounts; bool mbPersistentRefCounts;
SfxItemPool_Impl( SfxItemPool* pMaster, const UniString& rName, sal_uInt16 nStart, sal_uInt16 nEnd ) SfxItemPool_Impl( SfxItemPool* pMaster, const rtl::OUString& rName, sal_uInt16 nStart, sal_uInt16 nEnd )
: maPoolItems(nEnd - nStart + 1, static_cast<SfxPoolItemArray_Impl*>(NULL)) : maPoolItems(nEnd - nStart + 1, static_cast<SfxPoolItemArray_Impl*>(NULL))
, aName(rName) , aName(rName)
, ppPoolDefaults(new SfxPoolItem* [nEnd - nStart + 1]) , ppPoolDefaults(new SfxPoolItem* [nEnd - nStart + 1])

View File

@@ -54,7 +54,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn
{ {
// Okay, data were stored by CntWallpaperItem. // Okay, data were stored by CntWallpaperItem.
readUnicodeString(rStream, _aURL, nVersion >= 1); _aURL = readUnicodeString(rStream, nVersion >= 1);
// !!! Color stream operators do not work - they discard any // !!! Color stream operators do not work - they discard any
// transparency info !!! // transparency info !!!
_nColor.Read( rStream, sal_True ); _nColor.Read( rStream, sal_True );
@@ -76,7 +76,7 @@ CntWallpaperItem::CntWallpaperItem( sal_uInt16 which, SvStream& rStream, sal_uIn
} }
// Read SfxWallpaperItem's string member _aURL. // Read SfxWallpaperItem's string member _aURL.
readUnicodeString(rStream, _aURL, false); _aURL = readUnicodeString(rStream, false);
// "Read" SfxWallpaperItem's string member _aFilter. // "Read" SfxWallpaperItem's string member _aFilter.
read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream); read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStream);

View File

@@ -83,8 +83,7 @@ SfxPoolItem* CntContentTypeItem::Create( SvStream& rStream,
{ {
// CntContentTypeItem used to be derived from CntStringItem, so take that // CntContentTypeItem used to be derived from CntStringItem, so take that
// into account: // into account:
UniString aValue; rtl::OUString aValue = readUnicodeString(rStream, nItemVersion >= 1);
readUnicodeString(rStream, aValue, nItemVersion >= 1);
sal_uInt32 nMagic = 0; sal_uInt32 nMagic = 0;
rStream >> nMagic; rStream >> nMagic;
if (nMagic == CNTSTRINGITEM_STREAM_MAGIC) if (nMagic == CNTSTRINGITEM_STREAM_MAGIC)

View File

@@ -103,10 +103,10 @@ SfxBroadcaster& SfxItemPool::BC()
SfxItemPool::SfxItemPool SfxItemPool::SfxItemPool
( (
UniString const & rName, /* Name des Pools zur Idetifikation const rtl::OUString& rName, /* Name des Pools zur Idetifikation
im File-Format */ im File-Format */
sal_uInt16 nStartWhich, /* erste Which-Id des Pools */ sal_uInt16 nStartWhich, /* erste Which-Id des Pools */
sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */ sal_uInt16 nEndWhich, /* letzte Which-Id des Pools */
const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */ const SfxItemInfo* pInfos, /* SID-Map und Item-Flags */
SfxPoolItem** pDefaults, /* Pointer auf statische Defaults, SfxPoolItem** pDefaults, /* Pointer auf statische Defaults,
wird direkt vom Pool referenziert, wird direkt vom Pool referenziert,
@@ -452,7 +452,7 @@ void SfxItemPool::SetDefaultMetric( SfxMapUnit eNewMetric )
pImp->eDefMetric = eNewMetric; pImp->eDefMetric = eNewMetric;
} }
const UniString& SfxItemPool::GetName() const const rtl::OUString& SfxItemPool::GetName() const
{ {
return pImp->aName; return pImp->aName;
} }

View File

@@ -142,8 +142,8 @@ SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, sal_uInt16 nVersion )
sal_uInt16 nCurKey, eType = STARBASIC; sal_uInt16 nCurKey, eType = STARBASIC;
String aLibName, aMacName; String aLibName, aMacName;
rStrm >> nCurKey; rStrm >> nCurKey;
SfxPoolItem::readByteString(rStrm, aLibName); aLibName = SfxPoolItem::readByteString(rStrm);
SfxPoolItem::readByteString(rStrm, aMacName); aMacName = SfxPoolItem::readByteString(rStrm);
if( SVX_MACROTBL_VERSION40 <= nVersion ) if( SVX_MACROTBL_VERSION40 <= nVersion )
rStrm >> eType; rStrm >> eType;

View File

@@ -559,7 +559,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// Einzel-Header // Einzel-Header
int bOwnPool = sal_True; int bOwnPool = sal_True;
UniString aExternName; rtl::OUString aExternName;
{ {
// Header-Record suchen // Header-Record suchen
SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER ); SfxMiniRecordReader aPoolHeaderRec( &rStream, SFX_ITEMPOOL_REC_HEADER );
@@ -571,7 +571,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// Header-lesen // Header-lesen
rStream >> pImp->nLoadingVersion; rStream >> pImp->nLoadingVersion;
SfxPoolItem::readByteString(rStream, aExternName); aExternName = SfxPoolItem::readByteString(rStream);
bOwnPool = aExternName == pImp->aName; bOwnPool = aExternName == pImp->aName;
//! solange wir keine fremden Pools laden k"onnen //! solange wir keine fremden Pools laden k"onnen
@@ -714,7 +714,7 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
// wenn nicht own-Pool, dann kein Name // wenn nicht own-Pool, dann kein Name
if ( aExternName != pImp->aName ) if ( aExternName != pImp->aName )
pImp->aName.Erase(); pImp->aName = rtl::OUString();
pImp->bStreaming = sal_False; pImp->bStreaming = sal_False;
return rStream; return rStream;
@@ -743,10 +743,10 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
} }
sal_uInt32 nAttribSize(0); sal_uInt32 nAttribSize(0);
int bOwnPool = sal_True; int bOwnPool = sal_True;
UniString aExternName; rtl::OUString aExternName;
if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 ) if ( pImp->nMajorVer > 1 || pImp->nMinorVer >= 2 )
rStream >> pImp->nLoadingVersion; rStream >> pImp->nLoadingVersion;
SfxPoolItem::readByteString(rStream, aExternName); aExternName = SfxPoolItem::readByteString(rStream);
bOwnPool = aExternName == pImp->aName; bOwnPool = aExternName == pImp->aName;
pImp->bStreaming = sal_True; pImp->bStreaming = sal_True;
@@ -1020,7 +1020,7 @@ SvStream &SfxItemPool::Load1_Impl(SvStream &rStream)
} }
if ( aExternName != pImp->aName ) if ( aExternName != pImp->aName )
pImp->aName.Erase(); pImp->aName = rtl::OUString();
pImp->bStreaming = sal_False; pImp->bStreaming = sal_False;
return rStream; return rStream;
@@ -1092,7 +1092,7 @@ const SfxPoolItem* SfxItemPool::LoadSurrogate
// auf jeden Fall aufgel"ost werden. // auf jeden Fall aufgel"ost werden.
if ( !pRefPool ) if ( !pRefPool )
pRefPool = this; pRefPool = this;
bool bResolvable = pRefPool->GetName().Len() > 0; bool bResolvable = !pRefPool->GetName().isEmpty();
if ( !bResolvable ) if ( !bResolvable )
{ {
// Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId // Bei einem anders aufgebauten Pool im Stream, mu\s die SlotId

View File

@@ -185,34 +185,29 @@ SvStream& SfxPoolItem::Store(SvStream &rStream, sal_uInt16 ) const
//============================================================================ //============================================================================
// static // static
bool SfxPoolItem::readByteString(SvStream & rStream, UniString & rString) rtl::OUString SfxPoolItem::readByteString(SvStream& rStream)
{ {
rString = rStream.ReadUniOrByteString(rStream.GetStreamCharSet()); return rStream.ReadUniOrByteString(rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
} }
//============================================================================ //============================================================================
// static // static
void SfxPoolItem::writeByteString(SvStream & rStream, void SfxPoolItem::writeByteString(SvStream & rStream, const rtl::OUString& rString)
UniString const & rString)
{ {
rStream.WriteUniOrByteString(rString, rStream.GetStreamCharSet()); rStream.WriteUniOrByteString(rString, rStream.GetStreamCharSet());
} }
//============================================================================ //============================================================================
// static // static
bool SfxPoolItem::readUnicodeString(SvStream & rStream, UniString & rString, rtl::OUString SfxPoolItem::readUnicodeString(SvStream & rStream, bool bUnicode)
bool bUnicode)
{ {
rString = rStream.ReadUniOrByteString(bUnicode ? RTL_TEXTENCODING_UCS2 : return rStream.ReadUniOrByteString(bUnicode ? RTL_TEXTENCODING_UCS2 :
rStream.GetStreamCharSet()); rStream.GetStreamCharSet());
return rStream.GetError() == ERRCODE_NONE;
} }
//============================================================================ //============================================================================
// static // static
void SfxPoolItem::writeUnicodeString(SvStream & rStream, void SfxPoolItem::writeUnicodeString(SvStream & rStream, const rtl::OUString& rString)
UniString const & rString)
{ {
rStream.WriteUniOrByteString(rString, RTL_TEXTENCODING_UCS2); rStream.WriteUniOrByteString(rString, RTL_TEXTENCODING_UCS2);
} }

View File

@@ -77,8 +77,8 @@ SfxPoolItem * SfxFontItem::Create(SvStream & rStream, sal_uInt16) const
SfxFontItem * pItem = new SfxFontItem(Which()); SfxFontItem * pItem = new SfxFontItem(Which());
{ {
VersionCompat aFontCompat(rStream, STREAM_READ); VersionCompat aFontCompat(rStream, STREAM_READ);
readByteString(rStream, pItem->m_aName); pItem->m_aName = readByteString(rStream);
readByteString(rStream, pItem->m_aStyleName); pItem->m_aStyleName = readByteString(rStream);
rStream >> pItem->m_aSize; rStream >> pItem->m_aSize;
sal_Int16 nCharSet = 0; sal_Int16 nCharSet = 0;
rStream >> nCharSet; rStream >> nCharSet;

View File

@@ -102,7 +102,7 @@ SfxStringListItem::SfxStringListItem( sal_uInt16 which, SvStream& rStream ) :
String aStr; String aStr;
for( i=0; i < nEntryCount; i++ ) for( i=0; i < nEntryCount; i++ )
{ {
readByteString(rStream, aStr); aStr = readByteString(rStream);
pImp->aList.push_back(aStr); pImp->aList.push_back(aStr);
} }
} }

View File

@@ -41,8 +41,7 @@ TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem)
SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream): SfxStringItem::SfxStringItem(sal_uInt16 which, SvStream & rStream):
CntUnencodedStringItem(which) CntUnencodedStringItem(which)
{ {
UniString aValue; UniString aValue = readByteString(rStream);
readByteString(rStream, aValue);
SetValue(aValue); SetValue(aValue);
} }

View File

@@ -71,9 +71,9 @@ using namespace com::sun::star;
// //
//============================================================================ //============================================================================
UniString rtl::OUString
URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef, URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
UniString const & rTheRelURIRef, rtl::OUString const & rTheRelURIRef,
Link const & rMaybeFileHdl, Link const & rMaybeFileHdl,
bool bCheckFileExists, bool bCheckFileExists,
bool bIgnoreFragment, bool bIgnoreFragment,
@@ -84,7 +84,7 @@ URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
INetURLObject::FSysStyle eStyle) INetURLObject::FSysStyle eStyle)
{ {
// Backwards compatibility: // Backwards compatibility:
if (rTheRelURIRef.Len() != 0 && rTheRelURIRef.GetChar(0) == '#') if (!rTheRelURIRef.isEmpty() && rTheRelURIRef[0] == '#')
return rTheRelURIRef; return rTheRelURIRef;
INetURLObject aAbsURIRef; INetURLObject aAbsURIRef;
@@ -508,8 +508,8 @@ sal_uInt32 scanDomain(UniString const & rStr, xub_StrLen * pPos,
} }
UniString rtl::OUString
URIHelper::FindFirstURLInText(UniString const & rText, URIHelper::FindFirstURLInText(rtl::OUString const & rText,
xub_StrLen & rBegin, xub_StrLen & rBegin,
xub_StrLen & rEnd, xub_StrLen & rEnd,
CharClass const & rCharClass, CharClass const & rCharClass,
@@ -517,8 +517,8 @@ URIHelper::FindFirstURLInText(UniString const & rText,
rtl_TextEncoding eCharset, rtl_TextEncoding eCharset,
INetURLObject::FSysStyle eStyle) INetURLObject::FSysStyle eStyle)
{ {
if (!(rBegin <= rEnd && rEnd <= rText.Len())) if (!(rBegin <= rEnd && rEnd <= rText.getLength()))
return UniString(); return rtl::OUString();
// Search for the first substring of [rBegin..rEnd[ that matches any of the // Search for the first substring of [rBegin..rEnd[ that matches any of the
// following productions (for which the appropriate style bit is set in // following productions (for which the appropriate style bit is set in
@@ -588,7 +588,7 @@ URIHelper::FindFirstURLInText(UniString const & rText,
bool bBoundary2 = true; bool bBoundary2 = true;
for (xub_StrLen nPos = rBegin; nPos != rEnd; nPos = nextChar(rText, nPos)) for (xub_StrLen nPos = rBegin; nPos != rEnd; nPos = nextChar(rText, nPos))
{ {
sal_Unicode c = rText.GetChar(nPos); sal_Unicode c = rText[nPos];
if (bBoundary1) if (bBoundary1)
{ {
if (INetMIME::isAlpha(c)) if (INetMIME::isAlpha(c))
@@ -599,13 +599,13 @@ URIHelper::FindFirstURLInText(UniString const & rText,
rEnd)); rEnd));
if (eScheme == INET_PROT_FILE) // 2nd if (eScheme == INET_PROT_FILE) // 2nd
{ {
while (rText.GetChar(i++) != ':') ; while (rText[i++] != ':') ;
xub_StrLen nPrefixEnd = i; xub_StrLen nPrefixEnd = i;
xub_StrLen nUriEnd = i; xub_StrLen nUriEnd = i;
while (i != rEnd while (i != rEnd
&& checkWChar(rCharClass, rText, &i, &nUriEnd, true, && checkWChar(rCharClass, rText, &i, &nUriEnd, true,
true)) ; true)) ;
if (i != nPrefixEnd && rText.GetChar(i) == '#') if (i != nPrefixEnd && rText[i] == '#')
{ {
++i; ++i;
while (i != rEnd while (i != rEnd
@@ -629,12 +629,12 @@ URIHelper::FindFirstURLInText(UniString const & rText,
} }
else if (eScheme != INET_PROT_NOT_VALID) // 1st else if (eScheme != INET_PROT_NOT_VALID) // 1st
{ {
while (rText.GetChar(i++) != ':') ; while (rText[i++] != ':') ;
xub_StrLen nPrefixEnd = i; xub_StrLen nPrefixEnd = i;
xub_StrLen nUriEnd = i; xub_StrLen nUriEnd = i;
while (i != rEnd while (i != rEnd
&& checkWChar(rCharClass, rText, &i, &nUriEnd)) ; && checkWChar(rCharClass, rText, &i, &nUriEnd)) ;
if (i != nPrefixEnd && rText.GetChar(i) == '#') if (i != nPrefixEnd && rText[i] == '#')
{ {
++i; ++i;
while (i != rEnd while (i != rEnd
@@ -642,7 +642,7 @@ URIHelper::FindFirstURLInText(UniString const & rText,
} }
if (nUriEnd != nPrefixEnd if (nUriEnd != nPrefixEnd
&& (isBoundary1(rCharClass, rText, nUriEnd, rEnd) && (isBoundary1(rCharClass, rText, nUriEnd, rEnd)
|| rText.GetChar(nUriEnd) == '\\')) || rText[nUriEnd] == '\\'))
{ {
INetURLObject aUri(UniString(rText, nPos, INetURLObject aUri(UniString(rText, nPos,
nUriEnd - nPos), nUriEnd - nPos),
@@ -662,37 +662,37 @@ URIHelper::FindFirstURLInText(UniString const & rText,
i = nPos; i = nPos;
sal_uInt32 nLabels = scanDomain(rText, &i, rEnd); sal_uInt32 nLabels = scanDomain(rText, &i, rEnd);
if (nLabels >= 3 if (nLabels >= 3
&& rText.GetChar(nPos + 3) == '.' && rText[nPos + 3] == '.'
&& (((rText.GetChar(nPos) == 'w' && (((rText[nPos] == 'w'
|| rText.GetChar(nPos) == 'W') || rText[nPos] == 'W')
&& (rText.GetChar(nPos + 1) == 'w' && (rText[nPos + 1] == 'w'
|| rText.GetChar(nPos + 1) == 'W') || rText[nPos + 1] == 'W')
&& (rText.GetChar(nPos + 2) == 'w' && (rText[nPos + 2] == 'w'
|| rText.GetChar(nPos + 2) == 'W')) || rText[nPos + 2] == 'W'))
|| ((rText.GetChar(nPos) == 'f' || ((rText[nPos] == 'f'
|| rText.GetChar(nPos) == 'F') || rText[nPos] == 'F')
&& (rText.GetChar(nPos + 1) == 't' && (rText[nPos + 1] == 't'
|| rText.GetChar(nPos + 1) == 'T') || rText[nPos + 1] == 'T')
&& (rText.GetChar(nPos + 2) == 'p' && (rText[nPos + 2] == 'p'
|| rText.GetChar(nPos + 2) == 'P')))) || rText[nPos + 2] == 'P'))))
// (note that rText.GetChar(nPos + 3) is guaranteed to be // (note that rText.GetChar(nPos + 3) is guaranteed to be
// valid) // valid)
{ {
xub_StrLen nUriEnd = i; xub_StrLen nUriEnd = i;
if (i != rEnd && rText.GetChar(i) == '/') if (i != rEnd && rText[i] == '/')
{ {
nUriEnd = ++i; nUriEnd = ++i;
while (i != rEnd while (i != rEnd
&& checkWChar(rCharClass, rText, &i, &nUriEnd)) ; && checkWChar(rCharClass, rText, &i, &nUriEnd)) ;
} }
if (i != rEnd && rText.GetChar(i) == '#') if (i != rEnd && rText[i] == '#')
{ {
++i; ++i;
while (i != rEnd while (i != rEnd
&& checkWChar(rCharClass, rText, &i, &nUriEnd)) ; && checkWChar(rCharClass, rText, &i, &nUriEnd)) ;
} }
if (isBoundary1(rCharClass, rText, nUriEnd, rEnd) if (isBoundary1(rCharClass, rText, nUriEnd, rEnd)
|| rText.GetChar(nUriEnd) == '\\') || rText[nUriEnd] == '\\')
{ {
INetURLObject aUri(UniString(rText, nPos, INetURLObject aUri(UniString(rText, nPos,
nUriEnd - nPos), nUriEnd - nPos),
@@ -709,9 +709,9 @@ URIHelper::FindFirstURLInText(UniString const & rText,
} }
if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 3 if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 3
&& rText.GetChar(nPos + 1) == ':' && rText[nPos + 1] == ':'
&& (rText.GetChar(nPos + 2) == '/' && (rText[nPos + 2] == '/'
|| rText.GetChar(nPos + 2) == '\\')) // 7th, 8th || rText[nPos + 2] == '\\')) // 7th, 8th
{ {
i = nPos + 3; i = nPos + 3;
xub_StrLen nUriEnd = i; xub_StrLen nUriEnd = i;
@@ -736,12 +736,12 @@ URIHelper::FindFirstURLInText(UniString const & rText,
} }
} }
else if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 2 else if ((eStyle & INetURLObject::FSYS_DOS) != 0 && rEnd - nPos >= 2
&& rText.GetChar(nPos) == '\\' && rText[nPos] == '\\'
&& rText.GetChar(nPos + 1) == '\\') // 6th && rText[nPos + 1] == '\\') // 6th
{ {
xub_StrLen i = nPos + 2; xub_StrLen i = nPos + 2;
sal_uInt32 nLabels = scanDomain(rText, &i, rEnd); sal_uInt32 nLabels = scanDomain(rText, &i, rEnd);
if (nLabels >= 1 && i != rEnd && rText.GetChar(i) == '\\') if (nLabels >= 1 && i != rEnd && rText[i] == '\\')
{ {
xub_StrLen nUriEnd = ++i; xub_StrLen nUriEnd = ++i;
while (i != rEnd while (i != rEnd
@@ -771,7 +771,7 @@ URIHelper::FindFirstURLInText(UniString const & rText,
bool bDot = false; bool bDot = false;
for (xub_StrLen i = nPos + 1; i != rEnd; ++i) for (xub_StrLen i = nPos + 1; i != rEnd; ++i)
{ {
sal_Unicode c2 = rText.GetChar(i); sal_Unicode c2 = rText[i];
if (INetMIME::isAtomChar(c2)) if (INetMIME::isAtomChar(c2))
bDot = false; bDot = false;
else if (bDot) else if (bDot)
@@ -807,7 +807,7 @@ URIHelper::FindFirstURLInText(UniString const & rText,
bBoundary2 = isBoundary2(rCharClass, rText, nPos, rEnd); bBoundary2 = isBoundary2(rCharClass, rText, nPos, rEnd);
} }
rBegin = rEnd; rBegin = rEnd;
return UniString(); return rtl::OUString();
} }
//============================================================================ //============================================================================
@@ -816,8 +816,8 @@ URIHelper::FindFirstURLInText(UniString const & rText,
// //
//============================================================================ //============================================================================
UniString rtl::OUString
URIHelper::removePassword(UniString const & rURI, URIHelper::removePassword(rtl::OUString const & rURI,
INetURLObject::EncodeMechanism eEncodeMechanism, INetURLObject::EncodeMechanism eEncodeMechanism,
INetURLObject::DecodeMechanism eDecodeMechanism, INetURLObject::DecodeMechanism eDecodeMechanism,
rtl_TextEncoding eCharset) rtl_TextEncoding eCharset)
@@ -825,7 +825,7 @@ URIHelper::removePassword(UniString const & rURI,
INetURLObject aObj(rURI, eEncodeMechanism, eCharset); INetURLObject aObj(rURI, eEncodeMechanism, eCharset);
return aObj.HasError() ? return aObj.HasError() ?
rURI : rURI :
String(aObj.GetURLNoPass(eDecodeMechanism, eCharset)); aObj.GetURLNoPass(eDecodeMechanism, eCharset);
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -43,8 +43,7 @@ struct SVX_DLLPUBLIC DialogsResMgr
#define DIALOG_MGR() (*DialogsResMgr::GetResMgr()) #define DIALOG_MGR() (*DialogsResMgr::GetResMgr())
#define SVX_RES(i) ResId(i,DIALOG_MGR()) #define SVX_RES(i) ResId(i,DIALOG_MGR())
#define SVX_RESSTR(i) UniString(ResId(i,DIALOG_MGR())) #define SVX_RESSTR(i) ResId::toString(ResId(i,DIALOG_MGR()))
#define SVX_RESSSTR(i) String(ResId(i,DIALOG_MGR()))
#endif #endif

View File

@@ -5503,7 +5503,7 @@ static LRESULT ImplHandleIMEReconvertString( HWND hWnd, LPARAM lParam )
LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam; LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam;
LRESULT nRet = 0; LRESULT nRet = 0;
SalSurroundingTextRequestEvent aEvt; SalSurroundingTextRequestEvent aEvt;
aEvt.maText = UniString(); aEvt.maText = rtl::OUString();
aEvt.mnStart = aEvt.mnEnd = 0; aEvt.mnStart = aEvt.mnEnd = 0;
UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_SETCOMPSTR ); UINT nImeProps = ImmGetProperty( GetKeyboardLayout( 0 ), IGP_SETCOMPSTR );
@@ -5557,7 +5557,7 @@ static LRESULT ImplHandleIMEConfirmReconvertString( HWND hWnd, LPARAM lParam )
WinSalFrame* pFrame = GetWindowPtr( hWnd ); WinSalFrame* pFrame = GetWindowPtr( hWnd );
LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam; LPRECONVERTSTRING pReconvertString = (LPRECONVERTSTRING) lParam;
SalSurroundingTextRequestEvent aEvt; SalSurroundingTextRequestEvent aEvt;
aEvt.maText = UniString(); aEvt.maText = rtl::OUString();
aEvt.mnStart = aEvt.mnEnd = 0; aEvt.mnStart = aEvt.mnEnd = 0;
pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt ); pFrame->CallCallback( SALEVENT_SURROUNDINGTEXTREQUEST, (void*)&aEvt );