summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-07-30 09:42:12 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-07-30 10:58:56 +0100
commit83195e2821f24c182098740fb506db215185917f (patch)
treea952613b29c2173370e2aa32b9f2920f90c69e57
parent36efa8c6a8ffcad1b285caa4cfda138a900becf7 (diff)
XubString->OUString for msgbox
Change-Id: Ieee6547b36534d0a31b6df8e00c44f1ebbaeae9a
-rw-r--r--include/vcl/msgbox.hxx24
-rw-r--r--vcl/source/window/msgbox.cxx19
2 files changed, 19 insertions, 24 deletions
diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 93689f806fba..099bc5504adf 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -38,12 +38,12 @@ class VCL_DLLPUBLIC MessBox : public ButtonDialog
protected:
VclMultiLineEdit* mpVCLMultiLineEdit;
FixedImage* mpFixedImage;
- XubString maMessText;
+ OUString maMessText;
Image maImage;
- sal_Bool mbHelpBtn;
+ sal_Bool mbHelpBtn;
CheckBox* mpCheckBox;
- XubString maCheckBoxText;
- sal_Bool mbCheck;
+ OUString maCheckBoxText;
+ sal_Bool mbCheck;
SAL_DLLPRIVATE void ImplInitMessBoxData();
SAL_DLLPRIVATE void ImplInitButtons();
@@ -54,20 +54,20 @@ protected:
public:
MessBox( Window* pParent, WinBits nStyle,
- const XubString& rTitle, const XubString& rMessage );
+ const OUString& rTitle, const OUString& rMessage );
MessBox( Window* pParent, const ResId& rResId );
~MessBox();
virtual void StateChanged( StateChangedType nStateChange );
- void SetMessText( const XubString& rText ) { maMessText = rText; }
- const XubString& GetMessText() const { return maMessText; }
+ void SetMessText( const OUString& rText ) { maMessText = rText; }
+ const OUString& GetMessText() const { return maMessText; }
void SetImage( const Image& rImage ) { maImage = rImage; }
const Image& GetImage() const { return maImage; }
- void SetCheckBoxText( const XubString& rText ) { maCheckBoxText = rText;}
- const XubString& GetCheckBoxText() const { return maCheckBoxText;}
+ void SetCheckBoxText( const OUString& rText ) { maCheckBoxText = rText;}
+ const OUString& GetCheckBoxText() const { return maCheckBoxText;}
void SetCheckBoxState( sal_Bool bCheck );
sal_Bool GetCheckBoxState() const;
@@ -101,7 +101,7 @@ private:
public:
WarningBox( Window* pParent, WinBits nStyle,
- const XubString& rMessage );
+ const OUString& rMessage );
WarningBox( Window* pParent, const ResId& rResId );
void SetDefaultCheckBoxText();
@@ -120,7 +120,7 @@ private:
public:
ErrorBox( Window* pParent, WinBits nStyle,
- const XubString& rMessage );
+ const OUString& rMessage );
ErrorBox( Window* pParent, const ResId& rResId );
static Image GetStandardImage();
@@ -137,7 +137,7 @@ private:
public:
QueryBox( Window* pParent, WinBits nStyle,
- const XubString& rMessage );
+ const OUString& rMessage );
QueryBox( Window* pParent, const ResId& rResId );
void SetDefaultCheckBoxText();
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 9e27767e43f5..e65c66881755 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -147,7 +147,7 @@ void MessBox::ImplInitButtons()
// -----------------------------------------------------------------------
MessBox::MessBox( Window* pParent, WinBits nStyle,
- const XubString& rTitle, const XubString& rMessage ) :
+ const OUString& rTitle, const OUString& rMessage ) :
ButtonDialog( WINDOW_MESSBOX ),
maMessText( rMessage )
{
@@ -155,7 +155,7 @@ MessBox::MessBox( Window* pParent, WinBits nStyle,
ImplInit( pParent, nStyle | WB_MOVEABLE | WB_HORZ | WB_CENTER );
ImplInitButtons();
- if ( rTitle.Len() )
+ if (!rTitle.isEmpty())
SetText( rTitle );
}
@@ -221,7 +221,6 @@ void MessBox::ImplPosControls()
}
}
- XubString aMessText( maMessText );
TextRectInfo aTextInfo;
Rectangle aRect( 0, 0, 30000, 30000 );
Rectangle aFormatRect;
@@ -250,12 +249,8 @@ void MessBox::ImplPosControls()
mpCheckBox = NULL;
}
-
// Message-Text um Tabs bereinigen
- OUString aTabStr(" ");
- sal_uInt16 nIndex = 0;
- while ( nIndex != STRING_NOTFOUND )
- nIndex = aMessText.SearchAndReplace( OUString('\t'), aTabStr, nIndex );
+ OUString aMessText(maMessText.replaceAll("\t", " "));
// Wenn Fenster zu schmall, machen wir Dialog auch breiter
if ( mpWindowImpl->mbFrame )
@@ -343,7 +338,7 @@ void MessBox::ImplPosControls()
if ( aPageSize.Width() < nTitleWidth )
aPageSize.Width() = nTitleWidth;
- if ( maCheckBoxText.Len() )
+ if (!maCheckBoxText.isEmpty())
{
Size aMinCheckboxSize ( aMEditSize );
if ( aPageSize.Width() < IMPL_MINSIZE_MSGBOX_WIDTH+80 )
@@ -481,7 +476,7 @@ void WarningBox::ImplInitWarningBoxData()
// -----------------------------------------------------------------------
WarningBox::WarningBox( Window* pParent, WinBits nStyle,
- const XubString& rMessage ) :
+ const OUString& rMessage ) :
MessBox( pParent, nStyle, ImplGetSVEmptyStr(), rMessage )
{
ImplInitWarningBoxData();
@@ -526,7 +521,7 @@ void ErrorBox::ImplInitErrorBoxData()
// -----------------------------------------------------------------------
ErrorBox::ErrorBox( Window* pParent, WinBits nStyle,
- const XubString& rMessage ) :
+ const OUString& rMessage ) :
MessBox( pParent, nStyle, ImplGetSVEmptyStr(), rMessage )
{
ImplInitErrorBoxData();
@@ -570,7 +565,7 @@ void QueryBox::ImplInitQueryBoxData()
// -----------------------------------------------------------------------
-QueryBox::QueryBox( Window* pParent, WinBits nStyle, const XubString& rMessage ) :
+QueryBox::QueryBox( Window* pParent, WinBits nStyle, const OUString& rMessage ) :
MessBox( pParent, nStyle, ImplGetSVEmptyStr(), rMessage )
{
ImplInitQueryBoxData();