1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: detdata.hxx,v $
10 * $Revision: 1.7.32.2 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_DETDATA_HXX
32 #define SC_DETDATA_HXX
34 #include <svtools/svarray.hxx>
36 #include "address.hxx"
39 //------------------------------------------------------------------------
41 #define SC_DETOP_GROW 4
43 //------------------------------------------------------------------------
53 //------------------------------------------------------------------------
58 ScDetOpType eOperation
;
61 ScDetOpData( const ScAddress
& rP
, ScDetOpType eOp
) :
62 aPos(rP
), eOperation(eOp
) {}
64 ScDetOpData( const ScDetOpData
& rData
) :
65 aPos(rData
.aPos
), eOperation(rData
.eOperation
) {}
67 const ScAddress
& GetPos() const { return aPos
; }
68 ScDetOpType
GetOperation() const { return eOperation
; }
71 void SetPos(const ScAddress
& rNew
) { aPos
=rNew
; }
73 int operator== ( const ScDetOpData
& r
) const
74 { return eOperation
== r
.eOperation
&& aPos
== r
.aPos
; }
77 //------------------------------------------------------------------------
80 // Liste der Operationen
83 typedef ScDetOpData
* ScDetOpDataPtr
;
85 SV_DECL_PTRARR_DEL(ScDetOpArr_Impl
, ScDetOpDataPtr
, SC_DETOP_GROW
, SC_DETOP_GROW
)
87 class ScDetOpList
: public ScDetOpArr_Impl
89 BOOL bHasAddError
; // updated in Append
92 ScDetOpList() : bHasAddError(FALSE
) {}
93 ScDetOpList(const ScDetOpList
& rList
);
96 void DeleteOnTab( SCTAB nTab
);
97 void UpdateReference( ScDocument
* pDoc
, UpdateRefMode eUpdateRefMode
,
98 const ScRange
& rRange
, SCsCOL nDx
, SCsROW nDy
, SCsTAB nDz
);
100 BOOL
operator==( const ScDetOpList
& r
) const; // fuer Ref-Undo
102 void Append( ScDetOpData
* pData
);
104 BOOL
HasAddError() const { return bHasAddError
; }