[Libreoffice-commits] .: android/sdremote

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 20 08:12:29 PDT 2012


 android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java           |    1 +
 android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java |    8 +++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 2e44e8134b077032341849886e2aad465cee1fd9
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Aug 20 17:10:46 2012 +0200

    Fixed formatting of Network Servers in selection screen.
    
    Change-Id: Ia2e0612588b1bad4971b73852f9cbededb233c7e

diff --git a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
index f6f9514..267636f 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
@@ -101,6 +101,7 @@ public class SelectorActivity extends Activity {
 
     void doUnbindService() {
         unbindService(mConnection);
+        mCommunicationService = null;
     }
 
     private ServiceConnection mConnection = new ServiceConnection() {
diff --git a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
index c88d018..4734ff4 100644
--- a/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
+++ b/android/sdremote/src/org/libreoffice/impressremote/communication/ServerFinder.java
@@ -53,9 +53,10 @@ public class ServerFinder {
             if (i == aBuffer.length || !aCommand.equals("LOREMOTE_ADVERTISE")) {
                 return;
             }
-            for (int j = i; j < aBuffer.length; j++) {
-                if (aPacket.getData()[i] == '\n') {
-                    aName = new String(aPacket.getData(), i + 1, j, CHARSET);
+            for (int j = i + 1; j < aBuffer.length; j++) {
+                if (aPacket.getData()[j] == '\n') {
+                    aName = new String(aPacket.getData(), i + 1, j - (i + 1),
+                                    CHARSET);
                     break;
                 }
             }
@@ -66,6 +67,7 @@ public class ServerFinder {
                             .getAddress().getHostAddress(), aName,
                             System.currentTimeMillis());
             mServerList.put(aServer.getAddress(), aServer);
+            System.out.println("Contains:<<" + aName + ">>");
 
             Intent aIntent = new Intent(
                             CommunicationService.MSG_SERVERLIST_CHANGED);


More information about the Libreoffice-commits mailing list