Hi,

I know my topic is not concerning your discussion, but I am new to mozilla
hacking.
I think I found a bug in the printing code of the release 1.5 concerning the
top and left margin settings.
My problem was that the top margin of my printed pages were not correct.
Looking at the code I found that the right margin is used at a location
where an Y coordinate (i.e. top margin) ist expected.

The line of code is in the file nsSimplePageSequence.cpp in function
nsSimplePageSequenceFrame::PrintNextPage


  if (mPrintThisPage) {
    // XXX This is temporary fix for printing more than one page of a
selection
    // This does a poor man's "dump" pagination (see Bug 89353)
    // It has laid out as one long page and now we are just moving or view
up/down
    // one page at a time and printing the contents of what is exposed by
the rect.
    // currently this does not work for IFrames
    // I will soon improve this to work with IFrames
    PRBool  continuePrinting = PR_TRUE;
    PRInt32 width, height;
    dc->GetDeviceSurfaceDimensions(width, height);
    nsRect clipRect(0, 0, width, height);
    nsRect slidingRect(-1, -1, -1, -1);
    height -= mMargin.top + mMargin.bottom;
    width  -= mMargin.left + mMargin.right;
    nscoord selectionY = height;
    nsIView* containerView = nsnull;
    nsRect   containerRect;
    if (mSelectionHeight > -1) {
      nsIFrame* childFrame = mFrames.FirstChild();
      nsIFrame* conFrame;
      childFrame->FirstChild(aPresContext, nsnull, &conFrame);
      containerView = conFrame->GetView();
      NS_ASSERTION(containerView, "Container view can't be null!");
      containerRect = containerView->GetBounds();
      containerRect.y -= mYSelOffset;
      slidingRect.SetRect(0,mYSelOffset,width,height);

      vm->MoveViewTo(containerView, containerRect.x, containerRect.y);
      nsRect r(0, 0, containerRect.width, containerRect.height);
      vm->ResizeView(containerView, r, PR_FALSE);
==>   mMargin.right should be mMargin.top, this is line 887 in my file
==>      clipRect.SetRect(mMargin.left, mMargin.right, width, height);
    }

    while (continuePrinting) {
      if (!mSkipPageBegin) {
        PR_PL(("\n"));
        PR_PL(("***************** BeginPage *****************\n"));
        rv = dc->BeginPage();
        if (NS_FAILED(rv)) {
          return rv;
        }
      }


Could you please look at this and forward it to the person responsible for
that problem.


Thank you,

Hans Wieser
NetHotels AG, Austria



"Robert O'Callahan" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Boris Zbarsky wrote:
> >>(For some reason, the code for this third margin was part of the fix for
> >>bug 132563, and but bug 130075 was never closed.)
> >
> >
> > You may want to ask Roland about that....
> >
> > Your proposed solution sounds good as long as it doesn't break XPrint or
XPrint
> > can be adjusted to it.
>
> I haven't seen Roland around for a while...
>
> Maybe the thing to do is to have the printable area margins UI have a
> checkbox saying "Use printer default"? If checked, the print module will
> decide what value to use (0.25, or 0.04, or whatever). This would be
> checked by default.
>
> Rob
>


_______________________________________________
mozilla-layout mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-layout

Reply via email to