ScFormulaListener: do not start listening to clipboard or Undo docs
Change-Id: Ic00e30eccc64cc85ee877572ef8df042899f45f5
diff --git a/sc/source/core/data/colorscale.cxx b/sc/source/core/data/colorscale.cxx
index 2690be1..dbce784 100644
--- a/sc/source/core/data/colorscale.cxx
+++ b/sc/source/core/data/colorscale.cxx
@@ -36,7 +36,7 @@ ScFormulaListener::ScFormulaListener(ScDocument* pDoc):
void ScFormulaListener::startListening(ScTokenArray* pArr, const ScRange& rRange)
{
if (!pArr)
if (!pArr || mpDoc->IsClipOrUndo())
return;
pArr->Reset();
@@ -123,6 +123,9 @@ private:
void ScFormulaListener::stopListening()
{
if (mpDoc->IsClipOrUndo())
return;
std::for_each(maCells.begin(), maCells.end(), StopListeningCell(mpDoc, this));
}