]> git.saurik.com Git - apple/icu.git/blobdiff - icuSources/i18n/nortrans.cpp
ICU-400.42.tar.gz
[apple/icu.git] / icuSources / i18n / nortrans.cpp
index 36c62c8e5589ad63f6e612f3d1365f0c74b0ee57..f967f7dae5d5789c860da000f3f62d1e3a5d57aa 100644 (file)
@@ -1,6 +1,6 @@
 /*
 **********************************************************************
-*   Copyright (C) 2001-2003, International Business Machines
+*   Copyright (C) 2001-2007, International Business Machines
 *   Corporation and others.  All Rights Reserved.
 **********************************************************************
 *   Date        Name        Description
@@ -16,7 +16,6 @@
 #include "unicode/uiter.h"
 #include "nortrans.h"
 #include "unormimp.h"
-#include "mutex.h"
 #include "ucln_in.h"
 
 U_NAMESPACE_BEGIN
@@ -83,12 +82,12 @@ Transliterator(o) {
 /**
  * Assignment operator.
  */
-NormalizationTransliterator& NormalizationTransliterator::operator=(const NormalizationTransliterator& o) {
+/*NormalizationTransliterator& NormalizationTransliterator::operator=(const NormalizationTransliterator& o) {
     Transliterator::operator=(o);
     fMode = o.fMode;
     options = o.options;
     return *this;
-}
+}*/
 
 /**
  * Transliterator API.
@@ -166,7 +165,7 @@ void NormalizationTransliterator::handleTransliterate(Replaceable& text, UTransP
                             fMode, 0,
                             TRUE, &neededToNormalize,
                             &errorCode);
-        output.releaseBuffer(length);
+        output.releaseBuffer(U_SUCCESS(errorCode) ? length : 0);
 
         if(errorCode == U_BUFFER_OVERFLOW_ERROR) {
             // use a larger output string buffer and do it again from the start
@@ -177,7 +176,7 @@ void NormalizationTransliterator::handleTransliterate(Replaceable& text, UTransP
                                 fMode, 0,
                                 TRUE, &neededToNormalize,
                                 &errorCode);
-            output.releaseBuffer(length);
+            output.releaseBuffer(U_SUCCESS(errorCode) ? length : 0);
         }
 
         if(U_FAILURE(errorCode)) {