Kaydet (Commit) a3fb06a0 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 6c52a8b9
...@@ -37,14 +37,16 @@ namespace sw { namespace mark ...@@ -37,14 +37,16 @@ namespace sw { namespace mark
const OUString& rName, const OUString& rName,
const OUString& rShortName, const OUString& rShortName,
const OUString& rPrefix) 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 ), OSL_ENSURE( IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( rPaM ),
"<CrossRefBookmark::CrossRefBookmark(..)>" "<CrossRefBookmark::CrossRefBookmark(..)>"
"- creation of cross-reference bookmark with an illegal PaM that does not expand over exactly one whole paragraph."); "- creation of cross-reference bookmark with an illegal PaM that does not expand over exactly one whole paragraph.");
SetMarkPos(*rPaM.Start());
if(rName.isEmpty()) if(rName.isEmpty())
m_aName = MarkBase::GenerateNewName(rPrefix); m_aName = MarkBase::GenerateNewName(rPrefix);
assert(!m_pPos2);
} }
void CrossRefBookmark::SetMarkPos(const SwPosition& rNewPos) void CrossRefBookmark::SetMarkPos(const SwPosition& rNewPos)
......
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