summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2010-01-19 08:02:04 +0100
committerMathias Bauer <mba@openoffice.org>2010-01-19 08:02:04 +0100
commitaa2a9c2c4a94bf12b723bb55aec1895309555ca4 (patch)
treec8c6ca9cb83d473c5cc743f4d0e38ba16c428c3f /cui/source
parentedd01418d9b6650f6d923e84f335c90b7f001bb0 (diff)
#i107450#: use reliable way to access attribute name strings
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/srchxtra.cxx12
1 files changed, 5 insertions, 7 deletions
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 <dialmgr.hxx>
#include "backgrnd.hxx"
#include <svx/dialogs.hrc> // RID_SVXPAGE_...
+#include <tools/resary.hxx>
// 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() );
}