summaryrefslogtreecommitdiff
path: root/sw/source/ui/frmdlg/frmpage.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/frmdlg/frmpage.cxx')
-rw-r--r--sw/source/ui/frmdlg/frmpage.cxx23
1 files changed, 12 insertions, 11 deletions
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index 74ccc1a51809..82bb86e7a095 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -798,15 +798,9 @@ namespace
};
/// Checks if the current fly frame contains exactly one table.
-bool ContainsSingleTable(SwWrtShell* pWrtShell)
+bool ContainsSingleTable(const SwFrameFormat& rFlyFormat)
{
- const SwFrameFormat* pFlyFormat = pWrtShell->GetFlyFrameFormat();
- if (!pFlyFormat)
- {
- return false;
- }
-
- const SwNodeIndex* pStartNode = pFlyFormat->GetContent().GetContentIdx();
+ const SwNodeIndex* pStartNode = rFlyFormat.GetContent().GetContentIdx();
if (!pStartNode)
{
return false;
@@ -830,6 +824,12 @@ bool ContainsSingleTable(SwWrtShell* pWrtShell)
return true;
}
+
+bool ContainsChain(const SwFrameFormat& rFlyFormat)
+{
+ const SwFormatChain& rChain = rFlyFormat.GetChain();
+ return rChain.GetPrev() || rChain.GetNext();
+}
}
void SwFramePage::setOptimalRelWidth()
@@ -1047,10 +1047,11 @@ void SwFramePage::Reset( const SfxItemSet *rSet )
m_xFlySplitCB->set_sensitive(m_xAnchorAtParaRB->get_active());
}
- if (!ContainsSingleTable(pSh))
+ const SwFrameFormat* pFlyFormat = pSh->GetFlyFrameFormat();
+ if (!pFlyFormat || !ContainsSingleTable(*pFlyFormat) || ContainsChain(*pFlyFormat))
{
- // Only allow fly split if the frame contains a single table, otherwise it would be hard the
- // resulting model to Word formats.
+ // Only allow fly split if the frame contains a single table, otherwise it would be hard to
+ // save the resulting model to Word formats.
m_xFlySplitCB->hide();
}