tdf#81219: Sanitize the thumbnail of web view.

So that we don't render the entire document in the thumbnail ;-)

Change-Id: Ic19f403b68bd2e2e748138a861d55e41742250e0
This commit is contained in:
Jan Holesovsky 2015-10-21 17:10:39 +02:00
parent d4ef1860f2
commit f4294091b9

View file

@ -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 );
}