summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/autofmt.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/edit/autofmt.cxx')
-rw-r--r--sw/source/core/edit/autofmt.cxx39
1 files changed, 21 insertions, 18 deletions
diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx
index a3687b5e308c..80b91de1d649 100644
--- a/sw/source/core/edit/autofmt.cxx
+++ b/sw/source/core/edit/autofmt.cxx
@@ -571,29 +571,29 @@ bool SwAutoFormat::DoUnderline()
editeng::SvxBorderLine aLine;
switch( eState )
{
- case 1: // single, 0.05 pt
+ case 1: // single, hairline
aLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
- aLine.SetWidth( DEF_LINE_WIDTH_0 );
+ aLine.SetWidth( SvxBorderLineWidth::Hairline );
break;
- case 2: // single, 1.0 pt
+ case 2: // single, thin
aLine.SetBorderLineStyle(SvxBorderLineStyle::SOLID);
- aLine.SetWidth( DEF_LINE_WIDTH_1 );
+ aLine.SetWidth( SvxBorderLineWidth::Thin );
break;
- case 3: // double, 1.0 pt
+ case 3: // double, thin
aLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
- aLine.SetWidth( DEF_LINE_WIDTH_1 );
+ aLine.SetWidth( SvxBorderLineWidth::Thin );
break;
- case 4: // double (thick/thin), 4.0 pt
+ case 4: // double, thick/thin
aLine.SetBorderLineStyle(SvxBorderLineStyle::THICKTHIN_SMALLGAP);
- aLine.SetWidth( DEF_LINE_WIDTH_3 );
+ aLine.SetWidth( SvxBorderLineWidth::Thick );
break;
- case 5: // double (thin/thick), 4.0 pt
+ case 5: // double, thin/thick
aLine.SetBorderLineStyle(SvxBorderLineStyle::THINTHICK_SMALLGAP);
- aLine.SetWidth( DEF_LINE_WIDTH_3 );
+ aLine.SetWidth( SvxBorderLineWidth::Thick );
break;
- case 6: // double, 2.5 pt
+ case 6: // double, medium
aLine.SetBorderLineStyle(SvxBorderLineStyle::DOUBLE);
- aLine.SetWidth( DEF_LINE_WIDTH_2 );
+ aLine.SetWidth( SvxBorderLineWidth::Medium );
break;
}
SfxItemSet aSet(m_pDoc->GetAttrPool(),
@@ -1196,7 +1196,7 @@ void SwAutoFormat::DeleteSelImpl(SwPaM & rDelPam, SwPaM & rPamToCorrect)
SwPaM* pPrev = rPamToCorrect.GetPrev();
rPamToCorrect.GetRingContainer().merge( pShCursor->GetRingContainer() );
- m_pEditShell->DeleteSel( rDelPam );
+ m_pEditShell->DeleteSel(rDelPam, true);
// and remove Pam again:
SwPaM* p;
@@ -1212,7 +1212,7 @@ void SwAutoFormat::DeleteSelImpl(SwPaM & rDelPam, SwPaM & rPamToCorrect)
m_pCurTextFrame = GetFrame(*m_pCurTextNd); // keep it up to date
}
else
- m_pEditShell->DeleteSel( rDelPam );
+ m_pEditShell->DeleteSel(rDelPam, true);
}
bool SwAutoFormat::DeleteJoinCurNextPara(SwTextFrame const*const pNextFrame,
@@ -1904,11 +1904,14 @@ void SwAutoFormat::BuildHeadLine( sal_uInt16 nLvl )
JoinPrevPara();
DeleteLeadingTrailingBlanks( true, false );
- const SwTextFrame *const pNextFrame = GetNextNode(false);
- (void)DeleteJoinCurNextPara(pNextFrame, true);
-
+ const SwTextFrame* pNextFrame = GetNextNode(false);
+ if (pNextFrame->GetNext())
+ {
+ (void)DeleteJoinCurNextPara(pNextFrame, true);
+ pNextFrame = GetNextNode(false);
+ }
m_aDelPam.DeleteMark();
- m_aDelPam.GetPoint()->nNode = *GetNextNode(false)->GetTextNodeForParaProps();
+ m_aDelPam.GetPoint()->nNode = *pNextFrame->GetTextNodeForParaProps();
m_aDelPam.GetPoint()->nContent.Assign( m_aDelPam.GetContentNode(), 0 );
m_pDoc->SetTextFormatColl( m_aDelPam, &rNxtColl );
}