summaryrefslogtreecommitdiff
path: root/sc/source/core/data/documen3.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-21 05:09:10 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2011-11-23 06:25:33 +0100
commit106f128f359deb1c9553c105eff4bf829fdd9736 (patch)
tree57a563b4e8549de6c88ac5d686b17aa85c8b4361 /sc/source/core/data/documen3.cxx
parent26c86c78c5eb4b15e6f4fa9074045c97fcb50173 (diff)
ManageNames: make global undo work again with dialog
Diffstat (limited to 'sc/source/core/data/documen3.cxx')
-rw-r--r--sc/source/core/data/documen3.cxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 1aabd9f7dd6a..d225f1143945 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -126,6 +126,34 @@ void ScDocument::SetAllTabRangeNames(const ScRangeName::TabNameCopyMap& rNames)
SetRangeName(itr->first, new ScRangeName(*itr->second));
}
+void ScDocument::SetAllRangeNames( const boost::ptr_map<rtl::OUString, ScRangeName>& rRangeMap)
+{
+ rtl::OUString aGlobalStr(RTL_CONSTASCII_USTRINGPARAM(STR_GLOBAL_RANGE_NAME));
+ boost::ptr_map<rtl::OUString,ScRangeName>::const_iterator itr = rRangeMap.begin(), itrEnd = rRangeMap.end();
+ for (; itr!=itrEnd; ++itr)
+ {
+ if (itr->first == aGlobalStr)
+ {
+ delete pRangeName;
+ const ScRangeName* pName = itr->second;
+ if (pName->empty())
+ pRangeName = NULL;
+ else
+ pRangeName = new ScRangeName( *pName );
+ }
+ else
+ {
+ const ScRangeName* pName = itr->second;
+ SCTAB nTab;
+ GetTable(itr->first, nTab);
+ if (pName->empty())
+ SetRangeName( nTab, NULL );
+ else
+ SetRangeName( nTab, new ScRangeName( *pName ) );
+ }
+ }
+}
+
void ScDocument::GetTabRangeNameMap(std::map<rtl::OUString, ScRangeName*>& aRangeNameMap)
{
for (SCTAB i = 0; i < static_cast<SCTAB>(maTabs.size()); ++i)