summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-08-02 08:44:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-08-02 08:55:53 +0100
commitd4b172b8196de05bb4efa39e19a2b324cf0b2778 (patch)
treefa7c51dab729a66f3d71c11769ae8325a380bda4
parent1d90e4f5f3e046b946445dec38811fec8114364c (diff)
strip down UniString some more
Change-Id: Ibd749a70a7bbe8c1023edf7bd144aa6547147a12
-rw-r--r--canvas/source/directx/dx_textlayout_drawhelper.cxx2
-rw-r--r--sfx2/source/appl/appdde.cxx8
-rw-r--r--sfx2/source/appl/lnkbase2.cxx4
-rw-r--r--svl/inc/svl/svdde.hxx18
-rw-r--r--svl/source/svdde/ddecli.cxx4
-rw-r--r--svl/source/svdde/ddedata.cxx2
-rw-r--r--svl/source/svdde/ddeimp.hxx7
-rw-r--r--svl/source/svdde/ddestrg.cxx10
-rw-r--r--svl/source/svdde/ddesvr.cxx34
-rw-r--r--svl/unx/source/svdde/ddedummy.cxx14
-rw-r--r--svx/source/dialog/sendreportw32.cxx2
-rw-r--r--sw/source/ui/envelp/envimg.cxx2
-rw-r--r--tools/inc/tools/string.hxx7
-rw-r--r--tools/source/string/strascii.cxx36
-rw-r--r--tools/source/string/strimp.cxx28
-rw-r--r--tools/source/string/tustring.cxx37
-rwxr-xr-xunusedcode.easy4
-rw-r--r--vcl/win/source/gdi/salgdi3.cxx10
-rw-r--r--vcl/win/source/gdi/salprn.cxx8
-rw-r--r--vcl/win/source/window/salframe.cxx8
20 files changed, 70 insertions, 175 deletions
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index f804a60cff47..3dca360c6dbb 100644
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -201,7 +201,7 @@ namespace dxcanvas
const Point aEmptyPoint(0, 0);
// create the String
- const String aText(rText.Text.getStr());
+ const rtl::OUString aText(rText.Text);
if( rLogicalAdvancements.getLength() )
{
diff --git a/sfx2/source/appl/appdde.cxx b/sfx2/source/appl/appdde.cxx
index 280dbf3cc614..94067d9ae111 100644
--- a/sfx2/source/appl/appdde.cxx
+++ b/sfx2/source/appl/appdde.cxx
@@ -66,7 +66,7 @@ public:
ImplDdeService( const String& rNm )
: DdeService( rNm )
{}
- virtual sal_Bool MakeTopic( const String& );
+ virtual sal_Bool MakeTopic( const rtl::OUString& );
virtual String Topics();
@@ -110,7 +110,7 @@ namespace
}
}
-sal_Bool ImplDdeService::MakeTopic( const String& rNm )
+sal_Bool ImplDdeService::MakeTopic( const rtl::OUString& rNm )
{
// Workaround for Event after Main() under OS/2
// happens when exiting starts the App again
@@ -223,7 +223,7 @@ public:
virtual sal_Bool Put( const DdeData* );
virtual sal_Bool Execute( const String* );
virtual sal_Bool StartAdviseLoop();
- virtual sal_Bool MakeItem( const String& rItem );
+ virtual sal_Bool MakeItem( const rtl::OUString& rItem );
};
@@ -664,7 +664,7 @@ sal_Bool SfxDdeDocTopic_Impl::Execute( const String* pStr )
return 0 != nRet;
}
-sal_Bool SfxDdeDocTopic_Impl::MakeItem( const String& rItem )
+sal_Bool SfxDdeDocTopic_Impl::MakeItem( const rtl::OUString& rItem )
{
AddItem( DdeItem( rItem ) );
return sal_True;
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index a2b7410f3516..755e6d6f50e2 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -603,7 +603,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt )
String sNm( rLinkName );
sal_uInt16 nTokenPos = 0;
- String sService( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) );
+ rtl::OUString sService( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) );
DdeServices& rSvc = DdeService::GetServices();
for (DdeServices::iterator aI = rSvc.begin(); aI != rSvc.end(); ++aI)
@@ -612,7 +612,7 @@ static DdeTopic* FindTopic( const String & rLinkName, sal_uInt16* pItemStt )
if( pService->GetName() == sService )
{
// then we search for the Topic
- String sTopic( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) );
+ rtl::OUString sTopic( sNm.GetToken( 0, cTokenSeperator, nTokenPos ) );
if( pItemStt )
*pItemStt = nTokenPos;
diff --git a/svl/inc/svl/svdde.hxx b/svl/inc/svl/svdde.hxx
index 0895a8119e9c..0d8bc212c04e 100644
--- a/svl/inc/svl/svdde.hxx
+++ b/svl/inc/svl/svdde.hxx
@@ -108,7 +108,7 @@ public:
virtual ~DdeTransaction();
sal_Bool IsBusy() { return bBusy; }
- const String& GetName() const;
+ const rtl::OUString GetName() const;
void Execute();
@@ -258,7 +258,7 @@ public:
DdeItem( const DdeItem& );
virtual ~DdeItem();
- const String& GetName() const;
+ const rtl::OUString GetName() const;
short GetLinks();
void NotifyClient();
};
@@ -294,7 +294,7 @@ public:
virtual sal_Bool Put( const DdeData* );
virtual sal_Bool Execute( const String* );
// evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden
- virtual sal_Bool MakeItem( const String& rItem );
+ virtual sal_Bool MakeItem( const rtl::OUString& rItem );
// es wird ein Warm-/Hot-Link eingerichtet. Return-Wert
// besagt ob es geklappt hat
@@ -308,7 +308,7 @@ private:
private:
DdeString* pName;
- String aItem;
+ rtl::OUString aItem;
std::vector<DdeItem*> aItems;
Link aConnectLink;
Link aDisconnectLink;
@@ -317,10 +317,10 @@ private:
Link aExecLink;
public:
- DdeTopic( SAL_UNUSED_PARAMETER const String& );
+ DdeTopic( SAL_UNUSED_PARAMETER const rtl::OUString& );
virtual ~DdeTopic();
- const String& GetName() const;
+ const rtl::OUString GetName() const;
long GetConvId();
void SetConnectHdl( const Link& rLink ) { aConnectLink = rLink; }
@@ -340,7 +340,7 @@ public:
void InsertItem( DdeItem* ); // fuer eigene Ableitungen!
DdeItem* AddItem( const DdeItem& ); // werden kopiert !
void RemoveItem( const DdeItem& );
- const String& GetCurItem() { return aItem; }
+ const rtl::OUString& GetCurItem() { return aItem; }
const std::vector<DdeItem*>& GetItems() const { return aItems; }
private:
@@ -360,7 +360,7 @@ public:
virtual sal_Bool IsBusy();
virtual String GetHelp();
// evt. ein neues anlegen; return 0 -> es konnte nicht angelegt werden
- virtual sal_Bool MakeTopic( const String& rItem );
+ virtual sal_Bool MakeTopic( const rtl::OUString& rItem );
protected:
virtual String Topics();
@@ -385,7 +385,7 @@ public:
DdeService( SAL_UNUSED_PARAMETER const String& );
virtual ~DdeService();
- const String& GetName() const;
+ const rtl::OUString GetName() const;
short GetError() { return nStatus; }
static DdeServices& GetServices();
diff --git a/svl/source/svdde/ddecli.cxx b/svl/source/svdde/ddecli.cxx
index e698835acfeb..368ef13e7663 100644
--- a/svl/source/svdde/ddecli.cxx
+++ b/svl/source/svdde/ddecli.cxx
@@ -341,9 +341,9 @@ void DdeTransaction::Execute()
// --- DdeTransaction::GetName() -----------------------------------
-const String& DdeTransaction::GetName() const
+const rtl::OUString DdeTransaction::GetName() const
{
- return *pName;
+ return pName->toOUString();
}
// --- DdeTransaction::Data() --------------------------------------
diff --git a/svl/source/svdde/ddedata.cxx b/svl/source/svdde/ddedata.cxx
index 30f7a05de3d8..c47d390eee7e 100644
--- a/svl/source/svdde/ddedata.cxx
+++ b/svl/source/svdde/ddedata.cxx
@@ -183,7 +183,7 @@ sal_uLong DdeData::GetInternalFormat( sal_uLong nFmt )
TCHAR szName[ 256 ];
if( GetClipboardFormatName( nFmt, szName, sizeof(szName) ) )
- nFmt = SotExchange::RegisterFormatName( String(reinterpret_cast<const sal_Unicode*>(szName)) );
+ nFmt = SotExchange::RegisterFormatName( rtl::OUString(reinterpret_cast<const sal_Unicode*>(szName)) );
}
#endif
break;
diff --git a/svl/source/svdde/ddeimp.hxx b/svl/source/svdde/ddeimp.hxx
index 99e2ec276774..02e684129ee7 100644
--- a/svl/source/svdde/ddeimp.hxx
+++ b/svl/source/svdde/ddeimp.hxx
@@ -81,19 +81,22 @@ public:
// - DdeString -
// -------------
-class DdeString : public String
+class DdeString
{
+private:
+ rtl::OUString m_aString;
protected:
HSZ hString;
DWORD hInst;
public:
DdeString( DWORD, const sal_Unicode* );
- DdeString( DWORD, const String& );
+ DdeString( DWORD, const rtl::OUString& );
~DdeString();
int operator==( HSZ );
operator HSZ();
+ rtl::OUString toOUString() const { return m_aString; }
};
// --------------
diff --git a/svl/source/svdde/ddestrg.cxx b/svl/source/svdde/ddestrg.cxx
index 1c8c18927505..6a2564dd17a3 100644
--- a/svl/source/svdde/ddestrg.cxx
+++ b/svl/source/svdde/ddestrg.cxx
@@ -25,8 +25,8 @@
// --- DdeString::DdeString() --------------------------------------
-DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) :
- String( p )
+DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p )
+ : m_aString(p)
{
hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)p, CP_WINUNICODE );
hInst = hDdeInst;
@@ -34,10 +34,10 @@ DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) :
// --- DdeString::DdeString() --------------------------------------
-DdeString::DdeString( DWORD hDdeInst, const String& r) :
- String( r )
+DdeString::DdeString( DWORD hDdeInst, const rtl::OUString& r)
+ : m_aString(r)
{
- hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)r.GetBuffer(), CP_WINUNICODE );
+ hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)r.getStr(), CP_WINUNICODE );
hInst = hDdeInst;
}
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 25cc3cf2b632..383e9d67e3fb 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -95,7 +95,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
sal_uInt16 n = 0;
while( STRING_NOTFOUND != n )
{
- String s( sTopics.GetToken( 0, '\t', n ));
+ rtl::OUString s( sTopics.GetToken( 0, '\t', n ));
if( s == reinterpret_cast<const sal_Unicode*>(chTopicBuf) )
++nTopics;
}
@@ -123,7 +123,7 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
sal_uInt16 n = 0;
while( STRING_NOTFOUND != n )
{
- String s( sTopics.GetToken( 0, '\t', n ));
+ rtl::OUString s( sTopics.GetToken( 0, '\t', n ));
s = comphelper::string::remove(s, '\n');
s = comphelper::string::remove(s, '\r');
if( !hText1 || s == reinterpret_cast<const sal_Unicode*>(chTopicBuf) )
@@ -224,7 +224,7 @@ found:
if ( pItem )
pTopic->aItem = pItem->GetName();
else
- pTopic->aItem.Erase();
+ pTopic->aItem = rtl::OUString();
sal_Bool bRes = sal_False;
pInst->hCurConvSvr = (long)hConv;
@@ -519,9 +519,9 @@ DdeService::~DdeService()
// --- DdeService::GetName() ---------------------------------------
-const String& DdeService::GetName() const
+const rtl::OUString DdeService::GetName() const
{
- return *pName;
+ return pName->toOUString();
}
// --- DdeService::GetServices() -----------------------------------
@@ -612,7 +612,7 @@ void DdeService::RemoveFormat( sal_uLong nFmt )
// --- DdeTopic::DdeTopic() ----------------------------------------
-DdeTopic::DdeTopic( const String& rName )
+DdeTopic::DdeTopic( const rtl::OUString& rName )
{
DdeInstData* pInst = ImpGetInstData();
DBG_ASSERT(pInst,"SVDDE:No instance data");
@@ -635,9 +635,9 @@ DdeTopic::~DdeTopic()
// --- DdeTopic::GetName() -----------------------------------------
-const String& DdeTopic::GetName() const
+const rtl::OUString DdeTopic::GetName() const
{
- return *pName;
+ return pName->toOUString();
}
// --- DdeTopic::IsSystemTopic() -----------------------------------
@@ -703,7 +703,7 @@ void DdeTopic::NotifyClient( const String& rItem )
DBG_ASSERT(pInst,"SVDDE:No instance data");
for ( iter = aItems.begin(); iter != aItems.end(); ++iter)
{
- if ( (*iter)->GetName() == rItem && (*iter)->pImpData)
+ if ( (*iter)->GetName().equals(rItem) && (*iter)->pImpData)
{
DdePostAdvise( pInst->hDdeInstSvr, *pName, *(*iter)->pName );
break;
@@ -819,7 +819,7 @@ DdeItem::DdeItem( const DdeItem& r)
{
DdeInstData* pInst = ImpGetInstData();
DBG_ASSERT(pInst,"SVDDE:No instance data");
- pName = new DdeString( pInst->hDdeInstSvr, *r.pName );
+ pName = new DdeString( pInst->hDdeInstSvr, r.pName->toOUString() );
nType = DDEITEM;
pMyTopic = 0;
pImpData = 0;
@@ -838,9 +838,9 @@ DdeItem::~DdeItem()
// --- DdeItem::GetName() ------------------------------------------
-const String& DdeItem::GetName() const
+const rtl::OUString DdeItem::GetName() const
{
- return *pName;
+ return pName->toOUString();
}
// --- DdeItem::NotifyClient() ------------------------------------------
@@ -985,7 +985,7 @@ String DdeService::SysItems()
s += '\t';
s += (*iterItem)->GetName();
}
- s += String::CreateFromAscii("\r\n");
+ s += rtl::OUString("\r\n");
}
}
@@ -1006,7 +1006,7 @@ String DdeService::Topics()
s += '\t';
s += (*iter)->GetName();
}
- s += String::CreateFromAscii("\r\n");
+ s += rtl::OUString("\r\n");
return s;
}
@@ -1052,7 +1052,7 @@ String DdeService::Formats()
String DdeService::Status()
{
- return IsBusy() ? String::CreateFromAscii("Busy\r\n") : String::CreateFromAscii("Ready\r\n");
+ return IsBusy() ? rtl::OUString("Busy\r\n") : rtl::OUString("Ready\r\n");
}
// --- DdeService::IsBusy() ----------------------------------------
@@ -1069,12 +1069,12 @@ String DdeService::GetHelp()
return String();
}
-sal_Bool DdeTopic::MakeItem( const String& )
+sal_Bool DdeTopic::MakeItem( const rtl::OUString& )
{
return sal_False;
}
-sal_Bool DdeService::MakeTopic( const String& )
+sal_Bool DdeService::MakeTopic( const rtl::OUString& )
{
return sal_False;
}
diff --git a/svl/unx/source/svdde/ddedummy.cxx b/svl/unx/source/svdde/ddedummy.cxx
index c9e19f387e06..d38a3d1e628e 100644
--- a/svl/unx/source/svdde/ddedummy.cxx
+++ b/svl/unx/source/svdde/ddedummy.cxx
@@ -129,7 +129,7 @@ DdePoke::DdePoke( DdeConnection& rConnection, const String& rString, const DdeDa
}
-DdeTopic::DdeTopic( const String& )
+DdeTopic::DdeTopic( const rtl::OUString& )
{
}
@@ -163,7 +163,7 @@ DdeData* DdeTopic::Get( SAL_UNUSED_PARAMETER sal_uLong )
return NULL;
}
-sal_Bool DdeTopic::MakeItem( SAL_UNUSED_PARAMETER const String& )
+sal_Bool DdeTopic::MakeItem( SAL_UNUSED_PARAMETER const rtl::OUString& )
{
return sal_False;
}
@@ -188,9 +188,9 @@ sal_Bool DdeTopic::Put( SAL_UNUSED_PARAMETER const DdeData* )
return sal_False;
}
-const String& DdeTopic::GetName() const
+const rtl::OUString DdeTopic::GetName() const
{
- return String::EmptyString();
+ return rtl::OUString();
}
DdeService::DdeService( const String& )
@@ -248,14 +248,14 @@ void DdeService::RemoveTopic( SAL_UNUSED_PARAMETER const DdeTopic& )
{
}
-sal_Bool DdeService::MakeTopic( SAL_UNUSED_PARAMETER const String& )
+sal_Bool DdeService::MakeTopic( SAL_UNUSED_PARAMETER const rtl::OUString& )
{
return sal_False;
}
-const String& DdeService::GetName() const
+const rtl::OUString DdeService::GetName() const
{
- return String::EmptyString();
+ return rtl::OUString();
}
namespace
diff --git a/svx/source/dialog/sendreportw32.cxx b/svx/source/dialog/sendreportw32.cxx
index 129e7cbd3cf0..c45045fd39d9 100644
--- a/svx/source/dialog/sendreportw32.cxx
+++ b/svx/source/dialog/sendreportw32.cxx
@@ -119,7 +119,7 @@ namespace svx{
TEXT("ReturnAddress"),
szBuffer,
sizeof(szBuffer) ) )
- maEMailAddrED.SetText( (sal_Unicode *)szBuffer );
+ maEMailAddrED.SetText(rtl::OUString((sal_Unicode *)szBuffer));
DWORD fAllowContact = sal_False;
RegReadValue(
diff --git a/sw/source/ui/envelp/envimg.cxx b/sw/source/ui/envelp/envimg.cxx
index 5f8f256052bf..e3967c233932 100644
--- a/sw/source/ui/envelp/envimg.cxx
+++ b/sw/source/ui/envelp/envimg.cxx
@@ -45,7 +45,7 @@
#include <unomid.h>
#ifdef WNT
-#define NEXTLINE UniString::CreateFromAscii("\r\n")
+#define NEXTLINE rtl::OUString("\r\n")
#else
#define NEXTLINE '\n'
#endif
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx
index c524f0f1d4f6..d1768bc6b97a 100644
--- a/tools/inc/tools/string.hxx
+++ b/tools/inc/tools/string.hxx
@@ -152,6 +152,8 @@ private:
TOOLS_DLLPRIVATE UniString( const rtl::OString& rByteStr,
rtl_TextEncoding eTextEncoding,
sal_uInt32 nCvtFlags = BYTESTRING_TO_UNISTRING_CVTFLAGS );
+ TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr );
+ TOOLS_DLLPRIVATE UniString( const sal_Unicode* pCharStr, xub_StrLen nLen );
public:
UniString();
@@ -159,8 +161,6 @@ public:
UniString( const UniString& rStr );
UniString( const UniString& rStr, xub_StrLen nPos, xub_StrLen nLen );
UniString( const rtl::OUString& rStr );
- UniString( const sal_Unicode* pCharStr );
- UniString( const sal_Unicode* pCharStr, xub_StrLen nLen );
UniString( sal_Unicode c );
UniString(char c); // ...but allow "UniString('a')"
UniString( const sal_Char* pByteStr,
@@ -177,9 +177,6 @@ public:
reinterpret_cast<rtl_uString*>(mpData)), SAL_NO_ACQUIRE );
}
- static UniString CreateFromAscii( const sal_Char* pAsciiStr );
- static UniString CreateFromAscii( const sal_Char* pAsciiStr, xub_StrLen nLen );
-
static UniString CreateFromInt32( sal_Int32 n, sal_Int16 nRadix = 10 );
static const UniString& EmptyString();
sal_Int32 ToInt32() const;
diff --git a/tools/source/string/strascii.cxx b/tools/source/string/strascii.cxx
index 49600b9339de..f0fd961b0a7a 100644
--- a/tools/source/string/strascii.cxx
+++ b/tools/source/string/strascii.cxx
@@ -162,42 +162,6 @@ static sal_Int32 ImplStringICompareAscii( const sal_Unicode* pStr1, const sal_Ch
return nRet;
}
-// =======================================================================
-
-UniString UniString::CreateFromAscii( const sal_Char* pAsciiStr )
-{
- DBG_ASSERT( pAsciiStr, "UniString::CreateFromAscii() - pAsciiStr is NULL" );
-
- // Stringlaenge ermitteln
- xub_StrLen nLen = ImplStringLen( pAsciiStr );
-
- UniString aTempStr;
- if ( nLen )
- {
- ImplCopyAsciiStr( aTempStr.AllocBuffer( nLen ), pAsciiStr, nLen );
- }
- return aTempStr;
-}
-
-// -----------------------------------------------------------------------
-
-UniString UniString::CreateFromAscii( const sal_Char* pAsciiStr, xub_StrLen nLen )
-{
- DBG_ASSERT( pAsciiStr, "UniString::CreateFromAscii() - pAsciiStr is NULL" );
-
- // Stringlaenge ermitteln
- if ( nLen == STRING_LEN )
- nLen = ImplStringLen( pAsciiStr );
-
- UniString aTempStr;
-
- if ( nLen )
- {
- ImplCopyAsciiStr( aTempStr.AllocBuffer( nLen ), pAsciiStr, nLen );
- }
- return aTempStr;
-}
-
// -----------------------------------------------------------------------
UniString& UniString::AssignAscii( const sal_Char* pAsciiStr )
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx
index 3e2fc4376207..6717d93209ad 100644
--- a/tools/source/string/strimp.cxx
+++ b/tools/source/string/strimp.cxx
@@ -192,34 +192,6 @@ STRING::STRING( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen )
// -----------------------------------------------------------------------
-STRING::STRING( const STRCODE* pCharStr )
- : mpData(NULL)
-{
- DBG_CTOR( STRING, DBGCHECKSTRING );
-
- // Stringlaenge ermitteln
- // Bei diesem Ctor darf NULL uebergeben werden
- xub_StrLen nLen;
- if ( pCharStr )
- nLen = ImplStringLen( pCharStr );
- else
- nLen = 0;
-
- // Ist es kein leerer String
- if ( nLen )
- {
- // Verwaltungsdaten anlegen und String kopieren
- mpData = ImplAllocData( nLen );
- memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
- }
- else
- {
- STRING_NEW((STRING_TYPE **)&mpData);
- }
-}
-
-// -----------------------------------------------------------------------
-
STRING::~STRING()
{
DBG_DTOR( STRING, DBGCHECKSTRING );
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index db9aeaa12b9c..120bf002b873 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -855,43 +855,6 @@ STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, xub_StrLen& rIndex ) c
// -----------------------------------------------------------------------
-STRING::STRING( const STRCODE* pCharStr, xub_StrLen nLen )
-: mpData(NULL)
-{
- DBG_CTOR( STRING, DBGCHECKSTRING );
- DBG_ASSERT( pCharStr, "String::String() - pCharStr is NULL" );
-
- if ( nLen == STRING_LEN )
- nLen = ImplStringLen( pCharStr );
-
-#ifdef DBG_UTIL
- if ( DbgIsAssert() )
- {
- for ( xub_StrLen i = 0; i < nLen; i++ )
- {
- if ( !pCharStr[i] )
- {
- OSL_FAIL( "String::String() : nLen is wrong" );
- }
- }
- }
-#endif
-
- // Ist es kein leerer String
- if ( nLen )
- {
- // Verwaltungsdaten anlegen und String kopieren
- mpData = ImplAllocData( nLen );
- memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) );
- }
- else
- {
- STRING_NEW((STRING_TYPE **)&mpData);
- }
-}
-
-// -----------------------------------------------------------------------
-
STRING& STRING::Append( const STRCODE* pCharStr, xub_StrLen nCharLen )
{
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
diff --git a/unusedcode.easy b/unusedcode.easy
index 5e27520ecbc1..25f2c4d3506a 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -25,10 +25,6 @@ SecurityEnvironment_NssImpl::getImplementation(com::sun::star::uno::Reference<co
SotStorage::GetProperty(String const&, String const&, com::sun::star::uno::Any&)
SpinButton::SpinButton(Window*, ResId const&)
StgCache::Pos2Page(int)
-String::CreateFromAscii(char const*)
-String::CreateFromAscii(char const*, unsigned short)
-String::String(unsigned short const*)
-String::String(unsigned short const*, unsigned short)
SvXMLAutoStylePoolParentsP_Impl::GetPos(SvXMLAutoStylePoolParentP_Impl const*) const
SvXMLAutoStylePoolParentsP_Impl::Remove(SvXMLAutoStylePoolParentP_Impl*)
SvtSlideSorterBarOptions::AddListenerLink(Link const&)
diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx
index 81ad69bb3f13..ebb1edc69b6d 100644
--- a/vcl/win/source/gdi/salgdi3.cxx
+++ b/vcl/win/source/gdi/salgdi3.cxx
@@ -1010,8 +1010,8 @@ static ImplWinFontData* ImplLogMetricToDevFontDataW( const ENUMLOGFONTEXW* pLogF
void ImplSalLogFontToFontW( HDC hDC, const LOGFONTW& rLogFont, Font& rFont )
{
- XubString aFontName( reinterpret_cast<const xub_Unicode*>(rLogFont.lfFaceName) );
- if ( aFontName.Len() )
+ rtl::OUString aFontName( reinterpret_cast<const xub_Unicode*>(rLogFont.lfFaceName) );
+ if (!aFontName.isEmpty())
{
rFont.SetName( aFontName );
rFont.SetCharSet( ImplCharSetToSal( rLogFont.lfCharSet ) );
@@ -1890,7 +1890,7 @@ int CALLBACK SalEnumFontsProcExW( const ENUMLOGFONTEXW* pLogFont,
pInfo->mbCourier = ImplSalWICompareAscii( pLogFont->elfLogFont.lfFaceName, "Courier" ) == 0;
else
pInfo->mbCourier = FALSE;
- String aName( reinterpret_cast<const sal_Unicode*>(pLogFont->elfLogFont.lfFaceName) );
+ String aName = rtl::OUString(reinterpret_cast<const sal_Unicode*>(pLogFont->elfLogFont.lfFaceName));
pInfo->mpName = &aName;
memcpy( pInfo->mpLogFontW->lfFaceName, pLogFont->elfLogFont.lfFaceName, (aName.Len()+1)*sizeof( wchar_t ) );
pInfo->mpLogFontW->lfCharSet = pLogFont->elfLogFont.lfCharSet;
@@ -2745,13 +2745,13 @@ const void* WinSalGraphics::GetEmbedFontData( const PhysicalFontFace* pFont,
const bool bPFA = (*aRawFontData.get() < 0x80);
rInfo.m_nFontType = bPFA ? FontSubsetInfo::TYPE1_PFA : FontSubsetInfo::TYPE1_PFB;
WCHAR aFaceName[64];
- int nFNLen = ::GetTextFaceW( mhDC, 64, aFaceName );
+ sal_Int32 nFNLen = ::GetTextFaceW( mhDC, 64, aFaceName );
// #i59854# strip eventual null byte
while( nFNLen > 0 && aFaceName[nFNLen-1] == 0 )
nFNLen--;
if( nFNLen == 0 )
*pDataLen = 0;
- rInfo.m_aPSName = String( reinterpret_cast<const sal_Unicode*>(aFaceName), sal::static_int_cast<sal_uInt16>(nFNLen) );
+ rInfo.m_aPSName = rtl::OUString(reinterpret_cast<const sal_Unicode*>(aFaceName), nFNLen);
rInfo.m_nAscent = +aTm.tmAscent;
rInfo.m_nDescent = -aTm.tmDescent;
rInfo.m_aFontBBox = Rectangle( Point( -aTm.tmOverhang, -aTm.tmDescent ),
diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx
index 10bb796cdfdd..70be7f405a9c 100644
--- a/vcl/win/source/gdi/salprn.cxx
+++ b/vcl/win/source/gdi/salprn.cxx
@@ -218,18 +218,18 @@ void WinSalInstance::GetPrinterQueueState( SalPrinterQueueInfo* pInfo )
if( GetPrinterW( hPrinter, 2, (LPBYTE)pWinInfo2, nBytes, &nBytes ) )
{
if( pWinInfo2->pDriverName )
- pInfo->maDriver = String( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pDriverName) );
+ pInfo->maDriver = rtl::OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pDriverName) );
XubString aPortName;
if ( pWinInfo2->pPortName )
- aPortName = String( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pPortName) );
+ aPortName = rtl::OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pPortName) );
// pLocation can be 0 (the Windows docu doesn't describe this)
if ( pWinInfo2->pLocation && *pWinInfo2->pLocation )
- pInfo->maLocation = String( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pLocation) );
+ pInfo->maLocation = rtl::OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pLocation) );
else
pInfo->maLocation = aPortName;
// pComment can be 0 (the Windows docu doesn't describe this)
if ( pWinInfo2->pComment )
- pInfo->maComment = String( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pComment) );
+ pInfo->maComment = rtl::OUString( reinterpret_cast< const sal_Unicode* >(pWinInfo2->pComment) );
pInfo->mnStatus = ImplWinQueueStatusToSal( pWinInfo2->Status );
pInfo->mnJobs = pWinInfo2->cJobs;
if( ! pInfo->mpSysData )
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 938a710f6017..25bb9a21a734 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -4632,7 +4632,7 @@ static int ImplMeasureItem( HWND hWnd, WPARAM wParam, LPARAM lParam )
HFONT hfntOld = (HFONT) SelectObject(hdc, (HFONT) CreateFontIndirect( &ncm.lfMenuFont ));
// menu text and accelerator
- String aStr(pSalMenuItem->mText.GetBuffer() );
+ String aStr(pSalMenuItem->mText);
if( pSalMenuItem->mAccelText.Len() )
{
aStr.AppendAscii(" ");
@@ -4775,7 +4775,7 @@ static int ImplDrawItem(HWND, WPARAM wParam, LPARAM lParam )
hfntOld = (HFONT) SelectObject(pDI->hDC, (HFONT) CreateFontIndirect( &ncm.lfMenuFont ));
SIZE strSize;
- String aStr( pSalMenuItem->mText.GetBuffer() );
+ String aStr( pSalMenuItem->mText );
GetTextExtentPoint32W( pDI->hDC, (LPWSTR) aStr.GetBuffer(),
aStr.Len(), &strSize );
@@ -5167,7 +5167,7 @@ static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
WCHAR* pTextBuf = new WCHAR[nTextLen];
ImmGetCompositionStringW( hIMC, GCS_RESULTSTR, pTextBuf, nTextLen*sizeof( WCHAR ) );
- aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
+ aEvt.maText = rtl::OUString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (sal_Int32)nTextLen );
delete [] pTextBuf;
}
@@ -5193,7 +5193,7 @@ static sal_Bool ImplHandleIMECompositionInput( WinSalFrame* pFrame,
{
WCHAR* pTextBuf = new WCHAR[nTextLen];
ImmGetCompositionStringW( hIMC, GCS_COMPSTR, pTextBuf, nTextLen*sizeof( WCHAR ) );
- aEvt.maText = XubString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (xub_StrLen)nTextLen );
+ aEvt.maText = rtl::OUString( reinterpret_cast<const xub_Unicode*>(pTextBuf), (sal_Int32)nTextLen );
delete [] pTextBuf;
BYTE* pAttrBuf = NULL;