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