From 76be2970722faceda1552681d6d2ab942d350595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Wed, 11 Sep 2024 17:17:23 +0200 Subject: [PATCH] slideshow: lok: export hiden slide we need to be aware of hidden slides to make correct decision when doing "start from current slide" based on the slide number Change-Id: Ib4944c699fa2589026e4d8ae57766c83e0439d49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/177775 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- sd/qa/unit/tiledrendering/tiledrendering.cxx | 9 +++++++-- sd/source/ui/unoidl/unomodel.cxx | 10 +++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 4a17fc480ca7..18b213e99abf 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -2704,7 +2704,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPresentationInfo) CPPUNIT_ASSERT_EQUAL(15875, aTree.get_child("docWidth").get_value()); CPPUNIT_ASSERT_EQUAL(8930, aTree.get_child("docHeight").get_value()); - CPPUNIT_ASSERT_EQUAL(size_t(4), aTree.get_child("slides").size()); + CPPUNIT_ASSERT_EQUAL(size_t(5), aTree.get_child("slides").size()); // Slide Index 0 { @@ -2756,10 +2756,15 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPresentationInfo) } // Slide Index 3 - Hidden + { + const boost::property_tree::ptree& rChild = child_at(aTree, "slides", 3); + CPPUNIT_ASSERT_EQUAL(3, rChild.get_child("index").get_value()); + CPPUNIT_ASSERT_EQUAL(true, rChild.get_child("hidden").get_value()); + } // Slide Index 4 { - const boost::property_tree::ptree& rChild = child_at(aTree, "slides", 3); + const boost::property_tree::ptree& rChild = child_at(aTree, "slides", 4); CPPUNIT_ASSERT_EQUAL(4, rChild.get_child("index").get_value()); CPPUNIT_ASSERT_EQUAL(false, rChild.get_child("empty").get_value()); // Check only that these exist diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 436a0c91211a..12953834614c 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -4376,7 +4376,15 @@ OString SdXImpressDocument::getPresentationInfo() const SdGenericDrawPage* pSlide(xDrawPages->getDrawPageByIndex(i)); bool bIsVisible = true; // default visible pSlide->getPropertyValue("Visible") >>= bIsVisible; - if (bIsVisible) + if (!bIsVisible) + { + auto aSlideNode = aJsonWriter.startStruct(); + std::string sSlideHash = GetInterfaceHash(cppu::getXWeak(pSlide)); + aJsonWriter.put("hash", sSlideHash); + aJsonWriter.put("index", i); + aJsonWriter.put("hidden", true); + } + else { SdrPage* pPage = pSlide->GetSdrPage();