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>
This commit is contained in:
committed by
Eike Rathke
parent
dd4021a692
commit
c79bdd062f
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user