summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorAndrzej J.R. Hunt <andrzej@ahunt.org>2012-09-04 11:48:55 +0200
committerAndrzej J.R. Hunt <andrzej@ahunt.org>2012-09-04 11:50:00 +0200
commitf28e2820fc4105cf1aa8b1daf075ef540c532572 (patch)
tree0da830b26213f79261a2f915d475f5a3a21d5dd7 /sd
parent3224b47493a40eba67e454b4bde7fab334cb5298 (diff)
Restore correct saving of authorised servers.
Change-Id: Ibb1eaab3ceb4aba8a73594c87d9fd487169e0143
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/remotecontrol/Server.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index 757a65bab9c5..487a54341a88 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 );