Commits

Anonymous committed 2152f6e

Cleaned up the header declaration, turned inline methods into regular methods, and added copy c'tor.

  • Participants
  • Parent commits 289ecae

Comments (0)

Files changed (2)

File sc/inc/phonetic.hxx

 class SC_DLLPUBLIC ScPhonetic
 {
 public:
-	ScPhonetic() : mnFontIdx( 0 ), mnAdditionalSettings( 0 ), mnRepeatedTotalLength ( 0 ) {}
-	/** A constructor of ScPhonetic.
-	 * @param nFontIdx font index.
-	 * @param nAdditionalSettings an additional settings.
-	 * @param nRepeatedTotalLength the number of repeated total length.
-	 * @param rPhoneticString phonetic text.
-	 * @param rPhoneticPortions the portion of phonetic text.
-	 */
+	ScPhonetic();
+    ScPhonetic(const ScPhonetic& r);
 	ScPhonetic( sal_uInt16 nFontIdx, sal_uInt16 nAdditionalSettings,
-					sal_uInt16 nRepeatedTotalLength, const String& rPhoneticString,
-					const PhoneticPortionVec& rPhoneticPortions) :
-		mnFontIdx( nFontIdx ), mnAdditionalSettings( nAdditionalSettings ),
-		mnRepeatedTotalLength ( nRepeatedTotalLength ),
-		maPhoneticString ( rPhoneticString ), maPhoneticPortions ( rPhoneticPortions ) {}
-	virtual ~ScPhonetic();
+                sal_uInt16 nRepeatedTotalLength, const String& rPhoneticString,
+                const PhoneticPortionVec& rPhoneticPortions );
 
-	virtual int             operator==( const ScPhonetic& ) const;
+	~ScPhonetic();
+
+	bool operator== ( const ScPhonetic& r ) const;
 
 	/** Returns True if no phonetic information. */
-	inline BOOL IsEmpty() const { return maPhoneticString.Len() == 0; }
+	BOOL IsEmpty() const;
 	/** Returns the text for phonetic information. */
-	inline const String& GetString() const { return maPhoneticString; }
+	const String& GetString() const;
     /** Returns the portion for phonetic information. */
-	inline const PhoneticPortionVec& GetPortions() const { return maPhoneticPortions; }
+	const PhoneticPortionVec& GetPortions() const;
     /** Returns font index of phonetic information. */
-	inline sal_uInt16 GetFontIndex() const { return mnFontIdx; }
+	sal_uInt16 GetFontIndex() const;
     /** Returns additional settings of phonetic information. */
-	inline sal_uInt16 GetAdditionalSettings() const { return mnAdditionalSettings; }
+	sal_uInt16 GetAdditionalSettings() const;
     /** Returns repeated length of phonetic information. */
-	inline sal_uInt16 GetRepeatedTotalLength() const { return mnRepeatedTotalLength; }
+	sal_uInt16 GetRepeatedTotalLength() const;
     /** Returns the size of phonetic information. */
-	inline sal_uInt32 GetSize() const { return 14 + ( maPhoneticString.Len() ? maPhoneticString.Len() * 2 : 2 ) + maPhoneticPortions.size() * 6; }
+	sal_uInt32 GetSize() const;
 
 private:
+	PhoneticPortionVec maPhoneticPortions;
+	String             maPhoneticString;
 	sal_uInt16         mnFontIdx;            /// Index to FONT record
 	sal_uInt16         mnAdditionalSettings; /// Additional settings for the Asian phonetic text
 	sal_uInt16         mnRepeatedTotalLength;
-	String             maPhoneticString;
-	PhoneticPortionVec maPhoneticPortions;
 };
 
 #endif

File sc/source/core/data/phonetic.cxx

 
 using namespace com::sun::star;
 
+ScPhonetic::ScPhonetic() :
+    mnFontIdx(0), 
+    mnAdditionalSettings(0), 
+    mnRepeatedTotalLength(0)
+{
+}
 
-//------------------------------------------------------------------------
+ScPhonetic::ScPhonetic(const ScPhonetic& r) :
+    maPhoneticPortions(r.maPhoneticPortions),
+    maPhoneticString(r.maPhoneticString),
+    mnFontIdx(r.mnFontIdx),
+    mnAdditionalSettings(r.mnAdditionalSettings),
+    mnRepeatedTotalLength(r.mnRepeatedTotalLength)
+{
+}
+
+ScPhonetic::ScPhonetic( sal_uInt16 nFontIdx, sal_uInt16 nAdditionalSettings, 
+                        sal_uInt16 nRepeatedTotalLength, const String& rPhoneticString, 
+                        const PhoneticPortionVec& rPhoneticPortions) :
+    maPhoneticPortions(rPhoneticPortions),
+    maPhoneticString(rPhoneticString),
+    mnFontIdx(nFontIdx),
+    mnAdditionalSettings(nAdditionalSettings),
+    mnRepeatedTotalLength(nRepeatedTotalLength)
+{
+}
 
 ScPhonetic::~ScPhonetic()
 {
 }
 
-//------------------------------------------------------------------------
-
-int ScPhonetic::operator==( const ScPhonetic& rItem ) const
+bool ScPhonetic::operator== ( const ScPhonetic& r ) const
 {
-	return ((mnFontIdx == rItem.mnFontIdx)
-			 && (mnAdditionalSettings == rItem.mnAdditionalSettings)
-			 && (mnRepeatedTotalLength == rItem.mnRepeatedTotalLength)
-			 && (maPhoneticString == rItem.maPhoneticString)
-			 && (maPhoneticPortions == rItem.maPhoneticPortions));
+	return ((mnFontIdx == r.mnFontIdx)
+			 && (mnAdditionalSettings == r.mnAdditionalSettings)
+			 && (mnRepeatedTotalLength == r.mnRepeatedTotalLength)
+			 && (maPhoneticString == r.maPhoneticString)
+			 && (maPhoneticPortions == r.maPhoneticPortions));
 }
 
+
+BOOL ScPhonetic::IsEmpty() const
+{ 
+    return maPhoneticString.Len() == 0;
+}
+
+const String& ScPhonetic::GetString() const
+{ 
+    return maPhoneticString; 
+}
+
+const PhoneticPortionVec& ScPhonetic::GetPortions() const 
+{
+    return maPhoneticPortions; 
+}
+
+sal_uInt16 ScPhonetic::GetFontIndex() const 
+{ 
+    return mnFontIdx; 
+}
+
+sal_uInt16 ScPhonetic::GetAdditionalSettings() const 
+{ 
+    return mnAdditionalSettings; 
+}
+
+sal_uInt16 ScPhonetic::GetRepeatedTotalLength() const
+{ 
+    return mnRepeatedTotalLength; 
+}
+
+sal_uInt32 ScPhonetic::GetSize() const 
+{ 
+    return 14 + ( maPhoneticString.Len() ? maPhoneticString.Len() * 2 : 2 ) + maPhoneticPortions.size() * 6; 
+}