From 8d8e10ab4c3ef890323dd9b21edab8e91b9068c2 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 19 Sep 2013 13:54:15 +0200 Subject: restore behaviour after OUString changes in commit ab0806e183fcdc8b2e4eca2d29b877a41f3ded8b, "convert sd/.../fuinsfil.hxx from String to OUString" my OUString conversion changed the behaviour of the x.Erase(x.Search()) operations. Change-Id: I0f7f342eb4caf277fe62c3c11d1aa2c74290e549 --- sd/source/ui/func/fuinsfil.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index d789de78a3c1..42e180ceae6c 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -446,7 +446,9 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) SdPage* pPage = static_cast(mpViewShell)->GetActualPage(); aLayoutName = pPage->GetLayoutName(); - aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR)); + sal_Int32 nIndex = aLayoutName.indexOf(SD_LT_SEPARATOR); + if( nIndex != -1 ) + aLayoutName = aLayoutName.copy(0, nIndex); pOutliner->SetPaperSize(pPage->GetSize()); @@ -583,7 +585,9 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) } SdPage* pPage = mpDoc->GetSdPage(nPage, PK_STANDARD); aLayoutName = pPage->GetLayoutName(); - aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR)); + sal_Int32 nIndex = aLayoutName.indexOf(SD_LT_SEPARATOR); + if( nIndex != -1 ) + aLayoutName = aLayoutName.copy(0, nIndex); /* create our own outline since: - it is possible that the document outliner is actually used in the -- cgit