Index: filter/source/config/cache/constant.hxx
===================================================================
RCS file: /cvs/framework/filter/source/config/cache/constant.hxx,v
retrieving revision 1.7
diff -u -p -u -r1.7 constant.hxx
--- filter/source/config/cache/constant.hxx	8 Sep 2005 21:27:52 -0000	1.7
+++ filter/source/config/cache/constant.hxx	24 Aug 2006 14:10:25 -0000
@@ -37,6 +37,15 @@
 
 #include "macros.hxx"
 
+namespace filter { namespace config {
+extern rtl::OUString pFilterStrings[];
+}; };
+#ifndef PROPNAME_IMPL_DECL
+#  define PROPNAME_DECL(index, str) (pFilterStrings[(index)])
+#else
+#  define PROPNAME_DECL(index, str) pFilterStrings[(index)] = _FILTER_CONFIG_FROM_ASCII_(str)
+#endif
+
 /*  disable impl_loadOnDemand function of BaseContainer for certain
     functions, where it the feature "impl_loadItemOnDemand() of class FilterCache
     can be used instead of loadAll()!*/
@@ -48,40 +57,40 @@
             configuration API and can be used at all name containers
             (based on this filtercache) too.
  */
-#define  PROPNAME_NAME  _FILTER_CONFIG_FROM_ASCII_("Name")
+#define  PROPNAME_NAME  PROPNAME_DECL(0, "Name")
 
 /** @short  used to identify a type item property against the
             configuration API and can be used at all name containers
             (based on this filtercache) too.
  */
-#define  PROPNAME_UINAME            _FILTER_CONFIG_FROM_ASCII_("UIName"          )
-#define  PROPNAME_UINAMES           _FILTER_CONFIG_FROM_ASCII_("UINames"         )
-#define  PROPNAME_PREFERRED         _FILTER_CONFIG_FROM_ASCII_("Preferred"       )
-#define  PROPNAME_PREFERREDFILTER   _FILTER_CONFIG_FROM_ASCII_("PreferredFilter" )
-#define  PROPNAME_DETECTSERVICE     _FILTER_CONFIG_FROM_ASCII_("DetectService"   )
-#define  PROPNAME_MEDIATYPE         _FILTER_CONFIG_FROM_ASCII_("MediaType"       )
-#define  PROPNAME_CLIPBOARDFORMAT   _FILTER_CONFIG_FROM_ASCII_("ClipboardFormat" )
-#define  PROPNAME_URLPATTERN        _FILTER_CONFIG_FROM_ASCII_("URLPattern"      )
-#define  PROPNAME_EXTENSIONS        _FILTER_CONFIG_FROM_ASCII_("Extensions"      )
+#define  PROPNAME_UINAME            PROPNAME_DECL(1, "UIName"          )
+#define  PROPNAME_UINAMES           PROPNAME_DECL(2, "UINames"         )
+#define  PROPNAME_PREFERRED         PROPNAME_DECL(3, "Preferred"       )
+#define  PROPNAME_PREFERREDFILTER   PROPNAME_DECL(4, "PreferredFilter" )
+#define  PROPNAME_DETECTSERVICE     PROPNAME_DECL(5, "DetectService"   )
+#define  PROPNAME_MEDIATYPE         PROPNAME_DECL(6, "MediaType"       )
+#define  PROPNAME_CLIPBOARDFORMAT   PROPNAME_DECL(7, "ClipboardFormat" )
+#define  PROPNAME_URLPATTERN        PROPNAME_DECL(8, "URLPattern"      )
+#define  PROPNAME_EXTENSIONS        PROPNAME_DECL(9, "Extensions"      )
 
 /** @short  used to identify a filter item property against the
             configuration API and can be used at all name containers
             (based on this filtercache) too.
  */
-#define  PROPNAME_TYPE              _FILTER_CONFIG_FROM_ASCII_("Type"             )
-#define  PROPNAME_DOCUMENTSERVICE   _FILTER_CONFIG_FROM_ASCII_("DocumentService"  )
-#define  PROPNAME_FILTERSERVICE     _FILTER_CONFIG_FROM_ASCII_("FilterService"    )
-#define  PROPNAME_UICOMPONENT       _FILTER_CONFIG_FROM_ASCII_("UIComponent"      )
-#define  PROPNAME_FLAGS             _FILTER_CONFIG_FROM_ASCII_("Flags"            )
-#define  PROPNAME_USERDATA          _FILTER_CONFIG_FROM_ASCII_("UserData"         )
-#define  PROPNAME_TEMPLATENAME      _FILTER_CONFIG_FROM_ASCII_("TemplateName"     )
-#define  PROPNAME_FILEFORMATVERSION _FILTER_CONFIG_FROM_ASCII_("FileFormatVersion")
+#define  PROPNAME_TYPE              PROPNAME_DECL(10, "Type"             )
+#define  PROPNAME_DOCUMENTSERVICE   PROPNAME_DECL(11, "DocumentService"  )
+#define  PROPNAME_FILTERSERVICE     PROPNAME_DECL(12, "FilterService"    )
+#define  PROPNAME_UICOMPONENT       PROPNAME_DECL(13, "UIComponent"      )
+#define  PROPNAME_FLAGS             PROPNAME_DECL(14, "Flags"            )
+#define  PROPNAME_USERDATA          PROPNAME_DECL(15, "UserData"         )
+#define  PROPNAME_TEMPLATENAME      PROPNAME_DECL(16, "TemplateName"     )
+#define  PROPNAME_FILEFORMATVERSION PROPNAME_DECL(17, "FileFormatVersion")
 
 /** @short  used to identify a frame loader or detect service item
             property against the configuration API and can be used
             at all name containers (based on this filtercache) too.
  */
-#define  PROPNAME_TYPES     _FILTER_CONFIG_FROM_ASCII_("Types")
+#define  PROPNAME_TYPES     PROPNAME_DECL(18, "Types")
 
 /** @short  used to identify the list of sorted filters for a specific
             office module

Index: filter/source/config/cache/registration.cxx
===================================================================
RCS file: /cvs/framework/filter/source/config/cache/registration.cxx,v
retrieving revision 1.5
diff -u -p -u -r1.5 registration.cxx
--- filter/source/config/cache/registration.cxx	8 Sep 2005 21:32:04 -0000	1.5
+++ filter/source/config/cache/registration.cxx	24 Aug 2006 14:10:26 -0000
@@ -38,6 +38,13 @@
 //_______________________________________________
 // includes
 
+#ifdef _FILTER_CONFIG_CONSTANT_HXX_
+#  error "Already included constant.hxx"
+#else
+#  define PROPNAME_IMPL_DECL
+#  include "constant.hxx"
+#endif
+#include <stdio.h>
 #include "typedetection.hxx"
 #include "filterfactory.hxx"
 #include "contenthandlerfactory.hxx"
@@ -55,6 +62,41 @@ namespace css = ::com::sun::star;
 //_______________________________________________
 // definitions
 
+rtl::OUString pFilterStrings[19];
+static bool bInitialized = false;
+
+static void InitConstants()
+{
+	if (!bInitialized)
+	{
+		::osl::MutexGuard aGuard(::osl::Mutex::getGlobalMutex());
+		if (!bInitialized)
+		{
+//			fprintf (stderr, "This should only happen once\n");
+			PROPNAME_NAME;
+			PROPNAME_UINAME;
+			PROPNAME_UINAMES;
+			PROPNAME_PREFERRED;
+			PROPNAME_PREFERREDFILTER;
+			PROPNAME_DETECTSERVICE;
+			PROPNAME_MEDIATYPE;
+			PROPNAME_CLIPBOARDFORMAT;
+			PROPNAME_URLPATTERN;
+			PROPNAME_EXTENSIONS;
+			PROPNAME_TYPE;
+			PROPNAME_DOCUMENTSERVICE;
+			PROPNAME_FILTERSERVICE;
+			PROPNAME_UICOMPONENT;
+			PROPNAME_FLAGS;
+			PROPNAME_USERDATA;
+			PROPNAME_TEMPLATENAME;
+			PROPNAME_FILEFORMATVERSION;
+			PROPNAME_TYPES;
+			bInitialized = true;
+		}
+	}
+}
+
 // extern "C" component_getImplementationEnvironment()
 _COMPHELPER_COMPONENT_GETIMPLEMENTATIONENVIRONMENT
 
@@ -85,6 +127,7 @@ _COMPHELPER_COMPONENT_WRITEINFO
 // extern "C" component_getFactory()
 _COMPHELPER_COMPONENT_GETFACTORY
 (
+	{ InitConstants(); },
     _COMPHELPER_MULTIINSTANCEFACTORY( TypeDetection::impl_getImplementationName()   ,
                                       TypeDetection::impl_getSupportedServiceNames(),
                                       TypeDetection::impl_createInstance            )
Index: filter/source/config/cache/registration.hxx
===================================================================
RCS file: /cvs/framework/filter/source/config/cache/registration.hxx,v
retrieving revision 1.3
diff -u -p -u -r1.3 registration.hxx
--- filter/source/config/cache/registration.hxx	8 Sep 2005 21:32:20 -0000	1.3
+++ filter/source/config/cache/registration.hxx	24 Aug 2006 14:10:26 -0000
@@ -199,7 +199,7 @@ namespace comphelper{
 
 /** TODO    doc
  */
-#define _COMPHELPER_COMPONENT_GETFACTORY(FACTORYLIST)                                                                                               \
+#define _COMPHELPER_COMPONENT_GETFACTORY(STATIC_INIT,FACTORYLIST)                                                                                               \
     extern "C" void* SAL_CALL component_getFactory(const sal_Char* pImplementationName,                                                             \
                                                          void*     pServiceManager    ,                                                             \
                                                          void*     pRegistryKey       )                                                             \
@@ -210,6 +210,8 @@ namespace comphelper{
            )                                                                                                                                        \
         return NULL;                                                                                                                                \
                                                                                                                                                     \
+        STATIC_INIT                                                                                                                                 \
+                                                                                                                                                    \
         css::uno::Reference< css::lang::XMultiServiceFactory >  xSMGR     = reinterpret_cast< css::lang::XMultiServiceFactory* >(pServiceManager);  \
         css::uno::Reference< css::lang::XSingleServiceFactory > xFactory  ;                                                                         \
         rtl::OUString                                           sImplName = ::rtl::OUString::createFromAscii(pImplementationName);                  \
