summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-09-09 20:22:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-09-09 20:22:46 +0100
commit4bd34964251d1d65dfc9ecb3fded60fa71a07cf8 (patch)
tree51a78556714787e7231d2f71e49e10a24e02620a
parent9bba2d6a5ce91d851cfa15cbef3ba06e6907bc49 (diff)
CID#1079151 make it impossible to have an init m_eType
Change-Id: I04cc7fdc07e89b0a056f0012cdd00b43d29184e7
-rw-r--r--include/vcl/ppdparser.hxx2
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx9
2 files changed, 5 insertions, 6 deletions
diff --git a/include/vcl/ppdparser.hxx b/include/vcl/ppdparser.hxx
index 6ced633f31d9..0868da96120e 100644
--- a/include/vcl/ppdparser.hxx
+++ b/include/vcl/ppdparser.hxx
@@ -82,7 +82,7 @@ public:
PPDKey( const OUString& rKey );
~PPDKey();
- PPDValue* insertValue( const OUString& rOption );
+ PPDValue* insertValue( const OUString& rOption, PPDValueType eType );
int countValues() const
{ return m_aValues.size(); }
// neither getValue will return the query option
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index ffe899a7009b..1fd56cbe37e1 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -1151,10 +1151,9 @@ void PPDParser::parse( ::std::list< OString >& rLines )
if( eType == eNo && bQuery )
continue;
- PPDValue* pValue = pKey->insertValue( aOption );
+ PPDValue* pValue = pKey->insertValue( aOption, eType );
if( ! pValue )
continue;
- pValue->m_eType = eType;
pValue->m_aValue = aValue;
if( !aOptionTranslation.isEmpty() )
@@ -1200,8 +1199,7 @@ void PPDParser::parse( ::std::list< OString >& rLines )
// (example: DefaultResolution)
// so invent that key here and have a default value
PPDKey* pKey = new PPDKey( aKey );
- PPDValue* pNewValue = pKey->insertValue( aOption );
- pNewValue->m_eType = eInvocation; // or what ?
+ pKey->insertValue( aOption, eInvocation /*or what ?*/ );
insertKey( aKey, pKey );
}
}
@@ -1598,13 +1596,14 @@ void PPDKey::eraseValue( const OUString& rOption )
// -------------------------------------------------------------------
-PPDValue* PPDKey::insertValue( const OUString& rOption )
+PPDValue* PPDKey::insertValue( const OUString& rOption, PPDValueType eType )
{
if( m_aValues.find( rOption ) != m_aValues.end() )
return NULL;
PPDValue aValue;
aValue.m_aOption = rOption;
+ aValue.m_eType = eType;
m_aValues[ rOption ] = aValue;
PPDValue* pValue = &m_aValues[rOption];
m_aOrderedValues.push_back( pValue );