Make SfxItemSet ranges correct by construction

This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
sorted, and join adjacent ones".  While SfxItemSet::MergeRange relies on the
m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
that each individual range has an upper bound not smaller than its lower bound.
Arguably, all SfxItemSet instances should fulfill the stronger guarantees
required and checked by MergeRange.

And in many cases the ranges are statically known, so that the checking can
happen at compile time.  Therefore, replace the two SfxItemSet ctors taking
explicit ranges with two other ctors that actually do proper checking.  The
(templated) overload taking an svl::Items struct should be used in all cases
where the range values are statically known at compile time, while the overload
taking a std::initializer_list<Pair> is for the remaining cases (that can only
do runtime checking via assert).  Most of those latter cases are simple cases
with a single range covering a single item, but a few are more complex.

(At least some of the uses of the existing SfxItemSet overload taking a

  const sal_uInt16* pWhichPairTable

can probably also be strengthened, but that is left for another day.)

This commit is the first in a series of two.  Apart from the manual changes to
compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
But it does not yet check that the individual ranges are properly sorted (see
the TODO in svl::detail::validGap).  That check will be enabled, and the ensuing
manual fixes will be made in a follow-up commit, to reduce the likelyhood of
accidents.

There were three cases of necessary manual intervention:

* sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
braced-init-list syntax now, so needs explicit narrowing conversion to
sal_uInt16.

* In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.

* In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
some comments had to be put back (see "TODO: the replaced range can contain
relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).

A few uses of the variadic form erroneously used nullptr instead of 0 for
termination.  But this should have been harmless even if promoted std::nullptr_t
is larger than promoted sal_uInt16, assuming that the part of the nullptr value
that was interpreted as sal_uInt16/promoted int was all-zero bits.  Similarly,
some uses made the harmless error of using 0L instead of 0.

Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
Reviewed-on: https://gerrit.libreoffice.org/38861
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2017-06-16 09:58:13 +02:00
parent f83d8ae845
commit 13bb5a4b09
283 changed files with 1225 additions and 1132 deletions

View File

@ -63,7 +63,7 @@ SfxPrinter* DocShell::GetPrinter( bool bCreate )
{
if ( !pPrinter && bCreate )
pPrinter.disposeAndReset(VclPtr<SfxPrinter>::Create(o3tl::make_unique<SfxItemSet>(
GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN
GetPool(), svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN>{}
)));
return pPrinter.get();

View File

@ -284,11 +284,10 @@ SdrOutliner* DrawViewWrapper::getOutliner() const
SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
{
SfxItemSet aFullSet( GetModel()->GetItemPool(),
SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
svl::Items<SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT,
SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS,
SID_ATTR_METRIC, SID_ATTR_METRIC,
0);
SID_ATTR_METRIC, SID_ATTR_METRIC>{});
SfxItemSet aGeoSet( E3dView::GetGeoAttrFromMarked() );
aFullSet.Put( aGeoSet );
aFullSet.Put( SfxUInt16Item(SID_ATTR_METRIC,static_cast< sal_uInt16 >( ConfigurationAccess::getFieldUnit())));

View File

@ -137,7 +137,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
// Graphic Attributes
@ -147,9 +147,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
// CustomShape properties
SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
// range from SdrTextObj
EE_ITEMS_START, EE_ITEMS_END,
// end
0, 0);
EE_ITEMS_START, EE_ITEMS_END>{});
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
sal_Int32 nAngle = pSourceObj->GetRotateAngle();

View File

@ -564,13 +564,12 @@ void ShapeController::executeDispatch_ParagraphDialog()
pDrawViewWrapper->GetAttributes( aAttr );
SfxItemSet aNewAttr( rPool,
EE_ITEMS_START, EE_ITEMS_END,
svl::Items<EE_ITEMS_START, EE_ITEMS_END,
SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_PAGEBREAK,
SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
0 );
SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS>{} );
aNewAttr.Put( aAttr );
aNewAttr.Put( SvxHyphenZoneItem( false, SID_ATTR_PARA_HYPHENZONE ) );
aNewAttr.Put( SvxFormatBreakItem( SvxBreak::NONE, SID_ATTR_PARA_PAGEBREAK ) );

View File

@ -0,0 +1,262 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "check.hxx"
#include "plugin.hxx"
namespace {
class Visitor final:
public RecursiveASTVisitor<Visitor>, public loplugin::RewritePlugin
{
public:
explicit Visitor(InstantiationData const & data): RewritePlugin(data) {}
bool VisitCXXConstructExpr(CXXConstructExpr const * expr) {
if (ignoreLocation(expr)) {
return true;
}
auto const ctor = expr->getConstructor();
if (!loplugin::DeclCheck(ctor->getParent()).Class("SfxItemSet")
.GlobalNamespace())
{
return true;
}
auto const numParams = ctor->getNumParams();
auto const variadic = ctor->isVariadic();
if (!(((numParams == 3 && !variadic) || (numParams == 4 && variadic))
&& (loplugin::TypeCheck(ctor->getParamDecl(0)->getType())
.LvalueReference().Class("SfxItemPool").GlobalNamespace())))
{
return true;
}
auto const numArgs = expr->getNumArgs();
if (numArgs < 3) {
report(
DiagnosticsEngine::Warning,
("unexpected SfxItemPool constructor call with less than three"
" arguments"),
expr->getExprLoc())
<< expr->getSourceRange();
return true;
}
rewrite(expr, variadic, false, numArgs, expr->getArgs());
return true;
}
bool VisitCallExpr(CallExpr const * expr) {
if (ignoreLocation(expr)) {
return true;
}
auto const dre = dyn_cast<DeclRefExpr>(
expr->getCallee()->IgnoreParenImpCasts());
if (dre == nullptr
|| !(loplugin::DeclCheck(dre->getDecl()).Function("make_unique")
.Namespace("o3tl").GlobalNamespace()))
{
return true;
}
auto const numTArgs = dre->getNumTemplateArgs();
if (numTArgs == 0) {
report(
DiagnosticsEngine::Warning,
"unexpected o3tl::make_unique call without template arguments",
expr->getExprLoc())
<< expr->getSourceRange();
return true;
}
auto const tArg0 = dre->getTemplateArgs()[0].getArgument();
if (tArg0.getKind() != TemplateArgument::Type) {
report(
DiagnosticsEngine::Warning,
("unexpected o3tl::make_unique call with non-type first"
" template argument"),
expr->getExprLoc())
<< expr->getSourceRange();
return true;
}
if (!loplugin::TypeCheck(tArg0.getAsType()).Class("SfxItemSet")
.GlobalNamespace())
{
return true;
}
auto const numArgs = expr->getNumArgs();
if (numArgs < 3) {
return true;
}
rewrite(expr, numArgs > 3, true, numArgs, expr->getArgs());
return true;
}
private:
void run() override {
if (compiler.getLangOpts().CPlusPlus) {
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
}
}
SourceLocation nextToken(SourceLocation loc) {
return loc.getLocWithOffset(
Lexer::MeasureTokenLength(
loc, compiler.getSourceManager(), compiler.getLangOpts()));
}
SourceLocation atMacroExpansionStart(SourceLocation loc) {
while (loc.isMacroID()
&& (compiler.getSourceManager()
.isAtStartOfImmediateMacroExpansion(loc, &loc)))
{}
return loc;
}
SourceLocation atMacroExpansionEnd(SourceLocation loc) {
while (compiler.getSourceManager().isMacroBodyExpansion(loc)) {
loc = compiler.getSourceManager().getImmediateExpansionRange(loc)
.second;
}
return loc;
}
void rewrite(
Expr const * expr, bool variadic, bool forward, unsigned numArgs,
Expr const * const * args)
{
bool constant = true;
unsigned firstZero = 0;
for (unsigned i = 1; i != numArgs; ++i) {
auto const arg = args[i];
constant = constant
&& arg->isCXX11ConstantExpr(compiler.getASTContext());
APSInt v;
auto const zero
= ((arg->EvaluateAsInt(v, compiler.getASTContext())
&& v == 0)
|| (variadic && i > 4
&& arg->isNullPointerConstant(
compiler.getASTContext(),
Expr::NPC_ValueDependentIsNotNull)));
if (variadic) {
if (zero) {
if (firstZero == 0) {
if (i == 1) {
report(
DiagnosticsEngine::Warning,
("unexpected missing non-zero arguments before"
" first zero argument in SfxItemPool"
" constructor call"),
arg->getExprLoc())
<< expr->getSourceRange();
return;
}
if (i % 2 == 0) {
report(
DiagnosticsEngine::Warning,
("unexpected odd number of potentially non-zero"
" arguments before first definitely zero"
" argument in SfxItemPool constructor call"),
arg->getExprLoc())
<< expr->getSourceRange();
return;
}
firstZero = i;
}
} else if (firstZero != 0) {
report(
DiagnosticsEngine::Warning,
("unexpected potentially non-zero argument in"
" SfxItemPool constructor call, following zero"
" argument"),
arg->getExprLoc())
<< expr->getSourceRange();
return;
}
} else if (zero) {
report(
DiagnosticsEngine::Warning,
"unexpected zero argument in SfxItemPool constructor call",
arg->getExprLoc())
<< expr->getSourceRange();
return;
}
}
if (variadic && firstZero == 0) {
report(
DiagnosticsEngine::Warning,
("unexpected SfxItemPool constructor call with no detectable"
" zero arguments"),
expr->getExprLoc())
<< expr->getSourceRange();
return;
}
if (rewriter != nullptr) {
if (!insertTextBefore(
atMacroExpansionStart(args[1]->getLocStart()),
(constant
? StringRef("svl::Items<")
: (forward
? StringRef("std::initializer_list<SfxItemSet::Pair>{{")
: StringRef("{{")))))
{
goto failed;
}
auto const postLoc = atMacroExpansionEnd(
args[numArgs - 1]->getLocEnd());
auto const postStr = constant ? StringRef(">{}") : StringRef("}}");
if (variadic) {
//TODO: the replaced range can contain relevant comments:
if (!replaceText(
SourceRange(
nextToken(
atMacroExpansionEnd(
args[firstZero - 1]->getLocEnd())),
postLoc),
postStr))
{
goto failed;
}
} else {
if (!insertTextAfterToken(postLoc, postStr)) {
goto failed;
}
}
if (!constant && variadic) {
for (unsigned i = 2; i != firstZero - 1; ++i) {
auto const arg = args[i];
if (!(i % 2 == 0
? insertTextAfterToken(
atMacroExpansionEnd(arg->getLocEnd()), "}")
: insertTextBefore(
atMacroExpansionStart(arg->getLocStart()), "{")))
{
goto failed;
}
}
}
return;
}
failed: //TODO: undo partial changes
report(
DiagnosticsEngine::Warning,
("rewrite SfxItemPool constructor call with"
" %select{%select{|std::initializer_list<SfxItemSet::Pair>}1"
"%{%{..., ...%}, ..., %{..., ...%}%}|svl::Items<...>%{%}}0 around"
" the %select{|leading }2%3 WID arguments%select{| and remove the"
" remaining %4 zero %plural{1:argument|:arguments}4}2"),
expr->getExprLoc())
<< constant << forward << variadic
<< (variadic ? firstZero - 1 : numArgs - 1) << (numArgs - firstZero)
<< expr->getSourceRange();
}
};
static loplugin::Plugin::Registration<Visitor> reg("sfxitemsetrewrite",true);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */

View File

@ -118,8 +118,8 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
GetCancelButton().SetText ( CuiResId(RID_SVXSTR_HYPDLG_CLOSEBUT) );
// create itemset for tabpages
mpItemSet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK );
mpItemSet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), svl::Items<SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK>{} );
SvxHyperlinkItem aItem(SID_HYPERLINK_GETLINK);
mpItemSet->Put(aItem);
@ -191,8 +191,8 @@ bool SvxHpLinkDlg::Close()
void SvxHpLinkDlg::Apply()
{
SfxItemSet aItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK );
SfxItemSet aItemSet( SfxGetpApp()->GetPool(), svl::Items<SID_HYPERLINK_GETLINK,
SID_HYPERLINK_SETLINK>{} );
SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(
GetTabPage( GetCurPageId() ) );

View File

@ -323,8 +323,8 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, void)
// create empty itemset for macro-dlg
std::unique_ptr<SfxItemSet> pItemSet( new SfxItemSet(SfxGetpApp()->GetPool(),
SID_ATTR_MACROITEM,
SID_ATTR_MACROITEM ) );
svl::Items<SID_ATTR_MACROITEM,
SID_ATTR_MACROITEM>{} ) );
pItemSet->Put ( aItem );
/* disable HyperLinkDlg for input while the MacroAssignDlg is working

View File

@ -1285,7 +1285,7 @@ class SvxMacroAssignDialog : public VclAbstractDialog
public:
SvxMacroAssignDialog( vcl::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
:m_aItems( SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
:m_aItems( SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM>{} )
{
m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
m_pDialog.reset( VclPtr<SvxMacroAssignDlg>::Create( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );

View File

@ -1124,14 +1124,13 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
{
pRet = o3tl::make_unique<SfxItemSet>(
SfxGetpApp()->GetPool(),
SID_ATTR_METRIC, SID_ATTR_SPELL,
svl::Items<SID_ATTR_METRIC, SID_ATTR_SPELL,
SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER,
SID_ATTR_YEAR2000, SID_ATTR_YEAR2000,
SID_HTML_MODE, SID_HTML_MODE,
0 );
SID_HTML_MODE, SID_HTML_MODE>{} );
SfxItemSet aOptSet( SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
SfxItemSet aOptSet( SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER>{} );
SfxGetpApp()->GetOptions(aOptSet);
pRet->Put(aOptSet);
@ -1164,11 +1163,10 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
case SID_LANGUAGE_OPTIONS :
{
pRet = o3tl::make_unique<SfxItemSet>(SfxGetpApp()->GetPool(),
SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK,
svl::Items<SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK,
SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
SID_OPT_LOCALE_CHANGED, SID_OPT_LOCALE_CHANGED,
SID_SET_DOCUMENT_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE,
0 );
SID_SET_DOCUMENT_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE>{} );
// for linguistic
@ -1233,28 +1231,25 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
break;
case SID_INET_DLG :
pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
SID_BASIC_ENABLED, SID_BASIC_ENABLED,
svl::Items<SID_BASIC_ENABLED, SID_BASIC_ENABLED,
//SID_OPTIONS_START - ..END
SID_SAVEREL_INET, SID_SAVEREL_FSYS,
SID_INET_NOPROXY, SID_INET_FTP_PROXY_PORT,
SID_SECURE_URL, SID_SECURE_URL,
0L );
SID_SECURE_URL, SID_SECURE_URL>{} );
SfxGetpApp()->GetOptions(*pRet);
break;
case SID_FILTER_DLG:
pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE,
svl::Items<SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE,
SID_SAVEREL_INET, SID_SAVEREL_FSYS,
SID_ATTR_PRETTYPRINTING, SID_ATTR_PRETTYPRINTING,
SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT,
0 );
SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT>{} );
SfxGetpApp()->GetOptions(*pRet);
break;
case SID_SB_STARBASEOPTIONS:
pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
SID_SB_POOLING_ENABLED, SID_SB_DB_REGISTER,
0 );
svl::Items<SID_SB_POOLING_ENABLED, SID_SB_DB_REGISTER>{} );
::offapp::ConnectionPoolConfig::GetOptions(*pRet);
svx::DbRegisteredNamesConfig::GetOptions(*pRet);
break;
@ -1262,7 +1257,7 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
case SID_SCH_EDITOPTIONS:
{
SvxChartOptions aChartOpt;
pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS );
pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), svl::Items<SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS>{} );
pRet->Put( SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aChartOpt.GetDefaultColors() ) );
break;
}
@ -1278,7 +1273,7 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
{
utl::MiscCfg aMisc;
const SfxPoolItem* pItem = nullptr;
SfxItemSet aOptSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
SfxItemSet aOptSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER>{} );
aOptSet.Put(rSet);
if(aOptSet.Count())
SfxGetpApp()->SetOptions( aOptSet );

View File

@ -74,9 +74,8 @@ void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPa
{
SfxItemSet aNew(
*GetInputSetImpl()->GetPool(),
SID_COLOR_TABLE, SID_BITMAP_LIST,
SID_OFFER_IMPORT, SID_OFFER_IMPORT,
0, 0);
svl::Items<SID_COLOR_TABLE, SID_BITMAP_LIST,
SID_OFFER_IMPORT, SID_OFFER_IMPORT>{});
aNew.Put(*GetInputSetImpl());

View File

@ -1155,7 +1155,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
{
// create FillAttributes from SvxBrushItem
const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
SfxItemSet aTempSet(*rTmpSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@ -1199,7 +1199,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
{
// create FillAttributes from SvxBrushItem
const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
SfxItemSet aTempSet(*rTmpSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@ -1233,7 +1233,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
{
// create FillAttributes from SvxBrushItem
const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem);
SfxItemSet aTempSet(*rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
SfxItemSet aTempSet(*rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@ -1303,7 +1303,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
{
// aBspWin.SetHdColor(rItem.GetColor());
const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(nWhich));
SfxItemSet aTempSet(*rHeaderSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
SfxItemSet aTempSet(*rHeaderSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@ -1365,7 +1365,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
{
// aBspWin.SetFtColor(rItem.GetColor());
const SvxBrushItem& rItem = static_cast<const SvxBrushItem&>(rFooterSet.Get(nWhich));
SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
SfxItemSet aTempSet(*rFooterSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));

View File

@ -289,7 +289,7 @@ bool shouldLaunchQuickstart()
if (!bQuickstart)
{
const SfxPoolItem* pItem=nullptr;
SfxItemSet aQLSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER);
SfxItemSet aQLSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER>{});
SfxGetpApp()->GetOptions(aQLSet);
SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, false, &pItem);
if (SfxItemState::SET == eState)

View File

@ -1860,7 +1860,7 @@ void ContentNode::dumpAsXml(struct _xmlTextWriter* pWriter) const
ContentAttribs::ContentAttribs( SfxItemPool& rPool )
: pStyle(nullptr)
, aAttribSet( rPool, EE_PARA_START, EE_CHAR_END )
, aAttribSet( rPool, svl::Items<EE_PARA_START, EE_CHAR_END>{} )
{
}
@ -2105,7 +2105,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
void EditDoc::CreateDefFont( bool bUseStyles )
{
SfxItemSet aTmpSet( GetItemPool(), EE_PARA_START, EE_CHAR_END );
SfxItemSet aTmpSet( GetItemPool(), svl::Items<EE_PARA_START, EE_CHAR_END>{} );
CreateFont( aDefFont, aTmpSet );
aDefFont.SetVertical( IsVertical() );
aDefFont.SetOrientation( IsVertical() ? (IsTopToBottom() ? 2700 : 900) : 0 );

View File

@ -115,7 +115,7 @@ const XParaPortion& XParaPortionList::operator [](size_t i) const
ContentInfo::ContentInfo( SfxItemPool& rPool ) :
eFamily(SfxStyleFamily::Para),
aParaAttribs(rPool, EE_PARA_START, EE_CHAR_END)
aParaAttribs(rPool, svl::Items<EE_PARA_START, EE_CHAR_END>{})
{
}
@ -124,7 +124,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse
maText(rCopyFrom.maText),
aStyle(rCopyFrom.aStyle),
eFamily(rCopyFrom.eFamily),
aParaAttribs(rPoolToUse, EE_PARA_START, EE_CHAR_END)
aParaAttribs(rPoolToUse, svl::Items<EE_PARA_START, EE_CHAR_END>{})
{
// this should ensure that the Items end up in the correct Pool!
aParaAttribs.Set( rCopyFrom.GetParaAttribs() );

View File

@ -699,7 +699,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet()
{
if ( !pEmptyItemSet )
{
pEmptyItemSet = o3tl::make_unique<SfxItemSet>( aEditDoc.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END );
pEmptyItemSet = o3tl::make_unique<SfxItemSet>( aEditDoc.GetItemPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++)
{
pEmptyItemSet->ClearItem( nWhich );

View File

@ -2154,7 +2154,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
if(aCurrentNewPortion->sText != aCurrentOldPortion->sText)
{
//change text and apply language
SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
SetAttribs( *aCurrentOldPosition, aSet );
ImpInsertText( *aCurrentOldPosition, aCurrentNewPortion->sText );
@ -2162,7 +2162,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
{
//apply language
SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
SetAttribs( *aCurrentOldPosition, aSet );
}
@ -2199,7 +2199,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
case SvtScriptType::COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
default: break;
}
SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
SetAttribs( aCurrentPaM, aSet );
}

View File

@ -3260,7 +3260,7 @@ SfxPoolItem* SvxScriptTypeItem::Clone( SfxItemPool * ) const
SvxScriptSetItem::SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool )
: SfxSetItem( nSlotId, o3tl::make_unique<SfxItemSet>( rPool,
SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT ))
svl::Items<SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT>{} ))
{
sal_uInt16 nLatin, nAsian, nComplex;
GetWhichIds( nLatin, nAsian, nComplex );

View File

@ -190,13 +190,13 @@ void SvxUnoFontDescriptor::setPropertyToDefault( SfxItemSet& rSet )
uno::Any SvxUnoFontDescriptor::getPropertyDefault( SfxItemPool* pPool )
{
SfxItemSet aSet( *pPool, EE_CHAR_FONTINFO, EE_CHAR_FONTINFO,
SfxItemSet aSet( *pPool, svl::Items<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO,
EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT,
EE_CHAR_ITALIC, EE_CHAR_ITALIC,
EE_CHAR_UNDERLINE, EE_CHAR_UNDERLINE,
EE_CHAR_WEIGHT, EE_CHAR_WEIGHT,
EE_CHAR_STRIKEOUT, EE_CHAR_STRIKEOUT,
EE_CHAR_WLM, EE_CHAR_WLM, 0 );
EE_CHAR_WLM, EE_CHAR_WLM>{} );
uno::Any aAny;

View File

@ -203,7 +203,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
if( eMapUnit == MapUnit::Map100thMM )
nMemberId &= (~CONVERT_TWIPS);
uno::Any aVal;
SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
SfxItemSet aSet( mrItemPool, {{pMap->nWID, pMap->nWID}});
if( (pMap->nWID < OWN_ATTR_VALUE_START) || (pMap->nWID > OWN_ATTR_VALUE_END ) )
{

View File

@ -1273,7 +1273,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aProp
// Get Default from ItemPool
if(SfxItemPool::IsWhich(pMap->nWID))
{
SfxItemSet aSet( *pPool, pMap->nWID, pMap->nWID);
SfxItemSet aSet( *pPool, {{pMap->nWID, pMap->nWID}});
aSet.Put(pPool->GetDefaultItem(pMap->nWID));
return SvxItemPropertySet::getPropertyValue(pMap, aSet, true, false );
}

View File

@ -2660,9 +2660,8 @@ namespace pcr
{
// create the itemset for the dialog
SfxItemSet aCoreSet(SfxGetpApp()->GetPool(),
SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE,
SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
0); // ripped this somewhere ... don't understand it :(
svl::Items<SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE,
SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO>{}); // ripped this somewhere ... don't understand it :(
// get the number formats supplier
Reference< XNumberFormatsSupplier > xSupplier;

View File

@ -19,9 +19,14 @@
#ifndef INCLUDED_SVL_ITEMSET_HXX
#define INCLUDED_SVL_ITEMSET_HXX
#include <svl/svldllapi.h>
#include <sal/config.h>
#include <cstdarg>
#include <cassert>
#include <cstddef>
#include <initializer_list>
#include <type_traits>
#include <svl/svldllapi.h>
#include <svl/poolitem.hxx>
class SfxItemPool;
@ -30,6 +35,48 @@ class SvStream;
typedef SfxPoolItem const** SfxItemArray;
namespace svl {
namespace detail {
constexpr bool validRange(sal_uInt16 wid1, sal_uInt16 wid2)
{ return wid1 != 0 && wid1 <= wid2; }
constexpr bool validGap(sal_uInt16, sal_uInt16)
{ return true; } //TODO: wid2 > wid1 && wid2 - wid1 > 1
template<sal_uInt16 WID1, sal_uInt16 WID2> constexpr bool validRanges()
{ return validRange(WID1, WID2); }
template<sal_uInt16 WID1, sal_uInt16 WID2, sal_uInt16 WID3, sal_uInt16... WIDs>
constexpr bool validRanges() {
return validRange(WID1, WID2) && validGap(WID2, WID3)
&& validRanges<WID3, WIDs...>();
}
// The calculations in rangeSize and rangesSize cannot overflow, assuming
// std::size_t is no smaller than sal_uInt16:
constexpr std::size_t rangeSize(sal_uInt16 wid1, sal_uInt16 wid2) {
#if HAVE_CXX14_CONSTEXPR
assert(validRange(wid1, wid2));
#endif
return wid2 - wid1 + 1;
}
template<sal_uInt16 WID1, sal_uInt16 WID2> constexpr std::size_t rangesSize()
{ return rangeSize(WID1, WID2); }
template<sal_uInt16 WID1, sal_uInt16 WID2, sal_uInt16 WID3, sal_uInt16... WIDs>
constexpr std::size_t rangesSize()
{ return rangeSize(WID1, WID2) + rangesSize<WID3, WIDs...>(); }
}
template<sal_uInt16... WIDs> struct Items {};
}
class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet
{
friend class SfxItemIter;
@ -45,8 +92,10 @@ friend class SfxAllItemSet;
private:
SVL_DLLPRIVATE void InitRanges_Impl(const sal_uInt16 *nWhichPairTable);
SVL_DLLPRIVATE void InitRanges_Impl(va_list pWhich, sal_uInt16 n1, sal_uInt16 n2, sal_uInt16 n3);
SVL_DLLPRIVATE void InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2);
SfxItemSet(
SfxItemPool & pool, std::initializer_list<sal_uInt16> wids,
std::size_t items);
public:
SfxItemArray GetItems_Impl() const { return m_pItems; }
@ -61,11 +110,17 @@ protected:
void PutDirect(const SfxPoolItem &rItem);
public:
struct Pair { sal_uInt16 wid1, wid2; };
SfxItemSet( const SfxItemSet& );
SfxItemSet( SfxItemPool&);
SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
SfxItemSet( SfxItemPool&, int nWh1, int nWh2, int nNull, ... );
template<sal_uInt16... WIDs> SfxItemSet(
typename std::enable_if<
svl::detail::validRanges<WIDs...>(), SfxItemPool &>::type pool,
svl::Items<WIDs...>):
SfxItemSet(pool, {WIDs...}, svl::detail::rangesSize<WIDs...>()) {}
SfxItemSet( SfxItemPool&, std::initializer_list<Pair> wids );
SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable );
virtual ~SfxItemSet();

View File

@ -751,7 +751,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
try
{
SfxItemPool& rItemPool = pModel->GetItemPool();
::std::unique_ptr<SfxItemSet> pDescriptor( new SfxItemSet( rItemPool, rItemPool.GetFirstWhich(),rItemPool.GetLastWhich() ) );
::std::unique_ptr<SfxItemSet> pDescriptor( new SfxItemSet( rItemPool, {{rItemPool.GetFirstWhich(),rItemPool.GetLastWhich()}} ) );
lcl_fillShapeToItems(_xShape,*pDescriptor);
{ // want the dialog to be destroyed before our set

View File

@ -609,7 +609,7 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj)
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
SfxItemSet aDest( _pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
// Graphic Attributes
@ -619,9 +619,7 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj)
// CustomShape properties
SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
// range from SdrTextObj
EE_ITEMS_START, EE_ITEMS_END,
// end
0, 0);
EE_ITEMS_START, EE_ITEMS_END>{});
aDest.Set( rSource );
_pObj->SetMergedItemSet( aDest );
sal_Int32 nAngle = pSourceObj->GetRotateAngle();

View File

@ -3425,7 +3425,7 @@ void Test::testFormulaRefUpdateValidity()
SfxUInt32Item aItem(ATTR_VALIDDATA, nIndex);
ScPatternAttr aNewAttrs(
o3tl::make_unique<SfxItemSet>(*m_pDoc->GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END));
o3tl::make_unique<SfxItemSet>(*m_pDoc->GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{}));
aNewAttrs.GetItemSet().Put(aItem);
m_pDoc->ApplyPattern(0, 1, 0, aNewAttrs);

View File

@ -209,14 +209,13 @@ ScDocumentPool::ScDocumentPool()
GetDefaultFonts( aDummy, *pCjkFont, *pCtlFont );
SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER );
auto pSet = o3tl::make_unique<SfxItemSet>( *this, ATTR_PATTERN_START, ATTR_PATTERN_END );
auto pSet = o3tl::make_unique<SfxItemSet>( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
SfxItemSet aSetItemItemSet( *this,
ATTR_BACKGROUND, ATTR_BACKGROUND,
svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
ATTR_BORDER, ATTR_SHADOW,
ATTR_LRSPACE, ATTR_ULSPACE,
ATTR_PAGE_SIZE, ATTR_PAGE_SIZE,
ATTR_PAGE_ON, ATTR_PAGE_SHARED,
0 );
ATTR_PAGE_ON, ATTR_PAGE_SHARED>{} );
pGlobalBorderInnerAttr->SetLine(nullptr, SvxBoxInfoItemLine::HORI);
pGlobalBorderInnerAttr->SetLine(nullptr, SvxBoxInfoItemLine::VERT);

View File

@ -120,11 +120,10 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
{
auto pSet =
o3tl::make_unique<SfxItemSet>( *xPoolHelper->GetDocPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
nullptr );
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS>{} );
::utl::MiscCfg aMisc;
SfxPrinterChangeFlags nFlags = SfxPrinterChangeFlags::NONE;

View File

@ -85,7 +85,7 @@ ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet )
}
ScPatternAttr::ScPatternAttr( SfxItemPool* pItemPool )
: SfxSetItem ( ATTR_PATTERN, o3tl::make_unique<SfxItemSet>( *pItemPool, ATTR_PATTERN_START, ATTR_PATTERN_END ) ),
: SfxSetItem ( ATTR_PATTERN, o3tl::make_unique<SfxItemSet>( *pItemPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) ),
pName ( nullptr ),
pStyle ( nullptr ),
mnKey(0)
@ -161,7 +161,7 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */
pStr = new OUString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
auto pNewSet = o3tl::make_unique<SfxItemSet>( *GetItemSet().GetPool(),
ATTR_PATTERN_START, ATTR_PATTERN_END );
svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
pNewSet->Load( rStream );
ScPatternAttr* pPattern = new ScPatternAttr( std::move(pNewSet) );

View File

@ -139,12 +139,11 @@ SfxItemSet& ScStyleSheet::GetItemSet()
SfxItemPool& rItemPool = GetPool().GetPool();
pSet = new SfxItemSet( rItemPool,
ATTR_BACKGROUND, ATTR_BACKGROUND,
svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
ATTR_BORDER, ATTR_SHADOW,
ATTR_LRSPACE, ATTR_PAGE_SCALETO,
ATTR_WRITINGDIR, ATTR_WRITINGDIR,
ATTR_USERDEF, ATTR_USERDEF,
0 );
ATTR_USERDEF, ATTR_USERDEF>{} );
// If being loaded also the set is then filled in from the file,
// so the defaults do not need to be set.
@ -222,7 +221,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
case SfxStyleFamily::Para:
default:
pSet = new SfxItemSet( GetPool().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
pSet = new SfxItemSet( GetPool().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
break;
}
bMySet = true;

View File

@ -479,7 +479,7 @@ void ScTable::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMa
if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) )
{
ScDocumentPool* pPool = pDocument->GetPool();
SfxItemSet aSet( *pPool, ATTR_PATTERN_START, ATTR_PATTERN_END );
SfxItemSet aSet( *pPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
aSet.Put( ScProtectionAttr( false ) );
SfxItemPoolCache aCache( pPool, &aSet );
ApplySelectionCache( &aCache, rMark );

View File

@ -134,11 +134,11 @@ static bool lcl_HasThickLine( SdrObject& rObj )
}
ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
aBoxSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
aArrowSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
aToTabSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
aFromTabSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
aCircleSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END )
aBoxSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
aArrowSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
aToTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
aFromTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
aCircleSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} )
{
nMaxLevel = 0;
@ -194,7 +194,7 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
}
ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
aCaptionSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END, EE_ITEMS_START, EE_ITEMS_END, 0, 0 )
aCaptionSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END, EE_ITEMS_START, EE_ITEMS_END>{} )
{
basegfx::B2DPolygon aTriangle;
aTriangle.append(basegfx::B2DPoint(10.0, 0.0));

View File

@ -424,7 +424,7 @@ XclExpStringRef lclCreateFormattedString(
// font buffer and helper item set for edit engine -> Calc item conversion
XclExpFontBuffer& rFontBuffer = rRoot.GetFontBuffer();
SfxItemSet aItemSet( *rRoot.GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
SfxItemSet aItemSet( *rRoot.GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
// script type handling
Reference< XBreakIterator > xBreakIt = rRoot.GetDoc().GetBreakIterator();
@ -678,7 +678,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
OUString aText;
sal_Int32 nHeight = 0;
SfxItemSet aItemSet( *GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
// edit engine
bool bOldUpdateMode = mrEE.GetUpdateMode();

View File

@ -371,7 +371,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
// set Calc header/footer defaults
SfxItemSet* pEditSet = new SfxItemSet( rEE.GetEmptyItemSet() );
SfxItemSet aItemSet( *GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
ScPatternAttr::FillToEditItemSet( *pEditSet, aItemSet );
// FillToEditItemSet() adjusts font height to 1/100th mm, we need twips
std::unique_ptr<SfxPoolItem> pNewItem( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT));

View File

@ -760,12 +760,11 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
pSet->Put( aHeaderItem );
SfxItemSet aSetItemItemSet( *pDoc->GetPool(),
ATTR_BACKGROUND, ATTR_BACKGROUND,
svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
ATTR_BORDER, ATTR_SHADOW,
ATTR_PAGE_SIZE, ATTR_PAGE_SIZE,
ATTR_LRSPACE, ATTR_ULSPACE,
ATTR_PAGE_ON, ATTR_PAGE_SHARED,
0 );
ATTR_PAGE_ON, ATTR_PAGE_SHARED>{} );
nColor = pHeadFootLine->BackColor;
Color aBColor( nColor.Red, nColor.Green, nColor.Blue );
nColor = pHeadFootLine->RasterColor;

View File

@ -405,7 +405,7 @@ void ScModule::Execute( SfxRequest& rReq )
bSet = !GetDocOptions().IsAutoSpell();
}
SfxItemSet aSet( GetPool(), SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK );
SfxItemSet aSet( GetPool(), svl::Items<SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK>{} );
aSet.Put( SfxBoolItem( SID_AUTOSPELL_CHECK, bSet ) );
ModifyOptions( aSet );
rReq.Done();
@ -1932,7 +1932,7 @@ std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId )
{
pRet = o3tl::make_unique<SfxItemSet>( GetPool(),
// TP_CALC:
SID_SCDOCOPTIONS, SID_SCDOCOPTIONS,
svl::Items<SID_SCDOCOPTIONS, SID_SCDOCOPTIONS,
// TP_VIEW:
SID_SCVIEWOPTIONS, SID_SCVIEWOPTIONS,
SID_SC_OPT_SYNCZOOM, SID_SC_OPT_SYNCZOOM,
@ -1955,8 +1955,7 @@ std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId )
// TP_DEFAULTS
SID_SCDEFAULTSOPTIONS, SID_SCDEFAULTSOPTIONS,
// TP_FORMULA
SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS,
0 );
SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS>{} );
const ScAppOptions& rAppOpt = GetAppOptions();

View File

@ -645,10 +645,9 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, vcl::Windo
aDate += ScGlobal::pLocaleData->getTime( aDT, false );
SfxItemSet aSet( GetPool(),
SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR,
svl::Items<SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR,
SID_ATTR_POSTIT_DATE, SID_ATTR_POSTIT_DATE,
SID_ATTR_POSTIT_TEXT, SID_ATTR_POSTIT_TEXT,
0 );
SID_ATTR_POSTIT_TEXT, SID_ATTR_POSTIT_TEXT>{} );
aSet.Put( SvxPostItTextItem ( aComment, SID_ATTR_POSTIT_TEXT ) );
aSet.Put( SvxPostItAuthorItem( aAuthor, SID_ATTR_POSTIT_AUTHOR ) );

View File

@ -122,7 +122,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
case SID_TEXT_STANDARD: // delete hard text attributes
{
SfxItemSet aEmptyAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
SfxItemSet aEmptyAttr(GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
pView->SetAttributes(aEmptyAttr, true);
}
break;
@ -334,7 +334,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin )
}
// create empty itemset for macro-dlg
std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ));
std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>{} ));
pItemSet->Put ( aItem );
SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);

View File

@ -451,7 +451,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_ENABLE_HYPHENATION);
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
bool bValue = pItem->GetValue();
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
pView->SetAttributes( aSet );

View File

@ -801,7 +801,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
if ( pOutView )
pOutView->Paint( tools::Rectangle() );
SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), EE_ITEMS_START, EE_ITEMS_END );
SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
pView->SetAttributes( aEmptyAttr, true );
if ( pOutView )
@ -924,7 +924,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
const SvxLRSpaceItem& rItem = static_cast<const SvxLRSpaceItem&>(
pArgs->Get( nId ));
SfxItemSet aAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
nId = EE_PARA_LRSPACE;
SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
rItem.GetRight(), rItem.GetTextLeft(),
@ -936,7 +936,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
{
SvxLineSpacingItem aLineSpaceItem = static_cast<const SvxLineSpacingItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
SfxItemSet aAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL );
SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL>{} );
aAttr.Put( aLineSpaceItem );
pView->SetAttributes( aAttr );
}
@ -944,7 +944,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
{
SvxULSpaceItem aULSpaceItem = static_cast<const SvxULSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
SfxItemSet aAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE>{} );
aULSpaceItem.SetWhich(EE_PARA_ULSPACE);
aAttr.Put( aULSpaceItem );
pView->SetAttributes( aAttr );

View File

@ -72,13 +72,12 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
{
SfxItemPool* pArgPool = rArgs.GetPool();
SfxItemSet aNewAttr( *pArgPool,
EE_ITEMS_START, EE_ITEMS_END,
svl::Items<EE_ITEMS_START, EE_ITEMS_END,
SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_PAGEBREAK,
SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
0 );
SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS>{} );
aNewAttr.Put( rArgs );
// Values have been taken over once to show the dialog.

View File

@ -91,7 +91,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
{
SfxItemSet aAttr( pView->GetModel()->GetItemPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
SfxItemSet aAttr( pView->GetModel()->GetItemPool(), svl::Items<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION>{} );
aAttr.Put( SvxWritingModeItem(
nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL,
@ -107,7 +107,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_ENABLE_HYPHENATION);
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
bool bValue = pItem->GetValue();
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
pView->SetAttributes( aSet );
@ -163,9 +163,8 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
case SID_ATTR_PARA_RIGHT_TO_LEFT:
{
SfxItemSet aAttr( pView->GetModel()->GetItemPool(),
EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
EE_PARA_JUST, EE_PARA_JUST,
0 );
svl::Items<EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
EE_PARA_JUST, EE_PARA_JUST>{} );
bool bLeft = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT );
aAttr.Put( SvxFrameDirectionItem(
bLeft ? SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB,

View File

@ -168,7 +168,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
// Graphic Attributes
@ -178,9 +178,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
// CustomShape properties
SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
// range from SdrTextObj
EE_ITEMS_START, EE_ITEMS_END,
// end
0, 0);
EE_ITEMS_START, EE_ITEMS_END>{});
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
sal_Int32 nAngle = pSourceObj->GetRotateAngle();

View File

@ -413,7 +413,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
// set needed attributes for scrolling
SfxItemSet aItemSet( pDrDoc->GetItemPool(),
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>{});
aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
@ -684,7 +684,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectan
if(bMarquee)
{
SfxItemSet aSet(pDrDoc->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
SfxItemSet aSet(pDrDoc->GetItemPool(), svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>{});
aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );

View File

@ -44,8 +44,8 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe
: SvxHFPage ( pParent, rSet, nSetId ),
aDataSet ( *rSet.GetPool(),
ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
ATTR_PAGE, ATTR_PAGE, 0 ),
svl::Items<ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
ATTR_PAGE, ATTR_PAGE>{} ),
nPageUsage ( SvxPageUsage::All ),
pStyleDlg ( nullptr )
{

View File

@ -238,11 +238,10 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ );
aStream.Seek ( STREAM_SEEK_TO_BEGIN );
auto pSet = o3tl::make_unique<SfxItemSet>( *rDoc.GetPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
nullptr );
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS>{} );
pDocShell->SetPrinter( SfxPrinter::Create( aStream, std::move(pSet) ) );
}
}

View File

@ -3036,7 +3036,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
ScopedVclPtr<SfxAbstractTabDialog> pDlg;
ScSubTotalParam aSubTotalParam;
SfxItemSet aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA );
SfxItemSet aArgSet( GetPool(), svl::Items<SCITEM_SUBTDATA, SCITEM_SUBTDATA>{} );
// Only get existing named database range.
ScDBData* pDBData = pTabViewShell->GetDBData(true, SC_DB_OLD);

View File

@ -478,7 +478,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if( lcl_GetSortParam( pData, aSortParam ) )
{
ScDocument* pDoc = GetViewData()->GetDocument();
SfxItemSet aArgSet( GetPool(), SCITEM_SORTDATA, SCITEM_SORTDATA );
SfxItemSet aArgSet( GetPool(), svl::Items<SCITEM_SORTDATA, SCITEM_SORTDATA>{} );
pDBData->GetSortParam( aSortParam );
bool bHasHeader = pDoc->HasColHeader( aSortParam.nCol1, aSortParam.nRow1, aSortParam.nCol2, aSortParam.nRow2, pData->GetTabNo() );

View File

@ -331,13 +331,13 @@ void ScCellShell::Execute( SfxRequest& rReq )
std::unique_ptr<SfxItemSet> pEmptySet(
new SfxItemSet( *pReqArgs->GetPool(),
ATTR_PATTERN_START,
ATTR_PATTERN_END ));
svl::Items<ATTR_PATTERN_START,
ATTR_PATTERN_END>{} ));
std::unique_ptr<SfxItemSet> pNewSet(
new SfxItemSet( *pReqArgs->GetPool(),
ATTR_PATTERN_START,
ATTR_PATTERN_END ));
svl::Items<ATTR_PATTERN_START,
ATTR_PATTERN_END>{} ));
const SfxPoolItem* pAttr = nullptr;
sal_uInt16 nWhich = 0;

View File

@ -997,7 +997,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
{
AddUndo(new SdrUndoAttrObj(rHitObject));
SfxItemSet aSet(GetModel()->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
SfxItemSet aSet(GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>{});
aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
aSet.Put(XFillBitmapItem(OUString(), rGraphic));

View File

@ -1033,7 +1033,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
}
short nType = GetCurrentNumberFormatType();
SfxItemSet aSet( GetPool(), nSlot, nSlot );
SfxItemSet aSet( GetPool(), {{nSlot, nSlot}} );
switch ( nSlot )
{
case SID_NUMBER_TWODEC:
@ -1239,7 +1239,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
const SfxItemSet& rOldSet =
pTabViewShell->GetSelectionPattern()->GetItemSet();
SfxItemPool* pDocPool = GetViewData()->GetDocument()->GetPool();
SfxItemSet aNewSet( *pDocPool, ATTR_PATTERN_START, ATTR_PATTERN_END );
SfxItemSet aNewSet( *pDocPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
aNewSet.Put( *pItem );
pTabViewShell->ApplyAttributes( &aNewSet, &rOldSet );
}
@ -1873,13 +1873,13 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
std::unique_ptr<SfxItemSet> pOldSet(
new SfxItemSet(
*(pDoc->GetPool()),
ATTR_PATTERN_START,
ATTR_PATTERN_END ));
svl::Items<ATTR_PATTERN_START,
ATTR_PATTERN_END>{} ));
std::unique_ptr<SfxItemSet> pNewSet(
new SfxItemSet(
*(pDoc->GetPool()),
ATTR_PATTERN_START,
ATTR_PATTERN_END ));
svl::Items<ATTR_PATTERN_START,
ATTR_PATTERN_END>{} ));
const SfxPoolItem& rBorderAttr =
pOldAttrs->GetItemSet().
Get( ATTR_BORDER );

View File

@ -199,7 +199,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent&
}
SfxItemSet aArgSet( pViewData->GetViewShell()->GetPool(),
SCITEM_QUERYDATA, SCITEM_QUERYDATA );
svl::Items<SCITEM_QUERYDATA, SCITEM_QUERYDATA>{} );
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();

View File

@ -332,7 +332,7 @@ void ScGridWindow::UpdateStatusPosSize()
if (!pPV)
return; // shouldn't be called in that case either
SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), SID_ATTR_POSITION, SID_ATTR_SIZE);
SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), svl::Items<SID_ATTR_POSITION, SID_ATTR_SIZE>{});
// Fill items for position and size:
// show action rectangle during action,

View File

@ -100,7 +100,7 @@ void ScPivotShell::Execute( SfxRequest& rReq )
ScViewData& rViewData = pViewShell->GetViewData();
SfxItemSet aArgSet( pViewShell->GetPool(),
SCITEM_QUERYDATA, SCITEM_QUERYDATA );
svl::Items<SCITEM_QUERYDATA, SCITEM_QUERYDATA>{} );
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, &rViewData, &aQueryParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();

View File

@ -627,7 +627,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
}
else
{
SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SfxItemSet aSet ( GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{} );
SvxZoomItem aZoomItem( SvxZoomType::PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
aSet.Put( aZoomItem );

View File

@ -706,7 +706,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
}
else
{
SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SfxItemSet aSet ( GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{} );
SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
ScopedVclPtr<AbstractSvxZoomDialog> pDlg;
ScMarkData& rMark = GetViewData().GetMarkData();

View File

@ -203,8 +203,8 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
case SID_OPENDLG_CONSOLIDATE:
{
SfxItemSet aArgSet( GetPool(),
SCITEM_CONSOLIDATEDATA,
SCITEM_CONSOLIDATEDATA );
svl::Items<SCITEM_CONSOLIDATEDATA,
SCITEM_CONSOLIDATEDATA>{} );
const ScConsolidateParam* pDlgData =
pDoc->GetConsolidateDlgData();
@ -254,8 +254,8 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
{
ScQueryParam aQueryParam;
SfxItemSet aArgSet( GetPool(),
SCITEM_QUERYDATA,
SCITEM_QUERYDATA );
svl::Items<SCITEM_QUERYDATA,
SCITEM_QUERYDATA>{} );
ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
pDBData->ExtendDataArea(pDoc);
@ -284,8 +284,8 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
ScQueryParam aQueryParam;
SfxItemSet aArgSet( GetPool(),
SCITEM_QUERYDATA,
SCITEM_QUERYDATA );
svl::Items<SCITEM_QUERYDATA,
SCITEM_QUERYDATA>{} );
ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
pDBData->ExtendDataArea(pDoc);

View File

@ -3126,12 +3126,12 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
{
std::unique_ptr<SfxItemSet> pOldSet(new SfxItemSet(
*(pDoc->GetPool()),
ATTR_PATTERN_START,
ATTR_PATTERN_END ));
svl::Items<ATTR_PATTERN_START,
ATTR_PATTERN_END>{} ));
std::unique_ptr<SfxItemSet> pNewSet(new SfxItemSet(
*(pDoc->GetPool()),
ATTR_PATTERN_START,
ATTR_PATTERN_END ));
svl::Items<ATTR_PATTERN_START,
ATTR_PATTERN_END>{} ));
SvxBorderLine aLine;

View File

@ -981,7 +981,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem )
}
ScPatternAttr aNewAttrs( o3tl::make_unique<SfxItemSet>( *GetViewData().GetDocument()->GetPool(),
ATTR_PATTERN_START, ATTR_PATTERN_END ) );
svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) );
aNewAttrs.GetItemSet().Put( rAttrItem );
// if justify is set (with Buttons), always indentation 0

View File

@ -222,7 +222,7 @@ const SfxItemSet& SdDialogsTest::getEmptyFillStyleSfxItemSet()
{
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
mpEmptyFillStyleSfxItemSet.reset( new SfxItemSet(pDrawDoc->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST) );
mpEmptyFillStyleSfxItemSet.reset( new SfxItemSet(pDrawDoc->GetItemPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) );
CPPUNIT_ASSERT(mpEmptyFillStyleSfxItemSet);
mpEmptyFillStyleSfxItemSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
}
@ -350,7 +350,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
// CreateSdSnapLineDlg(const SfxItemSet& rInAttrs, ::sd::View* pView) override;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), ATTR_SNAPLINE_START, ATTR_SNAPLINE_END);
SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), svl::Items<ATTR_SNAPLINE_START, ATTR_SNAPLINE_END>{});
aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_X, 0));
aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_Y, 0));
pRetval = getSdAbstractDialogFactory()->CreateSdSnapLineDlg(
@ -364,7 +364,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
// CreateSdInsertLayerDlg(const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr) override;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), ATTR_LAYER_START, ATTR_LAYER_END);
SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), svl::Items<ATTR_LAYER_START, ATTR_LAYER_END>{});
const OUString aLayerName = SdResId(STR_LAYER); // + OUString::number(2);
aNewAttr.Put(makeSdAttrLayerName(aLayerName));
aNewAttr.Put(makeSdAttrLayerTitle());
@ -432,7 +432,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
const std::vector<OUString> aPageNames;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
SfxItemSet aDlgSet(pDrawDoc->GetItemPool(), ATTR_PRESENT_START, ATTR_PRESENT_END);
SfxItemSet aDlgSet(pDrawDoc->GetItemPool(), svl::Items<ATTR_PRESENT_START, ATTR_PRESENT_END>{});
::sd::PresentationSettings& rPresentationSettings = pDrawDoc->getPresentationSettings();
aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_ALL, rPresentationSettings.mbAll));
aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_CUSTOMSHOW, rPresentationSettings.mbCustomShow));
@ -513,7 +513,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
// CreatSdActionDialog(const SfxItemSet* pAttr, ::sd::View* pView) override;
SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
CPPUNIT_ASSERT(pDrawDoc);
SfxItemSet aSet(pDrawDoc->GetItemPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
SfxItemSet aSet(pDrawDoc->GetItemPool(), svl::Items<ATTR_ANIMATION_START, ATTR_ACTION_END>{});
aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false));
aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE)));
aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE)));

View File

@ -2156,7 +2156,7 @@ SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourceObj, P
}
// Remove LRSpace item
SfxItemSet aSet(pModel->GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
SfxItemSet aSet(pModel->GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aSet.Put(pNewObj->GetMergedItemSet());
@ -2194,7 +2194,7 @@ SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourceObj, P
pNewObj->SetEmptyPresObj(false);
// reset left indent
SfxItemSet aSet(pModel->GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
SfxItemSet aSet(pModel->GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aSet.Put(pNewObj->GetMergedItemSet());

View File

@ -479,7 +479,7 @@ SfxStyleSheet* SdPage::GetTextStyleSheetForObject( SdrObject* pObj ) const
SfxItemSet* SdPage::getOrCreateItems()
{
if( mpItems == nullptr )
mpItems = o3tl::make_unique<SfxItemSet>( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
mpItems = o3tl::make_unique<SfxItemSet>( pModel->GetItemPool(), svl::Items<SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES>{} );
return mpItems.get();
}

View File

@ -1006,7 +1006,7 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con
throw IllegalArgumentException();
}
SfxItemSet aSet( GetPool().GetPool(), pEntry->nWID, pEntry->nWID);
SfxItemSet aSet( GetPool().GetPool(), {{pEntry->nWID, pEntry->nWID}});
aSet.Put( rStyleSet );
if( !aSet.Count() )
@ -1113,7 +1113,7 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName )
}
else
{
SfxItemSet aSet( GetPool().GetPool(), pEntry->nWID, pEntry->nWID);
SfxItemSet aSet( GetPool().GetPool(), {{pEntry->nWID, pEntry->nWID}});
const SfxPoolItem* pItem;
SfxItemSet& rStyleSet = GetItemSet();
@ -1301,7 +1301,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName )
else
{
SfxItemPool& rMyPool = GetPool().GetPool();
SfxItemSet aSet( rMyPool, pEntry->nWID, pEntry->nWID);
SfxItemSet aSet( rMyPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( rMyPool.GetDefaultItem( pEntry->nWID ) );
aRet = SvxItemPropertySet_getPropertyValue( pEntry, aSet );
}

View File

@ -442,7 +442,7 @@ std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
rPool.SetDefaultMetric( MapUnit::Map100thMM );
auto pRet = o3tl::make_unique<SfxItemSet>( rPool,
SID_ATTR_METRIC, SID_ATTR_METRIC,
svl::Items<SID_ATTR_METRIC, SID_ATTR_METRIC,
SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
ATTR_OPTIONS_LAYOUT, ATTR_OPTIONS_LAYOUT,
@ -455,8 +455,7 @@ std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
0 );
SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS>{} );
// TP_OPTIONS_LAYOUT:
pRet->Put( SdOptionsLayoutItem( pOptions, pFrameView ) );
@ -628,10 +627,9 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
}
SfxItemSet aPrintSet( GetPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
0 );
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>{} );
// Print
const SdOptionsPrintItem* pPrintItem = nullptr;

View File

@ -319,7 +319,7 @@ IMPL_LINK_NOARG(SdModifyFieldDlg, LanguageChangeHdl, ListBox&, void)
SfxItemSet SdModifyFieldDlg::GetItemSet()
{
SfxItemSet aOutput( *maInputSet.GetPool(), EE_CHAR_LANGUAGE, EE_CHAR_LANGUAGE_CTL );
SfxItemSet aOutput( *maInputSet.GetPool(), svl::Items<EE_CHAR_LANGUAGE, EE_CHAR_LANGUAGE_CTL>{} );
if( m_pLbLanguage->IsValueChangedFromSaved() )
{

View File

@ -60,7 +60,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
, "modules/sdraw/ui/drawprtldialog.ui"),
mpDocShell ( pDocSh ),
ePO ( _ePO ),
aInputSet ( *rStyleBase.GetItemSet().GetPool(), SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL ),
aInputSet ( *rStyleBase.GetItemSet().GetPool(), svl::Items<SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL>{} ),
pOutSet ( nullptr ),
pOrgSet ( &rStyleBase.GetItemSet() )
{

View File

@ -100,10 +100,9 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
{
// create ItemSet with special pool area
auto pSet = o3tl::make_unique<SfxItemSet>( GetPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
0 );
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>{} );
// set PrintOptionsSet
SdOptionsPrintItem aPrintItem( SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()) );
SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );

View File

@ -252,7 +252,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
empty string). */
pOV->InsertText( "" );
SfxItemSet aOldSet( mpDoc->GetPool(), EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, 0 );
SfxItemSet aOldSet( mpDoc->GetPool(), svl::Items<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO>{} );
aOldSet.Put( pOV->GetAttribs() );
::svl::IUndoManager& rUndoMgr = pOL->GetUndoManager();

View File

@ -191,7 +191,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj
SDRATTR_START, SDRATTR_SHADOW_LAST,
svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
// Graphic Attributes
@ -201,9 +201,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
// CustomShape properties
SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
// range from SdrTextObj
EE_ITEMS_START, EE_ITEMS_END,
// end
0, 0);
EE_ITEMS_START, EE_ITEMS_END>{});
aDest.Set( rSource );
pObj->SetMergedItemSet( aDest );
sal_Int32 nAngle = pSourceObj->GetRotateAngle();

View File

@ -77,7 +77,7 @@ void FuCopy::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
SfxItemSet aSet( mpViewShell->GetPool(),
ATTR_COPY_START, ATTR_COPY_END, 0 );
svl::Items<ATTR_COPY_START, ATTR_COPY_END>{} );
// indicate color attribute
SfxItemSet aAttr( mpDoc->GetPool() );
@ -210,7 +210,7 @@ void FuCopy::DoExecute( SfxRequest& rReq )
if( ( 1 == i ) && bColor )
{
SfxItemSet aNewSet( mpViewShell->GetPool(), XATTR_FILLSTYLE, XATTR_FILLCOLOR, 0L );
SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR>{} );
aNewSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
aNewSet.Put( XFillColorItem( OUString(), aStartColor ) );
mpView->SetAttributes( aNewSet );
@ -272,7 +272,7 @@ void FuCopy::DoExecute( SfxRequest& rReq )
sal_uInt8 nGreen = aStartColor.GetGreen() + (sal_uInt8) ( ( (long) aEndColor.GetGreen() - (long) aStartColor.GetGreen() ) * (long) i / (long) nNumber );
sal_uInt8 nBlue = aStartColor.GetBlue() + (sal_uInt8) ( ( (long) aEndColor.GetBlue() - (long) aStartColor.GetBlue() ) * (long) i / (long) nNumber );
Color aNewColor( nRed, nGreen, nBlue );
SfxItemSet aNewSet( mpViewShell->GetPool(), XATTR_FILLSTYLE, XATTR_FILLCOLOR, 0L );
SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR>{} );
aNewSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
aNewSet.Put( XFillColorItem( OUString(), aNewColor ) );
mpView->SetAttributes( aNewSet );

View File

@ -116,7 +116,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
pOutl->SetText(*pParaObj);
// remove hard paragraph- and character attributes
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
sal_Int32 nParaCount1 = pOutl->GetParagraphCount();
for (sal_Int32 nPara = 0; nPara < nParaCount1; nPara++)

View File

@ -343,7 +343,7 @@ void FuMorph::ImpInsertPolygons(
long nEndLineWidth = 0;
SdrPageView* pPageView = mpView->GetSdrPageView();
SfxItemPool & rPool = pObj1->GetObjectItemPool();
SfxItemSet aSet1( rPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 );
SfxItemSet aSet1( rPool,svl::Items<SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END>{} );
SfxItemSet aSet2( aSet1 );
bool bLineColor = false;
bool bFillColor = false;

View File

@ -339,7 +339,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
if(!pArgs)
{
// fill ItemSet for dialog
SfxItemSet aSet(mpDoc->GetPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
SfxItemSet aSet(mpDoc->GetPool(), svl::Items<ATTR_ANIMATION_START, ATTR_ACTION_END>{});
// fill the set
if (nAnimationSet == ATTR_SET)

View File

@ -77,7 +77,7 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
mpView->GetAttributes( aEditAttr );
SfxItemSet aNewAttr( mpViewShell->GetPool(),
EE_ITEMS_START, EE_ITEMS_END );
svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aNewAttr.Put( aEditAttr, false );
// create and execute dialog
@ -150,7 +150,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
return;
}
SfxItemSet aNewAttr( mpViewShell->GetPool(), EE_ITEMS_START, EE_ITEMS_END );
SfxItemSet aNewAttr( mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
{
SfxItemSet aEditAttr( mpDoc->GetPool() );
mpView->GetAttributes( aEditAttr );
@ -270,7 +270,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
if (bInMasterView && pNumRule)
{
SfxItemSet aSetAttr( mpViewShell->GetPool(), EE_ITEMS_START, EE_ITEMS_END );
SfxItemSet aSetAttr( mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aSetAttr.Put(SvxNumBulletItem( *pNumRule, nNumItemId ));
mpView->SetAttributes(aSetAttr);
}

View File

@ -212,15 +212,14 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
PageKind ePageKind = mpDrawViewShell->GetPageKind();
SfxItemSet aNewAttr(mpDoc->GetPool(),
mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE),
SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED,
SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
XATTR_FILL_FIRST, XATTR_FILL_LAST,
SID_ATTR_PAGE_COLOR,SID_ATTR_PAGE_FILLSTYLE,
EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
0);
{{mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE)},
{SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED},
{SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER},
{SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW},
{XATTR_FILL_FIRST, XATTR_FILL_LAST},
{SID_ATTR_PAGE_COLOR,SID_ATTR_PAGE_FILLSTYLE},
{EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR}});
// Retrieve additional data for dialog
@ -279,7 +278,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
p2 = pPtr[3];
pPtr += 2;
}
SfxItemSet aMergedAttr( *aNewAttr.GetPool(), p1, p2 );
SfxItemSet aMergedAttr( *aNewAttr.GetPool(), {{p1, p2}} );
mergeItemSetsImpl( aMergedAttr, aNewAttr );
@ -316,12 +315,12 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
int nError = aDlg.GetGraphic(aGraphic);
if( nError == ERRCODE_NONE )
{
pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0) );
pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) );
pTempSet->Put( XFillStyleItem( drawing::FillStyle_BITMAP ) );
// MigrateItemSet makes sure the XFillBitmapItem will have a unique name
SfxItemSet aMigrateSet( mpDoc->GetPool(), XATTR_FILLBITMAP, XATTR_FILLBITMAP );
SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLBITMAP, XATTR_FILLBITMAP>{} );
aMigrateSet.Put(XFillBitmapItem(OUString("background"), aGraphic));
SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc );

View File

@ -70,10 +70,9 @@ void FuParagraph::DoExecute( SfxRequest& rReq )
mpView->GetAttributes( aEditAttr );
SfxItemPool *pPool = aEditAttr.GetPool();
SfxItemSet aNewAttr( *pPool,
EE_ITEMS_START, EE_ITEMS_END,
svl::Items<EE_ITEMS_START, EE_ITEMS_END,
SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET,
ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END,
0 );
ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END>{} );
aNewAttr.Put( aEditAttr );

View File

@ -143,7 +143,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
bool bLoad = false; // appear the new master pages?
OUString aFile;
SfxItemSet aSet(mpDoc->GetPool(), ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END);
SfxItemSet aSet(mpDoc->GetPool(), svl::Items<ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END>{});
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad));
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_MASTER_PAGE, bMasterPage ) );

View File

