mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 18:42:41 +01:00
GH #416: PDF::Page::createTextAnnotation bad comparison
This commit is contained in:
@@ -170,9 +170,9 @@ const Font& Document::loadFont(const std::string& name, const std::string& encod
|
||||
const Font& Document::font(const std::string& name, const std::string& encoding)
|
||||
{
|
||||
FontContainer::iterator it = _fonts.find(name);
|
||||
if (_fonts.end() == it) return loadFont(name, encoding);
|
||||
|
||||
throw IllegalStateException("Could not create font.");
|
||||
if (_fonts.end() != it) return it->second;
|
||||
|
||||
return loadFont(name, encoding);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ void Page::setRotation(int angle)
|
||||
const Destination& Page::createDestination(const std::string& name)
|
||||
{
|
||||
DestinationContainer::iterator it = _destinations.find(name);
|
||||
if (_destinations.end() == it)
|
||||
if (_destinations.end() != it)
|
||||
throw InvalidArgumentException("Destination already exists.");
|
||||
|
||||
Destination dest(_pPDF, HPDF_Page_CreateDestination(_page), name);
|
||||
@@ -150,7 +150,7 @@ const TextAnnotation& Page::createTextAnnotation(const std::string& name,
|
||||
const Encoder& encoder)
|
||||
{
|
||||
TextAnnotationContainer::iterator it = _textAnnotations.find(name);
|
||||
if (_textAnnotations.end() == it)
|
||||
if (_textAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
TextAnnotation ann(_pPDF,
|
||||
@@ -171,7 +171,7 @@ const LinkAnnotation& Page::createLinkAnnotation(const std::string& name,
|
||||
const Destination& dest)
|
||||
{
|
||||
LinkAnnotationContainer::iterator it = _linkAnnotations.find(name);
|
||||
if (_linkAnnotations.end() == it)
|
||||
if (_linkAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
LinkAnnotation ann(_pPDF,
|
||||
@@ -191,7 +191,7 @@ const LinkAnnotation& Page::createURILinkAnnotation(const std::string& name,
|
||||
const std::string& uri)
|
||||
{
|
||||
LinkAnnotationContainer::iterator it = _linkAnnotations.find(name);
|
||||
if (_linkAnnotations.end() == it)
|
||||
if (_linkAnnotations.end() != it)
|
||||
throw InvalidArgumentException("Annotation already exists.");
|
||||
|
||||
LinkAnnotation ann(_pPDF,
|
||||
|
||||
Reference in New Issue
Block a user