compilerplugins/clang/singlevalfields.cxx     |   14 ++++++++----
 compilerplugins/clang/singlevalfields.results |   25 +++++++++++++++-------
 include/tools/multisel.hxx                    |    1 
 include/unotools/textsearch.hxx               |    9 --------
 sw/source/core/inc/swfont.hxx                 |    2 -
 sw/source/core/text/itrform2.cxx              |    8 -------
 sw/source/core/text/itrpaint.cxx              |    3 --
 sw/source/core/text/pormulti.cxx              |    3 --
 sw/source/core/txtnode/swfont.cxx             |    3 --
 tools/source/memtools/multisel.cxx            |   29 +++++++-------------------
 unotools/source/i18n/textsearch.cxx           |   15 -------------
 11 files changed, 37 insertions(+), 75 deletions(-)

New commits:
commit 1b666235f6b0b0f0b13f473bf3b639f4f5f0b12f
Author: Noel Grandin <noel.gran...@collabora.co.uk>
Date:   Wed Jan 3 09:08:52 2018 +0200

    loplugin:singlevalfields improve copy constructor check
    
    Change-Id: Id1e7fbecd9e9f816553d2e678c3f1b7890fc4db8
    Reviewed-on: https://gerrit.libreoffice.org/47293
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/compilerplugins/clang/singlevalfields.cxx 
b/compilerplugins/clang/singlevalfields.cxx
index 61cfe044d1fd..83733b7a0041 100644
--- a/compilerplugins/clang/singlevalfields.cxx
+++ b/compilerplugins/clang/singlevalfields.cxx
@@ -142,7 +142,7 @@ bool SingleValFields::VisitCXXConstructorDecl( const 
CXXConstructorDecl* decl )
 
     // doesn't count as a write to fields because it's self->self
     if (decl->isCopyOrMoveConstructor())
-            return true;
+        return true;
 
     for(auto it = decl->init_begin(); it != decl->init_end(); ++it)
     {
@@ -246,9 +246,15 @@ bool SingleValFields::VisitMemberExpr( const MemberExpr* 
memberExpr )
         return true;
 
     const FunctionDecl* parentFunction = getParentFunctionDecl(memberExpr);
-    const CXXMethodDecl* methodDecl = 
dyn_cast_or_null<CXXMethodDecl>(parentFunction);
-    if (methodDecl && (methodDecl->isCopyAssignmentOperator() || 
methodDecl->isMoveAssignmentOperator()))
-       return true;
+    if (parentFunction)
+    {
+        auto methodDecl = dyn_cast<CXXMethodDecl>(parentFunction);
+        if (methodDecl && (methodDecl->isCopyAssignmentOperator() || 
methodDecl->isMoveAssignmentOperator()))
+           return true;
+        auto cxxConstructorDecl = dyn_cast<CXXConstructorDecl>(parentFunction);
+        if (cxxConstructorDecl && 
cxxConstructorDecl->isCopyOrMoveConstructor())
+           return true;
+    }
 
     // walk up the tree until we find something interesting
     const Stmt* child = memberExpr;
diff --git a/compilerplugins/clang/singlevalfields.results 
b/compilerplugins/clang/singlevalfields.results
index 823de7ba50d7..d54fac80e7c9 100644
--- a/compilerplugins/clang/singlevalfields.results
+++ b/compilerplugins/clang/singlevalfields.results
@@ -25,6 +25,18 @@ include/svtools/svparser.hxx:74
 include/svtools/svparser.hxx:75
     SvParser::TokenStackType bTokenHasValue
     0
+include/tools/multisel.hxx:41
+    MultiSelection bInverseCur
+    0
+include/unotools/textsearch.hxx:104
+    utl::SearchParam m_bWordOnly
+    0
+include/unotools/textsearch.hxx:105
+    utl::SearchParam m_bSrchInSel
+    0
+include/unotools/textsearch.hxx:110
+    utl::SearchParam nTransliterationFlags
+    0
 include/vcl/filter/pdfdocument.hxx:173
     vcl::filter::PDFNameElement m_nLength
     0
@@ -67,9 +79,6 @@ sc/inc/compiler.hxx:108
 sc/qa/unit/ucalc.hxx:41
     Test::RangeNameDef mnIndex
     1
-sc/source/ui/inc/undodat.hxx:447
-    ScUndoDataForm nStartChangeAction
-    0
 sd/inc/sdpptwrp.hxx:42
     SdPPTFilter pBas
     0
@@ -109,6 +118,9 @@ sw/inc/pagepreviewlayout.hxx:49
 sw/source/core/inc/frmtool.hxx:260
     SwBorderAttrs m_bBorderDist
     1
+sw/source/core/inc/swfont.hxx:170
+    SwFont m_bURL
+    0
 sw/source/core/inc/UndoSort.hxx:38
     SwSortUndoElement::(anonymous union)::(anonymous) nKenn
     4294967295
@@ -133,9 +145,6 @@ sw/source/filter/ww8/ww8par.hxx:651
 sw/source/filter/ww8/ww8par.hxx:660
     WW8FormulaControl mhpsCheckBox
     20
-sw/source/uibase/lingu/sdrhhcwrap.hxx:33
-    SdrHHCWrapper pTextObj
-    0
 vcl/inc/salprn.hxx:41
     SalPrinterQueueInfo mnStatus
     0
@@ -169,10 +178,10 @@ vcl/source/filter/jpeg/transupp.h:131
 vcl/source/font/font.cxx:539
     (anonymous namespace)::WeightSearchEntry weight
     5
-vcl/source/gdi/pdfwriter_impl.hxx:706
+vcl/source/gdi/pdfwriter_impl.hxx:705
     vcl::PDFWriterImpl m_nInheritedPageWidth
     595
-vcl/source/gdi/pdfwriter_impl.hxx:707
+vcl/source/gdi/pdfwriter_impl.hxx:706
     vcl::PDFWriterImpl m_nInheritedPageHeight
     842
 writerfilter/source/dmapper/GraphicImport.cxx:223
diff --git a/include/tools/multisel.hxx b/include/tools/multisel.hxx
index 903423ae5d9c..854be3768afb 100644
--- a/include/tools/multisel.hxx
+++ b/include/tools/multisel.hxx
@@ -38,7 +38,6 @@ private:
     sal_Int32       nCurSubSel; // index in aSels of current selected index
     sal_Int32       nCurIndex;  // current selected entry
     sal_Int32       nSelCount;  // number of selected indexes
-    bool            bInverseCur;// inverse cursor
     bool            bCurValid;  // are nCurIndex and nCurSubSel valid
 
     TOOLS_DLLPRIVATE void           ImplClear();
diff --git a/include/unotools/textsearch.hxx b/include/unotools/textsearch.hxx
index b7b3250253af..5571fca7c15f 100644
--- a/include/unotools/textsearch.hxx
+++ b/include/unotools/textsearch.hxx
@@ -101,14 +101,9 @@ private:
 
     sal_uInt32 m_cWildEscChar;      // wildcard escape character
 
-    bool m_bWordOnly   : 1;        // used by normal search
-    bool m_bSrchInSel  : 1;        // search only in the selection
     bool m_bCaseSense  : 1;
     bool m_bWildMatchSel : 1;       // wildcard pattern must match entire 
selection
 
-    // asian flags - used for the transliteration
-    TransliterationFlags nTransliterationFlags;
-
 public:
     SearchParam( const OUString &rText,
                     SearchType eSrchType,
@@ -125,14 +120,10 @@ public:
     SearchType      GetSrchType() const         { return m_eSrchType; }
 
     bool            IsCaseSensitive() const     { return m_bCaseSense; }
-    bool            IsSrchInSelection() const   { return m_bSrchInSel; }
-    bool            IsSrchWordOnly() const      { return m_bWordOnly; }
     bool            IsWildMatchSel() const      { return m_bWildMatchSel; }
 
     // signed return for API use
     sal_Int32       GetWildEscChar() const      { return 
static_cast<sal_Int32>(m_cWildEscChar); }
-
-    TransliterationFlags GetTransliterationFlags() const        { return 
nTransliterationFlags; }
 };
 
 // For use in SAL_DEBUG etc. Output format not guaranteed to be stable.
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index ee377c50c6fd..3049a9478704 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -167,7 +167,6 @@ class SW_DLLPUBLIC SwFont
     bool m_bPaintBlank    :1;  // blanks not with DrawRect
     bool m_bFontChg       :1;
     bool m_bOrgChg        :1;  // nOrgHeight/Ascent are invalid
-    bool m_bURL           :1;
     bool m_bGreyWave      :1;  // for the extended TextInput: gray waveline
 
 public:
@@ -255,7 +254,6 @@ public:
     bool IsMeta() const { return (0 != m_nMetaCount); }
     sal_uInt8 &GetInputField() { return m_nInputFieldCount; }
     bool IsInputField() const { return (0 != m_nInputFieldCount); }
-    bool IsURL() const { return m_bURL; }
     inline void SetGreyWave( const bool bNew );
     bool IsGreyWave() const { return m_bGreyWave; }
     bool IsPaintBlank() const { return m_bPaintBlank; }
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index e43cec544a02..04a1e3c46bee 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -907,16 +907,10 @@ SwTextPortion *SwTextFormatter::WhichTextPor( 
SwTextFormatInfo &rInf ) const
             }
             if( !pPor )
             {
-                if( !rInf.X() && !m_pCurr->GetPortion() && !m_pCurr->GetLen() 
&& !GetFnt()->IsURL() )
+                if( !rInf.X() && !m_pCurr->GetPortion() && !m_pCurr->GetLen() )
                     pPor = m_pCurr;
                 else
-                {
                     pPor = new SwTextPortion;
-                    if ( GetFnt()->IsURL() )
-                    {
-                        pPor->SetWhichPor( POR_URL );
-                    }
-                }
             }
         }
     }
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 2d309b26db6e..81697a3ab425 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -398,9 +398,6 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
         // reset (for special vertical alignment)
         GetInfo().Y( nOldY );
 
-        if( GetFnt()->IsURL() && pPor->InTextGrp() )
-            GetInfo().NotifyURL( *pPor );
-
         bFirst &= !pPor->GetLen();
         if( pNext || !pPor->IsMarginPortion() )
             pPor->Move( GetInfo() );
diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx
index ae02157fff19..b35760f763ba 100644
--- a/sw/source/core/text/pormulti.cxx
+++ b/sw/source/core/text/pormulti.cxx
@@ -1489,9 +1489,6 @@ void SwTextPainter::PaintMultiPortion( const SwRect 
&rPaint,
         else
             pPor->Paint( GetInfo() );
 
-        if( GetFnt()->IsURL() && pPor->InTextGrp() )
-            GetInfo().NotifyURL( *pPor );
-
         bFirst &= !pPor->GetLen();
         if( pNext || !pPor->IsMarginPortion() )
             pPor->Move( GetInfo() );
diff --git a/sw/source/core/txtnode/swfont.cxx 
b/sw/source/core/txtnode/swfont.cxx
index eddc2054fac9..b065ff5964ae 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -722,7 +722,6 @@ SwFont::SwFont( const SwFont &rFont )
     m_bFontChg = rFont.m_bFontChg;
     m_bOrgChg = rFont.m_bOrgChg;
     m_bPaintBlank = rFont.m_bPaintBlank;
-    m_bURL = rFont.m_bURL;
     m_bGreyWave = rFont.m_bGreyWave;
     m_bBlink = rFont.m_bBlink;
 }
@@ -737,7 +736,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
     m_nMetaCount = 0;
     m_nInputFieldCount = 0;
     m_bPaintBlank = false;
-    m_bURL = false;
     m_bGreyWave = false;
     m_bBlink = pAttrSet->GetBlink().GetValue();
     m_bOrgChg = true;
@@ -920,7 +918,6 @@ SwFont& SwFont::operator=( const SwFont &rFont )
     m_bFontChg = rFont.m_bFontChg;
     m_bOrgChg = rFont.m_bOrgChg;
     m_bPaintBlank = rFont.m_bPaintBlank;
-    m_bURL = rFont.m_bURL;
     m_bGreyWave = rFont.m_bGreyWave;
     m_bBlink = rFont.m_bBlink;
     return *this;
diff --git a/tools/source/memtools/multisel.cxx 
b/tools/source/memtools/multisel.cxx
index ae26b2e3cf38..d53ce8004e9c 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -66,7 +66,6 @@ MultiSelection::MultiSelection():
     nCurSubSel(0),
     nCurIndex(0),
     nSelCount(0),
-    bInverseCur(false),
     bCurValid(false)
 {
 }
@@ -88,13 +87,11 @@ MultiSelection::MultiSelection( const MultiSelection& rOrig 
) :
     {
         nCurSubSel = rOrig.nCurSubSel;
         nCurIndex = rOrig.nCurIndex;
-        bInverseCur = rOrig.bInverseCur;
     }
     else
     {
         nCurSubSel = 0;
         nCurIndex = 0;
-        bInverseCur = false;
     }
 
     // copy the sub selections
