[Libreoffice-commits] .: 5 commits - toolkit/source tools/inc vcl/source vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Fri Jun 17 06:13:07 PDT 2011


 toolkit/source/awt/vclxtoolkit.cxx    |    2 +-
 tools/inc/tools/fsys.hxx              |    2 --
 vcl/source/app/svapp.cxx              |    4 ----
 vcl/unx/generic/app/wmadaptor.cxx     |   30 ++++++++++++++++--------------
 vcl/unx/generic/plugadapt/salplug.cxx |    2 +-
 vcl/unx/gtk/app/gtksys.cxx            |   25 +++++++++++++++----------
 vcl/unx/headless/svppspgraphics.cxx   |    8 +++++---
 7 files changed, 38 insertions(+), 35 deletions(-)

New commits:
commit 0e4b6211f964b8ce7193b99209ffebae4bfc2414
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 16 22:49:31 2011 +0100

    ByteString -> rtl::OString

diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index 2e78e11..b09ce7c 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -272,7 +272,7 @@ void SalAbort( const XubString& rErrorText )
     if( !rErrorText.Len() )
         std::fprintf( stderr, "Application Error\n" );
     else
-        std::fprintf( stderr, "%s\n", ByteString( rErrorText, gsl_getSystemTextEncoding() ).GetBuffer() );
+        std::fprintf( stderr, "%s\n", rtl::OUStringToOString(rErrorText, gsl_getSystemTextEncoding()).getStr() );
     exit(-1);
 }
 
diff --git a/vcl/unx/gtk/app/gtksys.cxx b/vcl/unx/gtk/app/gtksys.cxx
index 03480d6..8a335da 100644
--- a/vcl/unx/gtk/app/gtksys.cxx
+++ b/vcl/unx/gtk/app/gtksys.cxx
@@ -55,11 +55,11 @@ GtkSalSystem::~GtkSalSystem()
 }
 
 // convert ~ to indicate mnemonic to '_'
-static ByteString MapToGtkAccelerator (const String &rStr)
+static rtl::OString MapToGtkAccelerator(const String &rStr)
 {
     String aRet( rStr );
     aRet.SearchAndReplaceAscii("~", String::CreateFromAscii("_"));
-    return ByteString( aRet, RTL_TEXTENCODING_UTF8 );
+    return rtl::OUStringToOString(aRet, RTL_TEXTENCODING_UTF8);
 }
 
 int GtkSalSystem::ShowNativeDialog( const String& rTitle,
@@ -76,14 +76,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle,
     std::fprintf( stderr, "GtkSalSystem::ShowNativeDialog\n");
 #endif
 
-    ByteString aTitle( rTitle, RTL_TEXTENCODING_UTF8 );
-    ByteString aMessage( rMessage, RTL_TEXTENCODING_UTF8 );
+    rtl::OString aTitle(rtl::OUStringToOString(rTitle,
+        RTL_TEXTENCODING_UTF8));
+    rtl::OString aMessage(rtl::OUStringToOString(rMessage,
+        RTL_TEXTENCODING_UTF8));
 
     /* Create the dialogue */
     GtkWidget* mainwin = gtk_message_dialog_new
             ( NULL, (GtkDialogFlags)0, GTK_MESSAGE_WARNING,
-              GTK_BUTTONS_NONE, aMessage.GetBuffer(), NULL );
-    gtk_window_set_title( GTK_WINDOW( mainwin ), aTitle.GetBuffer() );
+              GTK_BUTTONS_NONE, aMessage.getStr(), NULL );
+    gtk_window_set_title( GTK_WINDOW( mainwin ), aTitle.getStr() );
 
     gint nButtons = 0, nResponse;
 
