Constify some OUStrings and avoid some appends
Change-Id: Id90d02bab3c3a3b3e2e59097fdf741e2de2b331c
This commit is contained in:
@@ -153,10 +153,10 @@ void SwFldDokPage::Reset(const SfxItemSet& )
|
|||||||
|
|
||||||
if( !IsRefresh() )
|
if( !IsRefresh() )
|
||||||
{
|
{
|
||||||
OUString sUserData = GetUserData();
|
const OUString sUserData = GetUserData();
|
||||||
if (sUserData.getToken(0, ';').equalsIgnoreAsciiCase(USER_DATA_VERSION_1))
|
if (sUserData.getToken(0, ';').equalsIgnoreAsciiCase(USER_DATA_VERSION_1))
|
||||||
{
|
{
|
||||||
OUString sVal = sUserData.getToken(1, ';');
|
const OUString sVal = sUserData.getToken(1, ';');
|
||||||
const sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.toInt32());
|
const sal_uInt16 nVal = static_cast< sal_uInt16 >(sVal.toInt32());
|
||||||
if(nVal != USHRT_MAX)
|
if(nVal != USHRT_MAX)
|
||||||
{
|
{
|
||||||
@@ -257,7 +257,7 @@ IMPL_LINK_NOARG(SwFldDokPage, TypeHdl)
|
|||||||
|
|
||||||
case TYP_AUTHORFLD:
|
case TYP_AUTHORFLD:
|
||||||
{
|
{
|
||||||
OUString sFmt(GetFldMgr().GetFormatStr(nTypeId, i));
|
const OUString sFmt(GetFldMgr().GetFormatStr(nTypeId, i));
|
||||||
nPos = m_pSelectionLB->InsertEntry(sFmt);
|
nPos = m_pSelectionLB->InsertEntry(sFmt);
|
||||||
m_pSelectionLB->SetEntryData(nPos, reinterpret_cast<void*>(i));
|
m_pSelectionLB->SetEntryData(nPos, reinterpret_cast<void*>(i));
|
||||||
m_pSelectionLB->SelectEntry(GetFldMgr().GetFormatStr(nTypeId, GetCurField()->GetFormat()));
|
m_pSelectionLB->SelectEntry(GetFldMgr().GetFormatStr(nTypeId, GetCurField()->GetFormat()));
|
||||||
@@ -524,8 +524,8 @@ IMPL_LINK_NOARG(SwFldDokPage, FormatHdl)
|
|||||||
// Prev/Next - PageNumFields special treatment:
|
// Prev/Next - PageNumFields special treatment:
|
||||||
sal_uInt16 nTmp = (sal_uInt16)(sal_uLong)m_pFormatLB->GetEntryData(
|
sal_uInt16 nTmp = (sal_uInt16)(sal_uLong)m_pFormatLB->GetEntryData(
|
||||||
m_pFormatLB->GetSelectEntryPos() );
|
m_pFormatLB->GetSelectEntryPos() );
|
||||||
OUString sOldTxt( m_pValueFT->GetText() );
|
const OUString sOldTxt( m_pValueFT->GetText() );
|
||||||
OUString sNewTxt( SW_RES( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE
|
const OUString sNewTxt( SW_RES( SVX_NUM_CHAR_SPECIAL == nTmp ? STR_VALUE
|
||||||
: STR_OFFSET ));
|
: STR_OFFSET ));
|
||||||
|
|
||||||
if( sOldTxt != sNewTxt )
|
if( sOldTxt != sNewTxt )
|
||||||
@@ -643,15 +643,11 @@ sal_uInt16 SwFldDokPage::GetGroup()
|
|||||||
|
|
||||||
void SwFldDokPage::FillUserData()
|
void SwFldDokPage::FillUserData()
|
||||||
{
|
{
|
||||||
OUString sData(USER_DATA_VERSION);
|
const sal_Int32 nEntryPos = m_pTypeLB->GetSelectEntryPos();
|
||||||
sData += ";";
|
const sal_uInt16 nTypeSel = ( LISTBOX_ENTRY_NOTFOUND == nEntryPos )
|
||||||
sal_Int32 nTypeSel = m_pTypeLB->GetSelectEntryPos();
|
? USHRT_MAX : sal::static_int_cast< sal_uInt16 >
|
||||||
if( LISTBOX_ENTRY_NOTFOUND == nTypeSel )
|
(reinterpret_cast< sal_uIntPtr >(m_pTypeLB->GetEntryData( nEntryPos )));
|
||||||
nTypeSel = USHRT_MAX;
|
SetUserData(USER_DATA_VERSION ";" + OUString::number( nTypeSel ));
|
||||||
else
|
|
||||||
nTypeSel = sal::static_int_cast< sal_uInt16 >(reinterpret_cast< sal_uIntPtr >(m_pTypeLB->GetEntryData( nTypeSel )));
|
|
||||||
sData += OUString::number( nTypeSel );
|
|
||||||
SetUserData(sData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Reference in New Issue
Block a user