Re: [api-dev] Hyperlink within a shape (Solved)

2008-09-03 Thread Nicole Scholz
Hi Ariel!

Thank you very much for you help and your code. I got help by implementing your 
code in ooRexx and now hyperlinking text witihin a shape works. Here is the 
code:


call bsf.import com.sun.star.style.BreakType, pageBreakType -- for enum you 
need a class import

oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~XDesktop~XComponentLoader

url = private:factory/swriter
xWriterComponent = xComponentLoader~loadComponentFromURL(url, _blank, 0, 
.UNO~noProps)

xDocumentFactory = xWriterComponent~XMultiServiceFactory
xTextDocument= xWriterComponent~XTextDocument
xDocText = xTextDocument~getText
xDocTextCursor   = xDocText~createTextCursorByRange(xDocText~getStart)
xDocFactory  = xTextDocument~XMultiServiceFactory

/* create a RectangleShape */
Shape = xDocFactory~createInstance(com.sun.star.drawing.RectangleShape)
xShape = Shape~xShape

size = .bsf~new(com.sun.star.awt.Size, 8000 /*width*/, 2500 /*height*/)
xShape~setSize(size)

xShapeProps=xShape~xPropertySet
at_para=bsf.getConstant(com.sun.star.text.TextContentAnchorType,AT_PARAGRAPH)
xShapeProps~setPropertyValue(AnchorType, at_para)
xShapeProps~setPropertyValue(FillColor, box(int, C0 C0 C0x ~c2d))

-- create a text field at the document factory
xTextFieldProps=xDocFactory~createInstance(com.sun.star.text.TextField.URL)~XPropertySet
xTextFieldProps~setPropertyValue(Representation, OpenOffice.org API Project)
xTextFieldProps~setPropertyValue(TargetFrame, _blank)
xTextFieldProps~setPropertyValue(URL, http://api.openoffice.org;)

-- get the XTextContent of the shape and the field
xShapeTextContent=xShape~XTextContent
xFieldTextContent=xTextFieldProps~XTextContent

-- the shape is inserted at the DOCUMENT text
xDocText~insertTextContent(xDocTextCursor, xShapeTextContent, .false)

-- access the text inside the shape,
-- and create a text cursor
xShapeText   = xShape~XText
xShapeTextCursor = xShapeText~createTextCursor

-- insert the field at the SHAPE text
xShapeText~insertTextContent(xShapeTextCursor, xFieldTextContent, .false)

::requires UNO.cls 


Regards
Nicole

 Original-Nachricht 
 Datum: Fri, 29 Aug 2008 00:34:39 -0300
 Von: Ariel Constenla-Haile [EMAIL PROTECTED]
 An: dev@api.openoffice.org
 Betreff: Re: [api-dev] Hyperlink within a shape

 Hi Nicole,
 
 Nicole Scholz escribió:
  Hi Ariel!
  
  Thank you for your answer about creating hyperlinks within a rectangle.
 Nice to know that there is a solution in some cases.
  
  I tried to write a code in ooRex where this also works. But I did not
 found a solution. I get an error message when I try to insert the textfield.
 I think this is one of the errors you wrote in your mail which will appear.
  
  Here is my code:
  
  
  oDesktop = UNO.createDesktop()
  xComponentLoader = oDesktop~XDesktop~XComponentLoader
  url = private:factory/swriter
  
  xWriterComponent = xComponentLoader~loadComponentFromURL(url, _blank,
 0, .UNO~noProps)
  
  xDocumentFactory = xWriterComponent~XMultiServiceFactory
  xTextDocument = xWriterComponent~XTextDocument
  xText = xTextDocument~getText()
  xTextCursor = xText~createTextCursor()
  xDMsf = xTextDocument~XMultiServiceFactory
  
  aHyperlinkObj = xDMsf~createInstance(com.sun.star.text.TextField.URL)
  xPropSet = aHyperlinkObj~xPropertySet
  xPropSet~setPropertyValue(URL, hihi)
  xPropSet~setPropertyValue(Representation, hyperlink)
  xcontent = aHyperlinkObj~xTextContent
  
  -- insert the textfield
  xText~insertTextContent(xTextCursor, xcontent, .false)
  
  
  
  This is the error message I get :
  
  
  Exception in thread main org.apache.bsf.BSFException: ///
 Java-exception (Rexx
  AndJava) occurred: [com.sun.star.lang.IllegalArgumentException: unknown
 text con
  tent] \\\
  BSF4Rexx subfunction invoke: object '[EMAIL PROTECTED]' - method
 [INSERTTEXTCO
  NTENT], method not found or error (exception) executing method!
  at
 org.rexxla.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:
  2764)
  at org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxStart(Native
 Method)
  at
 org.rexxla.bsf.engines.rexx.RexxEngine.apply(RexxEngine.java:318)
  at org.rexxla.bsf.RexxDispatcher.main(RexxDispatcher.java:114)
 853 *-* call BSF invoke, [EMAIL PROTECTED], INSERTTEXTCONTENT ,
 a.1 , a
  .2 , a.3
  36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
  Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
  Error 40.1:  External routine BSF failed
  
  Exception of type 'org.apache.bsf.BSFException' thrown while invoking
 Rexx:
  36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
 
 I know nothing about ooRex (shame on me), but did you try with the
 following?
 
 xText~insertTextContent(xTextCursor~getStart(), xcontent, .false

Re: [api-dev] Hyperlink within a shape

2008-08-29 Thread Nicole Scholz
Hi Ariel!

Thank you for your fast answers :). I will try this.

