diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-05-18 21:14:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-05-19 15:40:40 +0200 |
commit | 2155e04d6343638ca9815d394cbc4f78c2b17c3a (patch) | |
tree | 0378142f6ce9edb63074291aed45527568e7b254 /extensions/source/propctrlr | |
parent | cee02e81cd3b55fb46eacf5db5713e8bf4363bcd (diff) |
make string translation loading more uniform
change various ResId classes that use conversion operator to OUString to
functions that return a OUString
drop various defines
drop unnecessary toString calls
Change-Id: Ibeccdf2b91a46a2ed5b4b74e6024e301a023bc92
Reviewed-on: https://gerrit.libreoffice.org/37817
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'extensions/source/propctrlr')
11 files changed, 38 insertions, 38 deletions
diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index b08ad0843f6c..0527b1268590 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -173,7 +173,7 @@ namespace pcr for ( sal_Int32 i=0; i<nCategories; ++i, ++pReturn ) { pReturn->ProgrammaticName = OUString::createFromAscii( aCategories[i].programmaticName ); - pReturn->UIName = PcrRes( aCategories[i].uiNameResId ).toString(); + pReturn->UIName = PcrRes( aCategories[i].uiNameResId ); pReturn->HelpURL = HelpIdUrl::getHelpURL( aCategories[i].helpId ); } diff --git a/extensions/source/propctrlr/eformshelper.cxx b/extensions/source/propctrlr/eformshelper.cxx index ce25451ef572..c468edd23fa2 100644 --- a/extensions/source/propctrlr/eformshelper.cxx +++ b/extensions/source/propctrlr/eformshelper.cxx @@ -542,7 +542,7 @@ namespace pcr if ( xBinding.is() ) { // find a nice name for it - OUString sBaseName(PcrRes(RID_STR_BINDING_UI_NAME).toString()); + OUString sBaseName(PcrRes(RID_STR_BINDING_UI_NAME)); sBaseName += " "; OUString sNewName; sal_Int32 nNumber = 1; diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 025199837fbf..964c3ee1e800 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -138,7 +138,7 @@ namespace pcr EventDescription::EventDescription( EventId _nId, const sal_Char* _pListenerNamespaceAscii, const sal_Char* _pListenerClassAsciiName, const sal_Char* _pListenerMethodAsciiName, sal_uInt16 _nDisplayNameResId, const OString& _sHelpId, const OString& _sUniqueBrowseId ) - :sDisplayName(PcrRes( _nDisplayNameResId ).toString()) + :sDisplayName(PcrRes( _nDisplayNameResId )) ,sListenerMethodName( OUString::createFromAscii( _pListenerMethodAsciiName ) ) ,sHelpId( _sHelpId ) ,sUniqueBrowseId( _sUniqueBrowseId ) diff --git a/extensions/source/propctrlr/formbrowsertools.cxx b/extensions/source/propctrlr/formbrowsertools.cxx index 12a5d4afec70..fd01daebb8af 100644 --- a/extensions/source/propctrlr/formbrowsertools.cxx +++ b/extensions/source/propctrlr/formbrowsertools.cxx @@ -48,12 +48,12 @@ namespace pcr { Reference< XInterface > xIFace; aUnoObj >>= xIFace; - sClassName = PcrRes(RID_STR_PROPTITLE_EDIT).toString(); + sClassName = PcrRes(RID_STR_PROPTITLE_EDIT); if (xIFace.is()) { // we have a chance to check if it's a formatted field model Reference< XServiceInfo > xInfo(xIFace, UNO_QUERY); if (xInfo.is() && (xInfo->supportsService(SERVICE_COMPONENT_FORMATTEDFIELD))) - sClassName = PcrRes(RID_STR_PROPTITLE_FORMATTED).toString(); + sClassName = PcrRes(RID_STR_PROPTITLE_FORMATTED); else if (!xInfo.is()) { // couldn't distinguish between formatted and edit with the service name, so try with the properties @@ -62,7 +62,7 @@ namespace pcr { Reference< XPropertySetInfo > xPropsInfo = xProps->getPropertySetInfo(); if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(PROPERTY_FORMATSSUPPLIER)) - sClassName = PcrRes(RID_STR_PROPTITLE_FORMATTED).toString(); + sClassName = PcrRes(RID_STR_PROPTITLE_FORMATTED); } } } @@ -70,44 +70,44 @@ namespace pcr break; case FormComponentType::COMMANDBUTTON: - sClassName = PcrRes(RID_STR_PROPTITLE_PUSHBUTTON).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_PUSHBUTTON); break; case FormComponentType::RADIOBUTTON: - sClassName = PcrRes(RID_STR_PROPTITLE_RADIOBUTTON).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_RADIOBUTTON); break; case FormComponentType::CHECKBOX: - sClassName = PcrRes(RID_STR_PROPTITLE_CHECKBOX).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_CHECKBOX); break; case FormComponentType::LISTBOX: - sClassName = PcrRes(RID_STR_PROPTITLE_LISTBOX).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_LISTBOX); break; case FormComponentType::COMBOBOX: - sClassName = PcrRes(RID_STR_PROPTITLE_COMBOBOX).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_COMBOBOX); break; case FormComponentType::GROUPBOX: - sClassName = PcrRes(RID_STR_PROPTITLE_GROUPBOX).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_GROUPBOX); break; case FormComponentType::IMAGEBUTTON: - sClassName = PcrRes(RID_STR_PROPTITLE_IMAGEBUTTON).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_IMAGEBUTTON); break; case FormComponentType::FIXEDTEXT: - sClassName = PcrRes(RID_STR_PROPTITLE_FIXEDTEXT).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_FIXEDTEXT); break; case FormComponentType::GRIDCONTROL: - sClassName = PcrRes(RID_STR_PROPTITLE_DBGRID).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_DBGRID); break; case FormComponentType::FILECONTROL: - sClassName = PcrRes(RID_STR_PROPTITLE_FILECONTROL).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_FILECONTROL); break; case FormComponentType::DATEFIELD: - sClassName = PcrRes(RID_STR_PROPTITLE_DATEFIELD).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_DATEFIELD); break; case FormComponentType::TIMEFIELD: - sClassName = PcrRes(RID_STR_PROPTITLE_TIMEFIELD).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_TIMEFIELD); break; case FormComponentType::NUMERICFIELD: - sClassName = PcrRes(RID_STR_PROPTITLE_NUMERICFIELD).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_NUMERICFIELD); break; case FormComponentType::CURRENCYFIELD: - sClassName = PcrRes(RID_STR_PROPTITLE_CURRENCYFIELD).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_CURRENCYFIELD); break; case FormComponentType::PATTERNFIELD: - sClassName = PcrRes(RID_STR_PROPTITLE_PATTERNFIELD).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_PATTERNFIELD); break; case FormComponentType::IMAGECONTROL: - sClassName = PcrRes(RID_STR_PROPTITLE_IMAGECONTROL).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_IMAGECONTROL); break; case FormComponentType::HIDDENCONTROL: - sClassName = PcrRes(RID_STR_PROPTITLE_HIDDENCONTROL).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_HIDDENCONTROL); break; case FormComponentType::CONTROL: default: - sClassName = PcrRes(RID_STR_PROPTITLE_UNKNOWNCONTROL).toString(); break; + sClassName = PcrRes(RID_STR_PROPTITLE_UNKNOWNCONTROL); break; } return sClassName; diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index 71fb21a05f43..b3e760c447c5 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -144,7 +144,7 @@ namespace pcr FormComponentPropertyHandler::FormComponentPropertyHandler( const Reference< XComponentContext >& _rxContext ) :FormComponentPropertyHandler_Base( _rxContext ) ,::comphelper::OPropertyContainer(FormComponentPropertyHandler_Base::rBHelper) - ,m_sDefaultValueString( PcrRes(RID_STR_STANDARD).toString() ) + ,m_sDefaultValueString( PcrRes(RID_STR_STANDARD) ) ,m_eComponentClass( eUnknown ) ,m_bComponentIsSubForm( false ) ,m_bHaveListSource( false ) @@ -551,7 +551,7 @@ namespace pcr OUString sControlValue; OSL_VERIFY( _rControlValue >>= sControlValue ); // Don't convert a placeholder - if ( nPropId == PROPERTY_ID_IMAGE_URL && sControlValue.equals( PcrRes(RID_EMBED_IMAGE_PLACEHOLDER).toString() ) ) + if ( nPropId == PROPERTY_ID_IMAGE_URL && sControlValue.equals( PcrRes(RID_EMBED_IMAGE_PLACEHOLDER) ) ) aPropertyValue <<= sControlValue; else { @@ -747,7 +747,7 @@ namespace pcr OUStringBuffer displayName; if ( aFont.Name.isEmpty() ) { - displayName.append( PcrRes(RID_STR_FONT_DEFAULT).toString() ); + displayName.append( PcrRes(RID_STR_FONT_DEFAULT) ); } else { @@ -770,7 +770,7 @@ namespace pcr if ( eWeight > WEIGHT_NORMAL ) nStyleResID = RID_STR_FONTSTYLE_BOLD; } - displayName.append(PcrRes(nStyleResID).toString()); + displayName.append(PcrRes(nStyleResID)); // font size if ( aFont.Height ) @@ -2680,7 +2680,7 @@ namespace pcr SvNumberFormatter* pFormatter = pSupplier->GetNumberFormatter(); double dPreviewVal = OFormatSampleControl::getPreviewValue(pFormatter,nFormatKey); - SvxNumberInfoItem aFormatter( pFormatter, dPreviewVal, PcrRes(RID_STR_TEXT_FORMAT).toString(), SID_ATTR_NUMBERFORMAT_INFO ); + SvxNumberInfoItem aFormatter( pFormatter, dPreviewVal, PcrRes(RID_STR_TEXT_FORMAT), SID_ATTR_NUMBERFORMAT_INFO ); aCoreSet.Put( aFormatter ); // a tab dialog with a single page diff --git a/extensions/source/propctrlr/formlinkdialog.cxx b/extensions/source/propctrlr/formlinkdialog.cxx index 5a1b0f71bcc7..601e4585b1d8 100644 --- a/extensions/source/propctrlr/formlinkdialog.cxx +++ b/extensions/source/propctrlr/formlinkdialog.cxx @@ -296,7 +296,7 @@ namespace pcr { if ( m_sDetailLabel.isEmpty() ) { - m_sDetailLabel = PcrRes(STR_DETAIL_FORM).toString(); + m_sDetailLabel = PcrRes(STR_DETAIL_FORM); } sDetailType = m_sDetailLabel; } @@ -308,7 +308,7 @@ namespace pcr { if ( m_sMasterLabel.isEmpty() ) { - m_sMasterLabel = PcrRes(STR_MASTER_FORM).toString(); + m_sMasterLabel = PcrRes(STR_MASTER_FORM); } sMasterType = m_sMasterLabel; } @@ -450,7 +450,7 @@ namespace pcr { OUString sErrorMessage; { - sErrorMessage = PcrRes(STR_ERROR_RETRIEVING_COLUMNS).toString(); + sErrorMessage = PcrRes(STR_ERROR_RETRIEVING_COLUMNS); sErrorMessage = sErrorMessage.replaceFirst("#", sCommand); } diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx index bb4edca2a414..d15a8190c824 100644 --- a/extensions/source/propctrlr/inspectorhelpwindow.cxx +++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx @@ -36,7 +36,7 @@ namespace pcr { SetBackground(); SetPaintTransparent(true); - m_aSeparator->SetText( PcrRes(RID_STR_HELP_SECTION_LABEL).toString() ); + m_aSeparator->SetText( PcrRes(RID_STR_HELP_SECTION_LABEL) ); m_aSeparator->SetBackground(); m_aSeparator->Show(); diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index 296bcfb2f20b..6f150c9d4622 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -1345,7 +1345,7 @@ namespace pcr { try { - OUString sPlcHolder = PcrRes(RID_EMBED_IMAGE_PLACEHOLDER).toString(); + OUString sPlcHolder = PcrRes(RID_EMBED_IMAGE_PLACEHOLDER); bool bIsPlaceHolderValue = false; if ( rName == PROPERTY_IMAGE_URL ) diff --git a/extensions/source/propctrlr/selectlabeldialog.cxx b/extensions/source/propctrlr/selectlabeldialog.cxx index ffec0db1ca00..36edf9b6313e 100644 --- a/extensions/source/propctrlr/selectlabeldialog.cxx +++ b/extensions/source/propctrlr/selectlabeldialog.cxx @@ -112,7 +112,7 @@ namespace pcr // insert the root Image aRootImage(BitmapEx(RID_EXTBMP_FORMS)); - SvTreeListEntry* pRoot = m_pControlTree->InsertEntry(PcrRes(RID_STR_FORMS).toString(), aRootImage, aRootImage); + SvTreeListEntry* pRoot = m_pControlTree->InsertEntry(PcrRes(RID_STR_FORMS), aRootImage, aRootImage); // build the tree m_pInitialSelection = nullptr; diff --git a/extensions/source/propctrlr/usercontrol.cxx b/extensions/source/propctrlr/usercontrol.cxx index c5c7c1e85ae7..b05f78860d58 100644 --- a/extensions/source/propctrlr/usercontrol.cxx +++ b/extensions/source/propctrlr/usercontrol.cxx @@ -107,7 +107,7 @@ namespace pcr const bool bIsTextFormat = ( pEntry && pEntry->IsTextFormat() ); if ( bIsTextFormat ) - getTypedControlWindow()->SetText( PcrRes( RID_STR_TEXT_FORMAT ).toString() ); + getTypedControlWindow()->SetText( PcrRes( RID_STR_TEXT_FORMAT ) ); else getTypedControlWindow()->SetValue( pEntry ? getPreviewValue( *pEntry ) : 1234.56789 ); } @@ -265,7 +265,7 @@ namespace pcr :OFileUrlControl_Base( PropertyControlType::Unknown, pParent, WB_TABSTOP | WB_BORDER | WB_DROPDOWN ) { getTypedControlWindow()->SetDropDownLineCount( 10 ); - getTypedControlWindow()->SetPlaceHolder( PcrRes( RID_EMBED_IMAGE_PLACEHOLDER ).toString() ) ; + getTypedControlWindow()->SetPlaceHolder( PcrRes( RID_EMBED_IMAGE_PLACEHOLDER ) ) ; } diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index 598f6f0bbed5..9b81f7b9dff0 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -523,7 +523,7 @@ namespace pcr } // confirmation message - OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ).toString() ); + OUString sConfirmation( PcrRes( RID_STR_CONFIRM_DELETE_DATA_TYPE ) ); sConfirmation = sConfirmation.replaceFirst( "#type#", pType->getName() ); ScopedVclPtrInstance<QueryBox> aQuery( nullptr, WB_YES_NO, sConfirmation ); // TODO/eForms: proper parent if ( aQuery->Execute() != RET_YES ) |