summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Timofeev <timofeev.i.s@gmail.com>2013-08-24 18:17:10 +0400
committerIvan Timofeev <timofeev.i.s@gmail.com>2013-08-24 22:23:18 +0400
commita0bfad8c0eed119af2aea71d4deebcd60ac3f4a5 (patch)
tree9b39088407c128437a557fd48a58092b1e45fa23
parentdb4154cc19c803707f34bdd5ce4e8a43eac528a6 (diff)
convert SdPresLayoutDlg to OUString
Change-Id: If21b54a9f8f17945e87363d9c370e756b6700831
-rw-r--r--sd/source/ui/dlg/sdpreslt.cxx37
-rw-r--r--sd/source/ui/inc/sdpreslt.hxx6
2 files changed, 20 insertions, 23 deletions
diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx
index bcb71e321339..ae074a713537 100644
--- a/sd/source/ui/dlg/sdpreslt.cxx
+++ b/sd/source/ui/dlg/sdpreslt.cxx
@@ -31,7 +31,6 @@
#include "sdpage.hxx"
#include "DrawDocShell.hxx"
-#define DOCUMENT_TOKEN (sal_Unicode('#'))
SdPresLayoutDlg::SdPresLayoutDlg(
::sd::DrawDocShell* pDocShell,
@@ -48,7 +47,7 @@ SdPresLayoutDlg::SdPresLayoutDlg(
maCbxCheckMasters (this, SdResId(CBX_CHECK_MASTERS)),
maBtnLoad (this, SdResId(BTN_LOAD)),
mrOutAttrs (rInAttrs),
- maStrNone ( SdResId( STR_NULL ) )
+ maStrNone (SD_RESSTR(STR_NULL))
{
FreeResource();
@@ -84,7 +83,7 @@ void SdPresLayoutDlg::Reset()
if(mrOutAttrs.GetItemState(ATTR_PRESLAYOUT_NAME, sal_True, &pPoolItem) == SFX_ITEM_SET)
maName = ((const SfxStringItem*)pPoolItem)->GetValue();
else
- maName.Erase();
+ maName = "";
FillValueSet();
@@ -109,19 +108,17 @@ void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs)
sal_Bool bLoad = nId > mnLayoutCount;
rOutAttrs.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad ) );
- String aLayoutName;
+ OUString aLayoutName;
if( bLoad )
{
- aLayoutName = maName;
- aLayoutName.Append( DOCUMENT_TOKEN );
- aLayoutName.Append( maLayoutNames[ nId - 1 ] );
+ aLayoutName = maName + "#" + maLayoutNames[ nId - 1 ];
}
else
{
aLayoutName = maLayoutNames[ nId - 1 ];
if( aLayoutName == maStrNone )
- aLayoutName.Erase(); // that way we encode "- nothing -" (see below)
+ aLayoutName = ""; // that way we encode "- nothing -" (see below)
}
rOutAttrs.Put( SfxStringItem( ATTR_PRESLAYOUT_NAME, aLayoutName ) );
@@ -151,9 +148,9 @@ void SdPresLayoutDlg::FillValueSet()
SdPage* pMaster = (SdPage*)pDoc->GetMasterPage(nLayout);
if (pMaster->GetPageKind() == PK_STANDARD)
{
- String aLayoutName(pMaster->GetLayoutName());
- aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ) );
- maLayoutNames.push_back(new String(aLayoutName));
+ OUString aLayoutName(pMaster->GetLayoutName());
+ aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR));
+ maLayoutNames.push_back(aLayoutName);
Bitmap aBitmap(mpDocSh->GetPagePreviewBitmap(pMaster, 90));
maVS.InsertItem((sal_uInt16)maLayoutNames.size(), aBitmap, aLayoutName);
@@ -204,7 +201,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
else
{
// that way we encode "- nothing -"
- maName.Erase();
+ maName = "";
}
}
break;
@@ -218,12 +215,12 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
{
// check if template already ecists
sal_Bool bExists = sal_False;
- String aCompareStr( maName );
- if( maName.Len() == 0 )
+ OUString aCompareStr(maName);
+ if (aCompareStr.isEmpty())
aCompareStr = maStrNone;
sal_uInt16 aPos = 0;
- for (boost::ptr_vector<String>::iterator it = maLayoutNames.begin();
+ for (std::vector<OUString>::iterator it = maLayoutNames.begin();
it != maLayoutNames.end() && !bExists; ++it, ++aPos)
{
if( aCompareStr == *it )
@@ -237,7 +234,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
if( !bExists )
{
// load document in order to determine preview bitmap (if template is selected)
- if( maName.Len() )
+ if (!maName.isEmpty())
{
// determine document in order to call OpenBookmarkDoc
SdDrawDocument* pDoc = mpDocSh->GetDoc();
@@ -254,9 +251,9 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
SdPage* pMaster = (SdPage*) pTemplDoc->GetMasterPage(nLayout);
if (pMaster->GetPageKind() == PK_STANDARD)
{
- String aLayoutName(pMaster->GetLayoutName());
- aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ) );
- maLayoutNames.push_back(new String(aLayoutName));
+ OUString aLayoutName(pMaster->GetLayoutName());
+ aLayoutName = aLayoutName.copy(0, aLayoutName.indexOf(SD_LT_SEPARATOR));
+ maLayoutNames.push_back(aLayoutName);
Bitmap aBitmap(pTemplDocSh->GetPagePreviewBitmap(pMaster, 90));
maVS.InsertItem((sal_uInt16)maLayoutNames.size(), aBitmap, aLayoutName);
@@ -273,7 +270,7 @@ IMPL_LINK_NOARG(SdPresLayoutDlg, ClickLoadHdl)
else
{
// empty layout
- maLayoutNames.push_back( new String( maStrNone ) );
+ maLayoutNames.push_back(maStrNone);
maVS.InsertItem( (sal_uInt16) maLayoutNames.size(),
Bitmap( SdResId( BMP_FOIL_NONE ) ), maStrNone );
}
diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx
index 8e04d1eede25..9bf09dd56aa3 100644
--- a/sd/source/ui/inc/sdpreslt.hxx
+++ b/sd/source/ui/inc/sdpreslt.hxx
@@ -64,11 +64,11 @@ private:
const SfxItemSet& mrOutAttrs;
- boost::ptr_vector<String> maLayoutNames;
+ std::vector<OUString> maLayoutNames;
- String maName; ///< layout name or file name
+ OUString maName; ///< layout name or file name
long mnLayoutCount; ///< number of master pages in the document
- const String maStrNone;
+ const OUString maStrNone;
void FillValueSet();
void Reset();