diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-18 14:30:22 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-19 06:32:58 +0000 |
commit | 0aa24916cbea2ab3a843217be2c3be6c32c42ad5 (patch) | |
tree | 3a002816d73015e1dfb75664cad331c398cb5bc8 | |
parent | 365f2e9054c59da1515c52fe8852216ce678cf38 (diff) |
loplugin:expandablemethodds in filter..forms
Change-Id: Ic1f64f804acc10b1a48d82de9fc6a2b39af465a0
Reviewed-on: https://gerrit.libreoffice.org/30014
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
19 files changed, 17 insertions, 73 deletions
diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.cxx b/filter/source/graphicfilter/idxf/dxfgrprd.cxx index 44672ed5e29e..caa2c4263bf2 100644 --- a/filter/source/graphicfilter/idxf/dxfgrprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfgrprd.cxx @@ -154,7 +154,7 @@ sal_uInt16 DXFGroupReader::Read() if ( !bStatus ) { nG = 0; - SetS(); + S = "EOF"; if ( nGCount != 0xffffffff ) { // InfoBox(NULL,String("Error in group # ")+String(nGCount)).Execute(); @@ -165,11 +165,6 @@ sal_uInt16 DXFGroupReader::Read() return nG; } -void DXFGroupReader::SetS() -{ - S = "EOF"; -} - long DXFGroupReader::ReadI() { OString s = DXFReadLine(rIS); diff --git a/filter/source/graphicfilter/idxf/dxfgrprd.hxx b/filter/source/graphicfilter/idxf/dxfgrprd.hxx index 822820859acc..c936b33b428b 100644 --- a/filter/source/graphicfilter/idxf/dxfgrprd.hxx +++ b/filter/source/graphicfilter/idxf/dxfgrprd.hxx @@ -59,11 +59,6 @@ public: // This read must have returned a group code for datatype String. // If not NULL is returend - // The following methods can change the current values of group codes - // (e.g. to set default values, before 'blindly' reading lots of groups) - - void SetS(); // (will be copied) - private: long ReadI(); diff --git a/filter/source/graphicfilter/idxf/dxfreprd.cxx b/filter/source/graphicfilter/idxf/dxfreprd.cxx index 838e2702bffe..4373e51a1698 100644 --- a/filter/source/graphicfilter/idxf/dxfreprd.cxx +++ b/filter/source/graphicfilter/idxf/dxfreprd.cxx @@ -252,7 +252,7 @@ void DXFRepresentation::ReadHeader(DXFGroupReader & rDGR) continue; // If we already use UTF8, then don't update encoding anymore - if (isTextEncodingUTF8()) + if (mEnc == RTL_TEXTENCODING_UTF8) continue; // FIXME: we really need a whole table of // $DWGCODEPAGE to encodings mappings diff --git a/filter/source/graphicfilter/idxf/dxfreprd.hxx b/filter/source/graphicfilter/idxf/dxfreprd.hxx index 66cc747b41cd..a7e15b274a33 100644 --- a/filter/source/graphicfilter/idxf/dxfreprd.hxx +++ b/filter/source/graphicfilter/idxf/dxfreprd.hxx @@ -111,7 +111,6 @@ private: DXFBoundingBox & rBox); bool isTextEncodingSet() const { return mEnc != RTL_TEXTENCODING_DONTKNOW; } - bool isTextEncodingUTF8() const { return mEnc == RTL_TEXTENCODING_UTF8; } }; diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 92e887d7e1fd..6c67b1ee15cb 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -178,7 +178,7 @@ void Impl_OlePres::Write( SvStream & rStm ) sal_uLong nPos = rStm.Tell(); rStm.WriteInt32( 0 ); - if( GetFormat() == SotClipboardFormatId::GDIMETAFILE && pMtf ) + if( nFormat == SotClipboardFormatId::GDIMETAFILE && pMtf ) { // Always to 1/100 mm, until Mtf-Solution found // Assumption (no scaling, no origin translation) diff --git a/filter/source/msfilter/viscache.hxx b/filter/source/msfilter/viscache.hxx index ee1767c5c05e..608ca8f71a64 100644 --- a/filter/source/msfilter/viscache.hxx +++ b/filter/source/msfilter/viscache.hxx @@ -50,7 +50,6 @@ public: delete pMtf; pMtf = new GDIMetaFile( rMtf ); } - SotClipboardFormatId GetFormat() const { return nFormat; } void SetAspect( sal_uInt16 nAsp ) { nAspect = nAsp; } void SetAdviseFlags( sal_uLong nAdv ) { nAdvFlags = nAdv; } void SetSize( const Size & rSize ) { aSize = rSize; } diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index d4186ed8af71..ff1fac9117ec 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -153,7 +153,7 @@ IMPL_LINK(XMLFilterSettingsDialog, ClickHdl_Impl, Button *, pButton, void ) } else if (m_pPBClose == pButton) { - onClose(); + Close(); } m_bIsClosable = true; @@ -976,11 +976,6 @@ void XMLFilterSettingsDialog::onOpen() } } -void XMLFilterSettingsDialog::onClose() -{ - Close(); -} - bool XMLFilterSettingsDialog::Notify( NotifyEvent& rNEvt ) { // Because of tab control first call the base class. diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx index 40f269861d7c..a44e5da01637 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.hxx @@ -100,7 +100,6 @@ public: void onDelete(); void onSave(); void onOpen(); - void onClose(); void updateStates(); diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.cxx b/filter/source/xsltdialog/xmlfiltertestdialog.cxx index 5c81b608edc9..686d1427cf78 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.cxx @@ -587,11 +587,6 @@ void XMLFilterTestDialog::onImportBrowse() initDialog(); } -void XMLFilterTestDialog::onImportRecentDocument() -{ - import( m_sImportRecentFile ); -} - void XMLFilterTestDialog::import( const OUString& rURL ) { try @@ -671,7 +666,7 @@ IMPL_LINK(XMLFilterTestDialog, ClickHdl_Impl, Button *, pButton, void ) } else if (m_pPBRecentFile == pButton) { - onImportRecentDocument(); + import( m_sImportRecentFile ); } else if (m_pPBClose == pButton) { diff --git a/filter/source/xsltdialog/xmlfiltertestdialog.hxx b/filter/source/xsltdialog/xmlfiltertestdialog.hxx index 64144fa60d84..a9f79873e73b 100644 --- a/filter/source/xsltdialog/xmlfiltertestdialog.hxx +++ b/filter/source/xsltdialog/xmlfiltertestdialog.hxx @@ -49,7 +49,6 @@ private: void onExportBrowse(); void onExportCurrentDocument(); void onImportBrowse(); - void onImportRecentDocument(); void initDialog(); css::uno::Reference< css::lang::XComponent > getFrontMostDocument( const OUString& rServiceName ); diff --git a/forms/source/component/EventThread.cxx b/forms/source/component/EventThread.cxx index 8e4cdfaa0d0f..e1011b17f26f 100644 --- a/forms/source/component/EventThread.cxx +++ b/forms/source/component/EventThread.cxx @@ -135,28 +135,18 @@ void OComponentEventThread::addEvent( const EventObject* _pEvt, m_aCond.set(); } -void OComponentEventThread::implStarted( ) -{ - acquire( ); -} - -void OComponentEventThread::implTerminated( ) -{ - release( ); -} - void SAL_CALL OComponentEventThread::onTerminated() { OComponentEventThread_TBASE::onTerminated(); - implTerminated( ); + release( ); } void OComponentEventThread::run() { osl_setThreadName("frm::OComponentEventThread"); - implStarted( ); + acquire( ); // Hold on to ourselves, so that we're not deleted if a dispose is called at some point in time css::uno::Reference<css::uno::XInterface> xThis(static_cast<XWeak*>(this)); diff --git a/forms/source/component/EventThread.hxx b/forms/source/component/EventThread.hxx index 71edb846e855..e8472f54419c 100644 --- a/forms/source/component/EventThread.hxx +++ b/forms/source/component/EventThread.hxx @@ -101,9 +101,6 @@ public: void SAL_CALL operator delete( void * p ) throw() { osl::Thread::operator delete(p); } private: - void implStarted( ); - void implTerminated( ); - void impl_clearEventQueue(); }; diff --git a/forms/source/component/GroupManager.cxx b/forms/source/component/GroupManager.cxx index 4bde4ddf7085..1ff40b5abb27 100644 --- a/forms/source/component/GroupManager.cxx +++ b/forms/source/component/GroupManager.cxx @@ -62,7 +62,7 @@ OGroupCompAcc::OGroupCompAcc(const Reference<XPropertySet>& rxElement, const OGr bool OGroupCompAcc::operator==( const OGroupCompAcc& rCompAcc ) const { - return (m_xComponent == rCompAcc.GetComponent()); + return m_xComponent == rCompAcc.m_xComponent; } class OGroupCompAccLess : public ::std::binary_function<OGroupCompAcc, OGroupCompAcc, sal_Bool> diff --git a/forms/source/component/GroupManager.hxx b/forms/source/component/GroupManager.hxx index d0b45fd5f424..35f1c9ecb40b 100644 --- a/forms/source/component/GroupManager.hxx +++ b/forms/source/component/GroupManager.hxx @@ -127,7 +127,6 @@ public: bool operator==( const OGroupCompAcc& rCompAcc ) const; - inline const css::uno::Reference< css::beans::XPropertySet>& GetComponent() const { return m_xComponent; } const OGroupComp& GetGroupComponent() const { return m_aGroupComp; } }; diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index 744a11b77ac3..c59b805c67a0 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -1113,7 +1113,7 @@ namespace frm void FormOperations::impl_checkDisposed_throw() const { - if ( impl_isDisposed_nothrow() ) + if ( !m_xCursor.is() ) throw DisposedException( OUString(), *const_cast< FormOperations* >( this ) ); } diff --git a/forms/source/runtime/formoperations.hxx b/forms/source/runtime/formoperations.hxx index 47acd3fe48b6..3d94b7aaea95 100644 --- a/forms/source/runtime/formoperations.hxx +++ b/forms/source/runtime/formoperations.hxx @@ -149,10 +149,6 @@ namespace frm void createWithFormController( const css::uno::Reference< css::form::runtime::XFormController >& _rxController ); void createWithForm( const css::uno::Reference< css::form::XForm >& _rxForm ); - /** determines whether or not we're already disposed - */ - inline bool impl_isDisposed_nothrow() const { return !m_xCursor.is(); } - /** checks whether the instance is already disposed, and throws an exception if so */ void impl_checkDisposed_throw() const; diff --git a/forms/source/xforms/NameContainer.hxx b/forms/source/xforms/NameContainer.hxx index 8e4cd809dbcc..621ea968160f 100644 --- a/forms/source/xforms/NameContainer.hxx +++ b/forms/source/xforms/NameContainer.hxx @@ -44,12 +44,6 @@ protected: typedef std::map<OUString,T> map_t; map_t maItems; - - bool hasItems() - { - return ! maItems.empty(); - } - typename map_t::const_iterator findItem( const OUString& rName ) { return maItems.find( rName ); @@ -99,7 +93,7 @@ public: virtual sal_Bool SAL_CALL hasElements() throw( css::uno::RuntimeException, std::exception ) override { - return hasItems(); + return ! maItems.empty(); } diff --git a/forms/source/xforms/mip.cxx b/forms/source/xforms/mip.cxx index 0edf32e53a09..b1759ecbe77e 100644 --- a/forms/source/xforms/mip.cxx +++ b/forms/source/xforms/mip.cxx @@ -29,7 +29,7 @@ MIP::MIP() resetRequired(); resetRelevant(); resetConstraint(); - resetCalculate(); + mbHasCalculate = false; resetTypeName(); } @@ -37,32 +37,32 @@ void MIP::inherit( const MIP& rMip ) { if( ! mbHasReadonly ) { - mbHasReadonly = rMip.hasReadonly(); + mbHasReadonly = rMip.mbHasReadonly; mbReadonly = rMip.isReadonly(); } if( ! mbHasRequired ) { - mbHasRequired = rMip.hasRequired(); + mbHasRequired = rMip.mbHasRequired; mbRequired = rMip.isRequired(); } if( ! mbHasRelevant ) { - mbHasRelevant = rMip.hasRelevant(); + mbHasRelevant = rMip.mbHasRelevant; mbRelevant = rMip.isRelevant(); } if( ! mbHasConstraint ) { - mbHasConstraint = rMip.hasConstraint(); + mbHasConstraint = rMip.mbHasConstraint; mbConstraint = rMip.isConstraint(); msConstraintExplanation = rMip.getConstraintExplanation(); } if( ! mbHasCalculate ) { - mbHasCalculate = rMip.hasCalculate(); + mbHasCalculate = rMip.mbHasCalculate; } if( ! mbHasTypeName ) { - mbHasTypeName = rMip.hasTypeName(); + mbHasTypeName = rMip.mbHasTypeName; msTypeName = rMip.getTypeName(); } } @@ -89,7 +89,6 @@ void MIP::resetConstraint() { mbHasConstraint = false; mbConstraint = true void MIP::setConstraintExplanation( const OUString& s ) { msConstraintExplanation = s; } void MIP::setHasCalculate( bool b ) { mbHasCalculate = b; } -void MIP::resetCalculate() { mbHasCalculate = false; } void MIP::setTypeName( const OUString& s ) { msTypeName = s; mbHasTypeName = true; } void MIP::resetTypeName() { msTypeName.clear(); mbHasTypeName = false; } diff --git a/forms/source/xforms/mip.hxx b/forms/source/xforms/mip.hxx index 4996fe162d58..f51c41384aa2 100644 --- a/forms/source/xforms/mip.hxx +++ b/forms/source/xforms/mip.hxx @@ -62,31 +62,26 @@ public: // - type (static; default: xsd:string) // (currently default implemented as empty string) - bool hasTypeName() const { return mbHasTypeName; } const OUString& getTypeName() const { return msTypeName; } void setTypeName( const OUString& ); void resetTypeName(); // - readonly (computed XPath; default: false; true if calculate exists) - bool hasReadonly() const { return mbHasReadonly; } bool isReadonly() const; void setReadonly( bool ); void resetReadonly(); // - required (computed XPath; default: false) - bool hasRequired() const { return mbHasRequired; } bool isRequired() const { return mbRequired; } void setRequired( bool ); void resetRequired(); // - relevant (computed XPath; default: true) - bool hasRelevant() const { return mbHasRelevant; } bool isRelevant() const { return mbRelevant; } void setRelevant( bool ); void resetRelevant(); // - constraint (computed XPath; default: true) - bool hasConstraint() const { return mbHasConstraint; } bool isConstraint() const { return mbConstraint; } void setConstraint( bool ); void resetConstraint(); @@ -99,9 +94,7 @@ public: // (for calculate, we only store whether a calculate MIP is present; // the actual calculate value is handled my changing the instance // directly) - bool hasCalculate() const { return mbHasCalculate; } void setHasCalculate( bool ); - void resetCalculate(); // - minOccurs/maxOccurs (computed XPath; default: 0/inf) // - p3ptype (static; no default) |