/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "tiledrenderingmodeltestbase.cxx" #include #include CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSidebarSwitchDeck) { // Given an impress document, with a visible sidebar (ModifyPage deck): createDoc("dummy.odp"); ViewCallback aView; sfx2::sidebar::Sidebar::Setup(u""); Scheduler::ProcessEventsToIdle(); aView.m_aStateChanges.clear(); // When switching to the MasterSlidesPanel deck: dispatchCommand(mxComponent, u".uno:MasterSlidesPanel"_ustr, {}); // Then make sure notifications are sent for both the old and the new decks: auto it = aView.m_aStateChanges.find(".uno:ModifyPage"); // Without the accompanying fix in place, this test would have failed, the notification for the // old deck was missing. CPPUNIT_ASSERT(it != aView.m_aStateChanges.end()); boost::property_tree::ptree aTree = it->second; CPPUNIT_ASSERT(aTree.get_child_optional("state").has_value()); CPPUNIT_ASSERT_EQUAL(std::string("false"), aTree.get_child("state").get_value()); it = aView.m_aStateChanges.find(".uno:MasterSlidesPanel"); CPPUNIT_ASSERT(it != aView.m_aStateChanges.end()); } CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */