Kaydet (Commit) f4294091 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

tdf#81219: Sanitize the thumbnail of web view.

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

Change-Id: Ic19f403b68bd2e2e748138a861d55e41742250e0
üst d4ef1860
...@@ -876,7 +876,16 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const ...@@ -876,7 +876,16 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
SwContentNode* pNd = m_pDoc->GetNodes().GoNext( &aIdx ); SwContentNode* pNd = m_pDoc->GetNodes().GoNext( &aIdx );
const SwRect aPageRect = pNd->FindPageFrmRect(); 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 ); return SfxObjectShell::GetVisArea( nAspect );
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment