Skip to main content
Inspiring
June 9, 2023
Question

Overriden item randomly moved

  • June 9, 2023
  • 3 replies
  • 278 views

Hi everyone,

I'm applying a master page to a normal page, but when apply the master to the normal one all the item on it are invisible.

So i want to unlock the all the master item applied to the normal page, I've found this method: 

Unfortunately sometimes the "overridenItem" isn't in the same position of the masterItem: 

MasterPage

Normal page after applying master page and unlock all the items with IMasterSpreadUtils->OverrideMasterPageItem()

When I apply the master page the items are perfectly positioned, the problem is when I unlock items.

This shift does not always happen, for most of the time do it correct, but sometimes they are shifted and I don't know why.

Thanks in advance anyone who can help me.

- Stefano

This topic has been closed for replies.

3 replies

Inspiring
January 31, 2024

Hi @Stefano5C37 

This is how I fixed position related issue

InterfacePtr<ITransform> iTransform(overriddenItem, UseDefaultIID());
                                        if(iTransform)
                                        {
                                            PMPoint point(pageRect.Left() - mpageRect.Left(),pageRect.Top() - mpageRect.Top());
                                            iTransform->TranslateItemBy(point);
                                        }
Inspiring
January 31, 2024

Hi @Stefano5C37 

Did you found any solution to this problem? I am also facing same issue

Mike Witherell
Community Expert
Community Expert
June 29, 2023

Are you sure that all pages and parent pages (used to be master pages) are the same physical size?

Mike Witherell