[PATCH] String=>OUString svtools imap
Norbert Thiebaud (via Code Review)
gerrit at gerrit.libreoffice.org
Thu Jun 13 06:19:59 PDT 2013
Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/4258
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/58/4258/1
String=>OUString svtools imap
Change-Id: I56a91943080e290eabbc23575e27aab65e5d269e
---
M include/svtools/imap.hxx
M include/svtools/imapcirc.hxx
M include/svtools/imapobj.hxx
M include/svtools/imappoly.hxx
M include/svtools/imaprect.hxx
M sc/source/ui/drawfunc/fusel.cxx
M sd/source/ui/func/fusel.cxx
M svtools/source/misc/imap.cxx
M svtools/source/misc/imap2.cxx
M svtools/source/uno/unoiface.cxx
M svtools/source/uno/unoimap.cxx
M sw/source/core/frmedt/fefly1.cxx
12 files changed, 166 insertions(+), 169 deletions(-)
diff --git a/include/svtools/imap.hxx b/include/svtools/imap.hxx
index 790cdeb..5f5b2e9 100644
--- a/include/svtools/imap.hxx
+++ b/include/svtools/imap.hxx
@@ -21,7 +21,6 @@
#define _IMAP_HXX
#include "svtools/svtdllapi.h"
-#include <tools/string.hxx>
#include <tools/stream.hxx>
#include <vector>
@@ -38,27 +37,27 @@
private:
IMapObjectList_impl maList;
- String aName;
+ OUString aName;
protected:
// Binaer laden/speichern
- void ImpWriteImageMap( SvStream& rOStm, const String& ) const ;
- void ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& );
+ void ImpWriteImageMap( SvStream& rOStm, const OUString& ) const ;
+ void ImpReadImageMap( SvStream& rIStm, size_t nCount, const OUString& );
// Im-/Export
- void ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
- void ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
- sal_uLong ImpReadCERN( SvStream& rOStm, const String& rBaseURL );
- sal_uLong ImpReadNCSA( SvStream& rOStm, const String& rBaseURL );
+ void ImpWriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const;
+ void ImpWriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const;
+ sal_uLong ImpReadCERN( SvStream& rOStm, const OUString& rBaseURL );
+ sal_uLong ImpReadNCSA( SvStream& rOStm, const OUString& rBaseURL );
- void ImpReadCERNLine( const OString& rLine, const String& rBaseURL );
+ void ImpReadCERNLine( const OString& rLine, const OUString& rBaseURL );
Point ImpReadCERNCoords( const char** ppStr );
long ImpReadCERNRadius( const char** ppStr );
- String ImpReadCERNURL( const char** ppStr, const String& rBaseURL );
+ OUString ImpReadCERNURL( const char** ppStr, const OUString& rBaseURL );
- void ImpReadNCSALine( const OString& rLine, const String& rBaseURL );
- String ImpReadNCSAURL( const char** ppStr, const String& rBaseURL );
+ void ImpReadNCSALine( const OString& rLine, const OUString& rBaseURL );
+ OUString ImpReadNCSAURL( const char** ppStr, const OUString& rBaseURL );
Point ImpReadNCSACoords( const char** ppStr );
sal_uLong ImpDetectFormat( SvStream& rIStm );
@@ -68,7 +67,7 @@
TYPEINFO();
ImageMap() {};
- ImageMap( const String& rName );
+ ImageMap( const OUString& rName );
ImageMap( const ImageMap& rImageMap );
// Der Dtor gibt den intern belegten
@@ -114,18 +113,18 @@
sal_uInt16 GetVersion() const;
// liefert / setzt den Namen der ImageMap
- const String& GetName() const { return aName; }
- void SetName( const String& rName ) { aName = rName; }
+ const OUString& GetName() const { return aName; }
+ void SetName( const OUString& rName ) { aName = rName; }
// skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
void Scale( const Fraction& rFractX, const Fraction& rFracY );
// Im-/Export
- void Write ( SvStream& rOStm, const String& rBaseURL ) const;
- void Read( SvStream& rIStm, const String& rBaseURL );
+ void Write ( SvStream& rOStm, const OUString& rBaseURL ) const;
+ void Read( SvStream& rIStm, const OUString& rBaseURL );
- void Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const;
- sal_uLong Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL );
+ void Write( SvStream& rOStm, sal_uLong nFormat, const OUString& rBaseURL ) const;
+ sal_uLong Read( SvStream& rIStm, sal_uLong nFormat, const OUString& rBaseURL );
};
class IMapCompat
diff --git a/include/svtools/imapcirc.hxx b/include/svtools/imapcirc.hxx
index 057561a..9ba93d4 100644
--- a/include/svtools/imapcirc.hxx
+++ b/include/svtools/imapcirc.hxx
@@ -42,11 +42,11 @@
IMapCircleObject() {};
IMapCircleObject( const Point& rCenter, sal_uLong nRad,
- const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bActive = sal_True,
sal_Bool bPixelCoords = sal_True );
virtual ~IMapCircleObject() {};
@@ -66,8 +66,8 @@
sal_Bool IsEqual( const IMapCircleObject& rEqObj );
// Im-/Export
- void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
- void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const;
};
#endif
diff --git a/include/svtools/imapobj.hxx b/include/svtools/imapobj.hxx
index e90902b..df79d9b 100644
--- a/include/svtools/imapobj.hxx
+++ b/include/svtools/imapobj.hxx
@@ -54,16 +54,16 @@
{
friend class ImageMap;
- String aURL;
- String aAltText;
- String aDesc;
- String aTarget;
- String aName;
+ OUString aURL;
+ OUString aAltText;
+ OUString aDesc;
+ OUString aTarget;
+ OUString aName;
SvxMacroTableDtor aEventList;
sal_Bool bActive;
protected:
- sal_uInt16 nReadVersion;
+ sal_uInt16 nReadVersion;
// Binaer-Im-/Export
virtual void WriteIMapObject( SvStream& rOStm ) const = 0;
@@ -71,20 +71,20 @@
// Hilfsmethoden
void AppendCERNCoords(OStringBuffer& rBuf, const Point& rPoint100) const;
- void AppendCERNURL(OStringBuffer& rBuf, const String& rBaseURL) const;
+ void AppendCERNURL(OStringBuffer& rBuf, const OUString& rBaseURL) const;
void AppendNCSACoords(OStringBuffer& rBuf, const Point& rPoint100) const;
- void AppendNCSAURL(OStringBuffer&rBuf, const String& rBaseURL) const;
+ void AppendNCSAURL(OStringBuffer&rBuf, const OUString& rBaseURL) const;
public:
static rtl_TextEncoding nActualTextEncoding;
IMapObject();
- IMapObject( const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ IMapObject( const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bActive );
virtual ~IMapObject() {};
@@ -92,25 +92,25 @@
virtual sal_uInt16 GetType() const = 0;
virtual sal_Bool IsHit( const Point& rPoint ) const = 0;
- void Write ( SvStream& rOStm, const String& rBaseURL ) const;
- void Read( SvStream& rIStm, const String& rBaseURL );
+ void Write ( SvStream& rOStm, const OUString& rBaseURL ) const;
+ void Read( SvStream& rIStm, const OUString& rBaseURL );
virtual Rectangle GetBoundRect() const = 0;
- const String& GetURL() const { return aURL; }
- void SetURL( const String& rURL ) { aURL = rURL; }
+ const OUString& GetURL() const { return aURL; }
+ void SetURL( const OUString& rURL ) { aURL = rURL; }
- const String& GetAltText() const { return aAltText; }
- void SetAltText( const String& rAltText) { aAltText = rAltText; }
+ const OUString& GetAltText() const { return aAltText; }
+ void SetAltText( const OUString& rAltText) { aAltText = rAltText; }
- const String& GetDesc() const { return aDesc; }
- void SetDesc( const String& rDesc ) { aDesc = rDesc; }
+ const OUString& GetDesc() const { return aDesc; }
+ void SetDesc( const OUString& rDesc ) { aDesc = rDesc; }
- const String& GetTarget() const { return aTarget; }
- void SetTarget( const String& rTarget ) { aTarget = rTarget; }
+ const OUString& GetTarget() const { return aTarget; }
+ void SetTarget( const OUString& rTarget ) { aTarget = rTarget; }
- const String& GetName() const { return aName; }
- void SetName( const String& rName ) { aName = rName; }
+ const OUString& GetName() const { return aName; }
+ void SetName( const OUString& rName ) { aName = rName; }
sal_Bool IsActive() const { return bActive; }
void SetActive( sal_Bool bSetActive = sal_True ) { bActive = bSetActive; }
diff --git a/include/svtools/imappoly.hxx b/include/svtools/imappoly.hxx
index b4a0eaf..887521e 100644
--- a/include/svtools/imappoly.hxx
+++ b/include/svtools/imappoly.hxx
@@ -40,16 +40,16 @@
virtual void WriteIMapObject( SvStream& rOStm ) const;
virtual void ReadIMapObject( SvStream& rIStm );
- sal_Bool ReadPreProLine( SvStream& rIStm, String& rStr );
+ sal_Bool ReadPreProLine( SvStream& rIStm, OUString& rStr );
public:
IMapPolygonObject() {};
IMapPolygonObject( const Polygon& rPoly,
- const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bActive = sal_True,
sal_Bool bPixelCoords = sal_True );
virtual ~IMapPolygonObject() {};
@@ -72,8 +72,8 @@
sal_Bool IsEqual( const IMapPolygonObject& rEqObj );
// Im-/Export
- void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
- void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const;
};
#endif
diff --git a/include/svtools/imaprect.hxx b/include/svtools/imaprect.hxx
index b7d6ab5..d2a257c 100644
--- a/include/svtools/imaprect.hxx
+++ b/include/svtools/imaprect.hxx
@@ -41,11 +41,11 @@
IMapRectangleObject() {};
IMapRectangleObject( const Rectangle& rRect,
- const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bActive = sal_True,
sal_Bool bPixelCoords = sal_True );
virtual ~IMapRectangleObject() {};
@@ -64,8 +64,8 @@
sal_Bool IsEqual( const IMapRectangleObject& rEqObj );
// Im-/Export
- void WriteCERN( SvStream& rOStm, const String& rBaseURL ) const;
- void WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const;
+ void WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const;
+ void WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const;
};
#endif
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index e226571..c8b61d6 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -239,7 +239,7 @@
{
const IMapObject* pIMapObj =
ScDrawLayer::GetHitIMapObject( aVEvt.pObj, aMDPos, *pWindow );
- if ( pIMapObj && pIMapObj->GetURL().Len() )
+ if ( pIMapObj && !pIMapObj->GetURL().isEmpty() )
{
sURL = pIMapObj->GetURL();
sTarget = pIMapObj->GetTarget();
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index 263569a..fb7fcbb 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -1158,7 +1158,7 @@
{
const IMapObject* pIMapObj = mpDoc->GetHitIMapObject( pObj, rPos, *mpWindow );
- if ( pIMapObj && pIMapObj->GetURL().Len() )
+ if ( pIMapObj && !pIMapObj->GetURL().isEmpty() )
{
// Jump to Document
mpWindow->ReleaseMouse();
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index 597d90a..46f7de3 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -53,8 +53,8 @@
{
}
-IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc,
- const String& rTarget, const String& rName, sal_Bool bURLActive )
+IMapObject::IMapObject( const OUString& rURL, const OUString& rAltText, const OUString& rDesc,
+ const OUString& rTarget, const OUString& rName, sal_Bool bURLActive )
: aURL( rURL )
, aAltText( rAltText )
, aDesc( rDesc )
@@ -77,7 +77,7 @@
return IMAP_OBJ_VERSION;
}
-void IMapObject::Write( SvStream& rOStm, const String& rBaseURL ) const
+void IMapObject::Write( SvStream& rOStm, const OUString& rBaseURL ) const
{
IMapCompat* pCompat;
const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding();
@@ -109,7 +109,7 @@
|*
\******************************************************************************/
-void IMapObject::Read( SvStream& rIStm, const String& rBaseURL )
+void IMapObject::Read( SvStream& rIStm, const OUString& rBaseURL )
{
IMapCompat* pCompat;
rtl_TextEncoding nTextEncoding;
@@ -153,11 +153,11 @@
}
IMapRectangleObject::IMapRectangleObject( const Rectangle& rRect,
- const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bURLActive,
sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive )
@@ -253,11 +253,11 @@
}
IMapCircleObject::IMapCircleObject( const Point& rCenter, sal_uLong nCircleRadius,
- const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bURLActive,
sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive )
@@ -401,11 +401,11 @@
}
IMapPolygonObject::IMapPolygonObject( const Polygon& rPoly,
- const String& rURL,
- const String& rAltText,
- const String& rDesc,
- const String& rTarget,
- const String& rName,
+ const OUString& rURL,
+ const OUString& rAltText,
+ const OUString& rDesc,
+ const OUString& rTarget,
+ const OUString& rName,
sal_Bool bURLActive,
sal_Bool bPixelCoords ) :
IMapObject ( rURL, rAltText, rDesc, rTarget, rName, bURLActive ),
@@ -567,7 +567,7 @@
|*
\******************************************************************************/
-ImageMap::ImageMap( const String& rName )
+ImageMap::ImageMap( const OUString& rName )
: aName( rName )
{
}
@@ -638,7 +638,7 @@
delete maList[ i ];
maList.clear();
- aName = String();
+ aName = OUString();
}
@@ -869,7 +869,7 @@
|*
\******************************************************************************/
-void ImageMap::ImpWriteImageMap( SvStream& rOStm, const String& rBaseURL ) const
+void ImageMap::ImpWriteImageMap( SvStream& rOStm, const OUString& rBaseURL ) const
{
IMapObject* pObj;
size_t nCount = maList.size();
@@ -888,7 +888,7 @@
|*
\******************************************************************************/
-void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount, const String& rBaseURL )
+void ImageMap::ImpReadImageMap( SvStream& rIStm, size_t nCount, const OUString& rBaseURL )
{
// neue Objekte einlesen
for ( size_t i = 0; i < nCount; i++ )
@@ -937,10 +937,10 @@
|*
\******************************************************************************/
-void ImageMap::Write( SvStream& rOStm, const String& rBaseURL ) const
+void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const
{
IMapCompat* pCompat;
- String aImageName( GetName() );
+ OUString aImageName( GetName() );
sal_uInt16 nOldFormat = rOStm.GetNumberFormatInt();
sal_uInt16 nCount = (sal_uInt16) GetIMapObjectCount();
const rtl_TextEncoding eEncoding = osl_getThreadTextEncoding(); //vomit!
@@ -973,7 +973,7 @@
|*
\******************************************************************************/
-void ImageMap::Read( SvStream& rIStm, const String& rBaseURL )
+void ImageMap::Read( SvStream& rIStm, const OUString& rBaseURL )
{
char cMagic[6];
sal_uInt16 nOldFormat = rIStm.GetNumberFormatInt();
diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx
index bec3886..0ff7c87 100644
--- a/svtools/source/misc/imap2.cxx
+++ b/svtools/source/misc/imap2.cxx
@@ -60,18 +60,18 @@
rBuf.append(' ');
}
-void IMapObject::AppendCERNURL(OStringBuffer& rBuf, const String& rBaseURL) const
+void IMapObject::AppendCERNURL(OStringBuffer& rBuf, const OUString& rBaseURL) const
{
rBuf.append(OUStringToOString(URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), osl_getThreadTextEncoding()));
}
-void IMapObject::AppendNCSAURL(OStringBuffer& rBuf, const String& rBaseURL) const
+void IMapObject::AppendNCSAURL(OStringBuffer& rBuf, const OUString& rBaseURL) const
{
rBuf.append(OUStringToOString(URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), osl_getThreadTextEncoding()));
rBuf.append(' ');
}
-void IMapRectangleObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
+void IMapRectangleObject::WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("rectangle "));
@@ -82,7 +82,7 @@
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void IMapRectangleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
+void IMapRectangleObject::WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("rect "));
@@ -93,7 +93,7 @@
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void IMapCircleObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
+void IMapCircleObject::WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("circle "));
@@ -105,7 +105,7 @@
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void IMapCircleObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
+void IMapCircleObject::WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("circle "));
@@ -116,7 +116,7 @@
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void IMapPolygonObject::WriteCERN( SvStream& rOStm, const String& rBaseURL ) const
+void IMapPolygonObject::WriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("polygon "));
const sal_uInt16 nCount = aPoly.GetSize();
@@ -129,7 +129,7 @@
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
+void IMapPolygonObject::WriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const
{
OStringBuffer aStrBuf(RTL_CONSTASCII_STRINGPARAM("poly "));
const sal_uInt16 nCount = std::min( aPoly.GetSize(), (sal_uInt16) 100 );
@@ -142,7 +142,7 @@
rOStm.WriteLine(aStrBuf.makeStringAndClear());
}
-void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const String& rBaseURL ) const
+void ImageMap::Write( SvStream& rOStm, sal_uLong nFormat, const OUString& rBaseURL ) const
{
switch( nFormat )
{
@@ -155,7 +155,7 @@
}
}
-void ImageMap::ImpWriteCERN( SvStream& rOStm, const String& rBaseURL ) const
+void ImageMap::ImpWriteCERN( SvStream& rOStm, const OUString& rBaseURL ) const
{
IMapObject* pObj;
size_t nCount = maList.size();
@@ -184,7 +184,7 @@
}
}
-void ImageMap::ImpWriteNCSA( SvStream& rOStm, const String& rBaseURL ) const
+void ImageMap::ImpWriteNCSA( SvStream& rOStm, const OUString& rBaseURL ) const
{
IMapObject* pObj;
size_t nCount = maList.size();
@@ -213,7 +213,7 @@
}
}
-sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const String& rBaseURL )
+sal_uLong ImageMap::Read( SvStream& rIStm, sal_uLong nFormat, const OUString& rBaseURL )
{
sal_uLong nRet = IMAP_ERR_FORMAT;
@@ -236,7 +236,7 @@
return nRet;
}
-sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const String& rBaseURL )
+sal_uLong ImageMap::ImpReadCERN( SvStream& rIStm, const OUString& rBaseURL )
{
// alten Inhalt loeschen
ClearImageMap();
@@ -248,7 +248,7 @@
return IMAP_ERR_OK;
}
-void ImageMap::ImpReadCERNLine( const OString& rLine, const String& rBaseURL )
+void ImageMap::ImpReadCERNLine( const OString& rLine, const OUString& rBaseURL )
{
OString aStr = comphelper::string::stripStart(rLine, ' ');
aStr = comphelper::string::stripStart(aStr, '\t');
@@ -273,19 +273,19 @@
{
const Point aTopLeft( ImpReadCERNCoords( &pStr ) );
const Point aBottomRight( ImpReadCERNCoords( &pStr ) );
- const String aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
const Rectangle aRect( aTopLeft, aBottomRight );
- IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, String(), String(), String(), String() );
+ IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( ( aToken == "circle" ) || ( aToken == "circ" ) )
{
const Point aCenter( ImpReadCERNCoords( &pStr ) );
const long nRadius = ImpReadCERNRadius( &pStr );
- const String aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadCERNURL( &pStr, rBaseURL ) );
- IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, String(), String(), String(), String() );
+ IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( ( aToken == "polygon" ) || ( aToken == "poly" ) )
@@ -293,14 +293,14 @@
const sal_uInt16 nCount = comphelper::string::getTokenCount(aStr,
'(') - 1;
Polygon aPoly( nCount );
- String aURL;
+ OUString aURL;
for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadCERNCoords( &pStr );
aURL = ImpReadCERNURL( &pStr, rBaseURL );
- IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() );
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
}
@@ -308,8 +308,8 @@
Point ImageMap::ImpReadCERNCoords( const char** ppStr )
{
- String aStrX;
- String aStrY;
+ OUStringBuffer aStrX;
+ OUStringBuffer aStrY;
Point aPt;
char cChar = *(*ppStr)++;
@@ -320,7 +320,7 @@
{
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrX += cChar;
+ aStrX.append(cChar);
cChar = *(*ppStr)++;
}
@@ -331,7 +331,7 @@
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrY += cChar;
+ aStrY.append(cChar);
cChar = *(*ppStr)++;
}
@@ -339,7 +339,7 @@
while( NOTEOL( cChar ) && ( cChar != ')' ) )
cChar = *(*ppStr)++;
- aPt = Point( aStrX.ToInt32(), aStrY.ToInt32() );
+ aPt = Point( aStrX.toString().toInt32(), aStrY.toString().toInt32() );
}
}
@@ -348,7 +348,7 @@
long ImageMap::ImpReadCERNRadius( const char** ppStr )
{
- String aStr;
+ OUStringBuffer aStr;
char cChar = *(*ppStr)++;
while( NOTEOL( cChar ) && ( ( cChar < '0' ) || ( cChar > '9' ) ) )
@@ -358,15 +358,15 @@
{
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStr += cChar;
+ aStr.append(cChar);
cChar = *(*ppStr)++;
}
}
- return aStr.ToInt32();
+ return aStr.toString().toInt32();
}
-String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL )
+OUString ImageMap::ImpReadCERNURL( const char** ppStr, const OUString& rBaseURL )
{
OUString aStr(OUString::createFromAscii(*ppStr));
@@ -378,7 +378,7 @@
return INetURLObject::GetAbsURL( rBaseURL, aStr );
}
-sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const String& rBaseURL )
+sal_uLong ImageMap::ImpReadNCSA( SvStream& rIStm, const OUString& rBaseURL )
{
// alten Inhalt loeschen
ClearImageMap();
@@ -390,7 +390,7 @@
return IMAP_ERR_OK;
}
-void ImageMap::ImpReadNCSALine( const OString& rLine, const String& rBaseURL )
+void ImageMap::ImpReadNCSALine( const OString& rLine, const OUString& rBaseURL )
{
OString aStr = comphelper::string::stripStart(rLine, ' ');
aStr = comphelper::string::stripStart(aStr, '\t');
@@ -413,44 +413,44 @@
{
if ( aToken == "rect" )
{
- const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
const Point aTopLeft( ImpReadNCSACoords( &pStr ) );
const Point aBottomRight( ImpReadNCSACoords( &pStr ) );
const Rectangle aRect( aTopLeft, aBottomRight );
- IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, String(), String(), String(), String() );
+ IMapRectangleObject* pObj = new IMapRectangleObject( aRect, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( aToken == "circle" )
{
- const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
const Point aCenter( ImpReadNCSACoords( &pStr ) );
const Point aDX( aCenter - ImpReadNCSACoords( &pStr ) );
long nRadius = (long) sqrt( (double) aDX.X() * aDX.X() +
(double) aDX.Y() * aDX.Y() );
- IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, String(), String(), String(), String() );
+ IMapCircleObject* pObj = new IMapCircleObject( aCenter, nRadius, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
else if ( aToken == "poly" )
{
const sal_uInt16 nCount = comphelper::string::getTokenCount(aStr,
',') - 1;
- const String aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
+ const OUString aURL( ImpReadNCSAURL( &pStr, rBaseURL ) );
Polygon aPoly( nCount );
for ( sal_uInt16 i = 0; i < nCount; i++ )
aPoly[ i ] = ImpReadNCSACoords( &pStr );
- IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, String(), String(), String(), String() );
+ IMapPolygonObject* pObj = new IMapPolygonObject( aPoly, aURL, OUString(), OUString(), OUString(), OUString() );
maList.push_back( pObj );
}
}
}
-String ImageMap::ImpReadNCSAURL( const char** ppStr, const String& rBaseURL )
+OUString ImageMap::ImpReadNCSAURL( const char** ppStr, const OUString& rBaseURL )
{
- String aStr;
+ OUStringBuffer aStr;
char cChar = *(*ppStr)++;
while( NOTEOL( cChar ) && ( ( cChar == ' ' ) || ( cChar == '\t' ) ) )
@@ -460,18 +460,18 @@
{
while( NOTEOL( cChar ) && ( cChar != ' ' ) && ( cChar != '\t' ) )
{
- aStr += cChar;
+ aStr.append(cChar);
cChar = *(*ppStr)++;
}
}
- return INetURLObject::GetAbsURL( rBaseURL, aStr );
+ return INetURLObject::GetAbsURL( rBaseURL, aStr.makeStringAndClear() );
}
Point ImageMap::ImpReadNCSACoords( const char** ppStr )
{
- String aStrX;
- String aStrY;
+ OUStringBuffer aStrX;
+ OUStringBuffer aStrY;
Point aPt;
char cChar = *(*ppStr)++;
@@ -482,7 +482,7 @@
{
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrX += cChar;
+ aStrX.append(cChar);
cChar = *(*ppStr)++;
}
@@ -493,11 +493,10 @@
while( NOTEOL( cChar ) && ( cChar >= '0' ) && ( cChar <= '9' ) )
{
- aStrY += cChar;
+ aStrY.append(cChar);
cChar = *(*ppStr)++;
}
-
- aPt = Point( aStrX.ToInt32(), aStrY.ToInt32() );
+ aPt = Point( aStrX.toString().toInt32(), aStrY.toString().toInt32() );
}
}
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index 658623f..6b0042b 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -62,8 +62,8 @@
SAL_DLLPUBLIC_EXPORT Window* CreateWindow( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor* pDescriptor, Window* pParent, WinBits nWinBits )
{
Window* pWindow = NULL;
- String aServiceName( pDescriptor->WindowServiceName );
- if ( aServiceName.EqualsIgnoreCaseAscii( "MultiLineEdit" ) )
+ OUString aServiceName( pDescriptor->WindowServiceName );
+ if ( aServiceName.equalsIgnoreAsciiCaseAscii( "MultiLineEdit" ) )
{
if ( pParent )
{
@@ -77,7 +77,7 @@
return NULL;
}
}
- else if ( aServiceName.EqualsIgnoreCaseAscii( "FileControl" ) )
+ else if ( aServiceName.equalsIgnoreAsciiCaseAscii( "FileControl" ) )
{
if ( pParent )
{
@@ -90,22 +90,22 @@
return NULL;
}
}
- else if (aServiceName.EqualsIgnoreCaseAscii("FormattedField") )
+ else if (aServiceName.equalsIgnoreAsciiCaseAscii("FormattedField") )
{
pWindow = new FormattedField( pParent, nWinBits );
*ppNewComp = new SVTXFormattedField;
}
- else if (aServiceName.EqualsIgnoreCaseAscii("NumericField") )
+ else if (aServiceName.equalsIgnoreAsciiCaseAscii("NumericField") )
{
pWindow = new DoubleNumericField( pParent, nWinBits );
*ppNewComp = new SVTXNumericField;
}
- else if (aServiceName.EqualsIgnoreCaseAscii("LongCurrencyField") )
+ else if (aServiceName.equalsIgnoreAsciiCaseAscii("LongCurrencyField") )
{
pWindow = new DoubleCurrencyField( pParent, nWinBits );
*ppNewComp = new SVTXCurrencyField;
}
- else if (aServiceName.EqualsIgnoreCaseAscii("datefield") )
+ else if (aServiceName.equalsIgnoreAsciiCaseAscii("datefield") )
{
pWindow = new CalendarField( pParent, nWinBits);
static_cast<CalendarField*>(pWindow)->EnableToday();
@@ -114,12 +114,12 @@
*ppNewComp = new SVTXDateField;
((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow );
}
- else if (aServiceName.EqualsIgnoreCaseAscii("roadmap") )
+ else if (aServiceName.equalsIgnoreAsciiCaseAscii("roadmap") )
{
pWindow = new ::svt::ORoadmap( pParent, WB_TABSTOP );
*ppNewComp = new SVTXRoadmap;
}
- else if ( aServiceName.EqualsIgnoreCaseAscii( "ProgressBar" ) )
+ else if ( aServiceName.equalsIgnoreAsciiCaseAscii( "ProgressBar" ) )
{
if ( pParent )
{
@@ -132,13 +132,13 @@
return NULL;
}
}
- else if ( aServiceName.EqualsIgnoreCaseAscii( "Tree" ) )
+ else if ( aServiceName.equalsIgnoreAsciiCaseAscii( "Tree" ) )
{
TreeControlPeer* pPeer = new TreeControlPeer;
*ppNewComp = pPeer;
pWindow = pPeer->createVclControl( pParent, nWinBits );
}
- else if ( aServiceName.EqualsIgnoreCaseAscii( "FixedHyperlink" ) )
+ else if ( aServiceName.equalsIgnoreAsciiCaseAscii( "FixedHyperlink" ) )
{
if ( pParent )
{
@@ -151,7 +151,7 @@
return NULL;
}
}
- else if ( aServiceName.EqualsIgnoreCaseAscii( "Grid" ) )
+ else if ( aServiceName.equalsIgnoreAsciiCaseAscii( "Grid" ) )
{
if ( pParent )
{
@@ -1051,16 +1051,16 @@
Color* pDum;
double d = 0.0;
rValue >>= d;
- String sConverted;
+ OUString sConverted;
pFormatter->GetOutputString(d, 0, sConverted, &pDum);
- aReturn <<= OUString( sConverted );
+ aReturn <<= sConverted;
}
break;
case ::com::sun::star::uno::TypeClass_STRING:
{
OUString aStr;
rValue >>= aStr;
- String sValue = aStr;
+ OUString sValue = aStr;
if (pField->TreatingAsNumber())
{
SvNumberFormatter* pFormatter = pField->GetFormatter();
@@ -1278,11 +1278,10 @@
OUString sText;
rValue >>= sText;
- String aStr( sText );
if (!pField->TreatingAsNumber())
- pField->SetTextFormatted(aStr);
+ pField->SetTextFormatted(sText);
else
- pField->SetTextValue(aStr);
+ pField->SetTextValue(sText);
}
}
// NotifyTextListeners();
@@ -1569,7 +1568,7 @@
case BASEPROPERTY_ACTIVATED:
{
- sal_Bool b = false;
+ sal_Bool b = false;
Value >>= b;
pField->SetRoadmapInteractive( b);
}
@@ -1577,7 +1576,7 @@
case BASEPROPERTY_CURRENTITEMID:
{
- sal_Int32 nId = 0;
+ sal_Int32 nId = 0;
Value >>= nId;
pField->SelectRoadmapItemByID( (RoadmapTypes::ItemId)nId );
}
@@ -1585,7 +1584,7 @@
case BASEPROPERTY_TEXT:
{
- OUString aStr;
+ OUString aStr;
Value >>= aStr;
pField->SetText( aStr );
pField->Invalidate();
diff --git a/svtools/source/uno/unoimap.cxx b/svtools/source/uno/unoimap.cxx
index d08a734..01e8b46 100644
--- a/svtools/source/uno/unoimap.cxx
+++ b/svtools/source/uno/unoimap.cxx
@@ -264,11 +264,11 @@
IMapObject* SvUnoImageMapObject::createIMapObject() const
{
- const String aURL( maURL );
- const String aAltText( maAltText );
- const String aDesc( maDesc );
- const String aTarget( maTarget );
- const String aName( maName );
+ const OUString aURL( maURL );
+ const OUString aAltText( maAltText );
+ const OUString aDesc( maDesc );
+ const OUString aTarget( maTarget );
+ const OUString aName( maName );
IMapObject* pNewIMapObject;
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index f8cebfe..b6ae3ae 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -1571,11 +1571,11 @@
if ( rURL.GetMap() )
{
IMapObject *pObject = pFly->GetFmt()->GetIMapObject( rPt, pFly );
- if ( pObject && pObject->GetURL().Len() )
+ if ( pObject && !pObject->GetURL().isEmpty() )
{
if( pURL )
*pURL = pObject->GetURL();
- if ( bSetTargetFrameName && pObject->GetTarget().Len() )
+ if ( bSetTargetFrameName && !pObject->GetTarget().isEmpty() )
{
bSetTargetFrameName = false;
*pTargetFrameName = pObject->GetTarget();
--
To view, visit https://gerrit.libreoffice.org/4258
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I56a91943080e290eabbc23575e27aab65e5d269e
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Norbert Thiebaud <nthiebaud at gmail.com>
More information about the LibreOffice
mailing list