xref: /trunk/main/sc/inc/tabopparams.hxx (revision 38d50f7b)
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 #ifndef SC_TABOPPARAMS_HXX
25 #define SC_TABOPPARAMS_HXX
26 
27 #include "global.hxx"
28 #include "address.hxx"
29 
30 #include <vector>
31 
32 class ScFormulaCell;
33 
34 struct ScInterpreterTableOpParams
35 {
36     ScAddress   aOld1;
37     ScAddress   aNew1;
38     ScAddress   aOld2;
39     ScAddress   aNew2;
40     ScAddress   aFormulaPos;
41     ::std::vector< ScFormulaCell* > aNotifiedFormulaCells;
42     ::std::vector< ScAddress >      aNotifiedFormulaPos;
43     sal_Bool        bValid;
44     sal_Bool        bRefresh;
45     sal_Bool        bCollectNotifications;
46 
ScInterpreterTableOpParamsScInterpreterTableOpParams47     ScInterpreterTableOpParams()
48             : bValid( sal_False )
49             , bRefresh( sal_False )
50             , bCollectNotifications( sal_True )
51     {
52     }
53 
ScInterpreterTableOpParamsScInterpreterTableOpParams54     ScInterpreterTableOpParams( const ScInterpreterTableOpParams& r )
55             : aOld1(                 r.aOld1 )
56             , aNew1(                 r.aNew1 )
57             , aOld2(                 r.aOld2 )
58             , aNew2(                 r.aNew2 )
59             , aFormulaPos(           r.aFormulaPos )
60             //! never copied!   , aNotifiedFormulaCells( r.aNotifiedFormulaCells )
61             , aNotifiedFormulaPos(   r.aNotifiedFormulaPos )
62             , bValid(                r.bValid )
63             , bRefresh(              r.bRefresh )
64             , bCollectNotifications( r.bCollectNotifications )
65     {
66     }
67 
operator =ScInterpreterTableOpParams68     ScInterpreterTableOpParams& operator =( const ScInterpreterTableOpParams& r )
69     {
70         aOld1                 = r.aOld1;
71         aNew1                 = r.aNew1;
72         aOld2                 = r.aOld2;
73         aNew2                 = r.aNew2;
74         aFormulaPos           = r.aFormulaPos;
75         //! never copied!   aNotifiedFormulaCells = r.aNotifiedFormulaCells;
76         //! instead, empty anything eventually present
77         ::std::vector< ScFormulaCell* >().swap( aNotifiedFormulaCells );
78         aNotifiedFormulaPos   = r.aNotifiedFormulaPos;
79         bValid                = r.bValid;
80         bRefresh              = r.bRefresh;
81         bCollectNotifications = r.bCollectNotifications;
82         return *this;
83     }
84 
operator ==ScInterpreterTableOpParams85     sal_Bool operator ==( const ScInterpreterTableOpParams& r )
86     {
87         return
88             bValid && r.bValid &&
89             aOld1       == r.aOld1 &&
90             aOld2       == r.aOld2 &&
91             aFormulaPos == r.aFormulaPos ;
92             // aNotifiedFormula(Cells|Pos), aNew1, aNew2, bRefresh,
93             // bCollectNotifications are not compared
94     }
95 };
96 
97 DECLARE_LIST( ScTabOpList, ScInterpreterTableOpParams* )
98 
99 #endif // SC_TABOPPARAMS_HXX
100 
101