1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
--- src/tools/replace_text.cc.orig 2010-02-24 03:28:09.000000000 +0900
+++ src/tools/replace_text.cc 2016-06-12 04:26:38.191487000 +0900
@@ -22,6 +22,7 @@
* Project is hosted on http://sourceforge.net/projects/pdfedit
*/
#include <sstream>
+#include <algorithm>
#include <kernel/pdfedit-core-dev.h>
#include <kernel/cpdf.h>
#include <kernel/cpage.h>
@@ -59,7 +60,7 @@
struct _replace {
static const string name;
- void operator () (shared_ptr<CPage> page, const string& what, const string& with)
+ void operator () (boost::shared_ptr<CPage> page, const string& what, const string& with)
{
page->replaceText (what, with);
}
@@ -121,14 +122,14 @@
return 1;
// open pdf
- shared_ptr<CPdf> pdf = CPdf::getInstance (file.c_str(), CPdf::ReadWrite);
+ boost::shared_ptr<CPdf> pdf = CPdf::getInstance (file.c_str(), CPdf::ReadWrite);
if (pdf->isLinearized())
{
pdf.reset ();
string out (file+"-delinearised.pdf");
{
- shared_ptr<Delinearizator> del (Delinearizator::getInstance(file.c_str(), new OldStylePdfWriter));
+ boost::shared_ptr<Delinearizator> del (Delinearizator::getInstance(file.c_str(), new OldStylePdfWriter));
if (!del) return -1;
del->delinearize(out.c_str());
}
@@ -137,7 +138,7 @@
// sane values
- to = std::min(to, pdf->getPageCount()+1);
+ to = std::min(to, (unsigned long)(pdf->getPageCount()+1));
// now the hard stuff comes - do this crazy loops intentionally
for (size_t things_to_replace = 0; things_to_replace < withs.size(); ++things_to_replace)
@@ -150,7 +151,7 @@
string with = withs[things_to_replace];
for (size_t i = from; i < to; ++i)
{
- shared_ptr<CPage> page = pdf->getPage(i);
+ boost::shared_ptr<CPage> page = pdf->getPage(i);
_replace()(page, what, with);
}
#ifdef WIN32
|