summaryrefslogtreecommitdiff
path: root/sw/source/core/docnode/node.cxx
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2023-04-27 22:57:09 +0200
committerBjoern Michaelsen <bjoern.michaelsen@libreoffice.org>2023-04-28 14:53:45 +0200
commit6fab79859ec97a9153e033fe00fd01e4e46620ce (patch)
treeff7f612626febfa8b26767ce0bd36411e4e35d11 /sw/source/core/docnode/node.cxx
parent10f289477971fe27a5062f02fbb07a44c79e2778 (diff)
Revert "Revert "introduce sw::SpzFrameFormat ...""
apparently, in SwHistoryChangeFlyAnchor::SetInDoc, m_rFormat might actually reference a DrawFormat, not a FlyFormat, and that is likely fundamentally broken. But for now, lets just make m_rFormat a sw::SpzFrameFormat -- this already removes some pointless up and downcasting. This reverts commit 52acefd6024ec79f8333ba40eef83816eda3046f. Change-Id: I040d98548bf9ac1c25b93214224eb0812f8cb653 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151150 Tested-by: Jenkins Reviewed-by: Bjoern Michaelsen <bjoern.michaelsen@libreoffice.org>
Diffstat (limited to 'sw/source/core/docnode/node.cxx')
-rw-r--r--sw/source/core/docnode/node.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 91ac1697ea30..b69dec062a1f 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -547,16 +547,15 @@ const SwPageDesc* SwNode::FindPageDesc( SwNodeOffset* pPgDescNdIdx ) const
{
// Find the right Anchor first
const SwFrameFormat* pFormat = nullptr;
- const SwFrameFormats& rFormats = *rDoc.GetSpzFrameFormats();
+ const sw::SpzFrameFormats& rFormats = *rDoc.GetSpzFrameFormats();
- for( size_t n = 0; n < rFormats.size(); ++n )
+ for(sw::SpzFrameFormat* pSpz: rFormats)
{
- const SwFrameFormat* pFrameFormat = rFormats[ n ];
- const SwFormatContent& rContent = pFrameFormat->GetContent();
+ const SwFormatContent& rContent = pSpz->GetContent();
if( rContent.GetContentIdx() &&
&rContent.GetContentIdx()->GetNode() == static_cast<SwNode const *>(pSttNd) )
{
- pFormat = pFrameFormat;
+ pFormat = pSpz;
break;
}
}
@@ -751,18 +750,17 @@ SwFrameFormat* SwNode::GetFlyFormat() const
if( !pRet )
{
// The hard way through the Doc is our last way out
- const SwFrameFormats& rFrameFormatTable = *GetDoc().GetSpzFrameFormats();
- for( size_t n = 0; n < rFrameFormatTable.size(); ++n )
+ const sw::SpzFrameFormats& rSpzs = *GetDoc().GetSpzFrameFormats();
+ for(sw::SpzFrameFormat* pSpz: rSpzs)
{
- SwFrameFormat* pFormat = rFrameFormatTable[n];
// Only Writer fly frames can contain Writer nodes.
- if (pFormat->Which() != RES_FLYFRMFMT)
+ if (pSpz->Which() != RES_FLYFRMFMT)
continue;
- const SwFormatContent& rContent = pFormat->GetContent();
+ const SwFormatContent& rContent = pSpz->GetContent();
if( rContent.GetContentIdx() &&
&rContent.GetContentIdx()->GetNode() == pSttNd )
{
- pRet = pFormat;
+ pRet = pSpz;
break;
}
}