Best Regards
Nicole


 Original-Nachricht 
 Datum: Fri, 29 Aug 2008 00:34:39 -0300
 Von: Ariel Constenla-Haile [EMAIL PROTECTED]
 An: dev@api.openoffice.org
 Betreff: Re: [api-dev] Hyperlink within a shape

 Hi Nicole,
 
 Nicole Scholz escribió:
  Hi Ariel!
  
  Thank you for your answer about creating hyperlinks within a rectangle.
 Nice to know that there is a solution in some cases.
  
  I tried to write a code in ooRex where this also works. But I did not
 found a solution. I get an error message when I try to insert the textfield.
 I think this is one of the errors you wrote in your mail which will appear.
  
  Here is my code:
  
  
  oDesktop = UNO.createDesktop()
  xComponentLoader = oDesktop~XDesktop~XComponentLoader
  url = private:factory/swriter
  
  xWriterComponent = xComponentLoader~loadComponentFromURL(url, _blank,
 0, .UNO~noProps)
  
  xDocumentFactory = xWriterComponent~XMultiServiceFactory
  xTextDocument = xWriterComponent~XTextDocument
  xText = xTextDocument~getText()
  xTextCursor = xText~createTextCursor()
  xDMsf = xTextDocument~XMultiServiceFactory
  
  aHyperlinkObj = xDMsf~createInstance(com.sun.star.text.TextField.URL)
  xPropSet = aHyperlinkObj~xPropertySet
  xPropSet~setPropertyValue(URL, hihi)
  xPropSet~setPropertyValue(Representation, hyperlink)
  xcontent = aHyperlinkObj~xTextContent
  
  -- insert the textfield
  xText~insertTextContent(xTextCursor, xcontent, .false)
  
  
  
  This is the error message I get :
  
  
  Exception in thread main org.apache.bsf.BSFException: ///
 Java-exception (Rexx
  AndJava) occurred: [com.sun.star.lang.IllegalArgumentException: unknown
 text con
  tent] \\\
  BSF4Rexx subfunction invoke: object '[EMAIL PROTECTED]' - method
 [INSERTTEXTCO
  NTENT], method not found or error (exception) executing method!
  at
 org.rexxla.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:
  2764)
  at org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxStart(Native
 Method)
  at
 org.rexxla.bsf.engines.rexx.RexxEngine.apply(RexxEngine.java:318)
  at org.rexxla.bsf.RexxDispatcher.main(RexxDispatcher.java:114)
 853 *-* call BSF invoke, [EMAIL PROTECTED], INSERTTEXTCONTENT ,
 a.1 , a
  .2 , a.3
  36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
  Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
  Error 40.1:  External routine BSF failed
  
  Exception of type 'org.apache.bsf.BSFException' thrown while invoking
 Rexx:
  36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
 
 I know nothing about ooRex (shame on me), but did you try with the
 following?
 
 xText~insertTextContent(xTextCursor~getStart(), xcontent, .false)
 
 As the error says Incorrect call to routine. A TextCursor is a
 TextRange, but I don't know how casting is implemented in this ooRex
 bridge to OOo. So maybe you need to get/query explcitly an XTextRange by
 
 xText~insertTextContent(xTextCursor~getStart(), xcontent, .false)
 or
 xText~insertTextContent(xTextCursor~XTextRange, xcontent, .false)
 
 ... just guessing, as I know nothing about ooRex :-(
 
  Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
  Error 40.1:  External routine BSF failed
  
  
  
  Is there a possibility with java to bypass this error?
 
 
 any way your code doesn't try insert the field inside the shape, but
 inside the document text body.
 The Java code below[1] inserts an URL field inside an Ellipse shape,
 *BUT* note the issues:
 
  * Writer:
*  com.sun.star.text.texfield.URL does not figure among the
 avaible
   services at the doc. factory, nor can be instantiated by this
   name. You have to use com.sun.star.text.TextField.URL
*  the document view does not know how to handle them, that is:
   * the pointer does not change from an ARROW to a REFHAND
 when the mouse is over the field
   * the URL is never dispatched when clicking the text field
   * if you double-click the shape to edit its text, then the
 field will look like an hyperlink (pointer changes to
 REFHAND when mouse over), but the URL is not dispatched
 
 
 
 Regards
 Ariel.
 
 
 
 [1] (fix line breaks  if copypaste)
 
 import com.sun.star.awt.Size;
 import com.sun.star.beans.PropertyValue;
 import com.sun.star.beans.XPropertySet;
 import com.sun.star.uno.XComponentContext;
 import com.sun.star.comp.helper.Bootstrap;
 import com.sun.star.drawing.XShape;
 import com.sun.star.frame.XComponentLoader;
 import com.sun.star.lang.XComponent;
 import com.sun.star.lang.XMultiComponentFactory;
 import

Re: [api-dev] Hyperlink within a shape

2008-08-28 Thread Nicole Scholz
Hi Ariel!

Thank you for your answer about creating hyperlinks within a rectangle. Nice to 
know that there is a solution in some cases.

I tried to write a code in ooRex where this also works. But I did not found a 
solution. I get an error message when I try to insert the textfield. I think 
this is one of the errors you wrote in your mail which will appear.

Here is my code:


oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~XDesktop~XComponentLoader
url = private:factory/swriter

xWriterComponent = xComponentLoader~loadComponentFromURL(url, _blank, 0, 
.UNO~noProps)

xDocumentFactory = xWriterComponent~XMultiServiceFactory
xTextDocument = xWriterComponent~XTextDocument
xText = xTextDocument~getText()
xTextCursor = xText~createTextCursor()
xDMsf = xTextDocument~XMultiServiceFactory

aHyperlinkObj = xDMsf~createInstance(com.sun.star.text.TextField.URL)
xPropSet = aHyperlinkObj~xPropertySet
xPropSet~setPropertyValue(URL, hihi)
xPropSet~setPropertyValue(Representation, hyperlink)
xcontent = aHyperlinkObj~xTextContent

-- insert the textfield
xText~insertTextContent(xTextCursor, xcontent, .false)



This is the error message I get :


Exception in thread main org.apache.bsf.BSFException: /// Java-exception (Rexx
AndJava) occurred: [com.sun.star.lang.IllegalArgumentException: unknown text con
tent] \\\
BSF4Rexx subfunction invoke: object '[EMAIL PROTECTED]' - method [INSERTTEXTCO
NTENT], method not found or error (exception) executing method!
at org.rexxla.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:
2764)
at org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxStart(Native Method)
at org.rexxla.bsf.engines.rexx.RexxEngine.apply(RexxEngine.java:318)
at org.rexxla.bsf.RexxDispatcher.main(RexxDispatcher.java:114)
   853 *-* call BSF invoke, [EMAIL PROTECTED], INSERTTEXTCONTENT , a.1 , a
