ooo-build r12174 - in trunk: . patches/src680



Author: kyoshida
Date: Tue Apr 15 20:01:59 2008
New Revision: 12174
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12174&view=rev

Log:
2008-04-15  Kohei Yoshida  <kyoshida novell com>

	* patches/src680/desktop-keyconfig-migration.diff: overwrite the 
	character set value for the CSV import dialog to -1 (unspecified) on
	version upgrade to prevent it from being incorrectly set to 'Unicode'
	(n#376473).


Modified:
   trunk/ChangeLog
   trunk/patches/src680/desktop-keyconfig-migration.diff

Modified: trunk/patches/src680/desktop-keyconfig-migration.diff
==============================================================================
--- trunk/patches/src680/desktop-keyconfig-migration.diff	(original)
+++ trunk/patches/src680/desktop-keyconfig-migration.diff	Tue Apr 15 20:01:59 2008
@@ -1,6 +1,7 @@
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=desktop.vpj desktop.clean/source/migration/migration.cxx desktop/source/migration/migration.cxx
---- desktop.clean/source/migration/migration.cxx	2008-03-07 09:57:38.000000000 -0500
-+++ desktop/source/migration/migration.cxx	2008-03-12 15:21:38.000000000 -0400
+diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx
+index 43e8b48..9722617 100644
+--- desktop/source/migration/migration.cxx
++++ desktop/source/migration/migration.cxx
 @@ -58,6 +58,10 @@
  #include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
  #include <com/sun/star/util/XRefreshable.hpp>
@@ -12,7 +13,7 @@
   
  using namespace rtl;
  using namespace osl;
-@@ -71,6 +75,8 @@ using namespace com::sun::star::containe
+@@ -71,6 +75,8 @@ using namespace com::sun::star::container;
  using namespace com::sun::star::configuration;
  using namespace com::sun::star::configuration::backend;
  
@@ -173,7 +174,7 @@
  }
  
  MigrationImpl::MigrationImpl(const Reference< XMultiServiceFactory >& xFactory)
-@@ -148,6 +285,7 @@ MigrationImpl::MigrationImpl(const Refer
+@@ -148,6 +285,7 @@ MigrationImpl::MigrationImpl(const Reference< XMultiServiceFactory >& xFactory)
      , m_aInfo(findInstallation())    
      , m_vrFileList(compileFileList())
      , m_vrServiceList(compileServiceList())
@@ -181,7 +182,7 @@
  {
  }
  
-@@ -158,28 +296,12 @@ MigrationImpl::~MigrationImpl()
+@@ -158,28 +296,13 @@ MigrationImpl::~MigrationImpl()
  
  sal_Bool MigrationImpl::doMigration()
  {
@@ -202,21 +203,21 @@
 -
 -        result = sal_True;
 -    } catch (...)
--    {
--        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());
 +    try
 +    {
 +        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
-@@ -187,43 +309,73 @@ sal_Bool MigrationImpl::doMigration()
+@@ -187,42 +310,83 @@ sal_Bool MigrationImpl::doMigration()
      return sal_False;
  }
  
@@ -276,7 +277,8 @@
 +    }
  }
  
- void MigrationImpl::setMigrationCompleted() 
+-void MigrationImpl::setMigrationCompleted() 
++void MigrationImpl::cleanCSVImportCharSet()
  {
 -	try {
 -		Reference< XPropertySet > aPropertySet(getConfigAccess("org.openoffice.Setup/Office", true), UNO_QUERY_THROW);
@@ -285,19 +287,18 @@
 -	} catch (...) {
 -		// fail silently
 -	}
--}
-+	try
-+    {
-+        Reference< XPropertySet > aPropSet;
-+        if (m_aAppVerStr.getLength() > 0)
-+        {
-+            aPropSet.set(getConfigAccess("org.openoffice.Setup/Configuration", true), UNO_QUERY_THROW);
-+            aPropSet->setPropertyValue(ascii("ooLastVersionTouched"), makeAny(m_aAppVerStr));
-+            Reference< XChangesBatch >(aPropSet, UNO_QUERY_THROW)->commitChanges();
-+        }
++    // 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)
++
++    Reference< XPropertySet > aPropSet;
++    aPropSet.set(getConfigAccess("org.openoffice.Office.Calc/Dialogs/CSVImport", true), UNO_QUERY_THROW);
++    aPropSet->setPropertyValue(ascii("CharSet"), makeAny(static_cast<sal_Int32>(-1)));
++    Reference< XChangesBatch >(aPropSet, UNO_QUERY_THROW)->commitChanges();
+ }
  
 -sal_Bool MigrationImpl::checkMigrationCompleted() 
