loplugin:unusedfields in sfx2

Change-Id: Id6666065bf3b27388d87aa2605229e83f1aed79a
Reviewed-on: https://gerrit.libreoffice.org/40255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2017-07-21 08:43:08 +02:00
parent 182a74d937
commit 5e4b4eecb1
17 changed files with 13 additions and 108 deletions

View File

@ -592,10 +592,6 @@ include/registry/refltype.hxx:68
RTUik m_Data4 sal_uInt32 RTUik m_Data4 sal_uInt32
include/registry/refltype.hxx:69 include/registry/refltype.hxx:69
RTUik m_Data5 sal_uInt32 RTUik m_Data5 sal_uInt32
include/sfx2/mailmodelapi.hxx:53
SfxMailModel mpCcList std::unique_ptr<AddressList_Impl>
include/sfx2/mailmodelapi.hxx:54
SfxMailModel mpBccList std::unique_ptr<AddressList_Impl>
include/sfx2/msg.hxx:105 include/sfx2/msg.hxx:105
SfxType createSfxPoolItemFunc std::function<SfxPoolItem *(void)> SfxType createSfxPoolItemFunc std::function<SfxPoolItem *(void)>
include/sfx2/msg.hxx:106 include/sfx2/msg.hxx:106
@ -610,14 +606,6 @@ include/sfx2/msg.hxx:119
SfxType0 nAttribs sal_uInt16 SfxType0 nAttribs sal_uInt16
include/sfx2/sidebar/ResourceManager.hxx:103 include/sfx2/sidebar/ResourceManager.hxx:103
sfx2::sidebar::ResourceManager maMiscOptions class SvtMiscOptions sfx2::sidebar::ResourceManager maMiscOptions class SvtMiscOptions
include/sfx2/StylePreviewRenderer.hxx:29
sfx2::StylePreviewRenderer msRenderText class rtl::OUString
include/sfx2/tabdlg.hxx:89
SfxTabDialog m_bItemsReset _Bool
include/sfx2/titledockwin.hxx:87
sfx2::TitledDockingWindow m_aEndDockingHdl Link<class sfx2::TitledDockingWindow *, void>
include/sfx2/viewsh.hxx:153
SfxViewShell pSubShell class SfxShell *
include/svl/ondemand.hxx:59 include/svl/ondemand.hxx:59
OnDemandLocaleDataWrapper aSysLocale class SvtSysLocale OnDemandLocaleDataWrapper aSysLocale class SvtSysLocale
include/svl/svdde.hxx:60 include/svl/svdde.hxx:60
@ -1112,18 +1100,12 @@ sfx2/source/control/dispatch.cxx:132
SfxDispatcher_Impl aObjBars struct SfxObjectBars_Impl [13] SfxDispatcher_Impl aObjBars struct SfxObjectBars_Impl [13]
sfx2/source/control/dispatch.cxx:133 sfx2/source/control/dispatch.cxx:133
SfxDispatcher_Impl aFixedObjBars struct SfxObjectBars_Impl [13] SfxDispatcher_Impl aFixedObjBars struct SfxObjectBars_Impl [13]
sfx2/source/dialog/tabdlg.cxx:114
TabDlg_Impl bModified _Bool
sfx2/source/doc/doctempl.cxx:118 sfx2/source/doc/doctempl.cxx:118
DocTempl::DocTempl_EntryData_Impl mxObjShell class SfxObjectShellLock DocTempl::DocTempl_EntryData_Impl mxObjShell class SfxObjectShellLock
sfx2/source/doc/sfxbasemodel.cxx:189 sfx2/source/doc/sfxbasemodel.cxx:189
IMPL_SfxBaseModel_DataContainer m_xStarBasicAccess Reference<script::XStarBasicAccess> IMPL_SfxBaseModel_DataContainer m_xStarBasicAccess Reference<script::XStarBasicAccess>
sfx2/source/inc/appdata.hxx:104 sfx2/source/inc/appdata.hxx:104
SfxAppData_Impl nDocModalMode sal_uInt16 SfxAppData_Impl nDocModalMode sal_uInt16
sfx2/source/inc/objshimp.hxx:104
SfxObjectShell_Impl nAutoLoadLocks sal_uInt16
sfx2/source/inc/objshimp.hxx:111
SfxObjectShell_Impl bDisposing _Bool
slideshow/source/engine/opengl/TransitionImpl.hxx:296 slideshow/source/engine/opengl/TransitionImpl.hxx:296
Vertex normal glm::vec3 Vertex normal glm::vec3
slideshow/source/engine/opengl/TransitionImpl.hxx:297 slideshow/source/engine/opengl/TransitionImpl.hxx:297

