[Libreoffice-commits] core.git: sw/source

Jan Holesovsky kendy at collabora.com
Wed Oct 21 08:21:01 PDT 2015


 sw/source/uibase/app/docsh.cxx |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit f4294091b997d9118617f0bbb82b1cafe3cf993b
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 2d88c5b..82c0e61 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 );
 }


More information about the Libreoffice-commits mailing list