[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - sd/source

2014-04-13 Thread Andrzej Hunt
 sd/source/ui/remotecontrol/BluetoothServer.cxx  |  673 +---
 sd/source/ui/remotecontrol/BufferedStreamSocket.cxx |2 
 sd/source/ui/remotecontrol/Communicator.cxx |2 
 3 files changed, 605 insertions(+), 72 deletions(-)

New commits:
commit d337b9a3c5ab41e4dc956e7fe1b36704426dc123
Author: Andrzej Hunt 
Date:   Thu Apr 10 21:58:29 2014 +0100

fdo#74697 Add Bluez 5 support for impress remote.

This time we:
 - Don't break SAL_WARN with an fprintf like syntax.
 - Replace DBUS_TYPE_UNIX_FD with it's definition 'h' as we might
   be building on dbus-glib versions that do not support it (however
   presumably anyone running bluez 5 will have a dbus version that is
   new enough to support this, i.e. purely a build-time issue).
 - Remove various C++11'isms.

Reviewed-on: https://gerrit.libreoffice.org/8924
Tested-by: Andrzej Hunt 
Reviewed-by: Andrzej Hunt 
(cherry picked from commit b15666fd7582729c75bd0dd1bd0cb5d7c5a77f0c)

Conflicts:
sd/source/ui/remotecontrol/BluetoothServer.cxx

Change-Id: I736cad2122cd3789a5c7fb62c39e409d41fc1e32

diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx 
b/sd/source/ui/remotecontrol/BluetoothServer.cxx
index 836c73e..db0ce7f 100644
--- a/sd/source/ui/remotecontrol/BluetoothServer.cxx
+++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx
@@ -12,6 +12,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 
 #ifdef LINUX_BLUETOOTH
@@ -89,25 +91,40 @@ struct DBusObject {
 }
 };
 
+static DBusObject* getBluez5Adapter(DBusConnection *pConnection);
+
 struct sd::BluetoothServer::Impl {
 // the glib mainloop running in the thread
 GMainContext *mpContext;
 DBusConnection *mpConnection;
 DBusObject *mpService;
 volatile bool mbExitMainloop;
+enum BluezVersion { BLUEZ4, BLUEZ5, UNKNOWN };
+BluezVersion maBluezVersion;
 
 Impl()
 : mpContext( g_main_context_new() )
 , mpConnection( NULL )
 , mpService( NULL )
 , mbExitMainloop( false )
+, maBluezVersion( UNKNOWN )
 { }
 
 DBusObject *getAdapter()
 {
-if( !mpService )
+if (mpService)
+{
+DBusObject* pAdapter = mpService->cloneForInterface( 
"org.bluez.Adapter" );
+return pAdapter;
+}
+else if (spServer->mpImpl->maBluezVersion == BLUEZ5)
+{
+return getBluez5Adapter(mpConnection);
+}
+else
+{
 return NULL;
-return mpService->cloneForInterface( "org.bluez.Adapter" );
+}
 }
 };
 
@@ -155,37 +172,181 @@ sendUnrefAndWaitForReply( DBusConnection *pConnection, 
DBusMessage *pMsg )
 return pMsg;
 }
 
