1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sc.hxx"
26
27 // INCLUDE ---------------------------------------------------------------
28
29 // System - Includes -----------------------------------------------------
30
31
32
33 #include <string.h>
34
35 #include "pagepar.hxx"
36
37
38 //========================================================================
39 // struct ScPageTableParam:
40
ScPageTableParam()41 ScPageTableParam::ScPageTableParam()
42 {
43 Reset();
44 }
45
46 //------------------------------------------------------------------------
47
~ScPageTableParam()48 ScPageTableParam::~ScPageTableParam()
49 {
50 }
51
52 //------------------------------------------------------------------------
53
Reset()54 void ScPageTableParam::Reset()
55 {
56 bCellContent = sal_True;
57 bNotes=bGrid=bHeaders=bDrawings=
58 bLeftRight=bScaleAll=bScaleTo=bScalePageNum=
59 bFormulas=bNullVals=bSkipEmpty = sal_False;
60 bTopDown=bScaleNone=bCharts=bObjects = sal_True;
61 nScaleAll = 100;
62 nScalePageNum = nScaleWidth = nScaleHeight = 0;
63 nFirstPageNo = 1;
64 }
65
66 //------------------------------------------------------------------------
67
operator ==(const ScPageTableParam & r) const68 sal_Bool ScPageTableParam::operator==( const ScPageTableParam& r ) const
69 {
70 return ( memcmp( this, &r, sizeof(ScPageTableParam) ) == 0 );
71 }
72
73 //========================================================================
74 // struct ScPageAreaParam:
75
ScPageAreaParam()76 ScPageAreaParam::ScPageAreaParam()
77 {
78 Reset();
79 }
80
81 //------------------------------------------------------------------------
82
~ScPageAreaParam()83 ScPageAreaParam::~ScPageAreaParam()
84 {
85 }
86
87 //------------------------------------------------------------------------
88
Reset()89 void ScPageAreaParam::Reset()
90 {
91 bPrintArea = bRepeatRow = bRepeatCol = sal_False;
92
93 memset( &aPrintArea, 0, sizeof(ScRange) );
94 memset( &aRepeatRow, 0, sizeof(ScRange) );
95 memset( &aRepeatCol, 0, sizeof(ScRange) );
96 }
97
98 //------------------------------------------------------------------------
99
operator ==(const ScPageAreaParam & r) const100 sal_Bool ScPageAreaParam::operator==( const ScPageAreaParam& r ) const
101 {
102 sal_Bool bEqual =
103 bPrintArea == r.bPrintArea
104 && bRepeatRow == r.bRepeatRow
105 && bRepeatCol == r.bRepeatCol;
106
107 if ( bEqual )
108 if ( bPrintArea )
109 bEqual = bEqual && ( aPrintArea == r.aPrintArea );
110 if ( bEqual )
111 if ( bRepeatRow )
112 bEqual = bEqual && ( aRepeatRow == r.aRepeatRow );
113 if ( bEqual )
114 if ( bRepeatCol )
115 bEqual = bEqual && ( aRepeatCol == r.aRepeatCol );
116
117 return bEqual;
118 }
119