Return-Path: X-Original-To: apmail-incubator-ooo-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-ooo-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DFC40D760 for ; Tue, 21 Aug 2012 07:48:17 +0000 (UTC) Received: (qmail 94531 invoked by uid 500); 21 Aug 2012 07:48:17 -0000 Delivered-To: apmail-incubator-ooo-dev-archive@incubator.apache.org Received: (qmail 93446 invoked by uid 500); 21 Aug 2012 07:48:13 -0000 Mailing-List: contact ooo-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ooo-dev@incubator.apache.org Delivered-To: mailing list ooo-dev@incubator.apache.org Received: (qmail 93393 invoked by uid 99); 21 Aug 2012 07:48:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Aug 2012 07:48:12 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of Oliver.Brinzing@gmx.de designates 213.165.64.22 as permitted sender) Received: from [213.165.64.22] (HELO mailout-de.gmx.net) (213.165.64.22) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 21 Aug 2012 07:48:04 +0000 Received: (qmail invoked by alias); 21 Aug 2012 07:47:42 -0000 Received: from dslb-088-067-135-225.pools.arcor-ip.net (EHLO [IPv6:::1]) [88.67.135.225] by mail.gmx.net (mp012) with SMTP; 21 Aug 2012 09:47:42 +0200 X-Authenticated: #28490571 X-Provags-ID: V01U2FsdGVkX1/Gg0JaFWbG0+HVpWD3ndWseJpjxT7wrr9EG8DuMN QVZ2fV+DhNKNLl Message-ID: <50333D18.5000204@gmx.de> Date: Tue, 21 Aug 2012 09:47:36 +0200 From: Oliver Brinzing User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: ooo-dev@incubator.apache.org Subject: Re: Is this a UNO API bug? References: <50332AF5.7080409@pitonyak.org> <50332CC4.3020207@pitonyak.org> In-Reply-To: X-Enigmail-Version: 1.4.3 OpenPGP: id=CFD04A45 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig8A87F3F9B7FAE86BAF6FB5BE" X-Y-GMX-Trusted: 0 X-Virus-Checked: Checked by ClamAV on apache.org --------------enig8A87F3F9B7FAE86BAF6FB5BE Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > The strange thing is this API can works fine for doc sample file. the following code works for me with a new doc, output is: Hello 1 World!= !! public class TextfieldProblem { public void setTextfield(XComponent component) { XMultiServiceFactory serviceFactory =3D UnoRuntime.queryInterface( XMultiServiceFactory.class, component); XTextField pageNumberFiled =3D null; try { pageNumberFiled =3D UnoRuntime .queryInterface( XTextField.class, serviceFactory .createInstance("com.sun.star.text.textfield.PageNumber")); XPropertySet props =3D UnoRuntime.queryInterface(XPropertySet.class, pageNumberFiled); props.setPropertyValue("NumberingType", com.sun.star.style.NumberingType.ARABIC); props.setPropertyValue("SubType", com.sun.star.text.PageNumberType.CURRENT); } catch (Exception e) { e.printStackTrace(); } XTextDocument document =3D UnoRuntime.queryInterface(XTextDocument.clas= s, component); try { document.getText().insertString(document.getText().getStart(), "Hello ", true); document.getText().insertTextContent(document.getText().getEnd(), pageNumberFiled, true); document.getText().insertString(document.getText().getEnd(), " World!!!", true); } catch (IllegalArgumentException e) { e.printStackTrace(); } getTextfield(document); } public void getTextfield(XComponent xComponent) { XTextDocument document =3D UnoRuntime.queryInterface(XTextDocument.clas= s, xComponent); String documentString =3D document.getText().getString(); System.out.println(documentString); } } Regards Oliver --=20 GnuPG key 0xCFD04A45: 8822 057F 4956 46D3 352C 1A06 4E2C AB40 CFD0 4A45 --------------enig8A87F3F9B7FAE86BAF6FB5BE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAlAzPRwACgkQTiyrQM/QSkXF/gCdGysFCGXw+6NySMlHN5bCdjnr S7UAniYDUWpLKRA75ToGthfLq+sKzMNr =soGJ -----END PGP SIGNATURE----- --------------enig8A87F3F9B7FAE86BAF6FB5BE--