[Libreoffice-commits] .: 2 commits - cui/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 4 14:44:39 PST 2013


 cui/source/options/personalization.cxx |   28 +++++++++++++++++++++++++---
 vcl/source/window/dockingarea.cxx      |    1 +
 2 files changed, 26 insertions(+), 3 deletions(-)

New commits:
commit 3f3d0c52ae29b6ab6b2c10a5557714361aa76a26
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jan 4 23:43:42 2013 +0100

    Personas: Broadcast the information that the Persona has changed.
    
    Change-Id: Ic563204c1a1a64d315e3e73dff30b6a6d05cfd87

diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index ae8f605..14e071f 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -16,6 +16,7 @@
 #include <tools/urlobj.hxx>
 #include <vcl/edit.hxx>
 #include <vcl/msgbox.hxx>
+#include <vcl/svapp.hxx>
 
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/system/SystemShellExecute.hpp>
@@ -161,6 +162,13 @@ sal_Bool SvxPersonalizationTabPage::FillItemSet( SfxItemSet & )
 
     batch->commit();
 
+    if ( bModified )
+    {
+        // broadcast the change
+        DataChangedEvent aDataChanged( DATACHANGED_SETTINGS, NULL, SETTINGS_STYLE );
+        Application::NotifyAllWindows( aDataChanged );
+    }
+
     return bModified;
 }
 
diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx
index 7d97dd9..8269c5e 100644
--- a/vcl/source/window/dockingarea.cxx
+++ b/vcl/source/window/dockingarea.cxx
@@ -103,6 +103,7 @@ void DockingAreaWindow::DataChanged( const DataChangedEvent& rDCEvt )
     if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
     {
         ImplInitBackground( this );
+        Invalidate();
     }
 }
 
commit c223e5ff859171adab1597025b30ec2501fc5771
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jan 4 23:09:18 2013 +0100

    Personas: More robust Persona URL handling.
    
    Change-Id: I55fa2570decd52e978747e589887f2fe972812c8

diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 7d31b0f..ae8f605 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -71,7 +71,14 @@ OUString SelectPersonaDialog::GetPersonaURL() const
         return OUString();
     }
 
-    return aText;
+    // canonicalize the URL
+    OUString aPersona( "persona/" );
+    sal_Int32 nPersona = aText.lastIndexOf( aPersona );
+
+    if ( nPersona < 0 )
+        return OUString();
+
+    return "http://www.getpersonas.com/persona/" + aText.copy( nPersona + aPersona.getLength() );
 }
 
 IMPL_LINK( SelectPersonaDialog, VisitPersonas, PushButton*, /*pButton*/ )
@@ -236,7 +243,7 @@ IMPL_LINK( SvxPersonalizationTabPage, SelectPersona, PushButton*, /*pButton*/ )
     while ( aDialog.Execute() == RET_OK )
     {
         OUString aURL( aDialog.GetPersonaURL() );
-        if ( aURL != "" )
+        if ( !aURL.isEmpty() )
         {
             if ( CopyPersonaToGallery( aURL ) )
                 m_pOwnPersona->Check();
@@ -312,7 +319,14 @@ bool SvxPersonalizationTabPage::CopyPersonaToGallery( const OUString &rURL )
     if ( !xFileAccess.is() )
         return false;
 
-    uno::Reference< io::XInputStream > xStream( xFileAccess->openFileRead( rURL ), uno::UNO_QUERY );
+    uno::Reference< io::XInputStream > xStream;
+    try {
+        xStream = xFileAccess->openFileRead( rURL );
+    }
+    catch (...)
+    {
+        return false;
+    }
     if ( !xStream.is() )
         return false;
 


More information about the Libreoffice-commits mailing list