summaryrefslogtreecommitdiff
path: root/vcl/source/filter/ipdf/pdfdocument.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/filter/ipdf/pdfdocument.cxx')
-rw-r--r--vcl/source/filter/ipdf/pdfdocument.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx
index 56e90cf7adf3..11c4519e44cf 100644
--- a/vcl/source/filter/ipdf/pdfdocument.cxx
+++ b/vcl/source/filter/ipdf/pdfdocument.cxx
@@ -2021,11 +2021,20 @@ bool PDFLiteralStringElement::Read(SvStream& rStream)
nPrevCh = ch;
rStream.ReadChar(ch);
+ // Start with 1 nesting level as we read a '(' above already.
+ int nDepth = 1;
OStringBuffer aBuf;
while (!rStream.eof())
{
+ if (ch == '(' && nPrevCh != '\\')
+ ++nDepth;
+
if (ch == ')' && nPrevCh != '\\')
+ --nDepth;
+
+ if (nDepth == 0)
{
+ // ')' of the outermost '(' is reached.
m_aValue = aBuf.makeStringAndClear();
SAL_INFO("vcl.filter", "PDFLiteralStringElement::Read: m_aValue is '" << m_aValue << "'");
return true;