Blame SOURCES/0310-lok-send-list-of-commands-instead-of-ClearStyles.patch

f325b2
From 269cad6f5da53600d11157c29f234175bc06e91c Mon Sep 17 00:00:00 2001
f325b2
From: Andrzej Hunt <andrzej@ahunt.org>
f325b2
Date: Thu, 12 Nov 2015 13:50:52 +0100
f325b2
Subject: [PATCH 310/398] lok: send list of commands instead of ClearStyles
f325b2
f325b2
We currently send just one command, but this could be expanded
f325b2
server side in future.
f325b2
f325b2
Change-Id: Id8f14196158f3a7fe9c54595d094603efd5e2ce3
f325b2
(cherry picked from commit fbc3965dc117967d2b5f51aa3902823da7c69d12)
f325b2
---
f325b2
 desktop/qa/desktop_lib/test_desktop_lib.cxx |  2 +-
f325b2
 desktop/source/lib/init.cxx                 | 25 +++++++++++++++++++++----
f325b2
 2 files changed, 22 insertions(+), 5 deletions(-)
f325b2
f325b2
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
f325b2
index c0ba1599f48b..7d94daea0fbc 100644
f325b2
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
f325b2
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
f325b2
@@ -192,7 +192,7 @@ void DesktopLOKTest::testGetStyles()
f325b2
             rPair.first != "NumberingStyles" &&
f325b2
             rPair.first != "CellStyles" &&
f325b2
             rPair.first != "ShapeStyles" &&
f325b2
-            rPair.first != "ClearStyle")
f325b2
+            rPair.first != "Commands")
f325b2
         {
f325b2
             CPPUNIT_FAIL("Unknown style family: " + rPair.first);
f325b2
         }
f325b2
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
f325b2
index e09ad171678e..dbe30a640ecb 100644
f325b2
--- a/desktop/source/lib/init.cxx
f325b2
+++ b/desktop/source/lib/init.cxx
f325b2
@@ -1301,10 +1301,27 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
f325b2
         aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
f325b2
     }
f325b2
 
f325b2
-    boost::property_tree::ptree aChildClearFormat;
f325b2
-    OUString sClearFormat = SVX_RESSTR( RID_SVXSTR_CLEARFORM );
f325b2
-    aChildClearFormat.put("", sClearFormat.toUtf8());
f325b2
-    aValues.add_child("ClearStyle", aChildClearFormat);
f325b2
+    {
f325b2
+        boost::property_tree::ptree aCommandList;
f325b2
+
f325b2
+        {
f325b2
+            boost::property_tree::ptree aChild;
f325b2
+
f325b2
+            OUString sClearFormat = SVX_RESSTR( RID_SVXSTR_CLEARFORM );
f325b2
+
f325b2
+            boost::property_tree::ptree aName;
f325b2
+            aName.put("", sClearFormat.toUtf8());
f325b2
+            aChild.push_back(std::make_pair("text", aName));
f325b2
+
f325b2
+            boost::property_tree::ptree aCommand;
f325b2
+            aCommand.put("", ".uno:ResetAttributes");
f325b2
+            aChild.push_back(std::make_pair("id", aCommand));
f325b2
+
f325b2
+            aCommandList.push_back(std::make_pair("", aChild));
f325b2
+        }
f325b2
+
f325b2
+        aValues.add_child("Commands", aCommandList);
f325b2
+    }
f325b2
 
f325b2
     aTree.add_child("commandValues", aValues);
f325b2
     std::stringstream aStream;
f325b2
-- 
f325b2
2.12.0
f325b2