[Libreoffice-commits] .: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Sep 4 02:50:26 PDT 2012


 sd/source/ui/remotecontrol/Server.cxx |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

New commits:
commit f28e2820fc4105cf1aa8b1daf075ef540c532572
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Tue Sep 4 11:48:55 2012 +0200

    Restore correct saving of authorised servers.
    
    Change-Id: Ibb1eaab3ceb4aba8a73594c87d9fd487169e0143

diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index 757a65b..487a543 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -225,21 +225,24 @@ sal_Bool RemoteServer::connectClient( ClientInfo* pClient, rtl::OUString aPin )
         if (xChild.is())
         {
             // Check whether the client is already saved
+            bool aSaved = false;
             Sequence< OUString > aNames = xConfig->getElementNames();
             for ( int i = 0; i < aNames.getLength(); i++ )
             {
                 if ( aNames[i].equals( apClient->mName ) )
+                {
                     xConfig->replaceByName( apClient->mName, makeAny( xChild ) );
-                else
-                    xConfig->insertByName( apClient->mName, makeAny( xChild ) );
+                    aSaved = true;
+                    break;
+                }
             }
-
+            if ( !aSaved )
+                xConfig->insertByName( apClient->mName, makeAny( xChild ) );
             aValue <<= OUString( apClient->mPin );
             xChild->replaceByName("PIN", aValue);
             aChanges->commit();
         }
 
-
         Communicator* pCommunicator = new Communicator( apClient->mpStreamSocket );
         MutexGuard aGuard( spServer->mDataMutex );
 


More information about the Libreoffice-commits mailing list