[api-dev] Re: executing a dialog without blocking the program
Hi, Please don't multi-post. This has already been answered in dev@api.openoffice.org At bottom of these archive pages you will find links to the answers. http://www.mail-archive.com/dev@api.openoffice.org/msg02924.html http://www.mail-archive.com/dev@api.openoffice.org/msg04026.html Regards Bernard Message de Gerardo Gómez date 2011-10-27 04:17 : Is it possible to execute a dialog of UNO-AWT without blocking the program. for example: dialog.execute();// execute the dialog (show the dialog)... System.out.println(not blocking dialog); // ...without being blocked, keep to this line while showing the dialog. Thank you in advance for your answers. Regards -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: missing setSelectedItem() method in XComboBox interface
Hi Gerardo, There are two ways to select an item of a ComboBox. From the model of the ComboBox, set the Text property to the value that you want to select: myControl.Text = yellow From the view of the control, use the setText() method: myControlView.setText(yellow) Regards Bernard Message de Gerardo Gómez date 2011-10-15 00:54 : As far as i know, there isn't any setSelectedItem() method in XComboBox interface, i don't know if i need to make a new bug ticket for this one, if you know of an alternative to this please let me know -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Document Text Fields
Hi, Message de Hal Vaughan date 2011-06-15 07:23 : While looking through the reference, I can find info on getting and storing text fields in a document in com.sun.star.text.FieldMaster.User, where I can name a text field and save the data. I don't find anything telling me if there is a limit to how long such a field can be. I think I remember them being unlimited. Is that correct? (I want to use them for storing notes about a document.) You store the text as a String into property Content of the service com.sun.star.text.fieldmaster.User. In Basic a String is limited to 65536 characters. Bernard -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: LibreOffice/OpenOffice.org BASIC – CDbl doesn't work properly with string argument
Hi, No bug here. CDbl uses the locale settings of your OpenOffice.org. Verify Tools Options Language settings Languages : the second item Local Settings should show : Swedish (Swede) Just under this item, you will see a comma indicated as separator for decimal values (it is small but visible). Regards Bernard -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Is LineEndName locale dependent?
Hi, My reply to [api-dev] seems lost, I send it again with copy to Andrew. Bernard Message de Bernard Marcelly date 2011-05-24 09:36 : Hi Andrew, Your code works with french locale. If I create by hand such a line, inspection of properties LineEndName and LineStartName also show the en-US name. I modified your code using the french name: oLine.LineStartName = Double flèche This was accepted, and property LineStartName showed Double Arrow. Tested with OOo 3.3.0 en-US plus french langpack. Bernard Message de Andrew Douglas Pitonyak date 2011-05-23 21:22 : I use English USA locale. Consider the following Calc macro that sets line starts and line ends based on the name (which I assume is the correct way to do this). Will this work in other languages such as German, French, Russian, Polish, Chinese? -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Get list of printers
Hi, Issue 117765 is good news. But this service com.sun.star.awt.PrinterServer is not documented in the IDL ! Only its interface. I hate using undocumented API. Can it be also corrected ? Regards Bernard Message de Frank Schönheit date 2011-04-08 09:28 : Hi Andrew, I had hoped it would be as easy as CreateUnoService(com.sun.star.awt.PrinterServer) Unfortunately, the returned object is not usable. Usable is a relative term. You can always do something like this: oServer = CreateUnoService(com.sun.star.awt.PrinterServer) oCore = CreateUnoService(com.sun.star.reflection.CoreReflection) oClass = oCore.forName(com.sun.star.awt.XPrinterServer) oMethod = oClass.getMethod(getPrinterNames) aNames = oMethod.invoke(oServer, Array()) Niklas Wow, thanks. Thanks to Ariel, I have a few links, one of which brings me here: http://openoffice.org/projects/api/lists/dev/archive/2008-08/message/66 So this means the problem with this absolutely unusable (despite the CoreReflection hoops) service is known for more than 2.5 years already, and nobody of us developers ever cared? Shame on us! Known as http://openoffice.org/bugzilla/show_bug.cgi?id=117765 now, fixed in CWS fs35a. Ciao Frank -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Get list of printers
I have created Issue http://openoffice.org/bugzilla/show_bug.cgi?id=117769 to request the IDL documentation. Bernard Message de Bernard Marcelly date 2011-04-08 13:47 : Hi, Issue 117765 is good news. But this service com.sun.star.awt.PrinterServer is not documented in the IDL ! Only its interface. I hate using undocumented API. Can it be also corrected ? Regards Bernard Message de Frank Schönheit date 2011-04-08 09:28 : Hi Andrew, I had hoped it would be as easy as CreateUnoService(com.sun.star.awt.PrinterServer) Unfortunately, the returned object is not usable. Usable is a relative term. You can always do something like this: oServer = CreateUnoService(com.sun.star.awt.PrinterServer) oCore = CreateUnoService(com.sun.star.reflection.CoreReflection) oClass = oCore.forName(com.sun.star.awt.XPrinterServer) oMethod = oClass.getMethod(getPrinterNames) aNames = oMethod.invoke(oServer, Array()) Niklas Wow, thanks. Thanks to Ariel, I have a few links, one of which brings me here: http://openoffice.org/projects/api/lists/dev/archive/2008-08/message/66 So this means the problem with this absolutely unusable (despite the CoreReflection hoops) service is known for more than 2.5 years already, and nobody of us developers ever cared? Shame on us! Known as http://openoffice.org/bugzilla/show_bug.cgi?id=117765 now, fixed in CWS fs35a. Ciao Frank -- -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
[api-dev] Re: Scrolling a spreadsheet with a macro
Hi, I always want A1 to be selected, keeping the selection out of the important area. Why select A1 ? Select any other far away cell, e.g. cell KK3000 _Then_ set the first visible row and column. Regards Bernard -- - To unsubscribe send email to dev-unsubscr...@api.openoffice.org For additional commands send email to sy...@api.openoffice.org with Subject: help
Re: [api-dev] I can see the method/property which can not be found ...
Hi Andreas, I ran your code on OOo 3.3.0 / Windows XP. I got a Writer table with the formatted cells. It works as expected. Suggestion : re-install OOo after a good cleaning. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Grid control on OOo 3.3.0
Hi Frank, Message de Frank Schönheit date 2011-02-08 10:55 : Hi Bernard, Attached is my test dialogue, in library CtrlGrid, if you can see what is wrong or missing. You add 4 columns to the column model, but only 3 columns to each row of the data model. This inconsistency prevents the grid control peer from being created. Adding a forth column to all 3 data rows shows the control. Yes, I already found that error (see my second message, february 3rd). Also yes, there is more code than necessary because I tested various things to make it work. After further tests I have created issues 116827 to 116831, I think they are also valid in the new implementation. Thanks for your message, Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Grid control on OOo 3.3.0
Message de Frank Schönheit date 2011-02-03 15:21 : Hi Bernard, Can the Grid control be displayed on OOo 3.3.0 ? It can, but there's a number of ... undocumented traps. Without investigating your concrete use case, it is difficult to tell what you miss - but there sure is something, I already saw living grid controls in a 3.3 :), though I don't have the code at hand right now. I saw your message about GridSort, but OOo 3.3 should be enough for a first try. Attached is my test dialogue, in library CtrlGrid, if you can see what is wrong or missing. Regards Bernard GridControl.odt Description: application/vnd.oasis.opendocument.text - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Grid control on OOo 3.3.0
OK, found my bug ! I had declared one column too many. The column of the row headers must not be defined. Using Oliver code adding the control to the dialog, my grid example throws GridInvalidDataException : number of items per row does not match the number of columns. With the method of inserting the control model to the dialog model, there is no exception and no display. In my opinion the same exception should be raised. I see that the row header column cannot be resized with the mouse. If the RowHeaderWidth is set too low some headers may be unreadable. It would be a nice improvement to allow resize by mouse. I will continue to play with the Grid control :-) Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] How to handle OnSelect event on sheet ?
Hi, I am trying to attach a macro to the sheet events available in OOo 3.3 (by a right-click on the sheet tab). With the OnSelect event, if the called macro displays a message you go into an endless loop because, once the message appears, the slightest move of the mouse changes the selection (all buttons released) - and calls again the macro ! I don't know how to avoid this. I feel there is a design problem here. The selection should not change when no mouse button is pressed. Tested on RC9 with Windows XP. Example of macro: Sub handleEvent(zone As Object) MsgBox(Hey!) End Sub Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] AdministrationProvider no more accessible
Message de Stephan Bergmann date 2011-01-11 14:41 : On 01/11/11 10:52, Bernard Marcelly wrote: I discovered another oddity in the configuration API in OOo 3.3 RC. It is no longer possible to get the AdministrationProvider. Yes, gone for good, but I apparently forgot to document that. -Stephan I see that references to this service were suppressed (June 2010) from the Developer's Guide, but is there now an alternative way to access/update the administration layer ? Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] AdministrationProvider no more accessible
Message de Stephan Bergmann date 2011-01-17 15:13 : On 01/17/11 15:04, Bernard Marcelly wrote: Message de Stephan Bergmann date 2011-01-11 14:41 : On 01/11/11 10:52, Bernard Marcelly wrote: I discovered another oddity in the configuration API in OOo 3.3 RC. It is no longer possible to get the AdministrationProvider. Yes, gone for good, but I apparently forgot to document that. -Stephan I see that references to this service were suppressed (June 2010) from the Developer's Guide, but is there now an alternative way to access/update the administration layer ? No, there is no programmatic way for that. The standard way should be to have an OOo extension (installed shared) that modifies the configuration. Do you have any other use cases? -Stephan I do not have a specific need. Just clarifying the evolution of the API. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] AdministrationProvider no more accessible
Hi, I discovered another oddity in the configuration API in OOo 3.3 RC. It is no longer possible to get the AdministrationProvider. Dim cfp As Object cfp = CreateUnoService(com.sun.star.configuration.AdministrationProvider) cfp returns as Null, which means the service is not recognized. Effectively, the Service Manager does not provide this service anymore. Is this on purpose ? This service is still described in the IDL. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] ConfigurationProvider getByHierarchicalName regression
Message de Stephan Bergmann date 2011-01-10 11:24 : On 01/10/11 10:06, Stephan Bergmann wrote: On 01/10/11 08:34, Bernard Marcelly wrote: A second anomaly is that if you put a Watch in Basic on the variable containing the registry key content, OpenOffice crashes. Seems similar to Issue 112107. Meanwhile, found the details again. Its http://qa.openoffice.org/issues/show_bug.cgi?id=112107, only fixed for OOo 3.4 (DEV300_m93). I don't understand why this regression/crash is not corrected for OOo 3.3. It is triggered by object inspectors : the watch window, Xray, MRI. These tools help ordinary programmers in their struggle against the API. Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] ConfigurationProvider getByHierarchicalName regression
Hi, Running a code that works in previous versions (up to 1.1.5 !) I found that it throws an exception in OOo 3.3 RC3 / Windows XP. Probably same in the latest RC, not tested. I use getByHierarchicalName to obtain a set in a container. If the argument is an absolute address within the container, it is rejected NoSuchElementException. If the argument is a relative address it is accepted. Both case were accepted up to now. A second anomaly is that if you put a Watch in Basic on the variable containing the registry key content, OpenOffice crashes. Seems similar to Issue 112107. Here is the Basic code. It reads the data UseSystemFileDialog in node: /org.openoffice.Office.Common/Misc It successfully reads with a relative address, then fails with an absolute address. __ Sub Main Dim rk As Object, v As Object, dataValue As Variant ' using GetRegistryKeyContent() from module Misc of library Tools GlobalScope.BasicLibraries.loadLibrary(Tools) rk = GetRegistryKeyContent(/org.openoffice.Office.Common) ' if you put a watch on rk and a breakpoint at next instruction, OpenOffice crashes ! ' next line works, the argument is relative to the node name v = rk.getByHierarchicalName(Misc) dataValue = v.getByName(UseSystemFileDialog) MsgBox(Value : dataValue, 0, Relative address) ' next line throws com.sun.star.container.NoSuchElementException with an absolute address v = rk.getByHierarchicalName(/org.openoffice.Office.Common/Misc) dataValue = v.getByName(UseSystemFileDialog) MsgBox(Value : dataValue, 0, Absolute address) rk.dispose End Sub __ I think this is a stopper to 3.3, your opinion ? Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] use of css.container.EnumerableMap
Issue finally created (after servlet errors) http://www.openoffice.org/issues/show_bug.cgi?id=116184 Regards Bernard Message de Stephan Bergmann date 2010-12-20 10:12 : On 12/19/10 08:39, Bernard Marcelly wrote: I tried to make it work like this: Dim keyType As Object, valueType As Object, reflect As Object reflect = CreateUnoService(com.sun.star.reflection.CoreReflection) keyType = reflect.forName(string) valueType = reflect.forName(long) enuMap = com.sun.star.container.EnumerableMap.create(keyType, valueType) ' -- error : com.sun.star.uno.Type expected. If you look at the mapping of simple types for Basic in the Dev'Guide http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Basic/Mapping_of_Simple_Types you see that the UNO type is mapped in Basic to com.sun.star.reflection.XIdlClass So my code (and yours) should be accepted. I'd suggest you file an issue for Basic. -Stephan - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] use of css.container.EnumerableMap
I fully agree with Paolo, this kind of API is a complex solution to a simple need. I tried to make it work like this: Dim keyType As Object, valueType As Object, reflect As Object reflect = CreateUnoService(com.sun.star.reflection.CoreReflection) keyType = reflect.forName(string) valueType = reflect.forName(long) enuMap = com.sun.star.container.EnumerableMap.create(keyType, valueType) ' -- error : com.sun.star.uno.Type expected. If you look at the mapping of simple types for Basic in the Dev'Guide http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Basic/Mapping_of_Simple_Types you see that the UNO type is mapped in Basic to com.sun.star.reflection.XIdlClass So my code (and yours) should be accepted. Regards Bernard Message de Ariel Constenla-Haile date 2010-12-19 02:00 : On Saturday 18 December 2010, 21:34:00, Ariel Constenla-Haile wrote: IMHO the wrong choice was to use the UNO type instead of com.sun.star.uno.TypeClass. With TypeClass and the support for new-style service constructor, it could have been as simple as: Dim aMap aMap = com.sun.star.container.EnumerableMap.create(_ com.sun.star.uno.TypeClass.SHORT,_ com.sun.star.uno.TypeClass.STRING) looking at http://api.openoffice.org/docs/common/ref/com/sun/star/container/EnumerableMap.html I see this won't work, because the EnumerableMap also takes other types than simple ones, like ENUM and INTERFACE; sure in this cases the UNO type is need and the uno.TypeClass is not enough. Regards - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Extremely slow performance with getCellByPosition
Hi, I used OOoBasic, which is not really fast. For the test my sheet had numbers on the first 637 rows, but the macro runs on 27001 rows. Sub Main Dim sh As Object, myCell As Object Dim x As Long, y As Long, t As Long sh = ThisComponent.Sheets(0) t = GetSystemTicks for y = 0 to 27000 for x = 0 to 32 myCell = sh.getCellByPosition(x,y) next next MsgBox(Duration : GetSystemTicks -t milliseconds) End Sub Result : approx. 110 seconds (less than 2 minutes) Windows XP SP3, Intel Core 2CPU at 2.13 GHz Your spreadsheet probably has something special. Or you do something else in the loop. Try to load the csv version instead of the original Excel file. Regards Bernard Message de Andrew Pitonyak date 2010-11-08 00:04 : On Fri, 5 Nov 2010 21:24:08 -0400, Scott Deerwester scott.deerwes...@gmail.com wrote: The following code (in Python): for r in range(dataRange.StartRow, dataRange.EndRow): for c in range(dataRange.StartColumn, dataRange.EndColumn): cell = sheet.getCellByPosition(c,r) takes nearly two hours to run on a reasonably fast workstation for a spreadsheet with 32 columns and ~27,000 rows (about .2 seconds per row). By comparison, opening the file takes about 8 seconds and saving the file to a CSV (which is functionally equivalent to the above) takes a few seconds. The original file was written in Excel as an XLS (not XLSX). This seems impossibly slow. Am I misusing the API somehow? What can I do to speed it up? - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] Some consistency in IDL please
Hello, This is not a problem, just an annoyance which could be avoided. I downloaded the Dev SDK for version 3.3, and run a grep tool on all IDL files, to find out which files contain the string : @since The following remarks are also valid for previous versions. For the latest version 3.3.0 I found these variants, on various IDLs: @since OpenOffice.org 3.3 @since OOo 3.3 @since OOo 3.3.0 @since OOo3.3 @since OpenOffice.org 3.3 Please, API developers, could you stick to one rule ? :-) Special comment for com/sun/star/text/TextMarkupType.idl which contains these: /// @since OOo 3.3 /// @since OOo 3.0.1 Not only are they invisible from a Browser, but they render invisible other information. Which is incorrect, the IDL file, the IDL formatter, both? Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] [terrible solution..] Opening *.dbf file - workaround?
Message de Thomas Krumbein date 2010-08-11 14:48 : Hi, This old version may not be able to guess the import filter and encoding of the dBase document. Did you try to add this information? dim arg(2) as new com.sun.star.beans.PropertyValue arg(0).Name = Hidden arg(0).Value = true arg(1).Name = FilterName arg(1).Value = dBase arg(2).Name = FilterOptions arg(2).Value = IBMPC_850 oCalcDoc = StarDesktop.loadComponentFromURL(sURL, _blank, 0, arg()) Version 3.0.1 is an obsolete and buggy version, it should not be used anymore in a professional (or even personal) environment. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Searching for a Document Property - Writer
Message de Thomas Krumbein date 2010-08-04 11:24 : Hey, By one of my customer we have a problem during migration to OOo 3.2.1: The page-layout is different and this is dramaticly because the page break in now one line prior - and a lot of document didn´1 work as expected. Analysing the problem it depend on a different setting in the option menu: in tools - options - OOo writer - compatibility the first checkbox (in German Druckermaße für Dokumentformatierung verwenden) is not set any more. Unfortunatly when I open a existing document via macro this checkbox is marked - so the information musst be stored anywhere in the document. But I do not know where??? Any hints? I will try to change the setting per basicmacro after insert such a document. Thanks in advance, Thomas Hi Thomas, It is more exactly the equivalent check in the printer dialog box, Options... Dim ds As Object ds = ThisComponent.createInstance(com.sun.star.text.DocumentSettings) ds.PrintPaperFromSetup = False Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Re: ERRCODE_IO_CANTWRITE writing a PDF file
Message de Joaquin Cuenca Abela date 2010-07-29 11:58 : Any other ideas? Thanks! For what's worth (I am not fluent in Python), I do not understand this code (and similar for output) : self._toProperties( InputStream=inputStream, FilterName='writer8', ReadOnly=True) which calls this : def _toProperties(self, **args): props = [] for key in args: prop = PropertyValue() prop.Name = key prop.Value = args[key] props.append(prop) return tuple(props) I can't see how you will get a correct .Name and .Value for each propertyValue. Check that you have: props[0].Name = 'InputStream' props[0].Value = inputStream props[1].Name = 'FilterName' props[1].Value = 'writer8' props[2].Name = 'ReadOnly' props[2].Value = True In the original code, function _toProperties receives a dictionnary as argument, and this I can understand. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Regarding max value of UnoControlNumericField
Message de Madhur Kashyap date 2010-06-15 12:21 : Hi, I am using OOO 3.2. I do not know the max value of the numeric field inputs I get from user. So, in other words I wan to leave it to the highest value supported by the precision of the field (double I believe). While creating the numeric field with OO macro, I am not setting any max value yet, the field max value gets defined to 1e7. Is there a way to reset this max value? Hi, Set property ValueMax of the model. Properties Value, ValueMax, ValueMin, ValueStep are of type double. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Measuring time with OpenOffice.org BASIC
Message de Johnny Rosenberg date 2010-05-29 23:05 : I know about the GetSystemTicks() function, but isn't that System Ticks rather than time? Like CPU time or something like that. I want to know the time from when I start doing something until it's done in absolute time. now() would work if the resolution was better than 1 s. There is no Basic function returning real time with better precision than 1 s. The apparent precision would be meaningless. Absolute real time valid to 100ms or better cannot be obtained on an ordinary personal computer. The internal clock drift is about 1 second per day (that is 10ms drift in 1/4h). You would need to recalibrate it to an atomic clock very often. And how can 16 ms be the best precision due to IBM PC hardware design? The original IBM PC was Stone Age computing, compared to current PC. But it was the first standard. And I don't know anything about MS Windows. I use Ubuntu. I don't know anything about Ubuntu. I use MS-Windows XP. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Measuring time with OpenOffice.org BASIC
Message de Konstantin Tokarev date 2010-05-29 19:10 : On MS-Windows the result is in milliseconds, with a precision of 16 ms due to IBM PC hardware design. Does it mean that results of OOo Basic scripts may be platform-dependent? Help says it depends on OS. I have not tested on other OS than MS-Windows, nor on other HW platform, e.g. Mac. Help shows how to count the ticks for a given delay. This code shows on PC/MS-Windows that GetSystemTicks does not increment by 1. Dim t1 As Long, t2 As Long, n As Long n = 0 t1 = GetSystemTicks Do t2 = GetSystemTicks -t1 n = n+1 Loop Until t2 0 MsgBox(t2 = t2 n = n) Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Measuring time with OpenOffice.org BASIC
Hello Johnny, Message de Johnny Rosenberg date 2010-05-29 17:53 : Have been searching in Help but I didn't find anything so far. I want the current time in ms, but all I find is the now() function which seems to have 1 s for resolution. Hints? If you want to measure short delays, see function GetSystemTicks. It is described in help under Miscellaneous commands, not under Date and Time functions. On MS-Windows the result is in milliseconds, with a precision of 16 ms due to IBM PC hardware design. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] options for the pdf export
Message de Ariel Constenla-Haile date 2010-05-21 04:34 : Hello Andreas, On Thursday 20 May 2010, 15:01, Andreas Mantke wrote: I have a look on the wiki site (http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export) and missed the option FitWindow. AFAIK there is no option (in the PDF configuration) with that name (though I may have missed that). Or may be you mixed the PDF config. property named ResizeWindowToInitialPage with its representation in the source code http://svn.services.openoffice.org/opengrok/xref/DEV300_m77/filter/source/pdf/pdfexport.cxx#450 Hi, I think Andreas request corresponds to property Magnification, described in the table Initial view. I profit from this occasion to thank Ariel for this splendid Wiki page. It is distressing that developers have not yet documented this interface in the API, and then we do not have API constants for all these parameter values. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Form, how do I set Control Property to Empty (BackgroundColor)
Hi Johannes, Message de Johannes Öberg date 2010-04-29 15:11 : How can I set the BackgroundColor of a label to transparent from a macro? When I Xray BackgroundColor after setting it to Default from the Form designer, it says it is of type Empty. Should i remove the property? How do I do that? Sorry if this is a stupid question again; I have googled for over 1h and not found an answer. No so stupid... You should have specified if the label is in a form or in a dialog, things may be different. This solution _nearly_ works. I tested it for a label in a form. ' *** Basic *** ' k is the model of the control Dim nocolor As Variant k.BackgroundColor = nocolor The trick is that a declared Variant is initialized as : empty ! Well, it _nearly_ works because the page of the document is not repainted. You have to change the page and return, or at least set the control out of the displayed zone. Someone else will find out how to trigger repaint... Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Embedding data files in Calc and extracting on need
Message de Madhur Kashyap date 2010-03-18 05:35 : Hi, I have built an application on top of openoffice calc using the Macro programming techniques. Now, some part of my application is in a compiled executable in a separate file which I invoke through a shell command. I want to distribute a single OO calc doc as the application, kind of self contained. In order to do that I need a mechanism to keep this executable embedded / kept inside the calc document itself. Also, a way to extract it out when needed during the use of application. Please guide me on how to do that. My users are on Windows as well as Linux. I think a simpler solution would be to create and distribute an extension. An extension may include any number of documents of any kind. You can easily find the path of the installed extension folder and then the address of the document. http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/Location_of_Installed_Extensions Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] From DDE link to cells
Message de Niklas Nebel date 2010-03-11 10:56 : On 03/10/10 21:08, Bernard Marcelly wrote: fp = ThisComponent.createInstance(com.sun.star.sheet.FormulaParser) fp.FormulaConvention = com.sun.star.sheet.AddressConvention.XL_OOX fp.ReferencePosition = c.CellAddress ftseq = fp.parseFormula(c.Formula) You can get the token sequence directly from the cell, without using the parser or the formula text: ftseq = c.Tokens ftseq is a nice array of FormulaToken, but how can I interpret a formula token OpCode ? In the fp object, property OpCodeMap is an empty array, and the documented property ExternalLinks does not exist. Use FormulaOpCodeMapper to map between function names and op codes. To get the code for the DDE function: dim aNames(0 to 0) as String aNames(0) = DDE oMapper = CreateUnoService(com.sun.star.sheet.FormulaOpCodeMapper) aMappings = oMapper.getMappings(aNames(),_ com.sun.star.sheet.FormulaLanguage.ENGLISH) print aMappings(0).OpCode Several IDL pages are unpublished, is this service usable ? This stuff is used by the xlsx import, so it should work. Unpublished means it might change in the future, but there are no API changes planned at the moment. Niklas Hi Niklas, Now I can find if a cell uses DDE function. But retrieving the value of its arguments is another matter, except in simple cases. Probably there is no easy way to find which cells use a given DDE link. Anyway, thanks for the tip. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] From DDE link to cells
Hi, The container DDELinks of a spreadsheet contains the DDE links used in the spreadsheet. Is it possible to find where (in which cells) a DDE link is used ? An idea is to scan cells containing formulas. But a call to DDE() function can appear in a complex form in a cell formula, so you need to parse the formula. I tried to use the service c.s.s.sheet.FormulaParser like this: ' *** BASIC *** Dim fp As Object, ca As Object, ftseq As Variant Dim f As Object, c As Object f = ThisComponent.Sheets.getByName(Feuille1) c = f.getCellRangeByName(D7) fp = ThisComponent.createInstance(com.sun.star.sheet.FormulaParser) fp.FormulaConvention = com.sun.star.sheet.AddressConvention.XL_OOX fp.ReferencePosition = c.CellAddress ftseq = fp.parseFormula(c.Formula) ftseq is a nice array of FormulaToken, but how can I interpret a formula token OpCode ? In the fp object, property OpCodeMap is an empty array, and the documented property ExternalLinks does not exist. Several IDL pages are unpublished, is this service usable ? Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api - dev] How to change Macro Security Level in program?
Hi, The option MacroExecutionMode does not change the security level in OpenOffice.org ! It only defines what to do if the document you are loading contains macros. If you decide to load a document so that macros that exist in the document will run without any warning, that is your responsibility. You (the programmer) should know what is in the loaded document. I cannot see this as a security hole. Regards Bernard Message de Malte Timmermann date 2010-01-29 14:13 : Correct - if you choose to run a macro, the macro can do everything the user is privileged to do. Including configuration manipulation and formatting discs and rebooting the system. See http://blogs.sun.com/malte/entry/some_words_about_macro_security Malte. Cor Nouws wrote, On 01/29/10 12:02: Marc Santhoff wrote (29-01-10 00:35) I would name this a dangerous security hole. Is it possible to switch it off using a configuration setting? Well, to turn it off with a macro, the user has to accept to run that macro. So I do not understand which hole you mean. Cor - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] How to use a PropertyChangeListener in Basic
Message de Regina Henschel date 2010-01-09 15:33 : Hello, I need to react on the change of the property CircleStartAngle and CircleEndAngle of an EllipseShape. I tried to use a PropertyChangeListener but it doesn't work. So I tried a PropertyChangeListener with a more simple example to learn whether I do something wrong, see code below. Hi Regina, Here is the description of interface XPropertySet in the API : There are three types of properties: * bound properties * constrained properties * free properties You can listen to changes of bound properties with the XPropertyChangeListener and you can veto changes of constrained properties with the XVetoableChangeListener. Few objects have bound properties. You will find them in form controls, e.g. in a TextField. If you use Xray (with detailed display) on such control, it will indicate value change may be listened for some properties : Align, BackgroundColor, Border, DataField, Tag, etc. For these properties you will receive a correctly filled event object. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] How to use a PropertyChangeListener in Basic
Message de Regina Henschel date 2010-01-09 18:55 : OK, I see that all EllipseShape properties are without value change may be listened. So I have to find another way. But the property ZoomValue has got value change may be listened, and there is no reaction on changing zoom in Writer, Draw and Impress, but only in Calc. Why? After some tests I conclude that the implementation is approximate regarding this listener... Calc : the property attribute of ZoomValue is : zero. It should not fire a PropertyChangeEvent. Yet, it does fire. But disposing is not fired when closing the window. Draw/Impress : the property attribute of ZoomValue is : 2. It should fire a PropertyChangeEvent. But it does not. Yet it fires the disposing event when closing the window. Writer : ZoomValue is a property of CurrentController.ViewSettings. The property attribute of ZoomValue is : zero. It should not fire a PropertyChangeEvent. It does not, as expected. Basic code, in container My macros for easier use Option Explicit Global propsObject as object Global oListener as object Sub listenPropertyChange Dim propsObject As Object Dim sListenerName as string, sProperty as string sListenerName = com.sun.star.beans.XPropertyChangeListener if IsNull(propsObject) then oListener = CreateUnoListener( myChangeListener_, sListenerName ) propsObject = ThisComponent.CurrentController ' Calc, Draw, Impress ' propsObject = ThisComponent.CurrentController.ViewSettings ' Writer sProperty = ZoomValue propsObject.addPropertyChangeListener(sProperty, oListener) MsgBox(Listener installed) else MsgBox(Listener already in use, 16) end if End Sub sub stopListener if IsNull(propsObject) then MsgBox(Listener not installed, 16) else propsObject.removePropertyChangeListener(sProperty,oListener) propsObject = Nothing oListener = Nothing MsgBox(Listener removed) end if end sub Sub myChangeListener_disposing(oEvt As Object) MsgBox(myChangeListener disposing) propsObject = Nothing oListener = Nothing End Sub Sub myChangeListener_propertyChange(oEvt As Object) xray oEvt End Sub Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Trying to understand random access to a file with OpenOffice.org Basic
Message de Johnny Rosenberg date 2010-01-01 13:58 : The first thing I did was to look in AndrewMacro.odt, the famous macro document by Andrew Pitonyak. I found this example, and I actually also found the same example in the OpenOffice.org BASIC help section, that seems to be broken though (I added line numbers to it, so I can easier refer to it later): 00. '?? This is broken! 01. Sub ExampleRandomAccess 02. Dim iNumber As Integer, aFile As String 03. Dim sText As Variant REM Must be a variant 04. aFile = c:\data1.txt 05. iNumber = Freefile 06. Open aFile For Random As #iNumber Len=5 07. Seek #iNumber,1 REM Position at beginning 08. Put #iNumber,, 1234567890 REM Fill line with text 09. Put #iNumber,, ABCDEFGHIJ 10. Put #iNumber,, abcdefghij 11. REM This is how the file looks now! 12. REM 08 00 0A 00 31 32 33 34 35 36 37 38 39 30 08 00 1234567890.. 13. REM 0A 00 41 42 43 44 45 46 47 48 49 4A 08 00 0A 00 ..ABCDEFGHIJ 14. REM 61 62 63 64 65 66 67 68 69 6A 00 00 00 00 00 00 abcdefghij 15. REM Hi Johnny, A Random access file has no real meaning for text. It would be much simpler to write an ordinary text file with successive lines using instruction Print, and later read the file line by line using instruction Line Input. For random access, put the lines in an array of String. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] using css.awt.AsyncCallback in OOoBasic
Hi Franck, I think callBack cannot be reliably used with Basic because you cannot know when the message list will be read. It can happen anywhere, as in this example: Option Explicit Private truc As Long Sub Main Dim ac As Object, oCallback As Object Dim n As Long truc = 0 ac = CreateUnoService(com.sun.star.awt.AsyncCallback) oCallback = CreateUnoListener( callback_, com.sun.star.awt.XCallback ) ac.addCallback( oCallback, 0) for n = 1 to 1 truc = n next End Sub Sub callback_notify() MsgBox(truc) End Sub At each run you will display a different value of variable truc. Using a wait(10) will force the message list to be read, but it may already have been read some instructions before... Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] Service SpreadsheetDocumentSettings
Hi all, Service css.sheet.SpreadsheetDocumentSettings is marked as deprecated since SDK 1.1. How can it be deprecated and have new properties added since OOo 3.0 ? [optional, property] boolean IsLoaded; [optional, property] boolean IsUndoEnabled; [optional, property] boolean IsAdjustHeightEnabled; [optional, property] boolean IsExecuteLinkEnabled; [readonly, optional, property] com::sun::star::awt::XDevice ReferenceDevice; Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] loadcomponentfromurl
Hi, Message de Wei Min Teo date 2009-11-06 02:51 : Hi, I'm not going to use any filters or perhaps it automatically uses a default filter. Anyway, to clarify, I think my problem occurs with opening *.doc or *.ppt files. When I open it prompts me on which character encoding i want to use. It means these are not real .doc or .ppt files. Microsoft sometimes creates simple (not formatted) text files as .doc Probably it uses Windows encoding ( e.g. Windows 1252 for European text). Open those files with user interface, you will be requested an encoding. If you can't find a correct one, how could you find it by program? Another case is when a file is corrupted : no solution here. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] OpenOffice.org Macros.
Hi, Don't forget OpenOffice.org Help : F1 In Contents tab, see section Macros and Programming You will also find references for starters in the Wiki page http://wiki.services.openoffice.org/wiki/Extensions_development Regards Bernard Message de Juergen Schmidt date 2009-10-10 11:04 : Hi, BrOffice.org = OpenOffice.org that means you can use all the material that you can find on the OpenOffice.org site an in the OpenOffic.org wiki. Here some links to get started: - the Basic Guide http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide - the Developers Guide http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/OpenOffice.org_Developers_Guide - Andrew Pitonyak's Macro Collection http://www.pitonyak.org/AndrewMacro.sxw - you can ask on this mailing (subscription is necessary) I hope that helps a little bit Juergen - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] OpenOffice.org 2.4.0 SDK download links are not working
Message de Jia, Yihan date 2009-09-10 12:15 : Hi, I am from London, UK and would like to download above SDK to work on a legacy internal project of my company. But the download links I tried on your download page ( http://download.openoffice.org/2.4.0/sdk.html ) are not working ( I tried all of them). Could you send me a this SDK or a valid download link so I can get it? it is very important and urgent for me to get hold of this version of SDK. Many Thanks and look forward your generous help. Regards Jason Hi Jason Legacy packages are stored in the archive server, read: http://distribution.openoffice.org/mirrors/archive.html You will find your SDK in folder openoffice-archive/stable/2.4.0 Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] OOoBasic: CreateUnoListener() returns references that can only be held by GLOBAL module vars and not PRIVATE vars ?
Hi again, Jan, Message de Jan Holst Jensen date 2009-09-05 22:10 : This behavior is not exactly clear from the Help description - here from the Help text about the Dim Statement: Dim declares local variables within subroutines. Global variables are declared with the PUBLIC or the PRIVATE statement. So we have global variables that do not hold data globally but only declare the variable globally. Strange notion... but of course useful when used in nested calls like I do in the dialog example code I listed. Would be nice if the help described the lifecycle of variable content as well as the declaration scope. Read the Basic Programming Guide, on the Wiki. http://wiki.services.openoffice.org/wiki/Documentation/BASIC_Guide/Scope_of_Variables The Basic Programming Guide is not up-to-date but is still valuable for learning the basics of Basic and API. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Problems with Type…
Message de Johnny Rosenberg date 2009-09-05 13:24 : MyArray().Nick=TempArray(0) ' This line produces the error message ”BASIC runtime error. Object variable not set.” Then I expect the following variables containing the following: MyArray(1).Nick=One MyArray(2).Nick=Two MyArray(3).Nick=Three MyArray(4).Nick=Four MyArray(5).Nick=Five MyArray(6).Nick=Six MyArray(7).Nick=Seven MyArray(8).Nick=Eight Am I totally approaching this the completely wrong way? Yes. Basic does not allow this (and probably no other language). You can assign an array of String to an array of String, or to a Variant. But not to a string in each structure of an array of structures. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] OOoBasic: CreateUnoListener() returns references that can only be held by GLOBAL module vars and not PRIVATE vars ?
Hi Jan, Private or Public variables live only during execution of a macro. Global variables survive between two executions. In your dialog example this is same. The macro ShowDialog does not exit because Dlg.execute waits for the dialog to be closed. You can verify this by inserting a MsgBox(Hello) just after Dlg.execute. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] Writer notes containing hyperlink
Hi developers, Could someone have a look at Issue 104513 : Writer notes containing hyperlink cannot be read by API http://www.openoffice.org/issues/show_bug.cgi?id=104513 I reproduce it again on 3.1.1. This is very disturbing because using correct API instructions you read only a part of a note containing an hyperlink, or even nothing, without any error. And the result of the API instructions changes if you modify the main text anywhere! I have attached a document with macros showing the bug, just do what is written in it. The only work-around I found is to use the TextRange of the note, create a text cursor on it, select from start to end of the TextRange, and getString from the cursor. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Bug when retrieving bookmarks with 3.1.0 ? = previous version
Hi Oscar, Message de Oscar Picasso date 2009-08-25 00:01 : Hi, I did install OpenOffice 3.1.0 and now some tests that used to pass with 3.0.1 don't pass anymore. The tests try to retrieve the bookmarks in a document. It uses the Java API: // accessing the Bookmarks collection of the document final XBookmarksSupplier supplier = (XBookmarksSupplier) UnoRuntime .queryInterface(XBookmarksSupplier.class, getComponent()); final XNameAccess bookmarks = supplier.getBookmarks(); final String[] names = bookmarks.getElementNames(); ... The names array is now emply which was not the case before. I can't see any problem with Bookmarks on 3.1.0, in Basic. So the API is still correct. Check that your document has bookmarks ! Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] How to enumerate text document by pages?
Hi Wei, Message de Wei Min Teo date 2009-08-21 05:50 : How can i enumerate through a text document by pages to check its individual header? Use interface com.sun.star.text.XPageCursor, from a com.sun.star.text.TextViewCursor. It provides, among others : boolean jumpToFirstPage() boolean jumpToNextPage() See Developer's Guide http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/TextViewCursor Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] OpenOffice.org BASIC - Global variables
Hi Johnny, Message de Johnny Rosenberg date 2009-07-17 18:21 : As I understand it, global variables should be declared first of all, before all subroutines and functions in a module, right? Like this: CODE Option explicit Global x As Long, y As Object, z As Variant, k As String Sub MySub1 ' Lot of things going on here End Sub Sub MySub2 ' Lot of things going on here End Sub Sub MySub3 ' Lot of things going on here End Sub Correct. But what's inside the Sub is important ! When my code does not work, I suspect my code first. I verified with a simple code : Sub MySubB1 x = x+1 MsgBox x End Sub Sub MySubB2 z = z +3.5 MsgBox z End Sub Sub MySubB3 k = k A MsgBox k End Sub And, of course, it works as expected. Same with an object variable. So, it's obvious that I need at least the search descriptor to be a global variable, because when I search for the first time the descriptor is created and when I want to search for the next occurance I need to use the same descriptor again making sure that I really find the NEXT occurance each time, not the same one. Make sure that you first assign a search descriptor to your Object variable before filling one of the descriptor fields. Else the variable will be Null and you get an error. Do I also need to declare my variables within each subroutine that is using them, using the Dim statement? Certainly not. This would create a local variable which would hide the global one inside the Sub. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Avoiding Moving The Cursor Before Start of Document
Hi Hal, Message de Hal Vaughan date 2009-06-26 08:41 : Sub InsertAutoMacroText oDoc = ThisComponent oCurs = oDoc.getCurrentController().getViewCursor() iEnd = false iCount = 0 Do 'Go back one character, then get that character and put it in a separate variable 'for comparison. oCurs.goLeft(1, true) sKey = oCurs.getString() sChar = Left(sKey, 1) 'BUG: This next line throws an error if we try to use this at the start of a document. Methods goLeft and goRight return a boolean True if the move could be done, False if it failed. if oCurs.goLeft(1, True) then ' do your job else ' already at start of text end Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] How to find the Default paragraph style
Hi Andrew, A style has an internal name and a localized display name. A custom style has the same internal name and display name. Built-in styles may have a display name different from the internal name. The built-in paragraph style with internal name : Standard has a display name Default in english locale. In french locale, the display name is Standard ... Method getName() returns the internal name of a style. Property DisplayName contains the displayed name. Dim paragStyles As Object, aStyle As Object paragStyles = ThisComponent.StyleFamilies.getByName(ParagraphStyles) aStyle = paragStyles.getByName(Standard) MsgBox(aStyle.DisplayName, 0, Displayed style name) Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Problems with clearContents in OO 3.1 (XP and W2K)
Message de Bart Aimar date 2009-06-05 12:20 : Thomas Krumbein ha scritto: Hey Bart, Hai Thomas, Works well under Vista and OOo 3.1 :-) Yes, under Vista seems working properly... like under Linux. Hi, I confirm on Windows XP, OOo 3.1.0 : - macro run on sheet 1 : OK - macro run on sheet 2 : one of my two CPU cores is 100% busy and the macro never finishes. Need to kill OpenOffice. Strange bug. You should create an Issue. Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Adding text to a TitleTextShape on an XDrawPage
Hi Jeremy, First add the form on the draw page. Then setString. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] UNO API features question
Hi Richard, OpenOffice documents may be handled through COM Automation (on MS-Windows), using OpenOffice API. See the Developer's Guide http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Bridge For an easy access with VB/VBA/VBScript, get VBx OOo tool : http://www.ooomacros.org/dev.php#240562 Hope this helps Bernard Message de Richard Georg Bayer date 2009-05-21 09:31 : Hi dev, I read through some things about OOo, but did not find this: Can OpenOffice be launched from an application and driven trough it's UNO API? The purpose would be to build up documents via this API. I know I could use ODF Toolkit, but this is about OOo. Example: A long time there was no other way to build Excel workbooks from a server than to have an instance of MS Excel running and instructing it what value to put to which cell. So, are there simillar features, like thise the API of MS Office exposes? And if so, can someone please give me hint, where to start reading? Thanks for anything, Richard G. Bayer - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Unfortunate document event name - how to fix it?
Message de Ariel Constenla-Haile date 2009-05-14 17:04 : Hello Mathias, On Wednesday 13 May 2009, 14:14, Mathias Bauer wrote: The best documentation is an API that doesn't need one. This deals with the fact that people don't like to read documentation. Having speaking names for events is a good thing per se, not just some language aesthetics. Yes, auto-documentation by correct naming is always better. But keep in mind that vocabulary words can be ambiguous in a given language, can be wrongly chosen by a non-english designer, and can be wrongly interpreted by a non-english reader. To get rid of ambiguity you need further explanations, and that is documentation. Besides, it's true that people don't like reading documentation (and also that developers in general don't like writing documentation). We often see people asking questions without even reading first the API ref. nor the Dev's Guide (and not even searching on the mailing list if the theme has already been discussed), but this is a general problem I see also on other mailing list (people have become simply more lazy). I agree (sigh) and these people never achieve a code without help from those who have spent time to read and understand the documentation. It would be more useful to spend time on improving the API documentation (IDL and Developer's Guide) and correcting known API issues. Sure. But I think documentation can be done by anybody knowing about the API, developers as well as users. In general, that's not true. For writing serious documentation you need some information about its implementation; but API user only know the specification and how to use the API. I have several remarks here: - IDL documentation should be written by the developer, because only him/her knows exactly the definition of the services, interfaces, properties etc that he/she has designed. It should be as clear and precise as possible. - IDL is not sufficient in itself, textual explanations and some illustrative examples are necessary to understand the philosophy of an API. This initial description should be written by its developer, in the Developer's Guide. - Further explanations, hints, code examples in different languages, may be added by API users, either in the Developer's Guide or in separate wiki pages that should be linked from the Developer's Guide. - An API user should not be compelled to read the code, this is contrary to the principle of an API. Take for example the description of the parameters for PDF export http://wiki.services.openoffice.org/wiki/API/Tutorials/PDF_export. This fantastic page was written by Ariel, certainly after lengthy reading of the source code. I think that most of it should have been written by the developer in the Developer's Guide. Without this information, the PDF export API is useless for an ordinary user. And the developer should update it when he/she changes or adds parameters. - An API user can find lots of things that are not documented, by playing with the API and using introspection tools (Xray, MRI, etc). Understanding the API through these tools is much easier than delving into the official documentation (and not finding what you look for). The problem here is that the API user cannot distinguish what is really part of the contract and what is un-intended (but useful) behaviour of the API. So he/she may create user code based on a feature that is not supported. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Unfortunate document event name - how to fix it?
Message de Matthias B. date 2009-05-12 11:06 : On Mon, May 11, 2009 at 10:56 AM, Mathias Bauer nospamfor...@gmx.de wrote: For the time being we had to keep OnLoad for compatibility reasons (both for registering as well as for sending), but the documentation would be changed to suggest OnOpen instead. This can be changed (and perhaps will be changed) in the first release that allows for incompatible API changes (I assume this will be 4.0). Alternatively, we can stay with OnLoad until the incompatible change and then switch to OnOpen without any intermediate compatibility arrangements. Comments, anyone? That you even consider removing this event is exactly the lack of commitment to compatibility I have critized in the long thread about OOo quality recently. There is ONLY ONE acceptable solution for changing the name. - introduce the new event name - keep the old event name for compatibility FOR ALL ETERNITY. It is NOT acceptable to retire it with OOo 4.0! NOT acceptable to retire it with OOo 5.0. People build their businesses on OOo. Your petty interests in language aesthetics are irrelevant! If you are worried about the overhead of sending the same event twice, well, there's also this option: - Live with the bad name, compensate it with good documentation and then find something more productive to waste your time on than breaking existing code. Matthias I totally agree with the opinion and arguments of Matthias B. There are many cases of unfortunate names in the API, this is not a good reason to change the API. Having a correct description in the documentation is enough. It would be more useful to spend time on improving the API documentation (IDL and Developer's Guide) and correcting known API issues. Some examples: API doc : issues 67088, 79943 API : issues 22625, 64800, 93716 Regards Bernard Marcelly - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] OOo equivalent of Winword Sections
Hi Laurent, Your code does not work (in Basic). The number of sections is displayed by: print ThisComponent.getTextSections().getCount() Without any programming, the Navigator lists the sections in a document. For further investigation, delete any confidential data in your document and make it downloadable from a site like http://www.mediafire.com/ Regards Bernard Message de Crivello, Laurent date 2009-05-01 13:36 : Dear All, I have a Microsoft Word document with multiple Sections in it. When I perform a Section enumeration, the result is '0' (see code below) alltextSections = doc.getTextSections().getElementNames() print len(alltextSections) Is there an equivalent of Sections in OpenOffice which has another name ? How to enumerate them then ? Thanks a lot ! Laurent - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] How to access the properties of an dialog which is not created at runtime
Hi Benjamin, The property Step is found on the model of the dialog and on the model of each control. See Developer's Guide, section Graphical User Interfaces Dialog Creation and its sub-sections. http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/GUI/Dialog_Creation Regards Bernard Message de Benjamin Vollmer date 2009-04-30 10:39 : Hello, in my extension written in java I load dialogs which I created with the OOo dialog editor via XDialogProvider.createDialog(). Now I want to access the properties of one dialog which should offer a wizard functionality. For this purpose I need the property step. Is it possible to get this value and manipulate it? In the developers guide I didn't found a solution for this. regards Benjamin - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Problem with my Eventhandler under OOWriter 3.x (Exception)
Hi Alex, According to the IDL documentation, XEventListener is deprecated. Use (still unpublished) XDocumentEventListener. http://api.openoffice.org/docs/common/ref/com/sun/star/document/XDocumentEventListener.html Regards Bernard Message de Alex P date 2009-04-29 12:37 : Hello! I've got a Problem with the registration of my Event-Handler since I installed OpenOffice.org 3. My Basic script to register my simple Eventhandler seems to be obsolete and I dont find the correct fix for this. I only want to capture the Close of my Document to sent a message to my application. Here my old script (from an old OO example), which produces this Exception: Type: com.sun.star.lang.IllegalArgumentException Message: cannot coerce argument type during corereflection call! Sub StartCloseListening() oDoc = ThisComponent oEventListener = CreateUnoListener( DocCloseListener_, com.sun.star.lang.XEventListener ) oDoc.addEventListener( oEventListener ) --- Here comes the exception!! End Sub Sub DocCloseListener_disposing( oEvent ) AutoClose() End Sub Thanks for Help Alex P. - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Problem with my Eventhandler under OOWriter 3.x (Exception)
Message de Mikhail Voytenko date 2009-04-29 15:00 : Hi Bernard, Alex, com::sun::star::lang::XEventListener is not deprecated. The problem looks to be that the document implements two addEventListener() methods that differ only by the type of the provided argument. You need the one that gets com::sun::star::lang::XEventListener. OOps ! I confused with c.s.s.document.XEventListener Here is the solution in Basic : you have to indicate the correct interface to use. The underline character replaces the dot or :: separator. oDoc.com_sun_star_lang_XComponent_addEventListener( oEventListener ) Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Extension's help file(xhp) in Japanese
Hi, Message de sakimotok date 2009-04-10 12:20 : Hi, I am developing an extension using NetBeans OOo plugin. I followed the DeveloperGuide for adding a help file for extensions. The example worded fine. DevGuide: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Extensions/Help_Content I added Japanese texts in the example's xhp file, and I changed the xml-lang to ja. The oxt file is successfuly built, but when I tried to install the extension, I got an error: input is not proper utf-8 indicate encoding which points to the exact line of help file where I added the Japanese texts. The xhp files must be written in utf-8 encoding. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] GroupShape in Java
Hi Ariel, Message de Ariel Constenla-Haile date 2009-03-27 11:58 : look at the code I attached to my answer in d...@graphics.openoffice.org (IIRC I CCed this list and you, so you'll get the fileon your mail). Grouping with a css.drawing.GroupShape seems not to work in Wirter (may be you can submit an issue with your demo attached), so better try grouping with a css.drawing.ShapeCollection. Regards The code example for Writer in the Developer's Guide Wiki should be completely changed. http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Drawing_Shapes Could you replace it by the Writer part of your demo code ? Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] GroupShape in Java
Hi Sebastian, Message de Sebastian Patschorke date 2009-03-26 16:50 : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello! I asked my question at d...@graphics.openoffice.org. But Christian isn't sure about the support of the API. So I ask here again :-) See http://graphics.openoffice.org/servlets/ReadMsg?list=devmsgNo=1516 How can I group some shapes and add them to a text document with Java? I have a XTextDocument and a XTextRange. In the example at http://api.openoffice.org/docs/DevelopersGuide/Drawing/Drawing.xhtml#1_3_2_2_5_Grouping_2C_Combining_and_Binding there is xDrawPage used to create a GroupeShape. How can I handle the creation with the XTextDocument? A Writer document has a DrawPage for the whole document. You get it with getDrawPage() from xDrawPageSupplier. See example in the Developer's Guide, Writer section http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Text/Drawing_Shapes Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [Fwd: Re: [api-dev] How to search inside notes ?]
Hi all, As a reminder, I have created enhancement Issue 100557. http://www.openoffice.org/issues/show_bug.cgi?id=100557 I wish it can be included in version 3.2. Regards Bernard Message de Mathias Bauer date 2009-03-13 23:19 : Maximilian Odendahl wrote: Hi, Searching into Writer notes is introduced with version 3.1. And it works, for the user. Was the API user forgotten ? no, it was not forgotten, but you are right, this is not yet possible, there are TODO's inside the code. Not sure about it, but maybe it was not possible in regards to API compatibility. @mba: are these information correct? Currently I think we can use the PropertySet of the SearchDescriptor service. But I would like to not to rush things here and think a little bit more. It's also more than a few lines of code to write. Regards, Mathias - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] FilePicker now needs initialize (for some OS)
Hi all again, I have added Issue 100214 : FileControl control does not work in Vista or MacOS. So the problem is more general than thought in Issue 90219. Would be fine to correct it for 3.1... Regards Bernard Message de Bernard Marcelly date 2009-03-14 18:01 : Hi all, Users of OOo 3.0 on Windows Vista have complained that opening a file with com.sun.star.ui.dialogs.FilePicker simply does not do anything in Vista (while it works in Windows XP and other OS, and also on Vista with 2.4.2). This is only with the system FilePicker, not OpenOffice FilePicker. In this thread http://www.oooforum.org/forum/viewtopic.phtml?t=80127 the forum member vicrh has cleverly found that Issue 90219 is the same problem (reported on MacOSX). He says that in Vista, FilePicker will work again if it is initialized to the constant com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE which has value zero. The responsible for the Issue says the File Picker should always be initialized, and wants to throw an exception if not, instead of using the default value zero. I think it is a regression (of the API), as there are numerous existing codes which do not initialize for a simple File Open, and which have been working for years on various OS and OpenOffice versions. I'd like the advice of other API designers. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] FilePicker now needs initialize (for some OS)
Hi all, Users of OOo 3.0 on Windows Vista have complained that opening a file with com.sun.star.ui.dialogs.FilePicker simply does not do anything in Vista (while it works in Windows XP and other OS, and also on Vista with 2.4.2). This is only with the system FilePicker, not OpenOffice FilePicker. In this thread http://www.oooforum.org/forum/viewtopic.phtml?t=80127 the forum member vicrh has cleverly found that Issue 90219 is the same problem (reported on MacOSX). He says that in Vista, FilePicker will work again if it is initialized to the constant com.sun.star.ui.dialogs.TemplateDescription.FILEOPEN_SIMPLE which has value zero. The responsible for the Issue says the File Picker should always be initialized, and wants to throw an exception if not, instead of using the default value zero. I think it is a regression (of the API), as there are numerous existing codes which do not initialize for a simple File Open, and which have been working for years on various OS and OpenOffice versions. I'd like the advice of other API designers. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] How to search inside notes ?
Hi all, Searching into Writer notes is introduced with version 3.1. And it works, for the user. Question : how to do this with the API ? - service com.sun.star.util.SearchDescriptor does not document a corresponding boolean item. - function createSearchDescriptor returns an object without such item. Was the API user forgotten ? Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] No more lck file with HSQLDB Base ?
Hi, Issue 97032 has target OOo 3.1 and indicated as verified fixed in CWS dba31h. Now, dba31h_OOO310 is integrated into OOO310m2 but the problem is still here : no lock file when opening an odb with integrated hsql database. Was the patch forgotten ? Regards Bernard Message de Frank Schönheit - Sun Microsystems Germany date 2008-12-08 20:38 : HI Bernard, I am playing with DEV300m37 on Windows XP. I found that when I open a table or form in a Base document using internal HSQLDB, no xxx.lck file appears. In the same situation (same Base doc) in OOo 3.0 the .lck file does appear. Is it intentional ? That's not intentional, and most probably a regression of the update to HSQLDB 1.8.0.10, which happened in DEV300m30. The problem is now known as issue 97032, thanks for finding it! Perhaps related to Issue 93381 ? Not at all. Ciao Frank - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] XCell methods getValue and getError
Message de Petteri Larjos date 2009-02-13 15:34 : I am using UNO C++ API and need help with XCell interface (again). How I can set cell value to empty? I tried xCell-setFormula(OUString()) but xCell-getType() does not return CellContentType_EMPTY after that. Any ideas? I also need set cell to '#N/A'. How I can set error codes? I tried to xCell-setValue(NAN) but it gives '#NUM!'. Hi, Answers are in Basic. ' setting cell to empty myCell.setString() ' setting cell to NA myCell.setFormula(=NA()) Remark: the subject of your mail has no relation with the question. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Finding Formula objects in a Write document
Message de Andrew Douglas Pitonyak date 2009-02-03 16:50 : How can I find a Formula object in a paragraph? I used a simple enumeration of the text object, and I even found the text section containing the formula. I only know this, however, because I used a very simple document with simple text and a formula (or two). The enumeration starts as follows: oParEnum = oDoc.getText().createEnumeration() Do While oParEnum.hasMoreElements() oPar = oParEnum.nextElement() If oPar.supportsService(com.sun.star.text.Paragraph) Then oEnum = oPar.createEnumeration() Do While oEnum.hasMoreElements() oSect = oEnum.nextElement() I found the formulas with yet another enumeration: if oSect.supportsService(com.sun.star.text.TextPortion) Then if oSect.TextPortionType = Frame then oTcEnu = oSect.createContentEnumeration(com.sun.star.formula.FormulaProperties) Do While oTcEnu.hasMoreElements() oTc = oTcEnu.nextElement() oTc is the embedded formula object. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Varying results when connecting to OOo through COM
Message de Bernard Marcelly date 2009-02-03 19:29 : Message de Cor Nouws date 2009-02-03 12:34 : Hi *, Some months ago, I reworked some functions in Lotus Script to connect with OpenOffice.org Part of the functions take care to insert and resize a picture. With some experience and info found on the web, all worked OK. But later, the same code produced an error.. The line: lPictureSoureceRatio = oGraph.GraphicObjectFillBitmap.Size.Height / oGraph.GraphicObjectFillBitmap.Size.Width produces error Instance member GraphicObjectFillBitmap does not exist OTOH, the line: lPictureSoureceRatio = oGraph.Graphic.Size.Height / oGraph.Graphic.Size.Width works fine, but does not necessarily have to give the correct result. See IDL description of service com.sun.star.drawing.GraphicObjectShape GraphicObjectFillBitmap : Deprecated. Use graphic property instead! You have to insert the image in the document first. Only then you can get useful information from Graphic. I forgot this related issue: Issue 93716 : Size100thMM not filled-in if image contains EXIF data Current target : OOo Later Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Basic: reading Locale from configuration returns only language for Dutch installation
Message de Cor Nouws date 2009-02-01 01:14 : reading this http://api.openoffice.org/docs/common/ref/com/sun/star/i18n/LanguageCountryInfo.html and knowing what is returned for other languages (en_GB for exmaple), I wonder how it is possible that for my local Dutch installation, I get only nl as return value in this function: Hi Cor, A Locale is primarily a language (the first part, lower case). This language may or not be specialised for a particular country (the second part, upper case). The language of your installation depends on the langpack it uses. The Locale is indicated in the file names of the installation package. You can see in the mirror servers that exists: en-US, fr, de, nl But not fr-FR, not fr-BE, not nl-NL. This simply means that there is no country variant langpack available in OpenOffice. In the langpacks for 3.0.1RC2 however I can see en-US, en-GB, en-ZA (i.e. english variant of South-Africa). Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Problem with SXW filter in oo-2.4
Hi John, In OpenOffice 1.1.x the property Name of a shape in Writer is not shown by the user interface but it can be found and displayed by macro. I can confirm your observation, using OpenOffice 3.0 and 1.1.5. You don't need macros to reproduce. Create a Writer document in 3.0, add a shape, name it (with user interface). Save the document in ODF format : doc2.odt file. Save as OOo 1.1 format : doc1a.sxw file. Open doc2.odt file with 1.1.5. The name can be displayed by macro. Save as OOo 1.1 format : doc1b.sxw file. With OpenOffice 3.0, open the doc1a.sxw file : the name is an empty string. With OpenOffice 3.0, open the doc1b.sxw file : the name is still here. IMHO, since the name is the only way to retrieve a particular shape among several shapes, it is a severe regression. Perhaps a solution to your problem is using OOo 1.1.5 to save in sxw format. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
Re: [api-dev] Setting Cell Annotation text attributes
Message de Andrew Douglas Pitonyak date 2009-01-17 04:27 : I would also like to be able to set the font for text in a CellAnnotation (note). Using the GUI, I can select text in an annotation and set the font. When I look at the Wiki, it specifically says that I can not do this: http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Cell_Annotations When I get an annotation from a cell, I see no mechanism for setting text attributes such as font. Hi Andrew, See Issue 96587 : Notes API does not support text formatting Target is OOo 3.1 (still valid?) Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] Usability of presentation.XSlideShowController
Hello, com.sun.star.presentation.XSlideShowController is still in unpublished state in the latest SDK. This interface has interesting features, many working but some do not work in DEV300m37. Is it useful to create issues ? Changing the value of attribute MouseVisible does not change the visibility. Changing the value of UsePen or PenColor has visible effect only after you change slides, which is not practical. Example in Basic: Dim pc As Object, coul As String pc = ThisComponent.Presentation.Controller if IsNull(pc) then Exit Sub ' slideshow not running coul = RGB(150,50,0) ' brown pc.UsePen = True ' workaround to make the pen write, and use the correct color pc.gotoNextSlide pc.gotoPreviousSlide There is a method gotoBookmark. What is a bookmark in Impress? I could not make it work. Method stopSound does not stop a transition sound. Regards Bernard - To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org For additional commands, e-mail: dev-h...@api.openoffice.org
[api-dev] No more lck file with HSQLDB Base ?
Hi, I am playing with DEV300m37 on Windows XP. I found that when I open a table or form in a Base document using internal HSQLDB, no xxx.lck file appears. In the same situation (same Base doc) in OOo 3.0 the .lck file does appear. Is it intentional ? Perhaps related to Issue 93381 ? Regards Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Removing focus from a control
Hi Andrew, I found the same problem with a simple control Button. You have to set focus again on the document window (sort of). Just add this instruction at end of your macro: oFrame.ContainerWindow.setFocus By the way, I did not know the .uno:SetInputMode trick ! __ Bernard Message de Andrew Douglas Pitonyak date 2008-10-28 04:36 : I was recently asked how to solve a simple problem. A checkbox in a Calc document calls a macro when it is clicked. I want the macro to select a cell such that the cell is in input mode. Ignoring the checkbox, I can use code similar to the following: Sub CellSelectOne Dim oCell Dim oSheet REM Get the first sheet. oSheet = ThisComponent.getSheets().getByIndex(0) REM Get cell A2 oCell = oSheet.GetCellbyPosition( 0, 1 ) REM Move the selection to cell A2 ThisComponent.CurrentController.Select(oCell) Dim oFrame Dim oDisp oFrame = ThisComponent.CurrentController.Frame oDisp = createUnoService(com.sun.star.frame.DispatchHelper) oDisp.executeDispatch(oFrame, .uno:SetInputMode, , 0, Array()) End Sub I even tried this: Dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = ToPoint args2(0).Value = $G$4 oDisp.executeDispatch(oFrame, .uno:GoToCell, , 0, args2()) When the macro returns, the checkbox still has focus. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] How to choose ODF version in document saving
Hi, With OOo 3.0 API how can I store a document in a specific ODF version ? For example, with .store() or .storeAsURL() force the use ODF version 1.0/1.1, whatever the current value in Tools Options Save. Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] API discussion/announce in the API mailing list?
Message de Ariel Constenla-Haile date 2008-10-20 05:06 : my proposal[1]: why not announcing and discussing this topics directly in *this* API mailing list? (and let [EMAIL PROTECTED]/ [EMAIL PROTECTED] for internal C++ API or whatever name you give to the core C++ code) They way I see it, we API clients are the end-users and target audience of such announces/discussions, and I guess most people here are not aware of, nor subscribed to, these interface-xxx mailing list; so announcing/discussing here would be more public and fruitful. Regards Ariel. +1 Addition : a similar message appeared in a more user-readable form in the list [EMAIL PROTECTED] - yet another list, more general - Suggestion: There are now web sites that copy some of the mailing lists, so you can read them from time to time without subscription. Examples: http://www.mail-archive.com/[EMAIL PROTECTED]/ http://www.mail-archive.com/interface-announce%40openoffice.org/ and some dev lists : http://www.mail-archive.com/dev%40api.openoffice.org/ http://www.mail-archive.com/dev%40dba.openoffice.org/ http://www.mail-archive.com/dev%40udk.openoffice.org/ The announcement for DocumentEvent is http://www.mail-archive.com/[EMAIL PROTECTED]/msg00577.html For important features like this one, dropping a short message pointing at the web-accessible message would be easy. GMANE also follows some openoffice list and displays differently: http://dir.gmane.org/search.php?match=gmane.comp.openoffice Regards Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[api-dev] User cannot see document Custom Properties
Hello, Back one year ago a Gulfoss blog promised for OOo 3.0 a new UI to display or change value, add, remove document Custom Properties from menu File Properties. http://blogs.sun.com/GullFOSS/entry/custom_properties_and_fields Here is OOo 3.0.0, this user interface has not changed. Was it forgotten, or is it delayed ? The current way to see (not change) such new properties is through menu Insert Fields. Not really user friendly. Regards Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] OOo 3.0 SDK
Hi, Message de Finn Gruwier Larsen date 2008-10-14 16:10 : Hi, Can anyone give me at clue when the SDK for 3.0 will be released? The SDK for 3.0.0 RC4 is already in the servers, section contrib/rc/3.0.0rc4/ The list of servers is available here http://distribution.openoffice.org/mirrors/ Regards Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Select function in XMenuListener is a reserved word
Hi Carlos, Message de Carlos Rocha date 2008-09-18 22:42 : Hi, I'm trying to make an activex wrapper in VB6 to simplify the use of listeners with automation bridge. With more or less work I've been able to put them to work, but now I got a problem I can't solve by myself :( The function select in XMenuListener is a reserved word in VB6 and it refuses to compile no matter how I escape it. Did you try the CallByName function of VBA ? CallByName oMenuListener, select, vbMethod, oMenuEvent __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Basic Dialogues doesn't look like when I created them.
Hi, Message de Johnny Rosenberg date 2008-09-14 02:27 : In this case I created the dialogue with OpenOffice.org 2.0.4, Operating system=Xandros for Eee PC (using an Eee PC 900, Swedish). After loading the document into my Ubuntu 8.04 laptop (not the Eee) with OpenOffice.org 2.4.1 it looks wrong. Probable reason: Ubuntu own version of OpenOffice is troubled by Compiz. Workaround : disable Compiz or install original OpenOffice. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Non modal dialog staying in front ?
Hi Laurent :) You cannot put a dialog window at front _and_ work with another window : this is not a floating toolbar. A little improvement is to hide the current document window and show the dialog. The dialog window will be visible but of course out of focus if you work on another OOo window. The user may position the (small) dialog window next to the other document window, to see both. Dim dlg As Object, currWin As Object ' dlg is the dialog, of course currWin = StarDesktop.CurrentFrame.ContainerWindow currWin.Visible = False dlg.Visible = True Wait(1) ' 10 seconds to work with another document dlg.dispose currWin.Visible= True MsgBox(That's all folks !) __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] XCellFormatRangesSupplier on multiple selections
Hi Dietmar, Message de Dietmar Hiller date 2008-07-09 21:23 : It works fine if I select a continous range of cells (e.g. A1:C3), but I select e.g. A1:A3 and C1:C3 (so 2 ranges), xFormatSupp is null. If you select several zones you get a com.sun.star.sheet.SheetCellRanges object. This is a container of com.sun.star.sheet.SheetCellRange objects. Use getCount and getByIndex to find each cell range. It's much easier to see in Basic with Xray tool: Xray ThisComponent.CurrentSelection Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] How to use com.sun.star.ui.dialogs.FolderPicker such that it works as documented ?
Message de Thomas Krumbein date 2008-06-14 16:56 : Hi rony, Rony G. Flatscher schrieb: [..] Platform is Windows XP SP 3. [..] However, this does not work at all. Tried all variations (system file path, URL, with and without trailing slash, feeding the directory path exactly like the service returns it). It is a bug of Windows - i guess, you use the windows own dialogs? Change to OpenOffice.org own dialogs (Extras - options - OOo - general) and it will work :-) It's a bug from OpenOffice 2.x. It works on 1.1.x with Windows dialogs. See Issue 64800 (targeted 3.x) created 2 years ago. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] compile button in Basic IDE
Hi, Message de Cor Nouws date 2008-05-16 17:51 : Hi, The compile button in Basic IDE does very little for me. From former experiences, I expect it to give warnings for non declared variables, for example (option explicit ON, of course). Wrong expectation? Bug, Enhancement? The compile button compiles the code of the module... as its name says. During the compilation process it may find syntax errors in the module, e.g. incorrect if/then/else usage. You should eradicate syntax errors in each module before running, otherwise you will have strange errors. Compilation will not find run-time errors. In OOoBasic, non declared variables are found during execution, not at compilation. Because variables and sub/function may be declared in another module, or even in another library. Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Reconising haard coded textportions
Message de Fernand Vanrie date 2008-04-29 16:14 : when a paragraph has only 1 textportion, the whole pargraph was hardcoded , then the PropertyState indicates that there was no hardcoding (com.sun.star.beans.PropertyState.DIRECT_VALUE = 1) Is this a issue are am i missing something Hi Fernand, You should first test the PropertyState for the paragraph itself. In your case it indicates DIRECT_VALUE. If it indicates DEFAULT there may be changes in a text portion. Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] copy/paste with dispatcher
Message de Atte André Jensen date 2008-04-24 11:49 : Hi I'm trying to copy a part of a document while preserving the formatting with python. Here's the code I have: print rangeCursor.String controller = doc.getCurrentController() controller.select(rangeCursor) frame = controller.getFrame() properties = () dispatch_helper.executeDispatch(frame, .uno:Copy, , 0, properties) dispatch_helper.executeDispatch(frame, .uno:Paste, , 0, properties) dispatch_helper.executeDispatch(frame, .uno:Paste, , 0, properties) Hi, Your Copy and Paste instructions work on the same range... You have to select the origin range, Copy, select the destination range, Paste. Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] copy/paste with dispatcher
Message de Atte André Jensen date 2008-04-24 13:56 : Bernard Marcelly wrote: Your Copy and Paste instructions work on the same range... You have to select the origin range, Copy, select the destination range, Another angle (that also suggests something else is wrong): I recorded a simple macro (select all, 2x paste) in openoffice, and it looks like this: ( ... ) This suggests that selecting a range, and dispatching Paste two times should indeed copy the selected text, something I cannot make my example do. So another question: Don't I need to tell dispatcher which range I want to copy from? In my code I did: controller = doc.getCurrentController() controller.select(rangeCursor) frame = controller.getFrame() properties = () dispatch_helper.executeDispatch(frame, .uno:Copy, , 0, properties) and assumed that this would set the range. Is that infact the problem with my code? How do control which range the dispatcher uses for it's copy/paste operation? My answer is the same as previous. Here is a recorded macro that works : Start record, selection of A2:B4, Copy, click D7 of the same sheet, Paste, click C15 of the same sheet, Paste, End record. I have suppressed superfluous comment lines. dim document as object dim dispatcher as object document = ThisComponent.CurrentController.Frame dispatcher = createUnoService(com.sun.star.frame.DispatchHelper) dim args2(0) as new com.sun.star.beans.PropertyValue args2(0).Name = ToPoint args2(0).Value = $A$2:$B$4 dispatcher.executeDispatch(document, .uno:GoToCell, , 0, args2()) dispatcher.executeDispatch(document, .uno:Copy, , 0, Array()) dim args4(0) as new com.sun.star.beans.PropertyValue args4(0).Name = ToPoint args4(0).Value = $D$7 dispatcher.executeDispatch(document, .uno:GoToCell, , 0, args4()) dispatcher.executeDispatch(document, .uno:Paste, , 0, Array()) dim args6(0) as new com.sun.star.beans.PropertyValue args6(0).Name = ToPoint args6(0).Value = $C$15 dispatcher.executeDispatch(document, .uno:GoToCell, , 0, args6()) dispatcher.executeDispatch(document, .uno:Paste, , 0, Array()) Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Naming a Toolbar Add-On
Message de Tobias Krais date 2008-04-04 10:55 : Hi Ariel, thank you for your help. I tested a lot but had no success... Have a look at the Extension Compiler http://wiki.services.openoffice.org/wiki/Extensions_Packager#Extension_Compiler It may look complex at first sight, but it's easier than handling those xml files yourself. Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] any workaround for issue 84718?
Message de Mathias Röllig date 2008-02-27 15:38 : Hello! I created a form document for a costumer so one can dial a phone number from this form. The macrocode for this uses SystemShellExecute. It worked fine until OOo 2.1. Now it doesn't work but the costumer want to use it. The target of this issue is set to OOo 3.0. But is there a usable workaround till then? Mathias This works for me in Basic (Windows XP, OOo 2.4.0 RC1, Thunderbird 2.0.0.12). I use Basic Shell function. Shell(C:\Program Files\Mozilla Thunderbird\thunderbird.exe, 1, -compose mailto:[EMAIL PROTECTED], False) __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] How to use structs with COM/Automation?
Message de Dmitry Teslenko date 2008-02-26 16:04 : Hello! I've using OO api via COM/Automation and I've stumbled upon this thing: I can't instantiate/manipulate structs such as com.sun.star.beans.PropertyValue or com.sun.star.table.CellAddress. COM/Automation is acessed via Trolltech Qt's wrapper, QAxContainter (In brier, this wrapper can perform fuction calls, retrieve sub-objects and read/write properties). Is there any constructors for structs such as ServiceManager.createInstance(...)? This is described in the Developer's Guide, chapter Professional Uno Uno language bindings Automation Bridge. To get a structure like com.sun.star.beans.PropertyValue, see http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Usage_of_Types They are widely used in the API, if you cannot instantiate them and use them in your language you can't pilot OpenOffice. (This answer is also valid for your other mail). ServiceManager.createInstance(...) returns a Uno object, not a Uno structure. See also the beginning of Dev'Guide Automation Bridge for more explanations. http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Bridge/Automation_Bridge Regards Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] xStorable.getLocation() return old MS-DOS style path - How to solve?
Message de Tobias Krais date 2008-02-19 12:28 : Hi together, I have a litte application and need to know the full path of the current document. Thus I use the XStorable interface. Using the xStorable.getLocation() method returns on a Windows XP system (using OOo 2.3): file:/F:/DOKUME1/Tobias/EIGENE1/... Correct would be: file:/F:/Dokumente und Einstellungen/Tobias/Eigene Dateien/... Is there a way to get the REAL full path of the document? Hi, I don't have this problem on Windows XP Home, using NTFS file system. Both getLocation on XStorable and getURL on the XModel return the complete address, not the 8+3 Dos-compatible notation. Perhaps a particular config of your Win XP? Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] CustomShapes not visible after drawing with API
Message de Daniel Rentz date 2008-01-30 15:43 : Sven Jacobi schrieb: To ease the creation of shapes, we added the interface com::sun::star::drawing::XEnhancedCustomShapeDefaulter which is able to create the geometry for many shapes. But I am sorry, this Interface is not yet accessible from basic. I wrote following issue: https://so-web.germany.sun.com/iBIS/servlet/edit.ControlPanel?tid=i85724 This is an internal link, please use http://www.openoffice.org/issues/show_bug.cgi?id=85724 This interface is not described in the IDL ... And Custom shapes are still not described in the Developer's Guide. API Developers, please do not forget the documentation ! __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] How to now when a structure is empty ?
Message de Fernand Vanrie date 2008-01-08 13:47 : For retrieving the demensions of an TextTablecell i uses : CurRow.TableColumnSeparators() who gives me a structure widt isVisible and Position of all the columns off the row. when the cells are merged then there is no longer a Separator position. Xraying the structure says its empty but isempty(structure) gives me False !! So how can i find out when this structure has no more ellements ?? TableColumnSeparators is a sequence of structure. In Basic it is an array of structure. An empty array has an upper bound of -1. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] How to unselect a current sleection
Message de Fernand Vanrie date 2008-01-07 12:26 : Hei, I need the current selection made by the UI but after I worked on the object I wont to UNselect the slection made by the UI so in basic: object = thiscomponent.getcurrentselection i do somthing with the object and now I hav to unselect the object It depends on the document. In Writer, Calc, AFAIK there is always a selection : in Writer it is a collapsed cursor, in Calc it is the current cell. In Draw it is a Null. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Get XTextTable service, cursor is in (Java)
Message de Dietmar Hiller date 2008-01-03 19:46 : I am trying to change the border of a texttable, the cursor is in. In OOo Basic it worked like this: What you are trying is not easy, because it depends on what is selected. In the simplest case, nothing is selected, the cursor is inside a cell of a text table. But you have other cases : - one or more text ranges selected in a cell - one or more text ranges selected in several cells - several contiguous cells selected Each case is a specific selection case. This is not exhaustive. The user could simultaneously select a range inside a cell of your text table and another range in another text table and another range in the main text! For the simplest case, you get some info with this Basic code: dim oView As Object, oVCursor As Object Dim oTable As Object, oCell As Object oView = ThisComponent.getCurrentController() oVCursor = oView.getViewCursor() ' caution : oVCursor.TextTable is void if the cursor is not in a text table oTable = oVCursor.TextTable ' caution : oVCursor.Cell is void if the cursor is not in a text table oCell = oVCursor.Cell print oCell.CellName If you want to investigate oSelection for the different cases you should use Xray and look at the detailed information it displays. Hopefully it will help you in translating to Java. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Constant group with varying datatypes ?
Message de Rony G. Flatscher date 2007-12-29 22:50 : Jim White wrote: Rony G. Flatscher wrote: just curious: ran over the definition of com.sun.star.packages.zip.ZipConstants, which lists constant values of *different/varying* (!) types! Is that an error or to be expected? ... And if you look at the definition of the API, you'll see that your reflection is exactly the types specified (after UNO-Java mapping): http://api.openoffice.org/docs/common/ref/com/sun/star/packages/zip/ZipConstants.html Being a bit unsure, the question still would be, whether it is really intended that a constant group's values can be of different types (because then the constant group may not consist of type compatible values such that the programmer needs to know what constant values from a constant group s/he is drawing and assigning to attributes/properties). In other constant groups of the API, all the constants of a group are used for the same purpose, setting a value in a particular property or in a method argument. Here we have constants of different purposes : compression level, header signature, header size, header field offset. For each purpose you can see that there is only one type. The constants are grouped here only for one reason : constants used by the ZIP interfaces. It's a quick-and-dirty API description. They should have been documented in separate groups. Note also that the Use link of the IDL page has nothing to say: this constants group is nowhere referenced. At least in packages/zip/ZipEntry.html the element nMethod should refer to packages.zip.ZipConstants group, but only for compression constants. If the IDL description was correct there should be a reference to a constants group dedicated to Zip compression level. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]