Kaydet (Commit) a22ce3e4 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

ManageNames: only update the range names if we really changed data

üst 68c59142
...@@ -96,6 +96,7 @@ private: ...@@ -96,6 +96,7 @@ private:
Selection maCurSel; Selection maCurSel;
bool mbNeedUpdate; bool mbNeedUpdate;
bool mbDataChanged;
typedef boost::ptr_map<rtl::OUString, ScRangeName> RangeNameContainer; typedef boost::ptr_map<rtl::OUString, ScRangeName> RangeNameContainer;
......
...@@ -111,7 +111,8 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, ...@@ -111,7 +111,8 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
mpViewData ( ptrViewData ), mpViewData ( ptrViewData ),
mpDoc ( ptrViewData->GetDocument() ), mpDoc ( ptrViewData->GetDocument() ),
maCursorPos ( aCursorPos ), maCursorPos ( aCursorPos ),
mbNeedUpdate ( true ) mbNeedUpdate ( true ),
mbDataChanged ( false )
{ {
Init(); Init();
FreeResource(); FreeResource();
...@@ -213,8 +214,11 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) ...@@ -213,8 +214,11 @@ void ScNameDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
sal_Bool ScNameDlg::Close() sal_Bool ScNameDlg::Close()
{ {
ScDocFunc aFunc(*mpViewData->GetDocShell()); if (mbDataChanged)
aFunc.ModifyAllRangeNames(maRangeMap); {
ScDocFunc aFunc(*mpViewData->GetDocShell());
aFunc.ModifyAllRangeNames(maRangeMap);
}
return DoClose( ScNameDlgWrapper::GetChildWindowId() ); return DoClose( ScNameDlgWrapper::GetChildWindowId() );
} }
...@@ -376,6 +380,8 @@ void ScNameDlg::RemovePushed() ...@@ -376,6 +380,8 @@ void ScNameDlg::RemovePushed()
// be safe and check for possible problems // be safe and check for possible problems
if (pData) if (pData)
pRangeName->erase(*pData); pRangeName->erase(*pData);
mbDataChanged = true;
} }
CheckForEmptyTable(); CheckForEmptyTable();
} }
...@@ -430,6 +436,7 @@ void ScNameDlg::NameModified() ...@@ -430,6 +436,7 @@ void ScNameDlg::NameModified()
aLine.aScope = aNewScope; aLine.aScope = aNewScope;
mpRangeManagerTable->addEntry(aLine); mpRangeManagerTable->addEntry(aLine);
mbNeedUpdate = true; mbNeedUpdate = true;
mbDataChanged = true;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment