summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-02-19 10:52:20 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-02-19 11:23:57 +0000
commit778e9a65bf5af07c4caeff969a0324e43a78e66b (patch)
treea5204f0d3eaf2f512a627eeb9e74d42e7e80b54f /sw/source
parent541c4c4509863beb7babe361b31e27f7295e3069 (diff)
new loplugin: find write-only fields
Change-Id: I0f83939babacf92485420ee63f290a297d7cb717 Reviewed-on: https://gerrit.libreoffice.org/22498 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/accmap.cxx2
-rw-r--r--sw/source/core/inc/UndoDelete.hxx1
-rw-r--r--sw/source/core/inc/UndoSort.hxx1
-rw-r--r--sw/source/core/text/pormulti.cxx1
-rw-r--r--sw/source/core/text/pormulti.hxx4
-rw-r--r--sw/source/core/undo/undel.cxx2
-rw-r--r--sw/source/core/undo/unsort.cxx4
-rw-r--r--sw/source/filter/basflt/fltshell.cxx6
-rw-r--r--sw/source/filter/html/swhtml.cxx2
-rw-r--r--sw/source/filter/html/swhtml.hxx1
-rw-r--r--sw/source/filter/inc/fltshell.hxx3
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/ui/misc/bookmark.cxx5
-rw-r--r--sw/source/uibase/cctrl/swlbox.cxx16
-rw-r--r--sw/source/uibase/inc/swlbox.hxx5
15 files changed, 15 insertions, 40 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx
index 2979c7c1a813..f7de95082df3 100644
--- a/sw/source/core/access/accmap.cxx
+++ b/sw/source/core/access/accmap.cxx
@@ -1656,7 +1656,6 @@ SwAccessibleMap::SwAccessibleMap( SwViewShell *pSh ) :
mpSelectedParas( nullptr ),
mpVSh( pSh ),
mpPreview( nullptr ),
- mnPara( 1 ),
mbShapeSelected( false ),
mpSeletedFrameMap(nullptr)
{
@@ -1886,7 +1885,6 @@ uno::Reference< XAccessible> SwAccessibleMap::GetContext( const SwFrame *pFrame,
switch( pFrame->GetType() )
{
case FRM_TXT:
- mnPara++;
pAcc = new SwAccessibleParagraph( this,
static_cast< const SwTextFrame& >( *pFrame ) );
break;
diff --git a/sw/source/core/inc/UndoDelete.hxx b/sw/source/core/inc/UndoDelete.hxx
index 92513a2652c8..18fb5224df35 100644
--- a/sw/source/core/inc/UndoDelete.hxx
+++ b/sw/source/core/inc/UndoDelete.hxx
@@ -38,7 +38,6 @@ class SwUndoDelete
{
SwNodeIndex* m_pMvStt; // Position of Nodes in UndoNodes-Array
OUString *m_pSttStr, *m_pEndStr;
- SwRedlineData* m_pRedlData;
SwRedlineSaveDatas* m_pRedlSaveData;
std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoStart;
std::shared_ptr< ::sfx2::MetadatableUndo > m_pMetadataUndoEnd;
diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx
index f5d4f528c77c..21009070e2b6 100644
--- a/sw/source/core/inc/UndoSort.hxx
+++ b/sw/source/core/inc/UndoSort.hxx
@@ -64,7 +64,6 @@ class SwUndoSort : public SwUndo, private SwUndRng
SwSortOptions* pSortOpt;
std::vector<std::unique_ptr<SwSortUndoElement>> m_SortList;
SwUndoAttrTable* pUndoTableAttr;
- SwRedlineData* pRedlData;
sal_uLong nTableNd;
public:
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index f720384413d5..629150088cf9 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -59,7 +59,6 @@ using namespace ::com::sun::star;
// and by another SwLineLayout via pNext to realize a doubleline portion.
SwMultiPortion::~SwMultiPortion()
{
- delete pFieldRest;
}
void SwMultiPortion::Paint( const SwTextPaintInfo & ) const
diff --git a/sw/source/core/text/pormulti.hxx b/sw/source/core/text/pormulti.hxx
index e2e04b43b611..0659db9c373b 100644
--- a/sw/source/core/text/pormulti.hxx
+++ b/sw/source/core/text/pormulti.hxx
@@ -73,7 +73,6 @@ struct SwBracket
class SwMultiPortion : public SwLinePortion
{
SwLineLayout aRoot; // One or more lines
- SwFieldPortion *pFieldRest; // Field rest from the previous line
bool bTab1 :1; // First line tabulator
bool bTab2 :1; // Second line includes tabulator
bool bDouble :1; // Double line
@@ -86,8 +85,7 @@ class SwMultiPortion : public SwLinePortion
sal_uInt8 nDirection:2; // Direction (0/90/180/270 degrees)
protected:
explicit SwMultiPortion(sal_Int32 nEnd)
- : pFieldRest(nullptr)
- , bTab1(false)
+ : bTab1(false)
, bTab2(false)
, bDouble(false)
, bRuby(false)
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx
index a9c7dca25ba5..f2a93ada1402 100644
--- a/sw/source/core/undo/undel.cxx
+++ b/sw/source/core/undo/undel.cxx
@@ -102,7 +102,6 @@ SwUndoDelete::SwUndoDelete(
m_pMvStt( nullptr ),
m_pSttStr(nullptr),
m_pEndStr(nullptr),
- m_pRedlData(nullptr),
m_pRedlSaveData(nullptr),
m_nNode(0),
m_nNdDiff(0),
@@ -524,7 +523,6 @@ SwUndoDelete::~SwUndoDelete()
m_pMvStt->GetNode().GetNodes().Delete( *m_pMvStt, m_nNode );
delete m_pMvStt;
}
- delete m_pRedlData;
delete m_pRedlSaveData;
}
diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx
index 1e99538ea78a..483354586dec 100644
--- a/sw/source/core/undo/unsort.cxx
+++ b/sw/source/core/undo/unsort.cxx
@@ -45,7 +45,6 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
: SwUndo(UNDO_SORT_TXT)
, SwUndRng(rRg)
, pUndoTableAttr(nullptr)
- , pRedlData(nullptr)
, nTableNd(0)
{
pSortOpt = new SwSortOptions(rOpt);
@@ -53,7 +52,7 @@ SwUndoSort::SwUndoSort(const SwPaM& rRg, const SwSortOptions& rOpt)
SwUndoSort::SwUndoSort( sal_uLong nStt, sal_uLong nEnd, const SwTableNode& rTableNd,
const SwSortOptions& rOpt, bool bSaveTable )
- : SwUndo(UNDO_SORT_TBL), pUndoTableAttr( nullptr ), pRedlData( nullptr )
+ : SwUndo(UNDO_SORT_TBL), pUndoTableAttr( nullptr )
{
nSttNode = nStt;
nEndNode = nEnd;
@@ -68,7 +67,6 @@ SwUndoSort::~SwUndoSort()
{
delete pSortOpt;
delete pUndoTableAttr;
- delete pRedlData;
}
void SwUndoSort::UndoImpl(::sw::UndoRedoContext & rContext)
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index a70c7f874d05..583fa774f1e9 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -1047,14 +1047,14 @@ const std::vector< std::pair<OUString, OUString> >& SwFltRDFMark::GetAttributes(
}
// methods of SwFltTOX follow
-SwFltTOX::SwFltTOX(SwTOXBase* pBase, sal_uInt16 _nCols)
- : SfxPoolItem(RES_FLTR_TOX), pTOXBase(pBase), nCols( _nCols ),
+SwFltTOX::SwFltTOX(SwTOXBase* pBase)
+ : SfxPoolItem(RES_FLTR_TOX), pTOXBase(pBase),
bHadBreakItem( false ), bHadPageDescItem( false )
{
}
SwFltTOX::SwFltTOX(const SwFltTOX& rCpy)
- : SfxPoolItem(RES_FLTR_TOX), pTOXBase(rCpy.pTOXBase), nCols( rCpy.nCols ),
+ : SfxPoolItem(RES_FLTR_TOX), pTOXBase(rCpy.pTOXBase),
bHadBreakItem( rCpy.bHadBreakItem ), bHadPageDescItem( rCpy.bHadPageDescItem )
{
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 036992f41714..707c06370bc2 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -5463,7 +5463,6 @@ _HTMLAttr::_HTMLAttr( const SwPosition& rPos, const SfxPoolItem& rItem,
bInsAtStart( true ),
bLikePara( false ),
bValid( true ),
- nCount( 1 ),
pNext( nullptr ),
pPrev( nullptr ),
ppHead( ppHd )
@@ -5480,7 +5479,6 @@ _HTMLAttr::_HTMLAttr( const _HTMLAttr &rAttr, const SwNodeIndex &rEndPara,
bInsAtStart( rAttr.bInsAtStart ),
bLikePara( rAttr.bLikePara ),
bValid( rAttr.bValid ),
- nCount( rAttr.nCount ),
pNext( nullptr ),
pPrev( nullptr ),
ppHead( ppHd )
diff --git a/sw/source/filter/html/swhtml.hxx b/sw/source/filter/html/swhtml.hxx
index 6b5f78bd14f4..d9d0ee4360ea 100644
--- a/sw/source/filter/html/swhtml.hxx
+++ b/sw/source/filter/html/swhtml.hxx
@@ -82,7 +82,6 @@ class _HTMLAttr
bool bValid : 1; // ist das Attribut gueltig?
SfxPoolItem* pItem;
- sal_uInt16 nCount; // Anzahl noch zu schliessender Attrs mit einem Wert
_HTMLAttr *pNext; // noch zu schliessene Attrs mit unterschiedl. Werten
_HTMLAttr *pPrev; // bereits geschlossene aber noch nicht gesetze Attrs
_HTMLAttr **ppHead; // der Listenkopf
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 7dce67125a4a..d4eab5ad3d4a 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -308,11 +308,10 @@ public:
class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem
{
SwTOXBase* pTOXBase;
- sal_uInt16 nCols;
bool bHadBreakItem; // there was a break item BEFORE insertion of the TOX
bool bHadPageDescItem;
public:
- SwFltTOX(SwTOXBase* pBase, sal_uInt16 _nCols = 0);
+ SwFltTOX(SwTOXBase* pBase);
SwFltTOX(const SwFltTOX&);
// "pure virtual Methoden" vom SfxPoolItem
virtual bool operator==(const SfxPoolItem&) const override;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 85bd07413192..63dc78f93eb1 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -3303,7 +3303,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
const SwPosition* pPos = m_pPaM->GetPoint();
- SwFltTOX aFltTOX( pBase, nIndexCols );
+ SwFltTOX aFltTOX( pBase );
// test if there is already a break item on this node
if(SwContentNode* pNd = pPos->nNode.GetNode().GetContentNode())
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 3dd6d2e4c3e5..c12da8dcbdce 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -94,7 +94,7 @@ void SwInsertBookmarkDlg::Apply()
}
// insert text mark
- SwBoxEntry aTmpEntry(m_pBookmarkBox->GetText(), 0 );
+ SwBoxEntry aTmpEntry(m_pBookmarkBox->GetText() );
if (!m_pBookmarkBox->GetText().isEmpty() &&
(m_pBookmarkBox->GetSwEntryPos(aTmpEntry) == COMBOBOX_ENTRY_NOTFOUND))
@@ -129,7 +129,6 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rS,
// fill Combobox with existing bookmarks
IDocumentMarkAccess* const pMarkAccess = rSh.getIDocumentMarkAccess();
- sal_Int32 nId = 0;
for( IDocumentMarkAccess::const_iterator_t ppBookmark = pMarkAccess->getBookmarksBegin();
ppBookmark != pMarkAccess->getBookmarksEnd();
++ppBookmark)
@@ -137,7 +136,7 @@ SwInsertBookmarkDlg::SwInsertBookmarkDlg( vcl::Window *pParent, SwWrtShell &rS,
if(IDocumentMarkAccess::MarkType::BOOKMARK == IDocumentMarkAccess::GetType(**ppBookmark))
{
m_pBookmarkBox->InsertSwEntry(
- SwBoxEntry(ppBookmark->get()->GetName(), nId++));
+ SwBoxEntry(ppBookmark->get()->GetName()));
}
}
diff --git a/sw/source/uibase/cctrl/swlbox.cxx b/sw/source/uibase/cctrl/swlbox.cxx
index 7d048161b353..08a4b9107694 100644
--- a/sw/source/uibase/cctrl/swlbox.cxx
+++ b/sw/source/uibase/cctrl/swlbox.cxx
@@ -24,25 +24,19 @@
// Description: ListboxElement
SwBoxEntry::SwBoxEntry() :
- bModified(false),
- bNew(false),
- nId(COMBOBOX_APPEND)
+ bNew(false)
{
}
-SwBoxEntry::SwBoxEntry(const OUString& aNam, sal_Int32 nIdx) :
- bModified(false),
+SwBoxEntry::SwBoxEntry(const OUString& aNam) :
bNew(false),
- aName(aNam),
- nId(nIdx)
+ aName(aNam)
{
}
SwBoxEntry::SwBoxEntry(const SwBoxEntry& rOld) :
- bModified(rOld.bModified),
bNew(rOld.bNew),
- aName(rOld.aName),
- nId(rOld.nId)
+ aName(rOld.aName)
{
}
@@ -58,7 +52,7 @@ void SwComboBox::Init()
sal_Int32 nSize = GetEntryCount();
for( sal_Int32 i=0; i < nSize; ++i )
{
- m_EntryList.push_back(SwBoxEntry(ComboBox::GetEntry(i), i));
+ m_EntryList.push_back(SwBoxEntry(ComboBox::GetEntry(i)));
}
}
diff --git a/sw/source/uibase/inc/swlbox.hxx b/sw/source/uibase/inc/swlbox.hxx
index be17d9871897..f4086805ea49 100644
--- a/sw/source/uibase/inc/swlbox.hxx
+++ b/sw/source/uibase/inc/swlbox.hxx
@@ -34,14 +34,11 @@ class SW_DLLPUBLIC SwBoxEntry
{
friend class SwComboBox;
- bool bModified : 1;
bool bNew : 1;
-
OUString aName;
- sal_Int32 nId;
public:
- SwBoxEntry(const OUString& aName, sal_Int32 nId=0);
+ SwBoxEntry(const OUString& aName);
SwBoxEntry(const SwBoxEntry& rOrg);
SwBoxEntry();