Kaydet (Commit) 859c0066 authored tarafından David Tardon's avatar David Tardon

add member prefix

Change-Id: Ic53e0c564176649b6cba84ea898c3c2f69fcad8c
üst 10b818d4
...@@ -41,18 +41,18 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, ...@@ -41,18 +41,18 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
SdUndoAction(pTheDoc) SdUndoAction(pTheDoc)
{ {
DBG_ASSERT(pTheStyleSheet, "Undo without StyleSheet ???"); DBG_ASSERT(pTheStyleSheet, "Undo without StyleSheet ???");
pStyleSheet = pTheStyleSheet; mpStyleSheet = pTheStyleSheet;
// Create ItemSets; Attention, it is possible that the new one is from a, // Create ItemSets; Attention, it is possible that the new one is from a,
// different pool. Therefore we clone it with its items. // different pool. Therefore we clone it with its items.
pNewSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges()); mpNewSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pTheNewItemSet->GetRanges());
SdrModel::MigrateItemSet( pTheNewItemSet, pNewSet.get(), pTheDoc ); SdrModel::MigrateItemSet( pTheNewItemSet, mpNewSet.get(), pTheDoc );
pOldSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), pStyleSheet->GetItemSet().GetRanges()); mpOldSet = o3tl::make_unique<SfxItemSet>(static_cast<SfxItemPool&>(SdrObject::GetGlobalDrawObjectItemPool()), mpStyleSheet->GetItemSet().GetRanges());
SdrModel::MigrateItemSet( &pStyleSheet->GetItemSet(), pOldSet.get(), pTheDoc ); SdrModel::MigrateItemSet( &mpStyleSheet->GetItemSet(), mpOldSet.get(), pTheDoc );
aComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT); maComment = SD_RESSTR(STR_UNDO_CHANGE_PRES_OBJECT);
OUString aName(pStyleSheet->GetName()); OUString aName(mpStyleSheet->GetName());
// delete layout name and separator // delete layout name and separator
sal_Int32 nPos = aName.indexOf(SD_LT_SEPARATOR); sal_Int32 nPos = aName.indexOf(SD_LT_SEPARATOR);
...@@ -91,36 +91,36 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc, ...@@ -91,36 +91,36 @@ StyleSheetUndoAction::StyleSheetUndoAction(SdDrawDocument* pTheDoc,
} }
// replace placeholder with template name // replace placeholder with template name
aComment = aComment.replaceFirst("$", aName); maComment = maComment.replaceFirst("$", aName);
} }
void StyleSheetUndoAction::Undo() void StyleSheetUndoAction::Undo()
{ {
SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); SfxItemSet aNewSet( mpDoc->GetItemPool(), mpOldSet->GetRanges() );
SdrModel::MigrateItemSet( pOldSet.get(), &aNewSet, mpDoc ); SdrModel::MigrateItemSet( mpOldSet.get(), &aNewSet, mpDoc );
pStyleSheet->GetItemSet().Set(aNewSet); mpStyleSheet->GetItemSet().Set(aNewSet);
if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) if( mpStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
else else
pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); mpStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
} }
void StyleSheetUndoAction::Redo() void StyleSheetUndoAction::Redo()
{ {
SfxItemSet aNewSet( mpDoc->GetItemPool(), pOldSet->GetRanges() ); SfxItemSet aNewSet( mpDoc->GetItemPool(), mpOldSet->GetRanges() );
SdrModel::MigrateItemSet( pNewSet.get(), &aNewSet, mpDoc ); SdrModel::MigrateItemSet( mpNewSet.get(), &aNewSet, mpDoc );
pStyleSheet->GetItemSet().Set(aNewSet); mpStyleSheet->GetItemSet().Set(aNewSet);
if( pStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO ) if( mpStyleSheet->GetFamily() == SD_STYLE_FAMILY_PSEUDO )
static_cast<SdStyleSheet*>(pStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); static_cast<SdStyleSheet*>(mpStyleSheet)->GetRealStyleSheet()->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
else else
pStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED)); mpStyleSheet->Broadcast(SfxSimpleHint(SFX_HINT_DATACHANGED));
} }
OUString StyleSheetUndoAction::GetComment() const OUString StyleSheetUndoAction::GetComment() const
{ {
return aComment; return maComment;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -30,11 +30,11 @@ class SdDrawDocument; ...@@ -30,11 +30,11 @@ class SdDrawDocument;
class StyleSheetUndoAction : public SdUndoAction class StyleSheetUndoAction : public SdUndoAction
{ {
SfxStyleSheet* pStyleSheet; SfxStyleSheet* mpStyleSheet;
std::unique_ptr<SfxItemSet> pNewSet; std::unique_ptr<SfxItemSet> mpNewSet;
std::unique_ptr<SfxItemSet> pOldSet; std::unique_ptr<SfxItemSet> mpOldSet;
OUString aComment; OUString maComment;
public: public:
StyleSheetUndoAction(SdDrawDocument* pTheDoc, StyleSheetUndoAction(SdDrawDocument* pTheDoc,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment