summaryrefslogtreecommitdiff
path: root/poppler/TextOutputDev.h
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2018-01-08 18:07:38 +0100
committerAlbert Astals Cid <aacid@kde.org>2018-01-08 18:37:33 +0100
commit8794789a72f845b009656e6d7ae6a00b709e09bc (patch)
tree82220f5640d4abcf726f6e83e59cd6bb59cc4d67 /poppler/TextOutputDev.h
parent4c7814342806b61fedbb2d45ce74462f9dbc20bc (diff)
Delete lots of copy constructors and copy assignment operators
Fixes rule-of-three and copyable-polymorphic warnings reported by clazy. The default copy constructor and copy assignment operator are only valid for simple classes so we delete them (i.e. make then not exist) when we have either a virtual class or a destructor, the code still compiles so this doesn't fix any bug, it is more a protection for when you think you can copy a class and don't realize the default copy constrcutor is not doing what you want and you get crashes. Hopefully this helps us in the future :)
Diffstat (limited to 'poppler/TextOutputDev.h')
-rw-r--r--poppler/TextOutputDev.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h
index 380301fd..5e92dfb7 100644
--- a/poppler/TextOutputDev.h
+++ b/poppler/TextOutputDev.h
@@ -17,7 +17,7 @@
// Copyright (C) 2006 Ed Catmur <ed@catmur.co.uk>
// Copyright (C) 2007, 2008, 2011, 2013 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2007, 2017 Adrian Johnson <ajohnson@redneon.com>
-// Copyright (C) 2008, 2010, 2015, 2016 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2008, 2010, 2015, 2016, 2018 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2010 Brian Ewins <brian.ewins@gmail.com>
// Copyright (C) 2012, 2013, 2015, 2016 Jason Crain <jason@aquaticape.us>
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
@@ -79,6 +79,9 @@ public:
TextFontInfo(GfxState *state);
~TextFontInfo();
+ TextFontInfo(const TextFontInfo &) = delete;
+ TextFontInfo& operator=(const TextFontInfo &) = delete;
+
GBool matches(GfxState *state);
GBool matches(TextFontInfo *fontInfo);
@@ -129,6 +132,9 @@ public:
// Destructor.
~TextWord();
+ TextWord(const TextWord &) = delete;
+ TextWord& operator=(const TextWord &) = delete;
+
// Add a character to the word.
void addChar(GfxState *state, TextFontInfo *fontA, double x, double y,
double dx, double dy, int charPosA, int charLen,
@@ -244,6 +250,9 @@ public:
TextPool();
~TextPool();
+ TextPool(const TextPool &) = delete;
+ TextPool& operator=(const TextPool &) = delete;
+
TextWord *getPool(int baseIdx) { return pool[baseIdx - minBaseIdx]; }
void setPool(int baseIdx, TextWord *p) { pool[baseIdx - minBaseIdx] = p; }
@@ -276,6 +285,9 @@ public:
TextLine(TextBlock *blkA, int rotA, double baseA);
~TextLine();
+ TextLine(const TextLine &) = delete;
+ TextLine& operator=(const TextLine &) = delete;
+
void addWord(TextWord *word);
// Return the distance along the primary axis between <this> and
@@ -353,6 +365,9 @@ public:
TextBlock(TextPage *pageA, int rotA);
~TextBlock();
+ TextBlock(const TextBlock &) = delete;
+ TextBlock& operator=(const TextBlock &) = delete;
+
void addWord(TextWord *word);
void coalesce(UnicodeMap *uMap, double fixedPitch);
@@ -442,6 +457,9 @@ public:
TextFlow(TextPage *pageA, TextBlock *blk);
~TextFlow();
+ TextFlow(const TextFlow &) = delete;
+ TextFlow& operator=(const TextFlow &) = delete;
+
// Add a block to the end of this flow.
void addBlock(TextBlock *blk);
@@ -488,6 +506,9 @@ public:
~TextWordList();
+ TextWordList(const TextWordList &) = delete;
+ TextWordList& operator=(const TextWordList &) = delete;
+
// Return the number of words on the list.
int getLength();
@@ -531,6 +552,9 @@ public:
// Constructor.
TextPage(GBool rawOrderA);
+ TextPage(const TextPage &) = delete;
+ TextPage& operator=(const TextPage &) = delete;
+
void incRefCnt();
void decRefCnt();
@@ -702,6 +726,9 @@ public:
ActualText(TextPage *out);
~ActualText();
+ ActualText(const ActualText &) = delete;
+ ActualText& operator=(const ActualText &) = delete;
+
void addChar(GfxState *state, double x, double y,
double dx, double dy,
CharCode c, int nBytes, Unicode *u, int uLen);