You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2012/05/12 10:49:23 UTC

[Bug 119339] New: internal names of documents are not accessible via API

https://issues.apache.org/ooo/show_bug.cgi?id=119339

          Priority: P3
            Bug ID: 119339
          Assignee: ooo-issues@incubator.apache.org
           Summary: internal names of documents are not accessible via API
          Severity: normal
        Issue Type: DEFECT
    Classification: Code
                OS: All
          Reporter: mroellig.news@gmx.net
          Hardware: PC
            Status: CONFIRMED
           Version: AOO 3.4.0
         Component: code
           Product: api

Created attachment 77533
  --> https://issues.apache.org/ooo/attachment.cgi?id=77533&action=edit
internal representation name vs. document title

In a german version of AOO there are a difference between the titles (names) of
new documents (e. g. "Unbenannt 1") and the internal naming ( "Unbenannt1"
without blanks). This difference is seen if one want to copy a sheet from a
document to another. (See attachment.)  For the first view it seems to be a
cosmetically issue.

The problem lays in the fact that the UNO representation of a document doesn't
provide this used internal name. So one can't get or manipulate this
representation name.

fact 1: There is no API command to copy a sheet into another document directly.
(See old discussions like
http://openoffice.markmail.org/message/hfhxqdeokcanh57o. I don't know if this
link will work for you.)
fact 2: The Dispatch-API need this internal name: (args1(0).Value in the
recorded macro)

sub copysheetdispatch
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "DocName"
args1(0).Value = "Unbenannt3"
args1(1).Name = "Index"
args1(1).Value = 32767
args1(2).Name = "Copy"
args1(2).Value = true
dispatcher.executeDispatch(document, ".uno:Move", "", 0, args1())
end sub

Now it is the problem: In earlier OOo-Versions the solution was:
argsCopy(0).Value = Doc.DocumentInfo.Title

I don't know since which version of OOo this problem resides.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 119339] internal names of documents are not accessible via API

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=119339

brinzing <ol...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |oliver.brinzing@gmx.de

--- Comment #1 from brinzing <ol...@gmx.de> ---
.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 119339] internal names of documents are not accessible via API

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=119339

Ariel Constenla-Haile <ar...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |arielch@apache.org

--- Comment #2 from Ariel Constenla-Haile <ar...@apache.org> ---
(In reply to comment #0)
> Now it is the problem: In earlier OOo-Versions the solution was:
> argsCopy(0).Value = Doc.DocumentInfo.Title
> 
> I don't know since which version of OOo this problem resides.

This seems to be introduced with the new
::com::sun::star::document::(X)DocumentProperties.

I tried with OOo 3.3.0 the following code:

Sub Main
    Dim oDoc as Object
    oDoc = StarDesktop.loadComponentFromURL("private:factory/scalc",_
                                            "_default",_
                                            0, Array())
    Dim sTitleFromGetTitle$
    Dim sTitleFromDocInfo$
    Dim sTitleFromDocProps$

    Dim oDocInfo as Object
    oDocInfo = oDoc.DocumentInfo

    Dim oDocumentProperties as Object
    oDocumentProperties = oDoc.DocumentProperties '"SfxDocumentMetaData"

    'getTitle() - function in interface ::com::sun::star::frame:: .XTitle
    sTitleFromGetTitle = oDoc.getTitle()

    'service ::com::sun::star::document:: .DocumentInfo - DEPRECATED
    '   ::com::sun::star::document::XDocumentInfo - DEPRECATED
    '     ::com::sun::star::beans::XPropertySet
    '    ::com::sun::star::beans::XFastPropertySet
    '    ::com::sun::star::beans::XPropertyContainer
    sTitleFromDocInfo = oDocInfo.getPropertyValue("Title")

    'interface ::com::sun::star::document::XDocumentProperties
    sTitleFromDocProps = oDocumentProperties.Title ' Title here is attribute,
not property anymore
End Sub

oDocInfo.getPropertyValue("Title")
oDocumentProperties.Title

are empty strings if you don't set a title in the document metadata, even If
you save the untitled document.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 119339] internal names of documents are not accessible via API

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=119339

Ariel Constenla-Haile <ar...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |ACCEPTED
                 CC|arielch@apache.org          |ooo-issues@incubator.apache
                   |                            |.org
           Assignee|ooo-issues@incubator.apache |arielch@apache.org
                   |.org                        |

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.