summaryrefslogtreecommitdiff
path: root/fpdfsdk/include/fsdk_define.h
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-11-30 12:39:54 -0800
committerTom Sepez <tsepez@chromium.org>2015-11-30 12:39:54 -0800
commit40e9ff30b7f22b37c071dc9751f489d4cc22b0ee (patch)
tree33f50b65518fcb32bc197adc94bb0073244113e1 /fpdfsdk/include/fsdk_define.h
parentd029d934e1a23aadc07cc99753a55b308f20ef2b (diff)
downloadpdfium-40e9ff30b7f22b37c071dc9751f489d4cc22b0ee.tar.xz
Tidy PDF_ENABLE_XFA #ifdefs in fpdfsdk.
-- label matching #endifs -- prefer #ifdef over #ifndef -- consolidate some blocks. R=ochang@chromium.org Review URL: https://codereview.chromium.org/1484843002 .
Diffstat (limited to 'fpdfsdk/include/fsdk_define.h')
-rw-r--r--fpdfsdk/include/fsdk_define.h31
1 files changed, 14 insertions, 17 deletions
diff --git a/fpdfsdk/include/fsdk_define.h b/fpdfsdk/include/fsdk_define.h
index 4dfe5c2840..0d63b642d4 100644
--- a/fpdfsdk/include/fsdk_define.h
+++ b/fpdfsdk/include/fsdk_define.h
@@ -7,32 +7,27 @@
#ifndef FPDFSDK_INCLUDE_FSDK_DEFINE_H_
#define FPDFSDK_INCLUDE_FSDK_DEFINE_H_
-#ifndef PDF_ENABLE_XFA
-#include "core/include/fpdfapi/fpdfapi.h"
-#else
-#include "../../xfa/include/fwl/adapter/fwl_adaptertimermgr.h"
-#include "../../xfa/include/fxbarcode/BC_BarCode.h"
-#include "../../xfa/include/fxfa/fxfa.h"
-#include "../../xfa/include/fxgraphics/fx_graphics.h"
-#include "../../xfa/include/fxjse/fxjse.h"
-#endif
#include "core/include/fpdfapi/fpdf_module.h"
#include "core/include/fpdfapi/fpdf_pageobj.h"
#include "core/include/fpdfapi/fpdf_parser.h"
#include "core/include/fpdfapi/fpdf_render.h"
#include "core/include/fpdfapi/fpdf_serial.h"
-#ifdef PDF_ENABLE_XFA
#include "core/include/fpdfapi/fpdfapi.h"
-#endif
#include "core/include/fpdfdoc/fpdf_doc.h"
#include "core/include/fpdfdoc/fpdf_vt.h"
#include "core/include/fxge/fx_ge.h"
#include "core/include/fxge/fx_ge_win32.h"
+#include "public/fpdfview.h"
+
#ifdef PDF_ENABLE_XFA
+#include "../../xfa/include/fwl/adapter/fwl_adaptertimermgr.h"
+#include "../../xfa/include/fxbarcode/BC_BarCode.h"
+#include "../../xfa/include/fxfa/fxfa.h"
+#include "../../xfa/include/fxgraphics/fx_graphics.h"
+#include "../../xfa/include/fxjse/fxjse.h"
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_doc.h"
#include "fpdfsdk/include/fpdfxfa/fpdfxfa_page.h"
-#endif
-#include "public/fpdfview.h"
+#endif // PDF_ENABLE_XFA
#ifdef _WIN32
#include <tchar.h>
@@ -67,15 +62,17 @@ class CPDF_CustomAccess final : public IFX_FileRead {
virtual CFX_ByteString GetFullPath() { return ""; }
virtual FX_BOOL GetByte(FX_DWORD pos, uint8_t& ch);
virtual FX_BOOL GetBlock(FX_DWORD pos, uint8_t* pBuf, FX_DWORD size);
+#endif // PDF_ENABLE_XFA
-#endif
private:
FPDF_FILEACCESS m_FileAccess;
#ifdef PDF_ENABLE_XFA
uint8_t m_Buffer[512];
FX_DWORD m_BufferOffset;
+#endif // PDF_ENABLE_XFA
};
+#ifdef PDF_ENABLE_XFA
class CFPDF_FileStream : public IFX_FileStream {
public:
CFPDF_FileStream(FPDF_FILEHANDLER* pFS);
@@ -98,8 +95,8 @@ class CFPDF_FileStream : public IFX_FileStream {
protected:
FPDF_FILEHANDLER* m_pFS;
FX_FILESIZE m_nCurPos;
-#endif
};
+#endif // PDF_ENABLE_XFA
// Object types for public FPDF_ types; these correspond to next layer down
// from fpdfsdk. For master, these are CPDF_ types, but for XFA, these are
@@ -107,10 +104,10 @@ class CFPDF_FileStream : public IFX_FileStream {
#ifndef PDF_ENABLE_XFA
using UnderlyingDocumentType = CPDF_Document;
using UnderlyingPageType = CPDF_Page;
-#else
+#else // PDF_ENABLE_XFA
using UnderlyingDocumentType = CPDFXFA_Document;
using UnderlyingPageType = CPDFXFA_Page;
-#endif
+#endif // PDF_ENABLE_XFA
// Conversions to/from underlying types.
UnderlyingDocumentType* UnderlyingFromFPDFDocument(FPDF_DOCUMENT doc);