Problem: 1615538

Title: (TStdPrintHandler) Custom margins don't work

Received: Dec 26 1996 11:11AM


After I have set custom margins thru TStdPrintHandler::InstallMargins TStdPrintHandler, the size of my view didn't changed. The view has set fSizeDeterminer to sizePage.

Steps to reproduce problem:

You can try code like this:

  VRect margins(30,50,-30,-50);
  aPrintHandler  = new TStdPrintHandler;
  aPrintHandler->IStdPrintHandler(this, aPrintedView, kFixedSize, kFixedSize);
  aPrintHandler->InstallMargins(margins, false);
  aPrintedView->DoPagination();
I think that problem is in the following code:
void TStdPrintHandler::RedoPageBreaks()
{
        Boolean worryAboutBreaks = (fView->GetGrafPort()) && gInitialized
                                    && (fShowBreaks || gDebugPrinting);
        if (worryAboutBreaks)
                InvalPageFeedback();     // invalidate old page breaks, if relevant
        SetPrintExtent();
        VRect oldInterior(GetInteriorRect());
        VPoint oldViewPerPage(GetViewPerPage());
Last to lines will get the new interiror and view per page not the old one.

I suggest to change it this way:

        VRect oldInterior = fInteriorRect;
        VPoint oldViewPerPage = fViewPerPage;

This should be checked. I believe the problem has been fixed.