diff options
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/data/test.ppsx | bin | 0 -> 32452 bytes | |||
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 13 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sd/qa/unit/tiledrendering/data/test.ppsx b/sd/qa/unit/tiledrendering/data/test.ppsx Binary files differnew file mode 100644 index 000000000000..2b955adeca97 --- /dev/null +++ b/sd/qa/unit/tiledrendering/data/test.ppsx diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index b15821f1329b..7f8c4fa19338 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2983,6 +2983,21 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSidebarHide) CPPUNIT_ASSERT(it != aView.m_aStateChanges.end()); } +CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testStartPresentation) +{ + SdXImpressDocument* pXImpressDocument = createDoc("test.ppsx"); + ViewCallback aView; + CPPUNIT_ASSERT(pXImpressDocument->GetDoc()->IsStartWithPresentation()); + Scheduler::ProcessEventsToIdle(); + + const auto it = aView.m_aStateChanges.find(".uno:StartWithPresentation"); + CPPUNIT_ASSERT(it != aView.m_aStateChanges.end()); + + const auto value = it->second; + CPPUNIT_ASSERT(value.get_child_optional("state").has_value()); + CPPUNIT_ASSERT_EQUAL(std::string("true"), value.get_child("state").get_value<std::string>()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 8a25f0593b87..a86a448900f4 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -19,6 +19,8 @@ #include <comphelper/processfactory.hxx> +#include <boost/property_tree/json_parser.hpp> + #include <ViewShellBase.hxx> #include <algorithm> #include <EventMultiplexer.hxx> @@ -1031,6 +1033,17 @@ void ViewShellBase::afterCallbackRegistered() std::set<Color> aDocumentColors = pDocShell->GetDocColors(); svx::theme::notifyLOK(pThemeColors, aDocumentColors); } + + if (mpDocument && mpDocument->IsStartWithPresentation()) + { + // Be consistent with SidebarController, emit JSON. + boost::property_tree::ptree aTree; + aTree.put("commandName", ".uno:StartWithPresentation"); + aTree.put("state", "true"); + std::stringstream aStream; + boost::property_tree::write_json(aStream, aTree); + libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, OString(aStream.str())); + } } void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const |