View File

@ -25,7 +25,6 @@ protected:
OutputDevice& mrOutputDev; OutputDevice& mrOutputDev;
SfxStyleSheetBase* mpStyle; SfxStyleSheetBase* mpStyle;
long mnMaxHeight; long mnMaxHeight;
OUString msRenderText;
public: public:
enum class RenderAlign enum class RenderAlign
@ -41,7 +40,6 @@ public:
, mrOutputDev(rOutputDev) , mrOutputDev(rOutputDev)
, mpStyle(pStyle) , mpStyle(pStyle)
, mnMaxHeight(nMaxHeight) , mnMaxHeight(nMaxHeight)
, msRenderText()
{} {}
virtual ~StylePreviewRenderer() virtual ~StylePreviewRenderer()

View File

@ -50,8 +50,6 @@ protected:
private: private:
std::unique_ptr<AddressList_Impl> mpToList; std::unique_ptr<AddressList_Impl> mpToList;
std::unique_ptr<AddressList_Impl> mpCcList;
std::unique_ptr<AddressList_Impl> mpBccList;
OUString maFromAddress; OUString maFromAddress;
OUString maSubject; OUString maSubject;

View File

@ -86,7 +86,6 @@ friend class SfxTabDialogUIObject;
std::unique_ptr< TabDlg_Impl > m_pImpl; std::unique_ptr< TabDlg_Impl > m_pImpl;
sal_uInt16* m_pRanges; sal_uInt16* m_pRanges;
sal_uInt16 m_nAppPageId; sal_uInt16 m_nAppPageId;
bool m_bItemsReset;
bool m_bStandardPushed; bool m_bStandardPushed;
DECL_DLLPRIVATE_LINK(ActivatePageHdl, TabControl*, void ); DECL_DLLPRIVATE_LINK(ActivatePageHdl, TabControl*, void );

View File

