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 <vmiklos@collabora.com>
This commit is contained in:
Szymon Kłos 2024-09-11 17:17:23 +02:00 committed by Miklos Vajna
parent e90ebdde41
commit 76be297072
2 changed files with 16 additions and 3 deletions

View file

@ -2704,7 +2704,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testPresentationInfo)
CPPUNIT_ASSERT_EQUAL(15875, aTree.get_child("docWidth").get_value<int>());
CPPUNIT_ASSERT_EQUAL(8930, aTree.get_child("docHeight").get_value<int>());
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<int>());
CPPUNIT_ASSERT_EQUAL(true, rChild.get_child("hidden").get_value<bool>());
}
// 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<int>());
CPPUNIT_ASSERT_EQUAL(false, rChild.get_child("empty").get_value<bool>());
// Check only that these exist

View file

@ -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();