[poppler] 5 commits - poppler/Annot.cc
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jun 21 16:51:11 UTC 2019
poppler/Annot.cc | 60 +++++++++++++++++++++++++++----------------------------
1 file changed, 30 insertions(+), 30 deletions(-)
New commits:
commit 9cea7a935e608828ef8957aeefbb3539f4f63ae5
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Jun 21 18:35:19 2019 +0200
Annot: Rename dx and dy
Fixes shadow warning
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 63ac2759..5993d30e 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -4346,16 +4346,16 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
CharCode code;
Unicode *uAux;
int uLen, n;
- double dx, dy, ox, oy;
+ double char_dx, char_dy, ox, oy;
- dx = 0.0;
- n = font->getNextChar(s, len, &code, &uAux, &uLen, &dx, &dy, &ox, &oy);
- dx *= fontSize;
+ char_dx = 0.0;
+ n = font->getNextChar(s, len, &code, &uAux, &uLen, &char_dx, &char_dy, &ox, &oy);
+ char_dx *= fontSize;
// center each character within its cell, by advancing the text
// position the appropriate amount relative to the start of the
// previous character
- x = 0.5 * (w - dx);
+ x = 0.5 * (w - char_dx);
appearBuf->appendf("{0:.2f} 0 Td\n", x - xPrev + w);
GooString charBuf(s, n);
commit 4e225788ec5d500d4f71d7abe8163517bfeadea0
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Jun 21 18:33:20 2019 +0200
Annot: rename one i and one j to k
fixes shadow warning
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 03dd55c0..63ac2759 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -4485,11 +4485,11 @@ bool AnnotAppearanceBuilder::drawListBox(const FormFieldChoice *fieldChoice, con
i = j;
}
}
- for (std::size_t i = 2; i < daToks->size(); ++i) {
- if (i >= 2 && !((*daToks)[i])->cmp("Tf")) {
- tfPos = i - 2;
- } else if (i >= 6 && !((*daToks)[i])->cmp("Tm")) {
- tmPos = i - 6;
+ for (std::size_t k = 2; k < daToks->size(); ++k) {
+ if (k >= 2 && !((*daToks)[k])->cmp("Tf")) {
+ tfPos = k - 2;
+ } else if (k >= 6 && !((*daToks)[k])->cmp("Tm")) {
+ tmPos = k - 6;
}
}
} else {
@@ -4606,8 +4606,8 @@ bool AnnotAppearanceBuilder::drawListBox(const FormFieldChoice *fieldChoice, con
// write the DA string
if (daToks) {
- for (std::size_t j = 0; j < daToks->size(); ++j) {
- appearBuf->append((*daToks)[j])->append(' ');
+ for (std::size_t k = 0; k < daToks->size(); ++k) {
+ appearBuf->append((*daToks)[k])->append(' ');
}
}
commit 2b73efb5d4aafdca90c892ed61c26bf3a98d87cf
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Jun 21 18:29:01 2019 +0200
Annot: break out a i definition into multiple
fixes shadow warning
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 4d6bd5d6..03dd55c0 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -4047,7 +4047,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
const GfxFont *font;
double dx, dy;
double fontSize, fontSize2, borderWidth, x, xPrev, y, w, wMax;
- int tfPos, tmPos, i, j;
+ int tfPos, tmPos, j;
int rot;
bool freeText = false; // true if text should be freed before return
GfxFont *fontToFree = nullptr;
@@ -4060,7 +4060,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
tfPos = tmPos = -1;
if (da) {
daToks = new std::vector<GooString*>();
- i = 0;
+ int i = 0;
while (i < da->getLength()) {
while (i < da->getLength() && Lexer::isSpace(da->getChar(i))) {
++i;
@@ -4148,7 +4148,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
len = text->getLength();
GooString *newText = new GooString;
- for (i = 0; i < len; ++i)
+ for (int i = 0; i < len; ++i)
newText->append('*');
text = newText;
freeText = true;
@@ -4193,7 +4193,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
if (fontSize == 0) {
for (fontSize = 20; fontSize > 1; --fontSize) {
y = dy - 3;
- i = 0;
+ int i = 0;
while (i < text->getLength()) {
Annot::layoutText(text, &convertedText, &i, font, &w, wMax / fontSize, nullptr,
forceZapfDingbats);
@@ -4228,7 +4228,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
// write the DA string
if (daToks) {
- for (i = 0; i < (int)daToks->size(); ++i) {
+ for (int i = 0; i < (int)daToks->size(); ++i) {
appearBuf->append((*daToks)[i])->append(' ');
}
}
@@ -4239,7 +4239,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
}
// write a series of lines of text
- i = 0;
+ int i = 0;
xPrev = 0;
while (i < text->getLength()) {
Annot::layoutText(text, &convertedText, &i, font, &w, wMax / fontSize, nullptr,
@@ -4294,7 +4294,7 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
}
}
- i = 0;
+ int i = 0;
Annot::layoutText(text, &convertedText, &i, font, nullptr, 0.0, &charCount,
forceZapfDingbats);
if (charCount > comb)
@@ -4370,8 +4370,8 @@ bool AnnotAppearanceBuilder::drawText(const GooString *text, const GooString *da
// regular (non-comb) formatting
} else {
- i = 0;
- Annot::layoutText(text, &convertedText, &i, font, &w, 0.0, nullptr,
+ int ii = 0;
+ Annot::layoutText(text, &convertedText, &ii, font, &w, 0.0, nullptr,
forceZapfDingbats);
// compute font autosize
commit 4d9fa84efd7b757f90cd36353c20ba033d6a2204
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Jun 21 18:24:05 2019 +0200
Annot: Rename three type to a longer more qualified name
Fixes shadow warnings
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index c6d07b41..4d6bd5d6 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -3784,14 +3784,14 @@ void AnnotWidget::initialize(PDFDoc *docA, Dict *dict) {
updatedAppearanceStream = Ref::INVALID();
}
-LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType type)
+LinkAction* AnnotWidget::getAdditionalAction(AdditionalActionsType additionalActionType)
{
- return ::getAdditionalAction(type, &additionalActions, doc);
+ return ::getAdditionalAction(additionalActionType, &additionalActions, doc);
}
-LinkAction* AnnotWidget::getFormAdditionalAction(FormAdditionalActionsType type)
+LinkAction* AnnotWidget::getFormAdditionalAction(FormAdditionalActionsType formAdditionalActionType)
{
- return ::getFormAdditionalAction(type, &additionalActions, doc);
+ return ::getFormAdditionalAction(formAdditionalActionType, &additionalActions, doc);
}
// Grand unified handler for preparing text strings to be drawn into form
@@ -5160,12 +5160,12 @@ void AnnotScreen::initialize(PDFDoc *docA, Dict* dict) {
}
}
-LinkAction* AnnotScreen::getAdditionalAction(AdditionalActionsType type)
+LinkAction* AnnotScreen::getAdditionalAction(AdditionalActionsType additionalActionType)
{
- if (type == actionFocusIn || type == actionFocusOut) // not defined for screen annotation
+ if (additionalActionType == actionFocusIn || additionalActionType == actionFocusOut) // not defined for screen annotation
return nullptr;
- return ::getAdditionalAction(type, &additionalActions, doc);
+ return ::getAdditionalAction(additionalActionType, &additionalActions, doc);
}
//------------------------------------------------------------------------
commit 40f5c496016ba94c9a27e31c5d1afb8e1a366de5
Author: Albert Astals Cid <aacid at kde.org>
Date: Fri Jun 21 18:18:47 2019 +0200
coords -> coordsA
fixes shadow warning
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index e256384f..c6d07b41 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -287,8 +287,8 @@ AnnotPath::AnnotPath(Array *array) {
parsePathArray(array);
}
-AnnotPath::AnnotPath(std::vector<AnnotCoord> &&coords) {
- this->coords = std::move(coords);
+AnnotPath::AnnotPath(std::vector<AnnotCoord> &&coordsA) {
+ coords = std::move(coordsA);
}
AnnotPath::~AnnotPath() = default;
More information about the poppler
mailing list