diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-02 08:44:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-08-02 08:55:53 +0100 |
commit | d4b172b8196de05bb4efa39e19a2b324cf0b2778 (patch) | |
tree | fa7c51dab729a66f3d71c11769ae8325a380bda4 /svl | |
parent | 1d90e4f5f3e046b946445dec38811fec8114364c (diff) |
strip down UniString some more
Change-Id: Ibd749a70a7bbe8c1023edf7bd144aa6547147a12
Diffstat (limited to 'svl')
-rw-r--r-- | svl/inc/svl/svdde.hxx | 18 | ||||
-rw-r--r-- | svl/source/svdde/ddecli.cxx | 4 | ||||
-rw-r--r-- | svl/source/svdde/ddedata.cxx | 2 | ||||
-rw-r--r-- | svl/source/svdde/ddeimp.hxx | 7 | ||||
-rw-r--r-- | svl/source/svdde/ddestrg.cxx | 10 | ||||
-rw-r--r-- | svl/source/svdde/ddesvr.cxx | 34 | ||||
-rw-r--r-- | svl/unx/source/svdde/ddedummy.cxx | 14 |
7 files changed, 46 insertions, 43 deletions
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 |