summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2019-10-23 17:10:35 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2019-10-24 08:53:52 +0200
commit9b5ea9a58200bf7a2075b47930e3f8c0f7c854c8 (patch)
tree2a4fd049233188a35d407f11ca2dd11a0344692f /svx
parent3eee1297ba82dbbfc9b3f185cbe65b77bd582d2f (diff)
jsdliaogs: send data for text styles combobox
Change-Id: I5827799f8adf8db697ac2e2a96eaba2a6fd2e2a4 Reviewed-on: https://gerrit.libreoffice.org/81401 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> (cherry picked from commit 00d06dee4b77cf52c927bd2c8687bb1a8d6c7904) Reviewed-on: https://gerrit.libreoffice.org/81420 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx32
1 files changed, 32 insertions, 0 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index deecd6b37353..977e3146dafe 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -147,6 +147,7 @@ public:
void SetVisibilityListener( const Link<SvxStyleBox_Impl&,void>& aVisListener ) { aVisibilityListener = aVisListener; }
void SetDefaultStyle( const OUString& rDefault ) { sDefaultStyle = rDefault; }
+ virtual boost::property_tree::ptree DumpAsPropertyTree() override;
protected:
/// Calculate the optimal width of the dropdown. Very expensive operation, triggers lots of font measurement.
@@ -373,6 +374,7 @@ SvxStyleBox_Impl::SvxStyleBox_Impl(vcl::Window* pParent,
EnableUserDraw( true );
AddEventListener(LINK(this, SvxStyleBox_Impl, CalcOptimalExtraUserWidth));
SetUserItemSize( Size( 0, ITEM_HEIGHT ) );
+ set_id("applystyle");
}
SvxStyleBox_Impl::~SvxStyleBox_Impl()
@@ -902,6 +904,36 @@ Color SvxStyleBox_Impl::TestColorsVisible(const Color &FontCol, const Color &Bac
return retCol;
}
+boost::property_tree::ptree SvxStyleBox_Impl::DumpAsPropertyTree()
+{
+ boost::property_tree::ptree aTree(ComboBox::DumpAsPropertyTree());
+
+ boost::property_tree::ptree aEntries;
+
+ for (int i = 0; i < GetEntryCount(); ++i)
+ {
+ boost::property_tree::ptree aEntry;
+ aEntry.put("", GetEntry(i));
+ aEntries.push_back(std::make_pair("", aEntry));
+ }
+
+ aTree.add_child("entries", aEntries);
+
+ boost::property_tree::ptree aSelected;
+
+ for (int i = 0; i < GetSelectedEntryCount(); ++i)
+ {
+ boost::property_tree::ptree aEntry;
+ aEntry.put("", GetSelectedEntryPos(i));
+ aSelected.push_back(std::make_pair("", aEntry));
+ }
+
+ aTree.put("selectedCount", GetSelectedEntryCount());
+ aTree.add_child("selectedEntries", aSelected);
+
+ return aTree;
+}
+
static bool lcl_GetDocFontList( const FontList** ppFontList, SvxFontNameBox_Impl* pBox )
{