Kaydet (Commit) b4ba8dc9 authored tarafından Noel Grandin's avatar Noel Grandin

tdf#117161 ReportBuilder horizontal align wrong when editing

regression from
	commit 5d0e485e
	use actual UNO enums in reportdesign..svtools

Also make some of the "template<> set" property helpers only fire on
actual property change

Change-Id: I930fd255d287c3c7e5b064823fd1e8d4b665eae0
Reviewed-on: https://gerrit.libreoffice.org/53412Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 64a0f135
...@@ -51,6 +51,22 @@ namespace reportdesign ...@@ -51,6 +51,22 @@ namespace reportdesign
OFixedText(const OFixedText&) = delete; OFixedText(const OFixedText&) = delete;
OFixedText& operator=(const OFixedText&) = delete; OFixedText& operator=(const OFixedText&) = delete;
// internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
void set( const OUString& _sProperty
,sal_Int16 Value
,css::style::ParagraphAdjust& _member)
{
BoundListeners l;
{
::osl::MutexGuard aGuard(m_aMutex);
if ( static_cast<sal_Int16>(_member) != Value )
{
prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
_member = static_cast<css::style::ParagraphAdjust>(Value);
}
}
l.notify();
}
template <typename T> void set( const OUString& _sProperty template <typename T> void set( const OUString& _sProperty
,const T& Value ,const T& Value
,T& _member) ,T& _member)
......
...@@ -49,6 +49,22 @@ namespace reportdesign ...@@ -49,6 +49,22 @@ namespace reportdesign
OFormatCondition(const OFormatCondition&) = delete; OFormatCondition(const OFormatCondition&) = delete;
OFormatCondition& operator=(const OFormatCondition&) = delete; OFormatCondition& operator=(const OFormatCondition&) = delete;
// internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
void set( const OUString& _sProperty
,sal_Int16 Value
,css::style::ParagraphAdjust& _member)
{
BoundListeners l;
{
::osl::MutexGuard aGuard(m_aMutex);
if ( static_cast<sal_Int16>(_member) != Value )
{
prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
_member = static_cast<css::style::ParagraphAdjust>(Value);
}
}
l.notify();
}
template <typename T> void set( const OUString& _sProperty template <typename T> void set( const OUString& _sProperty
,const T& Value ,const T& Value
,T& _member) ,T& _member)
...@@ -56,8 +72,11 @@ namespace reportdesign ...@@ -56,8 +72,11 @@ namespace reportdesign
BoundListeners l; BoundListeners l;
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); if ( _member != Value )
_member = Value; {
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
_member = Value;
}
} }
l.notify(); l.notify();
} }
...@@ -68,8 +87,11 @@ namespace reportdesign ...@@ -68,8 +87,11 @@ namespace reportdesign
BoundListeners l; BoundListeners l;
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); if ( _member != Value )
_member = Value; {
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
_member = Value;
}
} }
l.notify(); l.notify();
} }
......
...@@ -54,6 +54,22 @@ namespace reportdesign ...@@ -54,6 +54,22 @@ namespace reportdesign
OFormattedField(const OFormattedField&) = delete; OFormattedField(const OFormattedField&) = delete;
OFormattedField& operator=(const OFormattedField&) = delete; OFormattedField& operator=(const OFormattedField&) = delete;
// internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
void set( const OUString& _sProperty
,sal_Int16 Value
,css::style::ParagraphAdjust& _member)
{
BoundListeners l;
{
::osl::MutexGuard aGuard(m_aMutex);
if ( static_cast<sal_Int16>(_member) != Value )
{
prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
_member = static_cast<css::style::ParagraphAdjust>(Value);
}
}
l.notify();
}
template <typename T> void set( const OUString& _sProperty template <typename T> void set( const OUString& _sProperty
,const T& Value ,const T& Value
,T& _member) ,T& _member)
......
...@@ -231,7 +231,7 @@ sal_Int16 SAL_CALL clazz::getParaAdjust() \ ...@@ -231,7 +231,7 @@ sal_Int16 SAL_CALL clazz::getParaAdjust() \
\ \
void SAL_CALL clazz::setParaAdjust( sal_Int16 _align ) \ void SAL_CALL clazz::setParaAdjust( sal_Int16 _align ) \
{ \ { \
set(PROPERTY_PARAADJUST,static_cast<css::style::ParagraphAdjust>(_align),varName.nAlign); \ set(PROPERTY_PARAADJUST,_align,varName.nAlign); \
} \ } \
\ \
awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() \ awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() \
......
...@@ -59,6 +59,22 @@ namespace reportdesign ...@@ -59,6 +59,22 @@ namespace reportdesign
OShape(const OShape&) = delete; OShape(const OShape&) = delete;
OShape& operator=(const OShape&) = delete; OShape& operator=(const OShape&) = delete;
// internally, we store PROPERTY_PARAADJUST as css::style::ParagraphAdjust, but externally the property is visible as a sal_Int16
void set( const OUString& _sProperty
,sal_Int16 Value
,css::style::ParagraphAdjust& _member)
{
BoundListeners l;
{
::osl::MutexGuard aGuard(m_aMutex);
if ( static_cast<sal_Int16>(_member) != Value )
{
prepareSet(_sProperty, css::uno::makeAny(static_cast<sal_Int16>(_member)), css::uno::makeAny(Value), &l);
_member = static_cast<css::style::ParagraphAdjust>(Value);
}
}
l.notify();
}
template <typename T> void set( const OUString& _sProperty template <typename T> void set( const OUString& _sProperty
,const T& Value ,const T& Value
,T& _member) ,T& _member)
...@@ -66,8 +82,11 @@ namespace reportdesign ...@@ -66,8 +82,11 @@ namespace reportdesign
BoundListeners l; BoundListeners l;
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); if ( _member != Value )
_member = Value; {
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
_member = Value;
}
} }
l.notify(); l.notify();
} }
...@@ -78,8 +97,11 @@ namespace reportdesign ...@@ -78,8 +97,11 @@ namespace reportdesign
BoundListeners l; BoundListeners l;
{ {
::osl::MutexGuard aGuard(m_aMutex); ::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); if ( _member != Value )
_member = Value; {
prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
_member = Value;
}
} }
l.notify(); l.notify();
} }
......
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