From 2d748207d343bf97fac34261cafeaefd9d5fc74f Mon Sep 17 00:00:00 2001 From: Henry Castro Date: Thu, 24 Oct 2019 16:46:09 -0400 Subject: lok: ensure that the paper size list box control has selected items in the slide background panel. When a client side request the property tree data on the background panel the paper size list control has no selected items yet. I was tempted to force update the selected item in "Slide Background:: Initialize", however, I am not sure why it is not initialized the list box. This is done after an asynchronous update, maybe it is because the impress document is not initialized yet. anybody knows?. I prefer not to have side effects, so let's force initialization on in the tiled rendering case when the function SlideBackground::DumpAsPropertyTree is called. Change-Id: I596b75da46f2180342cb50bde03ee0ff1d414f05 Reviewed-on: https://gerrit.libreoffice.org/81483 Tested-by: Jenkins Reviewed-by: Henry Castro --- sd/source/ui/sidebar/SlideBackground.cxx | 11 +++++++++++ sd/source/ui/sidebar/SlideBackground.hxx | 1 + 2 files changed, 12 insertions(+) (limited to 'sd') diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index f6f520d0bf38..68f670f923a3 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -231,6 +231,17 @@ void SlideBackground::Initialize() UpdateMarginBox(); } +boost::property_tree::ptree SlideBackground::DumpAsPropertyTree() +{ + if (mpPaperSizeBox->GetSelectedEntryCount() == 0) + { + mpBindings->Update(SID_ATTR_PAGE_SIZE); + } + + boost::property_tree::ptree aTree(Control::DumpAsPropertyTree()); + return aTree; +} + void SlideBackground::HandleContextChange( const vcl::EnumContext& rContext) { diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx index a78a1a9b5723..3a48860b7d78 100644 --- a/sd/source/ui/sidebar/SlideBackground.hxx +++ b/sd/source/ui/sidebar/SlideBackground.hxx @@ -70,6 +70,7 @@ public: const SfxPoolItem* pState) override; virtual void HandleContextChange( const vcl::EnumContext& rContext) override; + virtual boost::property_tree::ptree DumpAsPropertyTree() override; private: -- cgit