[Libreoffice-commits] libmspub.git: src/lib

Miklos Vajna vmiklos at collabora.co.uk
Tue Sep 5 07:58:40 UTC 2017


 src/lib/Fill.h          |    8 ++++----
 src/lib/MSPUBParser2k.h |    8 ++++----
 src/lib/MSPUBParser97.h |   20 ++++++++++----------
 3 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit a4424c069c10a0ab2fcbb6ae45dce3884a02ae3f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Sep 5 09:58:13 2017 +0200

    Mark overriding member functions as 'override'
    
    This does not affect the generated code (API or ABI), but:
    
    1) Makes sure that in case the signature of one of these functions would
    change by accident, the build breaks as the function no longer overrides
    a base function.
    
    2) Makes the code readable by explicitly marking all overriding
    functions as 'override', where previously the reader had to read the
    interface of the base class(es) as well to find out if the function is
    virtual or not.
    
    3) Since 'override' implies 'virtual', remove the 'virtual' keyword
    where 'override' is present.
    
    Change-Id: I1acf5e9252667a7f00a0b1f9ebd0ea383c91b352

diff --git a/src/lib/Fill.h b/src/lib/Fill.h
index 0d6fc4b..5955697 100644
--- a/src/lib/Fill.h
+++ b/src/lib/Fill.h
@@ -44,7 +44,7 @@ protected:
   int m_rotation;
 public:
   ImgFill(unsigned imgIndex, const MSPUBCollector *owner, bool isTexture, int rotation);
-  virtual void getProperties(librevenge::RVNGPropertyList *out) const;
+  void getProperties(librevenge::RVNGPropertyList *out) const override;
 private:
   ImgFill(const ImgFill &) : Fill(NULL), m_imgIndex(0), m_isTexture(false), m_rotation(0) { }
   ImgFill &operator=(const ImgFill &);
@@ -56,7 +56,7 @@ class PatternFill : public ImgFill
   ColorReference m_bg;
 public:
   PatternFill(unsigned imgIndex, const MSPUBCollector *owner, ColorReference fg, ColorReference bg);
-  void getProperties(librevenge::RVNGPropertyList *out) const;
+  void getProperties(librevenge::RVNGPropertyList *out) const override;
 private:
   PatternFill(const PatternFill &) : ImgFill(0, NULL, true, 0), m_fg(0x08000000), m_bg(0x08000000) { }
   PatternFill &operator=(const ImgFill &);
@@ -68,7 +68,7 @@ class SolidFill : public Fill
   double m_opacity;
 public:
   SolidFill(ColorReference color, double opacity, const MSPUBCollector *owner);
-  void getProperties(librevenge::RVNGPropertyList *out) const;
+  void getProperties(librevenge::RVNGPropertyList *out) const override;
 private:
   SolidFill(const SolidFill &) : Fill(NULL), m_color(0x08000000), m_opacity(1) { }
   SolidFill &operator=(const SolidFill &);
@@ -96,7 +96,7 @@ public:
   void addColor(ColorReference c, unsigned offsetPercent, double opacity);
   void addColorReverse(ColorReference c, unsigned offsetPercent, double opacity);
   void completeComplexFill();
-  void getProperties(librevenge::RVNGPropertyList *out) const;
+  void getProperties(librevenge::RVNGPropertyList *out) const override;
 private:
   GradientFill(const GradientFill &) : Fill(NULL), m_stops(), m_angle(0), m_type(7), m_fillLeftVal(0.0), m_fillTopVal(0.0), m_fillRightVal(0.0), m_fillBottomVal(0.0) { }
   GradientFill &operator=(const GradientFill &);
diff --git a/src/lib/MSPUBParser2k.h b/src/lib/MSPUBParser2k.h
index 0d0ec57..89ce22f 100644
--- a/src/lib/MSPUBParser2k.h
+++ b/src/lib/MSPUBParser2k.h
@@ -46,9 +46,9 @@ protected:
   bool parseGroup(librevenge::RVNGInputStream *input, unsigned seqNum, unsigned page);
   void assignShapeImgIndex(unsigned seqNum);
   void parseShapeFill(librevenge::RVNGInputStream *input, unsigned seqNum, unsigned chunkOffset);
-  bool parseContents(librevenge::RVNGInputStream *input);
+  bool parseContents(librevenge::RVNGInputStream *input) override;
   virtual bool parseDocument(librevenge::RVNGInputStream *input);
-  virtual unsigned getColorIndexByQuillEntry(unsigned entry);
+  unsigned getColorIndexByQuillEntry(unsigned entry) override;
   virtual int translateCoordinateIfNecessary(int coordinate) const;
   virtual unsigned getFirstLineOffset() const;
   virtual unsigned getSecondLineOffset() const;
@@ -63,8 +63,8 @@ protected:
   virtual void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input);
 public:
   explicit MSPUBParser2k(librevenge::RVNGInputStream *input, MSPUBCollector *collector);
-  virtual bool parse();
-  virtual ~MSPUBParser2k();
+  bool parse() override;
+  ~MSPUBParser2k() override;
 };
 
 } // namespace libmspub
diff --git a/src/lib/MSPUBParser97.h b/src/lib/MSPUBParser97.h
index 576163a..ec3d014 100644
--- a/src/lib/MSPUBParser97.h
+++ b/src/lib/MSPUBParser97.h
@@ -42,24 +42,24 @@ class MSPUBParser97 : public MSPUBParser2k
 
   bool m_isBanner;
 
-  bool parseDocument(librevenge::RVNGInputStream *input);
-  int translateCoordinateIfNecessary(int coordinate) const;
-  unsigned getFirstLineOffset() const;
-  unsigned getSecondLineOffset() const;
-  unsigned getShapeFillTypeOffset() const;
-  unsigned getShapeFillColorOffset() const;
-  unsigned short getTextMarker() const;
-  unsigned getTextIdOffset() const;
+  bool parseDocument(librevenge::RVNGInputStream *input) override;
+  int translateCoordinateIfNecessary(int coordinate) const override;
+  unsigned getFirstLineOffset() const override;
+  unsigned getSecondLineOffset() const override;
+  unsigned getShapeFillTypeOffset() const override;
+  unsigned getShapeFillColorOffset() const override;
+  unsigned short getTextMarker() const override;
+  unsigned getTextIdOffset() const override;
   CharacterStyle readCharacterStyle(librevenge::RVNGInputStream *input,
                                     unsigned length);
-  void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input);
+  void parseContentsTextIfNecessary(librevenge::RVNGInputStream *input) override;
   std::vector<SpanInfo97> getSpansInfo(librevenge::RVNGInputStream *input,
                                        unsigned prop1Index, unsigned prop2Index, unsigned prop3Index,
                                        unsigned prop3End);
   TextInfo97 getTextInfo(librevenge::RVNGInputStream *input, unsigned length);
 public:
   MSPUBParser97(librevenge::RVNGInputStream *input, MSPUBCollector *collector);
-  bool parse();
+  bool parse() override;
 };
 }
 


More information about the Libreoffice-commits mailing list