summaryrefslogtreecommitdiff
path: root/vcl/unx/generic/printer/ppdparser.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-31 15:41:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-03-31 15:46:15 +0100
commita13362ef97d7cb7216009fe7002a050516895cb4 (patch)
tree7c0e19e639e4501ab9a341ac7d3270d9fca3c027 /vcl/unx/generic/printer/ppdparser.cxx
parentdcc8c9173d76c3f31af6b1098d920c5491ed150e (diff)
Resolves: fdo#43049 basic PPD custom options support
because this is another way seen in the wild to transmit a fax number through cups as an alternative to using fax4CUPS Change-Id: I32db38aa05213e469442136eb46d0028098a8b7e
Diffstat (limited to 'vcl/unx/generic/printer/ppdparser.cxx')
-rw-r--r--vcl/unx/generic/printer/ppdparser.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 7e56085a4cf1..42eeffc2e3a0 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -933,6 +933,18 @@ void PPDParser::parse( ::std::list< OString >& rLines )
}
else if( aKey == "CustomPageSize" ) // currently not handled
continue;
+ else if (aKey.startsWith("Custom", &aKey) )
+ {
+ //fdo#43049 very basic support for Custom entries, we ignore the
+ //validation params and types
+ PPDKey* pKey = NULL;
+ OUString aUniKey(OStringToOUString(aKey, RTL_TEXTENCODING_MS_1252));
+ keyit = m_aKeys.find( aUniKey );
+ if(keyit != m_aKeys.end())
+ pKey = keyit->second;
+ pKey->insertValue("Custom", eInvocation, true);
+ continue;
+ }
// default values are parsed in pass 2
if (aKey.startsWith("Default"))
@@ -1525,15 +1537,14 @@ void PPDKey::eraseValue( const OUString& rOption )
m_aValues.erase( it );
}
-
-
-PPDValue* PPDKey::insertValue( const OUString& rOption, PPDValueType eType )
+PPDValue* PPDKey::insertValue(const OUString& rOption, PPDValueType eType, bool bCustomOption)
{
if( m_aValues.find( rOption ) != m_aValues.end() )
return NULL;
PPDValue aValue;
aValue.m_aOption = rOption;
+ aValue.m_bCustomOption = bCustomOption;
aValue.m_eType = eType;
m_aValues[ rOption ] = aValue;
PPDValue* pValue = &m_aValues[rOption];
@@ -1541,8 +1552,6 @@ PPDValue* PPDKey::insertValue( const OUString& rOption, PPDValueType eType )
return pValue;
}
-
-
/*
* PPDContext
*/