xref: /aoo41x/main/configmgr/source/nodemap.cxx (revision 3a7cf181)
1*3a7cf181SAndrew Rist /**************************************************************
2*3a7cf181SAndrew Rist  *
3*3a7cf181SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*3a7cf181SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*3a7cf181SAndrew Rist  * distributed with this work for additional information
6*3a7cf181SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*3a7cf181SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*3a7cf181SAndrew Rist  * "License"); you may not use this file except in compliance
9*3a7cf181SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*3a7cf181SAndrew Rist  *
11*3a7cf181SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*3a7cf181SAndrew Rist  *
13*3a7cf181SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*3a7cf181SAndrew Rist  * software distributed under the License is distributed on an
15*3a7cf181SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*3a7cf181SAndrew Rist  * KIND, either express or implied.  See the License for the
17*3a7cf181SAndrew Rist  * specific language governing permissions and limitations
18*3a7cf181SAndrew Rist  * under the License.
19*3a7cf181SAndrew Rist  *
20*3a7cf181SAndrew Rist  *************************************************************/
21*3a7cf181SAndrew Rist 
22*3a7cf181SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "precompiled_configmgr.hxx"
25cdf0e10cSrcweir #include "sal/config.h"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <algorithm>
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "osl/diagnose.h"
30cdf0e10cSrcweir #include "rtl/ustring.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include "node.hxx"
33cdf0e10cSrcweir #include "nodemap.hxx"
34cdf0e10cSrcweir 
35cdf0e10cSrcweir namespace configmgr {
36cdf0e10cSrcweir 
cloneNodeMap(NodeMap const & source,NodeMap * target)37cdf0e10cSrcweir void cloneNodeMap(NodeMap const & source, NodeMap * target) {
38cdf0e10cSrcweir     OSL_ASSERT(target != 0 && target->empty());
39cdf0e10cSrcweir     NodeMap clone(source);
40cdf0e10cSrcweir     for (NodeMap::iterator i(clone.begin()); i != clone.end(); ++i) {
41cdf0e10cSrcweir         i->second = i->second->clone(true);
42cdf0e10cSrcweir     }
43cdf0e10cSrcweir     std::swap(clone, *target);
44cdf0e10cSrcweir }
45cdf0e10cSrcweir 
46cdf0e10cSrcweir }
47