summaryrefslogtreecommitdiff
path: root/sw/source/core/undo/unattr.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/undo/unattr.cxx')
-rw-r--r--sw/source/core/undo/unattr.cxx26
1 files changed, 26 insertions, 0 deletions
diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx
index 9d279860c086..bb2cdcaa34bb 100644
--- a/sw/source/core/undo/unattr.cxx
+++ b/sw/source/core/undo/unattr.cxx
@@ -55,6 +55,7 @@
#include <charfmt.hxx>
#include <calbck.hxx>
#include <frameformats.hxx>
+#include <editsh.hxx>
SwUndoFormatAttrHelper::SwUndoFormatAttrHelper(SwFormat& rFormat, bool bSvDrwPt)
: SwClient(&rFormat)
@@ -575,6 +576,10 @@ void SwUndoResetAttr::UndoImpl(::sw::UndoRedoContext & rContext)
pTNd->DontExpandFormat( aIdx, false );
}
}
+ else if (m_nFormatId == RES_TXTATR_REFMARK)
+ {
+ rDoc.GetEditShell()->SwViewShell::UpdateFields();
+ }
AddUndoRedoPaM(rContext);
}
@@ -626,6 +631,27 @@ void SwUndoResetAttr::RedoImpl(::sw::UndoRedoContext & rContext)
}
}
break;
+ case RES_TXTATR_REFMARK:
+ {
+ SfxItemPool::Item2Range aRange = rDoc.GetAttrPool().GetItemSurrogates(RES_TXTATR_REFMARK);
+ SwHistoryHint* pHistoryHint = GetHistory()[0];
+ if (pHistoryHint && HSTRY_SETREFMARKHNT == pHistoryHint->Which())
+ {
+ for (const SfxPoolItem* pItem : aRange)
+ {
+ assert(dynamic_cast<const SwFormatRefMark*>(pItem));
+ const auto pFormatRefMark = static_cast<const SwFormatRefMark*>(pItem);
+ if (static_cast<SwHistorySetRefMark*>(pHistoryHint)->GetRefName() ==
+ pFormatRefMark->GetRefName())
+ {
+ rDoc.DeleteFormatRefMark(pFormatRefMark);
+ rDoc.GetEditShell()->SwViewShell::UpdateFields();
+ break;
+ }
+ }
+ }
+ }
+ break;
}
}