cppuhelper/source/defaultbootstrap.cxx                       |   17 
 cppuhelper/source/gcc3.map                                   |    1 
 cppuhelper/source/servicemanager.cxx                         |   35 -
 cppuhelper/source/servicemanager.hxx                         |    2 
 desktop/CppunitTest_desktop_lib.mk                           |   68 ++
 desktop/Library_sofficeapp.mk                                |    3 
 desktop/Module_desktop.mk                                    |    4 
 desktop/inc/lib/init.hxx                                     |   27 
 desktop/qa/data/blank_text.odt                               |binary
 desktop/qa/desktop_lib/test_desktop_lib.cxx                  |  141 ++++
 desktop/source/app/cmdlineargs.hxx                           |    2 
 desktop/source/app/desktopresid.hxx                          |    2 
 desktop/source/deployment/gui/dp_gui.h                       |    2 
 desktop/source/deployment/gui/dp_gui_dialog2.cxx             |    4 
 desktop/source/deployment/gui/dp_gui_extlistbox.cxx          |    2 
 desktop/source/deployment/gui/dp_gui_extlistbox.hxx          |    6 
 desktop/source/deployment/gui/dp_gui_shared.hxx              |    2 
 desktop/source/deployment/gui/dp_gui_updatedata.hxx          |    2 
 desktop/source/deployment/gui/dp_gui_updatedialog.hxx        |    2 
 desktop/source/deployment/manager/dp_commandenvironments.hxx |    6 
 desktop/source/deployment/manager/dp_extensionmanager.hxx    |    2 
 desktop/source/deployment/manager/dp_informationprovider.cxx |    2 
 desktop/source/deployment/manager/dp_manager.cxx             |    2 
 desktop/source/deployment/manager/dp_managerfac.cxx          |    2 
 desktop/source/deployment/misc/dp_descriptioninfoset.cxx     |    2 
 desktop/source/lib/init.cxx                                  |  319 ++++++-----
 desktop/source/lib/lokinteractionhandler.cxx                 |   83 ++
 desktop/source/lib/lokinteractionhandler.hxx                 |   70 ++
 desktop/source/migration/services/oo3extensionmigration.hxx  |    2 
 desktop/source/offacc/acceptor.hxx                           |    2 
 desktop/source/pkgchk/unopkg/unopkg_app.cxx                  |    4 
 desktop/source/pkgchk/unopkg/unopkg_shared.h                 |    2 
 desktop/source/splash/splash.cxx                             |    2 
 desktop/source/splash/unxsplash.hxx                          |    2 
 desktop/test/deployment/active/active_native.cxx             |    4 
 desktop/test/deployment/passive/passive_native.cxx           |    4 
 include/LibreOfficeKit/LibreOfficeKit.h                      |    3 
 include/LibreOfficeKit/LibreOfficeKit.hxx                    |   11 
 include/svx/svdpagv.hxx                                      |    2 
 libreofficekit/qa/unit/tiledrendering.cxx                    |    1 
 smoketest/libtest.cxx                                        |   24 
 svx/source/svdraw/svdpagv.cxx                                |    6 
 vcl/source/window/paint.cxx                                  |    2 
 43 files changed, 636 insertions(+), 245 deletions(-)

New commits:
commit f387ec16a0c26a9bb0863a8fe04ec6630f606762
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Fri Sep 11 18:46:53 2015 +0200

    LOK: Implement an own trivial InteractionHandler.
    
    So far it just selects 'Approve' for any interaction that is done through
    that, later we want to route the information via callbacks to the caller.
    
    Change-Id: I7ae3e2dcc04877b8b0197b0396299126e1217a2a

diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 467fecc..ccad5a7 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -123,6 +123,7 @@ endif
 ifneq ($(filter $(OS),ANDROID IOS),)
 $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
        desktop/source/lib/init \
+       desktop/source/lib/lokinteractionhandler \
        $(if $(filter $(OS),ANDROID), \
                desktop/source/lib/lokandroid) \
 ))
@@ -130,6 +131,7 @@ else
 ifeq ($(GUIBASE),unx)
 $(eval $(call gb_Library_add_exception_objects,sofficeapp,\
        desktop/source/lib/init \
+       desktop/source/lib/lokinteractionhandler \
 ))
 endif
 endif
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index afca579..bf137a5 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -71,6 +71,8 @@
 #include "../app/officeipcthread.hxx"
 #include "../../inc/lib/init.hxx"
 
+#include "lokinteractionhandler.hxx"
+
 using namespace css;
 using namespace vcl;
 using namespace desktop;
