Kaydet (Commit) 030318a3 authored tarafından Andrzej Hunt's avatar Andrzej Hunt

lok: add Clear formatting to getStyles()

This requires client-side support too.

Change-Id: I5197ed3ed2b8244b50f7faf84a1cadde6a61b2cb
Reviewed-on: https://gerrit.libreoffice.org/19917Reviewed-by: 's avatarAndrzej Hunt <andrzej@ahunt.org>
Tested-by: 's avatarAndrzej Hunt <andrzej@ahunt.org>
(cherry picked from commit 0b5991e4)
üst c34df1da
...@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\ ...@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,sofficeapp,\
sb \ sb \
sfx \ sfx \
svl \ svl \
svxcore \
svt \ svt \
tk \ tk \
tl \ tl \
......
...@@ -184,15 +184,19 @@ void DesktopLOKTest::testGetStyles() ...@@ -184,15 +184,19 @@ void DesktopLOKTest::testGetStyles()
boost::property_tree::ptree aValues = aTree.get_child("commandValues"); boost::property_tree::ptree aValues = aTree.get_child("commandValues");
CPPUNIT_ASSERT( aValues.size() > 0 ); CPPUNIT_ASSERT( aValues.size() > 0 );
for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aValues) for (const std::pair<std::string, boost::property_tree::ptree>& rPair : aValues)
{
if( rPair.first != "ClearStyle")
{ {
CPPUNIT_ASSERT( rPair.second.size() > 0); CPPUNIT_ASSERT( rPair.second.size() > 0);
}
if (rPair.first != "CharacterStyles" && if (rPair.first != "CharacterStyles" &&
rPair.first != "ParagraphStyles" && rPair.first != "ParagraphStyles" &&
rPair.first != "FrameStyles" && rPair.first != "FrameStyles" &&
rPair.first != "PageStyles" && rPair.first != "PageStyles" &&
rPair.first != "NumberingStyles" && rPair.first != "NumberingStyles" &&
rPair.first != "CellStyles" && rPair.first != "CellStyles" &&
rPair.first != "ShapeStyles") rPair.first != "ShapeStyles" &&
rPair.first != "ClearStyle")
{ {
CPPUNIT_FAIL("Unknown style family: " + rPair.first); CPPUNIT_FAIL("Unknown style family: " + rPair.first);
} }
......
...@@ -66,6 +66,8 @@ ...@@ -66,6 +66,8 @@
#include <sfx2/lokhelper.hxx> #include <sfx2/lokhelper.hxx>
#include <sfx2/viewfrm.hxx> #include <sfx2/viewfrm.hxx>
#include <sfx2/viewsh.hxx> #include <sfx2/viewsh.hxx>
#include <svx/dialmgr.hxx>
#include <svx/dialogs.hrc>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/svpforlokit.hxx> #include <vcl/svpforlokit.hxx>
...@@ -1274,6 +1276,12 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand) ...@@ -1274,6 +1276,12 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
} }
aValues.add_child(sStyleFam.toUtf8().getStr(), aChildren); 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); aTree.add_child("commandValues", aValues);
std::stringstream aStream; std::stringstream aStream;
boost::property_tree::write_json(aStream, aTree); boost::property_tree::write_json(aStream, aTree);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment