summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2023-09-16 21:33:49 -0800
committerJim Raykowski <raykowj@gmail.com>2023-09-17 22:38:40 +0200
commit80a24870491385ba145757bf517c5f1cf7939017 (patch)
tree924ba189a0fa3ffeaa268550940292c19d1af419 /sw/source/uibase/utlui
parente3e16b50525422e77f2a293ab36e0da5b6afccda (diff)
tdf#152029 Don't include frame area top margin in the bring headings to
attention overlay Change-Id: I1ddd842b01d2a134a281f97d9377a3d41b3ecb41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156981 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r--sw/source/uibase/utlui/content.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index ca6a16dbe10d..8b77b9cc1449 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -5690,7 +5690,8 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry)
if (nType == ContentTypeId::OUTLINE)
{
BringTypesWithFlowFramesToAttention({m_pActiveShell->GetNodes().
- GetOutLineNds()[static_cast<SwOutlineContent*>(pCnt)->GetOutlinePos()]});
+ GetOutLineNds()[static_cast<SwOutlineContent*>(pCnt)->GetOutlinePos()]},
+ /*bIncludeTopMargin*/ false);
}
else if (nType == ContentTypeId::TABLE)
{
@@ -5786,7 +5787,7 @@ void SwContentTree::BringEntryToAttention(const weld::TreeIter& rEntry)
std::vector<const SwNode*> aNodesArr(
m_pActiveShell->GetNodes().GetOutLineNds().begin(),
m_pActiveShell->GetNodes().GetOutLineNds().end());
- BringTypesWithFlowFramesToAttention(aNodesArr);
+ BringTypesWithFlowFramesToAttention(aNodesArr, /*bIncludeTopMargin*/ false);
}
else if (nType == ContentTypeId::TABLE)
{
@@ -6031,8 +6032,8 @@ void SwContentTree::BringBookmarksToAttention(const std::vector<OUString>& rName
OverlayObject(std::move(aRanges));
}
-void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vector<const SwNode*>& rNodes)
-{
+void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vector<const SwNode*>& rNodes,
+ const bool bIncludeTopMargin){
std::vector<basegfx::B2DRange> aRanges;
for (const auto* pNode : rNodes)
{
@@ -6044,8 +6045,10 @@ void SwContentTree::BringTypesWithFlowFramesToAttention(const std::vector<const
{
const SwRect& rFrameRect = pFrame->getFrameArea();
if (!rFrameRect.IsEmpty())
- aRanges.emplace_back(rFrameRect.Left(), rFrameRect.Top(), rFrameRect.Right(),
- rFrameRect.Bottom());
+ aRanges.emplace_back(rFrameRect.Left(),
+ bIncludeTopMargin ? rFrameRect.Top() :
+ rFrameRect.Top() + pFrame->GetTopMargin(),
+ rFrameRect.Right(), rFrameRect.Bottom());
if (!pFrame->IsFlowFrame())
break;
SwFlowFrame *pFollow = SwFlowFrame::CastFlowFrame(pFrame)->GetFollow();