Copy link to clipboard
Copied
Hello,
I can use spread->GetItemsOnPage to get all the none master page items. I would like to also get all the master page items for a given page.
Thanks.
P.
Hi,
no.
Use the IMasterPage interface of the kPageBoss of the page with pageUID. From this interface you get the masterSpreadUID and masterSpreadPageIndex. Use the ISpread interface of the boss with the masterSpreadUID and call GetItemsOnPage( masterSpreadPageIndex, ... ).
Markus
Copy link to clipboard
Copied
Hello Pickory,
you must get the master page/spread of the page/spread and then call GetItemsOnPage. The page items are not in the same hierarchy.
Markus
Copy link to clipboard
Copied
Hi,
Thank you for your reply.
Would this be correct?
UIDRef masterSpreadUIDRef(db, masterSpreadList->GetNthMasterSpreadUID(masterSpreadIndex) );
InterfacePtr<ISpread> spread(masterSpreadUIDRef, UseDefaultIID());
if ( spread )
{
UIDList masterItemList;
int32 numPages = spread->GetNumPages ( );
for ( int32 j = 0; j < numPages; j++ )
{
if ( spread->GetNthPageUID ( j ) == pageUID ) // found our page
spread->GetItemsOnPage(j, &masterItemList, kFalse, kFalse );
Thank.
P.
Copy link to clipboard
Copied
Hi,
no.
Use the IMasterPage interface of the kPageBoss of the page with pageUID. From this interface you get the masterSpreadUID and masterSpreadPageIndex. Use the ISpread interface of the boss with the masterSpreadUID and call GetItemsOnPage( masterSpreadPageIndex, ... ).
Markus
Copy link to clipboard
Copied
Brilliant! Thank you.
P.