ooo-build r11498 - in trunk: . patches/test



Author: kyoshida
Date: Tue Feb  5 02:24:35 2008
New Revision: 11498
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11498&view=rev

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

	* patches/test/sc-localized-arg-separator.diff: on-going work to support
	localized argument separator (to primarily allow ',' instead of ';' in 
	some locales).

	* patches/test/README:
	* patches/test/sc-dp-drilldown-data-field-test.diff: cleaned up obsolete
	test patch.


Added:
   trunk/patches/test/sc-localized-arg-separator.diff
Removed:
   trunk/patches/test/sc-dp-drilldown-data-field-test.diff
Modified:
   trunk/ChangeLog
   trunk/patches/test/README

Modified: trunk/patches/test/README
==============================================================================
--- trunk/patches/test/README	(original)
+++ trunk/patches/test/README	Tue Feb  5 02:24:35 2008
@@ -106,10 +106,6 @@
 calc-autofilter-multistring-sc.diff
 calc-autofilter-multistring-xmloff.diff
 
-# Test patch for Calc's DataPilot drill-down feature & general code refactoring.
-
-sc-dp-drilldown-data-field-test.diff
-
 # On-going work toward importing & exporting Excel's sheet and workbook password
 # in addition to supporting sheet protection options like Excel does.
 

