[Libreoffice-commits] core.git: 2 commits - dbaccess/source lotuswordpro/source

Noel Grandin noel at peralex.com
Tue Mar 24 00:10:01 PDT 2015


 dbaccess/source/core/dataaccess/bookmarkcontainer.cxx   |   15 --------
 dbaccess/source/core/dataaccess/bookmarkcontainer.hxx   |    8 ----
 dbaccess/source/core/misc/DatabaseDataProvider.cxx      |    1 
 dbaccess/source/ui/app/AppDetailPageHelper.cxx          |   27 ----------------
 dbaccess/source/ui/app/AppDetailPageHelper.hxx          |    7 ----
 dbaccess/source/ui/app/AppDetailView.cxx                |   15 +++-----
 dbaccess/source/ui/inc/ConnectionLineAccess.hxx         |    2 -
 dbaccess/source/ui/inc/JoinTableView.hxx                |    1 
 dbaccess/source/ui/inc/QueryTextView.hxx                |    4 --
 dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx |    8 ----
 dbaccess/source/ui/querydesign/JoinTableView.cxx        |    4 --
 dbaccess/source/ui/querydesign/QueryTextView.cxx        |   16 ---------
 dbaccess/source/ui/querydesign/QueryViewSwitch.cxx      |    6 +--
 dbaccess/source/ui/uno/dbinteraction.hxx                |    3 -
 lotuswordpro/source/filter/lwpobjid.hxx                 |    4 +-
 15 files changed, 11 insertions(+), 110 deletions(-)

New commits:
commit 61831eb81661db2572eaa6cabf7d8eba2c4d842c
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 24 08:38:42 2015 +0200

    loplugin:constantfunction: dbaccess
    
    Change-Id: I896f2716cb91169e30f555943174b5aa67e74b20

diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index 17f28f8..881fe8b 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -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;
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx
index f9c4464..b14bfbd 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.hxx
@@ -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
diff --git a/dbaccess/source/core/misc/DatabaseDataProvider.cxx b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
index d030930..1b256dc 100644
--- a/dbaccess/source/core/misc/DatabaseDataProvider.cxx
+++ b/dbaccess/source/core/misc/DatabaseDataProvider.cxx
@@ -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)
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
index 5ce1a69..31b2691 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx
@@ -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 )
diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.hxx b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
index e4ad394..fb86bdd 100644
--- a/dbaccess/source/ui/app/AppDetailPageHelper.hxx
+++ b/dbaccess/source/ui/app/AppDetailPageHelper.hxx
@@ -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
diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx
index 59095b6..9d15ea4 100644
--- a/dbaccess/source/ui/app/AppDetailView.cxx
+++ b/dbaccess/source/ui/app/AppDetailView.cxx
@@ -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 )
 {
diff --git a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
index f74c18b..ce34510 100644
--- a/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
+++ b/dbaccess/source/ui/inc/ConnectionLineAccess.hxx
@@ -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;
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index 39c6fb3..f43cdd2 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -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;
 
diff --git a/dbaccess/source/ui/inc/QueryTextView.hxx b/dbaccess/source/ui/inc/QueryTextView.hxx
index 8155cc1..a45eefb 100644
--- a/dbaccess/source/ui/inc/QueryTextView.hxx
+++ b/dbaccess/source/ui/inc/QueryTextView.hxx
@@ -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();
diff --git a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
index 335ff09..0ea77ec 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
@@ -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)
     {
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index a84153c..fda33fa 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1500,10 +1500,6 @@ void OJoinTableView::dragFinished( )
 {
 }
 
-void OJoinTableView::StartDrag( sal_Int8 /*nAction*/, const Point& /*rPosPixel*/ )
-{
-}
-
 void OJoinTableView::clearLayoutInformation()
 {
     m_pLastFocusTabWin  = NULL;
diff --git a/dbaccess/source/ui/querydesign/QueryTextView.cxx b/dbaccess/source/ui/querydesign/QueryTextView.cxx
index eca9e83..162eb9b 100644
--- a/dbaccess/source/ui/querydesign/QueryTextView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryTextView.cxx
@@ -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() )
diff --git a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
index e506dbe..dd45011 100644
--- a/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
+++ b/dbaccess/source/ui/querydesign/QueryViewSwitch.cxx
@@ -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();
 }
 
diff --git a/dbaccess/source/ui/uno/dbinteraction.hxx b/dbaccess/source/ui/uno/dbinteraction.hxx
index 0b698c7..56685e9 100644
--- a/dbaccess/source/ui/uno/dbinteraction.hxx
+++ b/dbaccess/source/ui/uno/dbinteraction.hxx
@@ -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;
 
commit 18ef0c66f027440c2d34488f83c02fcfb0a1e75e
Author: Noel Grandin <noel at peralex.com>
Date:   Tue Mar 24 08:38:29 2015 +0200

    fix windows build
    
    after my commit d7a4135b072a693cb5ebf94c250d34d5beb741e3
    "loplugin:constantfunction: lotuswordpro"
    it appears that Visual Studio does not support this yet
    
    Change-Id: Ide04fde905e0991e27ec03c3e216fcbd25b1f10b

diff --git a/lotuswordpro/source/filter/lwpobjid.hxx b/lotuswordpro/source/filter/lwpobjid.hxx
index a701ca9..33c3429 100644
--- a/lotuswordpro/source/filter/lwpobjid.hxx
+++ b/lotuswordpro/source/filter/lwpobjid.hxx
@@ -88,7 +88,7 @@ private:
     sal_uInt8 m_nIndex;
     bool m_bIsCompressed;
 public:
-    sal_uInt32  Read( LwpSvStream *pStrm );
+    sal_uInt32 Read( LwpSvStream *pStrm );
     sal_uInt32 Read( LwpObjectStream *pStrm );
     sal_uInt32 ReadIndexed( LwpSvStream* pStrm );
     sal_uInt32 ReadIndexed( LwpObjectStream *pStrm );
@@ -97,7 +97,7 @@ public:
     /**
      * @descr       return the size of object id with format: low(4bytes)+high(2bytes)
     */
-    static sal_uInt32 DiskSize() { return sizeof(m_nLow) + sizeof(m_nHigh); }
+    static sal_uInt32 DiskSize() { return sizeof(sal_uInt32) + sizeof(sal_uInt16); } // sizeof(m_nLow) + sizeof(m_nHigh)
     sal_uInt32 DiskSizeIndexed() const;
     bool IsNull() const;
     bool IsCompressed();


More information about the Libreoffice-commits mailing list