Difference between revisions of "Porting example"

From Apache OpenOffice Wiki
Jump to: navigation, search
 
Line 1: Line 1:
I started looking at the Filter object e.g. [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XFilter.idl XFilter] in the helperapi, XFilter is implemented by [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/FilterImpl.java FilterImpl.java] but it expects to be initialised by an [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XAutoFilter.idl XAutoFilter] implementation [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/AutoFilterImpl.java object]
+
=== Step 1 Choose and object to port ===
 +
I randomly picked the Filter object e.g. [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XFilter.idl XFilter] in the helperapi, then browse the [http://api.openoffice.org/source/browse/api/helperapi/ helperapi] code. I find XFilter is implemented by [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/FilterImpl.java FilterImpl.java] but it expects to be initialised by an [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/com/sun/star/helper/calc/XAutoFilter.idl XAutoFilter] implementation [http://api.openoffice.org/source/browse/*checkout*/api/helperapi/impl/com/sun/star/helper/calc/AutoFilterImpl.java object]
  
so already we need to think about implementing not only XFilter but XAutoFilter
+
so already we need to think about providing an implementation for XFilter but also for XAutoFilter
  
looking at XAutoFilter.idl we see that there is a Filters() attribute/method that returns a Collection of Filters, so additionally we now need a Filters object ( and collections are pretty much completely different beasts in helperapi and oovbaapi )
+
looking at XAutoFilter.idl we see that there is a <tt>Filters(</tt> attribute/method that returns a [[Collection]] of Filters, so additionally I now realise I also need an implementation of the XFilters object. Around this time I notice that the XAutoFilter implementation is key object that the others are accessed/provided from. After some searching through the source code I find this is an attribute of the <tt>Sheet</tt> object
  
also this is an attriute of sheet, where the routine to returns the XAutoFilter
+
so, to summarize, after initially choosing one object to have a crack at porting, I find in fact I actually need to provide implementations for the following interfaces
 +
* XFilter
 +
* XAutoFilter
 +
* XFilters
 +
and I need to add a new attribute to return an <tt>XAutoFilter</tt> implementation

Revision as of 11:44, 23 February 2007

Step 1 Choose and object to port

I randomly picked the Filter object e.g. XFilter in the helperapi, then browse the helperapi code. I find XFilter is implemented by FilterImpl.java but it expects to be initialised by an XAutoFilter implementation object

so already we need to think about providing an implementation for XFilter but also for XAutoFilter

looking at XAutoFilter.idl we see that there is a Filters( attribute/method that returns a Collection of Filters, so additionally I now realise I also need an implementation of the XFilters object. Around this time I notice that the XAutoFilter implementation is key object that the others are accessed/provided from. After some searching through the source code I find this is an attribute of the Sheet object

so, to summarize, after initially choosing one object to have a crack at porting, I find in fact I actually need to provide implementations for the following interfaces

  • XFilter
  • XAutoFilter
  • XFilters

and I need to add a new attribute to return an XAutoFilter implementation

Personal tools