Kaydet (Commit) 0d7f5e06 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:checkunusedparams in package..reportdesign

Change-Id: I8ebccc413153667269954c303e216b155ee9d1ae
Reviewed-on: https://gerrit.libreoffice.org/37145Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 60fd81d8
......@@ -1391,7 +1391,7 @@ void OWriteStream_Impl::InputStreamDisposed( OInputCompStream* pStream )
m_aInputStreamsList.remove( pStream );
}
void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io::XInputStream >& xDataToCopy, const uno::Sequence< beans::PropertyValue >& aProps, bool, uno::Reference< io::XStream >& xTargetStream )
void OWriteStream_Impl::CreateReadonlyCopyBasedOnData( const uno::Reference< io::XInputStream >& xDataToCopy, const uno::Sequence< beans::PropertyValue >& aProps, uno::Reference< io::XStream >& xTargetStream )
{
uno::Reference < io::XStream > xTempFile;
if ( !xTargetStream.is() )
......@@ -1455,7 +1455,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
// in case of new inserted package stream it is possible that input stream still was not set
GetStreamProperties();
CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, m_bUseCommonEncryption, xTargetStream );
CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, xTargetStream );
}
}
......@@ -1521,7 +1521,7 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar
// in case of new inserted package stream it is possible that input stream still was not set
GetStreamProperties();
CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, m_bUseCommonEncryption, xTargetStream );
CreateReadonlyCopyBasedOnData( xDataToCopy, m_aProps, xTargetStream );
}
void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStorage >& xRelStorage, const OUString& aOrigStreamName, const OUString& aNewStreamName )
......
......@@ -209,7 +209,6 @@ public:
void CreateReadonlyCopyBasedOnData(
const css::uno::Reference< css::io::XInputStream >& xDataToCopy,
const css::uno::Sequence< css::beans::PropertyValue >& aProps,
bool bUseCommonEncryption,
css::uno::Reference< css::io::XStream >& xTargetStream );
void GetCopyOfLastCommit( css::uno::Reference< css::io::XStream >& xTargetStream );
......
......@@ -99,7 +99,7 @@ public:
OObjectBase(const OObjectBase&) = delete;
OObjectBase& operator=(const OObjectBase&) = delete;
void StartListening();
void EndListening(bool bRemoveListener = true);
void EndListening();
// PropertyChangeListener
/// @throws css::uno::RuntimeException
virtual void _propertyChange( const css::beans::PropertyChangeEvent& evt );
......
......@@ -300,7 +300,13 @@ void OGroup::setSection( const OUString& _sProperty
{
::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, uno::makeAny(_member), uno::makeAny(_bOn), &l);
lcl_createSectionIfNeeded(_bOn ,this,_member);
// create section if needed
if ( _bOn && !_member.is() )
_member = OSection::createOSection(this, getContext());
else if ( !_bOn )
::comphelper::disposeComponent(_member);
if ( _member.is() )
_member->setName(_sName);
}
......
......@@ -1034,7 +1034,13 @@ void OReportDefinition::setSection( const OUString& _sProperty
{
::osl::MutexGuard aGuard(m_aMutex);
prepareSet(_sProperty, uno::makeAny(_member), uno::makeAny(_bOn), &l);
lcl_createSectionIfNeeded(_bOn ,this,_member,_sProperty == PROPERTY_PAGEHEADERON || _sProperty == PROPERTY_PAGEFOOTERON);
// create section if needed
if ( _bOn && !_member.is() )
_member = OSection::createOSection(this, getContext(), _sProperty == PROPERTY_PAGEHEADERON || _sProperty == PROPERTY_PAGEFOOTERON);
else if ( !_bOn )
::comphelper::disposeComponent(_member);
if ( _member.is() )
_member->setName(_sName);
}
......
......@@ -95,8 +95,7 @@ uno::Reference<report::XSection> OSection::createOSection(
uno::Reference<report::XSection> OSection::createOSection(
const uno::Reference< report::XGroup >& xParentGroup,
const uno::Reference< uno::XComponentContext >& context,
bool const)
const uno::Reference< uno::XComponentContext >& context)
{
OSection *const pNew =
new OSection(nullptr, xParentGroup, context, lcl_getGroupAbsent());
......
......@@ -139,7 +139,7 @@ namespace reportdesign
,const css::uno::Reference< css::uno::XComponentContext >& context,bool _bPageSection=false);
static css::uno::Reference< css::report::XSection>
createOSection(const css::uno::Reference< css::report::XGroup >& _xParent
,const css::uno::Reference< css::uno::XComponentContext >& context, bool _bPageSection);
,const css::uno::Reference< css::uno::XComponentContext >& context);
DECLARE_XINTERFACE( )
......
......@@ -35,14 +35,6 @@
namespace reportdesign
{
template <class T> void lcl_createSectionIfNeeded(bool _bOn,const T& _xParent,css::uno::Reference< css::report::XSection>& _xSection/*in/out*/,bool _bPageSection = false)
{
if ( _bOn && !_xSection.is() )
_xSection = OSection::createOSection(_xParent,_xParent->getContext(),_bPageSection);
else if ( !_bOn )
::comphelper::disposeComponent(_xSection);
}
/** uses the XChild interface to get the section from any child of it.
*
* \param _xReportComponent A report component which is a child of the section.
......
......@@ -365,7 +365,7 @@ void OObjectBase::StartListening()
}
}
void OObjectBase::EndListening(bool /*bRemoveListener*/)
void OObjectBase::EndListening()
{
OSL_ENSURE(!m_xReportComponent.is() || isListening(), "OUnoObject::EndListening: not listening currently!");
......@@ -663,7 +663,7 @@ void OUnoObject::NbcMove( const Size& rSize )
if ( m_bIsListening )
{
// stop listening
OObjectBase::EndListening(false);
OObjectBase::EndListening();
bool bPositionFixed = false;
Size aUndoSize(0,0);
......@@ -710,7 +710,7 @@ void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Frac
SdrUnoObj::NbcResize( rRef, xFract, yFract );
// stop listening
OObjectBase::EndListening(false);
OObjectBase::EndListening();
// set geometry properties
SetPropsFromRect(GetLogicRect());
......@@ -723,7 +723,7 @@ void OUnoObject::NbcSetLogicRect(const tools::Rectangle& rRect)
{
SdrUnoObj::NbcSetLogicRect(rRect);
// stop listening
OObjectBase::EndListening(false);
OObjectBase::EndListening();
// set geometry properties
SetPropsFromRect(rRect);
......@@ -796,7 +796,7 @@ void OUnoObject::_propertyChange( const beans::PropertyChangeEvent& evt )
Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
if ( xControlModel.is() )
{
OObjectBase::EndListening(false);
OObjectBase::EndListening();
try
{
xControlModel->setPropertyValue(PROPERTY_TEXTCOLOR,evt.NewValue);
......@@ -823,7 +823,7 @@ void OUnoObject::_propertyChange( const beans::PropertyChangeEvent& evt )
if ( !aNewName.equals(aOldName) )
{
// set old name property
OObjectBase::EndListening(false);
OObjectBase::EndListening();
if ( m_xMediator.is() )
m_xMediator.get()->stopListening();
try
......@@ -938,7 +938,7 @@ void OOle2Obj::NbcMove( const Size& rSize )
if ( m_bIsListening )
{
// stop listening
OObjectBase::EndListening(false);
OObjectBase::EndListening();
bool bPositionFixed = false;
Size aUndoSize(0,0);
......@@ -990,7 +990,7 @@ void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fracti
SdrOle2Obj::NbcResize( rRef, xFract, yFract );
// stop listening
OObjectBase::EndListening(false);
OObjectBase::EndListening();
// set geometry properties
SetPropsFromRect(GetLogicRect());
......@@ -1003,7 +1003,7 @@ void OOle2Obj::NbcSetLogicRect(const tools::Rectangle& rRect)
{
SdrOle2Obj::NbcSetLogicRect(rRect);
// stop listening
OObjectBase::EndListening(false);
OObjectBase::EndListening();
// set geometry properties
SetPropsFromRect(rRect);
......
......@@ -238,10 +238,9 @@ namespace rptui
/** returns if the view handles the event by itself
*
* \param _nId the command id
* \return <FALSE/> is the event is not handled by the view otherwise <TRUE/>
*/
bool isHandleEvent(sal_uInt16 _nId) const;
bool isHandleEvent() const;
sal_uInt32 getMarkedObjectCount() const;
......
......@@ -662,7 +662,7 @@ void ODesignView::setDragStripes(bool bOn)
m_aScrollWindow->setDragStripes(bOn);
}
bool ODesignView::isHandleEvent(sal_uInt16 /*_nId*/) const
bool ODesignView::isHandleEvent() const
{
return m_pPropWin && m_pPropWin->HasChildPathFocus();
}
......
......@@ -519,19 +519,19 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection();
break;
case SID_CUT:
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
break;
case SID_COPY:
aReturn.bEnabled = getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
aReturn.bEnabled = getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
break;
case SID_PASTE:
aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent(_nId) && getDesignView()->IsPasteAllowed();
aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent() && getDesignView()->IsPasteAllowed();
break;
case SID_SELECTALL:
aReturn.bEnabled = !getDesignView()->isHandleEvent(_nId);
aReturn.bEnabled = !getDesignView()->isHandleEvent();
break;
case SID_SELECTALL_IN_SECTION:
aReturn.bEnabled = !getDesignView()->isHandleEvent(_nId);
aReturn.bEnabled = !getDesignView()->isHandleEvent();
if ( aReturn.bEnabled )
aReturn.bEnabled = getCurrentSectionView() != nullptr;
break;
......@@ -552,7 +552,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
case SID_EXPAND_SECTION:
case SID_NEXT_MARK:
case SID_PREV_MARK:
aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent(_nId);
aReturn.bEnabled = isEditable() && !getDesignView()->isHandleEvent();
break;
case SID_SELECT:
case SID_SELECT_REPORT:
......@@ -562,7 +562,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const
aReturn.bEnabled = isConnected() && m_xReportDefinition.is();
break;
case SID_DELETE:
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent(_nId);
aReturn.bEnabled = isEditable() && getDesignView()->HasSelection() && !getDesignView()->isHandleEvent();
if ( aReturn.bEnabled )
{
OSectionWindow* pSectionWindow = getDesignView()->getMarkedSection();
......
......@@ -521,7 +521,7 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
bool bChanged = false;
OObjectBase& rBase = dynamic_cast<OObjectBase&>(*pObject);
rBase.EndListening(false);
rBase.EndListening();
if ( aPos.X < i_nLeftMargin )
{
aPos.X = i_nLeftMargin;
......@@ -537,7 +537,7 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I
// add listener around
rBase.StartListening();
xReportComponent->setSize(aSize);
rBase.EndListening(false);
rBase.EndListening();
}
bChanged = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment