incubator-ooo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongjun zong <zongdj...@gmail.com>
Subject Is this a UNO API bug?
Date Mon, 20 Aug 2012 07:32:13 GMT
Hi All,
   Using UNO API I do below operation.
1.Launch a odt document,
2.Create a page number field and insert into this docment
3.Get the document text

But in the step3, page number is not contained in the get text.  But if I
launch a doc document, I can get the page number in step 3. I think this is
a UNO API bug, can some body help confirm? Below is my main code pieces.

XMultiServiceFactory sevriceFactory = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, document);
        XTextField  pageNumberFiled =
(XTextField)UnoRuntime.queryInterface(XTextField.class,
sevriceFactory.createInstance("com.sun.star.text.textfield.PageNumber"));

        XPropertySet props =
(XPropertySet)UnoRuntime.queryInterface(XPropertySet.class,
pageNumberFiled);
        props.setPropertyValue("NumberingType", 4);//Set page number
display as Arabic

        XTextCursor xTextCursor = document.getText().createTextCursor();
        xTextCursor.gotoEnd(false);

        document.getText().insertTextContent(document.getText().getEnd(),
pageNumberFiled, true);


        String documentString = document.getText().getString();
        System.out.println(documentString);

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