~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/3rdparty/webkit/WebCore/page/win/FrameWin.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "TransformationMatrix.h"
31
31
#include "FloatRect.h"
32
32
#include "Document.h"
33
 
#include "FramePrivate.h"
34
33
#include "RenderView.h"
35
34
#include "Settings.h"
36
35
 
48
47
    if (!frame->document() || !frame->view() || !frame->document()->renderer())
49
48
        return;
50
49
 
51
 
    RenderView* root = static_cast<RenderView*>(frame->document()->renderer());
 
50
    RenderView* root = toRenderView(frame->document()->renderer());
52
51
 
53
52
    if (!root) {
54
53
        LOG_ERROR("document to be printed has no renderer");
62
61
    
63
62
    float ratio = static_cast<float>(printRect.height()) / static_cast<float>(printRect.width());
64
63
 
65
 
    float pageWidth  = static_cast<float>(root->docWidth());
 
64
    float pageWidth  = static_cast<float>(root->rightLayoutOverflow());
66
65
    float pageHeight = pageWidth * ratio;
67
66
    outPageHeight = static_cast<int>(pageHeight);   // this is the height of the page adjusted by margins
68
67
    pageHeight -= (headerHeight + footerHeight);
82
81
    float printedPagesHeight = 0.0f;
83
82
    do {
84
83
        float proposedBottom = min(docHeight, printedPagesHeight + pageHeight);
85
 
        frame->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
 
84
        frame->view()->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight);
86
85
        currPageHeight = max(1.0f, proposedBottom - printedPagesHeight);
87
86
       
88
87
        pages.append(IntRect(0, printedPagesHeight, currPageWidth, currPageHeight));