Hi Max,

On 10/11/07 14:07, Maximilian Odendahl wrote:

Does sth. like that in general make sense(except the c-casts) or am I on the wrong track here?

SwTxtFld::~SwTxtFld( )
{
   if (Which()==RES_TXTATR_FIELD)
   {
if ( ((SwFmtFld&)(GetAttr())).GetFld()->GetTyp()->Which()==RES_POSTITFLD)
       {
SwDocShell* aShell = static_cast<SwPostItFieldType*>(((SwFmtFld&)GetAttr()).GetFld() ->GetTyp())->GetDoc()->GetDocShell();
           if (aShell)
           {
aShell->GetView()->GetPostItMgr()->Delete((SwFmtFld&)GetAttr());
           }
       }
   }
}

I get an assertion that there is no attribute, but where is it? Or in other words, how can I get my SwFmtFld?

Unfortunately, pAttr is already deleted SwTxtNode::DestroyAttr() by calling RemoveFromPool(). Looks like we have to keep it this way, see comment "RemoveFromPool muss immer vorm DTOR Aufruf erfolgen!!" in txatbase.hxx. It's always harder than expected. I suggest for now you can move this code to "RemoveFromPool", meanwhile I'll discuss this issue with OS.

Regards,

Frank

--
Frank Meies (fme) - OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to