From aa2a9c2c4a94bf12b723bb55aec1895309555ca4 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 19 Jan 2010 08:02:04 +0100 Subject: #i107450#: use reliable way to access attribute name strings --- cui/source/dialogs/srchxtra.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'cui/source') diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index 6b9f01fb9976..1daecd2d39bc 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -49,6 +49,7 @@ #include #include "backgrnd.hxx" #include // RID_SVXPAGE_... +#include // class SvxSearchFormatDialog ------------------------------------------- @@ -161,6 +162,7 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent, SfxObjectShell* pSh = SfxObjectShell::Current(); DBG_ASSERT( pSh, "No DocShell" ); + ResStringArray aAttrNames( SVX_RES( RID_ATTR_NAMES ) ); SfxItemPool& rPool = pSh->GetPool(); SfxItemSet aSet( rPool, pWhRanges ); SfxWhichIter aIter( aSet ); @@ -183,18 +185,14 @@ SvxSearchAttributeDialog::SvxSearchAttributeDialog( Window* pParent, } // item resources are in svx - USHORT nResId = nSlot - SID_SVX_START + RID_ATTR_BEGIN; + sal_uInt32 nId = aAttrNames.FindIndex( nSlot ); SvLBoxEntry* pEntry = NULL; - ResId aId( nResId, DIALOG_MGR() ); - aId.SetRT( RSC_STRING ); - if ( DIALOG_MGR().IsAvailable( aId ) ) - pEntry = aAttrLB.SvTreeListBox::InsertEntry( CUI_RESSTR( nResId ) ); + if ( RESARRAY_INDEX_NOTFOUND != nId ) + pEntry = aAttrLB.SvTreeListBox::InsertEntry( aAttrNames.GetString(nId) ); else { ByteString sError( "no resource for slot id\nslot = " ); sError += ByteString::CreateFromInt32( nSlot ); - sError += ByteString( "\nresid = " ); - sError += ByteString::CreateFromInt32( nResId ); DBG_ERRORFILE( sError.GetBuffer() ); } -- cgit v1.2.3