[Libreoffice-commits] core.git: include/tools include/ucbhelper tools/source ucbhelper/source ucb/source unotools/source unoxml/source vbahelper/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Jun 16 06:26:31 UTC 2017


 include/tools/resmgr.hxx                             |    4 +---
 include/tools/stream.hxx                             |    2 ++
 include/ucbhelper/interactionrequest.hxx             |    2 --
 tools/source/rc/resmgr.cxx                           |    8 ++------
 tools/source/stream/strmunx.cxx                      |    2 --
 ucb/source/ucp/ftp/ftpintreq.cxx                     |    2 --
 ucb/source/ucp/ftp/ftpintreq.hxx                     |    4 ----
 ucbhelper/source/provider/interactionrequest.cxx     |    3 +--
 unotools/source/config/extendedsecurityoptions.cxx   |    4 ----
 unoxml/source/dom/documentbuilder.cxx                |    3 ---
 vbahelper/source/msforms/vbacontrol.cxx              |    3 +--
 vbahelper/source/msforms/vbacontrol.hxx              |    1 -
 vbahelper/source/vbahelper/vbacommandbarcontrol.cxx  |   10 +++-------
 vbahelper/source/vbahelper/vbacommandbarcontrol.hxx  |    5 ++---
 vbahelper/source/vbahelper/vbacommandbarcontrols.cxx |    8 ++++----
 15 files changed, 16 insertions(+), 45 deletions(-)

New commits:
commit a975624bfeeb08670b90944eda372d6d4755ae34
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Thu Jun 15 16:02:03 2017 +0200

    loplugin:unusedfields in tools..vbahelper
    
    Change-Id: Ief7d4c8e1866604eda6308ea2a5c1ce4b1c093bc
    Reviewed-on: https://gerrit.libreoffice.org/38836
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/tools/resmgr.hxx b/include/tools/resmgr.hxx
index 6d98f4997e3a..5c464ae05c9a 100644
--- a/include/tools/resmgr.hxx
+++ b/include/tools/resmgr.hxx
@@ -73,11 +73,9 @@ struct ImpRCStack
     RCFlags         Flags;      ///< resource status
     void *          aResHandle; ///< Resource-Identifier from InternalResMgr
     const Resource* pResObj;    ///< pointer to Resource object
-    sal_uInt32      nId;        ///< ResId used for error message
-    ResMgr*         pResMgr;    ///< ResMgr for Resource pResObj
 
     void            Clear();
-    void            Init( ResMgr * pMgr, const Resource * pObj, sal_uInt32 nId );
+    void            Init( const Resource * pObj, sal_uInt32 nId );
 };
 
 class SAL_WARN_UNUSED TOOLS_DLLPUBLIC ResMgr
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 4b7765dc09d0..b47d150aca29 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -574,7 +574,9 @@ class TOOLS_DLLPUBLIC SvFileStream : public SvStream
 private:
     StreamData*     pInstanceData;
     OUString        aFilename;
+#if defined(_WIN32)
     sal_uInt16      nLockCounter;
+#endif
     bool            bIsOpen;
 
     SvFileStream (const SvFileStream&) = delete;
diff --git a/include/ucbhelper/interactionrequest.hxx b/include/ucbhelper/interactionrequest.hxx
index 07cd1ad629a8..7c2a5f565cad 100644
--- a/include/ucbhelper/interactionrequest.hxx
+++ b/include/ucbhelper/interactionrequest.hxx
@@ -316,7 +316,6 @@ class UCBHELPER_DLLPUBLIC InteractionSupplyAuthentication :
     OUString m_aAccount;
     css::ucb::RememberAuthentication m_eRememberPasswordMode;
     css::ucb::RememberAuthentication m_eDefaultRememberPasswordMode;
-    css::ucb::RememberAuthentication m_eRememberAccountMode;
     css::ucb::RememberAuthentication m_eDefaultRememberAccountMode;
     bool m_bCanSetRealm    : 1;
     bool m_bCanSetUserName : 1;
@@ -481,7 +480,6 @@ inline InteractionSupplyAuthentication::InteractionSupplyAuthentication(
   m_aRememberAccountModes( rRememberAccountModes ),
   m_eRememberPasswordMode( eDefaultRememberPasswordMode ),
   m_eDefaultRememberPasswordMode( eDefaultRememberPasswordMode ),
-  m_eRememberAccountMode( eDefaultRememberAccountMode ),
   m_eDefaultRememberAccountMode( eDefaultRememberAccountMode ),
   m_bCanSetRealm( bCanSetRealm ),
   m_bCanSetUserName( bCanSetUserName ),
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 3d3d2dd89048..3e808571923e 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -725,15 +725,13 @@ static void RscException_Impl()
     }
 }
 
