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 /starmath | |
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 'starmath')
-rw-r--r-- | starmath/source/document.cxx | 15 | ||||
-rw-r--r-- | starmath/source/smmod.cxx | 16 |
2 files changed, 12 insertions, 19 deletions
diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index ef1ce59cf0fe..998a648e05eb 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -560,15 +560,12 @@ Printer* SmDocShell::GetPrt() } else if (!mpPrinter) { - auto pOptions = o3tl::make_unique<SfxItemSet>(GetPool(), - svl::Items<SID_PRINTSIZE, SID_PRINTSIZE, - SID_PRINTZOOM, SID_PRINTZOOM, - SID_PRINTTITLE, SID_PRINTTITLE, - SID_PRINTTEXT, SID_PRINTTEXT, - SID_PRINTFRAME, SID_PRINTFRAME, - SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES, - SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS, - SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS>{}); + auto pOptions = o3tl::make_unique<SfxItemSet>( + GetPool(), + svl::Items< + SID_PRINTTITLE, SID_PRINTZOOM, + SID_NO_RIGHT_SPACES, SID_SAVE_ONLY_USED_SYMBOLS, + SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS>{}); SmModule *pp = SM_MOD(); pp->GetConfig()->ConfigToItemSet(*pOptions); mpPrinter = VclPtr<SfxPrinter>::Create(std::move(pOptions)); diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx index b532073bafac..0c705b7418d5 100644 --- a/starmath/source/smmod.cxx +++ b/starmath/source/smmod.cxx @@ -247,16 +247,12 @@ std::unique_ptr<SfxItemSet> SmModule::CreateItemSet( sal_uInt16 nId ) std::unique_ptr<SfxItemSet> pRet; if(nId == SID_SM_EDITOPTIONS) { - pRet = o3tl::make_unique<SfxItemSet>(GetPool(), - //TP_SMPRINT - svl::Items<SID_PRINTSIZE, SID_PRINTSIZE, - SID_PRINTZOOM, SID_PRINTZOOM, - SID_PRINTTITLE, SID_PRINTTITLE, - SID_PRINTTEXT, SID_PRINTTEXT, - SID_PRINTFRAME, SID_PRINTFRAME, - SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES, - SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS, - SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS>{} ); + pRet = o3tl::make_unique<SfxItemSet>( + GetPool(), + svl::Items< //TP_SMPRINT + SID_PRINTTITLE, SID_PRINTZOOM, + SID_NO_RIGHT_SPACES, SID_SAVE_ONLY_USED_SYMBOLS, + SID_AUTO_CLOSE_BRACKETS, SID_AUTO_CLOSE_BRACKETS>{}); GetConfig()->ConfigToItemSet(*pRet); } |