Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


On 06/21/2012 05:43 PM, Noel Grandin wrote:
Perhaps you can tell me - there are some deprecated methods like this one:

package com.sun.star.wizards.common;
public class NumberFormatter
{
public static XNumberFormatter
createNumberFormatter(XMultiServiceFactory _xMSF, XNumberFormatsSupplier
_xNumberFormatsSupplier) throws Exception

that are used in various places, but I can't find a replacement - there
doesn't seem to be a NumberFormatter factory class with a create method
taking an XComponentContext parameter, like I would expect.
Any ideas?

That factory would be a new-style com.sun.star.util.NumberFormatter service. ;)

It is a little unclear to me why that method is marked @deprecated. Assuming that it is so because it uses the obsolete XMultiServceFactory.createInstance approach (rather than XMultiComponentFactory.createInstanceWithContext), you could either rewrite it (and its callers) to use XComponentContext/XMultiComponentFactory instead (which might become a bit of a painful avalanche if the callers themselves also only have the XMultiServiceFactory around, but not the XComponentContext; there is no equivalent of the C++ comphelper::getProcessComponentContext in Java). Or you could remove the "@" from "@deprecated" so that it no longer generates noise. (Given that writing new code based on this is rare, the chance that somebody unintentionally uses this method instead of a better counter part in new code is negligible.)

Stephan

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.