diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-24 09:08:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-11 13:25:31 +0100 |
commit | 0d1253c2328106a443d16b6c8e96347de33e2ace (patch) | |
tree | e26e7ca9f9b91f50573f446b8a93515f4c4302eb /svx | |
parent | 2dd7aba7564a222c2acbac22975a76a6ab33c41f (diff) |
new loplugin writeonlyvars
largely based on the relevant portion of the unusedfields loplugin, but
adapted for local vars
Change-Id: Ic522a941573940e8f75c88f90ba5f37508ca49b1
Reviewed-on: https://gerrit.libreoffice.org/66835
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridcl.cxx | 14 | ||||
-rw-r--r-- | svx/source/form/fmshimp.cxx | 2 |
3 files changed, 5 insertions, 13 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 1c6982d4979a..ee5a92fe8226 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -2292,7 +2292,6 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly ) else { sal_Int32 nLineObjectCount(0); - sal_Int32 nAreaObjectCount(0); // correct some values and collect content data for ( std::pair< SdrPathObj*, double >& rCandidate : vObjectList ) @@ -2305,7 +2304,6 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly ) } else { - nAreaObjectCount++; AdaptObjColor( *pObj, rCandidate.second, diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index b4f42480eb48..7665142d34c9 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -226,7 +226,7 @@ sal_Int8 FmGridHeader::ExecuteDrop( const ExecuteDropEvent& _rEvt ) } // extract the descriptor - OUString sDatasource, sCommand, sFieldName,sDatabaseLocation,sConnnectionResource; + OUString sDatasource, sCommand, sFieldName,sDatabaseLocation; sal_Int32 nCommandType = CommandType::COMMAND; Reference< XPreparedStatement > xStatement; Reference< XResultSet > xResultSet; @@ -236,7 +236,6 @@ sal_Int8 FmGridHeader::ExecuteDrop( const ExecuteDropEvent& _rEvt ) ODataAccessDescriptor aColumn = OColumnTransferable::extractColumnDescriptor(aDroppedData); if (aColumn.has(DataAccessDescriptorProperty::DataSource)) aColumn[DataAccessDescriptorProperty::DataSource] >>= sDatasource; if (aColumn.has(DataAccessDescriptorProperty::DatabaseLocation)) aColumn[DataAccessDescriptorProperty::DatabaseLocation] >>= sDatabaseLocation; - if (aColumn.has(DataAccessDescriptorProperty::ConnectionResource)) aColumn[DataAccessDescriptorProperty::ConnectionResource] >>= sConnnectionResource; if (aColumn.has(DataAccessDescriptorProperty::Command)) aColumn[DataAccessDescriptorProperty::Command] >>= sCommand; if (aColumn.has(DataAccessDescriptorProperty::CommandType)) aColumn[DataAccessDescriptorProperty::CommandType] >>= nCommandType; if (aColumn.has(DataAccessDescriptorProperty::ColumnName)) aColumn[DataAccessDescriptorProperty::ColumnName] >>= sFieldName; @@ -675,20 +674,17 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe if (pMenu && xCols.is() && nColId) { - Reference< css::beans::XPropertySet > xSet( xCols->getByIndex(nPos), css::uno::UNO_QUERY); - sal_Int16 nClassId; - xSet->getPropertyValue(FM_PROP_CLASSID) >>= nClassId; + Reference< css::beans::XPropertySet > xPropSet( xCols->getByIndex(nPos), css::uno::UNO_QUERY); - Reference< css::io::XPersistObject > xServiceQuestion(xSet, UNO_QUERY); + Reference< css::io::XPersistObject > xServiceQuestion(xPropSet, UNO_QUERY); sal_Int32 nColType = xServiceQuestion.is() ? getColumnTypeByModelName(xServiceQuestion->getServiceName()) : 0; if (nColType == TYPE_TEXTFIELD) { // edit fields and formatted fields have the same service name, thus getColumnTypeByModelName returns TYPE_TEXTFIELD // in both cases. And as columns don't have an css::lang::XServiceInfo interface, we have to distinguish both // types via the existence of special properties - Reference< css::beans::XPropertySet > xProps(xSet, UNO_QUERY); - if (xProps.is()) + if (xPropSet.is()) { - Reference< css::beans::XPropertySetInfo > xPropsInfo = xProps->getPropertySetInfo(); + Reference< css::beans::XPropertySetInfo > xPropsInfo = xPropSet->getPropertySetInfo(); if (xPropsInfo.is() && xPropsInfo->hasPropertyByName(FM_PROP_FORMATSSUPPLIER)) nColType = TYPE_FORMATTEDFIELD; } diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 5189920bbff1..6447cf0590f1 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -3243,10 +3243,8 @@ void FmXFormShell::CreateExternalView_Lock() Reference< XPropertySet> xCurrentModelSet; OUString sColumnType,aGroupName,sControlSource; Sequence< Property> aProps; - Reference< XPropertySet> xCurrentBoundField; while ((xCurrentModelSet = Reference< XPropertySet>(aModelIterator.Next(), UNO_QUERY)).is()) { - xCurrentModelSet->getPropertyValue(FM_PROP_BOUNDFIELD) >>= xCurrentBoundField; OSL_ENSURE(xCurrentModelSet.is(),"xCurrentModelSet is null!"); // create a description of the column to be created // first : determine it's type |