[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - sw/source
Jan Holesovsky
kendy at collabora.com
Wed Oct 21 08:23:24 PDT 2015
sw/source/uibase/app/docsh.cxx | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 9370559e62a4858ed49a2b6d4c1be48b9f8c4127
Author: Jan Holesovsky <kendy at collabora.com>
Date: Wed Oct 21 17:10:39 2015 +0200
tdf#81219: Sanitize the thumbnail of web view.
So that we don't render the entire document in the thumbnail ;-)
Change-Id: Ic19f403b68bd2e2e748138a861d55e41742250e0
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index 6655f04..18696d8 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -854,7 +854,16 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
SwContentNode* pNd = m_pDoc->GetNodes().GoNext( &aIdx );
const SwRect aPageRect = pNd->FindPageFrmRect( false, 0, false );
- 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 );
}
More information about the Libreoffice-commits
mailing list