Blob Blame History Raw
From 8bc21ff727beb36e68076995cc642ac98296b689 Mon Sep 17 00:00:00 2001
From: Henry Castro <hcastro@collabora.com>
Date: Tue, 9 Jun 2015 23:19:40 -0400
Subject: [PATCH 036/398] sw: tiled rendering, set minimal window size.

Set minimal window size (1,1), so it can trigger
LOK_CALLBACK_INVALIDATE_TILES

Change-Id: If6ef9aeec94b396febd41375b3ce96b1aa1d6115
(cherry picked from commit 2281a4922f2209511f79b961ca2140c112bc41eb)
---
 sw/source/uibase/uno/unotxdoc.cxx | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index c19976c05289..450650d26c13 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3164,6 +3164,15 @@ void SwXTextDocument::initializeForTiledRendering()
     SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
     pViewShell->setTiledRendering(true);
 
+    if ( pViewShell->GetWin() )
+    {
+        // Check initial window size and set minimal size (1,1)
+        Size aSize( pViewShell->GetWin()->GetOutputSizePixel() );
+        if ( aSize.Width() == 0 || aSize.Height() == 0 )
+            pViewShell->GetWin()->SetOutputSizePixel(Size( std::max( aSize.Width() , long(1)),
+                                                           std::max( aSize.Height(), long(1)) ));
+    }
+
     bool      bBookMode = false;
     sal_Int16 nColumns = 1;
 
-- 
2.12.0