Kaydet (Commit) 61831eb8 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:constantfunction: dbaccess

Change-Id: I896f2716cb91169e30f555943174b5aa67e74b20
üst 18ef0c66
...@@ -101,7 +101,6 @@ Sequence< OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames( ) t ...@@ -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) void SAL_CALL OBookmarkContainer::insertByName( const OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(true);
if (checkExistence(_rName)) if (checkExistence(_rName))
throw ElementExistException(); throw ElementExistException();
...@@ -131,7 +130,6 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N ...@@ -131,7 +130,6 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N
OUString sOldBookmark; OUString sOldBookmark;
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(true);
// check the arguments // check the arguments
if (_rName.isEmpty()) if (_rName.isEmpty())
...@@ -161,7 +159,6 @@ void SAL_CALL OBookmarkContainer::removeByName( const OUString& _rName ) throw(N ...@@ -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) void SAL_CALL OBookmarkContainer::replaceByName( const OUString& _rName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException, std::exception)
{ {
ClearableMutexGuard aGuard(m_rMutex); ClearableMutexGuard aGuard(m_rMutex);
checkValid(true);
// check the arguments // check the arguments
if (_rName.isEmpty()) if (_rName.isEmpty())
...@@ -211,14 +208,12 @@ void SAL_CALL OBookmarkContainer::removeContainerListener( const Reference< XCon ...@@ -211,14 +208,12 @@ void SAL_CALL OBookmarkContainer::removeContainerListener( const Reference< XCon
Type SAL_CALL OBookmarkContainer::getElementType( ) throw (RuntimeException, std::exception) Type SAL_CALL OBookmarkContainer::getElementType( ) throw (RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
return ::cppu::UnoType<OUString>::get(); return ::cppu::UnoType<OUString>::get();
} }
sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException, std::exception) sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
return !m_aBookmarks.empty(); return !m_aBookmarks.empty();
} }
...@@ -226,7 +221,6 @@ sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException, st ...@@ -226,7 +221,6 @@ sal_Bool SAL_CALL OBookmarkContainer::hasElements( ) throw (RuntimeException, st
Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) throw(RuntimeException, std::exception) Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) throw(RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess*>(this)); return new ::comphelper::OEnumerationByIndex(static_cast<XIndexAccess*>(this));
} }
...@@ -234,14 +228,12 @@ Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) thr ...@@ -234,14 +228,12 @@ Reference< XEnumeration > SAL_CALL OBookmarkContainer::createEnumeration( ) thr
sal_Int32 SAL_CALL OBookmarkContainer::getCount( ) throw(RuntimeException, std::exception) sal_Int32 SAL_CALL OBookmarkContainer::getCount( ) throw(RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
return m_aBookmarks.size(); return m_aBookmarks.size();
} }
Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception) Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
if ((_nIndex < 0) || (_nIndex >= (sal_Int32)m_aBookmarksIndexed.size())) if ((_nIndex < 0) || (_nIndex >= (sal_Int32)m_aBookmarksIndexed.size()))
throw IndexOutOfBoundsException(); throw IndexOutOfBoundsException();
...@@ -252,7 +244,6 @@ Any SAL_CALL OBookmarkContainer::getByIndex( sal_Int32 _nIndex ) throw(IndexOutO ...@@ -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) Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
if (!checkExistence(_rName)) if (!checkExistence(_rName))
throw NoSuchElementException(); throw NoSuchElementException();
...@@ -263,7 +254,6 @@ Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName ) throw(NoSuc ...@@ -263,7 +254,6 @@ Any SAL_CALL OBookmarkContainer::getByName( const OUString& _rName ) throw(NoSuc
Sequence< OUString > SAL_CALL OBookmarkContainer::getElementNames( ) throw(RuntimeException, std::exception) Sequence< OUString > SAL_CALL OBookmarkContainer::getElementNames( ) throw(RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
Sequence< OUString > aNames(m_aBookmarks.size()); Sequence< OUString > aNames(m_aBookmarks.size());
OUString* pNames = aNames.getArray(); OUString* pNames = aNames.getArray();
...@@ -282,7 +272,6 @@ Sequence< OUString > SAL_CALL OBookmarkContainer::getElementNames( ) throw(Runt ...@@ -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) sal_Bool SAL_CALL OBookmarkContainer::hasByName( const OUString& _rName ) throw(RuntimeException, std::exception)
{ {
MutexGuard aGuard(m_rMutex); MutexGuard aGuard(m_rMutex);
checkValid(false);
return checkExistence(_rName); return checkExistence(_rName);
} }
...@@ -332,10 +321,6 @@ void OBookmarkContainer::implReplace(const OUString& _rName, const OUString& _rN ...@@ -332,10 +321,6 @@ void OBookmarkContainer::implReplace(const OUString& _rName, const OUString& _rN
m_aBookmarks[_rName] = _rNewLink; m_aBookmarks[_rName] = _rNewLink;
} }
void OBookmarkContainer::checkValid(bool /*_bIntendWriteAccess*/) const throw (RuntimeException, DisposedException)
{
}
Reference< XInterface > SAL_CALL OBookmarkContainer::getParent( ) throw (RuntimeException, std::exception) Reference< XInterface > SAL_CALL OBookmarkContainer::getParent( ) throw (RuntimeException, std::exception)
{ {
return m_rParent; return m_rParent;
......
...@@ -130,14 +130,6 @@ public: ...@@ -130,14 +130,6 @@ public:
void dispose(); void dispose();
protected: 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. /** 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. if there is such an object which is not already loaded, it won't be loaded now.
@param _rName the object name to check @param _rName the object name to check
......
...@@ -88,7 +88,6 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex ...@@ -88,7 +88,6 @@ DatabaseDataProvider::DatabaseDataProvider(uno::Reference< uno::XComponentContex
void SAL_CALL DatabaseDataProvider::disposing() void SAL_CALL DatabaseDataProvider::disposing()
{ {
lang::EventObject aEvt(static_cast<XWeak*>(this)); lang::EventObject aEvt(static_cast<XWeak*>(this));
m_aParameterManager.disposing( aEvt );
m_aParameterManager.dispose(); // (to free any references it may have to me) m_aParameterManager.dispose(); // (to free any references it may have to me)
m_aFilterManager.dispose(); // (dito) m_aFilterManager.dispose(); // (dito)
......
...@@ -512,33 +512,6 @@ sal_Int32 OAppDetailPageHelper::getElementCount() ...@@ -512,33 +512,6 @@ sal_Int32 OAppDetailPageHelper::getElementCount()
return nCount; 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 bool OAppDetailPageHelper::isLeaf(SvTreeListEntry* _pEntry) const
{ {
if ( !_pEntry ) if ( !_pEntry )
......
...@@ -174,13 +174,6 @@ namespace dbaui ...@@ -174,13 +174,6 @@ namespace dbaui
virtual void Resize() SAL_OVERRIDE; virtual void Resize() SAL_OVERRIDE;
virtual void KeyInput( const KeyEvent& rKEvt ) 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 /** creates the tables page
@param _xConnection @param _xConnection
The connection to get the table names The connection to get the table names
......
...@@ -818,24 +818,21 @@ SvTreeListEntry* OApplicationDetailView::getEntry( const Point& _aPoint ) const ...@@ -818,24 +818,21 @@ SvTreeListEntry* OApplicationDetailView::getEntry( const Point& _aPoint ) const
bool OApplicationDetailView::isCutAllowed() bool OApplicationDetailView::isCutAllowed()
{ {
return m_pControlHelper->isCutAllowed(); return false;
} }
bool OApplicationDetailView::isCopyAllowed() 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() void OApplicationDetailView::paste() { }
{
m_pControlHelper->paste();
}
SvTreeListEntry* OApplicationDetailView::elementAdded(ElementType _eType,const OUString& _rName, const Any& _rObject ) SvTreeListEntry* OApplicationDetailView::elementAdded(ElementType _eType,const OUString& _rName, const Any& _rObject )
{ {
......
...@@ -86,8 +86,6 @@ namespace dbaui ...@@ -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::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; 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 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 // XAccessibleRelationSet
virtual sal_Int32 SAL_CALL getRelationCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual sal_Int32 SAL_CALL getRelationCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
......
...@@ -226,7 +226,6 @@ namespace dbaui ...@@ -226,7 +226,6 @@ namespace dbaui
virtual bool PreNotify(NotifyEvent& rNEvt) SAL_OVERRIDE; virtual bool PreNotify(NotifyEvent& rNEvt) SAL_OVERRIDE;
// DnD stuff // DnD stuff
void StartDrag( sal_Int8 nAction, const Point& rPosPixel );
virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE; virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) SAL_OVERRIDE;
virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE; virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) SAL_OVERRIDE;
......
...@@ -36,8 +36,6 @@ namespace dbaui ...@@ -36,8 +36,6 @@ namespace dbaui
virtual void GetFocus() SAL_OVERRIDE; virtual void GetFocus() SAL_OVERRIDE;
bool isCutAllowed(); bool isCutAllowed();
bool isPasteAllowed();
bool isCopyAllowed();
void copy(); void copy();
void cut(); void cut();
void paste(); void paste();
...@@ -45,8 +43,6 @@ namespace dbaui ...@@ -45,8 +43,6 @@ namespace dbaui
void clear(); void clear();
// set the view readonly or not // set the view readonly or not
void setReadOnly(bool _bReadOnly); void setReadOnly(bool _bReadOnly);
// check if the statement is correct when not returning false
bool checkStatement();
// set the statement for representation // set the statement for representation
void setStatement(const OUString& _rsStatement); void setStatement(const OUString& _rsStatement);
OUString getStatement(); OUString getStatement();
......
...@@ -144,14 +144,6 @@ namespace dbaui ...@@ -144,14 +144,6 @@ namespace dbaui
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
return m_pLine ? m_pLine->GetParent()->GetWindowRegionPixel().IsInside(m_pLine->GetBoundingRect()) : sal_False; 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 // XAccessibleRelationSet
sal_Int32 SAL_CALL OConnectionLineAccess::getRelationCount( ) throw (RuntimeException, std::exception) sal_Int32 SAL_CALL OConnectionLineAccess::getRelationCount( ) throw (RuntimeException, std::exception)
{ {
......
...@@ -1500,10 +1500,6 @@ void OJoinTableView::dragFinished( ) ...@@ -1500,10 +1500,6 @@ void OJoinTableView::dragFinished( )
{ {
} }
void OJoinTableView::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
{
}
void OJoinTableView::clearLayoutInformation() void OJoinTableView::clearLayoutInformation()
{ {
m_pLastFocusTabWin = NULL; m_pLastFocusTabWin = NULL;
......
...@@ -68,12 +68,6 @@ void OQueryTextView::Resize() ...@@ -68,12 +68,6 @@ void OQueryTextView::Resize()
m_pEdit->SetSizePixel( GetOutputSizePixel() ); m_pEdit->SetSizePixel( GetOutputSizePixel() );
} }
// check if the statement is correct when not returning false
bool OQueryTextView::checkStatement()
{
return true;
}
OUString OQueryTextView::getStatement() OUString OQueryTextView::getStatement()
{ {
return m_pEdit->GetText(); return m_pEdit->GetText();
...@@ -110,16 +104,6 @@ bool OQueryTextView::isCutAllowed() ...@@ -110,16 +104,6 @@ bool OQueryTextView::isCutAllowed()
return !m_pEdit->GetSelected().isEmpty(); return !m_pEdit->GetSelected().isEmpty();
} }
bool OQueryTextView::isPasteAllowed()
{
return true;
}
bool OQueryTextView::isCopyAllowed()
{
return true;
}
void OQueryTextView::cut() void OQueryTextView::cut()
{ {
if(!m_pEdit->IsInAccelAct() ) if(!m_pEdit->IsInAccelAct() )
......
...@@ -77,7 +77,7 @@ void OQueryViewSwitch::resizeDocumentView(Rectangle& _rPlayground) ...@@ -77,7 +77,7 @@ void OQueryViewSwitch::resizeDocumentView(Rectangle& _rPlayground)
bool OQueryViewSwitch::checkStatement() bool OQueryViewSwitch::checkStatement()
{ {
if(m_pTextView->IsVisible()) if(m_pTextView->IsVisible())
return m_pTextView->checkStatement(); return true;
return m_pDesignView->checkStatement(); return m_pDesignView->checkStatement();
} }
...@@ -138,14 +138,14 @@ bool OQueryViewSwitch::isCutAllowed() ...@@ -138,14 +138,14 @@ bool OQueryViewSwitch::isCutAllowed()
bool OQueryViewSwitch::isCopyAllowed() bool OQueryViewSwitch::isCopyAllowed()
{ {
if(m_pTextView->IsVisible()) if(m_pTextView->IsVisible())
return m_pTextView->isCopyAllowed(); return true;
return m_pDesignView->isCopyAllowed(); return m_pDesignView->isCopyAllowed();
} }
bool OQueryViewSwitch::isPasteAllowed() bool OQueryViewSwitch::isPasteAllowed()
{ {
if(m_pTextView->IsVisible()) if(m_pTextView->IsVisible())
return m_pTextView->isPasteAllowed(); return true;
return m_pDesignView->isPasteAllowed(); return m_pDesignView->isPasteAllowed();
} }
......
...@@ -73,9 +73,6 @@ namespace dbaui ...@@ -73,9 +73,6 @@ namespace dbaui
const bool i_bFallbackToGeneric 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 // 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; 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;
......
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