summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/inc/flyfrms.hxx2
-rw-r--r--sw/source/core/inc/frame.hxx1
-rw-r--r--sw/source/core/layout/flowfrm.cxx4
-rw-r--r--sw/source/core/layout/flycnt.cxx21
4 files changed, 28 insertions, 0 deletions
diff --git a/sw/source/core/inc/flyfrms.hxx b/sw/source/core/inc/flyfrms.hxx
index 61a40d8a8f8c..39f9c1dbf2f5 100644
--- a/sw/source/core/inc/flyfrms.hxx
+++ b/sw/source/core/inc/flyfrms.hxx
@@ -195,6 +195,8 @@ public:
virtual bool IsFormatPossible() const override;
const SwFlyAtContentFrame* GetFollow() const;
SwFlyAtContentFrame* GetFollow();
+ const SwFlyAtContentFrame* GetPrecede() const;
+ SwFlyAtContentFrame* GetPrecede();
};
// Flys that are bound to a character in Content
diff --git a/sw/source/core/inc/frame.hxx b/sw/source/core/inc/frame.hxx
index 8102a7e26e56..e610de6eab70 100644
--- a/sw/source/core/inc/frame.hxx
+++ b/sw/source/core/inc/frame.hxx
@@ -549,6 +549,7 @@ public:
SwLayoutFrame *GetPrevLeaf ();
SwLayoutFrame *GetPrevFootnoteLeaf( MakePageType eMakeFootnote );
SwLayoutFrame *GetPrevSctLeaf();
+ SwLayoutFrame *GetPrevFlyLeaf();
SwLayoutFrame *GetPrevCellLeaf();
const SwLayoutFrame *GetLeaf ( MakePageType eMakePage, bool bFwd,
const SwFrame *pAnch ) const;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 9939dceafa1b..e53d32b9fa20 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -883,6 +883,10 @@ SwLayoutFrame *SwFrame::GetLeaf( MakePageType eMakePage, bool bFwd )
{
return GetNextFlyLeaf(eMakePage);
}
+ else
+ {
+ return GetPrevFlyLeaf();
+ }
}
return bFwd ? GetNextLeaf( eMakePage ) : GetPrevLeaf();
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 427ac5b9c37b..2d4c9a373796 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -1586,4 +1586,25 @@ SwLayoutFrame *SwFrame::GetNextFlyLeaf( MakePageType eMakePage )
return pLayLeaf;
}
+const SwFlyAtContentFrame* SwFlyAtContentFrame::GetPrecede() const
+{
+ return static_cast<const SwFlyAtContentFrame*>(SwFlowFrame::GetPrecede());
+}
+
+SwFlyAtContentFrame* SwFlyAtContentFrame::GetPrecede()
+{
+ return static_cast<SwFlyAtContentFrame*>(SwFlowFrame::GetPrecede());
+}
+
+SwLayoutFrame* SwFrame::GetPrevFlyLeaf()
+{
+ auto pFly = dynamic_cast<SwFlyAtContentFrame*>(FindFlyFrame());
+ if (!pFly->IsFlySplitAllowed())
+ {
+ return nullptr;
+ }
+
+ return pFly->GetPrecede();
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */