webengine/osswebengine/WebCore/platform/symbian/TextBreakIteratorSymbian.cpp
changeset 10 a359256acfc6
parent 5 10e98eab6f85
child 48 79859ed3eea9
equal deleted inserted replaced
5:10e98eab6f85 10:a359256acfc6
    19  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    19  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    20  * Boston, MA 02111-1307, USA.
    20  * Boston, MA 02111-1307, USA.
    21  *
    21  *
    22  */
    22  */
    23 
    23 
    24 #include "config.h"
    24 #include "TextBreakIteratorSymbian.h"
    25 #include "TextBreakIterator.h"
    25 #include "TextBreakIterator.h"
    26 #include <e32cmn.h>
    26 #include <e32cmn.h>
    27 #include <KJS/ustring.h>
    27 #include <KJS/ustring.h>
    28 
    28 
    29 namespace WebCore {
    29 namespace WebCore {
   166     }
   166     }
   167     
   167     
   168 static WordBreakIteratorSymbian *wordIterator = 0;
   168 static WordBreakIteratorSymbian *wordIterator = 0;
   169 static CharBreakIteratorSymbian *charIterator = 0;
   169 static CharBreakIteratorSymbian *charIterator = 0;
   170 static LineBreakIteratorSymbian *lineIterator = 0;
   170 static LineBreakIteratorSymbian *lineIterator = 0;
   171 struct cleanupIterators {
   171 void cleanupIterators() 
   172     ~cleanupIterators() {
   172 {
   173     		delete wordIterator;
   173     delete wordIterator;
   174     		wordIterator = NULL;
   174     wordIterator = NULL;
   175     		delete charIterator;
   175     delete charIterator;
   176     		charIterator = NULL;
   176     charIterator = NULL;
   177     		delete lineIterator;
   177     delete lineIterator;
   178     		lineIterator = NULL;
   178     lineIterator = NULL;
   179     }
   179 }
   180 };
       
   181 static cleanupIterators deleteBreakIterator;
       
   182 
   180 
   183 TextBreakIterator* wordBreakIterator(const UChar* string, int length)
   181 TextBreakIterator* wordBreakIterator(const UChar* string, int length)
   184 {
   182 {
   185     if (!wordIterator)
   183     if (!wordIterator)
   186         wordIterator = new WordBreakIteratorSymbian;
   184         wordIterator = new WordBreakIteratorSymbian;