aboutsummaryrefslogtreecommitdiff
path: root/editors/pdfedit/files
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2016-06-11 20:53:25 +0000
committerHiroki Sato <hrs@FreeBSD.org>2016-06-11 20:53:25 +0000
commitcbef0b05054632193ce5204cf6cbbc18d4bafe6f (patch)
treecca550dccdb2944758180b8dab0dd63d419a8936 /editors/pdfedit/files
parentb2ab33cabb4136d31840d4ca6db376aab24540bd (diff)
downloadports-cbef0b05054632193ce5204cf6cbbc18d4bafe6f.tar.gz
ports-cbef0b05054632193ce5204cf6cbbc18d4bafe6f.zip
Notes
Diffstat (limited to 'editors/pdfedit/files')
-rw-r--r--editors/pdfedit/files/patch-Makefile12
-rw-r--r--editors/pdfedit/files/patch-Makefile.flags.in30
-rw-r--r--editors/pdfedit/files/patch-doc__Makefile12
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cannotation.cc96
-rw-r--r--editors/pdfedit/files/patch-src-kernel-carray.cc118
-rw-r--r--editors/pdfedit/files/patch-src-kernel-ccontentstream.cc152
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cdict.cc149
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cdict.h20
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cobject.cc11
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cobject2string.cc11
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cobject2xpdf.cc47
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cobjecthelpers.cc142
-rw-r--r--editors/pdfedit/files/patch-src-kernel-contentschangetag.cc25
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cpage.cc35
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cpageannots.cc201
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cpageattributes.cc88
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cpagechanges.cc54
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cpdf.cc872
-rw-r--r--editors/pdfedit/files/patch-src-kernel-cstream.c65
-rw-r--r--editors/pdfedit/files/patch-src-kernel-pdfoperators.cc120
-rw-r--r--editors/pdfedit/files/patch-src-kernel-pdfoperatorsbase.cc78
-rw-r--r--editors/pdfedit/files/patch-src-kernel-pdfwriter.cc57
-rw-r--r--editors/pdfedit/files/patch-src-kernel-stateupdater.cc11
-rw-r--r--editors/pdfedit/files/patch-src-kernel-textoutputengines.cc29
-rw-r--r--editors/pdfedit/files/patch-src-tools-Makfile13
-rw-r--r--editors/pdfedit/files/patch-src-tools-add_image.cc69
-rw-r--r--editors/pdfedit/files/patch-src-tools-add_text.cc37
-rw-r--r--editors/pdfedit/files/patch-src-tools-displaycs.cc22
-rw-r--r--editors/pdfedit/files/patch-src-tools-pagemetrics.cc47
-rw-r--r--editors/pdfedit/files/patch-src-tools-pdf_images.cc38
-rw-r--r--editors/pdfedit/files/patch-src-tools-replace_text.cc54
-rw-r--r--editors/pdfedit/files/patch-src-utils-algorithms.h18
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.cc29
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.h20
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.cc29
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.h11
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1.cc11
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1C.cc15
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-goo-GString.cc91
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-goo-GString.h40
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.cc22
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.h34
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-xpdf-NameToUnicodeTable.h11
-rw-r--r--editors/pdfedit/files/patch-src-xpdf-xpdf-Object.h11
-rw-r--r--editors/pdfedit/files/patch-src__gui__base.cc24
-rw-r--r--editors/pdfedit/files/patch-src__gui__pdfutil.cc24
-rw-r--r--editors/pdfedit/files/patch-src__kernel__cpagecontents.cc374
-rw-r--r--editors/pdfedit/files/patch-src__tools__pdf_to_text.cc45
48 files changed, 3524 insertions, 0 deletions
diff --git a/editors/pdfedit/files/patch-Makefile b/editors/pdfedit/files/patch-Makefile
new file mode 100644
index 000000000000..1b970ecce06f
--- /dev/null
+++ b/editors/pdfedit/files/patch-Makefile
@@ -0,0 +1,12 @@
+--- Makefile.orig 2008-11-13 23:11:39.000000000 +0900
++++ Makefile 2016-06-12 05:32:04.209014000 +0900
+@@ -44,6 +44,9 @@
+ cd $(KERNELROOT) && $(MAKE) install-dev
+ cd $(OSROOT) && $(MAKE) install-dev
+
++install-tools:
++ cd $(TOOLSROOT) && $(MAKE) install
++
+
+ # Common uninstall target. It depends on configuration which specific
+ # uninstallation target will be used
diff --git a/editors/pdfedit/files/patch-Makefile.flags.in b/editors/pdfedit/files/patch-Makefile.flags.in
new file mode 100644
index 000000000000..e02b249e3d3d
--- /dev/null
+++ b/editors/pdfedit/files/patch-Makefile.flags.in
@@ -0,0 +1,30 @@
+--- Makefile.flags.in.bak 2010-02-24 03:28:09.000000000 +0900
++++ Makefile.flags.in 2016-06-12 05:13:20.961050000 +0900
+@@ -131,20 +131,20 @@
+ # from autoconf --enable-observer-debug
+ OBSERVER_CXXFLAGS = @OBSERVER_CXXFLAGS@
+
+-EXTRA_UTILS_CXXFLAGS = @EXTRA_UTILS_CXXFLAGS@ -pedantic
+-EXTRA_KERNEL_CXXFLAGS = @EXTRA_KERNEL_CXXFLAGS@ -pedantic
++EXTRA_UTILS_CXXFLAGS = @EXTRA_UTILS_CXXFLAGS@
++EXTRA_KERNEL_CXXFLAGS = @EXTRA_KERNEL_CXXFLAGS@
+ EXTRA_TESTS_CXXFLAGS = @EXTRA_TESTS_CXXFLAGS@
+ EXTRA_GUI_CXXFLAGS = @EXTRA_GUI_CXXFLAGS@ -D CONFIG_DATA_PATH="$(DATA_PATH)"
+-EXTRA_XPDF_CXXFLAGS = @EXTRA_XPDF_CXXFLAGS@ -pedantic
++EXTRA_XPDF_CXXFLAGS = @EXTRA_XPDF_CXXFLAGS@
+
+ # same like for compiler stuff we also define 2 levels
+ # CONFIG_{NAME} can be used for qmake direct {NAME} can be used
+ # for compilation
+-CONFIG_CFLAGS = $(DEBUG) $(OPTIM) $(ARCH) $(WARN) $(C_EXTRA) @STACK_PROTECTOR_FLAGS@ -pipe -posix -ansi -std=c99 -pedantic
+-CONFIG_CXXFLAGS = $(DEBUG) $(OPTIM) $(ARCH) $(WARN) $(CXX_EXTRA) $(OBSERVER_CXXFLAGS) @STACK_PROTECTOR_FLAGS@ -pipe -posix -ansi -std=c++98
++CONFIG_CFLAGS = $(DEBUG) $(WARN) $(C_EXTRA) @STACK_PROTECTOR_FLAGS@
++CONFIG_CXXFLAGS = $(DEBUG) $(WARN) $(CXX_EXTRA) $(OBSERVER_CXXFLAGS) @STACK_PROTECTOR_FLAGS@
+
+-CFLAGS = $(CONFIG_CFLAGS)
+-CXXFLAGS = $(CONFIG_CXXFLAGS)
++CFLAGS += $(CONFIG_CFLAGS)
++CXXFLAGS += $(CONFIG_CXXFLAGS)
+
+ #######################################
+ # Absolute paths for all components
diff --git a/editors/pdfedit/files/patch-doc__Makefile b/editors/pdfedit/files/patch-doc__Makefile
new file mode 100644
index 000000000000..915269137241
--- /dev/null
+++ b/editors/pdfedit/files/patch-doc__Makefile
@@ -0,0 +1,12 @@
+--- doc/Makefile.orig 2008-12-03 09:16:03.000000000 +0900
++++ doc/Makefile 2011-03-21 20:34:48.000000000 +0900
+@@ -18,9 +18,6 @@
+ $(USER_MANUAL_INSTALL_TARGET) \
+ $(DOXYGEN_INSTALL_TARGET) \
+ $(ADVANCED_DOC_INSTALL_TARGET)
+- $(MKDIR) $(INSTALL_ROOT)$(DOC_PATH)/;
+- $(COPY_FILE) LICENSE.GPL ../README ../Changelog AUTHORS README-* \
+- README.cygwin $(INSTALL_ROOT)$(DOC_PATH)
+
+ # TODO maybe we should be less brutal here and delete only our files However we
+ # have no list of installed doc files. This list is probably too much effort
diff --git a/editors/pdfedit/files/patch-src-kernel-cannotation.cc b/editors/pdfedit/files/patch-src-kernel-cannotation.cc
new file mode 100644
index 000000000000..9097a4d267a0
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cannotation.cc
@@ -0,0 +1,96 @@
+--- src/kernel/cannotation.cc.orig 2009-07-27 17:18:10.000000000 +0900
++++ src/kernel/cannotation.cc 2016-06-11 05:49:08.538858000 +0900
+@@ -114,13 +114,13 @@
+ AnnotList::const_iterator implElem;
+ if((implElem=implList.find(annotType))==implList.end())
+ return false;
+- shared_ptr<IAnnotInitializator> impl=implElem->second;
++ boost::shared_ptr<IAnnotInitializator> impl=implElem->second;
+
+ // use registerd implementator
+ return (*impl)(annotDict, annotType);
+ }
+
+-bool UniversalAnnotInitializer::registerInitializer(std::string annotType, shared_ptr<IAnnotInitializator> impl, bool forceNew)
++bool UniversalAnnotInitializer::registerInitializer(std::string annotType, boost::shared_ptr<IAnnotInitializator> impl, bool forceNew)
+ {
+ AnnotList::iterator elem=implList.find(annotType);
+ if(elem!=implList.end())
+@@ -229,10 +229,10 @@
+ } // namespace utils
+
+ // initialization of static
+-shared_ptr<utils::IAnnotInitializator>
+-CAnnotation::annotInit=shared_ptr<utils::IAnnotInitializator>(new utils::UniversalAnnotInitializer());
++boost::shared_ptr<utils::IAnnotInitializator>
++CAnnotation::annotInit=boost::shared_ptr<utils::IAnnotInitializator>(new utils::UniversalAnnotInitializer());
+
+-shared_ptr<CAnnotation> CAnnotation::createAnnotation(libs::Rectangle rect, string annotType)
++boost::shared_ptr<CAnnotation> CAnnotation::createAnnotation(libs::Rectangle rect, string annotType)
+ {
+ using namespace debug;
+ using namespace utils;
+@@ -240,7 +240,7 @@
+ kernelPrintDbg(DBG_DBG, "");
+
+ // creates new empty dictionary for annotation
+- shared_ptr<CDict> annotDictionary(CDictFactory::getInstance());
++ boost::shared_ptr<CDict> annotDictionary(CDictFactory::getInstance());
+
+ // initializes annotation dictionary maintaining information:
+ // Type of annotation dictionary has to be Annot (this is not strongly
+@@ -249,7 +249,7 @@
+ checkAndReplace(annotDictionary, "Type", *typeField);
+
+ // Rectangle of annotation is constructed from given parameter
+- shared_ptr<IProperty> rectField(getIPropertyFromRectangle(rect));
++ boost::shared_ptr<IProperty> rectField(getIPropertyFromRectangle(rect));
+ checkAndReplace(annotDictionary, "Rect", *rectField);
+
+ // last modified date field (M) is initialized to current local time
+@@ -257,7 +257,7 @@
+ time(&currTime);
+ struct tm currLocalTime;
+ localtime_r(&currTime, &currLocalTime);
+- shared_ptr<IProperty> mField=getIPropertyFromDate(&currLocalTime);
++ boost::shared_ptr<IProperty> mField=getIPropertyFromDate(&currLocalTime);
+ checkAndReplace(annotDictionary, "M", *mField);
+
+ // initializes annotation dictionary according desired type - at least Type
+@@ -270,7 +270,7 @@
+ if(!initialized)
+ kernelPrintDbg(DBG_WARN, "Unable to initialize annotation dictionary with type="<<annotType);
+
+- return shared_ptr<CAnnotation>(new CAnnotation(annotDictionary));
++ return boost::shared_ptr<CAnnotation>(new CAnnotation(annotDictionary));
+ }
+
+ void CAnnotation::invalidate()
+@@ -285,8 +285,8 @@
+ // Uses this instance as newValue, but uses EmptyDeallocator to keep
+ // instance alive when shared_ptr tries to destroy its content.
+ // context is empty
+- shared_ptr<CAnnotation> current(this, EmptyDeallocator<CAnnotation>());
+- notifyObservers(current, shared_ptr<ChangeContext>());
++ boost::shared_ptr<CAnnotation> current(this, EmptyDeallocator<CAnnotation>());
++ notifyObservers(current, boost::shared_ptr<ChangeContext>());
+ }
+
+ CAnnotation::AnnotType CAnnotation::getType()const
+@@ -295,14 +295,14 @@
+
+ try
+ {
+- shared_ptr<IProperty> subTypeProp=annotDictionary->getProperty("Subtype");
++ boost::shared_ptr<IProperty> subTypeProp=annotDictionary->getProperty("Subtype");
+ if(!isName(subTypeProp))
+ {
+ // TODO may be problem if value is indirect (what is not very usual)
+ kernelPrintDbg(DBG_WARN, "Subtype is not Name. Type="<<subTypeProp->getType());
+ return Unknown;
+ }
+- shared_ptr<CName> subTypeName=IProperty::getSmartCObjectPtr<CName>(subTypeProp);
++ boost::shared_ptr<CName> subTypeName=IProperty::getSmartCObjectPtr<CName>(subTypeProp);
+ string typeName;
+ subTypeName->getValue(typeName);
+ return utils::annotTypeMapping(typeName);
diff --git a/editors/pdfedit/files/patch-src-kernel-carray.cc b/editors/pdfedit/files/patch-src-kernel-carray.cc
new file mode 100644
index 000000000000..765bd23e503a
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-carray.cc
@@ -0,0 +1,118 @@
+--- src/kernel/carray.cc.orig 2009-09-11 21:02:56.000000000 +0900
++++ src/kernel/carray.cc 2016-06-11 05:52:59.028080000 +0900
+@@ -80,7 +80,7 @@
+ //
+ //
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CArray::getProperty (PropertyId id) const
+ {
+ //kernelPrintDbg (debug::DBG_DBG,"getProperty() " << id);
+@@ -88,7 +88,7 @@
+ if (id >= value.size())
+ throw OutOfRange ();
+
+- shared_ptr<IProperty> ip = value[id];
++ boost::shared_ptr<IProperty> ip = value[id];
+ // Set mode only if pdf is valid
+ _setMode (ip,id);
+
+@@ -146,7 +146,7 @@
+ // Check whether we can make the change
+ this->canChange();
+
+- shared_ptr<IProperty> oldip = value[id];
++ boost::shared_ptr<IProperty> oldip = value[id];
+
+ // Delete that item
+ value.erase (remove (value.begin(), value.end(), oldip));
+@@ -156,11 +156,11 @@
+ assert (hasValidRef (this));
+
+ // Create contest
+- shared_ptr<ObserverContext> context (_createContext (oldip,id));
++ boost::shared_ptr<ObserverContext> context (_createContext (oldip,id));
+
+ try {
+ // notify observers and dispatch the change
+- _objectChanged (shared_ptr<IProperty> (new CNull), context);
++ _objectChanged (boost::shared_ptr<IProperty> (new CNull), context);
+
+ }catch (PdfException&)
+ {
+@@ -181,7 +181,7 @@
+ //
+ // Correctly to add an object (without name) can be done only to Array object
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CArray::addProperty (const IProperty& newIp)
+ {
+ //kernelPrintDbg (debug::DBG_DBG,"addProperty(...)");
+@@ -193,7 +193,7 @@
+ //
+ // REMARK: because of the compiler, we can't put PropertyId here
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CArray::addProperty (PropertyId position, const IProperty& newIp)
+ {
+ //kernelPrintDbg (debug::DBG_DBG,"addProperty(" << position << ")");
+@@ -208,7 +208,7 @@
+ this->canChange();
+
+ // Clone the added property
+- shared_ptr<IProperty> newIpClone = newIp.clone ();
++ boost::shared_ptr<IProperty> newIpClone = newIp.clone ();
+ assert (newIpClone);
+
+ // Inherit id, gen number and pdf
+@@ -230,7 +230,7 @@
+ assert (hasValidRef (this));
+
+ // Create contest
+- shared_ptr<ObserverContext> context (_createContext(shared_ptr<IProperty>(new CNull ()), position));
++ boost::shared_ptr<ObserverContext> context (_createContext(boost::shared_ptr<IProperty>(new CNull ()), position));
+
+ try {
+ // notify observers and dispatch the change
+@@ -256,7 +256,7 @@
+ //
+ //
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CArray::setProperty (PropertyId id, IProperty& newIp)
+ {
+ //kernelPrintDbg (debug::DBG_DBG, "setProperty(" << id << ")");
+@@ -269,9 +269,9 @@
+ this->canChange();
+
+ // Save the old one
+- shared_ptr<IProperty> oldip = value[id];
++ boost::shared_ptr<IProperty> oldip = value[id];
+ // Clone the added property
+- shared_ptr<IProperty> newIpClone = newIp.clone ();
++ boost::shared_ptr<IProperty> newIpClone = newIp.clone ();
+ assert (newIpClone);
+
+ // Inherit id, gen number and pdf
+@@ -289,7 +289,7 @@
+ assert (hasValidRef (this));
+
+ // Create contest
+- shared_ptr<ObserverContext> context (_createContext (oldip,id));
++ boost::shared_ptr<ObserverContext> context (_createContext (oldip,id));
+
+ try {
+ // notify observers and dispatch the change
+@@ -437,7 +437,7 @@
+ //
+ //
+ IProperty::ObserverContext*
+-CArray::_createContext (shared_ptr<IProperty> changedIp, PropertyId id)
++CArray::_createContext (boost::shared_ptr<IProperty> changedIp, PropertyId id)
+ {
+ //kernelPrintDbg (debug::DBG_DBG, "");
+
diff --git a/editors/pdfedit/files/patch-src-kernel-ccontentstream.cc b/editors/pdfedit/files/patch-src-kernel-ccontentstream.cc
new file mode 100644
index 000000000000..1c0f2377baaa
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-ccontentstream.cc
@@ -0,0 +1,152 @@
+--- src/kernel/ccontentstream.cc.orig 2010-04-28 03:42:09.000000000 +0900
++++ src/kernel/ccontentstream.cc 2016-06-11 06:33:26.838638000 +0900
+@@ -68,7 +68,7 @@
+ * @param observer Operand observer.
+ */
+ void
+- opsSetPdfRefCs (shared_ptr<PdfOperator> first,
++ opsSetPdfRefCs (boost::shared_ptr<PdfOperator> first,
+ boost::weak_ptr<CPdf> pdf,
+ IndiRef rf,
+ CContentStream& cs,
+@@ -204,7 +204,7 @@
+ }else
+ {// We have an OPERAND
+
+- shared_ptr<IProperty> pIp (createObjFromXpdfObj (*o));
++ boost::shared_ptr<IProperty> pIp (createObjFromXpdfObj (*o));
+ operands.push_back (pIp);
+ }
+
+@@ -223,14 +223,14 @@
+ * @param streamreader CStreams parser from which we get an xpdf object.
+ * @param operands Operands of operator. They are shared through subcalls.
+ */
+- shared_ptr<PdfOperator>
++ boost::shared_ptr<PdfOperator>
+ createOperatorFromStream (CStreamsXpdfReader<CContentStream::CStreams>& streamreader,
+ PdfOperator::Operands& operands)
+ {
+ // Get operands
+ boost::shared_ptr< ::Object> o(XPdfObjectFactory::getInstance(), xpdf::object_deleter());
+ if (!createOperandsFromStream (streamreader, operands, o))
+- return shared_ptr<PdfOperator> ();
++ return boost::shared_ptr<PdfOperator> ();
+
+ //
+ // SPECIAL CASE for inline image (stream within a text stream)
+@@ -246,8 +246,8 @@
+ throw ElementBadTypeException ("Content stream operator has incorrect operand type.");
+ }
+
+- shared_ptr<CInlineImage> inimg (getInlineImage (streamreader));
+- return shared_ptr<PdfOperator> (new InlineImageCompositePdfOperator (inimg, chcktp->name, chcktp->endTag));
++ boost::shared_ptr<CInlineImage> inimg (getInlineImage (streamreader));
++ return boost::shared_ptr<PdfOperator> (new InlineImageCompositePdfOperator (inimg, chcktp->name, chcktp->endTag));
+ }
+
+ // factory function for all other operators
+@@ -269,11 +269,11 @@
+ *
+ * @return New pdf operator.
+ */
+- shared_ptr<PdfOperator>
++ boost::shared_ptr<PdfOperator>
+ parseOp (CStreamsXpdfReader<CContentStream::CStreams>& streamreader, PdfOperator::Operands& operands)
+ {
+ // Create operator with its operands
+- shared_ptr<PdfOperator> result = createOperatorFromStream (streamreader, operands);
++ boost::shared_ptr<PdfOperator> result = createOperatorFromStream (streamreader, operands);
+
+ if (result && isCompositeOp (result) && !isInlineImageOp (result))
+ {
+@@ -283,7 +283,7 @@
+ bool foundEndTag = false;
+
+ // The same as in (re)parse
+- shared_ptr<PdfOperator> newop, previousLast = result;
++ boost::shared_ptr<PdfOperator> newop, previousLast = result;
+
+ //
+ // Use recursion to get all operators
+@@ -348,7 +348,7 @@
+ if (!hasValidPdf (*it) || !hasValidRef (*it))
+ throw CObjInvalidObject ();
+ }
+- weak_ptr<CPdf> pdf = streams.front()->getPdf ();
++ boost::weak_ptr<CPdf> pdf = streams.front()->getPdf ();
+ assert (pdf.lock());
+ IndiRef rf = streams.front()->getIndiRef ();
+
+@@ -357,8 +357,8 @@
+ streamreader.open ();
+
+ PdfOperator::Operands operands;
+- shared_ptr<PdfOperator> topoperator (new UnknownCompositePdfOperator ("",""));
+- shared_ptr<PdfOperator> newop, previousLast = topoperator;
++ boost::shared_ptr<PdfOperator> topoperator (new UnknownCompositePdfOperator ("",""));
++ boost::shared_ptr<PdfOperator> newop, previousLast = topoperator;
+
+ //
+ // Parsing can throw, if so the stream is invalid
+@@ -469,10 +469,10 @@
+ typedef PdfOperator::BBox BBox;
+
+ // Init resources
+- void operator() (shared_ptr<GfxResources>) const {}
++ void operator() (boost::shared_ptr<GfxResources>) const {}
+
+ // Loop through operators
+- void operator() (shared_ptr<PdfOperator> op, BBox rc, const GfxState&) const
++ void operator() (boost::shared_ptr<PdfOperator> op, BBox rc, const GfxState&) const
+ {
+ // If not initialized, means an error occured (missing font etc..)
+ if (!BBox::isInitialized (rc))
+@@ -736,7 +736,7 @@
+
+ // Notify observers
+ boost::shared_ptr<CContentStream> current (this, EmptyDeallocator<CContentStream> ());
+- this->notifyObservers (current, shared_ptr<const ObserverContext> (new BasicObserverContext (current)));
++ this->notifyObservers (current, boost::shared_ptr<const ObserverContext> (new BasicObserverContext (current)));
+ }
+
+
+@@ -856,7 +856,7 @@
+ // Set correct IndiRef, CPdf and cs to inserted operator
+ assert (hasValidRef (cstreams.front()));
+ assert (hasValidPdf (cstreams.front()));
+- weak_ptr<CPdf> pdf = cstreams.front()->getPdf();
++ boost::weak_ptr<CPdf> pdf = cstreams.front()->getPdf();
+ assert (pdf.lock());
+ IndiRef rf = cstreams.front()->getIndiRef ();
+ opsSetPdfRefCs (newOper, pdf, rf, *this, operandobserver);
+@@ -937,7 +937,7 @@
+ // Check whether we can make the change
+ cstreams.front()->canChange();
+ IndiRef rf = cstreams.front()->getIndiRef ();
+- weak_ptr<CPdf> pdf = cstreams.front()->getPdf();
++ boost::weak_ptr<CPdf> pdf = cstreams.front()->getPdf();
+ assert (pdf.lock());
+ // set accordingly
+ opsSetPdfRefCs (newoper, pdf, rf, *this, operandobserver);
+@@ -949,9 +949,9 @@
+ { // Insert into
+ opsSetPdfRefCs (newoper, pdf, rf, *this, operandobserver);
+
+- shared_ptr<PdfOperator> secondoper = operators.front();
++ boost::shared_ptr<PdfOperator> secondoper = operators.front();
+ operators.push_front (newoper);
+- shared_ptr<PdfOperator> lastofnew = getLastOperator (newoper);
++ boost::shared_ptr<PdfOperator> lastofnew = getLastOperator (newoper);
+ secondoper->setPrev (lastofnew);
+ lastofnew->setNext (secondoper);
+ }
+@@ -992,7 +992,7 @@
+ // Set correct IndiRef, CPdf and cs to inserted operator
+ assert (hasValidRef (cstreams.front()));
+ assert (hasValidPdf (cstreams.front()));
+- weak_ptr<CPdf> pdf = cstreams.front()->getPdf();
++ boost::weak_ptr<CPdf> pdf = cstreams.front()->getPdf();
+ assert (pdf.lock());
+ IndiRef rf = cstreams.front()->getIndiRef ();
+ opsSetPdfRefCs (newOper, pdf, rf, *this, operandobserver);
diff --git a/editors/pdfedit/files/patch-src-kernel-cdict.cc b/editors/pdfedit/files/patch-src-kernel-cdict.cc
new file mode 100644
index 000000000000..3c46524d3582
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cdict.cc
@@ -0,0 +1,149 @@
+--- src/kernel/cdict.cc.orig 2010-04-28 03:42:09.000000000 +0900
++++ src/kernel/cdict.cc 2016-06-11 06:01:28.994503000 +0900
+@@ -95,7 +95,7 @@
+ //
+ //
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CDict::getProperty (PropertyId id) const
+ {
+ //kernelPrintDbg (debug::DBG_DBG,"getProperty() " << id);
+@@ -111,7 +111,7 @@
+ if (it == value.end())
+ throw ElementNotFoundException ("", "");
+
+- shared_ptr<IProperty> ip = cmp.getIProperty ();
++ boost::shared_ptr<IProperty> ip = cmp.getIProperty ();
+
+ // Set mode only if pdf is valid
+ _setMode (ip,id);
+@@ -188,7 +188,7 @@
+ if (oldit == value.end())
+ throw ElementNotFoundException ("CDict", "item not found");
+
+- shared_ptr<IProperty> oldip = cmp.getIProperty ();
++ boost::shared_ptr<IProperty> oldip = cmp.getIProperty ();
+
+ // Delete that item
+ value.erase (oldit);
+@@ -198,11 +198,11 @@
+ assert (hasValidRef (this));
+
+ // Indicate that this object has changed
+- shared_ptr<ObserverContext> context (_createContext (oldip,id));
++ boost::shared_ptr<ObserverContext> context (_createContext (oldip,id));
+
+ try {
+ // notify observers and dispatch the change
+- _objectChanged (shared_ptr<IProperty> (new CNull), context);
++ _objectChanged (boost::shared_ptr<IProperty> (new CNull), context);
+
+ }catch (PdfException&)
+ {
+@@ -224,7 +224,7 @@
+ //
+ // Correctly add an object (with name) can be done only to Dict and Stream object
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CDict::addProperty (const string& propertyName, const IProperty& newIp)
+ {
+ kernelPrintDbg (debug::DBG_DBG,"addProperty( " << propertyName << ",...)");
+@@ -239,7 +239,7 @@
+ throw CObjInvalidObject ();
+
+ // Clone the added property
+- shared_ptr<IProperty> newIpClone = newIp.clone ();
++ boost::shared_ptr<IProperty> newIpClone = newIp.clone ();
+ if (newIpClone)
+ {
+ // Inherit id, gen number and pdf
+@@ -260,7 +260,7 @@
+ assert (hasValidRef (this));
+
+ // notify observers and dispatch change
+- shared_ptr<ObserverContext> context (_createContext(shared_ptr<IProperty>(new CNull ()), propertyName));
++ boost::shared_ptr<ObserverContext> context (_createContext(boost::shared_ptr<IProperty>(new CNull ()), propertyName));
+
+ try {
+ // notify observers and dispatch the change
+@@ -285,7 +285,7 @@
+ //
+ //
+ //
+-shared_ptr<IProperty>
++boost::shared_ptr<IProperty>
+ CDict::setProperty (PropertyId id, IProperty& newIp)
+ {
+ kernelPrintDbg (debug::DBG_DBG, "setProperty(" << id << ")");
+@@ -308,9 +308,9 @@
+ return addProperty (id, newIp);
+
+ // Save the old one
+- shared_ptr<IProperty> oldIp = cmp.getIProperty ();
++ boost::shared_ptr<IProperty> oldIp = cmp.getIProperty ();
+ // Clone the added property
+- shared_ptr<IProperty> newIpClone = newIp.clone ();
++ boost::shared_ptr<IProperty> newIpClone = newIp.clone ();
+ assert (newIpClone);
+
+ // Inherit id, gen number and pdf
+@@ -328,7 +328,7 @@
+ assert (hasValidRef (this));
+
+ // Notify observers and dispatch change
+- shared_ptr<ObserverContext> context (_createContext (oldIp,id));
++ boost::shared_ptr<ObserverContext> context (_createContext (oldIp,id));
+
+ try {
+ // notify observers and dispatch the change
+@@ -382,7 +382,7 @@
+ Value::const_iterator it = value.begin();
+ for (; it != value.end(); ++it)
+ {
+- shared_ptr<IProperty> prop = it->second;
++ boost::shared_ptr<IProperty> prop = it->second;
+ Object * propObj = prop->_makeXpdfObject();
+ dictObj->dictAdd(copyString((it->first).c_str()), propObj);
+ gfree(propObj);
+@@ -398,7 +398,7 @@
+ //
+ void
+ CDict::_objectChanged
+- (shared_ptr<IProperty> newValue, shared_ptr<const ObserverContext> context)
++ (boost::shared_ptr<IProperty> newValue, boost::shared_ptr<const ObserverContext> context)
+ {
+ // Do not notify anything if we are not in a valid pdf
+ if (!hasValidPdf (this))
+@@ -424,10 +424,10 @@
+ // Set mode
+ //
+ void
+-CDict::_setMode (shared_ptr<IProperty> ip, PropertyId id) const
++CDict::_setMode (boost::shared_ptr<IProperty> ip, PropertyId id) const
+ {
+ configuration::ModeController* modecontroller = NULL;
+- shared_ptr<CPdf> p = this->getPdf().lock();
++ boost::shared_ptr<CPdf> p = this->getPdf().lock();
+ if ( p && (NULL != (modecontroller=p->getModeController())))
+ {
+ assert (modecontroller);
+@@ -451,7 +451,7 @@
+ }else
+ { // We have found a type
+ string tmp;
+- shared_ptr<IProperty> type = cmp.getIProperty ();
++ boost::shared_ptr<IProperty> type = cmp.getIProperty ();
+ if (isName (type))
+ IProperty::getSmartCObjectPtr<CName>(type)->getValue(tmp);
+ mode = modecontroller->getMode (tmp, id);
+@@ -498,7 +498,7 @@
+ //
+ //
+ IProperty::ObserverContext*
+-CDict::_createContext (shared_ptr<IProperty> changedIp, PropertyId id)
++CDict::_createContext (boost::shared_ptr<IProperty> changedIp, PropertyId id)
+ {
+ // Create the context
+ return new CDictComplexObserverContext (changedIp, id);
diff --git a/editors/pdfedit/files/patch-src-kernel-cdict.h b/editors/pdfedit/files/patch-src-kernel-cdict.h
new file mode 100644
index 000000000000..a804622394e6
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cdict.h
@@ -0,0 +1,20 @@
+--- src/kernel/cdict.h.orig 2016-06-11 05:41:31.261535000 +0900
++++ src/kernel/cdict.h 2016-06-11 05:44:42.503741000 +0900
+@@ -799,7 +799,7 @@
+ }
+
+ // Cast it to dict
+- CDict* dict = dynamic_cast<const CDict*> (&ip);
++ const CDict* dict = dynamic_cast<const CDict*> (&ip);
+ setSimpleValueInDict<Value, ItemType, ItemPType> (*dict, name, val);
+ }
+
+@@ -812,7 +812,7 @@
+ throw ElementBadTypeException ("");
+
+ // Cast it to dict
+- CDict* dict = dynamic_cast<const CDict*> (&ip);
++ const CDict* dict = dynamic_cast<const CDict*> (&ip);
+
+ setSimpleValueInDict<ItemType> (*dict, name, val);
+ }
diff --git a/editors/pdfedit/files/patch-src-kernel-cobject.cc b/editors/pdfedit/files/patch-src-kernel-cobject.cc
new file mode 100644
index 000000000000..6e0819c6f56f
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cobject.cc
@@ -0,0 +1,11 @@
+--- src/kernel/cobject.cc.orig 2016-06-11 06:02:30.123217000 +0900
++++ src/kernel/cobject.cc 2016-06-11 06:02:50.095614000 +0900
+@@ -60,7 +60,7 @@
+ if (!hasValidPdf (ip))
+ throw CObjInvalidOperation ();
+
+- shared_ptr<CPdf> pdf = ip.getPdf ().lock ();
++ boost::shared_ptr<CPdf> pdf = ip.getPdf ().lock ();
+ IndiRef ref = ip.getIndiRef();
+ if ( &ip == (indiObj=pdf->getIndirectProperty(ref)).get() )
+ return false;
diff --git a/editors/pdfedit/files/patch-src-kernel-cobject2string.cc b/editors/pdfedit/files/patch-src-kernel-cobject2string.cc
new file mode 100644
index 000000000000..615665f4ceda
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cobject2string.cc
@@ -0,0 +1,11 @@
+--- src/kernel/cobject2string.cc.orig 2016-06-11 06:20:13.726775000 +0900
++++ src/kernel/cobject2string.cc 2016-06-11 06:20:28.472463000 +0900
+@@ -81,7 +81,7 @@
+ void
+ simpleValueFromString (const std::string& str, double& val)
+ {
+- shared_ptr<Object> ptrObj (xpdfObjFromString(str), xpdf::object_deleter());
++ boost::shared_ptr<Object> ptrObj (xpdfObjFromString(str), xpdf::object_deleter());
+
+ assert (objReal == ptrObj->getType ());
+ if (objReal != ptrObj->getType() && objInt != ptrObj->getType())
diff --git a/editors/pdfedit/files/patch-src-kernel-cobject2xpdf.cc b/editors/pdfedit/files/patch-src-kernel-cobject2xpdf.cc
new file mode 100644
index 000000000000..95d4d7ce45d9
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cobject2xpdf.cc
@@ -0,0 +1,47 @@
+--- src/kernel/cobject2xpdf.cc.orig 2016-06-11 06:17:18.518993000 +0900
++++ src/kernel/cobject2xpdf.cc 2016-06-11 06:18:14.021576000 +0900
+@@ -453,16 +453,16 @@
+ // Get Object at i-th position
+ array.arrayGetNF (i, obj.get());
+
+- shared_ptr<IProperty> cobj;
++ boost::shared_ptr<IProperty> cobj;
+ // Create CObject from it
+ if (isPdfValid(pdf))
+ {
+ hasValidRef (ip);
+- cobj = shared_ptr<IProperty> (createObjFromXpdfObj (pdf, *obj, ip.getIndiRef()));
++ cobj = boost::shared_ptr<IProperty> (createObjFromXpdfObj (pdf, *obj, ip.getIndiRef()));
+
+ }else
+ {
+- cobj = shared_ptr<IProperty> (createObjFromXpdfObj (*obj));
++ cobj = boost::shared_ptr<IProperty> (createObjFromXpdfObj (*obj));
+ }
+
+ if (cobj)
+@@ -504,12 +504,12 @@
+ obj->free ();
+ dict.dictGetValNF (i,obj.get());
+
+- shared_ptr<IProperty> cobj;
++ boost::shared_ptr<IProperty> cobj;
+ // Create CObject from it
+ if (isPdfValid (pdf))
+- cobj = shared_ptr<IProperty> (createObjFromXpdfObj (pdf, *obj, ip.getIndiRef()));
++ cobj = boost::shared_ptr<IProperty> (createObjFromXpdfObj (pdf, *obj, ip.getIndiRef()));
+ else
+- cobj = shared_ptr<IProperty> (createObjFromXpdfObj (*obj));
++ cobj = boost::shared_ptr<IProperty> (createObjFromXpdfObj (*obj));
+
+ if (cobj)
+ {
+@@ -1021,7 +1021,7 @@
+ // for Dict -> String conversion
+ // initDict increases streamDict's reference thus we need to
+ // decrease it back by free
+- shared_ptr< ::Object> streamDictObj(XPdfObjectFactory::getInstance(), xpdf::object_deleter());
++ boost::shared_ptr< ::Object> streamDictObj(XPdfObjectFactory::getInstance(), xpdf::object_deleter());
+ streamDictObj->initDict((Dict *)streamObject.streamGetDict());
+ std::string dict;
+ xpdfObjToString(*streamDictObj, dict);
diff --git a/editors/pdfedit/files/patch-src-kernel-cobjecthelpers.cc b/editors/pdfedit/files/patch-src-kernel-cobjecthelpers.cc
new file mode 100644
index 000000000000..e47904472ee3
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cobjecthelpers.cc
@@ -0,0 +1,142 @@
+--- src/kernel/cobjecthelpers.cc.orig 2016-06-11 06:22:02.988983000 +0900
++++ src/kernel/cobjecthelpers.cc 2016-06-11 06:23:38.529873000 +0900
+@@ -42,14 +42,14 @@
+ {
+ using namespace boost;
+
+- shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
++ boost::shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
+ if(prop_ptr->getType() != pInt)
+ {
+ // malformed dictionary
+ throw ElementBadTypeException(name/*, prop_ptr->getType()*/);
+ }
+
+- shared_ptr<CInt> int_ptr=IProperty::getSmartCObjectPtr<CInt>(prop_ptr);
++ boost::shared_ptr<CInt> int_ptr=IProperty::getSmartCObjectPtr<CInt>(prop_ptr);
+ return int_ptr->getValue();
+ }
+
+@@ -57,14 +57,14 @@
+ {
+ using namespace boost;
+
+- shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
++ boost::shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
+ if(prop_ptr->getType() != pRef)
+ {
+ // malformed dictionary
+ throw ElementBadTypeException(name/*, prop_ptr->getType()*/);
+ }
+
+- shared_ptr<CRef> int_ptr=IProperty::getSmartCObjectPtr<CRef>(prop_ptr);
++ boost::shared_ptr<CRef> int_ptr=IProperty::getSmartCObjectPtr<CRef>(prop_ptr);
+ return int_ptr->getValue();
+ }
+
+@@ -72,14 +72,14 @@
+ {
+ using namespace boost;
+
+- shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
++ boost::shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
+ if(prop_ptr->getType() != pString)
+ {
+ // malformed dictionary
+ throw ElementBadTypeException(name);
+ }
+
+- shared_ptr<CString> str_ptr=IProperty::getSmartCObjectPtr<CString>(prop_ptr);
++ boost::shared_ptr<CString> str_ptr=IProperty::getSmartCObjectPtr<CString>(prop_ptr);
+ return str_ptr->getValue();
+ }
+
+@@ -87,14 +87,14 @@
+ {
+ using namespace boost;
+
+- shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
++ boost::shared_ptr<IProperty> prop_ptr=dict->getProperty(name);
+ if(prop_ptr->getType() != pName)
+ {
+ // malformed dictionary
+ throw ElementBadTypeException(name);
+ }
+
+- shared_ptr<CName> name_ptr=IProperty::getSmartCObjectPtr<CName>(prop_ptr);
++ boost::shared_ptr<CName> name_ptr=IProperty::getSmartCObjectPtr<CName>(prop_ptr);
+ std::string value;
+ name_ptr->getValue(value);
+
+@@ -125,7 +125,7 @@
+ // gets reference value and dereferences indirect object
+ IndiRef ref;
+ IProperty::getSmartCObjectPtr<CRef>(refProp)->getValue(ref);
+- shared_ptr<CPdf> pdf = refProp->getPdf().lock();
++ boost::shared_ptr<CPdf> pdf = refProp->getPdf().lock();
+ assert(pdf);
+ boost::shared_ptr<IProperty> indirect_ptr=pdf->getIndirectProperty(ref);
+ if(indirect_ptr->getType() != pDict)
+@@ -237,7 +237,7 @@
+
+ IndiRef ref;
+ IProperty::getSmartCObjectPtr<CRef>(ip)->getValue(ref);
+- shared_ptr<CPdf> pdf = ip->getPdf().lock();
++ boost::shared_ptr<CPdf> pdf = ip->getPdf().lock();
+ assert(pdf);
+ return pdf->getIndirectProperty (ref);
+
+@@ -254,7 +254,7 @@
+
+ // pdf specification says that two diagonal corners should be used and
+ // readers has to be prepared to normalize it
+- shared_ptr<CArray> array(CArrayFactory::getInstance());
++ boost::shared_ptr<CArray> array(CArrayFactory::getInstance());
+ scoped_ptr<IProperty> llx(CRealFactory::getInstance(rect.xleft));
+ scoped_ptr<IProperty> lly(CRealFactory::getInstance(rect.yleft));
+ scoped_ptr<IProperty> urx(CRealFactory::getInstance(rect.xright));
+@@ -267,12 +267,12 @@
+ return array;
+ }
+
+-void getRectangleFromProperty(const shared_ptr<IProperty> prop, libs::Rectangle & rect)
++void getRectangleFromProperty(const boost::shared_ptr<IProperty> prop, libs::Rectangle & rect)
+ {
+ if(!isArray(prop))
+ throw CObjBadValue();
+
+- shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray>(prop);
++ boost::shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray>(prop);
+ if(array->getPropertyCount() != 4)
+ throw CObjBadValue();
+
+@@ -286,7 +286,7 @@
+ {
+ using namespace boost;
+
+- shared_ptr<CString> dateString(CStringFactory::getInstance());
++ boost::shared_ptr<CString> dateString(CStringFactory::getInstance());
+ char buffer[30];
+ memset(buffer, '\0', sizeof(buffer));
+
+@@ -304,7 +304,7 @@
+ {
+ using namespace boost;
+
+- shared_ptr<IProperty> value;
++ boost::shared_ptr<IProperty> value;
+ try
+ {
+ value=annotDict->getProperty(fieldName);
+@@ -323,9 +323,9 @@
+ //
+ //
+ ::XRef*
+-getXRef (shared_ptr<IProperty> ip)
++getXRef (boost::shared_ptr<IProperty> ip)
+ {
+- shared_ptr<CPdf> pdf = ip->getPdf().lock();
++ boost::shared_ptr<CPdf> pdf = ip->getPdf().lock();
+ if(!pdf)
+ return NULL;
+ return pdf->getCXref();
diff --git a/editors/pdfedit/files/patch-src-kernel-contentschangetag.cc b/editors/pdfedit/files/patch-src-kernel-contentschangetag.cc
new file mode 100644
index 000000000000..8325dfe01201
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-contentschangetag.cc
@@ -0,0 +1,25 @@
+--- src/kernel/contentschangetag.cc.orig 2016-06-12 02:53:06.107246000 +0900
++++ src/kernel/contentschangetag.cc 2016-06-12 02:53:37.952146000 +0900
+@@ -51,11 +51,11 @@
+ PdfOperator::Operands opers;
+
+ // Name or our application
+- shared_ptr<CName> name (new CName (CHANGE_TAG_ID));
++ boost::shared_ptr<CName> name (new CName (CHANGE_TAG_ID));
+ opers.push_back (name);
+
+ // Dict with our informatio
+- shared_ptr<CDict> dict (new CDict ());
++ boost::shared_ptr<CDict> dict (new CDict ());
+ time_t t = time (NULL);
+ ostringstream oss;
+ oss << t;
+@@ -72,7 +72,7 @@
+ //
+ //
+ time_t
+-ContentsChangeTag::getTime (shared_ptr<PdfOperator> op)
++ContentsChangeTag::getTime (boost::shared_ptr<PdfOperator> op)
+ {
+ assert (op);
+
diff --git a/editors/pdfedit/files/patch-src-kernel-cpage.cc b/editors/pdfedit/files/patch-src-kernel-cpage.cc
new file mode 100644
index 000000000000..aad73157d462
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cpage.cc
@@ -0,0 +1,35 @@
+--- src/kernel/cpage.cc.orig 2016-06-11 10:20:24.977833000 +0900
++++ src/kernel/cpage.cc 2016-06-11 10:21:15.509192000 +0900
+@@ -88,9 +88,9 @@
+ //
+ // Init modules
+ //
+- _contents = shared_ptr<CPageContents> (new CPageContents(this));
++ _contents = boost::shared_ptr<CPageContents> (new CPageContents(this));
+ _modules.push_back (_contents);
+- _display = shared_ptr<CPageDisplay> (new CPageDisplay(this));
++ _display = boost::shared_ptr<CPageDisplay> (new CPageDisplay(this));
+ _modules.push_back (_display);
+ _fonts = boost::shared_ptr<CPageFonts> (new CPageFonts(this));
+ _modules.push_back (_fonts);
+@@ -252,7 +252,7 @@
+ CPage::getPagePosition () const
+ {
+ if (hasValidPdf (_dict))
+- return _dict->getPdf().lock()->getPagePosition (shared_ptr<CPage>(const_cast<CPage*>(this),EmptyDeallocator<CPage> ()));
++ return _dict->getPdf().lock()->getPagePosition (boost::shared_ptr<CPage>(const_cast<CPage*>(this),EmptyDeallocator<CPage> ()));
+
+ throw CObjInvalidOperation ();
+ }
+@@ -284,9 +284,9 @@
+
+ // Notify observers
+ if (invalid)
+- this->notifyObservers (current, shared_ptr<const ObserverContext> ());
++ this->notifyObservers (current, boost::shared_ptr<const ObserverContext> ());
+ else
+- this->notifyObservers (current, shared_ptr<const ObserverContext> (new BasicObserverContext (current)));
++ this->notifyObservers (current, boost::shared_ptr<const ObserverContext> (new BasicObserverContext (current)));
+ }
+
+
diff --git a/editors/pdfedit/files/patch-src-kernel-cpageannots.cc b/editors/pdfedit/files/patch-src-kernel-cpageannots.cc
new file mode 100644
index 000000000000..3d7e87d13a98
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cpageannots.cc
@@ -0,0 +1,201 @@
+--- src/kernel/cpageannots.cc.orig 2016-06-12 03:18:12.132253000 +0900
++++ src/kernel/cpageannots.cc 2016-06-12 03:21:24.901602000 +0900
+@@ -180,24 +180,24 @@
+
+ typedef struct reg_annots
+ {
+- void operator() (shared_ptr<IProperty> obj, boost::shared_ptr<IPropertyObserver> obs)
++ void operator() (boost::shared_ptr<IProperty> obj, boost::shared_ptr<IPropertyObserver> obs)
+ { REGISTER_SHAREDPTR_OBSERVER (obj, obs); }
+ }reg_annots;
+
+ typedef struct unreg_annots
+ {
+- void operator() (shared_ptr<IProperty> obj, boost::shared_ptr<IPropertyObserver> obs)
++ void operator() (boost::shared_ptr<IProperty> obj, boost::shared_ptr<IPropertyObserver> obs)
+ { UNREGISTER_SHAREDPTR_OBSERVER (obj, obs); }
+ }unreg_annots;
+
+ // generic {un}register function
+ template<typename T>
+- void egister_annots (shared_ptr<IProperty> annots,
++ void egister_annots (boost::shared_ptr<IProperty> annots,
+ T egister,
+ boost::shared_ptr<IPropertyObserver> _prop_wd,
+ boost::shared_ptr<IPropertyObserver> _array_wd)
+ {
+- shared_ptr<CArray> annotsArray;
++ boost::shared_ptr<CArray> annotsArray;
+ if(isRef(annots))
+ {
+ egister(annots, _prop_wd);
+@@ -237,7 +237,7 @@
+ //
+ //
+ void
+-CPageAnnots::reg_observers(shared_ptr<IProperty> annots)
++CPageAnnots::reg_observers(boost::shared_ptr<IProperty> annots)
+ {
+ kernelPrintDbg(DBG_DBG, "");
+
+@@ -251,7 +251,7 @@
+ REGISTER_SHAREDPTR_OBSERVER(_page->getDictionary(), _prop_wd);
+ if(_page->getDictionary()->containsProperty(Specification::Page::ANNOTS))
+ {
+- shared_ptr<IProperty> annotsProp=_page->getDictionary()->getProperty(Specification::Page::ANNOTS);
++ boost::shared_ptr<IProperty> annotsProp=_page->getDictionary()->getProperty(Specification::Page::ANNOTS);
+ reg_observers(annotsProp);
+ }
+ }
+@@ -275,7 +275,7 @@
+ UNREGISTER_SHAREDPTR_OBSERVER(_page->getDictionary(), _prop_wd);
+ if(_page->getDictionary()->containsProperty(Specification::Page::ANNOTS))
+ {
+- shared_ptr<IProperty> annotsProp=_page->getDictionary()->getProperty(Specification::Page::ANNOTS);
++ boost::shared_ptr<IProperty> annotsProp=_page->getDictionary()->getProperty(Specification::Page::ANNOTS);
+ unreg_observers(annotsProp);
+ }
+ }
+@@ -299,12 +299,12 @@
+ {
+ try
+ {
+- shared_ptr<CDict> annotDict=getCObjectFromRef<CDict>(oldValue);
++ boost::shared_ptr<CDict> annotDict=getCObjectFromRef<CDict>(oldValue);
+ Annotations::iterator i;
+ bool erased = false;
+ for(i=_annotations.begin(); i!=_annotations.end(); ++i)
+ {
+- shared_ptr<CAnnotation> annot=*i;
++ boost::shared_ptr<CAnnotation> annot=*i;
+ if(annot->getDictionary()==annotDict)
+ {
+ kernelPrintDbg(debug::DBG_DBG, "Annotation maintaining oldValue found and removed. Invalidating annotation");
+@@ -334,11 +334,11 @@
+ {
+ try
+ {
+- shared_ptr<CDict> annotDict=getCObjectFromRef<CDict>(newValue);
++ boost::shared_ptr<CDict> annotDict=getCObjectFromRef<CDict>(newValue);
+
+ // creates CAnnotation instance from dereferenced dictionary
+ // and adds it to _annotations
+- shared_ptr<CAnnotation> annot(new CAnnotation(annotDict));
++ boost::shared_ptr<CAnnotation> annot(new CAnnotation(annotDict));
+ _annotations.push_back(annot);
+ }catch(ElementBadTypeException & )
+ {
+@@ -362,7 +362,7 @@
+
+ // gets Annots array from page dictionary. If no found, creates it. If bad
+ // typed, throws an exception
+- shared_ptr<CArray> annotsArray;
++ boost::shared_ptr<CArray> annotsArray;
+ try
+ {
+ annotsArray=getAnnotsArray(_page->getDictionary());
+@@ -395,7 +395,7 @@
+ IndiRef annotRef=pdf->addIndirectProperty(annot->getDictionary());
+
+ // gets added annotation dictionary
+- shared_ptr<CDict> annotDict=IProperty::getSmartCObjectPtr<CDict>(
++ boost::shared_ptr<CDict> annotDict=IProperty::getSmartCObjectPtr<CDict>(
+ pdf->getIndirectProperty(annotRef)
+ );
+
+@@ -403,7 +403,7 @@
+ // updates P field with reference to this page
+ // This is not explictly required by specification for all annotation types,
+ // but is not an error to supply this information
+- shared_ptr<CRef> pageRef(CRefFactory::getInstance(_page->getDictionary()->getIndiRef()));
++ boost::shared_ptr<CRef> pageRef(CRefFactory::getInstance(_page->getDictionary()->getIndiRef()));
+ checkAndReplace(annotDict, "P", *pageRef);
+
+ kernelPrintDbg(debug::DBG_INFO, "Adding reference "<<annotRef<<" to annotation dictionary to Annots array");
+@@ -427,7 +427,7 @@
+ size_t pos=0;
+ for(Annotations::iterator i=_annotations.begin(); i!=_annotations.end(); ++i,++pos)
+ {
+- shared_ptr<CAnnotation> element=*i;
++ boost::shared_ptr<CAnnotation> element=*i;
+ if(annot!=element)
+ continue;
+
+@@ -436,7 +436,7 @@
+ kernelPrintDbg(debug::DBG_DBG, "Annotation found. Indiref="<<annotRef);
+ try
+ {
+- shared_ptr<CArray> annotArray=getAnnotsArray(_page->getDictionary());
++ boost::shared_ptr<CArray> annotArray=getAnnotsArray(_page->getDictionary());
+ // deleting of this reference triggers annotsWatchDog observer which
+ // will synchronize _annotations with current state
+ annotArray->delProperty(pos);
+@@ -476,13 +476,13 @@
+ }
+
+ kernelPrintDbg(DBG_DBG, "context type="<<context->getType());
+- shared_ptr<IProperty> oldValue;
++ boost::shared_ptr<IProperty> oldValue;
+ switch(context->getType())
+ {
+ case BasicChangeContextType:
+ {
+ // this means that Annots element reference value has changed
+- shared_ptr<const BasicChangeContext<IProperty> > basicContext=
++ boost::shared_ptr<const BasicChangeContext<IProperty> > basicContext=
+ dynamic_pointer_cast<const BasicChangeContext<IProperty>, const observer::IChangeContext<IProperty> >(context);
+ oldValue=basicContext->getOriginalValue();
+ assert(isRef(newValue));
+@@ -494,7 +494,7 @@
+ case ComplexChangeContextType:
+ {
+ // Annots array content has changed
+- shared_ptr<const CArray::CArrayComplexObserverContext > basicContext=
++ boost::shared_ptr<const CArray::CArrayComplexObserverContext > basicContext=
+ dynamic_pointer_cast<const CArray::CArrayComplexObserverContext,
+ const IChangeContext<IProperty> >(context);
+ if(!context)
+@@ -540,14 +540,14 @@
+ }
+
+ kernelPrintDbg(DBG_DBG, "context type="<<context->getType());
+- shared_ptr<IProperty> oldValue;
++ boost::shared_ptr<IProperty> oldValue;
+ switch(context->getType())
+ {
+ case BasicChangeContextType:
+ {
+ // This means that Annots property is reference and it has
+ // changed its reference value
+- shared_ptr<const observer::BasicChangeContext<IProperty> > basicContext=
++ boost::shared_ptr<const observer::BasicChangeContext<IProperty> > basicContext=
+ dynamic_pointer_cast<const observer::BasicChangeContext<IProperty>, const observer::IChangeContext<IProperty> >(context);
+ oldValue=basicContext->getOriginalValue();
+ assert(isRef(newValue));
+@@ -559,7 +559,7 @@
+ // page dictionary has changed
+ // checks identificator of changed property and if it is not
+ // Annots, immediately returns
+- shared_ptr<const CDict::CDictComplexObserverContext > basicContext=
++ boost::shared_ptr<const CDict::CDictComplexObserverContext > basicContext=
+ dynamic_pointer_cast<const CDict::CDictComplexObserverContext,
+ const IChangeContext<IProperty> >(context);
+ if(!basicContext)
+@@ -588,7 +588,7 @@
+ // gets original annots array and unregisters all observers
+ // doesn't unregister observer from Annots property, because it is done only
+ // in case of complex context
+- shared_ptr<IProperty> oldArray;
++ boost::shared_ptr<IProperty> oldArray;
+ if(isRef(oldValue))
+ {
+ try
+@@ -618,7 +618,7 @@
+ // registers obsevers to newValue annotation array - Annots property doesn't
+ // need obsever registration for same reason as oldValue doesn't need
+ // unregistration
+- shared_ptr<IProperty> newArray;
++ boost::shared_ptr<IProperty> newArray;
+ if(isRef(newValue))
+ {
+ try
diff --git a/editors/pdfedit/files/patch-src-kernel-cpageattributes.cc b/editors/pdfedit/files/patch-src-kernel-cpageattributes.cc
new file mode 100644
index 000000000000..6e3753d5cf5d
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cpageattributes.cc
@@ -0,0 +1,88 @@
+--- src/kernel/cpageattributes.cc.orig 2016-06-11 10:28:48.940221000 +0900
++++ src/kernel/cpageattributes.cc 2016-06-11 10:29:31.800132000 +0900
+@@ -47,7 +47,7 @@
+ //
+ //
+ void
+-CPageAttributes::fillInherited(const shared_ptr<CDict> pageDict, InheritedAttributes& attrs)
++CPageAttributes::fillInherited(const boost::shared_ptr<CDict> pageDict, InheritedAttributes& attrs)
+ {
+ int initialized=0;
+
+@@ -59,7 +59,7 @@
+ // attrs.__resources field is not specified yet, so tries this dictionary
+ if(pageDict->containsProperty(Specification::Page::RESOURCES))
+ {
+- shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::RESOURCES);
++ boost::shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::RESOURCES);
+ if(isRef(prop))
+ {
+ attrs._resources=getCObjectFromRef<CDict>(prop);
+@@ -81,7 +81,7 @@
+ // attrs._mediaBox field is not specified yet, so tries this array
+ if(pageDict->containsProperty(Specification::Page::MEDIABOX))
+ {
+- shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::MEDIABOX);
++ boost::shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::MEDIABOX);
+ if(isRef(prop))
+ {
+ attrs._mediaBox=getCObjectFromRef<CArray>(prop);
+@@ -102,7 +102,7 @@
+ // attrs._cropBox field is not specified yet, so tries this array
+ if(pageDict->containsProperty(Specification::Page::CROPBOX))
+ {
+- shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::CROPBOX);
++ boost::shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::CROPBOX);
+ if(isRef(prop))
+ {
+ attrs._cropBox=getCObjectFromRef<CArray>(prop);
+@@ -123,7 +123,7 @@
+ // attrs._rotate field is not specified yet, so tries this array
+ if(pageDict->containsProperty(Specification::Page::ROTATE))
+ {
+- shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::ROTATE);
++ boost::shared_ptr<IProperty> prop=pageDict->getProperty(Specification::Page::ROTATE);
+ if(isRef(prop))
+ {
+ attrs._rotate=getCObjectFromRef<CInt>(prop);
+@@ -147,19 +147,19 @@
+ // stops recursion and initializes values with default
+ if(pageDict->containsProperty(Specification::Page::PARENT))
+ {
+- shared_ptr<IProperty> parentRef=pageDict->getProperty(Specification::Page::PARENT);
++ boost::shared_ptr<IProperty> parentRef=pageDict->getProperty(Specification::Page::PARENT);
+ if(!isRef(parentRef))
+ // this should not happen - malformed page tree structure
+ return;
+
+- shared_ptr<CDict> parentDict=getCObjectFromRef<CDict>(parentRef);
++ boost::shared_ptr<CDict> parentDict=getCObjectFromRef<CDict>(parentRef);
+ CPageAttributes::fillInherited(parentDict, attrs);
+ }else
+ {
+ // Resources is required and at least empty dictionary should be
+ // specified
+ if(!attrs._resources.get())
+- attrs._resources=shared_ptr<CDict>(CDictFactory::getInstance());
++ attrs._resources=boost::shared_ptr<CDict>(CDictFactory::getInstance());
+
+ // default A4 sized box
+ libs::Rectangle defaultRect(
+@@ -191,7 +191,7 @@
+ // direct usage of static DEFAULT_ROTATE value caused linkage
+ // error
+ int defRot=DisplayParams::DEFAULT_ROTATE;
+- attrs._rotate=shared_ptr<CInt>(CIntFactory::getInstance(defRot));
++ attrs._rotate=boost::shared_ptr<CInt>(CIntFactory::getInstance(defRot));
+ }
+ }
+ }
+@@ -203,7 +203,7 @@
+ //
+ //
+ void
+-CPageAttributes::setInheritable(shared_ptr<CDict>& pageDict)
++CPageAttributes::setInheritable(boost::shared_ptr<CDict>& pageDict)
+ {
+ InheritedAttributes attrs;
+ CPageAttributes::fillInherited(pageDict, attrs);
diff --git a/editors/pdfedit/files/patch-src-kernel-cpagechanges.cc b/editors/pdfedit/files/patch-src-kernel-cpagechanges.cc
new file mode 100644
index 000000000000..8f7ab04b3a67
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cpagechanges.cc
@@ -0,0 +1,54 @@
+--- src/kernel/cpagechanges.cc.orig 2016-06-11 10:31:04.066936000 +0900
++++ src/kernel/cpagechanges.cc 2016-06-11 10:31:47.070535000 +0900
+@@ -50,7 +50,7 @@
+ CPageChanges::displayChange (::OutputDev& out, const Container& cont) const
+ {
+
+- shared_ptr<CDict> fakeDict (IProperty::getSmartCObjectPtr<CDict>(_page->getDictionary()->clone()));
++ boost::shared_ptr<CDict> fakeDict (IProperty::getSmartCObjectPtr<CDict>(_page->getDictionary()->clone()));
+ assert (fakeDict);
+
+ CPageContents::setContents (fakeDict, cont);
+@@ -66,7 +66,7 @@
+ // Display page using our dictionary
+ _page->display()->displayPage (out, fakeDict);
+ }
+-template void CPageChanges::displayChange<vector<shared_ptr<CContentStream> > > (::OutputDev& out, const vector<shared_ptr<CContentStream> >& cont) const;
++template void CPageChanges::displayChange<vector<boost::shared_ptr<CContentStream> > > (::OutputDev& out, const vector<boost::shared_ptr<CContentStream> >& cont) const;
+
+
+ //
+@@ -87,10 +87,10 @@
+ //
+ //
+ //
+-shared_ptr<CContentStream>
++boost::shared_ptr<CContentStream>
+ CPageChanges::getChange (size_t nthchange) const
+ {
+- typedef vector<shared_ptr<CContentStream> > CCs;
++ typedef vector<boost::shared_ptr<CContentStream> > CCs;
+
+ CCs ccs;
+ getChanges (ccs);
+@@ -122,9 +122,9 @@
+ */
+ struct ccs_change_sorter
+ {
+- bool operator() (shared_ptr<CContentStream> frst, shared_ptr<CContentStream> scnd)
++ bool operator() (boost::shared_ptr<CContentStream> frst, boost::shared_ptr<CContentStream> scnd)
+ {
+- typedef vector<shared_ptr<PdfOperator> > Ops;
++ typedef vector<boost::shared_ptr<PdfOperator> > Ops;
+ static const bool FIRST_IS_OUR_LAST = true;
+ static const bool SECOND_IS_OUR_LAST = false;
+
+@@ -163,7 +163,7 @@
+ _page->contents()->getContentStreams (ccs);
+ for (CCs::const_iterator it = ccs.begin(); it != ccs.end(); ++it)
+ {
+- vector<shared_ptr<PdfOperator> > ops;
++ vector<boost::shared_ptr<PdfOperator> > ops;
+ (*it)->getPdfOperators (ops);
+ // Empty contentstream is not our change
+ if (ops.empty())
diff --git a/editors/pdfedit/files/patch-src-kernel-cpdf.cc b/editors/pdfedit/files/patch-src-kernel-cpdf.cc
new file mode 100644
index 000000000000..fd00f678381a
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cpdf.cc
@@ -0,0 +1,872 @@
+--- src/kernel/cpdf.cc.orig 2016-06-12 03:22:58.998911000 +0900
++++ src/kernel/cpdf.cc 2016-06-12 03:32:11.057006000 +0900
+@@ -81,13 +81,13 @@
+ return stream;
+ }
+
+-shared_ptr<CDict> getPageTreeRoot(const boost::shared_ptr<CPdf> &pdf)
++boost::shared_ptr<CDict> getPageTreeRoot(const boost::shared_ptr<CPdf> &pdf)
+ {
+- shared_ptr<CDict> result;
++ boost::shared_ptr<CDict> result;
+
+ try
+ {
+- shared_ptr<IProperty> pagesProp=pdf->getDictionary()->getProperty("Pages");
++ boost::shared_ptr<IProperty> pagesProp=pdf->getDictionary()->getProperty("Pages");
+ if(!isRef(pagesProp))
+ // returns null dictionary
+ return result;
+@@ -106,7 +106,7 @@
+ PageTreeNodeType nodeType=UnknownNode;
+
+ // checks nodeProp - must be dictionary or reference to dictionary
+- shared_ptr<CDict> nodeDict;
++ boost::shared_ptr<CDict> nodeDict;
+ if(isDict(nodeProp))
+ nodeDict=IProperty::getSmartCObjectPtr<CDict>(nodeProp);
+ else
+@@ -126,9 +126,9 @@
+ return ErrorNode;
+
+ // checks root node at first
+- shared_ptr<CPdf> pdf=nodeProp->getPdf().lock();
++ boost::shared_ptr<CPdf> pdf=nodeProp->getPdf().lock();
+ assert(pdf);
+- shared_ptr<CDict> rootDict=getPageTreeRoot(pdf);
++ boost::shared_ptr<CDict> rootDict=getPageTreeRoot(pdf);
+ if(rootDict==nodeDict)
+ // root dictionary found and it is same as internode
+ return RootNode;
+@@ -136,7 +136,7 @@
+ // given node is not root of page tree, chcecks Type field
+ if(nodeDict->containsProperty("Type"))
+ {
+- shared_ptr<IProperty> nodeType=nodeDict->getProperty("Type");
++ boost::shared_ptr<IProperty> nodeType=nodeDict->getProperty("Type");
+ try
+ {
+ if(isRef(nodeType))
+@@ -159,7 +159,7 @@
+ // Internode should contain at least Kids array field
+ if(nodeDict->containsProperty("Kids"))
+ {
+- shared_ptr<IProperty> kidsProp=nodeDict->getProperty("Kids");
++ boost::shared_ptr<IProperty> kidsProp=nodeDict->getProperty("Kids");
+ if(isArray(kidsProp))
+ return InterNode;
+ if(isRef(kidsProp))
+@@ -189,8 +189,8 @@
+ // tries to get Kids array
+ if(interNodeDict->containsProperty("Kids"))
+ {
+- shared_ptr<IProperty> kidsProp=interNodeDict->getProperty("Kids");
+- shared_ptr<CArray> kidsArray;
++ boost::shared_ptr<IProperty> kidsProp=interNodeDict->getProperty("Kids");
++ boost::shared_ptr<CArray> kidsArray;
+ if(isRef(kidsProp))
+ {
+ try
+@@ -341,17 +341,17 @@
+ if(!withSubTree)
+ return;
+
+- shared_ptr<IProperty> nodeProp=pdf->getIndirectProperty(ref);
++ boost::shared_ptr<IProperty> nodeProp=pdf->getIndirectProperty(ref);
+ if(getNodeType(nodeProp)>=InterNode)
+ {
+ ChildrenStorage childs;
+ assert(isDict(nodeProp));
+- shared_ptr<CDict> nodeDict=IProperty::getSmartCObjectPtr<CDict>(nodeProp);
++ boost::shared_ptr<CDict> nodeDict=IProperty::getSmartCObjectPtr<CDict>(nodeProp);
+ getKidsFromInterNode(nodeDict, childs);
+ utilsPrintDbg(DBG_DBG, "discarding all nodes in "<<ref<<" subtree");
+ for(ChildrenStorage::iterator i=childs.begin(); i!=childs.end(); ++i)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+ if(!isRef(child))
+ // skip array mess
+ continue;
+@@ -373,7 +373,7 @@
+
+ // gets dictionary from given property. If reference, gets target object. If
+ // it is not a dictionary, returns with 0
+- shared_ptr<CDict> interNodeDict;
++ boost::shared_ptr<CDict> interNodeDict;
+ if(isRef(interNodeProp))
+ {
+ try
+@@ -409,7 +409,7 @@
+ getKidsFromInterNode(interNodeDict, children);
+ for(ChildrenStorage::const_iterator i=children.begin(); i!=children.end(); ++i)
+ {
+- shared_ptr<IProperty> childProp=*i;
++ boost::shared_ptr<IProperty> childProp=*i;
+ if(isRef(childProp))
+ count+=getKidsCount(childProp, cache);
+ }
+@@ -441,7 +441,7 @@
+ // dictionary smart pointer holder
+ // it is initialized according pagesDict parameter - if it is reference
+ // it has to be dereferenced
+- shared_ptr<CDict> dict_ptr;
++ boost::shared_ptr<CDict> dict_ptr;
+
+ // checks if given parameter is reference and if so, dereference it
+ // using getIndirectProperty method and casts to dict_ptr
+@@ -523,7 +523,7 @@
+ size_t min_pos=startPos, index=0;
+ for(ChildrenStorage::iterator i=children.begin(); i!=children.end(); ++i, ++index)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+
+ if(!isRef(child))
+ {
+@@ -542,7 +542,7 @@
+
+ // gets child dictionary (everything is checked, so no exception can
+ // be thrown here)
+- shared_ptr<CDict> child_ptr=getCObjectFromRef<CDict>(child);
++ boost::shared_ptr<CDict> child_ptr=getCObjectFromRef<CDict>(child);
+
+ utilsPrintDbg(DBG_DBG, "kid["<<index<<"] node type="<<nodeType);
+
+@@ -632,9 +632,9 @@
+ * superNode.
+ */
+ size_t searchTreeNode(
+- shared_ptr<const CPdf> pdf,
+- shared_ptr<CDict> superNode,
+- shared_ptr<CDict> node,
++ boost::shared_ptr<const CPdf> pdf,
++ boost::shared_ptr<CDict> superNode,
++ boost::shared_ptr<CDict> node,
+ size_t startValue,
+ PageTreeNodeCountCache * cache)
+ {
+@@ -673,7 +673,7 @@
+ getKidsFromInterNode(superNode, children);
+ for(i=children.begin(); i!=children.end(); ++i, ++index)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+
+ // each element has to be reference
+ if(!isRef(child))
+@@ -693,7 +693,7 @@
+
+ // dereference target dictionary - never throws, because we have checked
+ // node type
+- shared_ptr<CDict> elementDict_ptr=getCObjectFromRef<CDict>(child);
++ boost::shared_ptr<CDict> elementDict_ptr=getCObjectFromRef<CDict>(child);
+
+ // compares elementDict_ptr (kid) with node, if they are same, returns
+ // startValue
+@@ -723,7 +723,7 @@
+ IndiRef nodeRef=node->getIndiRef();
+ for(;i!=children.end(); ++i, ++index)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+ if(isRef(child) && getValueFromSimple<CRef>(child)==nodeRef)
+ {
+ utilsPrintDbg(DBG_WARN, "Internode "<<superNode->getIndiRef()<<" is ambiguous. Kids["<<index<<"] duplicates reference to node.");
+@@ -735,7 +735,7 @@
+ return position;
+ }
+
+-size_t getNodePosition(const shared_ptr<CPdf> &pdf, const shared_ptr<IProperty> &node, PageTreeNodeCountCache * cache)
++size_t getNodePosition(const boost::shared_ptr<CPdf> &pdf, const boost::shared_ptr<IProperty> &node, PageTreeNodeCountCache * cache)
+ {
+ utilsPrintDbg(DBG_DBG, "");
+ // node must be from given pdf
+@@ -746,7 +746,7 @@
+ }
+
+ // gets page tree root - if not found, then PageNotFoundException is thrown
+- shared_ptr<CDict> rootDict_ptr=getPageTreeRoot(pdf);
++ boost::shared_ptr<CDict> rootDict_ptr=getPageTreeRoot(pdf);
+ if(!rootDict_ptr.get())
+ throw PageNotFoundException(0);
+
+@@ -760,7 +760,7 @@
+ utilsPrintDbg(DBG_ERR, "Given node is not reference nor dictionary. type="<<nodeType);
+ throw ElementBadTypeException("node");
+ }
+- shared_ptr<CDict> nodeDict_ptr;
++ boost::shared_ptr<CDict> nodeDict_ptr;
+ if(isRef(node))
+ nodeDict_ptr=getCObjectFromRef<CDict>(node);
+ else
+@@ -776,7 +776,7 @@
+ throw PageNotFoundException(0);
+ }
+
+-bool isNodeDescendant(const boost::shared_ptr<CPdf>& pdf, const IndiRef &parent, const shared_ptr<CDict> &child)
++bool isNodeDescendant(const boost::shared_ptr<CPdf>& pdf, const IndiRef &parent, const boost::shared_ptr<CDict> &child)
+ {
+ using namespace utils;
+
+@@ -787,7 +787,7 @@
+ }
+
+ // gets parent property
+- shared_ptr<IProperty> parentProp=child->getProperty("Parent");
++ boost::shared_ptr<IProperty> parentProp=child->getProperty("Parent");
+ if(!isRef(parentProp))
+ {
+ // parent is incorect
+@@ -804,7 +804,7 @@
+ // referencies are not same, so gets parent dictionary and checks its parent
+ try
+ {
+- shared_ptr<CDict> parentDict=getCObjectFromRef<CDict>(parentProp);
++ boost::shared_ptr<CDict> parentDict=getCObjectFromRef<CDict>(parentProp);
+ return isNodeDescendant(pdf, parent, parentDict);
+ }catch(CObjectException & )
+ {
+@@ -830,7 +830,7 @@
+ return;
+
+ // gets dictionary from given property
+- shared_ptr<CDict> dict_ptr;
++ boost::shared_ptr<CDict> dict_ptr;
+ if(isRef(prop))
+ {
+ try
+@@ -854,8 +854,8 @@
+ if(!dict_ptr->containsProperty("Kids"))
+ return;
+
+- shared_ptr<IProperty> kidsProp_ptr=dict_ptr->getProperty("Kids");
+- shared_ptr<CArray> kids_ptr;
++ boost::shared_ptr<IProperty> kidsProp_ptr=dict_ptr->getProperty("Kids");
++ boost::shared_ptr<CArray> kids_ptr;
+ if(isRef(kidsProp_ptr))
+ {
+ // Kids property is reference - this is not offten but may occure and
+@@ -901,7 +901,7 @@
+ kids_ptr->_getAllChildObjects(container);
+ for(ChildrenStorage::iterator i=container.begin(); i!=container.end(); ++i)
+ {
+- shared_ptr<IProperty> elemProp_ptr=*i;
++ boost::shared_ptr<IProperty> elemProp_ptr=*i;
+ if(isRef(elemProp_ptr))
+ {
+ REGISTER_SHAREDPTR_OBSERVER(elemProp_ptr, pageTreeKidsObserver);
+@@ -922,7 +922,7 @@
+ return;
+
+ // gets dictionary from given property
+- shared_ptr<CDict> dict_ptr;
++ boost::shared_ptr<CDict> dict_ptr;
+ if(isRef(prop))
+ {
+ try
+@@ -974,8 +974,8 @@
+ if(!dict_ptr->containsProperty("Kids"))
+ return;
+
+- shared_ptr<IProperty> kidsProp_ptr=dict_ptr->getProperty("Kids");
+- shared_ptr<CArray> kids_ptr;
++ boost::shared_ptr<IProperty> kidsProp_ptr=dict_ptr->getProperty("Kids");
++ boost::shared_ptr<CArray> kids_ptr;
+ if(isRef(kidsProp_ptr))
+ {
+ // Kids property is reference - this is not offten but may occure and
+@@ -1021,7 +1021,7 @@
+ kids_ptr->_getAllChildObjects(container);
+ for(ChildrenStorage::iterator i=container.begin(); i!=container.end(); ++i)
+ {
+- shared_ptr<IProperty> elemProp_ptr=*i;
++ boost::shared_ptr<IProperty> elemProp_ptr=*i;
+ if(isRef(elemProp_ptr))
+ {
+ UNREGISTER_SHAREDPTR_OBSERVER(elemProp_ptr, pageTreeKidsObserver);
+@@ -1042,7 +1042,7 @@
+ using namespace utils;
+
+ assert(isActive());
+- shared_ptr<IProperty> oldValue;
++ boost::shared_ptr<IProperty> oldValue;
+ if(!context)
+ {
+ kernelPrintDbg(DBG_WARN, "No context available. Ignoring calling.");
+@@ -1055,7 +1055,7 @@
+ case BasicChangeContextType:
+ {
+ // Pages reference value has changed
+- shared_ptr<const BasicChangeContext<IProperty> > basicContext=
++ boost::shared_ptr<const BasicChangeContext<IProperty> > basicContext=
+ dynamic_pointer_cast<const BasicChangeContext<IProperty>, const IChangeContext<IProperty> >(context);
+ oldValue=basicContext->getOriginalValue();
+
+@@ -1068,7 +1068,7 @@
+ {
+ // document catalog dictionary has changed. Checks valueId and
+ // proceede just if Pages property has changed
+- shared_ptr<const CDict::CDictComplexObserverContext > complexContex=
++ boost::shared_ptr<const CDict::CDictComplexObserverContext > complexContex=
+ dynamic_pointer_cast<const CDict::CDictComplexObserverContext, const IChangeContext<IProperty> >(context);
+ if(!complexContex)
+ {
+@@ -1115,7 +1115,7 @@
+ {
+ try
+ {
+- shared_ptr<IProperty> oldValueDict=getCObjectFromRef<CDict>(oldValue);
++ boost::shared_ptr<IProperty> oldValueDict=getCObjectFromRef<CDict>(oldValue);
+ kernelPrintDbg(DBG_DBG, "unregistering observers from old page tree.");
+ pdf->unregisterPageTreeObservers(oldValueDict);
+ }catch(CObjectException & e)
+@@ -1136,7 +1136,7 @@
+ kernelPrintDbg(DBG_DBG, "Invalidating pageList with "<<pdf->pageList.size()<<" elements");
+ for(PageList::iterator i=pdf->pageList.begin(); i!=pdf->pageList.end(); ++i)
+ {
+- shared_ptr<CPage> page=i->second;
++ boost::shared_ptr<CPage> page=i->second;
+ page->invalidate();
+ }
+ pdf->pageList.clear();
+@@ -1154,7 +1154,7 @@
+ return;
+ }
+ IndiRef newValueRef=utils::getValueFromSimple<CRef>(newValue);
+- shared_ptr<IProperty> newValueProp=pdf->getIndirectProperty(newValueRef);
++ boost::shared_ptr<IProperty> newValueProp=pdf->getIndirectProperty(newValueRef);
+ if(!isDict(newValueProp))
+ {
+ kernelPrintDbg(DBG_WARN, "Pages property doesn't refer to dictionary. type="<<newValueProp->getType());
+@@ -1183,7 +1183,7 @@
+ kernelPrintDbg(DBG_WARN, "No context available. Ignoring calling.");
+ return;
+ }
+- shared_ptr<IProperty> oldValue;
++ boost::shared_ptr<IProperty> oldValue;
+ ChildrenStorage oldValues, newValues;
+ kernelPrintDbg(DBG_DBG, "context type="<<context->getType());
+ switch(context->getType())
+@@ -1193,7 +1193,7 @@
+ // this means that node contains Kids array with reference type
+ // and this reference has changed its value - both oldValue and
+ // newValue has to be referencies
+- shared_ptr<const BasicChangeContext<IProperty> > basicContext=
++ boost::shared_ptr<const BasicChangeContext<IProperty> > basicContext=
+ dynamic_pointer_cast<const BasicChangeContext<IProperty>, const IChangeContext<IProperty> >(context);
+ oldValue=basicContext->getOriginalValue();
+ assert(isRef(oldValue));
+@@ -1204,7 +1204,7 @@
+ {
+ // this means that inter node dictionary has changed
+ // if changed property is not Kids, immediatelly returns
+- shared_ptr<const CDict::CDictComplexObserverContext > complexContex=
++ boost::shared_ptr<const CDict::CDictComplexObserverContext > complexContex=
+ dynamic_pointer_cast<const CDict::CDictComplexObserverContext, const IChangeContext<IProperty> >(context);
+ if(!complexContex)
+ {
+@@ -1245,7 +1245,7 @@
+ try
+ {
+ // collects all children from array
+- shared_ptr<CArray> kidsArray;
++ boost::shared_ptr<CArray> kidsArray;
+ if(isRef(oldValue))
+ kidsArray=utils::getCObjectFromRef<CArray>(oldValue);
+ else
+@@ -1273,7 +1273,7 @@
+ try
+ {
+ // collects all children from array
+- shared_ptr<CArray> kidsArray;
++ boost::shared_ptr<CArray> kidsArray;
+ if(isRef(newValue))
+ kidsArray=utils::getCObjectFromRef<CArray>(newValue);
+ else
+@@ -1299,10 +1299,10 @@
+ IndiRef interNodeRef=(!isNull(oldValue))?oldValue->getIndiRef():newValue->getIndiRef();
+ try
+ {
+- shared_ptr<IProperty> interNodeProp=pdf->getIndirectProperty(interNodeRef);
++ boost::shared_ptr<IProperty> interNodeProp=pdf->getIndirectProperty(interNodeRef);
+ if(isDict(interNodeProp))
+ {
+- shared_ptr<CDict> interNode=IProperty::getSmartCObjectPtr<CDict>(interNodeProp);
++ boost::shared_ptr<CDict> interNode=IProperty::getSmartCObjectPtr<CDict>(interNodeProp);
+ // if consolidatePageTree hasn't kept page count numbers, total number
+ // of pages must be invalidated
+ if(!pdf->consolidatePageTree(interNode, true))
+@@ -1317,12 +1317,12 @@
+ }
+
+ // removes all pages from removed array
+- shared_ptr<IProperty> null(CNullFactory::getInstance());
++ boost::shared_ptr<IProperty> null(CNullFactory::getInstance());
+ kernelPrintDbg(DBG_DBG, "Consolidating page list by removing oldValues.");
+ size_t index=0;
+ for(ChildrenStorage::iterator i=oldValues.begin(); i!=oldValues.end(); ++i, ++index)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+ // consider just referencies, other elements are just mess in array
+ // unregisters observers and consolidates pageList like this node has
+ // been removed
+@@ -1341,7 +1341,7 @@
+ kernelPrintDbg(DBG_DBG, "Consolidating page list by adding newValues.");
+ for(ChildrenStorage::iterator i=newValues.begin(); i!=newValues.end(); ++i)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+ // consider just referencies, other elements are just mess in array
+ // registers observers and consolidates pageList like this node has
+ // been added
+@@ -1372,7 +1372,7 @@
+ kernelPrintDbg(DBG_DBG, "contextType="<<contextType);
+ // gets original value from given context. It has to at least
+ // BasicChangeContext
+- shared_ptr<IProperty> oldValue;
++ boost::shared_ptr<IProperty> oldValue;
+ switch(contextType)
+ {
+ // This context means that just simple value has been changed and so
+@@ -1381,7 +1381,7 @@
+ case BasicChangeContextType:
+ {
+ // this means that reference property has changed its value
+- shared_ptr<const BasicChangeContext<IProperty> > basicContext=
++ boost::shared_ptr<const BasicChangeContext<IProperty> > basicContext=
+ dynamic_pointer_cast<const BasicChangeContext<IProperty>, const IChangeContext<IProperty> >(context);
+ oldValue=basicContext->getOriginalValue();
+
+@@ -1393,7 +1393,7 @@
+ case ComplexChangeContextType:
+ {
+ // this means that array content has changed
+- shared_ptr<const CArray::CArrayComplexObserverContext > complexContex=
++ boost::shared_ptr<const CArray::CArrayComplexObserverContext > complexContex=
+ dynamic_pointer_cast<const CArray::CArrayComplexObserverContext, const IChangeContext<IProperty> >(context);
+ if(!complexContex)
+ {
+@@ -1455,7 +1455,7 @@
+ {
+ try
+ {
+- shared_ptr<IProperty> oldValueDict=getCObjectFromRef<CDict>(oldValue);
++ boost::shared_ptr<IProperty> oldValueDict=getCObjectFromRef<CDict>(oldValue);
+ pdf->unregisterPageTreeObservers(oldValueDict);
+ }catch(CObjectException & e)
+ {
+@@ -1482,7 +1482,7 @@
+ IndiRef parentRef=ref;
+ if(getCachedValue(ref, parentRef, pdf->pageTreeKidsParentCache))
+ kernelPrintDbg(DBG_DBG, "Uses pageTreeKidsParentCache with mapping from"<<ref<<" to "<<parentRef);
+- shared_ptr<IProperty> parentProp_ptr=pdf->getIndirectProperty(parentRef);
++ boost::shared_ptr<IProperty> parentProp_ptr=pdf->getIndirectProperty(parentRef);
+ if(parentProp_ptr->getType()!=pDict)
+ {
+ // target of the parent reference is not dictionary,
+@@ -1492,7 +1492,7 @@
+ }
+
+ // starts consolidation from parent intermediate node
+- shared_ptr<CDict> parentDict_ptr=IProperty::getSmartCObjectPtr<CDict>(parentProp_ptr);
++ boost::shared_ptr<CDict> parentDict_ptr=IProperty::getSmartCObjectPtr<CDict>(parentProp_ptr);
+ try
+ {
+ // if consolidatePageTree hasn't kept page count numbers, total number
+@@ -1530,7 +1530,7 @@
+ {
+ try
+ {
+- shared_ptr<IProperty> newValueDict=getCObjectFromRef<CDict>(newValue);
++ boost::shared_ptr<IProperty> newValueDict=getCObjectFromRef<CDict>(newValue);
+ pdf->registerPageTreeObservers(newValueDict);
+ }catch(CObjectException & e)
+ {
+@@ -1559,11 +1559,11 @@
+ }
+ if(docCatalog->containsProperty("Pages"))
+ {
+- shared_ptr<IProperty> pagesProp=docCatalog->getProperty("Pages");
++ boost::shared_ptr<IProperty> pagesProp=docCatalog->getProperty("Pages");
+ if(isRef(pagesProp))
+ {
+ UNREGISTER_SHAREDPTR_OBSERVER(pagesProp, pageTreeRootObserver);
+- shared_ptr<IProperty> pageTreeRoot=getPageTreeRoot(_this.lock());
++ boost::shared_ptr<IProperty> pageTreeRoot=getPageTreeRoot(_this.lock());
+ if(pageTreeRoot.get())
+ {
+ try
+@@ -1623,7 +1623,7 @@
+ for(IndirectMapping::iterator i=indMap.begin(); i!=indMap.end(); ++i)
+ {
+ IndiRef ref=i->first;
+- shared_ptr<IProperty> value=i->second;
++ boost::shared_ptr<IProperty> value=i->second;
+ if(!value.unique())
+ kernelPrintDbg(debug::DBG_WARN, "Somebody still holds property with with "<<ref);
+ }
+@@ -1654,7 +1654,7 @@
+ // is thrown
+ kernelPrintDbg(debug::DBG_DBG, "Getting Root field - document catalog");
+ IndiRef rootRef(xref->getRootNum(), xref->getRootGen());
+- shared_ptr<IProperty> prop_ptr=getIndirectProperty(rootRef);
++ boost::shared_ptr<IProperty> prop_ptr=getIndirectProperty(rootRef);
+ if(prop_ptr->getType()!=pDict)
+ {
+ kernelPrintDbg(debug::DBG_ERR, "Trailer dictionary doesn't point to correct document catalog "
+@@ -1670,7 +1670,7 @@
+ REGISTER_SHAREDPTR_OBSERVER(docCatalog, pageTreeRootObserver);
+ if(docCatalog->containsProperty("Pages"))
+ {
+- shared_ptr<IProperty> pagesProp=docCatalog->getProperty("Pages");
++ boost::shared_ptr<IProperty> pagesProp=docCatalog->getProperty("Pages");
+ if(isRef(pagesProp))
+ REGISTER_SHAREDPTR_OBSERVER(pagesProp, pageTreeRootObserver);
+ else
+@@ -1680,7 +1680,7 @@
+
+ // registers pageTreeNodeObserver and pageTreeKidsObserver to page tree root
+ // dictionary which registers these observers to whole page tree structure
+- shared_ptr<IProperty> pageTreeRoot=utils::getPageTreeRoot(_this.lock());
++ boost::shared_ptr<IProperty> pageTreeRoot=utils::getPageTreeRoot(_this.lock());
+ if(pageTreeRoot.get())
+ registerPageTreeObservers(pageTreeRoot);
+ }
+@@ -1870,7 +1870,7 @@
+
+ // mapping doesn't exist yet, so tries to create one
+ // fetches object according reference
+- shared_ptr< ::Object> obj(XPdfObjectFactory::getInstance(), xpdf::object_deleter());
++ boost::shared_ptr< ::Object> obj(XPdfObjectFactory::getInstance(), xpdf::object_deleter());
+ assert(xref);
+ xref->fetch(ref.num, ref.gen, obj.get());
+
+@@ -1883,13 +1883,13 @@
+ if(obj->getType()!=objNull)
+ {
+ IProperty * prop=utils::createObjFromXpdfObj(_this.lock(), *obj, ref);
+- prop_ptr=shared_ptr<IProperty>(prop);
++ prop_ptr=boost::shared_ptr<IProperty>(prop);
+ indMap.insert(IndirectMapping::value_type(ref, prop_ptr));
+ kernelPrintDbg(DBG_DBG, "Mapping created for "<<ref);
+ }else
+ {
+ kernelPrintDbg(DBG_DBG, ref<<" not available or points to objNull");
+- prop_ptr=shared_ptr<CNull>(CNullFactory::getInstance());
++ prop_ptr=boost::shared_ptr<CNull>(CNullFactory::getInstance());
+ }
+
+ return prop_ptr;
+@@ -1913,7 +1913,7 @@
+ // so no type check fails). We have to set this pdf temporarily, because
+ // _makeXpdfObject function sets xref to created Object from ip->getPdf().
+ // Finally restores original pdf value
+- shared_ptr<CPdf> original=ip->getPdf().lock();
++ boost::shared_ptr<CPdf> original=ip->getPdf().lock();
+ ip->setPdf(_this);
+ ::Object * obj=ip->_makeXpdfObject();
+ ip->setPdf(original);
+@@ -1940,7 +1940,7 @@
+ // ip is not from same pdf - may be in different one or stand alone object
+ // toSubstitute is deep copy of ip to prevent changes in original data.
+ // Also sets same pdf as orignal to cloned to enable dereferencing
+- shared_ptr<IProperty> toSubstitute=ip->clone();
++ boost::shared_ptr<IProperty> toSubstitute=ip->clone();
+ if(hasValidPdf(ip))
+ {
+ // locks cloned object to prevent making changes (kind of workaround)
+@@ -2060,8 +2060,8 @@
+ <<refEntry->first);
+ // ip is from read pdf and so dereferences target value
+ // FIXME check for valid pdf
+- shared_ptr<CPdf> pdf = ip->getPdf().lock();
+- shared_ptr<IProperty> followedIp=pdf->getIndirectProperty(ipRef);
++ boost::shared_ptr<CPdf> pdf = ip->getPdf().lock();
++ boost::shared_ptr<IProperty> followedIp=pdf->getIndirectProperty(ipRef);
+
+ // adds dereferenced value using addProperty with collected
+ // container. Current mapping is set to resolving state to
+@@ -2097,7 +2097,7 @@
+ ChildrenStorage::iterator i;
+ for(i=childrenStorage.begin(); i!=childrenStorage.end(); ++i)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+ if(!isRef(*child) && !isDict(*child) && !isArray(*child) && !isStream(*child))
+ {
+ // child is none of interesting type which may hold reference
+@@ -2146,7 +2146,7 @@
+ }
+
+ // checks whether given ip is from same pdf
+- shared_ptr<CPdf> ipPdf = ip->getPdf().lock();
++ boost::shared_ptr<CPdf> ipPdf = ip->getPdf().lock();
+ if(ipPdf.get()==this)
+ {
+ // ip is from same pdf and so all possible referencies are already in
+@@ -2245,7 +2245,7 @@
+ throw ReadOnlyDocumentException("Document is in read-only mode.");
+ }
+
+- shared_ptr<CPdf> _thisP = _this.lock();
++ boost::shared_ptr<CPdf> _thisP = _this.lock();
+ if(utils::isEncrypted(_thisP))
+ {
+ kernelPrintDbg(DBG_WARN, "Changing properties for encrypted documents si not implemented");
+@@ -2272,7 +2272,7 @@
+ // changeObject may throw if we are in read only mode or if xrefwriter is
+ // in paranoid mode and type check fails - to make it easier for such a case
+ // we are using shared_ptr which handles propObject cleanup correctly
+- shared_ptr<Object> propObject(prop->_makeXpdfObject(), xpdf::object_deleter());
++ boost::shared_ptr<Object> propObject(prop->_makeXpdfObject(), xpdf::object_deleter());
+ kernelPrintDbg(DBG_DBG, "Registering change to the XRefWriter");
+ xref->changeObject(indiRef.num, indiRef.gen, propObject.get());
+
+@@ -2359,10 +2359,10 @@
+ kernelPrintDbg(debug::DBG_DBG,"File stream created");
+
+ // stream is ready, creates CPdf instance
+- shared_ptr<CPdf> instance;
++ boost::shared_ptr<CPdf> instance;
+ try
+ {
+- instance = shared_ptr<CPdf>(new CPdf(stream, mode), PdfFileDeleter(file));
++ instance = boost::shared_ptr<CPdf>(new CPdf(stream, mode), PdfFileDeleter(file));
+ instance->_this = instance;
+
+ // initializes revision specific data for the newest revision
+@@ -2423,14 +2423,14 @@
+ // page is not available in pageList, searching has to be done
+ // find throws an exception if any problem found, otherwise pageDict_ptr
+ // contians Page dictionary at specified position.
+- shared_ptr<CDict> rootPages_ptr=getPageTreeRoot(_this.lock());
++ boost::shared_ptr<CDict> rootPages_ptr=getPageTreeRoot(_this.lock());
+ if(!rootPages_ptr.get())
+ throw PageNotFoundException(pos);
+- shared_ptr<CDict> pageDict_ptr=findPageDict(_this.lock(), rootPages_ptr, 1, pos, &nodeCountCache);
++ boost::shared_ptr<CDict> pageDict_ptr=findPageDict(_this.lock(), rootPages_ptr, 1, pos, &nodeCountCache);
+
+ // creates CPage instance from page dictionary and stores it to the pageList
+ CPage * page=CPageFactory::getInstance(pageDict_ptr);
+- shared_ptr<CPage> page_ptr(page);
++ boost::shared_ptr<CPage> page_ptr(page);
+ pageList.insert(PageList::value_type(pos, page_ptr));
+ kernelPrintDbg(DBG_DBG, "New page added to the pageList size="<<pageList.size());
+
+@@ -2452,7 +2452,7 @@
+ return pageCount;
+ }
+
+- shared_ptr<CDict> rootDict=getPageTreeRoot(_this.lock());
++ boost::shared_ptr<CDict> rootDict=getPageTreeRoot(_this.lock());
+ if(!rootDict.get())
+ return 0;
+ pageCount=getKidsCount(rootDict, &nodeCountCache);
+@@ -2531,7 +2531,7 @@
+ }
+
+
+-void CPdf::consolidatePageList(const shared_ptr<IProperty> & oldValue, const shared_ptr<IProperty> & newValue)
++void CPdf::consolidatePageList(const boost::shared_ptr<IProperty> & oldValue, const boost::shared_ptr<IProperty> & newValue)
+ {
+ using namespace utils;
+
+@@ -2562,12 +2562,12 @@
+ {
+ kernelPrintDbg(DBG_DBG, "oldValue was simple page dictionary");
+ difference = -1;
+- shared_ptr<CDict> oldDict_ptr=getCObjectFromRef<CDict>(oldValue);
++ boost::shared_ptr<CDict> oldDict_ptr=getCObjectFromRef<CDict>(oldValue);
+
+ for(PageList::iterator i=pageList.begin(); i!=pageList.end(); ++i)
+ {
+ // checks page's dictionary with old one
+- shared_ptr<CPage> page=i->second;
++ boost::shared_ptr<CPage> page=i->second;
+ if(page->getDictionary() == oldDict_ptr)
+ {
+ i->second->invalidate();
+@@ -2598,7 +2598,7 @@
+ bool found=false;
+ for(PageList::iterator i=pageList.begin(); i!=pageList.end();)
+ {
+- shared_ptr<CPage> page=i->second;
++ boost::shared_ptr<CPage> page=i->second;
+ // checks page's dictionary whether it is in oldDict_ptr sub
+ // tree and if so removes it from pageList
+ if(isNodeDescendant(_this.lock(), ref, page->getDictionary()))
+@@ -2698,7 +2698,7 @@
+ for(i=pageList.begin(); i!=pageList.end();)
+ {
+ size_t pos=i->first;
+- shared_ptr<CPage> page=i->second;
++ boost::shared_ptr<CPage> page=i->second;
+
+ if(pos>=minPos)
+ {
+@@ -2782,8 +2782,8 @@
+ bool countChanged=false;
+ if(interNode->containsProperty("Count"))
+ {
+- shared_ptr<IProperty> countProp=interNode->getProperty("Count");
+- shared_ptr<CInt> countInt;
++ boost::shared_ptr<IProperty> countProp=interNode->getProperty("Count");
++ boost::shared_ptr<CInt> countInt;
+ if(isRef(countProp))
+ {
+ try
+@@ -2803,7 +2803,7 @@
+ interNode->delProperty("Count");
+
+ // adds new Count property with correct value
+- countInt=shared_ptr<CInt>(CIntFactory::getInstance((int)count));
++ countInt=boost::shared_ptr<CInt>(CIntFactory::getInstance((int)count));
+ kernelPrintDbg(DBG_DBG, "replacing old Count property with new property value="<<count);
+ interNode->addProperty("Count", *countInt);
+ countChanged=true;
+@@ -2842,7 +2842,7 @@
+ size_t index=0;
+ for(i=kids.begin(); i!=kids.end(); ++i, ++index)
+ {
+- shared_ptr<IProperty> child=*i;
++ boost::shared_ptr<IProperty> child=*i;
+ if(!isRef(child))
+ {
+ // element is not reference, so we print warning and skip it
+@@ -2861,16 +2861,16 @@
+
+ // gets target dictionary to check and consolidate - this doesn't throw
+ // because it is leaf or intermediate node
+- shared_ptr<CDict> childDict=getCObjectFromRef<CDict>(child);
++ boost::shared_ptr<CDict> childDict=getCObjectFromRef<CDict>(child);
+
+ // each leaf and inter node has to have Parent property with refernce to
+ // this node (which is indirect object and so we can use its
+ // NOTE that change in Parent property doesn't require also interNode
+ // parent consolidation
+- shared_ptr<CRef> parentRef;
++ boost::shared_ptr<CRef> parentRef;
+ if(childDict->containsProperty("Parent"))
+ {
+- shared_ptr<IProperty> parentProp=childDict->getProperty("Parent");
++ boost::shared_ptr<IProperty> parentProp=childDict->getProperty("Parent");
+ if(isRef(parentProp))
+ parentRef=IProperty::getSmartCObjectPtr<CRef>(parentProp);
+
+@@ -2881,7 +2881,7 @@
+ childDict->delProperty("Parent");
+
+ // adds new Parent property with correct value
+- parentRef=shared_ptr<CRef>(CRefFactory::getInstance(interNodeRef));
++ parentRef=boost::shared_ptr<CRef>(CRefFactory::getInstance(interNodeRef));
+ kernelPrintDbg(DBG_DBG, "replacing old Parent property with new");
+ childDict->addProperty("Parent", *parentRef);
+ }else
+@@ -2920,12 +2920,12 @@
+ // just prints warning messages and stops recursion
+ if(interNode->containsProperty("Parent"))
+ {
+- shared_ptr<IProperty> parentProp=interNode->getProperty("Parent");
++ boost::shared_ptr<IProperty> parentProp=interNode->getProperty("Parent");
+ if(isRef(parentProp))
+ {
+ try
+ {
+- shared_ptr<CDict> parentDict=getCObjectFromRef<CDict>(parentProp);
++ boost::shared_ptr<CDict> parentDict=getCObjectFromRef<CDict>(parentProp);
+ return consolidatePageTree(parentDict, true);
+ }catch(CObjectException & e)
+ {
+@@ -2977,8 +2977,8 @@
+ // gets intermediate node where to insert new page
+ // in degenerated case, when there are no pages in the tree, we have to
+ // handle it special way
+- shared_ptr<CDict> interNode_ptr;
+- shared_ptr<CRef> currRef;
++ boost::shared_ptr<CDict> interNode_ptr;
++ boost::shared_ptr<CRef> currRef;
+ // by default it is root of page tree
+ interNode_ptr=getPageTreeRoot(_this.lock());
+ if(!interNode_ptr.get())
+@@ -2993,23 +2993,23 @@
+ // searches for page at storePosition and gets its reference
+ // page dictionary has to be an indirect object, so getIndiRef returns
+ // dictionary reference
+- shared_ptr<CDict> currentPage_ptr=findPageDict(_this.lock(), interNode_ptr, 1, storePostion, &nodeCountCache);
+- currRef=shared_ptr<CRef>(CRefFactory::getInstance(currentPage_ptr->getIndiRef()));
++ boost::shared_ptr<CDict> currentPage_ptr=findPageDict(_this.lock(), interNode_ptr, 1, storePostion, &nodeCountCache);
++ currRef=boost::shared_ptr<CRef>(CRefFactory::getInstance(currentPage_ptr->getIndiRef()));
+
+ // gets parent of found dictionary which maintains
+- shared_ptr<IProperty> parentRef_ptr=currentPage_ptr->getProperty("Parent");
++ boost::shared_ptr<IProperty> parentRef_ptr=currentPage_ptr->getProperty("Parent");
+ interNode_ptr=getCObjectFromRef<CDict>(parentRef_ptr);
+ }
+
+ // gets Kids array where to insert new page dictionary
+- shared_ptr<IProperty> kidsProp_ptr=interNode_ptr->getProperty("Kids");
++ boost::shared_ptr<IProperty> kidsProp_ptr=interNode_ptr->getProperty("Kids");
+ if(kidsProp_ptr->getType()!=pArray)
+ {
+ kernelPrintDbg(DBG_ERR, "Pages Kids field is not an array type="<<kidsProp_ptr->getType());
+ // Kids is not array - malformed intermediate node
+ throw MalformedFormatExeption("Intermediate node Kids field is not an array.");
+ }
+- shared_ptr<CArray> kids_ptr=IProperty::getSmartCObjectPtr<CArray>(kidsProp_ptr);
++ boost::shared_ptr<CArray> kids_ptr=IProperty::getSmartCObjectPtr<CArray>(kidsProp_ptr);
+
+ // gets index in Kids array where to store.
+ // by default insert at 1st position (index is 0)
+@@ -3032,8 +3032,8 @@
+
+ // Now it is safe to add indirect object, because there is nothing that can
+ // fail
+- shared_ptr<CDict> pageDict=page->getDictionary();
+- shared_ptr<CPdf> pageDictPdf = pageDict->getPdf().lock();
++ boost::shared_ptr<CDict> pageDict=page->getDictionary();
++ boost::shared_ptr<CPdf> pageDictPdf = pageDict->getPdf().lock();
+ if(pageDictPdf && pageDictPdf !=_this.lock())
+ {
+ // page comes from different valid pdf - we have to create clone and
+@@ -3085,8 +3085,8 @@
+ // page dictionary is stored in the tree, consolidation is also done at this
+ // moment
+ // CPage can be created and inserted to the pageList
+- shared_ptr<CDict> newPageDict_ptr=IProperty::getSmartCObjectPtr<CDict>(getIndirectProperty(pageRef));
+- shared_ptr<CPage> newPage_ptr(CPageFactory::getInstance(newPageDict_ptr));
++ boost::shared_ptr<CDict> newPageDict_ptr=IProperty::getSmartCObjectPtr<CDict>(getIndirectProperty(pageRef));
++ boost::shared_ptr<CPage> newPage_ptr(CPageFactory::getInstance(newPageDict_ptr));
+ pageList.insert(PageList::value_type(storePostion+append, newPage_ptr));
+ kernelPrintDbg(DBG_DBG, "New page added to the pageList size="<<pageList.size());
+ return newPage_ptr;
+@@ -3113,21 +3113,21 @@
+ // Searches for page dictionary at given pos and gets its reference.
+ // getPageTreeRoot doesn't fail, because we are in page range and so it has
+ // to exist
+- shared_ptr<CDict> rootDict=getPageTreeRoot(_this.lock());
+- shared_ptr<CDict> currentPage_ptr=findPageDict(_this.lock(), rootDict, 1, pos, &nodeCountCache);
+- shared_ptr<CRef> currRef(CRefFactory::getInstance(currentPage_ptr->getIndiRef()));
++ boost::shared_ptr<CDict> rootDict=getPageTreeRoot(_this.lock());
++ boost::shared_ptr<CDict> currentPage_ptr=findPageDict(_this.lock(), rootDict, 1, pos, &nodeCountCache);
++ boost::shared_ptr<CRef> currRef(CRefFactory::getInstance(currentPage_ptr->getIndiRef()));
+
+ // Gets parent field from found page dictionary and gets its Kids array
+- shared_ptr<IProperty> parentRef_ptr=currentPage_ptr->getProperty("Parent");
+- shared_ptr<CDict> interNode_ptr=getCObjectFromRef<CDict>(parentRef_ptr);
+- shared_ptr<IProperty> kidsProp_ptr=interNode_ptr->getProperty("Kids");
++ boost::shared_ptr<IProperty> parentRef_ptr=currentPage_ptr->getProperty("Parent");
++ boost::shared_ptr<CDict> interNode_ptr=getCObjectFromRef<CDict>(parentRef_ptr);
++ boost::shared_ptr<IProperty> kidsProp_ptr=interNode_ptr->getProperty("Kids");
+ if(kidsProp_ptr->getType()!=pArray)
+ {
+ kernelPrintDbg(DBG_ERR, "Pages Kids field is not an array type="<<kidsProp_ptr->getType());
+ // Kids is not array - malformed intermediate node
+ throw MalformedFormatExeption("Intermediate node Kids field is not an array.");
+ }
+- shared_ptr<CArray> kids_ptr=IProperty::getSmartCObjectPtr<CArray>(kidsProp_ptr);
++ boost::shared_ptr<CArray> kids_ptr=IProperty::getSmartCObjectPtr<CArray>(kidsProp_ptr);
+
+ // gets index of searched node in Kids array and removes element from found
+ // position - if position can't be determined unambiguously (getPropertyId
diff --git a/editors/pdfedit/files/patch-src-kernel-cstream.c b/editors/pdfedit/files/patch-src-kernel-cstream.c
new file mode 100644
index 000000000000..4d76e0ec1dc2
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-cstream.c
@@ -0,0 +1,65 @@
+--- ./src/kernel/cstream.cc.orig 2015-08-23 03:19:33.639621000 +0900
++++ ./src/kernel/cstream.cc 2015-08-23 03:20:30.110651000 +0900
+@@ -123,7 +123,7 @@
+ CStream::createReqEntries ()
+ {
+ // Add one required entry in the stream dictionary (according to pdf specification)
+- shared_ptr<CInt> len (new CInt (0));
++ boost::shared_ptr<CInt> len (new CInt (0));
+ assert (len);
+ dictionary.addProperty ("Length", *len);
+ }
+@@ -152,7 +152,7 @@
+ CDict::Value::const_iterator it = dictionary.value.begin ();
+ for (; it != dictionary.value.end (); ++it)
+ {
+- shared_ptr<IProperty> newIp = ((*it).second)->clone ();
++ boost::shared_ptr<IProperty> newIp = ((*it).second)->clone ();
+ assert (newIp);
+ CDict::Value::value_type item = make_pair ((*it).first, newIp);
+ clone_->dictionary.value.push_back (item);
+@@ -204,7 +204,7 @@
+ this->canChange();
+
+ // Create context
+- shared_ptr<ObserverContext> context (this->_createContext());
++ boost::shared_ptr<ObserverContext> context (this->_createContext());
+
+ // Copy buf to buffer
+ buffer.clear ();
+@@ -324,7 +324,7 @@
+ size_t
+ CStream::getLength () const
+ {
+- shared_ptr<IProperty> len = utils::getReferencedObject (dictionary.getProperty("Length"));
++ boost::shared_ptr<IProperty> len = utils::getReferencedObject (dictionary.getProperty("Length"));
+ if (isInt (len))
+ {
+ int length;
+@@ -345,7 +345,7 @@
+ IProperty::ObserverContext*
+ CStream::_createContext () const
+ {
+- return new BasicObserverContext (shared_ptr<IProperty> (new CNull ()));
++ return new BasicObserverContext (boost::shared_ptr<IProperty> (new CNull ()));
+ }
+
+
+@@ -353,7 +353,7 @@
+ //
+ //
+ void
+-CStream::_objectChanged (shared_ptr<const ObserverContext> context)
++CStream::_objectChanged (boost::shared_ptr<const ObserverContext> context)
+ {
+ // Do not notify anything if we are not in a valid pdf
+ if (!hasValidPdf (this))
+@@ -380,7 +380,7 @@
+ // doesn't clone but rather wrap this with shared pointer
+ // and empty deallocator to prevent from this instance
+ // deallocation
+- shared_ptr<IProperty> newValue(this, EmptyDeallocator<IProperty>());
++ boost::shared_ptr<IProperty> newValue(this, EmptyDeallocator<IProperty>());
+ // Fill it with correct values
+ newValue->setPdf (this->getPdf());
+ newValue->setIndiRef (this->getIndiRef());
diff --git a/editors/pdfedit/files/patch-src-kernel-pdfoperators.cc b/editors/pdfedit/files/patch-src-kernel-pdfoperators.cc
new file mode 100644
index 000000000000..e7ec39610046
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-pdfoperators.cc
@@ -0,0 +1,120 @@
+--- src/kernel/pdfoperators.cc.orig 2016-06-11 06:39:28.304555000 +0900
++++ src/kernel/pdfoperators.cc 2016-06-11 06:42:54.331017000 +0900
+@@ -129,7 +129,7 @@
+ //
+ //
+ //
+-shared_ptr<PdfOperator>
++boost::shared_ptr<PdfOperator>
+ SimpleGenericOperator::clone ()
+ {
+ // Clone operands
+@@ -144,7 +144,7 @@
+
+
+ void
+-SimpleGenericOperator::init_operands (shared_ptr<observer::IObserver<IProperty> > observer,
++SimpleGenericOperator::init_operands (boost::shared_ptr<observer::IObserver<IProperty> > observer,
+ boost::weak_ptr<CPdf> pdf,
+ IndiRef* rf)
+ {
+@@ -204,20 +204,20 @@
+ }
+ else if (name == "TJ")
+ {
+- shared_ptr<IProperty> op = ops[0];
++ boost::shared_ptr<IProperty> op = ops[0];
+ if (!isArray(op) || ops.size() != 1)
+ {
+ utilsPrintDbg(debug::DBG_WARN, "Bad operands for TJ operator: ops[type="
+ << op->getType() <<" size="<<ops.size()<<"]");
+ return;
+ }
+- shared_ptr<CArray> opArray = IProperty::getSmartCObjectPtr<CArray>(op);
+- std::vector<shared_ptr<IProperty> > props;
++ boost::shared_ptr<CArray> opArray = IProperty::getSmartCObjectPtr<CArray>(op);
++ std::vector<boost::shared_ptr<IProperty> > props;
+ opArray->_getAllChildObjects(props);
+- std::vector<shared_ptr<IProperty> >::iterator i;
++ std::vector<boost::shared_ptr<IProperty> >::iterator i;
+ for(i=props.begin(); i!=props.end(); ++i)
+ {
+- shared_ptr<IProperty> p = *i;
++ boost::shared_ptr<IProperty> p = *i;
+
+ // TODO consider spacing coming from values
+ if(!(isString(p)))
+@@ -264,7 +264,7 @@
+ }
+ else if (name == "TJ")
+ {
+- shared_ptr<IProperty> op = ops[0];
++ boost::shared_ptr<IProperty> op = ops[0];
+ if (!isArray(op) || ops.size() != 1)
+ {
+ utilsPrintDbg(debug::DBG_WARN, "Bad operands for TJ operator: ops[type="<< op->getType() <<" size="<<ops.size()<<"]");
+@@ -311,7 +311,7 @@
+ {
+ assert(fontData);
+ const char* tag = fontData->getFontTag();
+- shared_ptr<GfxResources> res = getContentStream()->getResources();
++ boost::shared_ptr<GfxResources> res = getContentStream()->getResources();
+ GfxFont* font = res->lookupFont(tag);
+ if(!font)
+ utilsPrintDbg(debug::DBG_ERR, "Unable to get font(name="
+@@ -407,10 +407,10 @@
+ //
+ //
+ //
+-shared_ptr<PdfOperator>
++boost::shared_ptr<PdfOperator>
+ UnknownCompositePdfOperator::clone ()
+ {
+- shared_ptr<UnknownCompositePdfOperator> clone (new UnknownCompositePdfOperator(_opBegin,_opEnd));
++ boost::shared_ptr<UnknownCompositePdfOperator> clone (new UnknownCompositePdfOperator(_opBegin,_opEnd));
+
+ for (PdfOperators::iterator it = _children.begin(); it != _children.end(); ++it)
+ clone->push_back ((*it)->clone(),getLastOperator(clone));
+@@ -482,13 +482,13 @@
+ //
+ //
+ //
+-shared_ptr<PdfOperator>
++boost::shared_ptr<PdfOperator>
+ InlineImageCompositePdfOperator::clone ()
+ {
+ // Clone operands
+- shared_ptr<CInlineImage> imgclone = IProperty::getSmartCObjectPtr<CInlineImage> (_inlineimage->clone());
++ boost::shared_ptr<CInlineImage> imgclone = IProperty::getSmartCObjectPtr<CInlineImage> (_inlineimage->clone());
+ // Create clone
+- return shared_ptr<PdfOperator> (new InlineImageCompositePdfOperator (imgclone, _opBegin, _opEnd));
++ return boost::shared_ptr<PdfOperator> (new InlineImageCompositePdfOperator (imgclone, _opBegin, _opEnd));
+ }
+
+
+@@ -505,7 +505,7 @@
+ const StateUpdater::CheckTypes* chcktp = StateUpdater::findOp (name.c_str());
+ // Operator not found, create unknown operator
+ if (NULL == chcktp)
+- return shared_ptr<PdfOperator> (new SimpleGenericOperator (name ,operands));
++ return boost::shared_ptr<PdfOperator> (new SimpleGenericOperator (name ,operands));
+
+ assert (chcktp);
+ utilsPrintDbg (DBG_DBG, "Operator found. " << chcktp->name);
+@@ -524,13 +524,13 @@
+ // If endTag is "" it is a simple operator, composite otherwise
+ //
+ if (isTextOp(*chcktp))
+- return shared_ptr<PdfOperator> (new TextSimpleOperator(chcktp->name, argNum, operands));
++ return boost::shared_ptr<PdfOperator> (new TextSimpleOperator(chcktp->name, argNum, operands));
+
+ if (isSimpleOp(*chcktp))
+- return shared_ptr<PdfOperator> (new SimpleGenericOperator (chcktp->name, argNum, operands));
++ return boost::shared_ptr<PdfOperator> (new SimpleGenericOperator (chcktp->name, argNum, operands));
+
+ // Composite operator
+- return shared_ptr<PdfOperator> (new UnknownCompositePdfOperator (chcktp->name, chcktp->endTag));
++ return boost::shared_ptr<PdfOperator> (new UnknownCompositePdfOperator (chcktp->name, chcktp->endTag));
+
+ }
+
diff --git a/editors/pdfedit/files/patch-src-kernel-pdfoperatorsbase.cc b/editors/pdfedit/files/patch-src-kernel-pdfoperatorsbase.cc
new file mode 100644
index 000000000000..f1ef59f96cfe
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-pdfoperatorsbase.cc
@@ -0,0 +1,78 @@
+--- src/kernel/pdfoperatorsbase.cc.orig 2016-06-11 06:35:15.369169000 +0900
++++ src/kernel/pdfoperatorsbase.cc 2016-06-11 06:36:00.937632000 +0900
+@@ -48,7 +48,7 @@
+ //
+ //
+ //
+-shared_ptr<CContentStream>
++boost::shared_ptr<CContentStream>
+ PdfOperator::getContentStream () const
+ {
+ assert (_contentstream);
+@@ -57,7 +57,7 @@
+ }
+
+ void
+-PdfOperator::putBehind (shared_ptr<PdfOperator> behindWhich, shared_ptr<PdfOperator> which)
++PdfOperator::putBehind (boost::shared_ptr<PdfOperator> behindWhich, boost::shared_ptr<PdfOperator> which)
+ {
+ if (behindWhich && which)
+ {
+@@ -92,7 +92,7 @@
+ //
+ //
+ void
+-CompositePdfOperator::push_back (const shared_ptr<PdfOperator> oper, shared_ptr<PdfOperator> prev)
++CompositePdfOperator::push_back (const boost::shared_ptr<PdfOperator> oper, boost::shared_ptr<PdfOperator> prev)
+ {
+ assert (oper);
+ kernelPrintDbg (debug::DBG_DBG, "");
+@@ -136,7 +136,7 @@
+ //
+ //
+ void
+-CompositePdfOperator::remove (shared_ptr<PdfOperator> op)
++CompositePdfOperator::remove (boost::shared_ptr<PdfOperator> op)
+ {
+ PdfOperators::iterator it = find (_children.begin(), _children.end(), op);
+ assert (it != _children.end());
+@@ -160,8 +160,8 @@
+ //
+ //
+ void
+-CompositePdfOperator::insert_after (const shared_ptr<PdfOperator> oper,
+- shared_ptr<PdfOperator> newOper)
++CompositePdfOperator::insert_after (const boost::shared_ptr<PdfOperator> oper,
++ boost::shared_ptr<PdfOperator> newOper)
+ {
+ PdfOperators::iterator it = std::find (_children.begin(), _children.end(), oper);
+ _children.insert (++it, newOper);
+@@ -189,7 +189,7 @@
+ }
+
+ void
+-CompositePdfOperator::init_operands (shared_ptr<observer::IObserver<IProperty> > observer, boost::weak_ptr<CPdf> pdf, IndiRef* rf)
++CompositePdfOperator::init_operands (boost::shared_ptr<observer::IObserver<IProperty> > observer, boost::weak_ptr<CPdf> pdf, IndiRef* rf)
+ {
+ for (PdfOperators::iterator it = _children.begin (); it != _children.end(); ++it)
+ (*it)->init_operands (observer, pdf, rf);
+@@ -204,8 +204,8 @@
+ //
+ //
+ //
+-shared_ptr<PdfOperator>
+-getLastOperator (shared_ptr<PdfOperator> oper)
++boost::shared_ptr<PdfOperator>
++getLastOperator (boost::shared_ptr<PdfOperator> oper)
+ {
+ if (!isCompositeOp (oper) || 0 == oper->getChildrenCount())
+ return oper;
+@@ -213,7 +213,7 @@
+ PdfOperator::PdfOperators opers;
+ oper->getChildren (opers);
+ assert (!opers.empty());
+- shared_ptr<PdfOperator> tmpop = opers.back();
++ boost::shared_ptr<PdfOperator> tmpop = opers.back();
+ while (isCompositeOp (tmpop))
+ {
+ opers.back()->getChildren (opers);
diff --git a/editors/pdfedit/files/patch-src-kernel-pdfwriter.cc b/editors/pdfedit/files/patch-src-kernel-pdfwriter.cc
new file mode 100644
index 000000000000..5a7b9b480c93
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-pdfwriter.cc
@@ -0,0 +1,57 @@
+--- src/kernel/pdfwriter.cc.orig 2016-06-11 06:46:45.675949000 +0900
++++ src/kernel/pdfwriter.cc 2016-06-11 06:47:46.394754000 +0900
+@@ -110,7 +110,7 @@
+ printf("Unsupported context.\n");
+ return;
+ }
+- shared_ptr<const IPdfWriter::ChangeContext> progressContext=
++ boost::shared_ptr<const IPdfWriter::ChangeContext> progressContext=
+ dynamic_pointer_cast<const IPdfWriter::ChangeContext>(context);
+ size_t total=progressContext->getScope()->total;
+ if(!started)
+@@ -427,7 +427,7 @@
+ // contain binary data
+ if(obj.isStream())
+ {
+- shared_ptr<FilterStreamWriter> filter = FilterStreamWriter::getInstance(obj);
++ boost::shared_ptr<FilterStreamWriter> filter = FilterStreamWriter::getInstance(obj);
+ assert(filter->supportObject(obj));
+ filter->compress(obj, ref, stream);
+ }else
+@@ -502,11 +502,11 @@
+ size_t index=0;
+
+ // creates context for observers
+- shared_ptr<OperationScope> scope(new OperationScope());
++ boost::shared_ptr<OperationScope> scope(new OperationScope());
+ scope->total=objectList.size();
+ scope->task=CONTENT;
+- shared_ptr<ChangeContext> context(new ChangeContext(scope));
+- shared_ptr<OperationStep> newValue(new OperationStep());
++ boost::shared_ptr<ChangeContext> context(new ChangeContext(scope));
++ boost::shared_ptr<OperationStep> newValue(new OperationStep());
+
+ // prepares offTable and writes objects
+ for(i=objectList.begin(); i!=objectList.end(); i++, index++)
+@@ -659,10 +659,10 @@
+ utilsPrintDbg(DBG_DBG, "Writing "<<subSectionTable.size()<<" subsections");
+
+ // creates context for observers
+- shared_ptr<OperationScope> scope(new OperationScope());
++ boost::shared_ptr<OperationScope> scope(new OperationScope());
+ scope->total=subSectionTable.size();
+ scope->task=TRAILER;
+- shared_ptr<ChangeContext> context(new ChangeContext(scope));
++ boost::shared_ptr<ChangeContext> context(new ChangeContext(scope));
+
+ // writes all subsection
+ size_t index=1;
+@@ -704,7 +704,7 @@
+ }
+
+ // notifies observers
+- shared_ptr<OperationStep> newValue(new OperationStep());
++ boost::shared_ptr<OperationStep> newValue(new OperationStep());
+ newValue->currStep=index;
+ notifyObservers(newValue, context);
+ }
diff --git a/editors/pdfedit/files/patch-src-kernel-stateupdater.cc b/editors/pdfedit/files/patch-src-kernel-stateupdater.cc
new file mode 100644
index 000000000000..05006bbabf3c
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-stateupdater.cc
@@ -0,0 +1,11 @@
+--- src/kernel/stateupdater.cc.orig 2016-06-11 06:44:12.114485000 +0900
++++ src/kernel/stateupdater.cc 2016-06-11 06:45:25.066472000 +0900
+@@ -1227,7 +1227,7 @@
+ { // Convert it to real
+ double dval = 0.0;
+ dval = IProperty::getSmartCObjectPtr<CInt>(*it)->getValue();
+- shared_ptr<IProperty> pIp (new CReal (dval));
++ boost::shared_ptr<IProperty> pIp (new CReal (dval));
+ std::replace (operands.begin(), operands.end(), *it, pIp);
+ }
+ }
diff --git a/editors/pdfedit/files/patch-src-kernel-textoutputengines.cc b/editors/pdfedit/files/patch-src-kernel-textoutputengines.cc
new file mode 100644
index 000000000000..cef8512fc606
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-kernel-textoutputengines.cc
@@ -0,0 +1,29 @@
+--- src/kernel/textoutputengines.cc.orig 2016-06-12 03:44:13.431031000 +0900
++++ src/kernel/textoutputengines.cc 2016-06-12 03:44:31.197856000 +0900
+@@ -232,13 +232,13 @@
+ PdfOperator::Operands ops;
+ op->getParameters (ops);
+ assert (1 == ops.size());
+- shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (ops.front());
++ boost::shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (ops.front());
+ //
+ // Loop through TJ operands either strings or nums
+ //
+ for (size_t i = 0; i < array->getPropertyCount(); ++i)
+ {
+- shared_ptr<IProperty> ip = array->getProperty (i);
++ boost::shared_ptr<IProperty> ip = array->getProperty (i);
+ if (isNumber (ip))
+ {
+ int wMode = s->getFont()->getWMode();
+@@ -253,8 +253,8 @@
+ // Create Tj with text and add it to output
+ string txt = getStringFromIProperty (ip);
+ PdfOperator::Operands opers;
+- opers.push_back (shared_ptr<CString> (new CString (txt)));
+- shared_ptr<PdfOperator> newop = createOperator ("Tj", opers);
++ opers.push_back (boost::shared_ptr<CString> (new CString (txt)));
++ boost::shared_ptr<PdfOperator> newop = createOperator ("Tj", opers);
+ // Set bbox
+ BBox bbox;
+ StateUpdater::printTextUpdate (s.get(), txt, &bbox);
diff --git a/editors/pdfedit/files/patch-src-tools-Makfile b/editors/pdfedit/files/patch-src-tools-Makfile
new file mode 100644
index 000000000000..7c018ad3d519
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-Makfile
@@ -0,0 +1,13 @@
+--- src/tools/Makefile.orig 2016-06-12 05:05:10.782469000 +0900
++++ src/tools/Makefile 2016-06-12 05:06:44.155717000 +0900
+@@ -25,6 +25,10 @@
+ .PHONY: all clean
+ all: $(TARGET)
+
++install: $(TARGET)
++ $(MKDIR) $(INSTALL_ROOT)$(bindir)
++ $(BSD_INSTALL_PROGRAM) $(TARGET) $(INSTALL_ROOT)$(bindir)
++
+ displaycs: displaycs.o
+ $(LINK) $(LDFLAGS) -o displaycs displaycs.o $(TOOLS_LIBS)
+
diff --git a/editors/pdfedit/files/patch-src-tools-add_image.cc b/editors/pdfedit/files/patch-src-tools-add_image.cc
new file mode 100644
index 000000000000..36ac50fe1757
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-add_image.cc
@@ -0,0 +1,69 @@
+--- src/tools/add_image.cc.orig 2010-04-30 18:32:18.000000000 +0900
++++ src/tools/add_image.cc 2016-06-12 04:11:42.137365000 +0900
+@@ -104,10 +104,10 @@
+
+ png_read_info(png_ptr, info_ptr);
+
+- size.x = info_ptr->width;
+- size.y = info_ptr->height;
+- color_type = info_ptr->color_type;
+- bit_depth = info_ptr->bit_depth;
++ size.x = png_get_image_width(png_ptr, info_ptr);
++ size.y = png_get_image_height(png_ptr, info_ptr);
++ bit_depth = png_get_bit_depth(png_ptr, info_ptr);
++ color_type = png_get_color_type(png_ptr, info_ptr);
+
+ number_of_passes = png_set_interlace_handling(png_ptr);
+ png_read_update_info(png_ptr, info_ptr);
+@@ -116,13 +116,13 @@
+ if (setjmp(png_jmpbuf(png_ptr)))
+ return;
+
+- scoped_array<png_byte> raw_buf (new png_byte [info_ptr->rowbytes]);
+- for (size_t y = 0; y < info_ptr->height; y++)
++ scoped_array<png_byte> raw_buf (new png_byte [png_get_rowbytes(png_ptr, info_ptr)]);
++ for (size_t y = 0; y < png_get_image_height(png_ptr, info_ptr); y++)
+ {
+ png_bytep bufp = raw_buf.get();
+ png_bytepp bufpp = &bufp;
+ png_read_rows (png_ptr, bufpp, NULL, 1);
+- std::copy (&raw_buf[0], &raw_buf[info_ptr->rowbytes], std::back_inserter (buf));
++ std::copy (&raw_buf[0], &raw_buf[png_get_rowbytes(png_ptr, info_ptr)], std::back_inserter (buf));
+ }
+
+ fclose(fp);
+@@ -132,7 +132,7 @@
+ };
+
+ struct _add {
+- void operator () (shared_ptr<CPage> page,
++ void operator () (boost::shared_ptr<CPage> page,
+ const Position& where,
+ Point image_dim,
+ size_t bit_depth,
+@@ -191,14 +191,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());
+ }
+@@ -226,7 +226,7 @@
+ continue;
+ }
+
+- shared_ptr<CPage> page = pdf->getPage(*it);
++ boost::shared_ptr<CPage> page = pdf->getPage(*it);
+ _add()(page, pos, _png.size, _png.bit_depth, _png.buf);
+
+ #ifdef WIN32
diff --git a/editors/pdfedit/files/patch-src-tools-add_text.cc b/editors/pdfedit/files/patch-src-tools-add_text.cc
new file mode 100644
index 000000000000..c2ee9e471d6c
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-add_text.cc
@@ -0,0 +1,37 @@
+--- src/tools/add_text.cc.orig 2016-06-12 03:53:24.278803000 +0900
++++ src/tools/add_text.cc 2016-06-12 03:53:43.440512000 +0900
+@@ -54,7 +54,7 @@
+ };
+
+ struct _add {
+- void operator () (shared_ptr<CPage> page,
++ void operator () (boost::shared_ptr<CPage> page,
+ const string& what,
+ const Position& where,
+ std::string font_id)
+@@ -126,14 +126,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());
+ }
+@@ -154,7 +154,7 @@
+ continue;
+ }
+
+- shared_ptr<CPage> page = pdf->getPage(*it);
++ boost::shared_ptr<CPage> page = pdf->getPage(*it);
+ _add()(page, what, pos, font_id);
+
+ #ifdef WIN32
diff --git a/editors/pdfedit/files/patch-src-tools-displaycs.cc b/editors/pdfedit/files/patch-src-tools-displaycs.cc
new file mode 100644
index 000000000000..a45ea49eb111
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-displaycs.cc
@@ -0,0 +1,22 @@
+--- src/tools/displaycs.cc.orig 2016-06-12 03:46:15.039573000 +0900
++++ src/tools/displaycs.cc 2016-06-12 03:46:33.669788000 +0900
+@@ -74,7 +74,7 @@
+ size_t from = vm["from"].as<size_t>();
+
+ // 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);
+
+ // sane values
+ size_t to = pdf->getPageCount()+1;
+@@ -90,8 +90,8 @@
+ {
+ std::cout << "=====================" << endl;
+ std::cout << "PAGE NUMBER " << i << endl;
+- shared_ptr<CPage> page = pdf->getPage(i);
+- typedef vector<shared_ptr<CContentStream> > CCs;
++ boost::shared_ptr<CPage> page = pdf->getPage(i);
++ typedef vector<boost::shared_ptr<CContentStream> > CCs;
+ CCs ccs;
+ page->getContentStreams (ccs);
+ std::cout << "- parsed" << endl;
diff --git a/editors/pdfedit/files/patch-src-tools-pagemetrics.cc b/editors/pdfedit/files/patch-src-tools-pagemetrics.cc
new file mode 100644
index 000000000000..bc5c3f496d7b
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-pagemetrics.cc
@@ -0,0 +1,47 @@
+--- src/tools/pagemetrics.cc.orig 2016-06-12 03:48:34.337781000 +0900
++++ src/tools/pagemetrics.cc 2016-06-12 03:48:53.651846000 +0900
+@@ -48,7 +48,7 @@
+
+ struct stm {
+ static const string name;
+- void operator () (shared_ptr<CPage> page, P& p)
++ void operator () (boost::shared_ptr<CPage> page, P& p)
+ {
+ if (p.size() < 6) throw std::runtime_error ("too few p params");
+ page->setTransformMatrix (&p[0]);
+@@ -58,7 +58,7 @@
+
+ struct sr {
+ static const string name;
+- void operator () (shared_ptr<CPage> page, P& p)
++ void operator () (boost::shared_ptr<CPage> page, P& p)
+ {
+ if (p.size() < 1) throw std::runtime_error ("too few p params");
+ page->setRotation ((int)(p[0]));
+@@ -68,7 +68,7 @@
+
+ struct smb {
+ static const string name;
+- void operator () (shared_ptr<CPage> page, const P& p)
++ void operator () (boost::shared_ptr<CPage> page, const P& p)
+ {
+ if (p.size() < 4) throw std::runtime_error ("too few p params");
+ page->setMediabox (libs::Rectangle (p[0], p[1], p[2], p[3]));
+@@ -131,7 +131,7 @@
+ 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);
+
+ // sane values
+ to = std::min(to, pdf->getPageCount()+1);
+@@ -139,7 +139,7 @@
+ // now the hard stuff comes
+ for (unsigned int i = from; i < to; ++i)
+ {
+- shared_ptr<CPage> page = pdf->getPage(i);
++ boost::shared_ptr<CPage> page = pdf->getPage(i);
+ if (alg == stm::name)
+ stm()(page,p);
+ else if (alg == sr::name)
diff --git a/editors/pdfedit/files/patch-src-tools-pdf_images.cc b/editors/pdfedit/files/patch-src-tools-pdf_images.cc
new file mode 100644
index 000000000000..435318f3bf2b
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-pdf_images.cc
@@ -0,0 +1,38 @@
+--- src/tools/pdf_images.cc.orig 2016-06-12 04:13:54.045270000 +0900
++++ src/tools/pdf_images.cc 2016-06-12 04:14:32.874579000 +0900
+@@ -51,7 +51,7 @@
+ };
+ // what to do with a page
+ struct _extract_images {
+- void operator () (shared_ptr<CPage> page, ImageOutputDev& img_out, pdfobjects::DisplayParams& displayparams)
++ void operator () (boost::shared_ptr<CPage> page, ImageOutputDev& img_out, pdfobjects::DisplayParams& displayparams)
+ {
+ page->displayPage (img_out, displayparams);
+ }
+@@ -107,7 +107,7 @@
+ 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);
+ ImageOutputDev img_out (const_cast<char*> (dir.c_str()), gTrue);
+
+ // alter display params
+@@ -119,7 +119,7 @@
+ {
+ for (size_t i = 1; i <= pdf->getPageCount(); ++i)
+ {
+- shared_ptr<CPage> page = pdf->getPage(i);
++ boost::shared_ptr<CPage> page = pdf->getPage(i);
+ std::cout << "\nPage " << i << ":";
+ _extract_images()(page, img_out, displayparams);
+ }
+@@ -134,7 +134,7 @@
+ continue;
+ }
+
+- shared_ptr<CPage> page = pdf->getPage(*it);
++ boost::shared_ptr<CPage> page = pdf->getPage(*it);
+ std::cout << "\nPage " << *it << ":";
+ _extract_images()(page, img_out, displayparams);
+ }
diff --git a/editors/pdfedit/files/patch-src-tools-replace_text.cc b/editors/pdfedit/files/patch-src-tools-replace_text.cc
new file mode 100644
index 000000000000..69dfb5839d23
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-tools-replace_text.cc
@@ -0,0 +1,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
diff --git a/editors/pdfedit/files/patch-src-utils-algorithms.h b/editors/pdfedit/files/patch-src-utils-algorithms.h
new file mode 100644
index 000000000000..35fa6913c72c
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-utils-algorithms.h
@@ -0,0 +1,18 @@
+--- src/utils/algorithms.h.orig 2016-06-11 10:27:29.196801000 +0900
++++ src/utils/algorithms.h 2016-06-11 10:27:51.958626000 +0900
+@@ -22,7 +22,7 @@
+ * Project is hosted on http://sourceforge.net/projects/pdfedit
+ */
+ #ifndef _ALGORTIHMS_H_
+-#define _ALGORTIHMS_H__
++#define _ALGORTIHMS_H_
+
+ //============================================
+ // Basic includes
+@@ -31,5 +31,5 @@
+ #include <utils/algorithms/basic_algos.h>
+
+
+-#endif //_ALGORTIHMS_H__
++#endif //_ALGORTIHMS_H_
+
diff --git a/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.cc b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.cc
new file mode 100644
index 000000000000..066fd304f606
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.cc
@@ -0,0 +1,29 @@
+--- src/xpdf/fofi/FoFiEncodings.cc.orig 2016-06-11 10:34:02.955763000 +0900
++++ src/xpdf/fofi/FoFiEncodings.cc 2016-06-11 10:34:35.315168000 +0900
+@@ -19,7 +19,7 @@
+ // Type 1 and 1C font data
+ //------------------------------------------------------------------------
+
+-char *fofiType1StandardEncoding[256] = {
++const char *fofiType1StandardEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+@@ -278,7 +278,7 @@
+ NULL
+ };
+
+-char *fofiType1ExpertEncoding[256] = {
++const char *fofiType1ExpertEncoding[256] = {
+ NULL,
+ NULL,
+ NULL,
+@@ -541,7 +541,7 @@
+ // Type 1C font data
+ //------------------------------------------------------------------------
+
+-char *fofiType1CStdStrings[391] = {
++const char *fofiType1CStdStrings[391] = {
+ ".notdef",
+ "space",
+ "exclam",
diff --git a/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.h b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.h
new file mode 100644
index 000000000000..7833994f8978
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiEncodings.h
@@ -0,0 +1,20 @@
+--- src/xpdf/fofi/FoFiEncodings.h.orig 2016-06-11 10:35:39.548372000 +0900
++++ src/xpdf/fofi/FoFiEncodings.h 2016-06-11 10:36:01.939673000 +0900
+@@ -21,14 +21,14 @@
+ // Type 1 and 1C font data
+ //------------------------------------------------------------------------
+
+-extern char *fofiType1StandardEncoding[256];
+-extern char *fofiType1ExpertEncoding[256];
++extern const char *fofiType1StandardEncoding[256];
++extern const char *fofiType1ExpertEncoding[256];
+
+ //------------------------------------------------------------------------
+ // Type 1C font data
+ //------------------------------------------------------------------------
+
+-extern char *fofiType1CStdStrings[391];
++extern const char *fofiType1CStdStrings[391];
+ extern Gushort fofiType1CISOAdobeCharset[229];
+ extern Gushort fofiType1CExpertCharset[166];
+ extern Gushort fofiType1CExpertSubsetCharset[87];
diff --git a/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.cc b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.cc
new file mode 100644
index 000000000000..aff1841b1e56
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.cc
@@ -0,0 +1,29 @@
+--- src/xpdf/fofi/FoFiTrueType.cc.orig 2016-06-11 10:37:17.000155000 +0900
++++ src/xpdf/fofi/FoFiTrueType.cc 2016-06-11 10:40:14.853257000 +0900
+@@ -143,7 +143,7 @@
+ //------------------------------------------------------------------------
+
+ struct T42Table {
+- char *tag; // 4-byte tag
++ const char *tag; // 4-byte tag
+ GBool required; // required by the TrueType spec?
+ };
+
+@@ -173,7 +173,7 @@
+
+ // Glyph names in some arbitrary standard order that Apple uses for
+ // their TrueType fonts.
+-static char *macGlyphNames[258] = {
++static const char *macGlyphNames[258] = {
+ ".notdef", "null", "CR", "space",
+ "exclam", "quotedbl", "numbersign", "dollar",
+ "percent", "ampersand", "quotesingle", "parenleft",
+@@ -2011,7 +2011,7 @@
+ }
+ }
+
+-int FoFiTrueType::seekTable(char *tag) {
++int FoFiTrueType::seekTable(const char *tag) {
+ Guint tagI;
+ int i;
+
diff --git a/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.h b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.h
new file mode 100644
index 000000000000..b1d9ddd8a842
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiTrueType.h
@@ -0,0 +1,11 @@
+--- src/xpdf/fofi/FoFiTrueType.h.orig 2016-06-11 10:41:33.311317000 +0900
++++ src/xpdf/fofi/FoFiTrueType.h 2016-06-11 10:41:43.645672000 +0900
+@@ -156,7 +156,7 @@
+ Guint computeTableChecksum(Guchar *data, int length);
+ void parse();
+ void readPostTable();
+- int seekTable(char *tag);
++ int seekTable(const char *tag);
+
+ TrueTypeTable *tables;
+ int nTables;
diff --git a/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1.cc b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1.cc
new file mode 100644
index 000000000000..0f9ab9982453
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1.cc
@@ -0,0 +1,11 @@
+--- src/xpdf/fofi/FoFiType1.cc.orig 2016-06-11 10:43:43.363657000 +0900
++++ src/xpdf/fofi/FoFiType1.cc 2016-06-11 10:44:21.857241000 +0900
+@@ -194,7 +194,7 @@
+ // get encoding
+ } else if (!encoding &&
+ !strncmp(line, "/Encoding StandardEncoding def", 30)) {
+- encoding = fofiType1StandardEncoding;
++ encoding = (char **)fofiType1StandardEncoding;
+ } else if (!encoding &&
+ !strncmp(line, "/Encoding 256 array", 19)) {
+ encoding = (char **)gmallocn(256, sizeof(char *));
diff --git a/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1C.cc b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1C.cc
new file mode 100644
index 000000000000..a7f31738f870
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-fofi-FoFiType1C.cc
@@ -0,0 +1,15 @@
+--- src/xpdf/fofi/FoFiType1C.cc.orig 2016-06-11 10:45:36.260108000 +0900
++++ src/xpdf/fofi/FoFiType1C.cc 2016-06-11 10:46:10.103508000 +0900
+@@ -2261,10 +2261,10 @@
+ int pos, c, sid, nLeft, nSups, i, j;
+
+ if (topDict.encodingOffset == 0) {
+- encoding = fofiType1StandardEncoding;
++ encoding = (char **)fofiType1StandardEncoding;
+
+ } else if (topDict.encodingOffset == 1) {
+- encoding = fofiType1ExpertEncoding;
++ encoding = (char **)fofiType1ExpertEncoding;
+
+ } else {
+ encoding = (char **)gmallocn(256, sizeof(char *));
diff --git a/editors/pdfedit/files/patch-src-xpdf-goo-GString.cc b/editors/pdfedit/files/patch-src-xpdf-goo-GString.cc
new file mode 100644
index 000000000000..1108fd3052bc
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-goo-GString.cc
@@ -0,0 +1,91 @@
+--- src/xpdf/goo/GString.cc.orig 2009-09-11 21:02:56.000000000 +0900
++++ src/xpdf/goo/GString.cc 2016-06-12 03:02:35.310062000 +0900
+@@ -60,7 +60,7 @@
+ fmtSpace
+ };
+
+-static char *formatStrings[] = {
++static const char *formatStrings[] = {
+ "d", "x", "o", "b", "ud", "ux", "uo", "ub",
+ "ld", "lx", "lo", "lb", "uld", "ulx", "ulo", "ulb",
+ "f", "g",
+@@ -144,14 +144,14 @@
+
+ GString *GString::fromInt(int x) {
+ char buf[24]; // enough space for 64-bit ints plus a little extra
+- char *p;
++ const char *p;
+ int len;
+
+ formatInt(x, buf, sizeof(buf), gFalse, 0, 10, &p, &len);
+ return new GString(p, len);
+ }
+
+-GString *GString::format(char *fmt, ...) {
++GString *GString::format(const char *fmt, ...) {
+ va_list argList;
+ GString *s;
+
+@@ -162,7 +162,7 @@
+ return s;
+ }
+
+-GString *GString::formatv(char *fmt, va_list argList) {
++GString *GString::formatv(const char *fmt, va_list argList) {
+ GString *s;
+
+ s = new GString();
+@@ -213,7 +213,7 @@
+ return this;
+ }
+
+-GString *GString::appendf(char *fmt, ...) {
++GString *GString::appendf(const char *fmt, ...) {
+ va_list argList;
+
+ va_start(argList, fmt);
+@@ -222,7 +222,7 @@
+ return this;
+ }
+
+-GString *GString::appendfv(char *fmt, va_list argList) {
++GString *GString::appendfv(const char *fmt, va_list argList) {
+ GStringFormatArg *args;
+ int argsLen, argsSize;
+ GStringFormatArg arg;
+@@ -231,7 +231,7 @@
+ GStringFormatType ft;
+ char buf[65];
+ int len, i;
+- char *p0, *p1, *str;
++ const char *p0, *p1, *str;
+
+ argsLen = 0;
+ argsSize = 8;
+@@ -465,7 +465,7 @@
+
+ void GString::formatInt(long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+- char **p, int *len) {
++ const char **p, int *len) {
+ static char vals[17] = "0123456789abcdef";
+ GBool neg;
+ int start, i, j;
+@@ -497,7 +497,7 @@
+
+ void GString::formatUInt(Gulong x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+- char **p, int *len) {
++ const char **p, int *len) {
+ static char vals[17] = "0123456789abcdef";
+ int i, j;
+
+@@ -520,7 +520,7 @@
+ }
+
+ void GString::formatDouble(double x, char *buf, int bufSize, int prec,
+- GBool trim, char **p, int *len) {
++ GBool trim, const char **p, int *len) {
+ GBool neg, started;
+ double x2;
+ int d, i, j;
diff --git a/editors/pdfedit/files/patch-src-xpdf-goo-GString.h b/editors/pdfedit/files/patch-src-xpdf-goo-GString.h
new file mode 100644
index 000000000000..cbaba6d991ee
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-goo-GString.h
@@ -0,0 +1,40 @@
+--- src/xpdf/goo/GString.h.orig 2009-09-11 21:02:56.000000000 +0900
++++ src/xpdf/goo/GString.h 2016-06-12 03:01:27.367470000 +0900
+@@ -67,8 +67,8 @@
+ // t -- GString *
+ // w -- blank space; arg determines width
+ // To get literal curly braces, use {{ or }}.
+- static GString *format(char *fmt, ...);
+- static GString *formatv(char *fmt, va_list argList);
++ static GString *format(const char *fmt, ...);
++ static GString *formatv(const char *fmt, va_list argList);
+
+ // Destructor.
+ ~GString();
+@@ -95,8 +95,8 @@
+ GString *append(const char *str, int lengthA);
+
+ // Append a formatted string.
+- GString *appendf(char *fmt, ...);
+- GString *appendfv(char *fmt, va_list argList);
++ GString *appendf(const char *fmt, ...);
++ GString *appendfv(const char *fmt, va_list argList);
+
+ // Insert a character or string.
+ GString *insert(int i, char c);
+@@ -125,12 +125,12 @@
+ void resize(int length1);
+ static void formatInt(long x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+- char **p, int *len);
++ const char **p, int *len);
+ static void formatUInt(Gulong x, char *buf, int bufSize,
+ GBool zeroFill, int width, int base,
+- char **p, int *len);
++ const char **p, int *len);
+ static void formatDouble(double x, char *buf, int bufSize, int prec,
+- GBool trim, char **p, int *len);
++ GBool trim, const char **p, int *len);
+ };
+
+ #if defined(WIN32) || defined(UNDER_CE)
diff --git a/editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.cc b/editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.cc
new file mode 100644
index 000000000000..b04960635217
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.cc
@@ -0,0 +1,22 @@
+--- src/xpdf/xpdf/BuiltinFont.cc.orig 2016-06-12 03:09:00.143158000 +0900
++++ src/xpdf/xpdf/BuiltinFont.cc 2016-06-12 03:09:30.242137000 +0900
+@@ -39,7 +39,7 @@
+ gfree(tab);
+ }
+
+-GBool BuiltinFontWidths::getWidth(char *name, Gushort *width) {
++GBool BuiltinFontWidths::getWidth(const char *name, Gushort *width) {
+ int h;
+ BuiltinFontWidth *p;
+
+@@ -53,8 +53,8 @@
+ return gFalse;
+ }
+
+-int BuiltinFontWidths::hash(char *name) {
+- char *p;
++int BuiltinFontWidths::hash(const char *name) {
++ const char *p;
+ unsigned int h;
+
+ h = 0;
diff --git a/editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.h b/editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.h
new file mode 100644
index 000000000000..15b2fdcbf946
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-xpdf-BuiltinFont.h
@@ -0,0 +1,34 @@
+--- src/xpdf/xpdf/BuiltinFont.h.orig 2016-06-12 03:07:21.081040000 +0900
++++ src/xpdf/xpdf/BuiltinFont.h 2016-06-12 03:08:04.015283000 +0900
+@@ -23,7 +23,7 @@
+ //------------------------------------------------------------------------
+
+ struct BuiltinFont {
+- char *name;
++ const char *name;
+ char **defaultBaseEnc;
+ short ascent;
+ short descent;
+@@ -34,7 +34,7 @@
+ //------------------------------------------------------------------------
+
+ struct BuiltinFontWidth {
+- char *name;
++ const char *name;
+ Gushort width;
+ BuiltinFontWidth *next;
+ };
+@@ -44,11 +44,11 @@
+
+ BuiltinFontWidths(BuiltinFontWidth *widths, int sizeA);
+ ~BuiltinFontWidths();
+- GBool getWidth(char *name, Gushort *width);
++ GBool getWidth(const char *name, Gushort *width);
+
+ private:
+
+- int hash(char *name);
++ int hash(const char *name);
+
+ BuiltinFontWidth **tab;
+ int size;
diff --git a/editors/pdfedit/files/patch-src-xpdf-xpdf-NameToUnicodeTable.h b/editors/pdfedit/files/patch-src-xpdf-xpdf-NameToUnicodeTable.h
new file mode 100644
index 000000000000..1d6a86ecb4b2
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-xpdf-NameToUnicodeTable.h
@@ -0,0 +1,11 @@
+--- src/xpdf/xpdf/NameToUnicodeTable.h.orig 2016-06-12 03:03:36.755295000 +0900
++++ src/xpdf/xpdf/NameToUnicodeTable.h 2016-06-12 03:03:51.495599000 +0900
+@@ -8,7 +8,7 @@
+
+ static struct {
+ Unicode u;
+- char *name;
++ const char *name;
+ } nameToUnicodeTab[] = {
+ {0x0021, "!"},
+ {0x0023, "#"},
diff --git a/editors/pdfedit/files/patch-src-xpdf-xpdf-Object.h b/editors/pdfedit/files/patch-src-xpdf-xpdf-Object.h
new file mode 100644
index 000000000000..bda39d4fa157
--- /dev/null
+++ b/editors/pdfedit/files/patch-src-xpdf-xpdf-Object.h
@@ -0,0 +1,11 @@
+--- src/xpdf/xpdf/Object.h.orig 2015-08-23 03:17:00.826883000 +0900
++++ src/xpdf/xpdf/Object.h 2015-08-23 03:17:15.658920000 +0900
+@@ -206,7 +206,7 @@
+ private:
+
+ ObjType type; // object type
+- mutable union { // value for each type:
++ union { // value for each type:
+ GBool booln; // boolean
+ int intg; // integer
+ double real; // real
diff --git a/editors/pdfedit/files/patch-src__gui__base.cc b/editors/pdfedit/files/patch-src__gui__base.cc
new file mode 100644
index 000000000000..491b562bf508
--- /dev/null
+++ b/editors/pdfedit/files/patch-src__gui__base.cc
@@ -0,0 +1,24 @@
+--- src/gui/base.cc.orig 2010-02-22 10:17:40.000000000 +0900
++++ src/gui/base.cc 2011-03-21 20:36:57.000000000 +0900
+@@ -688,7 +688,20 @@
+ if (openMode=="readonly") mode=CPdf::ReadOnly;
+ if (openMode=="readwrite") mode=CPdf::ReadWrite;
+ //Basic mode without asking a password (we do not know how)
+- return CPdf::getInstance(util::convertFromUnicode(filename,util::NAME).c_str(),mode);
++ boost::shared_ptr<pdfobjects::CPdf> pdf;
++ do {
++ try {
++ pdf = CPdf::getInstance(util::convertFromUnicode(filename,util::NAME).c_str(),mode);
++ }catch(PdfOpenException &e) {
++ // try to fallback to readonly mode
++ if (mode >= CPdf::ReadWrite) {
++ mode = CPdf::ReadOnly;
++ continue;
++ }
++ throw e;
++ }
++ }while(!pdf);
++ return pdf;
+ }
+
+ /** \copydoc loadFromFile */
diff --git a/editors/pdfedit/files/patch-src__gui__pdfutil.cc b/editors/pdfedit/files/patch-src__gui__pdfutil.cc
new file mode 100644
index 000000000000..21830bf30e08
--- /dev/null
+++ b/editors/pdfedit/files/patch-src__gui__pdfutil.cc
@@ -0,0 +1,24 @@
+--- src/gui/pdfutil.cc.orig 2009-04-07 00:24:47.000000000 +0900
++++ src/gui/pdfutil.cc 2011-03-21 20:36:57.000000000 +0900
+@@ -451,7 +451,20 @@
+ @param askPassword If true, password will be asked for if necessary
+ */
+ boost::shared_ptr<CPdf> getPdfInstance(QWidget *parent, const QString &filename, CPdf::OpenMode mode, bool askPassword) {
+- boost::shared_ptr<CPdf> pdf=CPdf::getInstance(util::convertFromUnicode(filename,util::NAME).c_str(), mode);
++ boost::shared_ptr<pdfobjects::CPdf> pdf;
++ do {
++ try {
++ pdf = CPdf::getInstance(util::convertFromUnicode(filename,util::NAME).c_str(),mode);
++ }catch(PdfOpenException &e) {
++ // try to fallback to readonly mode
++ if (mode >= CPdf::ReadWrite) {
++ mode = CPdf::ReadOnly;
++ continue;
++ }
++ throw e;
++ }
++ }while(!pdf);
++
+ if (askPassword && pdf->needsCredentials()) {
+ for(;;) {
+ //Ask for password until we either get the right one or user gets bored with retrying
diff --git a/editors/pdfedit/files/patch-src__kernel__cpagecontents.cc b/editors/pdfedit/files/patch-src__kernel__cpagecontents.cc
new file mode 100644
index 000000000000..dd3825a041f4
--- /dev/null
+++ b/editors/pdfedit/files/patch-src__kernel__cpagecontents.cc
@@ -0,0 +1,374 @@
+--- src/kernel/cpagecontents.cc.orig 2010-04-30 21:44:30.000000000 +0900
++++ src/kernel/cpagecontents.cc 2016-06-11 10:25:06.981679000 +0900
+@@ -55,8 +55,8 @@
+ //
+ //
+ void
+-CPageContents::ContentsWatchDog::notify (shared_ptr<IProperty> newValue,
+- shared_ptr<const IProperty::ObserverContext> context) const throw()
++CPageContents::ContentsWatchDog::notify (boost::shared_ptr<IProperty> newValue,
++ boost::shared_ptr<const IProperty::ObserverContext> context) const throw()
+ {
+ kernelPrintDbg (debug::DBG_DBG, "context type=" << context->getType());
+
+@@ -84,7 +84,7 @@
+ case ComplexChangeContextType:
+ {
+ // Is it a dictionary Page dictionary
+- shared_ptr<const CDict::CDictComplexObserverContext> ctxtdict =
++ boost::shared_ptr<const CDict::CDictComplexObserverContext> ctxtdict =
+ dynamic_pointer_cast<const CDict::CDictComplexObserverContext,
+ const IChangeContext<IProperty> > (context);
+ if (ctxtdict)
+@@ -102,7 +102,7 @@
+ // 1.2 Contents entry was removed
+ if (isNull(newValue))
+ {
+- shared_ptr<IProperty> oldValue = ctxtdict->getOriginalValue();
++ boost::shared_ptr<IProperty> oldValue = ctxtdict->getOriginalValue();
+ // Unregister observer
+ _cnt->unreg_observer (oldValue);
+
+@@ -116,7 +116,7 @@
+ }
+
+ // Is it an array (Contents) -- do nothing just reparse
+- shared_ptr<const CArray::CArrayComplexObserverContext> ctxtarray =
++ boost::shared_ptr<const CArray::CArrayComplexObserverContext> ctxtarray =
+ dynamic_pointer_cast<const CArray::CArrayComplexObserverContext,
+ const IChangeContext<IProperty> > (context);
+ if (ctxtarray)
+@@ -162,7 +162,7 @@
+ createStreamFromObjects (const Container& cont, boost::weak_ptr<CPdf> pdf)
+ {
+ // Create stream with one default property Length
+- shared_ptr<CStream> newstr (new CStream());
++ boost::shared_ptr<CStream> newstr (new CStream());
+
+ // Insert our change tag
+ std::string str;
+@@ -234,7 +234,7 @@
+ }
+
+
+-shared_ptr<CContentStream>
++boost::shared_ptr<CContentStream>
+ CPageContents::getContentStream (CContentStream* cc)
+ {
+ init();
+@@ -247,7 +247,7 @@
+ }
+
+
+-shared_ptr<CContentStream>
++boost::shared_ptr<CContentStream>
+ CPageContents::getContentStream (size_t pos)
+ {
+ init();
+@@ -265,7 +265,7 @@
+ CPageContents::addToFront (const Container& cont)
+ {
+ // Create cstream from container of pdf operators
+- shared_ptr<CStream> stream = createStreamFromObjects (cont, _dict->getPdf());
++ boost::shared_ptr<CStream> stream = createStreamFromObjects (cont, _dict->getPdf());
+ assert (hasValidRef (stream)); assert (hasValidPdf (stream));
+ if (!hasValidPdf(stream) || !hasValidPdf(stream))
+ throw CObjInvalidObject ();
+@@ -294,8 +294,8 @@
+ // Indicate change
+ change ();
+ }
+-template void CPageContents::addToFront<vector<shared_ptr<PdfOperator> > > (const vector<shared_ptr<PdfOperator> >& cont);
+-template void CPageContents::addToFront<deque<shared_ptr<PdfOperator> > > (const deque<shared_ptr<PdfOperator> >& cont);
++template void CPageContents::addToFront<vector<boost::shared_ptr<PdfOperator> > > (const vector<boost::shared_ptr<PdfOperator> >& cont);
++template void CPageContents::addToFront<deque<boost::shared_ptr<PdfOperator> > > (const deque<boost::shared_ptr<PdfOperator> >& cont);
+
+ //
+ //
+@@ -307,7 +307,7 @@
+ // Create cstream from container of pdf operators
+ if (!hasValidPdf(_dict))
+ throw CObjInvalidObject ();
+- shared_ptr<CStream> stream = createStreamFromObjects (cont, _dict->getPdf());
++ boost::shared_ptr<CStream> stream = createStreamFromObjects (cont, _dict->getPdf());
+ assert (hasValidRef (stream)); assert (hasValidPdf (stream));
+ if (!hasValidPdf(stream) || !hasValidPdf(stream))
+ throw CObjInvalidObject ();
+@@ -332,8 +332,8 @@
+ // Indicate change
+ change ();
+ }
+-template void CPageContents::addToBack<vector<shared_ptr<PdfOperator> > > (const vector<shared_ptr<PdfOperator> >& cont);
+-template void CPageContents::addToBack<deque<shared_ptr<PdfOperator> > > (const deque<shared_ptr<PdfOperator> >& cont);
++template void CPageContents::addToBack<vector<boost::shared_ptr<PdfOperator> > > (const vector<boost::shared_ptr<PdfOperator> >& cont);
++template void CPageContents::addToBack<deque<boost::shared_ptr<PdfOperator> > > (const deque<boost::shared_ptr<PdfOperator> >& cont);
+
+
+ //
+@@ -379,6 +379,12 @@
+
+ // Get the text
+ libs::Rectangle rec = (rc)? *rc : _page->display()->getPageRect();
++ // if we use rotation 90,270 then we must change the rectangle from which we want the text
++ // accordingly (TODO - verify for all rotations)
++ int rot = _page->getRotation ();
++ if (90 == rot || 270 == rot)
++ std::swap (rec.xright, rec.yright);
++
+ scoped_ptr<GString> gtxt (textDev->getText(rec.xleft, rec.yleft, rec.xright, rec.yright));
+ text = gtxt->getCString();
+ }
+@@ -484,11 +490,11 @@
+ if (fontName.empty())
+ fontName = "PDFEDIT_F1";
+ double fontSize = 15.0;
+- shared_ptr<UnknownCompositePdfOperator> q(new UnknownCompositePdfOperator("q", "Q"));
+- shared_ptr<UnknownCompositePdfOperator> BT(new UnknownCompositePdfOperator("BT", "ET"));
++ boost::shared_ptr<UnknownCompositePdfOperator> q(new UnknownCompositePdfOperator("q", "Q"));
++ boost::shared_ptr<UnknownCompositePdfOperator> BT(new UnknownCompositePdfOperator("BT", "ET"));
+ PdfOperator::Operands fontOperands;
+- fontOperands.push_back(shared_ptr<IProperty>(new CName (fontName)) );
+- fontOperands.push_back(shared_ptr<IProperty>(new CReal (fontSize)));
++ fontOperands.push_back(boost::shared_ptr<IProperty>(new CName (fontName)) );
++ fontOperands.push_back(boost::shared_ptr<IProperty>(new CReal (fontSize)));
+ q->push_back(BT,q);
+ BT->push_back(createOperator("Tf", fontOperands), getLastOperator(BT));
+
+@@ -497,13 +503,13 @@
+ BT->push_back(createOperator("Tm", posOperands), getLastOperator(BT));
+
+ PdfOperator::Operands textOperands;
+- textOperands.push_back(shared_ptr<IProperty>(new CString (what)));
++ textOperands.push_back(boost::shared_ptr<IProperty>(new CString (what)));
+ BT->push_back(createOperator("Tj", textOperands), getLastOperator(BT));
+ PdfOperator::Operands emptyOperands;
+ BT->push_back(createOperator("ET", emptyOperands), getLastOperator(BT));
+ q->push_back(createOperator("Q", emptyOperands), getLastOperator(q));
+
+- std::vector<shared_ptr<PdfOperator> > contents;
++ std::vector<boost::shared_ptr<PdfOperator> > contents;
+ contents.push_back(q);
+
+ addToBack (contents);
+@@ -531,7 +537,7 @@
+ // EI
+ // Q
+ //
+- shared_ptr<UnknownCompositePdfOperator> q(new UnknownCompositePdfOperator("q", "Q"));
++ boost::shared_ptr<UnknownCompositePdfOperator> q(new UnknownCompositePdfOperator("q", "Q"));
+
+ // translate
+ q->push_back(createOperatorTranslation(where.x, where.y), getLastOperator(q));
+@@ -540,19 +546,23 @@
+
+
+ CDict image_dict;
+- image_dict.addProperty ("W", CInt (image_size.x));
+- image_dict.addProperty ("H", CInt (image_size.y));
+- image_dict.addProperty ("CS", CName ("RGB"));
+- image_dict.addProperty ("BPC", CInt (8));
++ CInt x (image_size.x);
++ image_dict.addProperty ("W", x);
++ CInt y (image_size.y);
++ image_dict.addProperty ("H", y);
++ CName n ("RGB");
++ image_dict.addProperty ("CS", n);
++ CInt i (8);
++ image_dict.addProperty ("BPC", i);
+ CInlineImage img (image_dict, what);
+- shared_ptr<CInlineImage> inline_image (new CInlineImage (image_dict, what));
+- shared_ptr<InlineImageCompositePdfOperator> BI(new InlineImageCompositePdfOperator (inline_image));
++ boost::shared_ptr<CInlineImage> inline_image (new CInlineImage (image_dict, what));
++ boost::shared_ptr<InlineImageCompositePdfOperator> BI(new InlineImageCompositePdfOperator (inline_image));
+
+ q->push_back(BI,getLastOperator(q));
+ PdfOperator::Operands o;
+ q->push_back(createOperator("Q", o), getLastOperator(q));
+
+- std::vector<shared_ptr<PdfOperator> > contents;
++ std::vector<boost::shared_ptr<PdfOperator> > contents;
+ contents.push_back(q);
+
+ addToBack (contents);
+@@ -595,7 +605,7 @@
+ // addSomewhere
+ template<OPERWHERE WHERE>
+ void
+- cc_add (shared_ptr<CDict> _dict, CRef& ref)
++ cc_add (boost::shared_ptr<CDict> _dict, CRef& ref)
+ {
+ // contents not present
+ if (!_dict->containsProperty (Specification::Page::CONTENTS))
+@@ -607,8 +617,8 @@
+ // contents present
+ }else
+ {
+- shared_ptr<IProperty> content = _dict->getProperty (Specification::Page::CONTENTS);
+- shared_ptr<IProperty> realcontent = getReferencedObject(content);
++ boost::shared_ptr<IProperty> content = _dict->getProperty (Specification::Page::CONTENTS);
++ boost::shared_ptr<IProperty> realcontent = getReferencedObject(content);
+ assert (content);
+ // Contents can be either stream or an array of streams
+ if (isStream (realcontent))
+@@ -620,7 +630,7 @@
+ }else if (isArray (realcontent))
+ {
+ // We can be sure that streams are indirect objects (pdf spec)
+- shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (realcontent);
++ boost::shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (realcontent);
+ OpTrait<WHERE>::Oper::add (*array, ref);
+
+ }else // Neither stream nor array
+@@ -672,7 +682,7 @@
+ * Indicats that the page changed.
+ */
+ template<typename Cont>
+-void CPageContents::setContents (shared_ptr<CDict> dict, const Cont& cont)
++void CPageContents::setContents (boost::shared_ptr<CDict> dict, const Cont& cont)
+ {
+
+ if (dict->containsProperty (Specification::Page::CONTENTS))
+@@ -682,7 +692,7 @@
+ // Loop throug all content streams and add all cstreams from each
+ // content streams to Contents entry of page dictionary
+ //
+- typedef vector<shared_ptr<CStream> > Css;
++ typedef vector<boost::shared_ptr<CStream> > Css;
+ Css css;
+ getAllCStreams (cont, css);
+
+@@ -698,14 +708,14 @@
+ }
+ }
+ // Explicit instantiation
+-template void CPageContents::setContents<vector<shared_ptr<CContentStream> > >
+- (shared_ptr<CDict> dict, const vector<shared_ptr<CContentStream> >& cont);
++template void CPageContents::setContents<vector<boost::shared_ptr<CContentStream> > >
++ (boost::shared_ptr<CDict> dict, const vector<boost::shared_ptr<CContentStream> >& cont);
+
+ //
+ //
+ //
+ void
+-CPageContents::remove (shared_ptr<const CContentStream> cs)
++CPageContents::remove (boost::shared_ptr<const CContentStream> cs)
+ {
+ if (!_dict->containsProperty (Specification::Page::CONTENTS))
+ throw CObjInvalidOperation ();
+@@ -717,7 +727,7 @@
+ // Loop throug all content streams and add all cstreams from each
+ // content streams to Contents entry of page dictionary
+ //
+- typedef vector<shared_ptr<CStream> > Css;
++ typedef vector<boost::shared_ptr<CStream> > Css;
+ Css css;
+ cs->getCStreams (css);
+
+@@ -743,8 +753,8 @@
+ void
+ CPageContents::remove (const IndiRef& rf)
+ {
+- shared_ptr<IProperty> content = _dict->getProperty (Specification::Page::CONTENTS);
+- shared_ptr<IProperty> realcontent = getReferencedObject (content);
++ boost::shared_ptr<IProperty> content = _dict->getProperty (Specification::Page::CONTENTS);
++ boost::shared_ptr<IProperty> realcontent = getReferencedObject (content);
+ assert (content);
+ // Contents can be either stream or an array of streams
+ if (isStream (realcontent))
+@@ -756,7 +766,7 @@
+ }else if (isArray (realcontent))
+ {
+ // We can be sure that streams are indirect objects (pdf spec)
+- shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (realcontent);
++ boost::shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (realcontent);
+ for (size_t i = 0; i < array->getPropertyCount(); ++i)
+ {
+ IndiRef _rf = getRefFromArray (array,i);
+@@ -821,7 +831,7 @@
+ //
+ if (!_dict->containsProperty (Specification::Page::CONTENTS))
+ return true;
+- shared_ptr<IProperty> contents = getReferencedObject (_dict->getProperty (Specification::Page::CONTENTS));
++ boost::shared_ptr<IProperty> contents = getReferencedObject (_dict->getProperty (Specification::Page::CONTENTS));
+ assert (contents);
+
+ CContentStream::CStreams streams;
+@@ -831,13 +841,13 @@
+ //
+ if (isStream (contents))
+ {
+- shared_ptr<CStream> stream = IProperty::getSmartCObjectPtr<CStream> (contents);
++ boost::shared_ptr<CStream> stream = IProperty::getSmartCObjectPtr<CStream> (contents);
+ streams.push_back (stream);
+
+ }else if (isArray (contents))
+ {
+ // We can be sure that streams are indirect objects (pdf spec)
+- shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (contents);
++ boost::shared_ptr<CArray> array = IProperty::getSmartCObjectPtr<CArray> (contents);
+ for (size_t i = 0; i < array->getPropertyCount(); ++i)
+ streams.push_back (getCStreamFromArray(array,i));
+
+@@ -854,7 +864,7 @@
+ // True if Contents is not [ ]
+ while (!streams.empty())
+ {
+- shared_ptr<CContentStream> cc (new CContentStream(streams,state,res));
++ boost::shared_ptr<CContentStream> cc (new CContentStream(streams,state,res));
+ // Save smart pointer of the content stream so pdfoperators can return it
+ cc->setSmartPointer (cc);
+ _ccs.push_back (cc);
+@@ -911,7 +921,7 @@
+ // If it contains Contents register observer on it too
+ if (_dict->containsProperty(Specification::Page::CONTENTS))
+ {
+- shared_ptr<IProperty> prop = _dict->getProperty(Specification::Page::CONTENTS);
++ boost::shared_ptr<IProperty> prop = _dict->getProperty(Specification::Page::CONTENTS);
+ REGISTER_SHAREDPTR_OBSERVER(prop, _wd);
+ }
+ }
+@@ -933,7 +943,7 @@
+ // Unregister contents observer
+ if (_dict->containsProperty(Specification::Page::CONTENTS))
+ {
+- shared_ptr<IProperty> prop = _dict->getProperty(Specification::Page::CONTENTS);
++ boost::shared_ptr<IProperty> prop = _dict->getProperty(Specification::Page::CONTENTS);
+ UNREGISTER_SHAREDPTR_OBSERVER(prop, _wd);
+ }
+ }
+@@ -963,7 +973,7 @@
+ //
+ //
+ void
+-CPageContents::moveAbove (shared_ptr<const CContentStream> ct)
++CPageContents::moveAbove (boost::shared_ptr<const CContentStream> ct)
+ {
+ // Get the next item
+ init();
+@@ -975,7 +985,7 @@
+ throw OutOfRange ();
+
+ // Delete next item but store it
+- shared_ptr<CContentStream> tmp = *itNext;
++ boost::shared_ptr<CContentStream> tmp = *itNext;
+ _ccs.erase (itNext, itNext + 1);
+ // Insert stored item before supplied (simply swap ct with the next item)
+ _ccs.insert (find (_ccs.begin(), _ccs.end(), ct), tmp);
+@@ -993,7 +1003,7 @@
+ //
+ //
+ void
+-CPageContents::moveBelow (shared_ptr<const CContentStream> ct)
++CPageContents::moveBelow (boost::shared_ptr<const CContentStream> ct)
+ {
+ // Get the item index
+ unsigned int pos = 0;
+@@ -1007,7 +1017,7 @@
+ throw CObjInvalidOperation ();
+
+ // Swap
+- shared_ptr<CContentStream> tmp = _ccs[pos];
++ boost::shared_ptr<CContentStream> tmp = _ccs[pos];
+ _ccs[pos] = _ccs[pos - 1];
+ _ccs[pos - 1] = tmp;
+
diff --git a/editors/pdfedit/files/patch-src__tools__pdf_to_text.cc b/editors/pdfedit/files/patch-src__tools__pdf_to_text.cc
new file mode 100644
index 000000000000..a7d1097d5150
--- /dev/null
+++ b/editors/pdfedit/files/patch-src__tools__pdf_to_text.cc
@@ -0,0 +1,45 @@
+--- src/tools/pdf_to_text.cc.orig 2010-04-23 15:58:36.000000000 +0900
++++ src/tools/pdf_to_text.cc 2016-06-12 03:51:28.186690000 +0900
+@@ -45,8 +45,16 @@
+ };
+ // what to do with a page
+ struct _textify {
+- string operator () (shared_ptr<CPage> page)
++ string operator () (boost::shared_ptr<CPage> page)
+ {
++ // Update display params to use media box not default page rect (DEFAULT_PAGE_RX, DEFAULT_PAGE_RY)
++ // TODO upsidedown? get/set
++ DisplayParams dp;
++ dp.useMediaBox = gTrue;
++ dp.crop = gFalse;
++ dp.rotate = page->getRotation ();
++ page->setDisplayParams (dp);
++
+ string text;
+ static const std::string encoding="UTF-8";
+ page->getText (text, &encoding);
+@@ -97,13 +105,13 @@
+ 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 (pages.empty())
+ {
+ for (size_t i = 1; i <= pdf->getPageCount(); ++i)
+ {
+- shared_ptr<CPage> page = pdf->getPage(i);
++ boost::shared_ptr<CPage> page = pdf->getPage(i);
+ std::cout << "\nPage " << i << ":\n" << _textify()(page);
+ }
+ }
+@@ -117,7 +125,7 @@
+ continue;
+ }
+
+- shared_ptr<CPage> page = pdf->getPage(*it);
++ boost::shared_ptr<CPage> page = pdf->getPage(*it);
+ std::cout << "\nPage " << *it << ":\n" << _textify()(page);
+ }
+