Kaydet (Commit) a2b86b5f authored tarafından Noel Grandin's avatar Noel Grandin

convert the rest of the .cxx files in sd from String to OUString

Change-Id: I2f68a14baf707d7098b84c68b11a85cd28e49d95
üst 0bfd0378
......@@ -82,8 +82,8 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
// now check for duplicate masterpage and layout names
// ===================================================
String aFullNameLayout( pBMMPage->GetLayoutName() );
aFullNameLayout.Erase( aFullNameLayout.SearchAscii( SD_LT_SEPARATOR ));
OUString aFullNameLayout( pBMMPage->GetLayoutName() );
aFullNameLayout = aFullNameLayout.copy(0, aFullNameLayout.indexOf( SD_LT_SEPARATOR ));
OUString aLayout(aFullNameLayout);
......@@ -97,8 +97,8 @@ void InsertBookmarkAsPage_FindDuplicateLayouts::operator()( SdDrawDocument& rDoc
{
// Do the layouts already exist within the document?
SdPage* pTestPage = (SdPage*) rDoc.GetMasterPage(nMPage);
String aFullTest(pTestPage->GetLayoutName());
aFullTest.Erase( aFullTest.SearchAscii( SD_LT_SEPARATOR ));
OUString aFullTest(pTestPage->GetLayoutName());
aFullTest = aFullTest.copy(0, aFullTest.indexOf( SD_LT_SEPARATOR ));
OUString aTest(aFullTest);
......@@ -815,8 +815,8 @@ sal_Bool SdDrawDocument::InsertBookmarkAsPage(
++pExchangeIter;
}
String aLayout(pRefPage->GetLayoutName());
aLayout.Erase(aLayout.SearchAscii( SD_LT_SEPARATOR ));
OUString aLayout(pRefPage->GetLayoutName());
aLayout = aLayout.copy(0, aLayout.indexOf( SD_LT_SEPARATOR ));
// update layout and referred master page
pRefPage->SetPresentationLayout(aLayout);
......@@ -1311,7 +1311,7 @@ bool isMasterPageLayoutNameUnique(const SdDrawDocument& rDoc, const OUString& rC
// #i121863# factored out functinality
OUString createNewMasterPageLayoutName(const SdDrawDocument& rDoc)
{
const String aBaseName(SdResId(STR_LAYOUT_DEFAULT_NAME));
const OUString aBaseName(SdResId(STR_LAYOUT_DEFAULT_NAME));
OUString aRetval;
sal_uInt16 nCount(0);
......@@ -1350,7 +1350,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if( bUndo )
{
pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), String());
pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), OUString());
}
SdPage* pSelectedPage = GetSdPage(nSdPageNum, PK_STANDARD);
......@@ -1360,9 +1360,9 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
SdPage* pMaster = NULL;
SdPage* pNotesMaster = NULL;
SdPage* pPage = NULL;
String aOldPageLayoutName(pSelectedPage->GetLayoutName());
String aOldLayoutName(aOldPageLayoutName);
aOldLayoutName.Erase(aOldLayoutName.SearchAscii( SD_LT_SEPARATOR ));
OUString aOldPageLayoutName(pSelectedPage->GetLayoutName());
OUString aOldLayoutName(aOldPageLayoutName);
aOldLayoutName = aOldLayoutName.copy(0, aOldLayoutName.indexOf( SD_LT_SEPARATOR ));
if (pSourceDoc)
{
......@@ -1421,8 +1421,8 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
return;
}
const String aOriginalNewLayoutName( pMaster->GetName() );
String aTargetNewLayoutName(aOriginalNewLayoutName);
const OUString aOriginalNewLayoutName( pMaster->GetName() );
OUString aTargetNewLayoutName(aOriginalNewLayoutName);
if (pSourceDoc != this)
{
......@@ -1443,15 +1443,15 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// layout name needs to be unique
aTargetNewLayoutName = pMaster->GetLayoutName();
aTargetNewLayoutName.Erase(aTargetNewLayoutName.SearchAscii(SD_LT_SEPARATOR));
aTargetNewLayoutName = aTargetNewLayoutName.copy(0, aTargetNewLayoutName.indexOf(SD_LT_SEPARATOR));
if(!isMasterPageLayoutNameUnique(*this, aTargetNewLayoutName))
{
aTargetNewLayoutName = createNewMasterPageLayoutName(*this);
String aTemp(aTargetNewLayoutName);
aTemp.AppendAscii(RTL_CONSTASCII_STRINGPARAM(SD_LT_SEPARATOR));
aTemp.Append(SD_RESSTR(STR_LAYOUT_OUTLINE));
OUString aTemp(aTargetNewLayoutName);
aTemp += SD_LT_SEPARATOR;
aTemp += SD_RESSTR(STR_LAYOUT_OUTLINE);
pMaster->SetName(aTargetNewLayoutName);
pMaster->SetLayoutName(aTemp);
......@@ -1476,7 +1476,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// Correct or create presentation templates --
// only worry about presentation templates
String aName;
OUString aName;
SdStyleSheetPool* pSourceStyleSheetPool = (SdStyleSheetPool*) pSourceDoc->GetStyleSheetPool();
pSourceStyleSheetPool->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
static_cast<SdStyleSheetPool*>( mxStyleSheetPool.get())->SetSearchMask(SD_STYLE_FAMILY_MASTERPAGE);
......@@ -1490,14 +1490,13 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// #i121863# search in source styles with original style name from source of
// evtl. cloned master (not-cloned, renamed for uniqueness)
if( aName.Search( aOriginalNewLayoutName ) == 0 )
if( aName.indexOf( aOriginalNewLayoutName ) == 0 )
{
// #i121863# build name of evtl. cloned master style to search for
if(aOriginalNewLayoutName != aTargetNewLayoutName)
{
const sal_uInt16 nPos(aName.SearchAscii(SD_LT_SEPARATOR));
aName.Erase(0, nPos);
aName.Insert(aTargetNewLayoutName, 0);
const sal_Int32 nPos(aName.indexOf(SD_LT_SEPARATOR));
aName = aTargetNewLayoutName + aName.copy(nPos);
}
SfxStyleSheet* pMySheet = static_cast<SfxStyleSheet*>( mxStyleSheetPool->Find(aName, SD_STYLE_FAMILY_MASTERPAGE) );
......@@ -1537,10 +1536,9 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// #i121863# re-create original name of styte used at page where to replace with
// this new style
String aTemp(pMySheet->GetName());
const sal_uInt16 nPos(aTemp.SearchAscii(SD_LT_SEPARATOR));
aTemp.Erase(0, nPos);
aTemp.Insert(aOldLayoutName, 0);
OUString aTemp(pMySheet->GetName());
const sal_Int32 nPos(aTemp.indexOf(SD_LT_SEPARATOR));
aTemp = aOldLayoutName + aTemp.copy(nPos);
aReplData.aName = aTemp;
aReplList.push_back(aReplData);
}
......@@ -1560,17 +1558,17 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
if (pSOld && pSNew)
{
const String& rParentOfOld = pSOld->GetParent();
const String& rParentOfNew = pSNew->GetParent();
const OUString& rParentOfOld = pSOld->GetParent();
const OUString& rParentOfNew = pSNew->GetParent();
if (rParentOfOld.Len() > 0 && rParentOfNew.Len() == 0)
if (!rParentOfOld.isEmpty() && rParentOfNew.isEmpty())
{
std::vector<StyleReplaceData>::iterator pRDIter;
for ( pRDIter = aReplList.begin(); pRDIter != aReplList.end(); ++pRDIter )
{
if ((pRDIter->aName == rParentOfOld) && (pRDIter->aName != pRDIter->aNewName))
{
String aParentOfNew(pRDIter->aNewName);
OUString aParentOfNew(pRDIter->aNewName);
pSNew->SetParent(aParentOfNew);
break;
}
......@@ -1595,9 +1593,9 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
// Create layout name based upon the name of the page layout of the
// master page
String aPageLayoutName(pMaster->GetLayoutName());
String aLayoutName = aPageLayoutName;
aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ));
OUString aPageLayoutName(pMaster->GetLayoutName());
OUString aLayoutName = aPageLayoutName;
aLayoutName = aLayoutName.copy( 0, aLayoutName.indexOf( SD_LT_SEPARATOR ));
// #i121863# Do *not* remove from original document any longer, it is potentially used there
// and would lead to crashes. Rely on the automatic process of removing unused masterpages
......@@ -1653,7 +1651,7 @@ void SdDrawDocument::SetMasterPage(sal_uInt16 nSdPageNum,
for (sal_uInt16 nPage = 1; nPage < GetPageCount(); nPage++)
{
pPage = (SdPage*) GetPage(nPage);
String aTest = pPage->GetLayoutName();
OUString aTest = pPage->GetLayoutName();
if (aTest == aOldPageLayoutName)
{
aPageList.push_back(pPage);
......
......@@ -568,14 +568,14 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, sal_Bool bVertical, const
SfxStyleSheet* SdPage::GetStyleSheetForMasterPageBackground() const
{
String aName(GetLayoutName());
String aSep( SD_LT_SEPARATOR );
sal_uInt16 nPos = aName.Search(aSep);
OUString aName(GetLayoutName());
OUString aSep( SD_LT_SEPARATOR );
sal_Int32 nPos = aName.indexOf(aSep);
if (nPos != STRING_NOTFOUND)
if (nPos != -1)
{
nPos = nPos + aSep.Len();
aName.Erase(nPos);
nPos = nPos + aSep.getLength();
aName = aName.copy(0, nPos);
}
aName += SD_RESSTR(STR_LAYOUT_BACKGROUND);
......@@ -587,13 +587,13 @@ SfxStyleSheet* SdPage::GetStyleSheetForMasterPageBackground() const
SfxStyleSheet* SdPage::GetStyleSheetForPresObj(PresObjKind eObjKind) const
{
String aName(GetLayoutName());
String aSep( SD_LT_SEPARATOR );
sal_uInt16 nPos = aName.Search(aSep);
if (nPos != STRING_NOTFOUND)
OUString aName(GetLayoutName());
OUString aSep( SD_LT_SEPARATOR );
sal_Int32 nPos = aName.indexOf(aSep);
if (nPos != -1)
{
nPos = nPos + aSep.Len();
aName.Erase(nPos);
nPos = nPos + aSep.getLength();
aName = aName.copy(0, nPos);
}
switch (eObjKind)
......@@ -636,9 +636,9 @@ SfxStyleSheet* SdPage::GetStyleSheetForPresObj(PresObjKind eObjKind) const
slides masterpage */
SdStyleSheet* SdPage::getPresentationStyle( sal_uInt32 nHelpId ) const
{
String aStyleName( pPage->GetLayoutName() );
const String aSep( SD_LT_SEPARATOR );
aStyleName.Erase(aStyleName.Search(aSep) + aSep.Len());
OUString aStyleName( pPage->GetLayoutName() );
const OUString aSep( SD_LT_SEPARATOR );
aStyleName = aStyleName.copy(0, aStyleName.indexOf(aSep) + aSep.getLength());
sal_uInt16 nNameId;
switch( nHelpId )
......@@ -662,11 +662,11 @@ SdStyleSheet* SdPage::getPresentationStyle( sal_uInt32 nHelpId ) const
OSL_FAIL( "SdPage::getPresentationStyle(), illegal argument!" );
return 0;
}
aStyleName.Append( SD_RESSTR( nNameId ) );
aStyleName += SD_RESSTR( nNameId );
if( nNameId == STR_LAYOUT_OUTLINE )
{
aStyleName.Append( sal_Unicode( ' ' ));
aStyleName.Append( OUString::number( sal_Int32( nHelpId - HID_PSEUDOSHEET_OUTLINE )));
aStyleName += " ";
aStyleName += OUString::number( sal_Int32( nHelpId - HID_PSEUDOSHEET_OUTLINE ));
}
SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
......
......@@ -154,20 +154,18 @@ void SdPage::SetPresentationLayout(const OUString& rLayoutName,
{
if (!bListsFilled || !bReplaceStyleSheets)
{
String aFullName;
String aOldFullName;
OUString aFullName;
OUString aOldFullName;
SfxStyleSheetBase* pSheet = NULL;
SfxStyleSheetBasePool* pStShPool = pModel->GetStyleSheetPool();
for (sal_Int16 i = -1; i < 9; i++)
{
aFullName = maLayoutName;
aOldFullName = aOldLayoutName;
aFullName += sal_Unicode( ' ' );
aFullName += OUString::number( (sal_Int32) (i <= 0 ) ? 1 : i + 1);
aOldFullName += sal_Unicode( ' ' );
aOldFullName += OUString::number( (sal_Int32) (i <= 0 ) ? 1 : i + 1 );
aFullName = maLayoutName + " " +
OUString::number( (sal_Int32) (i <= 0 ) ? 1 : i + 1) +
" " +
OUString::number( (sal_Int32) (i <= 0 ) ? 1 : i + 1 );
pSheet = pStShPool->Find(aOldFullName, SD_STYLE_FAMILY_MASTERPAGE);
DBG_ASSERT(pSheet, "Old outline style sheet not found");
aOldOutlineStyles.push_back(pSheet);
......@@ -268,8 +266,8 @@ void SdPage::EndListenOutlineText()
{
SdStyleSheetPool* pSPool = (SdStyleSheetPool*)pModel->GetStyleSheetPool();
DBG_ASSERT(pSPool, "StyleSheetPool missing");
String aTrueLayoutName(maLayoutName);
aTrueLayoutName.Erase( aTrueLayoutName.SearchAscii( SD_LT_SEPARATOR ));
OUString aTrueLayoutName(maLayoutName);
aTrueLayoutName = aTrueLayoutName.copy(0, aTrueLayoutName.indexOf( SD_LT_SEPARATOR ));
SfxStyleSheet *pSheet = NULL;
std::vector<SfxStyleSheetBase*> aOutlineStyles;
......@@ -403,7 +401,7 @@ SdPage::SdPage(const SdPage& rSrcPage)
maSoundFile = rSrcPage.maSoundFile;
mbLoopSound = rSrcPage.mbLoopSound;
mbStopSound = rSrcPage.mbStopSound;
maCreatedPageName = String();
maCreatedPageName = "";
maFileName = rSrcPage.maFileName;
maBookmarkName = rSrcPage.maBookmarkName;
mbScaleObjects = rSrcPage.mbScaleObjects;
......
......@@ -208,9 +208,9 @@ OUString SAL_CALL SdStyleFamily::getName() throw (RuntimeException)
if( pPage == 0 )
throw DisposedException();
String aLayoutName( pPage->GetLayoutName() );
const String aSep( SD_LT_SEPARATOR );
aLayoutName.Erase(aLayoutName.Search(aSep));
OUString aLayoutName( pPage->GetLayoutName() );
const OUString aSep( SD_LT_SEPARATOR );
aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(aSep));
return OUString( aLayoutName );
}
......
......@@ -201,7 +201,7 @@ void ImagePreparer::sendNotes( sal_uInt32 aSlideNumber )
Transmitter::PRIORITY_LOW );
}
sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, String aUrl );
sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, OUString aUrl );
// Code copied from sdremote/source/presenter/PresenterNotesView.cxx
OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
......@@ -283,7 +283,7 @@ OString ImagePreparer::prepareNotes( sal_uInt32 aSlideNumber )
aRet.makeStringAndClear(), RTL_TEXTENCODING_UTF8 );
}
sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, String aUrl )
sal_Bool ExportTo( uno::Reference< drawing::XDrawPage>& aNotesPage, OUString aUrl )
{
OUString aFilterName( "XHTML Draw File" );
uno::Reference< document::XExporter > xExporter;
......
......@@ -146,7 +146,7 @@ void CurrentMasterPagesSelector::Fill (ItemList& rItemList)
continue;
// Use the name of the master page to avoid duplicate entries.
String sName (pMasterPage->GetName());
OUString sName (pMasterPage->GetName());
if (aMasterPageNames.find(sName)!=aMasterPageNames.end())
continue;
aMasterPageNames.insert (sName);
......@@ -159,9 +159,9 @@ void CurrentMasterPagesSelector::Fill (ItemList& rItemList)
SharedMasterPageDescriptor pDescriptor (new MasterPageDescriptor(
MasterPageContainer::MASTERPAGE,
nIndex,
String(),
OUString(),
pMasterPage->GetName(),
String(),
OUString(),
pMasterPage->IsPrecious(),
::boost::shared_ptr<PageObjectProvider>(new ExistingPageProvider(pMasterPage)),
::boost::shared_ptr<PreviewProvider>(new PagePreviewProvider())));
......@@ -221,7 +221,7 @@ void CurrentMasterPagesSelector::UpdateSelection (void)
sal_uInt16 nItemCount (PreviewValueSet::GetItemCount());
for (nIndex=1; nIndex<=nItemCount && bLoop; nIndex++)
{
String sName (PreviewValueSet::GetItemText (nIndex));
OUString sName (PreviewValueSet::GetItemText (nIndex));
if (aNames.find(sName) != aNames.end())
{
PreviewValueSet::SelectItem (nIndex);
......
......@@ -262,8 +262,8 @@ void DocumentHelper::ProvideStyles (
SdPage* pPage)
{
// Get the layout name of the given page.
String sLayoutName (pPage->GetLayoutName());
sLayoutName.Erase (sLayoutName.SearchAscii (SD_LT_SEPARATOR));
OUString sLayoutName (pPage->GetLayoutName());
sLayoutName = sLayoutName.copy(0, sLayoutName.indexOf(SD_LT_SEPARATOR));
// Copy the style sheet from source to target document.
SdStyleSheetPool* pSourceStyleSheetPool =
......@@ -306,8 +306,8 @@ void DocumentHelper::AssignMasterPageToPageList (
// Make the layout name by stripping ouf the layout postfix from the
// layout name of the given master page.
OUString sFullLayoutName(pMasterPage->GetLayoutName());
String sBaseLayoutName (sFullLayoutName);
sBaseLayoutName.Erase (sBaseLayoutName.SearchAscii (SD_LT_SEPARATOR));
OUString sBaseLayoutName (sFullLayoutName);
sBaseLayoutName = sBaseLayoutName.copy(0, sBaseLayoutName.indexOf(SD_LT_SEPARATOR));
if (rpPageList->empty())
return;
......@@ -329,7 +329,7 @@ void DocumentHelper::AssignMasterPageToPageList (
::svl::IUndoManager* pUndoMgr = rTargetDocument.GetDocSh()->GetUndoManager();
if( pUndoMgr )
pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), String());
pUndoMgr->EnterListAction(SD_RESSTR(STR_UNDO_SET_PRESLAYOUT), OUString());
SdPage* pMasterPageInDocument = ProvideMasterPage(rTargetDocument,pMasterPage,rpPageList);
if (pMasterPageInDocument == NULL)
......
......@@ -583,7 +583,7 @@ SfxRequest LayoutMenu::CreateRequest (
SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers());
aRequest.AppendItem(
SfxStringItem (ID_VAL_PAGENAME, String()));//pPage->GetName()));
SfxStringItem (ID_VAL_PAGENAME, OUString()));//pPage->GetName()));
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, aLayout));
aRequest.AppendItem(
SfxBoolItem(ID_VAL_ISPAGEBACK, aVisibleLayers.IsSet(aBackground)));
......@@ -654,7 +654,7 @@ void LayoutMenu::Fill (void)
if (bRightToLeft && (WritingMode_TB_RL != pInfo->meWritingMode))
aBmp.Mirror (BMP_MIRROR_HORZ);
InsertItem (i, aBmp, String (SdResId (pInfo->mnStrResId)));
InsertItem (i, aBmp, SdResId (pInfo->mnStrResId));
SetItemData (i, new AutoLayout(pInfo->maAutoLayout));
n++;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment