summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-04 12:42:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-04 21:17:46 +0200
commitea36e0502c0bc381577cfa1b1a7fedf0f05d1d72 (patch)
treed8eeb2ab7cee6f0a4ee40a846697216ce0bd5fd8 /forms
parent437abb3abbc506c1e20c6fec8e574abfe3487842 (diff)
tdf#150786 use a 'standard' theme for form controls
i.e. ignore system theme so we get the same results on export to pdf regardless of the theme (esp dark) and don't follow the system theme when hosted with a writer/calc/impress document (do continue to use system theme for StarBasic dialogs as seen in BasicIDE) Didn't reuse 'NativeWidgetLook' for this because is currently defaults off, while we currently do use the colors derived from the system theme even when this is off, its really the NWF flag to render using the platform theming engine Change-Id: I816d7ebaf793e5eac7bd937d44c1db0371145199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140942 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/Edit.cxx1
-rw-r--r--forms/source/component/FormComponent.cxx18
-rw-r--r--forms/source/inc/FormComponent.hxx1
-rw-r--r--forms/source/inc/frm_strings.hxx2
-rw-r--r--forms/source/inc/property.hxx2
5 files changed, 22 insertions, 2 deletions
diff --git a/forms/source/component/Edit.cxx b/forms/source/component/Edit.cxx
index 27ea6cc9982d..580e4f3a9f0e 100644
--- a/forms/source/component/Edit.cxx
+++ b/forms/source/component/Edit.cxx
@@ -382,6 +382,7 @@ void OEditModel::describeAggregateProperties( Sequence< Property >& _rAggregateP
RemoveProperty( _rAggregateProps, PROPERTY_NAME );
RemoveProperty( _rAggregateProps, PROPERTY_TAG );
RemoveProperty( _rAggregateProps, PROPERTY_NATIVE_LOOK );
+ RemoveProperty( _rAggregateProps, PROPERTY_STANDARD_THEME );
}
diff --git a/forms/source/component/FormComponent.cxx b/forms/source/component/FormComponent.cxx
index 2c882145ffd1..9b5558eed5e6 100644
--- a/forms/source/component/FormComponent.cxx
+++ b/forms/source/component/FormComponent.cxx
@@ -496,6 +496,7 @@ OControlModel::OControlModel(
,m_nTabIndex(FRM_DEFAULT_TABINDEX)
,m_nClassId(FormComponentType::CONTROL)
,m_bNativeLook( false )
+ ,m_bStandardTheme( false )
,m_bGenerateVbEvents( false )
,m_nControlTypeinMSO(0) // 0 : default value is create from AOO
,m_nObjIDinMSO(INVALID_OBJ_ID_IN_MSO)
@@ -548,6 +549,7 @@ OControlModel::OControlModel( const OControlModel* _pOriginal, const Reference<
m_nTabIndex = _pOriginal->m_nTabIndex;
m_nClassId = _pOriginal->m_nClassId;
m_bNativeLook = _pOriginal->m_bNativeLook;
+ m_bStandardTheme = _pOriginal->m_bStandardTheme;
m_bGenerateVbEvents = _pOriginal->m_bGenerateVbEvents;
m_nControlTypeinMSO = _pOriginal->m_nControlTypeinMSO;
m_nObjIDinMSO = _pOriginal->m_nObjIDinMSO;
@@ -871,6 +873,9 @@ Any OControlModel::getPropertyDefaultByHandle( sal_Int32 _nHandle ) const
case PROPERTY_ID_NATIVE_LOOK:
aReturn <<= true;
break;
+ case PROPERTY_ID_STANDARD_THEME:
+ aReturn <<= false;
+ break;
case PROPERTY_ID_GENERATEVBAEVENTS:
aReturn <<= false;
break;
@@ -909,6 +914,9 @@ void OControlModel::getFastPropertyValue( Any& _rValue, sal_Int32 _nHandle ) con
case PROPERTY_ID_NATIVE_LOOK:
_rValue <<= m_bNativeLook;
break;
+ case PROPERTY_ID_STANDARD_THEME:
+ _rValue <<= m_bStandardTheme;
+ break;
case PROPERTY_ID_GENERATEVBAEVENTS:
_rValue <<= m_bGenerateVbEvents;
break;
@@ -946,6 +954,9 @@ sal_Bool OControlModel::convertFastPropertyValue(
case PROPERTY_ID_NATIVE_LOOK:
bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_bNativeLook);
break;
+ case PROPERTY_ID_STANDARD_THEME:
+ bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_bStandardTheme);
+ break;
case PROPERTY_ID_GENERATEVBAEVENTS:
bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_bGenerateVbEvents);
break;
@@ -988,6 +999,9 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A
case PROPERTY_ID_NATIVE_LOOK:
OSL_VERIFY( _rValue >>= m_bNativeLook );
break;
+ case PROPERTY_ID_STANDARD_THEME:
+ OSL_VERIFY( _rValue >>= m_bStandardTheme );
+ break;
case PROPERTY_ID_GENERATEVBAEVENTS:
OSL_VERIFY( _rValue >>= m_bGenerateVbEvents );
break;
@@ -1009,12 +1023,14 @@ void OControlModel::setFastPropertyValue_NoBroadcast(sal_Int32 _nHandle, const A
void OControlModel::describeFixedProperties( Sequence< Property >& _rProps ) const
{
- _rProps.realloc(7);
+ _rProps.realloc(8);
css::beans::Property* pProperties = _rProps.getArray();
*pProperties++ = css::beans::Property(PROPERTY_CLASSID, PROPERTY_ID_CLASSID, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::READONLY | css::beans::PropertyAttribute::TRANSIENT);
*pProperties++ = css::beans::Property(PROPERTY_NAME, PROPERTY_ID_NAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
*pProperties++ = css::beans::Property(PROPERTY_NATIVE_LOOK, PROPERTY_ID_NATIVE_LOOK, cppu::UnoType<bool>::get(),
css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::TRANSIENT);
+ *pProperties++ = css::beans::Property(PROPERTY_STANDARD_THEME, PROPERTY_ID_STANDARD_THEME, cppu::UnoType<bool>::get(),
+ css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::TRANSIENT);
*pProperties++ = css::beans::Property(PROPERTY_TAG, PROPERTY_ID_TAG, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
*pProperties++ = css::beans::Property(PROPERTY_GENERATEVBAEVENTS, PROPERTY_ID_GENERATEVBAEVENTS, cppu::UnoType<sal_Bool>::get(), css::beans::PropertyAttribute::TRANSIENT);
*pProperties++ = css::beans::Property(PROPERTY_CONTROL_TYPE_IN_MSO, PROPERTY_ID_CONTROL_TYPE_IN_MSO, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND);
diff --git a/forms/source/inc/FormComponent.hxx b/forms/source/inc/FormComponent.hxx
index 833cd90df561..0a0ec19be553 100644
--- a/forms/source/inc/FormComponent.hxx
+++ b/forms/source/inc/FormComponent.hxx
@@ -321,6 +321,7 @@ protected:
sal_Int16 m_nTabIndex; // index within the taborder
sal_Int16 m_nClassId; // type of the control
bool m_bNativeLook; // should the control use the native platform look?
+ bool m_bStandardTheme; // should the default control colors be 'standard' or use the native platform theme?
bool m_bGenerateVbEvents; // should the control generate fake vba events
//added for exporting OCX control
sal_Int16 m_nControlTypeinMSO; //keep the MS office control type for exporting to MS binary file
diff --git a/forms/source/inc/frm_strings.hxx b/forms/source/inc/frm_strings.hxx
index 79f23aa46985..5dbceb886cc8 100644
--- a/forms/source/inc/frm_strings.hxx
+++ b/forms/source/inc/frm_strings.hxx
@@ -216,6 +216,8 @@ inline constexpr OUStringLiteral PROPERTY_HIDEINACTIVESELECTION = u"HideInactive
inline constexpr OUStringLiteral PROPERTY_HIGHLIGHT_COLOR = u"HighlightColor";
inline constexpr OUStringLiteral PROPERTY_HIGHLIGHT_TEXT_COLOR = u"HighlightTextColor";
+inline constexpr OUStringLiteral PROPERTY_STANDARD_THEME = u"StandardTheme";
+
inline constexpr OUStringLiteral PROPERTY_SHOW_POSITION = u"ShowPosition";
inline constexpr OUStringLiteral PROPERTY_SHOW_NAVIGATION = u"ShowNavigation";
inline constexpr OUStringLiteral PROPERTY_SHOW_RECORDACTIONS = u"ShowRecordActions";
diff --git a/forms/source/inc/property.hxx b/forms/source/inc/property.hxx
index e6879950a18b..54d19a03d319 100644
--- a/forms/source/inc/property.hxx
+++ b/forms/source/inc/property.hxx
@@ -57,7 +57,7 @@ namespace frm
#define PROPERTY_ID_VERTICAL_ALIGN (PROPERTY_ID_START + 22)
#define PROPERTY_ID_GRAPHIC (PROPERTY_ID_START + 23)
#define PROPERTY_ID_GROUP_NAME (PROPERTY_ID_START + 24)
- // free
+#define PROPERTY_ID_STANDARD_THEME (PROPERTY_ID_START + 25)
// free
// free
// free