@@ -107,7 +104,6 @@ MultiSelection::MultiSelection( const Range& rRange ):
     nCurSubSel(0),
     nCurIndex(0),
     nSelCount(0),
-    bInverseCur(false),
     bCurValid(false)
 {
 }
@@ -421,7 +417,6 @@ sal_Int32 MultiSelection::ImplFwdUnselected()
 
 sal_Int32 MultiSelection::FirstSelected()
 {
-    bInverseCur = false;
     nCurSubSel = 0;
 
     bCurValid = !aSels.empty();
@@ -447,24 +442,16 @@ sal_Int32 MultiSelection::NextSelected()
     if ( !bCurValid )
         return SFX_ENDOFSELECTION;
 
-    if ( bInverseCur )
-    {
-        ++nCurIndex;
-        return ImplFwdUnselected();
-    }
-    else
-    {
-        // is the next index in the current sub selection too?
-        if ( nCurIndex < aSels[ nCurSubSel ]->Max() )
-            return ++nCurIndex;
+    // is the next index in the current sub selection too?
+    if ( nCurIndex < aSels[ nCurSubSel ]->Max() )
+        return ++nCurIndex;
 
-        // are there further sub selections?
-        if ( ++nCurSubSel < sal_Int32(aSels.size()) )
-            return nCurIndex = aSels[ nCurSubSel ]->Min();
+    // are there further sub selections?
+    if ( ++nCurSubSel < sal_Int32(aSels.size()) )
+        return nCurIndex = aSels[ nCurSubSel ]->Min();
 
-        // we are at the end!
-        return SFX_ENDOFSELECTION;
-    }
+    // we are at the end!
+    return SFX_ENDOFSELECTION;
 }
 
 void MultiSelection::SetTotalRange( const Range& rTotRange )
diff --git a/unotools/source/i18n/textsearch.cxx 
b/unotools/source/i18n/textsearch.cxx
index f1191f43c6c0..bcf9efc4d718 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -53,12 +53,8 @@ SearchParam::SearchParam( const OUString &rText,
 
     m_cWildEscChar  = cWildEscChar;
 
-    m_bWordOnly     = false;
-    m_bSrchInSel    = false;
     m_bCaseSense    = bCaseSensitive;
     m_bWildMatchSel = bWildMatchSel;
-
-    nTransliterationFlags = TransliterationFlags::NONE;
 }
 
 SearchParam::SearchParam( const SearchParam& rParam )
@@ -69,12 +65,8 @@ SearchParam::SearchParam( const SearchParam& rParam )
 
     m_cWildEscChar  = rParam.m_cWildEscChar;
 
-    m_bWordOnly     = rParam.m_bWordOnly;
-    m_bSrchInSel    = rParam.m_bSrchInSel;
     m_bCaseSense    = rParam.m_bCaseSense;
     m_bWildMatchSel = rParam.m_bWildMatchSel;
-
-    nTransliterationFlags = rParam.nTransliterationFlags;
 }
 
 SearchParam::~SearchParam() {}
@@ -200,16 +192,11 @@ void TextSearch::Init( const SearchParam & rParam,
     case SearchParam::SearchType::Regexp:
         aSOpt.AlgorithmType2 = SearchAlgorithms2::REGEXP;
         aSOpt.algorithmType = SearchAlgorithms_REGEXP;
-        if( rParam.IsSrchInSelection() )
-            aSOpt.searchFlag |= SearchFlags::REG_NOT_BEGINOFLINE |
-                                SearchFlags::REG_NOT_ENDOFLINE;
         break;
 
     case SearchParam::SearchType::Normal:
         aSOpt.AlgorithmType2 = SearchAlgorithms2::ABSOLUTE;
         aSOpt.algorithmType = SearchAlgorithms_ABSOLUTE;
-        if( rParam.IsSrchWordOnly() )
-            aSOpt.searchFlag |= SearchFlags::NORM_WORD_ONLY;
         break;
 
     default:
@@ -218,7 +205,7 @@ void TextSearch::Init( const SearchParam & rParam,
     aSOpt.searchString = rParam.GetSrchStr();
     aSOpt.replaceString = rParam.GetReplaceStr();
     aSOpt.Locale = rLocale;
-    aSOpt.transliterateFlags = rParam.GetTransliterationFlags();
+    aSOpt.transliterateFlags = TransliterationFlags::NONE;
     if( !rParam.IsCaseSensitive() )
     {
         aSOpt.searchFlag |= SearchFlags::ALL_IGNORE_CASE;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to