1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <sdr/contact/viewcontactofgroup.hxx>
21 #include <svx/svdogrp.hxx>
22 #include <svx/sdr/contact/viewobjectcontact.hxx>
23 #include <sdr/contact/viewobjectcontactofgroup.hxx>
24 #include <drawinglayer/primitive2d/sdrdecompositiontools2d.hxx>
25 #include <tools/debug.hxx>
26 #include <vcl/canvastools.hxx>
29 namespace sdr::contact
31 // Create an Object-Specific ViewObjectContact, set ViewContact and
32 // ObjectContact. Always needs to return something.
33 ViewObjectContact
& ViewContactOfGroup::CreateObjectSpecificViewObjectContact(ObjectContact
& rObjectContact
)
35 ViewObjectContact
* pRetval
= new ViewObjectContactOfGroup(rObjectContact
, *this);
36 DBG_ASSERT(pRetval
, "ViewContactOfGroup::CreateObjectSpecificViewObjectContact() failed (!)");
41 ViewContactOfGroup::ViewContactOfGroup(SdrObjGroup
& rGroup
)
42 : ViewContactOfSdrObj(rGroup
)
46 ViewContactOfGroup::~ViewContactOfGroup()
50 void ViewContactOfGroup::createViewIndependentPrimitive2DSequence(drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
52 const sal_uInt32
nObjectCount(GetObjectCount());
56 // collect all sub-primitives
57 for(sal_uInt32
a(0); a
< nObjectCount
; a
++)
59 const ViewContact
& rCandidate(GetViewContact(a
));
60 rCandidate
.getViewIndependentPrimitive2DContainer(rVisitor
);
65 // append an invisible outline for the cases where no visible content exists
66 const basegfx::B2DRange aCurrentRange
= vcl::unotools::b2DRectangleFromRectangle(GetSdrObjGroup().GetLastBoundRect());
68 const drawinglayer::primitive2d::Primitive2DReference
xReference(
69 drawinglayer::primitive2d::createHiddenGeometryPrimitives2D(
70 false, aCurrentRange
));
72 rVisitor
.visit(xReference
);
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */