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