Skip to content

Commit 6ac8792

Browse files
committedSep 20, 2012
Merge branch 'master' of github.com:timlinux/Quantum-GIS
2 parents 05ae00d + 88ca822 commit 6ac8792

File tree

6 files changed

+4021
-12
lines changed

6 files changed

+4021
-12
lines changed
 

‎src/core/composer/qgscomposerhtml.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,20 @@ void QgsComposerHtml::setUrl( const QUrl& url )
5757
{
5858
qApp->processEvents();
5959
}
60-
QSize contentsSize = mWebPage->mainFrame()->contentsSize();
60+
61+
if ( nFrames() < 1) return;
62+
//QSize contentsSize = mWebPage->mainFrame()->contentsSize();
63+
64+
QRectF contentRect = this->mFrameItems.at(0)->boundingRect();
65+
//there is going to be a little rounding error converting from float to int
66+
QSize contentsSize = QSize( (int)(contentRect.width() * mHtmlUnitsToMM),
67+
(int)(contentRect.height() * mHtmlUnitsToMM));
6168
mWebPage->setViewportSize( contentsSize );
6269

70+
//suppress scroll bars always
71+
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
72+
mWebPage->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
73+
6374
mSize.setWidth( contentsSize.width() / mHtmlUnitsToMM );
6475
mSize.setHeight( contentsSize.height() / mHtmlUnitsToMM );
6576
recalculateFrameSizes();

‎tests/src/python/test_qgscomposerhtml.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def testTableMultiFrame(self):
101101
checker2 = QgsCompositionChecker()
102102
myControlImage = self.controlImagePath(
103103
"composerhtml_table_multiframe2.png")
104+
print "Checking page 2"
104105
myResult, myMessage = checker2.testComposition("Composer html table",
105106
self.mComposition,
106107
myControlImage,
@@ -115,6 +116,7 @@ def testTableMultiFrame(self):
115116
self.mComposition,
116117
myControlImage,
117118
myPage)
119+
print "Checking page 3"
118120
assert myResult, myMessage
119121

120122
if __name__ == '__main__':

‎tests/src/python/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from qgis_interface import QgisInterface
1111
import hashlib
1212

13-
QGISAPP = None # Static vainasafele used to hold hand to running QGis app
13+
QGISAPP = None # Static variable used to hold hand to running QGis app
1414
CANVAS = None
1515
PARENT = None
1616
IFACE = None

‎tests/testdata/bootstrap.css

Lines changed: 3990 additions & 0 deletions
Large diffs are not rendered by default.
Loading

‎tests/testdata/html_table.html

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
<table border="1" style="font-family:serif; font-size:12pt; ">
2-
<tbody>
3-
<tr><td>1 Foo data</td><td>Bar data</td></tr>
4-
<tr><td>2 Foo data</td><td>Bar data</td></tr>
5-
<tr><td>3 Foo data</td><td>Bar data</td></tr>
6-
<tr><td>4 Foo data</td><td>Bar data</td></tr>
7-
<tr><td>5 Foo data</td><td>Bar data</td></tr>
8-
</tbody>
9-
</table>
10-
</table>
1+
<html>
2+
<head>
3+
<link href="bootstrap.css" media="all" rel="stylesheet" type="text/css" />
4+
</head>
5+
<body>
6+
<table class="table table-striped table-bordered condensed">
7+
<tbody>
8+
<tr><td>1 Foo data</td><td>Bar data</td></tr>
9+
<tr><td>2 Foo data</td><td>Bar data</td></tr>
10+
<tr><td>3 Foo data</td><td>Bar data</td></tr>
11+
<tr><td>4 Foo data</td><td>Bar data</td></tr>
12+
<tr><td>5 Foo data</td><td>Bar data</td></tr>
13+
</tbody>
14+
</table>
15+
</body>
16+
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.