[dev] Re: XTextContent problem
Hi, I don't succeed reproduce your problem nor with OOo 3.3.0, neither with LibreOffice 3.4.5. Are you able to reproduce the problem on request ? Are you doing something special when you delete the formula ? Which version of OOo are you using ? Regards Thibault. - Mail original - De: Jan jrheinlaen...@gmx.de À: dev dev@openoffice.org Envoyé: Vendredi 24 Février 2012 12:24:52 Objet: [dev] XTextContent problem Hello, I execute the following basic macro on a text document: xFormula = ThisComponent.createInstance(com.sun.star.text.TextEmbeddedObject) xFormula.setPropertyValue(CLSID, 078B7ABA-54FC-457F-8551-6147e776a997) xFormula.setPropertyValue(AnchorType, 1) xTextViewCursor = ThisComponent.getCurrentController().getViewCursor() xDocumentText = xTextViewCursor.getText() xModelCursor = xDocumentText.createTextCursorByRange(xTextViewCursor.getEnd()) xDocumentText.insertTextContent(xModelCursor, xFormula, true) This successfully inserts an empty smath formula in the document. Now I do this: 1. Delete the formula 2. Undo the deletion 3. Copy the formula 4. Paste the formula and I get a little box saying Object1 in red type, but not formula!!! What am I doing wrong? Needless to say, this behaviour does not occur when I create the formula through the UI. And I thought I was following the devguide with my macro code. Thanks for any ideas! Jan Rheinländer -- - To unsubscribe send email to dev-unsubscr...@openoffice.org For additional commands send email to sy...@openoffice.org with Subject: help -- - To unsubscribe send email to dev-unsubscr...@openoffice.org For additional commands send email to sy...@openoffice.org with Subject: help
Re: [dev] RE: [api-dev] pdf import programmatically
Hi, You can find documentation about this here : http://wiki.services.openoffice.org/wiki/Documentation/DevGuide/Spreadsheets/Filter_Options But there is also an empiric way : 1- open the document from the GUI 2- read the FilterName and FilterOptions properties of the correspondent component. Use its getArgs() method to access these properties (http://api.openoffice.org/docs/common/ref/com/sun/star/frame/XModel.html#getArgs). T. Vataire - Mail Original - De: Wei Min Teo shaun...@hotmail.com À: dev@openoffice.org Envoyé: Mardi 22 Juin 2010 05:37:35 Objet: RE: [dev] RE: [api-dev] pdf import programmatically Hi Thibault Vataire, Thanks. I think this seem like it should work. It was suggested by cor nouws too. The problem with these filter fields or other properties is that i can't seem to find any documentation as to what strings it accepts. Thanks again Date: Thu, 17 Jun 2010 09:15:09 + From: tvata...@starxpert.fr To: dev@openoffice.org Subject: Re: [dev] RE: [api-dev] pdf import programmatically Hi, To open you document programmatically, you can do that : sub main dim xComp as object dim args(0) as new com.sun.star.beans.PropertyValue args(0).name = FilterName args(0).value = draw_pdf_import xComp = starDesktop.loadComponentFromUrl(convertToUrl(/home/tvataire/Bureau/resultat.pdf), _blank, com.sun.star.frame.FrameSearchFlag.CREATE, args) end sub This works on a pdf document previously created with Writer. I'm working with OOo 3.2 on Ubuntu. Regards, Thibault Vataire - Mail Original - De: Wei Min Teo shaun...@hotmail.com À: dev@openoffice.org, d...@api.openoffice.org Envoyé: Jeudi 17 Juin 2010 04:34:36 Objet: [dev] RE: [api-dev] pdf import programmatically Hi, Can anyone help me on this? Is there a way to force a document to open with draw programmatically? From: shaun...@hotmail.com To: dev@openoffice.org; d...@api.openoffice.org Date: Mon, 7 Jun 2010 15:32:58 +0800 Subject: [api-dev] pdf import programmatically Hi all, I am trying import pdf files to edit. I've installed the sun pdf import with openoffice 3.1. Pdf files seem to open fine in draw when i open it from the desktop. However, when i use the loadComponentFromURL method, it opens the file with writer and encoded text appears. I've also tried passing in MediaType in the mediadescriptor with the value of simpress8 but it doesn't work. How can i programmatically force it to open with draw and return a XComponent object? Thanks. Cheers, Wei Min _ Hotmail: Trusted email with powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969 _ Hotmail: Free, trusted and rich email service. https://signup.live.com/signup.aspx?id=60969 - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org _ Hotmail: Trusted email with powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969 - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] RE: [api-dev] pdf import programmatically
Hi, To open you document programmatically, you can do that : sub main dim xComp as object dim args(0) as new com.sun.star.beans.PropertyValue args(0).name = FilterName args(0).value = draw_pdf_import xComp = starDesktop.loadComponentFromUrl(convertToUrl(/home/tvataire/Bureau/resultat.pdf), _blank, com.sun.star.frame.FrameSearchFlag.CREATE, args) end sub This works on a pdf document previously created with Writer. I'm working with OOo 3.2 on Ubuntu. Regards, Thibault Vataire - Mail Original - De: Wei Min Teo shaun...@hotmail.com À: dev@openoffice.org, d...@api.openoffice.org Envoyé: Jeudi 17 Juin 2010 04:34:36 Objet: [dev] RE: [api-dev] pdf import programmatically Hi, Can anyone help me on this? Is there a way to force a document to open with draw programmatically? From: shaun...@hotmail.com To: dev@openoffice.org; d...@api.openoffice.org Date: Mon, 7 Jun 2010 15:32:58 +0800 Subject: [api-dev] pdf import programmatically Hi all, I am trying import pdf files to edit. I've installed the sun pdf import with openoffice 3.1. Pdf files seem to open fine in draw when i open it from the desktop. However, when i use the loadComponentFromURL method, it opens the file with writer and encoded text appears. I've also tried passing in MediaType in the mediadescriptor with the value of simpress8 but it doesn't work. How can i programmatically force it to open with draw and return a XComponent object? Thanks. Cheers, Wei Min _ Hotmail: Trusted email with powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969 _ Hotmail: Free, trusted and rich email service. https://signup.live.com/signup.aspx?id=60969 - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] Using matrices for rotation of graphical objects
Hi Regina, Ok I will try to ask on d...@api.openoffice.org. Thank you very much. Thibault. - Mail Original - De: Regina Henschel rb.hensc...@t-online.de À: dev@openoffice.org Envoyé: Vendredi 26 Mars 2010 00:06:44 Objet: Re: [dev] Using matrices for rotation of graphical objects Hi Thibault, Thibault Vataire schrieb: Hi, I use a trick to rotate the image : I convert the image (which is a com.sun.star.text.TextGraphicObject object) into com.sun.star.drawing.GraphicObjectShape object. It is this new object that I want to rotate. I'm not sure whether this is a defect or desired behavior. In my experiments I see this behavior: When you apply the new matrix, the translation part of it is used for from left to paragraph area and from top to margin. That is true for all anchor types of form to. Anchored as Character it is from bottom to base line vertically, horizontal part is ignored. Perhaps you ask in d...@api.openoffice.org? kind regards Regina - Mail Original - De: Regina Henschelrb.hensc...@t-online.de À: dev@openoffice.org Envoyé: Jeudi 25 Mars 2010 00:34:15 Objet: Re: [dev] Using matrices for rotation of graphical objects Hi Thibault, Thibault Vataire schrieb: Hi, I'm working on an extension that allow to rotate images in Writer, in the meanwhile that this function was added to OpenOffice.org. Some users asked me to add predefined values like rotate 90°, but I encounter some difficulties to use the matrices for rotation. I've found how to compute values for the first and the second column of the matrix, but not for the third. These values seems to be the new position of the initial upper left corner of the shape. Is somebody know how to compute these values ? I'm a little bit confused. If you have a Draw shape, then there is a transformation matrix, but that is not a new function. If you have a TextGraphicObject, then there is no transformation matrix. So what kind of object you are speaking about? kind regards Regina - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
Re: [dev] Using matrices for rotation of graphical objects
Hi, I use a trick to rotate the image : I convert the image (which is a com.sun.star.text.TextGraphicObject object) into com.sun.star.drawing.GraphicObjectShape object. It is this new object that I want to rotate. Best regards, T. Vataire - Mail Original - De: Regina Henschel rb.hensc...@t-online.de À: dev@openoffice.org Envoyé: Jeudi 25 Mars 2010 00:34:15 Objet: Re: [dev] Using matrices for rotation of graphical objects Hi Thibault, Thibault Vataire schrieb: Hi, I'm working on an extension that allow to rotate images in Writer, in the meanwhile that this function was added to OpenOffice.org. Some users asked me to add predefined values like rotate 90°, but I encounter some difficulties to use the matrices for rotation. I've found how to compute values for the first and the second column of the matrix, but not for the third. These values seems to be the new position of the initial upper left corner of the shape. Is somebody know how to compute these values ? I'm a little bit confused. If you have a Draw shape, then there is a transformation matrix, but that is not a new function. If you have a TextGraphicObject, then there is no transformation matrix. So what kind of object you are speaking about? kind regards Regina - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org
[dev] Using matrices for rotation of graphical objects
Hi, I'm working on an extension that allow to rotate images in Writer, in the meanwhile that this function was added to OpenOffice.org. Some users asked me to add predefined values like rotate 90°, but I encounter some difficulties to use the matrices for rotation. I've found how to compute values for the first and the second column of the matrix, but not for the third. These values seems to be the new position of the initial upper left corner of the shape. Is somebody know how to compute these values ? Best regards, Thibault Vataire. - To unsubscribe, e-mail: dev-unsubscr...@openoffice.org For additional commands, e-mail: dev-h...@openoffice.org