[Libreoffice-commits] core.git: 4 commits - desktop/qa desktop/source include/LibreOfficeKit include/vcl libreofficekit/qa libreofficekit/source sc/inc sc/source sd/qa sd/source sw/inc sw/qa sw/source

Miklos Vajna vmiklos at collabora.co.uk
Wed Nov 18 07:39:58 PST 2015


 desktop/qa/desktop_lib/test_desktop_lib.cxx         |    4 -
 desktop/source/lib/init.cxx                         |   78 ++++++++++----------
 desktop/source/lib/lokandroid.cxx                   |    2 
 include/LibreOfficeKit/LibreOfficeKit.h             |    3 
 include/LibreOfficeKit/LibreOfficeKit.hxx           |   16 +++-
 include/LibreOfficeKit/LibreOfficeKitGtk.h          |    2 
 include/vcl/ITiledRenderable.hxx                    |    2 
 libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx |   25 +++++-
 libreofficekit/source/gtk/lokdocview.cxx            |    5 +
 sc/inc/docuno.hxx                                   |    2 
 sc/source/ui/unoobj/docuno.cxx                      |    2 
 sd/qa/unit/tiledrendering/tiledrendering.cxx        |    2 
 sd/source/ui/inc/unomodel.hxx                       |    2 
 sd/source/ui/unoidl/unomodel.cxx                    |    2 
 sw/inc/unotxdoc.hxx                                 |    2 
 sw/qa/extras/tiledrendering/tiledrendering.cxx      |    3 
 sw/source/uibase/uno/unotxdoc.cxx                   |    8 +-
 17 files changed, 102 insertions(+), 58 deletions(-)

New commits:
commit be28ab9aa535e36ea226bc5aeaedea95fd2ba3db
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 18 16:07:17 2015 +0100

    sw: handle arguments in SwXTextDocument::initializeForTiledRendering()
    
    Change-Id: I19efc6050c78162e0889437d4c8285d1a6714e82

diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 2761a7a..4bede99 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3200,7 +3200,7 @@ OUString SwXTextDocument::getPartName(int nPart)
     return OUString(SW_RES(STR_PAGE)) + OUString::number(nPart + 1);
 }
 
