LibreOffice Module svx (master) 1
viewobjectcontactofgroup.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20
25#include <svx/svdobj.hxx>
26
27
28using namespace com::sun::star;
29
30
31namespace sdr::contact
32{
34 : ViewObjectContactOfSdrObj(rObjectContact, rViewContact)
35 {
36 }
37
39 {
40 }
41
43 {
44 // check model-view visibility
45 if(!isPrimitiveVisible(rDisplayInfo))
46 return;
47
48 const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
49 if(nSubHierarchyCount)
50 {
51 const bool bDoGhostedDisplaying(
52 GetObjectContact().DoVisualizeEnteredGroup()
53 && !GetObjectContact().isOutputToPrinter()
54 && GetObjectContact().getActiveViewContact() == &GetViewContact());
55
56 if(bDoGhostedDisplaying)
57 {
58 rDisplayInfo.ClearGhostedDrawMode();
59 }
60
61 // visit object hierarchy
62 getPrimitive2DSequenceSubHierarchy(rDisplayInfo, rVisitor);
63
64 if(bDoGhostedDisplaying)
65 {
66 rDisplayInfo.SetGhostedDrawMode();
67 }
68 }
69 else
70 {
71 // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
72 // which creates the replacement primitives for an empty group
74 }
75 }
76
78 {
79 SdrLayerIDSet aObjectLayers;
81 aObjectLayers &= aLayers;
82 return !aObjectLayers.IsEmpty();
83 }
84
85} // end of namespace
86
87/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsEmpty() const
Definition: svdlayer.cxx:28
void getMergedHierarchySdrLayerIDSet(SdrLayerIDSet &rSet) const
Definition: svdobj.cxx:650
ViewObjectContactOfGroup(ObjectContact &rObjectContact, ViewContact &rViewContact)
virtual void getPrimitive2DSequenceHierarchy(DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const override
virtual bool isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet &aLayers) const override
Test whether the primitive is visible on any layer from aLayers.
virtual bool isPrimitiveVisible(const DisplayInfo &rDisplayInfo) const override
ViewContact & GetViewContact() const
ObjectContact & GetObjectContact() const
void getPrimitive2DSequenceSubHierarchy(DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const
virtual void getPrimitive2DSequenceHierarchy(DisplayInfo &rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor &rVisitor) const