summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/dlged/dlged.cxx23
-rw-r--r--basctl/source/dlged/dlgedobj.cxx12
-rw-r--r--basctl/source/inc/dlged.hxx10
3 files changed, 32 insertions, 13 deletions
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 1a3bb9cbfea4..16707c579f2c 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlged.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: tbe $ $Date: 2001-09-20 09:05:27 $
+ * last change: $Author: tbe $ $Date: 2001-09-25 11:06:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -380,6 +380,25 @@ void DlgEditor::SetDialog( uno::Reference< container::XNameContainer > xUnoContr
//----------------------------------------------------------------------------
+Reference< util::XNumberFormatsSupplier > const & DlgEditor::GetNumberFormatsSupplier()
+{
+ if ( !m_xSupplier.is() )
+ {
+ Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
+ Reference< util::XNumberFormatsSupplier > xSupplier( xMSF->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier") ) ), UNO_QUERY );
+
+ ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+ if ( !m_xSupplier.is() )
+ {
+ m_xSupplier = xSupplier;
+ }
+ }
+ return m_xSupplier;
+}
+
+//----------------------------------------------------------------------------
+
void DlgEditor::MouseButtonDown( const MouseEvent& rMEvt )
{
if( pWindow )
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 9ce6ed4693a0..99e7be9434f4 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlgedobj.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: tbe $ $Date: 2001-09-20 09:05:27 $
+ * last change: $Author: tbe $ $Date: 2001-09-25 11:06:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -134,10 +134,6 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#endif
-#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#endif
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
@@ -893,9 +889,7 @@ FASTBOOL DlgEdObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd)
// set number formats supplier for formatted field
if ( aServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.awt.UnoControlFormattedFieldModel") ) )
{
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- uno::Reference< util::XNumberFormatsSupplier > xSupplier( xMSF->createInstance(
- ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.NumberFormatsSupplier") ) ), uno::UNO_QUERY );
+ uno::Reference< util::XNumberFormatsSupplier > xSupplier = GetDlgEdForm()->GetDlgEditor()->GetNumberFormatsSupplier();
uno::Any aSupplier;
aSupplier <<= xSupplier;
xPSet->setPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "FormatsSupplier" ) ), aSupplier );
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index cd0d1199523b..0a2e49902f22 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: dlged.hxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: tbe $ $Date: 2001-08-17 13:55:42 $
+ * last change: $Author: tbe $ $Date: 2001-09-25 11:05:22 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -78,6 +78,9 @@
#include <com/sun/star/datatransfer/DataFlavor.hpp>
#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#endif
enum DlgEdMode { DLGED_INSERT, DLGED_SELECT, DLGED_TEST };
@@ -108,6 +111,7 @@ protected:
DlgEdForm* pDlgEdForm;
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > m_xUnoControlDialogModel;
::com::sun::star::uno::Sequence< ::com::sun::star::datatransfer::DataFlavor > m_ClipboardDataFlavors;
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > m_xSupplier;
DlgEdFactory* pObjFac;
Window* pWindow;
DlgEdFunc* pFunc;
@@ -142,6 +146,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > GetDialog() const
{return m_xUnoControlDialogModel;}
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > const & GetNumberFormatsSupplier();
+
SdrModel* GetModel() const { return pSdrModel; }
SdrView* GetView() const { return pSdrView; }
SdrPage* GetPage() const { return pSdrPage; }