[Libreoffice-commits] core.git: 6 commits - config_host.mk.in configure.ac ios/iosremote RepositoryExternal.mk sd/CppunitTest_sd_uimpress.mk sd/Library_sd.mk sd/source slideshow/source

Siqi LIU me at siqi.fr
Thu Jul 25 08:28:24 PDT 2013


 RepositoryExternal.mk                              |   27 
 config_host.mk.in                                  |    3 
 configure.ac                                       |   24 
 ios/iosremote/iosremote/serverList_vc.m            |   28 
 ios/iosremote/iosremote/slideShowPreviewTable_vc.m |    1 
 sd/CppunitTest_sd_uimpress.mk                      |   13 
 sd/Library_sd.mk                                   |  982 ++++++++++-----------
 sd/source/ui/remotecontrol/AvahiNetworkService.cxx |  168 +++
 sd/source/ui/remotecontrol/AvahiNetworkService.hxx |   37 
 sd/source/ui/remotecontrol/DiscoveryService.cxx    |   39 
 sd/source/ui/remotecontrol/DiscoveryService.hxx    |   19 
 sd/source/ui/remotecontrol/OSXNetworkService.h     |    2 
 sd/source/ui/remotecontrol/OSXNetworkService.hxx   |   38 
 sd/source/ui/remotecontrol/OSXNetworkService.mm    |    2 
 sd/source/ui/remotecontrol/Receiver.cxx            |   16 
 sd/source/ui/remotecontrol/ZeroconfService.hxx     |   43 
 sd/source/ui/sidebar/PanelFactory.cxx              |    2 
 sd/source/ui/slideshow/slideshowimpl.cxx           |   50 +
 sd/source/ui/slideshow/slideshowimpl.hxx           |    2 
 slideshow/source/engine/pointersymbol.cxx          |  215 ++++
 slideshow/source/engine/pointersymbol.hxx          |   97 ++
 21 files changed, 1263 insertions(+), 545 deletions(-)

New commits:
commit 65134fb75c3e94b7869fb6d490f88bf4b252760e
Author: Siqi LIU <me at siqi.fr>
Date:   Thu Jul 25 17:27:10 2013 +0200

    minor updates for avahi/bonjour refacotration
    
    Change-Id: I89e0115ddbea953de4ee0468c66e949070087a96

diff --git a/configure.ac b/configure.ac
index 9f75304..496c29d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -799,6 +799,11 @@ AC_ARG_ENABLE(atl,
     ],
 ,)
 
+AC_ARG_ENABLE(avahi,
+    AS_HELP_STRING([--disable-avahi],
+        [Determines whether to use the avahi support for impress remote zeroconf.]),
+,enable_avahi=yes)
+
 AC_ARG_ENABLE(werror,
     AS_HELP_STRING([--enable-werror],
         [Turn warnings to errors. (Has no effect in modules where the treating
@@ -942,11 +947,6 @@ AC_ARG_ENABLE(gio,
         [Determines whether to use the GIO support.]),
 ,enable_gio=yes)
 
-AC_ARG_ENABLE(avahi,
-    AS_HELP_STRING([--disable-avahi],
-        [Determines whether to use the avahi support for impress remote zeroconf.]),
-,enable_avahi=yes)
-
 AC_ARG_ENABLE(telepathy,
     AS_HELP_STRING([--enable-telepathy],
         [Determines whether to enable Telepathy for collaboration.]),
diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 8fa24f5..c1a66ca 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -71,12 +71,20 @@ $(eval $(call gb_CppunitTest_use_system_darwin_frameworks,sd_uimpress,\
 ))
 endif
 
+ifeq ($(OS), LINUX)
 $(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\
 	boost_headers \
-    gtk \
-    dbus \
-    avahi \
+        gtk \
+        dbus \
+        avahi \
 ))
+else
+$(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\
+	boost_headers \
+        gtk \
+        dbus \
+))
+endif
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sd_uimpress,\
     sd/qa/unit/uimpress \
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index a6b7590..9466102 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -94,12 +94,20 @@ $(eval $(call gb_Library_use_libraries,sd,\
 	$(gb_UWINAPI) \
 ))
 
+ifeq ($(OS), LINUX)
 $(eval $(call gb_Library_use_externals,sd,\
 	boost_headers \
 	libxml2 \
 	dbus \
 	avahi \
 ))
+else
+$(eval $(call gb_Library_use_externals,sd,\
+	boost_headers \
+	libxml2 \
+	dbus \
+))
+endif
 
 ifeq ($(OS),WNT)
 $(eval $(call gb_Library_use_system_win32_libs,sd,\
@@ -537,10 +545,6 @@ $(eval $(call gb_Library_add_objcxxobjects,sd,\
 	sd/source/ui/remotecontrol/OSXNetworkService \
 ))
 
-$(eval $(call gb_Library_add_exception_objects,sd,\
-	sd/source/ui/remotecontrol/OSXNetworkService \
-))
-
 else
 
 ifeq ($(OS),LINUX)
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index eba3aa0..262c47a 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -13,7 +13,6 @@
 #include <unistd.h>
 #include <algorithm>
 #include <vector>
-#include <thread>
 #include <iostream>
 
 #include <comphelper/processfactory.hxx>
diff --git a/sd/source/ui/remotecontrol/OSXNetworkService.h b/sd/source/ui/remotecontrol/OSXNetworkService.h
index f0af0da..f8f0e9c 100644
--- a/sd/source/ui/remotecontrol/OSXNetworkService.h
+++ b/sd/source/ui/remotecontrol/OSXNetworkService.h
@@ -19,7 +19,7 @@
   #import <Foundation/NSRunLoop.h>
  #include <postmac.h>
 
- at interface OSXNetworkService : NSObject<NSNetServiceDelegate>
+ at interface OSXBonjourService : NSObject<NSNetServiceDelegate>
 {
     NSNetService *netService;
 }
diff --git a/sd/source/ui/remotecontrol/OSXNetworkService.hxx b/sd/source/ui/remotecontrol/OSXNetworkService.hxx
index 6659d75..bbbc0cf 100644
--- a/sd/source/ui/remotecontrol/OSXNetworkService.hxx
+++ b/sd/source/ui/remotecontrol/OSXNetworkService.hxx
@@ -7,7 +7,6 @@
 #include <string.h>
 #include <algorithm>
 #include <vector>
-#include <thread>
 #include <iostream>
 
 #include <osl/conditn.hxx> // Include this early to avoid error as check() gets defined by some SDK header to empty
@@ -22,16 +21,16 @@ namespace sd {
     class OSXNetworkService : public ZeroconfService
     {
     private:
-        OSXNetworkService osxservice;
+        OSXBonjourService *osxservice;
     public:
-        OSXNetworkService(const string& aname = "", uint aport = 1599)
+        OSXNetworkService(const std::string& aname = "", unsigned int aport = 1599)
             : ZeroconfService(aname, aport){}
 
         void clear() {
             [osxservice dealloc];
         }
         void setup() {
-            osxservice = [[OSXNetworkService alloc] init];
+            osxservice = [[OSXBonjourService alloc] init];
             [osxservice publishImpressRemoteServiceOnLocalNetworkWithName: @""];
         };
     };
diff --git a/sd/source/ui/remotecontrol/OSXNetworkService.mm b/sd/source/ui/remotecontrol/OSXNetworkService.mm
index 8e81def..d7f3ebc 100644
--- a/sd/source/ui/remotecontrol/OSXNetworkService.mm
+++ b/sd/source/ui/remotecontrol/OSXNetworkService.mm
@@ -13,7 +13,7 @@
  #import "OSXNetworkService.h"
 #include <postmac.h>
 
- at implementation OSXNetworkService
+ at implementation OSXBonjourService
 
 - (void) publishImpressRemoteServiceOnLocalNetworkWithName:(NSString *)sName
 {
diff --git a/sd/source/ui/remotecontrol/Receiver.cxx b/sd/source/ui/remotecontrol/Receiver.cxx
index 556926d..40fc734 100644
--- a/sd/source/ui/remotecontrol/Receiver.cxx
+++ b/sd/source/ui/remotecontrol/Receiver.cxx
@@ -121,12 +121,12 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand )
     }
     else if (aCommand[0].equals( "pointer_started" ))
     {
-        xSlideShowController->setPointerMode(true);
+        // xSlideShowController->setPointerMode(true);
         std::cerr << "Pointer started, we display the pointer on screen"<< std::endl;
     }
     else if (aCommand[0].equals( "pointer_dismissed" ))
     {
-        xSlideShowController->setPointerMode(false);
+        // xSlideShowController->setPointerMode(false);
         std::cerr << "Pointer dismissed, we hide the pointer on screen"<< std::endl;
     }
     else if (aCommand[0].equals( "pointer_coordination" ))
@@ -136,7 +136,7 @@ void Receiver::executeCommand( const std::vector<OString> &aCommand )
         std::cerr << "("<<x<<","<<y<<")"<< std::endl;
         const ::com::sun::star::geometry::RealPoint2D pos(x,y);
         // Same problem here...
-        xSlideShowController->setPointerPosition(pos);
+        // xSlideShowController->setPointerPosition(pos);
     }
     else if ( aCommand[0].equals( "presentation_resume" ) )
     {
diff --git a/sd/source/ui/remotecontrol/ZeroconfService.hxx b/sd/source/ui/remotecontrol/ZeroconfService.hxx
index 2952fa4..a3e92fa 100644
--- a/sd/source/ui/remotecontrol/ZeroconfService.hxx
+++ b/sd/source/ui/remotecontrol/ZeroconfService.hxx
@@ -15,13 +15,12 @@
 
 struct sockaddr_in;
 
+typedef unsigned int uint;
+
 namespace sd{
 
     class ZeroconfService
     {
-    private:
-        int mSocket;
-
     protected:
         std::string name;
         uint port;
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index f7fda9b..68b9b77 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -3065,6 +3065,11 @@ void SAL_CALL SlideshowImpl::setPointerMode( bool bSwitchPointerMode ) throw (cs
                         makeAny( bSwitchPointerMode ),
                         beans::PropertyState_DIRECT_VALUE ) );
     }
+    catch ( Exception& )
+    {
+        SAL_WARN( "sd.slideshow", "sd::SlideShowImpl::setPointerMode(), "
+            "exception caught: " << comphelper::anyToString( cppu::getCaughtException() ));
+    }
 }
 
 // --------------------------------------------------------------------
@@ -3072,13 +3077,18 @@ void SAL_CALL SlideshowImpl::setPointerPosition( const ::com::sun::star::geometr
 {
     SolarMutexGuard aSolarGuard;
     if (mxShow.is()) try
-        {
-            mxShow->setProperty(
-                        beans::PropertyValue( "PointerPosition" ,
-                            -1,
-                            makeAny( pos ),
-                            beans::PropertyState_DIRECT_VALUE ) );
-        }
+    {
+        mxShow->setProperty(
+                    beans::PropertyValue( "PointerPosition" ,
+                        -1,
+                        makeAny( pos ),
+                        beans::PropertyState_DIRECT_VALUE ) );
+    }
+    catch ( Exception& )
+    {
+        SAL_WARN( "sd.slideshow", "sd::SlideShowImpl::setPointerPosition(), "
+            "exception caught: " << comphelper::anyToString( cppu::getCaughtException() ));
+    }
 }
 // --------------------------------------------------------------------
 
diff --git a/slideshow/source/engine/pointersymbol.cxx b/slideshow/source/engine/pointersymbol.cxx
index 474db63..48ad0e5 100644
--- a/slideshow/source/engine/pointersymbol.cxx
+++ b/slideshow/source/engine/pointersymbol.cxx
@@ -107,6 +107,7 @@ basegfx::B2DPoint PointerSymbol::calcSpritePos(
                                                       uno::UNO_QUERY_THROW );
     const geometry::IntegerSize2D realSize( xBitmap->getSize() );
     return basegfx::B2DPoint(
+        // pos.X pos.Y are given in 0..1, beginning from the upper left corner of the currentSlide.
         std::min<sal_Int32>( realSize.Width * pos.X, LEFT_BORDER_SPACE ),
         std::max<sal_Int32>( 0, realSize.Height * (1-pos.Y) - mxBitmap->getSize().Height
                                                 - LOWER_BORDER_SPACE ) );
diff --git a/slideshow/source/engine/pointersymbol.hxx b/slideshow/source/engine/pointersymbol.hxx
index 641626e..9dc2818 100644
--- a/slideshow/source/engine/pointersymbol.hxx
+++ b/slideshow/source/engine/pointersymbol.hxx
@@ -47,7 +47,8 @@ public:
     /** Hides the pointer symbol.
      */
     void hide() { setVisible(false); }
-
+    /** Use this method to update the pointer's position
+    */
     virtual void viewsChanged(const ::com::sun::star::geometry::RealPoint2D& pos);
 
 private:
commit 6100d94078d37cb1413a0e45460cee480ba3e211
Author: Siqi <me at siqi.fr>
Date:   Thu Jul 25 15:45:19 2013 +0200

    avahi for linux refactored
    
    Change-Id: I412d97bb8c57a66c1e395f9fe1b21fc0486173e7
    
    Signed-off-by: Siqi LIU <me at siqi.fr>

diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index e4234c2..a6b7590 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -537,6 +537,10 @@ $(eval $(call gb_Library_add_objcxxobjects,sd,\
 	sd/source/ui/remotecontrol/OSXNetworkService \
 ))
 
+$(eval $(call gb_Library_add_exception_objects,sd,\
+	sd/source/ui/remotecontrol/OSXNetworkService \
+))
+
 else
 
 ifeq ($(OS),LINUX)
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
index 8947e8d..5cb52de 100644
--- a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
@@ -1,9 +1,5 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
 #include <time.h>
-#include <stdio.h>
+#include <iostream>
 #include <stdlib.h>
 #include <assert.h>
 
@@ -17,14 +13,16 @@
 #include <avahi-common/thread-watch.h>
 
 #include "AvahiNetworkService.hxx"
+#include "ZeroconfService.hxx"
+
+using namespace sd;
 
 static AvahiClient *client = NULL;
 static AvahiThreadedPoll *threaded_poll = NULL;
 static AvahiEntryGroup *group = NULL;
-static char *name = NULL;
+static AvahiNetworkService *avahiService = NULL;
 
 static void create_services(AvahiClient *c);
-static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata);
 
 static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) {
     assert(g == group || group == NULL);
@@ -35,7 +33,7 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,
     switch (state) {
         case AVAHI_ENTRY_GROUP_ESTABLISHED :
             /* The entry group has been established successfully */
-            fprintf(stderr, "Service '%s' successfully established.\n", name);
+            std::cerr << "Service " << avahiService->getName().c_str() << " successfully established.\n";
             break;
 
         case AVAHI_ENTRY_GROUP_COLLISION : {
@@ -43,11 +41,10 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,
 
             /* A service name collision with a remote service
              * happened. Let's pick a new name */
-            n = avahi_alternative_service_name(name);
-            avahi_free(name);
-            name = n;
+            n = avahi_alternative_service_name(avahiService->getName().c_str());
+            avahiService->setName(n);
 
-            fprintf(stderr, "Service name collision, renaming service to '%s'\n", name);
+            std::cerr << "Service name collision, renaming service to " << avahiService->getName() << std::endl;
 
             /* And recreate the services */
             create_services(avahi_entry_group_get_client(g));
@@ -79,59 +76,43 @@ static void create_services(AvahiClient *c) {
     if (!group)
         if (!(group = avahi_entry_group_new(c, entry_group_callback, NULL))) {
             fprintf(stderr, "avahi_entry_group_new() failed: %s\n", avahi_strerror(avahi_client_errno(c)));
-            goto fail;
+            avahiService->clear();
         }
 
     /* If the group is empty (either because it was just created, or
      * because it was reset previously, add our entries.  */
 
     if (avahi_entry_group_is_empty(group)) {
-        fprintf(stderr, "Adding service '%s'\n", name);
-
-        /* Create some random TXT data */
+        fprintf(stderr, "Adding service '%s'\n", avahiService->getName().c_str());
         snprintf(r, sizeof(r), "random=%i", rand());
+        if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0), avahiService->getName().c_str(), "_impressremote._tcp", NULL, NULL, 1599, "local", r, NULL)) < 0) {
 
-        /* We will now add two services and one subtype to the entry
-         * group. The two services have the same name, but differ in
-         * the service type (IPP vs. BSD LPR). Only services with the
-         * same name should be put in the same entry group. */
+            if (ret == AVAHI_ERR_COLLISION){
+                /* A service name collision with a local service happened. Let's
+                 * pick a new name */
+                n = avahi_alternative_service_name(avahiService->getName().c_str());
+                avahiService->setName(n);
 
-        /* Add the service for IPP */
-        if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0), name, "_impressremote._libreoffice._tcp", NULL, NULL, 1599, "local", r, NULL)) < 0) {
+                fprintf(stderr, "Service name collision, renaming service to '%s'\n", avahiService->getName().c_str());
 
-            if (ret == AVAHI_ERR_COLLISION)
-                goto collision;
+                avahi_entry_group_reset(group);
 
-            fprintf(stderr, "Failed to add _impressremote._libreoffice._tcp service: %s\n", avahi_strerror(ret));
-            goto fail;
+                create_services(c);
+                return;
+            }
+
+            fprintf(stderr, "Failed to add _impressremote._tcp service: %s\n", avahi_strerror(ret));
+            avahiService->clear();
         }
 
         /* Tell the server to register the service */
         if ((ret = avahi_entry_group_commit(group)) < 0) {
             fprintf(stderr, "Failed to commit entry group: %s\n", avahi_strerror(ret));
-            goto fail;
+            avahiService->clear();
         }
     }
 
     return;