@@ -92,13 +94,16 @@ int GtkSalSystem::ShowNativeDialog( const String& rTitle,
     {
         if( nButton == nDefButton )
         {
-            gtk_dialog_add_button( GTK_DIALOG( mainwin ), MapToGtkAccelerator(*it).GetBuffer(), nButtons );
-            gtk_dialog_set_default_response( GTK_DIALOG( mainwin ), nButtons );
+            gtk_dialog_add_button(GTK_DIALOG( mainwin ),
+                MapToGtkAccelerator(*it).getStr(), nButtons);
+            gtk_dialog_set_default_response(GTK_DIALOG(mainwin), nButtons);
         }
         else
         {
-            ByteString aLabel( *it, RTL_TEXTENCODING_UTF8 );
-            gtk_dialog_add_button( GTK_DIALOG( mainwin ), aLabel.GetBuffer(), nButtons );
+            rtl::OString aLabel(rtl::OUStringToOString(*it,
+                RTL_TEXTENCODING_UTF8));
+            gtk_dialog_add_button(GTK_DIALOG(mainwin), aLabel.getStr(),
+                nButtons);
         }
         nButtons++;
     }
diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx
index f44c445..5a31928 100644
--- a/vcl/unx/headless/svppspgraphics.cxx
+++ b/vcl/unx/headless/svppspgraphics.cxx
@@ -1135,10 +1135,12 @@ ImplDevFontAttributes PspGraphics::Info2DevFontAttributes( const psp::FastPrintF
 #if OSL_DEBUG_LEVEL > 2
     if( bHasMapNames )
     {
-        ByteString aOrigName( aDFA.maName, osl_getThreadTextEncoding() );
-        ByteString aAliasNames( aDFA.maMapNames, osl_getThreadTextEncoding() );
+        rtl::OString aOrigName(rtl::OUStringToOString(aDFA.maName,
+            osl_getThreadTextEncoding()));
+        rtl::OString aAliasNames(rtl::OUStringToOString(aDFA.maMapNames,
+            osl_getThreadTextEncoding()));
         fprintf( stderr, "using alias names \"%s\" for font family \"%s\"\n",
-            aAliasNames.GetBuffer(), aOrigName.GetBuffer() );
+            aAliasNames.getStr(), aOrigName.getStr() );
     }
 #endif
 
commit ac7a080d26599d2626d138e7de7dde13dca35fa9
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 16 22:28:08 2011 +0100

    ByteString -> rtl::OString

diff --git a/vcl/unx/generic/app/wmadaptor.cxx b/vcl/unx/generic/app/wmadaptor.cxx
index befda29..38ed2fa 100644
--- a/vcl/unx/generic/app/wmadaptor.cxx
+++ b/vcl/unx/generic/app/wmadaptor.cxx
@@ -228,8 +228,9 @@ WMAdaptor* WMAdaptor::createWMAdaptor( SalDisplay* pSalDisplay )
         pAdaptor = new WMAdaptor( pSalDisplay );
 
 #if OSL_DEBUG_LEVEL > 1
-    fprintf( stderr, "Window Manager's name is \"%s\"\n",
-             ByteString( pAdaptor->getWindowManagerName(), RTL_TEXTENCODING_ISO_8859_1 ).GetBuffer() );
+    fprintf(stderr, "Window Manager's name is \"%s\"\n",
+        rtl::OUStringToOString(pAdaptor->getWindowManagerName(),
+        RTL_TEXTENCODING_UTF8).getStr());
 #endif
     return pAdaptor;
 }
@@ -1075,10 +1076,11 @@ void GnomeWMAdaptor::initAtoms()
 
 void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
 {
-    ByteString aTitle( rWMName, osl_getThreadTextEncoding() );
+    rtl::OString aTitle(rtl::OUStringToOString(rWMName,
+        osl_getThreadTextEncoding()));
 
     if( ! rWMName.Len() && m_aWMName.EqualsAscii( "Dtwm" ) )
-        aTitle = " ";
+        aTitle = rtl::OString(' ');
 
     ::rtl::OString aWMLocale;
     rtl_Locale* pLocale = NULL;
@@ -1140,7 +1142,7 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
     }
     #endif
 
-    char* pT = const_cast<char*>(aTitle.GetBuffer());
+    char* pT = const_cast<char*>(aTitle.getStr());
     XTextProperty aProp = { NULL, None, 0, 0 };
     if( bTrustXmb )
     {
@@ -1151,10 +1153,10 @@ void WMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
                                    &aProp );
     }
 
