diff options
authorMichael Stahl <>2014-11-03 17:17:57 +0100
committerMichael Stahl <>2014-11-03 17:59:21 +0100
commita3fb06a0a9d03e31a8472dcc3cc994faeb59718c (patch)
parent6c52a8b916e52c9ab33461e931a4e75b3dae04f7 (diff)
fdo#65163: sw: CrossRefBookmark: ensure that unused m_pPos2 is null
... to prevent ~SwIndexReg() assertion when the note it is initialized with is deleted, since m_pPos2 will never be corrected because CrossRefBookmark essentially denies that it exists. Change-Id: I48543c47da0f4006e8381f4cc8a2ee81826461c9
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/core/crsr/crossrefbookmark.cxx b/sw/source/core/crsr/crossrefbookmark.cxx
index 269af4e5f2cb..2096314e19ea 100644
--- a/sw/source/core/crsr/crossrefbookmark.cxx
+++ b/sw/source/core/crsr/crossrefbookmark.cxx
@@ -37,14 +37,16 @@ namespace sw { namespace mark
const OUString& rName,
const OUString& rShortName,
const OUString& rPrefix)
- : Bookmark(rPaM, rCode, rName, rShortName)
+ : Bookmark(
+ // ensure that m_pPos2 is null by only passing start to super
+ SwPaM(*rPaM.Start()), rCode, rName, rShortName)
OSL_ENSURE( IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( rPaM ),
"- creation of cross-reference bookmark with an illegal PaM that does not expand over exactly one whole paragraph.");
- SetMarkPos(*rPaM.Start());
m_aName = MarkBase::GenerateNewName(rPrefix);
+ assert(!m_pPos2);
void CrossRefBookmark::SetMarkPos(const SwPosition& rNewPos)