summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-21 08:43:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-21 09:39:21 +0200
commit5e4b4eecb1b2b7113f45e9468574624d30c7097c (patch)
tree701fc89158bfbffab65fc222e062a927aa769120 /sfx2
parent182a74d937088f0f08850014a7b918719e106b7d (diff)
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>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/mailmodel.cxx42
-rw-r--r--sfx2/source/dialog/tabdlg.cxx20
-rw-r--r--sfx2/source/dialog/titledockwin.cxx8
-rw-r--r--sfx2/source/doc/objmisc.cxx2
-rw-r--r--sfx2/source/doc/objxtor.cxx4
-rw-r--r--sfx2/source/inc/objshimp.hxx2
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx6
-rw-r--r--sfx2/source/view/viewsh.cxx1
10 files changed, 12 insertions, 77 deletions
diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx
index 873ae8e84509..81c0f80338b8 100644
--- a/sfx2/source/dialog/mailmodel.cxx
+++ b/sfx2/source/dialog/mailmodel.cxx
@@ -726,55 +726,23 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css:
xSimpleMailMessage->setOriginator( maFromAddress );
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!!
- if ( nToCount > 1 )
- {
- nCcSeqCount = nToCount - 1 + nCcCount;
- xSimpleMailMessage->setRecipient( mpToList->at( 0 ) );
- nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE;
- }
- else if ( nToCount == 1 )
+ if ( nToCount >= 1 )
{
xSimpleMailMessage->setRecipient( mpToList->at( 0 ) );
nSendFlags = SimpleMailClientFlags::NO_USER_INTERFACE;
}
// all other recipient must be handled with CC recipients!
- if ( nCcSeqCount > 0 )
+ if ( nToCount > 1 )
{
- size_t nIndex = 0;
- Sequence< OUString > aCcRecipientSeq;
-
- 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);
- }
+ Sequence< OUString > aCcRecipientSeq( nToCount - 1 );
+ for ( size_t i = 1; i < nToCount; ++i )
+ aCcRecipientSeq[i - 1] = mpToList->at(i);
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());
if ( xSimpleMailMessage->getSubject().isEmpty() ) {
diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx
index 44f3118c6c6a..046f7baae4bc 100644
--- a/sfx2/source/dialog/tabdlg.cxx
+++ b/sfx2/source/dialog/tabdlg.cxx
@@ -111,14 +111,11 @@ typedef std::vector<Data_Impl*> SfxTabDlgData_Impl;
struct TabDlg_Impl
{
- bool bModified : 1,
- bModal : 1,
+ bool bModal : 1,
bHideResetBtn : 1;
SfxTabDlgData_Impl aData;
explicit TabDlg_Impl( sal_uInt8 nCnt ) :
-
- bModified ( false ),
bModal ( true ),
bHideResetBtn ( false )
{
@@ -321,7 +318,6 @@ SfxTabDialog::SfxTabDialog
, m_pOutSet(nullptr)
, m_pRanges(nullptr)
, m_nAppPageId(USHRT_MAX)
- , m_bItemsReset(false)
, m_bStandardPushed(false)
, 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;
if (m_bStandardPushed)
@@ -1067,18 +1063,8 @@ IMPL_LINK( SfxTabDialog, ActivatePageHdl, TabControl *, pTabCtrl, void )
// Create TabPage if possible:
if ( !pTabPage )
{
- const SfxItemSet* pTmpSet = nullptr;
-
if ( m_pSet )
- {
- if ( m_bItemsReset && m_pSet->GetParent() )
- pTmpSet = m_pSet->GetParent();
- else
- pTmpSet = m_pSet;
- }
-
- if ( pTmpSet )
- pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, pTmpSet );
+ pTabPage = (pDataObject->fnCreatePage)( pTabCtrl, m_pSet );
else
pTabPage = (pDataObject->fnCreatePage)
( pTabCtrl, CreateInputItemSet( nId ) );
diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx
index 3a12553aa8a3..8b43c8c23fb4 100644
--- a/sfx2/source/dialog/titledockwin.cxx
+++ b/sfx2/source/dialog/titledockwin.cxx
@@ -252,14 +252,6 @@ namespace sfx2
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 )
{
SfxDockingWindow::DataChanged( i_rDataChangedEvent );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index febf5fbfe728..4e910b57fcc5 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -912,7 +912,7 @@ bool SfxObjectShell::IsAutoLoadLocked() const
*/
{
- return !IsReadOnly() || pImpl->nAutoLoadLocks > 0;
+ return !IsReadOnly();
}
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 8b25c10f7fe1..513e148a6a82 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -240,11 +240,9 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,nFlagsInProgress( SfxLoadedFlags::NONE )
,bModalMode( false )
,bRunningMacro( false )
- ,nAutoLoadLocks( 0 )
,eFlags( SfxObjectShellFlags::UNDEFINED )
,bReadOnlyUI( false )
,nStyleFilter( 0 )
- ,bDisposing( false )
,m_bEnableSetModified( true )
,m_bIsModified( false )
,m_nMapUnit( MapUnit::Map100thMM )
@@ -390,7 +388,7 @@ bool SfxObjectShell::CloseInternal()
if ( !pImpl->bClosing )
{
// Do not close if a progress is still running
- if ( !pImpl->bDisposing && GetProgress() )
+ if ( GetProgress() )
return false;
pImpl->bClosing = true;
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index 24bfb66d405a..42c619c70de3 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -101,14 +101,12 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
SfxLoadedFlags nFlagsInProgress;
bool bModalMode;
bool bRunningMacro;
- sal_uInt16 nAutoLoadLocks;
SfxObjectShellFlags eFlags;
bool bReadOnlyUI;
tools::SvRef<SvRefBase> xHeaderAttributes;
::rtl::Reference< SfxBaseModel >
pBaseModel;
sal_uInt16 nStyleFilter;
- bool bDisposing;
bool m_bEnableSetModified;
bool m_bIsModified;
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 9bee390c7f6f..760cf75b6049 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -123,7 +123,7 @@ bool SfxFrame::DoClose()
try
{
Reference< XCloseable > xCloseable ( pImpl->xFrame, UNO_QUERY );
- if ( (!GetCurrentDocument() || !GetCurrentDocument()->Get_Impl()->bDisposing ) && xCloseable.is())
+ if (xCloseable.is())
xCloseable->close(true);
else if ( pImpl->xFrame.is() )
{
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index c74166027e8d..71040a9e3d7c 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1234,8 +1234,6 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect )
if ( i_eConnect != E_RECONNECT )
{
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();
pViewFrame->GetDispatcher()->Flush();
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index a22aae8818e6..7ec9a6190148 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -950,11 +950,7 @@ void SfxViewFrame::PopShellAndSubShells_Impl( SfxViewShell& i_rViewShell )
{
// more sub shells on the stack, which were not affected by PopSubShells_Impl
SfxShell *pSubShell = m_pDispatcher->GetShell( nLevel-1 );
- if ( pSubShell == i_rViewShell.GetSubShell() )
- // "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( *pSubShell, SfxDispatcherPopFlags::POP_UNTIL | SfxDispatcherPopFlags::POP_DELETE );
}
m_pDispatcher->Pop( i_rViewShell );
m_pDispatcher->Flush();
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 7dc86b388164..67b326205ed9 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1075,7 +1075,6 @@ SfxViewShell::SfxViewShell
: SfxShell(this)
, pImpl( new SfxViewShell_Impl(nFlags) )
, pFrame(pViewFrame)
-, pSubShell(nullptr)
, pWindow(nullptr)
, bNoNewWindow( nFlags & SfxViewShellFlags::NO_NEWWINDOW )
, mbPrinterSettingsModified(false)