LibreOffice Module sw (master)
1
sw
source
core
layout
movedfwdfrmsbyobjpos.cxx
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
20
#include <
movedfwdfrmsbyobjpos.hxx
>
21
#include <
txtfrm.hxx
>
22
#include <
rowfrm.hxx
>
23
#include <
pagefrm.hxx
>
24
#include <
calbck.hxx
>
25
#include <
ndtxt.hxx
>
26
27
SwMovedFwdFramesByObjPos::SwMovedFwdFramesByObjPos
()
28
{
29
}
30
31
SwMovedFwdFramesByObjPos::~SwMovedFwdFramesByObjPos
()
32
{
33
Clear
();
34
}
35
36
void
SwMovedFwdFramesByObjPos::Insert
(
const
SwTextFrame
& _rMovedFwdFrameByObjPos,
37
const
sal_uInt32 _nToPageNum )
38
{
39
maMovedFwdFrames
.emplace(_rMovedFwdFrameByObjPos.
GetTextNodeFirst
(), _nToPageNum);
40
}
41
42
void
SwMovedFwdFramesByObjPos::Remove
(
const
SwTextFrame
& _rTextFrame )
43
{
44
maMovedFwdFrames
.erase(_rTextFrame.
GetTextNodeFirst
());
45
}
46
47
bool
SwMovedFwdFramesByObjPos::FrameMovedFwdByObjPos
(
const
SwTextFrame
& _rTextFrame,
48
sal_uInt32& _ornToPageNum )
const
49
{
50
// sw_redlinehide: assumption: this wants to uniquely identify all
51
// SwTextFrame belonging to the same paragraph, so just use first one as key
52
auto
aIter =
maMovedFwdFrames
.find( _rTextFrame.
GetTextNodeFirst
() );
53
if
(
maMovedFwdFrames
.end() != aIter )
54
{
55
_ornToPageNum = (*aIter).second;
56
return
true
;
57
}
58
59
return
false
;
60
}
61
62
// #i26945#
63
bool
SwMovedFwdFramesByObjPos::DoesRowContainMovedFwdFrame
(
const
SwRowFrame
& _rRowFrame )
const
64
{
65
bool
bDoesRowContainMovedFwdFrame(
false
);
66
67
const
sal_uInt32 nPageNumOfRow = _rRowFrame.
FindPageFrame
()->
GetPhyPageNum
();
68
69
for
(
const
auto
& rEntry :
maMovedFwdFrames
)
70
{
71
if
( rEntry.second >= nPageNumOfRow )
72
{
73
SwIterator<SwTextFrame, SwTextNode, sw::IteratorMode::UnwrapMulti>
aFrameIter(*rEntry.first);
74
for
(
SwTextFrame
* pTextFrame = aFrameIter.
First
(); pTextFrame; pTextFrame = aFrameIter.
Next
() )
75
{
76
// #115759# - assure that found text frame
77
// is the first one.
78
if
( _rRowFrame.
IsAnLower
( pTextFrame ) && !pTextFrame->GetIndPrev() )
79
{
80
bDoesRowContainMovedFwdFrame =
true
;
81
break
;
82
}
83
}
84
}
85
}
86
87
return
bDoesRowContainMovedFwdFrame;
88
}
89
90
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
calbck.hxx
SwFrame::FindPageFrame
SwPageFrame * FindPageFrame()
Definition:
frame.hxx:686
SwIterator
Definition:
calbck.hxx:366
SwIterator::Next
TElementType * Next()
Definition:
calbck.hxx:380
SwIterator::First
TElementType * First()
Definition:
calbck.hxx:372
SwLayoutFrame::IsAnLower
bool IsAnLower(const SwFrame *) const
Definition:
findfrm.cxx:233
SwMovedFwdFramesByObjPos::maMovedFwdFrames
NodeMap maMovedFwdFrames
Definition:
movedfwdfrmsbyobjpos.hxx:35
SwMovedFwdFramesByObjPos::Clear
void Clear()
Definition:
movedfwdfrmsbyobjpos.hxx:53
SwMovedFwdFramesByObjPos::Insert
void Insert(const SwTextFrame &_rMovedFwdFrameByObjPos, const sal_uInt32 _nToPageNum)
Definition:
movedfwdfrmsbyobjpos.cxx:36
SwMovedFwdFramesByObjPos::~SwMovedFwdFramesByObjPos
~SwMovedFwdFramesByObjPos()
Definition:
movedfwdfrmsbyobjpos.cxx:31
SwMovedFwdFramesByObjPos::Remove
void Remove(const SwTextFrame &_rTextFrame)
Definition:
movedfwdfrmsbyobjpos.cxx:42
SwMovedFwdFramesByObjPos::FrameMovedFwdByObjPos
bool FrameMovedFwdByObjPos(const SwTextFrame &_rTextFrame, sal_uInt32 &_ornToPageNum) const
Definition:
movedfwdfrmsbyobjpos.cxx:47
SwMovedFwdFramesByObjPos::DoesRowContainMovedFwdFrame
bool DoesRowContainMovedFwdFrame(const SwRowFrame &_rRowFrame) const
Definition:
movedfwdfrmsbyobjpos.cxx:63
SwMovedFwdFramesByObjPos::SwMovedFwdFramesByObjPos
SwMovedFwdFramesByObjPos()
Definition:
movedfwdfrmsbyobjpos.cxx:27
SwPageFrame::GetPhyPageNum
sal_uInt16 GetPhyPageNum() const
Definition:
pagefrm.hxx:209
SwRowFrame
SwRowFrame is one table row in the document layout.
Definition:
rowfrm.hxx:29
SwTextFrame
Represents the visualization of a paragraph.
Definition:
txtfrm.hxx:168
SwTextFrame::GetTextNodeFirst
SwTextNode * GetTextNodeFirst()
Definition:
txtfrm.hxx:472
movedfwdfrmsbyobjpos.hxx
ndtxt.hxx
pagefrm.hxx
rowfrm.hxx
txtfrm.hxx
Generated on Sun Jul 30 2023 04:28:43 for LibreOffice Module sw (master) by
1.9.3