Coverage Report

Created: 2026-10-14 09:33

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sc/source/ui/inc/pagedata.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
20
#pragma once
21
22
#include <tools/long.hxx>
23
#include <address.hxx>
24
#include <memory>
25
#include <vector>
26
27
class ScPrintRangeData
28
{
29
private:
30
    ScRange     aPrintRange;
31
    std::vector<SCCOL>
32
                mvPageEndX;
33
    std::vector<SCROW>
34
                mvPageEndY;
35
    tools::Long        nFirstPage;
36
    bool        bTopDown;
37
    bool        bAutomatic;
38
39
public:
40
                    ScPrintRangeData();
41
                    ~ScPrintRangeData();
42
43
0
    void            SetPrintRange( const ScRange& rNew )    { aPrintRange = rNew; }
44
0
    const ScRange&  GetPrintRange() const                   { return aPrintRange; }
45
46
    void            SetPagesX( size_t nCount, const SCCOL* pEnd );
47
    void            SetPagesY( size_t nCount, const SCROW* pEnd );
48
49
0
    size_t          GetPagesX() const       { return mvPageEndX.size();   }
50
0
    const SCCOL*    GetPageEndX() const     { return mvPageEndX.data(); }
51
0
    size_t          GetPagesY() const       { return mvPageEndY.size();   }
52
0
    const SCROW*    GetPageEndY() const     { return mvPageEndY.data(); }
53
54
    tools::Long     GetPageNumber(SCCOL nCol, SCROW nRow) const;
55
56
0
    void            SetFirstPage( tools::Long nNew )   { nFirstPage = nNew; }
57
0
    tools::Long            GetFirstPage() const        { return nFirstPage; }
58
0
    void            SetTopDown( bool bSet )     { bTopDown = bSet; }
59
0
    bool            IsTopDown() const           { return bTopDown; }
60
0
    void            SetAutomatic( bool bSet )   { bAutomatic = bSet; }
61
0
    bool            IsAutomatic() const         { return bAutomatic; }
62
};
63
64
class ScPageBreakData
65
{
66
private:
67
    size_t              nAlloc;
68
    size_t              nUsed;
69
    std::unique_ptr<ScPrintRangeData[]>   pData;
70
71
public:
72
                ScPageBreakData(size_t nMax);
73
                ~ScPageBreakData();
74
75
0
    size_t              GetCount() const            { return nUsed; }
76
    ScPrintRangeData&   GetData(size_t i);
77
    const ScPrintRangeData&   GetData(size_t i) const;
78
79
    bool                operator==( const ScPageBreakData& rOther ) const;
80
81
    void                AddPages();
82
};
83
84
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */