summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-01 11:39:41 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-01 15:21:18 +0100
commit8d1aeb01ea025f6644401c3a9e01cb36a8ae367c (patch)
tree982e083d5665a1885266c82956b8e1402d88f5d3
parent7b9449986d841e2649e24a3045e6b821e4016438 (diff)
overly static
-rw-r--r--framework/inc/services/layoutmanager.hxx6
-rw-r--r--framework/source/fwe/classes/actiontriggerpropertyset.cxx6
-rw-r--r--framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx6
-rw-r--r--framework/source/fwi/uielement/constitemcontainer.cxx8
-rw-r--r--framework/source/fwi/uielement/rootitemcontainer.cxx8
-rw-r--r--framework/source/helper/uiconfigelementwrapperbase.cxx8
-rw-r--r--framework/source/helper/uielementwrapperbase.cxx8
-rw-r--r--framework/source/layoutmanager/layoutmanager.cxx40
-rw-r--r--framework/source/services/autorecovery.cxx4
-rw-r--r--framework/source/services/desktop.cxx8
-rw-r--r--framework/source/tabwin/tabwindow.cxx8
11 files changed, 66 insertions, 44 deletions
diff --git a/framework/inc/services/layoutmanager.hxx b/framework/inc/services/layoutmanager.hxx
index e8b9c17957f0..7afd3ebc5254 100644
--- a/framework/inc/services/layoutmanager.hxx
+++ b/framework/inc/services/layoutmanager.hxx
@@ -97,6 +97,10 @@ namespace framework
class ToolbarLayoutManager;
class PanelManager;
class GlobalSettings;
+ namespace detail
+ {
+ class InfoHelperBuilder;
+ }
typedef ::cppu::WeakImplHelper8 < ::com::sun::star::lang::XServiceInfo
, ::com::sun::star::frame::XLayoutManager
, ::com::sun::star::awt::XWindowListener
@@ -370,6 +374,8 @@ namespace framework
PanelManager* m_pPanelManager;
ToolbarLayoutManager* m_pToolbarManager;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener > m_xToolbarManager;
+
+ friend class detail::InfoHelperBuilder;
};
} // namespace framework
diff --git a/framework/source/fwe/classes/actiontriggerpropertyset.cxx b/framework/source/fwe/classes/actiontriggerpropertyset.cxx
index 6be1ddd537e6..91fbca5049f7 100644
--- a/framework/source/fwe/classes/actiontriggerpropertyset.cxx
+++ b/framework/source/fwe/classes/actiontriggerpropertyset.cxx
@@ -351,7 +351,7 @@ throw ( RuntimeException )
const Sequence< Property > ActionTriggerPropertySet::impl_getStaticPropertyDescriptor()
{
- static const Property pActionTriggerPropertys[] =
+ const Property pActionTriggerPropertys[] =
{
Property( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "CommandURL" )), HANDLE_COMMANDURL , ::getCppuType((::rtl::OUString*)0) , PropertyAttribute::TRANSIENT ),
Property( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "HelpURL" )), HANDLE_HELPURL , ::getCppuType((::rtl::OUString*)0) , PropertyAttribute::TRANSIENT ),
@@ -361,9 +361,9 @@ const Sequence< Property > ActionTriggerPropertySet::impl_getStaticPropertyDescr
};
// Use it to initialize sequence!
- static const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
+ const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
- // Return static "PropertyDescriptor"
+ // Return "PropertyDescriptor"
return seqActionTriggerPropertyDescriptor ;
}
diff --git a/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx b/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
index 0597b2d09837..9ae41cef8971 100644
--- a/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
+++ b/framework/source/fwe/classes/actiontriggerseparatorpropertyset.cxx
@@ -295,15 +295,15 @@ throw ( RuntimeException )
const Sequence< Property > ActionTriggerSeparatorPropertySet::impl_getStaticPropertyDescriptor()
{
- static const Property pActionTriggerPropertys[] =
+ const Property pActionTriggerPropertys[] =
{
Property( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SeparatorType" )), HANDLE_TYPE, ::getCppuType((sal_Int16*)0), PropertyAttribute::TRANSIENT )
};
// Use it to initialize sequence!
- static const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
+ const Sequence< Property > seqActionTriggerPropertyDescriptor( pActionTriggerPropertys, PROPERTYCOUNT );
- // Return static "PropertyDescriptor"
+ // Return "PropertyDescriptor"
return seqActionTriggerPropertyDescriptor ;
}
diff --git a/framework/source/fwi/uielement/constitemcontainer.cxx b/framework/source/fwi/uielement/constitemcontainer.cxx
index c90d0580ea1b..9d834ca119e5 100644
--- a/framework/source/fwi/uielement/constitemcontainer.cxx
+++ b/framework/source/fwi/uielement/constitemcontainer.cxx
@@ -451,22 +451,22 @@ throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang
const com::sun::star::uno::Sequence< com::sun::star::beans::Property > ConstItemContainer::impl_getStaticPropertyDescriptor()
{
- // Create a new static property array to initialize sequence!
+ // Create a property array to initialize sequence!
// Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
// Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
// It's necessary for methods of OPropertySetHelper.
// ATTENTION:
// YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
- static const com::sun::star::beans::Property pProperties[] =
+ const com::sun::star::beans::Property pProperties[] =
{
com::sun::star::beans::Property( PROPNAME_UINAME, PROPHANDLE_UINAME ,
::getCppuType((const rtl::OUString*)NULL),
com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY )
};
// Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
- // Return static "PropertyDescriptor"
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
+ // Return "PropertyDescriptor"
return lPropertyDescriptor;
}
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index e8759b0c0e7b..7f44c8c947d5 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -440,22 +440,22 @@ throw (::com::sun::star::uno::RuntimeException)
const com::sun::star::uno::Sequence< com::sun::star::beans::Property > RootItemContainer::impl_getStaticPropertyDescriptor()
{
- // Create a new static property array to initialize sequence!
+ // Create a property array to initialize sequence!
// Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
// Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
// It's necessary for methods of OPropertySetHelper.
// ATTENTION:
// YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
- static const com::sun::star::beans::Property pProperties[] =
+ const com::sun::star::beans::Property pProperties[] =
{
com::sun::star::beans::Property( PROPNAME_UINAME, PROPHANDLE_UINAME ,
::getCppuType((const rtl::OUString*)NULL),
com::sun::star::beans::PropertyAttribute::TRANSIENT )
};
// Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
- // Return static "PropertyDescriptor"
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, PROPCOUNT );
+ // Return "PropertyDescriptor"
return lPropertyDescriptor;
}
diff --git a/framework/source/helper/uiconfigelementwrapperbase.cxx b/framework/source/helper/uiconfigelementwrapperbase.cxx
index 4e416511c7a3..ab95ea744f5d 100644
--- a/framework/source/helper/uiconfigelementwrapperbase.cxx
+++ b/framework/source/helper/uiconfigelementwrapperbase.cxx
@@ -472,14 +472,14 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA
const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigElementWrapperBase::impl_getStaticPropertyDescriptor()
{
- // Create a new static property array to initialize sequence!
+ // Create property array to initialize sequence!
// Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
// Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
// It's necessary for methods of OPropertySetHelper.
// ATTENTION:
// YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
- static const com::sun::star::beans::Property pProperties[] =
+ const com::sun::star::beans::Property pProperties[] =
{
com::sun::star::beans::Property( UIELEMENT_PROPNAME_CONFIGLISTENER, UIELEMENT_PROPHANDLE_CONFIGLISTENER , ::getCppuType((const sal_Bool*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
com::sun::star::beans::Property( UIELEMENT_PROPNAME_CONFIGSOURCE , UIELEMENT_PROPHANDLE_CONFIGSOURCE , ::getCppuType((const Reference< ::com::sun::star::ui::XUIConfigurationManager >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT ),
@@ -491,8 +491,8 @@ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIConfigE
com::sun::star::beans::Property( UIELEMENT_PROPNAME_XMENUBAR , UIELEMENT_PROPHANDLE_XMENUBAR , ::getCppuType((const Reference< com::sun::star::awt::XMenuBar >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY )
};
// Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
- // Return static "PropertyDescriptor"
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
+ // Return "PropertyDescriptor"
return lPropertyDescriptor;
}
void SAL_CALL UIConfigElementWrapperBase::setSettings( const Reference< XIndexAccess >& xSettings ) throw ( RuntimeException )
diff --git a/framework/source/helper/uielementwrapperbase.cxx b/framework/source/helper/uielementwrapperbase.cxx
index bf2c2f7583fa..f86d0039900a 100644
--- a/framework/source/helper/uielementwrapperbase.cxx
+++ b/framework/source/helper/uielementwrapperbase.cxx
@@ -261,22 +261,22 @@ com::sun::star::uno::Reference< com::sun::star::beans::XPropertySetInfo > SAL_CA
const com::sun::star::uno::Sequence< com::sun::star::beans::Property > UIElementWrapperBase::impl_getStaticPropertyDescriptor()
{
- // Create a new static property array to initialize sequence!
+ // Create a property array to initialize sequence!
// Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
// Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
// It's necessary for methods of OPropertySetHelper.
// ATTENTION:
// YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
- static const com::sun::star::beans::Property pProperties[] =
+ const com::sun::star::beans::Property pProperties[] =
{
com::sun::star::beans::Property( UIELEMENT_PROPNAME_FRAME , UIELEMENT_PROPHANDLE_FRAME , ::getCppuType((Reference< XFrame >*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ),
com::sun::star::beans::Property( UIELEMENT_PROPNAME_RESOURCEURL , UIELEMENT_PROPHANDLE_RESOURCEURL , ::getCppuType((sal_Int16*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY ),
com::sun::star::beans::Property( UIELEMENT_PROPNAME_TYPE , UIELEMENT_PROPHANDLE_TYPE , ::getCppuType((const ::rtl::OUString*)NULL), com::sun::star::beans::PropertyAttribute::TRANSIENT | com::sun::star::beans::PropertyAttribute::READONLY )
};
// Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
- // Return static "PropertyDescriptor"
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, UIELEMENT_PROPCOUNT );
+ // Return "PropertyDescriptor"
return lPropertyDescriptor;
}
diff --git a/framework/source/layoutmanager/layoutmanager.cxx b/framework/source/layoutmanager/layoutmanager.cxx
index 847766c2a662..a7bc56cbd954 100644
--- a/framework/source/layoutmanager/layoutmanager.cxx
+++ b/framework/source/layoutmanager/layoutmanager.cxx
@@ -90,6 +90,7 @@
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/uno3.hxx>
#include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
#include <unotools/cmdoptions.hxx>
#include <algorithm>
@@ -3212,24 +3213,39 @@ void SAL_CALL LayoutManager::getFastPropertyValue( uno::Any& aValue, sal_Int32 n
LayoutManager_PBase::getFastPropertyValue( aValue, nHandle );
}
-::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper()
+namespace detail
{
- static ::cppu::OPropertyArrayHelper* pInfoHelper = NULL;
-
- if( pInfoHelper == NULL )
+ class InfoHelperBuilder : private ::boost::noncopyable
{
- osl::MutexGuard aGuard( osl::Mutex::getGlobalMutex() ) ;
-
- if( pInfoHelper == NULL )
+ private:
+ ::cppu::OPropertyArrayHelper *m_pInfoHelper;
+ public:
+ InfoHelperBuilder(const LayoutManager &rManager)
{
uno::Sequence< beans::Property > aProperties;
- describeProperties( aProperties );
- static ::cppu::OPropertyArrayHelper aInfoHelper( aProperties, sal_True );
- pInfoHelper = &aInfoHelper;
+ rManager.describeProperties(aProperties);
+ m_pInfoHelper = new ::cppu::OPropertyArrayHelper(aProperties, sal_True);
+ }
+ ~InfoHelperBuilder()
+ {
+ delete m_pInfoHelper;
}
- }
- return(*pInfoHelper);
+ ::cppu::OPropertyArrayHelper& getHelper() { return *m_pInfoHelper; }
+ };
+}
+namespace
+{
+ struct theInfoHelper :
+ public rtl::StaticWithArg< detail::InfoHelperBuilder, LayoutManager,
+ theInfoHelper >
+ {
+ };
+}
+
+::cppu::IPropertyArrayHelper& SAL_CALL LayoutManager::getInfoHelper()
+{
+ return theInfoHelper::get(*this).getHelper();
}
uno::Reference< beans::XPropertySetInfo > SAL_CALL LayoutManager::getPropertySetInfo() throw (uno::RuntimeException)
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index c269338b2237..0f620dcb7372 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3307,13 +3307,13 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue ,
//-----------------------------------------------
const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor()
{
- static const css::beans::Property pPropertys[] =
+ const css::beans::Property pPropertys[] =
{
css::beans::Property( AUTORECOVERY_PROPNAME_CRASHED , AUTORECOVERY_PROPHANDLE_CRASHED , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
css::beans::Property( AUTORECOVERY_PROPNAME_EXISTS_RECOVERYDATA, AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA, ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
css::beans::Property( AUTORECOVERY_PROPNAME_EXISTS_SESSIONDATA , AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA , ::getBooleanCppuType() , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
};
- static const css::uno::Sequence< css::beans::Property > lPropertyDescriptor(pPropertys, AUTORECOVERY_PROPCOUNT);
+ const css::uno::Sequence< css::beans::Property > lPropertyDescriptor(pPropertys, AUTORECOVERY_PROPCOUNT);
return lPropertyDescriptor;
}
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 28b56ad32a26..d7c478bc983d 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -1781,14 +1781,14 @@ css::uno::Reference< css::lang::XComponent > Desktop::impl_getFrameComponent( co
*//*-*************************************************************************************************************/
const css::uno::Sequence< css::beans::Property > Desktop::impl_getStaticPropertyDescriptor()
{
- // Create a new static property array to initialize sequence!
+ // Create a property array to initialize sequence!
// Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
// Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
// It's necessary for methods of OPropertySetHelper.
// ATTENTION:
// YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
- static const css::beans::Property pProperties[] =
+ const css::beans::Property pProperties[] =
{
css::beans::Property( DESKTOP_PROPNAME_ACTIVEFRAME , DESKTOP_PROPHANDLE_ACTIVEFRAME , ::getCppuType((const css::uno::Reference< css::lang::XComponent >*)NULL) , css::beans::PropertyAttribute::TRANSIENT | css::beans::PropertyAttribute::READONLY ),
css::beans::Property( DESKTOP_PROPNAME_DISPATCHRECORDERSUPPLIER , DESKTOP_PROPHANDLE_DISPATCHRECORDERSUPPLIER, ::getCppuType((const css::uno::Reference< css::frame::XDispatchRecorderSupplier >*)NULL), css::beans::PropertyAttribute::TRANSIENT ),
@@ -1797,8 +1797,8 @@ const css::uno::Sequence< css::beans::Property > Desktop::impl_getStaticProperty
css::beans::Property( DESKTOP_PROPNAME_TITLE , DESKTOP_PROPHANDLE_TITLE , ::getCppuType((const ::rtl::OUString*)NULL) , css::beans::PropertyAttribute::TRANSIENT ),
};
// Use it to initialize sequence!
- static const css::uno::Sequence< css::beans::Property > lPropertyDescriptor( pProperties, DESKTOP_PROPCOUNT );
- // Return static "PropertyDescriptor"
+ const css::uno::Sequence< css::beans::Property > lPropertyDescriptor( pProperties, DESKTOP_PROPCOUNT );
+ // Return "PropertyDescriptor"
return lPropertyDescriptor;
}
diff --git a/framework/source/tabwin/tabwindow.cxx b/framework/source/tabwin/tabwindow.cxx
index 143faff001d6..9f22997dc4d9 100644
--- a/framework/source/tabwin/tabwindow.cxx
+++ b/framework/source/tabwin/tabwindow.cxx
@@ -947,14 +947,14 @@ throw ( css::uno::RuntimeException )
const css::uno::Sequence< css::beans::Property > TabWindow::impl_getStaticPropertyDescriptor()
{
- // Create a new static property array to initialize sequence!
+ // Create property array to initialize sequence!
// Table of all predefined properties of this class. Its used from OPropertySetHelper-class!
// Don't forget to change the defines (see begin of this file), if you add, change or delete a property in this list!!!
// It's necessary for methods of OPropertySetHelper.
// ATTENTION:
// YOU MUST SORT FOLLOW TABLE BY NAME ALPHABETICAL !!!
- static const com::sun::star::beans::Property pProperties[] =
+ const com::sun::star::beans::Property pProperties[] =
{
com::sun::star::beans::Property( TABWINDOW_PROPNAME_PARENTWINDOW,
TABWINDOW_PROPHANDLE_PARENTWINDOW,
@@ -965,9 +965,9 @@ const css::uno::Sequence< css::beans::Property > TabWindow::impl_getStaticProper
::getCppuType((const css::uno::Reference< css::awt::XWindow >*)NULL),
com::sun::star::beans::PropertyAttribute::READONLY )
}; // Use it to initialize sequence!
- static const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, TABWINDOW_PROPCOUNT );
+ const com::sun::star::uno::Sequence< com::sun::star::beans::Property > lPropertyDescriptor( pProperties, TABWINDOW_PROPCOUNT );
- // Return static "PropertyDescriptor"
+ // Return "PropertyDescriptor"
return lPropertyDescriptor;
}