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: HandleAnchorNodeChg.hxx,v $
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 ************************************************************************/
30 #ifndef _HANDLEANCHORNODECHG_HXX
31 #define _HANDLEANCHORNODECHG_HXX
37 // OD 2006-02-28 #125892#
38 // helper class to track change of anchor node of at-paragraph respectively
39 // at-character anchored fly frames
40 // if such a change happens, it has to be checked, if the count of the anchor
41 // frames also change. if yes, a re-creation of the fly frames is needed:
42 // - deletion of existing fly frames before the intrinsic anchor node changes
43 // - creation of new fly frames after the intrinsic anchor node change.
44 class SwHandleAnchorNodeChg
47 /** checks, if re-creation of fly frames for an anchor node change at the
48 given fly frame format is necessary, and performs the first part.
53 reference to the fly frame format instance, which is handled.
56 new anchor attribute, which will be applied at the given fly frame format
58 @param _pKeepThisFlyFrm
59 optional parameter - pointer to a fly frame of the given fly frame format,
60 which isn't deleted, if re-creation of fly frames is necessary.
62 SwHandleAnchorNodeChg( SwFlyFrmFmt
& _rFlyFrmFmt
,
63 const SwFmtAnchor
& _rNewAnchorFmt
,
64 SwFlyFrm
* _pKeepThisFlyFrm
= 0L );
66 /** calls <SwFlyFrmFmt::MakeFrms>, if re-creation of fly frames is necessary.
70 ~SwHandleAnchorNodeChg();
73 // fly frame format, which is tracked for a anchor node change.
74 SwFlyFrmFmt
& mrFlyFrmFmt
;
75 // internal flag, which indicates that the certain anchor node change occurs
76 // and that re-creation of fly frames is necessary.
77 bool mbAnchorNodeChanged
;
79 // no copy-constructor
80 SwHandleAnchorNodeChg( const SwHandleAnchorNodeChg
& );
81 // no assignment-operator
82 void operator=( const SwHandleAnchorNodeChg
);