~ubuntu-branches/ubuntu/lucid/swftools/lucid

« back to all changes in this revision

Viewing changes to lib/pdf/xpdf/SplashFontFile.cc

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-04-30 05:22:19 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090430052219-l1n64qofzeq5pej8
Tags: 0.9.0-0ubuntu1
* New upstream release (LP: #369931)
  - patches/01_manpages: edited to match updated version of src/pdf2swf.1 and
    src/wav2swf.1
  - patches/02_faq: edited to match updated version of FAQ
  - patches/04_makefile: edited to delete the patch on lib/Makefile.in and 
    src/Makefile.in (applied upstream)
  - deleted patch 99_configure_for_python2.5_and_2.6 (applied upstream)
  - debian/swftools.doc: deleted installation of TODO and 
    pdf2swf/HOWTO_pdf2swf as they don't exist anymore

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//========================================================================
 
2
//
 
3
// SplashFontFile.cc
 
4
//
 
5
//========================================================================
 
6
 
 
7
#include <aconf.h>
 
8
 
 
9
#ifdef USE_GCC_PRAGMAS
 
10
#pragma implementation
 
11
#endif
 
12
 
 
13
#include <stdio.h>
 
14
#include <unistd.h>
 
15
#include "GString.h"
 
16
#include "SplashFontFile.h"
 
17
#include "SplashFontFileID.h"
 
18
 
 
19
#ifdef VMS
 
20
#if (__VMS_VER < 70000000)
 
21
extern "C" int unlink(char *filename);
 
22
#endif
 
23
#endif
 
24
 
 
25
//------------------------------------------------------------------------
 
26
// SplashFontFile
 
27
//------------------------------------------------------------------------
 
28
 
 
29
SplashFontFile::SplashFontFile(SplashFontFileID *idA, char *fileNameA,
 
30
                               GBool deleteFileA) {
 
31
  id = idA;
 
32
  fileName = new GString(fileNameA);
 
33
  deleteFile = deleteFileA;
 
34
  refCnt = 0;
 
35
}
 
36
 
 
37
SplashFontFile::~SplashFontFile() {
 
38
  if (deleteFile) {
 
39
    unlink(fileName->getCString());
 
40
  }
 
41
  delete fileName;
 
42
  delete id;
 
43
}
 
44
 
 
45
void SplashFontFile::incRefCnt() {
 
46
  ++refCnt;
 
47
}
 
48
 
 
49
void SplashFontFile::decRefCnt() {
 
50
  if (!--refCnt) {
 
51
    delete this;
 
52
  }
 
53
}