From 5f94a5e44621da1ca3cf59df7d6cbace46606995 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Tue, 9 Mar 2010 14:51:15 -0500 Subject: koheiextref01: #i108404# Disable interaction handler when interpreting formula strings via UNO API. --- sc/inc/externalrefmgr.hxx | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'sc/inc') diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index f251875b35ea..3f368d9a3189 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -386,6 +386,21 @@ public: }; }; + /** + * Use this guard when performing something from the API that might query + * values from external references. Interpreting formula strings is one + * such example. + */ + class ApiGuard + { + public: + ApiGuard(ScExternalRefManager* pMgr); + ~ApiGuard(); + private: + ScExternalRefManager* mpMgr; + bool mbOldInteractionEnabled; + }; + private: /** Shell instance for a source document. */ struct SrcShell @@ -512,7 +527,7 @@ public: * @returns if setAllCacheTableReferencedStati(false) was called, * if setAllCacheTableReferencedStati(true) was called. */ - bool isInReferenceMarking() const { return bInReferenceMarking; } + bool isInReferenceMarking() const { return mbInReferenceMarking; } void storeRangeNameTokens(sal_uInt16 nFileId, const String& rName, const ScTokenArray& rArray); @@ -716,7 +731,13 @@ private: ::std::vector maSrcFiles; /** Status whether in reference marking state. See isInReferenceMarking(). */ - bool bInReferenceMarking; + bool mbInReferenceMarking:1; + + /** + * Controls whether or not to allow user interaction. We don't want any + * user interaction when calling from the API. + */ + bool mbUserInteractionEnabled:1; AutoTimer maSrcDocTimer; DECL_LINK(TimeOutHdl, AutoTimer*); -- cgit