From b4ba8dc9ef1635c75b363838b6016d3851387020 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 24 Apr 2018 16:27:17 +0200 Subject: tdf#117161 ReportBuilder horizontal align wrong when editing regression from commit 5d0e485e827057eee9fb2c997685690b710e7f34 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/53412 Tested-by: Jenkins Reviewed-by: Noel Grandin --- reportdesign/source/core/inc/FixedText.hxx | 16 ++++++++++++ reportdesign/source/core/inc/FormatCondition.hxx | 30 ++++++++++++++++++++--- reportdesign/source/core/inc/FormattedField.hxx | 16 ++++++++++++ reportdesign/source/core/inc/ReportHelperImpl.hxx | 2 +- reportdesign/source/core/inc/Shape.hxx | 30 ++++++++++++++++++++--- 5 files changed, 85 insertions(+), 9 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/core/inc/FixedText.hxx b/reportdesign/source/core/inc/FixedText.hxx index b08efa10b759..03126ab30e5f 100644 --- a/reportdesign/source/core/inc/FixedText.hxx +++ b/reportdesign/source/core/inc/FixedText.hxx @@ -51,6 +51,22 @@ namespace reportdesign OFixedText(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(_member) != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(static_cast(_member)), css::uno::makeAny(Value), &l); + _member = static_cast(Value); + } + } + l.notify(); + } template void set( const OUString& _sProperty ,const T& Value ,T& _member) diff --git a/reportdesign/source/core/inc/FormatCondition.hxx b/reportdesign/source/core/inc/FormatCondition.hxx index a457f7dada59..409b1198f7ef 100644 --- a/reportdesign/source/core/inc/FormatCondition.hxx +++ b/reportdesign/source/core/inc/FormatCondition.hxx @@ -49,6 +49,22 @@ namespace reportdesign OFormatCondition(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(_member) != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(static_cast(_member)), css::uno::makeAny(Value), &l); + _member = static_cast(Value); + } + } + l.notify(); + } template void set( const OUString& _sProperty ,const T& Value ,T& _member) @@ -56,8 +72,11 @@ namespace reportdesign BoundListeners l; { ::osl::MutexGuard aGuard(m_aMutex); - prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); - _member = Value; + if ( _member != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); + _member = Value; + } } l.notify(); } @@ -68,8 +87,11 @@ namespace reportdesign BoundListeners l; { ::osl::MutexGuard aGuard(m_aMutex); - prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); - _member = Value; + if ( _member != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); + _member = Value; + } } l.notify(); } diff --git a/reportdesign/source/core/inc/FormattedField.hxx b/reportdesign/source/core/inc/FormattedField.hxx index e7860983bff5..040b6af2dfbb 100644 --- a/reportdesign/source/core/inc/FormattedField.hxx +++ b/reportdesign/source/core/inc/FormattedField.hxx @@ -54,6 +54,22 @@ namespace reportdesign OFormattedField(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(_member) != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(static_cast(_member)), css::uno::makeAny(Value), &l); + _member = static_cast(Value); + } + } + l.notify(); + } template void set( const OUString& _sProperty ,const T& Value ,T& _member) diff --git a/reportdesign/source/core/inc/ReportHelperImpl.hxx b/reportdesign/source/core/inc/ReportHelperImpl.hxx index 6e581347856f..47acf133a5f2 100644 --- a/reportdesign/source/core/inc/ReportHelperImpl.hxx +++ b/reportdesign/source/core/inc/ReportHelperImpl.hxx @@ -231,7 +231,7 @@ sal_Int16 SAL_CALL clazz::getParaAdjust() \ \ void SAL_CALL clazz::setParaAdjust( sal_Int16 _align ) \ { \ - set(PROPERTY_PARAADJUST,static_cast(_align),varName.nAlign); \ + set(PROPERTY_PARAADJUST,_align,varName.nAlign); \ } \ \ awt::FontDescriptor SAL_CALL clazz::getFontDescriptor() \ diff --git a/reportdesign/source/core/inc/Shape.hxx b/reportdesign/source/core/inc/Shape.hxx index 7d56822fc64f..b7c9e6d882f9 100644 --- a/reportdesign/source/core/inc/Shape.hxx +++ b/reportdesign/source/core/inc/Shape.hxx @@ -59,6 +59,22 @@ namespace reportdesign OShape(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(_member) != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(static_cast(_member)), css::uno::makeAny(Value), &l); + _member = static_cast(Value); + } + } + l.notify(); + } template void set( const OUString& _sProperty ,const T& Value ,T& _member) @@ -66,8 +82,11 @@ namespace reportdesign BoundListeners l; { ::osl::MutexGuard aGuard(m_aMutex); - prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); - _member = Value; + if ( _member != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); + _member = Value; + } } l.notify(); } @@ -78,8 +97,11 @@ namespace reportdesign BoundListeners l; { ::osl::MutexGuard aGuard(m_aMutex); - prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); - _member = Value; + if ( _member != Value ) + { + prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l); + _member = Value; + } } l.notify(); } -- cgit