135360
From 9b04a64c64b30faab0cec6c552589940181a4fa1 Mon Sep 17 00:00:00 2001
135360
From: Andrzej Hunt <andrzej@ahunt.org>
135360
Date: Wed, 11 Nov 2015 17:09:47 +0100
135360
Subject: [PATCH 305/398] lok: add Clear formatting to getStyles()
135360
135360
This requires client-side support too.
135360
135360
Change-Id: I5197ed3ed2b8244b50f7faf84a1cadde6a61b2cb
135360
Reviewed-on: https://gerrit.libreoffice.org/19917
135360
Reviewed-by: Andrzej Hunt <andrzej@ahunt.org>
135360
Tested-by: Andrzej Hunt <andrzej@ahunt.org>
135360
(cherry picked from commit 0b5991e4862501f0fa8e34f1b403aca40e51436f)
135360
---
135360
 desktop/Library_sofficeapp.mk               | 1 +
135360
 desktop/qa/desktop_lib/test_desktop_lib.cxx | 8 ++++++--
135360
 desktop/source/lib/init.cxx                 | 8 ++++++++
135360
 3 files changed, 15 insertions(+), 2 deletions(-)
135360
135360
diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
135360
index fb73cfa78f4b..f0c99eee6078 100644
135360
--- a/desktop/Library_sofficeapp.mk
135360
+++ b/desktop/Library_sofficeapp.mk
135360
@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
135360
     sb \
135360
     sfx \
135360
     svl \
135360
+    svxcore \
135360
     svt \
135360
     tk \
135360
     tl \
135360
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
135360
index df803c4bdaf0..83bd5ac620b4 100644
135360
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
135360
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
135360
@@ -181,14 +181,18 @@ void DesktopLOKTest::testGetStyles()
135360
     CPPUNIT_ASSERT( aValues.size() > 0 );
135360
     for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aValues)
135360
     {
135360
-        CPPUNIT_ASSERT( rPair.second.size() > 0);
135360
+        if( rPair.first != "ClearStyle")
135360
+        {
135360
+            CPPUNIT_ASSERT( rPair.second.size() > 0);
135360
+        }
135360
         if (rPair.first != "CharacterStyles" &&
135360
             rPair.first != "ParagraphStyles" &&
135360
             rPair.first != "FrameStyles" &&
135360
             rPair.first != "PageStyles" &&
135360
             rPair.first != "NumberingStyles" &&
135360
             rPair.first != "CellStyles" &&
135360
-            rPair.first != "ShapeStyles")
135360
+            rPair.first != "ShapeStyles" &&
135360
+            rPair.first != "ClearStyle")
135360
         {
135360
             CPPUNIT_FAIL("Unknown style family: " + rPair.first);
135360
         }
135360
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
135360
index ddd7859426e7..b7459e03244c 100644
135360
--- a/desktop/source/lib/init.cxx
135360
+++ b/desktop/source/lib/init.cxx
135360
@@ -58,6 +58,8 @@
135360
 #include <sfx2/lokhelper.hxx>
135360
 #include <sfx2/viewfrm.hxx>
135360
 #include <sfx2/viewsh.hxx>
135360
+#include <svx/dialmgr.hxx>
135360
+#include <svx/dialogs.hrc>
135360
 #include <svx/svxids.hrc>
135360
 #include <vcl/svapp.hxx>
135360
 #include <vcl/svpforlokit.hxx>
135360
@@ -1265,6 +1267,12 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
135360
         }
135360
         aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
135360
     }
135360
+
135360
+    boost::property_tree::ptree aChildClearFormat;
135360
+    OUString sClearFormat = SVX_RESSTR( RID_SVXSTR_CLEARFORM );
135360
+    aChildClearFormat.put("", sClearFormat.toUtf8());
135360
+    aValues.add_child("ClearStyle", aChildClearFormat);
135360
+
135360
     aTree.add_child("commandValues", aValues);
135360
     std::stringstream aStream;
135360
     boost::property_tree::write_json(aStream, aTree);
135360
-- 
135360
2.12.0
135360