diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 1d5a94f05f41..465730293983 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -4818,12 +4818,12 @@ bool ScDocFunc::UnmergeCells( const ScCellMergeOption& rOption, bool bRecord ) return true; } -bool ScDocFunc::ModifyRangeNames( const ScRangeName& rNewRanges, SCTAB nTab ) +void ScDocFunc::ModifyRangeNames( const ScRangeName& rNewRanges, SCTAB nTab ) { - return SetNewRangeNames( new ScRangeName(rNewRanges), true, nTab ); + SetNewRangeNames( new ScRangeName(rNewRanges), true, nTab ); } -bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTAB nTab ) // takes ownership of pNewRanges +void ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTAB nTab ) // takes ownership of pNewRanges { ScDocShellModificator aModificator( rDocShell ); @@ -4867,8 +4867,6 @@ bool ScDocFunc::SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc, SCTA aModificator.SetDocumentModified(); SfxGetpApp()->Broadcast( SfxSimpleHint(SC_HINT_AREAS_CHANGED) ); } - - return true; } void ScDocFunc::ModifyAllRangeNames( const boost::ptr_map& rRangeMap ) @@ -5037,7 +5035,8 @@ bool ScDocFunc::CreateNames( const ScRange& rRange, sal_uInt16 nFlags, bool bApi if ( bBottom && bRight ) CreateOneName( aNewRanges, nEndCol,nEndRow,nTab, nContX1,nContY1,nContX2,nContY2, bCancel, bApi ); - bDone = ModifyRangeNames( aNewRanges, aTab ); + ModifyRangeNames( aNewRanges, aTab ); + bDone = true; aModificator.SetDocumentModified(); SfxGetpApp()->Broadcast( SfxSimpleHint( SC_HINT_AREAS_CHANGED ) ); diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx index 5cd2513a347b..6f970eb3b90f 100644 --- a/sc/source/ui/inc/docfunc.hxx +++ b/sc/source/ui/inc/docfunc.hxx @@ -193,8 +193,8 @@ public: bool UnmergeCells( const ScRange& rRange, bool bRecord ); bool UnmergeCells( const ScCellMergeOption& rOption, bool bRecord ); - bool SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc = true, SCTAB nTab = -1 ); // takes ownership of pNewRanges //nTab = -1 for local range names - bool ModifyRangeNames( const ScRangeName& rNewRanges, SCTAB nTab = -1 ); + void SetNewRangeNames( ScRangeName* pNewRanges, bool bModifyDoc = true, SCTAB nTab = -1 ); // takes ownership of pNewRanges //nTab = -1 for local range names + void ModifyRangeNames( const ScRangeName& rNewRanges, SCTAB nTab = -1 ); /** * Modify all range names, global scope names as well as sheet local ones, * in one go. Note that this method will not destroy the instances