Added: trunk/patches/test/sc-localized-arg-separator.diff
==============================================================================
--- (empty file)
+++ trunk/patches/test/sc-localized-arg-separator.diff	Tue Feb  5 02:24:35 2008
@@ -0,0 +1,151 @@
+diff -ur sc.clean/source/core/src/compiler.src sc/source/core/src/compiler.src
+--- sc.clean/source/core/src/compiler.src	2007-07-03 11:48:53.000000000 -0400
++++ sc/source/core/src/compiler.src	2008-02-04 12:27:34.000000000 -0500
+@@ -51,7 +51,11 @@
+     String SC_OPCODE_ARRAY_CLOSE { Text = "}" ; };
+     String SC_OPCODE_ARRAY_ROW_SEP { Text = "|" ; };
+     String SC_OPCODE_ARRAY_COL_SEP { Text = ";" ; };
+-	String SC_OPCODE_SEP { Text = ";" ; };
++    String SC_OPCODE_SEP
++    { 
++        Text [ en-US ] = "," ; 
++        Text = ";" ;
++    };
+     String SC_OPCODE_PERCENT_SIGN { Text = "%" ; };
+ 	String SC_OPCODE_ADD { Text = "+" ; };
+ 	String SC_OPCODE_SUB { Text = "-" ; };
+@@ -1179,7 +1183,11 @@
+     String SC_OPCODE_ARRAY_CLOSE { Text = "}" ; };
+     String SC_OPCODE_ARRAY_ROW_SEP { Text = "|" ; };
+     String SC_OPCODE_ARRAY_COL_SEP { Text = ";" ; };
+-	String SC_OPCODE_SEP { Text = ";" ; };
++    String SC_OPCODE_SEP
++    { 
++        Text [ en-US ] = "," ; 
++        Text = ";" ;
++    };
+     String SC_OPCODE_PERCENT_SIGN { Text = "%" ; };
+ 	String SC_OPCODE_ADD { Text = "+" ; };
+ 	String SC_OPCODE_SUB { Text = "-" ; };
+diff -ur sc.clean/source/filter/xml/XMLConverter.cxx sc/source/filter/xml/XMLConverter.cxx
+--- sc.clean/source/filter/xml/XMLConverter.cxx	2007-05-22 16:01:59.000000000 -0400
++++ sc/source/filter/xml/XMLConverter.cxx	2008-02-04 21:12:30.000000000 -0500
+@@ -60,6 +60,11 @@
+ #ifndef SC_DOCUMENT_HXX
+ #include "document.hxx"
+ #endif
++#include "opcode.hxx"
++#include "scmod.hxx"
++#include "sc.hrc"
++#include "scresid.hxx"
++#include <tools/rcid.h>
+ 
+ #ifndef _DATETIME_HXX
+ #include <tools/datetime.hxx>
+@@ -79,7 +84,29 @@
+ using namespace ::rtl;
+ using namespace ::com::sun::star;
+ using namespace xmloff::token;
++using ::osl::MutexGuard;
++using ::osl::Mutex;
+ 
++::std::auto_ptr<ScXMLConverter::ResContainer> ScXMLConverter::spResContainer(NULL);
++
++ScXMLConverter::ResContainer::ResContainer() : Resource( ScResId(RID_SC_FUNCTION_NAMES) )
++{
++    ResMgr& rMgr = *SC_MOD()->GetResMgr();
++
++    ScResId aRes(SC_OPCODE_SEP);
++    aRes.SetRT(RSC_STRING);
++    if (IsAvailableRes(aRes))
++        maSep = String(ResId(SC_OPCODE_SEP, rMgr));
++}
++
++const ::rtl::OUString ScXMLConverter::ResContainer::getSep() const
++{
++    return maSep;
++}
++
++ScXMLConverter::ResContainer::~ResContainer()
++{
++}
+ 
+ //___________________________________________________________________
+ 
+@@ -349,6 +376,9 @@
+ 
+ void ScXMLConverter::ParseFormula(OUString& sFormula, const sal_Bool bIsFormula)
+ {
++    Init();
++    const rtl::OUString& rSep = spResContainer->getSep();
++
+ 	OUStringBuffer sBuffer(sFormula.getLength());
+ 	sal_Bool bInQuotationMarks(sal_False);
+ 	sal_Bool bInDoubleQuotationMarks(sal_False);
+@@ -367,6 +397,11 @@
+ 			++nCountBraces;
+ 		else if (sFormula[i] == ']')
+ 			nCountBraces--;
++        else if (sFormula[i] == ';' && nCountBraces == 0)
++        {
++            // localized argument separator
++            sBuffer.append(rSep);
++        }
+ 		else if	((sFormula[i] != '.') ||
+ 				((nCountBraces == 0) && bIsFormula) ||
+ 				!((chPrevious == '[') || (chPrevious == ':') || (chPrevious == ' ') || (chPrevious == '=')))
+@@ -414,3 +449,9 @@
+ 	rDateTime = aTempDateTime;
+ }
+ 
++void ScXMLConverter::Init()
++{
++    MutexGuard aGuard(Mutex::getGlobalMutex());
++    if (!spResContainer.get())
++        spResContainer.reset(new ResContainer);    
++}
+diff -ur sc.clean/source/filter/xml/XMLConverter.hxx sc/source/filter/xml/XMLConverter.hxx
+--- sc.clean/source/filter/xml/XMLConverter.hxx	2007-05-22 16:02:13.000000000 -0400
++++ sc/source/filter/xml/XMLConverter.hxx	2008-02-04 20:54:40.000000000 -0500
+@@ -50,6 +50,8 @@
+ #include <rtl/ustrbuf.hxx>
+ #endif
+ 
++#include <tools/rc.hxx>
++
+ #ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+ #include <com/sun/star/frame/XModel.hpp>
+ #endif
+@@ -65,6 +67,8 @@
+ #include <com/sun/star/util/DateTime.hpp>
+ #endif
+ 
++#include <memory>
++
+ class ScDocument;
+ class DateTime;
+ class SvXMLUnitConverter;
+@@ -140,6 +144,22 @@
+ 	static void			ConvertCoreToAPIDateTime(const DateTime& aDateTime, com::sun::star::util::DateTime& rDateTime);
+ 
+ 	static void         ConvertAPIToCoreDateTime(const com::sun::star::util::DateTime& aDateTime, DateTime& rDateTime);
++
++private:
++    static void         Init();
++
++private:
++    class ResContainer : public Resource
++    {
++    public:
++        explicit ResContainer();
++        ~ResContainer();
++
++        const ::rtl::OUString getSep() const;
++    private:
++        ::rtl::OUString maSep;
++    };
++    static ::std::auto_ptr<ResContainer> spResContainer;
+ };
+ 
+ 
+Only in sc: unxlngi6.pro



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