diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-09-25 18:14:47 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-10-06 11:09:06 +0200 |
commit | 87bd501da60e0976a9abc207a99b7dab1c9edf46 (patch) | |
tree | 08fdbf38f6be3a04263a466a22b29e22a4f168e6 | |
parent | fdo#83753: consider JAVA_HOME and PATH when selecting JRE (diff) | |
download | core-87bd501da60e0976a9abc207a99b7dab1c9edf46.tar.gz core-87bd501da60e0976a9abc207a99b7dab1c9edf46.zip |
i#101283 Fix collapsed bookmark handling
Correctly position the insert cursor in the case of a collapsed
bookmark.
Change-Id: I46707ab0e019aec1050864c9cb404a834e9a67fe
-rw-r--r-- | xmloff/source/text/XMLTextMarkImportContext.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/xmloff/source/text/XMLTextMarkImportContext.cxx b/xmloff/source/text/XMLTextMarkImportContext.cxx index ae89ab099658..acb67b5fd8b1 100644 --- a/xmloff/source/text/XMLTextMarkImportContext.cxx +++ b/xmloff/source/text/XMLTextMarkImportContext.cxx @@ -274,10 +274,16 @@ void XMLTextMarkImportContext::EndElement() m_rHelper.GetText()->createTextCursorByRange( xEndRange); try { - xInsertionCursor->gotoRange(xStartRange, sal_True); - } catch (uno::Exception&) { - OSL_ENSURE(false, - "cannot go to end position of bookmark"); + xInsertionCursor->gotoRange(xStartRange, sal_True); + if (xInsertionCursor->isCollapsed()) + { + xInsertionCursor = m_rHelper.GetText()->createTextCursorByRange(xStartRange); + xInsertionCursor->gotoRange(xStartRange, sal_False); + } + } + catch (uno::Exception&) + { + OSL_ENSURE(false, "cannot go to end position of bookmark"); } //DBG_ASSERT(! xInsertionCursor->isCollapsed(), |