diff options
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 10 | ||||
-rw-r--r-- | extensions/source/propctrlr/formres.src | 11 | ||||
-rw-r--r-- | extensions/source/propctrlr/formresid.hrc | 4 | ||||
-rw-r--r-- | extensions/source/propctrlr/handlerhelper.cxx | 10 | ||||
-rw-r--r-- | extensions/source/propctrlr/propres.src | 12 | ||||
-rw-r--r-- | extensions/source/propctrlr/propresid.hrc | 3 | ||||
-rw-r--r-- | extensions/source/propctrlr/stringrepresentation.cxx | 11 |
7 files changed, 39 insertions, 22 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 69c26cbba..b5c966fa6 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -114,6 +114,7 @@ #include <tools/diagnose_ex.h> #include <cppuhelper/exc_hlp.hxx> #include <connectivity/dbconversion.hxx> +#include <tools/StringListResource.hxx> #include <limits> @@ -1164,19 +1165,16 @@ namespace pcr // boolean values if ( eType == TypeClass_BOOLEAN ) { - String aEntries; + USHORT nResId = RID_RSC_ENUM_YESNO; if ( ( nPropId == PROPERTY_ID_SHOW_POSITION ) || ( nPropId == PROPERTY_ID_SHOW_NAVIGATION ) || ( nPropId == PROPERTY_ID_SHOW_RECORDACTIONS ) || ( nPropId == PROPERTY_ID_SHOW_FILTERSORT ) ) - aEntries = String( PcrRes( RID_STR_SHOW_HIDE ) ); - else - aEntries = String( PcrRes( RID_STR_BOOL ) ); + nResId = RID_RSC_ENUM_SHOWHIDE; ::std::vector< ::rtl::OUString > aListEntries; - for ( xub_StrLen i=0; i<2; ++i ) - aListEntries.push_back( aEntries.GetToken(i) ); + tools::StringListResource aRes(PcrRes(nResId),aListEntries); aDescriptor.Control = PropertyHandlerHelper::createListBoxControl( _rxControlFactory, aListEntries, sal_False, sal_False ); bNeedDefaultStringIfVoidAllowed = true; } diff --git a/extensions/source/propctrlr/formres.src b/extensions/source/propctrlr/formres.src index 78f0bbebf..572eb916a 100644 --- a/extensions/source/propctrlr/formres.src +++ b/extensions/source/propctrlr/formres.src @@ -1213,9 +1213,16 @@ String RID_STR_TEXTTYPE Text [ en-US ] = "Text type"; }; -String RID_STR_SHOW_HIDE +Resource RID_RSC_ENUM_SHOWHIDE { - Text [ en-US ] = "Hide;Show" ; + String 1 + { + Text [ en-US ] = "Hide" ; + }; + String 2 + { + Text [ en-US ] = "Show" ; + }; }; String RID_STR_XML_DATA_MODEL { diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc index 8bbf6a1b6..62c9cf976 100644 --- a/extensions/source/propctrlr/formresid.hrc +++ b/extensions/source/propctrlr/formresid.hrc @@ -335,8 +335,10 @@ #define RID_RSC_ENUM_ORIENTATION ( RID_PROPCONTROLLER_START + 22 ) #define RID_RSC_ENUM_CELL_EXCHANGE_TYPE ( RID_PROPCONTROLLER_START + 23 ) #define RID_RSC_ENUM_SUBMIT_TARGET ( RID_PROPCONTROLLER_START + 24 ) -#define RID_RSC_ENUM_SELECTION_TYPE ( RID_PROPCONTROLLER_START + 25 ) +#define RID_RSC_ENUM_SELECTION_TYPE ( RID_PROPCONTROLLER_START + 25 ) #define RID_RSC_ENUM_SCALE_MODE ( RID_PROPCONTROLLER_START + 26 ) +#define RID_RSC_ENUM_YESNO ( RID_PROPCONTROLLER_START + 27 ) +#define RID_RSC_ENUM_SHOWHIDE ( RID_PROPCONTROLLER_START + 28 ) // ----------------------------------------------------------------------- // - ImageList - local ids diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index d38bea87d..bff9d5e80 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -34,6 +34,7 @@ #ifndef EXTENSIONS_PROPRESID_HRC #include "propresid.hrc" #endif +#include "formresid.hrc" #include <comphelper/extract.hxx> #ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_ #include "modulepcr.hxx" @@ -55,6 +56,7 @@ /** === end UNO includes === **/ #include <tools/debug.hxx> #include <tools/diagnose_ex.h> +#include <tools/StringListResource.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <algorithm> @@ -91,11 +93,9 @@ namespace pcr // special handling for booleans (this will become a list) if ( _rProperty.Type.getTypeClass() == TypeClass_BOOLEAN ) { - String aBoolOptions = String( PcrRes( RID_STR_BOOL ) ); - Sequence< ::rtl::OUString > aEntries(2); - for ( xub_StrLen i=0; i<2; ++i ) - aEntries[i] = aBoolOptions.GetToken( i ); - _out_rDescriptor.Control = createListBoxControl( _rxControlFactory, aEntries, bReadOnlyControl, sal_False ); + ::std::vector< ::rtl::OUString > aListEntries; + tools::StringListResource aRes(PcrRes(RID_RSC_ENUM_YESNO),aListEntries); + _out_rDescriptor.Control = createListBoxControl( _rxControlFactory, aListEntries, bReadOnlyControl, sal_False ); return; } diff --git a/extensions/source/propctrlr/propres.src b/extensions/source/propctrlr/propres.src index b69af00aa..47adf9c9f 100644 --- a/extensions/source/propctrlr/propres.src +++ b/extensions/source/propctrlr/propres.src @@ -31,6 +31,7 @@ #ifndef EXTENSIONS_PROPRESID_HRC #include "propresid.hrc" #endif +#include "formresid.hrc" String RID_STR_STANDARD { @@ -44,9 +45,16 @@ String RID_STR_PROPPAGE_DATA { Text [ en-US ] = "Data" ; }; -String RID_STR_BOOL +Resource RID_RSC_ENUM_YESNO { - Text [ en-US ] = "No;Yes" ; + String 1 + { + Text [ en-US ] = "No" ; + }; + String 2 + { + Text [ en-US ] = "Yes" ; + }; }; String RID_STR_HELP_SECTION_LABEL { diff --git a/extensions/source/propctrlr/propresid.hrc b/extensions/source/propctrlr/propresid.hrc index e3b95433a..f5ad4bbce 100644 --- a/extensions/source/propctrlr/propresid.hrc +++ b/extensions/source/propctrlr/propresid.hrc @@ -44,8 +44,7 @@ #define RID_STR_STANDARD ( RID_PROPCONTROLLER_START + 0 ) #define RID_STR_PROPPAGE_DEFAULT ( RID_PROPCONTROLLER_START + 1 ) #define RID_STR_PROPPAGE_DATA ( RID_PROPCONTROLLER_START + 2 ) -#define RID_STR_BOOL ( RID_PROPCONTROLLER_START + 3 ) -#define RID_STR_HELP_SECTION_LABEL ( RID_PROPCONTROLLER_START + 4 ) +#define RID_STR_HELP_SECTION_LABEL ( RID_PROPCONTROLLER_START + 3 ) #define RID_EMBED_IMAGE_PLACEHOLDER ( RID_PROPCONTROLLER_START + 5 ) #endif // EXTENSIONS_PROPRESID_HRC diff --git a/extensions/source/propctrlr/stringrepresentation.cxx b/extensions/source/propctrlr/stringrepresentation.cxx index 9a9425e47..28d869461 100644 --- a/extensions/source/propctrlr/stringrepresentation.cxx +++ b/extensions/source/propctrlr/stringrepresentation.cxx @@ -54,6 +54,7 @@ #endif #include <tools/debug.hxx> #include <tools/string.hxx> +#include <tools/StringListResource.hxx> #include <comphelper/types.hxx> #ifndef _EXTENSIONS_PROPCTRLR_MODULEPCR_HXX_ #include "modulepcr.hxx" @@ -375,10 +376,11 @@ bool StringRepresentation::convertGenericValueToString( const uno::Any& _rValue, case uno::TypeClass_BOOLEAN: { - String aEntries( PcrRes( RID_STR_BOOL ) ); + ::std::vector< ::rtl::OUString > aListEntries; + tools::StringListResource aRes(PcrRes(RID_RSC_ENUM_YESNO),aListEntries); sal_Bool bValue = sal_False; _rValue >>= bValue; - _rStringRep = bValue ? aEntries.GetToken( 1 ) : aEntries.GetToken( 0 ); + _rStringRep = bValue ? aListEntries[1] : aListEntries[0]; } break; @@ -513,8 +515,9 @@ bool StringRepresentation::convertStringToGenericValue( const ::rtl::OUString& _ case uno::TypeClass_BOOLEAN: { - String sBooleanValues( PcrRes( RID_STR_BOOL ) ); - if ( sBooleanValues.GetToken(0) == String( _rStringRep ) ) + ::std::vector< ::rtl::OUString > aListEntries; + tools::StringListResource aRes(PcrRes(RID_RSC_ENUM_YESNO),aListEntries); + if ( aListEntries[0] == _rStringRep ) _rValue <<= (sal_Bool)sal_False; else _rValue <<= (sal_Bool)sal_True; |