From 34a1250e0b4bf62dbf87ff6139fc3107f7543b82 Mon Sep 17 00:00:00 2001 From: Andrew Rist Date: Fri, 5 Oct 2012 19:15:10 +0000 Subject: Related: #i117765# css.awt.PrinterServer implementation unusable in Basic from cws/fs35a by Frank Schoenheit [fs] (cherry picked from commit e9bfcd0982bcb67071b344da377158fc0d88d8a6) Conflicts: toolkit/inc/toolkit/awt/vclxprinter.hxx toolkit/source/awt/vclxprinter.cxx Change-Id: I96b08d00c7e483891d3c24c90fa52764949add0b Fix line endings (cherry picked from commit f4f2c3189e5fc9f6fac57b5a6df0840ecdaaa731) Conflicts: toolkit/inc/toolkit/awt/vclxprinter.hxx toolkit/source/awt/vclxprinter.cxx Change-Id: I88acd74eec39410844030d3cba489e1fe62a91b3 --- toolkit/source/awt/vclxprinter.cxx | 92 ++++++++------------------------------ 1 file changed, 19 insertions(+), 73 deletions(-) (limited to 'toolkit/source') diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index 60ef23190da0..209040bafa96 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -33,7 +33,7 @@ #include -#define BINARYSETUPMARKER 0x23864691 +#define BINARYSETUPMARKER 0x23864691 #define PROPERTY_Orientation 0 #define PROPERTY_Horizontal 1 @@ -60,29 +60,12 @@ return pProperties; } -// ---------------------------------------------------- -// class VCLXPrinterPropertySet -// ---------------------------------------------------- +// ---------------------------------------------------- +// class VCLXPrinterPropertySet +// ---------------------------------------------------- -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXPrinterPropertySet::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - (static_cast< ::com::sun::star::beans::XMultiPropertySet* >(this)), - (static_cast< ::com::sun::star::beans::XFastPropertySet* >(this)), - (static_cast< ::com::sun::star::beans::XPropertySet* >((::cppu::OPropertySetHelper*) this) ), - (static_cast< ::com::sun::star::awt::XPrinterPropertySet* >(this)), - (static_cast< ::com::sun::star::lang::XTypeProvider* >(this)) ); - return (aRet.hasValue() ? aRet : OPropertySetHelper::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXPrinterPropertySet ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XMultiPropertySet>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet>* ) NULL ), - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinterPropertySet>* ) NULL ) -IMPL_XTYPEPROVIDER_END +IMPLEMENT_FORWARD_XINTERFACE2( VCLXPrinterPropertySet, VCLXPrinterPropertySet_Base, OPropertySetHelper ) +IMPLEMENT_FORWARD_XTYPEPROVIDER2( VCLXPrinterPropertySet, VCLXPrinterPropertySet_Base, ::cppu::OPropertySetHelper ) VCLXPrinterPropertySet::VCLXPrinterPropertySet( const OUString& rPrinterName ) : OPropertySetHelper( BrdcstHelper ) @@ -227,7 +210,7 @@ void VCLXPrinterPropertySet::setHorizontal( sal_Bool bHorizontal ) throw(::com:: ::osl::MutexGuard aGuard( Mutex ); sal_uInt16 nPaperBinCount = GetPrinter()->GetPaperBinCount(); - ::com::sun::star::uno::Sequence< OUString > aDescriptions( nPaperBinCount ); + ::com::sun::star::uno::Sequence< OUString > aDescriptions( nPaperBinCount ); for ( sal_uInt16 n = 0; n < nPaperBinCount; n++ ) { // Format: @@ -279,11 +262,11 @@ void VCLXPrinterPropertySet::setBinarySetup( const ::com::sun::star::uno::Sequen } -// ---------------------------------------------------- -// class VCLXPrinter -// ---------------------------------------------------- +// ---------------------------------------------------- +// class VCLXPrinter +// ---------------------------------------------------- VCLXPrinter::VCLXPrinter( const OUString& rPrinterName ) - : VCLXPrinterPropertySet( rPrinterName ) + : VCLXPrinter_Base( rPrinterName ) { } @@ -291,24 +274,6 @@ VCLXPrinter::~VCLXPrinter() { } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXPrinter::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - (static_cast< ::com::sun::star::awt::XPrinter* >(this)) ); - - if ( !aRet.hasValue() ) - aRet = VCLXPrinterPropertySet::queryInterface( rType ); - - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXPrinter ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter>* ) NULL ), - VCLXPrinterPropertySet::getTypes() -IMPL_XTYPEPROVIDER_END - sal_Bool VCLXPrinter::start( const OUString& /*rJobName*/, sal_Int16 /*nCopies*/, sal_Bool /*bCollate*/ ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { ::osl::MutexGuard aGuard( Mutex ); @@ -363,12 +328,12 @@ void VCLXPrinter::endPage( ) throw(::com::sun::star::awt::PrinterException, ::c } -// ---------------------------------------------------- -// class VCLXInfoPrinter -// ---------------------------------------------------- +// ---------------------------------------------------- +// class VCLXInfoPrinter +// ---------------------------------------------------- VCLXInfoPrinter::VCLXInfoPrinter( const OUString& rPrinterName ) - : VCLXPrinterPropertySet( rPrinterName ) + : VCLXInfoPrinter_Base( rPrinterName ) { } @@ -376,24 +341,6 @@ VCLXInfoPrinter::~VCLXInfoPrinter() { } -// ::com::sun::star::uno::XInterface -::com::sun::star::uno::Any VCLXInfoPrinter::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) -{ - ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType, - (static_cast< ::com::sun::star::awt::XInfoPrinter* >(this)) ); - - if ( !aRet.hasValue() ) - aRet = VCLXPrinterPropertySet::queryInterface( rType ); - - return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType )); -} - -// ::com::sun::star::lang::XTypeProvider -IMPL_XTYPEPROVIDER_START( VCLXInfoPrinter ) - getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter>* ) NULL ), - VCLXPrinterPropertySet::getTypes() -IMPL_XTYPEPROVIDER_END - // ::com::sun::star::awt::XInfoPrinter ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXInfoPrinter::createDevice( ) throw(::com::sun::star::uno::RuntimeException) { @@ -402,9 +349,9 @@ IMPL_XTYPEPROVIDER_END return GetDevice(); } -// ---------------------------------------------------- -// class VCLXPrinterServer -// ---------------------------------------------------- +// ---------------------------------------------------- +// class VCLXPrinterServer +// ---------------------------------------------------- // ::com::sun::star::awt::XPrinterServer ::com::sun::star::uno::Sequence< OUString > VCLXPrinterServer::getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException) @@ -412,7 +359,7 @@ IMPL_XTYPEPROVIDER_END const std::vector& rQueues = Printer::GetPrinterQueues(); sal_uInt32 nPrinters = rQueues.size(); - ::com::sun::star::uno::Sequence< OUString > aNames( nPrinters ); + ::com::sun::star::uno::Sequence< OUString > aNames( nPrinters ); for ( sal_uInt32 n = 0; n < nPrinters; n++ ) aNames.getArray()[n] = rQueues[n]; @@ -434,5 +381,4 @@ IMPL_XTYPEPROVIDER_END } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit