incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongjun zong <zongdj...@gmail.com>
Subject Re: Is there difference of Author Field create by UNO API and UI Insert->Fields->Author
Date Fri, 24 Aug 2012 03:14:22 GMT
Confirm, From UI Insert->Fields->Author, is the created user, and respond
to UNO AP Icom.sun.
>
> star.text.textfield.docinfo.CreateAuthor. That may cause confuse to
> general user, can we add these information to API docs?
>
For the author fields save to MS doc format will lost issue´╝î I will raise a
bug in bugzilla.

Regards,
DongJun Zong



2012/8/23 Ariel Constenla-Haile <arielch@apache.org>

>
> Hi Oliver,
>
> On Thu, Aug 23, 2012 at 10:49:17AM +0200, Oliver Brinzing wrote:
> >
> > seems, there are 2 different fields:
> >
> > API: <text:author-name text:fixed="false">MyName</text:author-name>
>
> this is
> file:///opt/
> openoffice.org/basis3.4/sdk/docs/common/ref/com/sun/star/text/textfield/Author.html
>
>
> > GUI: <text:initial-creator>MyName</text:initial-creator>
>
> this is
> file:///opt/
> openoffice.org/basis3.4/sdk/docs/common/ref/com/sun/star/text/textfield/docinfo/CreateAuthor.html
>
>
> The following code:
>
>
> Sub Main
>     On Error Resume Next
>     Dim oDoc as Object
>     oDoc = StarDesktop.loadComponentFromURL(_
>         "private:factory/swriter", "_default", 0, Array())
>
>     Dim oText as Object
>     oText = oDoc.getText()
>
>     Dim oCursor as Object
>     oCursor = oText.createTextCursorByRange(oText.getStart())
>
>     Dim oAuthorField as Object
>     oAuthorField =
> oDoc.createInstance("com.sun.star.text.textfield.Author")
>     oAuthorField.setPropertyValue("FullName", TRUE)
>     oText.insertTextContent( oCursor.getEnd(), oAuthorField, false)
>     oText.insertControlCharacter( oCursor.getEnd(),_
>             com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false )
>
>     oAuthorField =
> oDoc.createInstance("com.sun.star.text.textfield.Author")
>     oAuthorField.setPropertyValue("FullName", FALSE)
>     oText.insertTextContent( oCursor.getEnd(), oAuthorField, false)
>     oText.insertControlCharacter( oCursor.getEnd(),_
>             com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, false )
>
>     Dim oInitialCreatorField as Object
>     oInitialCreatorField =
> oDoc.createInstance("com.sun.star.text.textfield.docinfo.CreateAuthor")
>     oText.insertTextContent( oCursor.getEnd(), oInitialCreatorField, false)
> End Sub
>
>
> Produces 3 different fields:
>
> <text:p text:style-name="Standard">
>     <text:author-name text:fixed="false">Ariel
> Constenla-Haile</text:author-name>
> </text:p>
> <text:p text:style-name="Standard">
>     <text:author-initials text:fixed="false">AC</text:author-initials>
> </text:p>
> <text:p text:style-name="Standard">
>     <text:initial-creator>Ariel Constenla-Haile</text:initial-creator>
> </text:p>
>
>
> Note that optional property AuthorFormat does not exist.
>
>
> http://www.openoffice.org/api/docs/common/ref/com/sun/star/text/textfield/Author.html#AuthorFormat
>
>
> Regards
> --
> Ariel Constenla-Haile
> La Plata, Argentina
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message