diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-11-10 15:51:56 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2010-11-18 10:15:17 -0500 |
commit | 5f35a43d8405ef3bff6b841ccdaf5a256f6f554a (patch) | |
tree | 5343e62b845429113d4f5879e748a79c2b3e758d /sc/source/ui/docshell/docfunc.cxx | |
parent | 1bd5254e971ded24daa8aed0c636be3450ee71b9 (diff) |
Disable document modify and broadcasting of changes on range names.
We don't need to set document status modified & broadcast changes
on every single addition of range names during document import.
Doing so would make the document import painfully slow esp with
docs with lots of range names defined. (n#634257)
Note: this is a backport of the same fix from master. Please don't
merge this back into master.
Diffstat (limited to 'sc/source/ui/docshell/docfunc.cxx')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index d4cff7090706..a962c72913b9 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4506,12 +4506,12 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, BOOL bRecord, BO //------------------------------------------------------------------------ -BOOL ScDocFunc::ModifyRangeNames( const ScRangeName& rNewRanges, BOOL bApi ) +bool ScDocFunc::ModifyRangeNames( const ScRangeName& rNewRanges ) { - return SetNewRangeNames( new ScRangeName( rNewRanges ), bApi ); + return SetNewRangeNames( new ScRangeName(rNewRanges) ); } -BOOL ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, BOOL /* bApi */ ) // takes ownership of pNewRanges +bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc ) // takes ownership of pNewRanges { ScDocShellModificator aModificator( rDocShell ); @@ -4539,10 +4539,13 @@ BOOL ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, BOOL /* bApi */ ) if ( bCompile ) pDoc->CompileNameFormula( FALSE ); // CompileFormulaString - aModificator.SetDocumentModified(); - SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) ); + if (bModifyDoc) + { + aModificator.SetDocumentModified(); + SFX_APP()->Broadcast( SfxSimpleHint(SC_HINT_AREAS_CHANGED) ); + } - return TRUE; + return true; } //------------------------------------------------------------------------ @@ -4691,7 +4694,7 @@ BOOL ScDocFunc::CreateNames( const ScRange& rRange, USHORT nFlags, BOOL bApi ) if ( bBottom && bRight ) CreateOneName( aNewRanges, nEndCol,nEndRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi ); - bDone = ModifyRangeNames( aNewRanges, bApi ); + bDone = ModifyRangeNames( aNewRanges ); aModificator.SetDocumentModified(); SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) ); |