.2 , a.3
36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
Error 40.1:  External routine BSF failed

Exception of type 'org.apache.bsf.BSFException' thrown while invoking Rexx:
36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
Error 40.1:  External routine BSF failed



Is there a possibility with java to bypass this error?

Regards
Nicole

 Original-Nachricht 
 Datum: Wed, 30 Jul 2008 14:01:58 -0300
 Von: Ariel Constenla-Haile [EMAIL PROTECTED]
 An: dev@api.openoffice.org
 Betreff: Re: [api-dev] Hyperlink within a shape

 Hello Nicole,
 
 Nicole Scholz escribió:
  Hi!
  
  I tried to add a hyperlink to a text within a rectangle. Usually a
 hyperlink is set on the textproperties with setpropertyvalue and then the
 hyperlink for example: 
  xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)
  
  Now I would like to add the hyperlink to a shape. I tried it the same
 way with the xText within the shape.
  
  xShapeText = Shape~xText
  xShapeTextCursor = xShapeText~createTextCursor
  props = xShapeTextCursor~xPropertySet
  props~setPropertyValue(HyperLinkURL, “www.google.at”)
  
  But this does not work. I get the exception that the method is not
 found. Can someone give me a hint why I get this error and how I can get the
 hyperlink into the shape?
 
 as you have realized, an hyperlink within a shape can not be set as a
 character property of the shape's text.
 You will also realize how to do this if you try in the graphical user
 interface:
 
 * open a new OOo Draw document
 * draw any shape, let's say an ellipse
 * double-click the shape in order to insert text inside it
 * type any URL, for example www.google.at
 * as soon as you press the space key, this text truns into an URL *field*
 
 So the key to the answer is: an hyperlink within a shape is inserted as
 an URL text field.
 
 Sure you have noticed that in Calc/Draw/Impress, when you select the
 menu Insert - Hyperlink, an URL text field is inserted. In
 Draw/Impress case, the field is inside a text shape.
 
 In *theory*, as an API client, you can achieve this doing the following:
 
 * instantiate a shape at the doc. factory
 * add the shape to a draw page
 * instantiate a com.sun.star.text.texfield.URL
 [http://api.openoffice.org/docs/common/ref/com/sun/star/text/textfield/URL.html]
 at the doc. factory
 * get the shape's css.text.XText and insert the field as a text content
 
 In practice, I see the following issues (look at the macros in
 http://www.ArielConstenlaHaile.com.ar/ooo/temp/field_inside_shape.odt):
 
 * Writer:
   *  com.sun.star.text.texfield.URL does not figure among the avaible
  services at the doc. factory, nor can be instantiated

Re: [api-dev] Hyperlink within a shape

2008-08-28 Thread Ariel Constenla-Haile

Hi Nicole,

Nicole Scholz escribió:

Hi Ariel!

Thank you for your answer about creating hyperlinks within a rectangle. Nice to 
know that there is a solution in some cases.

I tried to write a code in ooRex where this also works. But I did not found a 
solution. I get an error message when I try to insert the textfield. I think 
this is one of the errors you wrote in your mail which will appear.

Here is my code:


oDesktop = UNO.createDesktop()
xComponentLoader = oDesktop~XDesktop~XComponentLoader
url = private:factory/swriter

xWriterComponent = xComponentLoader~loadComponentFromURL(url, _blank, 0, 
.UNO~noProps)

xDocumentFactory = xWriterComponent~XMultiServiceFactory
xTextDocument = xWriterComponent~XTextDocument
xText = xTextDocument~getText()
xTextCursor = xText~createTextCursor()
xDMsf = xTextDocument~XMultiServiceFactory

aHyperlinkObj = xDMsf~createInstance(com.sun.star.text.TextField.URL)
xPropSet = aHyperlinkObj~xPropertySet
xPropSet~setPropertyValue(URL, hihi)
xPropSet~setPropertyValue(Representation, hyperlink)
xcontent = aHyperlinkObj~xTextContent

-- insert the textfield
xText~insertTextContent(xTextCursor, xcontent, .false)



This is the error message I get :


Exception in thread main org.apache.bsf.BSFException: /// Java-exception (Rexx
AndJava) occurred: [com.sun.star.lang.IllegalArgumentException: unknown text con
tent] \\\
BSF4Rexx subfunction invoke: object '[EMAIL PROTECTED]' - method [INSERTTEXTCO
NTENT], method not found or error (exception) executing method!
at org.rexxla.bsf.engines.rexx.RexxAndJava.javaCallBSF(RexxAndJava.java:
2764)
at org.rexxla.bsf.engines.rexx.RexxAndJava.jniRexxStart(Native Method)
at org.rexxla.bsf.engines.rexx.RexxEngine.apply(RexxEngine.java:318)
at org.rexxla.bsf.RexxDispatcher.main(RexxDispatcher.java:114)
   853 *-* call BSF invoke, [EMAIL PROTECTED], INSERTTEXTCONTENT , a.1 , a
.2 , a.3
36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)
Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
Error 40.1:  External routine BSF failed

