[pdfmod] Add copyright headers to all .cs files
- From: Gabriel Burt <gburt src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [pdfmod] Add copyright headers to all .cs files
- Date: Wed, 9 Sep 2009 17:49:40 +0000 (UTC)
commit b679f0ce22ca1674265453408848c90f53f5cb8a
Author: Gabriel Burt <gabriel burt gmail com>
Date: Wed Sep 9 10:46:58 2009 -0700
Add copyright headers to all .cs files
src/PdfMod/Core/AssemblyInfo.cs | 16 +++++
src/PdfMod/Core/Client.cs | 16 +++++
src/PdfMod/Core/Configuration.cs | 15 +++++
src/PdfMod/Core/Defines.cs.in | 16 +++++
src/PdfMod/Gui/Actions.cs | 18 ++++++
src/PdfMod/Gui/CairoCell.cs | 15 +++++
src/PdfMod/Gui/Client.cs | 17 +++++
src/PdfMod/Gui/DocumentIconView.cs | 17 +++++
src/PdfMod/Gui/MetadataEditorBox.cs | 15 +++++
src/PdfMod/Gui/PageCell.cs | 15 +++++
src/PdfMod/Gui/PageListStore.cs | 16 +++++
src/PdfMod/Gui/SelectMatchingBox.cs | 16 +++++
src/PdfMod/Main.cs | 17 +++++
src/PdfMod/Pdf/Document.cs | 17 +++++
src/PdfMod/Pdf/Page.cs | 15 +++++
src/PdfMod/Pdf/PageLabels.cs | 115 +++++++++++++++++++---------------
src/PdfMod/Pdf/PageThumbnail.cs | 15 +++++
17 files changed, 320 insertions(+), 51 deletions(-)
---
diff --git a/src/PdfMod/Core/AssemblyInfo.cs b/src/PdfMod/Core/AssemblyInfo.cs
index 81c7064..234495b 100644
--- a/src/PdfMod/Core/AssemblyInfo.cs
+++ b/src/PdfMod/Core/AssemblyInfo.cs
@@ -1,3 +1,19 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
using System.Reflection;
using System.Runtime.CompilerServices;
diff --git a/src/PdfMod/Core/Client.cs b/src/PdfMod/Core/Client.cs
index d05d29b..2161e77 100644
--- a/src/PdfMod/Core/Client.cs
+++ b/src/PdfMod/Core/Client.cs
@@ -1,3 +1,19 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
using System;
using System.Collections.Generic;
using System.IO;
diff --git a/src/PdfMod/Core/Configuration.cs b/src/PdfMod/Core/Configuration.cs
index 044e959..5b5d9e4 100644
--- a/src/PdfMod/Core/Configuration.cs
+++ b/src/PdfMod/Core/Configuration.cs
@@ -1,3 +1,18 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
diff --git a/src/PdfMod/Core/Defines.cs.in b/src/PdfMod/Core/Defines.cs.in
index 67dafe4..94f2882 100644
--- a/src/PdfMod/Core/Defines.cs.in
+++ b/src/PdfMod/Core/Defines.cs.in
@@ -1,3 +1,19 @@
+// Copyright (C) 2009 Å?ukasz JernaÅ?
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
using System;
namespace PdfMod.Core
diff --git a/src/PdfMod/Gui/Actions.cs b/src/PdfMod/Gui/Actions.cs
index f9c9113..939339a 100644
--- a/src/PdfMod/Gui/Actions.cs
+++ b/src/PdfMod/Gui/Actions.cs
@@ -1,3 +1,21 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Julien Rebetez
+// Copyright (C) 2009 Å?ukasz JernaÅ?
+// Copyright (C) 2009 Andreu Correa Casablanca
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
using System.IO;
diff --git a/src/PdfMod/Gui/CairoCell.cs b/src/PdfMod/Gui/CairoCell.cs
index 99e8c5a..ee8f993 100644
--- a/src/PdfMod/Gui/CairoCell.cs
+++ b/src/PdfMod/Gui/CairoCell.cs
@@ -1,3 +1,18 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
diff --git a/src/PdfMod/Gui/Client.cs b/src/PdfMod/Gui/Client.cs
index fa59b77..ca32c75 100644
--- a/src/PdfMod/Gui/Client.cs
+++ b/src/PdfMod/Gui/Client.cs
@@ -1,3 +1,20 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Robert Dyer
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
using System;
using System.Collections.Generic;
using System.IO;
diff --git a/src/PdfMod/Gui/DocumentIconView.cs b/src/PdfMod/Gui/DocumentIconView.cs
index 921fab3..42a4e86 100644
--- a/src/PdfMod/Gui/DocumentIconView.cs
+++ b/src/PdfMod/Gui/DocumentIconView.cs
@@ -1,3 +1,20 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Julien Rebetez
+// Copyright (C) 2009 Igor Vatavuk
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
using System.Collections.Generic;
diff --git a/src/PdfMod/Gui/MetadataEditorBox.cs b/src/PdfMod/Gui/MetadataEditorBox.cs
index 833e463..59a7e3b 100644
--- a/src/PdfMod/Gui/MetadataEditorBox.cs
+++ b/src/PdfMod/Gui/MetadataEditorBox.cs
@@ -1,3 +1,18 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
diff --git a/src/PdfMod/Gui/PageCell.cs b/src/PdfMod/Gui/PageCell.cs
index 4601b62..1d3d3e5 100644
--- a/src/PdfMod/Gui/PageCell.cs
+++ b/src/PdfMod/Gui/PageCell.cs
@@ -1,3 +1,18 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
using System.Linq;
diff --git a/src/PdfMod/Gui/PageListStore.cs b/src/PdfMod/Gui/PageListStore.cs
index f5558eb..a23c259 100644
--- a/src/PdfMod/Gui/PageListStore.cs
+++ b/src/PdfMod/Gui/PageListStore.cs
@@ -1,3 +1,19 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Michael McKinley
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
using System.Collections.Generic;
diff --git a/src/PdfMod/Gui/SelectMatchingBox.cs b/src/PdfMod/Gui/SelectMatchingBox.cs
index e804757..8c5a9dd 100644
--- a/src/PdfMod/Gui/SelectMatchingBox.cs
+++ b/src/PdfMod/Gui/SelectMatchingBox.cs
@@ -1,3 +1,19 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Igor Vatavuk
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
diff --git a/src/PdfMod/Main.cs b/src/PdfMod/Main.cs
index fb6be83..e0ee93f 100644
--- a/src/PdfMod/Main.cs
+++ b/src/PdfMod/Main.cs
@@ -1,3 +1,20 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Å?ukasz JernaÅ?
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
using System;
using System.IO;
diff --git a/src/PdfMod/Pdf/Document.cs b/src/PdfMod/Pdf/Document.cs
index 855204c..e8df52f 100644
--- a/src/PdfMod/Pdf/Document.cs
+++ b/src/PdfMod/Pdf/Document.cs
@@ -1,3 +1,20 @@
+// Copyright (C) 2009 Novell, Inc.
+// Copyright (C) 2009 Julien Rebetez
+// Copyright (C) 2009 Michael McKinley
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
using System.Linq;
diff --git a/src/PdfMod/Pdf/Page.cs b/src/PdfMod/Pdf/Page.cs
index e1cef2a..83bfcea 100644
--- a/src/PdfMod/Pdf/Page.cs
+++ b/src/PdfMod/Pdf/Page.cs
@@ -1,3 +1,18 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
diff --git a/src/PdfMod/Pdf/PageLabels.cs b/src/PdfMod/Pdf/PageLabels.cs
index 4c30e13..7bdcb7c 100644
--- a/src/PdfMod/Pdf/PageLabels.cs
+++ b/src/PdfMod/Pdf/PageLabels.cs
@@ -1,4 +1,18 @@
-// Author: Michael McKinley (m mckinley gmail com)
+// Copyright (C) 2009 Michael McKinley
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
using System.Linq;
@@ -17,31 +31,31 @@ namespace PdfMod.Pdf
public string prefix;
public int first_number;
}
-
+
public class PageLabels
{
private const string name_labels = "/PageLabels";
private const string name_numtree = "/Nums";
-
+
// Keys (PdfNames) for formatting attributes
private const string name_fmt = "/S";
private const string name_start_at = "/St";
private const string name_prefix = "/P";
-
+
// Possible values for the numbering style
- private const string alpha_upper = "/A";
- private const string alpha_lower = "/a";
+ private const string alpha_upper = "/A";
+ private const string alpha_lower = "/a";
private const string roman_upper = "/R";
- private const string roman_lower = "/r";
+ private const string roman_lower = "/r";
private const string arabic = "/D";
-
+
private SortedDictionary<int, PageLabelFormat> page_labels;
private PdfDictionary.DictionaryElements pdf_elements;
private PdfDocument pdf_document;
private bool edited;
public string this[Page page] { get { return this[page.Index]; } }
-
+
public string this[int index] {
get {
if (index < 0 || index > pdf_document.PageCount) {
@@ -51,15 +65,15 @@ namespace PdfMod.Pdf
if (page_labels.Count == 0) {
return null;
}
-
- int range_base = GetFormat (index);
+
+ int range_base = GetFormat (index);
try {
PageLabelFormat cur_format = page_labels[range_base];
string label = cur_format.prefix;
-
+
// Restart numbering for each range of pages
int vindex = index + cur_format.first_number - range_base;
-
+
if (cur_format.number_style == roman_upper || cur_format.number_style == alpha_upper) {
label += RenderVal (vindex, cur_format.number_style).ToUpper ();
} else {
@@ -72,53 +86,53 @@ namespace PdfMod.Pdf
return null;
}
}
-
+
internal PageLabels (PdfDocument document)
{
page_labels = new SortedDictionary<int, PageLabelFormat> ();
pdf_elements = document.Internals.Catalog.Elements;
pdf_document = document;
edited = false;
-
+
// Ignore documents that don't have labelling stuff defined
if (!pdf_elements.Contains (name_labels)) {
return;
}
-
+
// Ignore documents that don't have a properly-defined PageLabelFmt section
PdfDictionary my_labels = pdf_elements.GetDictionary (name_labels);
if (!my_labels.Elements.Contains (name_numtree)) {
return;
- }
+ }
/* The number tree (not my term) is a PdfArray arranged as follows: [##, dict, ##, dict, ##, dict ...]
* ## represents the starting index of the page (0-based) and the following dict is a PdfDictionary
* containing formatting information regarding the range
*/
-
+
PdfArray number_tree = my_labels.Elements.GetArray (name_numtree);
-
- for (int i = 0; i < number_tree.Elements.Count / 2; ++i) {
+
+ for (int i = 0; i < number_tree.Elements.Count / 2; ++i) {
Console.WriteLine ("Range # {0}", i);
PageLabelFormat temp_label = new PageLabelFormat ();
-
+
int range_start = number_tree.Elements.GetInteger (i * 2);
PdfDictionary label_data = number_tree.Elements.GetDictionary (i * 2 + 1);
-
+
// Set the prefix, default to ""
if (label_data.Elements.Contains (name_prefix)) {
temp_label.prefix = label_data.Elements.GetString (name_prefix);
} else {
temp_label.prefix = "";
- }
-
+ }
+
// Set the start number, default to 1
if (label_data.Elements.Contains (name_start_at)) {
temp_label.first_number = label_data.Elements.GetInteger (name_start_at);
} else {
temp_label.first_number = 1;
}
-
+
// Set the format type, default to no numbering (only show the prefix)
if (label_data.Elements.Contains (name_fmt)) {
temp_label.number_style = label_data.Elements.GetString (name_fmt);
@@ -129,12 +143,12 @@ namespace PdfMod.Pdf
page_labels.Add (range_start, temp_label);
}
}
-
+
// Determine which formatting rules apply to page index. Returns the start of the formatting range
private int GetFormat (int index)
{
// TODO: find the correct range using a binary search
-
+
int last = -1;
foreach (int range_start in page_labels.Keys) {
if (range_start > index) {
@@ -145,7 +159,7 @@ namespace PdfMod.Pdf
return last;
}
-
+
// Render the value index in the proper format (case-agnostic)
private string RenderVal (int index, string fmt)
{
@@ -157,19 +171,19 @@ namespace PdfMod.Pdf
return ToAlpha (index);
} else {
return "";
- }
+ }
}
-
+
// Convert val into Roman numerals
private string ToRoman (int val)
{
StringBuilder roman_val = new StringBuilder ();
// TODO: see if there's a more elegant conversion
-
+
if (val >= 1000) {
roman_val.Append ('M', val / 1000);
val -= (1000 * (val / 1000));
- }
+ }
if (val >= 900) {
roman_val.Append ("CM");
val -= 900;
@@ -177,7 +191,7 @@ namespace PdfMod.Pdf
if (val >= 500) {
roman_val.Append ('D', val / 500);
val -= (500 * (val / 500));
- }
+ }
if (val >= 400) {
roman_val.Append ("CD");
val -= 400;
@@ -185,56 +199,56 @@ namespace PdfMod.Pdf
if (val >= 100) {
roman_val.Append ('C', val / 100);
val -= (100 * (val / 100));
- }
+ }
if (val >= 90) {
roman_val.Append ("XC");
val -= 90;
- }
+ }
if (val >= 50) {
roman_val.Append ('L', val / 50);
val -= (50 * (val / 50));
- }
+ }
if (val >= 40) {
roman_val.Append ("XL");
val -= 40;
- }
+ }
if (val >= 10) {
roman_val.Append ('X', val / 10);
val -= (10 * (val / 10));
- }
+ }
if (val >= 9) {
roman_val.Append ("IX");
val -= 9;
- }
+ }
if (val >= 5) {
roman_val.Append ('V', val / 5);
val -= (5 * (val / 5));
- }
+ }
if (val >= 4) {
roman_val.Append ("IV");
val -= 4;
}
- roman_val.Append ('I', val);
+ roman_val.Append ('I', val);
return roman_val.ToString ();
}
-
+
// Convert val into the alpha representation. 1 -> a, 2 -> b, ... 26 -> z, 27 -> aa, 28 -> bb, etc.
private string ToAlpha (int val)
{
- char letter = (char)((val - 1) % 26 + 'a');
+ char letter = (char)((val - 1) % 26 + 'a');
int rep_count = (val - 1)/26 + 1;
StringBuilder s = new StringBuilder (rep_count);
s.Append (letter, rep_count);
return s.ToString ();
}
-
+
// Write labels to the PDF
internal void WriteLabels ()
{
- if (!edited) {
+ if (!edited) {
return;
}
-
+
// Grab the labels element, creating it if necessary
PdfDictionary labels_dict;
if (!pdf_elements.Contains (name_labels)) {
@@ -252,18 +266,17 @@ namespace PdfMod.Pdf
foreach (int range_start in page_labels.Keys)
{
number_tree.Elements.Add (new PdfInteger (range_start));
- PageLabelFormat label_format = page_labels[range_start];
+ PageLabelFormat label_format = page_labels[range_start];
PdfDictionary r_attribs = new PdfDictionary (pdf_document);
if (label_format.number_style.Length > 0) {
- r_attribs.Elements.Add (new PdfName (name_fmt), new PdfName (label_format.number_style));
- }
+ r_attribs.Elements.Add (new PdfName (name_fmt), new PdfName (label_format.number_style));
+ }
if (label_format.first_number > 1) {
- r_attribs.Elements.Add (new PdfName (name_start_at), new PdfInteger (label_format.first_number));
+ r_attribs.Elements.Add (new PdfName (name_start_at), new PdfInteger (label_format.first_number));
}
if (label_format.prefix.Length > 0) {
r_attribs.Elements.Add (new PdfName (name_prefix), new PdfString (label_format.prefix));
-
}
number_tree.Elements.Add (r_attribs);
}
diff --git a/src/PdfMod/Pdf/PageThumbnail.cs b/src/PdfMod/Pdf/PageThumbnail.cs
index 3d4d521..d84c851 100644
--- a/src/PdfMod/Pdf/PageThumbnail.cs
+++ b/src/PdfMod/Pdf/PageThumbnail.cs
@@ -1,3 +1,18 @@
+// Copyright (C) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
using System;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]