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