Blob Blame History Raw
From 9f16689992d23d36f3538647aee575e08b5b7009 Mon Sep 17 00:00:00 2001
Message-Id: <9f16689992d23d36f3538647aee575e08b5b7009.1435610349.git.erack@redhat.com>
From: Eike Rathke <erack@redhat.com>
Date: Mon, 29 Jun 2015 22:20:04 +0200
Subject: [PATCH] Resolves: tdf#31577 volatile lookup ranges must not be cached
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="------------erAck-patch-parts"

This is a multi-part message in MIME format.
--------------erAck-patch-parts
Content-Type: text/plain; charset=UTF-8; format=fixed
Content-Transfer-Encoding: 8bit


Change-Id: Iac8574329c8c8e0bc0ac956993ccdd085372a6cc
(cherry picked from commit 5e83f49e5d62587f427ad416f5188ce81506c05b)
---
 sc/source/core/tool/interpr1.cxx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


--------------erAck-patch-parts
Content-Type: text/x-patch; name="0001-Resolves-tdf-31577-volatile-lookup-ranges-must-not-b.patch"
Content-Transfer-Encoding: 8bit
Content-Disposition: attachment; filename="0001-Resolves-tdf-31577-volatile-lookup-ranges-must-not-b.patch"

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index c12fb39..c30c0551 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8490,7 +8490,13 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress & o_rResultPos,
     const ScQueryEntry& rEntry = rParam.GetEntry(0);
     bool bColumnsMatch = (rParam.nCol1 == rEntry.nField);
     OSL_ENSURE( bColumnsMatch, "ScInterpreter::LookupQueryWithCache: columns don't match");
-    if (!bColumnsMatch)
+    // At least all volatile functions that generate indirect references have
+    // to force non-cached lookup.
+    /* TODO: We could further classify volatile functions into reference
+     * generating and not reference generating functions to have to force less
+     * direct lookups here. We could even further attribute volatility per
+     * parameter so it would affect only the lookup range parameter. */
+    if (!bColumnsMatch || GetVolatileType() != NOT_VOLATILE)
         bFound = lcl_LookupQuery( o_rResultPos, pDok, rParam, rEntry);
     else
     {

--------------erAck-patch-parts--