Blob Blame History Raw
From 381c84511f6adf660189af85ff615e841e00977a Mon Sep 17 00:00:00 2001
From: Andrzej Hunt <andrzej@ahunt.org>
Date: Mon, 16 Nov 2015 15:30:53 +0100
Subject: [PATCH 336/398] sc lok: use client zoom for ViewRowColumnHeaders

Change-Id: I85000851f82ea7cdc4b536683adbc8570de9af7e
(cherry picked from commit 396b5f411f7ecc7d600efdc0bb2381a7d1ed6d88)
---
 desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 +++
 sc/source/ui/unoobj/docuno.cxx              | 5 +++++
 2 files changed, 8 insertions(+)

diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx
index 930dd21ec081..1edf8d722d2f 100644
--- a/desktop/qa/desktop_lib/test_desktop_lib.cxx
+++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx
@@ -405,6 +405,9 @@ void DesktopLOKTest::testRowColumnHeaders()
      * "text" has the header label in UTF-8
      */
     LibLODocument_Impl* pDocument = loadDoc("search.ods");
+
+    pDocument->pClass->initializeForRendering(pDocument);
+
     boost::property_tree::ptree aTree;
     char* pJSON = pDocument->m_pDocumentClass->getCommandValues(pDocument, ".uno:ViewRowColumnHeaders");
     std::stringstream aStream(pJSON);
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index c5a96e1e8255..c0f504d770c6 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -885,9 +885,14 @@ void ScModelObj::setClientZoom(int nTilePixelWidth_, int nTilePixelHeight_, int
 OUString ScModelObj::getRowColumnHeaders(const Rectangle& rRectangle)
 {
     ScViewData* pViewData = ScDocShell::GetViewData();
+
     if (!pViewData)
         return OUString();
 
+    // update the aLogicMode in ScViewData to something predictable
+    pViewData->SetZoom(Fraction(nTilePixelWidth * TWIPS_PER_PIXEL, nTileTwipWidth),
+                       Fraction(nTilePixelHeight * TWIPS_PER_PIXEL, nTileTwipHeight), true);
+
     ScTabView* pTabView = pViewData->GetView();
     if (!pTabView)
         return OUString();
-- 
2.12.0