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

Chris Sherlock chris.sherlock79 at gmail.com
Sat Dec 26 11:03:59 PST 2015


 include/svx/ColorSets.hxx             |    4 ++--
 include/svx/Palette.hxx               |   12 +++++++++---
 include/svx/XPropertyEntry.hxx        |    8 ++++----
 svx/source/styles/ColorSets.cxx       |    4 ++--
 svx/source/tbxctrls/Palette.cxx       |   28 ++++++++++++++--------------
 svx/source/xoutdev/XPropertyEntry.cxx |    6 +++---
 6 files changed, 34 insertions(+), 28 deletions(-)

New commits:
commit 422bedb783b9484a7a4b0de5b7ee4634cf6c972c
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Sun Dec 27 02:04:42 2015 +1100

    svx: change instances of maName to more descriptive names
    
    maName is just not descriptive enough and hard to search the source for.
    
    Also in this patch:
    - tracked down what ASE, GPL and SOC stand for and added a comment
    - found instances of aName, local variables and changed these to
      aPaletteName
    
    Change-Id: I4c7eee31b604a8ef2ebef5fd1daa81e193dd7295
    Reviewed-on: https://gerrit.libreoffice.org/20958
    Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
    Tested-by: Chris Sherlock <chris.sherlock79 at gmail.com>

diff --git a/include/svx/ColorSets.hxx b/include/svx/ColorSets.hxx
index b8c32ff..a05097b 100644
--- a/include/svx/ColorSets.hxx
+++ b/include/svx/ColorSets.hxx
@@ -21,7 +21,7 @@ namespace svx
 
 class SVX_DLLPUBLIC ColorSet
 {
-    OUString maName;
+    OUString maColorSetName;
     std::vector<Color> maColors;
 public:
     ColorSet(OUString const & aName);
@@ -34,7 +34,7 @@ public:
 
     const OUString& getName() const
     {
-        return maName;
+        return maColorSetName;
     }
     const Color& getColor(sal_uInt32 nIndex) const
     {
diff --git a/include/svx/Palette.hxx b/include/svx/Palette.hxx
index 9c50899..fa2c179 100644
--- a/include/svx/Palette.hxx
+++ b/include/svx/Palette.hxx
@@ -40,11 +40,13 @@ public:
     virtual bool                IsValid() = 0;
 };
 
+// ASE = Adobe Swatch Exchange
+
 class PaletteASE : public Palette
 {
     bool        mbValidPalette;
     OUString    maFPath;
-    OUString    maName;
+    OUString    maASEPaletteName;
     ColorList   maColors;
 
     void        LoadPalette();
@@ -58,13 +60,15 @@ public:
     virtual bool                IsValid() override;
 };
 
+// GPL - this is *not* GNU Public License, but is the Gimp PaLette
+
 class PaletteGPL : public Palette
 {
     bool        mbLoadedPalette;
     bool        mbValidPalette;
     OUString    maFName;
     OUString    maFPath;
-    OUString    maName;
+    OUString    maGPLPaletteName;
     ColorList   maColors;
 
     bool        ReadPaletteHeader(SvFileStream& rFileStream);
@@ -80,11 +84,13 @@ public:
     virtual bool                IsValid() override;
 };
 
+// SOC - Star Office Color-table
+
 class PaletteSOC : public Palette
 {
     bool            mbLoadedPalette;
     OUString        maFPath;
-    OUString        maName;
+    OUString        maSOCPaletteName;
     XColorListRef   mpColorList;
 public:
     PaletteSOC( const OUString &rFPath, const OUString &rFName );
diff --git a/include/svx/XPropertyEntry.hxx b/include/svx/XPropertyEntry.hxx
index 9859fc0..004aa3f 100644
--- a/include/svx/XPropertyEntry.hxx
+++ b/include/svx/XPropertyEntry.hxx
@@ -29,18 +29,18 @@
 class SVX_DLLPUBLIC XPropertyEntry
 {
 private:
-    OUString maName;
+    OUString maPropEntryName;
     Bitmap   maUiBitmap;
 
 protected:
-    XPropertyEntry(const OUString& rName);
+    XPropertyEntry(const OUString& rPropEntryName);
     XPropertyEntry(const XPropertyEntry& rOther);
 
 public:
     virtual ~XPropertyEntry();
 
-    void SetName(const OUString& rName) { maName = rName; }
-    const OUString& GetName() const { return maName; }
+    void SetName(const OUString& rPropEntryName) { maPropEntryName = rPropEntryName; }
+    const OUString& GetName() const { return maPropEntryName; }
     void SetUiBitmap(const Bitmap& rUiBitmap) { maUiBitmap = rUiBitmap; }
     const Bitmap& GetUiBitmap() const { return maUiBitmap; }
 };
diff --git a/svx/source/styles/ColorSets.cxx b/svx/source/styles/ColorSets.cxx
index 819790a..504ffa0 100644
--- a/svx/source/styles/ColorSets.cxx
+++ b/svx/source/styles/ColorSets.cxx
@@ -13,8 +13,8 @@
 namespace svx
 {
 
-ColorSet::ColorSet(OUString const & aName)
-    : maName(aName)
+ColorSet::ColorSet(OUString const & aColorSetName)
+    : maColorSetName(aColorSetName)
     , maColors(12)
 {}
 
diff --git a/svx/source/tbxctrls/Palette.cxx b/svx/source/tbxctrls/Palette.cxx
index 4fc1f3b..d5e2dd9 100644
--- a/svx/source/tbxctrls/Palette.cxx
+++ b/svx/source/tbxctrls/Palette.cxx
@@ -32,7 +32,7 @@ PaletteASE::~PaletteASE()
 PaletteASE::PaletteASE( const OUString &rFPath, const OUString &rFName ) :
     mbValidPalette( false ),
     maFPath ( rFPath ),
-    maName  ( rFName )
+    maASEPaletteName  ( rFName )
 {
     LoadPalette();
 }
@@ -50,7 +50,7 @@ void PaletteASE::LoadColorSet( SvxColorValueSet& rColorSet )
 
 const OUString& PaletteASE::GetName()
 {
-    return maName;
+    return maASEPaletteName;
 }
 
 bool PaletteASE::IsValid()
@@ -102,19 +102,19 @@ void PaletteASE::LoadPalette()
         aFile.ReadUInt16(nChunkSize);
         aFile.ReadUInt16(nChars);
 
-        OUString aName("");
+        OUString aPaletteName("");
         if (nChars > 1)
-            aName = read_uInt16s_ToOUString(aFile, nChars);
+            aPaletteName = read_uInt16s_ToOUString(aFile, nChars);
         else
             aFile.SeekRel(2);
 
         if (nChunkType == 0xC0010000)
         {
             // Got a start chunk, so set palette name
-            maName = aName;
+            maASEPaletteName = aPaletteName;
             // Is there color data? (shouldn't happen in a start block, but check anyway)
             if (nChunkSize > ((nChars * 2) + 2))
-                aName.clear();
+                aPaletteName.clear();
             else
                 continue;
         }
@@ -158,7 +158,7 @@ void PaletteASE::LoadPalette()
 
         // Ignore color type
         aFile.SeekRel(2);
-        maColors.push_back(std::make_pair(Color(r * 255, g * 255, b * 255), aName));
+        maColors.push_back(std::make_pair(Color(r * 255, g * 255, b * 255), aPaletteName));
     }
 
     mbValidPalette = true;
@@ -183,7 +183,7 @@ PaletteGPL::~PaletteGPL()
 
 const OUString& PaletteGPL::GetName()
 {
-    return maName;
+    return maGPLPaletteName;
 }
 
 void PaletteGPL::LoadColorSet( SvxColorValueSet& rColorSet )
@@ -207,21 +207,21 @@ bool PaletteGPL::IsValid()
 bool PaletteGPL::ReadPaletteHeader(SvFileStream& rFileStream)
 {
     OString aLine;
-    OString aName;
+    OString aPaletteName;
 
     rFileStream.ReadLine(aLine);
     if( !aLine.startsWith("GIMP Palette") ) return false;
     rFileStream.ReadLine(aLine);
-    if( aLine.startsWith("Name: ", &aName) )
+    if( aLine.startsWith("Name: ", &aPaletteName) )
     {
-        maName = OStringToOUString(aName, RTL_TEXTENCODING_ASCII_US);
+        maGPLPaletteName = OStringToOUString(aPaletteName, RTL_TEXTENCODING_ASCII_US);
         rFileStream.ReadLine(aLine);
         if( aLine.startsWith("Columns: "))
             rFileStream.ReadLine(aLine); // we can ignore this
     }
     else
     {
-        maName = maFName;
+        maGPLPaletteName = maFName;
     }
     return true;
 }
@@ -314,7 +314,7 @@ OString lcl_getToken(const OString& rStr, sal_Int32& index)
 PaletteSOC::PaletteSOC( const OUString &rFPath, const OUString &rFName ) :
     mbLoadedPalette( false ),
     maFPath( rFPath ),
-    maName( rFName )
+    maSOCPaletteName( rFName )
 {
 }
 
@@ -324,7 +324,7 @@ PaletteSOC::~PaletteSOC()
 
 const OUString& PaletteSOC::GetName()
 {
-    return maName;
+    return maSOCPaletteName;
 }
 
 void PaletteSOC::LoadColorSet( SvxColorValueSet& rColorSet )
diff --git a/svx/source/xoutdev/XPropertyEntry.cxx b/svx/source/xoutdev/XPropertyEntry.cxx
index 62ae82d..4c29e4f3 100644
--- a/svx/source/xoutdev/XPropertyEntry.cxx
+++ b/svx/source/xoutdev/XPropertyEntry.cxx
@@ -19,14 +19,14 @@
 
 #include <svx/XPropertyEntry.hxx>
 
-XPropertyEntry::XPropertyEntry(const OUString& rName)
-:   maName(rName),
+XPropertyEntry::XPropertyEntry(const OUString& rPropEntryName)
+:   maPropEntryName(rPropEntryName),
     maUiBitmap()
 {
 }
 
 XPropertyEntry::XPropertyEntry(const XPropertyEntry& rOther)
-:   maName(rOther.maName),
+:   maPropEntryName(rOther.maPropEntryName),
     maUiBitmap(rOther.maUiBitmap)
 {
 }


More information about the Libreoffice-commits mailing list