List Info

Thread: UserDefinedAttributes for TextSection....




UserDefinedAttributes for TextSection....
user name
2007-09-05 04:14:39
I found that a TextSection in writer has a
"UserDefinedAttributes" property.

It seems to be a AttributeContainer type, and so I was able
to set XML
AttributeData values to it.  I did not receive any errors,
but the
values are never saved to the document.
(i scanned both content.xml and meta.xml...)

Is this property supported by the API or is it a bug ?

ashok

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: UserDefinedAttributes for TextSection....
user name
2007-09-05 07:07:52
mmm ...
http://api.openoffice.org/docs/co
mmon/ref/com/sun/star/text/TextSection.html...
doesn't state that such a property exist.
Are you sure that it is a textsection we are talking about
?

2007/9/5, ashok _ <listmanstergmail.com>:
>
> I found that a TextSection in writer has a
"UserDefinedAttributes"
> property.
>
> It seems to be a AttributeContainer type, and so I was
able to set XML
> AttributeData values to it.  I did not receive any
errors, but the
> values are never saved to the document.
> (i scanned both content.xml and meta.xml...)
>
> Is this property supported by the API or is it a bug ?
>
> ashok
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> For additional commands, e-mail: dev-helpapi.openoffice.org
>
>
Re: UserDefinedAttributes for TextSection....
user name
2007-09-05 07:47:08
Hi,

its a bug: http://qa.openoffice.org/issues/show_bug.cgi?id=58667
Re: UserDefinedAttributes for TextSection....
user name
2007-09-05 07:48:26
Sry, for my quickshot above...

"UserDefinedAttributes" are documentated Features
that are currently buggy.

Regards jan
Re: UserDefinedAttributes for TextSection....
user name
2007-09-05 07:59:34
On 9/5/07, Stephan Wunderlich <stephan.wunderlichgooglemail.com> wrote:
> mmm ...
> http://api.openoffice.org/docs/co
mmon/ref/com/sun/star/text/TextSection.html...
> doesn't state that such a property exist.
> Are you sure that it is a textsection we are talking
about ?
>


Actually, I realized its not documented, but visible as a
property for
the textsection object, via XRay.... I was hoping it would
work :-(

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: UserDefinedAttributes for TextSection....
user name
2007-09-05 09:39:04
Seems not be be my day...
TextSection != Text...

Back to topic:
In some of my macros I use the UserDefinedAttributes of
TextSections. To
store an Attribute i use the following function:

Function AddAttribute(AttributeContainer As
com.sun.star.xml.AttributeContainer, AttributeName As
String, AttributeValue
As String)
  Dim oMyAttribute As Object

  oMyAttribute =
createUnoStruct("com.sun.star.xml.AttributeData")

  With oMyAttribute
    '        .Namespace = "citDesigner"
    .Type = "CDATA"
    .Value = AttributeValue
  End With

  If AttributeContainer.hasByName(AttributeName) Then
    AttributeContainer.removeByName(AttributeName,
oMyAttribute)
    AttributeContainer.insertByName(AttributeName,
oMyAttribute)
  Else
    AttributeContainer.insertByName(AttributeName,
oMyAttribute)
  End If

  AddAttribute = AttributeContainer
End Function


The trick is to rewrite the Container to the section, eg.:
oSection.UserDefinedAttributes =
AddAttribute(oSection.UserDefinedAttributes,
"foo", "bar")

i hope this does resolve your problems
Re: UserDefinedAttributes for TextSection....
user name
2007-09-06 04:49:01
On 9/5/07, Jan Füssel wrote:
> Back to topic:
> In some of my macros I use the UserDefinedAttributes of
TextSections. To
> store an Attribute i use the following function:
>
> The trick is to rewrite the Container to the section,
eg.:
> oSection.UserDefinedAttributes =
AddAttribute(oSection.UserDefinedAttributes,
> "foo", "bar")
>


Hello Jan:

I am using exactly the same method you have described,
unfortunately
nothing gets set, nor do i get an error :-(...  I imagine
since its
not in the API documentation, its not a documented
feature....

thanks
ashok

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: UserDefinedAttributes for TextSection....
user name
2007-09-06 04:54:51
On 9/5/07, Jan Füssel wrote:
> Hi,
>
> its a bug: http://qa.openoffice.org/issues/show_bug.cgi?id=58667
>

Can someone from the OOo qa team know if this has been fixed
? its not so clear
from the issue tracker page... We are willing  to look at
putting in
some resources to fix that
issue, if that is the case....

thanks

ashok

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


Re: UserDefinedAttributes for TextSection....
user name
2007-10-04 11:46:29
Just on the below issue of the
"UserDefinedAttributes" property for
TextSection objects.

I can confirm that this property is functional in OOo 2.3
(it wasnt in
OOo 2.2).
I have tested it and it appears to work predictably.

However, it hasnt yet been documented on the API page for
TextSection

http://api.openoffice.org/docs/commo
n/ref/com/sun/star/text/TextSection.html


On 9/5/07, Stephan Wunderlich wrote:
> mmm ...
> http://api.openoffice.org/docs/co
mmon/ref/com/sun/star/text/TextSection.html...
> doesn't state that such a property exist.
> Are you sure that it is a textsection we are talking
about ?
>
> 2007/9/5, ashok _
> >
> > I found that a TextSection in writer has a
"UserDefinedAttributes"
> > property.
> >
> > It seems to be a AttributeContainer type, and so I
was able to set XML
> > AttributeData values to it.  I did not receive any
errors, but the
> > values are never saved to the document.
> > (i scanned both content.xml and meta.xml...)
> >
> > Is this property supported by the API or is it a
bug ?
> >
> > ashok
> >
> >
------------------------------------------------------------
---------
> > To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
> > For additional commands, e-mail: dev-helpapi.openoffice.org
> >
> >
>

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeapi.openoffice.org
For additional commands, e-mail: dev-helpapi.openoffice.org


[1-9]

about | contact  Other archives ( Real Estate discussion Medical topics )