diff --git a/CMakeLists.txt b/CMakeLists.txt index caa353b..903f11f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,8 +155,6 @@ add_executable(pdf2htmlEX src/HTMLRenderer/link.cc src/HTMLRenderer/state.cc src/HTMLRenderer/text.cc - src/HTMLRenderer/Preprocessor.h - src/HTMLRenderer/Preprocessor.cc src/BackgroundRenderer/BackgroundRenderer.h src/BackgroundRenderer/SplashBackgroundRenderer.h src/BackgroundRenderer/SplashBackgroundRenderer.cc @@ -164,8 +162,8 @@ add_executable(pdf2htmlEX src/BackgroundRenderer/CairoBackgroundRenderer.cc src/util/ArgParser.h src/util/ArgParser.cc - src/util/base64.h - src/util/base64.cc + src/util/base64stream.h + src/util/base64stream.cc src/util/const.h src/util/const.cc src/util/ffw.h @@ -177,7 +175,10 @@ add_executable(pdf2htmlEX src/util/namespace.h src/util/path.h src/util/path.cc + src/util/Preprocessor.h + src/util/Preprocessor.cc src/util/StringFormatter.h + src/util/StringFormatter.cc src/util/TmpFiles.h src/util/TmpFiles.cc src/util/unicode.h diff --git a/ChangeLog b/ChangeLog index 9f270de..8df58bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ Latest v0.6 +* New parameter: --use-cropbox +* Progress indicator +* Create a glyph for ' ' when missing +* Code refining + v0.5 2012.10.06 diff --git a/debian/changelog b/debian/changelog index bf75d52..3e7697e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +pdf2htmlex (0.6-1~git201212111844rd76af-0ubuntu1) quantal; urgency=low + + * Package for quantal + + -- WANG Lu Tue, 11 Dec 2012 18:44:44 +0800 + pdf2htmlex (0.6-1~git201210070052rcb9a8-0ubuntu1) precise; urgency=low * New version diff --git a/src/HTMLRenderer/HTMLRenderer.h b/src/HTMLRenderer/HTMLRenderer.h index 4b035ac..22ce5f1 100644 --- a/src/HTMLRenderer/HTMLRenderer.h +++ b/src/HTMLRenderer/HTMLRenderer.h @@ -25,7 +25,7 @@ #include #include "Param.h" -#include "Preprocessor.h" +#include "util/Preprocessor.h" #include "util/const.h" #include "util/StringFormatter.h" #include "util/TmpFiles.h" diff --git a/src/HTMLRenderer/export.cc b/src/HTMLRenderer/export.cc index f7f6b18..cb893bb 100644 --- a/src/HTMLRenderer/export.cc +++ b/src/HTMLRenderer/export.cc @@ -12,7 +12,7 @@ #include "HTMLRenderer.h" #include "util/namespace.h" -#include "util/base64.h" +#include "util/base64stream.h" #include "util/math.h" #include "util/misc.h" diff --git a/src/HTMLRenderer/general.cc b/src/HTMLRenderer/general.cc index 043bc93..165c684 100644 --- a/src/HTMLRenderer/general.cc +++ b/src/HTMLRenderer/general.cc @@ -18,7 +18,7 @@ #include "BackgroundRenderer/BackgroundRenderer.h" #include "util/namespace.h" #include "util/ffw.h" -#include "util/base64.h" +#include "util/base64stream.h" #include "util/math.h" #include "util/path.h" diff --git a/src/HTMLRenderer/Preprocessor.cc b/src/util/Preprocessor.cc similarity index 100% rename from src/HTMLRenderer/Preprocessor.cc rename to src/util/Preprocessor.cc diff --git a/src/HTMLRenderer/Preprocessor.h b/src/util/Preprocessor.h similarity index 100% rename from src/HTMLRenderer/Preprocessor.h rename to src/util/Preprocessor.h diff --git a/src/util/StringFormatter.cc b/src/util/StringFormatter.cc new file mode 100644 index 0000000..0b183ac --- /dev/null +++ b/src/util/StringFormatter.cc @@ -0,0 +1,28 @@ +#include + +#include "StringFormatter.h" + +namespace pdf2htmlEX { + +StringFormatter::GuardedPointer StringFormatter::operator () (const char * format, ...) +{ + assert((buf_cnt == 0) && "StringFormatter: buffer is reused!"); + + va_list vlist; + va_start(vlist, format); + int l = vsnprintf(&buf.front(), buf.capacity(), format, vlist); + va_end(vlist); + if(l >= (int)buf.capacity()) + { + buf.reserve(std::max((long)(l+1), (long)buf.capacity() * 2)); + va_start(vlist, format); + l = vsnprintf(&buf.front(), buf.capacity(), format, vlist); + va_end(vlist); + } + assert(l >= 0); // we should fail when vsnprintf fail + assert(l < (int)buf.capacity()); + return GuardedPointer(this); +} + +} //namespace pdf2htmlEX + diff --git a/src/util/StringFormatter.h b/src/util/StringFormatter.h index 96e0370..048a30f 100644 --- a/src/util/StringFormatter.h +++ b/src/util/StringFormatter.h @@ -29,24 +29,8 @@ public: * Important: * there is only one buffer, so new strings will replace old ones */ - GuardedPointer operator () (const char * format, ...) { - assert((buf_cnt == 0) && "StringFormatter: buffer is reused!"); + GuardedPointer operator () (const char * format, ...); - va_list vlist; - va_start(vlist, format); - int l = vsnprintf(&buf.front(), buf.capacity(), format, vlist); - va_end(vlist); - if(l >= (int)buf.capacity()) - { - buf.reserve(std::max((long)(l+1), (long)buf.capacity() * 2)); - va_start(vlist, format); - l = vsnprintf(&buf.front(), buf.capacity(), format, vlist); - va_end(vlist); - } - assert(l >= 0); // we should fail when vsnprintf fail - assert(l < (int)buf.capacity()); - return GuardedPointer(this); - } private: friend class GuardedPointer; std::vector buf; diff --git a/src/util/base64.cc b/src/util/base64stream.cc similarity index 97% rename from src/util/base64.cc rename to src/util/base64stream.cc index e5da7e3..7df00fe 100644 --- a/src/util/base64.cc +++ b/src/util/base64stream.cc @@ -1,4 +1,4 @@ -#include "base64.h" +#include "base64stream.h" namespace pdf2htmlEX { diff --git a/src/util/base64.h b/src/util/base64stream.h similarity index 87% rename from src/util/base64.h rename to src/util/base64stream.h index 5bdb4fe..46955cf 100644 --- a/src/util/base64.h +++ b/src/util/base64stream.h @@ -5,8 +5,8 @@ * 2012.11.29 */ -#ifndef BASE64_H__ -#define BASE64_H__ +#ifndef BASE64STREAM_H__ +#define BASE64STREAM_H__ #include @@ -30,4 +30,4 @@ std::ostream & operator << (std::ostream & out, base64stream & bf); std::ostream & operator << (std::ostream & out, base64stream && bf); } //namespace pdf2htmlEX -#endif //BASE64_H__ +#endif //BASE64STREAM_H__