In my opinion at first we must decide what goals we seek and what problems
we try to solve and after think how do that.
I think scripting API must be simple, logical and should be used without
significant training and long-term UNO structure studies.
I personally would like the next changes:
- all object properties must be accessed directly from object, not matter
from which area (model, frame or controller) they are, for example:
object.value="aaa"
object.height=111
object.X=1111
object.Y=11111
object.setActive()
instead cumbersome current structures:
Dim Point As New com.sun.star.awt.Point
Dim Size As New com.sun.star.awt.Size
Point.x = 1000
Point.y = 1000
Size.Width = 10000
Size.Height = 10000
LineShape.Size = Size
LineShape.Position = Point
or more complicated structure for form controls (as example in my first
post)
-add drawings, forms, controls directly to Calc or Writer document without
DrawPages
-simplify creating of new object:
objects.new() or objects.create()
or
new(object) or create(object)
instead current:
Circle =Doc.createInstance("com.sun.star.drawing.EllipseShape")
Page.add(Circle)
-simplify long constants names ( à la
com.sun.star.table.CellContentType.TEXT to CellContentType.TEXT or simply
TEXT)
-remove inconsistency in methods, properties and their names, for example,
if we have ListBox control in dialog property, in form ListBox this property
must be the same with the sames arguments in the same order. Other example -
we must access table cell an get all roprties by the same method or
property in Calc an Writer.
-make properties and methods smarter:
-- instead getByName, getByIndex, getCellByPosition, getCellByName use
Cell("a1") and Cell(0,0) or Sheet("sheet 1") and Sheet(0)
-- instead cell.string, cell.value, cell.formula use cell.value("1"),
cell.value(1), cell.value("=A1+A2")
--instead StarDesktop.loadComponentFromURL(Url) use
loadComponent("file:///C:/test.odt") or loadComponent("C:\test.odt")
--instead insertByName,insertByIndex - method insert() or new()
--instead removeByName,removeByIndex - method remove() or delete()
--instead getCellRangeByName, CellAddress, CellRangeAddress use
Range("A1:B1") or Range(0,0,1,1)
etc
Best regards
Mindaugas
--
View this message in context:
http://nabble.documentfoundation.org/Simplified-Libreoffice-API-tp4043112p4044203.html
Sent from the Dev mailing list archive at Nabble.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.