extensions: Use appropriate OUString functions on string constants

Change-Id: I2476f409604d69e8e8ea1a132cd0a9169b5d435e
This commit is contained in:
Stephan Bergmann
2014-12-12 17:51:56 +01:00
parent 9d94148b04
commit 4fbdcb8c05
10 changed files with 47 additions and 47 deletions

View File

@@ -1177,9 +1177,8 @@ Reference< awt::XControlModel > BibDataManager::createGridModel(const OUString&
Reference< XPropertySetInfo > xPropInfo = xPropSet->getPropertySetInfo();
if (xPropInfo->hasPropertyByName(uProp))
{
OUString sId( INET_HID_SCHEME );
sId += OUString::createFromAscii( HID_BIB_DB_GRIDCTRL );
xPropSet->setPropertyValue( uProp, makeAny( sId ) );
xPropSet->setPropertyValue(
uProp, makeAny<OUString>(INET_HID_SCHEME HID_BIB_DB_GRIDCTRL));
}
}
catch (const Exception&)

View File

@@ -447,7 +447,7 @@ uno::Reference< awt::XControlModel > BibGeneralPage::AddXControl(
OUString uProp("HelpURL");
if(xPropInfo->hasPropertyByName(uProp))
{
OUString sId = OUString::createFromAscii( INET_HID_SCHEME );
OUString sId( INET_HID_SCHEME );
DBG_ASSERT( INetURLObject( OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 ) ).GetProtocol() == INET_PROT_NOT_VALID, "Wrong HelpId!" );
sId += OStringToOUString( sHelpId, RTL_TEXTENCODING_UTF8 );
xPropSet->setPropertyValue( uProp, makeAny( sId ) );

View File

@@ -114,27 +114,27 @@ namespace pcr
PropertyValue aProperty;
if (_rValue >>= aProperty)
{
if (aProperty.Name.equalsAscii("Detail"))
if (aProperty.Name == "Detail")
{
OSL_VERIFY( aProperty.Value >>= m_xDetail );
return;
}
else if (aProperty.Name.equalsAscii("Master"))
else if (aProperty.Name == "Master")
{
OSL_VERIFY( aProperty.Value >>= m_xMaster );
return;
}
else if (aProperty.Name.equalsAscii("Explanation"))
else if (aProperty.Name == "Explanation")
{
OSL_VERIFY( aProperty.Value >>= m_sExplanation );
return;
}
else if (aProperty.Name.equalsAscii("DetailLabel"))
else if (aProperty.Name == "DetailLabel")
{
OSL_VERIFY( aProperty.Value >>= m_sDetailLabel );
return;
}
else if (aProperty.Name.equalsAscii("MasterLabel"))
else if (aProperty.Name == "MasterLabel")
{
OSL_VERIFY( aProperty.Value >>= m_sMasterLabel );
return;

View File

@@ -440,12 +440,12 @@ namespace pcr
}
break;
case PROPERTY_ID_BIND_EXPRESSION: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_BIND_EXPRESSION); break;
case PROPERTY_ID_XSD_REQUIRED: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_REQUIRED); break;
case PROPERTY_ID_XSD_RELEVANT: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_RELEVANT); break;
case PROPERTY_ID_XSD_READONLY: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_READONLY); break;
case PROPERTY_ID_XSD_CONSTRAINT: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_CONSTRAINT); break;
case PROPERTY_ID_XSD_CALCULATION: aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_XSD_CALCULATION); break;
case PROPERTY_ID_BIND_EXPRESSION: aDescriptor.PrimaryButtonId = UID_PROP_DLG_BIND_EXPRESSION; break;
case PROPERTY_ID_XSD_REQUIRED: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_REQUIRED; break;
case PROPERTY_ID_XSD_RELEVANT: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_RELEVANT; break;
case PROPERTY_ID_XSD_READONLY: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_READONLY; break;
case PROPERTY_ID_XSD_CONSTRAINT: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_CONSTRAINT; break;
case PROPERTY_ID_XSD_CALCULATION: aDescriptor.PrimaryButtonId = UID_PROP_DLG_XSD_CALCULATION; break;
default:
OSL_FAIL( "EFormsPropertyHandler::describePropertyLine: cannot handle this property!" );

View File

@@ -157,7 +157,7 @@ namespace pcr
{
#define DESCRIBE_EVENT( asciinamespace, asciilistener, asciimethod, id_postfix ) \
s_aKnownEvents.insert( EventMap::value_type( \
OUString::createFromAscii( asciimethod ), \
asciimethod, \
EventDescription( ++nEventId, asciinamespace, asciilistener, asciimethod, RID_STR_EVT_##id_postfix, HID_EVT_##id_postfix, UID_BRWEVT_##id_postfix ) ) )
bool lcl_getEventDescriptionForMethod( const OUString& _rMethodName, EventDescription& _out_rDescription )

View File

@@ -1014,39 +1014,39 @@ namespace pcr
{
case PROPERTY_ID_DEFAULT_SELECT_SEQ:
case PROPERTY_ID_SELECTEDITEMS:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SELECTION);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_SELECTION;
break;
case PROPERTY_ID_FILTER:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FILTER);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_FILTER;
break;
case PROPERTY_ID_SORT:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_ORDER);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_ORDER;
break;
case PROPERTY_ID_MASTERFIELDS:
case PROPERTY_ID_DETAILFIELDS:
nControlType = PropertyControlType::StringListField;
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FORMLINKFIELDS);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_FORMLINKFIELDS;
break;
case PROPERTY_ID_COMMAND:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SQLCOMMAND);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_SQLCOMMAND;
break;
case PROPERTY_ID_TABINDEX:
{
Reference< XControlContainer > xControlContext( impl_getContextControlContainer_nothrow() );
if ( xControlContext.is() )
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_TABINDEX);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_TABINDEX;
nControlType = PropertyControlType::NumericField;
};
break;
case PROPERTY_ID_FONT:
bReadOnly = true;
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FONT_TYPE);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_FONT_TYPE;
break;
case PROPERTY_ID_TARGET_URL:
@@ -1054,8 +1054,9 @@ namespace pcr
{
aDescriptor.Control = new OFileUrlControl( impl_getDefaultDialogParent_nothrow(), WB_TABSTOP | WB_BORDER );
aDescriptor.PrimaryButtonId = OUString::createFromAscii(( PROPERTY_ID_TARGET_URL == nPropId )
? UID_PROP_DLG_ATTR_TARGET_URL : UID_PROP_DLG_IMAGE_URL);
aDescriptor.PrimaryButtonId = PROPERTY_ID_TARGET_URL == nPropId
? OUString(UID_PROP_DLG_ATTR_TARGET_URL)
: OUString(UID_PROP_DLG_IMAGE_URL);
}
break;
@@ -1072,13 +1073,13 @@ namespace pcr
switch( nPropId )
{
case PROPERTY_ID_BACKGROUNDCOLOR:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_BACKGROUNDCOLOR); break;
aDescriptor.PrimaryButtonId = UID_PROP_DLG_BACKGROUNDCOLOR; break;
case PROPERTY_ID_FILLCOLOR:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_FILLCOLOR); break;
aDescriptor.PrimaryButtonId = UID_PROP_DLG_FILLCOLOR; break;
case PROPERTY_ID_SYMBOLCOLOR:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SYMBOLCOLOR); break;
aDescriptor.PrimaryButtonId = UID_PROP_DLG_SYMBOLCOLOR; break;
case PROPERTY_ID_BORDERCOLOR:
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_BORDERCOLOR); break;
aDescriptor.PrimaryButtonId = UID_PROP_DLG_BORDERCOLOR; break;
}
break;
@@ -1102,7 +1103,7 @@ namespace pcr
case PROPERTY_ID_CONTROLLABEL:
bReadOnly = true;
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_CONTROLLABEL);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_CONTROLLABEL;
break;
case PROPERTY_ID_FORMATKEY:
@@ -1132,7 +1133,7 @@ namespace pcr
aDescriptor.Control = pControl;
pControl->SetFormatSupplier( pSupplier );
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_NUMBER_FORMAT);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_NUMBER_FORMAT;
}
else
{
@@ -1357,7 +1358,7 @@ namespace pcr
// DataSource
case PROPERTY_ID_DATASOURCE:
{
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_ATTR_DATASOURCE);
aDescriptor.PrimaryButtonId = UID_PROP_DLG_ATTR_DATASOURCE;
::std::vector< OUString > aListEntries;
@@ -2455,7 +2456,7 @@ namespace pcr
_out_rProperty.DisplayName = m_pInfoService->getPropertyTranslation( PROPERTY_ID_COMMAND );
_out_rProperty.HelpURL = HelpIdUrl::getHelpURL( m_pInfoService->getPropertyHelpId( PROPERTY_ID_COMMAND ) );
_out_rProperty.PrimaryButtonId = OUString::createFromAscii(UID_PROP_DLG_SQLCOMMAND);
_out_rProperty.PrimaryButtonId = UID_PROP_DLG_SQLCOMMAND;
sal_Int32 nCommandType = CommandType::COMMAND;

View File

@@ -576,7 +576,7 @@ namespace pcr
case TypeClass_STRING:
{
// some special handling for URL properties
bool bIsURLProperty = _rPropertyName.endsWithAsciiL( "URL", 3 );
bool bIsURLProperty = _rPropertyName.endsWith( "URL" );
if ( bIsURLProperty )
{
aDescriptor.Control = _rxControlFactory->createPropertyControl(

View File

@@ -319,8 +319,8 @@ namespace pcr
implGetAvailableDataTypeNames( aListEntries );
aDescriptor.PrimaryButtonId = OUString::createFromAscii(UID_PROP_ADD_DATA_TYPE);
aDescriptor.SecondaryButtonId = OUString::createFromAscii(UID_PROP_REMOVE_DATA_TYPE);;
aDescriptor.PrimaryButtonId = UID_PROP_ADD_DATA_TYPE;
aDescriptor.SecondaryButtonId = UID_PROP_REMOVE_DATA_TYPE;
aDescriptor.HasPrimaryButton = aDescriptor.HasSecondaryButton = sal_True;
aDescriptor.PrimaryButtonImageURL = "private:graphicrepository/extensions/res/buttonplus.png";
aDescriptor.SecondaryButtonImageURL = "private:graphicrepository/extensions/res/buttonminus.png";

View File

@@ -533,7 +533,7 @@ UpdateCheckConfig::getByName( const OUString& aName )
uno::Any aValue = m_xContainer->getByName( aName );
// Provide dynamic default value
if( aName.equalsAscii(DOWNLOAD_DESTINATION) )
if( aName == DOWNLOAD_DESTINATION )
{
OUString aStr;
aValue >>= aStr;

View File

@@ -146,7 +146,7 @@ void UpdateHandler::setDownloadBtnLabel( bool bAppendDots )
aLabel += "...";
setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "Label", uno::Any( aLabel ) );
setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD2 ) ) );
setControlProperty( msButtonIDs[DOWNLOAD_BUTTON], "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD2 ) );
mbDownloadBtnHasDots = bAppendDots;
}
@@ -1085,7 +1085,7 @@ void UpdateHandler::createDialog()
xPropSet->setPropertyValue( "PositionY", uno::Any(sal_Int32( 100 )) );
xPropSet->setPropertyValue( "Width", uno::Any(sal_Int32( DIALOG_WIDTH )) );
xPropSet->setPropertyValue( "Height", uno::Any(sal_Int32( DIALOG_HEIGHT )) );
xPropSet->setPropertyValue( "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DLG ) ) );
xPropSet->setPropertyValue( "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DLG ) );
}
{ // Label (fixed text) <status>
uno::Sequence< beans::NamedValue > aProps(1);
@@ -1112,7 +1112,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 3, "MultiLine", uno::Any( true ) );
setProperty( aProps, 4, "ReadOnly", uno::Any( true ) );
setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) );
setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_STATUS ) ) );
setProperty( aProps, 6, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_STATUS ) );
insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_STATUS,
awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET,
@@ -1143,7 +1143,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 1, "Enabled", uno::Any( true ) );
setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) );
setProperty( aProps, 3, "Label", uno::Any( msPauseBtn ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_PAUSE ) ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_PAUSE ) );
insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[PAUSE_BUTTON],
awt::Rectangle( BOX1_BTN_X, BOX1_BTN_Y, BUTTON_WIDTH, BUTTON_HEIGHT ),
@@ -1156,7 +1156,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 1, "Enabled", uno::Any( true ) );
setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) );
setProperty( aProps, 3, "Label", uno::Any( msResumeBtn ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_RESUME ) ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_RESUME ) );
insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[RESUME_BUTTON],
awt::Rectangle( BOX1_BTN_X,
@@ -1172,7 +1172,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 1, "Enabled", uno::Any( true ) );
setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) );
setProperty( aProps, 3, "Label", uno::Any( msCancelBtn ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_CANCEL ) ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_CANCEL ) );
insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[CANCEL_BUTTON],
awt::Rectangle( BOX1_BTN_X,
@@ -1206,7 +1206,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 3, "MultiLine", uno::Any( true ) );
setProperty( aProps, 4, "ReadOnly", uno::Any( true ) );
setProperty( aProps, 5, "AutoVScroll", uno::Any( true ) );
setProperty( aProps, 6, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DESCRIPTION ) ) );
setProperty( aProps, 6, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DESCRIPTION ) );
insertControlModel( xControlModel, EDIT_FIELD_MODEL, TEXT_DESCRIPTION,
awt::Rectangle( DIALOG_BORDER + TEXT_OFFSET,
@@ -1236,7 +1236,7 @@ void UpdateHandler::createDialog()
// setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_CANCEL) ) );
// [property] string Label // only if PushButtonType_STANDARD
setProperty( aProps, 3, "Label", uno::Any( msClose ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_CLOSE ) ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_CLOSE ) );
insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[ CLOSE_BUTTON ],
awt::Rectangle( CLOSE_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ),
@@ -1249,7 +1249,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 1, "Enabled", uno::Any( true ) );
setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) );
setProperty( aProps, 3, "Label", uno::Any( msInstall ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_INSTALL ) ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_INSTALL ) );
insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[INSTALL_BUTTON],
awt::Rectangle( INSTALL_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ),
@@ -1262,7 +1262,7 @@ void UpdateHandler::createDialog()
setProperty( aProps, 1, "Enabled", uno::Any( true ) );
setProperty( aProps, 2, "PushButtonType", uno::Any( sal_Int16(awt::PushButtonType_STANDARD) ) );
setProperty( aProps, 3, "Label", uno::Any( msDownload ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny( INET_HID_SCHEME + OUString::createFromAscii( HID_CHECK_FOR_UPD_DOWNLOAD ) ) );
setProperty( aProps, 4, "HelpURL", uno::makeAny<OUString>( INET_HID_SCHEME HID_CHECK_FOR_UPD_DOWNLOAD ) );
insertControlModel ( xControlModel, BUTTON_MODEL, msButtonIDs[DOWNLOAD_BUTTON],
awt::Rectangle( DOWNLOAD_BTN_X, BUTTON_Y_POS, BUTTON_WIDTH, BUTTON_HEIGHT ),