summaryrefslogtreecommitdiff
path: root/forms/source/misc
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-12-04 13:18:35 +0200
committerNoel Grandin <noel@peralex.com>2012-12-06 13:20:31 +0200
commit773ad75b0dbc4dac1cae704c726b5a2d67ae1146 (patch)
treeb95386a6639835d7751a6b3aa7bcdfb114f026f8 /forms/source/misc
parent584cd8d1c23d47becb776e382f853ffe77ce9fc2 (diff)
fdo#46808, Adapt util::NumberFormatsSupplier UNO service to new style
Change-Id: I58436d9eea0c38d14cde2dc01aa463d5d71912e9
Diffstat (limited to 'forms/source/misc')
-rw-r--r--forms/source/misc/limitedformats.cxx21
1 files changed, 7 insertions, 14 deletions
diff --git a/forms/source/misc/limitedformats.cxx b/forms/source/misc/limitedformats.cxx
index 82e4fe2b88ea..06bba11583b7 100644
--- a/forms/source/misc/limitedformats.cxx
+++ b/forms/source/misc/limitedformats.cxx
@@ -23,6 +23,7 @@
#include <comphelper/types.hxx>
#include <comphelper/extract.hxx>
#include <com/sun/star/form/FormComponentType.hpp>
+#include <com/sun/star/util/NumberFormatsSupplier.hpp>
//.........................................................................
namespace frm
@@ -132,12 +133,12 @@ namespace frm
//= OLimitedFormats
//=====================================================================
//---------------------------------------------------------------------
- OLimitedFormats::OLimitedFormats(const Reference< XMultiServiceFactory >& _rxORB, const sal_Int16 _nClassId)
+ OLimitedFormats::OLimitedFormats(const Reference< XComponentContext >& _rxContext, const sal_Int16 _nClassId)
:m_nFormatEnumPropertyHandle(-1)
,m_nTableId(_nClassId)
{
- OSL_ENSURE(_rxORB.is(), "OLimitedFormats::OLimitedFormats: invalid service factory!");
- acquireSupplier(_rxORB);
+ OSL_ENSURE(_rxContext.is(), "OLimitedFormats::OLimitedFormats: invalid service factory!");
+ acquireSupplier(_rxContext);
ensureTableInitialized(m_nTableId);
}
@@ -355,20 +356,12 @@ namespace frm
}
//---------------------------------------------------------------------
- void OLimitedFormats::acquireSupplier(const Reference< XMultiServiceFactory >& _rxORB)
+ void OLimitedFormats::acquireSupplier(const Reference< XComponentContext >& _rxContext)
{
::osl::MutexGuard aGuard(s_aMutex);
- if ((1 == ++s_nInstanceCount) && _rxORB.is())
+ if (1 == ++s_nInstanceCount)
{ // create the standard formatter
-
- Sequence< Any > aInit(1);
- aInit[0] <<= getLocale(ltEnglishUS);
-
- Reference< XInterface > xSupplier = _rxORB->createInstanceWithArguments(FRM_NUMBER_FORMATS_SUPPLIER, aInit);
- OSL_ENSURE(xSupplier.is(), "OLimitedFormats::OLimitedFormats: could not create a formats supplier!");
-
- s_xStandardFormats = Reference< XNumberFormatsSupplier >(xSupplier, UNO_QUERY);
- OSL_ENSURE(s_xStandardFormats.is() || !xSupplier.is(), "OLimitedFormats::OLimitedFormats: missing an interface!");
+ s_xStandardFormats = NumberFormatsSupplier::createWithLocale(_rxContext, getLocale(ltEnglishUS));
}
}