summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-06-01 20:38:13 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-06-12 18:55:25 +0200
commit5c49c0df7d5cae7834f8f620226a128b7ac9e1bc (patch)
treec22e7d4525a39f768b1c67560537eb33e7bdffee
parenta9a5287a2ec083b0100afa95cc083c28cccebff1 (diff)
sw_redlinehide: trivial GetNode() in PageBreakWin.cxx
Change-Id: I7bdf58d1f2233ab77a1b774a99aa068fe9438ae8
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index 1580fc4eb756..366c204f9dc8 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -12,6 +12,8 @@
#include <cmdid.h>
#include <cntfrm.hxx>
+#include <txtfrm.hxx>
+#include <notxtfrm.hxx>
#include <DashedLine.hxx>
#include <doc.hxx>
#include <edtwin.hxx>
@@ -240,7 +242,9 @@ void SwPageBreakWin::Select()
rSh.ClearMark();
SwContentFrame *pCnt = const_cast< SwContentFrame* >( pBodyFrame->ContainsContent() );
- SwContentNode* pNd = pCnt->GetNode();
+ SwContentNode* pNd = pCnt->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode();
rSh.SetSelection( *pNd );
SfxStringItem aItem(pEditWin->GetView().GetPool().GetWhich(FN_FORMAT_TABLE_DLG), "textflow");
@@ -254,7 +258,9 @@ void SwPageBreakWin::Select()
else
{
SwContentFrame *pCnt = const_cast< SwContentFrame* >( pBodyFrame->ContainsContent() );
- SwContentNode* pNd = pCnt->GetNode();
+ SwContentNode* pNd = pCnt->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode();
SwPaM aPaM( *pNd );
SwPaMItem aPaMItem( pEditWin->GetView().GetPool( ).GetWhich( FN_PARAM_PAM ), &aPaM );
@@ -276,8 +282,11 @@ void SwPageBreakWin::Select()
if ( pBodyFrame )
{
+
SwContentFrame *pCnt = const_cast< SwContentFrame* >( pBodyFrame->ContainsContent() );
- SwContentNode* pNd = pCnt->GetNode();
+ SwContentNode* pNd = pCnt->IsTextFrame()
+ ? static_cast<SwTextFrame*>(pCnt)->GetTextNodeFirst()
+ : static_cast<SwNoTextFrame*>(pCnt)->GetNode();
pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( SwUndoId::UI_DELETE_PAGE_BREAK, nullptr );