Problem: 1318654

Title: (Printing) TPrintHandler::SetOwner

Received: Jan 25 1996 2:03PM


In TPrintHandler::SetOwner, for debug builds, if fOwner != fView then DebugStr is called, which is very annoying when using the Metrowerks Debugger from CW7 becayue each call to DebugStr causes a the debugger to bring up a MODAL dialog! This happens way too much when printing from my Application, which has a custom print handler.

My question to you is, do these two fields really need to be the same? If so, why? Why not get rid of one of them?


More on TPrintHandler::SetOwner:

In TPrintHandler::SetOwner, it must be bogus for it to generate an error message if fOwner != fView because...

In TStdPrintHandler::IStdPrintHandler it calls IPrintHandler which sets fView to itsView, and then down a little bit this happens:

   if (itsDocument)
      itsDocument->AttachPrintHandler(this);
Which eventually calls TEventHandler::AddBehavior, which has this line:
   theBehavior->SetOwner(this);
hence normal use of TStdPrintHandler::IStdPrintHandler will result in fOwner !=fView...
Fix:

This is a scripting bug. The code in question was added/modified to support scripting and needs to be evaluated in that light.


Verified, the ProgramBreak statement was removed.