textconversion_zh.cxx (b6943fcf) textconversion_zh.cxx (4674bdb9)
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

--- 70 unchanged lines hidden (view full) ---

79 Data = ((const sal_Unicode* (*)())getFunctionBySymbol("getSTC_CharData_S2T"))();
80 Index = ((const sal_uInt16* (*)())getFunctionBySymbol("getSTC_CharIndex_S2T"))();
81 }
82
83 rtl_uString * newStr = x_rtl_uString_new_WithLength( nLength ); // defined in x_rtl_ustring.h
84 for (sal_Int32 i = 0; i < nLength; i++)
85 newStr->buffer[i] =
86 getOneCharConversion(aText[nStartPos+i], Data, Index);
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

--- 70 unchanged lines hidden (view full) ---

79 Data = ((const sal_Unicode* (*)())getFunctionBySymbol("getSTC_CharData_S2T"))();
80 Index = ((const sal_uInt16* (*)())getFunctionBySymbol("getSTC_CharIndex_S2T"))();
81 }
82
83 rtl_uString * newStr = x_rtl_uString_new_WithLength( nLength ); // defined in x_rtl_ustring.h
84 for (sal_Int32 i = 0; i < nLength; i++)
85 newStr->buffer[i] =
86 getOneCharConversion(aText[nStartPos+i], Data, Index);
87 return OUString( newStr, SAL_NO_ACQUIRE);
87 return OUString( newStr, SAL_NO_ACQUIRE ); // take over ownership of <newStr>
88}
89
90OUString SAL_CALL
91TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, sal_Bool toSChinese, sal_Int32 nConversionOptions, Sequence<sal_Int32>& offset)
92{
93 sal_Int32 dictLen = 0;
94 sal_Int32 maxLen = 0;
95 const sal_uInt16 *index;

--- 113 unchanged lines hidden (view full) ---

209 offset[count]=nStartPos+currPos;
210 newStr->buffer[count++] =
211 getOneCharConversion(aText[nStartPos+currPos], charData, charIndex);
212 currPos++;
213 }
214 }
215 if (offset.getLength() > 0)
216 offset.realloc(one2one ? 0 : count);
88}
89
90OUString SAL_CALL
91TextConversion_zh::getWordConversion(const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength, sal_Bool toSChinese, sal_Int32 nConversionOptions, Sequence<sal_Int32>& offset)
92{
93 sal_Int32 dictLen = 0;
94 sal_Int32 maxLen = 0;
95 const sal_uInt16 *index;

--- 113 unchanged lines hidden (view full) ---

209 offset[count]=nStartPos+currPos;
210 newStr->buffer[count++] =
211 getOneCharConversion(aText[nStartPos+currPos], charData, charIndex);
212 currPos++;
213 }
214 }
215 if (offset.getLength() > 0)
216 offset.realloc(one2one ? 0 : count);
217 return OUString( newStr->buffer, count);
217 OUString resultStr( newStr->buffer, count );
218 x_rtl_uString_release( newStr );
219 return resultStr;
218}
219
220TextConversionResult SAL_CALL
221TextConversion_zh::getConversions( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength,
222 const Locale& rLocale, sal_Int16 nConversionType, sal_Int32 nConversionOptions)
223 throw( RuntimeException, IllegalArgumentException, NoSupportException )
224{
225 TextConversionResult result;

--- 67 unchanged lines hidden ---
220}
221
222TextConversionResult SAL_CALL
223TextConversion_zh::getConversions( const OUString& aText, sal_Int32 nStartPos, sal_Int32 nLength,
224 const Locale& rLocale, sal_Int16 nConversionType, sal_Int32 nConversionOptions)
225 throw( RuntimeException, IllegalArgumentException, NoSupportException )
226{
227 TextConversionResult result;

--- 67 unchanged lines hidden ---