@@ -385,11 +387,26 @@ static LibreOfficeKitDocument* 
lo_documentLoadWithOptions(LibreOfficeKit* pThis,
 
     try
     {
-        uno::Sequence<css::beans::PropertyValue> aFilterOptions(1);
+        uno::Sequence<css::beans::PropertyValue> aFilterOptions(2);
         aFilterOptions[0] = css::beans::PropertyValue( 
OUString("FilterOptions"),
                                                        0,
                                                        
uno::makeAny(OUString::createFromAscii(pOptions)),
                                                        
beans::PropertyState_DIRECT_VALUE);
+
+        uno::Reference<task::XInteractionHandler2> xInteraction(new 
LOKInteractionHandler(::comphelper::getProcessComponentContext()));
+        aFilterOptions[1].Name = "InteractionHandler";
+        aFilterOptions[1].Value <<= xInteraction;
+
+        /* TODO
+        sal_Int16 nMacroExecMode = document::MacroExecMode::USE_CONFIG;
+        aFilterOptions[2].Name = "MacroExecutionMode";
+        aFilterOptions[2].Value <<= nMacroExecMode;
+
+        sal_Int16 nUpdateDoc = document::UpdateDocMode::ACCORDING_TO_CONFIG;
+        aFilterOptions[3].Name = "UpdateDocMode";
+        aFilterOptions[3].Value <<= nUpdateDoc;
+        */
+
         uno::Reference<lang::XComponent> xComponent;
         xComponent = xComponentLoader->loadComponentFromURL(
                                             aURL, OUString("_blank"), 0,
diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
new file mode 100644
index 0000000..1d20b02
--- /dev/null
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "lokinteractionhandler.hxx"
+
+#include <cppuhelper/supportsservice.hxx>
+
+#include <com/sun/star/task/XInteractionApprove.hpp>
+
+using namespace com::sun::star;
+
+LOKInteractionHandler::LOKInteractionHandler(uno::Reference<uno::XComponentContext>
 const & /*rxContext*/)
+{
+}
+
+LOKInteractionHandler::~LOKInteractionHandler()
+{
+}
+
+OUString SAL_CALL LOKInteractionHandler::getImplementationName() throw 
(uno::RuntimeException, std::exception)
+{
+    return OUString("com.sun.star.comp.uui.LOKInteractionHandler");
+}
+
+sal_Bool SAL_CALL LOKInteractionHandler::supportsService(OUString const & 
rServiceName) throw (uno::RuntimeException, std::exception)
+{
+    return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence< OUString > SAL_CALL 
LOKInteractionHandler::getSupportedServiceNames() throw (uno::RuntimeException, 
std::exception)
+{
+    uno::Sequence< OUString > aNames(3);
+    aNames[0] = "com.sun.star.task.InteractionHandler";
+    // added to indicate support for configuration.backend.MergeRecoveryRequest
+    aNames[1] = "com.sun.star.configuration.backend.InteractionHandler";
+    aNames[2] = "com.sun.star.uui.InteractionHandler";
+    // for backwards compatibility
+    return aNames;
+}
+
+void SAL_CALL LOKInteractionHandler::initialize(uno::Sequence<uno::Any> const 
& /*rArguments*/) throw (uno::Exception, std::exception)
+{
+}
+
+void SAL_CALL 
LOKInteractionHandler::handle(uno::Reference<task::XInteractionRequest> const & 
rRequest) throw (uno::RuntimeException, std::exception)
+{
+    // just do the same thing in both cases
+    handleInteractionRequest(rRequest);
+}
+
+sal_Bool SAL_CALL LOKInteractionHandler::handleInteractionRequest(const 
uno::Reference<task::XInteractionRequest >& rRequest) throw ( 
uno::RuntimeException, std::exception )
+{
+    uno::Sequence<uno::Reference<task::XInteractionContinuation>> const 
&rContinuations = rRequest->getContinuations();
+
+    // TODO: add LOK api that allows handling this for real, for the moment we
+    // just set the interaction as 'Approved'
+    for (sal_Int32 i = 0; i < rContinuations.getLength(); ++i)
+    {
+        uno::Reference<task::XInteractionApprove> xApprove(rContinuations[i], 
uno::UNO_QUERY);
+        if (xApprove.is())
+            xApprove->select();
+    }
+
+    return sal_True;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/lib/lokinteractionhandler.hxx 
b/desktop/source/lib/lokinteractionhandler.hxx
new file mode 100644
index 0000000..6d4aa82
--- /dev/null
+++ b/desktop/source/lib/lokinteractionhandler.hxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_DESKTOP_SOURCE_LIB_LOKINTERACTIONHANDLER_HXX
+#define INCLUDED_DESKTOP_SOURCE_LIB_LOKINTERACTIONHANDLER_HXX
+
+#include <cppuhelper/implbase.hxx>
+
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/task/InteractionHandler.hpp>
+
+/** InteractionHandler is an interface that provides the user with various 
dialogs / error messages.
+
+We need an own implementation for the LibreOfficeKit so that we can route the
+information easily via callbacks.
+
+TODO: the callbacks are not implemented yet, we just approve any interaction
+that we get.
+*/
+class LOKInteractionHandler: public 
cppu::WeakImplHelper<com::sun::star::lang::XServiceInfo,
+                                                         
com::sun::star::lang::XInitialization,
+                                                         
com::sun::star::task::XInteractionHandler2>
+{
+    LOKInteractionHandler(const LOKInteractionHandler&) SAL_DELETED_FUNCTION;
+    LOKInteractionHandler& operator=(const LOKInteractionHandler&) 
SAL_DELETED_FUNCTION;
+
+public:
+    explicit 
LOKInteractionHandler(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>
 const & rxContext);
+
+    virtual ~LOKInteractionHandler();
+
+    virtual OUString SAL_CALL getImplementationName()
+        throw (com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
+
+    virtual sal_Bool SAL_CALL supportsService(OUString const & rServiceName)
+        throw (com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
+
+    virtual com::sun::star::uno::Sequence<OUString> SAL_CALL 
getSupportedServiceNames()
+        throw (com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
+
+    virtual void SAL_CALL 
initialize(com::sun::star::uno::Sequence<com::sun::star::uno::Any > const & 
rArguments)
+        throw (com::sun::star::uno::Exception, std::exception) SAL_OVERRIDE;
+
+    virtual void SAL_CALL 
handle(com::sun::star::uno::Reference<com::sun::star::task::XInteractionRequest>
 const & rRequest)
+        throw (com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
+
+    virtual sal_Bool SAL_CALL handleInteractionRequest(const 
::com::sun::star::uno::Reference<::com::sun::star::task::XInteractionRequest>& 
_Request)
+        throw (com::sun::star::uno::RuntimeException, std::exception) 
SAL_OVERRIDE;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 341f5ce7214d230d8d2d32b3488cf981f2146ea2
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Tue Sep 8 18:49:20 2015 +0200

    tdf#93480: Don't send an EMPTY Invalidate() on .uno:DefaultBullet.
    
    When there was no modification to the document, and .uno:DefaultBullet was
    sent, we have got an invalidtion of the entire document.
    
    It seems that Invalidate() was not supposed to be called in the Validate()
    call, and instead, we should rely on what the Validate() invalidates :-)
    
    Change-Id: Ia65df90e4ff34078b59c1b2eb1ce1faac790b40d

diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index bc0050a..5012c4d 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -1244,12 +1244,10 @@ void Window::Invalidate( const vcl::Region& rRegion, 
sal_uInt16 nFlags )
 
 void Window::Validate( sal_uInt16 nFlags )
 {
-
     if ( !comphelper::LibreOfficeKit::isActive() && 
(!IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight) )
         return;
 
     ImplValidate( NULL, nFlags );
-    LogicInvalidate(0);
 }
 
 bool Window::HasPaintEvent() const
commit ddc9626ec835b48b059ec0f02bf5b9b54624d5c0
Author: Mihai Varga <mihai.va...@collabora.com>
Date:   Thu Sep 10 11:31:48 2015 +0300

    LOK: getFonts method
    
    Returns a json mapping of the available fonts to their possible font
    sizes
    
    Change-Id: I80c0bdd79e3ef2d814f64b8d38143d6c2b9ca720

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 842d209..a089614 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -49,6 +49,7 @@ public:
 
     void runAllTests();
     void testGetStyles();
+    void testGetFonts();
 
     CPPUNIT_TEST_SUITE(DesktopLOKTest);
     CPPUNIT_TEST(runAllTests);
@@ -81,6 +82,7 @@ void DesktopLOKTest::closeDoc()
 void DesktopLOKTest::runAllTests()
 {
     testGetStyles();
+    testGetFonts();
 }
 
 void DesktopLOKTest::testGetStyles()
@@ -112,6 +114,26 @@ void DesktopLOKTest::testGetStyles()
     closeDoc();
 }
 
+void DesktopLOKTest::testGetFonts()
+{
+    LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+    boost::property_tree::ptree aTree;
+    char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, 
".uno:CharFontName");
+    std::stringstream aStream(pJSON);
+    boost::property_tree::read_json(aStream, aTree);
+    CPPUNIT_ASSERT( aTree.size() > 0 );
+    CPPUNIT_ASSERT( aTree.get_child("commandName").get_value<std::string>() == 
".uno:CharFontName" );
+
+    boost::property_tree::ptree aValues = aTree.get_child("commandValues");
+    CPPUNIT_ASSERT( aValues.size() > 0 );
+    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : 
aValues)
+    {
+        // check that we have font sizes available for each font
+        CPPUNIT_ASSERT( rPair.second.size() > 0);
+    }
+    closeDoc();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index c3a6417..afca579 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -45,10 +45,15 @@
 #include <com/sun/star/ucb/XContentProvider.hpp>
 #include <com/sun/star/ucb/XUniversalContentBroker.hpp>
 
+#include <editeng/fontitem.hxx>
+#include <editeng/flstitem.hxx>
+#include <sfx2/objsh.hxx>
+#include <svx/svxids.hrc>
 #include <vcl/svapp.hxx>
 #include <vcl/svpforlokit.hxx>
 #include <tools/resmgr.hxx>
 #include <tools/fract.hxx>
+#include <svtools/ctrltool.hxx>
 #include <vcl/graphicfilter.hxx>
 #include <vcl/sysdata.hxx>
 #include <vcl/virdev.hxx>
@@ -864,6 +869,43 @@ static void doc_resetSelection(LibreOfficeKitDocument* 
pThis)
 
     pDoc->resetSelection();
 }
+static char* getFonts (const char* pCommand)
+{
+    SfxObjectShell* pDocSh = SfxObjectShell::Current();
+    const SvxFontListItem* pFonts = static_cast<const SvxFontListItem*>(
+        pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST));
+    const FontList* pList = pFonts ? pFonts->GetFontList() : 0;
+
+    boost::property_tree::ptree aTree;
+    aTree.put("commandName", pCommand);
+    boost::property_tree::ptree aValues;
+    if ( pList )
+    {
+        sal_uInt16 nFontCount = pList->GetFontNameCount();
+        for (sal_uInt16 i = 0; i < nFontCount; ++i)
+        {
+            boost::property_tree::ptree aChildren;
+            const vcl::FontInfo& rInfo = pList->GetFontName(i);
+            const sal_IntPtr* pAry = pList->GetSizeAry(rInfo);
+            sal_uInt16 nSizeCount = 0;
+            while (pAry[nSizeCount])
+            {
+                boost::property_tree::ptree aChild;
+                aChild.put("", (float)pAry[nSizeCount] / 10);
+                aChildren.push_back(std::make_pair("", aChild));
+                nSizeCount++;
+            }
+            aValues.add_child(rInfo.GetName().toUtf8().getStr(), aChildren);
+        }
+    }
+    aTree.add_child("commandValues", aValues);
+    std::stringstream aStream;
+    boost::property_tree::write_json(aStream, aTree);
+    char* pJson = static_cast<char*>(malloc(aStream.str().size() + 1));
+    strcpy(pJson, aStream.str().c_str());
+    pJson[aStream.str().size()] = '\0';
+    return pJson;
+}
 
 static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
 {
@@ -901,7 +943,11 @@ static char* getStyles(LibreOfficeKitDocument* pThis, 
const char* pCommand)
 
 static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* 
pCommand)
 {
-    if (!strcmp(pCommand, ".uno:StyleApply"))
+    if (!strcmp(pCommand, ".uno:CharFontName"))
+    {
+        return getFonts(pCommand);
+    }
+    else if (!strcmp(pCommand, ".uno:StyleApply"))
     {
         return getStyles(pThis, pCommand);
     }
commit 7705f4faad57afe4e168f9824e6c70ea362951ab
Author: Mihai Varga <mihai.va...@collabora.com>
Date:   Thu Sep 10 09:21:45 2015 +0300

    LOK: added a general getCommandValues method
    
    This method returns a JSON mapping of the posible values for the given
    command (e.g. .uno:StyleApply, etc).
    
    returns:
    {commandName: "cmdName", commandValues: {json_of_cmd_values}}
    I've fixed the unit test this time
    
    Change-Id: I30b0fba8ba1db33dd79f4b46026d293b9ea72402

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index c88a53f..842d209 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -87,12 +87,15 @@ void DesktopLOKTest::testGetStyles()
 {
     LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
     boost::property_tree::ptree aTree;
-    char* pJSON = pDocument->m_pDocumentClass->getStyles(pDocument);
+    char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, 
".uno:StyleApply");
     std::stringstream aStream(pJSON);
     boost::property_tree::read_json(aStream, aTree);
     CPPUNIT_ASSERT( aTree.size() > 0 );
+    CPPUNIT_ASSERT( aTree.get_child("commandName").get_value<std::string>() == 
".uno:StyleApply" );
 
-    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : 
aTree)
+    boost::property_tree::ptree aValues = aTree.get_child("commandValues");
+    CPPUNIT_ASSERT( aValues.size() > 0 );
+    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : 
aValues)
     {
         CPPUNIT_ASSERT( rPair.second.size() > 0);
         if (rPair.first != "CharacterStyles" &&
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 95779f9..c3a6417 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -235,7 +235,7 @@ static void doc_setGraphicSelection 
(LibreOfficeKitDocument* pThis,
                                   int nX,
                                   int nY);
 static void doc_resetSelection (LibreOfficeKitDocument* pThis);
-static char* doc_getStyles(LibreOfficeKitDocument* pThis);
+static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* 
pCommand);
 
 
 LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
<css::lang::XComponent> &xComponent) :
@@ -266,7 +266,7 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
<css::lang::XCompone
         m_pDocumentClass->getTextSelection = doc_getTextSelection;
         m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection;
         m_pDocumentClass->resetSelection = doc_resetSelection;
-        m_pDocumentClass->getStyles = doc_getStyles;
+        m_pDocumentClass->getCommandValues = doc_getCommandValues;
 
         gDocumentClass = m_pDocumentClass;
     }
@@ -865,15 +865,17 @@ static void doc_resetSelection(LibreOfficeKitDocument* 
pThis)
     pDoc->resetSelection();
 }
 
-static char* doc_getStyles(LibreOfficeKitDocument* pThis)
+static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
 {
     LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
 
     boost::property_tree::ptree aTree;
+    aTree.put("commandName", pCommand);
     uno::Reference<css::style::XStyleFamiliesSupplier> 
xStyleFamiliesSupplier(pDocument->mxComponent, uno::UNO_QUERY);
     uno::Reference<container::XNameAccess> 
xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
     uno::Sequence<OUString> aStyleFamilies = xStyleFamilies->getElementNames();
 
+    boost::property_tree::ptree aValues;
     for (sal_Int32 nStyleFam = 0; nStyleFam < aStyleFamilies.getLength(); 
++nStyleFam)
     {
         boost::property_tree::ptree aChildren;
@@ -886,8 +888,9 @@ static char* doc_getStyles(LibreOfficeKitDocument* pThis)
             aChild.put("", aStyles[nInd]);
             aChildren.push_back(std::make_pair("", aChild));
         }
-        aTree.add_child(sStyleFam.toUtf8().getStr(), aChildren);
+        aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
     }
+    aTree.add_child("commandValues", aValues);
     std::stringstream aStream;
     boost::property_tree::write_json(aStream, aTree);
     char* pJson = static_cast<char*>(malloc(aStream.str().size() + 1));
@@ -895,6 +898,19 @@ static char* doc_getStyles(LibreOfficeKitDocument* pThis)
     pJson[aStream.str().size()] = '\0';
     return pJson;
 }
+
+static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* 
pCommand)
+{
+    if (!strcmp(pCommand, ".uno:StyleApply"))
+    {
+        return getStyles(pThis, pCommand);
+    }
+    else {
+        gImpl->maLastExceptionMsg = "Unknown command, no values returned";
+        return NULL;
+    }
+}
+
 static char* lo_getError (LibreOfficeKit *pThis)
 {
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index af7155c..8060f0e 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -161,7 +161,7 @@ struct _LibreOfficeKitDocumentClass
     void (*resetSelection) (LibreOfficeKitDocument* pThis);
 
     /// @see lok::Document:getStyles
-    char* (*getStyles) (LibreOfficeKitDocument* pThis);
+    char* (*getCommandValues) (LibreOfficeKitDocument* pThis, const char* 
pCommand);
 #endif // LOK_USE_UNSTABLE_API
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index c526bda..4459994 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -248,11 +248,14 @@ public:
     }
 
     /**
-     * Returns a json map, {"familyName1" : ["list of style names in the 
family1"], etc.}
+     * Returns a json mapping of the possible values for the given command
+     * e.g. {commandName: ".uno:StyleApply", commandValues: {"familyName1" : 
["list of style names in the family1"], etc.}}
+     * @param pCommand a uno command for which the possible values are 
requested
+     * @return {commandName: unoCmd, commandValues: {possible_values}}
      */
-    inline char* getStyles()
+    inline char* getCommandValues(const char* pCommand)
     {
-        return mpDoc->pClass->getStyles(mpDoc);
+        return mpDoc->pClass->getCommandValues(mpDoc, pCommand);
     }
 #endif // LOK_USE_UNSTABLE_API
 };
commit 0b891c859858f92ffde7a0e9cd24bc018dd478bf
Author: Mihai Varga <mihai.va...@collabora.com>
Date:   Wed Sep 9 15:08:26 2015 +0300

    LOK: moved the decalaration of LibLODocument_Impl to make it visible
    
    We needed a better way to test LOK methods that are not app specific,
    but are defined in /desktop/source/lib/init.cxx. So the decalaration
    needs to be visible.
    
    I also moved the `getStyles` test in the new test file
    
    Change-Id: I98d97dc17a66e72732ca7bd848c131610790f48e

diff --git a/desktop/CppunitTest_desktop_lib.mk 
b/desktop/CppunitTest_desktop_lib.mk
new file mode 100644
index 0000000..be39460
--- /dev/null
+++ b/desktop/CppunitTest_desktop_lib.mk
@@ -0,0 +1,68 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#*************************************************************************
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+#*************************************************************************
+
+$(eval $(call gb_CppunitTest_CppunitTest,desktop_lib))
+
+$(eval $(call gb_CppunitTest_add_exception_objects,desktop_lib, \
+       desktop/qa/desktop_lib/test_desktop_lib \
+))
+
+$(eval $(call gb_CppunitTest_use_libraries,desktop_lib, \
+       comphelper \
+       cppu \
+       cppuhelper \
+       sal \
+       sfx \
+       sofficeapp \
+       subsequenttest \
+       sw \
+       test \
+       unotest \
+       vcl \
+    $(gb_UWINAPI) \
+))
+
+$(eval $(call gb_CppunitTest_use_external,desktop_lib,boost_headers))
+
+$(eval $(call gb_CppunitTest_use_api,desktop_lib,\
+       offapi \
+       udkapi \
+))
+
+$(eval $(call gb_CppunitTest_use_ure,desktop_lib))
+
+$(eval $(call gb_CppunitTest_use_vcl,desktop_lib))
+
+$(eval $(call gb_CppunitTest_use_components,desktop_lib,\
+    comphelper/util/comphelp \
+    configmgr/source/configmgr \
+    filter/source/config/cache/filterconfig1 \
+    filter/source/storagefilterdetect/storagefd \
+    framework/util/fwk \
+    i18npool/util/i18npool \
+    package/source/xstor/xstor \
+    package/util/package2 \
+    sax/source/expatwrap/expwrap \
+    sfx2/util/sfx \
+    svl/source/fsstor/fsstorage \
+    svtools/util/svt \
+    sw/util/sw \
+    sw/util/swd \
+    toolkit/util/tk \
+    ucb/source/core/ucb1 \
+    ucb/source/ucp/file/ucpfile1 \
+    unoxml/source/service/unoxml \
+    xmloff/util/xo \
+))
+
+$(eval $(call gb_CppunitTest_use_configuration,desktop_lib))
+
+# vim: set noet sw=4 ts=4:
diff --git a/desktop/Module_desktop.mk b/desktop/Module_desktop.mk
index ab04152..c725a26 100644
--- a/desktop/Module_desktop.mk
+++ b/desktop/Module_desktop.mk
@@ -130,4 +130,8 @@ $(eval $(call gb_Module_add_check_targets,desktop, \
     CppunitTest_desktop_version \
 ))
 
+$(eval $(call gb_Module_add_check_targets,desktop, \
+    CppunitTest_desktop_lib \
+))
+
 # vim: set ts=4 sw=4 et:
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx
new file mode 100644
index 0000000..b17f825
--- /dev/null
+++ b/desktop/inc/lib/init.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#include <LibreOfficeKit/LibreOfficeKit.h>
+#include <com/sun/star/frame/XStorable.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <boost/shared_ptr.hpp>
+#include "../../source/inc/desktopdllapi.h"
+
+using namespace css;
+using namespace boost;
+
+namespace desktop {
+    struct DESKTOP_DLLPUBLIC LibLODocument_Impl : public 
_LibreOfficeKitDocument
+    {
+        uno::Reference<css::lang::XComponent> mxComponent;
+        shared_ptr< LibreOfficeKitDocumentClass > m_pDocumentClass;
+
+        explicit LibLODocument_Impl(const uno::Reference 
<css::lang::XComponent> &xComponent);
+        ~LibLODocument_Impl();
+    };
+}
diff --git a/desktop/qa/data/blank_text.odt b/desktop/qa/data/blank_text.odt
new file mode 100644
index 0000000..00b92d7
Binary files /dev/null and b/desktop/qa/data/blank_text.odt differ
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx 
b/desktop/qa/desktop_lib/test_desktop_lib.cxx
new file mode 100644
index 0000000..c88a53f
--- /dev/null
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -0,0 +1,116 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+
+#include <boost/property_tree/json_parser.hpp>
+#include <comphelper/processfactory.hxx>
+#include <sfx2/objsh.hxx>
+#include <test/unoapi_test.hxx>
+
+#include "../../inc/lib/init.hxx"
+
+using namespace com::sun::star;
+using namespace desktop;
+
+class DesktopLOKTest : public UnoApiTest
+{
+public:
+    DesktopLOKTest() : UnoApiTest("/desktop/qa/data/")
+    {
+    }
+
+    virtual ~DesktopLOKTest()
+    {
+    }
+
+    virtual void setUp() SAL_OVERRIDE
+    {
+        UnoApiTest::setUp();
+        
mxDesktop.set(frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory())));
+    };
+
+    virtual void tearDown() SAL_OVERRIDE
+    {
+        closeDoc();
+        UnoApiTest::tearDown();
+    };
+
+    LibLODocument_Impl* loadDoc(const char* pName);
+    void closeDoc();
+
+    void runAllTests();
+    void testGetStyles();
+
+    CPPUNIT_TEST_SUITE(DesktopLOKTest);
+    CPPUNIT_TEST(runAllTests);
+    CPPUNIT_TEST_SUITE_END();
+
+    uno::Reference<lang::XComponent> mxComponent;
+};
+
+LibLODocument_Impl* DesktopLOKTest::loadDoc(const char* pName)
+{
+    OUString aFileURL;
+    createFileURL(OUString::createFromAscii(pName), aFileURL);
+    mxComponent = loadFromDesktop(aFileURL, "com.sun.star.text.TextDocument");
+    if (!mxComponent.is())
+    {
+        CPPUNIT_ASSERT(false);
+    }
+    return new LibLODocument_Impl(mxComponent);
+}
+
+void DesktopLOKTest::closeDoc()
+{
+    if (mxComponent.is())
+    {
+        closeDocument(mxComponent);
+        mxComponent.clear();
+    }
+}
+
+void DesktopLOKTest::runAllTests()
+{
+    testGetStyles();
+}
+
+void DesktopLOKTest::testGetStyles()
+{
+    LibLODocument_Impl* pDocument = loadDoc("blank_text.odt");
+    boost::property_tree::ptree aTree;
+    char* pJSON = pDocument->m_pDocumentClass->getStyles(pDocument);
+    std::stringstream aStream(pJSON);
+    boost::property_tree::read_json(aStream, aTree);
+    CPPUNIT_ASSERT( aTree.size() > 0 );
+
+    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : 
aTree)
+    {
+        CPPUNIT_ASSERT( rPair.second.size() > 0);
+        if (rPair.first != "CharacterStyles" &&
+            rPair.first != "ParagraphStyles" &&
+            rPair.first != "FrameStyles" &&
+            rPair.first != "PageStyles" &&
+            rPair.first != "NumberingStyles" &&
+            rPair.first != "CellStyles" &&
+            rPair.first != "ShapeStyles")
+        {
+            CPPUNIT_FAIL("Unknown style family: " + rPair.first);
+        }
+    }
+    closeDoc();
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(DesktopLOKTest);
+
+CPPUNIT_PLUGIN_IMPLEMENT();
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6828d6b..95779f9 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -64,6 +64,7 @@
 // We also need to hackily be able to start the main libreoffice thread:
 #include "../app/sofficemain.h"
 #include "../app/officeipcthread.hxx"
