diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-12-02 20:36:09 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2019-12-03 15:30:11 +0100 |
commit | 4bfd34145c3b5253cc212ee9d5d479fdb2150ccd (patch) | |
tree | 429433b2ac0087582b832691390407755c76c11f /oox/source | |
parent | 99f0f57d6861e92025d839cc2b22701220d8878e (diff) |
Simplify a bit use of LabelPlacementParam (oox/chartexport)
Change-Id: I940be544577d8955959d4b8c89feaa08f99e544a
Reviewed-on: https://gerrit.libreoffice.org/84272
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/export/chartexport.cxx | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 89513746bcca..9b4e33963fcd 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -3049,22 +3049,23 @@ struct LabelPlacementParam std::unordered_set<sal_Int32> maAllowedValues; - LabelPlacementParam() : - mbExport(true), - meDefault(css::chart::DataLabelPlacement::OUTSIDE) {} - - void allowAll() - { - maAllowedValues.insert(css::chart::DataLabelPlacement::OUTSIDE); - maAllowedValues.insert(css::chart::DataLabelPlacement::INSIDE); - maAllowedValues.insert(css::chart::DataLabelPlacement::CENTER); - maAllowedValues.insert(css::chart::DataLabelPlacement::NEAR_ORIGIN); - maAllowedValues.insert(css::chart::DataLabelPlacement::TOP); - maAllowedValues.insert(css::chart::DataLabelPlacement::BOTTOM); - maAllowedValues.insert(css::chart::DataLabelPlacement::LEFT); - maAllowedValues.insert(css::chart::DataLabelPlacement::RIGHT); - maAllowedValues.insert(css::chart::DataLabelPlacement::AVOID_OVERLAP); - } + LabelPlacementParam(bool bExport, sal_Int32 nDefault) : + mbExport(bExport), + meDefault(nDefault), + maAllowedValues( + { + css::chart::DataLabelPlacement::OUTSIDE, + css::chart::DataLabelPlacement::INSIDE, + css::chart::DataLabelPlacement::CENTER, + css::chart::DataLabelPlacement::NEAR_ORIGIN, + css::chart::DataLabelPlacement::TOP, + css::chart::DataLabelPlacement::BOTTOM, + css::chart::DataLabelPlacement::LEFT, + css::chart::DataLabelPlacement::RIGHT, + css::chart::DataLabelPlacement::AVOID_OVERLAP + } + ) + {} }; const char* toOOXMLPlacement( sal_Int32 nPlacement ) @@ -3290,10 +3291,7 @@ void ChartExport::exportDataLabels( // is corrupt & refuse to open it. const chart::TypeGroupInfo& rInfo = chart::GetTypeGroupInfo(static_cast<chart::TypeId>(eChartType)); - LabelPlacementParam aParam; - aParam.mbExport = !mbIs3DChart; - aParam.meDefault = rInfo.mnDefLabelPos; - aParam.allowAll(); + LabelPlacementParam aParam(!mbIs3DChart, rInfo.mnDefLabelPos); switch (eChartType) // diagram chart type { case chart::TYPEID_PIE: |