summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-07-20 13:54:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-07-31 12:09:00 +0200
commit4732e65646016087d772adb3a0b55c166b35356d (patch)
tree76285ed978ddce19355fe993391172aeb575d69b /sw
parentb6e32d53ce9c98bfba517c40f53d40e97a091b0e (diff)
loplugin:unusedfields in sw
Change-Id: Iad2bddb2359af3e7da40175d17d2d3ed7eda5be6 Reviewed-on: https://gerrit.libreoffice.org/40229 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/dbmgr.hxx2
-rw-r--r--sw/inc/doc.hxx7
-rw-r--r--sw/inc/shellio.hxx1
-rw-r--r--sw/source/core/doc/docnew.cxx3
-rw-r--r--sw/source/core/layout/calcmove.cxx15
-rw-r--r--sw/source/filter/basflt/shellio.cxx2
-rw-r--r--sw/source/ui/chrdlg/pardlg.cxx22
-rw-r--r--sw/source/ui/dbui/mmoutputtypepage.cxx3
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx11
-rw-r--r--sw/source/uibase/dbui/dbtree.cxx5
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx3
-rw-r--r--sw/source/uibase/inc/dbtree.hxx1
-rw-r--r--sw/source/uibase/inc/fldmgr.hxx1
-rw-r--r--sw/source/uibase/inc/numfmtlb.hxx4
-rw-r--r--sw/source/uibase/inc/swuipardlg.hxx1
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx5
-rw-r--r--sw/source/uibase/utlui/numfmtlb.cxx63
17 files changed, 22 insertions, 127 deletions
diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx
index 4d4bd461a9ae..7282acfb3a7f 100644
--- a/sw/inc/dbmgr.hxx
+++ b/sw/inc/dbmgr.hxx
@@ -250,8 +250,6 @@ class SW_DLLPUBLIC SwDBManager
bool bInitDBFields : 1;
bool bInMerge : 1; ///< merge process active
bool bMergeSilent : 1; ///< suppress display of dialogs/boxes (used when called over API)
- bool bMergeLock : 1; /**< prevent update of database fields while document is
- actually printed at the SwViewShell */
SwDSParams_t m_DataSourceParams;
std::unique_ptr<SwDBManager_Impl> pImpl;
const SwXMailMerge* pMergeEvtSrc; ///< != 0 if mail merge events are to be send
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 651078c3500c..07208deea24d 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -361,10 +361,6 @@ private:
bool mbColumnSelection : 1; //< TRUE: this content has been created by a column selection (clipboard docs only)
bool mbIsPrepareSelAll : 1;
-#ifdef DBG_UTIL
- bool mbXMLExport : 1; //< true: during XML export
-#endif
-
// true: Document contains at least one anchored object, which is anchored AT_PAGE with a content position.
// Thus, certain adjustment needed during formatting for these kind of anchored objects.
bool mbContainsAtPageObjWithContentAnchor : 1;
@@ -580,9 +576,6 @@ public:
inline void SetOLEPrtNotifyPending( bool bSet = true );
void PrtOLENotify( bool bAll ); // All or only marked
-#ifdef DBG_UTIL
- bool InXMLExport() const { return mbXMLExport; }
-#endif
bool IsPrepareSelAll() const { return mbIsPrepareSelAll; }
void SetPrepareSelAll() { mbIsPrepareSelAll = true; }
diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx
index 0a48eabafb61..22791a14acf2 100644
--- a/sw/inc/shellio.hxx
+++ b/sw/inc/shellio.hxx
@@ -486,7 +486,6 @@ public:
class SW_DLLPUBLIC SwWriter
{
SvStream* pStrm;
- tools::SvRef<SotStorage> pStg;
css::uno::Reference < css::embed::XStorage > xStg;
SfxMedium* pMedium;
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 3f236d2de388..8c7be64c3763 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -262,9 +262,6 @@ SwDoc::SwDoc()
mbClipBoard( false ),
mbColumnSelection( false ),
mbIsPrepareSelAll(false),
-#ifdef DBG_UTIL
- mbXMLExport(false),
-#endif
mbContainsAtPageObjWithContentAnchor(false), //#i119292#, fdo#37024
meDocType(DOCTYPE_NATIVE)
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 94cf9bc6dcac..b51da88350cd 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1112,21 +1112,6 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
int nConsecutiveFormatsWithoutChange = 0;
PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr )
-#ifdef DBG_UTIL
- const SwDoc *pDoc = GetAttrSet()->GetDoc();
- if( pDoc )
- {
- static bool bWarned = false;
- if( pDoc->InXMLExport() )
- {
- SAL_WARN_IF( !bWarned, "sw", "Formatting during XML-export!" );
- bWarned = true;
- }
- else
- bWarned = false;
- }
-#endif
-
// takes care of the notification in the dtor
SwContentNotify *pNotify = new SwContentNotify( this );
diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx
index a937a2d7a030..c6f9c05bc77d 100644
--- a/sw/source/filter/basflt/shellio.cxx
+++ b/sw/source/filter/basflt/shellio.cxx
@@ -853,8 +853,6 @@ ErrCode SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName )
ErrCode nError = ERRCODE_NONE;
if( pMedium )
nError = rxWriter->Write( *pPam, *pMedium, pRealFileName );
- else if( pStg.is() )
- nError = rxWriter->Write( *pPam, *pStg, pRealFileName );
else if( pStrm )
nError = rxWriter->Write( *pPam, *pStrm, pRealFileName );
else if( xStg.is() )
diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx
index e7d2cbefe1d7..18158982aebf 100644
--- a/sw/source/ui/chrdlg/pardlg.cxx
+++ b/sw/source/ui/chrdlg/pardlg.cxx
@@ -62,7 +62,6 @@ SwParaDlg::SwParaDlg(vcl::Window *pParent,
, m_nParaExt(0)
, m_nParaNumPara(0)
, m_nParaDrpCps(0)
- , m_nParaBckGrnd(0)
, m_nParaBorder(0)
, m_nAreaId(0)
, m_nTransparenceId(0)
@@ -142,18 +141,12 @@ SwParaDlg::SwParaDlg(vcl::Window *pParent,
if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES)))
{
- // remove?
- //OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
- //OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
- //m_nParaBckGrnd = AddTabPage("labelTP_BACKGROUND", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
- //
// add Area and Transparence TabPages
m_nAreaId = AddTabPage("area", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_AREA ));
m_nTransparenceId = AddTabPage("transparence", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_TRANSPARENCE ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_TRANSPARENCE ) );
}
else
{
- // RemoveTabPage("labelTP_BACKGROUND");
RemoveTabPage("area");
RemoveTabPage("transparence");
}
@@ -219,21 +212,6 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
{
static_cast<SwDropCapsPage&>(rPage).SetFormat(false);
}
- else if( m_nParaBckGrnd == nId )
- {
- if(!( nHtmlMode & HTMLMODE_ON ) ||
- nHtmlMode & HTMLMODE_SOME_STYLES)
- {
- // pagebreak only when the cursor is in the body-area and not in a table
- const FrameTypeFlags eType = rSh.GetFrameType(nullptr,true);
- if(!(FrameTypeFlags::BODY & eType) ||
- rSh.GetSelectionType() & SelectionType::Table)
- {
- aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,true));
- rPage.PageCreated(aSet);
- }
- }
- }
else if( m_nParaNumPara == nId)
{
SwTextFormatColl* pTmpColl = rSh.GetCurTextFormatColl();
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index f4b0cf499bce..45d8042b5a53 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -98,7 +98,6 @@ struct SwSendMailDialog_Impl
sal_uInt32 nCurrentDescriptor;
::rtl::Reference< MailDispatcher > xMailDispatcher;
::rtl::Reference< IMailDispatcherListener> xMailListener;
- uno::Reference< mail::XMailService > xConnectedMailService;
uno::Reference< mail::XMailService > xConnectedInMailService;
Idle aRemoveIdle;
@@ -307,8 +306,6 @@ void SwSendMailDialog::dispose()
{
if(m_pImpl->xMailDispatcher->isStarted())
m_pImpl->xMailDispatcher->stop();
- if(m_pImpl->xConnectedMailService.is() && m_pImpl->xConnectedMailService->isConnected())
- m_pImpl->xConnectedMailService->disconnect();
if(m_pImpl->xConnectedInMailService.is() && m_pImpl->xConnectedInMailService->isConnected())
m_pImpl->xConnectedInMailService->disconnect();
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 60aeb83f28b5..e9240b08a50d 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -794,7 +794,6 @@ SwDBManager::SwDBManager(SwDoc* pDoc)
, bInitDBFields(false)
, bInMerge(false)
, bMergeSilent(false)
- , bMergeLock(false)
, pImpl(new SwDBManager_Impl(*this))
, pMergeEvtSrc(nullptr)
, m_pDoc(pDoc)
@@ -2038,12 +2037,10 @@ bool SwDBManager::IsDataSourceOpen(const OUString& rDataSource,
{
if(pImpl->pMergeData)
{
- return !bMergeLock &&
- ((rDataSource == pImpl->pMergeData->sDataSource &&
- rTableOrQuery == pImpl->pMergeData->sCommand)
- ||(rDataSource.isEmpty() && rTableOrQuery.isEmpty()))
- &&
- pImpl->pMergeData->xResultSet.is();
+ return ((rDataSource == pImpl->pMergeData->sDataSource
+ && rTableOrQuery == pImpl->pMergeData->sCommand)
+ || (rDataSource.isEmpty() && rTableOrQuery.isEmpty()))
+ && pImpl->pMergeData->xResultSet.is();
}
else if(!bMergeShell)
{
diff --git a/sw/source/uibase/dbui/dbtree.cxx b/sw/source/uibase/dbui/dbtree.cxx
index eab3e01ed5d9..c0a3176855d7 100644
--- a/sw/source/uibase/dbui/dbtree.cxx
+++ b/sw/source/uibase/dbui/dbtree.cxx
@@ -198,10 +198,7 @@ void SwDBTreeList::InitTreeList()
OUString sDBName(pDBNames[i]);
InsertEntry(sDBName, aImg, aImg, nullptr, true);
}
- OUString sDBName(sDefDBName.getToken(0, DB_DELIM));
- OUString sTableName(sDefDBName.getToken(1, DB_DELIM));
- OUString sColumnName(sDefDBName.getToken(2, DB_DELIM));
- Select(sDBName, sTableName, sColumnName);
+ Select(OUString(), OUString(), OUString());
bInitialized = true;
}
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index fb7f82c23a69..86ce46c903ce 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -362,7 +362,6 @@ inline sal_uInt16 GetPackCount() { return SAL_N_ELEMENTS(aSwFields); }
// FieldManager controls inserting and updating of fields
SwFieldMgr::SwFieldMgr(SwWrtShell* pSh ) :
- pMacroItem(nullptr),
pWrtShell(pSh),
bEvalExp(true)
{
@@ -1121,8 +1120,6 @@ bool SwFieldMgr::InsertField(
case TYP_INTERNETFLD:
{
SwFormatINetFormat aFormat( rData.m_sPar1, sCurFrame );
- if( pMacroItem )
- aFormat.SetMacroTable( &pMacroItem->GetMacroTable() );
return pCurShell->InsertURL( aFormat, rData.m_sPar2 );
}
diff --git a/sw/source/uibase/inc/dbtree.hxx b/sw/source/uibase/inc/dbtree.hxx
index 93bb98efbfb6..2eb1d4f41e8e 100644
--- a/sw/source/uibase/inc/dbtree.hxx
+++ b/sw/source/uibase/inc/dbtree.hxx
@@ -30,7 +30,6 @@ class SwWrtShell;
class SW_DLLPUBLIC SwDBTreeList : public SvTreeListBox
{
- OUString sDefDBName;
bool bInitialized;
bool bShowColumns;
diff --git a/sw/source/uibase/inc/fldmgr.hxx b/sw/source/uibase/inc/fldmgr.hxx
index 916c40f44889..dab4ad58fd35 100644
--- a/sw/source/uibase/inc/fldmgr.hxx
+++ b/sw/source/uibase/inc/fldmgr.hxx
@@ -96,7 +96,6 @@ class SW_DLLPUBLIC SwFieldMgr
{
private:
SwField* pCurField;
- const SvxMacroItem* pMacroItem;
SwWrtShell* pWrtShell; // can be ZERO too!
OUString aCurPar1;
OUString aCurPar2;
diff --git a/sw/source/uibase/inc/numfmtlb.hxx b/sw/source/uibase/inc/numfmtlb.hxx
index bcc5f5fb6075..8ee8be99e3c8 100644
--- a/sw/source/uibase/inc/numfmtlb.hxx
+++ b/sw/source/uibase/inc/numfmtlb.hxx
@@ -31,8 +31,6 @@ class SW_DLLPUBLIC NumFormatListBox : public ListBox
sal_Int32 nStdEntry;
bool bOneArea;
sal_uInt32 nDefFormat;
- SwView* pVw;
- SvNumberFormatter* pOwnFormatter;
LanguageType eCurLanguage;
bool bShowLanguageControl; //determine whether the language control has
//to be shown in the number format dialog
@@ -42,13 +40,11 @@ class SW_DLLPUBLIC NumFormatListBox : public ListBox
SAL_DLLPRIVATE static double GetDefValue(const short nFormatType);
SAL_DLLPRIVATE void Init();
- SAL_DLLPRIVATE SwView* GetView();
public:
NumFormatListBox(vcl::Window* pWin, WinBits nStyle);
virtual ~NumFormatListBox() override;
- virtual void dispose() override;
void Clear();
diff --git a/sw/source/uibase/inc/swuipardlg.hxx b/sw/source/uibase/inc/swuipardlg.hxx
index 880289081217..13c0775459dd 100644
--- a/sw/source/uibase/inc/swuipardlg.hxx
+++ b/sw/source/uibase/inc/swuipardlg.hxx
@@ -32,7 +32,6 @@ class SwParaDlg: public SfxTabDialog
sal_uInt16 m_nParaExt;
sal_uInt16 m_nParaNumPara;
sal_uInt16 m_nParaDrpCps;
- sal_uInt16 m_nParaBckGrnd;
sal_uInt16 m_nParaBorder;
sal_uInt16 m_nAreaId;
sal_uInt16 m_nTransparenceId;
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index 57539a56b6e7..cb5318dc19d7 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -52,18 +52,15 @@ class ColorVariable
{
public:
long mnIndex;
- Color maColor;
sal_Int16 mnTintShade;
ColorVariable()
: mnIndex(-1)
- , maColor()
, mnTintShade()
{}
ColorVariable(long nIndex, sal_Int16 nTintShade)
: mnIndex(nIndex)
- , maColor()
, mnTintShade(nTintShade)
{}
};
@@ -95,7 +92,7 @@ public:
}
else
{
- aColor.SetColor(maVariable.maColor.GetColor());
+ aColor.SetColor(COL_BLACK);
}
return aColor;
}
diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx
index b718d47f9c3b..e93f9ce1525d 100644
--- a/sw/source/uibase/utlui/numfmtlb.cxx
+++ b/sw/source/uibase/utlui/numfmtlb.cxx
@@ -57,8 +57,6 @@ NumFormatListBox::NumFormatListBox(vcl::Window* pWin, WinBits nStyle) :
nStdEntry (0),
bOneArea (false),
nDefFormat (0),
- pVw (nullptr),
- pOwnFormatter (nullptr),
bShowLanguageControl(false),
bUseAutomaticLanguage(true)
{
@@ -86,7 +84,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL makeNumFormatListBox(VclPtr<vcl::W
void NumFormatListBox::Init()
{
- SwView *pView = GetView();
+ SwView *pView = GetActiveView();
if (pView)
eCurLanguage = pView->GetWrtShell().GetCurLang();
@@ -104,37 +102,17 @@ NumFormatListBox::~NumFormatListBox()
disposeOnce();
}
-void NumFormatListBox::dispose()
-{
- delete pOwnFormatter;
- ListBox::dispose();
-}
-
-SwView* NumFormatListBox::GetView()
-{
- if( pVw )
- return pVw;
- return ::GetActiveView();
-}
-
void NumFormatListBox::SetFormatType(const short nFormatType)
{
if (nCurrFormatType == -1 ||
(nCurrFormatType & nFormatType) == 0) // there are mixed formats, like for example DateTime
{
- SvNumberFormatter* pFormatter;
-
- if( pOwnFormatter )
- pFormatter = pOwnFormatter;
- else
- {
- SwView *pView = GetView();
- OSL_ENSURE(pView, "no view found");
- if(!pView)
- return;
- SwWrtShell &rSh = pView->GetWrtShell();
- pFormatter = rSh.GetNumberFormatter();
- }
+ SwView *pView = GetActiveView();
+ OSL_ENSURE(pView, "no view found");
+ if(!pView)
+ return;
+ SwWrtShell &rSh = pView->GetWrtShell();
+ SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
Clear(); // Remove all entries from the Listbox
@@ -248,11 +226,8 @@ void NumFormatListBox::SetFormatType(const short nFormatType)
}
}
- if (!pOwnFormatter)
- {
- const sal_Int32 nPos = InsertEntry(SwResId( STR_DEFINE_NUMBERFORMAT ));
- SetEntryData( nPos, nullptr );
- }
+ const sal_Int32 nPos = InsertEntry(SwResId( STR_DEFINE_NUMBERFORMAT ));
+ SetEntryData( nPos, nullptr );
SelectEntryPos( nStdEntry );
@@ -268,18 +243,12 @@ void NumFormatListBox::SetDefFormat(const sal_uInt32 nDefaultFormat)
return;
}
- SvNumberFormatter* pFormatter;
- if (pOwnFormatter)
- pFormatter = pOwnFormatter;
- else
- {
- SwView *pView = GetView();
- OSL_ENSURE(pView, "no view found");
- if(!pView)
- return;
- SwWrtShell &rSh = pView->GetWrtShell();
- pFormatter = rSh.GetNumberFormatter();
- }
+ SwView *pView = GetActiveView();
+ OSL_ENSURE(pView, "no view found");
+ if(!pView)
+ return;
+ SwWrtShell &rSh = pView->GetWrtShell();
+ SvNumberFormatter* pFormatter = rSh.GetNumberFormatter();
short nType = pFormatter->GetType(nDefaultFormat);
@@ -360,7 +329,7 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox&, rBox, void )
{
const sal_Int32 nPos = rBox.GetSelectEntryPos();
OUString sDefine(SwResId( STR_DEFINE_NUMBERFORMAT ));
- SwView *pView = GetView();
+ SwView *pView = GetActiveView();
if( pView && nPos == rBox.GetEntryCount() - 1 &&
rBox.GetEntry( nPos ) == sDefine )