summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/RemoteDialog.cxx5
-rw-r--r--sd/source/ui/dlg/RemoteDialogClientBox.cxx4
-rw-r--r--sd/source/ui/remotecontrol/BufferedStreamSocket.cxx30
-rw-r--r--sd/source/ui/remotecontrol/Server.cxx2
4 files changed, 26 insertions, 15 deletions
diff --git a/sd/source/ui/dlg/RemoteDialog.cxx b/sd/source/ui/dlg/RemoteDialog.cxx
index 0df0f7070547..d920d91c0527 100644
--- a/sd/source/ui/dlg/RemoteDialog.cxx
+++ b/sd/source/ui/dlg/RemoteDialog.cxx
@@ -50,9 +50,12 @@ IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton)
if ( aSelected < 0 )
return 1;
TClientBoxEntry aEntry = mClientBox.GetEntryData(aSelected);
- OUString aPin = mClientBox.getPin();
+ OUString aPin ( mClientBox.getPin() );
if ( RemoteServer::connectClient( aEntry->m_pClientInfo, aPin ) )
+ {
+ Close();
return 0;
+ }
else
return 1;
}
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
index 11128f364da8..8ce809e7d356 100644
--- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -97,6 +97,8 @@ ClientBox::ClientBox( Dialog* pParent, RemoteServer *pServer,
m_pScrollBar->SetScrollHdl( LINK( this, ClientBox, ScrollHdl ) );
m_pScrollBar->EnableDrag();
+ m_aPinBox.SetUseThousandSep(false);
+
SetPaintTransparent( true );
SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
@@ -582,7 +584,7 @@ long ClientBox::PointToPos( const Point& rPos )
OUString ClientBox::getPin()
{
- return m_aPinBox.GetText();
+ return OUString::valueOf( m_aPinBox.GetValue() );
}
//------------------------------------------------------------------------------
diff --git a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
index 8232bd085a06..0e274c30295a 100644
--- a/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
+++ b/sd/source/ui/remotecontrol/BufferedStreamSocket.cxx
@@ -27,8 +27,25 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
{
while ( true )
{
+ // Process buffer first incase data already present.
+ vector<char>::iterator aIt;
+ if ( (aIt = find( aBuffer.begin(), aBuffer.end(), '\n' ))
+ != aBuffer.end() )
+ {
+ sal_uInt64 aLocation = aIt - aBuffer.begin();
+
+ aLine = OString( &(*aBuffer.begin()), aLocation );
+
+ aBuffer.erase( aBuffer.begin(), aIt + 1 ); // Also delete the empty line
+ aRead -= (aLocation + 1);
+
+ return aLine.getLength();
+ }
+
+ // Then try and receive if nothing present
aBuffer.resize( aRead + 100 );
aRet = recv( &aBuffer[aRead], 100 );
+
if ( aRet == 0 )
{
return aRet;
@@ -40,19 +57,6 @@ sal_Int32 BufferedStreamSocket::readLine( OString& aLine )
return 0;
}
aRead += aRet;
- vector<char>::iterator aIt;
- while ( (aIt = find( aBuffer.begin(), aBuffer.end(), '\n' ))
- != aBuffer.end() )
- {
- sal_uInt64 aLocation = aIt - aBuffer.begin();
-
- aLine = OString( &(*aBuffer.begin()), aLocation );
-
- aBuffer.erase( aBuffer.begin(), aIt + 1 ); // Also delete the empty line
- aRead -= (aLocation + 1);
-
- return aLine.getLength();
- }
}
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index af4170aed6dd..e7a361e59e51 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -82,6 +82,7 @@ void RemoteServer::execute()
if ( ! pSocket->readLine( aLine ) ) delete pSocket;
OString aPin( aLine );
+ fprintf( stderr, "Pin:%s\n", aPin.getStr() );
SocketAddr aClientAddr;
pSocket->getPeerAddr( aClientAddr );
@@ -191,6 +192,7 @@ sal_Bool RemoteServer::connectClient( ClientInfo* pClient, rtl::OUString aPin )
break;
}
}
+ pCommunicator->launch();
return true;
}
else