diff options
author | Thomas Arnhold <thomas@arnhold.org> | 2013-06-29 21:24:12 +0200 |
---|---|---|
committer | Thomas Arnhold <thomas@arnhold.org> | 2013-06-29 21:52:54 +0000 |
commit | ba0a57702cdef7a0389c06841711d7e3079d471c (patch) | |
tree | 223c0dd50de4b71cf7df9d0073f7cacca1f18c8d /extensions/source/dbpilots | |
parent | 8a7ede404ca4980f169c4ce634805ea5c1b6b56e (diff) |
remove OUString wrap for string literals
For some functions and all kinds of Exceptions.
CannotConvertException
CloseVetoException
DisposedException
EmptyUndoStackException
ErrorCodeIOException
Exception
GridInvalidDataException
GridInvalidModelException
IOException
IllegalAccessException
IllegalArgumentException
IllegalTypeException
IndexOutOfBoundsException
NoMasterException
NoSuchElementException
NoSupportException
PropertyVetoException
RuntimeException
SAXException
ScannerException
StorageWrappedTargetException
UnsupportedFlavorException
VetoException
WrappedTargetException
ZipIOException
throwGenericSQLException
throwIllegallArgumentException
createInstance
createInstanceWithContext
forName
getByName
getPackageManager
getPropertyValue
getUnpackedValueOrDefault
getValueByName
hasPropertyByName
openKey
setName
setPropertyValue
supportsService
bash command:
for i in `cat list`; do git grep "$i\s*(\s*OUString(\s*\"" -- '*.[hc]xx'
| cut -d ':' -f1 | sort -u
| xargs sed -i
-e "s/\(\<$i\s*(\)\s*OUString(\s*\(\"[^\")\\]*\"\)\s*)\s*/\1\2/g"
-e "s/\($i.*\)\"+ /\1\" + /g";
done
Change-Id: Iaf8e641b0abf28c082906014f87a183517630535
Reviewed-on: https://gerrit.libreoffice.org/4624
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
Diffstat (limited to 'extensions/source/dbpilots')
-rw-r--r-- | extensions/source/dbpilots/commonpagesdbp.cxx | 12 | ||||
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 18 | ||||
-rw-r--r-- | extensions/source/dbpilots/listcombowizard.cxx | 8 | ||||
-rw-r--r-- | extensions/source/dbpilots/optiongrouplayouter.cxx | 18 |
4 files changed, 28 insertions, 28 deletions
diff --git a/extensions/source/dbpilots/commonpagesdbp.cxx b/extensions/source/dbpilots/commonpagesdbp.cxx index 77dbb9a91e51..77e019c4514c 100644 --- a/extensions/source/dbpilots/commonpagesdbp.cxx +++ b/extensions/source/dbpilots/commonpagesdbp.cxx @@ -111,7 +111,7 @@ namespace dbp try { OUString sDataSourceName; - rContext.xForm->getPropertyValue(OUString("DataSourceName")) >>= sDataSourceName; + rContext.xForm->getPropertyValue("DataSourceName") >>= sDataSourceName; Reference< XConnection > xConnection; bool bEmbedded = ::dbtools::isEmbeddedInDatabase( rContext.xForm, xConnection ); @@ -129,9 +129,9 @@ namespace dbp implFillTables(xConnection); OUString sCommand; - OSL_VERIFY( rContext.xForm->getPropertyValue( OUString("Command") ) >>= sCommand ); + OSL_VERIFY( rContext.xForm->getPropertyValue("Command") >>= sCommand ); sal_Int32 nCommandType = CommandType::TABLE; - OSL_VERIFY( rContext.xForm->getPropertyValue( OUString("CommandType") ) >>= nCommandType ); + OSL_VERIFY( rContext.xForm->getPropertyValue("CommandType") >>= nCommandType ); // search the entry of the given type with the given name for ( sal_uInt16 nLookup = 0; nLookup < m_aTable.GetEntryCount(); ++nLookup ) @@ -167,13 +167,13 @@ namespace dbp xOldConn = getFormConnection(); OUString sDataSource = m_aDatasource.GetSelectEntry(); - rContext.xForm->setPropertyValue( OUString("DataSourceName"), makeAny( sDataSource ) ); + rContext.xForm->setPropertyValue("DataSourceName", makeAny( sDataSource ) ); } OUString sCommand = m_aTable.GetSelectEntry(); sal_Int32 nCommandType = reinterpret_cast< sal_IntPtr >( m_aTable.GetEntryData( m_aTable.GetSelectEntryPos() ) ); - rContext.xForm->setPropertyValue( OUString("Command"), makeAny( sCommand ) ); - rContext.xForm->setPropertyValue( OUString("CommandType"), makeAny( nCommandType ) ); + rContext.xForm->setPropertyValue("Command", makeAny( sCommand ) ); + rContext.xForm->setPropertyValue("CommandType", makeAny( nCommandType ) ); if ( !rContext.bEmbedded ) setFormConnection( xOldConn, sal_False ); diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index 32a152be18df..507525ce80a4 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -232,9 +232,9 @@ namespace dbp sal_Int32 nCommandType = CommandType::COMMAND; try { - rContext.xForm->getPropertyValue(OUString("DataSourceName")) >>= sDataSource; - rContext.xForm->getPropertyValue(OUString("Command")) >>= sCommand; - rContext.xForm->getPropertyValue(OUString("CommandType")) >>= nCommandType; + rContext.xForm->getPropertyValue("DataSourceName") >>= sDataSource; + rContext.xForm->getPropertyValue("Command") >>= sCommand; + rContext.xForm->getPropertyValue("CommandType") >>= nCommandType; } catch(const Exception&) { @@ -298,7 +298,7 @@ namespace dbp sal_Int16 nClassId = FormComponentType::CONTROL; try { - getContext().xObjectModel->getPropertyValue(OUString("ClassId")) >>= nClassId; + getContext().xObjectModel->getPropertyValue("ClassId") >>= nClassId; } catch(const Exception&) { @@ -457,7 +457,7 @@ namespace dbp try { if ( !::dbtools::isEmbeddedInDatabase(m_aContext.xForm,xConn) ) - m_aContext.xForm->getPropertyValue(OUString("ActiveConnection")) >>= xConn; + m_aContext.xForm->getPropertyValue("ActiveConnection") >>= xConn; } catch(const Exception&) { @@ -487,7 +487,7 @@ namespace dbp } else { - m_aContext.xForm->setPropertyValue( OUString("ActiveConnection"), makeAny( _rxConn ) ); + m_aContext.xForm->setPropertyValue("ActiveConnection", makeAny( _rxConn ) ); } } catch(const Exception&) @@ -558,8 +558,8 @@ namespace dbp if (m_aContext.xForm.is()) { // collect some properties of the form - OUString sObjectName = ::comphelper::getString(m_aContext.xForm->getPropertyValue(OUString("Command"))); - sal_Int32 nObjectType = ::comphelper::getINT32(m_aContext.xForm->getPropertyValue(OUString("CommandType"))); + OUString sObjectName = ::comphelper::getString(m_aContext.xForm->getPropertyValue("Command")); + sal_Int32 nObjectType = ::comphelper::getINT32(m_aContext.xForm->getPropertyValue("CommandType")); // calculate the connection the rowset is working with Reference< XConnection > xConnection; @@ -604,7 +604,7 @@ namespace dbp // not interested in any results, only in the fields Reference< XPropertySet > xStatementProps(xStatement, UNO_QUERY); - xStatementProps->setPropertyValue(OUString("MaxRows"), makeAny(sal_Int32(0))); + xStatementProps->setPropertyValue("MaxRows", makeAny(sal_Int32(0))); // TODO: think about handling local SQLExceptions here ... Reference< XColumnsSupplier > xSupplyCols(xStatement->executeQuery(), UNO_QUERY); diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 866a34e5227e..20eae70f083e 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -176,12 +176,12 @@ namespace dbp } // ListSourceType: SQL - getContext().xObjectModel->setPropertyValue(OUString("ListSourceType"), makeAny((sal_Int32)ListSourceType_SQL)); + getContext().xObjectModel->setPropertyValue("ListSourceType", makeAny((sal_Int32)ListSourceType_SQL)); if (isListBox()) { // BoundColumn: 1 - getContext().xObjectModel->setPropertyValue(OUString("BoundColumn"), makeAny((sal_Int16)1)); + getContext().xObjectModel->setPropertyValue("BoundColumn", makeAny((sal_Int16)1)); // build the statement to set as list source OUString sStatement = "SELECT " + @@ -189,7 +189,7 @@ namespace dbp " FROM " + OUString( getSettings().sListContentTable ); Sequence< OUString > aListSource(1); aListSource[0] = sStatement; - getContext().xObjectModel->setPropertyValue(OUString("ListSource"), makeAny(aListSource)); + getContext().xObjectModel->setPropertyValue("ListSource", makeAny(aListSource)); } else { @@ -201,7 +201,7 @@ namespace dbp } // the bound field - getContext().xObjectModel->setPropertyValue(OUString("DataField"), makeAny(OUString(getSettings().sLinkedFormField))); + getContext().xObjectModel->setPropertyValue("DataField", makeAny(OUString(getSettings().sLinkedFormField))); } catch(const Exception&) { diff --git a/extensions/source/dbpilots/optiongrouplayouter.cxx b/extensions/source/dbpilots/optiongrouplayouter.cxx index 9e315a8d5811..ef1754a002ad 100644 --- a/extensions/source/dbpilots/optiongrouplayouter.cxx +++ b/extensions/source/dbpilots/optiongrouplayouter.cxx @@ -119,28 +119,28 @@ namespace dbp aButtonPosition.Y = aShapePosition.Y + (i+1) * nTempHeight + nTopSpace; Reference< XPropertySet > xRadioModel( - xDocFactory->createInstance(OUString("com.sun.star.form.component.RadioButton")), + xDocFactory->createInstance("com.sun.star.form.component.RadioButton"), UNO_QUERY); // the label - xRadioModel->setPropertyValue(OUString("Label"), makeAny(OUString(*aLabelIter))); + xRadioModel->setPropertyValue("Label", makeAny(OUString(*aLabelIter))); // the value - xRadioModel->setPropertyValue(OUString("RefValue"), makeAny(OUString(*aValueIter))); + xRadioModel->setPropertyValue("RefValue", makeAny(OUString(*aValueIter))); // default selection if (_rSettings.sDefaultField == *aLabelIter) - xRadioModel->setPropertyValue(OUString("DefaultState"), makeAny(sal_Int16(1))); + xRadioModel->setPropertyValue("DefaultState", makeAny(sal_Int16(1))); // the connection to the database field if (0 != _rSettings.sDBField.Len()) - xRadioModel->setPropertyValue(OUString("DataField"), makeAny(OUString(_rSettings.sDBField))); + xRadioModel->setPropertyValue("DataField", makeAny(OUString(_rSettings.sDBField))); // the name for the model - xRadioModel->setPropertyValue(OUString("Name"), makeAny(sElementsName)); + xRadioModel->setPropertyValue("Name", makeAny(sElementsName)); // create a shape for the radio button Reference< XControlShape > xRadioShape( - xDocFactory->createInstance(OUString("com.sun.star.drawing.ControlShape")), + xDocFactory->createInstance("com.sun.star.drawing.ControlShape"), UNO_QUERY); Reference< XPropertySet > xShapeProperties(xRadioShape, UNO_QUERY); @@ -155,7 +155,7 @@ namespace dbp // the name of the shape if (xShapeProperties.is()) - xShapeProperties->setPropertyValue(OUString("Name"), makeAny(sElementsName)); + xShapeProperties->setPropertyValue("Name", makeAny(sElementsName)); // add to the page xPageShapes->add(xRadioShape.get()); @@ -164,7 +164,7 @@ namespace dbp // set the GroupBox as "LabelControl" for the RadioButton // (_after_ having inserted the model into the page!) - xRadioModel->setPropertyValue(OUString("LabelControl"), makeAny(_rContext.xObjectModel)); + xRadioModel->setPropertyValue("LabelControl", makeAny(_rContext.xObjectModel)); } // group the shapes |