i18npool/inc/xdictionary.hxx                            |    2 -
 i18npool/source/breakiterator/breakiterator_unicode.cxx |    2 -
 i18npool/source/breakiterator/xdictionary.cxx           |   19 ----------------
 3 files changed, 1 insertion(+), 22 deletions(-)

New commits:
commit 997d1387abcfa40eca8d15a2fe025edc4a1de040
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed Sep 10 16:38:07 2014 +0100

    Revert "fdo#81272 Speed up break iterators"
    
    hmm, make CppunitTest_i18npool_test_breakiterator fails after all
    
    This reverts commit 693f72384e081429cddb29415276cc4d07b05645.

diff --git a/i18npool/inc/xdictionary.hxx b/i18npool/inc/xdictionary.hxx
index f7c0110..57f5238 100644
--- a/i18npool/inc/xdictionary.hxx
+++ b/i18npool/inc/xdictionary.hxx
@@ -76,8 +76,6 @@ public:
 
 private:
     WordBreakCache cache[CACHE_MAX];
-    OUString segmentCachedString;
-    Boundary segmentCachedBoundary;
 
     bool        seekSegment(const OUString& rText, sal_Int32 pos, Boundary& 
boundary);
     WordBreakCache& getCache(const sal_Unicode *text, Boundary& boundary);
diff --git a/i18npool/source/breakiterator/breakiterator_unicode.cxx 
b/i18npool/source/breakiterator/breakiterator_unicode.cxx
index 658d4ff..5270b1d 100644
--- a/i18npool/source/breakiterator/breakiterator_unicode.cxx
+++ b/i18npool/source/breakiterator/breakiterator_unicode.cxx
@@ -185,7 +185,7 @@ void SAL_CALL 
BreakIterator_Unicode::loadICUBreakIterator(const com::sun::star::
         }
     }
 
-    if (newBreak || icuBI->aICUText.pData != rText.pData)
+    if (newBreak || !icuBI->aICUText.equals(rText))
     {
         // UChar != sal_Unicode in MinGW
         const UChar *pText = reinterpret_cast<const UChar *>(rText.getStr());
diff --git a/i18npool/source/breakiterator/xdictionary.cxx 
b/i18npool/source/breakiterator/xdictionary.cxx
index 95e1cc9..1067e33 100644
--- a/i18npool/source/breakiterator/xdictionary.cxx
+++ b/i18npool/source/breakiterator/xdictionary.cxx
@@ -271,21 +271,6 @@ bool xdictionary::seekSegment(const OUString &rText, 
sal_Int32 pos,
     Boundary& segBoundary)
 {
     sal_Int32 indexUtf16;
-
-    if (segmentCachedString.pData != rText.pData) {
-        // Cache the passed text so we can avoid regenerating the segment if 
it's the same
-        // (pData is refcounted and assigning the OUString references it, 
which ensures that
-        // the object is the same if we get the same pointer back later)
-        segmentCachedString = rText;
-    } else {
-        // If pos is within the cached boundary, use that boundary
-        if (pos >= segmentCachedBoundary.startPos && pos <= 
segmentCachedBoundary.endPos) {
-            indexUtf16 = segmentCachedBoundary.startPos;
-            rText.iterateCodePoints(&indexUtf16, 1);
-            return segmentCachedBoundary.endPos > indexUtf16;
-        }
-    }
-
     segBoundary.endPos = segBoundary.startPos = pos;
 
     indexUtf16 = pos;
@@ -308,10 +293,6 @@ bool xdictionary::seekSegment(const OUString &rText, 
sal_Int32 pos,
             break;
     }
 
-    // Cache the calculated boundary
-    segmentCachedBoundary.startPos = segBoundary.startPos;
-    segmentCachedBoundary.endPos = segBoundary.endPos;
-
     indexUtf16 = segBoundary.startPos;
     rText.iterateCodePoints(&indexUtf16, 1);
     return segBoundary.endPos > indexUtf16;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to