+#include "../../inc/lib/init.hxx"
 
 using namespace css;
 using namespace vcl;
@@ -72,7 +73,6 @@ using namespace utl;
 
 using namespace boost;
 
-struct LibLODocument_Impl;
 struct LibLibreOffice_Impl;
 
 static LibLibreOffice_Impl *gImpl = NULL;
@@ -237,51 +237,46 @@ static void doc_setGraphicSelection 
(LibreOfficeKitDocument* pThis,
 static void doc_resetSelection (LibreOfficeKitDocument* pThis);
 static char* doc_getStyles(LibreOfficeKitDocument* pThis);
 
-struct LibLODocument_Impl : public _LibreOfficeKitDocument
-{
-    uno::Reference<css::lang::XComponent> mxComponent;
-    shared_ptr< LibreOfficeKitDocumentClass > m_pDocumentClass;
 
-    explicit LibLODocument_Impl(const uno::Reference <css::lang::XComponent> 
&xComponent) :
-        mxComponent( xComponent )
+LibLODocument_Impl::LibLODocument_Impl(const uno::Reference 
<css::lang::XComponent> &xComponent) :
+    mxComponent( xComponent )
+{
+    if (!(m_pDocumentClass = gDocumentClass.lock()))
     {
-        if (!(m_pDocumentClass = gDocumentClass.lock()))
-        {
-            m_pDocumentClass.reset(new LibreOfficeKitDocumentClass);
-
-            m_pDocumentClass->nSize = sizeof(LibreOfficeKitDocument);
-
-            m_pDocumentClass->destroy = doc_destroy;
-            m_pDocumentClass->saveAs = doc_saveAs;
-            m_pDocumentClass->getDocumentType = doc_getDocumentType;
-            m_pDocumentClass->getParts = doc_getParts;
-            m_pDocumentClass->getPart = doc_getPart;
-            m_pDocumentClass->setPart = doc_setPart;
-            m_pDocumentClass->getPartName = doc_getPartName;
-            m_pDocumentClass->setPartMode = doc_setPartMode;
-            m_pDocumentClass->paintTile = doc_paintTile;
-            m_pDocumentClass->getDocumentSize = doc_getDocumentSize;
-            m_pDocumentClass->initializeForRendering = 
doc_initializeForRendering;
-            m_pDocumentClass->registerCallback = doc_registerCallback;
-            m_pDocumentClass->postKeyEvent = doc_postKeyEvent;
-            m_pDocumentClass->postMouseEvent = doc_postMouseEvent;
-            m_pDocumentClass->postUnoCommand = doc_postUnoCommand;
-            m_pDocumentClass->setTextSelection = doc_setTextSelection;
-            m_pDocumentClass->getTextSelection = doc_getTextSelection;
-            m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection;
-            m_pDocumentClass->resetSelection = doc_resetSelection;
-            m_pDocumentClass->getStyles = doc_getStyles;
-
-            gDocumentClass = m_pDocumentClass;
-        }
-        pClass = m_pDocumentClass.get();
+        m_pDocumentClass.reset(new LibreOfficeKitDocumentClass);
+
+        m_pDocumentClass->nSize = sizeof(LibreOfficeKitDocument);
+
+        m_pDocumentClass->destroy = doc_destroy;
+        m_pDocumentClass->saveAs = doc_saveAs;
+        m_pDocumentClass->getDocumentType = doc_getDocumentType;
+        m_pDocumentClass->getParts = doc_getParts;
+        m_pDocumentClass->getPart = doc_getPart;
+        m_pDocumentClass->setPart = doc_setPart;
+        m_pDocumentClass->getPartName = doc_getPartName;
+        m_pDocumentClass->setPartMode = doc_setPartMode;
+        m_pDocumentClass->paintTile = doc_paintTile;
+        m_pDocumentClass->getDocumentSize = doc_getDocumentSize;
+        m_pDocumentClass->initializeForRendering = doc_initializeForRendering;
+        m_pDocumentClass->registerCallback = doc_registerCallback;
+        m_pDocumentClass->postKeyEvent = doc_postKeyEvent;
+        m_pDocumentClass->postMouseEvent = doc_postMouseEvent;
+        m_pDocumentClass->postUnoCommand = doc_postUnoCommand;
+        m_pDocumentClass->setTextSelection = doc_setTextSelection;
+        m_pDocumentClass->getTextSelection = doc_getTextSelection;
+        m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection;
+        m_pDocumentClass->resetSelection = doc_resetSelection;
+        m_pDocumentClass->getStyles = doc_getStyles;
+
+        gDocumentClass = m_pDocumentClass;
     }
+    pClass = m_pDocumentClass.get();
+}
 
-    ~LibLODocument_Impl()
-    {
-        mxComponent->dispose();
-    }
-};
+LibLODocument_Impl::~LibLODocument_Impl()
+{
+    mxComponent->dispose();
+}
 
 static void doc_destroy(LibreOfficeKitDocument *pThis)
 {
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx 
b/libreofficekit/qa/unit/tiledrendering.cxx
index a0f4bcb..aa68c72 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -68,7 +68,6 @@ public:
     void testDocumentTypes( Office* pOffice );
     void testImpressSlideNames( Office* pOffice );
     void testCalcSheetNames( Office* pOffice );
-    void testGetStyles( Office* pOffice );
 #if 0
     void testOverlay( Office* pOffice );
 #endif
@@ -95,7 +94,6 @@ void TiledRenderingTest::runAllTests()
     testDocumentTypes( pOffice.get() );
     testImpressSlideNames( pOffice.get() );
     testCalcSheetNames( pOffice.get() );
-    testGetStyles( pOffice.get() );
 #if 0
     testOverlay( pOffice.get() );
 #endif
@@ -184,38 +182,6 @@ void TiledRenderingTest::testCalcSheetNames( Office* 
pOffice )
     CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 2 ), "Sheet3" ) == 0 );
 }
 
-void TiledRenderingTest::testGetStyles( Office* pOffice )
-{
-    const string sDocPath = m_sSrcRoot + 
"/libreofficekit/qa/data/blank_text.odt";
-    const string sLockFile = m_sSrcRoot 
+"/libreofficekit/qa/data/.~lock.blank_text.odt#";
-
-    // FIXME: LOK will fail when trying to open a locked file
-    remove( sLockFile.c_str() );
-
-    scoped_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) 
);
-
-    boost::property_tree::ptree aTree;
-    char* pJSON = pDocument->getStyles();
-    std::stringstream aStream(pJSON);
-    boost::property_tree::read_json(aStream, aTree);
-    CPPUNIT_ASSERT( aTree.size() > 0 );
-
-    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : 
aTree)
-    {
-        CPPUNIT_ASSERT( rPair.second.size() > 0);
-        if (rPair.first != "CharacterStyles" &&
-            rPair.first != "ParagraphStyles" &&
-            rPair.first != "FrameStyles" &&
-            rPair.first != "PageStyles" &&
-            rPair.first != "NumberingStyles" &&
-            rPair.first != "CellStyles" &&
-            rPair.first != "ShapeStyles")
-        {
-            CPPUNIT_FAIL("Unknown style family: " + rPair.first);
-        }
-    }
-}
-
 #if 0
 static void dumpRGBABitmap( const OUString& rPath, const unsigned char* 
pBuffer,
                             const int nWidth, const int nHeight )
commit e068b3c17779792116c5c586c6584a8a599d5e42
Author: Mihai Varga <mihai.va...@collabora.com>
Date:   Fri Sep 4 11:55:47 2015 +0300

    LOK: allow float numbers in json -> property value conversion
    
    Change-Id: I866a44fcb71044d27a9bf06e2f55ca2e4135c23b

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 255634e..6828d6b 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -772,6 +772,8 @@ static void jsonToPropertyValues(const char* pJSON, 
uno::Sequence<beans::Propert
                 aValue.Value <<= OUString::fromUtf8(rValue.c_str());
             else if (rType == "boolean")
                 aValue.Value <<= OString(rValue.c_str()).toBoolean();
+            else if (rType == "float")
+                aValue.Value <<= OString(rValue.c_str()).toFloat();
             else if (rType == "long")
                 aValue.Value <<= OString(rValue.c_str()).toInt32();
             else
commit d4c59bf41dc9130dd755b3094af8b3676dfe37b1
Author: Mihai Varga <mihai.va...@collabora.com>
Date:   Mon Aug 17 18:49:40 2015 +0300

    lok::Document getStyles method
    
    This method returns a JSON mapping of style families to a list of styles
    from the corresponding family.
    Will be used to know and apply styles in tiledrendering.
    
    Change-Id: I0aa395c40b9573920ade44255f97c077475ae5f1

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 0a7a63f..255634e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -35,11 +35,13 @@
 #include <comphelper/processfactory.hxx>
 
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/frame/XStorable.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
 #include <com/sun/star/ucb/XContentProvider.hpp>
 #include <com/sun/star/ucb/XUniversalContentBroker.hpp>
 
@@ -233,6 +235,7 @@ static void doc_setGraphicSelection 
(LibreOfficeKitDocument* pThis,
                                   int nX,
                                   int nY);
 static void doc_resetSelection (LibreOfficeKitDocument* pThis);
+static char* doc_getStyles(LibreOfficeKitDocument* pThis);
 
 struct LibLODocument_Impl : public _LibreOfficeKitDocument
 {
@@ -267,6 +270,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
             m_pDocumentClass->getTextSelection = doc_getTextSelection;
             m_pDocumentClass->setGraphicSelection = doc_setGraphicSelection;
             m_pDocumentClass->resetSelection = doc_resetSelection;
+            m_pDocumentClass->getStyles = doc_getStyles;
 
             gDocumentClass = m_pDocumentClass;
         }
@@ -864,6 +868,36 @@ static void doc_resetSelection(LibreOfficeKitDocument* 
pThis)
     pDoc->resetSelection();
 }
 