-
-collision:
-
-    /* A service name collision with a local service happened. Let's
-     * pick a new name */
-    n = avahi_alternative_service_name(name);
-    avahi_free(name);
-    name = n;
-
-    fprintf(stderr, "Service name collision, renaming service to '%s'\n", name);
-
-    avahi_entry_group_reset(group);
-
-    create_services(c);
-    return;
-
-fail:
-    avahi_shutdown();
 }
 
 static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata) {
@@ -141,51 +122,27 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN
 
     switch (state) {
         case AVAHI_CLIENT_S_RUNNING:
-
-            /* The server has startup successfully and registered its host
-             * name on the network, so it's time to create our services */
             create_services(c);
             break;
-
         case AVAHI_CLIENT_FAILURE:
-
             fprintf(stderr, "Client failure: %s\n", avahi_strerror(avahi_client_errno(c)));
-            avahi_shutdown();
-
+            avahiService->clear();
             break;
-
         case AVAHI_CLIENT_S_COLLISION:
-
-            /* Let's drop our registered services. When the server is back
-             * in AVAHI_SERVER_RUNNING state we will register them
-             * again with the new host name. */
-
         case AVAHI_CLIENT_S_REGISTERING:
-
-            /* The server records are now being established. This
-             * might be caused by a host name change. We need to wait
-             * for our own records to register until the host name is
-             * properly esatblished. */
-
             if (group)
                 avahi_entry_group_reset(group);
-
             break;
-
         case AVAHI_CLIENT_CONNECTING:
             ;
     }
 }
 
-
-
-
-void avahi_setup(const char * sname) {
-   /* Call this when the application starts up. */
+void AvahiNetworkService::setup() {
    int error = 0;
-   name = avahi_strdup( sname );
+   avahiService = this;
    if (!(threaded_poll = avahi_threaded_poll_new())) {
-     fprintf(stderr, "avahi_threaded_poll_new '%s' failed.\n", name);
+     fprintf(stderr, "avahi_threaded_poll_new '%s' failed.\n", avahi_strdup( avahiService->getName().c_str() ));
      return;
    }
 
@@ -201,13 +158,10 @@ void avahi_setup(const char * sname) {
      fprintf(stderr, "avahi_threaded_poll_start failed.\n");
      return;
    }
-
-   fprintf(stderr, "setup done.\n");
 }
 
-void avahi_shutdown(void) {
+void AvahiNetworkService::clear() {
   /* Call this when the app shuts down */
-
   avahi_threaded_poll_stop(threaded_poll);
   avahi_client_free(client);
   avahi_threaded_poll_free(threaded_poll);
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.hxx b/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
index 64feb99..62809af 100644
--- a/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
@@ -1,6 +1,37 @@
 #ifndef AVAHI_NETWORK_SERVICE_H
 #define AVAHI_NETWORK_SERVICE_H
 
-    void avahi_setup(const char *);
-    void avahi_shutdown(void);
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <vector>
+#include <thread>
+#include <iostream>
+
+#include <avahi-client/client.h>
+#include <avahi-client/publish.h>
+#include <avahi-common/thread-watch.h>
+
+#include <avahi-common/alternative.h>
+#include <avahi-common/malloc.h>
+#include <avahi-common/error.h>
+#include <avahi-common/timeval.h>
+
+#include "ZeroconfService.hxx"
+
+namespace sd {
+
+    class AvahiNetworkService : public ZeroconfService
+    {
+    public:
+        AvahiNetworkService(const std::string& aname = "", uint aport = 1599)
+            : ZeroconfService(aname, aport){}
+        ~AvahiNetworkService();
+
+        void clear();
+        void setup();
+    };
+}
 #endif
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index 1e2472c..eba3aa0 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 #include <algorithm>
 #include <vector>
 #include <thread>
@@ -40,7 +41,7 @@
   #include <premac.h>
   #import <CoreFoundation/CoreFoundation.h>
   #include <postmac.h>
-  #import "OSXNetworkService.h"
+  #import "OSXNetworkService.hxx"
 #endif
 
 #ifdef LINUX
@@ -54,19 +55,21 @@ using namespace sd;
 DiscoveryService::DiscoveryService()
 {
 #ifdef MACOSX
-// Bonjour for OSX
-    osxservice = [[OSXNetworkService alloc] init];
-    [osxservice publishImpressRemoteServiceOnLocalNetworkWithName: @""];
+    // Bonjour for OSX
+    zService = new OSXNetworkService();
 #endif
 #ifdef LINUX
-// Avahi for Linux
+    // Avahi for Linux
     char hostname[1024];
     hostname[1023] = '\0';
     gethostname(hostname, 1023);
-    std::cerr << " AVAHI SETUP Called" << std::endl;
-    avahi_setup(hostname);
+
+    zService = new AvahiNetworkService(hostname);
 #endif
 
+    zService->setup();
+
+    // Old implementation for backward compatibility matter
     mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
 
     sockaddr_in aAddr;
@@ -89,9 +92,9 @@ DiscoveryService::DiscoveryService()
     multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY);
 
     rc = setsockopt( mSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
-  #ifdef WNT
+    #ifdef WNT
         (const char*)
-  #endif
+    #endif
         &multicastRequest, sizeof(multicastRequest));
 
     if (rc)
@@ -99,28 +102,22 @@ DiscoveryService::DiscoveryService()
         SAL_WARN("sd", "DiscoveryService: setsockopt failed: " << errno);
         return; // would be better to throw, but unsure if caller handles that
     }
-// #endif
 }
 
 DiscoveryService::~DiscoveryService()
 {
-  #ifdef LINUX
-      avahi_shutdown();
-  #endif
-
-  #ifdef MACOSX
-      [osxservice dealloc];
-  #endif
-
   #ifdef WNT
       closesocket( mSocket );
   #else
-      close( mSocket );
+     close( mSocket );
   #endif
+
+  zService->clear();
 }
 
 void SAL_CALL DiscoveryService::run()
 {
+  // Kept for backwrad compatibility
     char aBuffer[BUFFER_SIZE];
     while ( true )
     {
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.hxx b/sd/source/ui/remotecontrol/DiscoveryService.hxx
index 15e98cc..ce851c2 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.hxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.hxx
@@ -11,39 +11,16 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-#include <sys/types.h>
 
 #include <osl/socket.hxx>
-#include <rtl/ref.hxx>
 #include <osl/thread.hxx>
 
-#ifdef MACOSX
-  #include <osl/conditn.hxx> // Include this early to avoid error as check() gets defined by some SDK header to empty
-  #include <premac.h>
-  #import <CoreFoundation/CoreFoundation.h>
-  #include <postmac.h>
-  #import "OSXNetworkService.h"
-#endif
-
-
-/**
-* The port for use for the main communication between LibO and remote control app.
-*/
-#define PORT_DISCOVERY 1598
-#define BUFFER_SIZE 200
-
-#define CHARSET RTL_TEXTENCODING_UTF8
+#include "ZeroconfService.hxx"
 
 struct sockaddr_in;
 
 namespace sd
 {
-
-
-
     class DiscoveryService : public osl::Thread
     {
         public:
@@ -55,13 +32,9 @@ namespace sd
 
             static DiscoveryService *spService;
             virtual void SAL_CALL run();
-
-            // osl::DatagramSocket mSocket;
-            #ifdef MACOSX
-            OSXNetworkService * osxservice;
-            #endif
             int mSocket;
 
+            ZeroconfService * zService;
     };
 }
 
diff --git a/sd/source/ui/remotecontrol/OSXNetworkService.hxx b/sd/source/ui/remotecontrol/OSXNetworkService.hxx
new file mode 100644
index 0000000..6659d75
--- /dev/null
+++ b/sd/source/ui/remotecontrol/OSXNetworkService.hxx
@@ -0,0 +1,39 @@
+#ifndef OSX_NETWORK_SERVICE_HXX
+#define OSX_NETWORK_SERVICE_HXX
+
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <algorithm>
+#include <vector>
+#include <thread>
+#include <iostream>
+
+#include <osl/conditn.hxx> // Include this early to avoid error as check() gets defined by some SDK header to empty
+#include <premac.h>
+#import <CoreFoundation/CoreFoundation.h>
+#include <postmac.h>
+#import "OSXNetworkService.h"
+
+#include "ZeroconfService.hxx"
+
+namespace sd {
+    class OSXNetworkService : public ZeroconfService
+    {
+    private:
+        OSXNetworkService osxservice;
+    public:
+        OSXNetworkService(const string& aname = "", uint aport = 1599)
+            : ZeroconfService(aname, aport){}
+
+        void clear() {
+            [osxservice dealloc];
+        }
+        void setup() {
+            osxservice = [[OSXNetworkService alloc] init];
+            [osxservice publishImpressRemoteServiceOnLocalNetworkWithName: @""];
+        };
+    };
+}
+#endif
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/OSXNetworkService.mm b/sd/source/ui/remotecontrol/OSXNetworkService.mm
index f4feb3e..8e81def 100644
--- a/sd/source/ui/remotecontrol/OSXNetworkService.mm
+++ b/sd/source/ui/remotecontrol/OSXNetworkService.mm
@@ -17,7 +17,7 @@
 
 - (void) publishImpressRemoteServiceOnLocalNetworkWithName:(NSString *)sName
 {
-    netService = [[NSNetService alloc] initWithDomain:@"local" type:@"_impressremote._libreoffice._tcp" name:sName port:1599];
+    netService = [[NSNetService alloc] initWithDomain:@"local" type:@"_impressremote._tcp" name:sName port:1599];
 
   if (netService != nil) 
   {
diff --git a/sd/source/ui/remotecontrol/ZeroconfService.cxx b/sd/source/ui/remotecontrol/ZeroconfService.cxx
deleted file mode 100644
index 9c105a7..0000000
--- a/sd/source/ui/remotecontrol/ZeroconfService.cxx
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "ZeroconfService.hxx"
-#include <string>
-
-
-ZeroconfService::ZeroconfService(string aname = "", uint aport = 1599)
-    :port(aport), name(aname)
-{
-    // Defined in subclasses
-    this->setup();
-
-    mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
-
-    sockaddr_in aAddr;
-    memset(&aAddr, 0, sizeof(aAddr));
-    aAddr.sin_family = AF_INET;
-    aAddr.sin_addr.s_addr = htonl(INADDR_ANY);
-    aAddr.sin_port = htons( PORT_DISCOVERY );
-
-    int rc = bind( mSocket, (sockaddr*) &aAddr, sizeof(sockaddr_in) );
-
-    if (rc)
-    {
-        SAL_WARN("sd", "DiscoveryService: bind failed: " << errno);
-        return; // would be better to throw, but unsure if caller handles that
-    }
-
-    struct ip_mreq multicastRequest;
-
-    multicastRequest.imr_multiaddr.s_addr = inet_addr( "239.0.0.1" );
-    multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY);
-
-    rc = setsockopt( mSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
-  #ifdef WNT
-        (const char*)
-  #endif
-        &multicastRequest, sizeof(multicastRequest));
-
-    if (rc)
-    {
-        SAL_WARN("sd", "DiscoveryService: setsockopt failed: " << errno);
-        return; // would be better to throw, but unsure if caller handles that
-    }
-
-    SAL_WARN("sd", "ZeroconfService created: " << name << " port:"<< port);
-}
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/ZeroconfService.hxx b/sd/source/ui/remotecontrol/ZeroconfService.hxx
index f7dc1b5..2952fa4 100644
--- a/sd/source/ui/remotecontrol/ZeroconfService.hxx
+++ b/sd/source/ui/remotecontrol/ZeroconfService.hxx
@@ -2,20 +2,43 @@
 #define ZEROCONF_SERVICE
 
 #include <string>
+#include <stdio.h>
+#include <stdlib.h>
 
-class ZeroconfService
-{
-private:
-    string name;
-    uint port;
-
-public:
-    ZeroconfService(string aname = "", uint aport = 1599);
-    ~ZeroconfService();
-    // Clean up the service when closing
-    virtual void clear() = 0;
-    // Bonjour for OSX, Avahi for Linux
-    virtual void setup() = 0;
-};
+/**
+* The port for use for the main communication between LibO and remote control app.
+*/
+#define PORT_DISCOVERY 1598
+#define BUFFER_SIZE 200
 
+#define CHARSET RTL_TEXTENCODING_UTF8
+
+struct sockaddr_in;
+
+namespace sd{
+
+    class ZeroconfService
+    {
+    private:
+        int mSocket;
+
+    protected:
+        std::string name;
+        uint port;
+
+    public:
+        explicit ZeroconfService(const std::string& aname, uint aport)
+            :name(aname), port(aport){}
+
+        std::string getName() const {return name;}
+        void setName(const char * n) {name = n;}
+        uint getPort() const {return port;}
+
+        // Clean up the service when closing
+        virtual void clear() = 0;
+        // Bonjour for OSX, Avahi for Linux
+        virtual void setup() = 0;
+    };
+
+}
 #endif
commit 24d46ea66485ff8b5bca49ec587b41547787bf42
Author: Siqi <me at siqi.fr>
Date:   Thu Jul 25 12:03:31 2013 +0200

    avahi works
    
    Change-Id: I5302235faf8b7402347cd1d091c43f953e0c4bbe
    
    Signed-off-by: Siqi LIU <me at siqi.fr>

diff --git a/sd/CppunitTest_sd_uimpress.mk b/sd/CppunitTest_sd_uimpress.mk
index 5fb5961..8fa24f5 100644
--- a/sd/CppunitTest_sd_uimpress.mk
+++ b/sd/CppunitTest_sd_uimpress.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_CppunitTest_use_externals,sd_uimpress,\
 	boost_headers \
     gtk \
     dbus \
+    avahi \
 ))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sd_uimpress,\
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
index 2da4a74..8947e8d 100644
--- a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
@@ -1,22 +1,3 @@
-/***
-  This file is part of avahi.
-
-  avahi is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2.1 of the
-  License, or (at your option) any later version.
-
-  avahi is distributed in the hope that it will be useful, but WITHOUT
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
-  Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with avahi; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -30,72 +11,21 @@
 #include <avahi-client/publish.h>
 
 #include <avahi-common/alternative.h>
-#include <avahi-common/simple-watch.h>
 #include <avahi-common/malloc.h>
 #include <avahi-common/error.h>
 #include <avahi-common/timeval.h>
+#include <avahi-common/thread-watch.h>
 
 #include "AvahiNetworkService.hxx"
 
+static AvahiClient *client = NULL;
+static AvahiThreadedPoll *threaded_poll = NULL;
 static AvahiEntryGroup *group = NULL;
-static AvahiSimplePoll *simple_poll = NULL;
 static char *name = NULL;
 
 static void create_services(AvahiClient *c);
-static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata);
-
 static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata);
 
-int start_avahi_service(const char * serviceName){
-    AvahiClient *client = NULL;
-    int error;
-    int ret = 1;
-
-    name = avahi_strdup(serviceName);
-
-    /* Allocate main loop object */
-    if (!(simple_poll = avahi_simple_poll_new())) {
-        fprintf(stderr, "Failed to create simple poll object.\n");
-        goto fail;
-    }
-
-    /* Allocate a new client */
-    client = avahi_client_new(avahi_simple_poll_get(simple_poll), static_cast<AvahiClientFlags>(0), client_callback, NULL, &error);
-
-    /* Check wether creating the client object succeeded */
-    if (!client) {
-        fprintf(stderr, "Failed to create client: %s\n", avahi_strerror(error));
-        goto fail;
-    }
-
-    /* Run the main loop */
-    avahi_simple_poll_loop(simple_poll);
-
-    ret = 0;
-
-fail:
-
-    /* Cleanup things */
-
-    if (client)
-        avahi_client_free(client);
-
-    if (simple_poll)
-        avahi_simple_poll_free(simple_poll);
-
-    avahi_free(name);
-
-    return ret;
-}
-
-
-void clean_avahi_service(){
-    if (simple_poll)
-      avahi_simple_poll_free(simple_poll);
-
-    avahi_free(name);
-}
-
 static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) {
     assert(g == group || group == NULL);
     group = g;
@@ -129,7 +59,7 @@ static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state,
             fprintf(stderr, "Entry group failure: %s\n", avahi_strerror(avahi_client_errno(avahi_entry_group_get_client(g))));
 
             /* Some kind of failure happened while we were registering our services */
-            avahi_simple_poll_quit(simple_poll);
+            avahi_threaded_poll_quit(threaded_poll);
             break;
 
         case AVAHI_ENTRY_GROUP_UNCOMMITED:
@@ -167,12 +97,12 @@ static void create_services(AvahiClient *c) {
          * same name should be put in the same entry group. */
 
         /* Add the service for IPP */
-        if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0), name, "_impressremote._tcp", NULL, NULL, 1599, "test=blah", r, NULL)) < 0) {
+        if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0), name, "_impressremote._libreoffice._tcp", NULL, NULL, 1599, "local", r, NULL)) < 0) {
 
             if (ret == AVAHI_ERR_COLLISION)
                 goto collision;
 
-            fprintf(stderr, "Failed to add _ipp._tcp service: %s\n", avahi_strerror(ret));
+            fprintf(stderr, "Failed to add _impressremote._libreoffice._tcp service: %s\n", avahi_strerror(ret));
             goto fail;
         }
 
