[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/svtools include/vcl sd/source sw/inc sw/qa sw/source vcl/inc vcl/source vcl/unx

2023-06-30 Thread Noel Grandin (via logerrit)
 compilerplugins/clang/unusedfields.only-used-in-constructor.results |  172 ++--
 compilerplugins/clang/unusedfields.readonly.results |  278 
+++---
 compilerplugins/clang/unusedfields.untouched.results|   94 +-
 compilerplugins/clang/unusedfields.writeonly.results|  406 
++
 editeng/source/editeng/editeng.cxx  |6 
 editeng/source/editeng/impedit.hxx  |1 
 include/editeng/editeng.hxx |1 
 include/svtools/colorcfg.hxx|2 
 include/vcl/ctrl.hxx|2 
 sd/source/ui/slidesorter/controller/SlsPageSelector.cxx |9 
 sd/source/ui/slidesorter/inc/controller/SlsPageSelector.hxx |7 
 sw/inc/viewopt.hxx  |3 
 sw/qa/extras/rtfimport/rtfimport.cxx|3 
 sw/source/uibase/config/viewopt.cxx |8 
 sw/source/uibase/sidebar/A11yCheckIssuesPanel.hxx   |1 
 vcl/inc/unx/saldisp.hxx |   17 
 vcl/source/control/ctrl.cxx |8 
 vcl/unx/generic/app/saldisp.cxx |  176 
 18 files changed, 596 insertions(+), 598 deletions(-)

New commits:
commit c33e81615c85eb9acd5956973e3bbc27ea068b41
Author: Noel Grandin 
AuthorDate: Thu Jun 29 16:34:49 2023 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 30 15:14:14 2023 +0200

loplugin:unusedmethods

Change-Id: I8d3402a69237b665462e04440ad73fe29e2133db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153807
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 
a/compilerplugins/clang/unusedfields.only-used-in-constructor.results 
b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
index b50c4546394b..d897f095b3c2 100644
--- a/compilerplugins/clang/unusedfields.only-used-in-constructor.results
+++ b/compilerplugins/clang/unusedfields.only-used-in-constructor.results
@@ -1,8 +1,8 @@
 basegfx/source/polygon/b2dpolygontriangulator.cxx:112
 basegfx::(anonymous namespace)::Triangulator maStartEntries EdgeEntries
-basegfx/source/polygon/b2dtrapezoid.cxx:205
+basegfx/source/polygon/b2dtrapezoid.cxx:208
 basegfx::trapezoidhelper::(anonymous namespace)::PointBlockAllocator 
maFirstStackBlock B2DPoint[32]
-basegfx/source/polygon/b2dtrapezoid.cxx:256
+basegfx/source/polygon/b2dtrapezoid.cxx:259
 basegfx::trapezoidhelper::(anonymous namespace)::TrapezoidSubdivider 
maPoints std::vector
 basic/qa/cppunit/basictest.hxx:27
 MacroSnippet maDll BasicDLL
@@ -22,6 +22,22 @@ 
chart2/source/controller/accessibility/AccessibleChartShape.hxx:78
 chart::AccessibleChartShape m_aShapeTreeInfo 
::accessibility::AccessibleShapeTreeInfo
 chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:70
 chart::ThreeD_SceneIllumination_TabPage m_aModelChangeListener 
ModifyListenerCallBack
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:76
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light1 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:77
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light2 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:78
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light3 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:79
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light4 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:80
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light5 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:81
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light6 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:82
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light7 LightButton
+chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx:83
+chart::ThreeD_SceneIllumination_TabPage m_aBtn_Light8 LightButton
 chart2/source/controller/inc/dlg_View3D.hxx:46
 chart::View3DDialog m_aControllerLocker ControllerLockHelper
 chart2/source/controller/inc/RangeSelectionListener.hxx:65
@@ -74,11 +90,11 @@ connectivity/source/inc/flat/EResultSet.hxx:39
 connectivity::flat::OFlatResultSet m_bBookmarkable _Bool
 connectivity/source/inc/java/lang/Object.hxx:37
 connectivity::SDBThreadAttach m_aGuard jvmaccess::class 
VirtualMachine::AttachGuard
-cppcanvas/source/mtfrenderer/textaction.cxx:806
+cppcanvas/source/mtfrenderer/textaction.cxx:812
 cppcanvas::internal::(anonymous namespace)::EffectTextAction 
maTextLineInfo const tools::TextLineInfo
-cppcanvas/source/mtfrenderer/textaction.cxx:1627
+cppcanvas/source/mtfrenderer/textaction.cxx:1645
 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2022-07-28 Thread Justin Luth (via logerrit)
 compilerplugins/clang/unusedenumconstants.writeonly.results |2 --
 editeng/source/outliner/outliner.cxx|6 --
 include/editeng/outliner.hxx|1 -
 3 files changed, 9 deletions(-)

New commits:
commit 2b0626e2e9d112280e9d9a296cc7d7ba3022bdc9
Author: Justin Luth 
AuthorDate: Wed Jul 27 10:54:22 2022 -0400
Commit: Justin Luth 
CommitDate: Thu Jul 28 13:27:58 2022 +0200

remove unused SETBULLETTEXT flag in editeng

Already unused in initial import.

Change-Id: I423442a2b036c64727af608fa667f1f8a427391f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137542
Tested-by: Jenkins
Reviewed-by: Justin Luth 

diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results 
b/compilerplugins/clang/unusedenumconstants.writeonly.results
index 0d2f68303c8a..b4f02f215137 100644
--- a/compilerplugins/clang/unusedenumconstants.writeonly.results
+++ b/compilerplugins/clang/unusedenumconstants.writeonly.results
@@ -1492,8 +1492,6 @@ include/editeng/numitem.hxx:247
 enum SvxNumRuleType OUTLINE_NUMBERING
 include/editeng/numitem.hxx:248
 enum SvxNumRuleType PRESENTATION_NUMBERING
-include/editeng/outliner.hxx:99
-enum ParaFlag SETBULLETTEXT
 include/editeng/outliner.hxx:190
 enum OutlinerView::MouseTarget Outside
 include/editeng/svxrtf.hxx:207
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index 13e490f87b7f..ae4aac401bee 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -123,7 +123,6 @@ void Outliner::ParagraphInserted( sal_Int32 nPara )
 pParaList->Insert( std::unique_ptr(pPara), nPara );
 if( pEditEngine->IsInUndo() )
 {
-pPara->nFlags = ParaFlag::SETBULLETTEXT;
 pPara->bVisible = true;
 const SfxInt16Item& rLevel = pEditEngine->GetParaAttrib( nPara, 
EE_PARA_OUTLLEVEL );
 pPara->SetDepth( rLevel.GetValue() );
@@ -665,7 +664,6 @@ void Outliner::SetStyleSheet( sal_Int32 nPara, 
SfxStyleSheet* pStyle )
 if (pPara)
 {
 pEditEngine->SetStyleSheet( nPara, pStyle );
-pPara->nFlags |= ParaFlag::SETBULLETTEXT;
 ImplCheckNumBulletItem(  nPara );
 }
 }
@@ -1837,8 +1835,6 @@ void Outliner::ImplCalcBulletText( sal_Int32 nPara, bool 
bRecalcLevel, bool bRec
 if (pPara->GetText() != aBulletText)
 pPara->SetText( aBulletText );
 
-pPara->nFlags &= ~ParaFlag::SETBULLETTEXT;
-
 if ( bRecalcLevel )
 {
 sal_Int16 nDepth = pPara->GetDepth();
@@ -1897,8 +1893,6 @@ OUString Outliner::ImplGetBulletText( sal_Int32 nPara )
 Paragraph* pPara = pParaList->GetParagraph( nPara );
 if (pPara)
 {
-// Enable optimization again ...
-//  if( pPara->nFlags & ParaFlag::SETBULLETTEXT )
 ImplCalcBulletText( nPara, false, false );
 aRes = pPara->GetText();
 }
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index ab24be0b1e0e..6e19aa129a78 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -96,7 +96,6 @@ enum class ParaFlag
 {
 NONE   = 0x,
 HOLDDEPTH  = 0x4000,
-SETBULLETTEXT  = 0x8000,
 ISPAGE = 0x0100,
 };
 namespace o3tl


[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2021-06-04 Thread Noel Grandin (via logerrit)
 compilerplugins/clang/virtualdead.py   |   12 -
 compilerplugins/clang/virtualdead.results  |   46 +
 compilerplugins/clang/virtualdead.unusedparams.results |  133 +++--
 editeng/source/editeng/editeng.cxx |2 
 editeng/source/editeng/impedit3.cxx|2 
 editeng/source/outliner/outleeng.cxx   |2 
 editeng/source/outliner/outleeng.hxx   |2 
 include/editeng/editeng.hxx|2 
 8 files changed, 82 insertions(+), 119 deletions(-)

New commits:
commit 752e23f3cfb161f3eed72f3cd1104310b1b1ddba
Author: Noel Grandin 
AuthorDate: Fri Jun 4 13:13:37 2021 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 4 19:18:30 2021 +0200

loplugin:virtualdead

Change-Id: Ic2e18f9088e7427f0679dab27f0d3acb6f2bb240
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116716
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/virtualdead.py 
b/compilerplugins/clang/virtualdead.py
index e481127af75b..4584345da7a0 100755
--- a/compilerplugins/clang/virtualdead.py
+++ b/compilerplugins/clang/virtualdead.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python2
+#!/usr/bin/python3
 
 import sys
 import re
@@ -15,7 +15,7 @@ def normalizeTypeParams( line ):
 return normalizeTypeParamsRegex.sub("type-parameter-?-?", line)
 
 # reading as binary (since we known it is pure ascii) is much faster than 
reading as unicode
-with io.open("workdir/loplugin.virtualdead.log", "rb", buffering=1024*1024) as 
txt:
+with io.open("workdir/loplugin.virtualdead.log", "r", encoding="ascii", 
errors="ignore", buffering=1024*1024) as txt:
 for line in txt:
 try:
 tokens = line.strip().split("\t")
@@ -36,11 +36,11 @@ with io.open("workdir/loplugin.virtualdead.log", "rb", 
buffering=1024*1024) as t
 else:
 print( "unknown line: " + line)
 except IndexError:
-print "problem with line " + line.strip()
+print("problem with line " + line.strip())
 raise
 
 tmp1list = list()
-for callInfo, callValues in callDict.iteritems():
+for callInfo, callValues in iter(callDict.items()):
 nameAndParams = callInfo[1]
 if len(callValues) != 1:
 continue
@@ -63,6 +63,7 @@ for callInfo, callValues in callDict.iteritems():
 if srcloc.startswith("Core/"): continue
 if srcloc.startswith("/Qt"): continue
 if srcloc.startswith("Qt"): continue
+if srcloc.startswith("64-"): continue
 functionSig = callInfo[0]
 tmp1list.append((srcloc, functionSig, callValue))
 
@@ -88,7 +89,7 @@ for paramInfo in paramSet:
 tmp2dict[name] = bitfield
 else:
 tmp2dict[name] = merge_bitfield(tmp2dict[name], bitfield)
-for name, bitfield in tmp2dict.iteritems():
+for name, bitfield in iter(tmp2dict.items()):
 srcloc = definitionToSourceLocationMap[name]
 # ignore Qt stuff
 if srcloc.startswith("Gui/"): continue
@@ -96,6 +97,7 @@ for name, bitfield in tmp2dict.iteritems():
 if srcloc.startswith("Core/"): continue
 if srcloc.startswith("/Qt"): continue
 if srcloc.startswith("Qt"): continue
+if srcloc.startswith("64-"): continue
 # ignore external stuff
 if srcloc.startswith("workdir/"): continue
 # referenced by generated code in workdir/
diff --git a/compilerplugins/clang/virtualdead.results 
b/compilerplugins/clang/virtualdead.results
index 8e2aa00ce120..533a0f6edf11 100644
--- a/compilerplugins/clang/virtualdead.results
+++ b/compilerplugins/clang/virtualdead.results
@@ -34,25 +34,25 @@ include/basegfx/utils/unopolypolygon.hxx:94
 include/connectivity/sdbcx/IRefreshable.hxx:29
 void connectivity::sdbcx::IRefreshableGroups::refreshGroups()
 empty
-include/filter/msfilter/msdffimp.hxx:545
+include/filter/msfilter/msdffimp.hxx:546
 _Bool SvxMSDffManager::ShapeHasText(unsigned long,unsigned long,)const
 1
-include/svl/svdde.hxx:235
+include/svl/svdde.hxx:236
 class DdeData * DdeTopic::Get(enum SotClipboardFormatId,)
 0
-include/svl/svdde.hxx:236
+include/svl/svdde.hxx:237
 _Bool DdeTopic::Put(const class DdeData *,)
 0
-include/svl/svdde.hxx:237
+include/svl/svdde.hxx:238
 _Bool DdeTopic::Execute(const class rtl::OUString *,)
 0
-include/svl/svdde.hxx:239
+include/svl/svdde.hxx:240
 _Bool DdeTopic::MakeItem(const class rtl::OUString &,)
 0
-include/svl/svdde.hxx:242
+include/svl/svdde.hxx:243
 _Bool DdeTopic::StartAdviseLoop()
 0
-include/svtools/unoevent.hxx:199
+include/svtools/unoevent.hxx:198
 unsigned short SvEventDescriptor::getMacroItemWhich()const
 108
 include/ucbhelper/resultset.hxx:410
@@ -64,22 +64,19 @@ include/unotools/desktopterminationobserver.hxx:36
 include/vbahelper/vbahelperinterface.hxx:74
 int InheritedHelperInterfaceImpl::getCreator()
 1400204879
-include/vcl/toolkit/vclmedit.hxx:118
-void VclMultiLineEdit::UpdateData()
-   

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/svx include/vcl sc/inc sc/source svx/source sw/source vcl/source

2021-02-23 Thread Noel (via logerrit)
 compilerplugins/clang/constantparam.bitmask.results  |   10 
 compilerplugins/clang/constantparam.booleans.results | 1298 +++
 compilerplugins/clang/constantparam.constructors.results |  294 +--
 compilerplugins/clang/constantparam.numbers.results  | 1086 +---
 compilerplugins/clang/constantparam.py   |2 
 editeng/source/outliner/outlvw.cxx   |4 
 include/editeng/outliner.hxx |2 
 include/svx/fontworkgallery.hxx  |2 
 include/vcl/toolkit/button.hxx   |2 
 sc/inc/document.hxx  |2 
 sc/inc/drwlayer.hxx  |2 
 sc/source/core/data/documen2.cxx |4 
 sc/source/core/data/drwlayer.cxx |6 
 svx/source/tbxctrls/fontworkgallery.cxx  |4 
 sw/source/uibase/uiview/viewdraw.cxx |2 
 vcl/source/control/button.cxx|4 
 16 files changed, 1314 insertions(+), 1410 deletions(-)

New commits:
commit 4b9ad812facbd9416d9658325791bad3ab48934d
Author: Noel 
AuthorDate: Tue Feb 23 14:35:04 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 23 17:43:06 2021 +0100

loplugin:constantparam

Change-Id: Ieaee9a3e3ef4aa9bc390ddb198ee1718f635bcbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111391
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/constantparam.bitmask.results 
b/compilerplugins/clang/constantparam.bitmask.results
index b651e6b9c82f..90fdcd09bd07 100644
--- a/compilerplugins/clang/constantparam.bitmask.results
+++ b/compilerplugins/clang/constantparam.bitmask.results
@@ -4,7 +4,7 @@ codemaker/source/javamaker/classfile.hxx:152
 codemaker/source/javamaker/classfile.hxx:167
 void codemaker::javamaker::ClassFile::addField(enum 
codemaker::javamaker::ClassFile::AccessFlags,const class rtl::OString &,const 
class rtl::OString &,unsigned short,const class rtl::OString &)
 enum codemaker::javamaker::ClassFile::AccessFlags accessFlags setBits=0x1
-dbaccess/source/filter/xml/xmlExport.hxx:164
+dbaccess/source/filter/xml/xmlExport.hxx:163
 void dbaxml::ODBExport::ODBExport(const class 
com::sun::star::uno::Reference 
&,const class rtl::OUString &,enum SvXMLExportFlags)
 enum SvXMLExportFlags nExportFlag setBits=0x400 clearBits=0x200
 include/basegfx/polygon/b2dpolygontools.hxx:145
@@ -13,10 +13,10 @@ include/basegfx/polygon/b2dpolygontools.hxx:145
 include/framework/framelistanalyzer.hxx:185
 void framework::FrameListAnalyzer::FrameListAnalyzer(const class 
com::sun::star::uno::Reference 
&,const class com::sun::star::uno::Reference &,enum FrameAnalyzerFlags)
 enum FrameAnalyzerFlags eDetectMode setBits=0x4
-include/sfx2/objsh.hxx:477
+include/sfx2/objsh.hxx:467
 void SfxObjectShell::FinishedLoading(enum SfxLoadedFlags)
 enum SfxLoadedFlags nWhich setBits=0x1
-include/svtools/brwbox.hxx:511
+include/svtools/brwbox.hxx:510
 void BrowseBox::InsertDataColumn(unsigned short,const class rtl::OUString 
&,long,enum HeaderBarItemBits,unsigned short)
 enum HeaderBarItemBits nBits setBits=0x400 clearBits=0x3ec
 include/vcl/wizardmachine.hxx:139
@@ -37,10 +37,10 @@ sc/source/ui/view/cellsh1.cxx:103
 sc/source/ui/view/cellsh1.cxx:126
 class rtl::OUString FlagsToString(enum InsertDeleteFlags,enum 
InsertDeleteFlags)
 enum InsertDeleteFlags nFlagsMask setBits=0x87f clearBits=0x700
-sw/source/core/view/viewsh.cxx:717
+sw/source/core/view/viewsh.cxx:719
 void lcl_InvalidateAllContent(class SwViewShell &,enum SwInvalidateFlags)
 enum SwInvalidateFlags nInv setBits=0x2
-sw/source/filter/html/swhtml.hxx:687
+sw/source/filter/html/swhtml.hxx:689
 void SwHTMLParser::SetFrameFormatAttrs(class SfxItemSet &,enum 
HtmlFrameFormatFlags,class SfxItemSet &)
 enum HtmlFrameFormatFlags nFlags setBits=0x1
 sw/source/filter/ww8/wrtw8esh.cxx:1545
diff --git a/compilerplugins/clang/constantparam.booleans.results 
b/compilerplugins/clang/constantparam.booleans.results
index 18cf2a58bb2e..8076a6771b2c 100644
--- a/compilerplugins/clang/constantparam.booleans.results
+++ b/compilerplugins/clang/constantparam.booleans.results
@@ -6,7 +6,7 @@ accessibility/source/standard/vclxaccessibletoolbox.cxx:101
 void (anonymous 
namespace)::OToolBoxWindowItem::OToolBoxWindowItem(int,const class 
com::sun::star::uno::Reference 
&,const class com::sun::star::uno::Reference &,const class 
com::sun::star::uno::Reference &)
 int _nIndexInParent
 0
-basctl/source/basicide/moduldlg.hxx:103
+basctl/source/basicide/moduldlg.hxx:107
 void basctl::LibDialog::EnableReference(_Bool)
 _Bool b
 0
@@ -14,7 +14,7 @@ basctl/source/inc/scriptdocument.hxx:88
 void basctl::ScriptDocument::ScriptDocument(enum 
basctl::ScriptDocument::SpecialDocument)
 enum 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/sfx2 include/svx include/vcl sc/source sd/source sfx2/source svx/source sw/inc sw/source

2019-06-12 Thread Noel Grandin (via logerrit)
 compilerplugins/clang/unusedmethods.results   |  432 
--
 compilerplugins/clang/unusedmethods.unused-returns.results|   64 -
 editeng/source/outliner/outlvw.cxx|   33 
 include/editeng/outliner.hxx  |5 
 include/sfx2/basedlgs.hxx |2 
 include/sfx2/dinfdlg.hxx  |1 
 include/svx/AccessibleGraphicShape.hxx|3 
 include/svx/AccessibleOLEShape.hxx|3 
 include/svx/DescriptionGenerator.hxx  |8 
 include/svx/dlgctl3d.hxx  |1 
 include/svx/fntctrl.hxx   |   12 
 include/svx/langbox.hxx   |3 
 include/vcl/treelistbox.hxx   |2 
 sc/source/ui/dataprovider/htmldataprovider.cxx|   31 
 sc/source/ui/dataprovider/htmldataprovider.hxx|2 
 sd/source/ui/accessibility/AccessiblePageShape.cxx|6 
 sd/source/ui/accessibility/AccessiblePresentationGraphicShape.cxx |   24 
 sd/source/ui/accessibility/AccessiblePresentationOLEShape.cxx |   36 
 sd/source/ui/accessibility/AccessiblePresentationShape.cxx|   51 -
 sd/source/ui/inc/AccessiblePageShape.hxx  |3 
 sd/source/ui/inc/AccessiblePresentationGraphicShape.hxx   |2 
 sd/source/ui/inc/AccessiblePresentationOLEShape.hxx   |2 
 sd/source/ui/inc/AccessiblePresentationShape.hxx  |2 
 sfx2/source/dialog/basedlgs.cxx   |   32 
 svx/source/accessibility/AccessibleGraphicShape.cxx   |   11 
 svx/source/accessibility/AccessibleOLEShape.cxx   |6 
 svx/source/accessibility/DescriptionGenerator.cxx |   16 
 svx/source/dialog/fntctrl.cxx |  113 --
 svx/source/dialog/langbox.cxx |   11 
 sw/inc/shellio.hxx|2 
 sw/source/core/swg/swblocks.cxx   |   19 
 31 files changed, 235 insertions(+), 703 deletions(-)

New commits:
commit cae829e9c1394851fc88829d5197460929c2792a
Author: Noel Grandin 
AuthorDate: Tue Jun 11 14:05:02 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 12 13:34:02 2019 +0200

loplugin:unusedmethods

Change-Id: I42667e8483d2cb4363227344faca3899bd95d424
Reviewed-on: https://gerrit.libreoffice.org/73824
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index bd89d0d57225..5fb2ed3f09a7 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -64,6 +64,16 @@ cui/source/inc/cfgutil.hxx:151
 class rtl::OUString CuiConfigFunctionListBox::get_id(int) const
 cui/source/inc/cfgutil.hxx:165
 int CuiConfigFunctionListBox::get_selected_index() const
+cui/source/inc/CustomNotebookbarGenerator.hxx:30
+ CustomNotebookbarGenerator::CustomNotebookbarGenerator()
+cui/source/inc/CustomNotebookbarGenerator.hxx:33
+class com::sun::star::uno::Sequence 
CustomNotebookbarGenerator::getCustomizedUIItem(class rtl::OUString)
+cui/source/inc/CustomNotebookbarGenerator.hxx:35
+void CustomNotebookbarGenerator::modifyCustomizedUIFile(class 
com::sun::star::uno::Sequence)
+cui/source/inc/CustomNotebookbarGenerator.hxx:36
+void CustomNotebookbarGenerator::createCustomizedUIFile()
+cui/source/inc/CustomNotebookbarGenerator.hxx:37
+void CustomNotebookbarGenerator::setCustomizedUIItem(class 
com::sun::star::uno::Sequence,class rtl::OUString)
 cui/source/inc/hangulhanjadlg.hxx:245
 class rtl::OUString svx::SuggestionEdit::get_text() const
 dbaccess/source/filter/hsqldb/fbalterparser.hxx:20
@@ -112,18 +122,6 @@ editeng/inc/edtspell.hxx:113
 class __gnu_debug::_Safe_iterator > 
>, class std::__debug::vector > > WrongList::end() const
 extensions/source/scanner/scanner.hxx:81
 void ScannerManager::SetData(void *)
-formula/source/ui/dlg/funcpage.hxx:89
-void formula::FuncPage::Show()
-formula/source/ui/dlg/funcpage.hxx:91
-void formula::FuncPage::Hide()
-formula/source/ui/dlg/structpg.hxx:44
- formula::StructListBox::StructListBox(class vcl::Window *,long)
-formula/source/ui/dlg/structpg.hxx:47
-class SvTreeListEntry * formula::StructListBox::InsertStaticEntry(const 
class rtl::OUString &,const class Image &,class SvTreeListEntry *,unsigned 
long,const class formula::FormulaToken *)
-formula/source/ui/dlg/structpg.hxx:98
-void formula::StructPage::Show()
-formula/source/ui/dlg/structpg.hxx:100
-void formula::StructPage::Hide()
 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2018-11-27 Thread Libreoffice Gerrit user
 compilerplugins/clang/unusedenumconstants.readonly.results |2 --
 editeng/source/editeng/editstt2.hxx|3 ---
 editeng/source/editeng/impedit.cxx |   10 --
 editeng/source/editeng/impedit2.cxx|5 -
 include/editeng/editstat.hxx   |3 +--
 5 files changed, 1 insertion(+), 22 deletions(-)

New commits:
commit b6449c65daa2854b8241e14c0966721412f16515
Author: Noel Grandin 
AuthorDate: Mon Nov 26 13:45:26 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 27 14:41:41 2018 +0100

remove unused EEControlBits enum value

Change-Id: Ic363903bb6e32c029f5aac6810f69d590df1bf79
Reviewed-on: https://gerrit.libreoffice.org/64091
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index c1731a325120..bbb57be316e4 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -306,8 +306,6 @@ include/editeng/editeng.hxx:126
 enum GetAttribsFlags STYLESHEET
 include/editeng/editeng.hxx:127
 enum GetAttribsFlags PARAATTRIBS
-include/editeng/editstat.hxx:32
-enum EEControlBits CRSRLEFTPARA
 include/editeng/editstat.hxx:49
 enum EEControlBits AUTOCOMPLETE
 include/editeng/flditem.hxx:94
diff --git a/editeng/source/editeng/editstt2.hxx 
b/editeng/source/editeng/editstt2.hxx
index 15726ef24032..48d5f1e81da6 100644
--- a/editeng/source/editeng/editstt2.hxx
+++ b/editeng/source/editeng/editstt2.hxx
@@ -35,9 +35,6 @@ public:
 boolUseCharAttribs() const
 { return bool( nControlBits & EEControlBits::USECHARATTRIBS ); 
}
 
-boolNotifyCursorMovements() const
-{ return bool( nControlBits & EEControlBits::CRSRLEFTPARA ); }
-
 boolUseIdleFormatter() const
 { return bool( nControlBits & EEControlBits::DOIDLEFORMAT); }
 
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index b17c8c9c5386..390f524ddab4 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -1302,14 +1302,6 @@ bool ImpEditView::PostKeyEvent( const KeyEvent& 
rKeyEvent, vcl::Window const * p
 
 bool ImpEditView::MouseButtonUp( const MouseEvent& rMouseEvent )
 {
-if ( pEditEngine->GetInternalEditStatus().NotifyCursorMovements() )
-{
-if ( pEditEngine->GetInternalEditStatus().GetPrevParagraph() != 
pEditEngine->GetEditDoc().GetPos( GetEditSelection().Max().GetNode() ) )
-{
-pEditEngine->GetInternalEditStatus().GetStatusWord() = 
pEditEngine->GetInternalEditStatus().GetStatusWord() | 
EditStatusFlags::CRSRLEFTPARA;
-pEditEngine->pImpEditEngine->CallStatusHdl();
-}
-}
 nTravelXPos = TRAVEL_X_DONTKNOW;
 nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
 nExtraCursorFlags = GetCursorFlags::NONE;
@@ -1338,8 +1330,6 @@ void ImpEditView::ReleaseMouse()
 bool ImpEditView::MouseButtonDown( const MouseEvent& rMouseEvent )
 {
 pEditEngine->CheckIdleFormatter();  // If fast typing and mouse button 
downs
-if ( pEditEngine->GetInternalEditStatus().NotifyCursorMovements() )
-pEditEngine->GetInternalEditStatus().GetPrevParagraph() = 
pEditEngine->GetEditDoc().GetPos( GetEditSelection().Max().GetNode() );
 nTravelXPos = TRAVEL_X_DONTKNOW;
 nExtraCursorFlags   = GetCursorFlags::NONE;
 nCursorBidiLevel= CURSOR_BIDILEVEL_DONTKNOW;
diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index d892953fb062..8dcf586d3a54 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -902,11 +902,6 @@ EditSelection const & ImpEditEngine::MoveCursor( const 
KeyEvent& rKeyEvent, Edit
 if ( aOldPaM != aPaM )
 {
 CursorMoved( aOldPaM.GetNode() );
-if ( aStatus.NotifyCursorMovements() && ( aOldPaM.GetNode() != 
aPaM.GetNode() ) )
-{
-aStatus.GetStatusWord() = aStatus.GetStatusWord() | 
EditStatusFlags::CRSRLEFTPARA;
-aStatus.GetPrevParagraph() = aEditDoc.GetPos( aOldPaM.GetNode() );
-}
 }
 else
 aStatus.GetStatusWord() = aStatus.GetStatusWord() | 
EditStatusFlags::CRSRMOVEFAIL;
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index 7a64e817b194..f6894923c2e5 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -29,7 +29,6 @@ enum class EEControlBits
 {
 NONE   = 0x,
 USECHARATTRIBS = 0x0001,  // Use of hard character attributes
-CRSRLEFTPARA   = 0x0004,  // Cursor is moved to another paragraph
 DOIDLEFORMAT   = 0x0008,  // Formatting idle
 PASTESPECIAL   = 0x0010,  // Allow PasteSpecial
 AUTOINDENTING  = 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2018-11-27 Thread Libreoffice Gerrit user
 compilerplugins/clang/unusedenumconstants.readonly.results |2 
 editeng/source/editeng/impedit.cxx |   30 -
 editeng/source/editeng/impedit.hxx |1 
 include/editeng/editstat.hxx   |3 -
 4 files changed, 2 insertions(+), 34 deletions(-)

New commits:
commit 7290ce233de89319549cf47899905170a65593c7
Author: Noel Grandin 
AuthorDate: Mon Nov 26 13:41:59 2018 +0200
Commit: Noel Grandin 
CommitDate: Tue Nov 27 14:41:22 2018 +0100

remove unused EVControlBits enum values

Change-Id: I4e10f0a2f40f9e7b6cc40a810468f43b2ab97aa9
Reviewed-on: https://gerrit.libreoffice.org/64090
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index e22ad2930bc0..c1731a325120 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -310,8 +310,6 @@ include/editeng/editstat.hxx:32
 enum EEControlBits CRSRLEFTPARA
 include/editeng/editstat.hxx:49
 enum EEControlBits AUTOCOMPLETE
-include/editeng/editstat.hxx:64
-enum EVControlBits BIGSCROLL
 include/editeng/flditem.hxx:94
 enum SvxDateFormat System
 include/editeng/flditem.hxx:96
diff --git a/editeng/source/editeng/impedit.cxx 
b/editeng/source/editeng/impedit.cxx
index 0f91a4fa24eb..b17c8c9c5386 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -645,10 +645,7 @@ void ImpEditView::SetOutputArea( const tools::Rectangle& 
rRect )
 if ( aOutArea.Bottom() < aOutArea.Top() )
 aOutArea.SetBottom( aOutArea.Top() );
 
-if ( DoBigScroll() )
-SetScrollDiffX( static_cast(aOutArea.GetWidth()) * 3 / 10 
);
-else
-SetScrollDiffX( static_cast(aOutArea.GetWidth()) * 2 / 10 
);
+SetScrollDiffX( static_cast(aOutArea.GetWidth()) * 2 / 10 );
 }
 
 void ImpEditView::InvalidateAtWindow(const tools::Rectangle& rRect)
@@ -995,31 +992,6 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool 
bForceVisCursor )
 long nDiffX = !IsVertical() ? nDocDiffX : (IsTopToBottom() ? 
-nDocDiffY : nDocDiffY);
 long nDiffY = !IsVertical() ? nDocDiffY : (IsTopToBottom() ? 
nDocDiffX : -nDocDiffX);
 
-// Negative: Back to the top or left edge
-if ( ( std::abs( nDiffY ) > pEditEngine->GetOnePixelInRef() ) && 
DoBigScroll() )
-{
-long nH = aOutArea.GetHeight() / 4;
-if ( ( nH > aEditCursor.GetHeight() ) && ( std::abs( nDiffY ) 
< nH ) )
-{
-if ( nDiffY < 0 )
-nDiffY -= nH;
-else
-nDiffY += nH;
-}
-}
-
-if ( ( std::abs( nDiffX ) > pEditEngine->GetOnePixelInRef() ) && 
DoBigScroll() )
-{
-long nW = aOutArea.GetWidth() / 4;
-if ( std::abs( nDiffX ) < nW )
-{
-if ( nDiffY < 0 )
-nDiffY -= nW;
-else
-nDiffY += nW;
-}
-}
-
 if ( nDiffX )
 pEditEngine->GetInternalEditStatus().GetStatusWord() = 
pEditEngine->GetInternalEditStatus().GetStatusWord() | EditStatusFlags::HSCROLL;
 if ( nDiffY )
diff --git a/editeng/source/editeng/impedit.hxx 
b/editeng/source/editeng/impedit.hxx
index dffd2534ef69..418ef91f6814 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -382,7 +382,6 @@ public:
 
 boolDoSingleLinePaste() const   { return bool( nControl & 
EVControlBits::SINGLELINEPASTE ); }
 boolDoAutoScroll() const{ return bool( nControl & 
EVControlBits::AUTOSCROLL ); }
-boolDoBigScroll() const { return bool( nControl & 
EVControlBits::BIGSCROLL ); }
 boolDoAutoSize() const  { return bool( nControl & 
EVControlBits::AUTOSIZE ); }
 boolDoAutoWidth() const { return bool( nControl & 
EVControlBits::AUTOSIZEX); }
 boolDoAutoHeight() const{ return bool( nControl & 
EVControlBits::AUTOSIZEY); }
diff --git a/include/editeng/editstat.hxx b/include/editeng/editstat.hxx
index af8d5944e39e..7a64e817b194 100644
--- a/include/editeng/editstat.hxx
+++ b/include/editeng/editstat.hxx
@@ -61,7 +61,6 @@ namespace o3tl
 enum class EVControlBits
 {
 AUTOSCROLL = 0x0001,  // Auto scrolling horizontally
-BIGSCROLL  = 0x0002,  // Scroll further to the cursor
 ENABLEPASTE= 0x0004,  // Enable Paste
 SINGLELINEPASTE= 0x0008,  // View: Paste in input line ...
 OVERWRITE  = 0x0010,  // Overwrite mode
@@ -72,7 +71,7 @@ enum class EVControlBits
 };
 namespace o3tl
 {
- 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng sd/source

2018-11-21 Thread Libreoffice Gerrit user
 compilerplugins/clang/test/unusedenumconstants.cxx  |6 
 compilerplugins/clang/unusedenumconstants.cxx   |   17 
 compilerplugins/clang/unusedenumconstants.py|6 
 compilerplugins/clang/unusedenumconstants.readonly.results  |  186 -
 compilerplugins/clang/unusedenumconstants.untouched.results |  364 ++
 compilerplugins/clang/unusedenumconstants.writeonly.results | 1800 +++-
 editeng/source/editeng/editeng.cxx  |   14 
 editeng/source/editeng/editstt2.hxx |9 
 editeng/source/editeng/impedit2.cxx |2 
 editeng/source/editeng/impedit3.cxx |   10 
 include/editeng/editstat.hxx|6 
 sd/source/filter/ppt/pptin.cxx  |1 
 sd/source/ui/docshell/docshel4.cxx  |1 
 13 files changed, 1108 insertions(+), 1314 deletions(-)

New commits:
commit bab2753312c960c9eea610e927492775308fdfd5
Author: Noel Grandin 
AuthorDate: Wed Nov 21 13:34:02 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Nov 22 07:34:15 2018 +0100

loplugin:unusedenumconstants in EEControlBits

(*) remove effectivly unused enum constants

(*) tweak the plugins heuristics some more to remove false+ in this enum

(*) twweak the python post-processing step to avoid a KeyError

Change-Id: I2943ec94c00f71dcd049f5c9ef33db259c005ba3
Reviewed-on: https://gerrit.libreoffice.org/63709
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/test/unusedenumconstants.cxx 
b/compilerplugins/clang/test/unusedenumconstants.cxx
index 3de1a65537e0..76027b8e8481 100644
--- a/compilerplugins/clang/test/unusedenumconstants.cxx
+++ b/compilerplugins/clang/test/unusedenumconstants.cxx
@@ -27,10 +27,12 @@ enum class BrowseMode
 {
 Modules = 0x01, // expected-error {{read Modules 
[loplugin:unusedenumconstants]}}
 Top = 0x02, // expected-error {{write Top [loplugin:unusedenumconstants]}}
+Bottom = 0x04, // expected-error {{read Bottom 
[loplugin:unusedenumconstants]}}
+Left = 0x04, // expected-error {{write Left 
[loplugin:unusedenumconstants]}}
 };
 namespace o3tl
 {
-template <> struct typed_flags : is_typed_flags
+template <> struct typed_flags : is_typed_flags
 {
 };
 }
@@ -42,6 +44,8 @@ int test2(BrowseMode nMode)
 g_flags |= BrowseMode::Top;
 return 0;
 }
+bool test2b(BrowseMode nMode) { return bool(nMode & BrowseMode::Bottom); }
+BrowseMode test2c() { return BrowseMode::Left; }
 
 enum class Enum3
 {
diff --git a/compilerplugins/clang/unusedenumconstants.cxx 
b/compilerplugins/clang/unusedenumconstants.cxx
index 74e9eb216da7..80f40d69a1a1 100644
--- a/compilerplugins/clang/unusedenumconstants.cxx
+++ b/compilerplugins/clang/unusedenumconstants.cxx
@@ -188,12 +188,21 @@ walk_up:
 }
 else if (const CXXMemberCallExpr * memberCall = 
dyn_cast(parent))
 {
-//memberCall->getImplicitObjectArgument()->dump();
-//child->dump();
 // happens a lot with o3tl::typed_flags
 if (*memberCall->child_begin() == child)
-goto walk_up;
-bWrite = true;
+{
+if (auto conversionDecl = 
dyn_cast(memberCall->getMethodDecl()))
+{
+if 
(conversionDecl->getConversionType()->isSpecificBuiltinType(clang::BuiltinType::Bool))
+bRead = true;
+else
+goto walk_up;
+}
+else
+goto walk_up;
+}
+else
+bWrite = true;
 }
 else if (isa(parent) || isa(parent) || 
isa(parent)
  || isa(parent) || isa(parent)
diff --git a/compilerplugins/clang/unusedenumconstants.py 
b/compilerplugins/clang/unusedenumconstants.py
index ded7f4f8b1aa..24cd0c6ded07 100755
--- a/compilerplugins/clang/unusedenumconstants.py
+++ b/compilerplugins/clang/unusedenumconstants.py
@@ -205,6 +205,9 @@ writeonlySet = set()
 for d in writeSet:
 if d in readSet:
 continue
+# can happen with stuff in workdir or external
+if d not in definitionSet:
+continue
 srcLoc = definitionToSourceLocationMap[d];
 if (is_ignore(srcLoc)):
 continue
@@ -214,6 +217,9 @@ readonlySet = set()
 for d in readSet:
 if d in writeSet:
 continue
+# can happen with stuff in workdir or external
+if d not in definitionSet:
+continue
 srcLoc = definitionToSourceLocationMap[d];
 if (is_ignore(srcLoc)):
 continue
diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results 
b/compilerplugins/clang/unusedenumconstants.readonly.results
index be07890fdf83..cae51737565f 100644
--- a/compilerplugins/clang/unusedenumconstants.readonly.results
+++ b/compilerplugins/clang/unusedenumconstants.readonly.results
@@ -5,7 +5,7 @@ bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx:78
 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/svtools include/svx include/vcl sc/inc sc/source sd/source sfx2/source svtools/source svx/source sw/inc sw/

2018-10-15 Thread Libreoffice Gerrit user
 compilerplugins/clang/staticconstfield.cxx   |  144 ---
 compilerplugins/clang/test/staticconstfield.cxx  |   93 --
 editeng/source/outliner/outliner.cxx |   11 -
 editeng/source/outliner/outlvw.cxx   |4 
 include/editeng/outliner.hxx |2 
 include/svtools/svparser.hxx |2 
 include/svx/ClassificationDialog.hxx |1 
 include/svx/colrctrl.hxx |2 
 include/vcl/filter/pdfdocument.hxx   |4 
 sc/inc/rangenam.hxx  |8 -
 sc/source/core/tool/compiler.cxx |2 
 sc/source/core/tool/interpr8.cxx |2 
 sc/source/core/tool/rangenam.cxx |   28 
 sc/source/filter/inc/sheetdatabuffer.hxx |2 
 sc/source/filter/oox/sheetdatabuffer.cxx |3 
 sc/source/filter/xml/cachedattraccess.cxx|2 
 sc/source/filter/xml/cachedattraccess.hxx|2 
 sd/source/ui/animations/CustomAnimationPane.cxx  |6 
 sd/source/ui/animations/CustomAnimationPane.hxx  |2 
 sd/source/ui/sidebar/PreviewValueSet.cxx |5 
 sd/source/ui/sidebar/PreviewValueSet.hxx |1 
 sd/source/ui/slidesorter/view/SlsLayouter.cxx|   56 
 sfx2/source/doc/doctemplates.cxx |6 
 svtools/source/svrtf/svparser.cxx|2 
 svx/source/dialog/ClassificationDialog.cxx   |1 
 svx/source/svdraw/svdpdf.cxx |3 
 svx/source/svdraw/svdpdf.hxx |2 
 svx/source/tbxctrls/colrctrl.cxx |   27 ++--
 sw/inc/pagepreviewlayout.hxx |4 
 sw/source/core/view/pagepreviewlayout.cxx|   26 +---
 sw/source/filter/html/htmlcss1.cxx   |   19 ---
 sw/source/filter/html/svxcss1.cxx|9 -
 sw/source/filter/html/svxcss1.hxx|6 
 vcl/inc/octree.hxx   |8 -
 vcl/source/filter/ipdf/pdfdocument.cxx   |7 -
 vcl/source/gdi/octree.cxx|   13 --
 vcl/unx/generic/print/bitmap_gfx.cxx |   18 +-
 writerfilter/source/dmapper/GraphicImport.cxx|5 
 writerfilter/source/dmapper/NumberingManager.cxx |9 -
 writerfilter/source/dmapper/NumberingManager.hxx |2 
 writerfilter/source/dmapper/PropertyMap.cxx  |8 -
 writerfilter/source/dmapper/PropertyMap.hxx  |2 
 42 files changed, 276 insertions(+), 283 deletions(-)

New commits:
commit eaf0c263eb1a72a58d2a67cc0506ab022d7c4be4
Author: Noel Grandin 
AuthorDate: Fri Oct 12 17:12:22 2018 +0200
Commit: Noel Grandin 
CommitDate: Mon Oct 15 19:22:21 2018 +0200

loplugin:staticconstfield improvements

And fix
  ScXMLCachedRowAttrAccess::Cache
which was never setting its mnTab field, and hence would never
be hit.

And fix oox::xls::CellBlockBuffer, which was never setting mnCurrRow.

Change-Id: I2c46aa050b9ebe3c2dc2e52579555f97945dd61c
Reviewed-on: https://gerrit.libreoffice.org/61772
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/staticconstfield.cxx 
b/compilerplugins/clang/staticconstfield.cxx
index cde2f80babc5..b10953a75617 100644
--- a/compilerplugins/clang/staticconstfield.cxx
+++ b/compilerplugins/clang/staticconstfield.cxx
@@ -11,6 +11,9 @@
 #include "check.hxx"
 #include "compat.hxx"
 #include 
+#include 
+#include 
+#include 
 
 namespace
 {
@@ -22,22 +25,76 @@ public:
 {
 }
 
-void run() override { 
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+void run() override;
 
 bool TraverseConstructorInitializer(CXXCtorInitializer* init);
+bool TraverseCXXConstructorDecl(CXXConstructorDecl* decl);
+
+private:
+struct Data
+{
+std::vector inits;
+std::string value;
+};
+std::unordered_map m_potentials;
+std::unordered_set m_excluded;
+CXXConstructorDecl* m_currentConstructor = nullptr;
 };
 
+void StaticConstField::run()
+{
+std::string fn = handler.getMainFileName();
+loplugin::normalizeDotDotInFilePath(fn);
+
+// unusual case where a user constructor sets a field to one value, and a 
copy constructor sets it to a different value
+if (fn == SRCDIR "/sw/source/core/attr/hints.cxx")
+return;
+if (fn == SRCDIR "/oox/source/core/contexthandler2.cxx")
+return;
+
+TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+
+for (auto const& pair : m_potentials)
+{
+report(DiagnosticsEngine::Error, "field can be static const", 
pair.first->getLocation())
+<< pair.first->getSourceRange();
+for (CXXCtorInitializer const* init : pair.second.inits)
+if (pair.first->getLocation() != init->getSourceLocation())
+report(DiagnosticsEngine::Note, "init here", 
init->getSourceLocation())
+   

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/sfx2 include/svl include/svx include/vcl lotuswordpro/source reportdesign/source sc/source sdext/source sd/

2018-09-27 Thread Libreoffice Gerrit user
 compilerplugins/clang/methodcycles.partition.results   |   98 
 compilerplugins/clang/methodcycles.py  |  123 +++--
 compilerplugins/clang/methodcycles.results |   33 -
 editeng/source/uno/unoedprx.cxx|   17 
 editeng/source/uno/unoviwou.cxx|   28 -
 include/editeng/unoedprx.hxx   |3 
 include/editeng/unoedsrc.hxx   |   12 
 include/editeng/unoviwou.hxx   |1 
 include/sfx2/objsh.hxx |2 
 include/svl/style.hxx  |1 
 include/svx/sdr/contact/objectcontact.hxx  |   12 
 include/svx/sdr/contact/objectcontactofobjlistpainter.hxx  |3 
 include/svx/sdr/overlay/overlaymanager.hxx |3 
 include/svx/svdmrkv.hxx|1 
 include/svx/svdobj.hxx |2 
 include/svx/svdogrp.hxx|1 
 include/svx/svdotable.hxx  |1 
 include/svx/svdotext.hxx   |1 
 include/svx/svdovirt.hxx   |2 
 include/svx/svdpage.hxx|1 
 include/svx/svdundo.hxx|2 
 include/svx/unoshtxt.hxx   |1 
 include/vcl/field.hxx  |4 
 lotuswordpro/source/filter/lwplayout.cxx   |   36 -
 lotuswordpro/source/filter/lwplayout.hxx   |2 
 reportdesign/source/core/inc/ReportUndoFactory.hxx |2 
 reportdesign/source/core/sdr/ReportUndoFactory.cxx |   11 
 sc/source/ui/Accessibility/AccessibleText.cxx  |  235 ---
 sc/source/ui/docshell/docsh.cxx|   13 
 sc/source/ui/inc/docsh.hxx |1 
 sc/source/ui/vba/vbacondition.cxx  |   14 
 sc/source/ui/vba/vbacondition.hxx  |2 
 sc/source/ui/vba/vbaformatcondition.cxx|8 
 sc/source/ui/vba/vbaformatcondition.hxx|1 
 sd/inc/sdpage.hxx  |1 
 sd/inc/stlsheet.hxx|2 
 sd/source/core/sdpage.cxx  |8 
 sd/source/core/stlsheet.cxx|   11 
 sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx |   20 
 sd/source/ui/docshell/docshell.cxx |   45 --
 sd/source/ui/inc/AccessibleOutlineEditSource.hxx   |1 
 sd/source/ui/inc/DrawDocShell.hxx  |1 
 sd/source/ui/inc/View.hxx  |1 
 sd/source/ui/view/sdview.cxx   |7 
 sdext/source/pdfimport/inc/genericelements.hxx |1 
 sdext/source/pdfimport/tree/genericelements.cxx|   30 -
 sfx2/source/doc/objmisc.cxx|   11 
 slideshow/source/engine/shapeattributelayer.cxx|8 
 slideshow/source/inc/shapeattributelayer.hxx   |4 
 starmath/source/accessibility.cxx  |   53 --
 starmath/source/accessibility.hxx  |2 
 svl/source/items/style.cxx |4 
 svx/inc/sdr/contact/objectcontactofpageview.hxx|   12 
 svx/inc/sdr/overlay/overlaymanagerbuffered.hxx |3 
 svx/source/accessibility/AccessibleEmptyEditSource.cxx |1 
 svx/source/sdr/contact/objectcontact.cxx   |   25 -
 svx/source/sdr/contact/objectcontactofobjlistpainter.cxx   |6 
 svx/source/sdr/contact/objectcontactofpageview.cxx |   46 --
 svx/source/sdr/contact/viewobjectcontactofpageobj.cxx  |6 
 svx/source/sdr/overlay/overlaymanager.cxx  |5 
 svx/source/sdr/overlay/overlaymanagerbuffered.cxx  |   10 
 svx/source/svdraw/svdmrkv1.cxx |   17 
 svx/source/svdraw/svdobj.cxx   |   16 
 svx/source/svdraw/svdogrp.cxx  |5 
 svx/source/svdraw/svdotext.cxx |   15 
 svx/source/svdraw/svdovirt.cxx |   11 
 svx/source/svdraw/svdpage.cxx  |   33 -
 svx/source/svdraw/svdundo.cxx  |   10 
 svx/source/table/svdotable.cxx |   12 
 svx/source/unodraw/unoshtxt.cxx|   35 -
 sw/inc/docsh.hxx   |1 
 sw/source/uibase/app/docsh.cxx |4 
 sw/source/uibase/inc/drawbase.hxx  |1 
 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/filter include/oox include/svx include/vcl sc/inc sc/source svx/inc svx/source vcl/source

2018-08-09 Thread Libreoffice Gerrit user
 compilerplugins/clang/unusedmethods.results|  658 ++---
 compilerplugins/clang/unusedmethods.unused-returns.results |  108 +-
 editeng/source/items/textitem.cxx  |8 
 editeng/source/outliner/outlobj.cxx|5 
 include/editeng/charsetcoloritem.hxx   |3 
 include/editeng/outlobj.hxx|1 
 include/editeng/twolinesitem.hxx   |3 
 include/filter/msfilter/msdffimp.hxx   |1 
 include/oox/crypto/AgileEngine.hxx |2 
 include/oox/crypto/Standard2007Engine.hxx  |2 
 include/svx/colorwindow.hxx|1 
 include/svx/relfld.hxx |2 
 include/svx/sdr/contact/objectcontact.hxx  |3 
 include/svx/svdograf.hxx   |2 
 include/svx/unoshape.hxx   |2 
 include/vcl/opengl/OpenGLContext.hxx   |2 
 sc/inc/compiler.hxx|2 
 sc/inc/compressedarray.hxx |1 
 sc/inc/validat.hxx |3 
 sc/source/core/data/compressedarray.cxx|   12 
 sc/source/core/data/validat.cxx|5 
 sc/source/core/tool/token.cxx  |   10 
 svx/inc/sdr/contact/objectcontactofpageview.hxx|3 
 svx/inc/sdr/contact/viewobjectcontactofgraphic.hxx |3 
 svx/source/dialog/relfld.cxx   |   24 
 svx/source/sdr/contact/objectcontact.cxx   |6 
 svx/source/sdr/contact/objectcontactofpageview.cxx |7 
 svx/source/sdr/contact/viewobjectcontactofgraphic.cxx  |   10 
 svx/source/svdraw/svdograf.cxx |  160 ---
 svx/source/tbxctrls/tbcontrl.cxx   |9 
 svx/source/unodraw/unoshape.cxx|   13 
 vcl/source/opengl/OpenGLContext.cxx|   26 
 32 files changed, 409 insertions(+), 688 deletions(-)

New commits:
commit f4fb14ed796cec7a02f3a06a6556997ae415e79d
Author: Noel Grandin 
AuthorDate: Wed Aug 8 13:55:15 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 9 14:17:08 2018 +0200

loplugin:unusedmethods

Change-Id: I0308ddd467ab6e283c0503f98885a248eb28290c
Reviewed-on: https://gerrit.libreoffice.org/58738
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index 72c2ec87bb6c..2c4007b5d8af 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -22,7 +22,7 @@ connectivity/source/drivers/firebird/Util.hxx:65
 short connectivity::firebird::ColumnTypeInfo::getScale() const
 connectivity/source/drivers/firebird/Util.hxx:66
 const class rtl::OUString & 
connectivity::firebird::ColumnTypeInfo::getCharacterSet() const
-connectivity/source/drivers/mork/mork_helper.cxx:36
+connectivity/source/drivers/mork/mork_helper.cxx:37
 int main(int,char **)
 connectivity/source/inc/dbase/dindexnode.hxx:70
 _Bool connectivity::dbase::ONDXKey::operator<(const class 
connectivity::dbase::ONDXKey &) const
@@ -50,7 +50,7 @@ dbaccess/source/filter/hsqldb/fbalterparser.hxx:20
 void dbahsql::FbAlterStmtParser::ensureProperTableLengths() const
 dbaccess/source/filter/hsqldb/parseschema.hxx:82
 const class std::__debug::map >, struct std::less, class 
std::allocator > > > > & dbahsql::SchemaParser::getPrimaryKeys() const
-dbaccess/source/ui/browser/genericcontroller.cxx:1212
+dbaccess/source/ui/browser/genericcontroller.cxx:1213
 const type-parameter-?-? & dbaui::(anonymous 
namespace)::SGI_identity::operator()(const type-parameter-?-? &) const
 dbaccess/source/ui/inc/dsmeta.hxx:88
 class __gnu_debug::_Safe_iterator, class std::__debug::set, class std::allocator > > dbaui::FeatureSet::begin() const
@@ -168,9 +168,9 @@ include/basegfx/point/b2ipoint.hxx:81
 class basegfx::B2IPoint & basegfx::B2IPoint::operator*=(int)
 include/basegfx/point/b2ipoint.hxx:98
 class basegfx::B2IPoint & basegfx::B2IPoint::operator*=(const class 
basegfx::B2DHomMatrix &)
-include/basegfx/point/b3dpoint.hxx:85
+include/basegfx/point/b3dpoint.hxx:76
 class basegfx::B3DPoint & basegfx::B3DPoint::operator*=(const class 
basegfx::B3DPoint &)
-include/basegfx/point/b3dpoint.hxx:95
+include/basegfx/point/b3dpoint.hxx:86
 class basegfx::B3DPoint & basegfx::B3DPoint::operator*=(double)
 include/basegfx/polygon/b3dpolypolygon.hxx:109
 class basegfx::B3DPolygon * basegfx::B3DPolyPolygon::begin()
@@ -284,7 +284,7 @@ include/basegfx/vector/b2ivector.hxx:84
 class basegfx::B2IVector & basegfx::B2IVector::operator*=(int)
 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/sfx2 include/svtools include/svx sfx2/source svtools/source svx/source sw/inc sw/source vcl/headless vcl/in

2018-06-11 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.results   |  678 +++--
 compilerplugins/clang/unusedmethods.unused-returns.results|   60 
 editeng/source/outliner/outlin2.cxx   |5 
 include/editeng/outliner.hxx  |1 
 include/sfx2/sidebar/Sidebar.hxx  |   10 
 include/svtools/valueset.hxx  |   54 
 include/svx/SvxColorValueSet.hxx  |2 
 include/svx/dialcontrol.hxx   |9 
 include/svx/paraprev.hxx  |   28 
 include/svx/swframeexample.hxx|3 
 sfx2/source/sidebar/Sidebar.cxx   |   22 
 svtools/source/control/valueacc.cxx   |   26 
 svtools/source/control/valueimp.hxx   |4 
 svtools/source/control/valueset.cxx   |   43 
 svx/source/dialog/dialcontrol.cxx |   21 
 svx/source/svdraw/svdpdf.cxx  |   72 
 svx/source/svdraw/svdpdf.hxx  |1 
 sw/inc/dbmgr.hxx  |1 
 sw/inc/dcontact.hxx   |2 
 sw/inc/ndgrf.hxx  |1 
 sw/source/core/draw/dcontact.cxx  |8 
 sw/source/uibase/dbui/dbmgr.cxx   |   48 
 sw/source/uibase/inc/numprevw.hxx |   11 
 sw/source/uibase/inc/prcntfld.hxx |   21 
 sw/source/uibase/utlui/prcntfld.cxx   |8 
 vcl/headless/svpgdi.cxx   |6 
 vcl/inc/headless/svpgdi.hxx   |2 
 vcl/inc/impgraph.hxx  |5 
 vcl/inc/svmconverter.hxx  |4 
 vcl/source/gdi/svmconverter.cxx   | 1318 --
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx |   42 
 xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx |   11 
 32 files changed, 502 insertions(+), 2025 deletions(-)

New commits:
commit d4d037619638e1915d15dba81c38a1c9b3157972
Author: Noel Grandin 
Date:   Mon Jun 11 10:11:40 2018 +0200

loplugin:unusedmethods

Change-Id: I26a0da1ec9cda9030371977596053a45303756a0
Reviewed-on: https://gerrit.libreoffice.org/55609
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index 912c676c8586..041145a9d2ae 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -12,15 +12,15 @@ connectivity/source/drivers/evoab2/NResultSetMetaData.hxx:51
 class com::sun::star::uno::Reference 
connectivity::evoab::OEvoabResultSetMetaData::operator Reference()
 connectivity/source/drivers/firebird/Driver.hxx:65
 const class com::sun::star::uno::Reference & 
connectivity::firebird::FirebirdDriver::getContext() const
-connectivity/source/drivers/firebird/Util.hxx:61
+connectivity/source/drivers/firebird/Util.hxx:58
  connectivity::firebird::ColumnTypeInfo::ColumnTypeInfo(short,const class 
rtl::OUString &)
-connectivity/source/drivers/firebird/Util.hxx:66
+connectivity/source/drivers/firebird/Util.hxx:63
 short connectivity::firebird::ColumnTypeInfo::getType() const
-connectivity/source/drivers/firebird/Util.hxx:67
+connectivity/source/drivers/firebird/Util.hxx:64
 short connectivity::firebird::ColumnTypeInfo::getSubType() const
-connectivity/source/drivers/firebird/Util.hxx:68
+connectivity/source/drivers/firebird/Util.hxx:65
 short connectivity::firebird::ColumnTypeInfo::getScale() const
-connectivity/source/drivers/firebird/Util.hxx:69
+connectivity/source/drivers/firebird/Util.hxx:66
 const class rtl::OUString & 
connectivity::firebird::ColumnTypeInfo::getCharacterSet() const
 connectivity/source/drivers/mork/mork_helper.cxx:36
 int main(int,char **)
@@ -28,11 +28,11 @@ connectivity/source/inc/dbase/dindexnode.hxx:70
 _Bool connectivity::dbase::ONDXKey::operator<(const class 
connectivity::dbase::ONDXKey &) const
 connectivity/source/inc/java/sql/Connection.hxx:63
 class rtl::OUString 
connectivity::java_sql_Connection::transFormPreparedStatement(const class 
rtl::OUString &)
-connectivity/source/inc/OColumn.hxx:112
+connectivity/source/inc/OColumn.hxx:103
 _Bool connectivity::OColumn::isReadOnly() const
-connectivity/source/inc/OColumn.hxx:113
+connectivity/source/inc/OColumn.hxx:104
 _Bool connectivity::OColumn::isWritable() const
-connectivity/source/inc/OColumn.hxx:114
+connectivity/source/inc/OColumn.hxx:105
 _Bool connectivity::OColumn::isDefinitelyWritable() const
 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2018-05-18 Thread Noel Grandin
 compilerplugins/clang/useuniqueptr.cxx |3 +
 editeng/source/misc/svxacorr.cxx   |   62 +
 include/editeng/svxacorr.hxx   |4 +-
 3 files changed, 31 insertions(+), 38 deletions(-)

New commits:
commit 516d593ce1593ad47712b762dfa67a8063a18929
Author: Noel Grandin 
Date:   Wed May 9 14:53:07 2018 +0200

loplugin:useuniqueptr in SvxAutoCorrectLanguageLists

Change-Id: Ie433a336f9cd5133aefbe4ef88d214b5f5c63a0a
Reviewed-on: https://gerrit.libreoffice.org/54182
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
index 0c82307a9da8..5a2ff10e0508 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -53,6 +53,9 @@ public:
 // to our own buffer
 if (fn == SRCDIR "/editeng/source/misc/txtrange.cxx")
 return;
+// can't use std::set> until C++14
+if (fn == SRCDIR "/editeng/source/misc/svxacorr.cxx")
+return;
 
 TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
 }
diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx
index bcc722e1f31a..70daa82e3a88 100644
--- a/editeng/source/misc/svxacorr.cxx
+++ b/editeng/source/misc/svxacorr.cxx
@@ -2457,7 +2457,7 @@ bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( 
std::vectorFindAndRemove( 
 );
+std::unique_ptr pFoundEntry = 
pAutocorr_List->FindAndRemove(  );
 if( pFoundEntry )
 {
 if( !pFoundEntry->IsTextOnly() )
@@ -2474,14 +2474,13 @@ bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( 
std::vectorCommit();
 }
 }
-delete pFoundEntry;
 }
 }
 
 for (SvxAutocorrWord & aNewEntrie : aNewEntries)
 {
-SvxAutocorrWord *pWordToAdd = new SvxAutocorrWord( 
aNewEntrie.GetShort(), aNewEntrie.GetLong(), true );
-SvxAutocorrWord *pRemoved = pAutocorr_List->FindAndRemove( 
pWordToAdd );
+std::unique_ptr pWordToAdd(new SvxAutocorrWord( 
aNewEntrie.GetShort(), aNewEntrie.GetLong(), true ));
+std::unique_ptr pRemoved = 
pAutocorr_List->FindAndRemove( pWordToAdd.get() );
 if( pRemoved )
 {
 if( !pRemoved->IsTextOnly() )
@@ -2496,13 +2495,11 @@ bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( 
std::vectorIsContained( sStorageName ) )
 xStorage->Remove( sStorageName );
 }
-delete pRemoved;
 }
-bRet = pAutocorr_List->Insert( pWordToAdd );
+bRet = pAutocorr_List->Insert( std::move(pWordToAdd) );
 
 if ( !bRet )
 {
-delete pWordToAdd;
 break;
 }
 }
@@ -2528,8 +2525,8 @@ bool SvxAutoCorrectLanguageLists::PutText( const 
OUString& rShort, const OUStrin
 // Update the word list
 if( bRet )
 {
-SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, rLong, true );
-SvxAutocorrWord *pRemove = pAutocorr_List->FindAndRemove( pNew );
+std::unique_ptr pNew(new SvxAutocorrWord( rShort, 
rLong, true ));
+std::unique_ptr pRemove = 
pAutocorr_List->FindAndRemove( pNew.get() );
 if( pRemove )
 {
 if( !pRemove->IsTextOnly() )
@@ -2544,17 +2541,15 @@ bool SvxAutoCorrectLanguageLists::PutText( const 
OUString& rShort, const OUStrin
 if( xStg->IsContained( sStgNm ) )
 xStg->Remove( sStgNm );
 }
-delete pRemove;
 }
 
-if( pAutocorr_List->Insert( pNew ) )
+if( pAutocorr_List->Insert( std::move(pNew) ) )
 {
 bRet = MakeBlocklist_Imp( *xStg );
 xStg = nullptr;
 }
 else
 {
-delete pNew;
 bRet = false;
 }
 }
@@ -2579,14 +2574,12 @@ void SvxAutoCorrectLanguageLists::PutText( const 
OUString& rShort,
 // Update the word list
 if( bRet )
 {
-SvxAutocorrWord* pNew = new SvxAutocorrWord( rShort, sLong, false 
);
-if( pAutocorr_List->Insert( pNew ) )
+std::unique_ptr pNew(new SvxAutocorrWord( rShort, 
sLong, false ));
+if( pAutocorr_List->Insert( std::move(pNew) ) )
 {
 tools::SvRef xStor = new SotStorage( 
sUserAutoCorrFile, StreamMode::READWRITE );
 MakeBlocklist_Imp( *xStor );
 }
-else
-delete pNew;
 }
 }
 catch ( const uno::Exception& )
@@ -2606,8 +2599,9 @@ struct CompareSvxAutocorrWordList
 
 namespace {
 
+// can't use std::unique_ptr until we have C++14
 typedef std::set

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2018-05-16 Thread Noel Grandin
 compilerplugins/clang/useuniqueptr.cxx |4 
 editeng/source/uno/unoforou.cxx|   23 ++-
 include/editeng/unoforou.hxx   |6 +++---
 3 files changed, 13 insertions(+), 20 deletions(-)

New commits:
commit 19b4520fbfa8080821021586d8fe3428a2a893af
Author: Noel Grandin 
Date:   Wed May 9 14:00:59 2018 +0200

loplugin:useuniqueptr in SvxOutlinerForwarder

Change-Id: Ie861132b43b0a01ee8b4f3bc201bbf12f8af9f36
Reviewed-on: https://gerrit.libreoffice.org/54181
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/useuniqueptr.cxx 
b/compilerplugins/clang/useuniqueptr.cxx
index c7f76fe6b962..0c82307a9da8 100644
--- a/compilerplugins/clang/useuniqueptr.cxx
+++ b/compilerplugins/clang/useuniqueptr.cxx
@@ -49,6 +49,10 @@ public:
 // and the logic depends on overriding methods.
 if (fn == SRCDIR "/sfx2/source/dialog/tabdlg.cxx")
 return;
+// pLongArr is being deleted here because we temporarily overwrite a 
pointer to someone else's buffer, with a pointer
+// to our own buffer
+if (fn == SRCDIR "/editeng/source/misc/txtrange.cxx")
+return;
 
 TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
 }
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 3db46f1a83e9..fa8e08ed16d7 100644
--- a/editeng/source/uno/unoforou.cxx
+++ b/editeng/source/uno/unoforou.cxx
@@ -109,8 +109,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const 
ESelection& rSel, EditEngineA
 else
 {
 // no, we need delete the old cache
-delete mpAttribsCache;
-mpAttribsCache = nullptr;
+mpAttribsCache.reset();
 }
 }
 
@@ -122,7 +121,7 @@ SfxItemSet SvxOutlinerForwarder::GetAttribs( const 
ESelection& rSel, EditEngineA
 
 if( EditEngineAttribs::All == nOnlyHardAttrib )
 {
-mpAttribsCache = new SfxItemSet( aSet );
+mpAttribsCache.reset(new SfxItemSet( aSet ));
 maAttribCacheSelection = rSel;
 }
 
@@ -146,12 +145,11 @@ SfxItemSet SvxOutlinerForwarder::GetParaAttribs( 
sal_Int32 nPara ) const
 else
 {
 // no, we need delete the old cache
-delete mpParaAttribsCache;
-mpParaAttribsCache = nullptr;
+mpParaAttribsCache.reset();
 }
 }
 
-mpParaAttribsCache = new SfxItemSet( rOutliner.GetParaAttribs( nPara ) );
+mpParaAttribsCache.reset(new SfxItemSet( rOutliner.GetParaAttribs( nPara ) 
));
 mnParaAttribsCache = nPara;
 
 EditEngine& rEditEngine = 
const_cast(rOutliner.GetEditEngine());
@@ -253,17 +251,8 @@ SfxItemState SvxOutlinerForwarder::GetItemState( sal_Int32 
nPara, sal_uInt16 nWh
 
 void SvxOutlinerForwarder::flushCache()
 {
-if( mpAttribsCache )
-{
-delete mpAttribsCache;
-mpAttribsCache = nullptr;
-}
-
-if( mpParaAttribsCache )
-{
-delete mpParaAttribsCache;
-mpParaAttribsCache = nullptr;
-}
+mpAttribsCache.reset();
+mpParaAttribsCache.reset();
 }
 
 LanguageType SvxOutlinerForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 
nIndex ) const
diff --git a/include/editeng/unoforou.hxx b/include/editeng/unoforou.hxx
index b04fdcdb59f5..0eb490b466fd 100644
--- a/include/editeng/unoforou.hxx
+++ b/include/editeng/unoforou.hxx
@@ -22,8 +22,8 @@
 
 #include 
 #include 
-
 #include 
+#include 
 
 class Outliner;
 
@@ -37,14 +37,14 @@ private:
 
 /** this pointer may be null or point to an item set for the attribs of
 the selection maAttribsSelection */
-mutable SfxItemSet* mpAttribsCache;
+mutable std::unique_ptr mpAttribsCache;
 
 /** if we have a cached attribute item set, this is the selection of it */
 mutable ESelection  maAttribCacheSelection;
 
 /** this pointer may be null or point to an item set for the paragraph
 mnParaAttribsCache */
-mutable SfxItemSet* mpParaAttribsCache;
+mutable std::unique_ptr mpParaAttribsCache;
 
 /** if we have a cached para attribute item set, this is the paragraph of 
it */
 mutable sal_Int32   mnParaAttribsCache;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng mysqlc/source

2018-03-12 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.results|  222 -
 compilerplugins/clang/unusedmethods.unused-returns.results |4 
 editeng/source/editeng/editeng.cxx |5 
 include/editeng/editeng.hxx|1 
 mysqlc/source/mysqlc_driver.cxx|   34 -
 mysqlc/source/mysqlc_subcomponent.hxx  |5 
 6 files changed, 85 insertions(+), 186 deletions(-)

New commits:
commit cb34e6083cdc82333d64ad9224e0d25e895d1dae
Author: Noel Grandin 
Date:   Fri Mar 9 15:23:44 2018 +0200

loplugin:unusedmethods

Change-Id: I027adbe65edd5f07534bb36f9f54c55f30ba516e
Reviewed-on: https://gerrit.libreoffice.org/50998
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index 747cb3037f08..3c535defd69c 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -10,8 +10,6 @@ connectivity/source/drivers/evoab2/NResultSetMetaData.hxx:51
 class com::sun::star::uno::Reference 
connectivity::evoab::OEvoabResultSetMetaData::operator Reference()
 connectivity/source/drivers/firebird/Driver.hxx:65
 const class com::sun::star::uno::Reference & 
connectivity::firebird::FirebirdDriver::getContext() const
-connectivity/source/drivers/firebird/SubComponent.hxx:53
-void release(int &,struct cppu::OBroadcastHelperVar 
&,class com::sun::star::uno::Reference 
&,class com::sun::star::lang::XComponent *)
 connectivity/source/drivers/firebird/Util.hxx:61
  connectivity::firebird::ColumnTypeInfo::ColumnTypeInfo(short,const class 
rtl::OUString &)
 connectivity/source/drivers/firebird/Util.hxx:66
@@ -46,8 +44,6 @@ connectivity/source/inc/OTypeInfo.hxx:55
 _Bool connectivity::OTypeInfo::operator==(const struct 
connectivity::OTypeInfo &) const
 connectivity/source/inc/OTypeInfo.hxx:56
 _Bool connectivity::OTypeInfo::operator!=(const struct 
connectivity::OTypeInfo &) const
-dbaccess/source/filter/hsqldb/columndef.hxx:37
-int dbahsql::ColumnDefinition::getAutoIncrementDefault() const
 dbaccess/source/ui/browser/genericcontroller.cxx:1230
 const type-parameter-?-? & dbaui::(anonymous 
namespace)::SGI_identity::operator()(const type-parameter-?-? &) const
 dbaccess/source/ui/inc/indexcollection.hxx:54
@@ -260,8 +256,6 @@ include/comphelper/configuration.hxx:264
 void comphelper::ConfigurationLocalizedProperty::set(const 
type-parameter-?-? &,const class std::shared_ptr &)
 include/comphelper/configuration.hxx:300
 class com::sun::star::uno::Reference 
comphelper::ConfigurationGroup::get(const class std::shared_ptr &)
-include/comphelper/graphicmimetype.hxx:27
-class rtl::OUString 
comphelper::GraphicMimeTypeHelper::GetMimeTypeForImageUrl(const class 
rtl::OUString &)
 include/comphelper/logging.hxx:57
 class rtl::OUString convertLogArgToString(char16_t)
 include/comphelper/logging.hxx:232
@@ -336,8 +330,8 @@ include/drawinglayer/primitive3d/baseprimitive3d.hxx:113
 _Bool drawinglayer::primitive3d::BasePrimitive3D::operator!=(const class 
drawinglayer::primitive3d::BasePrimitive3D &) const
 include/drawinglayer/texture/texture.hxx:44
 _Bool drawinglayer::texture::GeoTexSvx::operator!=(const class 
drawinglayer::texture::GeoTexSvx &) const
-include/editeng/outliner.hxx:999
-_Bool Outliner::IsHoriAlignIgnoreTrailingWhitespace() const
+include/editeng/editeng.hxx:626
+_Bool EditEngine::IsHoriAlignIgnoreTrailingWhitespace() const
 include/filter/msfilter/mstoolbar.hxx:98
  Indent::Indent(_Bool)
 include/formula/opcode.hxx:520
@@ -426,8 +420,6 @@ include/o3tl/typed_flags_set.hxx:348
 typename typed_flags::Self 
operator^=(type-parameter-?-? &,typename typed_flags::Wrap)
 include/o3tl/vector_pool.hxx:83
  o3tl::detail::struct_from_value::type::type()
-include/oox/export/drawingml.hxx:207
-void oox::drawingml::DrawingML::WriteSrcRect(const class 
com::sun::star::uno::Reference 
&,const class rtl::OUString &)
 include/oox/helper/containerhelper.hxx:51
 _Bool oox::ValueRange::operator!=(const struct oox::ValueRange &) const
 include/oox/helper/containerhelper.hxx:99
@@ -444,10 +436,8 @@ include/oox/helper/containerhelper.hxx:123
 typename vector 
>::iterator oox::Matrix::row_end(typename vector >::size_type)
 include/oox/helper/containerhelper.hxx:126
 typename vector 
>::reference oox::Matrix::row_front(typename vector >::size_type)
-include/oox/helper/graphichelper.hxx:148
-class rtl::OUString oox::GraphicHelper::importGraphicObject(const class 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2018-01-25 Thread Noel Grandin
 compilerplugins/clang/datamembershadow.cxx |5 +
 editeng/source/uno/unotext.cxx |2 +-
 include/editeng/unotext.hxx|2 +-
 3 files changed, 3 insertions(+), 6 deletions(-)

New commits:
commit fbe2d12f19dac29107e89ce4b3153fa6922633e5
Author: Noel Grandin 
Date:   Wed Jan 24 16:39:11 2018 +0200

loplugin:datamembershadow in SvxUnoTextRangeBase

make the superclass member private

Change-Id: I665d87bfdfc3d7804cd4cac6108f9bc65b9ca2b5
Reviewed-on: https://gerrit.libreoffice.org/48552
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/datamembershadow.cxx 
b/compilerplugins/clang/datamembershadow.cxx
index 520e1195f0ca..54e671daffa1 100644
--- a/compilerplugins/clang/datamembershadow.cxx
+++ b/compilerplugins/clang/datamembershadow.cxx
@@ -19,6 +19,7 @@
  * Check for data member being shadowed.
  *
  * @TODO check for any members in superclass hierarchy with duplicate names,
+ *   regardless of their visibility,
  *   more specific names will make the code easier to read
  */
 namespace
@@ -84,12 +85,8 @@ bool DataMemberShadow::VisitFieldDecl(FieldDecl const * 
fieldDecl)
 if (loplugin::isSamePathname(aFileName, SRCDIR 
"/store/source/stortree.hxx")
 || loplugin::isSamePathname(aFileName, SRCDIR 
"/store/source/stordata.hxx"))
 return true;
-if (loplugin::isSamePathname(aFileName, SRCDIR "/svx/source/inc/cell.hxx"))
-return true;
 if (loplugin::isSamePathname(aFileName, SRCDIR 
"/sw/source/uibase/inc/dbtree.hxx"))
 return true;
-if (loplugin::isSamePathname(aFileName, SRCDIR 
"/vcl/unx/generic/print/genpspgraphics.cxx"))
-return true;
 
 const CXXRecordDecl* parentCXXRecordDecl = 
dyn_cast(fieldDecl->getDeclContext());
 if (!parentCXXRecordDecl) {
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 7859b4f1185e..6b6127c92ec8 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -208,7 +208,7 @@ void CheckSelection( struct ESelection& rSel, SvxEditSource 
*pEdit ) throw()
 UNO3_GETIMPLEMENTATION_IMPL( SvxUnoTextRangeBase );
 
 SvxUnoTextRangeBase::SvxUnoTextRangeBase(const SvxItemPropertySet* _pSet)
-: mpEditSource(nullptr) , mpPropSet(_pSet)
+: mpPropSet(_pSet), mpEditSource(nullptr)
 {
 }
 
diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 4ee3bf4fc11d..4b4eb127aae0 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -250,11 +250,11 @@ class EDITENG_DLLPUBLIC SvxUnoTextRangeBase : public 
css::text::XTextRange,
 {
 friend class SvxUnoTextRangeEnumeration;
 friend class ::accessibility::AccessibleEditableTextPara;
+const SvxItemPropertySet* mpPropSet;
 
 protected:
 SvxEditSource*  mpEditSource;
 ESelection  maSelection;
-const SvxItemPropertySet* mpPropSet;
 
 /// @throws css::beans::UnknownPropertyException
 /// @throws css::beans::PropertyVetoException
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/tools sc/inc sc/source sd/inc starmath/inc starmath/source tools/source

2017-07-26 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.results|  250 +
 compilerplugins/clang/unusedmethods.unused-returns.results |4 
 editeng/source/rtf/svxrtf.cxx  |   61 ---
 include/editeng/svxrtf.hxx |4 
 include/tools/unqidx.hxx   |3 
 sc/inc/userdat.hxx |1 
 sc/source/core/data/userdat.cxx|5 
 sc/source/ui/inc/undobase.hxx  |1 
 sc/source/ui/undo/undobase.cxx |   42 --
 sd/inc/imapinfo.hxx|3 
 starmath/inc/smmod.hxx |3 
 starmath/source/smmod.cxx  |8 
 tools/source/memtools/unqidx.cxx   |   27 -
 13 files changed, 30 insertions(+), 382 deletions(-)

New commits:
commit 98782932280d20ece450fa06a90c202fb8e2a26e
Author: Noel Grandin 
Date:   Wed Jul 26 11:14:10 2017 +0200

loplugin:unusedmethods

Change-Id: I7f26ee112ed89ee3e69c56930260565f66ff145b
Reviewed-on: https://gerrit.libreoffice.org/40442
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.results 
b/compilerplugins/clang/unusedmethods.results
index 8fdc4275e208..6af3710f63bf 100644
--- a/compilerplugins/clang/unusedmethods.results
+++ b/compilerplugins/clang/unusedmethods.results
@@ -1,21 +1,13 @@
 basegfx/source/range/b2drangeclipper.cxx:697
 type-parameter-?-? eraseFromList(type-parameter-?-? &,const 
type-parameter-?-? &)
-chart2/source/inc/DataSeriesHelper.hxx:153
-_Bool areAllSeriesAttachedToSameAxis(const class 
com::sun::star::uno::Reference &,int 
&)
-connectivity/source/drivers/evoab2/NDatabaseMetaData.hxx:88
-class connectivity::evoab::OEvoabConnection * 
connectivity::evoab::OEvoabDatabaseMetaData::getOwnConnection() const
-connectivity/source/drivers/evoab2/NResultSetMetaData.hxx:50
-int connectivity::evoab::OEvoabResultSetMetaData::getFieldSize() const
-connectivity/source/drivers/evoab2/NStatement.hxx:60
- connectivity::evoab::FieldSort::FieldSort()
 connectivity/source/drivers/mork/mork_helper.cxx:36
 int main(int,char **)
 connectivity/source/inc/odbc/OPreparedStatement.hxx:74
 void 
connectivity::odbc::OPreparedStatement::setScalarParameter(int,int,unsigned 
long,const type-parameter-?-?)
 connectivity/source/inc/odbc/OPreparedStatement.hxx:75
 void 
connectivity::odbc::OPreparedStatement::setScalarParameter(int,int,unsigned 
long,int,const type-parameter-?-?)
-cui/source/inc/hyphen.hxx:70
-unsigned short SvxHyphenWordDialog::GetHyphIndex_Impl()
+connectivity/source/inc/OTypeInfo.hxx:40
+ connectivity::OTypeInfo::OTypeInfo()
 dbaccess/source/ui/inc/indexcollection.hxx:54
 class __gnu_debug::_Safe_iterator > >, class 
std::__debug::vector > > dbaui::OIndexCollection::begin() const
 dbaccess/source/ui/inc/indexcollection.hxx:58
@@ -30,8 +22,6 @@ desktop/inc/lib/init.hxx:45
 _Bool desktop::CallbackFlushHandler::isEventLatchOn() const
 desktop/inc/lib/init.hxx:47
 _Bool desktop::CallbackFlushHandler::isPartTilePainting() const
-desktop/source/app/langselect.hxx:29
-class rtl::OUString getEmergencyLocale()
 drawinglayer/source/tools/emfpbrush.hxx:123
 unsigned int emfplushelper::EMFPBrush::GetType() const
 drawinglayer/source/tools/emfpcustomlinecap.hxx:37
@@ -138,14 +128,12 @@ include/desktop/crashreport.hxx:50
 void CrashReporter::storeExceptionHandler(class 
google_breakpad::ExceptionHandler *)
 include/desktop/crashreport.hxx:54
 void CrashReporter::updateMinidumpLocation()
-include/drawinglayer/primitive2d/polypolygonprimitive2d.hxx:382
- 
drawinglayer::primitive2d::PolyPolygonGraphicPrimitive2D::PolyPolygonGraphicPrimitive2D(const
 class basegfx::B2DPolyPolygon &,const class 
drawinglayer::attribute::FillGraphicAttribute &)
-include/editeng/svxrtf.hxx:257
-void SvxRTFParser::ReadInfo()
+include/editeng/svxrtf.hxx:255
+struct com::sun::star::util::DateTime SvxRTFParser::GetDateTimeStamp()
+include/editeng/svxrtf.hxx:256
+class rtl::OUString & SvxRTFParser::GetTextToEndGroup(class rtl::OUString 
&)
 include/filter/msfilter/mstoolbar.hxx:98
  Indent::Indent(_Bool)
-include/formula/formdata.hxx:43
-unsigned short formula::FormEditData::GetEdFocus() const
 include/i18nlangtag/languagetag.hxx:257
 enum LanguageTag::ScriptType LanguageTag::getScriptType() const
 include/o3tl/any.hxx:155
@@ -226,40 +214,14 @@ include/oox/helper/propertymap.hxx:114
 void oox::PropertyMap::dumpData(const class 
com::sun::star::uno::Reference &)
 include/opencl/OpenCLZone.hxx:42
 _Bool OpenCLZone::isInInitialTest()
-include/sax/fastattribs.hxx:161
-const char * 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2017-07-22 Thread Noel Grandin
 compilerplugins/clang/unusedfields.readonly.results |4 
 editeng/source/outliner/outleeng.cxx|6 --
 editeng/source/outliner/outleeng.hxx|1 -
 editeng/source/outliner/outliner.cxx|   11 ---
 editeng/source/rtf/svxrtf.cxx   |6 +-
 editeng/source/uno/unoforou.cxx |3 +--
 include/editeng/outliner.hxx|2 --
 include/editeng/svxrtf.hxx  |1 -
 8 files changed, 2 insertions(+), 32 deletions(-)

New commits:
commit 5fad6eb1b38d369f4f7ca401f3c651292667486e
Author: Noel Grandin 
Date:   Fri Jul 21 12:31:18 2017 +0200

loplugin:unusedfields in editeng

Change-Id: I61ddd2ce8ded65251fdf1903e6cb67f0d18c9451
Reviewed-on: https://gerrit.libreoffice.org/40293
Reviewed-by: Noel Grandin 
Tested-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedfields.readonly.results 
b/compilerplugins/clang/unusedfields.readonly.results
index 7d45f9e52041..cd0e14d13418 100644
--- a/compilerplugins/clang/unusedfields.readonly.results
+++ b/compilerplugins/clang/unusedfields.readonly.results
@@ -542,10 +542,6 @@ include/editeng/brushitem.hxx:53
 SvxBrushItem maSecOptions class SvtSecurityOptions
 include/editeng/numitem.hxx:318
 SvxNodeNum nLevelVal sal_uInt16 [10]
-include/editeng/outliner.hxx:610
-Outliner aFieldClickedHdl Link
-include/editeng/svxrtf.hxx:206
-SvxRTFParser bReadDocInfo _Bool
 include/filter/msfilter/svdfppt.hxx:210
 PptSlideLayoutAtom aPlaceholderId enum PptPlaceholder [8]
 include/filter/msfilter/svdfppt.hxx:865
diff --git a/editeng/source/outliner/outleeng.cxx 
b/editeng/source/outliner/outleeng.cxx
index 185bef339690..97b63edf9f3f 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -169,12 +169,6 @@ void OutlinerEditEng::DrawingTab( const Point& rStartPos, 
long nWidth, const OUS
 bEndOfLine, bEndOfParagraph, rOverlineColor, rTextLineColor );
 }
 
-void OutlinerEditEng::FieldClicked( const SvxFieldItem& rField, sal_Int32 
nPara, sal_Int32 nPos )
-{
-EditEngine::FieldClicked( rField, nPara, nPos );// If URL
-pOwner->FieldClicked( rField, nPara, nPos );
-}
-
 OUString OutlinerEditEng::CalcFieldValue( const SvxFieldItem& rField, 
sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor )
 {
 return pOwner->CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor 
);
diff --git a/editeng/source/outliner/outleeng.hxx 
b/editeng/source/outliner/outleeng.hxx
index 093ef2991c8e..2b45610c16d3 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -71,7 +71,6 @@ public:
 // for text conversion
 virtual boolConvertNextDocument() override;
 
-virtual voidFieldClicked( const SvxFieldItem& rField, sal_Int32 
nPara, sal_Int32 nPos ) override;
 virtual OUStringCalcFieldValue( const SvxFieldItem& rField, sal_Int32 
nPara, sal_Int32 nPos, Color*& rTxtColor, Color*& rFldColor ) override;
 
 virtual tools::Rectangle   GetBulletArea( sal_Int32 nPara ) override;
diff --git a/editeng/source/outliner/outliner.cxx 
b/editeng/source/outliner/outliner.cxx
index a1fc3a229b6b..f89d5895a89f 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -632,17 +632,6 @@ void Outliner::AddText( const OutlinerParaObject& rPObj )
 pEditEngine->SetUpdateMode( bUpdate );
 }
 
-void Outliner::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, 
sal_Int32 nPos )
-{
-
-if ( aFieldClickedHdl.IsSet() )
-{
-EditFieldInfo aFldInfo( this, rField, nPara, nPos );
-aFieldClickedHdl.Call(  );
-}
-}
-
-
 OUString Outliner::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 
nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor )
 {
 if ( !aCalcFieldValueHdl.IsSet() )
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index c93841466570..419482a91903 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -72,7 +72,6 @@ SvxRTFParser::SvxRTFParser( SfxItemPool& rPool, SvStream& rIn,
 , bIsSetDfltTab( false)
 , bChkStyleAttr( false )
 , bCalcValue( false )
-, bReadDocInfo( false )
 , bIsLeftToRightDef( true)
 , bIsInReadStyleTab( false)
 {
@@ -214,10 +213,7 @@ INSINGLECHAR:
 bNewGroup = false;
 break;
 case RTF_INFO:
-if (bReadDocInfo && bNewDoc && m_xDocProps.is())
-ReadInfo();
-else
-SkipGroup();
+SkipGroup();
 break;
 
 // !!
diff --git a/editeng/source/uno/unoforou.cxx b/editeng/source/uno/unoforou.cxx
index 050f3c8c85b1..e5f6275c13b3 100644
--- a/editeng/source/uno/unoforou.cxx
+++ 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/oox include/sfx2 include/svtools include/svx include/xmloff oox/source sd/source sfx2/source svtools/source

2017-05-25 Thread Noel Grandin
 compilerplugins/clang/constantparam.bitmask.results  |   42 
 compilerplugins/clang/constantparam.booleans.results | 3040 
 compilerplugins/clang/constantparam.constructors.results |  832 
 compilerplugins/clang/constantparam.numbers.results  | 2804 
 compilerplugins/clang/constantparam.others.results   |292268 
+++
 compilerplugins/clang/constantparam.py   |   18 
 editeng/source/editeng/impedit3.cxx  |6 
 editeng/source/items/svxfont.cxx |   11 
 include/editeng/svxfont.hxx  |2 
 include/oox/vml/vmlshapecontainer.hxx|8 
 include/sfx2/objsh.hxx   |2 
 include/svtools/imap.hxx |8 
 include/svtools/imapcirc.hxx |4 
 include/svtools/imappoly.hxx |4 
 include/svtools/imaprect.hxx |4 
 include/svx/svdotext.hxx |4 
 include/xmloff/numehelp.hxx  |5 
 oox/source/drawingml/shape.cxx   |2 
 oox/source/vml/vmlshape.cxx  |6 
 oox/source/vml/vmlshapecontainer.cxx |   18 
 sd/source/ui/func/fuinsfil.cxx   |2 
 sfx2/source/doc/objmisc.cxx  |   22 
 sfx2/source/doc/objstor.cxx  |2 
 svtools/source/misc/imap.cxx |   16 
 svtools/source/misc/imap2.cxx|   56 
 svx/source/svdraw/svdotxln.cxx   |5 
 vcl/inc/opengl/texture.hxx   |6 
 vcl/inc/unx/fontmanager.hxx  |2 
 vcl/opengl/RenderList.cxx|2 
 vcl/opengl/texture.cxx   |8 
 vcl/unx/generic/fontmanager/fontconfig.cxx   |6 
 vcl/unx/generic/fontmanager/fontmanager.cxx  |6 
 xmloff/source/style/numehelp.cxx |2 
 33 files changed, 299097 insertions(+), 126 deletions(-)

New commits:
commit 4a340e36e8d3713806719351f455711c1254a178
Author: Noel Grandin 
Date:   Wed May 24 14:29:48 2017 +0200

loplugin:constantparam

add the results files so I can just see the diff in future

Change-Id: Ia20a1aa6418be95ed620719cde340c00b7b053e1
Reviewed-on: https://gerrit.libreoffice.org/37988
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/constantparam.bitmask.results 
b/compilerplugins/clang/constantparam.bitmask.results
new file mode 100644
index ..975005fc2817
--- /dev/null
+++ b/compilerplugins/clang/constantparam.bitmask.results
@@ -0,0 +1,42 @@
+codemaker/source/javamaker/classfile.hxx:153
+void codemaker::javamaker::ClassFile::ClassFile(enum 
codemaker::javamaker::ClassFile::AccessFlags,const class rtl::OString &,const 
class rtl::OString &,const class rtl::OString &)
+enum codemaker::javamaker::ClassFile::AccessFlags accessFlags setBits=0x1
+codemaker/source/javamaker/classfile.hxx:168
+void codemaker::javamaker::ClassFile::addField(enum 
codemaker::javamaker::ClassFile::AccessFlags,const class rtl::OString &,const 
class rtl::OString &,unsigned short,const class rtl::OString &)
+enum codemaker::javamaker::ClassFile::AccessFlags accessFlags setBits=0x1
+cui/source/options/webconninfo.hxx:35
+void svx::PasswordTable::InsertHeaderItem(unsigned short,const class 
rtl::OUString &,enum HeaderBarItemBits)
+enum HeaderBarItemBits nBits setBits=0x211 clearBits=0x1ee
+dbaccess/source/filter/xml/xmlExport.hxx:172
+void dbaxml::ODBExport::ODBExport(const class 
com::sun::star::uno::Reference 
&,const class rtl::OUString &,enum SvXMLExportFlags)
+enum SvXMLExportFlags nExportFlag setBits=0x400 clearBits=0x200
+include/framework/framelistanalyzer.hxx:181
+void framework::FrameListAnalyzer::FrameListAnalyzer(const class 
com::sun::star::uno::Reference 
&,const class com::sun::star::uno::Reference &,enum FrameAnalyzerFlags)
+enum FrameAnalyzerFlags eDetectMode setBits=0x4
+include/svl/itemset.hxx:134
+void SfxItemSet::PutExtended(const class SfxItemSet &,enum 
SfxItemState,enum SfxItemState)
+enum SfxItemState eDefaultAs setBits=0x20 clearBits=0xf
+include/svtools/brwbox.hxx:441
+void BrowseBox::InsertDataColumn(unsigned short,const class rtl::OUString 
&,long,enum HeaderBarItemBits,unsigned short)
+enum HeaderBarItemBits nBits setBits=0x410 clearBits=0x3ac
+include/svtools/wizardmachine.hxx:173
+void svt::OWizardMachine::OWizardMachine(class vcl::Window *,enum 
WizardButtonFlags)
+enum WizardButtonFlags _nButtonFlags setBits=0xf
+include/vcl/bitmapex.hxx:82
+

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/svl include/svx sc/inc svl/source svx/source

2017-03-03 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.py   |8 +---
 editeng/source/items/charhiddenitem.cxx  |2 --
 editeng/source/items/frmitems.cxx|3 ---
 editeng/source/items/paraitem.cxx|4 
 editeng/source/items/textitem.cxx|   11 ---
 editeng/source/items/writingmodeitem.cxx |2 --
 include/editeng/bulletitem.hxx   |2 --
 include/editeng/charhiddenitem.hxx   |2 --
 include/editeng/charsetcoloritem.hxx |2 --
 include/editeng/flditem.hxx  |2 --
 include/editeng/flstitem.hxx |2 --
 include/editeng/forbiddenruleitem.hxx|2 --
 include/editeng/frmdiritem.hxx   |2 --
 include/editeng/fwdtitem.hxx |2 --
 include/editeng/hngpnctitem.hxx  |2 --
 include/editeng/lcolitem.hxx |2 --
 include/editeng/nhypitem.hxx |2 --
 include/editeng/nlbkitem.hxx |2 --
 include/editeng/opaqitem.hxx |2 --
 include/editeng/pgrditem.hxx |2 --
 include/editeng/prntitem.hxx |2 --
 include/editeng/prszitem.hxx |2 --
 include/editeng/rsiditem.hxx |2 --
 include/editeng/scriptspaceitem.hxx  |2 --
 include/editeng/scripttypeitem.hxx   |4 
 include/editeng/twolinesitem.hxx |1 -
 include/editeng/udlnitem.hxx |4 
 include/editeng/writingmodeitem.hxx  |2 --
 include/svl/macitem.hxx  |2 --
 include/svx/algitem.hxx  |2 --
 include/svx/xflbckit.hxx |1 -
 include/svx/xflbmpit.hxx |1 -
 include/svx/xflbmsli.hxx |1 -
 include/svx/xflbmsxy.hxx |2 --
 include/svx/xflbmtit.hxx |1 -
 include/svx/xflboxy.hxx  |2 --
 include/svx/xflbstit.hxx |1 -
 include/svx/xflbtoxy.hxx |2 --
 include/svx/xfltrit.hxx  |1 -
 include/svx/xftshtit.hxx |2 --
 include/svx/xgrscit.hxx  |1 -
 include/svx/xlnedcit.hxx |1 -
 include/svx/xlnedwit.hxx |1 -
 include/svx/xlnstcit.hxx |1 -
 include/svx/xlnstwit.hxx |1 -
 include/svx/xlntrit.hxx  |1 -
 include/svx/xsflclit.hxx |1 -
 sc/inc/attrib.hxx|   10 --
 sc/inc/docoptio.hxx  |1 -
 sc/inc/printopt.hxx  |1 -
 sc/inc/viewopti.hxx  |1 -
 svl/source/items/macitem.cxx |3 ---
 svx/source/items/algitem.cxx |1 -
 svx/source/xoutdev/xattr.cxx |9 -
 svx/source/xoutdev/xattr2.cxx|   30 --
 55 files changed, 1 insertion(+), 157 deletions(-)

New commits:
commit 2675f26f1a155257bd1680a1e1a1ba58da8c4452
Author: Noel Grandin 
Date:   Fri Mar 3 11:27:32 2017 +0200

remove unused CreateDefault methods

Change-Id: Ifbdd7d41f0938e9a03693f88416792ff8087f8c2
Reviewed-on: https://gerrit.libreoffice.org/34850
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/compilerplugins/clang/unusedmethods.py 
b/compilerplugins/clang/unusedmethods.py
index c164b6e..d8db1c4 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -197,7 +197,7 @@ for d in definitionSet:
 continue
 if isOtherConstness(d, callSet):
 continue
-# include assignment operators, if we remove them, the compiler creates a 
default one, which can have odd consequences
+# exclude assignment operators, if we remove them, the compiler creates a 
default one, which can have odd consequences
 if "::operator=(" in d[1]:
 continue
 # these are only invoked implicitly, so the plugin does not see the calls
@@ -245,9 +245,6 @@ for d in definitionSet:
continue
 if d[0] == "basic_ostream &" and 
d[1].startswith("operator<<(basic_ostream

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng svx/source

2016-02-09 Thread Stephan Bergmann
 compilerplugins/clang/refcounting.cxx   |1 
 editeng/source/accessibility/AccessibleEditableTextPara.cxx |   16 +--
 editeng/source/accessibility/AccessibleParaManager.cxx  |   13 +-
 include/editeng/AccessibleParaManager.hxx   |   64 +---
 svx/source/accessibility/AccessibleTextHelper.cxx   |   11 --
 5 files changed, 29 insertions(+), 76 deletions(-)

New commits:
commit 5a5dbb31d559fb8d3cf9831863bea1f215a34f3d
Author: Stephan Bergmann 
Date:   Tue Feb 9 18:30:54 2016 +0100

Use rtl::Reference instead of HardCppRef

Change-Id: I089b5caca5e05726105f78aeb00db1869d0a17f4

diff --git a/compilerplugins/clang/refcounting.cxx 
b/compilerplugins/clang/refcounting.cxx
index 7681a6e..61854e4 100644
--- a/compilerplugins/clang/refcounting.cxx
+++ b/compilerplugins/clang/refcounting.cxx
@@ -110,7 +110,6 @@ static std::vector PROBABLY_GOOD_TEMPLATES = {
 "com::sun::star::uno::Reference",
 "com::sun::star::uno::WeakReference",
 "com::sun::star::uno::Sequence",
-"accessibility::HardCppRef",
 "accessibility::WeakCppRef",
 "dba::OAutoRegistration",
 "dba::OSingletonRegistration",
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx 
b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index a51fbba..66080c2 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -258,7 +258,7 @@ namespace accessibility
 
 mnParagraphIndex = nIndex;
 
-WeakBullet::HardRefType aChild( maImageBullet.get() );
+auto aChild( maImageBullet.get() );
 if( aChild.is() )
 aChild->SetParagraphIndex(mnParagraphIndex);
 
@@ -318,7 +318,7 @@ namespace accessibility
 
 void AccessibleEditableTextPara::SetEditSource( SvxEditSourceAdapter* 
pEditSource )
 {
-WeakBullet::HardRefType aChild( maImageBullet.get() );
+auto aChild( maImageBullet.get() );
 if( aChild.is() )
 aChild->SetEditSource(pEditSource);
 
@@ -561,7 +561,7 @@ namespace accessibility
 
 void AccessibleEditableTextPara::SetEEOffset( const Point& rOffset )
 {
-WeakBullet::HardRefType aChild( maImageBullet.get() );
+auto aChild( maImageBullet.get() );
 if( aChild.is() )
 aChild->SetEEOffset(rOffset);
 
@@ -700,7 +700,7 @@ namespace accessibility
   uno::Reference< 
uno::XInterface >
   ( static_cast< 
::cppu::OWeakObject* > (this) ) ); // static_cast: disambiguate hierarchy
 
-WeakBullet::HardRefType aChild( maImageBullet.get() );
+auto aChild( maImageBullet.get() );
 
 if( !aChild.is() )
 {
@@ -713,7 +713,7 @@ namespace accessibility
 uno::Reference< uno::XInterface >
 ( static_cast< 
::cppu::OWeakObject* > (this) ) );
 
-aChild = WeakBullet::HardRefType( xChild, pChild );
+aChild = pChild;
 
 aChild->SetEditSource( () );
 aChild->SetParagraphIndex( GetParagraphIndex() );
@@ -722,7 +722,7 @@ namespace accessibility
 maImageBullet = aChild;
 }
 
-return aChild.getRef();
+return aChild.get();
 }
 
 uno::Reference< XAccessible > SAL_CALL 
AccessibleEditableTextPara::getAccessibleParent() throw (uno::RuntimeException, 
std::exception)
@@ -817,7 +817,7 @@ namespace accessibility
  mpParaManager->IsReferencable( nMyParaIndex - 1 ) )
 {
 uno::Sequence aSequence
-{ mpParaManager->GetChild( nMyParaIndex - 1 
).first.get().getRef() };
+{ static_cast(mpParaManager->GetChild( nMyParaIndex - 1 ).first.get().get()) };
 AccessibleRelation aAccRel( 
AccessibleRelationType::CONTENT_FLOWS_FROM,
 aSequence );
 pAccRelSetHelper->AddRelation( aAccRel );
@@ -828,7 +828,7 @@ namespace accessibility
  mpParaManager->IsReferencable( nMyParaIndex + 1 ) )
 {
 uno::Sequence aSequence
-{ mpParaManager->GetChild( nMyParaIndex + 1 
).first.get().getRef() };
+{ static_cast(mpParaManager->GetChild( nMyParaIndex + 1 ).first.get().get()) };
 AccessibleRelation aAccRel( 
AccessibleRelationType::CONTENT_FLOWS_TO,
 aSequence );
 pAccRelSetHelper->AddRelation( aAccRel );
diff --git a/editeng/source/accessibility/AccessibleParaManager.cxx 
b/editeng/source/accessibility/AccessibleParaManager.cxx
index 30fbdb5..bed5541b 100644
--- a/editeng/source/accessibility/AccessibleParaManager.cxx
+++ 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng

2016-01-22 Thread Noel Grandin
 compilerplugins/clang/sfxpoolitem.cxx |  147 ++
 editeng/source/items/paraitem.cxx |8 +
 include/editeng/pmdlitem.hxx  |1 
 3 files changed, 156 insertions(+)

New commits:
commit 370294f6d1471b89a30c1f8b917cde3830d66b2f
Author: Noel Grandin 
Date:   Tue Dec 8 14:17:07 2015 +0200

new loplugin sfxpoolitem

generates a warning about subclasses that add members but do not
override operator==()

Change-Id: If6df1a2cbd115f17bcca22f9b7995181dcf55c03
Reviewed-on: https://gerrit.libreoffice.org/20468
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/compilerplugins/clang/sfxpoolitem.cxx 
b/compilerplugins/clang/sfxpoolitem.cxx
new file mode 100644
index 000..3248135
--- /dev/null
+++ b/compilerplugins/clang/sfxpoolitem.cxx
@@ -0,0 +1,147 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+
+#include "plugin.hxx"
+#include "compat.hxx"
+#include "clang/AST/CXXInheritance.h"
+
+/*
+what might be more interesting is a warning about subclasses that add
+members but do not override virtual operator==() - that is easily
+forgotten and hard to notice.
+*/
+namespace {
+
+class SfxPoolItem:
+public RecursiveASTVisitor, public loplugin::Plugin
+{
+public:
+explicit SfxPoolItem(InstantiationData const & data): Plugin(data) {}
+
+virtual void run() override { 
TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
+
+bool VisitCXXRecordDecl( const CXXRecordDecl* );
+};
+
+bool BaseCheckNotSfxPoolItemSubclass(
+const CXXRecordDecl *BaseDefinition
+#if __clang_major__ == 3 && __clang_minor__ <= 7
+, void *
+#endif
+)
+{
+if (BaseDefinition && BaseDefinition->getQualifiedNameAsString() == 
"SfxPoolItem") {
+return false;
+}
+return true;
+}
+
+bool isDerivedFromSfxPoolItem(const CXXRecordDecl *decl) {
+if (!decl)
+return false;
+if (decl->getQualifiedNameAsString() == "SfxPoolItem")
+return true;
+if (!decl->hasDefinition()) {
+return false;
+}
+if (// not sure what hasAnyDependentBases() does,
+// but it avoids classes we don't want, e.g. 
WeakAggComponentImplHelper1
+!decl->hasAnyDependentBases() &&
+!compat::forallBases(*decl, BaseCheckNotSfxPoolItemSubclass, nullptr, 
true)) {
+return true;
+}
+return false;
+}
+
+
+bool BaseCheckNotSwMsgPoolItemSubclass(
+const CXXRecordDecl *BaseDefinition
+#if __clang_major__ == 3 && __clang_minor__ <= 7
+, void *
+#endif
+)
+{
+if (BaseDefinition && BaseDefinition->getQualifiedNameAsString() == 
"SwMsgPoolItem") {
+return false;
+}
+return true;
+}
+
+bool isDerivedFromSwMsgPoolItem(const CXXRecordDecl *decl) {
+if (!decl)
+return false;
+if (decl->getQualifiedNameAsString() == "SwMsgPoolItem")
+return true;
+if (!decl->hasDefinition()) {
+return false;
+}
+if (// not sure what hasAnyDependentBases() does,
+// but it avoids classes we don't want, e.g. 
WeakAggComponentImplHelper1
+!decl->hasAnyDependentBases() &&
+!compat::forallBases(*decl, BaseCheckNotSwMsgPoolItemSubclass, 
nullptr, true)) {
+return true;
+}
+return false;
+}
+
+bool endsWith(const string& a, const string& b) {
+if (b.size() > a.size()) return false;
+return std::equal(a.begin() + a.size() - b.size(), a.end(), b.begin());
+}
+
+bool SfxPoolItem::VisitCXXRecordDecl(const CXXRecordDecl* decl)
+{
+if (ignoreLocation(decl)) {
+   return true;
+}
+if (!decl->hasDefinition()) {
+   return true;
+}
+// check if this class is derived from Window
+if (!isDerivedFromSfxPoolItem(decl)) {
+return true;
+}
+// the SwMsgPoolItem are some sort of hack to transport down-castable 
objects to SwClient::Modify(), they're not "real" items
+if (isDerivedFromSwMsgPoolItem(decl)) {
+return true;
+}
+if (decl->field_begin() == decl->field_end()) {
+return true;
+}
+// the enum types do some weird stuff involving SfxEnumItemInterface
+std::string sRecordName = decl->getQualifiedNameAsString();
+if (sRecordName == "SfxEnumItem" || sRecordName == "SfxAllEnumItem")
+return true;
+
+// the new field is only used for reading and writing to storage
+if (sRecordName == "SvxCharSetColorItem")
+return true;
+
+for (auto it = decl->method_begin(); it != decl->method_end(); ++it) {
+if ( endsWith((*it)->getQualifiedNameAsString(), "::operator==") )
+return true;
+}
+ 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng sd/inc sd/source

2015-07-21 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.py|   12 +-
 editeng/source/items/numitem.cxx  |   13 --
 include/editeng/brushitem.hxx |1 
 include/editeng/numitem.hxx   |1 
 sd/inc/CustomAnimationEffect.hxx  |   12 --
 sd/inc/CustomAnimationPreset.hxx  |2 
 sd/inc/EffectMigration.hxx|5 
 sd/inc/Outliner.hxx   |5 
 sd/inc/drawdoc.hxx|1 
 sd/inc/sdabstdlg.hxx  |7 -
 sd/inc/sdattr.hxx |5 
 sd/inc/sddll.hxx  |4 
 sd/inc/sdfilter.hxx   |2 
 sd/inc/sdiocmpt.hxx   |1 
 sd/inc/sdobjfac.hxx   |4 
 sd/inc/sdpage.hxx |5 
 sd/source/ui/animations/CustomAnimationDialog.hxx |1 
 sd/source/ui/animations/SlideTransitionPane.hxx   |1 
 sd/source/ui/annotations/annotationwindow.hxx |6 -
 sd/source/ui/dlg/sddlgfact.cxx|   25 
 sd/source/ui/dlg/sddlgfact.hxx|5 
 sd/source/ui/docshell/sdclient.cxx|3 
 sd/source/ui/framework/configuration/ConfigurationClassifier.cxx  |   13 --
 sd/source/ui/framework/configuration/ConfigurationClassifier.hxx  |   13 --
 sd/source/ui/inc/Client.hxx   |6 -
 sd/source/ui/inc/DrawViewShell.hxx|1 
 sd/source/ui/inc/FrameView.hxx|1 
 sd/source/ui/inc/PaneShells.hxx   |4 
 sd/source/ui/inc/TabControl.hxx   |2 
 sd/source/ui/inc/View.hxx |4 
 sd/source/ui/inc/ViewShell.hxx|2 
 sd/source/ui/inc/ViewShellBase.hxx|1 
 sd/source/ui/inc/Window.hxx   |1 
 sd/source/ui/inc/docprev.hxx  |1 
 sd/source/ui/inc/framework/ResourceId.hxx |5 
 sd/source/ui/inc/fuhhconv.hxx |6 -
 sd/source/ui/inc/fupoor.hxx   |5 
 sd/source/ui/inc/fusearch.hxx |5 
 sd/source/ui/inc/navigatr.hxx |1 
 sd/source/ui/inc/optsitem.hxx |4 
 sd/source/ui/inc/sdtreelb.hxx |1 
 sd/source/ui/inc/sdundogr.hxx |1 
 sd/source/ui/inc/taskpane/ToolPanelViewShell.hxx  |   52 
--
 sd/source/ui/slidesorter/inc/controller/SlideSorterController.hxx |   16 ---
 sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx   |3 
 sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx |   25 
 sd/source/ui/slidesorter/inc/view/SlsLayouter.hxx |5 
 sd/source/ui/slidesorter/view/SlideSorterView.cxx |1 
 sd/source/ui/view/Outliner.cxx|   18 ---
 sd/source/ui/view/ViewShellBase.cxx   |2 
 50 files changed, 11 insertions(+), 309 deletions(-)

New commits:
commit 3d2f43438d4fe6947965a98262b0db42c8d5e680
Author: Noel Grandin n...@peralex.com
Date:   Tue Jul 21 09:05:31 2015 +0200

loplugin:unusedmethods sd

Change-Id: I9b5399ace50db3259df2e619f28ae547a38e6c6d
Reviewed-on: https://gerrit.libreoffice.org/17254
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/compilerplugins/clang/unusedmethods.py 
b/compilerplugins/clang/unusedmethods.py
index cf9ce79..600fcf8 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -64,35 +64,35 @@ exclusionSet = set([
 void oox::drawingml::TextParagraphProperties::dump() const,
 class std::basic_stringchar, struct std::char_traitschar, class 
std::allocatorchar  writerfilter::ooxml::OOXMLPropertySet::toString(),
 # called from the writerfilter generated code in $WORKDIR, not sure why it 
is not being picked up
+_Bool writerfilter::ooxml::OOXMLFactory_ns::getElementId(unsigned 
int,unsigned int,enum writerfilter::ooxml::ResourceType_t ,unsigned int ),
 void 

[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/editeng include/svl svl/source

2015-07-20 Thread Noel Grandin
 compilerplugins/clang/unusedmethods.cxx |9 +
 compilerplugins/clang/unusedmethods.py  |   35 +-
 editeng/source/items/xmlcnitm.cxx   |7 
 include/editeng/xmlcnitm.hxx|2 -
 include/svl/cintitem.hxx|   12 ---
 include/svl/ctypeitm.hxx|2 -
 include/svl/custritm.hxx|2 -
 include/svl/documentlockfile.hxx|3 -
 include/svl/eitem.hxx   |3 -
 include/svl/int64item.hxx   |2 -
 include/svl/intitem.hxx |3 -
 include/svl/poolitem.hxx|1 
 include/svl/style.hxx   |3 -
 include/svl/visitem.hxx |3 -
 svl/source/items/cenumitm.cxx   |8 -
 svl/source/items/cintitem.cxx   |   49 
 svl/source/items/custritm.cxx   |   11 ---
 svl/source/items/int64item.cxx  |   13 
 svl/source/items/intitem.cxx|   12 ---
 svl/source/items/poolitem.cxx   |6 ---
 svl/source/items/visitem.cxx|8 -
 21 files changed, 35 insertions(+), 159 deletions(-)

New commits:
commit 9f4f237a3834e5d58a87296424db5428f68d1550
Author: Noel Grandin n...@peralex.com
Date:   Fri Jul 17 13:08:16 2015 +0200

loplugin:unusedmethods svl

Change-Id: If86cc43fda4d138cf7f678d81fa2b35f68f3c03b
Reviewed-on: https://gerrit.libreoffice.org/17162
Reviewed-by: Noel Grandin noelgran...@gmail.com
Tested-by: Noel Grandin noelgran...@gmail.com

diff --git a/compilerplugins/clang/unusedmethods.cxx 
b/compilerplugins/clang/unusedmethods.cxx
index a137a21..6627fe9 100644
--- a/compilerplugins/clang/unusedmethods.cxx
+++ b/compilerplugins/clang/unusedmethods.cxx
@@ -124,12 +124,19 @@ static bool startsWith(const std::string s, const char* 
other)
 return s.compare(0, strlen(other), other) == 0;
 }
 
-static bool isStandardStuff(const std::string s)
+static bool isStandardStuff(const std::string input)
 {
+std::string s = input;
+if (startsWith(s,class ))
+s = s.substr(6);
+else if (startsWith(s,struct ))
+s = s.substr(7);
 // ignore UNO interface definitions, cannot change those
 return startsWith(s, com::sun::star::)
   // ignore stuff in the C++ stdlib and boost
   || startsWith(s, std::) || startsWith(s, boost::) || 
startsWith(s, class boost::) || startsWith(s, __gnu_debug::)
+  // external library
+  || startsWith(s, mdds::)
   // can't change our rtl layer
   || startsWith(s, rtl::)
   // ignore anonymous namespace stuff, it is compilation-unit-local 
and the compiler will detect any
diff --git a/compilerplugins/clang/unusedmethods.py 
b/compilerplugins/clang/unusedmethods.py
index 2790408..27118b2 100755
--- a/compilerplugins/clang/unusedmethods.py
+++ b/compilerplugins/clang/unusedmethods.py
@@ -57,6 +57,7 @@ exclusionSet = set([
 # instantiated from templates, not sure why it is not being picked up
 class basegfx::B2DPolygon OutputDevice::PixelToLogic(const class 
basegfx::B2DPolygon ,const class MapMode ) const,
 type-parameter-0-0 * detail::cloner::clone(type-parameter-0-0 *const),
+const class rtl::OUString writerperfect::DocumentHandlerFor::name(),
 # only used by OSX build
 void StyleSettings::SetHideDisabledMenuItems(_Bool),
 ])
@@ -87,20 +88,38 @@ for clazz in sorted(definitionSet - callSet - exclusionSet):
  or (clazz.find(::Type()) != -1)):
 continue
 # if this method is const, and there is a non-const variant of it, and the 
non-const variant is in use, then leave it alone
-if (clazz.endswith( const)
-and clazz[6:len(clazz)-6] in definitionSet
-and clazz[6:len(clazz)-6] in callSet):
-   continue
+if (clazz.startswith(const ) and clazz.endswith( const)):
+clazz2 = clazz[6:len(clazz)-12]
+if (clazz2 in callSet):
+   continue
+elif (clazz.endswith( const)):
+clazz2 = clazz[:len(clazz)-6]
+if (clazz2 in callSet):
+   continue
+if (clazz.endswith( const) and clazz.find(::iterator) != -1):
+clazz2 = clazz.replace(::const_iterator, ::iterator)
+clazz2 = clazz2[:len(clazz)-6] # strip off  const
+if (clazz2 in callSet):
+   continue
 # if this method is non-const, and there is a const variant of it, and the 
const variant is in use, then leave it alone
-if ((not clazz.endswith( const))
-and (const  + clazz +  const) in definitionSet
-and (const  + clazz +  const) in callSet):
+if ((not clazz.endswith( const)) and (const  + clazz +  const) in 
callSet):
continue
+if ((not clazz.endswith( const)) and clazz.find(::iterator) != -1):
+clazz2 = clazz.replace(::iterator, ::const_iterator) +  const
+if (clazz2 in callSet):
+   continue
 # There is lots of macro magic