-void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
+void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
 {
     SolarMutexGuard aGuard;
 
@@ -3222,6 +3222,12 @@ void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::
     // Tiled rendering defaults.
     SwViewOption aViewOption(*pViewShell->GetViewOptions());
     aViewOption.SetHardBlank(false);
+    for (sal_Int32 i = 0; i < rArguments.getLength(); ++i)
+    {
+        const beans::PropertyValue& rValue = rArguments[i];
+        if (rValue.Name == ".uno:HideWhitespace" && rValue.Value.has<bool>())
+            aViewOption.SetHideWhitespaceMode(rValue.Value.get<bool>());
+    }
     pViewShell->ApplyViewOptions(aViewOption);
 
     // Disable map mode, so that it's possible to send mouse event coordinates
commit 0ea68eecddf0211f842645c4d257899531692770
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 18 15:57:36 2015 +0100

    gtktiledviewer: allow passing initializeForRendering() arguments
    
    Change-Id: Ic7b52764cf2fedbf73d4dcaaf36d1055b8ee22f2

diff --git a/include/LibreOfficeKit/LibreOfficeKitGtk.h b/include/LibreOfficeKit/LibreOfficeKitGtk.h
index 32cb669..c947ce3 100644
--- a/include/LibreOfficeKit/LibreOfficeKitGtk.h
+++ b/include/LibreOfficeKit/LibreOfficeKitGtk.h
@@ -65,6 +65,7 @@ GtkWidget*                     lok_doc_view_new_from_widget        (LOKDocView*
  * lok_doc_view_open_document:
  * @pDocView: The #LOKDocView instance
  * @pPath: (transfer full): The path of the document that #LOKDocView widget should try to open
+ * @pRenderingArguments: lok::Document::initializeForRendering() arguments.
  * @cancellable:
  * @callback:
  * @userdata:
@@ -73,6 +74,7 @@ GtkWidget*                     lok_doc_view_new_from_widget        (LOKDocView*
  */
 void                           lok_doc_view_open_document          (LOKDocView* pDocView,
                                                                     const gchar* pPath,
+                                                                    const gchar* pRenderingArguments,
                                                                     GCancellable* cancellable,
                                                                     GAsyncReadyCallback callback,
                                                                     gpointer userdata);
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index fe35f2e..f76ad1a 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -29,7 +29,9 @@
 
 static int help()
 {
-    fprintf( stderr, "Usage: gtktiledviewer <absolute-path-to-libreoffice-install's-program-directory> <path-to-document>\n" );
+    fprintf(stderr, "Usage: gtktiledviewer <absolute-path-to-libreoffice-install's-program-directory> <path-to-document> [<options> ... ]\n\n");
+    fprintf(stderr, "Options:\n\n");
+    fprintf(stderr, "--hide-whitespace: Hide whitespace between pages in text documents.\n");
     return 1;
 }
 
@@ -475,13 +477,25 @@ static void createView(GtkWidget* pButton, gpointer /*pItem*/)
 }
 
 /// Creates a new model, i.e. LOK init and document load, one view implicitly.
-static void createModelAndView(const char* pLOPath, const char* pDocPath)
+static void createModelAndView(const char* pLOPath, const char* pDocPath, const std::vector<std::string>& rArguments)
 {
     GtkWidget* pDocView = lok_doc_view_new(pLOPath, nullptr, nullptr);
 
     setupWidgetAndCreateWindow(pDocView);
 
-    lok_doc_view_open_document(LOK_DOC_VIEW(pDocView), pDocPath, nullptr, openDocumentCallback, pDocView);
+    boost::property_tree::ptree aTree;
+    for (const std::string& rArgument : rArguments)
+    {
+        if (rArgument == "--hide-whitespace")
+        {
+            aTree.put(boost::property_tree::ptree::path_type(".uno:HideWhitespace/type", '/'), "boolean");
+            aTree.put(boost::property_tree::ptree::path_type(".uno:HideWhitespace/value", '/'), true);
+        }
+    }
+    std::stringstream aStream;
+    boost::property_tree::write_json(aStream, aTree);
+    std::string aArguments = aStream.str();
+    lok_doc_view_open_document(LOK_DOC_VIEW(pDocView), pDocPath, aArguments.c_str(), nullptr, openDocumentCallback, pDocView);
 }
 
 /// Our GtkClipboardGetFunc implementation for HTML.
@@ -1263,7 +1277,10 @@ int main( int argc, char* argv[] )
 
     gtk_init( &argc, &argv );
 
-    createModelAndView(argv[1], argv[2]);
+    std::vector<std::string> aArguments;
+    for (int i = 3; i < argc; ++i)
+        aArguments.push_back(argv[i]);
+    createModelAndView(argv[1], argv[2], aArguments);
 
     gtk_main();
 
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 55822cd..6e9fc19 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -44,6 +44,7 @@ struct LOKDocViewPrivateImpl
 {
     const gchar* m_aLOPath;
     const gchar* m_aDocPath;
+    std::string m_aRenderingArguments;
     gdouble m_nLoadProgress;
     gboolean m_bIsLoading;
     gboolean m_bCanZoomIn;
@@ -530,7 +531,7 @@ static gboolean postDocumentLoad(gpointer pData)
     LOKDocViewPrivate& priv = getPrivate(pLOKDocView);
 
     priv->m_pDocument->pClass->setView(priv->m_pDocument, priv->m_nViewId);
-    priv->m_pDocument->pClass->initializeForRendering(priv->m_pDocument, nullptr);
+    priv->m_pDocument->pClass->initializeForRendering(priv->m_pDocument, priv->m_aRenderingArguments.c_str());
     priv->m_pDocument->pClass->registerCallback(priv->m_pDocument, callbackWorker, pLOKDocView);
     priv->m_pDocument->pClass->getDocumentSize(priv->m_pDocument, &priv->m_nDocumentWidthTwips, &priv->m_nDocumentHeightTwips);
     g_timeout_add(600, handleTimeout, pLOKDocView);
@@ -2312,6 +2313,7 @@ lok_doc_view_open_document_finish (LOKDocView* pDocView, GAsyncResult* res, GErr
 SAL_DLLPUBLIC_EXPORT void
 lok_doc_view_open_document (LOKDocView* pDocView,
                             const gchar* pPath,
+                            const gchar* pRenderingArguments,
                             GCancellable* cancellable,
                             GAsyncReadyCallback callback,
                             gpointer userdata)
@@ -2324,6 +2326,7 @@ lok_doc_view_open_document (LOKDocView* pDocView,
     pLOEvent->m_pPath = pPath;
 
     priv->m_aDocPath = pPath;
+    priv->m_aRenderingArguments = pRenderingArguments;
     g_task_set_task_data(task, pLOEvent, LOEvent::destroy);
 
     g_thread_pool_push(priv->lokThreadPool, g_object_ref(task), &error);
commit 479325dec83ea2747f3ce27ca7e817695b15e1bb
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 18 15:20:30 2015 +0100

    vcl::ITiledRenderable::initializeForTiledRendering: support init. arguments
    
    Change-Id: I9a6a75457078dc6383673f4c1a2012b69b5cefdd

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9f97dbc..fd0a10d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -983,7 +983,7 @@ static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
         doc_iniUnoCommands();
         uno::Sequence<beans::PropertyValue> aPropertyValues;
         jsonToPropertyValues(pArguments, aPropertyValues);
-        pDoc->initializeForTiledRendering();
+        pDoc->initializeForTiledRendering(aPropertyValues);
     }
 }
 
diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx
index e1cdf83..a86bb4d 100644
--- a/include/vcl/ITiledRenderable.hxx
+++ b/include/vcl/ITiledRenderable.hxx
@@ -94,7 +94,7 @@ public:
      * Setup various document properties that are needed for the document to
      * be renderable via tiled rendering.
      */
-    virtual void initializeForTiledRendering() = 0;
+    virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) = 0;
 
     /**
      * Registers a callback that will be invoked whenever the tiled renderer
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index 4c79af8..f4430e5 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -376,7 +376,7 @@ public:
     virtual OUString getPartName(int nPart) override;
 
     /// @see vcl::ITiledRenderable::initializeForTiledRendering().
-    virtual void initializeForTiledRendering() override;
+    virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override;
 
     /// @see vcl::ITiledRenderable::registerCallback().
     virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) override;
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 4729cea..c57f911 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -931,7 +931,7 @@ Pointer ScModelObj::getPointer()
     return pGridWindow->GetPointer();
 }
 
-void ScModelObj::initializeForTiledRendering()
+void ScModelObj::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
 {
     SolarMutexGuard aGuard;
     pDocShell->GetDocument().GetDrawLayer()->setTiledRendering(true);
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index d3e39b6..6ebb6ab 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -120,7 +120,7 @@ SdXImpressDocument* SdTiledRenderingTest::createDoc(const char* pName)
     mxComponent = loadFromDesktop(getURLFromSrc(DATA_DIRECTORY) + OUString::createFromAscii(pName), "com.sun.star.presentation.PresentationDocument");
     SdXImpressDocument* pImpressDocument = dynamic_cast<SdXImpressDocument*>(mxComponent.get());
     CPPUNIT_ASSERT(pImpressDocument);
-    pImpressDocument->initializeForTiledRendering();
+    pImpressDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
     return pImpressDocument;
 }
 
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index bb0220f..fe09a74 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -244,7 +244,7 @@ public:
     virtual void setPartMode( int nPartMode ) override;
 
     /// @see vcl::ITiledRenderable::initializeForTiledRendering().
-    virtual void initializeForTiledRendering() override;
+    virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override;
     /// @see vcl::ITiledRenderable::registerCallback().
     virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) override;
     /// @see vcl::ITiledRenderable::postKeyEvent().
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 9c37007..e4b31bb 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2360,7 +2360,7 @@ Size SdXImpressDocument::getDocumentSize()
     return Size(convertMm100ToTwip(aSize.getWidth()), convertMm100ToTwip(aSize.getHeight()));
 }
 
-void SdXImpressDocument::initializeForTiledRendering()
+void SdXImpressDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
 {
     SolarMutexGuard aGuard;
 
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index 3aec163..222114b 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -414,7 +414,7 @@ public:
     /// @see vcl::ITiledRenderable::getPartName().
     virtual OUString getPartName(int nPart) override;
     /// @see vcl::ITiledRenderable::initializeForTiledRendering().
-    virtual void initializeForTiledRendering() override;
+    virtual void initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& rArguments) override;
     /// @see vcl::ITiledRenderable::registerCallback().
     virtual void registerCallback(LibreOfficeKitCallback pCallback, void* pData) override;
     /// @see vcl::ITiledRenderable::postKeyEvent().
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index 2ec1052..858e6a4 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -87,7 +87,7 @@ SwXTextDocument* SwTiledRenderingTest::createDoc(const char* pName)
 
     SwXTextDocument* pTextDocument = dynamic_cast<SwXTextDocument*>(mxComponent.get());
     CPPUNIT_ASSERT(pTextDocument);
-    pTextDocument->initializeForTiledRendering();
+    pTextDocument->initializeForTiledRendering(uno::Sequence<beans::PropertyValue>());
     return pTextDocument;
 }
 
@@ -423,7 +423,6 @@ void SwTiledRenderingTest::testDocumentSizeChanged()
     SwXTextDocument* pXTextDocument = createDoc("2-pages.odt");
     pXTextDocument->registerCallback(&SwTiledRenderingTest::callback, this);
     SwWrtShell* pWrtShell = pXTextDocument->GetDocShell()->GetWrtShell();
-    pXTextDocument->initializeForTiledRendering();
     Size aSize = pXTextDocument->getDocumentSize();
 
     // Delete the second page and see how the size changes.
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 1d1830a..2761a7a 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3200,7 +3200,7 @@ OUString SwXTextDocument::getPartName(int nPart)
     return OUString(SW_RES(STR_PAGE)) + OUString::number(nPart + 1);
 }
 
-void SwXTextDocument::initializeForTiledRendering()
+void SwXTextDocument::initializeForTiledRendering(const css::uno::Sequence<css::beans::PropertyValue>& /*rArguments*/)
 {
     SolarMutexGuard aGuard;
 
commit 4bddfc00d25a42917db79ceaf0547c2e792132c4
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 18 14:59:51 2015 +0100

    lok::Document::initializeForRendering: support init. arguments
    
    Change-Id: I8aaf19a50f25f495cb87fba7ff6a4b0f56ed7d80

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 3b7e274..0874eed 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -283,7 +283,7 @@ void DesktopLOKTest::testSearchCalc()
     LibLibreOffice_Impl aOffice;
     comphelper::LibreOfficeKit::setActive();
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
-    pDocument->pClass->initializeForRendering(pDocument);
+    pDocument->pClass->initializeForRendering(pDocument, nullptr);
     pDocument->pClass->registerCallback(pDocument, &DesktopLOKTest::callback, this);
 
     uno::Sequence<beans::PropertyValue> aPropertyValues(comphelper::InitPropertySequence(
@@ -406,7 +406,7 @@ void DesktopLOKTest::testRowColumnHeaders()
      */
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
 
-    pDocument->pClass->initializeForRendering(pDocument);
+    pDocument->pClass->initializeForRendering(pDocument, nullptr);
 
     boost::property_tree::ptree aTree;
     char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:ViewRowColumnHeaders");
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 838073f..9f97dbc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -261,6 +261,40 @@ static OUString getAbsoluteURL(const char* pURL)
     return OUString();
 }
 
+static void jsonToPropertyValues(const char* pJSON, uno::Sequence<beans::PropertyValue>& rPropertyValues)
+{
+    std::vector<beans::PropertyValue> aArguments;
+    if (pJSON)
+    {
+        boost::property_tree::ptree aTree;
+        std::stringstream aStream(pJSON);
+        boost::property_tree::read_json(aStream, aTree);
+
+        for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aTree)
+        {
+            const std::string& rType = rPair.second.get<std::string>("type");
+            const std::string& rValue = rPair.second.get<std::string>("value");
+
+            beans::PropertyValue aValue;
+            aValue.Name = OUString::fromUtf8(rPair.first.c_str());
+            if (rType == "string")
+                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 if (rType == "unsigned short")
+                aValue.Value <<= static_cast<sal_uInt16>(OString(rValue.c_str()).toUInt32());
+            else
+                SAL_WARN("desktop.lib", "jsonToPropertyValues: unhandled type '"<<rType<<"'");
+            aArguments.push_back(aValue);
+        }
+    }
+    rPropertyValues = comphelper::containerToSequence(aArguments);
+}
+
 extern "C"
 {
 
@@ -281,7 +315,8 @@ void        doc_paintTile(LibreOfficeKitDocument* pThis,
 static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
                                 long* pWidth,
                                 long* pHeight);
-static void doc_initializeForRendering(LibreOfficeKitDocument* pThis);
+static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
+                                       const char* pArguments);
 
 static void doc_registerCallback(LibreOfficeKitDocument* pThis,
                                 LibreOfficeKitCallback pCallback,
@@ -939,12 +974,15 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis,
     }
 }
 
-static void doc_initializeForRendering(LibreOfficeKitDocument* pThis)
+static void doc_initializeForRendering(LibreOfficeKitDocument* pThis,
+                                       const char* pArguments)
 {
     ITiledRenderable* pDoc = getTiledRenderable(pThis);
     if (pDoc)
     {
         doc_iniUnoCommands();
+        uno::Sequence<beans::PropertyValue> aPropertyValues;
+        jsonToPropertyValues(pArguments, aPropertyValues);
         pDoc->initializeForTiledRendering();
     }
 }
@@ -988,40 +1026,6 @@ static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nChar
     pDoc->postKeyEvent(nType, nCharCode, nKeyCode);
 }
 