@ -71,7 +71,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
/* does the selections end in a unique presentation layout?
if not, it is not allowed to edit the templates */
SfxItemSet aSet(mpDoc->GetItemPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
SfxItemSet aSet(mpDoc->GetItemPool(), svl::Items<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>{});
pOutlineViewShell->GetStatusBarState( aSet );
OUString aLayoutName = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue();
DBG_ASSERT(!aLayoutName.isEmpty(), "Layout not defined");

View File

@ -69,7 +69,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
SfxItemSet aNewAttr( mpDoc->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
SfxItemSet aNewAttr( mpDoc->GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{} );
std::unique_ptr<SvxZoomItem> pZoomItem;
SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;

View File

@ -60,7 +60,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
{
PresentationSettings& rPresentationSettings = mpDoc->getPresentationSettings();
SfxItemSet aDlgSet( mpDoc->GetPool(), ATTR_PRESENT_START, ATTR_PRESENT_END );
SfxItemSet aDlgSet( mpDoc->GetPool(), svl::Items<ATTR_PRESENT_START, ATTR_PRESENT_END>{} );
std::vector<OUString> aPageNameList(mpDoc->GetSdPageCount( PageKind::Standard ));
const OUString& rPresPage = rPresentationSettings.maPresPage;
OUString aFirstPage;

View File

@ -72,7 +72,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
if (!pArgs)
{
SfxItemSet aNewAttr(mpViewShell->GetPool(), ATTR_SNAPLINE_START, ATTR_SNAPLINE_END);
SfxItemSet aNewAttr(mpViewShell->GetPool(), svl::Items<ATTR_SNAPLINE_START, ATTR_SNAPLINE_END>{});
bool bLineExist (false);
Point aLinePos;

View File

@ -194,7 +194,7 @@ void FuSummaryPage::DoExecute( SfxRequest& )
return;
// remove hard break- and character attributes
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
sal_Int32 nParaCount = pOutl->GetParagraphCount();
for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)

View File

@ -532,7 +532,7 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
{
// FitToSize (fit to frame)
SfxItemSet aSet(mpViewShell->GetPool(), SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
SfxItemSet aSet(mpViewShell->GetPool(), svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{});
SdrFitToSizeType eFTS = SdrFitToSizeType::Proportional;
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
@ -544,7 +544,7 @@ void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
{
SfxItemSet aSet(mpViewShell->GetPool(),
SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{});
SdrFitToSizeType eFTS = SdrFitToSizeType::Proportional;
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
aSet.Put(makeSdrTextAutoGrowHeightItem(false));

View File

@ -754,10 +754,9 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
else
{
pItemSet = o3tl::make_unique<SfxItemSet>(pDoc->GetPool(),
SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
0 );
ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>{} );
}
pPrinter = SfxPrinter::Create ( aStream, std::move(pItemSet) );

View File

@ -2481,7 +2481,7 @@ void SdDrawPage::setBackground( const Any& rValue )
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xSet );
SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( pBack )
{
@ -2867,7 +2867,7 @@ void SdMasterPage::setBackground( const Any& rValue )
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xInputSet );
SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( pBack )
{

View File

@ -60,7 +60,7 @@ SdUnoPageBackground::SdUnoPageBackground(
if( pDoc )
{
StartListening( *pDoc );
mpSet = o3tl::make_unique<SfxItemSet>( pDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
mpSet = o3tl::make_unique<SfxItemSet>( pDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( pSet )
mpSet->Put(*pSet);
@ -101,7 +101,7 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
StartListening( *pDoc );
mpDoc = pDoc;
mpSet = o3tl::make_unique<SfxItemSet>( *rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
mpSet = o3tl::make_unique<SfxItemSet>( *rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( mpPropSet->AreThereOwnUsrAnys() )
{
@ -228,7 +228,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa
}
SfxItemPool& rPool = *mpSet->GetPool();
SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( *mpSet );
if( !aSet.Count() )
@ -290,7 +290,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert
else
{
SfxItemPool& rPool = *mpSet->GetPool();
SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( *mpSet );
if( !aSet.Count() )
@ -418,7 +418,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp
else
{
SfxItemPool& rPool = *mpSet->GetPool();
SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) );
aAny = SvxItemPropertySet_getPropertyValue( pEntry, aSet );

View File

@ -129,7 +129,7 @@ void TextObjectBar::GetCharState( SfxItemSet& rSet )
SfxItemSet aCharAttrSet( mpView->GetDoc().GetPool() );
mpView->GetAttributes( aCharAttrSet );
SfxItemSet aNewAttr( mpViewShell->GetPool(),EE_ITEMS_START,EE_ITEMS_END);
SfxItemSet aNewAttr( mpViewShell->GetPool(),svl::Items<EE_ITEMS_START,EE_ITEMS_END>{});
aNewAttr.Put(aCharAttrSet, false);
rSet.Put(aNewAttr, false);

View File

@ -267,7 +267,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSpaceSlot)));
SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aLRSpace.SetWhich( EE_PARA_LRSPACE );
aEditAttr.Put( aLRSpace );
@ -279,7 +279,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
case SID_HANGING_INDENT:
{
SfxItemSet aLRSpaceSet( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
SfxItemSet aLRSpaceSet( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
mpView->GetAttributes( aLRSpaceSet );
SvxLRSpaceItem aParaMargin( static_cast<const SvxLRSpaceItem&>( aLRSpaceSet.Get( EE_PARA_LRSPACE ) ) );
@ -324,7 +324,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
{
mpView->SdrEndTextEdit();
SfxItemSet aAttr( mpView->GetDoc().GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
SfxItemSet aAttr( mpView->GetDoc().GetPool(), svl::Items<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION>{} );
aAttr.Put( SvxWritingModeItem(
nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL,

View File

@ -313,7 +313,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pItem )
{
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
bool bValue = pItem->GetValue();
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
mpDrawView->SetAttributes( aSet );
@ -321,7 +321,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
else // only for testing purpose
{
OSL_FAIL(" no value for hyphenation!");
SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
bool bValue = true;
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
mpDrawView->SetAttributes( aSet );
@ -785,7 +785,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
pOutl->RemoveFields(checkSvxFieldData<SvxURLField>);
}
pSet.reset(new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END ));
pSet.reset(new SfxItemSet( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} ));
mpDrawView->SetAttributes( *pSet, true );
}
else
@ -806,7 +806,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pPresPage->IsPresObj( pObj ) )
{
auto pNewSet = o3tl::make_unique<SfxItemSet>( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
auto pNewSet = o3tl::make_unique<SfxItemSet>( GetDoc()->GetPool(), svl::Items<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT>{} );
pNewSet->Put(pObj->GetMergedItemSet());
aAttrList.push_back(std::make_pair(std::move(pNewSet), pObj->GetUserCall()));
}
@ -1283,7 +1283,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_CONNECTION_NEW_ROUTING:
{
SfxItemSet aDefAttr( GetPool(), SDRATTR_EDGELINE1DELTA, SDRATTR_EDGELINE3DELTA );
SfxItemSet aDefAttr( GetPool(), svl::Items<SDRATTR_EDGELINE1DELTA, SDRATTR_EDGELINE3DELTA>{} );
GetView()->SetAttributes( aDefAttr, true ); // (ReplaceAll)
Cancel();
@ -1387,7 +1387,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (! pArgs)
{
SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
SfxItemSet aNewAttr( GetDoc()->GetPool(), svl::Items<ATTR_LAYER_START, ATTR_LAYER_END>{} );
aNewAttr.Put( makeSdAttrLayerName( aLayerName ) );
aNewAttr.Put( makeSdAttrLayerTitle() );
@ -1555,7 +1555,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (! pArgs)
{
SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
SfxItemSet aNewAttr( GetDoc()->GetPool(), svl::Items<ATTR_LAYER_START, ATTR_LAYER_END>{} );
aNewAttr.Put( makeSdAttrLayerName( aLayerName ) );
aNewAttr.Put( makeSdAttrLayerTitle( aLayerTitle ) );

View File

@ -657,7 +657,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
const SvxTabStopItem& rItem = static_cast<const SvxTabStopItem&>(
pArgs->Get( EE_PARA_TABS ));
SfxItemSet aEditAttr( GetPool(), EE_PARA_TABS, EE_PARA_TABS );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_TABS, EE_PARA_TABS>{} );
aEditAttr.Put( rItem );
mpDrawView->SetAttributes( aEditAttr );
@ -672,7 +672,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
SvxLineSpacingItem aParaLineSP = static_cast<const SvxLineSpacingItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
SfxItemSet aEditAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL>{} );
aParaLineSP.SetWhich( EE_PARA_SBL );
aEditAttr.Put( aParaLineSP );
@ -684,7 +684,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_LEFT:
{
SvxAdjustItem aItem( SvxAdjust::Left, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@ -695,7 +695,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_CENTER:
{
SvxAdjustItem aItem( SvxAdjust::Center, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@ -706,7 +706,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_RIGHT:
{
SvxAdjustItem aItem( SvxAdjust::Right, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@ -717,7 +717,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_BLOCK:
{
SvxAdjustItem aItem( SvxAdjust::Block, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@ -731,7 +731,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
sal_uInt16 nSlot = SID_ATTR_PARA_ULSPACE;
SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
SfxItemSet aEditAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE>{} );
aULSP.SetWhich( EE_PARA_ULSPACE );
aEditAttr.Put( aULSP );
@ -747,7 +747,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aLRSpace.SetWhich( EE_PARA_LRSPACE );
aEditAttr.Put( aLRSpace );
@ -837,7 +837,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
// only put lrSpace item
SfxItemSet aEditAttrReduced( GetDoc()->GetPool(),
EE_PARA_LRSPACE, EE_PARA_LRSPACE );
svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aEditAttrReduced.Put( aLRSpaceItem );
mpDrawView->SetAttributes( aEditAttrReduced );

View File

@ -835,10 +835,9 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect,
OSL_ASSERT (GetViewShell()!=nullptr);
if ( !GetViewShell()->GetUIActiveClient() )
{
SfxItemSet aSet(GetPool(), SID_CONTEXT, SID_CONTEXT,
SfxItemSet aSet(GetPool(), svl::Items<SID_CONTEXT, SID_CONTEXT,
SID_ATTR_POSITION, SID_ATTR_POSITION,
SID_ATTR_SIZE, SID_ATTR_SIZE,
0);
SID_ATTR_SIZE, SID_ATTR_SIZE>{});
GetStatusBarState(aSet);

View File

@ -1546,7 +1546,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
SdPage* pPage = GetActualPage();
if (pPage != nullptr && GetDoc() != nullptr)
{
SfxItemSet aMergedAttr(GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0);
SfxItemSet aMergedAttr(GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EditMode::MasterPage, aMergedAttr);
if (drawing::FillStyle_BITMAP == static_cast<const XFillStyleItem&>(aMergedAttr.Get(XATTR_FILLSTYLE)).GetValue())
@ -1751,7 +1751,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(pArgs->Get( XATTR_FILLGRADIENT )) );
// MigrateItemSet guarantees unique gradient names
SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), XATTR_FILLGRADIENT, XATTR_FILLGRADIENT );
SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} );
aMigrateSet.Put( aGradientItem );
SdrModel::MigrateItemSet( &aMigrateSet, pTempSet, mpDrawView->GetModel() );

View File

@ -571,7 +571,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
SfxItemSet aEditAttr( GetDoc()->GetPool() );
mpDrawView->GetAttributes( aEditAttr );
SfxItemSet aNewAttr( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
SfxItemSet aNewAttr( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aNewAttr.Put( aEditAttr, false );
std::unique_ptr<SvxNumRule> pNumRule;

View File

@ -121,8 +121,7 @@ void DrawViewShell::AssignFrom3DWindow()
if(!GetView()->IsPresObjSelected())
{
SfxItemSet aSet( GetDoc()->GetPool(),
SDRATTR_START, SDRATTR_END,
0, 0);
svl::Items<SDRATTR_START, SDRATTR_END>{});
p3DWin->GetAttr( aSet );
// own UNDO-compounding also around transformation in 3D
@ -132,7 +131,7 @@ void DrawViewShell::AssignFrom3DWindow()
{
// assign only text-attribute
SfxItemSet aTextSet( GetDoc()->GetPool(),
EE_ITEMS_START, EE_ITEMS_END, 0 );
svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aTextSet.Put( aSet, false );
GetView()->SetAttributes( aTextSet );

View File

@ -832,7 +832,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// does the selection provide a unique presentation layout?
// if not, the templates must not be edited
SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
SfxItemSet aSet(*rSet.GetPool(), svl::Items<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>{});
GetStatusBarState(aSet);
OUString aTest = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue();
if (aTest.isEmpty())
@ -1477,7 +1477,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet )
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
{
SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
SfxItemSet aSet(*rSet.GetPool(), svl::Items<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>{});
GetStatusBarState(aSet);
OUString aRealStyle = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue();
if (aRealStyle.isEmpty())

View File

@ -991,8 +991,8 @@ bool View::IsMorphingAllowed() const
( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) &&
dynamic_cast< const E3dObject *>( pObj1 ) == nullptr && dynamic_cast< const E3dObject *>( pObj2 ) == nullptr )
{
SfxItemSet aSet1( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
SfxItemSet aSet2( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
SfxItemSet aSet1( mrDoc.GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLSTYLE>{} );
SfxItemSet aSet2( mrDoc.GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLSTYLE>{} );
aSet1.Put(pObj1->GetMergedItemSet());
aSet2.Put(pObj2->GetMergedItemSet());

View File

@ -790,8 +790,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( dynamic_cast< E3dObject *>( pPickObj ) != nullptr && dynamic_cast< E3dObject *>( pObj ) != nullptr )
{
// handle 3D attribute in addition
SfxItemSet aNewSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
SfxItemSet aOldSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
SfxItemSet aNewSet( mrDoc.GetPool(), svl::Items<SID_ATTR_3D_START, SID_ATTR_3D_END>{} );
SfxItemSet aOldSet( mrDoc.GetPool(), svl::Items<SID_ATTR_3D_START, SID_ATTR_3D_END>{} );
aOldSet.Put(pPickObj->GetMergedItemSet());
aNewSet.Put( pObj->GetMergedItemSet() );

View File

@ -161,7 +161,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
EndUndo();
}
SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
SfxItemSet aSet(mpDocSh->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>{});
aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
aSet.Put(XFillBitmapItem(rGraphic));

View File

@ -406,7 +406,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
const SfxStringItem* pStringItem = rReq.GetArg<SfxStringItem>(SID_CONFIG);
SfxItemSet aSet(
GetPool(), SID_CONFIG, SID_CONFIG );
GetPool(), svl::Items<SID_CONFIG, SID_CONFIG>{} );
if ( pStringItem )
{
@ -1597,7 +1597,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
if ( pFact )
{
SfxItemSet aSet(GetPool(), SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG);
SfxItemSet aSet(GetPool(), svl::Items<SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG>{});
const SfxPoolItem* pItem=nullptr;
const SfxItemSet* pSet = rReq.GetArgs();
SfxItemPool* pSetPool = pSet ? pSet->GetPool() : nullptr;

View File

@ -1043,7 +1043,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
{
// The value is attached to a toggleable attribute (Bools)
sal_uInt16 nWhich = pSlot->GetWhich(rPool);
SfxItemSet aSet(rPool, nWhich, nWhich);
SfxItemSet aSet(rPool, {{nWhich, nWhich}});
SfxStateFunc aFunc = pSlot->GetStateFnc();
pShell->CallState( aFunc, aSet );
const SfxPoolItem *pOldItem;

View File

@ -382,7 +382,7 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
// Get Slot status
SfxItemPool &rPool = GetPool();
const sal_uInt16 nId = rSlot.GetWhich( rPool );
SfxItemSet aSet(rPool, nId, nId);
SfxItemSet aSet(rPool, {{nId, nId}});
SfxStateFunc pFunc = rSlot.GetStateFnc();
CallState( pFunc, aSet );
return aSet.GetItemState(nId) != SfxItemState::DISABLED;
@ -454,7 +454,7 @@ const SfxPoolItem* SfxShell::GetSlotState
// Get Item and Item status
const SfxPoolItem *pItem = nullptr;
SfxItemSet aSet( rPool, nSlotId, nSlotId ); // else pItem dies too soon
SfxItemSet aSet( rPool, {{nSlotId, nSlotId}} ); // else pItem dies too soon
if ( pSlot )
{
// Call Status method

Some files were not shown because too many files have changed in this diff Show More