22#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
23#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
24#include <com/sun/star/drawing/XMasterPageTarget.hpp>
25#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
26#include <com/sun/star/container/XNameContainer.hpp>
27#include <com/sun/star/container/XIndexContainer.hpp>
38void PageCollector::CollectCustomShowPages(
const css::uno::Reference< css::frame::XModel >& rxModel, std::u16string_view rCustomShowName, std::vector< Reference< XDrawPage > >& rUsedPageList )
42 Reference< XCustomPresentationSupplier > aXCPSup( rxModel, UNO_QUERY_THROW );
43 Reference< XNameContainer > aXCont( aXCPSup->getCustomPresentations() );
47 const Sequence< OUString> aNameSeq( aXCont->getElementNames() );
48 for ( OUString
const &
i :aNameSeq )
50 if (
i == rCustomShowName )
52 Reference< container::XIndexContainer > aXIC( aXCont->getByName(
i ), UNO_QUERY_THROW );
53 sal_Int32 j, nSlideCount = aXIC->getCount();
54 for ( j = 0; j < nSlideCount; j++ )
56 Reference< XDrawPage > xDrawPage( aXIC->getByIndex( j ), UNO_QUERY_THROW );
57 auto aIter = std::find(rUsedPageList.begin(), rUsedPageList.end(), xDrawPage);
58 if ( aIter == rUsedPageList.end() )
59 rUsedPageList.push_back( xDrawPage );
75 std::vector< Reference< XDrawPage > > vUsedPageList;
77 if ( !vUsedPageList.empty() )
79 Reference< XDrawPagesSupplier > xDrawPagesSupplier( rxModel, UNO_QUERY_THROW );
80 Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
81 for ( sal_Int32 j = 0; j < xDrawPages->getCount(); j++ )
83 Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( j ), UNO_QUERY_THROW );
84 auto aIter = std::find(vUsedPageList.begin(), vUsedPageList.end(), xDrawPage);
85 if ( aIter == vUsedPageList.end() )
86 rNonUsedPageList.push_back( xDrawPage );
101 Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
102 Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_SET_THROW );
103 for ( sal_Int32
i = 0;
i < xMasterPages->getCount();
i++ )
105 Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex(
i ), UNO_QUERY_THROW );
106 auto aIter = std::find_if(rMasterPageList.begin(), rMasterPageList.end(),
107 [&xMasterPage](
const MasterPageEntity& rEntity) { return rEntity.xMasterPage == xMasterPage; });
108 if ( aIter == rMasterPageList.end() )
112 aMasterPageEntity.
bUsed =
false;
113 rMasterPageList.push_back( aMasterPageEntity );
118 Reference< XDrawPagesSupplier > xDrawPagesSupplier( rxModel, UNO_QUERY_THROW );
119 Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
120 for ( sal_Int32 j = 0; j < xDrawPages->getCount(); j++ )
122 Reference< XMasterPageTarget > xMasterPageTarget( xDrawPages->getByIndex( j ), UNO_QUERY_THROW );
123 Reference< XDrawPage > xMasterPage( xMasterPageTarget->getMasterPage(), UNO_SET_THROW );
124 auto aIter = std::find_if(rMasterPageList.begin(), rMasterPageList.end(),
125 [&xMasterPage](
const MasterPageEntity& rEntity) { return rEntity.xMasterPage == xMasterPage; });
126 if ( aIter == rMasterPageList.end() )
127 throw uno::RuntimeException();
static void CollectNonCustomShowPages(const css::uno::Reference< css::frame::XModel > &, std::u16string_view rCustomShow, std::vector< css::uno::Reference< css::drawing::XDrawPage > > &)
static void CollectCustomShowPages(const css::uno::Reference< css::frame::XModel > &, std::u16string_view rCustomShow, std::vector< css::uno::Reference< css::drawing::XDrawPage > > &)
static void CollectMasterPages(const css::uno::Reference< css::frame::XModel > &, std::vector< MasterPageEntity > &)
css::uno::Reference< css::drawing::XDrawPage > xMasterPage