summaryrefslogtreecommitdiffstats
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-09-19 13:51:47 +0200
committerNoel Grandin <noel@peralex.com>2013-09-19 13:54:39 +0200
commit7c34df7c6a65ce2ed616f6013f39121ce90e7c6b (patch)
treeb818fc3833af7330c1f9a49673b4e80e55816338 /sd
parentrestore behaviour after OUString changes (diff)
downloadcore-7c34df7c6a65ce2ed616f6013f39121ce90e7c6b.tar.gz
core-7c34df7c6a65ce2ed616f6013f39121ce90e7c6b.zip
restore behaviour after OUString changes
in commit 15d88e256dcf4d0bf567b5f320cefe55179e4bd8, "convert more .cxx files in sd from String to OUString" my OUString conversion changed the behaviour of the x.Erase(x.Search()) operations. Change-Id: I8150fdecde439fdc5eeae53d50ad0dd00c0c1879
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx4
-rw-r--r--sd/source/ui/toolpanel/controls/DocumentHelper.cxx8
2 files changed, 9 insertions, 3 deletions
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index cf64461dd4be..87b4acbe9770 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -872,7 +872,9 @@ void SlotManager::GetStatusBarState (SfxItemSet& rSet)
{
pFirstPage = pPage;
aLayoutStr = pFirstPage->GetLayoutName();
- aLayoutStr = aLayoutStr.copy(0, aLayoutStr.indexOf( SD_LT_SEPARATOR ) );
+ sal_Int32 nIndex = aLayoutStr.indexOf( SD_LT_SEPARATOR );
+ if( nIndex != -1 )
+ aLayoutStr = aLayoutStr.copy(0, nIndex);
rSet.Put( SfxStringItem( SID_STATUS_LAYOUT, aLayoutStr ) );
}
if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_ZOOMSLIDER ) )
diff --git a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
index 74848dd8a3c3..ff8dcb24c4bc 100644
--- a/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
+++ b/sd/source/ui/toolpanel/controls/DocumentHelper.cxx
@@ -264,7 +264,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 =
@@ -308,7 +310,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;