@ -63,9 +63,6 @@ namespace sfx2
virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent ) override; virtual void DataChanged( const DataChangedEvent& i_rDataChangedEvent ) override;
virtual void SetText( const OUString& i_rText ) override; virtual void SetText( const OUString& i_rText ) override;
// DockingWindow overridables
void EndDocking(const tools::Rectangle& rRect, bool bFloatMode) override;
virtual void ApplySettings(vcl::RenderContext& rRenderContext) override; virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
protected: protected:
/** internal version of ResetToolBox /** internal version of ResetToolBox
@ -84,8 +81,6 @@ namespace sfx2
VclPtr<ToolBox> m_aToolbox; VclPtr<ToolBox> m_aToolbox;
VclPtr<Window> m_aContentWindow; VclPtr<Window> m_aContentWindow;
Link<TitledDockingWindow*,void> m_aEndDockingHdl;
/** The border that is painted around the inner window. The bevel /** The border that is painted around the inner window. The bevel
shadow lines are part of the border, so where the border is 0 no shadow lines are part of the border, so where the border is 0 no
such line is painted. such line is painted.

View File

@ -150,7 +150,6 @@ friend class SfxPrinterController;
std::unique_ptr<struct SfxViewShell_Impl> pImpl; std::unique_ptr<struct SfxViewShell_Impl> pImpl;
SfxViewFrame* pFrame; SfxViewFrame* pFrame;
SfxShell* pSubShell;
VclPtr<vcl::Window> pWindow; VclPtr<vcl::Window> pWindow;
bool bNoNewWindow; bool bNoNewWindow;
bool mbPrinterSettingsModified; bool mbPrinterSettingsModified;
@ -214,7 +213,6 @@ public:
virtual bool HasSelection( bool bText = true ) const; virtual bool HasSelection( bool bText = true ) const;
virtual SdrView* GetDrawView() const; virtual SdrView* GetDrawView() const;
SfxShell* GetSubShell() const { return pSubShell; }
void AddSubShell( SfxShell& rShell ); void AddSubShell( SfxShell& rShell );
void RemoveSubShell( SfxShell *pShell=nullptr ); void RemoveSubShell( SfxShell *pShell=nullptr );
SfxShell* GetSubShell( sal_uInt16 ); SfxShell* GetSubShell( sal_uInt16 );

View File

@ -726,55 +726,23 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css:
xSimpleMailMessage->setOriginator( maFromAddress ); xSimpleMailMessage->setOriginator( maFromAddress );
size_t nToCount = mpToList ? mpToList->size() : 0; size_t nToCount = mpToList ? mpToList->size() : 0;
size_t nCcCount = mpCcList ? mpCcList->size() : 0;
size_t nCcSeqCount = nCcCount;
// set recipient (only one) for this simple mail server!! // set recipient (only one) for this simple mail server!!
if ( nToCount > 1 ) if ( nToCount >= 1 )
{
nCcSeqCount = nToCount - 1 + nCcCount;
xSimpleMailMessage->setRecipient( mpToList->at( 0 ) );
nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE;
}
else if ( nToCount == 1 )
{ {
xSimpleMailMessage->setRecipient( mpToList->at( 0 ) ); xSimpleMailMessage->setRecipient( mpToList->at( 0 ) );
nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE; nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE;
} }
// all other recipient must be handled with CC recipients! // all other recipient must be handled with CC recipients!
if ( nCcSeqCount > 0 ) if ( nToCount > 1 )
{ {
size_t nIndex = 0; Sequence< OUString > aCcRecipientSeq( nToCount - 1 );
Sequence< OUString > aCcRecipientSeq; for ( size_t i = 1; i < nToCount; ++i )
aCcRecipientSeq[i - 1] = mpToList->at(i);
aCcRecipientSeq.realloc( nCcSeqCount );
if ( nCcSeqCount > nCcCount )
{
for ( size_t i = 1; i < nToCount; ++i )
{
aCcRecipientSeq[nIndex++] = mpToList->at(i);
}
}
for ( size_t i = 0; i < nCcCount; i++ )
{
aCcRecipientSeq[nIndex++] = mpCcList->at(i);
}
xSimpleMailMessage->setCcRecipient( aCcRecipientSeq ); xSimpleMailMessage->setCcRecipient( aCcRecipientSeq );
} }
size_t nBccCount = mpBccList ? mpBccList->size() : 0;
if ( nBccCount > 0 )
{
Sequence< OUString > aBccRecipientSeq( nBccCount );
for ( size_t i = 0; i < nBccCount; ++i )
{
aBccRecipientSeq[i] = mpBccList->at(i);
}
xSimpleMailMessage->setBccRecipient( aBccRecipientSeq );
}
Sequence< OUString > aAttachmentSeq(&(maAttachedDocuments[0]),maAttachedDocuments.size()); Sequence< OUString > aAttachmentSeq(&(maAttachedDocuments[0]),maAttachedDocuments.size());
if ( xSimpleMailMessage->getSubject().isEmpty() ) { if ( xSimpleMailMessage->getSubject().isEmpty() ) {

View File

@ -111,14 +111,11 @@ typedef std::vector<Data_Impl*> SfxTabDlgData_Impl;
struct TabDlg_Impl struct TabDlg_Impl
{ {
bool bModified : 1, bool bModal : 1,
bModal : 1,
bHideResetBtn : 1; bHideResetBtn : 1;
SfxTabDlgData_Impl aData; SfxTabDlgData_Impl aData;
explicit TabDlg_Impl( sal_uInt8 nCnt ) : explicit TabDlg_Impl( sal_uInt8 nCnt ) :
bModified ( false ),
bModal ( true ), bModal ( true ),
bHideResetBtn ( false ) bHideResetBtn ( false )
{ {
@ -321,7 +318,6 @@ SfxTabDialog::SfxTabDialog
, m_pOutSet(nullptr) , m_pOutSet(nullptr)
, m_pRanges(nullptr) , m_pRanges(nullptr)
, m_nAppPageId(USHRT_MAX) , m_nAppPageId(USHRT_MAX)
, m_bItemsReset(false)
, m_bStandardPushed(false) , m_bStandardPushed(false)
, m_pExampleSet(nullptr) , m_pExampleSet(nullptr)
{ {
@ -792,7 +788,7 @@ short SfxTabDialog::Ok()
} }
} }
if ( m_pImpl->bModified || ( m_pOutSet && m_pOutSet->Count() > 0 ) ) if ( m_pOutSet && m_pOutSet->Count() > 0 )
bModified = true; bModified = true;
if (m_bStandardPushed) if (m_bStandardPushed)
@ -1067,18 +1063,8 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl, void )
// Create TabPage if possible: // Create TabPage if possible:
if ( !pTabPage ) if ( !pTabPage )
{ {
const SfxItemSet* pTmpSet = nullptr;
if ( m_pSet ) if ( m_pSet )
{ pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, m_pSet );
if ( m_bItemsReset && m_pSet->GetParent() )
pTmpSet = m_pSet->GetParent();
else
pTmpSet = m_pSet;
}
if ( pTmpSet )
pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, pTmpSet );
else else
pTabPage = (pDataObject->fnCreatePage) pTabPage = (pDataObject->fnCreatePage)
( pTabCtrl, CreateInputItemSet( nId ) ); ( pTabCtrl, CreateInputItemSet( nId ) );

View File

@ -252,14 +252,6 @@ namespace sfx2
SfxDockingWindow::StateChanged( i_nType ); SfxDockingWindow::StateChanged( i_nType );
} }
void TitledDockingWindow::EndDocking( const tools::Rectangle& i_rRect, bool i_bFloatMode )
{
SfxDockingWindow::EndDocking( i_rRect, i_bFloatMode );
m_aEndDockingHdl.Call( this );
}
void TitledDockingWindow::DataChanged( const DataChangedEvent& i_rDataChangedEvent ) void TitledDockingWindow::DataChanged( const DataChangedEvent& i_rDataChangedEvent )
{ {
SfxDockingWindow::DataChanged( i_rDataChangedEvent ); SfxDockingWindow::DataChanged( i_rDataChangedEvent );

View File

@ -912,7 +912,7 @@ bool SfxObjectShell::IsAutoLoadLocked() const
*/ */
{ {
return !IsReadOnly() || pImpl->nAutoLoadLocks > 0; return !IsReadOnly();
} }

