diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-05-26 12:29:37 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-05-26 15:55:53 +0200 |
commit | ef4964a4e598c3c9714cdc18ffa40bcb120dbef6 (patch) | |
tree | 9646b70a5b4d90977e0e14a2ce6639de9011cfff /include/drawinglayer | |
parent | 3a93748c9c4faadeb9ab4eb21706d187677549fa (diff) |
reduce dynamic_cast usage in an O(N^2) algorithm
When scrolling down in tdf#130431 this is the major CPU cost.
Move the dynamic_cast out of the loops as much as possible.
Change-Id: I0ea9f457bb17fbdde880f09b059f07dec4b1790b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94858
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'include/drawinglayer')
-rw-r--r-- | include/drawinglayer/primitive2d/borderlineprimitive2d.hxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx index 1a3bfa2b1b9b..537f503e5b9b 100644 --- a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx @@ -81,12 +81,6 @@ public: bool operator==(const BorderLine& rBorderLine) const; }; -/// helper to try to merge two instances of BorderLinePrimitive2D. If it was possible, -/// a merged version is in the returned Primitive2DReference. Lots of preconditions -/// have to be met to allow that, see implementation (and maybe even expand) -Primitive2DReference DRAWINGLAYER_DLLPUBLIC tryMergeBorderLinePrimitive2D( - const Primitive2DReference& rCandidateA, const Primitive2DReference& rCandidateB); - /** BorderLinePrimitive2D class This is the basic primitive to build frames around objects, e.g. tables. @@ -141,6 +135,12 @@ public: virtual sal_uInt32 getPrimitive2DID() const override; }; +/// helper to try to merge two instances of BorderLinePrimitive2D. If it was possible, +/// a merged version is in the returned Primitive2DReference. Lots of preconditions +/// have to be met to allow that, see implementation (and maybe even expand) +Primitive2DReference DRAWINGLAYER_DLLPUBLIC tryMergeBorderLinePrimitive2D( + const BorderLinePrimitive2D* pCandidateA, const BorderLinePrimitive2D* pCandidateB); + } // end of namespace drawinglayer::primitive2d /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |