From 926e3fa5459363b0ba5e9e14c00abe5e0c4cb08a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 14 Aug 2010 12:19:14 -0600 Subject: [PATCH] Update podofo in windows build to -r1269 --- setup/installer/windows/notes.rst | 24 +++-------------- src/calibre/trac/bzr_commit_plugin.py | 38 +++++++++++++-------------- 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/setup/installer/windows/notes.rst b/setup/installer/windows/notes.rst index e7fef2be80..8f1cc80bb5 100644 --- a/setup/installer/windows/notes.rst +++ b/setup/installer/windows/notes.rst @@ -237,28 +237,10 @@ cp build/podofo/build/src/Release/podofo.exp lib/ cp build/podofo/build/podofo_config.h include/podofo/ cp -r build/podofo/src/* include/podofo/ -The following patch (against 0.8.1) was required to get it to compile: +You have to use >0.8.1 (>= revision 1269) + +The following patch (against -r1269) was required to get it to compile: -Index: src/PdfImage.cpp -=================================================================== ---- src/PdfImage.cpp (revision 1261) -+++ src/PdfImage.cpp (working copy) -@@ -627,7 +627,7 @@ - - long lLen = static_cast(pInfo->rowbytes * height); - char* pBuffer = static_cast(malloc(sizeof(char) * lLen)); -- png_bytep pRows[height]; -+ png_bytepp pRows = static_cast(malloc(sizeof(png_bytep)*height)); - for(int y=0; y(pBuffer + (y * pInfo->rowbytes)); -@@ -672,6 +672,7 @@ - this->SetImageData( width, height, pInfo->bit_depth, &stream ); - - free(pBuffer); -+ free(pRows); - } - #endif // PODOFO_HAVE_PNG_LIB Index: src/PdfFiltersPrivate.cpp =================================================================== diff --git a/src/calibre/trac/bzr_commit_plugin.py b/src/calibre/trac/bzr_commit_plugin.py index 5ec6e8f7e8..c39131cccb 100644 --- a/src/calibre/trac/bzr_commit_plugin.py +++ b/src/calibre/trac/bzr_commit_plugin.py @@ -26,18 +26,18 @@ import bzrlib class cmd_commit(_cmd_commit): - + @classmethod def trac_url(self, username, password, url): - return url.replace('//', '//%s:%s@'%(username, password))+'/login/xmlrpc' - + return url.replace('//', '//%s:%s@'%(username, password))+'/login/xmlrpc' + def get_trac_summary(self, bug, url): print 'Getting bug summary for bug #%s'%bug, server = xmlrpclib.ServerProxy(url) attributes = server.ticket.get(int(bug))[-1] print attributes['summary'] return attributes['summary'] - + def expand_bug(self, msg, nick, config, bug_tracker, type='trac'): prefix = '%s_%s_'%(type, nick) username = config.get_user_option(prefix+'username') @@ -55,10 +55,10 @@ class cmd_commit(_cmd_commit): url = self.trac_url(username, password, bug_tracker) summary = self.get_trac_summary(bug, url) if summary: - msg = msg.replace('#%s'%bug, '#%s (%s)'%(bug, summary)) + msg = msg.replace('#%s'%bug, '#%s (%s)'%(bug, summary)) return msg, bug, url, action - - + + def get_bugtracker(self, basedir, type='trac'): config = os.path.join(basedir, '.bzr', 'branch', 'branch.conf') bugtracker, nick = None, None @@ -69,16 +69,16 @@ class cmd_commit(_cmd_commit): nick, bugtracker = match.group(1), match.group(2) break return nick, bugtracker - + def expand_message(self, msg, tree): nick, bugtracker = self.get_bugtracker(tree.basedir, type='trac') if not bugtracker: return msg config = branch.Branch.open(tree.basedir).get_config() msg, bug, url, action = self.expand_bug(msg, nick, config, bugtracker) - + return msg, bug, url, action, nick, config - + def run(self, message=None, file=None, verbose=False, selected_list=None, unchanged=False, strict=False, local=False, fixes=None, author=None, show_diff=False, exclude=None): @@ -89,18 +89,18 @@ class cmd_commit(_cmd_commit): self.expand_message(message, tree_files(selected_list)[0]) except ValueError: pass - + if nick and bug and not fixes: fixes = [nick+':'+bug] - - ret = _cmd_commit.run(self, message=message, file=file, verbose=verbose, + + ret = _cmd_commit.run(self, message=message, file=file, verbose=verbose, selected_list=selected_list, unchanged=unchanged, - strict=strict, local=local, fixes=fixes, + strict=strict, local=local, fixes=fixes, author=author, show_diff=show_diff, exclude=exclude) if message and bug and action and nick and config: self.close_bug(bug, action, url, config) return ret - + def close_bug(self, bug, action, url, config): print 'Closing bug #%s'% bug nick = config.get_nickname() @@ -110,8 +110,8 @@ class cmd_commit(_cmd_commit): action = action+'ed' msg = '%s in branch %s. %s'%(action, nick, suffix) server = xmlrpclib.ServerProxy(url) - server.ticket.update(int(bug), msg, - {'status':'closed', 'resolution':'fixed'}, + server.ticket.update(int(bug), msg, + {'status':'closed', 'resolution':'fixed'}, False) - -bzrlib.commands.register_command(cmd_commit) \ No newline at end of file + +bzrlib.commands.register_command(cmd_commit)