+static bool
+isBluez5Available(DBusConnection *pConnection)
+{
+DBusMessage *pMsg;
+
+// Simplest wasy to check whether we have Bluez 5+ is to check
+// that we can obtain adapters using the new interfaces.
+// The first two error checks however don't tell us anything as they should
+// succeed as long as dbus is working correctly.
+pMsg = DBusObject( "org.bluez", "/", "org.freedesktop.DBus.ObjectManager" 
).getMethodCall( "GetManagedObjects" );
+if (!pMsg)
+{
+SAL_INFO("sdremote.bluetooth", "No GetManagedObjects call created");
+return false;
+}
+
+pMsg = sendUnrefAndWaitForReply( pConnection, pMsg );
+if (!pMsg)
+{
+SAL_INFO("sdremote.bluetooth", "No reply received");
+return false;
+}
+
+// If dbus is working correctly and we aren't on bluez 5 this is where we
+// should actually get the error.
+if (dbus_message_get_error_name( pMsg ))
+{
+SAL_INFO( "sdremote.bluetooth", "GetManagedObjects call failed with \""
+<< dbus_message_get_error_name( pMsg )
+<< "\" -- we don't seem to have Bluez 5 available");
+return false;
+}
+SAL_INFO("sdremote.bluetooth", "GetManagedObjects call seems to have 
succeeded -- we must be on Bluez 5");
+dbus_message_unref(pMsg);
+return true;
+}
+
+
+static DBusObject*
+getBluez5Adapter(DBusConnection *pConnection)
+{
+DBusMessage *pMsg;
+// This returns a list of objects where we need to find the first
+// org.bluez.Adapter1 .
+pMsg = DBusObject( "org.bluez", "/", "org.freedesktop.DBus.ObjectManager" 
).getMethodCall( "GetManagedObjects" );
+if (!pMsg)
+return NULL;
+
+const gchar* pInterfaceType = "org.bluez.Adapter1";
+
+pMsg = sendUnrefAndWaitForReply( pConnection, pMsg );
+
+DBusMessageIter aObjectIterator;
+if (pMsg && dbus_message_iter_init(pMsg, &aObjectIterator))
+{
+if (DBUS_TYPE_ARRAY == 
dbus_message_iter_get_arg_type(&aObjectIterator))
+{
+DBusMessageIter aObject;
+dbus_message_iter_recurse(&aObjectIterator, &aObject);
+do
+{
+if (DBUS_TYPE_DICT_ENTRY == 
dbus_message_it

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - sd/source

2014-03-12 Thread Muthu Subramanian
 sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 1a0e824ea96d325e728677802c38973d1b0689ef
Author: Muthu Subramanian 
Date:   Wed Mar 12 12:31:52 2014 +0530

n#862516: Remember slides sorter view setting.

Keep the number of slides per row when moving across tabs.

Change-Id: I316dac87c9dc8c88149b510f93be88940d91d98c

diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx 
b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
index b32b4a2..6667c6c 100644
--- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
+++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx
@@ -593,6 +593,8 @@ void SlideSorterViewShell::Activate (sal_Bool 
bIsMDIActivate)
 
 void SlideSorterViewShell::Deactivate (sal_Bool /*bIsMDIActivate*/)
 {
+// Save Settings - Specifically SlidesPerRow to retrieve it later
+WriteFrameViewData();
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - sd/source

2014-02-12 Thread Michael Stahl
 sd/source/ui/unoidl/sddetect.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 2714ebedcbd3648cb220e4f667a337563a2fd95d
Author: Michael Stahl 
Date:   Mon Feb 10 16:45:27 2014 +0100

fdo#73363: sd: fix mis-detection of Visio files as PPT

SdFilterDetect::detect() erroneously detects all binary MSO files, and
because the Visio types would be checked after PPT, Visio is pre-empted.

Change-Id: I6ec3647a508dc8d79b47bfff6de35ccae39416ee
(cherry picked from commit e62339f856efa0b8ef03df3bf8b93e098c4ac0d3)

diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index 9e98a7b..66fab30 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -371,6 +371,10 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< 
beans::PropertyValue >& lDes
 else
 pFilter = SfxFilter::GetFilterByName( 
pFilterPowerPoint97);
 }
+else
+{
+pFilter = 0;
+}
 }
 else
 {
@@ -423,6 +427,10 @@ OUString SAL_CALL SdFilterDetect::detect( Sequence< 
beans::PropertyValue >& lDes
 }
 }
 }
+else
+{
+pFilter = 0;
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.1' - sd/source

2013-10-25 Thread Jan Holesovsky
 sd/source/ui/view/DocumentRenderer.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 892d6fe2a6e5cd21abf9346e0bd40b73c2973d8b
Author: Jan Holesovsky 
Date:   Thu Aug 22 09:40:22 2013 +0200

bnc#835985: When printing handouts using the default, 'Order' did not count.

"Left to right, then down" was the same as "Top to bottom, then right"
when printing handout; set the 6 pages explicitly as the default.

Change-Id: I4a5f58c8fcf2efdc85ad7bb23bde791c5fb87584

diff --git a/sd/source/ui/view/DocumentRenderer.cxx 
b/sd/source/ui/view/DocumentRenderer.cxx
index a544515..6e9e673 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1557,14 +1557,14 @@ private:
 AutoLayout eLayout = AUTOLAYOUT_HANDOUT6;
 switch (nSlidesPerHandout)
 {
-case 0: eLayout = AUTOLAYOUT_NONE; break; // AUTOLAYOUT_HANDOUT1; 
break;
 case 1: eLayout = AUTOLAYOUT_HANDOUT1; break;
 case 2: eLayout = AUTOLAYOUT_HANDOUT2; break;
 case 3: eLayout = AUTOLAYOUT_HANDOUT3; break;
 case 4: eLayout = AUTOLAYOUT_HANDOUT4; break;
-default:
-case 6: eLayout = AUTOLAYOUT_HANDOUT6; break;
 case 9: eLayout = AUTOLAYOUT_HANDOUT9; break;
+default:
+case 0:
+case 6: break; // use the default
 }
 
 if( !mrBase.GetDocument() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits