[Libreoffice-commits] core.git: vcl/inc vcl/source
Chr. Rossmanith
ChrRossmanith at gmx.de
Tue Mar 12 14:19:35 PDT 2013
vcl/inc/ilstbox.hxx | 24 ++++++++++++------------
vcl/source/control/ilstbox.cxx | 22 +++++++++++-----------
2 files changed, 23 insertions(+), 23 deletions(-)
New commits:
commit d2ffd0799fcaef0603b76984bf024ab1ba54b095
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date: Tue Mar 12 22:02:14 2013 +0100
Replace XubString with OUString (vcl/ilstbox)
Change-Id: Ia2cefe1649538d411ae858e21a3145ca01fff2ee
Reviewed-on: https://gerrit.libreoffice.org/2690
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx
index 4c1b700..d2ae81f 100644
--- a/vcl/inc/ilstbox.hxx
+++ b/vcl/inc/ilstbox.hxx
@@ -57,14 +57,14 @@ enum LB_EVENT_TYPE
struct ImplEntryType
{
- XubString maStr;
+ OUString maStr;
Image maImage;
void* mpUserData;
- sal_Bool mbIsSelected;
+ sal_Bool mbIsSelected;
long mnFlags;
long mnHeight;
- ImplEntryType( const XubString& rStr, const Image& rImage ) :
+ ImplEntryType( const OUString& rStr, const Image& rImage ) :
maStr( rStr ),
maImage( rImage ),
mnFlags( 0 ),
@@ -74,7 +74,7 @@ struct ImplEntryType
mpUserData = NULL;
}
- ImplEntryType( const XubString& rStr ) :
+ ImplEntryType( const OUString& rStr ) :
maStr( rStr ),
mnFlags( 0 ),
mnHeight( 0 )
@@ -143,7 +143,7 @@ public:
sal_uInt16 GetEntryCount() const { return (sal_uInt16)maEntries.size(); }
sal_Bool HasImages() const { return mnImages ? sal_True : sal_False; }
- XubString GetEntryText( sal_uInt16 nPos ) const;
+ OUString GetEntryText( sal_uInt16 nPos ) const;
sal_Bool HasEntryImage( sal_uInt16 nPos ) const;
Image GetEntryImage( sal_uInt16 nPos ) const;
@@ -157,7 +157,7 @@ public:
void SelectEntry( sal_uInt16 nPos, sal_Bool bSelect );
sal_uInt16 GetSelectEntryCount() const;
- XubString GetSelectEntry( sal_uInt16 nIndex ) const;
+ OUString GetSelectEntry( sal_uInt16 nIndex ) const;
sal_uInt16 GetSelectEntryPos( sal_uInt16 nIndex ) const;
sal_Bool IsEntryPosSelected( sal_uInt16 nIndex ) const;
@@ -429,9 +429,9 @@ public:
virtual const Wallpaper& GetDisplayBackground() const;
virtual Window* GetPreferredKeyInputWindow();
- sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const OUString& rStr );
sal_uInt16 InsertEntry( sal_uInt16 nPos, const Image& rImage );
- sal_uInt16 InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage );
+ sal_uInt16 InsertEntry( sal_uInt16 nPos, const OUString& rStr, const Image& rImage );
void RemoveEntry( sal_uInt16 nPos );
void SetEntryData( sal_uInt16 nPos, void* pNewData ) { maLBWindow.GetEntryList()->SetEntryData( nPos, pNewData ); }
void Clear();
@@ -560,7 +560,7 @@ class ImplWin : public Control
private:
sal_uInt16 mnItemPos; // because of UserDraw I have to know which item I draw
- XubString maString;
+ OUString maString;
Image maImage;
Rectangle maFocusRect;
@@ -588,11 +588,11 @@ public:
virtual void LoseFocus();
virtual long PreNotify( NotifyEvent& rNEvt );
- sal_uInt16 GetItemPos() const { return mnItemPos; }
+ sal_uInt16 GetItemPos() const { return mnItemPos; }
void SetItemPos( sal_uInt16 n ) { mnItemPos = n; }
- const XubString& GetString() const { return maString; }
- void SetString( const XubString& rStr ) { maString = rStr; }
+ const OUString& GetString() const { return maString; }
+ void SetString( const OUString& rStr ) { maString = rStr; }
const Image& GetImage() const { return maImage; }
void SetImage( const Image& rImg ) { maImage = rImg; }
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index e790a43..73e5c5d 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -376,9 +376,9 @@ long ImplEntryList::GetEntryHeight( sal_uInt16 nPos ) const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
+OUString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
{
- XubString aEntryText;
+ OUString aEntryText;
ImplEntryType* pImplEntry = GetEntry( nPos );
if ( pImplEntry )
aEntryText = pImplEntry->maStr;
@@ -457,7 +457,7 @@ sal_uInt16 ImplEntryList::GetSelectEntryCount() const
// -----------------------------------------------------------------------
-XubString ImplEntryList::GetSelectEntry( sal_uInt16 nIndex ) const
+OUString ImplEntryList::GetSelectEntry( sal_uInt16 nIndex ) const
{
return GetEntryText( GetSelectEntryPos( nIndex ) );
}
@@ -672,7 +672,7 @@ struct ImplEntryMetrics
void ImplListBoxWindow::ImplUpdateEntryMetrics( ImplEntryType& rEntry )
{
ImplEntryMetrics aMetrics;
- aMetrics.bText = rEntry.maStr.Len() ? sal_True : sal_False;
+ aMetrics.bText = !rEntry.maStr.isEmpty() ? sal_True : sal_False;
aMetrics.bImage = !!rEntry.maImage;
aMetrics.nEntryWidth = 0;
aMetrics.nEntryHeight = 0;
@@ -2268,7 +2268,7 @@ void ImplListBox::Clear()
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const OUString& rStr )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr );
sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
@@ -2288,7 +2288,7 @@ sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const Image& rImage )
// -----------------------------------------------------------------------
-sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const XubString& rStr, const Image& rImage )
+sal_uInt16 ImplListBox::InsertEntry( sal_uInt16 nPos, const OUString& rStr, const Image& rImage )
{
ImplEntryType* pNewEntry = new ImplEntryType( rStr, rImage );
sal_uInt16 nNewPos = maLBWindow.InsertEntry( nPos, pNewEntry );
@@ -2697,14 +2697,14 @@ void ImplListBox::SetMRUEntries( const rtl::OUString& rEntries, sal_Unicode cSep
rtl::OUString ImplListBox::GetMRUEntries( sal_Unicode cSep ) const
{
- String aEntries;
+ OUStringBuffer aEntries;
for ( sal_uInt16 n = 0; n < GetEntryList()->GetMRUCount(); n++ )
{
- aEntries += GetEntryList()->GetEntryText( n );
+ aEntries.append(GetEntryList()->GetEntryText( n ));
if( n < ( GetEntryList()->GetMRUCount() - 1 ) )
- aEntries += cSep;
+ aEntries.append(cSep);
}
- return aEntries;
+ return aEntries.makeStringAndClear();
}
// =======================================================================
@@ -2920,7 +2920,7 @@ void ImplWin::DrawEntry( sal_Bool bDrawImage, sal_Bool bDrawText, sal_Bool bDraw
}
}
- if( bDrawText && maString.Len() )
+ if( bDrawText && !maString.isEmpty() )
{
sal_uInt16 nTextStyle = TEXT_DRAW_VCENTER;
More information about the Libreoffice-commits
mailing list