loplugin:datamembershadow in StyleSheetUndoAction

Change-Id: Ic4de30f7e9582078562b661545ac23fe9927f83d
Reviewed-on: https://gerrit.libreoffice.org/30903
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2016-11-16 14:31:04 +02:00
parent 2f7ccd102a
commit f20422ce9e
2 changed files with 2 additions and 10 deletions

View File

@@ -51,7 +51,7 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
mpOldSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), mpStyleSheet->GetItemSet().GetRanges()); mpOldSet = o3tl::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 );
maComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT); OUString aComment(SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT));
OUString aName(mpStyleSheet->GetName()); OUString aName(mpStyleSheet->GetName());
// delete layout name and separator // delete layout name and separator
@@ -91,7 +91,7 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
} }
// replace placeholder with template name // replace placeholder with template name
maComment = maComment.replaceFirst("$", aName); SetComment(aComment.replaceFirst("$", aName));
} }
void StyleSheetUndoAction::Undo() void StyleSheetUndoAction::Undo()
@@ -118,9 +118,4 @@ void StyleSheetUndoAction::Redo()
mpStyleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED)); mpStyleSheet->Broadcast(SfxHint(SFX_HINT_DATACHANGED));
} }
OUString StyleSheetUndoAction::GetComment() const
{
return maComment;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -34,7 +34,6 @@ class StyleSheetUndoAction : public SdUndoAction
std::unique_ptr<SfxItemSet> mpNewSet; std::unique_ptr<SfxItemSet> mpNewSet;
std::unique_ptr<SfxItemSet> mpOldSet; std::unique_ptr<SfxItemSet> mpOldSet;
OUString maComment;
public: public:
StyleSheetUndoAction(SdDrawDocument* pTheDoc, StyleSheetUndoAction(SdDrawDocument* pTheDoc,
@@ -43,8 +42,6 @@ public:
virtual void Undo() override; virtual void Undo() override;
virtual void Redo() override; virtual void Redo() override;
virtual OUString GetComment() const override;
}; };
#endif // INCLUDED_SD_SOURCE_UI_INC_UNCHSS_HXX #endif // INCLUDED_SD_SOURCE_UI_INC_UNCHSS_HXX