View File

@ -240,11 +240,9 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,nFlagsInProgress( SfxLoadedFlags::NONE ) ,nFlagsInProgress( SfxLoadedFlags::NONE )
,bModalMode( false ) ,bModalMode( false )
,bRunningMacro( false ) ,bRunningMacro( false )
,nAutoLoadLocks( 0 )
,eFlags( SfxObjectShellFlags::UNDEFINED ) ,eFlags( SfxObjectShellFlags::UNDEFINED )
,bReadOnlyUI( false ) ,bReadOnlyUI( false )
,nStyleFilter( 0 ) ,nStyleFilter( 0 )
,bDisposing( false )
,m_bEnableSetModified( true ) ,m_bEnableSetModified( true )
,m_bIsModified( false ) ,m_bIsModified( false )
,m_nMapUnit( MapUnit::Map100thMM ) ,m_nMapUnit( MapUnit::Map100thMM )
@ -390,7 +388,7 @@ bool SfxObjectShell::CloseInternal()
if ( !pImpl->bClosing ) if ( !pImpl->bClosing )
{ {
// Do not close if a progress is still running // Do not close if a progress is still running
if ( !pImpl->bDisposing && GetProgress() ) if ( GetProgress() )
return false; return false;
pImpl->bClosing = true; pImpl->bClosing = true;

View File

@ -101,14 +101,12 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
SfxLoadedFlags nFlagsInProgress; SfxLoadedFlags nFlagsInProgress;
bool bModalMode; bool bModalMode;
bool bRunningMacro; bool bRunningMacro;
sal_uInt16 nAutoLoadLocks;
SfxObjectShellFlags eFlags; SfxObjectShellFlags eFlags;
bool bReadOnlyUI; bool bReadOnlyUI;
tools::SvRef<SvRefBase> xHeaderAttributes; tools::SvRef<SvRefBase> xHeaderAttributes;
::rtl::Reference< SfxBaseModel > ::rtl::Reference< SfxBaseModel >
pBaseModel; pBaseModel;
sal_uInt16 nStyleFilter; sal_uInt16 nStyleFilter;
bool bDisposing;
bool m_bEnableSetModified; bool m_bEnableSetModified;
bool m_bIsModified; bool m_bIsModified;

View File

@ -123,7 +123,7 @@ bool SfxFrame::DoClose()
try try
{ {
Reference< XCloseable > xCloseable ( pImpl->xFrame, UNO_QUERY ); Reference< XCloseable > xCloseable ( pImpl->xFrame, UNO_QUERY );
if ( (!GetCurrentDocument() || !GetCurrentDocument()->Get_Impl()->bDisposing ) && xCloseable.is()) if (xCloseable.is())
xCloseable->close(true); xCloseable->close(true);
else if ( pImpl->xFrame.is() ) else if ( pImpl->xFrame.is() )
{ {

View File

@ -1234,8 +1234,6 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
if ( i_eConnect != E_RECONNECT ) if ( i_eConnect != E_RECONNECT )
{ {
pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell ); pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell );
if ( m_pData->m_pViewShell->GetSubShell() )
pViewFrame->GetDispatcher()->Push( *m_pData->m_pViewShell->GetSubShell() );
m_pData->m_pViewShell->PushSubShells_Impl(); m_pData->m_pViewShell->PushSubShells_Impl();
pViewFrame->GetDispatcher()->Flush(); pViewFrame->GetDispatcher()->Flush();
} }

View File

@ -950,11 +950,7 @@ void SfxViewFrame::PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell )
{ {
// more sub shells on the stack, which were not affected by PopSubShells_Impl // more sub shells on the stack, which were not affected by PopSubShells_Impl
SfxShell *pSubShell = m_pDispatcher->GetShell( nLevel-1 ); SfxShell *pSubShell = m_pDispatcher->GetShell( nLevel-1 );
if ( pSubShell == i_rViewShell.GetSubShell() ) m_pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE );
// "real" sub shells will be deleted elsewhere
m_pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL );
else
m_pDispatcher->Pop( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE );
} }
m_pDispatcher->Pop( i_rViewShell ); m_pDispatcher->Pop( i_rViewShell );
m_pDispatcher->Flush(); m_pDispatcher->Flush();

View File

@ -1075,7 +1075,6 @@ SfxViewShell::SfxViewShell
: SfxShell(this) : SfxShell(this)
, pImpl( new SfxViewShell_Impl(nFlags) ) , pImpl( new SfxViewShell_Impl(nFlags) )
, pFrame(pViewFrame) , pFrame(pViewFrame)
, pSubShell(nullptr)
, pWindow(nullptr) , pWindow(nullptr)
, bNoNewWindow( nFlags & SfxViewShellFlags::NO_NEWWINDOW ) , bNoNewWindow( nFlags & SfxViewShellFlags::NO_NEWWINDOW )
, mbPrinterSettingsModified(false) , mbPrinterSettingsModified(false)

View File

@ -185,7 +185,7 @@ Size CommonStylePreviewRenderer::getRenderSize()
bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, RenderAlign eRenderAlign) bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, RenderAlign eRenderAlign)
{ {
const OUString& rText = msRenderText.isEmpty() ? maStyleName : msRenderText; const OUString& rText = maStyleName;
// setup the device & draw // setup the device & draw
vcl::Font aOldFont(mrOutputDev.GetFont()); vcl::Font aOldFont(mrOutputDev.GetFont());