Re: [dev] Writer allows deleting opened file while saving
Ales Kahanek wrote: With such applications we do another approach: we try periodically to get ShareExclusive access to this file. If the request is rejected, we know that the file is still opened and edited. And here is the problem with Writer - when you save the file in Writer, there is a short period of time, when the the exclusive access to the file can be obtained and more, the file can be even DELETED. There is an important point to know: this behaviour can be reproduced when the OO QuickStarter is running (I do not know if this could have any impact on it). What do you think about it? How can I know, when the file opened by Writer was closed? Or better - shouldn´t this behaviour be changed not to release the file access lock? If we overwrite a file we must (at least for a short span of time) release the old one or (to keep the lock) use a more complicated approach that - when things go haywire - can result in crashes and data loss or would need a complete rewrite of our persistence code to avoid that. It's too much to explain it here but believe me, we considered this very carefully. There are so many things that can happen why saving a file, you wouldn't believe it. And Linux/Unix file systems add a lot of complexity that make them incomparable with Windows file systems, so a comparison with Word or Excel doesn't really help. BTW: we changed the behavior a bit for OOo2.0 (but still with a temporary release) and now we have the most robust solution implemented, Even removing a remote file system while a file gets saved to it shouldn't cause OOo to crash or lose data. Relying on the locked state of a file IMHO is a hack (sorry). But there's no need to use such a hack because you can use our API to get the job done. If you placed a listener in every open document you would get notifications when they are closed and then copy the content of the file they have been saved to to your database. Best regards, Mathias -- Mathias Bauer - OpenOffice.org Application Framework Project Lead Please reply to the list only, [EMAIL PROTECTED] is a spam sink. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] Wants a start in OpenOffice development.
Hi Azhar, i would suggest that you start with SDK examples, work with them, implement your own simple tasks and read the documentation (the Developers Guide). You will learn the basics about the API and after that you should be able to start working on other things (e.g. extensions). Juergen Azhar wrote: Hello, My name is Azhar Javaid, I am currently working as a Senior Software Developer in a Software Organization. I want to get started with open office development. It would be just great if you can help me in doing so. Though i am not currently working in the languages that are required in OpenOffice development like C++ and JAVA, but I have a strong knowledge of these two great languages and with a little effort, I hope that I can develop something in these languages and contribute in the development of OpenOffice. Waiting for you response. Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: On UI/dialogs in C++
I found an interesting site http://ui.openoffice.org. It does contain articles on localized res files and methods that create dialogs and stuff. I have still not been able to find a good text/document for this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[dev] Re: Writer allows deleting opened file while saving
Mathias Bauer wrote: Relying on the locked state of a file IMHO is a hack (sorry). But Yes, I know that this is not the best way, but there are many applications that do their job in many different ways and if the check if the process is active scenario fails, then this is may be the last possibility. If you placed a listener in every open document you would get notifications when they are closed This sounds good, could you, please, point me to the right direction about listener? Are there some documents or info how to do this? Best regards, Mathias Thank you very much for your answers. Best regards Ales - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] How to implement Exchange Databases function
Search the OOo Forum. This should get you started anyway. http://www.oooforum.org/forum/viewtopic.phtml?p=76328 I think that I have an example somewhere, if I can only find it. Matthias Benkmann wrote: I'm writing an application that creates CSV-files and automatically loads a text template for the mail merge function. The mail merge fields in the template are connected with a text database that refers to the directory where the CSV files are created. Because it must be possible to open multiple mail merge documents at the same time with different data sets, every CSV-file gets a unique generated name. Obviously this generated name is different from the table name the mail merge fields in the template refer to. So what I need to do is to make the mail merge fields refer to the proper database table. Manually I can do this easily with the Edit - Exchange Database... dialog. But how do I script this? To make this clear, I'm *not* looking for a way to call the Exchange Database... dialog from a macro. I want to get the effect of Exchange Database... from a script without user intervention, i.e. given the name of a database and/or table, modify the mail merge fields to refer to the new database/table. I'm working with OO 2.0 Beta in Java but example code in other languages is welcome, as are pointers to UNO services/interfaces/properties that may help me. I also have the OO sources lying around, so if that could be helpful I'd take a look at the C++ implementation of Exchange Database... if someone tells me where I can find it. Matthias Benkmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [dev] How to traverse paras on a page?
Download my free macro document (see link below), or get my book. If you have my free macro document, check out the section discussing how to traverse paragraphs (Andrew learns to ...). Also, read the section on the selected text framework, which demonstrates how to know when to end. It would probably suffice to traverse while moving the display cursor with you until you leave the page. The thing is that ONLY the display cursor can act as a page cursor if I remember correctly (I discuss this in my book, but probably not the free macro document). Aditya Pandey wrote: Hi I have been trying to write a simple page traverser since half a day unsuccessfully. Here is little code: bool blnJump = xPageCursor-jumpToNextPage(); printf (Jump Page: %d\n, blnJump); Reference XTextViewCursor xViewCursor2 (xPageCursor, UNO_QUERY); if (xViewCursor2 == NULL) { ShowMessageBox( xToolkit, m_ooxFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( Test App )), OUString( RTL_CONSTASCII_USTRINGPARAM( xViewCursor not found )) ); return false; } Reference XTextRange xTextRange2 (xViewCursor2, UNO_QUERY); Reference XTextCursor xModelCursor2 = xDocumentText- createTextCursorByRange(xTextRange2); Reference XParagraphCursor xPrCursor2 (xModelCursor2, UNO_QUERY); if (xPrCursor2 == NULL) { ShowMessageBox( xToolkit, m_ooxFrame, OUString( RTL_CONSTASCII_USTRINGPARAM( Test App )), OUString( RTL_CONSTASCII_USTRINGPARAM( xPrCursor is not found )) ); return false; } int paraCount = 0; while (xPrCursor2-gotoNextParagraph(false) ) // xPrCursor-getText() != xPrCursor2-getText()) { paraCount ++; } printf (%d\n, paraCount ); This code has a flaw -- It gives all paras starting from the current page till last page of document. While I want all paras of current page. Could somebody please help with this? It doesnt appear to be as easy as I thought it to be. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andrew Pitonyak My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm Free Info: http://www.pitonyak.org/oo.php - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]