diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-03-22 08:46:17 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-03-22 08:46:17 +0000 |
commit | 60dca97be1fcc0279c97c06f4ed2076aa788b64d (patch) | |
tree | c5dc02d614cf357b20cc9d4f1d631c5fa7282ed0 | |
parent | d318cba2627d9749c884c5309d94a2fd07f49ee8 (diff) |
INTEGRATION: CWS printsetting (1.57.14); FILE MERGED
2006/03/08 13:04:19 pl 1.57.14.1: #i49631# add: printing disabler
-rw-r--r-- | vcl/source/app/settings.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index a5b599596b20..2a33bce001e1 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -4,9 +4,9 @@ * * $RCSfile: settings.cxx,v $ * - * $Revision: 1.57 $ + * $Revision: 1.58 $ * - * last change: $Author: rt $ $Date: 2006-02-09 14:28:08 $ + * last change: $Author: obo $ $Date: 2006-03-22 09:46:17 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1024,6 +1024,7 @@ ImplMiscData::ImplMiscData() mnRefCount = 1; mnTwoDigitYearStart = 1930; mnEnableATT = ~0; + mnDisablePrinting = ~0; static const char* pEnv = getenv("SAL_DECIMALSEP_ENABLED" ); // set default without UI mbEnableLocalizedDecimalSep = (pEnv != NULL) ? TRUE : FALSE; } @@ -1035,6 +1036,7 @@ ImplMiscData::ImplMiscData( const ImplMiscData& rData ) mnRefCount = 1; mnTwoDigitYearStart = rData.mnTwoDigitYearStart; mnEnableATT = rData.mnEnableATT; + mnDisablePrinting = rData.mnDisablePrinting; mbEnableLocalizedDecimalSep = rData.mbEnableLocalizedDecimalSep; } @@ -1108,6 +1110,7 @@ BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const if ( (mpData->mnTwoDigitYearStart == rSet.mpData->mnTwoDigitYearStart ) && (mpData->mnEnableATT == rSet.mpData->mnEnableATT ) && + (mpData->mnDisablePrinting == rSet.mpData->mnDisablePrinting ) && (mpData->mbEnableLocalizedDecimalSep == rSet.mpData->mbEnableLocalizedDecimalSep ) ) return TRUE; else @@ -1116,6 +1119,21 @@ BOOL MiscSettings::operator ==( const MiscSettings& rSet ) const // ----------------------------------------------------------------------- +BOOL MiscSettings::GetDisablePrinting() const +{ + if( mpData->mnDisablePrinting == (USHORT)~0 ) + { + rtl::OUString aEnable = + vcl::SettingsConfigItem::get()-> + getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DesktopManagement" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisablePrinting" ) ) ); + mpData->mnDisablePrinting = aEnable.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0; + } + + return (BOOL)mpData->mnDisablePrinting; +} +// ----------------------------------------------------------------------- + BOOL MiscSettings::GetEnableATToolSupport() const { @@ -1178,6 +1196,20 @@ BOOL MiscSettings::GetEnableATToolSupport() const // ----------------------------------------------------------------------- +void MiscSettings::SetDisablePrinting( BOOL bEnable ) +{ + if ( bEnable != mpData->mnDisablePrinting ) + { + vcl::SettingsConfigItem::get()-> + setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DesktopManagement" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DisablePrinting" ) ), + rtl::OUString::createFromAscii( bEnable ? "true" : "false" ) ); + mpData->mnDisablePrinting = bEnable ? 1 : 0; + } +} + +// ----------------------------------------------------------------------- + void MiscSettings::SetEnableATToolSupport( BOOL bEnable ) { if ( bEnable != mpData->mnEnableATT ) |