Hi Frank,

Thank you for your answer.

I guess there is a theoretical API and a real api.
The API is already hard to learn and the api seems even harder,
some doubt and betting involved even by extreemly well experienced
developers :(

I take it then that exchanging models can't be done?

Is there a quick way to exchange or replace the contents of a Model with
that of another model?

Thanks again,

Daniel 

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] 
> Sent: February 19, 2009 10:11 AM
> To: [email protected]
> Subject: Re: [api-dev] How to attach new Model to old Controller
> 
> Hi Daniel,
> 
> > With regards to getting the frame from the desktop I used the
> > xDesktop.getCurrentFrame() API. This returned null.
> 
> getCurrentFrame is almost always a bad idea. It denotes the 
> "currently active" frame, and this is a term which cannot be 
> reliably defined, really, for instance because the "current 
> frame" heavily depends on the Window manager you use, and its 
> focusing behavior.
> 
> Also, since you load the document hidden, I doubt that the 
> CurrentFrame would point to it, anyway.
> 
> >         XController xController = xModel_A.getCurrentController();
> >         if ( xController.attachModel( xModel_B ) )
> >             lbaLogger.info(  "Sucessfully attached xModel_B 
> to desktop 
> > controller" );
> >         else
> >             lbaLogger.info(  "Did not sucessfully attach 
> xModel_B to 
> > desktop controller" );
> >     } // oooTest
> > 
> > This returned: Did not sucessfully attach xModel_B to desktop 
> > controller Meaning the xModel_B was not attached. Any reason why?
> 
> http://svn.services.openoffice.org/opengrok/xref/Current%20(tr
> unk)/sfx2/source/view/sfxbasecontroller.cxx#717
> 
> As I said: I doubt this is really properly implemented .... 
> In the SFX application framework (used by Writer, Calc, Draw, 
> Impress), the UNO API really is only a facade on top of a 
> non-UNO implementation, which obviously was never prepared to 
> exchange the document of a given view.
> 
> Ciao
> Frank
> 
> -- 
> - Frank Schönheit, Software Engineer         
> [email protected] -
> - Sun Microsystems                      
> http://www.sun.com/staroffice -
> - OpenOffice.org Base                       
> http://dba.openoffice.org -
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - -
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to