summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-09-25 18:14:47 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2014-10-06 11:09:06 +0200
commit87bd501da60e0976a9abc207a99b7dab1c9edf46 (patch)
tree08fdbf38f6be3a04263a466a22b29e22a4f168e6
parent4e98212a0faab7540d383c4210f32567fa640e9e (diff)
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.cxx14
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(),