loplugin:mergeclasses

Change-Id: Id6e39c2c20ab3da5a8b8628f99a940b896feff78
This commit is contained in:
Noel Grandin
2015-10-09 12:28:26 +02:00
parent 523eaf4888
commit f8ba308cd7
5 changed files with 12 additions and 25 deletions

View File

@@ -119,7 +119,6 @@ merge dbmm::IMigrationProgress with dbmm::ProgressPage
merge dbmm::IProgressConsumer with dbmm::ProgressDelegator merge dbmm::IProgressConsumer with dbmm::ProgressDelegator
merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot merge dbp::OModuleResourceClient with dbp::OUnoAutoPilot
merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables merge dbtools::ISQLStatementHelper with connectivity::mysql::OTables
merge frm::IAttributeHandler with frm::AttributeHandler
merge frm::ICommandDescriptionProvider with frm::DefaultCommandDescriptionProvider merge frm::ICommandDescriptionProvider with frm::DefaultCommandDescriptionProvider
merge frm::ICommandImageProvider with frm::DocumentCommandImageProvider merge frm::ICommandImageProvider with frm::DocumentCommandImageProvider
merge frm::IEngineStatusListener with frm::RichTextControlImpl merge frm::IEngineStatusListener with frm::RichTextControlImpl

View File

@@ -185,7 +185,7 @@ namespace frm
AttributeHandlerPool::const_iterator aHandlerPos = m_aAttributeHandlers.find( _nAttributeId ); AttributeHandlerPool::const_iterator aHandlerPos = m_aAttributeHandlers.find( _nAttributeId );
if ( aHandlerPos == m_aAttributeHandlers.end() ) if ( aHandlerPos == m_aAttributeHandlers.end() )
{ {
::rtl::Reference< IAttributeHandler > aHandler = AttributeHandlerFactory::getHandlerFor( _nAttributeId, *m_pEngine->GetEmptyItemSet().GetPool() ); ::rtl::Reference< AttributeHandler > aHandler = AttributeHandlerFactory::getHandlerFor( _nAttributeId, *m_pEngine->GetEmptyItemSet().GetPool() );
OSL_ENSURE( aHandler.is(), "RichTextControlImpl::enableAttributeNotification: no handler available for this attribute!" ); OSL_ENSURE( aHandler.is(), "RichTextControlImpl::enableAttributeNotification: no handler available for this attribute!" );
if ( !aHandler.is() ) if ( !aHandler.is() )
return; return;

View File

@@ -43,7 +43,7 @@ namespace frm
class RichTextControlImpl : public IEngineStatusListener class RichTextControlImpl : public IEngineStatusListener
{ {
typedef ::std::map< AttributeId, AttributeState > StateCache; typedef ::std::map< AttributeId, AttributeState > StateCache;
typedef ::std::map< AttributeId, ::rtl::Reference< IAttributeHandler > > AttributeHandlerPool; typedef ::std::map< AttributeId, ::rtl::Reference< AttributeHandler > > AttributeHandlerPool;
typedef ::std::map< AttributeId, ITextAttributeListener* > AttributeListenerPool; typedef ::std::map< AttributeId, ITextAttributeListener* > AttributeListenerPool;
StateCache m_aLastKnownStates; StateCache m_aLastKnownStates;

View File

@@ -114,9 +114,9 @@ namespace frm
} }
} }
::rtl::Reference< IAttributeHandler > AttributeHandlerFactory::getHandlerFor( AttributeId _nAttributeId, const SfxItemPool& _rEditEnginePool ) ::rtl::Reference< AttributeHandler > AttributeHandlerFactory::getHandlerFor( AttributeId _nAttributeId, const SfxItemPool& _rEditEnginePool )
{ {
::rtl::Reference< IAttributeHandler > pReturn; ::rtl::Reference< AttributeHandler > pReturn;
switch ( _nAttributeId ) switch ( _nAttributeId )
{ {
case SID_ATTR_PARA_ADJUST_LEFT : case SID_ATTR_PARA_ADJUST_LEFT :

View File

@@ -34,18 +34,7 @@ class SfxItemPool;
namespace frm namespace frm
{ {
class IAttributeHandler : public salhelper::SimpleReferenceObject class AttributeHandler : public salhelper::SimpleReferenceObject
{
public:
virtual AttributeId getAttributeId( ) const = 0;
virtual AttributeState getState( const SfxItemSet& _rAttribs ) const = 0;
virtual void executeAttribute( const SfxItemSet& _rCurrentAttribs, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, SvtScriptType _nForScriptType ) const = 0;
protected:
virtual ~IAttributeHandler() {}
};
class AttributeHandler : public IAttributeHandler
{ {
private: private:
AttributeId m_nAttribute; AttributeId m_nAttribute;
@@ -58,20 +47,19 @@ namespace frm
public: public:
AttributeHandler( AttributeId _nAttributeId, WhichId _nWhichId ); AttributeHandler( AttributeId _nAttributeId, WhichId _nWhichId );
// IAttributeHandler AttributeId getAttributeId( ) const;
virtual AttributeId getAttributeId( ) const SAL_OVERRIDE; virtual AttributeState getState( const SfxItemSet& _rAttribs ) const;
virtual AttributeState getState( const SfxItemSet& _rAttribs ) const SAL_OVERRIDE; virtual void executeAttribute( const SfxItemSet& _rCurrentAttribs, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, SvtScriptType _nForScriptType ) const = 0;
virtual void executeAttribute( const SfxItemSet& _rCurrentAttribs, SfxItemSet& _rNewAttribs, const SfxPoolItem* _pAdditionalArg, SvtScriptType _nForScriptType ) const SAL_OVERRIDE = 0;
protected: protected:
/// helper method calling implGetCheckState /// helper method calling implGetCheckState
AttributeCheckState getCheckState( const SfxItemSet& _rAttribs ) const; AttributeCheckState getCheckState( const SfxItemSet& _rAttribs ) const;
/// helper method putting an item into a set, respecting a script type /// helper method putting an item into a set, respecting a script type
void putItemForScript( SfxItemSet& _rAttribs, const SfxPoolItem& _rItem, SvtScriptType _nForScriptType ) const; void putItemForScript( SfxItemSet& _rAttribs, const SfxPoolItem& _rItem, SvtScriptType _nForScriptType ) const;
// pseudo-abstract // pseudo-abstract
virtual AttributeCheckState implGetCheckState( const SfxPoolItem& _rItem ) const; virtual AttributeCheckState implGetCheckState( const SfxPoolItem& _rItem ) const;
protected: protected:
virtual ~AttributeHandler(); virtual ~AttributeHandler();
@@ -79,7 +67,7 @@ namespace frm
namespace AttributeHandlerFactory namespace AttributeHandlerFactory
{ {
::rtl::Reference< IAttributeHandler > getHandlerFor( AttributeId _nAttributeId, const SfxItemPool& _rEditEnginePool ); ::rtl::Reference< AttributeHandler > getHandlerFor( AttributeId _nAttributeId, const SfxItemPool& _rEditEnginePool );
} }
class ParaAlignmentHandler : public AttributeHandler class ParaAlignmentHandler : public AttributeHandler