@@ -201,7 +131,7 @@ collision:
     return;
 
 fail:
-    avahi_simple_poll_quit(simple_poll);
+    avahi_shutdown();
 }
 
 static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata) {
@@ -220,7 +150,7 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN
         case AVAHI_CLIENT_FAILURE:
 
             fprintf(stderr, "Client failure: %s\n", avahi_strerror(avahi_client_errno(c)));
-            avahi_simple_poll_quit(simple_poll);
+            avahi_shutdown();
 
             break;
 
@@ -245,4 +175,40 @@ static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UN
         case AVAHI_CLIENT_CONNECTING:
             ;
     }
-}
\ No newline at end of file
+}
+
+
+
+
+void avahi_setup(const char * sname) {
+   /* Call this when the application starts up. */
+   int error = 0;
+   name = avahi_strdup( sname );
+   if (!(threaded_poll = avahi_threaded_poll_new())) {
+     fprintf(stderr, "avahi_threaded_poll_new '%s' failed.\n", name);
+     return;
+   }
+
+   if (!(client = avahi_client_new(avahi_threaded_poll_get(threaded_poll), static_cast<AvahiClientFlags>(0), client_callback, NULL, &error))) {
+     fprintf(stderr, "avahi_client_new failed.\n");
+     return;
+   }
+
+   create_services(client);
+
+   /* Finally, start the event loop thread */
+   if (avahi_threaded_poll_start(threaded_poll) < 0) {
+     fprintf(stderr, "avahi_threaded_poll_start failed.\n");
+     return;
+   }
+
+   fprintf(stderr, "setup done.\n");
+}
+
+void avahi_shutdown(void) {
+  /* Call this when the app shuts down */
+
+  avahi_threaded_poll_stop(threaded_poll);
+  avahi_client_free(client);
+  avahi_threaded_poll_free(threaded_poll);
+}
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.hxx b/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
index cc223e0..64feb99 100644
--- a/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
@@ -1,5 +1,6 @@
 #ifndef AVAHI_NETWORK_SERVICE_H
 #define AVAHI_NETWORK_SERVICE_H
-    int start_avahi_service(const char * serviceName);
-    void clean_avahi_service();
-#endif
\ No newline at end of file
+
+    void avahi_setup(const char *);
+    void avahi_shutdown(void);
+#endif
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index cae88f1..1e2472c 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -12,6 +12,8 @@
 #include <string.h>
 #include <algorithm>
 #include <vector>
+#include <thread>
+#include <iostream>
 
 #include <comphelper/processfactory.hxx>
 #include <rtl/strbuf.hxx>
@@ -52,13 +54,17 @@ using namespace sd;
 DiscoveryService::DiscoveryService()
 {
 #ifdef MACOSX
-    OSXNetworkService * service = [[OSXNetworkService alloc] init];
-    [service publishImpressRemoteServiceOnLocalNetworkWithName: @""];
+// Bonjour for OSX
+    osxservice = [[OSXNetworkService alloc] init];
+    [osxservice publishImpressRemoteServiceOnLocalNetworkWithName: @""];
 #endif
-
 #ifdef LINUX
 // Avahi for Linux
-    start_avahi_service("HP");
+    char hostname[1024];
+    hostname[1023] = '\0';
+    gethostname(hostname, 1023);
+    std::cerr << " AVAHI SETUP Called" << std::endl;
+    avahi_setup(hostname);
 #endif
 
     mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
@@ -99,7 +105,11 @@ DiscoveryService::DiscoveryService()
 DiscoveryService::~DiscoveryService()
 {
   #ifdef LINUX
-      clean_avahi_service();
+      avahi_shutdown();
+  #endif
+
+  #ifdef MACOSX
+      [osxservice dealloc];
   #endif
 
   #ifdef WNT
@@ -107,12 +117,10 @@ DiscoveryService::~DiscoveryService()
   #else
       close( mSocket );
   #endif
-// #endif
 }
 
 void SAL_CALL DiscoveryService::run()
 {
-// #ifndef MACOSX
     char aBuffer[BUFFER_SIZE];
     while ( true )
     {
@@ -136,7 +144,6 @@ void SAL_CALL DiscoveryService::run()
             }
         }
     }
-// #endif
 }
 
 DiscoveryService *sd::DiscoveryService::spService = NULL;
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.hxx b/sd/source/ui/remotecontrol/DiscoveryService.hxx
index 846b211..15e98cc 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.hxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.hxx
@@ -20,6 +20,15 @@
 #include <rtl/ref.hxx>
 #include <osl/thread.hxx>
 
+#ifdef MACOSX
+  #include <osl/conditn.hxx> // Include this early to avoid error as check() gets defined by some SDK header to empty
+  #include <premac.h>
+  #import <CoreFoundation/CoreFoundation.h>
+  #include <postmac.h>
+  #import "OSXNetworkService.h"
+#endif
+
+
 /**
 * The port for use for the main communication between LibO and remote control app.
 */
@@ -48,6 +57,9 @@ namespace sd
             virtual void SAL_CALL run();
 
             // osl::DatagramSocket mSocket;
+            #ifdef MACOSX
+            OSXNetworkService * osxservice;
+            #endif
             int mSocket;
 
     };
