Kaydet (Commit) 6e5e8302 authored tarafından Caolán McNamara's avatar Caolán McNamara

forcepoint: rework to explore loop

Change-Id: I14f6a3269fc3347a9976d899519e74f58d5975c8
Reviewed-on: https://gerrit.libreoffice.org/56125
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst cb5c2d20
......@@ -261,7 +261,7 @@ public:
// for printer setup
char* getStreamableBuffer( sal_uLong& rBytes ) const;
void rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes );
void rebuildFromStreamBuffer(const std::vector<char> &rBuffer);
// convenience
int getRenderResolution() const;
......
......@@ -278,8 +278,9 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
nBytes = aStream.ReadBytes(aRemain.data(), nBytes);
if (nBytes)
{
aRemain.resize(nBytes+1);
aRemain[nBytes] = 0;
rJobData.m_aContext.rebuildFromStreamBuffer(aRemain.data(), nBytes);
rJobData.m_aContext.rebuildFromStreamBuffer(aRemain);
bContext = true;
}
}
......
......@@ -1905,17 +1905,18 @@ char* PPDContext::getStreamableBuffer( sal_uLong& rBytes ) const
return pBuffer;
}
void PPDContext::rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes )
void PPDContext::rebuildFromStreamBuffer(const std::vector<char> &rBuffer)
{
if( ! m_pParser )
return;
m_aCurrentValues.clear();
char* pRun = pBuffer;
while( nBytes && *pRun )
size_t nBytes = rBuffer.size() - 1;
size_t nRun = 0;
while (nBytes && rBuffer[nRun])
{
OString aLine( pRun );
OString aLine(rBuffer.data() + nRun);
sal_Int32 nPos = aLine.indexOf(':');
if( nPos != -1 )
{
......@@ -1935,7 +1936,7 @@ void PPDContext::rebuildFromStreamBuffer( char* pBuffer, sal_uLong nBytes )
}
}
nBytes -= aLine.getLength()+1;
pRun += aLine.getLength()+1;
nRun += aLine.getLength()+1;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment