summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-08 12:36:53 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-10 12:02:44 +0200
commit366d08f2f6d4de922f6099c62bb81b49d89e0a68 (patch)
treeb232884af6e844c2f0994859e4b42efbc1ce654c /chart2/source
parent75a2257a5bd716a9f937abe5e53f305c983afd5d (diff)
new loplugin:simplifypointertobool
Change-Id: Iff68e8f379614a6ab6a6e0d1bad18e70bc76d76a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx36
-rw-r--r--chart2/source/controller/dialogs/res_ErrorBar.cxx4
-rw-r--r--chart2/source/controller/main/ControllerCommandDispatch.cxx10
-rw-r--r--chart2/source/controller/main/ElementSelector.cxx6
-rw-r--r--chart2/source/view/main/VDataSeries.cxx2
5 files changed, 24 insertions, 34 deletions
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 86571ffeea7b..785a1d16528c 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -583,7 +583,7 @@ bool DataBrowser::MayMoveLeftColumns() const
return ! IsReadOnly()
&& ( nColIdx > 1 )
&& ( nColIdx <= ColCount() - 2 )
- && m_apDataBrowserModel.get()
+ && m_apDataBrowserModel
&& !m_apDataBrowserModel->isCategoriesColumn( nColIdx );
}
@@ -600,7 +600,7 @@ bool DataBrowser::MayMoveRightColumns() const
return ! IsReadOnly()
&& ( nColIdx > 0 )
&& ( nColIdx < ColCount()-2 )
- && m_apDataBrowserModel.get()
+ && m_apDataBrowserModel
&& !m_apDataBrowserModel->isCategoriesColumn( nColIdx );
}
@@ -701,7 +701,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
{
aResult = OUString::number(static_cast< sal_Int32 >( nRow ) + 1);
}
- else if( nRow >= 0 && m_apDataBrowserModel.get())
+ else if( nRow >= 0 && m_apDataBrowserModel)
{
sal_Int32 nColIndex = static_cast< sal_Int32 >( nColumnId ) - 1;
@@ -758,8 +758,7 @@ double DataBrowser::GetCellNumber( long nRow, sal_uInt16 nColumnId ) const
double fResult;
::rtl::math::setNan( & fResult );
- if(( nColumnId >= 1 ) && ( nRow >= 0 ) &&
- m_apDataBrowserModel.get())
+ if(( nColumnId >= 1 ) && ( nRow >= 0 ) && m_apDataBrowserModel)
{
fResult = m_apDataBrowserModel->getCellNumber(
static_cast< sal_Int32 >( nColumnId ) - 1, nRow );
@@ -878,8 +877,7 @@ void DataBrowser::InsertColumn()
{
sal_Int32 nColIdx = lcl_getColumnInDataOrHeader( GetCurColumnId(), m_aSeriesHeaders );
- if( nColIdx >= 0 &&
- m_apDataBrowserModel.get())
+ if( nColIdx >= 0 && m_apDataBrowserModel)
{
// save changes made to edit-field
if( IsModified() )
@@ -894,8 +892,7 @@ void DataBrowser::InsertTextColumn()
{
sal_Int32 nColIdx = lcl_getColumnInDataOrHeader( GetCurColumnId(), m_aSeriesHeaders );
- if( nColIdx >= 0 &&
- m_apDataBrowserModel.get())
+ if( nColIdx >= 0 && m_apDataBrowserModel)
{
// save changes made to edit-field
if( IsModified() )
@@ -910,8 +907,7 @@ void DataBrowser::RemoveColumn()
{
sal_Int32 nColIdx = lcl_getColumnInDataOrHeader( GetCurColumnId(), m_aSeriesHeaders );
- if( nColIdx >= 0 &&
- m_apDataBrowserModel.get())
+ if( nColIdx >= 0 && m_apDataBrowserModel)
{
// save changes made to edit-field
if( IsModified() )
@@ -927,8 +923,7 @@ void DataBrowser::InsertRow()
{
sal_Int32 nRowIdx = lcl_getRowInData( GetCurRow());
- if( nRowIdx >= 0 &&
- m_apDataBrowserModel.get())
+ if( nRowIdx >= 0 && m_apDataBrowserModel)
{
// save changes made to edit-field
if( IsModified() )
@@ -943,8 +938,7 @@ void DataBrowser::RemoveRow()
{
sal_Int32 nRowIdx = lcl_getRowInData( GetCurRow());
- if( nRowIdx >= 0 &&
- m_apDataBrowserModel.get())
+ if( nRowIdx >= 0 && m_apDataBrowserModel)
{
// save changes made to edit-field
if( IsModified() )
@@ -960,8 +954,7 @@ void DataBrowser::MoveLeftColumn()
{
sal_Int32 nColIdx = lcl_getColumnInDataOrHeader( GetCurColumnId(), m_aSeriesHeaders );
- if( !(nColIdx > 0 &&
- m_apDataBrowserModel.get()))
+ if( !(nColIdx > 0 && m_apDataBrowserModel))
return;
// save changes made to edit-field
@@ -982,8 +975,7 @@ void DataBrowser::MoveRightColumn()
{
sal_Int32 nColIdx = lcl_getColumnInDataOrHeader( GetCurColumnId(), m_aSeriesHeaders );
- if( !(nColIdx >= 0 &&
- m_apDataBrowserModel.get()))
+ if( !(nColIdx >= 0 && m_apDataBrowserModel))
return;
// save changes made to edit-field
@@ -1004,8 +996,7 @@ void DataBrowser::MoveUpRow()
{
sal_Int32 nRowIdx = lcl_getRowInData( GetCurRow());
- if( !(nRowIdx > 0 &&
- m_apDataBrowserModel.get()))
+ if( !(nRowIdx > 0 && m_apDataBrowserModel))
return;
// save changes made to edit-field
@@ -1026,8 +1017,7 @@ void DataBrowser::MoveDownRow()
{
sal_Int32 nRowIdx = lcl_getRowInData( GetCurRow());
- if( !(nRowIdx >= 0 &&
- m_apDataBrowserModel.get()))
+ if( !(nRowIdx >= 0 && m_apDataBrowserModel))
return;
// save changes made to edit-field
diff --git a/chart2/source/controller/dialogs/res_ErrorBar.cxx b/chart2/source/controller/dialogs/res_ErrorBar.cxx
index b8511f21896c..aaa1c6eedb8b 100644
--- a/chart2/source/controller/dialogs/res_ErrorBar.cxx
+++ b/chart2/source/controller/dialogs/res_ErrorBar.cxx
@@ -230,7 +230,7 @@ void ErrorBarResources::UpdateControlStates()
bool bShowRange = m_xRbRange->get_active();
bool bCanChooseRange =
( bShowRange &&
- m_apRangeSelectionHelper.get() &&
+ m_apRangeSelectionHelper &&
m_apRangeSelectionHelper->hasRangeSelection());
m_xMfPositive->set_visible( ! bShowRange );
@@ -700,7 +700,7 @@ void ErrorBarResources::isRangeFieldContentValid(weld::Entry& rEdit)
{
OUString aRange( rEdit.get_text());
bool bIsValid = ( aRange.isEmpty() ) ||
- ( m_apRangeSelectionHelper.get() &&
+ ( m_apRangeSelectionHelper &&
m_apRangeSelectionHelper->verifyCellRange( aRange ));
if( bIsValid || !rEdit.get_sensitive())
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 4a70f339df97..aa21b77fb451 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -501,10 +501,10 @@ void ControllerCommandDispatch::initialize()
if( m_xSelectionSupplier.is() )
m_xSelectionSupplier->addSelectionChangeListener( this );
- if( m_apModelState.get() && xModel.is())
+ if( m_apModelState && xModel.is())
m_apModelState->update( xModel );
- if( m_apControllerState.get() && xModel.is())
+ if( m_apControllerState && xModel.is())
m_apControllerState->update( m_xChartController.get(), xModel );
updateCommandAvailability();
@@ -793,14 +793,14 @@ void SAL_CALL ControllerCommandDispatch::modified( const lang::EventObject& aEve
bool bUpdateCommandAvailability = false;
// Update the "ModelState" Struct.
- if( m_apModelState.get() && m_xChartController.is())
+ if( m_apModelState && m_xChartController.is())
{
m_apModelState->update( m_xChartController->getModel());
bUpdateCommandAvailability = true;
}
// Update the "ControllerState" Struct.
- if( m_apControllerState.get() && m_xChartController.is())
+ if( m_apControllerState && m_xChartController.is())
{
m_apControllerState->update( m_xChartController.get(), m_xChartController->getModel());
bUpdateCommandAvailability = true;
@@ -823,7 +823,7 @@ void SAL_CALL ControllerCommandDispatch::modified( const lang::EventObject& aEve
void SAL_CALL ControllerCommandDispatch::selectionChanged( const lang::EventObject& aEvent )
{
// Update the "ControllerState" Struct.
- if( m_apControllerState.get() && m_xChartController.is())
+ if( m_apControllerState && m_xChartController.is())
{
m_apControllerState->update( m_xChartController.get(), m_xChartController->getModel());
updateCommandAvailability();
diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx
index 1271a77c9cf0..46e601954e34 100644
--- a/chart2/source/controller/main/ElementSelector.cxx
+++ b/chart2/source/controller/main/ElementSelector.cxx
@@ -288,7 +288,7 @@ void SAL_CALL ElementSelectorToolbarController::release() throw ()
}
void SAL_CALL ElementSelectorToolbarController::statusChanged( const frame::FeatureStateEvent& rEvent )
{
- if( m_apSelectorListBox.get() )
+ if( m_apSelectorListBox )
{
SolarMutexGuard aSolarMutexGuard;
if ( rEvent.FeatureURL.Path == "ChartElementSelector" )
@@ -303,7 +303,7 @@ void SAL_CALL ElementSelectorToolbarController::statusChanged( const frame::Feat
uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::createItemWindow( const uno::Reference< awt::XWindow >& xParent )
{
uno::Reference< awt::XWindow > xItemWindow;
- if( !m_apSelectorListBox.get() )
+ if( !m_apSelectorListBox )
{
VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
if( pParent )
@@ -311,7 +311,7 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create
m_apSelectorListBox.reset(VclPtr<SelectorListBox>::Create(pParent));
}
}
- if( m_apSelectorListBox.get() )
+ if( m_apSelectorListBox )
xItemWindow = VCLUnoHelper::GetInterface( m_apSelectorListBox.get() );
return xItemWindow;
}
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 7c7509635bf5..c0d0616a090d 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -832,7 +832,7 @@ Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
if (!m_apSymbolProperties_Series)
m_apSymbolProperties_Series
= getSymbolPropertiesFromPropertySet(getPropertiesOfSeries());
- if( m_apSymbolProperties_Series.get() && m_apSymbolProperties_Series->Style != SymbolStyle_NONE )
+ if( m_apSymbolProperties_Series && m_apSymbolProperties_Series->Style != SymbolStyle_NONE )
{
if (!m_apSymbolProperties_InvisibleSymbolForSelection)
{