sw: convert SwCaptionOptPage to OUString

Change-Id: Ibd54c1472a3f86a0799386e4cf5e929d73ac104d
This commit is contained in:
Michael Stahl
2013-08-07 14:34:05 +02:00
parent 40b4567be2
commit af2d474ff9
3 changed files with 48 additions and 52 deletions

View File

@@ -161,7 +161,7 @@ sal_Bool SwCondCollPage::FillItemSet(SfxItemSet &rSet)
SwCondCollItem aCondItem; SwCondCollItem aCondItem;
for(sal_uInt16 i = 0; i < aStrArr.Count(); i++) for(sal_uInt16 i = 0; i < aStrArr.Count(); i++)
{ {
String sEntry = aTbLinks.GetEntryText(i, 1); OUString sEntry = aTbLinks.GetEntryText(i, 1);
aCondItem.SetStyle( &sEntry, i); aCondItem.SetStyle( &sEntry, i);
} }
rSet.Put(aCondItem); rSet.Put(aCondItem);

View File

@@ -398,16 +398,16 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet )
aCharStyleLB (this, SW_RES(LB_CHARSTYLE )), aCharStyleLB (this, SW_RES(LB_CHARSTYLE )),
aApplyBorderCB (this, SW_RES(CB_APPLYBORDER)), aApplyBorderCB (this, SW_RES(CB_APPLYBORDER)),
sSWTable (SW_RES(STR_TABLE )), m_sSWTable (SW_RES(STR_TABLE )),
sSWFrame (SW_RES(STR_FRAME )), m_sSWFrame (SW_RES(STR_FRAME )),
sSWGraphic (SW_RES(STR_GRAPHIC )), m_sSWGraphic (SW_RES(STR_GRAPHIC )),
sOLE (SW_RES(STR_OLE )), m_sOLE (SW_RES(STR_OLE )),
sBegin (SW_RESSTR(STR_BEGINNING )), m_sBegin (SW_RESSTR(STR_BEGINNING )),
sEnd (SW_RESSTR(STR_END )), m_sEnd (SW_RESSTR(STR_END )),
sAbove (SW_RESSTR(STR_ABOVE )), m_sAbove (SW_RESSTR(STR_ABOVE )),
sBelow (SW_RESSTR(STR_CP_BELOW )), m_sBelow (SW_RESSTR(STR_CP_BELOW )),
sNone (SW_RESSTR( STR_CATEGORY_NONE )), m_sNone (SW_RESSTR( STR_CATEGORY_NONE )),
pMgr (new SwFldMgr()), pMgr (new SwFldMgr()),
bHTMLMode(sal_False) bHTMLMode(sal_False)
@@ -415,15 +415,10 @@ SwCaptionOptPage::SwCaptionOptPage( Window* pParent, const SfxItemSet& rSet )
Wallpaper aBack( GetSettings().GetStyleSettings().GetWindowColor() ); Wallpaper aBack( GetSettings().GetStyleSettings().GetWindowColor() );
aPreview.SetBackground( aBack ); aPreview.SetBackground( aBack );
OUString tmp1, tmp2, tmp3, tmp4; //FIXME SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_ABB, m_sIllustration);
SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_ABB, tmp1); SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_TABLE, m_sTable);
SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_TABLE, tmp2); SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_FRAME, m_sText);
SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_FRAME, tmp3); SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_DRAWING, m_sDrawing);
SwStyleNameMapper::FillUIName(RES_POOLCOLL_LABEL_DRAWING, tmp4);
sIllustration = tmp1;
sTable = tmp2;
sText = tmp3;
sDrawing = tmp4;
sal_uInt16 i, nCount; sal_uInt16 i, nCount;
SwWrtShell *pSh = ::GetActiveWrtShell(); SwWrtShell *pSh = ::GetActiveWrtShell();
@@ -548,11 +543,11 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
// Writer objects // Writer objects
sal_uInt16 nPos = 0; sal_uInt16 nPos = 0;
aCheckLB.InsertEntry(sSWTable); aCheckLB.InsertEntry(m_sSWTable);
SetOptions(nPos++, TABLE_CAP); SetOptions(nPos++, TABLE_CAP);
aCheckLB.InsertEntry(sSWFrame); aCheckLB.InsertEntry(m_sSWFrame);
SetOptions(nPos++, FRAME_CAP); SetOptions(nPos++, FRAME_CAP);
aCheckLB.InsertEntry(sSWGraphic); aCheckLB.InsertEntry(m_sSWGraphic);
SetOptions(nPos++, GRAPHIC_CAP); SetOptions(nPos++, GRAPHIC_CAP);
// get Productname and -version // get Productname and -version
@@ -568,10 +563,11 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet)
for ( sal_uLong i = 0; i < aObjS.Count(); ++i ) for ( sal_uLong i = 0; i < aObjS.Count(); ++i )
{ {
const SvGlobalName &rOleId = aObjS[i].GetClassName(); const SvGlobalName &rOleId = aObjS[i].GetClassName();
const String* pClassName = &aObjS[i].GetHumanName(); String sClass;
if ( rOleId == SvGlobalName( SO3_OUT_CLASSID ) ) if (rOleId == SvGlobalName(SO3_OUT_CLASSID))
pClassName = &sOLE; sClass = aObjS[i].GetHumanName();
String sClass( *pClassName ); else
sClass = m_sOLE;
// don't show product version // don't show product version
sClass.SearchAndReplace( sComplete, sWithoutVersion ); sClass.SearchAndReplace( sComplete, sWithoutVersion );
aCheckLB.InsertEntry( sClass ); aCheckLB.InsertEntry( sClass );
@@ -645,7 +641,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl)
InsCaptionOpt* pOpt = (InsCaptionOpt*)pSelEntry->GetUserData(); InsCaptionOpt* pOpt = (InsCaptionOpt*)pSelEntry->GetUserData();
aCategoryBox.Clear(); aCategoryBox.Clear();
aCategoryBox.InsertEntry( sNone ); aCategoryBox.InsertEntry(String(m_sNone)); //FIXME
if (pSh) if (pSh)
{ {
sal_uInt16 nCount = pMgr->GetFldTypeCount(); sal_uInt16 nCount = pMgr->GetFldTypeCount();
@@ -660,16 +656,16 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl)
} }
else else
{ {
aCategoryBox.InsertEntry(SwBoxEntry(sIllustration)); aCategoryBox.InsertEntry(SwBoxEntry(m_sIllustration));
aCategoryBox.InsertEntry(SwBoxEntry(sTable)); aCategoryBox.InsertEntry(SwBoxEntry(m_sTable));
aCategoryBox.InsertEntry(SwBoxEntry(sText)); aCategoryBox.InsertEntry(SwBoxEntry(m_sText));
aCategoryBox.InsertEntry(SwBoxEntry(sDrawing)); aCategoryBox.InsertEntry(SwBoxEntry(m_sDrawing));
} }
if(pOpt->GetCategory().Len()) if(pOpt->GetCategory().Len())
aCategoryBox.SetText(pOpt->GetCategory()); aCategoryBox.SetText(pOpt->GetCategory());
else else
aCategoryBox.SetText( sNone ); aCategoryBox.SetText(m_sNone);
if (pOpt->GetCategory().Len() && if (pOpt->GetCategory().Len() &&
aCategoryBox.GetEntryPos(OUString(pOpt->GetCategory())) == COMBOBOX_ENTRY_NOTFOUND) aCategoryBox.GetEntryPos(OUString(pOpt->GetCategory())) == COMBOBOX_ENTRY_NOTFOUND)
aCategoryBox.InsertEntry(pOpt->GetCategory()); aCategoryBox.InsertEntry(pOpt->GetCategory());
@@ -702,12 +698,12 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ShowEntryHdl)
case GRAPHIC_CAP: case GRAPHIC_CAP:
case TABLE_CAP: case TABLE_CAP:
case OLE_CAP: case OLE_CAP:
aPosBox.InsertEntry(sAbove); aPosBox.InsertEntry(m_sAbove);
aPosBox.InsertEntry(sBelow); aPosBox.InsertEntry(m_sBelow);
break; break;
case FRAME_CAP: case FRAME_CAP:
aPosBox.InsertEntry(sBegin); aPosBox.InsertEntry(m_sBegin);
aPosBox.InsertEntry(sEnd); aPosBox.InsertEntry(m_sEnd);
break; break;
} }
aPosBox.SelectEntryPos(pOpt->GetPos()); aPosBox.SelectEntryPos(pOpt->GetPos());
@@ -752,7 +748,7 @@ void SwCaptionOptPage::SaveEntry(SvTreeListEntry* pEntry)
pOpt->UseCaption() = aCheckLB.IsChecked((sal_uInt16)aCheckLB.GetModel()->GetAbsPos(pEntry)); pOpt->UseCaption() = aCheckLB.IsChecked((sal_uInt16)aCheckLB.GetModel()->GetAbsPos(pEntry));
String aName( aCategoryBox.GetText() ); String aName( aCategoryBox.GetText() );
if(aName == sNone) if (aName == m_sNone)
pOpt->SetCategory(aEmptyStr); pOpt->SetCategory(aEmptyStr);
else else
pOpt->SetCategory(comphelper::string::strip(aName, ' ')); pOpt->SetCategory(comphelper::string::strip(aName, ' '));
@@ -780,7 +776,7 @@ IMPL_LINK_NOARG(SwCaptionOptPage, ModifyHdl)
PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL; PushButton *pBtn = pDlg ? pDlg->GetOKButton() : NULL;
if (pBtn) if (pBtn)
pBtn->Enable(sFldTypeName.Len() != 0); pBtn->Enable(sFldTypeName.Len() != 0);
sal_Bool bEnable = aCategoryBox.IsEnabled() && sFldTypeName != sNone; sal_Bool bEnable = aCategoryBox.IsEnabled() && sFldTypeName != m_sNone;
aFormatText.Enable(bEnable); aFormatText.Enable(bEnable);
aFormatBox.Enable(bEnable); aFormatBox.Enable(bEnable);
@@ -819,7 +815,7 @@ void SwCaptionOptPage::DrawSample()
{ {
String aStr; String aStr;
if( aCategoryBox.GetText() != OUString(sNone)) if( aCategoryBox.GetText() != m_sNone)
{ {
//#i61007# order of captions //#i61007# order of captions
bool bOrderNumberingFirst = aLbCaptionOrder.GetSelectEntryPos() == 1; bool bOrderNumberingFirst = aLbCaptionOrder.GetSelectEntryPos() == 1;

View File

@@ -134,22 +134,22 @@ private:
ListBox aCharStyleLB; ListBox aCharStyleLB;
CheckBox aApplyBorderCB; CheckBox aApplyBorderCB;
String sSWTable; OUString m_sSWTable;
String sSWFrame; OUString m_sSWFrame;
String sSWGraphic; OUString m_sSWGraphic;
String sOLE; OUString m_sOLE;
String sIllustration; OUString m_sIllustration;
String sTable; OUString m_sTable;
String sText; OUString m_sText;
String sDrawing; OUString m_sDrawing;
String sBegin; OUString m_sBegin;
String sEnd; OUString m_sEnd;
String sAbove; OUString m_sAbove;
String sBelow; OUString m_sBelow;
String sNone; OUString m_sNone;
SwFldMgr *pMgr; SwFldMgr *pMgr;
bool bHTMLMode; bool bHTMLMode;