Blob Blame History Raw
From 9b04a64c64b30faab0cec6c552589940181a4fa1 Mon Sep 17 00:00:00 2001
From: Andrzej Hunt <andrzej@ahunt.org>
Date: Wed, 11 Nov 2015 17:09:47 +0100
Subject: [PATCH 305/398] lok: add Clear formatting to getStyles()

This requires client-side support too.

Change-Id: I5197ed3ed2b8244b50f7faf84a1cadde6a61b2cb
Reviewed-on: https://gerrit.libreoffice.org/19917
Reviewed-by: Andrzej Hunt <andrzej@ahunt.org>
Tested-by: Andrzej Hunt <andrzej@ahunt.org>
(cherry picked from commit 0b5991e4862501f0fa8e34f1b403aca40e51436f)
---
 desktop/Library_sofficeapp.mk               | 1 +
 desktop/qa/desktop_lib/test_desktop_lib.cxx | 8 ++++++--
 desktop/source/lib/init.cxx                 | 8 ++++++++
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/desktop/Library_sofficeapp.mk b/desktop/Library_sofficeapp.mk
index fb73cfa78f4b..f0c99eee6078 100644
--- a/desktop/Library_sofficeapp.mk
+++ b/desktop/Library_sofficeapp.mk
@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
     sb \
     sfx \
     svl \
+    svxcore \
     svt \
     tk \
     tl \
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index df803c4bdaf0..83bd5ac620b4 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -181,14 +181,18 @@ void DesktopLOKTest::testGetStyles()
     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 != "ClearStyle")
+        {
+            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")
+            rPair.first != "ShapeStyles" &&
+            rPair.first != "ClearStyle")
         {
             CPPUNIT_FAIL("Unknown style family: " + rPair.first);
         }
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ddd7859426e7..b7459e03244c 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -58,6 +58,8 @@
 #include <sfx2/lokhelper.hxx>
 #include <sfx2/viewfrm.hxx>
 #include <sfx2/viewsh.hxx>
+#include <svx/dialmgr.hxx>
+#include <svx/dialogs.hrc>
 #include <svx/svxids.hrc>
 #include <vcl/svapp.hxx>
 #include <vcl/svpforlokit.hxx>
@@ -1265,6 +1267,12 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
         }
         aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren);
     }
+
+    boost::property_tree::ptree aChildClearFormat;
+    OUString sClearFormat = SVX_RESSTR( RID_SVXSTR_CLEARFORM );
+    aChildClearFormat.put("", sClearFormat.toUtf8());
+    aValues.add_child("ClearStyle", aChildClearFormat);
+
     aTree.add_child("commandValues", aValues);
     std::stringstream aStream;
     boost::property_tree::write_json(aStream, aTree);
-- 
2.12.0