ooo-build r14083 - in trunk: . patches/dev300
- From: jholesovsky svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14083 - in trunk: . patches/dev300
- Date: Thu, 25 Sep 2008 15:45:59 +0000 (UTC)
Author: jholesovsky
Date: Thu Sep 25 15:45:59 2008
New Revision: 14083
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14083&view=rev
Log:
2008-09-25 Jan Holesovsky <kendy suse cz>
* patches/dev300/desktop-config-migration.diff: Copy the user settings
from older release to newer one again.
* patches/dev300/scp2-user-config-ooo3.diff,
patches/dev300/apply: Migrate user settings from ~/.ooo-2.0 to
~/.ooo3.
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
trunk/patches/dev300/desktop-config-migration.diff
trunk/patches/dev300/scp2-user-config-ooo3.diff
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Thu Sep 25 15:45:59 2008
@@ -917,7 +917,7 @@
[ CustomUserConfig >= dev300-m29 >= ooo300-m1 ]
# migrate keyboard shortcuts & reset character set for CSV import dialog.
-desktop-config-migration.diff n#367160, n#376473, kohei
+desktop-config-migration.diff n#367160, n#376473, n#421070, kohei/jholesov
[ CustomUserConfig ]
Modified: trunk/patches/dev300/desktop-config-migration.diff
==============================================================================
--- trunk/patches/dev300/desktop-config-migration.diff (original)
+++ trunk/patches/dev300/desktop-config-migration.diff Thu Sep 25 15:45:59 2008
@@ -1,8 +1,8 @@
-diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
-index 43e8b48..9722617 100644
+diff --git desktop/source/migration/migration.cxx desktop/source/migration/migration.cxx
+index 8811076..62ecfad 100644
--- desktop/source/migration/migration.cxx
+++ desktop/source/migration/migration.cxx
-@@ -58,6 +58,10 @@
+@@ -57,6 +57,10 @@
#include <com/sun/star/util/XRefreshable.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <com/sun/star/util/XStringSubstitution.hpp>
@@ -10,10 +10,10 @@
+#include <com/sun/star/ui/XAcceleratorConfiguration.hpp>
+#include <com/sun/star/awt/Key.hpp>
+#include <com/sun/star/awt/KeyEvent.hpp>
-
+
using namespace rtl;
using namespace osl;
-@@ -71,6 +75,9 @@ using namespace com::sun::star::container;
+@@ -71,6 +75,9 @@ using namespace com::sun::star::configuration::backend;
using com::sun::star::uno::Exception;
using namespace com::sun::star;
@@ -23,7 +23,7 @@
namespace desktop {
-@@ -128,17 +134,148 @@ OUString Migration::getOldVersionName()
+@@ -127,19 +134,150 @@ OUString Migration::getOldVersionName()
return getImpl()->getOldVersionName();
}
@@ -44,7 +44,10 @@
-sal_Bool MigrationImpl::checkMigration()
+static bool splitVersionString(const OUString& rVer, MigrationImpl::VersionNumber& rVerNum)
-+{
+ {
+- if (m_aInfo.userdata.getLength() > 0 && ! checkMigrationCompleted())
+- return sal_True;
+- else
+ rVerNum.mnMajor = 0;
+ rVerNum.mnMinor = 0;
+ rVerNum.mnMicro = 0;
@@ -91,8 +94,7 @@
+ rVer2. */
+static short compareVersion(const MigrationImpl::VersionNumber& rVer1,
+ const MigrationImpl::VersionNumber& rVer2)
- {
-- if (m_aInfo.userdata.getLength() > 0 && ! checkMigrationCompleted())
++{
+ // major version
+ if (rVer1.mnMajor < rVer2.mnMajor)
+ return -1;
@@ -119,12 +121,12 @@
+ MigrationImpl::VersionNumber& rAppVerNum)
+{
+ if (!splitVersionString(rConfVerStr, rConfVerNum))
-+ return sal_False;
+ return sal_False;
+
+ if (!splitVersionString(rAppVerStr, rAppVerNum))
+ return sal_False;
+
-+#if 0
++#if OSL_DEBUG_LEVEL > 0
+ fprintf(stdout, "desktop::isMigrationNeeded: config ver = %d.%d.%d\n",
+ rConfVerNum.mnMajor,rConfVerNum.mnMinor,rConfVerNum.mnMicro);
+
@@ -133,17 +135,16 @@
+#endif
+
+ if (compareVersion(rConfVerNum, rAppVerNum) < 0)
- return sal_True;
-- else
++ return sal_True;
+
+ return sal_False;
-+}
-+
+ }
+
+sal_Bool MigrationImpl::checkMigration()
+{
+ if (m_bMigrationCompleted)
+ // migration is already complete.
- return sal_False;
++ return sal_False;
+
+ try
+ {
@@ -172,75 +173,65 @@
+ {
+ }
+ return sal_True;
- }
-
++}
++
MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFactory)
-@@ -148,6 +285,7 @@ MigrationImpl::MigrationImpl(const Reference< XMultiServiceFactory >& xFactory)
- , m_aInfo(findInstallation())
+ : m_vrVersions(new strings_v)
+ , m_xFactory(xFactory)
+@@ -147,6 +285,7 @@ MigrationImpl::MigrationImpl(const uno::Reference< XMultiServiceFactory >& xFact
+ , m_aInfo(findInstallation())
, m_vrFileList(compileFileList())
, m_vrServiceList(compileServiceList())
+ , m_bMigrationCompleted(false)
{
}
-@@ -158,70 +296,97 @@ MigrationImpl::~MigrationImpl()
+@@ -157,6 +296,10 @@ MigrationImpl::~MigrationImpl()
sal_Bool MigrationImpl::doMigration()
{
-- sal_Bool result = sal_False;
-- try{
-- copyFiles();
--
-- // execute the migration items from Setup.xcu
-- // and refresh the cache
-- copyConfig();
-- refresh();
--
-- // execute custom migration services from Setup.xcu
-- // and refresh the cache
-- runServices();
-- refresh();
--
-- result = sal_True;
-- } catch (...)
-+ try
-+ {
++#if OSL_DEBUG_LEVEL > 0
++ fprintf( stderr, "Migrating user configuration to newer OOo version.\n" );
++#endif
++
+ sal_Bool result = sal_False;
+ try{
+ copyFiles();
+@@ -164,6 +307,11 @@ sal_Bool MigrationImpl::doMigration()
+ // execute the migration items from Setup.xcu
+ // and refresh the cache
+ copyConfig();
++
++ // refresh pieces of the configuration
+ transKeyConfig();
+ cleanCSVImportCharSet();
-+ }
-+ catch (const Exception&)
- {
-- OString aMsg("An unexpected exception was thrown during migration");
-- aMsg += "\nOldVersion: " + OUStringToOString(m_aInfo.productname, RTL_TEXTENCODING_ASCII_US);
-- aMsg += "\nDataPath : " + OUStringToOString(m_aInfo.userdata, RTL_TEXTENCODING_ASCII_US);
-- OSL_ENSURE(sal_False, aMsg.getStr());
- }
-
- // prevent running the migration multiple times
- setMigrationCompleted();
-- return result;
-+ return sal_True;
++
+ refresh();
+
+ // execute custom migration services from Setup.xcu
+@@ -196,31 +344,83 @@ void MigrationImpl::refresh()
+
}
--void MigrationImpl::refresh()
+-void MigrationImpl::setMigrationCompleted()
+void MigrationImpl::transKeyConfig()
{
-- uno::Reference< XRefreshable > xRefresh(m_xFactory->createInstance(
-- OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")), uno::UNO_QUERY);
-- if (xRefresh.is())
-- xRefresh->refresh();
-- else
-- OSL_ENSURE(sal_False, "could not get XRefresh interface from default config provider. No refresh done.");
--
+- try {
+- uno::Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), uno::UNO_QUERY_THROW);
+- aPropertySet->setPropertyValue(OUString::createFromAscii("MigrationCompleted"), uno::makeAny(sal_True));
+- uno::Reference< XChangesBatch >(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges();
+- } catch (...) {
+- // fail silently
+- }
+ using namespace ::com::sun::star;
+ using namespace ::com::sun::star::ui;
+
-+#if 0
++#if OSL_DEBUG_LEVEL > 0
+ fprintf(stdout, "MigrationImpl::transKeyConfig: config ver = %ld.%ld.%ld\n",
-+ m_aConfigVerNum.mnMajor, m_aConfigVerNum.mnMinor, m_aConfigVerNum.mnMicro);
++ long(m_aConfigVerNum.mnMajor), long(m_aConfigVerNum.mnMinor), long(m_aConfigVerNum.mnMicro));
+
+ fprintf(stdout, "MigrationImpl::transKeyConfig: app ver = %ld.%ld.%ld\n",
-+ m_aAppVerNum.mnMajor, m_aAppVerNum.mnMinor, m_aAppVerNum.mnMicro);
++ long(m_aAppVerNum.mnMajor), long(m_aAppVerNum.mnMinor), long(m_aAppVerNum.mnMicro));
+#endif
+
+ if (compareVersion(m_aConfigVerNum, VersionNumber(2,4,0)) < 0)
@@ -278,27 +269,8 @@
+ }
}
--void MigrationImpl::setMigrationCompleted()
-+void MigrationImpl::cleanCSVImportCharSet()
- {
-- try {
-- uno::Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), uno::UNO_QUERY_THROW);
-- aPropertySet->setPropertyValue(OUString::createFromAscii("MigrationCompleted"), uno::makeAny(sal_True));
-- uno::Reference< XChangesBatch >(aPropertySet, uno::UNO_QUERY_THROW)->commitChanges();
-- } catch (...) {
-- // fail silently
-- }
-+ // Overwrite the character set value for CSV import to -1 (unset) on every
-+ // upgrade, to prevent it from being incorrectly set to Unicode. (n#376473)
-+
-+ uno::Reference< XPropertySet > aPropSet;
-+ aPropSet.set(getConfigAccess("org.openoffice.Office.Calc/Dialogs/CSVImport", true), uno::UNO_QUERY_THROW);
-+ aPropSet->setPropertyValue(ascii("CharSet"), uno::makeAny(static_cast<sal_Int32>(-1)));
-+ uno::Reference< XChangesBatch >(aPropSet, uno::UNO_QUERY_THROW)->commitChanges();
- }
-
-sal_Bool MigrationImpl::checkMigrationCompleted()
-+void MigrationImpl::setMigrationCompleted()
++void MigrationImpl::cleanCSVImportCharSet()
{
- sal_Bool bMigrationCompleted = sal_False;
- try {
@@ -310,7 +282,17 @@
- // just return false...
- }
- return bMigrationCompleted;
--}
++ // Overwrite the character set value for CSV import to -1 (unset) on every
++ // upgrade, to prevent it from being incorrectly set to Unicode. (n#376473)
++
++ uno::Reference< XPropertySet > aPropSet;
++ aPropSet.set(getConfigAccess("org.openoffice.Office.Calc/Dialogs/CSVImport", true), uno::UNO_QUERY_THROW);
++ aPropSet->setPropertyValue(ascii("CharSet"), uno::makeAny(static_cast<sal_Int32>(-1)));
++ uno::Reference< XChangesBatch >(aPropSet, uno::UNO_QUERY_THROW)->commitChanges();
+ }
+
++void MigrationImpl::setMigrationCompleted()
++{
+ try
+ {
+ uno::Reference< XPropertySet > aPropSet;
@@ -320,7 +302,7 @@
+ aPropSet->setPropertyValue(ascii("ooLastVersionTouched"), uno::makeAny(m_aAppVerStr));
+ uno::Reference< XChangesBatch >(aPropSet, uno::UNO_QUERY_THROW)->commitChanges();
+ }
-
++
+ m_bMigrationCompleted = true;
+ }
+ catch (const Exception&)
@@ -330,218 +312,11 @@
migrations_vr MigrationImpl::readMigrationSteps()
{
-@@ -442,82 +606,6 @@ strings_vr MigrationImpl::compileFileList()
- return vrResult;
- }
-
--
--void MigrationImpl::copyConfig()
--{
-- try {
-- // 1. get a list of all components from hierachy browser
-- uno::Reference< XJob > xBrowser(m_xFactory->createInstance(
-- OUString::createFromAscii("com.sun.star.configuration.backend.LocalHierarchyBrowser")), uno::UNO_QUERY_THROW);
--
-- uno::Sequence< NamedValue > seqArgs(2);
-- seqArgs[0] = NamedValue(
-- OUString::createFromAscii("LayerDataUrl"),
-- uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry")));
-- seqArgs[1] = NamedValue(
-- OUString::createFromAscii("FetchComponentNames"),
-- uno::makeAny(sal_True));
--
-- // execute the search
-- uno::Any aResult = xBrowser->execute(seqArgs);
-- uno::Sequence< OUString > seqComponents;
-- aResult >>= seqComponents;
-- OSL_ENSURE(seqComponents.getLength()>0, "MigrationImpl::copyConfig(): no config components available");
--
-- // 2. create an importer
-- uno::Reference< XJob > xImporter(m_xFactory->createInstance(
-- OUString::createFromAscii("com.sun.star.configuration.backend.LocalDataImporter")), uno::UNO_QUERY_THROW);
--
-- // 3. for each migration step...
-- uno::Sequence< NamedValue > importerArgs(3);
-- importerArgs[0] = NamedValue(
-- OUString::createFromAscii("LayerDataUrl"),
-- uno::makeAny(m_aInfo.userdata + OUString::createFromAscii("/user/registry")));
-- importerArgs[1] = NamedValue(
-- OUString::createFromAscii("LayerFilter"),
-- uno::Any());
-- importerArgs[2] = NamedValue(
-- OUString::createFromAscii("Component"),
-- uno::Any());
--
-- migrations_v::const_iterator i_mig = m_vrMigrations->begin();
-- while (i_mig != m_vrMigrations->end())
-- {
-- // a. create config filter for step
-- uno::Reference< XInitialization > xFilter(
-- new CConfigFilter(&(i_mig->includeConfig), &(i_mig->excludeConfig)));
-- importerArgs[1].Value = uno::makeAny(xFilter);
--
-- // b. run each importer with config filter
-- for (sal_Int32 i=0; i<seqComponents.getLength(); i++)
-- {
-- OUString component = seqComponents[i];
-- importerArgs[2].Value = uno::makeAny(seqComponents[i]);
-- try {
-- aResult = xImporter->execute(importerArgs);
-- Exception myException;
-- if (aResult >>= myException) throw myException;
-- } catch(Exception& aException) {
-- OString aMsg("Exception in config layer import.\ncomponent: ");
-- aMsg += OUStringToOString(seqComponents[i], RTL_TEXTENCODING_ASCII_US);
-- aMsg += "\nmessage: ";
-- aMsg += OUStringToOString(aException.Message, RTL_TEXTENCODING_ASCII_US);
-- OSL_ENSURE(sal_False, aMsg.getStr());
-- }
-- }
-- i_mig++;
-- }
-- }
-- catch (Exception& e)
-- {
-- OString aMsg("Exception in config layer import.\nmessage: ");
-- aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
-- OSL_ENSURE(sal_False, aMsg.getStr());
-- }
--
--
--}
--
- // removes elements of vector 2 in vector 1
- void MigrationImpl::substract(strings_v& va, const strings_v& vb_c) const
- {
-@@ -597,123 +685,6 @@ static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL)
- return xNameAccess;
- }
-
--void MigrationImpl::copyFiles()
--{
-- strings_v::const_iterator i_file = m_vrFileList->begin();
-- OUString localName;
-- OUString destName;
-- OUString userInstall;
-- utl::Bootstrap::PathStatus aStatus;
-- aStatus = utl::Bootstrap::locateUserInstallation(userInstall);
-- if (aStatus == utl::Bootstrap::PATH_EXISTS)
-- {
-- while (i_file != m_vrFileList->end())
-- {
--
-- // remove installation prefix from file
-- localName = i_file->copy(m_aInfo.userdata.getLength());
-- destName = userInstall + localName;
-- INetURLObject aURL(destName);
-- // check whether destination directory exists
-- aURL.removeSegment();
-- _checkAndCreateDirectory(aURL);
-- FileBase::RC copyResult = File::copy(*i_file, destName);
-- if (copyResult != FileBase::E_None)
-- {
-- OString msg("Cannot copy ");
-- msg += OUStringToOString(*i_file, RTL_TEXTENCODING_UTF8) + " to "
-- + OUStringToOString(destName, RTL_TEXTENCODING_UTF8);
-- OSL_ENSURE(sal_False, msg.getStr());
-- }
-- i_file++;
-- }
-- }
-- else
-- {
-- OSL_ENSURE(sal_False, "copyFiles: UserInstall does not exist");
-- }
--}
--
--void MigrationImpl::runServices()
--{
--
-- //create stratum for old user layer
-- OUString aOldLayerURL = m_aInfo.userdata;
-- aOldLayerURL += OUString::createFromAscii("/user/registry");
-- OUString aStratumSvc = OUString::createFromAscii("com.sun.star.configuration.backend.LocalSingleStratum");
-- uno::Sequence< uno::Any > stratumArgs(1);
-- stratumArgs[0] = uno::makeAny(aOldLayerURL);
-- uno::Reference< XSingleLayerStratum> xStartum( m_xFactory->createInstanceWithArguments(
-- aStratumSvc, stratumArgs), uno::UNO_QUERY);
--
-- // Build argument array
-- uno::Sequence< uno::Any > seqArguments(3);
-- seqArguments[0] = uno::makeAny(NamedValue(
-- OUString::createFromAscii("Productname"),
-- uno::makeAny(m_aInfo.productname)));
-- seqArguments[1] = uno::makeAny(NamedValue(
-- OUString::createFromAscii("UserData"),
-- uno::makeAny(m_aInfo.userdata)));
--
--
-- // create an instance of every migration service
-- // and execute the migration job
-- uno::Reference< XJob > xMigrationJob;
--
-- migrations_v::const_iterator i_mig = m_vrMigrations->begin();
-- while (i_mig != m_vrMigrations->end())
-- {
-- if( i_mig->service.getLength() > 0)
-- {
--
-- try
-- {
-- // create access to old configuration components in the user layer
-- // that were requested by the migration service
-- uno::Sequence< NamedValue > seqComponents(i_mig->configComponents.size());
-- strings_v::const_iterator i_comp = i_mig->configComponents.begin();
-- sal_Int32 i = 0;
-- while (i_comp != i_mig->configComponents.end() && xStartum.is())
-- {
-- // create Layer for i_comp
-- seqComponents[i] = NamedValue(
-- *i_comp, uno::makeAny(xStartum->getLayer(*i_comp, OUString())));
--
-- // next component
-- i_comp++;
-- i++;
-- }
-- // set old config argument
-- seqArguments[2] = uno::makeAny(NamedValue(
-- OUString::createFromAscii("OldConfiguration"),
-- uno::makeAny(seqComponents)));
--
-- xMigrationJob = uno::Reference< XJob >(m_xFactory->createInstanceWithArguments(
-- i_mig->service, seqArguments), uno::UNO_QUERY_THROW);
--
-- xMigrationJob->execute(uno::Sequence< NamedValue >());
--
--
-- } catch (Exception& e)
-- {
-- OString aMsg("Execution of migration service failed (Exception caught).\nService: ");
-- aMsg += OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US) + "\nMessage: ";
-- aMsg += OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
-- OSL_ENSURE(sal_False, aMsg.getStr());
-- } catch (...)
-- {
-- OString aMsg("Execution of migration service failed (Exception caught).\nService: ");
-- aMsg += OUStringToOString(i_mig->service, RTL_TEXTENCODING_ASCII_US) +
-- "\nNo message available";
-- OSL_ENSURE(sal_False, aMsg.getStr());
-- }
--
-- }
-- i_mig++;
-- }
--}
--
--
- strings_vr MigrationImpl::compileServiceList()
- {
- strings_vr vrResult(new strings_v);
-diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
-index b31a2a9..5553d04 100644
+diff --git desktop/source/migration/migration_impl.hxx desktop/source/migration/migration_impl.hxx
+index e07847a..0d83eac 100644
--- desktop/source/migration/migration_impl.hxx
+++ desktop/source/migration/migration_impl.hxx
-@@ -81,6 +81,16 @@ typedef std::auto_ptr< migrations_v > migrations_vr;
+@@ -76,6 +76,16 @@ typedef std::auto_ptr< migrations_v > migrations_vr;
class MigrationImpl
{
@@ -558,7 +333,7 @@
private:
strings_vr m_vrVersions;
-@@ -90,6 +100,10 @@ private:
+@@ -85,6 +95,10 @@ private:
strings_vr m_vrFileList; // final list of files to be copied
strings_vr m_vrConfigList; // final list of nodes to be copied
strings_vr m_vrServiceList; // final list of services to be called
@@ -569,15 +344,10 @@
// initializer functions...
migrations_vr readMigrationSteps();
-@@ -104,14 +118,10 @@ private:
- strings_vr applyPatterns(const strings_v& vSet, const strings_v& vPatterns) const;
- NS_UNO::Reference< NS_CSS::container::XNameAccess > getConfigAccess(const sal_Char* path, sal_Bool rw=sal_False);
-
-- // actual processing function that perform the migration steps
-- void copyFiles();
-- void copyConfig();
-- void runServices();
-- void refresh();
+@@ -104,9 +118,10 @@ private:
+ void copyConfig();
+ void runServices();
+ void refresh();
+ void transKeyConfig();
+ void cleanCSVImportCharSet();
@@ -586,11 +356,11 @@
public:
MigrationImpl(const NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory >&);
-diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
-index 5c11fb4..bae1820 100644
+diff --git officecfg/registry/schema/org/openoffice/Setup.xcs officecfg/registry/schema/org/openoffice/Setup.xcs
+index 7572879..247928a 100644
--- officecfg/registry/schema/org/openoffice/Setup.xcs
+++ officecfg/registry/schema/org/openoffice/Setup.xcs
-@@ -422,6 +422,14 @@
+@@ -417,6 +417,14 @@
<desc>Deprecated</desc>
</info>
</prop>
Modified: trunk/patches/dev300/scp2-user-config-ooo3.diff
==============================================================================
--- trunk/patches/dev300/scp2-user-config-ooo3.diff (original)
+++ trunk/patches/dev300/scp2-user-config-ooo3.diff Thu Sep 25 15:45:59 2008
@@ -9,3 +9,14 @@
#endif
StandaloneValue = "$ORIGIN/..";
End
+--- officecfg/registry/data/org/openoffice/Setup.xcu
++++ officecfg/registry/data/org/openoffice/Setup.xcu
+@@ -776,7 +776,7 @@
+ </node>
+ <node oor:name="Migration">
+ <prop oor:name="SupportedVersions">
+- <value oor:separator=",">OpenOffice.org 2=openoffice.org2,StarOffice 8=staroffice8,StarSuite 8=starsuite8</value>
++ <value oor:separator=",">OpenOffice.org 2=ooo-2.0,StarOffice 8=staroffice8,StarSuite 8=starsuite8</value>
+ </prop>
+ <node oor:name="MigrationSteps">
+ <node oor:name="Datasources" oor:op="replace">
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]