Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <string.h>
30 : :
31 : : #include "pagepar.hxx"
32 : :
33 : :
34 : : //========================================================================
35 : : // struct ScPageTableParam:
36 : :
37 : 250 : ScPageTableParam::ScPageTableParam()
38 : : {
39 : 250 : Reset();
40 : 250 : }
41 : :
42 : : //------------------------------------------------------------------------
43 : :
44 : 250 : ScPageTableParam::~ScPageTableParam()
45 : : {
46 : 250 : }
47 : :
48 : : //------------------------------------------------------------------------
49 : :
50 : 250 : void ScPageTableParam::Reset()
51 : : {
52 : 250 : bCellContent = sal_True;
53 : : bNotes=bGrid=bHeaders=bDrawings=
54 : : bLeftRight=bScaleAll=bScaleTo=bScalePageNum=
55 : 250 : bFormulas=bNullVals=bSkipEmpty = false;
56 : 250 : bTopDown=bScaleNone=bCharts=bObjects = sal_True;
57 : 250 : nScaleAll = 100;
58 : 250 : nScalePageNum = nScaleWidth = nScaleHeight = 0;
59 : 250 : nFirstPageNo = 1;
60 : 250 : }
61 : :
62 : : //------------------------------------------------------------------------
63 : :
64 : 0 : sal_Bool ScPageTableParam::operator==( const ScPageTableParam& r ) const
65 : : {
66 : 0 : return ( memcmp( this, &r, sizeof(ScPageTableParam) ) == 0 );
67 : : }
68 : :
69 : : //========================================================================
70 : : // struct ScPageAreaParam:
71 : :
72 : 250 : ScPageAreaParam::ScPageAreaParam()
73 : : {
74 : 250 : Reset();
75 : 250 : }
76 : :
77 : : //------------------------------------------------------------------------
78 : :
79 : 250 : ScPageAreaParam::~ScPageAreaParam()
80 : : {
81 : 250 : }
82 : :
83 : : //------------------------------------------------------------------------
84 : :
85 : 250 : void ScPageAreaParam::Reset()
86 : : {
87 : 250 : bPrintArea = bRepeatRow = bRepeatCol = false;
88 : :
89 : 250 : memset( &aPrintArea, 0, sizeof(ScRange) );
90 : 250 : memset( &aRepeatRow, 0, sizeof(ScRange) );
91 : 250 : memset( &aRepeatCol, 0, sizeof(ScRange) );
92 : 250 : }
93 : :
94 : : //------------------------------------------------------------------------
95 : :
96 : 0 : sal_Bool ScPageAreaParam::operator==( const ScPageAreaParam& r ) const
97 : : {
98 : : sal_Bool bEqual =
99 : : bPrintArea == r.bPrintArea
100 : : && bRepeatRow == r.bRepeatRow
101 [ # # ][ # # ]: 0 : && bRepeatCol == r.bRepeatCol;
[ # # ]
102 : :
103 [ # # ]: 0 : if ( bEqual )
104 [ # # ]: 0 : if ( bPrintArea )
105 [ # # ][ # # ]: 0 : bEqual = bEqual && ( aPrintArea == r.aPrintArea );
106 [ # # ]: 0 : if ( bEqual )
107 [ # # ]: 0 : if ( bRepeatRow )
108 [ # # ][ # # ]: 0 : bEqual = bEqual && ( aRepeatRow == r.aRepeatRow );
109 [ # # ]: 0 : if ( bEqual )
110 [ # # ]: 0 : if ( bRepeatCol )
111 [ # # ][ # # ]: 0 : bEqual = bEqual && ( aRepeatCol == r.aRepeatCol );
112 : :
113 : 0 : return bEqual;
114 : : }
115 : :
116 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|