tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / drawinglayer / source / primitive2d / groupprimitive2d.cxx
blobe6428c09e8cdad6b254e281956c46b1719644b71
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <drawinglayer/primitive2d/groupprimitive2d.hxx>
21 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
24 using namespace com::sun::star;
27 namespace drawinglayer::primitive2d
29 GroupPrimitive2D::GroupPrimitive2D( Primitive2DContainer&& aChildren )
30 : maChildren(std::move(aChildren))
34 /** The compare operator uses the Sequence::==operator, so only checking if
35 the references are equal. All non-equal references are interpreted as
36 non-equal.
38 bool GroupPrimitive2D::operator==( const BasePrimitive2D& rPrimitive ) const
40 if(BasePrimitive2D::operator==(rPrimitive))
42 const GroupPrimitive2D& rCompare = static_cast< const GroupPrimitive2D& >(rPrimitive);
44 return getChildren() == rCompare.getChildren();
47 return false;
50 /// default: just return children, so all renderers not supporting group will use its content
51 void GroupPrimitive2D::get2DDecomposition(Primitive2DDecompositionVisitor& rVisitor, const geometry::ViewInformation2D& /*rViewInformation*/) const
53 getChildren(rVisitor);
56 sal_Int64 GroupPrimitive2D::estimateUsage()
58 size_t nRet(0);
59 for (auto& it : getChildren())
61 if (it)
62 nRet += it->estimateUsage();
64 return nRet;
67 // provide unique ID
68 sal_uInt32 GroupPrimitive2D::getPrimitive2DID() const
70 return PRIMITIVE2D_ID_GROUPPRIMITIVE2D;
73 } // end of namespace
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */