Kaydet (Commit) bbf1312b authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:finalclasses in lotuswordpro

Change-Id: I09a570741f5801980ae07fb90835e543519df046
Reviewed-on: https://gerrit.libreoffice.org/44135Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 6084ca8a
......@@ -101,7 +101,7 @@ private:
/**
* @brief point class
*/
class LwpPoint
class LwpPoint final
{
public:
LwpPoint();
......@@ -111,7 +111,7 @@ public:
sal_Int32 GetY() const {return m_nY;}
inline void SetX(sal_Int32 nX);
inline void SetY(sal_Int32 nY);
protected:
private:
sal_Int32 m_nX;
sal_Int32 m_nY;
};
......
......@@ -177,17 +177,16 @@ public:
class LwpOrderedObject;
class LwpListList;
class LwpOrderedObjectManager
class LwpOrderedObjectManager final
{
public:
LwpOrderedObjectManager(){}
protected:
LwpObjectID m_Head;
public:
void Read(LwpObjectStream *pStrm);
LwpOrderedObject* Enumerate(LwpOrderedObject* pLast);
protected:
private:
LwpListList* GetNextActiveListList(LwpListList* pLast);
LwpObjectID m_Head;
};
class LwpStyleManager;
......
......@@ -77,11 +77,11 @@ struct LwpKey
/**
* @brief LwpIndexManager, to read all index records and maintain the index information
*/
class LwpIndexManager
class LwpIndexManager final
{
public:
LwpIndexManager();
protected:
private:
static const sal_uInt8 MAXOBJECTIDS;
std::vector<LwpKey> m_ObjectKeys; //the <id, offset> ordered vector
std::vector<LwpKey> m_RootObjs; //For those object ids in RootObjIndex
......@@ -93,7 +93,7 @@ protected:
sal_uInt32 m_ChildIndex[256]; //Offset of leaf index
sal_uInt16 m_nLeafCount;
protected:
void ReadRootData(LwpObjectStream *pObjStrm ); //Read root index data
//Add new method to handle ObjIndex
......
......@@ -77,11 +77,10 @@
/**
* @brief object factory used for lwp object creation and maintenance
*/
class LwpObjectFactory
class LwpObjectFactory final
{
public:
explicit LwpObjectFactory(LwpSvStream* pSvStream);
public:
~LwpObjectFactory();
//For object Factory and object manager
......@@ -106,7 +105,6 @@ private:
LwpIdToObjMap m_IdToObjList;
LwpIndexManager m_IndexMgr;
protected:
rtl::Reference<LwpObject> FindObject(const LwpObjectID &objID);
public:
rtl::Reference<LwpObject> CreateObject(sal_uInt32 type, LwpObjectHeader &objHdr);
......
......@@ -103,7 +103,7 @@ protected:
sal_uInt16 m_nApply;
};
class LwpTextLanguageOverride : public LwpOverride
class LwpTextLanguageOverride final : public LwpOverride
{
public:
LwpTextLanguageOverride() : m_nLanguage(0) {}
......@@ -112,17 +112,14 @@ public:
void Read(LwpObjectStream* pStrm) override;
protected:
LwpTextLanguageOverride(LwpTextLanguageOverride const& rOther);
private:
LwpTextLanguageOverride(LwpTextLanguageOverride const& rOther);
LwpTextLanguageOverride& operator=(LwpTextLanguageOverride const& rOther) = delete;
private:
sal_uInt16 m_nLanguage;
};
class LwpTextAttributeOverride : public LwpOverride
class LwpTextAttributeOverride final : public LwpOverride
{
public:
LwpTextAttributeOverride() : m_nHideLevels(0), m_nBaseLineOffset(0) {}
......@@ -135,13 +132,10 @@ public:
bool IsHighlight();
protected:
LwpTextAttributeOverride(LwpTextAttributeOverride const& rOther);
private:
LwpTextAttributeOverride(LwpTextAttributeOverride const& rOther);
LwpTextAttributeOverride& operator=(LwpTextAttributeOverride const& rOther) = delete;
private:
enum{
TAO_HIGHLIGHT = 0x08,
};
......@@ -154,7 +148,7 @@ inline sal_uInt16 LwpTextAttributeOverride::GetHideLevels() const
return m_nHideLevels;
}
class LwpKinsokuOptsOverride : public LwpOverride
class LwpKinsokuOptsOverride final : public LwpOverride
{
public:
LwpKinsokuOptsOverride() : m_nLevels(0) {}
......@@ -163,17 +157,14 @@ public:
void Read(LwpObjectStream* pStrm) override;
protected:
LwpKinsokuOptsOverride(LwpKinsokuOptsOverride const& rOther);
private:
LwpKinsokuOptsOverride(LwpKinsokuOptsOverride const& rOther);
LwpKinsokuOptsOverride& operator=(LwpKinsokuOptsOverride const& rOther) = delete;
private:
sal_uInt16 m_nLevels;
};
class LwpBulletOverride : public LwpOverride
class LwpBulletOverride final : public LwpOverride
{
public:
LwpBulletOverride() {m_bIsNull = true;}
......@@ -203,13 +194,10 @@ public:
bool IsInValid(){return m_bIsNull;}
protected:
LwpBulletOverride(LwpBulletOverride const& rOther);
private:
LwpBulletOverride(LwpBulletOverride const& rOther);
LwpBulletOverride& operator=(LwpBulletOverride const& rOther) = delete;
private:
enum
{
BO_SILVERBULLET = 0x01,
......@@ -273,7 +261,7 @@ inline void LwpBulletOverride::RevertRightAligned()
LwpOverride::Override(BO_RIGHTALIGN, STATE_STYLE);
}
class LwpAlignmentOverride : public LwpOverride
class LwpAlignmentOverride final : public LwpOverride
{
public:
LwpAlignmentOverride() : m_nAlignType(ALIGN_LEFT), m_nPosition(0), m_nAlignChar(0){}
......@@ -298,13 +286,10 @@ public:
void Override(LwpAlignmentOverride* other);
void OverrideAlignment(AlignType val);
protected:
LwpAlignmentOverride(LwpAlignmentOverride const& rOther);
private:
LwpAlignmentOverride(LwpAlignmentOverride const& rOther);
LwpAlignmentOverride& operator=(LwpAlignmentOverride const& rOther) = delete;
private:
enum
{
AO_TYPE = 0x01,
......@@ -317,7 +302,7 @@ private:
sal_uInt16 m_nAlignChar;
};
class LwpSpacingCommonOverride : public LwpOverride
class LwpSpacingCommonOverride final : public LwpOverride
{
public:
LwpSpacingCommonOverride() : m_nSpacingType(SPACING_NONE), m_nAmount(0), m_nMultiple(65536){}
......@@ -343,13 +328,10 @@ public:
void OverrideAmount(sal_Int32 val);
void OverrideMultiple(sal_Int32 val);
protected:
LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther);
private:
LwpSpacingCommonOverride(LwpSpacingCommonOverride const& rOther);
LwpSpacingCommonOverride& operator=(LwpSpacingCommonOverride const& rOther) = delete;
protected:
enum
{
SPO_TYPE = 0x01,
......@@ -361,7 +343,7 @@ protected:
sal_Int32 m_nMultiple;
};
class LwpSpacingOverride : public LwpOverride
class LwpSpacingOverride final : public LwpOverride
{
public:
LwpSpacingOverride();
......@@ -378,20 +360,17 @@ public:
LwpSpacingCommonOverride* GetAboveSpacing(){return m_pParaSpacingAbove;}
LwpSpacingCommonOverride* GetBelowSpacing(){return m_pParaSpacingBelow;}
protected:
LwpSpacingOverride(LwpSpacingOverride const& rOther);
private:
LwpSpacingOverride(LwpSpacingOverride const& rOther);
LwpSpacingOverride& operator=(LwpSpacingOverride const& rOther) = delete;
private:
LwpSpacingCommonOverride* m_pSpacing;
LwpSpacingCommonOverride* m_pAboveLineSpacing;
LwpSpacingCommonOverride* m_pParaSpacingAbove;
LwpSpacingCommonOverride* m_pParaSpacingBelow;
};
class LwpIndentOverride : public LwpOverride
class LwpIndentOverride final : public LwpOverride
{
public:
LwpIndentOverride() : m_nAll(0), m_nFirst(0), m_nRest(0), m_nRight(0) {}
......@@ -427,13 +406,10 @@ public:
void SetMRest(sal_Int32 val){m_nRest=val;}
void SetMRight(sal_Int32 val){m_nRight=val;}
protected:
LwpIndentOverride(LwpIndentOverride const& rOther);
private:
LwpIndentOverride(LwpIndentOverride const& rOther);
LwpIndentOverride& operator=(LwpIndentOverride const& rOther) = delete;
private:
enum
{
IO_ALL = 0x0001,
......@@ -470,7 +446,7 @@ inline double LwpIndentOverride::GetRight() const
}
class LwpBackgroundStuff;
class LwpAmikakeOverride : public LwpOverride
class LwpAmikakeOverride final : public LwpOverride
{
public:
LwpAmikakeOverride();
......@@ -487,16 +463,12 @@ public:
AMIKAKE_CHARACTER = 2
};
protected:
LwpAmikakeOverride(LwpAmikakeOverride const& rOther);
private:
LwpAmikakeOverride(LwpAmikakeOverride const& rOther);
LwpAmikakeOverride& operator=(LwpAmikakeOverride const& rOther) = delete;
private:
std::unique_ptr<LwpBackgroundStuff> m_pBackgroundStuff;
sal_uInt16 m_nType;
};
#endif
......
......@@ -65,12 +65,11 @@
#include <xfilter/xfcolor.hxx>
#include <rtl/ustring.hxx>
class XFNumberStyle : public XFStyle
class XFNumberStyle final : public XFStyle
{
public:
XFNumberStyle();
public:
void SetDecimalDigits(sal_Int32 decimal);
void SetGroup();
......@@ -92,31 +91,25 @@ public:
virtual void ToXml(IXFStream *pStrm) override;
protected:
private:
void ToXml_StartElement(IXFStream *pStrm);
void ToXml_EndElement(IXFStream *pStrm);
void ToXml_Normal(IXFStream *pStrm);
void ToXml_Negative(IXFStream *pStrm);
void ToXml_Content(IXFStream *pStrm, bool nagetive);
protected:
enumXFNumberType m_eType;
sal_Int32 m_nDecimalDigits;
sal_Int32 m_nMinInteger;
sal_Int32 m_nMinExponent;
bool m_bGroup;
XFColor m_aColor;
bool m_bCurrencySymbolPost;
sal_Int32 m_nDecimalDigits;
sal_Int32 m_nMinInteger;
sal_Int32 m_nMinExponent;
bool m_bGroup;
XFColor m_aColor;
bool m_bCurrencySymbolPost;
OUString m_strCurrencySymbol;
OUString m_strPrefix;
OUString m_strSuffix;
bool m_bRedIfNegative;
XFColor m_aNegativeColor;
bool m_bRedIfNegative;
XFColor m_aNegativeColor;
OUString m_strNegativePrefix;
OUString m_strNegativeSuffix;
};
......
......@@ -32,7 +32,7 @@
/* This component will be instantiated for both import or export. Whether it calls
* setSourceDocument or setTargetDocument determines which Impl function the filter
* member calls */
class LotusWordProImportFilter : public cppu::WeakImplHelper
class LotusWordProImportFilter final : public cppu::WeakImplHelper
<
css::document::XFilter,
css::document::XImporter,
......@@ -41,9 +41,6 @@ class LotusWordProImportFilter : public cppu::WeakImplHelper
css::lang::XServiceInfo
>
{
private:
protected:
// oo.org declares
css::uno::Reference< css::uno::XComponentContext > mxContext;
css::uno::Reference< css::lang::XComponent > mxDoc;
......
......@@ -65,7 +65,7 @@
/**
* @brief Reader framework class for Lotus Word Pro 9 file
*/
class Lwp9Reader
class Lwp9Reader final
{
public:
Lwp9Reader(LwpSvStream* InputStream, IXFStream* pStream);
......@@ -74,7 +74,6 @@ private:
IXFStream* m_pStream;
LwpObjectFactory* m_pObjMgr;
LwpFileHeader m_LwpFileHdr; //LWP7 object
protected:
void ReadFileHeader();
void ReadIndex();
void ParseDocument();
......
......@@ -65,7 +65,7 @@
class LwpObjectStream;
class LwpAtomHolder;
class LwpBreaksOverride : public LwpOverride
class LwpBreaksOverride final : public LwpOverride
{
public:
......@@ -127,13 +127,10 @@ public:
void OverrideKeepWithPrevious(bool bVal);
void OverrideUseNextStyle(bool bVal);
protected:
LwpBreaksOverride(LwpBreaksOverride const& rOther);
private:
LwpBreaksOverride(LwpBreaksOverride const& rOther);
LwpBreaksOverride& operator=(const LwpBreaksOverride& rOther) = delete;
private:
std::unique_ptr<LwpAtomHolder> m_pNextStyle;
};
......
......@@ -140,7 +140,7 @@ protected:
* @brief
* VO_HIDDENCELLLAYOUT object
*/
class LwpHiddenCellLayout : public LwpCellLayout
class LwpHiddenCellLayout final : public LwpCellLayout
{
public:
LwpHiddenCellLayout(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
......@@ -150,7 +150,7 @@ public:
virtual rtl::Reference<XFCell> ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uInt16 nCol) override;
void RegisterStyle() override {}
virtual void SetCellMap() override;
protected:
private:
void Read() override;
LwpObjectID cconnectedlayout;
};
......
......@@ -65,7 +65,7 @@
class LwpBorderStuff;
class LwpMargins;
class LwpCharacterBorderOverride : public LwpOverride
class LwpCharacterBorderOverride final : public LwpOverride
{
public:
LwpCharacterBorderOverride();
......@@ -76,13 +76,10 @@ public:
void Read(LwpObjectStream* pStrm) override;
protected:
LwpCharacterBorderOverride(LwpCharacterBorderOverride const& rOther);
private:
LwpCharacterBorderOverride(LwpCharacterBorderOverride const& rOther);
LwpCharacterBorderOverride& operator=(LwpCharacterBorderOverride const& rOther) = delete;
private:
LwpBorderStuff* m_pBorderStuff;
LwpMargins* m_pMargins;
sal_Int32 m_nAboveWidth;
......
......@@ -231,16 +231,15 @@ public:
/**
* @brief VO_FOOTNOTEOPTS object
*/
class LwpFootnoteOptions : public LwpObject
class LwpFootnoteOptions final : public LwpObject
{
public:
LwpFootnoteOptions(LwpObjectHeader const &objHdr, LwpSvStream* pStrm);
void RegisterStyle() override;
protected:
private:
void Read() override;
void RegisterFootnoteStyle();
void RegisterEndnoteStyle();
private:
virtual ~LwpFootnoteOptions() override;
sal_uInt16 m_nFlag;
......
......@@ -82,17 +82,17 @@ private:
* @brief VO_HEADTAILHOLDER, LwpDLVListHeadTailHolder,
* contains a LwpDLVListHeadTail (Head and tail id)
*/
class LwpDLVListHeadTailHolder : public LwpObject
class LwpDLVListHeadTailHolder final : public LwpObject
{
public:
LwpDLVListHeadTailHolder(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
void Read() override;
LwpObjectID& GetHead(){ return m_HeadTail.GetHead();}
LwpObjectID& GetTail(){ return m_HeadTail.GetTail();}
protected:
LwpDLVListHeadTail m_HeadTail;
private:
virtual ~LwpDLVListHeadTailHolder() override {}
LwpDLVListHeadTail m_HeadTail;
};
/**
* @brief LwpObjectHolder, which is LwpDLVList, contains an id to an object
......@@ -114,16 +114,16 @@ protected:
* @brief VO_LISTLIST object in .lwp file
*
*/
class LwpListList : public LwpObjectHolder
class LwpListList final : public LwpObjectHolder
{
public:
LwpListList(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
void Read() override;
LwpObjectID& GetHead(){ return m_HeadTail.GetHead();}
protected:
LwpDLVListHeadTail m_HeadTail;
private:
virtual ~LwpListList() override {}
LwpDLVListHeadTail m_HeadTail;
};
#endif
......
......@@ -280,14 +280,14 @@ public:
LwpVirtualLayout* FindChildByType(LWP_LAYOUT_TYPE eType);
};
class LwpAssociatedLayouts
class LwpAssociatedLayouts final
{
public:
LwpAssociatedLayouts(){}
void Read(LwpObjectStream* pStrm);
LwpObjectID& GetOnlyLayout() { return m_OnlyLayout;}
rtl::Reference<LwpVirtualLayout> GetLayout(LwpVirtualLayout const * pStartLayout);
protected:
private:
LwpObjectID m_OnlyLayout; //LwpVirtualLayout
LwpDLVListHeadTail m_Layouts;
};
......
......@@ -78,7 +78,7 @@ private:
sal_Int16 m_nRotation; //angle
};
class LwpLayoutGeometry : public LwpVirtualPiece
class LwpLayoutGeometry final : public LwpVirtualPiece
{
public:
LwpLayoutGeometry(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
......@@ -89,20 +89,19 @@ public:
const LwpPoint& GetAbsoluteOrigin() { return m_AbsoluteOrigin; }
sal_uInt8 GetContentOrientation(){ return m_ContentOrientation;}
protected:
private:
virtual void Read() override;
protected:
virtual ~LwpLayoutGeometry() override;
sal_Int32 m_nWidth;
sal_Int32 m_nHeight;
LwpPoint m_Origin;
LwpPoint m_AbsoluteOrigin;
LwpRotor m_ContainerRotor;
sal_uInt8 m_ContentOrientation;
private:
virtual ~LwpLayoutGeometry() override;
};
class LwpLayoutScale : public LwpVirtualPiece
class LwpLayoutScale final : public LwpVirtualPiece
{
public:
enum {ORIGINAL_SIZE = 1, FIT_IN_FRAME = 2, PERCENTAGE = 4,
......@@ -117,9 +116,10 @@ public:
sal_Int32 GetScaleHeight(){return m_nScaleHeight;}
sal_uInt16 GetPlacement(){return m_nPlacement;}
LwpPoint& GetOffset() {return m_Offset;}
protected:
private:
virtual void Read() override;
protected:
virtual ~LwpLayoutScale() override;
sal_uInt16 m_nScaleMode;
sal_uInt32 m_nScalePercentage;
sal_Int32 m_nScaleWidth;
......@@ -127,53 +127,48 @@ protected:
sal_uInt16 m_nContentRotation;
LwpPoint m_Offset;
sal_uInt16 m_nPlacement;
private:
virtual ~LwpLayoutScale() override;
};
class LwpLayoutMargins : public LwpVirtualPiece
class LwpLayoutMargins final : public LwpVirtualPiece
{
public:
LwpLayoutMargins(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) override;
LwpMargins& GetMargins() { return m_Margins; }
LwpMargins& GetExtMargins(){ return m_ExtMargins;}
protected:
private:
virtual void Read() override;
protected:
virtual ~LwpLayoutMargins() override;
LwpMargins m_Margins;
LwpMargins m_ExtMargins;
LwpMargins m_ExtraMargins;
private:
virtual ~LwpLayoutMargins() override;
};
class LwpLayoutBorder : public LwpVirtualPiece
class LwpLayoutBorder final : public LwpVirtualPiece
{
public:
LwpLayoutBorder(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) override;
LwpBorderStuff& GetBorderStuff(){ return m_BorderStuff;}
protected:
virtual void Read() override;
protected:
LwpBorderStuff m_BorderStuff;
private:
virtual void Read() override;
virtual ~LwpLayoutBorder() override;
LwpBorderStuff m_BorderStuff;
};
class LwpLayoutBackground : public LwpVirtualPiece
class LwpLayoutBackground final : public LwpVirtualPiece
{
public:
LwpLayoutBackground(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) override;
LwpBackgroundStuff& GetBackgoudStuff(){return m_BackgroundStuff;}
protected:
virtual void Read() override;
protected:
LwpBackgroundStuff m_BackgroundStuff;
private:
virtual void Read() override;
virtual ~LwpLayoutBackground() override;
LwpBackgroundStuff m_BackgroundStuff;
};
class LwpExternalBorder
......@@ -190,17 +185,16 @@ private:
};
//It seems that this class is used for designer border. Only read now.
class LwpLayoutExternalBorder : public LwpVirtualPiece
class LwpLayoutExternalBorder final : public LwpVirtualPiece
{
public:
LwpLayoutExternalBorder(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) override;
protected:
virtual void Read() override;
protected:
LwpExternalBorder m_ExtranalBorder;
private:
virtual void Read() override;
virtual ~LwpLayoutExternalBorder() override;
LwpExternalBorder m_ExtranalBorder;
};
class LwpColumnInfo
......@@ -216,7 +210,7 @@ private:
sal_Int32 m_nGap;
};
class LwpLayoutColumns : public LwpVirtualPiece
class LwpLayoutColumns final : public LwpVirtualPiece
{
public:
LwpLayoutColumns(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
......@@ -224,27 +218,25 @@ public:
sal_uInt16 GetNumCols(){return m_nNumCols;}
double GetColWidth(sal_uInt16 nIndex);
double GetColGap(sal_uInt16 nIndex);
protected:
private:
virtual void Read() override;
protected:
virtual ~LwpLayoutColumns() override;
sal_uInt16 m_nNumCols;
LwpColumnInfo* m_pColumns;
private:
virtual ~LwpLayoutColumns() override;
};
class LwpLayoutGutters : public LwpVirtualPiece
class LwpLayoutGutters final : public LwpVirtualPiece
{
public:
LwpLayoutGutters(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) override;
LwpBorderStuff& GetBorderStuff() { return m_BorderBuffer; }
protected:
virtual void Read() override;
protected:
LwpBorderStuff m_BorderBuffer;
private:
virtual void Read() override;
virtual ~LwpLayoutGutters() override;
LwpBorderStuff m_BorderBuffer;
};
class LwpJoinStuff
......@@ -293,31 +285,29 @@ private:
LwpColor m_Color;
};
class LwpLayoutJoins : public LwpVirtualPiece
class LwpLayoutJoins final : public LwpVirtualPiece
{
public:
LwpLayoutJoins(LwpObjectHeader const & objHdr, LwpSvStream* pStrm);
virtual void Parse(IXFStream* pOutputStream) override;
protected:
virtual void Read() override;
protected:
LwpJoinStuff m_JoinStuff;
private:
virtual void Read() override;
virtual ~LwpLayoutJoins() override;