[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - i18npool/source

2016-01-11 Thread Jingtao Yan
 i18npool/source/collator/collator_unicode.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9059f747c50eaf99a3c065f90b598208edbcb86b
Author: Jingtao Yan 
Date:   Thu Jan 7 10:28:31 2016 -0500

tdf#95494 Calc can not sort Chinese word by stroke and radical,

_length must at the tail of filename.

Change-Id: I434e89bf052d8f3130bfca62d71eaf8588c2bac9
Reviewed-on: https://gerrit.libreoffice.org/21213
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit 1b683de366f4caf82225c632f02cf0f58ae76490)
Reviewed-on: https://gerrit.libreoffice.org/21368

diff --git a/i18npool/source/collator/collator_unicode.cxx 
b/i18npool/source/collator/collator_unicode.cxx
index 3eb93f3..9ef6548 100644
--- a/i18npool/source/collator/collator_unicode.cxx
+++ b/i18npool/source/collator/collator_unicode.cxx
@@ -156,20 +156,20 @@ Collator_Unicode::loadCollatorAlgorithm(const OUString& 
rAlgorithm, const lang::
 
aBuf.appendAscii("get_").append(rLocale.Language).appendAscii("_");
 if ( rLocale.Language == "zh" ) {
 OUString func_base = aBuf.makeStringAndClear();
-OUString funclen_base = func_base + "_length";
+OUString funclen_base = func_base;
 if (OUString("TW HK MO").indexOf(rLocale.Country) >= 0)
 {
 func = reinterpret_cast(osl_getFunctionSymbol(hModule,
 OUString(func_base + "TW_" + 
rAlgorithm).pData));
 funclen = reinterpret_cast(osl_getFunctionSymbol(hModule,
-OUString(funclen_base + "TW_" + 
rAlgorithm).pData));
+OUString(funclen_base + "TW_" + rAlgorithm 
+ "_length").pData));
 }
 if (!func)
 {
 func = reinterpret_cast(osl_getFunctionSymbol(
 hModule, OUString(func_base + 
rAlgorithm).pData));
 funclen = reinterpret_cast(osl_getFunctionSymbol(
-hModule, OUString(funclen_base + 
rAlgorithm).pData));
+hModule, OUString(funclen_base + rAlgorithm + 
"_length").pData));
 }
 } else {
 if ( rLocale.Language == "ja" ) {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - i18npool/source

2015-11-26 Thread Eike Rathke
 i18npool/source/search/textsearch.cxx |   36 --
 1 file changed, 22 insertions(+), 14 deletions(-)

New commits:
commit a38963a40eed7f1d85767b393a316870c31bff5c
Author: Eike Rathke 
Date:   Wed Nov 25 15:58:01 2015 +0100

regex result offsets can be negative if a group was not matched, tdf#94810

"(abc)|(def)" matches "def" with result offset sequences
{0,-1,0},{3,-1,3}

And thus the assert() calls introduced with
4cf1d290bab29e18e1312b63ff862f5102e00387 and
ce91f3c1292f3e9b84157acf10b67ad9ca16719d were hit.

Change-Id: I571b6c7d47349a2cc7b1d1e34193b2865012a49f
(cherry picked from commit 4dd2d40673299966ad639d799e925e64ae5560cf)
Reviewed-on: https://gerrit.libreoffice.org/20174
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 

diff --git a/i18npool/source/search/textsearch.cxx 
b/i18npool/source/search/textsearch.cxx
index 472d509..97cceee 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -301,18 +301,22 @@ SearchResult TextSearch::searchForward( const OUString& 
searchStr, sal_Int32 sta
 for ( sal_Int32 k = 0; k < nGroups; k++ )
 {
 const sal_Int32 nStart = sres.startOffset[k] - nExtraOffset;
-assert(nStart >= 0);
-sres.startOffset[k] = (nStart < nOffsets ? offset[nStart] : 
(offset[nOffsets - 1] + 1));
+// Result offsets are negative (-1) if a group expression was
+// not matched.
+if (nStart >= 0)
+sres.startOffset[k] = (nStart < nOffsets ? offset[nStart] 
: (offset[nOffsets - 1] + 1));
 // JP 20.6.2001: end is ever exclusive and then don't return
 //   the position of the next character - return 
the
 //   next position behind the last found character!
 //   "a b c" find "b" must return 2,3 and not 
2,4!!!
 const sal_Int32 nStop = sres.endOffset[k] - nExtraOffset;
-assert(nStop >= 0);
-if (nStop > 0)
-sres.endOffset[k] = offset[(nStop <= nOffsets ? nStop : 
nOffsets) - 1] + 1;
-else
-sres.endOffset[k] = offset[0];
+if (nStop >= 0)
+{
+if (nStop > 0)
+sres.endOffset[k] = offset[(nStop <= nOffsets ? nStop 
: nOffsets) - 1] + 1;
+else
+sres.endOffset[k] = offset[0];
+}
 }
 }
 }
@@ -404,18 +408,22 @@ SearchResult TextSearch::searchBackward( const OUString& 
searchStr, sal_Int32 st
 for ( sal_Int32 k = 0; k < nGroups; k++ )
 {
 const sal_Int32 nStart = sres.startOffset[k];
-assert(nStart >= 0);
-if (nStart > 0)
-sres.startOffset[k] = offset[(nStart <= nOffsets ? nStart 
: nOffsets) - 1] + 1;
-else
-sres.startOffset[k] = offset[0];
+// Result offsets are negative (-1) if a group expression was
+// not matched.
+if (nStart >= 0)
+{
+if (nStart > 0)
+sres.startOffset[k] = offset[(nStart <= nOffsets ? 
nStart : nOffsets) - 1] + 1;
+else
+sres.startOffset[k] = offset[0];
+}
 // JP 20.6.2001: end is ever exclusive and then don't return
 //   the position of the next character - return 
the
 //   next position behind the last found character!
 //   "a b c" find "b" must return 2,3 and not 
2,4!!!
 const sal_Int32 nStop = sres.endOffset[k];
-assert(nStop >= 0);
-sres.endOffset[k] = (nStop < nOffsets ? offset[nStop] : 
(offset[nOffsets - 1] + 1));
+if (nStop >= 0)
+sres.endOffset[k] = (nStop < nOffsets ? offset[nStop] : 
(offset[nOffsets - 1] + 1));
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - i18npool/source

2015-10-30 Thread Eike Rathke
 i18npool/source/localedata/data/vec_IT.xml |  191 +++--
 1 file changed, 99 insertions(+), 92 deletions(-)

New commits:
commit 79e98696ae3b14d77ed7975fe2e0d63c7d777528
Author: Eike Rathke 
Date:   Thu Oct 29 14:33:47 2015 +0100

use separators and number formats as in [it-IT], tdf#91199 follow-up

Can't use ref="it_IT" because it-IT is one of the legacy locales that
has localized format codes, sigh..

(cherry picked from commit c6e6909672486b8552c6a5b051ce0fb91ba60f1f)

add missing license header

(cherry picked from commit 326b21356784a382a3880835f5f24353730e4e30)

f8503566d02b2e2de51acc21f33042b9cc23b059

Change-Id: I3ce88e80f17e626bc4fc4849795e2c9893261dc3
Reviewed-on: https://gerrit.libreoffice.org/19670
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/i18npool/source/localedata/data/vec_IT.xml 
b/i18npool/source/localedata/data/vec_IT.xml
index ae63285..705e1aa 100644
--- a/i18npool/source/localedata/data/vec_IT.xml
+++ b/i18npool/source/localedata/data/vec_IT.xml
@@ -1,5 +1,22 @@
 
 
+
 
   
 
@@ -11,16 +28,16 @@
   Italy
 
   
-  
+  
 
   /
-  ,
-  .
-  :
-  .
+  .
+  ,
+  .
+  ,
   ;
-  , 
-  , 
+   
+   


 
@@ -30,154 +47,153 @@
   “
   ”
 
-AM
-PM
+m.
+p.
 metric
   
   
-M/D
+D/M
 
-  General
+  Standard
 
 
   0
 
 
-  0.00
+  0,00
 
 
-  #,##0
+  #.##0
 
 
-  #,##0.00
+  #.##0,00
 
 
-  #,###.00
+  #.###,00
 
-
-  0.00E+00
+
+  0,00E+000
 
-
-  0.00E+000
+
+  0,00E+00
+
+
+  ##0,00E+00
 
 
   0%
 
 
-  0.00%
+  0,00%
 
 
-  [CURRENCY] #,##0;-[CURRENCY] #,##0
+  [CURRENCY] #.##0;-[CURRENCY] #.##0
 
 
-  [CURRENCY] #,##0.00;-[CURRENCY] #,##0.00
+  [CURRENCY] #.##0;-[CURRENCY] #.##0
 
 
-  [CURRENCY] #,##0;[RED]-[CURRENCY] #,##0
+  [CURRENCY] #.##0;[RED]-[CURRENCY] #.##0
 
 
-  [CURRENCY] #,##0.00;[RED]-[CURRENCY] #,##0.00
+  [CURRENCY] #.##0;[RED]-[CURRENCY] #.##0
 
 
-  #,##0.00 CCC
+  #.##0 CCC
 
 
-  [CURRENCY] #,##0.--;[RED]-[CURRENCY] #,##0.--
+  [CURRENCY] #.##0;[RED]-[CURRENCY] #.##0
 
-
-  YY/MM/DD
+
+  DD/MM/YY
 
-
-  DD,  
+
+  DD  
 
-
-  YY/MM/DD
+
+  DD/MM/YY
 
-
-  /MM/DD
+
+  DD/MM/
 
-
-  D, MMM YY
+
+  D MMM YY
 
-
-  D, MMM 
+
+  D MMM 
 
-
-  D, MMM 
+
+  D. MMM. 
 
-
-  D,  
+
+  D  
 
-
-  D,  
+
+  D.  
 
-
-  NN, DD/MMM/YY
+
+  NN D MMM YY
 
-
-  NN, D, MMM YY
+
+  NN DD/MMM YY
 
-
-  NN, D,  
+
+  NN D  
 
-
-  D,  
+
+  D  
 
-
-  MM/DD
+
+  MM-DD
 
-
+
   YY-MM-DD
-  ISO 8601
 
-
+
   -MM-DD
-  ISO 8601
+  ISO 8601 (EN 28601)
 
-
-  YY/MM
+
+  MM/YY
 
-
-  MMM/DD
+
+  DD/MMM
 
-
+
   
 
-
+
   QQ YY
 
-
+
   WW
 
-
-  HH:MM
+
+  HH.MM
 
-
-  HH:MM:SS
+
+  HH.MM.SS
 
-
-  HH:MM AM/PM
+
+  HH.MM AM/PM
 
-
-  HH:MM:SS AM/PM
+
+  HH.MM.SS AM/PM
 
 
-  [HH]:MM:SS
+  [HH].MM.SS
 
 
-  MM:SS.00
+  MM.SS,00
 
 
-  [HH]:MM:SS.00
+  [HH].MM.SS,00
 
 
-  YY/MM/DD HH:MM
+  DD/MM/YY HH.MM
 
 
-  /MM/DD HH:MM:SS AM/PM
-
-
-  ##0.00E+00
+  DD/MM/ HH.MM.SS
 
   
   
@@ -347,16 +363,7 @@
   C4
 
   
-  
-
-
-
-
-
-
-
-
-  
-  
+  
+  
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - i18npool/source

2015-06-05 Thread Eike Rathke
 i18npool/source/localedata/LocaleNode.cxx |   18 ++
 1 file changed, 18 insertions(+)

New commits:
commit ab67914eac41cc72bfae7c99b1a80d0f6b5d1b96
Author: Eike Rathke er...@redhat.com
Date:   Fri Jun 5 14:10:31 2015 +0200

ensure engineering notation format is present

We could generate that in the number formatter, but as long as we don't ...

Change-Id: Icbbad4215fdf7f3a94f652c27cb2f9b04205b519
(cherry picked from commit f672c8cc0d5227ab3484e20322f20dd4ee35ed96)

diff --git a/i18npool/source/localedata/LocaleNode.cxx 
b/i18npool/source/localedata/LocaleNode.cxx
index 8ef4149..89325ae 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -659,6 +659,7 @@ void LCFormatNode::generateCode (const OFileWriter of) 
const
 ValueSet aFormatIndexSet;
 NameSet  aDefaultsSet;
 bool bCtypeIsRef = false;
+bool bHaveEngineering = false;
 
 for (sal_Int16 i = 0; i getNumberOfChildren() ; i++, formatCount++)
 {
@@ -805,6 +806,20 @@ void LCFormatNode::generateCode (const OFileWriter of) 
const
 incErrorInt( Error: [CURRENCY] replaceTo not 
found for formatindex=\%d\.\n, formatindex);
 }
 break;
+default:
+if (aUsage == SCIENTIFIC_NUMBER)
+{
+// Check for presence of  ##0.00E+00
+OUString aCode( n-getValue());
+// Simple check without decimal separator (assumed to
+// be one UTF-16 character). May be prefixed with
+// [NatNum1] or other tags.
+sal_Int32 nInt = aCode.indexOf(##0);
+sal_Int32 nDec = (nInt  0 ? -1 : 
aCode.indexOf(00E+00, nInt));
+if (nInt = 0  nDec == nInt+4)
+bHaveEngineering = true;
+}
+break;
 }
 if (pCtype)
 {
@@ -947,6 +962,9 @@ void LCFormatNode::generateCode (const OFileWriter of) 
const
 ;   // nothing
 }
 }
+
+if (!bHaveEngineering)
+incError(Engineering notation format not present, e.g. ##0.00E+00 
or ##0,00E+00 for usage=\SCIENTIFIC_NUMBER\\n);
 }
 
 of.writeAsciiString(\nstatic const sal_Int16 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - i18npool/source

2015-05-27 Thread Juergen Funk
 i18npool/source/breakiterator/breakiterator_th.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 489c46007447a4cae76379c4b3153957998afd65
Author: Juergen Funk juergen.funk...@cib.de
Date:   Wed May 27 09:34:25 2015 +0200

Include missing in Windows build

for the std::min we need the header algorithm

Change-Id: I83d815e1fe8a7221c0eade58df5af887d5a9795a
Reviewed-on: https://gerrit.libreoffice.org/15921
Reviewed-by: Miklos Vajna vmik...@collabora.co.uk
Tested-by: Jenkins c...@libreoffice.org

diff --git a/i18npool/source/breakiterator/breakiterator_th.cxx 
b/i18npool/source/breakiterator/breakiterator_th.cxx
index 08a9400..a685427 100644
--- a/i18npool/source/breakiterator/breakiterator_th.cxx
+++ b/i18npool/source/breakiterator/breakiterator_th.cxx
@@ -21,6 +21,7 @@
 #include wtt.h
 
 #include string.h
+#include algorithm
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - i18npool/source

2015-05-22 Thread Michael Stahl
 i18npool/source/breakiterator/breakiterator_th.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 7f49a466e85b5f5866e6af28d84ed06697e49d20
Author: Michael Stahl mst...@redhat.com
Date:   Fri May 22 20:53:05 2015 +0200

tdf#90809: i18npool: fix crash in Thai break iterator

endPos = nStartPos + 1 may be past the end index

invalid write of size 4
 at 0x1CBBA959: 
com::sun::star::i18n::BreakIterator_th::makeIndex(rtl::OUString const, int) 
(breakiterator_th.cxx:139)
 by 0x1CBB4AA2: 
com::sun::star::i18n::BreakIterator_CTL::previousCharacters(rtl::OUString 
const, int, com::sun::star::lang::Locale const, short, int, int) 
(breakiterator_ctl.cxx:61)
 by 0x1CBB544F: 
com::sun::star::i18n::BreakIteratorImpl::previousCharacters(rtl::OUString 
const, int, com::sun::star::lang::Locale const, short, int, int) 
(breakiteratorImpl.cxx:64)
 by 0xA29D29A: ServerFontLayout::setNeedFallback(ImplLayoutArgs, int, 
bool) (gcach_layout.cxx:99)

Change-Id: I201f24cb6773b5aa1a81dea90ea906d3d4355053
(cherry picked from commit 9db629b8a1fa9b63bc320f8d47594ec82511a9c5)

diff --git a/i18npool/source/breakiterator/breakiterator_th.cxx 
b/i18npool/source/breakiterator/breakiterator_th.cxx
index 17a51ea..08a9400 100644
--- a/i18npool/source/breakiterator/breakiterator_th.cxx
+++ b/i18npool/source/breakiterator/breakiterator_th.cxx
@@ -103,7 +103,7 @@ static sal_Int32 SAL_CALL getACell(const sal_Unicode *text, 
sal_Int32 pos, sal_I
 
 #define is_Thai(c)  (0x0e00 = c  c = 0x0e7f) // Unicode definition for Thai
 
-void SAL_CALL BreakIterator_th::makeIndex(const OUString Text, sal_Int32 
nStartPos)
+void SAL_CALL BreakIterator_th::makeIndex(const OUString Text, sal_Int32 
const nStartPos)
 throw(RuntimeException)
 {
 if (Text != cachedText) {
@@ -123,18 +123,20 @@ void SAL_CALL BreakIterator_th::makeIndex(const OUString 
Text, sal_Int32 nStart
 return;
 
 const sal_Unicode* str = cachedText.getStr();
-sal_Int32 len = cachedText.getLength(), startPos, endPos;
+sal_Int32 const len = cachedText.getLength();
 
-startPos = nStartPos;
+sal_Int32 startPos = nStartPos;
 while (startPos  0  is_Thai(str[startPos-1])) startPos--;
-endPos = nStartPos+1;
+sal_Int32 endPos = std::min(len, nStartPos+1);
 while (endPos  len  is_Thai(str[endPos])) endPos++;
 
 sal_Int32 start, end, pos;
 pos = start = end = startPos;
 
+assert(endPos = cellIndexSize);
 while (pos  endPos) {
 end += getACell(str, start, endPos);
+assert(end = cellIndexSize);
 while (pos  end) {
 nextCellIndex[pos] = end;
 previousCellIndex[pos] = start;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits