summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx8
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.cxx2
-rw-r--r--include/svx/svdmodel.hxx2
-rw-r--r--include/svx/xbtmpit.hxx2
-rw-r--r--include/svx/xflftrit.hxx2
-rw-r--r--include/svx/xflgrit.hxx2
-rw-r--r--include/svx/xflhtit.hxx2
-rw-r--r--include/svx/xlndsit.hxx2
-rw-r--r--include/svx/xlnedit.hxx2
-rw-r--r--include/svx/xlnstit.hxx2
-rw-r--r--sc/source/core/data/drwlayer.cxx2
-rw-r--r--sc/source/ui/view/tabvwsha.cxx2
-rw-r--r--sd/source/ui/dlg/unchss.cxx8
-rw-r--r--sd/source/ui/func/fupage.cxx6
-rw-r--r--sd/source/ui/func/futempl.cxx14
-rw-r--r--sd/source/ui/view/drviews7.cxx4
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx15
-rw-r--r--svx/source/svdraw/svdmodel.cxx17
-rw-r--r--svx/source/xoutdev/xattr.cxx600
-rw-r--r--svx/source/xoutdev/xattrbmp.cxx27
-rw-r--r--sw/source/core/doc/docfly.cxx14
-rw-r--r--sw/source/uibase/shells/textsh1.cxx4
22 files changed, 358 insertions, 381 deletions
diff --git a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
index b67872d3d0e3..0ca5be652a84 100644
--- a/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/GraphicPropertyItemConverter.cxx
@@ -295,7 +295,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XLineDashItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XLineDashItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put( std::move(pItemToPut) );
@@ -321,7 +321,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XFillGradientItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XFillGradientItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put(std::move(pItemToPut) );
@@ -347,7 +347,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XFillHatchItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XFillHatchItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put( std::move(pItemToPut) );
@@ -368,7 +368,7 @@ void GraphicPropertyItemConverter::FillSpecialItem(
// translate model name to UI-name for predefined entries, so
// that the correct entry is chosen in the list of UI-names
- std::unique_ptr<XFillBitmapItem> pItemToPut = aItem.checkForUniqueItem( & m_rDrawModel );
+ std::unique_ptr<XFillBitmapItem> pItemToPut = aItem.checkForUniqueItem( m_rDrawModel );
if(pItemToPut)
rOutItemSet.Put( std::move(pItemToPut) );
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index 189ed77fd762..967bc20a0d91 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -473,7 +473,7 @@ void ChartAreaPanel::updateData()
DrawModelWrapper* pModelWrapper = getDrawModelWrapper(mxModel);
if (pModelWrapper)
{
- pBitmapItem = aBitmapItem.checkForUniqueItem(&pModelWrapper->getSdrModel());
+ pBitmapItem = aBitmapItem.checkForUniqueItem(pModelWrapper->getSdrModel());
}
}
catch (...)
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 5f0175b57d7e..ffd89a7dfda2 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -597,7 +597,7 @@ public:
/** copies the items from the source set to the destination set. Both sets must have
same ranges but can have different pools. */
- static void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModel );
+ static void MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel& rNewModel );
bool IsInDestruction() const { return mbInDestruction;}
diff --git a/include/svx/xbtmpit.hxx b/include/svx/xbtmpit.hxx
index 6d7d75f3de7c..88a7df1a807f 100644
--- a/include/svx/xbtmpit.hxx
+++ b/include/svx/xbtmpit.hxx
@@ -55,7 +55,7 @@ public:
bool isPattern() const;
static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
- std::unique_ptr<XFillBitmapItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XFillBitmapItem> checkForUniqueItem( SdrModel& rModel ) const;
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
};
diff --git a/include/svx/xflftrit.hxx b/include/svx/xflftrit.hxx
index 9b13616916ec..f7909b14586a 100644
--- a/include/svx/xflftrit.hxx
+++ b/include/svx/xflftrit.hxx
@@ -53,7 +53,7 @@ public:
void SetEnabled( bool bEnable ) { bEnabled = bEnable; }
static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
- std::unique_ptr<XFillFloatTransparenceItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XFillFloatTransparenceItem> checkForUniqueItem( SdrModel& rModel ) const;
virtual boost::property_tree::ptree dumpAsJSON() const override;
};
diff --git a/include/svx/xflgrit.hxx b/include/svx/xflgrit.hxx
index 97c0b072352c..e988544a275b 100644
--- a/include/svx/xflgrit.hxx
+++ b/include/svx/xflgrit.hxx
@@ -53,7 +53,7 @@ public:
void SetGradientValue(const basegfx::BGradient& rNew) { m_aGradient = rNew; Detach(); } // SetValue -> SetGradientValue
static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
- std::unique_ptr<XFillGradientItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XFillGradientItem> checkForUniqueItem( SdrModel& rModel ) const;
virtual boost::property_tree::ptree dumpAsJSON() const override;
};
diff --git a/include/svx/xflhtit.hxx b/include/svx/xflhtit.hxx
index 92ce362fc0fa..dd3bbff21193 100644
--- a/include/svx/xflhtit.hxx
+++ b/include/svx/xflhtit.hxx
@@ -55,7 +55,7 @@ public:
const XHatch& GetHatchValue() const { return m_aHatch;} // GetValue -> GetHatchValue
static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
- std::unique_ptr<XFillHatchItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XFillHatchItem> checkForUniqueItem( SdrModel& rModel ) const;
};
#endif
diff --git a/include/svx/xlndsit.hxx b/include/svx/xlndsit.hxx
index 04b40d41fab2..ca108eb5edcc 100644
--- a/include/svx/xlndsit.hxx
+++ b/include/svx/xlndsit.hxx
@@ -58,7 +58,7 @@ public:
void SetDashValue(const XDash& rNew) { aDash = rNew; Detach(); } // SetValue -> SetDashValue
static bool CompareValueFunc( const NameOrIndex* p1, const NameOrIndex* p2 );
- std::unique_ptr<XLineDashItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XLineDashItem> checkForUniqueItem( SdrModel& rModel ) const;
};
#endif
diff --git a/include/svx/xlnedit.hxx b/include/svx/xlnedit.hxx
index 81fd12e3726f..c34cfaf04d3b 100644
--- a/include/svx/xlnedit.hxx
+++ b/include/svx/xlnedit.hxx
@@ -53,7 +53,7 @@ public:
const basegfx::B2DPolyPolygon& GetLineEndValue() const { return maPolyPolygon;}
void SetLineEndValue(const basegfx::B2DPolyPolygon& rPolyPolygon) { maPolyPolygon = rPolyPolygon; Detach(); }
- std::unique_ptr<XLineEndItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XLineEndItem> checkForUniqueItem( SdrModel& rModel ) const;
};
#endif
diff --git a/include/svx/xlnstit.hxx b/include/svx/xlnstit.hxx
index c2729492200a..f7c45b562137 100644
--- a/include/svx/xlnstit.hxx
+++ b/include/svx/xlnstit.hxx
@@ -53,7 +53,7 @@ public:
const basegfx::B2DPolyPolygon& GetLineStartValue() const { return maPolyPolygon;}
void SetLineStartValue(const basegfx::B2DPolyPolygon& rPolyPolygon) { maPolyPolygon = rPolyPolygon; Detach(); }
- std::unique_ptr<XLineStartItem> checkForUniqueItem( SdrModel* pModel ) const;
+ std::unique_ptr<XLineStartItem> checkForUniqueItem( SdrModel& rModel ) const;
};
#endif
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 40e63fd1ce49..9db9e653677e 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -373,7 +373,7 @@ void ScDrawLayer::CreateDefaultStyles()
aTriangle.setClosed(true);
auto pSet = &pSheet->GetItemSet();
- pSet->Put(XLineStartItem(OUString(), ::basegfx::B2DPolyPolygon(aTriangle)).checkForUniqueItem(this));
+ pSet->Put(XLineStartItem(OUString(), ::basegfx::B2DPolyPolygon(aTriangle)).checkForUniqueItem(*this));
pSet->Put(XLineStartWidthItem(200));
pSet->Put(XLineStartCenterItem(false));
pSet->Put(XLineStyleItem(drawing::LineStyle_SOLID));
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 9a707ff4790f..dc08fa8b9046 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -1666,7 +1666,7 @@ void ScTabViewShell::ExecuteStyleEditDialog(VclPtr<SfxAbstractTabDialog> pDlg,
{
if (auto pOldItem = rAttr.GetItemIfSet(nWhichId, false))
{
- if (auto pNewItem = pOldItem->checkForUniqueItem(&GetDrawView()->GetModel()))
+ if (auto pNewItem = pOldItem->checkForUniqueItem(GetDrawView()->GetModel()))
rAttr.Put(std::move(pNewItem));
}
};
diff --git a/sd/source/ui/dlg/unchss.cxx b/sd/source/ui/dlg/unchss.cxx
index 7d963cddfb11..848f89c61208 100644
--- a/sd/source/ui/dlg/unchss.cxx
+++ b/sd/source/ui/dlg/unchss.cxx
@@ -44,10 +44,10 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
// Create ItemSets; Attention, it is possible that the new one is from a,
// different pool. Therefore we clone it with its items.
mpNewSet = std::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges());
- SdrModel::MigrateItemSet( pTheNewItemSet, mpNewSet.get(), pTheDoc );
+ SdrModel::MigrateItemSet( pTheNewItemSet, mpNewSet.get(), *pTheDoc );
mpOldSet = std::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), mpStyleSheet->GetItemSet().GetRanges());
- SdrModel::MigrateItemSet( &mpStyleSheet->GetItemSet(), mpOldSet.get(), pTheDoc );
+ SdrModel::MigrateItemSet( &mpStyleSheet->GetItemSet(), mpOldSet.get(), *pTheDoc );
OUString aComment(SdResId(STR_UNDO_CHANGE_PRES_OBJECT));
OUString aName(mpStyleSheet->GetName());
@@ -95,7 +95,7 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
void StyleSheetUndoAction::Undo()
{
SfxItemSet aNewSet( mpDoc->GetItemPool(), mpOldSet->GetRanges() );
- SdrModel::MigrateItemSet( mpOldSet.get(), &aNewSet, mpDoc );
+ SdrModel::MigrateItemSet( mpOldSet.get(), &aNewSet, *mpDoc );
mpStyleSheet->GetItemSet().Set(aNewSet);
if( mpStyleSheet->GetFamily() == SfxStyleFamily::Pseudo )
@@ -107,7 +107,7 @@ void StyleSheetUndoAction::Undo()
void StyleSheetUndoAction::Redo()
{
SfxItemSet aNewSet( mpDoc->GetItemPool(), mpOldSet->GetRanges() );
- SdrModel::MigrateItemSet( mpNewSet.get(), &aNewSet, mpDoc );
+ SdrModel::MigrateItemSet( mpNewSet.get(), &aNewSet, *mpDoc );
mpStyleSheet->GetItemSet().Set(aNewSet);
if( mpStyleSheet->GetFamily() == SfxStyleFamily::Pseudo )
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 0eebf6bad8b8..9a9762e0635b 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -339,7 +339,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
// MigrateItemSet makes sure the XFillBitmapItem will have a unique name
SfxItemSetFixed<XATTR_FILLBITMAP, XATTR_FILLBITMAP> aMigrateSet( mpDoc->GetPool() );
aMigrateSet.Put(XFillBitmapItem(u"background"_ustr, std::move(aGraphic)));
- SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc );
+ SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, *mpDoc );
pTempSet->Put( XFillBmpStretchItem( true ));
pTempSet->Put( XFillBmpTileItem( false ));
@@ -400,7 +400,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
// MigrateItemSet guarantees unique gradient names
SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet( mpDoc->GetPool() );
aMigrateSet.Put( XFillGradientItem(u"gradient"_ustr, pTempGradItem->GetGradientValue()) );
- SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc);
+ SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, *mpDoc);
}
const XFillHatchItem* pTempHatchItem = pTempSet->GetItem<XFillHatchItem>(XATTR_FILLHATCH);
@@ -409,7 +409,7 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
// MigrateItemSet guarantees unique hatch names
SfxItemSetFixed<XATTR_FILLHATCH, XATTR_FILLHATCH> aMigrateSet( mpDoc->GetPool() );
aMigrateSet.Put( XFillHatchItem(u"hatch"_ustr, pTempHatchItem->GetHatchValue()) );
- SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, mpDoc);
+ SdrModel::MigrateItemSet( &aMigrateSet, &*pTempSet, *mpDoc);
}
if( !mbMasterPage && bChanges && mbPageBckgrdDeleted )
diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx
index a96979d4121a..83a895c1449e 100644
--- a/sd/source/ui/func/futempl.cxx
+++ b/sd/source/ui/func/futempl.cxx
@@ -436,7 +436,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_FILLBITMAP ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLBITMAP );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillBitmapItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
@@ -445,7 +445,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_LINEDASH ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEDASH );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineDashItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
@@ -454,7 +454,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_LINESTART ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINESTART );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineStartItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
@@ -463,7 +463,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_LINEEND ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_LINEEND );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XLineEndItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
@@ -472,7 +472,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_FILLGRADIENT ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLGRADIENT );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillGradientItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
@@ -481,7 +481,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_FILLFLOATTRANSPARENCE ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLFLOATTRANSPARENCE );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillFloatTransparenceItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
@@ -490,7 +490,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq )
if( rAttr.GetItemState( XATTR_FILLHATCH ) == SfxItemState::SET )
{
const SfxPoolItem* pOldItem = rAttr.GetItem( XATTR_FILLHATCH );
- std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( mpDoc );
+ std::unique_ptr<SfxPoolItem> pNewItem = static_cast<const XFillHatchItem*>(pOldItem)->checkForUniqueItem( *mpDoc );
if( pNewItem )
{
rAttr.Put( std::move(pNewItem) );
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 5d6cd9d55aed..b207a600ff45 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1823,7 +1823,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
// MigrateItemSet guarantees unique gradient names
SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet(mpDrawView->GetModel().GetItemPool());
aMigrateSet.Put( aGradientItem );
- SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, &mpDrawView->GetModel());
+ SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, mpDrawView->GetModel());
rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
rPageProperties.PutItemSet( aTempSet );
@@ -1835,7 +1835,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
// MigrateItemSet guarantees unique gradient names
SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet(mpDrawView->GetModel().GetItemPool());
aMigrateSet.Put( aGradientItem );
- SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, &mpDrawView->GetModel());
+ SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, mpDrawView->GetModel());
rPageProperties.PutItem( XFillStyleItem( drawing::FillStyle_GRADIENT ) );
rPageProperties.PutItemSet( aTempSet );
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index 641ebe438154..177dd09aee1e 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -291,39 +291,38 @@ namespace sdr::properties
{
case XATTR_FILLBITMAP:
{
- // TTTT checkForUniqueItem should use SdrModel&
- pResultItem = static_cast<const XFillBitmapItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XFillBitmapItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
case XATTR_LINEDASH:
{
- pResultItem = static_cast<const XLineDashItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XLineDashItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
case XATTR_LINESTART:
{
- pResultItem = static_cast<const XLineStartItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XLineStartItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
case XATTR_LINEEND:
{
- pResultItem = static_cast<const XLineEndItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XLineEndItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
case XATTR_FILLGRADIENT:
{
- pResultItem = static_cast<const XFillGradientItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XFillGradientItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
case XATTR_FILLFLOATTRANSPARENCE:
{
// #85953# allow all kinds of XFillFloatTransparenceItem to be set
- pResultItem = static_cast<const XFillFloatTransparenceItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XFillFloatTransparenceItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
case XATTR_FILLHATCH:
{
- pResultItem = static_cast<const XFillHatchItem*>(pNewItem)->checkForUniqueItem( &rModel );
+ pResultItem = static_cast<const XFillHatchItem*>(pNewItem)->checkForUniqueItem( rModel );
break;
}
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index a26b26a2ff2c..e13f1025430a 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1644,9 +1644,8 @@ void SdrModel::setLock( bool bLock )
}
-void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel* pNewModelel )
+void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSet, SdrModel& rNewModel )
{
- assert(pNewModelel != nullptr);
if( !(pSourceSet && pDestSet && (pSourceSet != pDestSet )) )
return;
@@ -1663,26 +1662,26 @@ void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSe
switch( nWhich )
{
case XATTR_FILLBITMAP:
- pResultItem = static_cast<const XFillBitmapItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XFillBitmapItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
case XATTR_LINEDASH:
- pResultItem = static_cast<const XLineDashItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XLineDashItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
case XATTR_LINESTART:
- pResultItem = static_cast<const XLineStartItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XLineStartItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
case XATTR_LINEEND:
- pResultItem = static_cast<const XLineEndItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XLineEndItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
case XATTR_FILLGRADIENT:
- pResultItem = static_cast<const XFillGradientItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XFillGradientItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
case XATTR_FILLFLOATTRANSPARENCE:
// allow all kinds of XFillFloatTransparenceItem to be set
- pResultItem = static_cast<const XFillFloatTransparenceItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XFillFloatTransparenceItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
case XATTR_FILLHATCH:
- pResultItem = static_cast<const XFillHatchItem*>(pPoolItem)->checkForUniqueItem( pNewModelel );
+ pResultItem = static_cast<const XFillHatchItem*>(pPoolItem)->checkForUniqueItem( rNewModel );
break;
}
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index d8e0a41a6f9d..7ab66e2e2b29 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -956,19 +956,16 @@ bool XLineDashItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex*
return static_cast<const XLineDashItem*>(p1)->GetDashValue() == static_cast<const XLineDashItem*>(p2)->GetDashValue();
}
-std::unique_ptr<XLineDashItem> XLineDashItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XLineDashItem> XLineDashItem::checkForUniqueItem( SdrModel& rModel ) const
{
- if( pModel )
- {
- const OUString aUniqueName = NameOrIndex::CheckNamedItem(
- this, XATTR_LINEDASH, &pModel->GetItemPool(),
- XLineDashItem::CompareValueFunc, RID_SVXSTR_DASH20,
- pModel->GetPropertyList( XPropertyListType::Dash ) );
+ const OUString aUniqueName = NameOrIndex::CheckNamedItem(
+ this, XATTR_LINEDASH, &rModel.GetItemPool(),
+ XLineDashItem::CompareValueFunc, RID_SVXSTR_DASH20,
+ rModel.GetPropertyList( XPropertyListType::Dash ) );
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() )
- return std::make_unique<XLineDashItem>( aUniqueName, aDash );
- }
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() )
+ return std::make_unique<XLineDashItem>( aUniqueName, aDash );
return nullptr;
}
@@ -1212,57 +1209,76 @@ bool XLineStartItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId )
/** this function searches in both the models pool and the styles pool for XLineStartItem
and XLineEndItem with the same value or name and returns an item with the value of
this item and a unique name for an item with this value. */
-std::unique_ptr<XLineStartItem> XLineStartItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XLineStartItem> XLineStartItem::checkForUniqueItem( SdrModel& rModel ) const
{
- if( pModel )
+ std::unique_ptr<XLineStartItem> pTempItem;
+ const XLineStartItem* pLineStartItem = this;
+
+ OUString aUniqueName( GetName() );
+
+ if( !maPolyPolygon.count() )
{
- std::unique_ptr<XLineStartItem> pTempItem;
- const XLineStartItem* pLineStartItem = this;
+ // if the polygon is empty, check if the name is empty
+ if( aUniqueName.isEmpty() )
+ return nullptr;
- OUString aUniqueName( GetName() );
+ // force empty name for empty polygons
+ return std::make_unique<XLineStartItem>( "", maPolyPolygon );
+ }
- if( !maPolyPolygon.count() )
+ if( maPolyPolygon.count() > 1 )
+ {
+ // check if the polygon is closed
+ if(!maPolyPolygon.isClosed())
{
- // if the polygon is empty, check if the name is empty
- if( aUniqueName.isEmpty() )
- return nullptr;
-
- // force empty name for empty polygons
- return std::make_unique<XLineStartItem>( "", maPolyPolygon );
+ // force a closed polygon
+ basegfx::B2DPolyPolygon aNew(maPolyPolygon);
+ aNew.setClosed(true);
+ pTempItem.reset(new XLineStartItem( aUniqueName, std::move(aNew) ));
+ pLineStartItem = pTempItem.get();
}
+ }
+
+ bool bForceNew = false;
+
+ // 2. if we have a name check if there is already an item with the
+ // same name in the documents pool with a different line end or start
- if( maPolyPolygon.count() > 1 )
+ const SfxItemPool& rPool1 = rModel.GetItemPool();
+ if (!aUniqueName.isEmpty())
+ {
+ ItemSurrogates aSurrogates;
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ for (const SfxPoolItem* p : aSurrogates)
{
- // check if the polygon is closed
- if(!maPolyPolygon.isClosed())
+ auto pItem = dynamic_cast<const XLineStartItem*>(p);
+
+ if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
{
- // force a closed polygon
- basegfx::B2DPolyPolygon aNew(maPolyPolygon);
- aNew.setClosed(true);
- pTempItem.reset(new XLineStartItem( aUniqueName, std::move(aNew) ));
- pLineStartItem = pTempItem.get();
+ // if there is already an item with the same name and the same
+ // value it's ok to set it
+ if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
+ {
+ // same name but different value, we need a new name for this item
+ aUniqueName.clear();
+ bForceNew = true;
+ }
+ break;
}
}
- bool bForceNew = false;
-
- // 2. if we have a name check if there is already an item with the
- // same name in the documents pool with a different line end or start
-
- const SfxItemPool& rPool1 = pModel->GetItemPool();
- if (!aUniqueName.isEmpty())
+ if( !bForceNew )
{
- ItemSurrogates aSurrogates;
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
for (const SfxPoolItem* p : aSurrogates)
{
- auto pItem = dynamic_cast<const XLineStartItem*>(p);
+ auto pItem = dynamic_cast<const XLineEndItem*>(p);
if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
{
// if there is already an item with the same name and the same
// value it's ok to set it
- if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
+ if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
{
// same name but different value, we need a new name for this item
aUniqueName.clear();
@@ -1271,44 +1287,44 @@ std::unique_ptr<XLineStartItem> XLineStartItem::checkForUniqueItem( SdrModel* pM
break;
}
}
+ }
+ }
+
+ const SfxItemPool* pPool2 = rModel.GetStyleSheetPool() ? &rModel.GetStyleSheetPool()->GetPool() : nullptr;
+ if( !aUniqueName.isEmpty() && pPool2)
+ {
+ ItemSurrogates aSurrogates;
+ pPool2->GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ for (const SfxPoolItem* p : aSurrogates)
+ {
+ auto pItem = dynamic_cast<const XLineStartItem*>(p);
- if( !bForceNew )
+ if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
{
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
- for (const SfxPoolItem* p : aSurrogates)
+ // if there is already an item with the same name and the same
+ // value it's ok to set it
+ if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
{
- auto pItem = dynamic_cast<const XLineEndItem*>(p);
-
- if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
- {
- // if there is already an item with the same name and the same
- // value it's ok to set it
- if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
- {
- // same name but different value, we need a new name for this item
- aUniqueName.clear();
- bForceNew = true;
- }
- break;
- }
+ // same name but different value, we need a new name for this item
+ aUniqueName.clear();
+ bForceNew = true;
}
+ break;
}
}
- const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr;
- if( !aUniqueName.isEmpty() && pPool2)
+ if( !bForceNew )
{
- ItemSurrogates aSurrogates;
- pPool2->GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ pPool2->GetItemSurrogates(aSurrogates, XATTR_LINEEND);
for (const SfxPoolItem* p : aSurrogates)
{
- auto pItem = dynamic_cast<const XLineStartItem*>(p);
+ auto pItem = dynamic_cast<const XLineEndItem*>(p);
if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
{
// if there is already an item with the same name and the same
// value it's ok to set it
- if( pItem->GetLineStartValue() != pLineStartItem->GetLineStartValue() )
+ if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
{
// same name but different value, we need a new name for this item
aUniqueName.clear();
@@ -1317,104 +1333,82 @@ std::unique_ptr<XLineStartItem> XLineStartItem::checkForUniqueItem( SdrModel* pM
break;
}
}
+ }
+ }
- if( !bForceNew )
+ // if we have no name yet, find existing item with same content or
+ // create a unique name
+ if( aUniqueName.isEmpty() )
+ {
+ bool bFoundExisting = false;
+
+ sal_Int32 nUserIndex = 1;
+ const OUString aUser(SvxResId(RID_SVXSTR_LINEEND));
+
+ ItemSurrogates aSurrogates;
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ for (const SfxPoolItem* p : aSurrogates)
+ {
+ auto pItem = dynamic_cast<const XLineStartItem*>(p);
+
+ if (pItem && !pItem->GetName().isEmpty())
{
- pPool2->GetItemSurrogates(aSurrogates, XATTR_LINEEND);
- for (const SfxPoolItem* p : aSurrogates)
+ if (!bForceNew && pItem->GetLineStartValue() == pLineStartItem->GetLineStartValue())
{
- auto pItem = dynamic_cast<const XLineEndItem*>(p);
+ aUniqueName = pItem->GetName();
+ bFoundExisting = true;
+ break;
+ }
- if( pItem && ( pItem->GetName() == pLineStartItem->GetName() ) )
- {
- // if there is already an item with the same name and the same
- // value it's ok to set it
- if( pItem->GetLineEndValue() != pLineStartItem->GetLineStartValue() )
- {
- // same name but different value, we need a new name for this item
- aUniqueName.clear();
- bForceNew = true;
- }
- break;
- }
+ if (pItem->GetName().startsWith(aUser))
+ {
+ sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
+ if (nThisIndex >= nUserIndex)
+ nUserIndex = nThisIndex + 1;
}
}
}
- // if we have no name yet, find existing item with same content or
- // create a unique name
- if( aUniqueName.isEmpty() )
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
+ for (const SfxPoolItem* p : aSurrogates)
{
- bool bFoundExisting = false;
-
- sal_Int32 nUserIndex = 1;
- const OUString aUser(SvxResId(RID_SVXSTR_LINEEND));
+ auto pItem = dynamic_cast<const XLineEndItem*>(p);
- ItemSurrogates aSurrogates;
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
- for (const SfxPoolItem* p : aSurrogates)
+ if (pItem && !pItem->GetName().isEmpty())
{
- auto pItem = dynamic_cast<const XLineStartItem*>(p);
-
- if (pItem && !pItem->GetName().isEmpty())
+ if (!bForceNew && pItem->GetLineEndValue() == pLineStartItem->GetLineStartValue())
{
- if (!bForceNew && pItem->GetLineStartValue() == pLineStartItem->GetLineStartValue())
- {
- aUniqueName = pItem->GetName();
- bFoundExisting = true;
- break;
- }
-
- if (pItem->GetName().startsWith(aUser))
- {
- sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
- if (nThisIndex >= nUserIndex)
- nUserIndex = nThisIndex + 1;
- }
+ aUniqueName = pItem->GetName();
+ bFoundExisting = true;
+ break;
}
- }
-
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
- for (const SfxPoolItem* p : aSurrogates)
- {
- auto pItem = dynamic_cast<const XLineEndItem*>(p);
- if (pItem && !pItem->GetName().isEmpty())
+ if (pItem->GetName().startsWith(aUser))
{
- if (!bForceNew && pItem->GetLineEndValue() == pLineStartItem->GetLineStartValue())
- {
- aUniqueName = pItem->GetName();
- bFoundExisting = true;
- break;
- }
-
- if (pItem->GetName().startsWith(aUser))
- {
- sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
- if (nThisIndex >= nUserIndex)
- nUserIndex = nThisIndex + 1;
- }
+ sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
+ if (nThisIndex >= nUserIndex)
+ nUserIndex = nThisIndex + 1;
}
}
+ }
- if( !bFoundExisting )
- {
- aUniqueName = aUser + " " + OUString::number( nUserIndex );
- }
+ if( !bFoundExisting )
+ {
+ aUniqueName = aUser + " " + OUString::number( nUserIndex );
}
+ }
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() || pTempItem )
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() || pTempItem )
+ {
+ if( pTempItem )
{
- if( pTempItem )
- {
- pTempItem->SetName( aUniqueName );
- return pTempItem;
- }
- else
- {
- return std::make_unique<XLineStartItem>( aUniqueName, maPolyPolygon );
- }
+ pTempItem->SetName( aUniqueName );
+ return pTempItem;
+ }
+ else
+ {
+ return std::make_unique<XLineStartItem>( aUniqueName, maPolyPolygon );
}
}
@@ -1460,57 +1454,76 @@ bool XLineEndItem::operator==(const SfxPoolItem& rItem) const
/** this function searches in both the models pool and the styles pool for XLineStartItem
and XLineEndItem with the same value or name and returns an item with the value of
this item and a unique name for an item with this value. */
-std::unique_ptr<XLineEndItem> XLineEndItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XLineEndItem> XLineEndItem::checkForUniqueItem( SdrModel& rModel ) const
{
- if( pModel )
+ std::unique_ptr<XLineEndItem> pTempItem;
+ const XLineEndItem* pLineEndItem = this;
+
+ OUString aUniqueName( GetName() );
+
+ if( !maPolyPolygon.count() )
{
- std::unique_ptr<XLineEndItem> pTempItem;
- const XLineEndItem* pLineEndItem = this;
+ // if the polygon is empty, check if the name is empty
+ if( aUniqueName.isEmpty() )
+ return nullptr;
- OUString aUniqueName( GetName() );
+ // force empty name for empty polygons
+ return std::make_unique<XLineEndItem>( "", maPolyPolygon );
+ }
- if( !maPolyPolygon.count() )
+ if( maPolyPolygon.count() > 1 )
+ {
+ // check if the polygon is closed
+ if(!maPolyPolygon.isClosed())
{
- // if the polygon is empty, check if the name is empty
- if( aUniqueName.isEmpty() )
- return nullptr;
-
- // force empty name for empty polygons
- return std::make_unique<XLineEndItem>( "", maPolyPolygon );
+ // force a closed polygon
+ basegfx::B2DPolyPolygon aNew(maPolyPolygon);
+ aNew.setClosed(true);
+ pTempItem.reset(new XLineEndItem( aUniqueName, std::move(aNew) ));
+ pLineEndItem = pTempItem.get();
}
+ }
+
+ bool bForceNew = false;
- if( maPolyPolygon.count() > 1 )
+ // 2. if we have a name check if there is already an item with the
+ // same name in the documents pool with a different line end or start
+
+ const SfxItemPool& rPool1 = rModel.GetItemPool();
+ if (!aUniqueName.isEmpty())
+ {
+ ItemSurrogates aSurrogates;
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ for (const SfxPoolItem* p : aSurrogates)
{
- // check if the polygon is closed
- if(!maPolyPolygon.isClosed())
+ auto pItem = dynamic_cast<const XLineStartItem*>(p);
+
+ if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
{
- // force a closed polygon
- basegfx::B2DPolyPolygon aNew(maPolyPolygon);
- aNew.setClosed(true);
- pTempItem.reset(new XLineEndItem( aUniqueName, std::move(aNew) ));
- pLineEndItem = pTempItem.get();
+ // if there is already an item with the same name and the same
+ // value it's ok to set it
+ if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
+ {
+ // same name but different value, we need a new name for this item
+ aUniqueName.clear();
+ bForceNew = true;
+ }
+ break;
}
}
- bool bForceNew = false;
-
- // 2. if we have a name check if there is already an item with the
- // same name in the documents pool with a different line end or start
-
- const SfxItemPool& rPool1 = pModel->GetItemPool();
- if (!aUniqueName.isEmpty())
+ if( !bForceNew )
{
- ItemSurrogates aSurrogates;
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
for (const SfxPoolItem* p : aSurrogates)
{
- auto pItem = dynamic_cast<const XLineStartItem*>(p);
+ auto pItem = dynamic_cast<const XLineEndItem*>(p);
if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
{
// if there is already an item with the same name and the same
// value it's ok to set it
- if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
+ if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
{
// same name but different value, we need a new name for this item
aUniqueName.clear();
@@ -1519,44 +1532,44 @@ std::unique_ptr<XLineEndItem> XLineEndItem::checkForUniqueItem( SdrModel* pModel
break;
}
}
+ }
+ }
- if( !bForceNew )
+ const SfxItemPool* pPool2 = rModel.GetStyleSheetPool() ? &rModel.GetStyleSheetPool()->GetPool() : nullptr;
+ if( !aUniqueName.isEmpty() && pPool2)
+ {
+ ItemSurrogates aSurrogates;
+ pPool2->GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ for (const SfxPoolItem* p : aSurrogates)
+ {
+ auto pItem = dynamic_cast<const XLineStartItem*>(p);
+
+ if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
{
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
- for (const SfxPoolItem* p : aSurrogates)
+ // if there is already an item with the same name and the same
+ // value it's ok to set it
+ if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
{
- auto pItem = dynamic_cast<const XLineEndItem*>(p);
-
- if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
- {
- // if there is already an item with the same name and the same
- // value it's ok to set it
- if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
- {
- // same name but different value, we need a new name for this item
- aUniqueName.clear();
- bForceNew = true;
- }
- break;
- }
+ // same name but different value, we need a new name for this item
+ aUniqueName.clear();
+ bForceNew = true;
}
+ break;
}
}
- const SfxItemPool* pPool2 = pModel->GetStyleSheetPool() ? &pModel->GetStyleSheetPool()->GetPool() : nullptr;
- if( !aUniqueName.isEmpty() && pPool2)
+ if( !bForceNew )
{
- ItemSurrogates aSurrogates;
- pPool2->GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ pPool2->GetItemSurrogates(aSurrogates, XATTR_LINEEND);
for (const SfxPoolItem* p : aSurrogates)
{
- auto pItem = dynamic_cast<const XLineStartItem*>(p);
+ auto pItem = dynamic_cast<const XLineEndItem*>(p);
if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
{
// if there is already an item with the same name and the same
// value it's ok to set it
- if( pItem->GetLineStartValue() != pLineEndItem->GetLineEndValue() )
+ if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
{
// same name but different value, we need a new name for this item
aUniqueName.clear();
@@ -1565,104 +1578,82 @@ std::unique_ptr<XLineEndItem> XLineEndItem::checkForUniqueItem( SdrModel* pModel
break;
}
}
+ }
+ }
- if( !bForceNew )
+ // if we have no name yet, find existing item with same content or
+ // create a unique name
+ if( aUniqueName.isEmpty() )
+ {
+ bool bFoundExisting = false;
+
+ sal_Int32 nUserIndex = 1;
+ const OUString aUser(SvxResId(RID_SVXSTR_LINEEND));
+
+ ItemSurrogates aSurrogates;
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
+ for (const SfxPoolItem* p : aSurrogates)
+ {
+ auto pItem = dynamic_cast<const XLineStartItem*>(p);
+
+ if (pItem && !pItem->GetName().isEmpty())
{
- pPool2->GetItemSurrogates(aSurrogates, XATTR_LINEEND);
- for (const SfxPoolItem* p : aSurrogates)
+ if (!bForceNew && pItem->GetLineStartValue() == pLineEndItem->GetLineEndValue())
{
- auto pItem = dynamic_cast<const XLineEndItem*>(p);
+ aUniqueName = pItem->GetName();
+ bFoundExisting = true;
+ break;
+ }
- if( pItem && ( pItem->GetName() == pLineEndItem->GetName() ) )
- {
- // if there is already an item with the same name and the same
- // value it's ok to set it
- if( pItem->GetLineEndValue() != pLineEndItem->GetLineEndValue() )
- {
- // same name but different value, we need a new name for this item
- aUniqueName.clear();
- bForceNew = true;
- }
- break;
- }
+ if (pItem->GetName().startsWith(aUser))
+ {
+ sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
+ if (nThisIndex >= nUserIndex)
+ nUserIndex = nThisIndex + 1;
}
}
}
- // if we have no name yet, find existing item with same content or
- // create a unique name
- if( aUniqueName.isEmpty() )
+ rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
+ for (const SfxPoolItem* p : aSurrogates)
{
- bool bFoundExisting = false;
+ auto pItem = dynamic_cast<const XLineEndItem*>(p);
- sal_Int32 nUserIndex = 1;
- const OUString aUser(SvxResId(RID_SVXSTR_LINEEND));
-
- ItemSurrogates aSurrogates;
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINESTART);
- for (const SfxPoolItem* p : aSurrogates)
+ if (pItem && !pItem->GetName().isEmpty())
{
- auto pItem = dynamic_cast<const XLineStartItem*>(p);
-
- if (pItem && !pItem->GetName().isEmpty())
+ if (!bForceNew && pItem->GetLineEndValue() == pLineEndItem->GetLineEndValue())
{
- if (!bForceNew && pItem->GetLineStartValue() == pLineEndItem->GetLineEndValue())
- {
- aUniqueName = pItem->GetName();
- bFoundExisting = true;
- break;
- }
-
- if (pItem->GetName().startsWith(aUser))
- {
- sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
- if (nThisIndex >= nUserIndex)
- nUserIndex = nThisIndex + 1;
- }
+ aUniqueName = pItem->GetName();
+ bFoundExisting = true;
+ break;
}
- }
-
- rPool1.GetItemSurrogates(aSurrogates, XATTR_LINEEND);
- for (const SfxPoolItem* p : aSurrogates)
- {
- auto pItem = dynamic_cast<const XLineEndItem*>(p);
- if (pItem && !pItem->GetName().isEmpty())
+ if (pItem->GetName().startsWith(aUser))
{
- if (!bForceNew && pItem->GetLineEndValue() == pLineEndItem->GetLineEndValue())
- {
- aUniqueName = pItem->GetName();
- bFoundExisting = true;
- break;
- }
-
- if (pItem->GetName().startsWith(aUser))
- {
- sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
- if (nThisIndex >= nUserIndex)
- nUserIndex = nThisIndex + 1;
- }
+ sal_Int32 nThisIndex = o3tl::toInt32(pItem->GetName().subView(aUser.getLength()));
+ if (nThisIndex >= nUserIndex)
+ nUserIndex = nThisIndex + 1;
}
}
+ }
- if( !bFoundExisting )
- {
- aUniqueName = aUser + " " + OUString::number( nUserIndex );
- }
+ if( !bFoundExisting )
+ {
+ aUniqueName = aUser + " " + OUString::number( nUserIndex );
}
+ }
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() || pTempItem )
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() || pTempItem )
+ {
+ if( pTempItem )
{
- if( pTempItem )
- {
- pTempItem->SetName( aUniqueName );
- return pTempItem;
- }
- else
- {
- return std::make_unique<XLineEndItem>( aUniqueName, maPolyPolygon );
- }
+ pTempItem->SetName( aUniqueName );
+ return pTempItem;
+ }
+ else
+ {
+ return std::make_unique<XLineEndItem>( aUniqueName, maPolyPolygon );
}
}
@@ -2474,19 +2465,16 @@ bool XFillGradientItem::CompareValueFunc( const NameOrIndex* p1, const NameOrInd
return static_cast<const XFillGradientItem*>(p1)->GetGradientValue() == static_cast<const XFillGradientItem*>(p2)->GetGradientValue();
}
-std::unique_ptr<XFillGradientItem> XFillGradientItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XFillGradientItem> XFillGradientItem::checkForUniqueItem( SdrModel& rModel ) const
{
- if( pModel )
- {
- const OUString aUniqueName = NameOrIndex::CheckNamedItem(
- this, Which(), &pModel->GetItemPool(),
- XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT,
- pModel->GetPropertyList( XPropertyListType::Gradient ) );
+ const OUString aUniqueName = NameOrIndex::CheckNamedItem(
+ this, Which(), &rModel.GetItemPool(),
+ XFillGradientItem::CompareValueFunc, RID_SVXSTR_GRADIENT,
+ rModel.GetPropertyList( XPropertyListType::Gradient ) );
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() )
- return std::make_unique<XFillGradientItem>( aUniqueName, m_aGradient, TypedWhichId<XFillGradientItem>(Which()) );
- }
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() )
+ return std::make_unique<XFillGradientItem>( aUniqueName, m_aGradient, TypedWhichId<XFillGradientItem>(Which()) );
return nullptr;
}
@@ -2593,25 +2581,22 @@ bool XFillFloatTransparenceItem::CompareValueFunc( const NameOrIndex* p1, const
static_cast<const XFillFloatTransparenceItem*>(p1)->GetGradientValue() == static_cast<const XFillFloatTransparenceItem*>(p2)->GetGradientValue();
}
-std::unique_ptr<XFillFloatTransparenceItem> XFillFloatTransparenceItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XFillFloatTransparenceItem> XFillFloatTransparenceItem::checkForUniqueItem( SdrModel& rModel ) const
{
// #85953# unique name only necessary when enabled
if(IsEnabled())
{
- if( pModel )
- {
- const OUString aUniqueName = NameOrIndex::CheckNamedItem( this,
- XATTR_FILLFLOATTRANSPARENCE,
- &pModel->GetItemPool(),
- XFillFloatTransparenceItem::CompareValueFunc,
- RID_SVXSTR_TRASNGR0,
- XPropertyListRef() );
+ const OUString aUniqueName = NameOrIndex::CheckNamedItem( this,
+ XATTR_FILLFLOATTRANSPARENCE,
+ &rModel.GetItemPool(),
+ XFillFloatTransparenceItem::CompareValueFunc,
+ RID_SVXSTR_TRASNGR0,
+ XPropertyListRef() );
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() )
- {
- return std::make_unique<XFillFloatTransparenceItem>( aUniqueName, GetGradientValue(), true );
- }
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() )
+ {
+ return std::make_unique<XFillFloatTransparenceItem>( aUniqueName, GetGradientValue(), true );
}
}
else
@@ -2874,19 +2859,16 @@ bool XFillHatchItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex*
return static_cast<const XFillHatchItem*>(p1)->GetHatchValue() == static_cast<const XFillHatchItem*>(p2)->GetHatchValue();
}
-std::unique_ptr<XFillHatchItem> XFillHatchItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XFillHatchItem> XFillHatchItem::checkForUniqueItem( SdrModel& rModel ) const
{
- if( pModel )
- {
- const OUString aUniqueName = NameOrIndex::CheckNamedItem(
- this, XATTR_FILLHATCH, &pModel->GetItemPool(),
- XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10,
- pModel->GetPropertyList( XPropertyListType::Hatch ) );
+ const OUString aUniqueName = NameOrIndex::CheckNamedItem(
+ this, XATTR_FILLHATCH, &rModel.GetItemPool(),
+ XFillHatchItem::CompareValueFunc, RID_SVXSTR_HATCH10,
+ rModel.GetPropertyList( XPropertyListType::Hatch ) );
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() )
- return std::make_unique<XFillHatchItem>( aUniqueName, m_aHatch );
- }
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() )
+ return std::make_unique<XFillHatchItem>( aUniqueName, m_aHatch );
return nullptr;
}
diff --git a/svx/source/xoutdev/xattrbmp.cxx b/svx/source/xoutdev/xattrbmp.cxx
index b8949e3edc0c..740db886d2e9 100644
--- a/svx/source/xoutdev/xattrbmp.cxx
+++ b/svx/source/xoutdev/xattrbmp.cxx
@@ -307,23 +307,20 @@ bool XFillBitmapItem::CompareValueFunc( const NameOrIndex* p1, const NameOrIndex
return aGraphicObjectA == aGraphicObjectB;
}
-std::unique_ptr<XFillBitmapItem> XFillBitmapItem::checkForUniqueItem( SdrModel* pModel ) const
+std::unique_ptr<XFillBitmapItem> XFillBitmapItem::checkForUniqueItem( SdrModel& rModel ) const
{
- if( pModel )
+ XPropertyListType aListType = XPropertyListType::Bitmap;
+ if(isPattern())
+ aListType = XPropertyListType::Pattern;
+ const OUString aUniqueName = NameOrIndex::CheckNamedItem(
+ this, XATTR_FILLBITMAP, &rModel.GetItemPool(),
+ XFillBitmapItem::CompareValueFunc, RID_SVXSTR_BMP21,
+ rModel.GetPropertyList( aListType ) );
+
+ // if the given name is not valid, replace it!
+ if( aUniqueName != GetName() )
{
- XPropertyListType aListType = XPropertyListType::Bitmap;
- if(isPattern())
- aListType = XPropertyListType::Pattern;
- const OUString aUniqueName = NameOrIndex::CheckNamedItem(
- this, XATTR_FILLBITMAP, &pModel->GetItemPool(),
- XFillBitmapItem::CompareValueFunc, RID_SVXSTR_BMP21,
- pModel->GetPropertyList( aListType ) );
-
- // if the given name is not valid, replace it!
- if( aUniqueName != GetName() )
- {
- return std::make_unique<XFillBitmapItem>(aUniqueName, maGraphicObject);
- }
+ return std::make_unique<XFillBitmapItem>(aUniqueName, maGraphicObject);
}
return nullptr;
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 52d9d601dc90..c6e3ebe3ea83 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -515,37 +515,37 @@ void SwDoc::CheckForUniqueItemForLineFillNameOrIndex(SfxItemSet& rSet)
{
case XATTR_FILLBITMAP:
{
- pResult = pItem->StaticWhichCast(XATTR_FILLBITMAP).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_FILLBITMAP).checkForUniqueItem(*pDrawModel);
break;
}
case XATTR_LINEDASH:
{
- pResult = pItem->StaticWhichCast(XATTR_LINEDASH).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_LINEDASH).checkForUniqueItem(*pDrawModel);
break;
}
case XATTR_LINESTART:
{
- pResult = pItem->StaticWhichCast(XATTR_LINESTART).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_LINESTART).checkForUniqueItem(*pDrawModel);
break;
}
case XATTR_LINEEND:
{
- pResult = pItem->StaticWhichCast(XATTR_LINEEND).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_LINEEND).checkForUniqueItem(*pDrawModel);
break;
}
case XATTR_FILLGRADIENT:
{
- pResult = pItem->StaticWhichCast(XATTR_FILLGRADIENT).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_FILLGRADIENT).checkForUniqueItem(*pDrawModel);
break;
}
case XATTR_FILLFLOATTRANSPARENCE:
{
- pResult = pItem->StaticWhichCast(XATTR_FILLFLOATTRANSPARENCE).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_FILLFLOATTRANSPARENCE).checkForUniqueItem(*pDrawModel);
break;
}
case XATTR_FILLHATCH:
{
- pResult = pItem->StaticWhichCast(XATTR_FILLHATCH).checkForUniqueItem(pDrawModel);
+ pResult = pItem->StaticWhichCast(XATTR_FILLHATCH).checkForUniqueItem(*pDrawModel);
break;
}
}
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 5bcf240026b6..c8ae3dded2c2 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1666,7 +1666,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
// MigrateItemSet guarantees unique gradient names
SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet(rWrtSh.GetView().GetPool());
aMigrateSet.Put(XFillGradientItem(u"gradient"_ustr, pTempGradItem->GetGradientValue()));
- SdrModel::MigrateItemSet(&aMigrateSet, pSet, pDrawModel);
+ SdrModel::MigrateItemSet(&aMigrateSet, pSet, *pDrawModel);
}
bSet = pFS && pFS->GetValue() == drawing::FillStyle_HATCH;
@@ -1676,7 +1676,7 @@ void SwTextShell::Execute(SfxRequest &rReq)
{
SfxItemSetFixed<XATTR_FILLHATCH, XATTR_FILLHATCH> aMigrateSet(rWrtSh.GetView().GetPool());
aMigrateSet.Put(XFillHatchItem(u"hatch"_ustr, pTempHatchItem->GetHatchValue()));
- SdrModel::MigrateItemSet(&aMigrateSet, pSet, pDrawModel);
+ SdrModel::MigrateItemSet(&aMigrateSet, pSet, *pDrawModel);
}
sw_ParagraphDialogResult(pSet, rWrtSh, *pRequest, vCursors->front().get());