[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - sc/source

Julien Nabet serval2412 at yahoo.fr
Thu Mar 26 11:52:40 PDT 2015


 sc/source/ui/docshell/docsh4.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 9dfad2baaf1f9c6d0933b2326cbf2ff522ae73d1
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Feb 16 23:53:55 2015 +0100

    Resolves tdf#72152: respect page orientation of Calc files in recent docs
    
    Change-Id: I2a8d4cce979ce0ff1fd260bfa796817a0dbb7ce2
    Reviewed-on: https://gerrit.libreoffice.org/14512
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>
    (cherry picked from commit 38c22ed2b8b8f3530b8a0fe5a23a329e8e511c76)
    Reviewed-on: https://gerrit.libreoffice.org/14989
    Reviewed-by: Jean-Baptiste Faure <jbfaure at libreoffice.org>

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 1a1c6f8e..957e7a4 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -109,9 +109,6 @@ using namespace ::com::sun::star;
         static_cast<const SvxSetItem&>((set).Get(ATTR_PAGE_FOOTERSET)).GetItemSet(). \
             Get(ATTR_PAGE_SHARED)).GetValue()
 
-#define SC_PREVIEW_SIZE_X   10000
-#define SC_PREVIEW_SIZE_Y   12400
-
 void ScDocShell::Execute( SfxRequest& rReq )
 {
     //  SID_SC_RANGE (Range),
@@ -1900,7 +1897,16 @@ Rectangle ScDocShell::GetVisArea( sal_uInt16 nAspect ) const
 
     if( nAspect == ASPECT_THUMBNAIL )
     {
-        Rectangle aArea( 0,0, SC_PREVIEW_SIZE_X,SC_PREVIEW_SIZE_Y );
+        Size aSize = aDocument.GetPageSize(aDocument.GetVisibleTab());
+        const long SC_PREVIEW_SIZE_X = 10000;
+        const long SC_PREVIEW_SIZE_Y = 12400;
+        Rectangle aArea( 0,0, SC_PREVIEW_SIZE_X, SC_PREVIEW_SIZE_Y);
+        if (aSize.Width() > aSize.Height())
+        {
+            aArea.Right() = SC_PREVIEW_SIZE_Y;
+            aArea.Bottom() = SC_PREVIEW_SIZE_X;
+        }
+
         bool bNegativePage = aDocument.IsNegativePage( aDocument.GetVisibleTab() );
         if ( bNegativePage )
             ScDrawLayer::MirrorRectRTL( aArea );


More information about the Libreoffice-commits mailing list