Update podofo in windows build to -r1269

This commit is contained in:
Kovid Goyal 2010-08-14 12:19:14 -06:00
parent 8f42c11aa3
commit 926e3fa545
2 changed files with 22 additions and 40 deletions

View File

@ -237,28 +237,10 @@ cp build/podofo/build/src/Release/podofo.exp lib/
cp build/podofo/build/podofo_config.h include/podofo/ cp build/podofo/build/podofo_config.h include/podofo/
cp -r build/podofo/src/* 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<long>(pInfo->rowbytes * height);
char* pBuffer = static_cast<char*>(malloc(sizeof(char) * lLen));
- png_bytep pRows[height];
+ png_bytepp pRows = static_cast<png_bytepp>(malloc(sizeof(png_bytep)*height));
for(int y=0; y<height; y++)
{
pRows[y] = reinterpret_cast<png_bytep>(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 Index: src/PdfFiltersPrivate.cpp
=================================================================== ===================================================================

View File

@ -26,18 +26,18 @@ import bzrlib
class cmd_commit(_cmd_commit): class cmd_commit(_cmd_commit):
@classmethod @classmethod
def trac_url(self, username, password, url): 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): def get_trac_summary(self, bug, url):
print 'Getting bug summary for bug #%s'%bug, print 'Getting bug summary for bug #%s'%bug,
server = xmlrpclib.ServerProxy(url) server = xmlrpclib.ServerProxy(url)
attributes = server.ticket.get(int(bug))[-1] attributes = server.ticket.get(int(bug))[-1]
print attributes['summary'] print attributes['summary']
return attributes['summary'] return attributes['summary']
def expand_bug(self, msg, nick, config, bug_tracker, type='trac'): def expand_bug(self, msg, nick, config, bug_tracker, type='trac'):
prefix = '%s_%s_'%(type, nick) prefix = '%s_%s_'%(type, nick)
username = config.get_user_option(prefix+'username') username = config.get_user_option(prefix+'username')
@ -55,10 +55,10 @@ class cmd_commit(_cmd_commit):
url = self.trac_url(username, password, bug_tracker) url = self.trac_url(username, password, bug_tracker)
summary = self.get_trac_summary(bug, url) summary = self.get_trac_summary(bug, url)
if summary: 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 return msg, bug, url, action
def get_bugtracker(self, basedir, type='trac'): def get_bugtracker(self, basedir, type='trac'):
config = os.path.join(basedir, '.bzr', 'branch', 'branch.conf') config = os.path.join(basedir, '.bzr', 'branch', 'branch.conf')
bugtracker, nick = None, None bugtracker, nick = None, None
@ -69,16 +69,16 @@ class cmd_commit(_cmd_commit):
nick, bugtracker = match.group(1), match.group(2) nick, bugtracker = match.group(1), match.group(2)
break break
return nick, bugtracker return nick, bugtracker
def expand_message(self, msg, tree): def expand_message(self, msg, tree):
nick, bugtracker = self.get_bugtracker(tree.basedir, type='trac') nick, bugtracker = self.get_bugtracker(tree.basedir, type='trac')
if not bugtracker: if not bugtracker:
return msg return msg
config = branch.Branch.open(tree.basedir).get_config() config = branch.Branch.open(tree.basedir).get_config()
msg, bug, url, action = self.expand_bug(msg, nick, config, bugtracker) msg, bug, url, action = self.expand_bug(msg, nick, config, bugtracker)
return msg, bug, url, action, nick, config return msg, bug, url, action, nick, config
def run(self, message=None, file=None, verbose=False, selected_list=None, def run(self, message=None, file=None, verbose=False, selected_list=None,
unchanged=False, strict=False, local=False, fixes=None, unchanged=False, strict=False, local=False, fixes=None,
author=None, show_diff=False, exclude=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]) self.expand_message(message, tree_files(selected_list)[0])
except ValueError: except ValueError:
pass pass
if nick and bug and not fixes: if nick and bug and not fixes:
fixes = [nick+':'+bug] 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, 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) author=author, show_diff=show_diff, exclude=exclude)
if message and bug and action and nick and config: if message and bug and action and nick and config:
self.close_bug(bug, action, url, config) self.close_bug(bug, action, url, config)
return ret return ret
def close_bug(self, bug, action, url, config): def close_bug(self, bug, action, url, config):
print 'Closing bug #%s'% bug print 'Closing bug #%s'% bug
nick = config.get_nickname() nick = config.get_nickname()
@ -110,8 +110,8 @@ class cmd_commit(_cmd_commit):
action = action+'ed' action = action+'ed'
msg = '%s in branch %s. %s'%(action, nick, suffix) msg = '%s in branch %s. %s'%(action, nick, suffix)
server = xmlrpclib.ServerProxy(url) server = xmlrpclib.ServerProxy(url)
server.ticket.update(int(bug), msg, server.ticket.update(int(bug), msg,
{'status':'closed', 'resolution':'fixed'}, {'status':'closed', 'resolution':'fixed'},
False) False)
bzrlib.commands.register_command(cmd_commit) bzrlib.commands.register_command(cmd_commit)