[Libreoffice-commits] .: 2 commits - i18npool/qa i18npool/source package/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 28 05:26:57 PDT 2012


 i18npool/qa/cppunit/test_breakiterator.cxx  |   40 ++++++++++++++++++++++++++++
 i18npool/source/breakiterator/data/README   |    8 -----
 package/source/zipapi/XUnbufferedStream.cxx |    4 ++
 3 files changed, 45 insertions(+), 7 deletions(-)

New commits:
commit e2f3312ea2e547fbca7e131ed7824b1de4573b43
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 28 13:05:47 2012 +0100

    throw earlier on broken zip streams
    
    Change-Id: I0de705b4c6a9176e98baed21b2cd960d4d091563

diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx
index 9f289ba..d028c14 100644
--- a/package/source/zipapi/XUnbufferedStream.cxx
+++ b/package/source/zipapi/XUnbufferedStream.cxx
@@ -78,6 +78,10 @@ XUnbufferedStream::XUnbufferedStream(
         mnZipSize = maEntry.nSize;
         mnZipEnd = maEntry.nMethod == DEFLATED ? maEntry.nOffset + maEntry.nCompressedSize : maEntry.nOffset + maEntry.nSize;
     }
+
+    if (mnZipSize < 0)
+        throw ZipIOException(OUString("The stream seems to be broken!"), uno::Reference< XInterface >());
+
     sal_Bool bHaveEncryptData = ( rData.is() && rData->m_aSalt.getLength() && rData->m_aInitVector.getLength() && rData->m_nIterationCount != 0 ) ? sal_True : sal_False;
     sal_Bool bMustDecrypt = ( nStreamMode == UNBUFF_STREAM_DATA && bHaveEncryptData && bIsEncrypted ) ? sal_True : sal_False;
 
commit 8c205bfccdf625d70cfc9fcf617f89548c1521b1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Aug 28 12:14:15 2012 +0100

    Related: #i58513# add regression test for Finnish break iterator rules
    
    Change-Id: I5b8c1190db08f781143fd8d12b007dc05a4d6046

diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx
index e03fbe4..52dc05f 100644
--- a/i18npool/qa/cppunit/test_breakiterator.cxx
+++ b/i18npool/qa/cppunit/test_breakiterator.cxx
@@ -487,6 +487,46 @@ void TestBreakIterator::testWordBoundaries()
         while (nPos++ < aTest.getLength());
         CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
     }
+
+    //See https://issues.apache.org/ooo/show_bug.cgi?id=58513
+    {
+        aLocale.Language = "fi";
+        aLocale.Country = "FI";
+
+        rtl::OUString aTest("Kuorma-auto kaakkois- ja Keski-Suomi");
+
+        {
+            sal_Int32 nPos = 0;
+            sal_Int32 aExpected[] = {12, 22, 25, 36};
+            size_t i = 0;
+            do
+            {
+                CPPUNIT_ASSERT(i < SAL_N_ELEMENTS(aExpected));
+                nPos = m_xBreak->getWordBoundary(aTest, nPos, aLocale,
+                    i18n::WordType::WORD_COUNT, true).endPos;
+                CPPUNIT_ASSERT(aExpected[i++] == nPos);
+            }
+            while (nPos++ < aTest.getLength());
+            CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
+        }
+
+        {
+            sal_Int32 nPos = 0;
+            sal_Int32 aExpected[] = {0, 11, 12, 21, 22, 24, 25, 36};
+            size_t i = 0;
+            do
+            {
+                CPPUNIT_ASSERT(i < SAL_N_ELEMENTS(aExpected));
+                aBounds = m_xBreak->getWordBoundary(aTest, nPos, aLocale,
+                    i18n::WordType::DICTIONARY_WORD, true);
+                CPPUNIT_ASSERT(aExpected[i++] == aBounds.startPos);
+                CPPUNIT_ASSERT(aExpected[i++] == aBounds.endPos);
+                nPos = aBounds.endPos;
+            }
+            while (nPos++ < aTest.getLength());
+            CPPUNIT_ASSERT(i == SAL_N_ELEMENTS(aExpected));
+        }
+    }
 }
 
 //See http://qa.openoffice.org/issues/show_bug.cgi?id=111152
diff --git a/i18npool/source/breakiterator/data/README b/i18npool/source/breakiterator/data/README
index e50b061..7d67cf0 100644
--- a/i18npool/source/breakiterator/data/README
+++ b/i18npool/source/breakiterator/data/README
@@ -354,13 +354,6 @@ Date:   Tue Oct 24 12:53:13 2006 +0000
     INTEGRATION: CWS tl29 (1.12.24); FILE MERGED
     2006/09/20 01:24:53 khong 1.12.24.1: #i69482# fixed mismatch of nextWord and getWordBoundary
 
-commit be43820c99d96a9e03e2ec5871f6259283b53b58
-Author: Rüdiger Timm <rt at openoffice.org>
-Date:   Thu May 4 08:11:17 2006 +0000
-
-    INTEGRATION: CWS locales203 (1.1.2); FILE ADDED
-    2006/04/25 22:47:02 khong 1.1.2.1: #i58513 add break iterator rules for Finish
-
 commit 97d89862a2285071202cc8010d888ffcbf96279a
 Author: Jens-Heiner Rechtien <hr at openoffice.org>
 Date:   Thu Nov 17 19:30:35 2005 +0000
@@ -592,6 +585,7 @@ Date:   Mon Mar 8 16:17:05 2004 +0000
 
 done, regression tests added:
 
+#i58513# add break iterator rules for Finish
 #i19716# fix wrong line break on bracket characters
 #i21290# extend Greek script type
 #i21907# fix isBeginWord and isEndWord problem


More information about the Libreoffice-commits mailing list