summaryrefslogtreecommitdiff
authorAlbert Astals Cid <aacid@kde.org>2008-12-16 19:37:39 (GMT)
committer Albert Astals Cid <aacid@kde.org>2008-12-16 19:37:39 (GMT)
commit80f415176952635a485356cf36048eee53396c25 (patch) (side-by-side diff)
tree812cddc52698242641b4cd85b9abccabb9da7003
parentdbcebda953cb36a45a125aada68e85249fb73f43 (diff)
downloadpoppler-80f415176952635a485356cf36048eee53396c25.zip
poppler-80f415176952635a485356cf36048eee53396c25.tar.gz
Make destructors private/protected since you are not supposed to use them
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--poppler/GfxFont.cc2
-rw-r--r--poppler/GfxFont.h11
2 files changed, 6 insertions, 7 deletions
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 9cfa4f9..9ae54e6 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -2054,7 +2054,7 @@ GfxFontDict::GfxFontDict(XRef *xref, Ref *fontDictRef, Dict *fontDict) {
// NULL and !isOk() so that when we do lookups
// we can tell the difference between a missing font
// and a font that is just !isOk()
- delete fonts[i];
+ fonts[i]->decRefCnt();
fonts[i] = NULL;
}
} else {
diff --git a/poppler/GfxFont.h b/poppler/GfxFont.h
index 75a35d2..55f8692 100644
--- a/poppler/GfxFont.h
+++ b/poppler/GfxFont.h
@@ -135,8 +135,6 @@ public:
GfxFont(char *tagA, Ref idA, GooString *nameA);
- virtual ~GfxFont();
-
GBool isOk() { return ok; }
void incRefCnt();
@@ -229,6 +227,8 @@ public:
DisplayFontParam *dfp;
protected:
+ virtual ~GfxFont();
+
void readFontDescriptor(XRef *xref, Dict *fontDict);
CharCodeToUnicode *readToUnicodeCMap(Dict *fontDict, int nBits,
CharCodeToUnicode *ctu);
@@ -265,8 +265,6 @@ public:
Gfx8BitFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
GfxFontType typeA, Dict *fontDict);
- virtual ~Gfx8BitFont();
-
virtual int getNextChar(char *s, int len, CharCode *code,
Unicode **u, int *uLen,
double *dx, double *dy, double *ox, double *oy);
@@ -303,6 +301,7 @@ public:
Dict *getResources();
private:
+ virtual ~Gfx8BitFont();
char *enc[256]; // char code --> char name
char encFree[256]; // boolean for each char name: if set,
@@ -325,8 +324,6 @@ public:
GfxCIDFont(XRef *xref, char *tagA, Ref idA, GooString *nameA,
Dict *fontDict);
- virtual ~GfxCIDFont();
-
virtual GBool isCIDFont() { return gTrue; }
virtual int getNextChar(char *s, int len, CharCode *code,
@@ -352,6 +349,8 @@ public:
double getWidth(char* s, int len);
private:
+ virtual ~GfxCIDFont();
+
Gushort mapCodeToGID(FoFiTrueType *ff, int cmapi,
Unicode unicode, GBool wmode);