summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-11-21 09:00:31 +0100
committerDavid Tardon <dtardon@redhat.com>2011-11-21 09:03:46 +0100
commit5ec603972f501062118b8ad5326a47287b3a1e59 (patch)
tree2508a41cb79b5ecc01991477a51b2dc40f83892c /vcl/unx/gtk
parent737f61ba4c202834e70bbaa746b4a9ce0137a891 (diff)
convert gtk plugin to rtl::O(U)String
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r--vcl/unx/gtk/app/gtksys.cxx16
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx12
2 files changed, 15 insertions, 13 deletions
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index dbe1c47c7e89..a5b134e420f2 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -30,6 +30,7 @@
#include <string.h>
#include <gmodule.h>
#include <gtk/gtk.h>
+#include <comphelper/string.hxx>
#include <unx/gtk/gtkinst.hxx>
#include <unx/gtk/gtksys.hxx>
@@ -210,15 +211,16 @@ rtl::OUString GtkSalSystem::GetScreenName(unsigned int nScreen)
}
// convert ~ to indicate mnemonic to '_'
-static rtl::OString MapToGtkAccelerator(const String &rStr)
+static rtl::OString MapToGtkAccelerator(const rtl::OUString &rStr)
{
- String aRet( rStr );
- aRet.SearchAndReplaceAscii("~", String::CreateFromAscii("_"));
- return rtl::OUStringToOString(aRet, RTL_TEXTENCODING_UTF8);
+ const rtl::OUString aRep(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "_" )));
+ return rtl::OUStringToOString(
+ comphelper::string::searchAndReplaceAsciiL(
+ rStr, RTL_CONSTASCII_STRINGPARAM( "~" ), aRep), RTL_TEXTENCODING_UTF8);
}
-int GtkSalSystem::ShowNativeDialog (const String& rTitle, const String& rMessage,
- const std::list< String >& rButtonNames,
+int GtkSalSystem::ShowNativeDialog (const rtl::OUString& rTitle, const rtl::OUString& rMessage,
+ const std::list< rtl::OUString >& rButtonNames,
int nDefaultButton)
{
rtl::OString aTitle (rtl::OUStringToOString (rTitle, RTL_TEXTENCODING_UTF8));
@@ -231,7 +233,7 @@ int GtkSalSystem::ShowNativeDialog (const String& rTitle, const String& rMessage
"text", aMessage.getStr(),
NULL));
int nButton = 0;
- std::list< String >::const_iterator it;
+ std::list< rtl::OUString >::const_iterator it;
for (it = rButtonNames.begin(); it != rButtonNames.end(); ++it)
gtk_dialog_add_button (pDialog, MapToGtkAccelerator(*it).getStr(), nButton++);
gtk_dialog_set_default_response (pDialog, nDefaultButton);
diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx
index e8998ca94abc..9947eb0abd02 100644
--- a/vcl/unx/gtk/window/gtkframe.cxx
+++ b/vcl/unx/gtk/window/gtkframe.cxx
@@ -1133,7 +1133,7 @@ sal_Bool GtkSalFrame::PostEvent( void* pData )
return sal_True;
}
-void GtkSalFrame::SetTitle( const String& rTitle )
+void GtkSalFrame::SetTitle( const rtl::OUString& rTitle )
{
m_aTitle = rTitle;
if( m_pWindow && ! isChild() )
@@ -2358,25 +2358,25 @@ void GtkSalFrame::Sync()
gdk_display_sync( getGdkDisplay() );
}
-String GtkSalFrame::GetSymbolKeyName( const String&, sal_uInt16 nKeyCode )
+rtl::OUString GtkSalFrame::GetSymbolKeyName( const rtl::OUString&, sal_uInt16 nKeyCode )
{
#if !GTK_CHECK_VERSION(3,0,0)
return getDisplay()->GetKeyName( nKeyCode );
#else
(void)nKeyCode;
# warning FIXME - key names
- return String();
+ return rtl::OUString();
#endif
}
-String GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode )
+rtl::OUString GtkSalFrame::GetKeyName( sal_uInt16 nKeyCode )
{
#if !GTK_CHECK_VERSION(3,0,0)
return getDisplay()->GetKeyName( nKeyCode );
#else
(void)nKeyCode;
# warning FIXME - key names
- return String();
+ return rtl::OUString();
#endif
}
@@ -2621,7 +2621,7 @@ void GtkSalFrame::createNewWindow( XLIB_Window aNewParent, bool bXEmbed, int nSc
}
#endif
- if( m_aTitle.Len() )
+ if( ! m_aTitle.isEmpty() )
SetTitle( m_aTitle );
if( bWasVisible )