-static void jsonToPropertyValues(const char* pJSON, uno::Sequence<beans::PropertyValue>& rPropertyValues)
-{
-    std::vector<beans::PropertyValue> aArguments;
-    if (pJSON)
-    {
-        boost::property_tree::ptree aTree;
-        std::stringstream aStream(pJSON);
-        boost::property_tree::read_json(aStream, aTree);
-
-        for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aTree)
-        {
-            const std::string& rType = rPair.second.get<std::string>("type");
-            const std::string& rValue = rPair.second.get<std::string>("value");
-
-            beans::PropertyValue aValue;
-            aValue.Name = OUString::fromUtf8(rPair.first.c_str());
-            if (rType == "string")
-                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 if (rType == "unsigned short")
-                aValue.Value <<= static_cast<sal_uInt16>(OString(rValue.c_str()).toUInt32());
-            else
-                SAL_WARN("desktop.lib", "jsonToPropertyValues: unhandled type '"<<rType<<"'");
-            aArguments.push_back(aValue);
-        }
-    }
-    rPropertyValues = comphelper::containerToSequence(aArguments);
-}
-
 /** Class to react on finishing of a dispatched command.
 
     This will call a LOK_COMMAND_FINISHED callback when postUnoCommand was
diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index 0c360d3..9f15796 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -256,7 +256,7 @@ extern "C" SAL_JNI_EXPORT void JNICALL Java_org_libreoffice_kit_Document_initial
     (JNIEnv* pEnv, jobject aObject)
 {
     LibreOfficeKitDocument* pDocument = getHandle<LibreOfficeKitDocument>(pEnv, aObject);
-    pDocument->pClass->initializeForRendering(pDocument);
+    pDocument->pClass->initializeForRendering(pDocument, NULL);
 }
 
 extern "C" SAL_JNI_EXPORT jint JNICALL Java_org_libreoffice_kit_Office_saveAs
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 0321037..93f7dca 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -124,7 +124,8 @@ struct _LibreOfficeKitDocumentClass
                              long* pHeight);
 
     /// @see lok::Document::initializeForRendering().
-    void (*initializeForRendering) (LibreOfficeKitDocument* pThis);
+    void (*initializeForRendering) (LibreOfficeKitDocument* pThis,
+                                    const char* pArguments);
 
     /// @see lok::Document::registerCallback().
     void (*registerCallback) (LibreOfficeKitDocument* pThis,
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index d21abdd..a3c0cd8 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -156,10 +156,22 @@ public:
      * needed to render the document correctly using tiled rendering. This
      * method has to be called right after documentLoad() in case any of the
      * tiled rendering methods are to be used later.
+     *
+     * Example argument string for text documents:
+     *
+     * {
+     *     ".uno:HideWhitespace":
+     *     {
+     *         "type": "boolean",
+     *         "value": "true"
+     *     }
+     * }
+     *
+     * @param pArguments arguments of the rendering
      */
-    inline void initializeForRendering()
+    inline void initializeForRendering(const char* pArguments = NULL)
     {
-        mpDoc->pClass->initializeForRendering(mpDoc);
+        mpDoc->pClass->initializeForRendering(mpDoc, pArguments);
     }
 
     /**
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 5c5336d..55822cd 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -530,7 +530,7 @@ static gboolean postDocumentLoad(gpointer pData)
     LOKDocViewPrivate& priv = getPrivate(pLOKDocView);
 
     priv->m_pDocument->pClass->setView(priv->m_pDocument, priv->m_nViewId);
-    priv->m_pDocument->pClass->initializeForRendering(priv->m_pDocument);
+    priv->m_pDocument->pClass->initializeForRendering(priv->m_pDocument, nullptr);
     priv->m_pDocument->pClass->registerCallback(priv->m_pDocument, callbackWorker, pLOKDocView);
     priv->m_pDocument->pClass->getDocumentSize(priv->m_pDocument, &priv->m_nDocumentWidthTwips, &priv->m_nDocumentHeightTwips);
     g_timeout_add(600, handleTimeout, pLOKDocView);


More information about the Libreoffice-commits mailing list