[Libreoffice-commits] core.git: sw/inc sw/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Feb 27 08:09:40 UTC 2018


 sw/inc/docufld.hxx                 |   14 +++++++-------
 sw/source/core/fields/docufld.cxx  |    6 +++---
 sw/source/core/fields/scrptfld.cxx |   28 ++++++++++++++--------------
 sw/source/core/inc/wrong.hxx       |   10 +++++-----
 sw/source/core/text/wrong.cxx      |   36 ++++++++++++++++++------------------
 5 files changed, 47 insertions(+), 47 deletions(-)

New commits:
commit 78233e47d07d89d656ef75b534272f71ea540572
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Feb 26 09:11:44 2018 +0100

    sw: prefix members of SwScriptField, SwTemplNameField and SwWrongList
    
    Change-Id: Ia82df7c6c8260c90f76d77355b70b8589978b9c2
    Reviewed-on: https://gerrit.libreoffice.org/50341
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx
index 0cc2cce18d2c..6d7fcd2f95c9 100644
--- a/sw/inc/docufld.hxx
+++ b/sw/inc/docufld.hxx
@@ -223,7 +223,7 @@ public:
 
 class SwTemplNameFieldType : public SwFieldType
 {
-    SwDoc *pDoc;
+    SwDoc *m_pDoc;
 public:
     SwTemplNameFieldType(SwDoc*);
 
@@ -668,7 +668,7 @@ public:
 
 class SwScriptFieldType : public SwFieldType
 {
-    SwDoc* pDoc;
+    SwDoc* m_pDoc;
 public:
     SwScriptFieldType( SwDoc* pDoc );
 
@@ -677,11 +677,11 @@ public:
 
 class SwScriptField : public SwField
 {
-    OUString sType;  ///< Type of Code (Java/VBScript/...)
-    OUString sCode;  /**< Code as text.
+    OUString m_sType;  ///< Type of Code (Java/VBScript/...)
+    OUString m_sCode;  /**< Code as text.
                           Code as JavaCode ? */
 
-    bool    bCodeURL; ///< Code contains URL of a script.
+    bool    m_bCodeURL; ///< Code contains URL of a script.
 
 public:
     SwScriptField( SwScriptFieldType*, const OUString& rType,
@@ -699,8 +699,8 @@ public:
     virtual OUString   GetPar2() const override;
     virtual void            SetPar2(const OUString& rStr) override;
 
-    bool                    IsCodeURL() const { return bCodeURL; }
-    void                    SetCodeURL( bool bURL ) { bCodeURL = bURL; }
+    bool                    IsCodeURL() const { return m_bCodeURL; }
+    void                    SetCodeURL( bool bURL ) { m_bCodeURL = bURL; }
     virtual bool        QueryValue( css::uno::Any& rVal, sal_uInt16 nWhich ) const override;
     virtual bool        PutValue( const css::uno::Any& rVal, sal_uInt16 nWhich ) override;
 };
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx
index dd97dd56f37c..52abab26fe30 100644
--- a/sw/source/core/fields/docufld.cxx
+++ b/sw/source/core/fields/docufld.cxx
@@ -571,7 +571,7 @@ bool SwFileNameField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
 SwTemplNameFieldType::SwTemplNameFieldType(SwDoc *pDocument)
     : SwFieldType( SwFieldIds::TemplateName )
 {
-    pDoc = pDocument;
+    m_pDoc = pDocument;
 }
 
 OUString SwTemplNameFieldType::Expand(sal_uLong nFormat) const
@@ -579,7 +579,7 @@ OUString SwTemplNameFieldType::Expand(sal_uLong nFormat) const
     OSL_ENSURE( nFormat < FF_END, "Expand: no valid Format!" );
 
     OUString aRet;
-    SwDocShell *pDocShell(pDoc->GetDocShell());
+    SwDocShell *pDocShell(m_pDoc->GetDocShell());
     OSL_ENSURE(pDocShell, "no SwDocShell");
     if (pDocShell) {
         uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
@@ -626,7 +626,7 @@ OUString SwTemplNameFieldType::Expand(sal_uLong nFormat) const
 
 SwFieldType* SwTemplNameFieldType::Copy() const
 {
-    SwFieldType *pTmp = new SwTemplNameFieldType(pDoc);
+    SwFieldType *pTmp = new SwTemplNameFieldType(m_pDoc);
     return pTmp;
 }
 
diff --git a/sw/source/core/fields/scrptfld.cxx b/sw/source/core/fields/scrptfld.cxx
index fd9d89c5625b..8f26608090fd 100644
--- a/sw/source/core/fields/scrptfld.cxx
+++ b/sw/source/core/fields/scrptfld.cxx
@@ -25,18 +25,18 @@
 using namespace ::com::sun::star;
 
 SwScriptFieldType::SwScriptFieldType( SwDoc* pD )
-    : SwFieldType( SwFieldIds::Script ), pDoc( pD )
+    : SwFieldType( SwFieldIds::Script ), m_pDoc( pD )
 {}
 
 SwFieldType* SwScriptFieldType::Copy() const
 {
-    return new SwScriptFieldType( pDoc );
+    return new SwScriptFieldType( m_pDoc );
 }
 
 SwScriptField::SwScriptField( SwScriptFieldType* pInitType,
                                 const OUString& rType, const OUString& rCode,
                                 bool bURL )
-    : SwField( pInitType ), sType( rType ), sCode( rCode ), bCodeURL( bURL )
+    : SwField( pInitType ), m_sType( rType ), m_sCode( rCode ), m_bCodeURL( bURL )
 {
 }
 
@@ -52,29 +52,29 @@ OUString SwScriptField::Expand() const
 
 SwField* SwScriptField::Copy() const
 {
-    return new SwScriptField( static_cast<SwScriptFieldType*>(GetTyp()), sType, sCode, bCodeURL );
+    return new SwScriptField( static_cast<SwScriptFieldType*>(GetTyp()), m_sType, m_sCode, m_bCodeURL );
 }
 
 /// set type
 void SwScriptField::SetPar1( const OUString& rStr )
 {
-    sType = rStr;
+    m_sType = rStr;
 }
 
 OUString SwScriptField::GetPar1() const
 {
-    return sType;
+    return m_sType;
 }
 
 /// set code
 void SwScriptField::SetPar2( const OUString& rStr )
 {
-    sCode = rStr;
+    m_sCode = rStr;
 }
 
 OUString SwScriptField::GetPar2() const
 {
-    return sCode;
+    return m_sCode;
 }
 
 bool SwScriptField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
@@ -82,13 +82,13 @@ bool SwScriptField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const
     switch( nWhichId )
     {
     case FIELD_PROP_PAR1:
-        rAny <<= sType;
+        rAny <<= m_sType;
         break;
     case FIELD_PROP_PAR2:
-        rAny <<= sCode;
+        rAny <<= m_sCode;
         break;
     case FIELD_PROP_BOOL1:
-        rAny <<= bCodeURL;
+        rAny <<= m_bCodeURL;
         break;
     default:
         assert(false);
@@ -101,13 +101,13 @@ bool SwScriptField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId )
     switch( nWhichId )
     {
     case FIELD_PROP_PAR1:
-        rAny >>= sType;
+        rAny >>= m_sType;
         break;
     case FIELD_PROP_PAR2:
-        rAny >>= sCode;
+        rAny >>= m_sCode;
         break;
     case FIELD_PROP_BOOL1:
-        bCodeURL = *o3tl::doAccess<bool>(rAny);
+        m_bCodeURL = *o3tl::doAccess<bool>(rAny);
         break;
     default:
         assert(false);
diff --git a/sw/source/core/inc/wrong.hxx b/sw/source/core/inc/wrong.hxx
index 54eb27e68022..fc44c6db8ead 100644
--- a/sw/source/core/inc/wrong.hxx
+++ b/sw/source/core/inc/wrong.hxx
@@ -181,8 +181,8 @@ class SwWrongList
     std::vector<SwWrongArea> maList;
     WrongListType            meType;
 
-    sal_Int32 nBeginInvalid;   // Start of the invalid range
-    sal_Int32 nEndInvalid;     // End of the invalid range
+    sal_Int32 mnBeginInvalid;   // Start of the invalid range
+    sal_Int32 mnEndInvalid;     // End of the invalid range
 
     static void ShiftLeft( sal_Int32 &rPos, sal_Int32 nStart, sal_Int32 nEnd )
     { if( rPos > nStart ) rPos = rPos > nEnd ? rPos - nEnd + nStart : nStart; }
@@ -202,10 +202,10 @@ public:
     virtual void CopyFrom( const SwWrongList& rCopy );
 
     WrongListType GetWrongListType() const { return meType; }
-    sal_Int32 GetBeginInv() const { return nBeginInvalid; }
-    sal_Int32 GetEndInv() const { return nEndInvalid; }
+    sal_Int32 GetBeginInv() const { return mnBeginInvalid; }
+    sal_Int32 GetEndInv() const { return mnEndInvalid; }
     void SetInvalid( sal_Int32 nBegin, sal_Int32 nEnd );
-    void Validate(){ nBeginInvalid = nEndInvalid = COMPLETE_STRING; }
+    void Validate(){ mnBeginInvalid = mnEndInvalid = COMPLETE_STRING; }
     void Invalidate( sal_Int32 nBegin, sal_Int32 nEnd );
     bool InvalidateWrong();
     enum class FreshState { FRESH, CURSOR, NOTHING };
diff --git a/sw/source/core/text/wrong.cxx b/sw/source/core/text/wrong.cxx
index 3968bce1c1e5..20fdac821985 100644
--- a/sw/source/core/text/wrong.cxx
+++ b/sw/source/core/text/wrong.cxx
@@ -48,8 +48,8 @@ SwWrongArea::SwWrongArea( const OUString& rType,
 
 SwWrongList::SwWrongList( WrongListType eType ) :
     meType       (eType),
-    nBeginInvalid(COMPLETE_STRING),  // everything correct... (the invalid area starts beyond the string)
-    nEndInvalid  (COMPLETE_STRING)
+    mnBeginInvalid(COMPLETE_STRING),  // everything correct... (the invalid area starts beyond the string)
+    mnEndInvalid  (COMPLETE_STRING)
 {
     maList.reserve( 5 );
 }
@@ -70,8 +70,8 @@ void SwWrongList::CopyFrom( const SwWrongList& rCopy )
 {
     maList = rCopy.maList;
     meType = rCopy.meType;
-    nBeginInvalid = rCopy.nBeginInvalid;
-    nEndInvalid = rCopy.nEndInvalid;
+    mnBeginInvalid = rCopy.mnBeginInvalid;
+    mnEndInvalid = rCopy.mnEndInvalid;
     for(SwWrongArea & i : maList)
     {
         if( i.mpSubList )
@@ -248,15 +248,15 @@ sal_uInt16 SwWrongList::GetWrongPos( sal_Int32 nValue ) const
 void SwWrongList::Invalidate_( sal_Int32 nBegin, sal_Int32 nEnd )
 {
     if ( nBegin < GetBeginInv() )
-        nBeginInvalid = nBegin;
+        mnBeginInvalid = nBegin;
     if ( nEnd > GetEndInv() || GetEndInv() == COMPLETE_STRING )
-        nEndInvalid = nEnd;
+        mnEndInvalid = nEnd;
 }
 
 void SwWrongList::SetInvalid( sal_Int32 nBegin, sal_Int32 nEnd )
 {
-    nBeginInvalid = nBegin;
-    nEndInvalid = nEnd;
+    mnBeginInvalid = nBegin;
+    mnEndInvalid = nEnd;
 }
 
 /** Change all values after the given position.
@@ -301,9 +301,9 @@ void SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
             SetInvalid( nPos ? nPos - 1 : nPos, nPos + 1 );
         else
         {
-            ShiftLeft( nBeginInvalid, nPos, nEnd );
-            if( nEndInvalid != COMPLETE_STRING )
-                ShiftLeft( nEndInvalid, nPos, nEnd );
+            ShiftLeft( mnBeginInvalid, nPos, nEnd );
+            if( mnEndInvalid != COMPLETE_STRING )
+                ShiftLeft( mnEndInvalid, nPos, nEnd );
             Invalidate_( nPos ? nPos - 1 : nPos, nPos + 1 );
         }
     }
@@ -312,10 +312,10 @@ void SwWrongList::Move( sal_Int32 nPos, sal_Int32 nDiff )
         const sal_Int32 nEnd = nPos + nDiff;
         if( COMPLETE_STRING != GetBeginInv() )
         {
-            if( nBeginInvalid > nPos )
-                nBeginInvalid += nDiff;
-            if( nEndInvalid >= nPos && nEndInvalid != COMPLETE_STRING )
-                nEndInvalid += nDiff;
+            if( mnBeginInvalid > nPos )
+                mnBeginInvalid += nDiff;
+            if( mnEndInvalid >= nPos && mnEndInvalid != COMPLETE_STRING )
+                mnEndInvalid += nDiff;
         }
         // If the pointer is in the middle of a wrong word,
         // invalidation must happen from the beginning of that word.
@@ -477,9 +477,9 @@ SwWrongList* SwWrongList::SplitList( sal_Int32 nSplitPos )
         SetInvalid( 0, 1 );
     else
     {
-        ShiftLeft( nBeginInvalid, 0, nSplitPos );
-        if( nEndInvalid != COMPLETE_STRING )
-            ShiftLeft( nEndInvalid, 0, nSplitPos );
+        ShiftLeft( mnBeginInvalid, 0, nSplitPos );
+        if( mnEndInvalid != COMPLETE_STRING )
+            ShiftLeft( mnEndInvalid, 0, nSplitPos );
         Invalidate_( 0, 1 );
     }
     for (nLst = 0; nLst < Count(); ++nLst )


More information about the Libreoffice-commits mailing list