Exception of type 'org.apache.bsf.BSFException' thrown while invoking Rexx:
36 *-* xText~insertTextContent(xTextCursor, xcontent, .false)


I know nothing about ooRex (shame on me), but did you try with the
following?

xText~insertTextContent(xTextCursor~getStart(), xcontent, .false)

As the error says Incorrect call to routine. A TextCursor is a
TextRange, but I don't know how casting is implemented in this ooRex
bridge to OOo. So maybe you need to get/query explcitly an XTextRange by

xText~insertTextContent(xTextCursor~getStart(), xcontent, .false)
or
xText~insertTextContent(xTextCursor~XTextRange, xcontent, .false)

... just guessing, as I know nothing about ooRex :-(


Error 40 running a_BSF4Rexx_program line 36:  Incorrect call to routine
Error 40.1:  External routine BSF failed



Is there a possibility with java to bypass this error?



any way your code doesn't try insert the field inside the shape, but
inside the document text body.
The Java code below[1] inserts an URL field inside an Ellipse shape,
*BUT* note the issues:


* Writer:
  *  com.sun.star.text.texfield.URL does not figure among the avaible
 services at the doc. factory, nor can be instantiated by this
 name. You have to use com.sun.star.text.TextField.URL
  *  the document view does not know how to handle them, that is:
 * the pointer does not change from an ARROW to a REFHAND
   when the mouse is over the field
 * the URL is never dispatched when clicking the text field
 * if you double-click the shape to edit its text, then the
   field will look like an hyperlink (pointer changes to
   REFHAND when mouse over), but the URL is not dispatched




Regards
Ariel.



[1] (fix line breaks  if copypaste)

import com.sun.star.awt.Size;
import com.sun.star.beans.PropertyValue;
import com.sun.star.beans.XPropertySet;
import com.sun.star.uno.XComponentContext;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.drawing.XShape;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.TextContentAnchorType;
import com.sun.star.text.XText;
import com.sun.star.text.XTextContent;
import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;

public class Demo {

public static void main(String[] args) {
try {
// get the remote office component context
XComponentContext xContext = Bootstrap.bootstrap();
 

Re: [api-dev] Hyperlink within a shape

2008-07-30 Thread Ariel Constenla-Haile

Hello Nicole,

Nicole Scholz escribió:

Hi!

I tried to add a hyperlink to a text within a rectangle. Usually a hyperlink is set on the textproperties with setpropertyvalue and then the hyperlink for example: 
xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)


Now I would like to add the hyperlink to a shape. I tried it the same way with 
the xText within the shape.

xShapeText = Shape~xText
xShapeTextCursor = xShapeText~createTextCursor
props = xShapeTextCursor~xPropertySet
props~setPropertyValue(HyperLinkURL, “www.google.at”)

But this does not work. I get the exception that the method is not found. Can 
someone give me a hint why I get this error and how I can get the hyperlink 
into the shape?


as you have realized, an hyperlink within a shape can not be set as a
character property of the shape's text.
You will also realize how to do this if you try in the graphical user
interface:

* open a new OOo Draw document
* draw any shape, let's say an ellipse
* double-click the shape in order to insert text inside it
* type any URL, for example www.google.at
* as soon as you press the space key, this text truns into an URL *field*

So the key to the answer is: an hyperlink within a shape is inserted as
an URL text field.

Sure you have noticed that in Calc/Draw/Impress, when you select the
menu Insert - Hyperlink, an URL text field is inserted. In
Draw/Impress case, the field is inside a text shape.

In *theory*, as an API client, you can achieve this doing the following:

* instantiate a shape at the doc. factory
* add the shape to a draw page
* instantiate a com.sun.star.text.texfield.URL
[http://api.openoffice.org/docs/common/ref/com/sun/star/text/textfield/URL.html]
at the doc. factory
* get the shape's css.text.XText and insert the field as a text content

In practice, I see the following issues (look at the macros in
http://www.ArielConstenlaHaile.com.ar/ooo/temp/field_inside_shape.odt):

* Writer:
 *  com.sun.star.text.texfield.URL does not figure among the avaible
services at the doc. factory, nor can be instantiated by this
name. You have to use com.sun.star.text.TextField.URL
 *  the document view does not know how to handle them, that is:
* the pointer does not change from an ARROW to a REFHAND
  when the mouse is over the field
* the URL is never dispatched when clicking the text field
* if you double-click the shape to edit its text, then the
  field will look like an hyperlink (pointer changes to
  REFHAND when mouse over), but the URL is not dispatched

* Calc
* same issue with the service name, in fact all text field services
  names are in uppercase, while the name of the module is
  textfield, NOT TextField:
com.sun.star.text.TextField.URL
com.sun.star.text.TextField.PageNumber
com.sun.star.text.TextField.PageCount
com.sun.star.text.TextField.Date
com.sun.star.text.TextField.Time
com.sun.star.text.TextField.DocumentTitle
com.sun.star.text.TextField.FileName
com.sun.star.text.TextField.SheetName
* you can instantiate a com.sun.star.text.TextField.URL at the
  doc.'s factory, but if you try to insert it as text content at a
  shape's XText, then you get an error. Looks like you can insert
  this field only inside a cell, not a shape
  [notice that in the macro I find a way to fool Calc, but that's
  just a trick and not how one must really proceed]
* if you try in the GUI (drawing a shape, typying an URL inside it,
  etc), the field works as expected; so it's an API issue

* Draw/Impress
* here the desolation is bigger: there are no text field services
  available at the doc.'s service factory, nor can they be
  instantiated.

Sometimes I have the feeling that some OOo developers don't care much
about us API clients.

Concerning the Draw/Impress issue, *just* adding the service names in
the css.lang.XMultiServiceFactory implementation in
SdXImpressDocument::createInstance() (and
SdXImpressDocument::getAvailableServiceNames() for the sake of
completness) in sd/source/ui/unoidl/unomodel.cxx solves the issue:

//*


uno::Reference uno::XInterface  SAL_CALL
SdXImpressDocument::createInstance( const OUString aServiceSpecifier )
throw(uno::Exception, uno::RuntimeException)
{
OGuard aGuard( Application::GetSolarMutex() );

if( NULL == mpDoc )
throw lang::DisposedException();

//...

//-

// corret case for textfield module
if( ( 0 == aServiceSpecifier.reverseCompareToAsciiL(
RTL_CONSTASCII_STRINGPARAM(com.sun.star.text.TextField.DateTime) ) ) ||
( 0 == aServiceSpecifier.reverseCompareToAsciiL(

Re: [api-dev] Hyperlink within a shape

2008-07-18 Thread Daniel Rentz

Nicole Scholz schrieb:

Hi!

I tried to add a hyperlink to a text within a rectangle. Usually a
hyperlink is set on the textproperties with setpropertyvalue and then
the hyperlink for example: 
xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)


Hyperlinks in shapes do not work at least in Calc:
http://www.openoffice.org/issues/show_bug.cgi?id=66550

Regards
Daniel

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Hyperlink within a shape

2008-07-18 Thread Nicole Scholz
Hi!

Thank you for the information and the link. 
So it is not possible at the moment to hyperlink only the text within a shape.

Regards 
Nicole


 Original-Nachricht 
 Datum: Fri, 18 Jul 2008 08:59:53 +0200
 Von: Daniel Rentz [EMAIL PROTECTED]
 An: dev@api.openoffice.org
 Betreff: Re: [api-dev] Hyperlink within a shape

 Nicole Scholz schrieb:
  Hi!
  
  I tried to add a hyperlink to a text within a rectangle. Usually a
  hyperlink is set on the textproperties with setpropertyvalue and then
  the hyperlink for example: 
  xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)
 
 Hyperlinks in shapes do not work at least in Calc:
 http://www.openoffice.org/issues/show_bug.cgi?id=66550
 
 Regards
 Daniel
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Hyperlink within a shape

2008-07-17 Thread Nicole Scholz
Hi Alexandro!

Thanks for your answer. Do I understand you right that this feature isn't 
implemenet or doesn't work yet?

Regards
Nicole


 Original-Nachricht 
 Datum: Tue, 15 Jul 2008 15:14:57 -0500
 Von: Alexandro Colorado [EMAIL PROTECTED]
 An: dev@api.openoffice.org
 Betreff: Re: [api-dev] Hyperlink within a shape

 On Tue, 15 Jul 2008 14:16:41 -0500, Nicole Scholz [EMAIL PROTECTED] wrote:
 
  Hi!
 
  I tried to add a hyperlink to a text within a rectangle. Usually a  
  hyperlink is set on the textproperties with setpropertyvalue and then  
  the hyperlink for example:
  xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)
 
  Now I would like to add the hyperlink to a shape. I tried it the same  
  way with the xText within the shape.
 
 i would really like this feature being implemented since this could be a  
 great mindmapping feature to generate child documents of a master.
 
 
  xShapeText = Shape~xText
  xShapeTextCursor = xShapeText~createTextCursor
  props = xShapeTextCursor~xPropertySet
  props~setPropertyValue(HyperLinkURL, “www.google.at”)
 
  But this does not work. I get the exception that the method is not  
  found. Can someone give me a hint why I get this error and how I can get
  
  the hyperlink into the shape?
 
  Thanks
  Nicole
 
 
 
 -- 
 Alexandro Colorado
 CoLeader of OpenOffice.org ES
 http://es.openoffice.org
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Hyperlink within a shape

2008-07-17 Thread Cor Nouws

Hi Nicole,

Nicole Scholz wrote (15-7-2008 21:16)


I tried to add a hyperlink to a text within a rectangle. Usually a
hyperlink is set on the textproperties with setpropertyvalue and then
the hyperlink for example: 
xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)


Now I would like to add the hyperlink to a shape. I tried it the same
way with the xText within the shape.

xShapeText = Shape~xText xShapeTextCursor =
xShapeText~createTextCursor props = xShapeTextCursor~xPropertySet 
props~setPropertyValue(HyperLinkURL, “www.google.at”)


But this does not work. I get the exception that the method is not
found. Can someone give me a hint why I get this error and how I can
get the hyperlink into the shape?


When a shape is selected, you can choose Presentation|Interaction.
The Document as target and the URL you like.
This works in the UI, so I expect that is is possible via the API as well.

Have you tried xRay to examine the methods/properties of the shape?

Kindest regards,
Cor

--
The Year of 3 -2008- Het jaar van 3

Cor Nouws - Arnhem - Netherlands
   marketing contact - http://nl.OpenOffice.org
   Zeker van OpenOffice.org - www.nouenoff.nl


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[api-dev] Hyperlink within a shape

2008-07-15 Thread Nicole Scholz
Hi!

I tried to add a hyperlink to a text within a rectangle. Usually a hyperlink is 
set on the textproperties with setpropertyvalue and then the hyperlink for 
example: 
xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)

Now I would like to add the hyperlink to a shape. I tried it the same way with 
the xText within the shape.

xShapeText = Shape~xText
xShapeTextCursor = xShapeText~createTextCursor
props = xShapeTextCursor~xPropertySet
props~setPropertyValue(HyperLinkURL, “www.google.at”)

But this does not work. I get the exception that the method is not found. Can 
someone give me a hint why I get this error and how I can get the hyperlink 
into the shape?

Thanks
Nicole
-- 
Pt! Schon das coole Video vom GMX MultiMessenger gesehen?
Der Eine für Alle: http://www.gmx.net/de/go/messenger03

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] Hyperlink within a shape

2008-07-15 Thread Alexandro Colorado

On Tue, 15 Jul 2008 14:16:41 -0500, Nicole Scholz [EMAIL PROTECTED] wrote:


Hi!

I tried to add a hyperlink to a text within a rectangle. Usually a  
hyperlink is set on the textproperties with setpropertyvalue and then  
the hyperlink for example:

xTextProps~setPropertyValue(HyperLinkURL, “www.google.at”)

Now I would like to add the hyperlink to a shape. I tried it the same  
way with the xText within the shape.


i would really like this feature being implemented since this could be a  
great mindmapping feature to generate child documents of a master.




xShapeText = Shape~xText
xShapeTextCursor = xShapeText~createTextCursor
props = xShapeTextCursor~xPropertySet
props~setPropertyValue(HyperLinkURL, “www.google.at”)

But this does not work. I get the exception that the method is not  
found. Can someone give me a hint why I get this error and how I can get  
the hyperlink into the shape?


Thanks
Nicole




--
Alexandro Colorado
CoLeader of OpenOffice.org ES
http://es.openoffice.org

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]