diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-23 09:00:19 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2011-11-23 09:01:40 +0100 |
commit | a22ce3e4483f6fe462eaba8826a91355957e3676 (patch) | |
tree | 95771ddac3ba24e65d90b7f735bdddb9c1257079 /sc | |
parent | 68c591429fd0fc6189d53d4f718fb3edf9038dfb (diff) |
ManageNames: only update the range names if we really changed data
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/inc/namedlg.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namedlg.cxx | 13 |
2 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx index fc2fc0f2b65c..c6f4f4abe15d 100644 --- a/sc/source/ui/inc/namedlg.hxx +++ b/sc/source/ui/inc/namedlg.hxx @@ -96,6 +96,7 @@ private: Selection maCurSel; bool mbNeedUpdate; + bool mbDataChanged; typedef boost::ptr_map<rtl::OUString, ScRangeName> RangeNameContainer; diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index d21355cbc201..c27389400892 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -111,7 +111,8 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, mpViewData ( ptrViewData ), mpDoc ( ptrViewData->GetDocument() ), maCursorPos ( aCursorPos ), - mbNeedUpdate ( true ) + mbNeedUpdate ( true ), + mbDataChanged ( false ) { Init(); FreeResource(); @@ -213,8 +214,11 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) sal_Bool ScNameDlg::Close() { - ScDocFunc aFunc(*mpViewData->GetDocShell()); - aFunc.ModifyAllRangeNames(maRangeMap); + if (mbDataChanged) + { + ScDocFunc aFunc(*mpViewData->GetDocShell()); + aFunc.ModifyAllRangeNames(maRangeMap); + } return DoClose( ScNameDlgWrapper::GetChildWindowId() ); } @@ -376,6 +380,8 @@ void ScNameDlg::RemovePushed() // be safe and check for possible problems if (pData) pRangeName->erase(*pData); + + mbDataChanged = true; } CheckForEmptyTable(); } @@ -430,6 +436,7 @@ void ScNameDlg::NameModified() aLine.aScope = aNewScope; mpRangeManagerTable->addEntry(aLine); mbNeedUpdate = true; + mbDataChanged = true; } } |