-    unsigned char* pData	= aProp.nitems ? aProp.value : (unsigned char*)aTitle.GetBuffer();
-    Atom nType				= aProp.nitems ? aProp.encoding : XA_STRING;
-    int nFormat				= aProp.nitems ? aProp.format : 8;
-    int nBytes				= aProp.nitems ? aProp.nitems : aTitle.Len();
+    unsigned char* pData = aProp.nitems ? aProp.value : (unsigned char*)aTitle.getStr();
+    Atom nType = aProp.nitems ? aProp.encoding : XA_STRING;
+    int nFormat = aProp.nitems ? aProp.format : 8;
+    int nBytes = aProp.nitems ? aProp.nitems : aTitle.getLength();
     const SystemEnvData* pEnv = pFrame->GetSystemData();
     XChangeProperty( m_pDisplay,
                      (XLIB_Window)pEnv->aShellWindow,
@@ -1195,7 +1197,7 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
 {
     WMAdaptor::setWMName( pFrame, rWMName );
 
-    ByteString aTitle( rWMName, RTL_TEXTENCODING_UTF8 );
+    rtl::OString aTitle(rtl::OUStringToOString(rWMName, RTL_TEXTENCODING_UTF8));
     const SystemEnvData* pEnv = pFrame->GetSystemData();
     if( m_aWMAtoms[ NET_WM_NAME ] )
         XChangeProperty( m_pDisplay,
@@ -1204,8 +1206,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
                          m_aWMAtoms[ UTF8_STRING ],
                          8,
                          PropModeReplace,
-                         (unsigned char*)aTitle.GetBuffer(),
-                         aTitle.Len()+1 );
+                         (unsigned char*)aTitle.getStr(),
+                         aTitle.getLength()+1 );
     if( m_aWMAtoms[ NET_WM_ICON_NAME ] )
         XChangeProperty( m_pDisplay,
                          (XLIB_Window)pEnv->aShellWindow,
@@ -1213,8 +1215,8 @@ void NetWMAdaptor::setWMName( X11SalFrame* pFrame, const String& rWMName ) const
                          m_aWMAtoms[ UTF8_STRING ],
                          8,
                          PropModeReplace,
-                         (unsigned char*)aTitle.GetBuffer(),
-                         aTitle.Len()+1 );
+                         (unsigned char*)aTitle.getStr(),
+                         aTitle.getLength()+1 );
     // The +1 copies the terminating null byte. Although
     // the spec says, this should not be necessary
     // at least the kwin implementation seems to depend
commit 38f65601ec7bffbcb5509f680529343f9ab333e1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 16 22:15:27 2011 +0100

    don't need to expose aNameMask

diff --git a/tools/inc/tools/fsys.hxx b/tools/inc/tools/fsys.hxx
index 567e7d1..6d706bf 100644
--- a/tools/inc/tools/fsys.hxx
+++ b/tools/inc/tools/fsys.hxx
@@ -450,8 +450,6 @@ public:
                          FSysSort nSort, ... );
                     ~Dir();
 
-    const WildCard& GetNameMask() const { return aNameMask; }
-
     FSysError		SetSort( FSysSort nSort, ... );
 
     void			Reset();
commit fec73be9aca7db6c8ef1f8867f359b6587d2eb54
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 16 21:36:00 2011 +0100

    fix comment typo

diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index bfe570a..ccc1cb1 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -1069,7 +1069,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
     {
         VCLXWindow* pParentComponent = VCLXWindow::GetImplementation( rDescriptor.Parent );
 
-        // #103939# Don't through assertion, may be it's a system dependend window, used in ImplCreateWindow.
+        // #103939# Don't throw assertion, may be it's a system dependend window, used in ImplCreateWindow.
         // DBG_ASSERT( pParentComponent, "ParentComponent not valid" );
 
         if ( pParentComponent )
commit 0cd46583009053e809279dea98d225673f5d3692
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jun 16 21:34:11 2011 +0100

    let the caller own this

diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 4ea05ba..3346fc9 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -2067,13 +2067,9 @@ void Application::Property( ApplicationProperty& rProp )
 
 void Application::SetPropertyHandler( PropertyHandler* p )
 {
-    if ( pHandler )
-        delete pHandler;
     pHandler = p;
 }
 
-
-
 void Application::AppEvent( const ApplicationEvent& /*rAppEvent*/ )
 {
 }


More information about the Libreoffice-commits mailing list