Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/svx/source/sdr/contact/viewobjectcontactofgroup.cxx
Line
Count
Source
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
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>
26
27
28
using namespace com::sun::star;
29
30
31
namespace sdr::contact
32
{
33
        ViewObjectContactOfGroup::ViewObjectContactOfGroup(ObjectContact& rObjectContact, ViewContact& rViewContact)
34
331
        :   ViewObjectContactOfSdrObj(rObjectContact, rViewContact)
35
331
        {
36
331
        }
37
38
        ViewObjectContactOfGroup::~ViewObjectContactOfGroup()
39
331
        {
40
331
        }
41
42
        void ViewObjectContactOfGroup::getPrimitive2DSequenceHierarchy(DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const
43
331
        {
44
            // check model-view visibility
45
331
            if(!isPrimitiveVisible(rDisplayInfo))
46
0
                return;
47
48
331
            drawinglayer::primitive2d::Primitive2DContainer primitiveSequence;
49
50
331
            const sal_uInt32 nSubHierarchyCount(GetViewContact().GetObjectCount());
51
331
            if(nSubHierarchyCount)
52
190
            {
53
190
                const bool bDoGhostedDisplaying(
54
190
                    GetObjectContact().DoVisualizeEnteredGroup()
55
0
                    && !GetObjectContact().isOutputToPrinter()
56
0
                    && GetObjectContact().getActiveViewContact() == &GetViewContact());
57
58
190
                if(bDoGhostedDisplaying)
59
0
                {
60
0
                    rDisplayInfo.ClearGhostedDrawMode();
61
0
                }
62
63
                // visit object hierarchy
64
190
                getPrimitive2DSequenceSubHierarchy(rDisplayInfo, primitiveSequence);
65
66
190
                if(bDoGhostedDisplaying)
67
0
                {
68
0
                    rDisplayInfo.SetGhostedDrawMode();
69
0
                }
70
190
            }
71
141
            else
72
141
            {
73
                // draw replacement object for group. This will use ViewContactOfGroup::createViewIndependentPrimitive2DSequence
74
                // which creates the replacement primitives for an empty group
75
141
                ViewObjectContactOfSdrObj::getPrimitive2DSequenceHierarchy(rDisplayInfo, primitiveSequence);
76
141
            }
77
78
331
            primitiveSequence = GetViewContact().embedToObjectSpecificInformation(primitiveSequence);
79
80
            // ISO 14289-1:2014, Clause: 7.3
81
331
            createStructureTag(primitiveSequence);
82
83
331
            rVisitor.visit(primitiveSequence);
84
331
        }
85
86
        bool ViewObjectContactOfGroup::isPrimitiveVisibleOnAnyLayer(const SdrLayerIDSet& aLayers) const
87
472
        {
88
472
            return getSdrObject().isVisibleOnAnyOfTheseLayers(aLayers);
89
472
        }
90
91
} // end of namespace
92
93
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */