summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-04-06 13:36:35 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-06 18:55:10 +0200
commit6f31c63e35abef03e6f938bbddc8778b70a62d43 (patch)
tree70fd2fc22f682b6ed8953578f0421af750d20f2c
parent1ac1fdbe5bb3139c81a331beb16c79e84d7c4f27 (diff)
clang-tidy modernize-avoid-c-arrays in animations
Change-Id: I3dc1c0e63bd90735c20a65b1af25b243e5a5eee5 Reviewed-on: https://gerrit.libreoffice.org/70341 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--animations/source/animcore/animcore.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index 4dd4868e70e5..d5bcb0c21b14 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -57,6 +57,7 @@
#include <osl/mutex.hxx>
#include <sal/log.hxx>
+#include <array>
#include <vector>
#include <algorithm>
#include <string.h>
@@ -287,7 +288,7 @@ private:
const sal_Int16 mnNodeType;
// for XTypeProvider
- static Sequence< Type >* mpTypes[12];
+ static std::array<Sequence< Type >*, 12> mpTypes;
// attributes for the XAnimationNode interface implementation
Any maBegin, maDuration, maEnd, maEndSync, maRepeatCount, maRepeatDuration;
@@ -388,7 +389,7 @@ Any SAL_CALL TimeContainerEnumeration::nextElement()
}
-Sequence< Type >* AnimationNode::mpTypes[] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
+std::array<Sequence< Type >*, 12> AnimationNode::mpTypes = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
AnimationNode::AnimationNode( sal_Int16 nNodeType )
: maChangeListener(maMutex),
@@ -418,7 +419,7 @@ AnimationNode::AnimationNode( sal_Int16 nNodeType )
mnIterateType( css::presentation::ShapeAnimationSubType::AS_WHOLE ),
mfIterateInterval(0.0)
{
- assert(nNodeType < int(SAL_N_ELEMENTS(mpTypes)));
+ assert(nNodeType < int(mpTypes.size()));
}
AnimationNode::AnimationNode( const AnimationNode& rNode )
@@ -696,7 +697,7 @@ void AnimationNode::initTypeProvider( sal_Int16 nNodeType ) throw()
if(! mpTypes[nNodeType] )
{
- static const sal_Int32 type_numbers[] =
+ static constexpr std::array<sal_Int32, mpTypes.size()> type_numbers =
{
7, // CUSTOM
9, // PAR