summaryrefslogtreecommitdiff
path: root/sd/source/ui/sidebar/DocumentHelper.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-19 13:23:24 +0200
committerNoel Grandin <noel@peralex.com>2013-09-19 13:54:38 +0200
commit3ea390cbd8fcb19dfefc0c8d8cf03510d3c6ea56 (patch)
tree9c905d876d98b0b530416e6ff4918475c7149719 /sd/source/ui/sidebar/DocumentHelper.cxx
parentf86404450621bbee6feaaee0f43f5e53d9501796 (diff)
restore behaviour after OUString changes
in commit a2b86b5fb75925e7e8b24751f83e1ecc8584cf72, my OUString conversion changed the behaviour of the x.Erase(x.Search()) operations. Change-Id: Iad91980322b8cb46e8b2040f3fbd4e6cc1176424
Diffstat (limited to 'sd/source/ui/sidebar/DocumentHelper.cxx')
-rw-r--r--sd/source/ui/sidebar/DocumentHelper.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/sd/source/ui/sidebar/DocumentHelper.cxx b/sd/source/ui/sidebar/DocumentHelper.cxx
index 5e3651e4c514..6eb8a21f044f 100644
--- a/sd/source/ui/sidebar/DocumentHelper.cxx
+++ b/sd/source/ui/sidebar/DocumentHelper.cxx
@@ -263,7 +263,9 @@ void DocumentHelper::ProvideStyles (
{
// Get the layout name of the given page.
OUString sLayoutName (pPage->GetLayoutName());
- sLayoutName = sLayoutName.copy(0, sLayoutName.indexOf(SD_LT_SEPARATOR));
+ sal_Int32 nIndex = sLayoutName.indexOf(SD_LT_SEPARATOR);
+ if( nIndex != -1 )
+ sLayoutName = sLayoutName.copy(0, nIndex);
// Copy the style sheet from source to target document.
SdStyleSheetPool* pSourceStyleSheetPool =
@@ -307,7 +309,9 @@ void DocumentHelper::AssignMasterPageToPageList (
// layout name of the given master page.
OUString sFullLayoutName(pMasterPage->GetLayoutName());
OUString sBaseLayoutName (sFullLayoutName);
- sBaseLayoutName = sBaseLayoutName.copy(0, sBaseLayoutName.indexOf(SD_LT_SEPARATOR));
+ sal_Int32 nIndex = sBaseLayoutName.indexOf(SD_LT_SEPARATOR);
+ if( nIndex != -1 )
+ sBaseLayoutName = sBaseLayoutName.copy(0, nIndex);
if (rpPageList->empty())
return;