diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-01-06 22:14:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-07 11:12:14 +0100 |
commit | 93790b70ea663184f758031dc5af311828fe36ad (patch) | |
tree | feed1ac577f505e6c371ae1c24ddc2f7ee33b9d7 /svx/source/sdr | |
parent | c52aa97b988aeeb16d1eb21262889f565b8a72a3 (diff) |
move applyDefaultStyleSheetFromSdrModel from BaseProperties..
to AttributeProperties, since it only applies to AttributeProperties
and its sub-classes.
Change-Id: I01527f75815659d1cf2a9859888ef04c561633a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128092
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/properties/attributeproperties.cxx | 16 | ||||
-rw-r--r-- | svx/source/sdr/properties/properties.cxx | 15 |
2 files changed, 16 insertions, 15 deletions
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index b4624937be09..532e0bc67294 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -523,6 +523,22 @@ namespace sdr::properties } return false; } + + void AttributeProperties::applyDefaultStyleSheetFromSdrModel() + { + SfxStyleSheet* pDefaultStyleSheet(GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet()); + + // tdf#118139 Only do this when StyleSheet really differs. It may e.g. + // be the case that nullptr == pDefaultStyleSheet and there is none set yet, + // so indeed no need to set it (needed for some strange old MSWord2003 + // documents with CustomShape-'Group' and added Text-Frames, see task description) + if(pDefaultStyleSheet != GetStyleSheet()) + { + // do not delete hard attributes when setting dsefault Style + SetStyleSheet(pDefaultStyleSheet, true); + } + } + } // end of namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx index 353cdc5ede36..acfb368bc615 100644 --- a/svx/source/sdr/properties/properties.cxx +++ b/svx/source/sdr/properties/properties.cxx @@ -41,21 +41,6 @@ namespace sdr::properties { } - void BaseProperties::applyDefaultStyleSheetFromSdrModel() - { - SfxStyleSheet* pDefaultStyleSheet(GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet()); - - // tdf#118139 Only do this when StyleSheet really differs. It may e.g. - // be the case that nullptr == pDefaultStyleSheet and there is none set yet, - // so indeed no need to set it (needed for some strange old MSWord2003 - // documents with CustomShape-'Group' and added Text-Frames, see task description) - if(pDefaultStyleSheet != GetStyleSheet()) - { - // do not delete hard attributes when setting dsefault Style - SetStyleSheet(pDefaultStyleSheet, true); - } - } - const SdrObject& BaseProperties::GetSdrObject() const { return mrObject; |