--{
++void MigrationImpl::setMigrationCompleted() 
+ {
 -    sal_Bool bMigrationCompleted = sal_False;
 -    try {
 -        Reference< XPropertySet > aPropertySet(
@@ -308,18 +309,27 @@
 -        // just return false...
 -    }
 -    return bMigrationCompleted;
+-}
++	try
++    {
++        Reference< XPropertySet > aPropSet;
++        if (m_aAppVerStr.getLength() > 0)
++        {
++            aPropSet.set(getConfigAccess("org.openoffice.Setup/Configuration", true), UNO_QUERY_THROW);
++            aPropSet->setPropertyValue(ascii("ooLastVersionTouched"), makeAny(m_aAppVerStr));
++            Reference< XChangesBatch >(aPropSet, UNO_QUERY_THROW)->commitChanges();
++        }
+ 
 +        m_bMigrationCompleted = true;
 +	} 
 +    catch (const Exception&)
 +    {
 +	}
- }
++}
  
--
  migrations_vr MigrationImpl::readMigrationSteps()
  {
- 
-@@ -442,82 +594,6 @@ strings_vr MigrationImpl::compileFileLis
+@@ -442,82 +606,6 @@ strings_vr MigrationImpl::compileFileList()
      return vrResult;
  }
  
@@ -402,7 +412,7 @@
  // removes elements of vector 2 in vector 1
  void MigrationImpl::substract(strings_v& va, const strings_v& vb_c) const
  {
-@@ -597,123 +673,6 @@ static FileBase::RC _checkAndCreateDirec
+@@ -597,123 +685,6 @@ static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL)
          return result;
  }       
  
@@ -526,10 +536,11 @@
  strings_vr MigrationImpl::compileServiceList()
  {
      strings_vr vrResult(new strings_v);
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=desktop.vpj desktop.clean/source/migration/migration_impl.hxx desktop/source/migration/migration_impl.hxx
---- desktop.clean/source/migration/migration_impl.hxx	2008-03-07 09:57:38.000000000 -0500
-+++ desktop/source/migration/migration_impl.hxx	2008-03-12 15:17:53.000000000 -0400
-@@ -81,6 +81,16 @@ typedef std::auto_ptr< migrations_v > mi
+diff --git a/desktop/source/migration/migration_impl.hxx b/desktop/source/migration/migration_impl.hxx
+index b31a2a9..5553d04 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;
  
  class MigrationImpl
  {
@@ -557,7 +568,7 @@
  
      // initializer functions...
      migrations_vr readMigrationSteps();
-@@ -104,14 +118,9 @@ private:
+@@ -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);
  
@@ -567,15 +578,17 @@
 -    void runServices();
 -    void refresh();
 +    void transKeyConfig();
++    void cleanCSVImportCharSet();
  
      void setMigrationCompleted();
 -    sal_Bool checkMigrationCompleted();
      
  public:
      MigrationImpl(const NS_UNO::Reference< NS_CSS::lang::XMultiServiceFactory >&);
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=officecfg.vpj officecfg.clean/registry/schema/org/openoffice/Setup.xcs officecfg/registry/schema/org/openoffice/Setup.xcs
---- officecfg.clean/registry/schema/org/openoffice/Setup.xcs	2008-03-03 11:28:58.000000000 -0500
-+++ officecfg/registry/schema/org/openoffice/Setup.xcs	2008-03-07 17:12:18.000000000 -0500
+diff --git a/officecfg/registry/schema/org/openoffice/Setup.xcs b/officecfg/registry/schema/org/openoffice/Setup.xcs
+index 5c11fb4..bae1820 100644
+--- officecfg/registry/schema/org/openoffice/Setup.xcs
++++ officecfg/registry/schema/org/openoffice/Setup.xcs
 @@ -422,6 +422,14 @@
                      <desc>Deprecated</desc>
  				</info>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]