Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Wed, 2011-05-04 at 14:29 +0200, Markus Mohrhard wrote:
Hello,



for the import of the sheet local anonymous db data from excel I had
to create a new UNO interface that supports calc's new sheet local db
data.


I attached my first version that compiles without any errors. But I'm
open to any suggestion about better concepts or renaming of the
interface.

So, I have several suggestions.  Please bear with me being a little too
nit-picky.  The API affects not just the implementers but the extension
developers as well, so I'd like to be extra picky.

* Since the interface itself has Unnamed in it, I think it's redundant
to repeat that in its methods.  When setting and getting database ranges
using this interface, we already know that they are unnamed.

* usually getFoo's counterpart is setFoo, so it's probably more
consistent to stick with this convention rather than addFoo/getFoo.  The
term 'add' also implies that you could add multiple ranges when in fact
you can't.

* I think it would look better to have all methods be consistently
named ...ByTable.  This would also future-proof ourselves in case we
decide to add more methods in the future that allow handling of
anonymous ranges that are not bound to sheets.  UNO API supports those
languages that don't support method overloading, so having unique method
names becomes important in such cases.

Also.... and I'm not 100% sure about this, but I would prefer to pass a
table index as the first parameter to the "add" method.  I know this
would make it redundant since the range struct already provides sheet
index, but IMO that method should raise the index out of bound exception
in case the sheet index is out-of-bound, and if the method doesn't take
a sheet index it may make the method a bit more confusing.  Maybe we
should create a 2-dimensional range struct for this...  but that would
be an extra hassle, so maybe not.

With these in mind, my suggested interface definition would be something
like

interface XUnnamedDatabaseRanges: com::sun::star::uno::XInterface
{
    void setNewByTable( [in] long nTab, [in] com::sun::star::table::CellRangeAddress aRange )
        raises( com::sun::star::lang::IndexOutOfBoundsException );

    any getByTable( [in] long nTab )
        raises( com::sun::star::container::NoSuchElementException,
                com::sun::star::lang::IndexOutOfBoundsException );

    boolean hasByTable ( [in] long nTab )
        raises( com::sun::star::lang::IndexOutOfBoundsException );

};

What do you think about this?

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida@novell.com>


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.