Kaydet (Commit) a2058e75 authored tarafından Mike Kaganski's avatar Mike Kaganski

replace double-checked locking patterns with thread safe local statics

Change-Id: Ie1aae7ecbd065a88b371d8c0deb586f54f7eff65
Reviewed-on: https://gerrit.libreoffice.org/62835
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst b156ca6e
......@@ -76,33 +76,14 @@ css::uno::Sequence< sal_Int8 > SAL_CALL SoundHandler::getImplementationId()
css::uno::Sequence< css::uno::Type > SAL_CALL SoundHandler::getTypes()
{
/* Optimize this method ! */
/* We initialize a static variable only one time. */
/* And we don't must use a mutex at every call! */
/* For the first call; pTypeCollection is NULL - */
/* for the second call pTypeCollection is different from NULL! */
static ::cppu::OTypeCollection* pTypeCollection = nullptr ;
if ( pTypeCollection == nullptr )
{
/* Ready for multithreading; get global mutex for first call of this method only! see before */
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
/* Control these pointer again ... it can be, that another instance will be faster then these! */
if ( pTypeCollection == nullptr )
{
/* Create a static typecollection ... */
static ::cppu::OTypeCollection aTypeCollection
(
cppu::UnoType<css::lang::XTypeProvider>::get(),
cppu::UnoType<css::lang::XServiceInfo>::get(),
cppu::UnoType<css::frame::XNotifyingDispatch>::get(),
cppu::UnoType<css::frame::XDispatch>::get(),
cppu::UnoType<css::document::XExtendedFilterDetection>::get()
);
/* ... and set his address to static pointer! */
pTypeCollection = &aTypeCollection ;
}
}
return pTypeCollection->getTypes();
static ::cppu::OTypeCollection aTypeCollection(
cppu::UnoType<css::lang::XTypeProvider>::get(),
cppu::UnoType<css::lang::XServiceInfo>::get(),
cppu::UnoType<css::frame::XNotifyingDispatch>::get(),
cppu::UnoType<css::frame::XDispatch>::get(),
cppu::UnoType<css::document::XExtendedFilterDetection>::get());
return aTypeCollection.getTypes();
}
#define IMPLEMENTATIONNAME_SOUNDHANDLER OUString("com.sun.star.comp.framework.SoundHandler")
......
......@@ -113,23 +113,15 @@ uno::Any SAL_CALL CreationWizardUnoDlg::queryAggregation( uno::Type const & rTyp
uno::Sequence< uno::Type > CreationWizardUnoDlg::getTypes()
{
static uno::Sequence< uno::Type > aTypeList;
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( !aTypeList.getLength() )
{
std::vector< uno::Type > aTypes;
aTypes.push_back( cppu::UnoType<lang::XComponent>::get() );
aTypes.push_back( cppu::UnoType<lang::XTypeProvider>::get() );
aTypes.push_back( cppu::UnoType<uno::XAggregation>::get() );
aTypes.push_back( cppu::UnoType<uno::XWeak>::get() );
aTypes.push_back( cppu::UnoType<lang::XServiceInfo>::get() );
aTypes.push_back( cppu::UnoType<lang::XInitialization>::get() );
aTypes.push_back( cppu::UnoType<frame::XTerminateListener>::get() );
aTypes.push_back( cppu::UnoType<ui::dialogs::XExecutableDialog>::get() );
aTypes.push_back( cppu::UnoType<beans::XPropertySet>::get() );
aTypeList = comphelper::containerToSequence( aTypes );
}
static uno::Sequence<uno::Type> aTypeList{ cppu::UnoType<lang::XComponent>::get(),
cppu::UnoType<lang::XTypeProvider>::get(),
cppu::UnoType<uno::XAggregation>::get(),
cppu::UnoType<uno::XWeak>::get(),
cppu::UnoType<lang::XServiceInfo>::get(),
cppu::UnoType<lang::XInitialization>::get(),
cppu::UnoType<frame::XTerminateListener>::get(),
cppu::UnoType<ui::dialogs::XExecutableDialog>::get(),
cppu::UnoType<beans::XPropertySet>::get() };
return aTypeList;
}
......
......@@ -42,57 +42,43 @@ namespace cppu
static typelib_InterfaceTypeDescription * get_type_XCurrentContext()
{
static typelib_InterfaceTypeDescription * s_type_XCurrentContext = nullptr;
if (nullptr == s_type_XCurrentContext)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if (nullptr == s_type_XCurrentContext)
{
OUString sTypeName("com.sun.star.uno.XCurrentContext");
typelib_InterfaceTypeDescription * pTD = nullptr;
typelib_TypeDescriptionReference * pMembers[1] = { nullptr };
OUString sMethodName0("com.sun.star.uno.XCurrentContext::getValueByName");
typelib_typedescriptionreference_new(
&pMembers[0],
typelib_TypeClass_INTERFACE_METHOD,
sMethodName0.pData );
typelib_typedescription_newInterface(
&pTD,
sTypeName.pData, 0, 0, 0, 0, 0,
* typelib_static_type_getByTypeClass( typelib_TypeClass_INTERFACE ),
1,
pMembers );
typelib_typedescription_register( reinterpret_cast<typelib_TypeDescription**>(&pTD) );
typelib_typedescriptionreference_release( pMembers[0] );
typelib_InterfaceMethodTypeDescription * pMethod = nullptr;
typelib_Parameter_Init aParameters[1];
OUString sParamName0("Name");
OUString sParamType0("string");
aParameters[0].pParamName = sParamName0.pData;
aParameters[0].eTypeClass = typelib_TypeClass_STRING;
aParameters[0].pTypeName = sParamType0.pData;
aParameters[0].bIn = true;
aParameters[0].bOut = false;
rtl_uString * pExceptions[1];
OUString sExceptionName0("com.sun.star.uno.RuntimeException");
pExceptions[0] = sExceptionName0.pData;
OUString sReturnType0("any");
typelib_typedescription_newInterfaceMethod(
&pMethod,
3, false,
sMethodName0.pData,
typelib_TypeClass_ANY, sReturnType0.pData,
1, aParameters, 1, pExceptions );
typelib_typedescription_register( reinterpret_cast<typelib_TypeDescription**>(&pMethod) );
typelib_typedescription_release( &pMethod->aBase.aBase );
// another static ref:
++reinterpret_cast< typelib_TypeDescription * >( pTD )->
nStaticRefCount;
s_type_XCurrentContext = pTD;
}
}
static typelib_InterfaceTypeDescription* s_type_XCurrentContext = []() {
OUString sTypeName("com.sun.star.uno.XCurrentContext");
typelib_InterfaceTypeDescription* pTD = nullptr;
typelib_TypeDescriptionReference* pMembers[1] = { nullptr };
OUString sMethodName0("com.sun.star.uno.XCurrentContext::getValueByName");
typelib_typedescriptionreference_new(&pMembers[0], typelib_TypeClass_INTERFACE_METHOD,
sMethodName0.pData);
typelib_typedescription_newInterface(
&pTD, sTypeName.pData, 0, 0, 0, 0, 0,
*typelib_static_type_getByTypeClass(typelib_TypeClass_INTERFACE), 1, pMembers);
typelib_typedescription_register(reinterpret_cast<typelib_TypeDescription**>(&pTD));
typelib_typedescriptionreference_release(pMembers[0]);
typelib_InterfaceMethodTypeDescription* pMethod = nullptr;
typelib_Parameter_Init aParameters[1];
OUString sParamName0("Name");
OUString sParamType0("string");
aParameters[0].pParamName = sParamName0.pData;
aParameters[0].eTypeClass = typelib_TypeClass_STRING;
aParameters[0].pTypeName = sParamType0.pData;
aParameters[0].bIn = true;
aParameters[0].bOut = false;
rtl_uString* pExceptions[1];
OUString sExceptionName0("com.sun.star.uno.RuntimeException");
pExceptions[0] = sExceptionName0.pData;
OUString sReturnType0("any");
typelib_typedescription_newInterfaceMethod(&pMethod, 3, false, sMethodName0.pData,
typelib_TypeClass_ANY, sReturnType0.pData, 1,
aParameters, 1, pExceptions);
typelib_typedescription_register(reinterpret_cast<typelib_TypeDescription**>(&pMethod));
typelib_typedescription_release(&pMethod->aBase.aBase);
// another static ref:
++reinterpret_cast<typelib_TypeDescription*>(pTD)->nStaticRefCount;
return pTD;
}();
return s_type_XCurrentContext;
}
......
......@@ -155,17 +155,8 @@ public:
#define IMPLEMENT_IMPLEMENTATION_ID( classname ) \
css::uno::Sequence< sal_Int8 > classname::getUnoTunnelImplementationId() \
{ \
static ::cppu::OImplementationId* pId = nullptr; \
if ( !pId ) \
{ \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \
if ( !pId ) \
{ \
static ::cppu::OImplementationId aId; \
pId = &aId; \
} \
} \
return pId->getImplementationId(); \
static ::cppu::OImplementationId aId; \
return aId.getImplementationId(); \
} \
css::uno::Sequence< sal_Int8 > classname::getImplementationId() \
{ \
......
......@@ -95,35 +95,25 @@ static const DispatchInfo SupportedCommandsArray[] =
{ ".uno:Bib/removeFilter" , frame::CommandGroup::DATA , true },
{ ".uno:Bib/sdbsource" , frame::CommandGroup::DATA , true },
{ ".uno:Bib/Mapping" , frame::CommandGroup::DATA , true },
{ nullptr , 0 , false }
};
typedef std::unordered_map< OUString, CacheDispatchInfo > CmdToInfoCache;
static const CmdToInfoCache& GetCommandToInfoCache()
{
static bool bCacheInitialized = false;
static CmdToInfoCache aCmdToInfoCache;
if ( !bCacheInitialized )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if ( !bCacheInitialized )
static CmdToInfoCache aCmdToInfoCache = []() {
CmdToInfoCache aCache;
for (const auto& command : SupportedCommandsArray)
{
sal_Int32 i( 0 );
while ( SupportedCommandsArray[i].pCommand != nullptr )
{
OUString aCommand( OUString::createFromAscii( SupportedCommandsArray[i].pCommand ));
OUString aCommand(OUString::createFromAscii(command.pCommand));
CacheDispatchInfo aDispatchInfo;
aDispatchInfo.nGroupId = SupportedCommandsArray[i].nGroupId;
aDispatchInfo.bActiveConnection = SupportedCommandsArray[i].bActiveConnection;
aCmdToInfoCache.emplace(aCommand, aDispatchInfo);
++i;
}
bCacheInitialized = true;
CacheDispatchInfo aDispatchInfo;
aDispatchInfo.nGroupId = command.nGroupId;
aDispatchInfo.bActiveConnection = command.bActiveConnection;
aCache.emplace(aCommand, aDispatchInfo);
}
}
return aCache;
}();
return aCmdToInfoCache;
}
......
......@@ -154,56 +154,53 @@ namespace pcr
namespace
{
#define DESCRIBE_EVENT( asciinamespace, asciilistener, asciimethod, id_postfix ) \
s_aKnownEvents.emplace( \
#define DESCRIBE_EVENT( map, asciinamespace, asciilistener, asciimethod, id_postfix ) \
map.emplace( \
asciimethod, \
EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) )
bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, EventDescription& _out_rDescription )
{
static EventMap s_aKnownEvents;
if ( s_aKnownEvents.empty() )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if ( s_aKnownEvents.empty() )
{
static sal_Int32 nEventId = 0;
DESCRIBE_EVENT( "form", "XApproveActionListener", "approveAction", APPROVEACTIONPERFORMED );
DESCRIBE_EVENT( "awt", "XActionListener", "actionPerformed", ACTIONPERFORMED );
DESCRIBE_EVENT( "form", "XChangeListener", "changed", CHANGED );
DESCRIBE_EVENT( "awt", "XTextListener", "textChanged", TEXTCHANGED );
DESCRIBE_EVENT( "awt", "XItemListener", "itemStateChanged", ITEMSTATECHANGED );
DESCRIBE_EVENT( "awt", "XFocusListener", "focusGained", FOCUSGAINED );
DESCRIBE_EVENT( "awt", "XFocusListener", "focusLost", FOCUSLOST );
DESCRIBE_EVENT( "awt", "XKeyListener", "keyPressed", KEYTYPED );
DESCRIBE_EVENT( "awt", "XKeyListener", "keyReleased", KEYUP );
DESCRIBE_EVENT( "awt", "XMouseListener", "mouseEntered", MOUSEENTERED );
DESCRIBE_EVENT( "awt", "XMouseMotionListener", "mouseDragged", MOUSEDRAGGED );
DESCRIBE_EVENT( "awt", "XMouseMotionListener", "mouseMoved", MOUSEMOVED );
DESCRIBE_EVENT( "awt", "XMouseListener", "mousePressed", MOUSEPRESSED );
DESCRIBE_EVENT( "awt", "XMouseListener", "mouseReleased", MOUSERELEASED );
DESCRIBE_EVENT( "awt", "XMouseListener", "mouseExited", MOUSEEXITED );
DESCRIBE_EVENT( "form", "XResetListener", "approveReset", APPROVERESETTED );
DESCRIBE_EVENT( "form", "XResetListener", "resetted", RESETTED );
DESCRIBE_EVENT( "form", "XSubmitListener", "approveSubmit", SUBMITTED );
DESCRIBE_EVENT( "form", "XUpdateListener", "approveUpdate", BEFOREUPDATE );
DESCRIBE_EVENT( "form", "XUpdateListener", "updated", AFTERUPDATE );
DESCRIBE_EVENT( "form", "XLoadListener", "loaded", LOADED );
DESCRIBE_EVENT( "form", "XLoadListener", "reloading", RELOADING );
DESCRIBE_EVENT( "form", "XLoadListener", "reloaded", RELOADED );
DESCRIBE_EVENT( "form", "XLoadListener", "unloading", UNLOADING );
DESCRIBE_EVENT( "form", "XLoadListener", "unloaded", UNLOADED );
DESCRIBE_EVENT( "form", "XConfirmDeleteListener", "confirmDelete", CONFIRMDELETE );
DESCRIBE_EVENT( "sdb", "XRowSetApproveListener", "approveRowChange", APPROVEROWCHANGE );
DESCRIBE_EVENT( "sdbc", "XRowSetListener", "rowChanged", ROWCHANGE );
DESCRIBE_EVENT( "sdb", "XRowSetApproveListener", "approveCursorMove", POSITIONING );
DESCRIBE_EVENT( "sdbc", "XRowSetListener", "cursorMoved", POSITIONED );
DESCRIBE_EVENT( "form", "XDatabaseParameterListener", "approveParameter", APPROVEPARAMETER );
DESCRIBE_EVENT( "sdb", "XSQLErrorListener", "errorOccured", ERROROCCURRED );
DESCRIBE_EVENT( "awt", "XAdjustmentListener", "adjustmentValueChanged", ADJUSTMENTVALUECHANGED );
}
}
static EventMap s_aKnownEvents = []() {
EventMap aMap;
sal_Int32 nEventId = 0;
DESCRIBE_EVENT(aMap, "form", "XApproveActionListener", "approveAction", APPROVEACTIONPERFORMED);
DESCRIBE_EVENT(aMap, "awt", "XActionListener", "actionPerformed", ACTIONPERFORMED);
DESCRIBE_EVENT(aMap, "form", "XChangeListener", "changed", CHANGED);
DESCRIBE_EVENT(aMap, "awt", "XTextListener", "textChanged", TEXTCHANGED);
DESCRIBE_EVENT(aMap, "awt", "XItemListener", "itemStateChanged", ITEMSTATECHANGED);
DESCRIBE_EVENT(aMap, "awt", "XFocusListener", "focusGained", FOCUSGAINED);
DESCRIBE_EVENT(aMap, "awt", "XFocusListener", "focusLost", FOCUSLOST);
DESCRIBE_EVENT(aMap, "awt", "XKeyListener", "keyPressed", KEYTYPED);
DESCRIBE_EVENT(aMap, "awt", "XKeyListener", "keyReleased", KEYUP);
DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mouseEntered", MOUSEENTERED);
DESCRIBE_EVENT(aMap, "awt", "XMouseMotionListener", "mouseDragged", MOUSEDRAGGED);
DESCRIBE_EVENT(aMap, "awt", "XMouseMotionListener", "mouseMoved", MOUSEMOVED);
DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mousePressed", MOUSEPRESSED);
DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mouseReleased", MOUSERELEASED);
DESCRIBE_EVENT(aMap, "awt", "XMouseListener", "mouseExited", MOUSEEXITED);
DESCRIBE_EVENT(aMap, "form", "XResetListener", "approveReset", APPROVERESETTED);
DESCRIBE_EVENT(aMap, "form", "XResetListener", "resetted", RESETTED);
DESCRIBE_EVENT(aMap, "form", "XSubmitListener", "approveSubmit", SUBMITTED);
DESCRIBE_EVENT(aMap, "form", "XUpdateListener", "approveUpdate", BEFOREUPDATE);
DESCRIBE_EVENT(aMap, "form", "XUpdateListener", "updated", AFTERUPDATE);
DESCRIBE_EVENT(aMap, "form", "XLoadListener", "loaded", LOADED);
DESCRIBE_EVENT(aMap, "form", "XLoadListener", "reloading", RELOADING);
DESCRIBE_EVENT(aMap, "form", "XLoadListener", "reloaded", RELOADED);
DESCRIBE_EVENT(aMap, "form", "XLoadListener", "unloading", UNLOADING);
DESCRIBE_EVENT(aMap, "form", "XLoadListener", "unloaded", UNLOADED);
DESCRIBE_EVENT(aMap, "form", "XConfirmDeleteListener", "confirmDelete", CONFIRMDELETE);
DESCRIBE_EVENT(aMap, "sdb", "XRowSetApproveListener", "approveRowChange", APPROVEROWCHANGE);
DESCRIBE_EVENT(aMap, "sdbc", "XRowSetListener", "rowChanged", ROWCHANGE);
DESCRIBE_EVENT(aMap, "sdb", "XRowSetApproveListener", "approveCursorMove", POSITIONING);
DESCRIBE_EVENT(aMap, "sdbc", "XRowSetListener", "cursorMoved", POSITIONED);
DESCRIBE_EVENT(aMap, "form", "XDatabaseParameterListener", "approveParameter", APPROVEPARAMETER);
DESCRIBE_EVENT(aMap, "sdb", "XSQLErrorListener", "errorOccured", ERROROCCURRED);
DESCRIBE_EVENT(aMap, "awt", "XAdjustmentListener", "adjustmentValueChanged", ADJUSTMENTVALUECHANGED);
return aMap;
}();
EventMap::const_iterator pos = s_aKnownEvents.find( _rMethodName );
if ( pos == s_aKnownEvents.end() )
......
......@@ -524,17 +524,8 @@ namespace frm
Sequence< sal_Int8 > ORichTextModel::getEditEngineTunnelId()
{
static ::cppu::OImplementationId * pId = nullptr;
if (! pId)
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if (! pId)
{
static ::cppu::OImplementationId aId;
pId = &aId;
}
}
return pId->getImplementationId();
static cppu::OImplementationId aId;
return aId.getImplementationId();
}
......
......@@ -234,47 +234,41 @@ Any SAL_CALL TableColumn::getFastPropertyValue( sal_Int32 nHandle )
rtl::Reference< FastPropertySetInfo > TableColumn::getStaticPropertySetInfo()
{
static rtl::Reference< FastPropertySetInfo > xInfo;
if( !xInfo.is() )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( !xInfo.is() )
{
PropertyVector aProperties(6);
aProperties[0].Name = "Width";
aProperties[0].Handle = Property_Width;
aProperties[0].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[0].Attributes = 0;
aProperties[1].Name = "OptimalWidth";
aProperties[1].Handle = Property_OptimalWidth;
aProperties[1].Type = cppu::UnoType<bool>::get();
aProperties[1].Attributes = 0;
aProperties[2].Name = "IsVisible";
aProperties[2].Handle = Property_IsVisible;
aProperties[2].Type = cppu::UnoType<bool>::get();
aProperties[2].Attributes = 0;
aProperties[3].Name = "IsStartOfNewPage";
aProperties[3].Handle = Property_IsStartOfNewPage;
aProperties[3].Type = cppu::UnoType<bool>::get();
aProperties[3].Attributes = 0;
aProperties[4].Name = "Size";
aProperties[4].Handle = Property_Width;
aProperties[4].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[4].Attributes = 0;
aProperties[5].Name = "OptimalSize";
aProperties[5].Handle = Property_OptimalWidth;
aProperties[5].Type = cppu::UnoType<bool>::get();
aProperties[5].Attributes = 0;
xInfo.set( new FastPropertySetInfo(aProperties) );
}
}
static rtl::Reference<FastPropertySetInfo> xInfo = []() {
PropertyVector aProperties(6);
aProperties[0].Name = "Width";
aProperties[0].Handle = Property_Width;
aProperties[0].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[0].Attributes = 0;
aProperties[1].Name = "OptimalWidth";
aProperties[1].Handle = Property_OptimalWidth;
aProperties[1].Type = cppu::UnoType<bool>::get();
aProperties[1].Attributes = 0;
aProperties[2].Name = "IsVisible";
aProperties[2].Handle = Property_IsVisible;
aProperties[2].Type = cppu::UnoType<bool>::get();
aProperties[2].Attributes = 0;
aProperties[3].Name = "IsStartOfNewPage";
aProperties[3].Handle = Property_IsStartOfNewPage;
aProperties[3].Type = cppu::UnoType<bool>::get();
aProperties[3].Attributes = 0;
aProperties[4].Name = "Size";
aProperties[4].Handle = Property_Width;
aProperties[4].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[4].Attributes = 0;
aProperties[5].Name = "OptimalSize";
aProperties[5].Handle = Property_OptimalWidth;
aProperties[5].Type = cppu::UnoType<bool>::get();
aProperties[5].Attributes = 0;
return rtl::Reference<FastPropertySetInfo>(new FastPropertySetInfo(aProperties));
}();
return xInfo;
}
......
......@@ -308,47 +308,41 @@ Any SAL_CALL TableRow::getFastPropertyValue( sal_Int32 nHandle )
rtl::Reference< FastPropertySetInfo > TableRow::getStaticPropertySetInfo()
{
static rtl::Reference< FastPropertySetInfo > xInfo;
if( !xInfo.is() )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if( !xInfo.is() )
{
PropertyVector aProperties(6);
aProperties[0].Name = "Height";
aProperties[0].Handle = Property_Height;
aProperties[0].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[0].Attributes = 0;
aProperties[1].Name = "OptimalHeight";
aProperties[1].Handle = Property_OptimalHeight;
aProperties[1].Type = cppu::UnoType<bool>::get();
aProperties[1].Attributes = 0;
aProperties[2].Name = "IsVisible";
aProperties[2].Handle = Property_IsVisible;
aProperties[2].Type = cppu::UnoType<bool>::get();
aProperties[2].Attributes = 0;
aProperties[3].Name = "IsStartOfNewPage";
aProperties[3].Handle = Property_IsStartOfNewPage;
aProperties[3].Type = cppu::UnoType<bool>::get();
aProperties[3].Attributes = 0;
aProperties[4].Name = "Size";
aProperties[4].Handle = Property_Height;
aProperties[4].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[4].Attributes = 0;
aProperties[5].Name = "OptimalSize";
aProperties[5].Handle = Property_OptimalHeight;
aProperties[5].Type = cppu::UnoType<bool>::get();
aProperties[5].Attributes = 0;
xInfo.set( new FastPropertySetInfo(aProperties) );
}
}
static rtl::Reference<FastPropertySetInfo> xInfo = []() {
PropertyVector aProperties(6);
aProperties[0].Name = "Height";
aProperties[0].Handle = Property_Height;
aProperties[0].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[0].Attributes = 0;
aProperties[1].Name = "OptimalHeight";
aProperties[1].Handle = Property_OptimalHeight;
aProperties[1].Type = cppu::UnoType<bool>::get();
aProperties[1].Attributes = 0;
aProperties[2].Name = "IsVisible";
aProperties[2].Handle = Property_IsVisible;
aProperties[2].Type = cppu::UnoType<bool>::get();
aProperties[2].Attributes = 0;
aProperties[3].Name = "IsStartOfNewPage";
aProperties[3].Handle = Property_IsStartOfNewPage;
aProperties[3].Type = cppu::UnoType<bool>::get();
aProperties[3].Attributes = 0;
aProperties[4].Name = "Size";
aProperties[4].Handle = Property_Height;
aProperties[4].Type = ::cppu::UnoType<sal_Int32>::get();
aProperties[4].Attributes = 0;
aProperties[5].Name = "OptimalSize";
aProperties[5].Handle = Property_OptimalHeight;
aProperties[5].Type = cppu::UnoType<bool>::get();
aProperties[5].Attributes = 0;
return rtl::Reference<FastPropertySetInfo>(new FastPropertySetInfo(aProperties));
}();
return xInfo;
}
......
......@@ -79,18 +79,8 @@ namespace
{
const Sequence< OUString >& lcl_getLanguageDependentProperties()
{
static Sequence< OUString > s_aLanguageDependentProperties;
if ( s_aLanguageDependentProperties.getLength() == 0 )
{
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
if ( s_aLanguageDependentProperties.getLength() == 0 )
{
s_aLanguageDependentProperties.realloc( 2 );
s_aLanguageDependentProperties[0] = "HelpText";
s_aLanguageDependentProperties[1] = "Title";
// note: properties must be sorted
}
}
// note: properties must be sorted
static Sequence<OUString> s_aLanguageDependentProperties{ "HelpText", "Title" };
return s_aLanguageDependentProperties;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment