Index: i18npool/inc/nativenumbersupplier_th.hxx
===================================================================
RCS file: i18npool/inc/nativenumbersupplier_th.hxx
diff -N i18npool/inc/nativenumbersupplier_th.hxx
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ i18npool/inc/nativenumbersupplier_th.hxx	21 Sep 2004 10:04:45 -0000
@@ -0,0 +1,87 @@
+/*************************************************************************
+ *
+ *  $RCSfile: natnum.patch,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: ott $ $Date: 2004-10-18 15:24:32 $
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _I18N_NATIVENUMBERSUPPLIER_TH_HXX_
+#define _I18N_NATIVENUMBERSUPPLIER_TH_HXX_
+
+#include <com/sun/star/i18n/XNativeNumberSupplier.hpp>
+#include <com/sun/star/i18n/NativeNumberMode.hpp>
+#include <com/sun/star/i18n/NativeNumberXmlAttributes.hpp>
+#include <cppuhelper/implbase2.hxx> // helper for implementations
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+#define MAX_NUMBER_CHARACTOR	50
+
+namespace com { namespace sun { namespace star { namespace i18n {
+
+rtl::OUString SAL_CALL NativeToThaiTextNum( 
+		const ::rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, 
+        	com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset ) 
+		throw(::com::sun::star::uno::RuntimeException);	
+
+rtl::OUString SAL_CALL NativeToThaiText( 
+		const ::rtl::OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, 
+	        com::sun::star::uno::Sequence< sal_Int32 >& offset, sal_Bool useOffset ,sal_Int16 convertMode) 
+		throw(::com::sun::star::uno::RuntimeException);
+
+} } } }
+
+#endif
Index: i18npool/source/nativenumber/makefile.mk
===================================================================
RCS file: /cvsroot/thaioo/OpenOffice_Test/i18npool/source/nativenumber/makefile.mk,v
retrieving revision 1.1.1.1
diff -a -u -r1.1.1.1 makefile.mk
--- i18npool/source/nativenumber/makefile.mk	15 Sep 2004 05:34:32 -0000	1.1.1.1
+++ i18npool/source/nativenumber/makefile.mk	21 Sep 2004 10:04:45 -0000
@@ -76,6 +76,7 @@
 
 SLOFILES=	\
 			$(SLO)$/nativenumbersupplier.obj \
+			$(SLO)$/nativenumbersupplier_th.obj \
 
 # --- Targets ------------------------------------------------------
 
Index: i18npool/source/nativenumber/nativenumbersupplier.cxx
===================================================================
RCS file: /cvsroot/thaioo/OpenOffice_Test/i18npool/source/nativenumber/nativenumbersupplier.cxx,v
retrieving revision 1.1.1.1
diff -a -u -r1.1.1.1 nativenumbersupplier.cxx
--- i18npool/source/nativenumber/nativenumbersupplier.cxx	15 Sep 2004 05:34:33 -0000	1.1.1.1
+++ i18npool/source/nativenumber/nativenumbersupplier.cxx	21 Sep 2004 10:04:45 -0000
@@ -61,6 +61,7 @@
 
 #include <rtl/ustrbuf.hxx>
 #include <nativenumbersupplier.hxx>
+#include <nativenumbersupplier_th.hxx>
 #include <localedata.hxx>
 #include <data/numberchar.h>
 #include <i18nutil/x_rtl_ustring.h>
@@ -515,13 +516,29 @@
                     num = NumberChar_FullWidth;
                 break;
                 case NativeNumberMode::NATNUM4: // Text, Lower, Long
-                    number = &natnum4[langnum];
+                    //number = &natnum4[langnum];
+		    // thai language native number=5
+		    if (langnum == 5)
+			return NativeToThaiText(aNumberString,  0, aNumberString.getLength(), offset, useOffset, 0);
+		    else
+                    	number = &natnum4[langnum];
                 break;
                 case NativeNumberMode::NATNUM5: // Text, Upper, Long
-                    number = &natnum5[langnum];
+                    //number = &natnum5[langnum];
+		    // thai language native number=5
+		    if (langnum == 5)
+			return NativeToThaiText(aNumberString,  0, aNumberString.getLength(), offset, useOffset, 1);
+		    else		
+                    	number = &natnum5[langnum];
                 break;
                 case NativeNumberMode::NATNUM6: // Text, FullWidth
-                    number = &natnum6[langnum];
+                    //number = &natnum6[langnum];
+		    // thai language native number=5
+		    if (langnum == 5)
+			return NativeToThaiTextNum(aNumberString,  0, aNumberString.getLength(), offset, useOffset);
+			//return NativeToThaiTextNum_old(aNumberString,  0, aNumberString.getLength(), offset, useOffset);
+		    else		
+                    	number = &natnum6[langnum];
                 break;
                 case NativeNumberMode::NATNUM7: // Text. Lower, Short
                     number = &natnum7[langnum];
@@ -598,16 +615,23 @@
 
         switch (nNativeNumberMode) {
             case NativeNumberMode::NATNUM0:     // Ascii
+            case NativeNumberMode::NATNUM1:     // Char, Lower
+		return sal_True;
+	    break;
             case NativeNumberMode::NATNUM3:     // Char, FullWidth
-                return sal_True;
+                //return sal_True;
+		return (langnum != 5);
             break;
-            case NativeNumberMode::NATNUM1:     // Char, Lower
-                return (langnum >= 0);
+            //case NativeNumberMode::NATNUM1:     // Char, Lower
+            //    return (langnum >= 0);
             break;
-            case NativeNumberMode::NATNUM2:     // Char, Upper
+            //case NativeNumberMode::NATNUM2:     // Char, Upper
             case NativeNumberMode::NATNUM4:     // Text, Lower, Long
             case NativeNumberMode::NATNUM5:     // Text, Upper, Long
             case NativeNumberMode::NATNUM6:     // Text, FullWidth
+		return ((langnum >= 0 && langnum < 4) || langnum == 5);
+	    break;
+            case NativeNumberMode::NATNUM2:     // Char, Upper
             case NativeNumberMode::NATNUM7:     // Text. Lower, Short
             case NativeNumberMode::NATNUM8:     // Text, Upper, Short
                 return (langnum >= 0 && langnum < 4);
@@ -654,7 +678,12 @@
                     type = attLong;
                 break;
                 case NativeNumberMode::NATNUM5: // Text, Upper, Long
-                    number = natnum2[langnum];
+                    //number = natnum2[langnum];
+		    // if thai language, return number 6 (natnum5 id)
+		    if (langnum == 5)
+			number = 6;
+		    else
+			number = natnum2[langnum];
                     type = attLong;
                 break;
                 case NativeNumberMode::NATNUM6: // Text, FullWidth
Index: i18npool/source/nativenumber/nativenumbersupplier_th.cxx
===================================================================
RCS file: i18npool/source/nativenumber/nativenumbersupplier_th.cxx
diff -N i18npool/source/nativenumber/nativenumbersupplier_th.cxx
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ i18npool/source/nativenumber/nativenumbersupplier_th.cxx	21 Sep 2004 10:04:46 -0000
@@ -0,0 +1,444 @@
+/*************************************************************************
+ *
+ *  $RCSfile: natnum.patch,v $
+ *
+ *  $Revision: 1.1 $
+ *
+ *  last change: $Author: ott $ $Date: 2004-10-18 15:24:32 $
+ *
+ *  The Contents of this file are made available subject to the terms of
+ *  either of the following licenses
+ *
+ *         - GNU Lesser General Public License Version 2.1
+ *         - Sun Industry Standards Source License Version 1.1
+ *
+ *  Sun Microsystems Inc., October, 2000
+ *
+ *  GNU Lesser General Public License Version 2.1
+ *  =============================================
+ *  Copyright 2000 by Sun Microsystems, Inc.
+ *  901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ *  This library is free software; you can redistribute it and/or
+ *  modify it under the terms of the GNU Lesser General Public
+ *  License version 2.1, as published by the Free Software Foundation.
+ *
+ *  This library is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *  Lesser General Public License for more details.
+ *
+ *  You should have received a copy of the GNU Lesser General Public
+ *  License along with this library; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *  MA  02111-1307  USA
+ *
+ *
+ *  Sun Industry Standards Source License Version 1.1
+ *  =================================================
+ *  The contents of this file are subject to the Sun Industry Standards
+ *  Source License Version 1.1 (the "License"); You may not use this file
+ *  except in compliance with the License. You may obtain a copy of the
+ *  License at http://www.openoffice.org/license.html.
+ *
+ *  Software provided under this License is provided on an "AS IS" basis,
+ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ *  See the License for the specific provisions governing your rights and
+ *  obligations concerning the Software.
+ *
+ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ *  Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ *  All Rights Reserved.
+ *
+ *  Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <nativenumbersupplier_th.hxx>
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::lang;
+using namespace ::rtl;
+
+// change number to thai text
+static const sal_Unicode numTextThai0[] = {0xe28, 0xe39, 0xe19, 0xe22, 0xe4c, 0x0};     // Zero
+static const sal_Unicode numTextThai1[] = {0xe2b, 0xe19, 0xe36, 0xe48, 0xe07, 0x0};     // One
+static const sal_Unicode numTextThai2[] = {0xe2a, 0xe2d, 0xe07, 0x0};                           // Two
+static const sal_Unicode numTextThai3[] = {0xe2a, 0xe32, 0xe21, 0x0};                           // Three
+static const sal_Unicode numTextThai4[] = {0xe2a, 0xe35, 0xe48, 0x0};                           // Four
+static const sal_Unicode numTextThai5[] = {0xe2b, 0xe49, 0xe32, 0x0};                           // FIve
+static const sal_Unicode numTextThai6[] = {0xe2b, 0xe01, 0x0};                                          // Six
+static const sal_Unicode numTextThai7[] = {0xe40, 0xe08, 0xe47, 0xe14, 0x0};            // Seven
+static const sal_Unicode numTextThai8[] = {0xe41, 0xe1b, 0xe14, 0x0};                           // Eight
+static const sal_Unicode numTextThai9[] = {0xe40, 0xe01, 0xe49, 0xe32, 0x0};            // Nine
+
+static const sal_Unicode *numTextThaiArray[] = {
+                numTextThai0,
+                numTextThai1,
+                numTextThai2,
+                numTextThai3,
+                numTextThai4,
+                numTextThai5,
+                numTextThai6,
+                numTextThai7,
+                numTextThai8,
+                numTextThai9
+};
+
+static const sal_Unicode numTextThaiSpecail1[] = {0xe40, 0xe2d, 0xe47, 0xe14, 0x0};             // Thai Specail number 1 ('Aid')
+static const sal_Unicode numTextThaiSpecail2[] = {0xe22, 0xe35, 0xe48, 0x0};                    // Thai Specail number 2 ('Yee')
+
+static const sal_Unicode numTextThaiCurrency0[] = {0xe1a, 0xe32, 0xe17, 0x0};                   // Thai Currency unit ('Baht')
+static const sal_Unicode numTextThaiCurrency1[] = {0xe2a, 0xe15, 0xe32, 0xe07, 0xe04, 0xe4c, 0x0};      // Thai Currency unit ('Sa-Tang')
+static const sal_Unicode numTextThaiCurrency2[] = {0xe16, 0xe49, 0xe27, 0xe19, 0x0};                    // Thai Currency unit ('Tuan')
+
+static const sal_Unicode numTextThaiMinus[] = {0xe25, 0xe1a, 0x0};                              // Thai minus text
+static const sal_Unicode numTextThaiDecPoint[] = {0xe08, 0xe38, 0xe14, 0x0};    // Thai decimal point text 
+static const sal_Unicode numTextThaiMultiplier0[] = {0x0};                                                                      //
+static const sal_Unicode numTextThaiMultiplier1[] = {0xe2a, 0xe34, 0xe1a, 0x0};                         // ten
+static const sal_Unicode numTextThaiMultiplier2[] = {0xe23, 0xe49, 0xe2d, 0xe22, 0x0};          // handred
+static const sal_Unicode numTextThaiMultiplier3[] = {0xe1e, 0xe31, 0xe19, 0x0};                         // thousand
+static const sal_Unicode numTextThaiMultiplier4[] = {0xe2b, 0xe21, 0xe37, 0xe48, 0xe19, 0x0};   // ten thousand
+static const sal_Unicode numTextThaiMultiplier5[] = {0xe41, 0xe2a, 0xe19, 0x0};                         // handred thousand
+static const sal_Unicode numTextThaiMultiplier6[] = {0xe25, 0xe49, 0xe32, 0xe19, 0x0};          // million
+
+static const sal_Unicode *numTextThaiMultiplierArray[] = {
+                numTextThaiMultiplier0,
+                numTextThaiMultiplier1,
+                numTextThaiMultiplier2,
+                numTextThaiMultiplier3,
+                numTextThaiMultiplier4,
+                numTextThaiMultiplier5,
+                numTextThaiMultiplier6
+};
+
+namespace com { namespace sun { namespace star { namespace i18n { 
+
+static sal_Bool SAL_CALL isAllZero( const sal_Unicode *inStr, sal_Int32 start, sal_Int32 stop ) throw(RuntimeException)
+{
+		for (sal_Int32 i = start; i < stop; i++) {
+			if (inStr[i] != 0x30) 
+				return false;
+		}
+
+		return true;
+}
+
+static OUString SAL_CALL convertThaiTextNum( const sal_Unicode number ) throw(RuntimeException)
+{
+		OUString thaitext;
+		sal_Unicode ref_number = 0x30;
+		
+		// if found decimal point return decimal point text
+		// other, return number text
+		if ((number == 0x02e) || (number == 0xe3a))
+			thaitext += numTextThaiDecPoint;
+		else
+			thaitext += numTextThaiArray[number - ref_number];
+
+        return thaitext;
+}
+
+OUString SAL_CALL NativeToThaiTextNum( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, 
+        Sequence< sal_Int32 >& offset, sal_Bool useOffset ) throw(RuntimeException)
+{
+        const sal_Unicode *src = inStr.getStr() + startPos;
+		sal_Unicode new_src[MAX_NUMBER_CHARACTOR];
+		OUString thaitext; 
+
+        for (sal_Int32 i = 0; i < nCount; i++) {
+			// filter unicode data
+			// data is unicode number, convert to text
+			if (src[i] >= 0x030 && src[i] <= 0x039)
+				thaitext += convertThaiTextNum(src[i]);
+
+			// data is minus symbol 
+			else if (src[i] == 0x02d)
+				thaitext += numTextThaiMinus;
+
+			// data is dot symbol
+			else if (src[i] == 0x02e)
+				thaitext += numTextThaiDecPoint;
+
+			// other, direct display
+			else {
+				new_src[0] = src[i];
+				new_src[1] = 0x0;
+				thaitext += new_src;
+			}
+
+            if (useOffset)
+  	   	        offset[i] = startPos + i;
+		}
+		
+        return thaitext;
+}
+
+static OUString SAL_CALL convertThaiTextRead( const sal_Unicode number, sal_Int32 digit, sal_Int32 nCount ) throw(RuntimeException)
+{
+		OUString thaitext;
+		sal_Int32 new_digit;
+		sal_Unicode ref_number = 0x30;
+		
+		// find digit of number for add exponent value
+		// 1 = ten
+		// 2 = handred
+		// 3 = thousand
+		// 4 = ten thousand
+		// 5 = handred thousand
+		if (digit <= 6) 
+			new_digit = digit;
+		else {
+			new_digit = digit % 6;
+			if (new_digit == 0) 
+				new_digit = 6;
+		}
+
+		// check zero	
+		if (number == ref_number && nCount == 1) {
+			thaitext += numTextThaiArray[number - ref_number];
+		}
+		else if (number > ref_number ) { 	// except zero
+			// check number 1
+			if (number == (ref_number+1)) {
+				// if in digit 1 and have more number use 'Aid' text
+				// other use normal text
+				if (new_digit == 1)
+					if (digit < nCount)
+						thaitext += numTextThaiSpecail1;
+					else
+						thaitext += numTextThaiArray[number - ref_number];
+				// if not digit 1 use normal text
+				else if (new_digit != 2)
+					thaitext += numTextThaiArray[number - ref_number];
+			}
+			// check number 2
+			else if (number == (ref_number+2)) {
+				// if in digit 2 and have more number use 'Yee' text
+				// other use normal text				
+				if(new_digit == 2)
+					thaitext += numTextThaiSpecail2;
+				else
+					thaitext += numTextThaiArray[number - ref_number];
+			}
+			else
+				thaitext += numTextThaiArray[number - ref_number];
+				
+			// Add Exponent	text value
+			thaitext += numTextThaiMultiplierArray[new_digit - 1];
+		}
+		// if value is 10^6 use 'million
+		if ((digit > 6) && ((digit % 6)== 1)) {
+			thaitext += numTextThaiMultiplierArray[6];
+		}
+														
+        return thaitext;
+}
+
+static OUString SAL_CALL nativeToThaiTextRead( const sal_Unicode *src, sal_Int32 startPos, sal_Int32 nCount ) throw(RuntimeException)
+{
+		sal_Int32 i, decpoint;
+		OUString thaitext; 
+		sal_Unicode DecimalNumber[MAX_NUMBER_CHARACTOR];
+
+		// clear decimal variable		
+		for (i = 0; i< nCount; i++) {
+			DecimalNumber[i] = 0x030;
+		}
+				
+		// find decimal value section from string
+		decpoint = nCount;
+		for (i = 0; i < nCount; i++) {
+			if (!(src[i] == 0x02e) || (src[i] == 0xe3a))
+				DecimalNumber[i] = src[i];
+			else {
+				decpoint = i;
+				break;
+			}
+		}
+
+		// find fraction value section from string
+		sal_Unicode FractionNumber[MAX_NUMBER_CHARACTOR];
+		// clear fraction variable		
+		for (i = 0; i< (nCount - decpoint); i++) {
+			FractionNumber[i] = 0x030;
+		}
+		
+		// find fraction value section from string	
+		for (i = decpoint; i < nCount; i++) {
+			FractionNumber[i - decpoint] = src[i];
+		}
+		
+		// convert number to thai text in decimal section
+        	for (i = 0; i < decpoint; i++) {
+			thaitext += convertThaiTextRead(DecimalNumber[i], decpoint-i, decpoint);
+			
+		}
+
+		// check all zero number
+		// if all number is zero, skip function 
+		if (!isAllZero(FractionNumber, 1, (nCount - decpoint)) ) {
+
+			// convert number to thai text in fraction section
+			for (i = decpoint; i < nCount; i++) {
+	
+				// check zero number in next position
+				// if all position is zero, not translation to text and exit 
+				// other, translation 
+				if (!isAllZero(FractionNumber, (i - decpoint), (nCount - decpoint)))
+					thaitext += convertThaiTextNum(FractionNumber[i - decpoint]);
+			
+			}
+		}
+	
+        return thaitext;
+}
+
+static OUString SAL_CALL nativeToThaiBahtText( const sal_Unicode *src, sal_Int32 startPos, sal_Int32 nCount ) throw(RuntimeException)
+{
+		sal_Int32 i, decpoint;
+		OUString thaitext; 
+		sal_Unicode DecimalNumber[MAX_NUMBER_CHARACTOR];
+		
+		// clear decimal variable		
+		for (i = 0; i< nCount; i++) {
+			DecimalNumber[i] = 0x030;
+		}
+				
+		// find decimal value section from string
+		decpoint = nCount;
+		for (i = 0; i < nCount; i++) {
+			if (!(src[i] == 0x02e || src[i] == 0xe3a))
+				DecimalNumber[i] = src[i];
+			else {
+				decpoint = i;
+				break;
+			}
+		}
+
+		sal_Unicode FractionNumber[MAX_NUMBER_CHARACTOR];
+		sal_Int32 fCount;
+		sal_Bool firstZero = true;
+		// clear fraction variable		
+		for (i = 0; i< (nCount - decpoint); i++) {
+			FractionNumber[i] = 0x030; 
+		}
+				
+		// find fraction value section from string	
+		// and delete zero number in front data
+		fCount = 0;
+		for (i = decpoint; i < nCount; i++) {
+			if (src[i] != 0x030 || firstZero == false) {
+				FractionNumber[fCount] = src[i];
+				fCount++;
+				
+				if (src[i] != 0x02e)	
+					firstZero = false;
+			}
+		}
+
+		// convert number to thai text in decimal section
+        	for (i = 0; i < decpoint; i++) {
+			thaitext += convertThaiTextRead(DecimalNumber[i], decpoint - i, decpoint);
+		}
+		
+		// put a thai Currency unit ('Baht')
+		thaitext += numTextThaiCurrency0;
+		if ((nCount == decpoint) || isAllZero(FractionNumber, 1, (nCount - decpoint)))
+			// put a thai Currency unit ('Tuan')
+			thaitext += numTextThaiCurrency2;
+			
+		else {
+			// convert number to thai text in decimal section
+			sal_Int32 j = 1;
+	        for (i = decpoint + 1; i < nCount; i++) {
+				if (j < fCount) {
+					thaitext += convertThaiTextRead(FractionNumber[j], fCount - j, fCount -1);
+					j++;
+				}
+			}
+			// put a thai Currency unit ('Sa-Tang')
+			thaitext += numTextThaiCurrency1;
+		}
+
+		return thaitext;
+}
+
+OUString SAL_CALL NativeToThaiText( const OUString& inStr, sal_Int32 startPos, sal_Int32 nCount, 
+        Sequence< sal_Int32 >& offset, sal_Bool useOffset ,sal_Int16 convertMode) throw(RuntimeException)
+{
+        const sal_Unicode *src = inStr.getStr() + startPos;
+		sal_Unicode new_src[MAX_NUMBER_CHARACTOR];
+		sal_Int32 i,dCount;
+		sal_Bool num_flag = false;
+		OUString thaitext; 		
+
+		dCount = 0;
+        for (i = 0; i < nCount; i++) {
+			// filter unicode data
+			// data is unicode number, convert to text
+			if ((src[i] >= 0x030 && src[i] <= 0x039) || src[i] == 0x02e) {
+				new_src[dCount] = src[i];
+				
+				num_flag = true;
+				dCount++;
+			}
+			// data is minus symbol 
+			else if (src[i] == 0x02d) {
+				thaitext += numTextThaiMinus;
+				num_flag = false;
+				dCount = 0;
+			}
+			// data is dot symbol
+			/*
+			else if (src[i] == 0x02e) {
+				thaitext += numTextThaiDecPoint;
+				num_flag = false;
+				dCount = 0;
+			}
+			*/
+			// data is comma and thai bath symbol
+			// skip it
+			else if (src[i] == 0x02c || src[i] == 0xe3f) {
+				num_flag = false;
+				//dCount = 0;
+			}
+			// other, direct display
+			else {
+				new_src[0] = src[i];
+				new_src[1] = 0x0;
+				thaitext += new_src;
+
+				num_flag = false;
+				dCount = 0;
+			}
+
+			// check for convert number to text
+			if (dCount > 0 && num_flag == true) {
+				// check next character 
+				// if not number or dot convert
+				// other skip
+				if (!((src[i + 1] >= 0x030 && src[i + 1] <= 0x039) || 
+				    src[i + 1] == 0x02e || src[i + 1] == 0xe3a) && 
+				    src[i + 1] != 0x02c && src[i + 1] != 0xe3f) {
+					if (convertMode == 0)	// Thai read mode
+						thaitext += nativeToThaiTextRead(new_src, 0, dCount);
+					else if (convertMode == 1)	// Thai Bahttext mode
+						thaitext += nativeToThaiBahtText(new_src, 0, dCount);
+				}
+			}
+
+            if (useOffset)
+  	   	        offset[i] = startPos + i;
+		}
+	
+        return thaitext;
+}
+
+} } } }