diff --git a/sd/source/ui/remotecontrol/OSXNetworkService.mm b/sd/source/ui/remotecontrol/OSXNetworkService.mm
index 8e81def..f4feb3e 100644
--- a/sd/source/ui/remotecontrol/OSXNetworkService.mm
+++ b/sd/source/ui/remotecontrol/OSXNetworkService.mm
@@ -17,7 +17,7 @@
 
 - (void) publishImpressRemoteServiceOnLocalNetworkWithName:(NSString *)sName
 {
-    netService = [[NSNetService alloc] initWithDomain:@"local" type:@"_impressremote._tcp" name:sName port:1599];
+    netService = [[NSNetService alloc] initWithDomain:@"local" type:@"_impressremote._libreoffice._tcp" name:sName port:1599];
 
   if (netService != nil) 
   {
diff --git a/sd/source/ui/remotecontrol/ZeroconfService.cxx b/sd/source/ui/remotecontrol/ZeroconfService.cxx
new file mode 100644
index 0000000..9c105a7
--- /dev/null
+++ b/sd/source/ui/remotecontrol/ZeroconfService.cxx
@@ -0,0 +1,45 @@
+#include "ZeroconfService.hxx"
+#include <string>
+
+
+ZeroconfService::ZeroconfService(string aname = "", uint aport = 1599)
+    :port(aport), name(aname)
+{
+    // Defined in subclasses
+    this->setup();
+
+    mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
+
+    sockaddr_in aAddr;
+    memset(&aAddr, 0, sizeof(aAddr));
+    aAddr.sin_family = AF_INET;
+    aAddr.sin_addr.s_addr = htonl(INADDR_ANY);
+    aAddr.sin_port = htons( PORT_DISCOVERY );
+
+    int rc = bind( mSocket, (sockaddr*) &aAddr, sizeof(sockaddr_in) );
+
+    if (rc)
+    {
+        SAL_WARN("sd", "DiscoveryService: bind failed: " << errno);
+        return; // would be better to throw, but unsure if caller handles that
+    }
+
+    struct ip_mreq multicastRequest;
+
+    multicastRequest.imr_multiaddr.s_addr = inet_addr( "239.0.0.1" );
+    multicastRequest.imr_interface.s_addr = htonl(INADDR_ANY);
+
+    rc = setsockopt( mSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP,
+  #ifdef WNT
+        (const char*)
+  #endif
+        &multicastRequest, sizeof(multicastRequest));
+
+    if (rc)
+    {
+        SAL_WARN("sd", "DiscoveryService: setsockopt failed: " << errno);
+        return; // would be better to throw, but unsure if caller handles that
+    }
+
+    SAL_WARN("sd", "ZeroconfService created: " << name << " port:"<< port);
+}
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/ZeroconfService.hxx b/sd/source/ui/remotecontrol/ZeroconfService.hxx
new file mode 100644
index 0000000..f7dc1b5
--- /dev/null
+++ b/sd/source/ui/remotecontrol/ZeroconfService.hxx
@@ -0,0 +1,21 @@
+#ifndef ZEROCONF_SERVICE
+#define ZEROCONF_SERVICE
+
+#include <string>
+
+class ZeroconfService
+{
+private:
+    string name;
+    uint port;
+
+public:
+    ZeroconfService(string aname = "", uint aport = 1599);
+    ~ZeroconfService();
+    // Clean up the service when closing
+    virtual void clear() = 0;
+    // Bonjour for OSX, Avahi for Linux
+    virtual void setup() = 0;
+};
+
+#endif
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index dbdd48b..c2f0a74 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -78,7 +78,7 @@ Reference<XInterface> SAL_CALL PanelFactory_createInstance (
     if (!bSidebar)
     {
         SAL_WARN( "sd", "Creating a disabled sidebar factory" );
-	return NULL;
+    return NULL;
     }
 
     return Reference<XInterface>(static_cast<XWeak*>(new PanelFactory(rxContext)));
commit d041980a7aad0e6d111752ca98db42f9853a3c6b
Author: Siqi <me at siqi.fr>
Date:   Wed Jul 24 11:16:31 2013 +0200

    avahi patch
    
    Change-Id: I782389f00f486158313fd87bd36c0726f56f6ab6
    
    Signed-off-by: Siqi LIU <me at siqi.fr>

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 8bfe445..233e176 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1710,7 +1710,7 @@ $(call gb_LinkTarget_set_include,$(1),\
 )
 
 $(call gb_LinkTarget_add_defs,$(1),\
-    -DENABLE_GIO \
+	-DENABLE_GIO \
 )
 
 $(call gb_LinkTarget_add_libs,$(1),$(GIO_LIBS))
@@ -1725,6 +1725,31 @@ endef
 
 endif # ENABLE_GIO
 
+ifeq ($(ENABLE_AVAHI),TRUE)
+
+define gb_LinkTarget__use_avahi
+$(call gb_LinkTarget_set_include,$(1),\
+	$$(INCLUDE) \
+	$(AVAHI_CFLAGS) \
+)
+
+$(call gb_LinkTarget_add_defs,$(1),\
+    -DENABLE_AVAHI \
+)
+
+$(call gb_LinkTarget_add_libs,$(1),$(AVAHI_LIBS))
+
+endef
+
+else # ENABLE_AVAHI
+
+define gb_LinkTarget__use_AVAHI
+
+endef
+
+endif # ENABLE_AVAHI
+
+
 define gb_LinkTarget__use_gtk
 $(call gb_LinkTarget_set_include,$(1),\
 	$$(INCLUDE) \
diff --git a/config_host.mk.in b/config_host.mk.in
index e848c27..343d9b5 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -116,6 +116,7 @@ export ENABLE_EVOAB2=@ENABLE_EVOAB2@
 export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
 export ENABLE_GCONF=@ENABLE_GCONF@
 export ENABLE_GIO=@ENABLE_GIO@
+export ENABLE_AVAHI=@ENABLE_AVAHI@
 export ENABLE_GNOMEVFS=@ENABLE_GNOMEVFS@
 export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@
 export ENABLE_HARFBUZZ=@ENABLE_HARFBUZZ@
@@ -177,6 +178,8 @@ export GCONF_CFLAGS=$(gb_SPACE)@GCONF_CFLAGS@
 export GCONF_LIBS=$(gb_SPACE)@GCONF_LIBS@
 export GIO_CFLAGS=$(gb_SPACE)@GIO_CFLAGS@
 export GIO_LIBS=$(gb_SPACE)@GIO_LIBS@
+export AVAHI_CFLAGS=$(gb_SPACE)@AVAHI_CFLAGS@
+export AVAHI_LIBS=$(gb_SPACE)@AVAHI_LIBS@
 export GIT_REFERENCE_SRC=@GIT_REFERENCE_SRC@
 export GIT_LINK_SRC=@GIT_LINK_SRC@
 export GIT_NEEDED_SUBMODULES=@GIT_NEEDED_SUBMODULES@
diff --git a/configure.ac b/configure.ac
index 9f59a1b..9f75304 100644
--- a/configure.ac
+++ b/configure.ac
@@ -942,6 +942,11 @@ AC_ARG_ENABLE(gio,
         [Determines whether to use the GIO support.]),
 ,enable_gio=yes)
 
+AC_ARG_ENABLE(avahi,
+    AS_HELP_STRING([--disable-avahi],
+        [Determines whether to use the avahi support for impress remote zeroconf.]),
+,enable_avahi=yes)
+
 AC_ARG_ENABLE(telepathy,
     AS_HELP_STRING([--enable-telepathy],
         [Determines whether to enable Telepathy for collaboration.]),
@@ -11381,6 +11386,25 @@ AC_SUBST(CAIRO_CFLAGS)
 AC_SUBST(CAIRO_LIBS)
 
 dnl ===================================================================
+dnl Test whether to use avahi
+dnl ===================================================================
+AC_MSG_CHECKING([whether to enable avahi support])
+if test "$_os" != "WINNT" -a "$_os" != "Darwin" -a "$enable_avahi" = "yes"; then
+    PKG_CHECK_MODULES([AVAHI], [avahi-client >= 0.6.10],
+                      [ENABLE_AVAHI="TRUE"], [ENABLE_AVAHI=""])
+    if test "$ENABLE_AVAHI" = "TRUE"; then
+        AC_DEFINE(ENABLE_AVAHI)
+        AVAHI_CFLAGS=$(printf '%s' "$AVAHI_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
+    fi
+else
+    AC_MSG_RESULT([no])
+fi
+
+AC_SUBST(ENABLE_AVAHI)
+AC_SUBST(AVAHI_CFLAGS)
+AC_SUBST(AVAHI_LIBS)
+
+dnl ===================================================================
 dnl Test whether to use liblangtag
 dnl ===================================================================
 ENABLE_LIBLANGTAG=
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 43d68ad..e4234c2 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -14,45 +14,45 @@ $(eval $(call gb_Library_set_precompiled_header,sd,$(SRCDIR)/sd/inc/pch/precompi
 $(eval $(call gb_SdiTarget_SdiTarget,sd/sdi/sdslots,sd/sdi/sdslots))
 
 $(eval $(call gb_SdiTarget_set_include,sd/sdi/sdslots,\
-    -I$(SRCDIR)/sd/inc \
-    -I$(SRCDIR)/sd/sdi \
-    -I$(SRCDIR)/svx/sdi \
-    -I$(SRCDIR)/sfx2/sdi \
-    $$(INCLUDE) \
+	-I$(SRCDIR)/sd/inc \
+	-I$(SRCDIR)/sd/sdi \
+	-I$(SRCDIR)/svx/sdi \
+	-I$(SRCDIR)/sfx2/sdi \
+	$$(INCLUDE) \
 ))
 
 $(eval $(call gb_SdiTarget_SdiTarget,sd/sdi/sdgslots,sd/sdi/sdgslots))
 
 $(eval $(call gb_SdiTarget_set_include,sd/sdi/sdgslots,\
-    -I$(SRCDIR)/sd/inc \
-    -I$(SRCDIR)/sd/sdi \
-    -I$(SRCDIR)/svx/sdi \
-    -I$(SRCDIR)/sfx2/sdi \
-    $$(INCLUDE) \
+	-I$(SRCDIR)/sd/inc \
+	-I$(SRCDIR)/sd/sdi \
+	-I$(SRCDIR)/svx/sdi \
+	-I$(SRCDIR)/sfx2/sdi \
+	$$(INCLUDE) \
 ))
 
 $(eval $(call gb_Library_add_sdi_headers,sd,\
-    sd/sdi/sdgslots \
-    sd/sdi/sdslots \
+	sd/sdi/sdgslots \
+	sd/sdi/sdslots \
 ))
 
 $(eval $(call gb_Library_set_include,sd,\
-    $$(INCLUDE) \
-    -I$(SRCDIR)/bluez_bluetooth/inc \
-    -I$(SRCDIR)/sd/inc \
-    -I$(SRCDIR)/sd/source/ui/inc \
-    -I$(SRCDIR)/sd/source/ui/slidesorter/inc \
-    -I$(WORKDIR)/SdiTarget/sd/sdi \
+	$$(INCLUDE) \
+	-I$(SRCDIR)/bluez_bluetooth/inc \
+	-I$(SRCDIR)/sd/inc \
+	-I$(SRCDIR)/sd/source/ui/inc \
+	-I$(SRCDIR)/sd/source/ui/slidesorter/inc \
+	-I$(WORKDIR)/SdiTarget/sd/sdi \
 ))
 
 $(eval $(call gb_Library_add_defs,sd,\
-    -DSD_DLLIMPLEMENTATION \
+	-DSD_DLLIMPLEMENTATION \
 ))
 
 ifneq ($(strip $(dbg_anim_log)$(DBG_ANIM_LOG)),)
 $(eval $(call gb_Library_add_defs,sd,\
-    $$(DEFS) \
-    -DDBG_ANIM_LOG \
+	$$(DEFS) \
+	-DDBG_ANIM_LOG \
 ))
 endif
 
@@ -63,34 +63,34 @@ $(eval $(call gb_Library_use_custom_headers,sd,\
 $(eval $(call gb_Library_use_sdk_api,sd))
 
 $(eval $(call gb_Library_use_libraries,sd,\
-    avmedia \
-    basegfx \
-    canvastools \
-    comphelper \
-    cppcanvas \
-    cppu \
-    cppuhelper \
-    drawinglayer \
-    editeng \
-    i18nlangtag \
-    msfilter \
-    oox \
-    sal \
-    salhelper \
-    sax \
-    sb \
-    sfx \
-    sot \
-    svl \
-    svt \
-    svxcore \
-    svx \
-    tk \
-    tl \
-    ucbhelper \
-    utl \
-    vcl \
-    xmlsecurity \
+	avmedia \
+	basegfx \
+	canvastools \
+	comphelper \
+	cppcanvas \
+	cppu \
+	cppuhelper \
+	drawinglayer \
+	editeng \
+	i18nlangtag \
+	msfilter \
+	oox \
+	sal \
+	salhelper \
+	sax \
+	sb \
+	sfx \
+	sot \
+	svl \
+	svt \
+	svxcore \
+	svx \
+	tk \
+	tl \
+	ucbhelper \
+	utl \
+	vcl \
+	xmlsecurity \
 	$(gb_UWINAPI) \
 ))
 
@@ -98,6 +98,7 @@ $(eval $(call gb_Library_use_externals,sd,\
 	boost_headers \
 	libxml2 \
 	dbus \
+	avahi \
 ))
 
 ifeq ($(OS),WNT)
@@ -110,443 +111,448 @@ endif
 $(eval $(call gb_Library_set_componentfile,sd,sd/util/sd))
 
 $(eval $(call gb_Library_add_exception_objects,sd,\
-    sd/source/core/CustomAnimationCloner \
-    sd/source/core/CustomAnimationEffect \
-    sd/source/core/CustomAnimationPreset \
-    sd/source/core/EffectMigration \
-    sd/source/core/PageListWatcher \
-    sd/source/core/TransitionPreset \
-    sd/source/core/anminfo \
-    sd/source/core/annotations/Annotation \
-    sd/source/core/annotations/AnnotationEnumeration \
-    sd/source/core/cusshow \
-    sd/source/core/drawdoc \
-    sd/source/core/drawdoc2 \
-    sd/source/core/drawdoc3 \
-    sd/source/core/drawdoc4 \
-    sd/source/core/drawdoc_animations \
-    sd/source/core/pglink \
-    sd/source/core/sdattr \
-    sd/source/core/sdiocmpt \
-    sd/source/core/sdobjfac \
-    sd/source/core/sdpage \
-    sd/source/core/sdpage2 \
-    sd/source/core/sdpage_animations \
-    sd/source/core/shapelist \
-    sd/source/core/stlfamily \
-    sd/source/core/stlpool \
-    sd/source/core/stlsheet \
-    sd/source/core/text/textapi \
-    sd/source/core/typemap \
-    sd/source/core/undo/undofactory \
-    sd/source/core/undo/undomanager \
-    sd/source/core/undo/undoobjects \
-    sd/source/core/undoanim \
-    sd/source/filter/cgm/sdcgmfilter \
-    sd/source/filter/grf/sdgrffilter \
-    sd/source/filter/html/HtmlOptionsDialog \
-    sd/source/filter/html/buttonset \
-    sd/source/filter/html/htmlex \
-    sd/source/filter/html/sdhtmlfilter \
-    sd/source/filter/sdfilter \
-    sd/source/filter/sdpptwrp \
-    sd/source/filter/xml/sdtransform \
-    sd/source/filter/xml/sdxmlwrp \
-    sd/source/helper/simplereferencecomponent \
-    sd/source/ui/accessibility/AccessibleDocumentViewBase \
-    sd/source/ui/accessibility/AccessibleDrawDocumentView \
-    sd/source/ui/accessibility/AccessibleOutlineEditSource \
-    sd/source/ui/accessibility/AccessibleOutlineView \
-    sd/source/ui/accessibility/AccessiblePageShape \
-    sd/source/ui/accessibility/AccessiblePresentationGraphicShape \
-    sd/source/ui/accessibility/AccessiblePresentationOLEShape \
-    sd/source/ui/accessibility/AccessiblePresentationShape \
-    sd/source/ui/accessibility/AccessibleScrollPanel \
-    sd/source/ui/accessibility/AccessibleSlideSorterObject \
-    sd/source/ui/accessibility/AccessibleSlideSorterView \
-    sd/source/ui/accessibility/AccessibleTreeNode \
-    sd/source/ui/accessibility/AccessibleViewForwarder \
-    sd/source/ui/accessibility/SdShapeTypes \
-    sd/source/ui/animations/CustomAnimationCreateDialog \
-    sd/source/ui/animations/CustomAnimationDialog \
-    sd/source/ui/animations/CustomAnimationList \
-    sd/source/ui/animations/CustomAnimationPane \
-    sd/source/ui/animations/DialogListBox \
-    sd/source/ui/animations/STLPropertySet \
-    sd/source/ui/animations/SlideTransitionPane \
-    sd/source/ui/animations/motionpathtag \
-    sd/source/ui/annotations/annotationmanager \
-    sd/source/ui/annotations/annotationtag \
-    sd/source/ui/annotations/annotationwindow \
-    sd/source/ui/app/sddll \
-    sd/source/ui/app/sddll1 \
-    sd/source/ui/app/sddll2 \
-    sd/source/ui/app/sdmod \
-    sd/source/ui/app/sdmod1 \
-    sd/source/ui/app/sdmod2 \
-    sd/source/ui/app/sdpopup \
-    sd/source/ui/app/sdresid \
-    sd/source/ui/app/sdxfer \
-    sd/source/ui/app/tbxww \
-    sd/source/ui/app/tmplctrl \
-    sd/source/ui/controller/slidelayoutcontroller \
-    sd/source/ui/dlg/AnimationChildWindow \
-    sd/source/ui/dlg/LayerDialogChildWindow \
-    sd/source/ui/dlg/LayerDialogContent \
-    sd/source/ui/dlg/LayerTabBar \
-    sd/source/ui/dlg/NavigatorChildWindow \
-    sd/source/ui/dlg/PaneChildWindows \
-    sd/source/ui/dlg/PaneDockingWindow \
-    sd/source/ui/dlg/PaneShells \
-    sd/source/ui/dlg/SpellDialogChildWindow \
-    sd/source/ui/dlg/TemplateScanner \
-    sd/source/ui/dlg/animobjs \
-    sd/source/ui/dlg/assclass \
-    sd/source/ui/dlg/diactrl \
-    sd/source/ui/dlg/dlgctrls \
-    sd/source/ui/dlg/docprev \
-    sd/source/ui/dlg/filedlg \
-    sd/source/ui/dlg/gluectrl \
-    sd/source/ui/dlg/ins_paste \
-    sd/source/ui/dlg/layeroptionsdlg \
-    sd/source/ui/dlg/navigatr \
-    sd/source/ui/dlg/sdabstdlg \
-    sd/source/ui/dlg/sdtreelb \
-    sd/source/ui/dlg/unchss \
-    sd/source/ui/docshell/docshel2 \
-    sd/source/ui/docshell/docshel3 \
-    sd/source/ui/docshell/docshel4 \
-    sd/source/ui/docshell/docshell \
-    sd/source/ui/docshell/grdocsh \
-    sd/source/ui/docshell/sdclient \
-    sd/source/ui/framework/configuration/ChangeRequestQueue \
-    sd/source/ui/framework/configuration/ChangeRequestQueueProcessor \
-    sd/source/ui/framework/configuration/Configuration \
-    sd/source/ui/framework/configuration/ConfigurationClassifier \
-    sd/source/ui/framework/configuration/ConfigurationController \
-    sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster \
-    sd/source/ui/framework/configuration/ConfigurationControllerResourceManager \
-    sd/source/ui/framework/configuration/ConfigurationTracer \
-    sd/source/ui/framework/configuration/ConfigurationUpdater \
-    sd/source/ui/framework/configuration/GenericConfigurationChangeRequest \
-    sd/source/ui/framework/configuration/ResourceFactoryManager \
-    sd/source/ui/framework/configuration/ResourceId \
-    sd/source/ui/framework/configuration/UpdateRequest \
-    sd/source/ui/framework/factories/BasicPaneFactory \
-    sd/source/ui/framework/factories/BasicToolBarFactory \
-    sd/source/ui/framework/factories/BasicViewFactory \
-    sd/source/ui/framework/factories/ChildWindowPane \
-    sd/source/ui/framework/factories/FrameWindowPane \
-    sd/source/ui/framework/factories/FullScreenPane \
-    sd/source/ui/framework/factories/Pane \
-    sd/source/ui/framework/factories/PresentationFactory \
-    sd/source/ui/framework/factories/TaskPanelFactory \
-    sd/source/ui/framework/factories/ViewShellWrapper \
-    sd/source/ui/framework/module/CenterViewFocusModule \
-    sd/source/ui/framework/module/DrawModule \
-    sd/source/ui/framework/module/ImpressModule \
-    sd/source/ui/framework/module/ModuleController \
-    sd/source/ui/framework/module/PresentationModule \
-    sd/source/ui/framework/module/ResourceManager \
-    sd/source/ui/framework/module/ShellStackGuard \
-    sd/source/ui/framework/module/SlideSorterModule \
-    sd/source/ui/framework/module/ToolBarModule \
-    sd/source/ui/framework/module/ToolPanelModule \
-    sd/source/ui/framework/module/ViewTabBarModule \
-    sd/source/ui/framework/tools/FrameworkHelper \
-    sd/source/ui/func/bulmaper \
-    sd/source/ui/func/fuarea \
-    sd/source/ui/func/fubullet \
-    sd/source/ui/func/fuchar \
-    sd/source/ui/func/fucon3d \
-    sd/source/ui/func/fuconarc \
-    sd/source/ui/func/fuconbez \
-    sd/source/ui/func/fuconcs \
-    sd/source/ui/func/fuconnct \
-    sd/source/ui/func/fuconrec \
-    sd/source/ui/func/fuconstr \
-    sd/source/ui/func/fuconuno \
-    sd/source/ui/func/fucopy \
-    sd/source/ui/func/fucushow \
-    sd/source/ui/func/fudraw \
-    sd/source/ui/func/fudspord \
-    sd/source/ui/func/fuediglu \
-    sd/source/ui/func/fuexpand \
-    sd/source/ui/func/fuformatpaintbrush \
-    sd/source/ui/func/fuhhconv \
-    sd/source/ui/func/fuinsert \
-    sd/source/ui/func/fuinsfil \
-    sd/source/ui/func/fuline \
-    sd/source/ui/func/fulinend \
-    sd/source/ui/func/fulink \
-    sd/source/ui/func/fumeasur \
-    sd/source/ui/func/fumorph \
-    sd/source/ui/func/fuoaprms \
-    sd/source/ui/func/fuolbull \
-    sd/source/ui/func/fuoltext \
-    sd/source/ui/func/fuoutl \
-    sd/source/ui/func/fupage \
-    sd/source/ui/func/fuparagr \
-    sd/source/ui/func/fupoor \
-    sd/source/ui/func/fuprlout \
-    sd/source/ui/func/fuprobjs \
-    sd/source/ui/func/fuscale \
-    sd/source/ui/func/fusearch \
-    sd/source/ui/func/fusel \
-    sd/source/ui/func/fusldlg \
-    sd/source/ui/func/fusnapln \
-    sd/source/ui/func/fusumry \
-    sd/source/ui/func/futempl \
-    sd/source/ui/func/futhes \
-    sd/source/ui/func/futransf \
-    sd/source/ui/func/futxtatt \
-    sd/source/ui/func/fuvect \
-    sd/source/ui/func/fuzoom \
-    sd/source/ui/func/sdundo \
-    sd/source/ui/func/sdundogr \
-    sd/source/ui/func/smarttag \
-    sd/source/ui/func/undoback \
-    sd/source/ui/func/undoheaderfooter \
-    sd/source/ui/func/undolayer \
-    sd/source/ui/func/undopage \
-    sd/source/ui/func/unmovss \
-    sd/source/ui/func/unoaprms \
-    sd/source/ui/func/unprlout \
-    sd/source/ui/presenter/CanvasUpdateRequester \
-    sd/source/ui/presenter/PresenterCanvas \
-    sd/source/ui/presenter/PresenterHelper \
-    sd/source/ui/presenter/PresenterPreviewCache \
-    sd/source/ui/presenter/PresenterTextView \
-    sd/source/ui/presenter/SlideRenderer \
-    sd/source/ui/sidebar/AllMasterPagesSelector \
-    sd/source/ui/sidebar/CurrentMasterPagesSelector \
-    sd/source/ui/sidebar/CustomAnimationPanel \
-    sd/source/ui/sidebar/DocumentHelper \
-    sd/source/ui/sidebar/LayoutMenu \
-    sd/source/ui/sidebar/MasterPageContainer \
-    sd/source/ui/sidebar/MasterPageContainerFiller \
-    sd/source/ui/sidebar/MasterPageContainerProviders \
-    sd/source/ui/sidebar/MasterPageContainerQueue \
-    sd/source/ui/sidebar/MasterPageDescriptor \
-    sd/source/ui/sidebar/MasterPagesSelector \
-    sd/source/ui/sidebar/NavigatorWrapper \
-    sd/source/ui/sidebar/PanelBase \
-    sd/source/ui/sidebar/PanelFactory \
-    sd/source/ui/sidebar/PreviewValueSet \
-    sd/source/ui/sidebar/RecentlyUsedMasterPages \
-    sd/source/ui/sidebar/RecentMasterPagesSelector \
-    sd/source/ui/sidebar/SlideTransitionPanel \
-    sd/source/ui/slideshow/PaneHider \
-    sd/source/ui/slideshow/SlideShowRestarter \
-    sd/source/ui/slideshow/showwin \
-    sd/source/ui/slideshow/slideshow \
-    sd/source/ui/slideshow/slideshowimpl \
-    sd/source/ui/slideshow/slideshowviewimpl \
-    sd/source/ui/slidesorter/cache/SlsBitmapCache \
-    sd/source/ui/slidesorter/cache/SlsBitmapCompressor \
-    sd/source/ui/slidesorter/cache/SlsBitmapFactory \
-    sd/source/ui/slidesorter/cache/SlsCacheCompactor \
-    sd/source/ui/slidesorter/cache/SlsCacheConfiguration \
-    sd/source/ui/slidesorter/cache/SlsGenericPageCache \
-    sd/source/ui/slidesorter/cache/SlsPageCache \
-    sd/source/ui/slidesorter/cache/SlsPageCacheManager \
-    sd/source/ui/slidesorter/cache/SlsQueueProcessor \
-    sd/source/ui/slidesorter/cache/SlsRequestFactory \
-    sd/source/ui/slidesorter/cache/SlsRequestQueue \
-    sd/source/ui/slidesorter/controller/SlideSorterController \
-    sd/source/ui/slidesorter/controller/SlsAnimationFunction \
-    sd/source/ui/slidesorter/controller/SlsAnimator \
-    sd/source/ui/slidesorter/controller/SlsClipboard \
-    sd/source/ui/slidesorter/controller/SlsCurrentSlideManager \
-    sd/source/ui/slidesorter/controller/SlsDragAndDropContext \
-    sd/source/ui/slidesorter/controller/SlsFocusManager \
-    sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler \
-    sd/source/ui/slidesorter/controller/SlsListener \
-    sd/source/ui/slidesorter/controller/SlsPageSelector \
-    sd/source/ui/slidesorter/controller/SlsProperties \
-    sd/source/ui/slidesorter/controller/SlsScrollBarManager \
-    sd/source/ui/slidesorter/controller/SlsSelectionFunction \
-    sd/source/ui/slidesorter/controller/SlsSelectionManager \
-    sd/source/ui/slidesorter/controller/SlsSelectionObserver \
-    sd/source/ui/slidesorter/controller/SlsSlotManager \
-    sd/source/ui/slidesorter/controller/SlsTransferableData \
-    sd/source/ui/slidesorter/controller/SlsVisibleAreaManager \
-    sd/source/ui/slidesorter/model/SlideSorterModel \
-    sd/source/ui/slidesorter/model/SlsPageDescriptor \
-    sd/source/ui/slidesorter/model/SlsPageEnumeration \
-    sd/source/ui/slidesorter/model/SlsPageEnumerationProvider \
-    sd/source/ui/slidesorter/model/SlsVisualState \
-    sd/source/ui/slidesorter/shell/SlideSorter \
-    sd/source/ui/slidesorter/shell/SlideSorterService \
-    sd/source/ui/slidesorter/shell/SlideSorterViewShell \
-    sd/source/ui/slidesorter/view/SlideSorterView \
-    sd/source/ui/slidesorter/view/SlsFontProvider \
-    sd/source/ui/slidesorter/view/SlsFramePainter \
-    sd/source/ui/slidesorter/view/SlsInsertAnimator \
-    sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay \
-    sd/source/ui/slidesorter/view/SlsLayeredDevice \
-    sd/source/ui/slidesorter/view/SlsLayouter \
-    sd/source/ui/slidesorter/view/SlsPageObjectLayouter \
-    sd/source/ui/slidesorter/view/SlsPageObjectPainter \
-    sd/source/ui/slidesorter/view/SlsTheme \
-    sd/source/ui/slidesorter/view/SlsToolTip \
-    sd/source/ui/slidesorter/view/SlsViewCacheContext \
-    sd/source/ui/table/TableDesignPane \
-    sd/source/ui/table/tablefunction \
-    sd/source/ui/table/tableobjectbar \
-    sd/source/ui/toolpanel/ControlContainer \
-    sd/source/ui/toolpanel/LayoutMenu \
-    sd/source/ui/toolpanel/ScrollPanel \
-    sd/source/ui/toolpanel/SlideSorterCacheDisplay \
-    sd/source/ui/toolpanel/SubToolPanel \
-    sd/source/ui/toolpanel/TaskPaneControlFactory \
-    sd/source/ui/toolpanel/TaskPaneFocusManager \
-    sd/source/ui/toolpanel/TaskPaneShellManager \
-    sd/source/ui/toolpanel/TaskPaneTreeNode \
-    sd/source/ui/toolpanel/TitleBar \
-    sd/source/ui/toolpanel/TitledControl \
-    sd/source/ui/toolpanel/ToolPanel \
-    sd/source/ui/toolpanel/ToolPanelFactory \
-    sd/source/ui/toolpanel/ToolPanelUIElement \
-    sd/source/ui/toolpanel/ToolPanelViewShell \
-    sd/source/ui/toolpanel/controls/AllMasterPagesSelector \
-    sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector \
-    sd/source/ui/toolpanel/controls/CustomAnimationPanel \
-    sd/source/ui/toolpanel/controls/DocumentHelper \
-    sd/source/ui/toolpanel/controls/MasterPageContainer \
-    sd/source/ui/toolpanel/controls/MasterPageContainerFiller \
-    sd/source/ui/toolpanel/controls/MasterPageContainerProviders \
-    sd/source/ui/toolpanel/controls/MasterPageContainerQueue \
-    sd/source/ui/toolpanel/controls/MasterPageDescriptor \
-    sd/source/ui/toolpanel/controls/MasterPageObserver \
-    sd/source/ui/toolpanel/controls/MasterPagesPanel \
-    sd/source/ui/toolpanel/controls/MasterPagesSelector \
-    sd/source/ui/toolpanel/controls/PreviewValueSet \
-    sd/source/ui/toolpanel/controls/RecentMasterPagesSelector \
-    sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages \
-    sd/source/ui/toolpanel/controls/SlideTransitionPanel \
-    sd/source/ui/toolpanel/controls/TableDesignPanel \
-    sd/source/ui/tools/AsynchronousCall \
-    sd/source/ui/tools/ConfigurationAccess \
-    sd/source/ui/tools/EventMultiplexer \
-    sd/source/ui/tools/IconCache \
-    sd/source/ui/tools/IdleDetection \
-    sd/source/ui/tools/PreviewRenderer \
-    sd/source/ui/tools/PropertySet \
-    sd/source/ui/tools/SdGlobalResourceContainer \
-    sd/source/ui/tools/SlotStateListener \
-    sd/source/ui/tools/TimerBasedTaskExecution \
-    sd/source/ui/unoidl/DrawController \
-    sd/source/ui/unoidl/SdUnoDrawView \
-    sd/source/ui/unoidl/SdUnoOutlineView \
-    sd/source/ui/unoidl/SdUnoSlideView \
-    sd/source/ui/unoidl/UnoDocumentSettings \
-    sd/source/ui/unoidl/facreg \
-    sd/source/ui/unoidl/randomnode \
-    sd/source/ui/unoidl/unocpres \
-    sd/source/ui/unoidl/unodoc \
-    sd/source/ui/unoidl/unolayer \
-    sd/source/ui/unoidl/unomodel \
-    sd/source/ui/unoidl/unomodule \
-    sd/source/ui/unoidl/unoobj \
-    sd/source/ui/unoidl/unopage \
-    sd/source/ui/unoidl/unopback \
-    sd/source/ui/unoidl/unopool \
-    sd/source/ui/unoidl/unosrch \
-    sd/source/ui/view/DocumentRenderer \
-    sd/source/ui/view/FormShellManager \
-    sd/source/ui/view/GraphicObjectBar \
-    sd/source/ui/view/GraphicViewShellBase \
-    sd/source/ui/view/ImpressViewShellBase \
-    sd/source/ui/view/MediaObjectBar \
-    sd/source/ui/view/OutlineViewShellBase \
-    sd/source/ui/view/Outliner \
-    sd/source/ui/view/OutlinerIterator \
-    sd/source/ui/view/PresentationViewShellBase \
-    sd/source/ui/view/SlideSorterViewShellBase \
-    sd/source/ui/view/ToolBarManager \
-    sd/source/ui/view/ViewClipboard \
-    sd/source/ui/view/ViewShellBase \
-    sd/source/ui/view/ViewShellHint \
-    sd/source/ui/view/ViewShellImplementation \
-    sd/source/ui/view/ViewShellManager \
-    sd/source/ui/view/ViewTabBar \
-    sd/source/ui/view/WindowUpdater \
-    sd/source/ui/view/clview \
-    sd/source/ui/view/drawview \
-    sd/source/ui/view/drbezob \
-    sd/source/ui/view/drtxtob \
-    sd/source/ui/view/drtxtob1 \
-    sd/source/ui/view/drviews1 \
-    sd/source/ui/view/drviews2 \
-    sd/source/ui/view/drviews3 \
-    sd/source/ui/view/drviews4 \
-    sd/source/ui/view/drviews5 \
-    sd/source/ui/view/drviews6 \
-    sd/source/ui/view/drviews7 \
-    sd/source/ui/view/drviews8 \
-    sd/source/ui/view/drviews9 \
-    sd/source/ui/view/drviewsa \
-    sd/source/ui/view/drviewsb \
-    sd/source/ui/view/drviewsc \
-    sd/source/ui/view/drviewsd \
-    sd/source/ui/view/drviewse \
-    sd/source/ui/view/drviewsf \
-    sd/source/ui/view/drviewsg \
-    sd/source/ui/view/drviewsh \
-    sd/source/ui/view/drviewsi \
-    sd/source/ui/view/drviewsj \
-    sd/source/ui/view/drvwshrg \
-    sd/source/ui/view/frmview \
-    sd/source/ui/view/grviewsh \
-    sd/source/ui/view/outlnvs2 \
-    sd/source/ui/view/outlnvsh \
-    sd/source/ui/view/outlview \
-    sd/source/ui/view/presvish \
-    sd/source/ui/view/sdruler \
-    sd/source/ui/view/sdview \
-    sd/source/ui/view/sdview2 \
-    sd/source/ui/view/sdview3 \
-    sd/source/ui/view/sdview4 \
-    sd/source/ui/view/sdview5 \
-    sd/source/ui/view/sdwindow \
-    sd/source/ui/view/tabcontr \
-    sd/source/ui/view/unmodpg \
-    sd/source/ui/view/viewoverlaymanager \
-    sd/source/ui/view/viewshe2 \
-    sd/source/ui/view/viewshe3 \
-    sd/source/ui/view/viewshel \
-    sd/source/ui/view/zoomlist \
+	sd/source/core/CustomAnimationCloner \
+	sd/source/core/CustomAnimationEffect \
+	sd/source/core/CustomAnimationPreset \
+	sd/source/core/EffectMigration \
+	sd/source/core/PageListWatcher \
+	sd/source/core/TransitionPreset \
+	sd/source/core/anminfo \
+	sd/source/core/annotations/Annotation \
+	sd/source/core/annotations/AnnotationEnumeration \
+	sd/source/core/cusshow \
+	sd/source/core/drawdoc \
+	sd/source/core/drawdoc2 \
+	sd/source/core/drawdoc3 \
+	sd/source/core/drawdoc4 \
+	sd/source/core/drawdoc_animations \
+	sd/source/core/pglink \
+	sd/source/core/sdattr \
+	sd/source/core/sdiocmpt \
+	sd/source/core/sdobjfac \
+	sd/source/core/sdpage \
+	sd/source/core/sdpage2 \
+	sd/source/core/sdpage_animations \
+	sd/source/core/shapelist \
+	sd/source/core/stlfamily \
+	sd/source/core/stlpool \
+	sd/source/core/stlsheet \
+	sd/source/core/text/textapi \
+	sd/source/core/typemap \
+	sd/source/core/undo/undofactory \
+	sd/source/core/undo/undomanager \
+	sd/source/core/undo/undoobjects \
+	sd/source/core/undoanim \
+	sd/source/filter/cgm/sdcgmfilter \
+	sd/source/filter/grf/sdgrffilter \
+	sd/source/filter/html/HtmlOptionsDialog \
+	sd/source/filter/html/buttonset \
+	sd/source/filter/html/htmlex \
+	sd/source/filter/html/sdhtmlfilter \
+	sd/source/filter/sdfilter \
+	sd/source/filter/sdpptwrp \
+	sd/source/filter/xml/sdtransform \
+	sd/source/filter/xml/sdxmlwrp \
+	sd/source/helper/simplereferencecomponent \
+	sd/source/ui/accessibility/AccessibleDocumentViewBase \
+	sd/source/ui/accessibility/AccessibleDrawDocumentView \
+	sd/source/ui/accessibility/AccessibleOutlineEditSource \
+	sd/source/ui/accessibility/AccessibleOutlineView \
+	sd/source/ui/accessibility/AccessiblePageShape \
+	sd/source/ui/accessibility/AccessiblePresentationGraphicShape \
+	sd/source/ui/accessibility/AccessiblePresentationOLEShape \
+	sd/source/ui/accessibility/AccessiblePresentationShape \
+	sd/source/ui/accessibility/AccessibleScrollPanel \
+	sd/source/ui/accessibility/AccessibleSlideSorterObject \
+	sd/source/ui/accessibility/AccessibleSlideSorterView \
+	sd/source/ui/accessibility/AccessibleTreeNode \
+	sd/source/ui/accessibility/AccessibleViewForwarder \
+	sd/source/ui/accessibility/SdShapeTypes \
+	sd/source/ui/animations/CustomAnimationCreateDialog \
+	sd/source/ui/animations/CustomAnimationDialog \
+	sd/source/ui/animations/CustomAnimationList \
+	sd/source/ui/animations/CustomAnimationPane \
+	sd/source/ui/animations/DialogListBox \
+	sd/source/ui/animations/STLPropertySet \
+	sd/source/ui/animations/SlideTransitionPane \
+	sd/source/ui/animations/motionpathtag \
+	sd/source/ui/annotations/annotationmanager \
+	sd/source/ui/annotations/annotationtag \
+	sd/source/ui/annotations/annotationwindow \
+	sd/source/ui/app/sddll \
+	sd/source/ui/app/sddll1 \
+	sd/source/ui/app/sddll2 \
+	sd/source/ui/app/sdmod \
+	sd/source/ui/app/sdmod1 \
+	sd/source/ui/app/sdmod2 \
+	sd/source/ui/app/sdpopup \
+	sd/source/ui/app/sdresid \
+	sd/source/ui/app/sdxfer \
+	sd/source/ui/app/tbxww \
+	sd/source/ui/app/tmplctrl \
+	sd/source/ui/controller/slidelayoutcontroller \
+	sd/source/ui/dlg/AnimationChildWindow \
+	sd/source/ui/dlg/LayerDialogChildWindow \
+	sd/source/ui/dlg/LayerDialogContent \
+	sd/source/ui/dlg/LayerTabBar \
+	sd/source/ui/dlg/NavigatorChildWindow \
+	sd/source/ui/dlg/PaneChildWindows \
+	sd/source/ui/dlg/PaneDockingWindow \
+	sd/source/ui/dlg/PaneShells \
+	sd/source/ui/dlg/SpellDialogChildWindow \
+	sd/source/ui/dlg/TemplateScanner \
+	sd/source/ui/dlg/animobjs \
+	sd/source/ui/dlg/assclass \
+	sd/source/ui/dlg/diactrl \
+	sd/source/ui/dlg/dlgctrls \
+	sd/source/ui/dlg/docprev \
+	sd/source/ui/dlg/filedlg \
+	sd/source/ui/dlg/gluectrl \
+	sd/source/ui/dlg/ins_paste \
+	sd/source/ui/dlg/layeroptionsdlg \
+	sd/source/ui/dlg/navigatr \
+	sd/source/ui/dlg/sdabstdlg \
+	sd/source/ui/dlg/sdtreelb \
+	sd/source/ui/dlg/unchss \
+	sd/source/ui/docshell/docshel2 \
+	sd/source/ui/docshell/docshel3 \
+	sd/source/ui/docshell/docshel4 \
+	sd/source/ui/docshell/docshell \
+	sd/source/ui/docshell/grdocsh \
+	sd/source/ui/docshell/sdclient \
+	sd/source/ui/framework/configuration/ChangeRequestQueue \
+	sd/source/ui/framework/configuration/ChangeRequestQueueProcessor \
+	sd/source/ui/framework/configuration/Configuration \
+	sd/source/ui/framework/configuration/ConfigurationClassifier \
+	sd/source/ui/framework/configuration/ConfigurationController \
+	sd/source/ui/framework/configuration/ConfigurationControllerBroadcaster \
+	sd/source/ui/framework/configuration/ConfigurationControllerResourceManager \
+	sd/source/ui/framework/configuration/ConfigurationTracer \
+	sd/source/ui/framework/configuration/ConfigurationUpdater \
+	sd/source/ui/framework/configuration/GenericConfigurationChangeRequest \
+	sd/source/ui/framework/configuration/ResourceFactoryManager \
+	sd/source/ui/framework/configuration/ResourceId \
+	sd/source/ui/framework/configuration/UpdateRequest \
+	sd/source/ui/framework/factories/BasicPaneFactory \
+	sd/source/ui/framework/factories/BasicToolBarFactory \
+	sd/source/ui/framework/factories/BasicViewFactory \
+	sd/source/ui/framework/factories/ChildWindowPane \
+	sd/source/ui/framework/factories/FrameWindowPane \
+	sd/source/ui/framework/factories/FullScreenPane \
+	sd/source/ui/framework/factories/Pane \
+	sd/source/ui/framework/factories/PresentationFactory \
+	sd/source/ui/framework/factories/TaskPanelFactory \
+	sd/source/ui/framework/factories/ViewShellWrapper \
+	sd/source/ui/framework/module/CenterViewFocusModule \
+	sd/source/ui/framework/module/DrawModule \
+	sd/source/ui/framework/module/ImpressModule \
+	sd/source/ui/framework/module/ModuleController \
+	sd/source/ui/framework/module/PresentationModule \
+	sd/source/ui/framework/module/ResourceManager \
+	sd/source/ui/framework/module/ShellStackGuard \
+	sd/source/ui/framework/module/SlideSorterModule \
+	sd/source/ui/framework/module/ToolBarModule \
+	sd/source/ui/framework/module/ToolPanelModule \
+	sd/source/ui/framework/module/ViewTabBarModule \
+	sd/source/ui/framework/tools/FrameworkHelper \
+	sd/source/ui/func/bulmaper \
+	sd/source/ui/func/fuarea \
+	sd/source/ui/func/fubullet \
+	sd/source/ui/func/fuchar \
+	sd/source/ui/func/fucon3d \
+	sd/source/ui/func/fuconarc \
+	sd/source/ui/func/fuconbez \
+	sd/source/ui/func/fuconcs \
+	sd/source/ui/func/fuconnct \
+	sd/source/ui/func/fuconrec \
+	sd/source/ui/func/fuconstr \
+	sd/source/ui/func/fuconuno \
+	sd/source/ui/func/fucopy \
+	sd/source/ui/func/fucushow \
+	sd/source/ui/func/fudraw \
+	sd/source/ui/func/fudspord \
+	sd/source/ui/func/fuediglu \
+	sd/source/ui/func/fuexpand \
+	sd/source/ui/func/fuformatpaintbrush \
+	sd/source/ui/func/fuhhconv \
+	sd/source/ui/func/fuinsert \
+	sd/source/ui/func/fuinsfil \
+	sd/source/ui/func/fuline \
+	sd/source/ui/func/fulinend \
+	sd/source/ui/func/fulink \
+	sd/source/ui/func/fumeasur \
+	sd/source/ui/func/fumorph \
+	sd/source/ui/func/fuoaprms \
+	sd/source/ui/func/fuolbull \
+	sd/source/ui/func/fuoltext \
+	sd/source/ui/func/fuoutl \
+	sd/source/ui/func/fupage \
+	sd/source/ui/func/fuparagr \
+	sd/source/ui/func/fupoor \
+	sd/source/ui/func/fuprlout \
+	sd/source/ui/func/fuprobjs \
+	sd/source/ui/func/fuscale \
+	sd/source/ui/func/fusearch \
+	sd/source/ui/func/fusel \
+	sd/source/ui/func/fusldlg \
+	sd/source/ui/func/fusnapln \
+	sd/source/ui/func/fusumry \
+	sd/source/ui/func/futempl \
+	sd/source/ui/func/futhes \
+	sd/source/ui/func/futransf \
+	sd/source/ui/func/futxtatt \
+	sd/source/ui/func/fuvect \
+	sd/source/ui/func/fuzoom \
+	sd/source/ui/func/sdundo \
+	sd/source/ui/func/sdundogr \
+	sd/source/ui/func/smarttag \
+	sd/source/ui/func/undoback \
+	sd/source/ui/func/undoheaderfooter \
+	sd/source/ui/func/undolayer \
+	sd/source/ui/func/undopage \
+	sd/source/ui/func/unmovss \
+	sd/source/ui/func/unoaprms \
+	sd/source/ui/func/unprlout \
+	sd/source/ui/presenter/CanvasUpdateRequester \
+	sd/source/ui/presenter/PresenterCanvas \
+	sd/source/ui/presenter/PresenterHelper \
+	sd/source/ui/presenter/PresenterPreviewCache \
+	sd/source/ui/presenter/PresenterTextView \
+	sd/source/ui/presenter/SlideRenderer \
+	sd/source/ui/sidebar/AllMasterPagesSelector \
+	sd/source/ui/sidebar/CurrentMasterPagesSelector \
+	sd/source/ui/sidebar/CustomAnimationPanel \
+	sd/source/ui/sidebar/DocumentHelper \
+	sd/source/ui/sidebar/LayoutMenu \
+	sd/source/ui/sidebar/MasterPageContainer \
+	sd/source/ui/sidebar/MasterPageContainerFiller \
+	sd/source/ui/sidebar/MasterPageContainerProviders \
+	sd/source/ui/sidebar/MasterPageContainerQueue \
+	sd/source/ui/sidebar/MasterPageDescriptor \
+	sd/source/ui/sidebar/MasterPagesSelector \
+	sd/source/ui/sidebar/NavigatorWrapper \
+	sd/source/ui/sidebar/PanelBase \
+	sd/source/ui/sidebar/PanelFactory \
+	sd/source/ui/sidebar/PreviewValueSet \
+	sd/source/ui/sidebar/RecentlyUsedMasterPages \
+	sd/source/ui/sidebar/RecentMasterPagesSelector \
+	sd/source/ui/sidebar/SlideTransitionPanel \
+	sd/source/ui/slideshow/PaneHider \
+	sd/source/ui/slideshow/SlideShowRestarter \
+	sd/source/ui/slideshow/showwin \
+	sd/source/ui/slideshow/slideshow \
+	sd/source/ui/slideshow/slideshowimpl \
+	sd/source/ui/slideshow/slideshowviewimpl \
+	sd/source/ui/slidesorter/cache/SlsBitmapCache \
+	sd/source/ui/slidesorter/cache/SlsBitmapCompressor \
+	sd/source/ui/slidesorter/cache/SlsBitmapFactory \
+	sd/source/ui/slidesorter/cache/SlsCacheCompactor \
+	sd/source/ui/slidesorter/cache/SlsCacheConfiguration \
+	sd/source/ui/slidesorter/cache/SlsGenericPageCache \
+	sd/source/ui/slidesorter/cache/SlsPageCache \
+	sd/source/ui/slidesorter/cache/SlsPageCacheManager \
+	sd/source/ui/slidesorter/cache/SlsQueueProcessor \
+	sd/source/ui/slidesorter/cache/SlsRequestFactory \
+	sd/source/ui/slidesorter/cache/SlsRequestQueue \
+	sd/source/ui/slidesorter/controller/SlideSorterController \
+	sd/source/ui/slidesorter/controller/SlsAnimationFunction \
+	sd/source/ui/slidesorter/controller/SlsAnimator \
+	sd/source/ui/slidesorter/controller/SlsClipboard \
+	sd/source/ui/slidesorter/controller/SlsCurrentSlideManager \
+	sd/source/ui/slidesorter/controller/SlsDragAndDropContext \
+	sd/source/ui/slidesorter/controller/SlsFocusManager \
+	sd/source/ui/slidesorter/controller/SlsInsertionIndicatorHandler \
+	sd/source/ui/slidesorter/controller/SlsListener \
+	sd/source/ui/slidesorter/controller/SlsPageSelector \
+	sd/source/ui/slidesorter/controller/SlsProperties \
+	sd/source/ui/slidesorter/controller/SlsScrollBarManager \
+	sd/source/ui/slidesorter/controller/SlsSelectionFunction \
+	sd/source/ui/slidesorter/controller/SlsSelectionManager \
+	sd/source/ui/slidesorter/controller/SlsSelectionObserver \
+	sd/source/ui/slidesorter/controller/SlsSlotManager \
+	sd/source/ui/slidesorter/controller/SlsTransferableData \
+	sd/source/ui/slidesorter/controller/SlsVisibleAreaManager \
+	sd/source/ui/slidesorter/model/SlideSorterModel \
+	sd/source/ui/slidesorter/model/SlsPageDescriptor \
+	sd/source/ui/slidesorter/model/SlsPageEnumeration \
+	sd/source/ui/slidesorter/model/SlsPageEnumerationProvider \
+	sd/source/ui/slidesorter/model/SlsVisualState \
+	sd/source/ui/slidesorter/shell/SlideSorter \
+	sd/source/ui/slidesorter/shell/SlideSorterService \
+	sd/source/ui/slidesorter/shell/SlideSorterViewShell \
+	sd/source/ui/slidesorter/view/SlideSorterView \
+	sd/source/ui/slidesorter/view/SlsFontProvider \
+	sd/source/ui/slidesorter/view/SlsFramePainter \
+	sd/source/ui/slidesorter/view/SlsInsertAnimator \
+	sd/source/ui/slidesorter/view/SlsInsertionIndicatorOverlay \
+	sd/source/ui/slidesorter/view/SlsLayeredDevice \
+	sd/source/ui/slidesorter/view/SlsLayouter \
+	sd/source/ui/slidesorter/view/SlsPageObjectLayouter \
+	sd/source/ui/slidesorter/view/SlsPageObjectPainter \
+	sd/source/ui/slidesorter/view/SlsTheme \
+	sd/source/ui/slidesorter/view/SlsToolTip \
+	sd/source/ui/slidesorter/view/SlsViewCacheContext \
+	sd/source/ui/table/TableDesignPane \
+	sd/source/ui/table/tablefunction \
+	sd/source/ui/table/tableobjectbar \
+	sd/source/ui/toolpanel/ControlContainer \
+	sd/source/ui/toolpanel/LayoutMenu \
+	sd/source/ui/toolpanel/ScrollPanel \
+	sd/source/ui/toolpanel/SlideSorterCacheDisplay \
+	sd/source/ui/toolpanel/SubToolPanel \
+	sd/source/ui/toolpanel/TaskPaneControlFactory \
+	sd/source/ui/toolpanel/TaskPaneFocusManager \
+	sd/source/ui/toolpanel/TaskPaneShellManager \
+	sd/source/ui/toolpanel/TaskPaneTreeNode \
+	sd/source/ui/toolpanel/TitleBar \
+	sd/source/ui/toolpanel/TitledControl \
+	sd/source/ui/toolpanel/ToolPanel \
+	sd/source/ui/toolpanel/ToolPanelFactory \
+	sd/source/ui/toolpanel/ToolPanelUIElement \
+	sd/source/ui/toolpanel/ToolPanelViewShell \
+	sd/source/ui/toolpanel/controls/AllMasterPagesSelector \
+	sd/source/ui/toolpanel/controls/CurrentMasterPagesSelector \
+	sd/source/ui/toolpanel/controls/CustomAnimationPanel \
+	sd/source/ui/toolpanel/controls/DocumentHelper \
+	sd/source/ui/toolpanel/controls/MasterPageContainer \
+	sd/source/ui/toolpanel/controls/MasterPageContainerFiller \
+	sd/source/ui/toolpanel/controls/MasterPageContainerProviders \
+	sd/source/ui/toolpanel/controls/MasterPageContainerQueue \
+	sd/source/ui/toolpanel/controls/MasterPageDescriptor \
+	sd/source/ui/toolpanel/controls/MasterPageObserver \
+	sd/source/ui/toolpanel/controls/MasterPagesPanel \
+	sd/source/ui/toolpanel/controls/MasterPagesSelector \
+	sd/source/ui/toolpanel/controls/PreviewValueSet \
+	sd/source/ui/toolpanel/controls/RecentMasterPagesSelector \
+	sd/source/ui/toolpanel/controls/RecentlyUsedMasterPages \
+	sd/source/ui/toolpanel/controls/SlideTransitionPanel \
+	sd/source/ui/toolpanel/controls/TableDesignPanel \
+	sd/source/ui/tools/AsynchronousCall \
+	sd/source/ui/tools/ConfigurationAccess \
+	sd/source/ui/tools/EventMultiplexer \
+	sd/source/ui/tools/IconCache \
+	sd/source/ui/tools/IdleDetection \
+	sd/source/ui/tools/PreviewRenderer \
+	sd/source/ui/tools/PropertySet \
+	sd/source/ui/tools/SdGlobalResourceContainer \
+	sd/source/ui/tools/SlotStateListener \
+	sd/source/ui/tools/TimerBasedTaskExecution \
+	sd/source/ui/unoidl/DrawController \
+	sd/source/ui/unoidl/SdUnoDrawView \
+	sd/source/ui/unoidl/SdUnoOutlineView \
+	sd/source/ui/unoidl/SdUnoSlideView \
+	sd/source/ui/unoidl/UnoDocumentSettings \
+	sd/source/ui/unoidl/facreg \
+	sd/source/ui/unoidl/randomnode \
+	sd/source/ui/unoidl/unocpres \
+	sd/source/ui/unoidl/unodoc \
+	sd/source/ui/unoidl/unolayer \
+	sd/source/ui/unoidl/unomodel \
+	sd/source/ui/unoidl/unomodule \
+	sd/source/ui/unoidl/unoobj \
+	sd/source/ui/unoidl/unopage \
+	sd/source/ui/unoidl/unopback \
+	sd/source/ui/unoidl/unopool \
+	sd/source/ui/unoidl/unosrch \
+	sd/source/ui/view/DocumentRenderer \
+	sd/source/ui/view/FormShellManager \
+	sd/source/ui/view/GraphicObjectBar \
+	sd/source/ui/view/GraphicViewShellBase \
+	sd/source/ui/view/ImpressViewShellBase \
+	sd/source/ui/view/MediaObjectBar \
+	sd/source/ui/view/OutlineViewShellBase \
+	sd/source/ui/view/Outliner \
+	sd/source/ui/view/OutlinerIterator \
+	sd/source/ui/view/PresentationViewShellBase \
+	sd/source/ui/view/SlideSorterViewShellBase \
+	sd/source/ui/view/ToolBarManager \
+	sd/source/ui/view/ViewClipboard \
+	sd/source/ui/view/ViewShellBase \
+	sd/source/ui/view/ViewShellHint \
+	sd/source/ui/view/ViewShellImplementation \
+	sd/source/ui/view/ViewShellManager \
+	sd/source/ui/view/ViewTabBar \
+	sd/source/ui/view/WindowUpdater \
+	sd/source/ui/view/clview \
+	sd/source/ui/view/drawview \
+	sd/source/ui/view/drbezob \
+	sd/source/ui/view/drtxtob \
+	sd/source/ui/view/drtxtob1 \
+	sd/source/ui/view/drviews1 \
+	sd/source/ui/view/drviews2 \
+	sd/source/ui/view/drviews3 \
+	sd/source/ui/view/drviews4 \
+	sd/source/ui/view/drviews5 \
+	sd/source/ui/view/drviews6 \
+	sd/source/ui/view/drviews7 \
+	sd/source/ui/view/drviews8 \
+	sd/source/ui/view/drviews9 \
+	sd/source/ui/view/drviewsa \
+	sd/source/ui/view/drviewsb \
+	sd/source/ui/view/drviewsc \
+	sd/source/ui/view/drviewsd \
+	sd/source/ui/view/drviewse \
+	sd/source/ui/view/drviewsf \
+	sd/source/ui/view/drviewsg \
+	sd/source/ui/view/drviewsh \
+	sd/source/ui/view/drviewsi \
+	sd/source/ui/view/drviewsj \
+	sd/source/ui/view/drvwshrg \
+	sd/source/ui/view/frmview \
+	sd/source/ui/view/grviewsh \
+	sd/source/ui/view/outlnvs2 \
+	sd/source/ui/view/outlnvsh \
+	sd/source/ui/view/outlview \
+	sd/source/ui/view/presvish \
+	sd/source/ui/view/sdruler \
+	sd/source/ui/view/sdview \
+	sd/source/ui/view/sdview2 \
+	sd/source/ui/view/sdview3 \
+	sd/source/ui/view/sdview4 \
+	sd/source/ui/view/sdview5 \
+	sd/source/ui/view/sdwindow \
+	sd/source/ui/view/tabcontr \
+	sd/source/ui/view/unmodpg \
+	sd/source/ui/view/viewoverlaymanager \
+	sd/source/ui/view/viewshe2 \
+	sd/source/ui/view/viewshe3 \
+	sd/source/ui/view/viewshel \
+	sd/source/ui/view/zoomlist \
 ))
 
 ifeq ($(ENABLE_SDREMOTE),YES)
 $(eval $(call gb_Library_add_exception_objects,sd,\
-    sd/source/ui/remotecontrol/BufferedStreamSocket \
-    sd/source/ui/remotecontrol/Communicator \
-    sd/source/ui/remotecontrol/ImagePreparer \
-    sd/source/ui/remotecontrol/Server \
-    sd/source/ui/remotecontrol/Receiver \
-    sd/source/ui/remotecontrol/Listener \
-    sd/source/ui/remotecontrol/Transmitter \
+	sd/source/ui/remotecontrol/BufferedStreamSocket \
+	sd/source/ui/remotecontrol/Communicator \
+	sd/source/ui/remotecontrol/ImagePreparer \
+	sd/source/ui/remotecontrol/Server \
+	sd/source/ui/remotecontrol/Receiver \
+	sd/source/ui/remotecontrol/Listener \
+	sd/source/ui/remotecontrol/Transmitter \
 ))
 
-ifneq ($(OS),MACOSX)
-
-$(eval $(call gb_Library_add_exception_objects,sd,\
-    sd/source/ui/remotecontrol/DiscoveryService \
+ifeq ($(OS),MACOSX)
+$(eval $(call gb_Library_add_objcxxobjects,sd,\
+	sd/source/ui/remotecontrol/DiscoveryService \
+	sd/source/ui/remotecontrol/OSXNetworkService \
 ))
 
 else
 
-$(eval $(call gb_Library_add_objcxxobjects,sd,\
-    sd/source/ui/remotecontrol/DiscoveryService \
-    sd/source/ui/remotecontrol/OSXNetworkService, \
+ifeq ($(OS),LINUX)
+$(eval $(call gb_Library_add_exception_objects,sd,\
+	sd/source/ui/remotecontrol/AvahiNetworkService \
+))
+endif
+
+$(eval $(call gb_Library_add_exception_objects,sd,\
+	sd/source/ui/remotecontrol/DiscoveryService \
 ))
 
 endif
 
 $(eval $(call gb_Library_add_defs,sd,\
-    -DENABLE_SDREMOTE \
+	-DENABLE_SDREMOTE \
 ))
 
 ifeq ($(ENABLE_SDREMOTE_BLUETOOTH),YES)
@@ -554,18 +560,18 @@ ifeq ($(ENABLE_SDREMOTE_BLUETOOTH),YES)
 ifneq ($(OS),MACOSX)
 
 $(eval $(call gb_Library_add_exception_objects,sd,\
-    sd/source/ui/remotecontrol/BluetoothServer \
+	sd/source/ui/remotecontrol/BluetoothServer \
 ))
 
 else
 
 $(eval $(call gb_Library_add_objcxxobjects,sd,\
-    sd/source/ui/remotecontrol/BluetoothServer \
-    sd/source/ui/remotecontrol/OSXBluetooth\
+	sd/source/ui/remotecontrol/BluetoothServer \
+	sd/source/ui/remotecontrol/OSXBluetooth \
 ))
 
 $(eval $(call gb_Library_add_libs,sd,\
-    -lobjc \
+	-lobjc \
 ))
 
 $(eval $(call gb_Library_use_system_darwin_frameworks,sd,\
@@ -576,7 +582,7 @@ $(eval $(call gb_Library_use_system_darwin_frameworks,sd,\
 endif
 
 $(eval $(call gb_Library_add_defs,sd,\
-    -DENABLE_SDREMOTE_BLUETOOTH \
+	-DENABLE_SDREMOTE_BLUETOOTH \
 ))
 
 endif
@@ -585,25 +591,25 @@ endif
 
 ifeq ($(OS),WNT)
 $(eval $(call gb_Library_add_cxxobjects,sd,\
-    sd/source/ui/app/optsitem \
-    sd/source/ui/func/futext \
-    , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+	sd/source/ui/app/optsitem \
+	sd/source/ui/func/futext \
+	, $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
 ))
 else
 $(eval $(call gb_Library_add_exception_objects,sd,\
-    sd/source/ui/app/optsitem \
-    sd/source/ui/func/futext \
+	sd/source/ui/app/optsitem \
+	sd/source/ui/func/futext \
 ))
 endif
 
 ifeq ($(strip $(COM)),GCC)
 $(eval $(call gb_Library_add_cxxobjects,sd,\
-    sd/source/ui/unoidl/unowcntr \
-    , $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
+	sd/source/ui/unoidl/unowcntr \
+	, $(gb_COMPILERNOOPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) \
 ))
 else
 $(eval $(call gb_Library_add_exception_objects,sd,\
-    sd/source/ui/unoidl/unowcntr \
+	sd/source/ui/unoidl/unowcntr \
 ))
 endif
 
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.cxx b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
new file mode 100644
index 0000000..2da4a74
--- /dev/null
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.cxx
@@ -0,0 +1,248 @@
+/***
+  This file is part of avahi.
+
+  avahi is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as
+  published by the Free Software Foundation; either version 2.1 of the
+  License, or (at your option) any later version.
+
+  avahi is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+  Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with avahi; if not, write to the Free Software
+  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+  USA.
+***/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <time.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+
+#include <avahi-client/client.h>
+#include <avahi-client/publish.h>
+
+#include <avahi-common/alternative.h>
+#include <avahi-common/simple-watch.h>
+#include <avahi-common/malloc.h>
+#include <avahi-common/error.h>
+#include <avahi-common/timeval.h>
+
+#include "AvahiNetworkService.hxx"
+
+static AvahiEntryGroup *group = NULL;
+static AvahiSimplePoll *simple_poll = NULL;
+static char *name = NULL;
+
+static void create_services(AvahiClient *c);
+static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata);
+
+static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata);
+
+int start_avahi_service(const char * serviceName){
+    AvahiClient *client = NULL;
+    int error;
+    int ret = 1;
+
+    name = avahi_strdup(serviceName);
+
+    /* Allocate main loop object */
+    if (!(simple_poll = avahi_simple_poll_new())) {
+        fprintf(stderr, "Failed to create simple poll object.\n");
+        goto fail;
+    }
+
+    /* Allocate a new client */
+    client = avahi_client_new(avahi_simple_poll_get(simple_poll), static_cast<AvahiClientFlags>(0), client_callback, NULL, &error);
+
+    /* Check wether creating the client object succeeded */
+    if (!client) {
+        fprintf(stderr, "Failed to create client: %s\n", avahi_strerror(error));
+        goto fail;
+    }
+
+    /* Run the main loop */
+    avahi_simple_poll_loop(simple_poll);
+
+    ret = 0;
+
+fail:
+
+    /* Cleanup things */
+
+    if (client)
+        avahi_client_free(client);
+
+    if (simple_poll)
+        avahi_simple_poll_free(simple_poll);
+
+    avahi_free(name);
+
+    return ret;
+}
+
+
+void clean_avahi_service(){
+    if (simple_poll)
+      avahi_simple_poll_free(simple_poll);
+
+    avahi_free(name);
+}
+
+static void entry_group_callback(AvahiEntryGroup *g, AvahiEntryGroupState state, AVAHI_GCC_UNUSED void *userdata) {
+    assert(g == group || group == NULL);
+    group = g;
+
+    /* Called whenever the entry group state changes */
+
+    switch (state) {
+        case AVAHI_ENTRY_GROUP_ESTABLISHED :
+            /* The entry group has been established successfully */
+            fprintf(stderr, "Service '%s' successfully established.\n", name);
+            break;
+
+        case AVAHI_ENTRY_GROUP_COLLISION : {
+            char *n;
+
+            /* A service name collision with a remote service
+             * happened. Let's pick a new name */
+            n = avahi_alternative_service_name(name);
+            avahi_free(name);
+            name = n;
+
+            fprintf(stderr, "Service name collision, renaming service to '%s'\n", name);
+
+            /* And recreate the services */
+            create_services(avahi_entry_group_get_client(g));
+            break;
+        }
+
+        case AVAHI_ENTRY_GROUP_FAILURE :
+
+            fprintf(stderr, "Entry group failure: %s\n", avahi_strerror(avahi_client_errno(avahi_entry_group_get_client(g))));
+
+            /* Some kind of failure happened while we were registering our services */
+            avahi_simple_poll_quit(simple_poll);
+            break;
+
+        case AVAHI_ENTRY_GROUP_UNCOMMITED:
+        case AVAHI_ENTRY_GROUP_REGISTERING:
+            ;
+    }
+}
+
+static void create_services(AvahiClient *c) {
+    char *n, r[128];
+    int ret;
+    assert(c);
+
+    /* If this is the first time we're called, let's create a new
+     * entry group if necessary */
+
+    if (!group)
+        if (!(group = avahi_entry_group_new(c, entry_group_callback, NULL))) {
+            fprintf(stderr, "avahi_entry_group_new() failed: %s\n", avahi_strerror(avahi_client_errno(c)));
+            goto fail;
+        }
+
+    /* If the group is empty (either because it was just created, or
+     * because it was reset previously, add our entries.  */
+
+    if (avahi_entry_group_is_empty(group)) {
+        fprintf(stderr, "Adding service '%s'\n", name);
+
+        /* Create some random TXT data */
+        snprintf(r, sizeof(r), "random=%i", rand());
+
+        /* We will now add two services and one subtype to the entry
+         * group. The two services have the same name, but differ in
+         * the service type (IPP vs. BSD LPR). Only services with the
+         * same name should be put in the same entry group. */
+
+        /* Add the service for IPP */
+        if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, static_cast<AvahiPublishFlags>(0), name, "_impressremote._tcp", NULL, NULL, 1599, "test=blah", r, NULL)) < 0) {
+
+            if (ret == AVAHI_ERR_COLLISION)
+                goto collision;
+
+            fprintf(stderr, "Failed to add _ipp._tcp service: %s\n", avahi_strerror(ret));
+            goto fail;
+        }
+
+        /* Tell the server to register the service */
+        if ((ret = avahi_entry_group_commit(group)) < 0) {
+            fprintf(stderr, "Failed to commit entry group: %s\n", avahi_strerror(ret));
+            goto fail;
+        }
+    }
+
+    return;
+
+collision:
+
+    /* A service name collision with a local service happened. Let's
+     * pick a new name */
+    n = avahi_alternative_service_name(name);
+    avahi_free(name);
+    name = n;
+
+    fprintf(stderr, "Service name collision, renaming service to '%s'\n", name);
+
+    avahi_entry_group_reset(group);
+
+    create_services(c);
+    return;
+
+fail:
+    avahi_simple_poll_quit(simple_poll);
+}
+
+static void client_callback(AvahiClient *c, AvahiClientState state, AVAHI_GCC_UNUSED void * userdata) {
+    assert(c);
+
+    /* Called whenever the client or server state changes */
+
+    switch (state) {
+        case AVAHI_CLIENT_S_RUNNING:
+
+            /* The server has startup successfully and registered its host
+             * name on the network, so it's time to create our services */
+            create_services(c);
+            break;
+
+        case AVAHI_CLIENT_FAILURE:
+
+            fprintf(stderr, "Client failure: %s\n", avahi_strerror(avahi_client_errno(c)));
+            avahi_simple_poll_quit(simple_poll);
+
+            break;
+
+        case AVAHI_CLIENT_S_COLLISION:
+
+            /* Let's drop our registered services. When the server is back
+             * in AVAHI_SERVER_RUNNING state we will register them
+             * again with the new host name. */
+
+        case AVAHI_CLIENT_S_REGISTERING:
+
+            /* The server records are now being established. This
+             * might be caused by a host name change. We need to wait
+             * for our own records to register until the host name is
+             * properly esatblished. */
+
+            if (group)
+                avahi_entry_group_reset(group);
+
+            break;
+
+        case AVAHI_CLIENT_CONNECTING:
+            ;
+    }
+}
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/AvahiNetworkService.hxx b/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
new file mode 100644
index 0000000..cc223e0
--- /dev/null
+++ b/sd/source/ui/remotecontrol/AvahiNetworkService.hxx
@@ -0,0 +1,5 @@
+#ifndef AVAHI_NETWORK_SERVICE_H
+#define AVAHI_NETWORK_SERVICE_H
+    int start_avahi_service(const char * serviceName);
+    void clean_avahi_service();
+#endif
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/DiscoveryService.cxx b/sd/source/ui/remotecontrol/DiscoveryService.cxx
index cfe7691..cae88f1 100644
--- a/sd/source/ui/remotecontrol/DiscoveryService.cxx
+++ b/sd/source/ui/remotecontrol/DiscoveryService.cxx
@@ -41,6 +41,10 @@
   #import "OSXNetworkService.h"
 #endif
 
+#ifdef LINUX
+  #include "AvahiNetworkService.hxx"
+#endif
+
 using namespace osl;
 using namespace rtl;
 using namespace sd;
@@ -51,7 +55,12 @@ DiscoveryService::DiscoveryService()
     OSXNetworkService * service = [[OSXNetworkService alloc] init];
     [service publishImpressRemoteServiceOnLocalNetworkWithName: @""];
 #endif
-// #else
+
+#ifdef LINUX
+// Avahi for Linux
+    start_avahi_service("HP");
+#endif
+
     mSocket = socket( AF_INET, SOCK_DGRAM, IPPROTO_UDP );
 
     sockaddr_in aAddr;
@@ -89,7 +98,10 @@ DiscoveryService::DiscoveryService()
 
 DiscoveryService::~DiscoveryService()
 {
-// #ifndef MACOSX
+  #ifdef LINUX
+      clean_avahi_service();
+  #endif
+
   #ifdef WNT
       closesocket( mSocket );
   #else
commit 3b28ec6855e5df0629427752d7dafae1f0a277d4
Author: Siqi LIU <me at siqi.fr>
Date:   Thu Jul 25 15:55:35 2013 +0200

    prevent zeroconf discovery duplication
    
    Change-Id: I5947ca5c6d29fbac02123cd2b54ba99c25060d9f

diff --git a/ios/iosremote/iosremote/serverList_vc.m b/ios/iosremote/iosremote/serverList_vc.m
index 5c158e8..2510fdd 100644
--- a/ios/iosremote/iosremote/serverList_vc.m
+++ b/ios/iosremote/iosremote/serverList_vc.m
@@ -89,6 +89,7 @@
            didFindService:(NSNetService *)aNetService
                moreComing:(BOOL)moreComing
 {
+    [self.comManager.autoDiscoveryServers removeObject:aNetService];
     [self.comManager.autoDiscoveryServers addObject:aNetService];
     
     NSLog(@"Got service %p with hostname %@\n", aNetService,
@@ -110,24 +111,6 @@
                moreComing:(BOOL)moreComing
 {
     NSLog(@"Did remove");
-    NSString * ipString;
-    
-    if ([[aNetService addresses] count] > 0){
-        NSData * address = [[aNetService addresses] objectAtIndex: 0];
-        struct sockaddr_in *socketAddress = (struct sockaddr_in *) [address bytes];
-        ipString = [NSString stringWithFormat: @"%s",inet_ntoa(socketAddress->sin_addr)];
-    }
-    
-    for (Server * s in self.comManager.autoDiscoveryServers) {
-        if (ipString){
-            if ([s.serverName isEqualToString:aNetService.name] && [s.serverAddress isEqualToString:ipString])
-                [self.comManager.autoDiscoveryServers removeObjectIdenticalTo:s];
-        } else {
-            if ([s.serverName isEqualToString:aNetService.name])
-                [self.comManager.autoDiscoveryServers removeObjectIdenticalTo:s];
-        }
-    }
-    // in case any residuous netServices still stay in the list
     [self.comManager.autoDiscoveryServers removeObject:aNetService];
     
     if(!moreComing)
@@ -185,14 +168,13 @@
                                                                                            [self disableSpinner];
                                                                                            [self performSegueWithIdentifier:@"SlideShowPreview" sender:self ];
                                                                                        }];
-    [super viewDidAppear:animated];
-    
     NSLog(@"Clear auto discovered servers");
     [self.comManager.autoDiscoveryServers removeAllObjects];
     self.serviceBrowser = [[NSNetServiceBrowser alloc] init];
     [self.serviceBrowser setDelegate:self];
-    [self.serviceBrowser searchForServicesOfType:@"_impressRemote._tcp" inDomain:@"local"];
+    [self.serviceBrowser searchForServicesOfType:@"_impressremote._tcp" inDomain:@"local"];
     [self.serviceBrowser scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
+    [super viewDidAppear:animated];
 }
 
 - (void) viewWillDisappear:(BOOL)animated
@@ -270,10 +252,10 @@
     
     switch (section) {
         case 0:
-            sectionName = [NSString stringWithFormat:@"Visible computers"];
+            sectionName = [NSString stringWithFormat:@"Detected connections"];
             break;
         case 1:
-            sectionName = [NSString stringWithFormat:@"Manual computers"];
+            sectionName = [NSString stringWithFormat:@"Custom connections"];
             break;
     }
     
diff --git a/ios/iosremote/iosremote/slideShowPreviewTable_vc.m b/ios/iosremote/iosremote/slideShowPreviewTable_vc.m
index c2b7dc1..59139fa 100644
--- a/ios/iosremote/iosremote/slideShowPreviewTable_vc.m
+++ b/ios/iosremote/iosremote/slideShowPreviewTable_vc.m
@@ -207,6 +207,7 @@
     UITableViewCell * cell = [tableView cellForRowAtIndexPath:indexPath];
     UISwitch * toggle = [[[cell accessoryView] subviews] objectAtIndex:0];
     [toggle setOn:![toggle isOn] animated:YES];
+    [cell setSelected:NO animated:YES];
 }
 
 - (void)viewDidUnload {
commit cca0b9ae02603ab88ec7d8810aab2a8a1b4efda2
Author: Siqi LIU <me at siqi.fr>
Date:   Wed Jul 24 18:47:16 2013 +0200

    patch for review
    

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list