diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-06-19 09:32:45 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-06-19 09:38:05 +0200 |
commit | 1e3a00f0c772a76a1dd76b8272e2c35a1802d574 (patch) | |
tree | a1eadac1680f1e46c789964200aa8a61bb659189 /sw/source/uibase/docvw | |
parent | 9fe114e78f1285397dcd2a0d2e3d6afc3024fa66 (diff) |
Make SfxItemSet ranges correct by construction: Fix static cases
...with the aid of an extended compilerplugins/clang/store/sfxitemsetrewrite.cxx
(which in turn needed a small addition to compilerplugins/clang/check.hxx).
Enable svl::detail::validGap check for the static case, but keep it disabled for
now for the dynamic case.
Change-Id: I4846ba8e99aff94a86518e2cb5044e575093386e
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r-- | sw/source/uibase/docvw/HeaderFooterWin.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PageBreakWin.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 14 |
3 files changed, 16 insertions, 14 deletions
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index 0feb53f1e972..ca5c7857d96c 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -418,11 +418,11 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent) pHFFormat = const_cast< SwFrameFormat* >( rMaster.GetHeader().GetHeaderFormat() ); SfxItemPool* pPool = pHFFormat->GetAttrSet().GetPool(); - SfxItemSet aSet( *pPool, - svl::Items<RES_BACKGROUND, RES_BACKGROUND, - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - RES_SHADOW, RES_SHADOW>{} ); + SfxItemSet aSet( + *pPool, + svl::Items< + RES_BACKGROUND, RES_SHADOW, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); aSet.Put( pHFFormat->GetAttrSet() ); diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 0aabe5fe728f..5615b3f8cd9f 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -282,9 +282,9 @@ void SwPageBreakWin::Select() pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( SwUndoId::UI_DELETE_PAGE_BREAK, nullptr ); - SfxItemSet aSet( GetEditWin()->GetView().GetWrtShell().GetAttrPool(), - svl::Items<RES_PAGEDESC, RES_PAGEDESC, - RES_BREAK, RES_BREAK>{} ); + SfxItemSet aSet( + GetEditWin()->GetView().GetWrtShell().GetAttrPool(), + svl::Items<RES_PAGEDESC, RES_BREAK>{}); aSet.Put( SvxFormatBreakItem( SvxBreak::NONE, RES_BREAK ) ); aSet.Put( SwFormatPageDesc( nullptr ) ); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 225ddc2f7943..892a0b724249 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1008,12 +1008,14 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) if( aTmp.HasArea() && rSh.IsSelObjProtected( FlyProtectFlags::Pos ) == FlyProtectFlags::NONE ) { - SfxItemSet aSet(rSh.GetAttrPool(), - svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, - RES_VERT_ORIENT, RES_ANCHOR, - RES_COL, RES_COL, - RES_PROTECT, RES_PROTECT, - RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW>{}); + SfxItemSet aSet( + rSh.GetAttrPool(), + svl::Items< + RES_FRM_SIZE, RES_FRM_SIZE, + RES_PROTECT, RES_PROTECT, + RES_VERT_ORIENT, RES_ANCHOR, + RES_COL, RES_COL, + RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW>{}); rSh.GetFlyFrameAttr( aSet ); RndStdIds eAnchorId = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId(); Size aSnap; |