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 .
21 #include <sdr/contact/viewobjectcontactofgroup.hxx>
22 #include <svx/sdr/contact/displayinfo.hxx>
23 #include <svx/sdr/contact/objectcontact.hxx>
24 #include <svx/sdr/contact/viewcontact.hxx>
25 #include <svx/svdobj.hxx>
28 using namespace com::sun::star
;
31 namespace sdr::contact
33 ViewObjectContactOfGroup::ViewObjectContactOfGroup(ObjectContact
& rObjectContact
, ViewContact
& rViewContact
)
34 : ViewObjectContactOfSdrObj(rObjectContact
, rViewContact
)
38 ViewObjectContactOfGroup::~ViewObjectContactOfGroup()
42 void ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo
& rDisplayInfo
, drawinglayer::primitive2d::Primitive2DDecompositionVisitor
& rVisitor
) const
44 // check model-view visibility
45 if(!isPrimitiveVisible(rDisplayInfo
))
48 drawinglayer::primitive2d::Primitive2DContainer primitiveSequence
;
50 const sal_uInt32
nSubHierarchyCount(GetViewContact().GetObjectCount());
51 if(nSubHierarchyCount
)
53 const bool bDoGhostedDisplaying(
54 GetObjectContact().DoVisualizeEnteredGroup()
55 && !GetObjectContact().isOutputToPrinter()
56 && GetObjectContact().getActiveViewContact() == &GetViewContact());
58 if(bDoGhostedDisplaying
)
60 rDisplayInfo
.ClearGhostedDrawMode();
63 // visit object hierarchy
64 getPrimitive2DSequenceSubHierarchy(rDisplayInfo
, primitiveSequence
);
66 if(bDoGhostedDisplaying
)
68 rDisplayInfo
.SetGhostedDrawMode();
73 // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
74 // which creates the replacement primitives for an empty group
75 ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo
, primitiveSequence
);
78 primitiveSequence
= GetViewContact().embedToObjectSpecificInformation(primitiveSequence
);
80 // ISO 14289-1:2014, Clause: 7.3
81 createStructureTag(primitiveSequence
);
83 rVisitor
.visit(primitiveSequence
);
86 bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet
& aLayers
) const
88 return getSdrObject().isVisibleOnAnyOfTheseLayers(aLayers
);
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */