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,\
sb \
sfx \
svl \
svxcore \
svt \
tk \
tl \
......
......@@ -185,14 +185,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);
}
......
......@@ -66,6 +66,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>
......@@ -1274,6 +1276,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);
......
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