Re: commmit - fix AbiCommand inserttext [& UT_UCS2String question]

From: Andrew Dunbar (hippietrail@yahoo.com)
Date: Sun Apr 28 2002 - 23:09:35 EDT

  • Next message: Andrew Dunbar: "Re: Release cycle (was Re: New development plans)"

     --- Jesper Skov <jskov@zoftcorp.dk> wrote: >
    > Looking at the below, I can't help feel like
    > extending ut_string_class
    > with something like:
    >
    > UT_UCS2String::UT_UCS2String(const UT_String* rhs)
    >
    > allowing to avoid the error-prone alloc/free used in
    > the code below.

    I did this about a year ago. Guess it's another of
    the
    things that got lost in my mega unicode patch ):

    Andrew.

    > Jesper
    >
    >
    > Index: xp/AbiCommand.cpp
    >
    ===================================================================
    > RCS file:
    >
    /cvsroot/abiword-plugins/tools/abicommand/xp/AbiCommand.cpp,v
    > retrieving revision 1.9
    > diff -u -u -5 -r1.9 AbiCommand.cpp
    > --- xp/AbiCommand.cpp 26 Apr 2002 12:58:05 -0000 1.9
    > +++ xp/AbiCommand.cpp 28 Apr 2002 14:29:52 -0000
    > @@ -886,11 +886,13 @@
    > {
    > if(m_pCurView != NULL && pToks->getItemCount() >
    > 1)
    > {
    > UT_String * pText = (UT_String *)
    > pToks->getNthItem(1);
    > UT_UCSChar * pUCSText = (UT_UCSChar *)
    > UT_calloc(pText->size()+1,sizeof(UT_UCSChar));
    > + UT_UCS_strcpy_char(pUCSText, pText->c_str());
    > static_cast<FV_View
    >
    *>(m_pCurView)->cmdCharInsert(pUCSText,pText->size());
    > + FREEP(pUCSText);
    > return true;
    > }
    > return false;
    > }
    > //

    =====
    http://linguaphile.sourceforge.net http://www.abisource.com

    __________________________________________________
    Do You Yahoo!?
    Everything you'll ever need on one web page
    from News and Sport to Email and Music Charts
    http://uk.my.yahoo.com



    This archive was generated by hypermail 2.1.4 : Sun Apr 28 2002 - 23:11:24 EDT