diff options
author | Laurent Godard <lgodard.libre@laposte.net> | 2015-03-20 12:02:31 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-03-27 23:33:51 +0000 |
commit | c79bdd062f657d1be98aa815d9b882d144f35e04 (patch) | |
tree | 9e0befc6caff794a849ae256d88b6fc4911681a3 /sc | |
parent | dd4021a692d3f2d5950c0d9951ea4919368f046e (diff) |
tdf#90042 only handle formula group if useful
Change-Id: I497a5bae4b08b46357415501ddbafc70585adfb0
Reviewed-on: https://gerrit.libreoffice.org/14920
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/document.cxx | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 506cb2dd7d9e..98ea133bb569 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3214,19 +3214,29 @@ bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& if (!pTab) return false; - // In case setting this string affects an existing formula group, record - // its above and below position for later listening. + bool bNumFmtSet = false; - std::vector<ScAddress> aGroupPos; - sc::EndListeningContext aCxt(*this); - ScAddress aPos(nCol, nRow, nTab); - EndListeningIntersectedGroup(aCxt, aPos, &aGroupPos); - aCxt.purgeEmptyBroadcasters(); + const ScFormulaCell* pCurCellFormula = pTab->GetFormulaCell(nCol, nRow); + if (pCurCellFormula && pCurCellFormula->IsShared()) + { + // In case setting this string affects an existing formula group, record + // its above and below position for later listening. - bool bNumFmtSet = pTab->SetString(nCol, nRow, nTab, rString, pParam); + std::vector<ScAddress> aGroupPos; + sc::EndListeningContext aCxt(*this); + ScAddress aPos(nCol, nRow, nTab); + EndListeningIntersectedGroup(aCxt, aPos, &aGroupPos); + aCxt.purgeEmptyBroadcasters(); - SetNeedsListeningGroups(aGroupPos); - StartNeededListeners(); + bNumFmtSet = pTab->SetString(nCol, nRow, nTab, rString, pParam); + + SetNeedsListeningGroups(aGroupPos); + StartNeededListeners(); + } + else + { + bNumFmtSet = pTab->SetString(nCol, nRow, nTab, rString, pParam); + } return bNumFmtSet; } |