+static char* doc_getStyles(LibreOfficeKitDocument* pThis)
+{
+    LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
+
+    boost::property_tree::ptree aTree;
+    uno::Reference<css::style::XStyleFamiliesSupplier> 
xStyleFamiliesSupplier(pDocument->mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XNameAccess> 
xStyleFamilies(xStyleFamiliesSupplier->getStyleFamilies(), uno::UNO_QUERY);
+    uno::Sequence<OUString> aStyleFamilies = xStyleFamilies->getElementNames();
+
+    for (sal_Int32 nStyleFam = 0; nStyleFam < aStyleFamilies.getLength(); 
++nStyleFam)
+    {
+        boost::property_tree::ptree aChildren;
+        OUString sStyleFam = aStyleFamilies[nStyleFam];
+        uno::Reference<container::XNameAccess> 
xStyleFamily(xStyleFamilies->getByName(sStyleFam), uno::UNO_QUERY);
+        uno::Sequence<OUString> aStyles = xStyleFamily->getElementNames();
+        for (sal_Int32 nInd = 0; nInd < aStyles.getLength(); ++nInd)
+        {
+            boost::property_tree::ptree aChild;
+            aChild.put("", aStyles[nInd]);
+            aChildren.push_back(std::make_pair("", aChild));
+        }
+        aTree.add_child(sStyleFam.toUtf8().getStr(), aChildren);
+    }
+    std::stringstream aStream;
+    boost::property_tree::write_json(aStream, aTree);
+    char* pJson = static_cast<char*>(malloc(aStream.str().size() + 1));
+    strcpy(pJson, aStream.str().c_str());
+    pJson[aStream.str().size()] = '\0';
+    return pJson;
+}
 static char* lo_getError (LibreOfficeKit *pThis)
 {
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h 
b/include/LibreOfficeKit/LibreOfficeKit.h
index e3b4850..af7155c 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -159,6 +159,9 @@ struct _LibreOfficeKitDocumentClass
 
     /// @see lok::Document::resetSelection
     void (*resetSelection) (LibreOfficeKitDocument* pThis);
+
+    /// @see lok::Document:getStyles
+    char* (*getStyles) (LibreOfficeKitDocument* pThis);
 #endif // LOK_USE_UNSTABLE_API
 };
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx 
b/include/LibreOfficeKit/LibreOfficeKit.hxx
index 816ade5..c526bda 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -246,6 +246,14 @@ public:
     {
         mpDoc->pClass->resetSelection(mpDoc);
     }
+
+    /**
+     * Returns a json map, {"familyName1" : ["list of style names in the 
family1"], etc.}
+     */
+    inline char* getStyles()
+    {
+        return mpDoc->pClass->getStyles(mpDoc);
+    }
 #endif // LOK_USE_UNSTABLE_API
 };
 
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx 
b/libreofficekit/qa/unit/tiledrendering.cxx
index fb2f741..a0f4bcb 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -9,6 +9,7 @@
 
 #include <boost/scoped_array.hpp>
 #include <boost/scoped_ptr.hpp>
+#include <boost/property_tree/json_parser.hpp>
 #include <cppunit/TestFixture.h>
 #include <cppunit/plugin/TestPlugIn.h>
 #include <cppunit/extensions/HelperMacros.h>
@@ -67,6 +68,7 @@ public:
     void testDocumentTypes( Office* pOffice );
     void testImpressSlideNames( Office* pOffice );
     void testCalcSheetNames( Office* pOffice );
+    void testGetStyles( Office* pOffice );
 #if 0
     void testOverlay( Office* pOffice );
 #endif
@@ -93,6 +95,7 @@ void TiledRenderingTest::runAllTests()
     testDocumentTypes( pOffice.get() );
     testImpressSlideNames( pOffice.get() );
     testCalcSheetNames( pOffice.get() );
+    testGetStyles( pOffice.get() );
 #if 0
     testOverlay( pOffice.get() );
 #endif
@@ -181,6 +184,38 @@ void TiledRenderingTest::testCalcSheetNames( Office* 
pOffice )
     CPPUNIT_ASSERT( strcmp( pDocument->getPartName( 2 ), "Sheet3" ) == 0 );
 }
 
+void TiledRenderingTest::testGetStyles( Office* pOffice )
+{
+    const string sDocPath = m_sSrcRoot + 
"/libreofficekit/qa/data/blank_text.odt";
+    const string sLockFile = m_sSrcRoot 
+"/libreofficekit/qa/data/.~lock.blank_text.odt#";
+
+    // FIXME: LOK will fail when trying to open a locked file
+    remove( sLockFile.c_str() );
+
+    scoped_ptr< Document> pDocument( pOffice->documentLoad( sDocPath.c_str() ) 
);
+
+    boost::property_tree::ptree aTree;
+    char* pJSON = pDocument->getStyles();
+    std::stringstream aStream(pJSON);
+    boost::property_tree::read_json(aStream, aTree);
+    CPPUNIT_ASSERT( aTree.size() > 0 );
+
+    for (const std::pair<std::string, boost::property_tree::ptree>& rPair : 
aTree)
+    {
+        CPPUNIT_ASSERT( rPair.second.size() > 0);
+        if (rPair.first != "CharacterStyles" &&
+            rPair.first != "ParagraphStyles" &&
+            rPair.first != "FrameStyles" &&
+            rPair.first != "PageStyles" &&
+            rPair.first != "NumberingStyles" &&
+            rPair.first != "CellStyles" &&
+            rPair.first != "ShapeStyles")
+        {
+            CPPUNIT_FAIL("Unknown style family: " + rPair.first);
+        }
+    }
+}
+
 #if 0
 static void dumpRGBABitmap( const OUString& rPath, const unsigned char* 
pBuffer,
                             const int nWidth, const int nHeight )
commit 47c56f96218f3b403d1697d001a5c953680f7cf3
Author: Mihai Varga <mihai.va...@collabora.com>
Date:   Fri Jul 31 18:24:33 2015 +0300

    Removed some whole page invalidations in impress
    
    1. For tiled rendering, don't invalidate the whole page when hiding it
    2. Don't invalidate when showing a page because we've just hidden the
    previous one
    3. No need for invalidation when setting visible layers
    
    Change-Id: I858401b22c95093c58ec00896fe92b766fddb6de
    Reviewed-on: https://gerrit.libreoffice.org/17452
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx
index 8bf305f..f28e3e7 100644
--- a/include/svx/svdpagv.hxx
+++ b/include/svx/svdpagv.hxx
@@ -216,7 +216,7 @@ public:
     void PagePosToLogic(Point& rPnt) const { rPnt+=aPgOrg; }
     void PagePosToLogic(Rectangle& rRect) const { 
rRect.Move(aPgOrg.X(),aPgOrg.Y()); }
 
-    void SetVisibleLayers(const SetOfByte& rSet) { aLayerVisi=rSet; 
InvalidateAllWin(); }
+    void SetVisibleLayers(const SetOfByte& rSet) { aLayerVisi=rSet; }
     const SetOfByte& GetVisibleLayers() const { return aLayerVisi; }
     void SetPrintableLayers(const SetOfByte& rSet) { aLayerPrn=rSet; }
     const SetOfByte& GetPrintableLayers() const { return aLayerPrn;  }
diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx
index e8caa44..9c74d43 100644
--- a/svx/source/svdraw/svdpagv.cxx
+++ b/svx/source/svdraw/svdpagv.cxx
@@ -229,7 +229,6 @@ void SdrPageView::Show()
     if(!IsVisible())
     {
         mbVisible = true;
-        InvalidateAllWin();
 
         for(sal_uInt32 a(0L); a < GetView().PaintWindowCount(); a++)
         {
@@ -242,7 +241,10 @@ void SdrPageView::Hide()
 {
     if(IsVisible())
     {
-        InvalidateAllWin();
+        if (!GetView().GetModel()->isTiledRendering())
+        {
+            InvalidateAllWin();
+        }
         mbVisible = false;
         ClearPageWindows();
     }
commit 07aa8685539b3ae48b99176975ed2a39f454d1e0
Author: Henry Castro <hcas...@collabora.com>
Date:   Thu Aug 6 11:40:28 2015 -0400

    LOKit: set thread name lo_startmain
    
    It is necessary the thread name for debugging LOKit threads.
    
    Change-Id: I713595eb1319234ff90a6eddebcac5ebad912b04

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 30236f95..0a7a63f 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -940,6 +940,8 @@ static bool initialize_uno(const OUString& aAppProgramURL)
 
 static void lo_startmain(void*)
 {
+    osl_setThreadName("lo_startmain");
+
     soffice_main();
 }
 
commit 7980efe3fea9ed17d0cd03599bde422338d732c3
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Tue Jul 7 08:40:28 2015 +0200

    LOK: Corner case with working dir as '/'.
    
    Change-Id: I3965966f0d3fe65389e8834d67452ac56f9df2d6

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 7cfbd37..30236f95 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -172,9 +172,11 @@ static OUString getAbsoluteURL(const char* pURL)
     // convert relative paths to absolute ones
     OUString aWorkingDir;
     osl_getProcessWorkingDir(&aWorkingDir.pData);
+    if (!aWorkingDir.endsWith("/"))
+        aWorkingDir += "/";
 
     try {
-        return rtl::Uri::convertRelToAbs(aWorkingDir + "/", aURL);
+        return rtl::Uri::convertRelToAbs(aWorkingDir, aURL);
     }
     catch (const rtl::MalformedUriException &)
     {
commit c20b0925580652ada7c889ac3ff5c26ff7def9cf
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Jun 24 17:35:37 2015 +0100

    cppcheck: noExplicitConstructor
    
    Change-Id: I80cd2975f17bb7fa57fa669873ef1dd8f3595a11

diff --git a/desktop/source/app/cmdlineargs.hxx 
b/desktop/source/app/cmdlineargs.hxx
index 7b8c0da..fe8ea8b 100644
--- a/desktop/source/app/cmdlineargs.hxx
+++ b/desktop/source/app/cmdlineargs.hxx
@@ -51,7 +51,7 @@ class CommandLineArgs: private boost::noncopyable
         };
 
         CommandLineArgs();
-        CommandLineArgs( Supplier& supplier );
+        explicit CommandLineArgs( Supplier& supplier );
 
         boost::optional< OUString > getCwdUrl() const { return m_cwdUrl; }
 
diff --git a/desktop/source/app/desktopresid.hxx 
b/desktop/source/app/desktopresid.hxx
index d07df7e..4311421 100644
--- a/desktop/source/app/desktopresid.hxx
+++ b/desktop/source/app/desktopresid.hxx
@@ -28,7 +28,7 @@ namespace desktop
 class DesktopResId : public ResId
 {
     public:
-        DesktopResId( sal_uInt16 nId );
+        explicit DesktopResId( sal_uInt16 nId );
 };
 
 }
diff --git a/desktop/source/deployment/gui/dp_gui.h 
b/desktop/source/deployment/gui/dp_gui.h
index 0de1148..b99099f 100644
--- a/desktop/source/deployment/gui/dp_gui.h
+++ b/desktop/source/deployment/gui/dp_gui.h
@@ -68,7 +68,7 @@ enum PackageState { REGISTERED, NOT_REGISTERED, AMBIGUOUS, 
NOT_AVAILABLE };
 class SelectedPackage: public salhelper::SimpleReferenceObject {
 public:
     SelectedPackage() {}
-    SelectedPackage( const ::com::sun::star::uno::Reference< 
::com::sun::star::deployment::XPackage> &xPackage)
+    explicit SelectedPackage( const ::com::sun::star::uno::Reference< 
::com::sun::star::deployment::XPackage> &xPackage)
     : m_xPackage( xPackage )
     {}
 
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index fb98cdd..37afa83 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -136,8 +136,8 @@ class ExtBoxWithBtns_Impl : public ExtensionBox_Impl
     DECL_DLLPRIVATE_LINK( HandleRemoveBtn, void * );
 
 public:
-                    ExtBoxWithBtns_Impl(vcl::Window* pParent);
-                   virtual ~ExtBoxWithBtns_Impl();
+    explicit ExtBoxWithBtns_Impl(vcl::Window* pParent);
+    virtual ~ExtBoxWithBtns_Impl();
     virtual void dispose() SAL_OVERRIDE;
 
     void InitFromDialog(ExtMgrDialog *pParentDialog);
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
index f98de99..afd9dce 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx
@@ -46,7 +46,7 @@ struct FindWeakRef
 {
     const uno::Reference<deployment::XPackage> m_extension;
 
-    FindWeakRef( uno::Reference<deployment::XPackage> const & ext): 
m_extension(ext) {}
+    explicit FindWeakRef( uno::Reference<deployment::XPackage> const & ext): 
m_extension(ext) {}
     bool operator () (uno::WeakReference< deployment::XPackage >  const & ref);
 };
 
diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx 
b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
index 6a027c4..0d5ca8f 100644
--- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
+++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx
@@ -96,8 +96,8 @@ class ExtensionRemovedListener : public 
::cppu::WeakImplHelper1<css::lang::XEven
 
 public:
 
-    ExtensionRemovedListener( ExtensionBox_Impl *pParent ) { m_pParent = 
pParent; }
-   virtual ~ExtensionRemovedListener();
+    explicit ExtensionRemovedListener( ExtensionBox_Impl *pParent ) { 
m_pParent = pParent; }
+    virtual ~ExtensionRemovedListener();
 
 
     // XEventListener
@@ -173,7 +173,7 @@ class ExtensionBox_Impl : public ::svt::IExtensionListBox
 
     void Init();
 public:
-    ExtensionBox_Impl(vcl::Window* pParent);
+    explicit ExtensionBox_Impl(vcl::Window* pParent);
     virtual ~ExtensionBox_Impl();
     virtual void dispose() SAL_OVERRIDE;
 
diff --git a/desktop/source/deployment/gui/dp_gui_shared.hxx 
b/desktop/source/deployment/gui/dp_gui_shared.hxx
index 8d926c8..bd175cb 100644
--- a/desktop/source/deployment/gui/dp_gui_shared.hxx
+++ b/desktop/source/deployment/gui/dp_gui_shared.hxx
@@ -36,7 +36,7 @@ struct DeploymentGuiResMgr :
 class DpGuiResId : public ResId
 {
 public:
-    DpGuiResId( sal_uInt16 nId ):ResId( nId, *DeploymentGuiResMgr::get() ) {}
+    explicit DpGuiResId( sal_uInt16 nId ):ResId( nId, 
*DeploymentGuiResMgr::get() ) {}
 };
 
 #define DPGUI_RESSTR(i)   DpGuiResId(i).toString()
diff --git a/desktop/source/deployment/gui/dp_gui_updatedata.hxx 
b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
index c8ae7ab..ac12cc0 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedata.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedata.hxx
@@ -38,7 +38,7 @@ namespace dp_gui {
 
 struct UpdateData
 {
-    UpdateData( ::com::sun::star::uno::Reference< 
::com::sun::star::deployment::XPackage > const & aExt):
+    explicit UpdateData( ::com::sun::star::uno::Reference< 
::com::sun::star::deployment::XPackage > const & aExt):
         bIsShared(false), aInstalledPackage(aExt), aUpdateSource(NULL), 
m_nID(0), m_bIgnored(false){};
 
     //When entries added to the listbox then there can be one for the user 
update and one
diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx 
b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
index 18fa9de..76851b4 100644
--- a/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
+++ b/desktop/source/deployment/gui/dp_gui_updatedialog.hxx
@@ -115,7 +115,7 @@ private:
         sal_uInt16 getItemCount() const;
 
     private:
-        CheckListBox(UpdateDialog::CheckListBox &) SAL_DELETED_FUNCTION;
+        explicit CheckListBox(UpdateDialog::CheckListBox &) 
SAL_DELETED_FUNCTION;
         void operator =(UpdateDialog::CheckListBox &) SAL_DELETED_FUNCTION;
 
         virtual void MouseButtonDown(MouseEvent const & event) SAL_OVERRIDE;
diff --git a/desktop/source/deployment/manager/dp_commandenvironments.hxx 
b/desktop/source/deployment/manager/dp_commandenvironments.hxx
index d51d161..b45c28d 100644
--- a/desktop/source/deployment/manager/dp_commandenvironments.hxx
+++ b/desktop/source/deployment/manager/dp_commandenvironments.hxx
@@ -44,7 +44,7 @@ protected:
 public:
     virtual ~BaseCommandEnv();
     BaseCommandEnv();
-    BaseCommandEnv(
+    explicit BaseCommandEnv(
         css::uno::Reference< css::task::XInteractionHandler> const & handler);
 
     // XCommandEnvironment
@@ -70,7 +70,7 @@ class TmpRepositoryCommandEnv : public BaseCommandEnv
 {
 public:
     TmpRepositoryCommandEnv();
-    TmpRepositoryCommandEnv(css::uno::Reference< 
css::task::XInteractionHandler> const & handler);
+    explicit TmpRepositoryCommandEnv(css::uno::Reference< 
css::task::XInteractionHandler> const & handler);
 
 // XInteractionHandler
     virtual void SAL_CALL handle(
@@ -111,7 +111,7 @@ class NoLicenseCommandEnv : public BaseCommandEnv
 
 public:
     NoLicenseCommandEnv(){};
-    NoLicenseCommandEnv(css::uno::Reference< css::task::XInteractionHandler> 
const & handler);
+    explicit NoLicenseCommandEnv(css::uno::Reference< 
css::task::XInteractionHandler> const & handler);
 
 // XInteractionHandler
     virtual void SAL_CALL handle(
diff --git a/desktop/source/deployment/manager/dp_extensionmanager.hxx 
b/desktop/source/deployment/manager/dp_extensionmanager.hxx
index 47a3e96..1c2cea9 100644
--- a/desktop/source/deployment/manager/dp_extensionmanager.hxx
+++ b/desktop/source/deployment/manager/dp_extensionmanager.hxx
@@ -44,7 +44,7 @@ class ExtensionManager : private ::dp_misc::MutexHolder,
         public ::cppu::WeakComponentImplHelper1< 
css::deployment::XExtensionManager >
 {
 public:
-    ExtensionManager( css::uno::Reference< css::uno::XComponentContext >const& 
xContext);
+    explicit ExtensionManager( css::uno::Reference< 
css::uno::XComponentContext >const& xContext);
     virtual     ~ExtensionManager();
 
     static css::uno::Sequence< OUString > getServiceNames();
diff --git a/desktop/source/deployment/manager/dp_informationprovider.cxx 
b/desktop/source/deployment/manager/dp_informationprovider.cxx
index be26372..b550f09 100644
--- a/desktop/source/deployment/manager/dp_informationprovider.cxx
+++ b/desktop/source/deployment/manager/dp_informationprovider.cxx
@@ -63,7 +63,7 @@ class PackageInformationProvider :
 
 {
     public:
-                 PackageInformationProvider( uno::Reference< 
uno::XComponentContext >const& xContext);
+    explicit PackageInformationProvider( uno::Reference< 
uno::XComponentContext >const& xContext);
     virtual     ~PackageInformationProvider();
 
     // XPackageInformationProvider
diff --git a/desktop/source/deployment/manager/dp_manager.cxx 
b/desktop/source/deployment/manager/dp_manager.cxx
index 3ddc5f8..bf0f4e9 100644
--- a/desktop/source/deployment/manager/dp_manager.cxx
+++ b/desktop/source/deployment/manager/dp_manager.cxx
@@ -77,7 +77,7 @@ namespace dp_manager {
 struct MatchTempDir
 {
     OUString m_str;
-    MatchTempDir( OUString const & str ) : m_str( str ) {}
+    explicit MatchTempDir( OUString const & str ) : m_str( str ) {}
     bool operator () ( ActivePackages::Entries::value_type const & v ) const {
         return v.second.temporaryName.equalsIgnoreAsciiCase( m_str );
     }
diff --git a/desktop/source/deployment/manager/dp_managerfac.cxx 
b/desktop/source/deployment/manager/dp_managerfac.cxx
index 49238f9..06a5acd 100644
--- a/desktop/source/deployment/manager/dp_managerfac.cxx
+++ b/desktop/source/deployment/manager/dp_managerfac.cxx
@@ -56,7 +56,7 @@ protected:
 
 public:
     virtual ~PackageManagerFactoryImpl();
-    PackageManagerFactoryImpl(
+    explicit PackageManagerFactoryImpl(
         Reference<XComponentContext> const & xComponentContext );
 
     // XPackageManagerFactory
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx 
b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 292d0bf..dab93e3 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -148,7 +148,7 @@ class FileDoesNotExistFilter
 
 public:
     virtual ~FileDoesNotExistFilter();
-    FileDoesNotExistFilter(
+    explicit FileDoesNotExistFilter(
         const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv);
 
     bool exist() { return m_bExist;}
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ec78be6..7cfbd37 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -237,7 +237,7 @@ struct LibLODocument_Impl : public _LibreOfficeKitDocument
     uno::Reference<css::lang::XComponent> mxComponent;
     shared_ptr< LibreOfficeKitDocumentClass > m_pDocumentClass;
 
-    LibLODocument_Impl(const uno::Reference <css::lang::XComponent> 
&xComponent) :
+    explicit LibLODocument_Impl(const uno::Reference <css::lang::XComponent> 
&xComponent) :
         mxComponent( xComponent )
     {
         if (!(m_pDocumentClass = gDocumentClass.lock()))
diff --git a/desktop/source/migration/services/oo3extensionmigration.hxx 
b/desktop/source/migration/services/oo3extensionmigration.hxx
index 33b0809..ad04d83 100644
--- a/desktop/source/migration/services/oo3extensionmigration.hxx
+++ b/desktop/source/migration/services/oo3extensionmigration.hxx
@@ -87,7 +87,7 @@ namespace migration
         void                    migrateExtension( const OUString& sSourceDir );
 
     public:
-        OO3ExtensionMigration(::com::sun::star::uno::Reference<
+        explicit OO3ExtensionMigration(::com::sun::star::uno::Reference<
             ::com::sun::star::uno::XComponentContext > const & ctx);
         virtual ~OO3ExtensionMigration();
 
diff --git a/desktop/source/offacc/acceptor.hxx 
b/desktop/source/offacc/acceptor.hxx
index a7c35ae..2881bf9 100644
--- a/desktop/source/offacc/acceptor.hxx
+++ b/desktop/source/offacc/acceptor.hxx
@@ -71,7 +71,7 @@ private:
     bool m_bDying;
 
 public:
-    Acceptor( const css::uno::Reference< css::uno::XComponentContext >& 
rxContext );
+    explicit Acceptor( const css::uno::Reference< css::uno::XComponentContext 
>& rxContext );
     virtual ~Acceptor();
 
     void run();
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx 
b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index b7f0e0e..b4e686e 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -54,7 +54,7 @@ namespace {
 struct ExtensionName
 {
     OUString m_str;
-    ExtensionName( OUString const & str ) : m_str( str ) {}
+    explicit ExtensionName( OUString const & str ) : m_str( str ) {}
     bool operator () ( Reference<deployment::XPackage> const & e ) const
     {
         if (m_str.equals(dp_misc::getIdentifier(e))
@@ -125,7 +125,7 @@ class DialogClosedListenerImpl :
     osl::Condition & m_rDialogClosedCondition;
 
 public:
-    DialogClosedListenerImpl( osl::Condition & rDialogClosedCondition )
+    explicit DialogClosedListenerImpl( osl::Condition & rDialogClosedCondition 
)
         : m_rDialogClosedCondition( rDialogClosedCondition ) {}
 
     // XEventListener (base of XDialogClosedListener)
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h 
b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 26a047a..5c25fbc 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -49,7 +49,7 @@ struct OptionInfo
 
 struct LockFileException : public css::uno::Exception
 {
-    LockFileException(OUString const & sMessage) :
+    explicit LockFileException(OUString const & sMessage) :
         css::uno::Exception(sMessage, css::uno::Reference< 
css::uno::XInterface > ()) {}
 };
 
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx
index 48d2933..ec71ad7 100644
--- a/desktop/source/splash/splash.cxx
+++ b/desktop/source/splash/splash.cxx
@@ -54,7 +54,7 @@ class SplashScreenWindow : public IntroWindow
 public:
     SplashScreen *pSpl;
     ScopedVclPtr<VirtualDevice> _vdev;
-            SplashScreenWindow(SplashScreen *);
+    explicit SplashScreenWindow(SplashScreen *);
     virtual ~SplashScreenWindow() { disposeOnce(); }
     virtual void dispose() SAL_OVERRIDE;
     // workwindow
diff --git a/desktop/source/splash/unxsplash.hxx 
b/desktop/source/splash/unxsplash.hxx
index 901e327..e712334 100644
--- a/desktop/source/splash/unxsplash.hxx
+++ b/desktop/source/splash/unxsplash.hxx
@@ -48,7 +48,7 @@ private:
     FILE *m_pOutFd;
 
 public:
-    UnxSplashScreen( const css::uno::Reference< css::uno::XComponentContext >& 
xCtx );
+    explicit UnxSplashScreen( const css::uno::Reference< 
css::uno::XComponentContext >& xCtx );
 
     // XStatusIndicator
     virtual void SAL_CALL start( const OUString& aText, sal_Int32 nRange ) 
throw ( css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
diff --git a/desktop/test/deployment/active/active_native.cxx 
b/desktop/test/deployment/active/active_native.cxx
index c88e191..06da72a 100644
--- a/desktop/test/deployment/active/active_native.cxx
+++ b/desktop/test/deployment/active/active_native.cxx
@@ -74,7 +74,7 @@ public:
     static_getSupportedServiceNames();
 
 private:
-    Provider(
+    explicit Provider(
         css::uno::Reference< css::uno::XComponentContext > const & context):
         context_(context) { assert(context.is()); }
 
@@ -166,7 +166,7 @@ public:
     { return css::uno::Sequence< rtl::OUString >(); }
 
 private:
-    Dispatch(
+    explicit Dispatch(
         css::uno::Reference< css::uno::XComponentContext > const & context):
         context_(context) { assert(context.is()); }
 
diff --git a/desktop/test/deployment/passive/passive_native.cxx 
b/desktop/test/deployment/passive/passive_native.cxx
index b7325f6..70b11cc 100644
--- a/desktop/test/deployment/passive/passive_native.cxx
+++ b/desktop/test/deployment/passive/passive_native.cxx
@@ -71,7 +71,7 @@ public:
     static_getSupportedServiceNames();
 
 private:
-    Provider(
+    explicit Provider(
         css::uno::Reference< css::uno::XComponentContext > const & context):
         context_(context) { assert(context.is()); }
 
@@ -163,7 +163,7 @@ public:
     { return css::uno::Sequence< rtl::OUString >(); }
 
 private:
-    Dispatch(
+    explicit Dispatch(
         css::uno::Reference< css::uno::XComponentContext > const & context):
         context_(context) { assert(context.is()); }
 
commit 650d9d4b1c6faca7224ae2f3b83ca30be801d465
Author: Jan Holesovsky <ke...@collabora.com>
Date:   Mon Sep 14 16:47:27 2015 +0200

    Revert the pre-init work for now.

diff --git a/cppuhelper/source/defaultbootstrap.cxx 
b/cppuhelper/source/defaultbootstrap.cxx
index b135b2c..1fbbf8f 100644
--- a/cppuhelper/source/defaultbootstrap.cxx
+++ b/cppuhelper/source/defaultbootstrap.cxx
@@ -43,18 +43,6 @@ rtl::OUString getBootstrapVariable(
     return v;
 }
 
-void default_preInitBootstrap(rtl::OUString const & aUri)
-{
-    rtl::Bootstrap bsUri(aUri);
-    if (bsUri.getHandle() == 0)
-        throw css::uno::DeploymentException("Cannot open uno ini " + aUri);
-
-    // create the service manager
-    rtl::Reference< cppuhelper::ServiceManager > aManager(new 
cppuhelper::ServiceManager);
-    // read rdb files
-    aManager->init(getBootstrapVariable(bsUri, "UNO_SERVICES"));
-    aManager->loadImplementations();
-}
 }
 
 css::uno::Reference< css::uno::XComponentContext >
@@ -119,9 +107,4 @@ cppu::defaultBootstrap_InitialComponentContext()
     return defaultBootstrap_InitialComponentContext(getUnoIniUri());
 }
 
-void
-cppu::preInitBootstrap()
-{
-    default_preInitBootstrap(getUnoIniUri());
-}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppuhelper/source/gcc3.map b/cppuhelper/source/gcc3.map
index 3d7a5c6..12c29834a 100644
--- a/cppuhelper/source/gcc3.map
+++ b/cppuhelper/source/gcc3.map
@@ -423,7 +423,6 @@ global:
         # enableChangeListenerNotification
         _ZN4cppu19OPropertySetHelper232enableChangeListenerNotificationEh;
         _ZThn*_N4cppu19OPropertySetHelper232enableChangeListenerNotificationEh;
-        _ZN4cppu16preInitBootstrapEv;
 } UDK_3.7;
 
 LIBO_UDK_3.9 { # LibO 3.7
diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index ffed6ba..2140a2f 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -42,7 +42,6 @@
 #include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
 #include <uno/environment.hxx>
-#include <osl/module.hxx>
 
 #include "loadsharedlibcomponentfactory.hxx"
 
@@ -879,40 +878,6 @@ void cppuhelper::ServiceManager::loadImplementation(
     }
 }
 
-void cppuhelper::ServiceManager::loadImplementations()
-{
-    rtl::OUString aUri;
-    osl::MutexGuard g(rBHelper.rMutex);
-
-    for (Data::NamedImplementations::const_iterator iterator(
-            data_.namedImplementations.begin());
-            iterator != data_.namedImplementations.end(); ++iterator)
-    {
-        try
-        {
-            aUri = cppu::bootstrap_expandUri(iterator->second->info->uri);
-        }
-        catch (css::lang::IllegalArgumentException& aError)
-        {
-            throw css::uno::DeploymentException(
-                "Cannot expand URI" + iterator->second->info->uri + ": " + 
aError.Message,
-                static_cast< cppu::OWeakObject * >(this));
-        }
-
-        if (iterator->second->info->loader == 
"com.sun.star.loader.SharedLibrary" &&
-            iterator->second->status != Data::Implementation::STATUS_LOADED)
-        {
-            oslModule aModule = osl_loadModule( aUri.pData, SAL_LOADMODULE_NOW 
| SAL_LOADMODULE_GLOBAL );
-            SAL_INFO("lok", "loaded component library " << aUri << ( aModule ? 
" ok" : " no"));
-
-            // leak aModule
-            // osl_unloadModule(aModule);
-            if ( aModule )
-                iterator->second->status = Data::Implementation::STATUS_LOADED;
-        }
-    }
-}
-
 void cppuhelper::ServiceManager::disposing() {
     std::vector< css::uno::Reference<css::lang::XComponent> > sngls;
     std::vector< css::uno::Reference< css::lang::XComponent > > comps;
diff --git a/cppuhelper/source/servicemanager.hxx 
b/cppuhelper/source/servicemanager.hxx
index ddf85965f..903084b 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -203,8 +203,6 @@ public:
         css::uno::Reference< css::uno::XComponentContext > const & context,
         boost::shared_ptr< Data::Implementation > & implementation);
 
-    void loadImplementations();
-
 private:
     virtual ~ServiceManager() {}
 
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index 4093c3a..467fecc 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -58,7 +58,6 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
     ucbhelper \
     utl \
     vcl \
-    xmlreader \
        $(gb_UWINAPI) \
 ))
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9e1f1b4..ec78be6 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -42,8 +42,6 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/ucb/XContentProvider.hpp>
 #include <com/sun/star/ucb/XUniversalContentBroker.hpp>
-#include <com/sun/star/container/XContentEnumerationAccess.hpp>
-#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
 
 #include <vcl/svapp.hxx>
 #include <vcl/svpforlokit.hxx>
@@ -894,7 +892,7 @@ static void aBasicErrorFunc(const OUString& rError, const 
OUString& rAction)
     fprintf(stderr, "Unexpected basic error dialog '%s'\n", aBuffer.getStr());
 }
 
-static bool initialize_uno(const OUString& aAppProgramURL, bool bPreInit)
+static bool initialize_uno(const OUString& aAppProgramURL)
 {
 #ifdef IOS
     // For iOS we already hardocde the inifile as "rc" in the .app directory.
@@ -903,13 +901,6 @@ static bool initialize_uno(const OUString& aAppProgramURL, 
bool bPreInit)
     rtl::Bootstrap::setIniFilename(aAppProgramURL + "/" 
SAL_CONFIGFILE("soffice"));
 #endif
 
-    if (bPreInit)
-    {
-        // pre-load all component libraries.
-        cppu::preInitBootstrap();
-        return true;
-    }
-
     xContext = cppu::defaultBootstrap_InitialComponentContext();
     if (!xContext.is())
     {
@@ -973,41 +964,17 @@ static void lo_status_indicator_callback(void *data, 
comphelper::LibreOfficeKit:
     }
 }
 
-/// pre-load and parse all filter XML
-static void forceLoadFilterXML()
-{
-}
-
 static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const 
char* pUserProfilePath)
 {
-    enum {
-        PRE_INIT,     // setup shared data in master process
-        SECOND_INIT,  // complete init. after fork
-        FULL_INIT     // do a standard complete init.
-    } eStage;
-
-    // Did we do a pre-initialize
-    static bool bPreInited = false;
-
-    // What stage are we at ?
-    if (pThis == NULL)
-        eStage = PRE_INIT;
-    else if (bPreInited)
-        eStage = SECOND_INIT;
-    else
-        eStage = FULL_INIT;
-
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
 
     if (bInitialized)
         return 1;
 
-    if (eStage != SECOND_INIT)
-        comphelper::LibreOfficeKit::setActive();
-    if (eStage != PRE_INIT)
-        
comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback,
 pLib);
+    comphelper::LibreOfficeKit::setActive();
+    
comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback,
 pLib);
 
-    if (eStage != SECOND_INIT && pUserProfilePath)
+    if (pUserProfilePath)
         rtl::Bootstrap::set(OUString("UserInstallation"), 
OUString(pUserProfilePath, strlen(pUserProfilePath), RTL_TEXTENCODING_UTF8));
 
     OUString aAppPath;
@@ -1030,31 +997,22 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
 
     try
     {
-        if (eStage != SECOND_INIT)
+        SAL_INFO("lok", "Attempting to initalize UNO");
+        if (!initialize_uno(aAppURL))
         {
-            SAL_INFO("lok", "Attempting to initalize UNO");
-
-            if (!initialize_uno(aAppURL, (eStage == PRE_INIT)))
-                return false;
-
-            if (eStage != PRE_INIT)
-                force_c_locale();
-
-            // Force headless -- this is only for bitmap rendering.
-            rtl::Bootstrap::set("SAL_USE_VCLPLUGIN", "svp");
+            return false;
+        }
+        force_c_locale();
 
-            // We specifically need to make sure we have the "headless"
-            // command arg set (various code specifically checks via
-            // CommandLineArgs):
-            desktop::Desktop::GetCommandLineArgs().setHeadless();
+        // Force headless -- this is only for bitmap rendering.
+        rtl::Bootstrap::set("SAL_USE_VCLPLUGIN", "svp");
 
-            Application::EnableHeadlessMode(true);
-        }
+        // We specifically need to make sure we have the "headless"
+        // command arg set (various code specifically checks via
+        // CommandLineArgs):
+        desktop::Desktop::GetCommandLineArgs().setHeadless();
 
-        if (eStage == PRE_INIT)
-        {
-            forceLoadFilterXML();
-        }
+        Application::EnableHeadlessMode(true);
 
         // This is horrible crack. I really would want to go back to simply 
just call
         // InitVCL() here. The OfficeIPCThread thing is just horrible.
@@ -1075,34 +1033,27 @@ static int lo_initialize(LibreOfficeKit* pThis, const 
char* pAppPath, const char
         // the Thread from wherever (it's done again in Desktop::Main), and can
         // then use it to wait until we're definitely ready to continue.
 
-        if (eStage != PRE_INIT)
+        SAL_INFO("lok", "Enabling OfficeIPCThread");
+        OfficeIPCThread::EnableOfficeIPCThread();
+        SAL_INFO("lok", "Starting soffice_main");
+        pLib->maThread = osl_createThread(lo_startmain, NULL);
+        SAL_INFO("lok", "Waiting for OfficeIPCThread");
+        OfficeIPCThread::WaitForReady();
+        SAL_INFO("lok", "OfficeIPCThread ready -- continuing");
+
+        // If the Thread has been disabled again that indicates that a
+        // restart is required (or in any case we don't have a useable
+        // process around).
+        if (!OfficeIPCThread::IsEnabled())
         {
-            SAL_INFO("lok", "Enabling OfficeIPCThread");
-            OfficeIPCThread::EnableOfficeIPCThread();
-            SAL_INFO("lok", "Starting soffice_main");
-            pLib->maThread = osl_createThread(lo_startmain, NULL);
-            SAL_INFO("lok", "Waiting for OfficeIPCThread");
-            OfficeIPCThread::WaitForReady();
-            SAL_INFO("lok", "OfficeIPCThread ready -- continuing");
-
-            // If the Thread has been disabled again that indicates that a
-            // restart is required (or in any case we don't have a useable
-            // process around).
-            if (!OfficeIPCThread::IsEnabled())
-            {
-                fprintf(stderr, "LOK init failed -- restart required\n");
-                return false;
-            }
+            fprintf(stderr, "LOK init failed -- restart required\n");
+            return false;
         }
 
-        if (eStage != SECOND_INIT)
-            ErrorHandler::RegisterDisplay(aBasicErrorFunc);
+        ErrorHandler::RegisterDisplay(aBasicErrorFunc);
 
         SAL_INFO("lok", "LOK Initialized");
-        if (eStage == PRE_INIT)
-            bPreInited = true;
-        else
-            bInitialized = true;
+        bInitialized = true;
     }
     catch (css::uno::Exception& exception)
     {
@@ -1136,12 +1087,6 @@ LibreOfficeKit *libreofficekit_hook(const char* 
install_path)
     return libreofficekit_hook_2(install_path, NULL);
 }
 
-SAL_JNI_EXPORT
-int lok_preinit(const char* install_path, const char* user_profile_path)
-{
-    return lo_initialize(NULL, install_path, user_profile_path);
-}
-
 static void lo_destroy(LibreOfficeKit* pThis)
 {
     LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis);
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index 60ee19e..ae87c79 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -83,29 +83,7 @@ int main (int argc, char **argv)
         return 1;
 
     // coverity[tainted_string] - build time test tool
-    char *install_path = argv[1];
-
-    if( argc > 4 )
-    {
-        fprintf( stderr, "testing preinit\n");
-        char *imp_lib;
-        void *dlhandle;
-        dlhandle = lok_dlopen( install_path, &imp_lib );
-        if( !dlhandle )
-        {
-            fprintf( stderr, "Failed to link '%s'\n", lok_dlerror() );
-            return -1;
-        }
-        LokHookPreInit *preinit = (LokHookPreInit *) lok_dlsym( dlhandle, 
"lok_preinit" );
-        if( !preinit )
-        {
-            fprintf( stderr, "Failed to find pre-init symbol: %s\n", 
lok_dlerror() );
-            return -1;
-        }
-        preinit( install_path, NULL );
-    }
-
-    Office *pOffice = lok_cpp_init( install_path );
+    Office *pOffice = lok_cpp_init( argv[1] );
     if( !pOffice )
     {
         fprintf( stderr, "Failed to initialize\n" );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to