summaryrefslogtreecommitdiff
path: root/padmin
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-12-16 17:38:59 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2009-12-16 17:38:59 +0100
commit5df27651727b0c7899a7220f972799a99694254d (patch)
tree2f72899a57b264f2745652b4d55c28965b2e51ea /padmin
parent2740353e241613fd17fcd8ce57583129490a19d2 (diff)
vcl108: #i94111# support globalized PPDs
Diffstat (limited to 'padmin')
-rw-r--r--padmin/source/prtsetup.cxx23
-rw-r--r--padmin/source/prtsetup.hxx2
2 files changed, 13 insertions, 12 deletions
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 6cf4f8b257b1..69217e2d0063 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -44,9 +44,9 @@ using namespace rtl;
using namespace psp;
using namespace padmin;
-void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDKey* pKey )
+void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, const PPDKey* pKey )
{
- if( ! pKey )
+ if( ! pKey || ! pParser )
return;
const PPDValue* pValue = NULL;
@@ -56,7 +56,7 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDKey* pKey )
for( int i = 0; i < pKey->countValues(); i++ )
{
pValue = pKey->getValue( i );
- aOptionText = pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption;
+ aOptionText = pParser->translateOption( pKey->getKey(), pValue->m_aOption) ;
if( m_aJobData.m_aContext.checkConstraints( pKey, pValue ) )
{
@@ -282,7 +282,7 @@ void RTSPaperPage::update()
if( m_pParent->m_aJobData.m_pParser &&
(pKey = m_pParent->m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) )) )
{
- m_pParent->insertAllPPDValues( m_aDuplexBox, pKey );
+ m_pParent->insertAllPPDValues( m_aDuplexBox, m_pParent->m_aJobData.m_pParser, pKey );
}
else
{
@@ -294,7 +294,7 @@ void RTSPaperPage::update()
if( m_pParent->m_aJobData.m_pParser &&
(pKey = m_pParent->m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) )) )
{
- m_pParent->insertAllPPDValues( m_aPaperBox, pKey );
+ m_pParent->insertAllPPDValues( m_aPaperBox, m_pParent->m_aJobData.m_pParser, pKey );
}
else
{
@@ -306,7 +306,7 @@ void RTSPaperPage::update()
if( m_pParent->m_aJobData.m_pParser &&
(pKey = m_pParent->m_aJobData.m_pParser->getKey( String::CreateFromAscii( "InputSlot" ) )) )
{
- m_pParent->insertAllPPDValues( m_aSlotBox, pKey );
+ m_pParent->insertAllPPDValues( m_aSlotBox, m_pParent->m_aJobData.m_pParser, pKey );
}
else
{
@@ -411,8 +411,8 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
! pKey->getKey().EqualsAscii( "Duplex" )
)
{
- USHORT nPos =
- m_aPPDKeyBox.InsertEntry( pKey->getUITranslation().Len() ? pKey->getUITranslation() : pKey->getKey() );
+ String aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) );
+ USHORT nPos = m_aPPDKeyBox.InsertEntry( aEntry );
m_aPPDKeyBox.SetEntryData( nPos, (void*)pKey );
}
}
@@ -466,10 +466,11 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey )
for( int i = 0; i < pKey->countValues(); i++ )
{
pValue = pKey->getValue( i );
- if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) )
+ if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) &&
+ m_pParent->m_aJobData.m_pParser )
{
- USHORT nPos =
- m_aPPDValueBox.InsertEntry( pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption );
+ String aEntry( m_pParent->m_aJobData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ) );
+ USHORT nPos = m_aPPDValueBox.InsertEntry( aEntry );
m_aPPDValueBox.SetEntryData( nPos, (void*)pValue );
}
}
diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx
index 8487daa158da..1e296fa9ed88 100644
--- a/padmin/source/prtsetup.hxx
+++ b/padmin/source/prtsetup.hxx
@@ -85,7 +85,7 @@ class RTSDialog : public TabDialog
DECL_LINK( ClickButton, Button* );
// helper functions
- void insertAllPPDValues( ListBox&, const ::psp::PPDKey* );
+ void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* );
public:
RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL );
~RTSDialog();