mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Add warning if someone attempts to create a multi-page SVG calendar.
This commit is contained in:
@@ -207,6 +207,7 @@ eval { $surface->set_metadata('subject', 'Calendar'); };
|
||||
my $cr = Cairo::Context->create($surface);
|
||||
$cr->set_line_width($settings->{line_thickness});
|
||||
|
||||
my $warned = 0;
|
||||
while(1) {
|
||||
my ($obj, $err) = Remind::PDF->create_from_stream(*STDIN,
|
||||
{color => 1,
|
||||
@@ -223,8 +224,15 @@ while(1) {
|
||||
}
|
||||
last;
|
||||
}
|
||||
$done_one = 1;
|
||||
if ($settings->{svg} && $done_one) {
|
||||
if (!$warned) {
|
||||
print STDERR "WARNING: --svg can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n";
|
||||
$warned = 1;
|
||||
}
|
||||
next;
|
||||
}
|
||||
$obj->render($cr, $settings);
|
||||
$done_one = 1;
|
||||
}
|
||||
|
||||
$surface->finish();
|
||||
|
||||
@@ -1008,7 +1008,17 @@ as were read from the C<remind -ppp> stream
|
||||
sub render
|
||||
{
|
||||
my ($self, $cr, $settings) = @_;
|
||||
my $done = 0;
|
||||
my $warned = 0;
|
||||
foreach my $e (@{$self->{entries}}) {
|
||||
if ($settings->{svg} && $done) {
|
||||
if (!$warned) {
|
||||
print STDERR "WARNING: --svg can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n";
|
||||
$warned = 1;
|
||||
}
|
||||
next;
|
||||
}
|
||||
$done = 1;
|
||||
$e->render($cr, $settings);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user