Hi,
XNumberFormatPreviewer seems only to work, if the XNumberFormatsSupplier
is attached to an (unused) XNumberFormatter, otherwise a
RuntimeException is thrown. Is this the intended behavior?
Object formatter =
xMcf.createInstanceWithContext("com.sun.star.util.NumberFormatter",this.context);
com.sun.star.lang.Locale aLocale = new Locale();
XNumberFormatter xNumberFormatter= (XNumberFormatter)
UnoRuntime.queryInterface(XNumberFormatter.class, formatter);
XNumberFormatPreviewer xNumberFormatPreviewer = (XNumberFormatPreviewer)
UnoRuntime.queryInterface(XNumberFormatPreviewer.class, formatter);
XNumberFormatsSupplier xNumberFormatsSupplier =
(XNumberFormatsSupplier) UnoRuntime.queryInterface(
XNumberFormatsSupplier.class,
this.xSpreadsheetDocument);
// This does not work:
JOptionPane.showMessageDialog(null,xNumberFormatPreviewer.convertNumberToPreviewString("#.##0,00",
50., aLocale, true));
// This does work
xNumberFormatter.attachNumberFormatsSupplier(xNumberFormatsSupplier);
JOptionPane.showMessageDialog(null,xNumberFormatPreviewer.convertNumberToPreviewString("#.##0,00",
50., aLocale, true));
Regards
Peter
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org