summaryrefslogtreecommitdiff
path: root/vcl/source/filter/ipdf/pdfdocument.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-03-22 21:32:12 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-03-22 21:32:12 +0100
commit2595ad876024d6df4249dcdac39501d2fdf9e0c9 (patch)
tree1b8bc7efa9f04965ba2410ed4050a87f375a7db2 /vcl/source/filter/ipdf/pdfdocument.cxx
parentf5c93d4149e7ae967e98dbce72528a04a204ca95 (diff)
Use rtl::isAscii* instead of ctype.h is* (and fix passing plain char)
Change-Id: I10c0433d314808cb1c51c3bde4f826bce7c8a97b
Diffstat (limited to 'vcl/source/filter/ipdf/pdfdocument.cxx')
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx22
1 files changed, 13 insertions, 9 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index fe60765ed5eb..72996ecd652c 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -19,6 +19,7 @@
#include <comphelper/scopeguard.hxx>
#include <comphelper/string.hxx>
#include <filter/msfilter/mscodec.hxx>
+#include <rtl/character.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/string.hxx>
#include <sal/log.hxx>
@@ -994,7 +995,7 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode, std::vector< s
}
default:
{
- if (isdigit(ch) || ch == '-')
+ if (rtl::isAsciiDigit(static_cast<unsigned char>(ch)) || ch == '-')
{
// Numbering object: an integer or a real.
auto pNumberElement = new PDFNumberElement();
@@ -1015,7 +1016,7 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode, std::vector< s
m_pXRefStream = it->second;
}
}
- else if (isalpha(ch))
+ else if (rtl::isAsciiAlpha(static_cast<unsigned char>(ch)))
{
// Possible keyword, like "obj".
rStream.SeekRel(-1);
@@ -1166,7 +1167,7 @@ bool PDFDocument::Tokenize(SvStream& rStream, TokenizeMode eMode, std::vector< s
}
else
{
- if (!isspace(ch))
+ if (!rtl::isAsciiWhiteSpace(static_cast<unsigned char>(ch)))
{
SAL_WARN("vcl.filter", "PDFDocument::Tokenize: unexpected character: " << ch << " at byte position " << rStream.Tell());
return false;
@@ -1261,7 +1262,7 @@ OString PDFDocument::ReadKeyword(SvStream& rStream)
rStream.ReadChar(ch);
if (rStream.IsEof())
return OString();
- while (isalpha(ch))
+ while (rtl::isAsciiAlpha(static_cast<unsigned char>(ch)))
{
aBuf.append(ch);
rStream.ReadChar(ch);
@@ -1682,7 +1683,7 @@ void PDFDocument::SkipWhitespace(SvStream& rStream)
if (rStream.IsEof())
break;
- if (!isspace(ch))
+ if (!rtl::isAsciiWhiteSpace(static_cast<unsigned char>(ch)))
{
rStream.SeekRel(-1);
return;
@@ -1833,7 +1834,7 @@ std::vector<PDFObjectElement*> PDFDocument::GetSignatureWidgets()
int PDFDocument::AsHex(char ch)
{
int nRet = 0;
- if (isdigit(ch))
+ if (rtl::isAsciiDigit(static_cast<unsigned char>(ch)))
nRet = ch - '0';
else
{
@@ -1921,14 +1922,16 @@ bool PDFNumberElement::Read(SvStream& rStream)
{
return false;
}
- if (!isdigit(ch) && ch != '-' && ch != '.')
+ if (!rtl::isAsciiDigit(static_cast<unsigned char>(ch)) && ch != '-'
+ && ch != '.')
{
rStream.SeekRel(-1);
return false;
}
while (!rStream.IsEof())
{
- if (!isdigit(ch) && ch != '-' && ch != '.')
+ if (!rtl::isAsciiDigit(static_cast<unsigned char>(ch)) && ch != '-'
+ && ch != '.')
{
rStream.SeekRel(-1);
m_nLength = rStream.Tell() - m_nOffset;
@@ -2780,7 +2783,8 @@ bool PDFNameElement::Read(SvStream& rStream)
rStream.ReadChar(ch);
while (!rStream.IsEof())
{
- if (isspace(ch) || ch == '/' || ch == '[' || ch == ']' || ch == '<' || ch == '>' || ch == '(')
+ if (rtl::isAsciiWhiteSpace(static_cast<unsigned char>(ch)) || ch == '/'
+ || ch == '[' || ch == ']' || ch == '<' || ch == '>' || ch == '(')
{
rStream.SeekRel(-1);
m_aValue = aBuf.makeStringAndClear();