Re: #include ap_EditMethods.cpp


Subject: Re: #include ap_EditMethods.cpp
From: Paul Rohr (paul@abisource.com)
Date: Wed Jan 19 2000 - 21:48:06 CST


At 08:23 PM 1/19/00 -0600, sam th wrote:
>As most of you know, the command in the subject won't work. However, I
>need to use a function that I have defined in ap_EditMethods.cpp. Is
>there a better place to locate this function? I am currently attempting
>to create a header file for EditMethods, but I don't really like that
>solution, and it's hard to do. I hope someone knows what to do.

No. Please do not do this. Edit methods are private by design, which is
why there isn't a header file for them.

I'm not sure what you're trying to do here, but creating that header file is
*not* the way to solve it. If you have some helper function which you'd
like to call from edit methods and from other places in the code, then move
that function somewhere else.

Or, if you need to call an existing edit method by name from elsewhere in
the app, you can use the following idiom:

    const EV_EditMethodContainer * pEMC = pApp->getEditMethodContainer();
    UT_ASSERT(pEMC);

    EV_EditMethod * pEM = pEMC->findEditMethodByName("closeWindow");
    UT_ASSERT(pEM); // make sure it's bound to something

    if (pEM)
    {
        (*pEM->getFn())(pView,NULL);
        return 0;
    }

Would either of those work for you?

Paul
                



This archive was generated by hypermail 2b25 : Wed Jan 19 2000 - 21:42:47 CST