incubator-ooo-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 120625] New: [UNO API]can't get the text of "TextField PageNumber" by XTextDocument.getText()
Date Tue, 21 Aug 2012 01:56:08 GMT
https://issues.apache.org/ooo/show_bug.cgi?id=120625

          Priority: P2
            Bug ID: 120625
          Assignee: ooo-issues@incubator.apache.org
           Summary: [UNO API]can't get the text of "TextField PageNumber"
                    by XTextDocument.getText()
          Severity: normal
        Issue Type: DEFECT
    Classification: Code
                OS: All
          Reporter: zongdj001@gmail.com
          Hardware: All
            Status: UNCONFIRMED
           Version: AOO 3.4.0
         Component: code
           Product: api

Build:
AOO350m1(Build:9610)

Steps:
 Using UNO API  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.  Below is  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);.

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

Mime
View raw message