LibreOffice Module sw (master) 1
HandleAnchorNodeChg.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include "pam.hxx"
22#include <wrtsh.hxx>
23
25class SwFormatAnchor;
26class SwFlyFrame;
27
28// helper class to track change of anchor node of at-paragraph respectively
29// at-character anchored fly frames
30// if such a change happens, it has to be checked, if the count of the anchor
31// frames also change. if yes, a re-creation of the fly frames is needed:
32// - deletion of existing fly frames before the intrinsic anchor node changes
33// - creation of new fly frames after the intrinsic anchor node change.
35{
36public:
51 const SwFormatAnchor& _rNewAnchorFormat,
52 SwFlyFrame const* _pKeepThisFlyFrame = nullptr);
53
56
57private:
58 // fly frame format, which is tracked for an anchor node change.
60 // internal flag, which indicates that the certain anchor node change occurs
61 // and that re-creation of fly frames is necessary.
63
65 std::optional<SwPosition> moCommentAnchor;
66
68
69 void ImplDestroy();
70
72 void operator=(const SwHandleAnchorNodeChg) = delete;
73};
74
75/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
FlyAnchors.
Definition: fmtanchr.hxx:37
std::optional< SwPosition > moCommentAnchor
If the fly frame has a comment, this points to the old comment anchor.
void operator=(const SwHandleAnchorNodeChg)=delete
SwFlyFrameFormat & mrFlyFrameFormat
~SwHandleAnchorNodeChg()
calls <SwFlyFrameFormat::MakeFrames>, if re-creation of fly frames is necessary.
Definition: atrfrm.cxx:3450
SwHandleAnchorNodeChg(SwFlyFrameFormat &_rFlyFrameFormat, const SwFormatAnchor &_rNewAnchorFormat, SwFlyFrame const *_pKeepThisFlyFrame=nullptr)
checks, if re-creation of fly frames for an anchor node change at the given fly frame format is neces...
Definition: atrfrm.cxx:3324
SwHandleAnchorNodeChg(const SwHandleAnchorNodeChg &)=delete
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97