Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/source/ui/view/tabvwsh8.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
#include <editeng/borderline.hxx>
21
22
#include <tabvwsh.hxx>
23
#include <document.hxx>
24
25
void ScTabViewShell::SetDefaultFrameLine( const ::editeng::SvxBorderLine* pLine )
26
0
{
27
0
    if ( pLine )
28
0
    {
29
0
        pCurFrameLine.reset( new ::editeng::SvxBorderLine( &pLine->GetColor(),
30
0
                                            pLine->GetWidth(),
31
0
                                            pLine->GetBorderLineStyle() ) );
32
0
    }
33
0
    else
34
0
        pCurFrameLine.reset();
35
0
}
36
37
bool ScTabViewShell::HasSelection( bool bText ) const
38
0
{
39
0
    bool bHas = false;
40
0
    ScViewData& rData = const_cast<ScViewData&>(GetViewData());
41
0
    if ( bText )
42
0
    {
43
        // Content contained: Count2 >= 1
44
0
        ScDocument& rDoc = rData.GetDocument();
45
0
        ScMarkData& rMark = rData.GetMarkData();
46
0
        ScAddress aCursor( rData.GetCurX(), rData.GetCurY(), rData.CurrentTabForData() );
47
0
        double fVal = 0.0;
48
0
        if ( rDoc.GetSelectionFunction( SUBTOTAL_FUNC_CNT2, aCursor, rMark, fVal ) )
49
0
            bHas = ( fVal > 0.5 );
50
0
    }
51
0
    else
52
0
    {
53
0
        ScRange aRange;
54
0
        ScMarkType eMarkType = rData.GetSimpleArea( aRange );
55
0
        if ( eMarkType == SC_MARK_SIMPLE )
56
0
            bHas = ( aRange.aStart != aRange.aEnd );    // more than 1 cell
57
0
        else
58
0
            bHas = true;                                // multiple selection or filtered
59
0
    }
60
0
    return bHas;
61
0
}
62
63
void ScTabViewShell::UIDeactivated( SfxInPlaceClient* pClient )
64
0
{
65
0
    ClearHighlightRanges();
66
67
    // Move in the ViewShell should really be called from Sfx, when the
68
    // frame window is moved due to different toolboxes or other things
69
    // (to not  move painted objects by mistake, #56515#).
70
    // this mechanism does however not work at the moment, that is why this
71
    // call is here (in Move it is checked if the position has really changed).
72
0
    ForceMove();
73
0
    SfxViewShell::UIDeactivated( pClient );
74
0
}
75
76
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */