loplugin:constantfunction: dbaccess

Change-Id: I896f2716cb91169e30f555943174b5aa67e74b20
This commit is contained in:
Noel Grandin
2015-03-24 08:38:42 +02:00
parent 18ef0c66f0
commit 61831eb816
14 changed files with 9 additions and 108 deletions

View File

@@ -101,7 +101,6 @@ Sequence< OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) t
void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(true);
if (checkExistence(_rName))
throw ElementExistException();
@@ -131,7 +130,6 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N
OUString sOldBookmark;
{
MutexGuard aGuard(m_rMutex);
checkValid(true);
// check the arguments
if (_rName.isEmpty())
@@ -161,7 +159,6 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N
void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException, std::exception)
{
ClearableMutexGuard aGuard(m_rMutex);
checkValid(true);
// check the arguments
if (_rName.isEmpty())
@@ -211,14 +208,12 @@ void SAL_CALL OBookmarkContainer::removeContainerListener( const Reference< XCon
Type SAL_CALL OBookmarkContainer::getElementType( ) throw (RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
return ::cppu::UnoType<OUString>::get();
}
sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
return !m_aBookmarks.empty();
}
@@ -226,7 +221,6 @@ sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException, st
Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) throw(RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess*>(this));
}
@@ -234,14 +228,12 @@ Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) thr
sal_Int32 SAL_CALL OBookmarkContainer::getCount( ) throw(RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
return m_aBookmarks.size();
}
Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
if ((_nIndex < 0) || (_nIndex >= (sal_Int32)m_aBookmarksIndexed.size()))
throw IndexOutOfBoundsException();
@@ -252,7 +244,6 @@ Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutO
Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
if (!checkExistence(_rName))
throw NoSuchElementException();
@@ -263,7 +254,6 @@ Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName ) throw(NoSuc
Sequence< OUString > SAL_CALL OBookmarkContainer::getElementNames( ) throw(RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
Sequence< OUString > aNames(m_aBookmarks.size());
OUString* pNames = aNames.getArray();
@@ -282,7 +272,6 @@ Sequence< OUString > SAL_CALL OBookmarkContainer::getElementNames( ) throw(Runt
sal_Bool SAL_CALL OBookmarkContainer::hasByName( const OUString& _rName ) throw(RuntimeException, std::exception)
{
MutexGuard aGuard(m_rMutex);
checkValid(false);
return checkExistence(_rName);
}
@@ -332,10 +321,6 @@ void OBookmarkContainer::implReplace(const OUString& _rName, const OUString& _rN
m_aBookmarks[_rName] = _rNewLink;
}
void OBookmarkContainer::checkValid(bool /*_bIntendWriteAccess*/) const throw (RuntimeException, DisposedException)
{
}
Reference< XInterface > SAL_CALL OBookmarkContainer::getParent( ) throw (RuntimeException, std::exception)
{
return m_rParent;

View File

@@ -130,14 +130,6 @@ public:
void dispose();
protected:
/** checks whether the object is basically alive, i.e. it has been fully initialized (@see initialize) and
not disposed (@see dispose)
@param _bIntendWriteAccess determines whether or not the caller intends to modify the configuration.
if sal_True and the configuration is readonly, a runtime exception with
a description string is thrown.
*/
void checkValid(bool _bIntendWriteAccess) const throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::DisposedException);
/** quickly checks if there already is an element with a given name. No access to the configuration occurs, i.e.
if there is such an object which is not already loaded, it won't be loaded now.
@param _rName the object name to check

View File

@@ -88,7 +88,6 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex
void SAL_CALL DatabaseDataProvider::disposing()
{
lang::EventObject aEvt(static_cast<XWeak*>(this));
m_aParameterManager.disposing( aEvt );
m_aParameterManager.dispose(); // (to free any references it may have to me)
m_aFilterManager.dispose(); // (dito)

View File

@@ -512,33 +512,6 @@ sal_Int32 OAppDetailPageHelper::getElementCount()
return nCount;
}
bool OAppDetailPageHelper::isCutAllowed()
{
return false;
}
bool OAppDetailPageHelper::isCopyAllowed()
{
return true;
}
bool OAppDetailPageHelper::isPasteAllowed()
{
return true;
}
void OAppDetailPageHelper::copy()
{
}
void OAppDetailPageHelper::cut()
{
}
void OAppDetailPageHelper::paste()
{
}
bool OAppDetailPageHelper::isLeaf(SvTreeListEntry* _pEntry) const
{
if ( !_pEntry )

View File

@@ -174,13 +174,6 @@ namespace dbaui
virtual void Resize() SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) SAL_OVERRIDE;
bool isCutAllowed();
bool isCopyAllowed();
bool isPasteAllowed();
void copy();
void cut();
void paste();
/** creates the tables page
@param _xConnection
The connection to get the table names

View File

@@ -818,24 +818,21 @@ SvTreeListEntry* OApplicationDetailView::getEntry( const Point& _aPoint ) const
bool OApplicationDetailView::isCutAllowed()
{
return m_pControlHelper->isCutAllowed();
return false;
}
bool OApplicationDetailView::isCopyAllowed()
{
return m_pControlHelper->isCopyAllowed();
return true;
}
bool OApplicationDetailView::isPasteAllowed() { return m_pControlHelper->isPasteAllowed(); }
bool OApplicationDetailView::isPasteAllowed() { return true; }
void OApplicationDetailView::copy() { m_pControlHelper->copy(); }
void OApplicationDetailView::copy() { }
void OApplicationDetailView::cut() { m_pControlHelper->cut(); }
void OApplicationDetailView::cut() { }
void OApplicationDetailView::paste()
{
m_pControlHelper->paste();
}
void OApplicationDetailView::paste() { }
SvTreeListEntry* OApplicationDetailView::elementAdded(ElementType _eType,const OUString& _rName, const Any& _rObject )
{

View File

@@ -86,8 +86,6 @@ namespace dbaui
virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::com::sun::star::awt::Size SAL_CALL getSize( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
bool SAL_CALL isShowing( ) throw (::com::sun::star::uno::RuntimeException);
bool SAL_CALL isVisible( ) throw (::com::sun::star::uno::RuntimeException);
bool SAL_CALL isFocusTraversable( ) throw (::com::sun::star::uno::RuntimeException);
// XAccessibleRelationSet
virtual sal_Int32 SAL_CALL getRelationCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;

View File

@@ -226,7 +226,6 @@ namespace dbaui
virtual bool PreNotify(NotifyEvent& rNEvt) SAL_OVERRIDE;
// DnD stuff
void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;

View File

@@ -36,8 +36,6 @@ namespace dbaui
virtual void GetFocus() SAL_OVERRIDE;
bool isCutAllowed();
bool isPasteAllowed();
bool isCopyAllowed();
void copy();
void cut();
void paste();
@@ -45,8 +43,6 @@ namespace dbaui
void clear();
// set the view readonly or not
void setReadOnly(bool _bReadOnly);
// check if the statement is correct when not returning false
bool checkStatement();
// set the statement for representation
void setStatement(const OUString& _rsStatement);
OUString getStatement();

View File

@@ -144,14 +144,6 @@ namespace dbaui
::osl::MutexGuard aGuard( m_aMutex );
return m_pLine ? m_pLine->GetParent()->GetWindowRegionPixel().IsInside(m_pLine->GetBoundingRect()) : sal_False;
}
bool SAL_CALL OConnectionLineAccess::isVisible( ) throw (RuntimeException)
{
return true;
}
bool SAL_CALL OConnectionLineAccess::isFocusTraversable( ) throw (RuntimeException)
{
return true;
}
// XAccessibleRelationSet
sal_Int32 SAL_CALL OConnectionLineAccess::getRelationCount( ) throw (RuntimeException, std::exception)
{

View File

@@ -1500,10 +1500,6 @@ void OJoinTableView::dragFinished( )
{
}
void OJoinTableView::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
{
}
void OJoinTableView::clearLayoutInformation()
{
m_pLastFocusTabWin = NULL;

View File

@@ -68,12 +68,6 @@ void OQueryTextView::Resize()
m_pEdit->SetSizePixel( GetOutputSizePixel() );
}
// check if the statement is correct when not returning false
bool OQueryTextView::checkStatement()
{
return true;
}
OUString OQueryTextView::getStatement()
{
return m_pEdit->GetText();
@@ -110,16 +104,6 @@ bool OQueryTextView::isCutAllowed()
return !m_pEdit->GetSelected().isEmpty();
}
bool OQueryTextView::isPasteAllowed()
{
return true;
}
bool OQueryTextView::isCopyAllowed()
{
return true;
}
void OQueryTextView::cut()
{
if(!m_pEdit->IsInAccelAct() )

View File

@@ -77,7 +77,7 @@ void OQueryViewSwitch::resizeDocumentView(Rectangle& _rPlayground)
bool OQueryViewSwitch::checkStatement()
{
if(m_pTextView->IsVisible())
return m_pTextView->checkStatement();
return true;
return m_pDesignView->checkStatement();
}
@@ -138,14 +138,14 @@ bool OQueryViewSwitch::isCutAllowed()
bool OQueryViewSwitch::isCopyAllowed()
{
if(m_pTextView->IsVisible())
return m_pTextView->isCopyAllowed();
return true;
return m_pDesignView->isCopyAllowed();
}
bool OQueryViewSwitch::isPasteAllowed()
{
if(m_pTextView->IsVisible())
return m_pTextView->isPasteAllowed();
return true;
return m_pDesignView->isPasteAllowed();
}

View File

@@ -73,9 +73,6 @@ namespace dbaui
const bool i_bFallbackToGeneric
);
// XInitialization
void SAL_CALL initialize( com::sun::star::uno::Sequence< com::sun::star::uno::Any > const & /*rArguments*/) throw (com::sun::star::uno::Exception) {}
// XInteractionHandler2
virtual sal_Bool SAL_CALL handleInteractionRequest( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& Request ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;