summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-10-21 17:10:39 +0200
committerJan Holesovsky <kendy@collabora.com>2015-10-21 17:17:57 +0200
commitf4294091b997d9118617f0bbb82b1cafe3cf993b (patch)
treefb04dc62b8e8d0dd2497dd42278673ca71255e06 /sw/source/uibase
parentd4ef1860f268efb5a7ec5cdbce69b40b8f228dd8 (diff)
tdf#81219: Sanitize the thumbnail of web view.
So that we don't render the entire document in the thumbnail ;-) Change-Id: Ic19f403b68bd2e2e748138a861d55e41742250e0
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/docsh.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 2d88c5bb58b8..82c0e617a289 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -876,7 +876,16 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
SwContentNode* pNd = m_pDoc->GetNodes().GoNext( &aIdx );
const SwRect aPageRect = pNd->FindPageFrmRect();
- return aPageRect.SVRect();
+ Rectangle aRect(aPageRect.SVRect());
+
+ // tdf#81219 sanitize - nobody is interested in a thumbnail where's
+ // nothing visible
+ if (aRect.GetHeight() > 2*aRect.GetWidth())
+ aRect.SetSize(Size(aRect.GetWidth(), 2*aRect.GetWidth()));
+ else if (aRect.GetWidth() > 2*aRect.GetHeight())
+ aRect.SetSize(Size(2*aRect.GetHeight(), aRect.GetHeight()));
+
+ return aRect;
}
return SfxObjectShell::GetVisArea( nAspect );
}