Coverage Report

Created: 2026-02-14 09:37

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sw/inc/fmtline.hxx
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
#ifndef INCLUDED_SW_INC_FMTLINE_HXX
20
#define INCLUDED_SW_INC_FMTLINE_HXX
21
22
#include <svl/poolitem.hxx>
23
#include <tools/solar.h>
24
#include "hintids.hxx"
25
#include "swdllapi.h"
26
#include "swatrset.hxx"
27
28
/// Contains the line numbering properties of this paragraph. Format -> Paragraph -> Outline & List
29
/// tab, Line Numbering section is the UI for this.
30
class SW_DLLPUBLIC SwFormatLineNumber final : public SfxPoolItem
31
{
32
    sal_uLong m_nStartValue   :24; ///< Starting value for the paragraph. 0 == no starting value.
33
    bool      m_bCountLines   :1;  ///< Also count lines of paragraph.
34
35
public:
36
    DECLARE_ITEM_TYPE_FUNCTION(SwFormatLineNumber)
37
    SwFormatLineNumber();
38
    virtual ~SwFormatLineNumber() override;
39
40
254k
    SwFormatLineNumber(SwFormatLineNumber const &) = default;
41
    SwFormatLineNumber(SwFormatLineNumber &&) = default;
42
    SwFormatLineNumber & operator =(SwFormatLineNumber const &) = delete; // due to SfxPoolItem
43
    SwFormatLineNumber & operator =(SwFormatLineNumber &&) = delete; // due to SfxPoolItem
44
45
    static SfxPoolItem* CreateDefault();
46
47
    /// "Pure virtual methods" of SfxPoolItem.
48
    virtual bool            operator==( const SfxPoolItem& ) const override;
49
    virtual SwFormatLineNumber* Clone( SfxItemPool* pPool = nullptr ) const override;
50
    virtual bool GetPresentation( SfxItemPresentation ePres,
51
                                  MapUnit eCoreMetric,
52
                                  MapUnit ePresMetric,
53
                                  OUString &rText,
54
                                  const IntlWrapper& rIntl ) const override;
55
    virtual bool             QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override;
56
    virtual bool             PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override;
57
58
471k
    sal_uLong GetStartValue() const { return m_nStartValue; }
59
600k
    bool  IsCount()           const { return m_bCountLines; }
60
61
35.1k
    void SetStartValue( sal_uLong nNew ) { m_nStartValue = nNew; }
62
212k
    void SetCountLines( bool b )     { m_bCountLines = b;    }
63
};
64
65
inline const SwFormatLineNumber &SwAttrSet::GetLineNumber(bool bInP) const
66
174k
    { return Get( RES_LINENUMBER,bInP); }
67
68
#endif
69
70
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */