summaryrefslogtreecommitdiffstats
path: root/sw/source/core/doc/DocumentContentOperationsManager.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/core/doc/DocumentContentOperationsManager.cxx')
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 21f67d9a9774..a87dc20f8516 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -626,18 +626,21 @@ namespace sw
}
while (!startedFields.empty())
{
- SwPosition const& rStart(std::get<0>(startedFields.top())->GetMarkStart());
- std::pair<SwNodeOffset, sal_Int32> const pos(
- rStart.GetNodeIndex(), rStart.GetContentIndex());
- auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), pos);
- assert(it == rBreaks.end() || *it != pos);
- rBreaks.insert(it, pos);
+ if (const sw::mark::IFieldmark* pMark = std::get<0>(startedFields.top()))
+ {
+ SwPosition const& rStart(pMark->GetMarkStart());
+ std::pair<SwNodeOffset, sal_Int32> const pos(
+ rStart.GetNodeIndex(), rStart.GetContentIndex());
+ auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), pos);
+ assert(it == rBreaks.end() || *it != pos);
+ rBreaks.insert(it, pos);
+ }
if (std::get<1>(startedFields.top()))
{
std::pair<SwNodeOffset, sal_Int32> const posSep(
std::get<2>(startedFields.top()),
std::get<3>(startedFields.top()));
- it = std::lower_bound(rBreaks.begin(), rBreaks.end(), posSep);
+ auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), posSep);
assert(it == rBreaks.end() || *it != posSep);
rBreaks.insert(it, posSep);
}