diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-11-02 20:51:05 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2021-11-03 18:50:30 +0100 |
commit | d33613c067c198c2a6ef30fb56bcc0cce7565c9b (patch) | |
tree | 187a9218ae36c2efede3b4653a9293a2a43723bd /forms | |
parent | b33bd288111fc07177b3dc36c3b2f8d60a5dec19 (diff) |
Replace some macros in forms part 2
DECL_PROP4 + REGISTER_PROP_2 + REGISTER_PROP_3 + REGISTER_VOID_PROP_2
Change-Id: Ib7fdfed9f94fe0bb2c3f4f1398bc058af84823d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124615
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/Grid.cxx | 3 | ||||
-rw-r--r-- | forms/source/component/navigationbar.cxx | 43 | ||||
-rw-r--r-- | forms/source/inc/property.hxx | 18 | ||||
-rw-r--r-- | forms/source/richtext/richtextmodel.cxx | 83 |
4 files changed, 86 insertions, 61 deletions
diff --git a/forms/source/component/Grid.cxx b/forms/source/component/Grid.cxx index 67fb4cba1bbf..0b98db032679 100644 --- a/forms/source/component/Grid.cxx +++ b/forms/source/component/Grid.cxx @@ -406,7 +406,8 @@ void OGridControlModel::describeFixedProperties( Sequence< Property >& _rProps ) DECL_PROP1(FONT_STRIKEOUT, sal_Int16, MAYBEDEFAULT); DECL_PROP2(RECORDMARKER, sal_Bool, BOUND, MAYBEDEFAULT ); DECL_PROP2(PRINTABLE, sal_Bool, BOUND, MAYBEDEFAULT ); - DECL_PROP4(CURSORCOLOR, sal_Int32, BOUND, MAYBEDEFAULT, MAYBEVOID , TRANSIENT); + DECL_PROP_IMPL(CURSORCOLOR, sal_Int32) css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | + css::beans::PropertyAttribute::MAYBEVOID | css::beans::PropertyAttribute::TRANSIENT); DECL_PROP3(ALWAYSSHOWCURSOR, sal_Bool, BOUND, MAYBEDEFAULT, TRANSIENT); DECL_PROP3(DISPLAYSYNCHRON, sal_Bool, BOUND, MAYBEDEFAULT, TRANSIENT); DECL_PROP2(HELPURL, OUString, BOUND, MAYBEDEFAULT); diff --git a/forms/source/component/navigationbar.cxx b/forms/source/component/navigationbar.cxx index 368ab62d3fa9..b3b386d2aefc 100644 --- a/forms/source/component/navigationbar.cxx +++ b/forms/source/component/navigationbar.cxx @@ -99,20 +99,35 @@ namespace frm void ONavigationBarModel::implInitPropertyContainer() { - REGISTER_PROP_2( DEFAULTCONTROL, m_sDefaultControl, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HELPTEXT, m_sHelpText, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HELPURL, m_sHelpURL, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( ENABLED, m_bEnabled, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( ENABLEVISIBLE, m_bEnableVisible, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( ICONSIZE, m_nIconSize, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( BORDER, m_nBorder, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( DELAY, m_nDelay, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( SHOW_POSITION, m_bShowPosition, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( SHOW_NAVIGATION, m_bShowNavigation, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( SHOW_RECORDACTIONS, m_bShowActions, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( SHOW_FILTERSORT, m_bShowFilterSort, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( WRITING_MODE, m_nWritingMode, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_3( CONTEXT_WRITING_MODE,m_nContextWritingMode, BOUND, MAYBEDEFAULT, TRANSIENT ); + registerProperty( PROPERTY_DEFAULTCONTROL, PROPERTY_ID_DEFAULTCONTROL, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sDefaultControl, cppu::UnoType<decltype(m_sDefaultControl)>::get() ); + registerProperty( PROPERTY_HELPTEXT, PROPERTY_ID_HELPTEXT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sHelpText, cppu::UnoType<decltype(m_sHelpText)>::get() ); + registerProperty( PROPERTY_HELPURL, PROPERTY_ID_HELPURL, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sHelpURL, cppu::UnoType<decltype(m_sHelpURL)>::get() ); + registerProperty( PROPERTY_ENABLED, PROPERTY_ID_ENABLED, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bEnabled, cppu::UnoType<decltype(m_bEnabled)>::get() ); + registerProperty( PROPERTY_ENABLEVISIBLE, PROPERTY_ID_ENABLEVISIBLE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bEnableVisible, cppu::UnoType<decltype(m_bEnableVisible)>::get() ); + registerProperty( PROPERTY_ICONSIZE, PROPERTY_ID_ICONSIZE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nIconSize, cppu::UnoType<decltype(m_nIconSize)>::get() ); + registerProperty( PROPERTY_BORDER, PROPERTY_ID_BORDER, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nBorder, cppu::UnoType<decltype(m_nBorder)>::get() ); + registerProperty( PROPERTY_DELAY, PROPERTY_ID_DELAY, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nDelay, cppu::UnoType<decltype(m_nDelay)>::get() ); + registerProperty( PROPERTY_SHOW_POSITION, PROPERTY_ID_SHOW_POSITION, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bShowPosition, cppu::UnoType<decltype(m_bShowPosition)>::get() ); + registerProperty( PROPERTY_SHOW_NAVIGATION, PROPERTY_ID_SHOW_NAVIGATION, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bShowNavigation, cppu::UnoType<decltype(m_bShowNavigation)>::get() ); + registerProperty( PROPERTY_SHOW_RECORDACTIONS, PROPERTY_ID_SHOW_RECORDACTIONS, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bShowActions, cppu::UnoType<decltype(m_bShowActions)>::get() ); + registerProperty( PROPERTY_SHOW_FILTERSORT, PROPERTY_ID_SHOW_FILTERSORT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bShowFilterSort, cppu::UnoType<decltype(m_bShowFilterSort)>::get() ); + registerProperty( PROPERTY_WRITING_MODE, PROPERTY_ID_WRITING_MODE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nWritingMode, cppu::UnoType<decltype(m_nWritingMode)>::get() ); + + registerProperty( PROPERTY_CONTEXT_WRITING_MODE, PROPERTY_ID_CONTEXT_WRITING_MODE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT | PropertyAttribute::TRANSIENT, + &m_nContextWritingMode, cppu::UnoType<decltype(m_nContextWritingMode)>::get() ); REGISTER_VOID_PROP( TABSTOP, m_aTabStop, sal_Bool ); REGISTER_VOID_PROP( BACKGROUNDCOLOR, m_aBackgroundColor, sal_Int32 ); diff --git a/forms/source/inc/property.hxx b/forms/source/inc/property.hxx index 61447430dced..7e9642b8d2d9 100644 --- a/forms/source/inc/property.hxx +++ b/forms/source/inc/property.hxx @@ -377,9 +377,6 @@ public: DECL_PROP_IMPL(varname, type) css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3) -#define DECL_PROP4(varname, type, attrib1, attrib2, attrib3, attrib4) \ - DECL_PROP_IMPL(varname, type) css::beans::PropertyAttribute::attrib1 | css::beans::PropertyAttribute::attrib2 | css::beans::PropertyAttribute::attrib3 | css::beans::PropertyAttribute::attrib4) - // === some property types require special handling // === such Boolean properties @@ -393,21 +390,6 @@ public: #define END_DESCRIBE_PROPERTIES() \ DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(), "<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?"); \ - -#define REGISTER_PROP_2( prop, member, attrib1, attrib2 ) \ - registerProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::attrib1 | PropertyAttribute::attrib2, \ - &member, cppu::UnoType<decltype(member)>::get() ); - -#define REGISTER_PROP_3( prop, member, attrib1, attrib2, attrib3 ) \ - registerProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::attrib1 | PropertyAttribute::attrib2 | PropertyAttribute::attrib3, \ - &member, cppu::UnoType<decltype(member)>::get() ); - - -#define REGISTER_VOID_PROP_2( prop, memberAny, type, attrib1, attrib2 ) \ - registerMayBeVoidProperty( PROPERTY_##prop, PROPERTY_ID_##prop, PropertyAttribute::MAYBEVOID | PropertyAttribute::attrib1 | PropertyAttribute::attrib2, \ - &memberAny, cppu::UnoType<type>::get() ); - - } //... namespace frm ....................................................... diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx index 3b78baa524e0..edd2e3ff6ab7 100644 --- a/forms/source/richtext/richtextmodel.cxx +++ b/forms/source/richtext/richtextmodel.cxx @@ -165,37 +165,64 @@ namespace frm void ORichTextModel::implRegisterProperties() { - REGISTER_PROP_2( DEFAULTCONTROL, m_sDefaultControl, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HELPTEXT, m_sHelpText, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HELPURL, m_sHelpURL, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( ENABLED, m_bEnabled, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( ENABLEVISIBLE, m_bEnableVisible, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( BORDER, m_nBorder, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HARDLINEBREAKS, m_bHardLineBreaks, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HSCROLL, m_bHScroll, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( VSCROLL, m_bVScroll, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( READONLY, m_bReadonly, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( PRINTABLE, m_bPrintable, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( REFERENCE_DEVICE, m_xReferenceDevice, BOUND, TRANSIENT ); - REGISTER_PROP_2( RICH_TEXT, m_bReallyActAsRichText, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( HIDEINACTIVESELECTION, m_bHideInactiveSelection, BOUND, MAYBEDEFAULT ); - - REGISTER_VOID_PROP_2( TABSTOP, m_aTabStop, sal_Bool, BOUND, MAYBEDEFAULT ); - REGISTER_VOID_PROP_2( BACKGROUNDCOLOR, m_aBackgroundColor, sal_Int32, BOUND, MAYBEDEFAULT ); - REGISTER_VOID_PROP_2( BORDERCOLOR, m_aBorderColor, sal_Int32, BOUND, MAYBEDEFAULT ); - REGISTER_VOID_PROP_2( VERTICAL_ALIGN, m_aVerticalAlignment, VerticalAlignment, BOUND, MAYBEDEFAULT ); + registerProperty( PROPERTY_DEFAULTCONTROL, PROPERTY_ID_DEFAULTCONTROL, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sDefaultControl, cppu::UnoType<decltype(m_sDefaultControl)>::get() ); + registerProperty( PROPERTY_HELPTEXT, PROPERTY_ID_HELPTEXT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sHelpText, cppu::UnoType<decltype(m_sHelpText)>::get() ); + registerProperty( PROPERTY_HELPURL, PROPERTY_ID_HELPURL, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sHelpURL, cppu::UnoType<decltype(m_sHelpURL)>::get() ); + registerProperty( PROPERTY_ENABLED, PROPERTY_ID_ENABLED, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bEnabled, cppu::UnoType<decltype(m_bEnabled)>::get() ); + registerProperty( PROPERTY_ENABLEVISIBLE, PROPERTY_ID_ENABLEVISIBLE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bEnableVisible, cppu::UnoType<decltype(m_bEnableVisible)>::get() ); + registerProperty( PROPERTY_BORDER, PROPERTY_ID_BORDER, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nBorder, cppu::UnoType<decltype(m_nBorder)>::get() ); + registerProperty( PROPERTY_HARDLINEBREAKS, PROPERTY_ID_HARDLINEBREAKS, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bHardLineBreaks, cppu::UnoType<decltype(m_bHardLineBreaks)>::get() ); + registerProperty( PROPERTY_HSCROLL, PROPERTY_ID_HSCROLL, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bHScroll, cppu::UnoType<decltype(m_bHScroll)>::get() ); + registerProperty( PROPERTY_VSCROLL, PROPERTY_ID_VSCROLL, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bVScroll, cppu::UnoType<decltype(m_bVScroll)>::get() ); + registerProperty( PROPERTY_READONLY, PROPERTY_ID_READONLY, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bReadonly, cppu::UnoType<decltype(m_bReadonly)>::get() ); + registerProperty( PROPERTY_PRINTABLE, PROPERTY_ID_PRINTABLE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bPrintable, cppu::UnoType<decltype(m_bPrintable)>::get() ); + registerProperty( PROPERTY_REFERENCE_DEVICE, PROPERTY_ID_REFERENCE_DEVICE, PropertyAttribute::BOUND | PropertyAttribute::TRANSIENT, + &m_xReferenceDevice, cppu::UnoType<decltype(m_xReferenceDevice)>::get() ); + registerProperty( PROPERTY_RICH_TEXT, PROPERTY_ID_RICH_TEXT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bReallyActAsRichText, cppu::UnoType<decltype(m_bReallyActAsRichText)>::get() ); + registerProperty( PROPERTY_HIDEINACTIVESELECTION, PROPERTY_ID_HIDEINACTIVESELECTION, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bHideInactiveSelection, cppu::UnoType<decltype(m_bHideInactiveSelection)>::get() ); + + registerMayBeVoidProperty( PROPERTY_TABSTOP, PROPERTY_ID_TABSTOP, PropertyAttribute::MAYBEVOID | PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_aTabStop, cppu::UnoType<sal_Bool>::get() ); + registerMayBeVoidProperty( PROPERTY_BACKGROUNDCOLOR, PROPERTY_ID_BACKGROUNDCOLOR, PropertyAttribute::MAYBEVOID | PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_aBackgroundColor, cppu::UnoType<sal_Int32>::get() ); + registerMayBeVoidProperty( PROPERTY_BORDERCOLOR, PROPERTY_ID_BORDERCOLOR, PropertyAttribute::MAYBEVOID | PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_aBorderColor, cppu::UnoType<sal_Int32>::get() ); + registerMayBeVoidProperty( PROPERTY_VERTICAL_ALIGN, PROPERTY_ID_VERTICAL_ALIGN, PropertyAttribute::MAYBEVOID | PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_aVerticalAlignment, cppu::UnoType<VerticalAlignment>::get() ); // properties which exist only for compatibility with the css.swt.UnoControlEditModel, // since we replace the default implementation for this service - REGISTER_PROP_2( ECHO_CHAR, m_nEchoChar, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( MAXTEXTLEN, m_nMaxTextLength, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( MULTILINE, m_bMultiLine, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( TEXT, m_sLastKnownEngineText, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( LINEEND_FORMAT, m_nLineEndFormat, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_2( WRITING_MODE, m_nTextWritingMode, BOUND, MAYBEDEFAULT ); - REGISTER_PROP_3( CONTEXT_WRITING_MODE, m_nContextWritingMode, BOUND, MAYBEDEFAULT, TRANSIENT ); - - REGISTER_VOID_PROP_2( ALIGN, m_aAlign, sal_Int16, BOUND, MAYBEDEFAULT ); + registerProperty( PROPERTY_ECHO_CHAR, PROPERTY_ID_ECHO_CHAR, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nEchoChar, cppu::UnoType<decltype(m_nEchoChar)>::get() ); + registerProperty( PROPERTY_MAXTEXTLEN, PROPERTY_ID_MAXTEXTLEN, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nMaxTextLength, cppu::UnoType<decltype(m_nMaxTextLength)>::get() ); + registerProperty( PROPERTY_MULTILINE, PROPERTY_ID_MULTILINE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_bMultiLine, cppu::UnoType<decltype(m_bMultiLine)>::get() ); + registerProperty( PROPERTY_TEXT, PROPERTY_ID_TEXT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_sLastKnownEngineText, cppu::UnoType<decltype(m_sLastKnownEngineText)>::get() ); + registerProperty( PROPERTY_LINEEND_FORMAT, PROPERTY_ID_LINEEND_FORMAT, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nLineEndFormat, cppu::UnoType<decltype(m_nLineEndFormat)>::get() ); + registerProperty( PROPERTY_WRITING_MODE, PROPERTY_ID_WRITING_MODE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_nTextWritingMode, cppu::UnoType<decltype(m_nTextWritingMode)>::get() ); + + registerProperty( PROPERTY_CONTEXT_WRITING_MODE, PROPERTY_ID_CONTEXT_WRITING_MODE, PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT | + PropertyAttribute::TRANSIENT, &m_nContextWritingMode, cppu::UnoType<decltype(m_nContextWritingMode)>::get() ); + + registerMayBeVoidProperty( PROPERTY_ALIGN, PROPERTY_ID_ALIGN, PropertyAttribute::MAYBEVOID | PropertyAttribute::BOUND | PropertyAttribute::MAYBEDEFAULT, + &m_aAlign, cppu::UnoType<sal_Int16>::get() ); } |