-void ImpRCStack::Init( ResMgr* pMgr, const Resource* pObj, sal_uInt32 Id )
+void ImpRCStack::Init( const Resource* pObj, sal_uInt32 Id )
 {
     pResource       = nullptr;
     pClassRes       = nullptr;
     Flags           = RCFlags::NONE;
     aResHandle      = nullptr;
     pResObj         = pObj;
-    nId             = Id & ~RSC_DONTRELEASE; //TLX: Besser Init aendern
-    pResMgr         = pMgr;
     if ( !(Id & RSC_DONTRELEASE) )
         Flags      |= RCFlags::AUTORELEASE;
 }
@@ -745,8 +743,6 @@ void ImpRCStack::Clear()
     Flags           = RCFlags::NONE;
     aResHandle      = nullptr;
     pResObj         = nullptr;
-    nId             = 0;
-    pResMgr         = nullptr;
 }
 
 static RSHEADER_TYPE* LocalResource( const ImpRCStack* pStack,
@@ -966,7 +962,7 @@ bool ResMgr::GetResource( const ResId& rId, const Resource* pResObj )
 
     incStack();
     pTop = &aStack[nCurStack];
-    pTop->Init( pMgr, pResObj, nId |
+    pTop->Init( pResObj, nId |
                 (rId.IsAutoRelease() ? 0 : RSC_DONTRELEASE) );
 
     if ( pClassRes )
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 46d0bb79c9dc..bb5d3de9fff7 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -272,7 +272,6 @@ static sal_uInt32 GetSvError( oslFileError nErrno )
 SvFileStream::SvFileStream( const OUString& rFileName, StreamMode nOpenMode )
 {
     bIsOpen             = false;
-    nLockCounter        = 0;
     m_isWritable        = false;
     pInstanceData       = new StreamData;
 
@@ -290,7 +289,6 @@ SvFileStream::SvFileStream( const OUString& rFileName, StreamMode nOpenMode )
 SvFileStream::SvFileStream()
 {
     bIsOpen             = false;
-    nLockCounter        = 0;
     m_isWritable        = false;
     pInstanceData       = new StreamData;
     SetBufferSize( 1024 );
diff --git a/ucb/source/ucp/ftp/ftpintreq.cxx b/ucb/source/ucp/ftp/ftpintreq.cxx
index e660153807c4..08b857590b9e 100644
--- a/ucb/source/ucp/ftp/ftpintreq.cxx
+++ b/ucb/source/ucp/ftp/ftpintreq.cxx
@@ -48,13 +48,11 @@ void SAL_CALL XInteractionApproveImpl::select()
 // XInteractionDisapproveImpl
 
 XInteractionDisapproveImpl::XInteractionDisapproveImpl()
-    : m_bSelected(false)
 {
 }
 
 void SAL_CALL XInteractionDisapproveImpl::select()
 {
-    m_bSelected = true;
 }
 
 // XInteractionRequestImpl
diff --git a/ucb/source/ucp/ftp/ftpintreq.hxx b/ucb/source/ucp/ftp/ftpintreq.hxx
index 50356454f05f..04b57de82aed 100644
--- a/ucb/source/ucp/ftp/ftpintreq.hxx
+++ b/ucb/source/ucp/ftp/ftpintreq.hxx
@@ -58,10 +58,6 @@ namespace ftp {
         XInteractionDisapproveImpl();
 
         virtual void SAL_CALL select() override;
-
-    private:
-
-        bool          m_bSelected;
     };
 
 
diff --git a/ucbhelper/source/provider/interactionrequest.cxx b/ucbhelper/source/provider/interactionrequest.cxx
index 9f4119c8bdb7..edb7010aeaad 100644
--- a/ucbhelper/source/provider/interactionrequest.cxx
+++ b/ucbhelper/source/provider/interactionrequest.cxx
@@ -644,9 +644,8 @@ InteractionSupplyAuthentication::getRememberAccountModes(
 
 // virtual
 void SAL_CALL InteractionSupplyAuthentication::setRememberAccount(
-                                    ucb::RememberAuthentication Remember )
+                                    ucb::RememberAuthentication )
 {
-    m_eRememberAccountMode = Remember;
 }
 
 
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
index fccc785a2003..0d680c304d27 100644
--- a/unotools/source/config/extendedsecurityoptions.cxx
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -98,7 +98,6 @@ class SvtExtendedSecurityOptions_Impl : public ConfigItem
         OUString                                        m_aExtensionPropName;
 
         SvtExtendedSecurityOptions::OpenHyperlinkMode   m_eOpenHyperlinkMode;
-        bool                                        m_bROOpenHyperlinkMode;
         ExtensionHashMap                                m_aExtensionHashMap;
 };
 
@@ -110,7 +109,6 @@ SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl()
     , m_aSecureExtensionsSetName( SECURE_EXTENSIONS_SET )
     , m_aExtensionPropName( EXTENSION_PROPNAME )
     , m_eOpenHyperlinkMode(SvtExtendedSecurityOptions::OPEN_NEVER)
-    , m_bROOpenHyperlinkMode(false)
     // Init member then.
 {
     // Fill the extension hash map with all secure extension strings
@@ -118,7 +116,6 @@ SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl()
 
     Sequence< OUString >    seqNames    = GetPropertyNames();
     Sequence< Any >         seqValues   = GetProperties( seqNames );
-    Sequence< sal_Bool >    seqRO       = GetReadOnlyStates ( seqNames  );
 
     sal_Int32 nPropertyCount = seqValues.getLength();
     for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
@@ -138,7 +135,6 @@ SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl()
                 else {
                     OSL_FAIL("Wrong type for Open mode!");
                 }
-                m_bROOpenHyperlinkMode = seqRO[nProperty];
             }
             break;
         }
diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx
index 006e5c7fe086..5f3530395bfe 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -180,7 +180,6 @@ namespace DOM
 
     // context struct passed to IO functions
     typedef struct context {
-        CDocumentBuilder *pBuilder;
         Reference< XInputStream > rInputStream;
         bool close;
         bool freeOnClose;
@@ -247,7 +246,6 @@ namespace DOM
         // when IO is actually performed through the callbacks. The close function must
         // free the memory which is indicated by the freeOnClose field in the context struct
         context_t *c = new context_t;
-        c->pBuilder = builder;
         c->rInputStream = src.aInputStream;
         c->close = true;
         c->freeOnClose = true;
@@ -316,7 +314,6 @@ namespace DOM
         // IO context struct.  Must outlive pContext, as destroying that via
         // xmlFreeParserCtxt may still access this context_t
         context_t c;
-        c.pBuilder = this;
         c.rInputStream = is;
         // we did not open the stream, thus we do not close it.
         c.close = false;
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index 0906439c1e04..1c8e50d6632f 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -124,7 +124,7 @@ ScVbaControlListener::disposing( const lang::EventObject& )
 
 //ScVbaControl
 
-ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl,  const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ),  bIsDialog(false), m_xControl( xControl ), m_xModel( xModel )
+ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< ::uno::XInterface >& xControl,  const css::uno::Reference< css::frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ControlImpl_BASE( xParent, xContext ), m_xControl( xControl ), m_xModel( xModel )
 {
     //add listener
     m_xEventListener.set( new ScVbaControlListener( this ) );
@@ -146,7 +146,6 @@ ScVbaControl::ScVbaControl( const uno::Reference< XHelperInterface >& xParent, c
     else if ( xUserFormControl.is() ) // userform control
     {
         m_xProps.set( xUserFormControl->getModel(), uno::UNO_QUERY_THROW );
-        bIsDialog = true;
     }
 }
 
diff --git a/vbahelper/source/msforms/vbacontrol.hxx b/vbahelper/source/msforms/vbacontrol.hxx
index 51bcb958480d..66bebf5acad5 100644
--- a/vbahelper/source/msforms/vbacontrol.hxx
+++ b/vbahelper/source/msforms/vbacontrol.hxx
@@ -44,7 +44,6 @@ protected:
     // whether it is necessary is another question
     OUString m_aControlTag;
 
-    bool bIsDialog;
     OUString m_sLibraryAndCodeName;
     std::unique_ptr< ov::AbstractGeometryAttributes > mpGeometryHelper;
     css::uno::Reference< css::beans::XPropertySet > m_xProps;
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
index cfc89c70abd8..f69bcf822d9a 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.cxx
@@ -24,7 +24,7 @@
 using namespace com::sun::star;
 using namespace ooo::vba;
 
-ScVbaCommandBarControl::ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl ) : CommandBarControl_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_sResourceUrl( sResourceUrl ), m_xCurrentSettings( xSettings ), m_xBarSettings( xBarSettings ), m_nPosition( 0 ), m_bTemporary( true )
+ScVbaCommandBarControl::ScVbaCommandBarControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl ) : CommandBarControl_BASE( xParent, xContext ), pCBarHelper( pHelper ), m_sResourceUrl( sResourceUrl ), m_xCurrentSettings( xSettings ), m_xBarSettings( xBarSettings ), m_nPosition( 0 )
 {
 }
 
@@ -200,12 +200,10 @@ ScVbaCommandBarPopup::ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelp
                                             const VbaCommandBarHelperRef& pHelper,
                                             const css::uno::Reference< css::container::XIndexAccess >& xBarSettings,
                                             const OUString& sResourceUrl,
-                                            sal_Int32 nPosition,
-                                            bool bTemporary )
+                                            sal_Int32 nPosition )
     : CommandBarPopup_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl )
 {
     m_nPosition = nPosition;
-    m_bTemporary = bTemporary;
     m_xCurrentSettings->getByIndex( m_nPosition ) >>= m_aPropertyValues;
 }
 
@@ -234,12 +232,10 @@ ScVbaCommandBarButton::ScVbaCommandBarButton( const css::uno::Reference< ov::XHe
                                               const VbaCommandBarHelperRef& pHelper,
                                               const css::uno::Reference< css::container::XIndexAccess >& xBarSettings,
                                               const OUString& sResourceUrl,
-                                              sal_Int32 nPosition,
-                                              bool bTemporary )
+                                              sal_Int32 nPosition )
     : CommandBarButton_BASE( xParent, xContext, xSettings, pHelper, xBarSettings, sResourceUrl )
 {
     m_nPosition = nPosition;
-    m_bTemporary = bTemporary;
     m_xCurrentSettings->getByIndex( m_nPosition ) >>= m_aPropertyValues;
 }
 
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
index de5fdfc4d6af..348518b5ba2e 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrol.hxx
@@ -40,7 +40,6 @@ protected:
     css::uno::Sequence< css::beans::PropertyValue >     m_aPropertyValues;
 
     sal_Int32           m_nPosition;
-    bool                m_bTemporary;
 
 private:
     /// @throws css::uno::RuntimeException
@@ -80,7 +79,7 @@ class ScVbaCommandBarPopup : public CommandBarPopup_BASE
 {
 public:
     /// @throws css::uno::RuntimeException
-    ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, bool bTemporary );
+    ScVbaCommandBarPopup( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition );
 
     virtual sal_Int32 SAL_CALL getType() override
     {
@@ -96,7 +95,7 @@ class ScVbaCommandBarButton : public CommandBarButton_BASE
 {
 public:
     /// @throws css::uno::RuntimeException
-    ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition, bool bTemporary );
+    ScVbaCommandBarButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xSettings, const VbaCommandBarHelperRef& pHelper, const css::uno::Reference< css::container::XIndexAccess >& xBarSettings, const OUString& sResourceUrl, sal_Int32 nPosition );
 
     virtual sal_Int32 SAL_CALL getType() override
     {
diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
index 9c0772c9c9da..1c4261f034f5 100644
--- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
+++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx
@@ -132,9 +132,9 @@ ScVbaCommandBarControls::createCollectionObject( const uno::Any& aSource )
     getPropertyValue( aProps, ITEM_DESCRIPTOR_CONTAINER ) >>= xSubMenu;
     ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
     if( xSubMenu.is() )
-        pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, true );
+        pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
     else
-        pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, true );
+        pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
 
     return uno::makeAny( uno::Reference< XCommandBarControl > ( pNewCommandBarControl ) );
 }
@@ -227,9 +227,9 @@ ScVbaCommandBarControls::Add( const uno::Any& Type, const uno::Any& Id, const un
 
     ScVbaCommandBarControl* pNewCommandBarControl = nullptr;
     if( nType == office::MsoControlType::msoControlPopup )
-        pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, bTemporary );
+        pNewCommandBarControl = new ScVbaCommandBarPopup( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
     else
-        pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition, bTemporary );
+        pNewCommandBarControl = new ScVbaCommandBarButton( this, mxContext, m_xIndexAccess, pCBarHelper, m_xBarSettings, m_sResourceUrl, nPosition );
 
     return uno::Reference< XCommandBarControl >( pNewCommandBarControl );
 }


More information about the Libreoffice-commits mailing list