https://issues.apache.org/ooo/show_bug.cgi?id=120625
--- Comment #8 from zong dong jun <[email protected]> --- Java Code as below. I have found the reason of this problem, if I add a sleep after inert page number field, I can get the page number value. public void createPageNumber(XComponent component) { XMultiServiceFactory sevriceFactory = (XMultiServiceFactory) UnoRuntime.queryInterface(XMultiServiceFactory.class, component); XTextField pageNumberFiled; try { 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", NumberingType.ARABIC);//Set page number display as Arabic props.setPropertyValue("SubType", PageNumberType.CURRENT); document.getText().insertTextContent(document.getText().getEnd(), pageNumberFiled, true); // try { // Thread.sleep(1000); // } catch (InterruptedException e) { // e.printStackTrace(); // } System.out.println(document.getText().getString()); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(); } -- You are receiving this mail because: You are the assignee for the bug.
