tdf#164685 Cleanup SfxItemSetFixed - Part 3

This is the continuation of the cleanup of class SfxItemSetFixed, as described in the bug ticket.

Change-Id: I567f985af181d326a6adb6c3d3af2a9e2fa8df34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180975
Tested-by: Jenkins
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
This commit is contained in:
rafaelhlima
2025-02-11 01:19:10 +01:00
committed by Rafael Lima
parent 089e8d0ae1
commit e2c08c31cf
25 changed files with 119 additions and 134 deletions
+1 -1
View File
@@ -812,7 +812,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
void EditDoc::CreateDefFont( bool bUseStyles )
{
SfxItemSetFixed<EE_PARA_START, EE_CHAR_END> aTmpSet( GetItemPool() );
SfxItemSet aTmpSet(SfxItemSet::makeFixedSfxItemSet<EE_PARA_START, EE_CHAR_END>(GetItemPool()));
CreateFont(maDefFont, aTmpSet);
maDefFont.SetVertical( IsEffectivelyVertical() );
maDefFont.SetOrientation( Degree10(IsEffectivelyVertical() ? (IsTopToBottom() ? 2700 : 900) : 0) );
+5 -7
View File
@@ -114,13 +114,11 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
{
if (!mpPrinter && bCreateIfNotExist && mxPoolHelper)
{
auto pSet =
std::make_unique<SfxItemSetFixed
<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS>>(*mxPoolHelper->GetDocPool());
auto pSet = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS>(*mxPoolHelper->GetDocPool()));
SfxPrinterChangeFlags nFlags = SfxPrinterChangeFlags::NONE;
if (officecfg::Office::Common::Print::Warning::PaperOrientation::get())
nFlags |= SfxPrinterChangeFlags::CHG_ORIENTATION;
+2 -3
View File
@@ -64,9 +64,8 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
SfxItemSet& rOutSet )
{
SfxItemPool* pArgPool = rArgs.GetPool();
SfxItemSetFixed<
EE_ITEMS_START, EE_ITEMS_END,
SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_WIDOWS> aNewAttr(*pArgPool);
SfxItemSet aNewAttr(SfxItemSet::makeFixedSfxItemSet<EE_ITEMS_START, EE_ITEMS_END,
SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_WIDOWS>(*pArgPool));
aNewAttr.Put( rArgs );
// Values have been taken over once to show the dialog.
+1 -1
View File
@@ -3644,7 +3644,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
ScopedVclPtr<SfxAbstractTabDialog> pDlg;
ScSubTotalParam aSubTotalParam;
SfxItemSetFixed<SCITEM_SUBTDATA, SCITEM_SUBTDATA> aArgSet( GetPool() );
SfxItemSet aArgSet(SfxItemSet::makeFixedSfxItemSet<SCITEM_SUBTDATA, SCITEM_SUBTDATA>(GetPool()));
bool bAnonymous;
+1 -2
View File
@@ -476,9 +476,8 @@ void ScCellShell::Execute( SfxRequest& rReq )
{
// set cell attribute without dialog:
SfxItemSet aEmptySet(SfxItemSet::makeFixedSfxItemSet<ATTR_PATTERN_START, ATTR_PATTERN_END>(*pReqArgs->GetPool()));
// SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aEmptySet( *pReqArgs->GetPool() );
SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aNewSet( *pReqArgs->GetPool() );
SfxItemSet aNewSet(SfxItemSet::makeFixedSfxItemSet<ATTR_PATTERN_START, ATTR_PATTERN_END>(*pReqArgs->GetPool()));
const SfxPoolItem* pAttr = nullptr;
sal_uInt16 nWhich = 0;
+1 -1
View File
@@ -206,7 +206,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent&
nSrcTab = pDesc->GetSourceRange().aStart.Tab();
}
SfxItemSetFixed<SCITEM_QUERYDATA, SCITEM_QUERYDATA> aArgSet( mrViewData.GetViewShell()->GetPool() );
SfxItemSet aArgSet(SfxItemSet::makeFixedSfxItemSet<SCITEM_QUERYDATA, SCITEM_QUERYDATA>(mrViewData.GetViewShell()->GetPool()));
aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, &mrViewData, &aQueryParam ) );
ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
+1 -1
View File
@@ -625,7 +625,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
}
else
{
SfxItemSetFixed<SID_ATTR_ZOOM, SID_ATTR_ZOOM> aSet( GetPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SID_ATTR_ZOOM, SID_ATTR_ZOOM>(GetPool()));
SvxZoomItem aZoomItem( SvxZoomType::PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
aSet.Put( aZoomItem );
+2 -2
View File
@@ -539,7 +539,7 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
{
// FitToSize (fit to frame)
SfxItemSetFixed<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH> aSet(mpViewShell->GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>(mpViewShell->GetPool()));
aSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_PROPORTIONAL));
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
aSet.Put(makeSdrTextAutoGrowWidthItem(false));
@@ -549,7 +549,7 @@ void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
{
SfxItemSetFixed<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH> aSet(mpViewShell->GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>(mpViewShell->GetPool()));
aSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_PROPORTIONAL));
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
aSet.Put(makeSdrTextAutoGrowWidthItem(false));
@@ -56,7 +56,7 @@ namespace sdr::properties
GetObjectItemSet();
// add filtered scene properties (SDRATTR_3DSCENE_) to local itemset
SfxItemSetFixed<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST> aSet(*moItemSet->GetPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>(*moItemSet->GetPool()));
aSet.Put(pScene->GetProperties().GetObjectItemSet());
moItemSet->Put(aSet);
}
@@ -77,7 +77,7 @@ namespace sdr::properties
GetObjectItemSet();
// Generate filtered scene properties (SDRATTR_3DSCENE_) itemset
SfxItemSetFixed<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST> aSet(*moItemSet->GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_3DSCENE_FIRST, SDRATTR_3DSCENE_LAST>(*moItemSet->GetPool()));
aSet.Put(rSet);
if(bClearAllItems)
+7 -7
View File
@@ -520,9 +520,9 @@ void SdrTextObj::AdaptTextMinSize()
// No auto grow requested. Bail out.
return;
SfxItemSetFixed<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT,
SDRATTR_TEXT_MINFRAMEWIDTH, SDRATTR_TEXT_AUTOGROWWIDTH> // contains SDRATTR_TEXT_MAXFRAMEWIDTH
aSet(*GetObjectItemSet().GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT,
// contains SDRATTR_TEXT_MAXFRAMEWIDTH
SDRATTR_TEXT_MINFRAMEWIDTH, SDRATTR_TEXT_AUTOGROWWIDTH>(*GetObjectItemSet().GetPool()));
if(bW)
{
@@ -1507,10 +1507,10 @@ void SdrTextObj::SetVerticalWriting(bool bVertical)
tools::Rectangle aObjectRect = GetSnapRect();
// prepare ItemSet to set exchanged width and height items
SfxItemSetFixed<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT,
// Expanded item ranges to also support hor and ver adjust.
SDRATTR_TEXT_VERTADJUST, SDRATTR_TEXT_VERTADJUST,
SDRATTR_TEXT_AUTOGROWWIDTH, SDRATTR_TEXT_HORZADJUST> aNewSet(*rSet.GetPool());
SfxItemSet aNewSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT,
// Expanded item ranges to also support hor and ver adjust.
SDRATTR_TEXT_VERTADJUST, SDRATTR_TEXT_VERTADJUST,
SDRATTR_TEXT_AUTOGROWWIDTH, SDRATTR_TEXT_HORZADJUST>(*rSet.GetPool()));
aNewSet.Put(rSet);
aNewSet.Put(makeSdrTextAutoGrowWidthItem(bAutoGrowHeight));
+8 -7
View File
@@ -101,12 +101,12 @@ ImpSdrPdfImport::ImpSdrPdfImport(SdrModel& rModel, SdrLayerID nLay, const tools:
mpVD->SetLineColor();
mpVD->SetFillColor();
maOldLineColor.SetRed(mpVD->GetLineColor().GetRed() + 1);
mpLineAttr = std::make_unique<SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>>(
rModel.GetItemPool());
mpFillAttr = std::make_unique<SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>>(
rModel.GetItemPool());
mpTextAttr
= std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(rModel.GetItemPool());
mpLineAttr = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<XATTR_LINE_FIRST, XATTR_LINE_LAST>(rModel.GetItemPool()));
mpFillAttr = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<XATTR_FILL_FIRST, XATTR_FILL_LAST>(rModel.GetItemPool()));
mpTextAttr = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<EE_ITEMS_START, EE_ITEMS_END>(rModel.GetItemPool()));
checkClip();
@@ -819,7 +819,8 @@ void ImpSdrPdfImport::InsertTextObject(const Point& rPos, const Size& rSize, con
if (!aFont.IsTransparent())
{
SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aAttr(*mpFillAttr->GetPool());
SfxItemSet aAttr(SfxItemSet::makeFixedSfxItemSet<XATTR_FILL_FIRST, XATTR_FILL_LAST>(
*mpFillAttr->GetPool()));
aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID));
aAttr.Put(XFillColorItem(OUString(), aFont.GetFillColor()));
pText->SetMergedItemSet(aAttr);
+1 -1
View File
@@ -2755,7 +2755,7 @@ void SvxTableController::SetAttrToSelectedShape(const SfxItemSet& rAttr)
return;
// Filter out non-shadow items from rAttr.
SfxItemSetFixed<SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST> aSet(*rAttr.GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST>(*rAttr.GetPool()));
aSet.Put(rAttr);
if (!aSet.Count())
+4 -4
View File
@@ -3088,8 +3088,8 @@ XLineAttrSetItem::XLineAttrSetItem( SfxItemSet&& pItemSet ) :
}
XLineAttrSetItem::XLineAttrSetItem( SfxItemPool* pItemPool ) :
SfxSetItem( XATTRSET_LINE,
SfxItemSetFixed<XATTR_LINE_FIRST, XATTR_LINE_LAST>( *pItemPool ))
SfxSetItem(XATTRSET_LINE,
SfxItemSet::makeFixedSfxItemSet<XATTR_LINE_FIRST, XATTR_LINE_LAST>(*pItemPool))
{
}
@@ -3116,8 +3116,8 @@ XFillAttrSetItem::XFillAttrSetItem( SfxItemSet&& pItemSet ) :
}
XFillAttrSetItem::XFillAttrSetItem( SfxItemPool* pItemPool ) :
SfxSetItem( XATTRSET_FILL,
SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST>( *pItemPool ))
SfxSetItem(XATTRSET_FILL,
SfxItemSet::makeFixedSfxItemSet<XATTR_FILL_FIRST, XATTR_FILL_LAST>(*pItemPool))
{
}
+2 -1
View File
@@ -234,7 +234,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreTxtnodeTest, testSplitNodeSuperscriptCopy)
SwWrtShell* pWrtShell = getSwDocShell()->GetWrtShell();
pWrtShell->Insert(u"1st"_ustr);
pWrtShell->Left(SwCursorSkipMode::Chars, /*bSelect=*/true, 2, /*bBasicCall=*/false);
SfxItemSetFixed<RES_CHRATR_ESCAPEMENT, RES_CHRATR_ESCAPEMENT> aSet(pWrtShell->GetAttrPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_ESCAPEMENT, RES_CHRATR_ESCAPEMENT>(
pWrtShell->GetAttrPool()));
SvxEscapementItem aItem(SvxEscapement::Superscript, RES_CHRATR_ESCAPEMENT);
aSet.Put(aItem);
pWrtShell->SetAttrSet(aSet);
+4 -2
View File
@@ -108,7 +108,8 @@ CPPUNIT_TEST_FIXTURE(Test, testTickCheckboxContentControl)
// The default Liberation Serif doesn't have a checkmark glyph, avoid font fallback.
SwView& rView = pWrtShell->GetView();
SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aSet(rView.GetPool());
SfxItemSet aSet(
SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_CHRATR_END>(rView.GetPool()));
SvxFontItem aFont(FAMILY_DONTKNOW, u"DejaVu Sans"_ustr, OUString(), PITCH_DONTKNOW,
RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT);
aSet.Put(aFont);
@@ -172,7 +173,8 @@ CPPUNIT_TEST_FIXTURE(Test, testInsertCheckboxContentControl)
// The default Liberation Serif doesn't have a checkmark glyph, avoid font fallback.
SwView& rView = pWrtShell->GetView();
SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aSet(rView.GetPool());
SfxItemSet aSet(
SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_CHRATR_END>(rView.GetPool()));
SvxFontItem aFont(FAMILY_DONTKNOW, u"DejaVu Sans"_ustr, OUString(), PITCH_DONTKNOW,
RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT);
aSet.Put(aFont);
@@ -1299,8 +1299,8 @@ namespace //local functions originally from docfmt.cxx
if (!xExtra)
{
// Apply the first character's attributes to the ReplaceText
SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> aSet( rDoc.GetAttrPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>(rDoc.GetAttrPool()));
SwTextNode * pNode = rRg.Start()->GetNode().GetTextNode();
pNode->GetParaAttr( aSet, rRg.Start()->GetContentIndex() + 1, rRg.End()->GetContentIndex() );
@@ -1450,18 +1450,15 @@ namespace //local functions originally from docfmt.cxx
// - The attribute in rChgSet does not belong to one of the above categories
if ( !bCharAttr && !bOtherAttr )
{
SfxItemSet* pTmpCharItemSet = new SfxItemSetFixed<
RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
RES_TXTATR_AUTOFMT, RES_TXTATR_CHARFMT,
RES_TXTATR_UNKNOWN_CONTAINER,
RES_TXTATR_UNKNOWN_CONTAINER>( rDoc.GetAttrPool() );
SfxItemSet* pTmpOtherItemSet = new SfxItemSetFixed<
RES_PARATR_BEGIN, RES_GRFATR_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1,
// FillAttribute support:
XATTR_FILL_FIRST, XATTR_FILL_LAST>( rDoc.GetAttrPool() );
SfxItemSet* pTmpCharItemSet = new SfxItemSet(
rDoc.GetAttrPool(), WhichRangesContainer(svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
RES_TXTATR_AUTOFMT, RES_TXTATR_CHARFMT,
RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER>));
SfxItemSet* pTmpOtherItemSet = new SfxItemSet(
rDoc.GetAttrPool(), WhichRangesContainer(svl::Items<RES_PARATR_BEGIN, RES_GRFATR_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1,
// FillAttribute support:
XATTR_FILL_FIRST, XATTR_FILL_LAST>));
pTmpCharItemSet->Put( rChgSet );
pTmpOtherItemSet->Put( rChgSet );
@@ -1546,8 +1543,7 @@ namespace //local functions originally from docfmt.cxx
// Attributes without an end do not have a range
if ( !bCharAttr && !bOtherAttr )
{
SfxItemSetFixed<RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1>
aTextSet( rDoc.GetAttrPool() );
SfxItemSet aTextSet(SfxItemSet::makeFixedSfxItemSet<RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1>(rDoc.GetAttrPool()));
aTextSet.Put( rChgSet );
if( aTextSet.Count() )
{
@@ -1577,11 +1573,9 @@ namespace //local functions originally from docfmt.cxx
{
// CharFormat and URL attributes are treated separately!
// TEST_TEMP ToDo: AutoFormat!
SfxItemSetFixed<
RES_TXTATR_REFMARK, RES_TXTATR_METAFIELD,
RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
RES_TXTATR_INPUTFIELD, RES_TXTATR_CONTENTCONTROL>
aTextSet(rDoc.GetAttrPool());
SfxItemSet aTextSet(SfxItemSet::makeFixedSfxItemSet<RES_TXTATR_REFMARK, RES_TXTATR_METAFIELD,
RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY,
RES_TXTATR_INPUTFIELD, RES_TXTATR_CONTENTCONTROL>(rDoc.GetAttrPool()));
aTextSet.Put( rChgSet );
if( aTextSet.Count() )
@@ -1711,15 +1705,14 @@ namespace //local functions originally from docfmt.cxx
}
}
SfxItemSetFixed<RES_PAGEDESC, RES_BREAK> firstSet(rDoc.GetAttrPool());
SfxItemSet firstSet(SfxItemSet::makeFixedSfxItemSet<RES_PAGEDESC, RES_BREAK>(rDoc.GetAttrPool()));
if (pOtherSet && pOtherSet->Count())
{ // actually only RES_BREAK is possible here...
firstSet.Put(*pOtherSet);
}
SfxItemSetFixed
<RES_PARATR_BEGIN, RES_PAGEDESC,
RES_BREAK+1, RES_FRMATR_END,
XATTR_FILL_FIRST, XATTR_FILL_LAST+1> propsSet(rDoc.GetAttrPool());
SfxItemSet propsSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_BEGIN, RES_PAGEDESC,
RES_BREAK+1, RES_FRMATR_END,
XATTR_FILL_FIRST, XATTR_FILL_LAST+1> (rDoc.GetAttrPool()));
if (pOtherSet && pOtherSet->Count())
{
propsSet.Put(*pOtherSet);
@@ -4239,10 +4232,11 @@ void DocumentContentOperationsManager::CopyFlyInFlyImpl(
*/
std::shared_ptr<SfxItemSet> DocumentContentOperationsManager::lcl_createDelSet(SwDoc& rDoc)
{
std::shared_ptr<SfxItemSet> pDelSet(new SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
RES_TXTATR_INETFMT, RES_TXTATR_UNKNOWN_CONTAINER,
RES_PARATR_BEGIN, RES_FRMATR_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>(rDoc.GetAttrPool()));
std::shared_ptr<SfxItemSet> pDelSet(new SfxItemSet(
rDoc.GetAttrPool(), WhichRangesContainer(svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1,
RES_TXTATR_INETFMT, RES_TXTATR_UNKNOWN_CONTAINER,
RES_PARATR_BEGIN, RES_FRMATR_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>)));
o3tl::sorted_vector<sal_uInt16> aAttribs;
static constexpr std::pair<sal_uInt16, sal_uInt16> aResetableSetRange[] = {
@@ -4766,9 +4760,8 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt
if( !sRepl.isEmpty() )
{
// Apply the first character's attributes to the ReplaceText
SfxItemSetFixed
<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> aSet( m_rDoc.GetAttrPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1,
RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>(m_rDoc.GetAttrPool()));
pTextNd->GetParaAttr( aSet, nStt+1, nStt+1 );
aSet.ClearItem( RES_TXTATR_REFMARK );
+6 -6
View File
@@ -2017,8 +2017,8 @@ bool SwFEShell::ImpEndCreate()
}
}
SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE,
RES_SURROUND, RES_ANCHOR> aSet( GetDoc()->GetAttrPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_FRM_SIZE, RES_FRM_SIZE,
RES_SURROUND, RES_ANCHOR>(GetDoc()->GetAttrPool()));
aSet.Put( aAnch );
// OD 2004-03-30 #i26791# - determine relative object position
@@ -2091,7 +2091,7 @@ bool SwFEShell::ImpEndCreate()
::GetHtmlMode( GetDoc()->GetDocShell() ) &&
nullptr != ( pFlyFrame = GetSelectedFlyFrame() ))
{
SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT> aHtmlSet( GetDoc()->GetAttrPool() );
SfxItemSet aHtmlSet(SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_HORI_ORIENT>(GetDoc()->GetAttrPool()));
// horizontal orientation:
const bool bLeftFrame = aFlyRect.Left() <
pAnch->getFrameArea().Left() + pAnch->getFramePrintArea().Left(),
@@ -2841,8 +2841,8 @@ void SwFEShell::CheckUnboundObjects()
// First the action here, to assure GetCharRect delivers current values.
StartAllAction();
SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE,
RES_SURROUND, RES_ANCHOR> aSet( GetAttrPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_FRM_SIZE, RES_FRM_SIZE,
RES_SURROUND, RES_ANCHOR>(GetAttrPool()));
aSet.Put( aAnch );
aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ) );
SwFrameFormat* pFormat = getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet );
@@ -3203,7 +3203,7 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect
if(bMarquee)
{
SfxItemSetFixed<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST> aSet(rDrawModel.GetItemPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>(rDrawModel.GetItemPool()));
aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
aSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) );
+1 -1
View File
@@ -814,7 +814,7 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrame* _pNewAnchorFram
SwFormatHoriOrient hori(nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME);
SwFormatVertOrient vert(nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME);
SwFrameFormat* pObjFormat = GetFrameFormat();
SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT> items(pObjFormat->GetDoc()->GetAttrPool());
SfxItemSet items(SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_HORI_ORIENT>(pObjFormat->GetDoc()->GetAttrPool()));
items.Put(hori);
items.Put(vert);
pObjFormat->GetDoc()->SetAttr(items, *pObjFormat);
+15 -18
View File
@@ -2243,7 +2243,7 @@ void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext)
SwFrameFormat* pBoxFormat = pBox->ClaimFrameFormat();
if( m_bNewFormat || m_bNewFormula || m_bNewValue )
{
SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxSet( rDoc.GetAttrPool() );
SfxItemSet aBoxSet(SfxItemSet::makeFixedSfxItemSet<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(rDoc.GetAttrPool()));
// Resetting attributes is not enough. In addition, take care that the
// text will be also formatted correctly.
@@ -2271,7 +2271,7 @@ void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext)
}
else if( getSwDefaultTextFormat() != m_nFormatIdx )
{
SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxSet( rDoc.GetAttrPool() );
SfxItemSet aBoxSet(SfxItemSet::makeFixedSfxItemSet<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(rDoc.GetAttrPool()));
aBoxSet.Put( SwTableBoxNumFormat( m_nFormatIdx ));
aBoxSet.Put( SwTableBoxValue( m_fNum ));
@@ -2468,10 +2468,8 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext)
aInsIdx = rBox.GetSttIdx() + 1;
rDoc.GetNodes().Delete( aInsIdx );
SfxItemSetFixed<
RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>
aTmpSet(rDoc.GetAttrPool());
SfxItemSet aTmpSet(SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(rDoc.GetAttrPool()));
aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() );
if( aTmpSet.Count() )
{
@@ -2488,9 +2486,9 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext)
if( aTmpSet.Count() )
{
pEntry->pBoxNumAttr = std::make_unique<SfxItemSetFixed<
RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>>(rDoc.GetAttrPool());
pEntry->pBoxNumAttr = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(rDoc.GetAttrPool()));
pEntry->pBoxNumAttr->Put( aTmpSet );
}
@@ -2563,9 +2561,8 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext)
aInsIdx = rBox.GetSttIdx() + 1;
rDoc.GetNodes().Delete( aInsIdx );
SfxItemSetFixed<
RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aTmpSet(rDoc.GetAttrPool());
SfxItemSet aTmpSet(SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(rDoc.GetAttrPool()));
aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() );
if( aTmpSet.Count() )
{
@@ -2581,9 +2578,9 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext)
if( aTmpSet.Count() )
{
pEntry->pBoxNumAttr = std::make_unique<SfxItemSetFixed<
RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>>(rDoc.GetAttrPool());
pEntry->pBoxNumAttr = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(rDoc.GetAttrPool()));
pEntry->pBoxNumAttr->Put( aTmpSet );
}
@@ -2618,9 +2615,9 @@ void SwUndoTableCpyTable::AddBoxBefore( const SwTableBox& rBox, bool bDelContent
}
}
pEntry->pBoxNumAttr = std::make_unique<SfxItemSetFixed<
RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>>(pDoc->GetAttrPool());
pEntry->pBoxNumAttr = std::make_unique<SfxItemSet>(
SfxItemSet::makeFixedSfxItemSet<RES_VERT_ORIENT, RES_VERT_ORIENT,
RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(pDoc->GetAttrPool()));
pEntry->pBoxNumAttr->Put( rBox.GetFrameFormat()->GetAttrSet() );
if( !pEntry->pBoxNumAttr->Count() )
{
+4 -5
View File
@@ -339,11 +339,10 @@ static SwHTMLWriter& OutHTML_SwField( SwHTMLWriter& rWrt, const SwField* pField,
{
//sequence of (start, end) property ranges we want to
//query
SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT,
RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT>
aScriptItemSet( rWrt.m_pDoc->GetAttrPool() );
SfxItemSet aScriptItemSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONTSIZE,
RES_CHRATR_POSTURE, RES_CHRATR_POSTURE,
RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT,
RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT>(rWrt.m_pDoc->GetAttrPool()));
rTextNd.GetParaAttr(aScriptItemSet, nFieldPos, nFieldPos+1);
sal_uInt16 aWesternWhichIds[4] =
+1 -1
View File
@@ -1021,7 +1021,7 @@ SwHTMLWriter& OutHTML_DrawFrameFormatAsControl( SwHTMLWriter& rWrt,
bool bEdit = TAG_TEXTAREA == eTag || TYPE_FILE == eType ||
TYPE_TEXT == eType;
SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aItemSet( rWrt.m_pDoc->GetAttrPool() );
SfxItemSet aItemSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_CHRATR_END>(rWrt.m_pDoc->GetAttrPool()));
if( xPropSetInfo->hasPropertyByName( u"BackgroundColor"_ustr ) )
{
aTmp = xPropSet->getPropertyValue( u"BackgroundColor"_ustr );
+1 -1
View File
@@ -9319,7 +9319,7 @@ void DocxAttributeOutput::FormatTextLeftMargin(SvxTextLeftMarginItem const& rTex
// so try to add them as paragraph properties here.
if (!pTextNd->IsCountedInList())
{
SfxItemSetFixed<RES_MARGIN_TEXTLEFT, RES_MARGIN_TEXTLEFT> temp(m_rExport.m_rDoc.GetAttrPool());
SfxItemSet temp(SfxItemSet::makeFixedSfxItemSet<RES_MARGIN_TEXTLEFT, RES_MARGIN_TEXTLEFT>(m_rExport.m_rDoc.GetAttrPool()));
pTextNd->GetParaAttr(temp, 0, 0, false, true, true, nullptr);
if (auto *const pItem = temp.GetItem(RES_MARGIN_TEXTLEFT))
{
+1 -1
View File
@@ -1932,7 +1932,7 @@ void DocxExport::WriteDocumentBackgroundFill()
}
else if (eFillType == drawing::FillStyle_GRADIENT)
{
SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet(m_rDoc.GetAttrPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<XATTR_FILL_FIRST, XATTR_FILL_LAST>(m_rDoc.GetAttrPool()));
aSet.Set(rPageStyleAttrSet);
// Collect all of the gradient attributes into SdrExporter() AttrLists
+7 -8
View File
@@ -180,14 +180,13 @@ void SwTextShell::ExecIdx(SfxRequest const &rReq)
}
case FN_INSERT_MULTI_TOX:
{
SfxItemSetFixed<
RES_FRM_SIZE, RES_FRM_SIZE,
RES_LR_SPACE, RES_LR_SPACE,
RES_BACKGROUND, RES_BACKGROUND,
RES_COL, RES_COL,
XATTR_FILL_FIRST, XATTR_FILL_LAST,
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE> aSet( GetPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_FRM_SIZE, RES_FRM_SIZE,
RES_LR_SPACE, RES_LR_SPACE,
RES_BACKGROUND, RES_BACKGROUND,
RES_COL, RES_COL,
XATTR_FILL_FIRST, XATTR_FILL_LAST,
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE>(GetPool()));
SwWrtShell& rSh = GetShell();
SwRect aRect;
rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR);
+15 -18
View File
@@ -74,7 +74,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq)
Get( nWhich )).GetValue() ? STATE_ON : STATE_OFF;
}
SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END-1> aSet( GetPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_CHRATR_END-1>(GetPool()));
if (STATE_TOGGLE == eState)
rSh.GetCurAttr( aSet );
@@ -324,11 +324,9 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq)
const SfxItemSet* pArgs = rReq.GetArgs();
// Get both attributes immediately isn't more expensive!!
SfxItemSetFixed
<RES_PARATR_LINESPACING, RES_PARATR_ADJUST,
RES_PARATR_HYPHENZONE, RES_PARATR_HYPHENZONE,
RES_FRAMEDIR, RES_FRAMEDIR> aSet( GetPool() );
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_LINESPACING, RES_PARATR_ADJUST,
RES_PARATR_HYPHENZONE, RES_PARATR_HYPHENZONE,
RES_FRAMEDIR, RES_FRAMEDIR>(GetPool()));
sal_uInt16 nSlot = rReq.GetSlot();
switch (nSlot)
{
@@ -388,7 +386,7 @@ SET_LINESPACE:
case SID_ATTR_PARA_LEFT_TO_RIGHT :
case SID_ATTR_PARA_RIGHT_TO_LEFT :
{
SfxItemSetFixed<RES_PARATR_ADJUST, RES_PARATR_ADJUST> aAdjustSet( GetPool() );
SfxItemSet aAdjustSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_ADJUST, RES_PARATR_ADJUST>(GetPool()));
GetShell().GetCurAttr(aAdjustSet);
bool bChgAdjust = false;
SfxItemState eAdjustState = aAdjustSet.GetItemState(RES_PARATR_ADJUST, false);
@@ -444,7 +442,7 @@ SET_LINESPACE:
break;
case SID_ATTR_PARA_HYPHENZONE:
{
SfxItemSetFixed<RES_PARATR_HYPHENZONE, RES_PARATR_HYPHENZONE> aHyphSet( GetPool() );
SfxItemSet aHyphSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_HYPHENZONE, RES_PARATR_HYPHENZONE>(GetPool()));
GetShell().GetCurAttr(aHyphSet);
SfxItemState eState = aHyphSet.GetItemState(RES_PARATR_HYPHENZONE, false);
if ( eState >= SfxItemState::DEFAULT )
@@ -485,7 +483,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
if( pItem )
{
OUString sCharStyleName = static_cast<const SfxStringItem*>(pItem)->GetValue();
SfxItemSetFixed<RES_PARATR_DROP, RES_PARATR_DROP> aSet(GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_DROP, RES_PARATR_DROP>(GetPool()));
rSh.GetCurAttr(aSet);
SwFormatDrop aDropItem(aSet.Get(RES_PARATR_DROP));
SwCharFormat* pFormat = nullptr;
@@ -505,8 +503,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
}
else
{
SfxItemSetFixed<RES_PARATR_DROP, RES_PARATR_DROP,
HINT_END, HINT_END> aSet(GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_DROP, RES_PARATR_DROP,
HINT_END, HINT_END>(GetPool()));
rSh.GetCurAttr(aSet);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSwDropCapsDialog(GetView().GetFrameWeld(), aSet));
@@ -538,8 +536,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq)
{
if(pItem)
{
SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC,
SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL> aCoreSet( GetPool() );
SfxItemSet aCoreSet(SfxItemSet::makeFixedSfxItemSet<RES_PAGEDESC, RES_PAGEDESC,
SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL>(GetPool()));
aCoreSet.Put(*pItem);
SfxToSwPageDescAttr( rSh, aCoreSet);
rSh.SetAttrSet(aCoreSet);
@@ -832,9 +830,8 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
break;
case SID_ATTR_PARA_MODEL:
{
SfxItemSetFixed
<RES_PAGEDESC,RES_PAGEDESC,
SID_ATTR_PARA_MODEL,SID_ATTR_PARA_MODEL> aTemp(GetPool());
SfxItemSet aTemp(SfxItemSet::makeFixedSfxItemSet<RES_PAGEDESC, RES_PAGEDESC,
SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL>(GetPool()));
aTemp.Put(aCoreSet);
::SwToSfxPageDescAttr(aTemp);
rSet.Put(aTemp.Get(SID_ATTR_PARA_MODEL));
@@ -843,7 +840,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
break;
case RES_TXTATR_INETFMT:
{
SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>(GetPool()));
rSh.GetCurAttr(aSet);
const SfxPoolItem& rItem = aSet.Get(RES_TXTATR_INETFMT);
rSet.Put(rItem);
@@ -852,7 +849,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet)
break;
case FN_NO_BREAK:
{
SfxItemSetFixed<RES_CHRATR_NOHYPHEN, RES_CHRATR_NOHYPHEN> aSet(GetPool());
SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_NOHYPHEN, RES_CHRATR_NOHYPHEN>(GetPool()));
rSh.GetCurAttr(aSet);
const SfxPoolItem& rItem = aSet.Get(RES_CHRATR_NOHYPHEN);