migration.cxx (2722cedd) | migration.cxx (5e679a6c) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 754 unchanged lines hidden (view full) --- 763 if (getComponent(*j, &comp)) { 764 comps[comp].excludedPaths.insert(*j); 765 } 766 } 767 } 768 for (Components::const_iterator i(comps.begin()); i != comps.end(); ++i) { 769 if (!i->second.includedPaths.empty()) { 770 rtl::OUStringBuffer buf(m_aInfo.userdata); | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 754 unchanged lines hidden (view full) --- 763 if (getComponent(*j, &comp)) { 764 comps[comp].excludedPaths.insert(*j); 765 } 766 } 767 } 768 for (Components::const_iterator i(comps.begin()); i != comps.end(); ++i) { 769 if (!i->second.includedPaths.empty()) { 770 rtl::OUStringBuffer buf(m_aInfo.userdata); |
771 buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("/user/registry/data")); 772 sal_Int32 n = 0; 773 do { 774 rtl::OUString seg(i->first.getToken(0, '.', n)); 775 rtl::OUString enc( 776 rtl::Uri::encode( 777 seg, rtl_UriCharClassPchar, rtl_UriEncodeStrict, 778 RTL_TEXTENCODING_UTF8)); 779 if (enc.getLength() == 0 && seg.getLength() != 0) { 780 OSL_TRACE( 781 ("configuration migration component %s ignored (cannot" 782 " be encoded as file path)"), 783 rtl::OUStringToOString( 784 i->first, RTL_TEXTENCODING_UTF8).getStr()); 785 goto next; 786 } 787 buf.append(sal_Unicode('/')); 788 buf.append(enc); 789 } while (n >= 0); 790 buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(".xcu")); | 771 if ( m_aInfo.productname.equals( OUString::createFromAscii("OpenOffice.org 3") ) ) 772 { 773 // OpenOffice.org 3 configuration file 774 buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("/user/registrymodifications.xcu")); 775 } 776 else 777 { 778 // OpenOffice.org 2 configuration files 779 buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("/user/registry/data")); 780 sal_Int32 n = 0; 781 do { 782 rtl::OUString seg(i->first.getToken(0, '.', n)); 783 rtl::OUString enc( 784 rtl::Uri::encode( 785 seg, rtl_UriCharClassPchar, rtl_UriEncodeStrict, 786 RTL_TEXTENCODING_UTF8)); 787 if (enc.getLength() == 0 && seg.getLength() != 0) { 788 OSL_TRACE( 789 ("configuration migration component %s ignored (cannot" 790 " be encoded as file path)"), 791 rtl::OUStringToOString( 792 i->first, RTL_TEXTENCODING_UTF8).getStr()); 793 goto next; 794 } 795 buf.append(sal_Unicode('/')); 796 buf.append(enc); 797 } while (n >= 0); 798 buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(".xcu")); 799 } |
791 configuration::Update::get( 792 comphelper::getProcessComponentContext())-> 793 insertModificationXcuFile( 794 buf.makeStringAndClear(), setToSeq(i->second.includedPaths), 795 setToSeq(i->second.excludedPaths)); 796 } else { 797 OSL_TRACE( 798 ("configuration migration component %s ignored (only excludes," --- 563 unchanged lines hidden --- | 800 configuration::Update::get( 801 comphelper::getProcessComponentContext())-> 802 insertModificationXcuFile( 803 buf.makeStringAndClear(), setToSeq(i->second.includedPaths), 804 setToSeq(i->second.excludedPaths)); 805 } else { 806 OSL_TRACE( 807 ("configuration migration component %s ignored (only excludes," --- 563 unchanged lines hidden --- |