diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-24 16:27:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-25 08:27:28 +0200 |
commit | b4ba8dc9ef1635c75b363838b6016d3851387020 (patch) | |
tree | 3b857ae54eea6dfa17076a56f11bcaea8a298b23 /reportdesign | |
parent | 64a0f135a08d7d25fc3a796e604336f64bbd3ddb (diff) |
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 <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/inc/FixedText.hxx | 16 | ||||
-rw-r--r-- | reportdesign/source/core/inc/FormatCondition.hxx | 30 | ||||
-rw-r--r-- | reportdesign/source/core/inc/FormattedField.hxx | 16 | ||||
-rw-r--r-- | reportdesign/source/core/inc/ReportHelperImpl.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/core/inc/Shape.hxx | 30 |
5 files changed, 85 insertions, 9 deletions
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<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 ,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<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 ,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<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 ,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<css::style::ParagraphAdjust>(_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<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 ,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(); } |