include/toolkit/awt/vclxprinter.hxx | 117 +++++++++++++-------------------- sd/source/ui/tools/PreviewRenderer.cxx | 30 +++++--- toolkit/source/awt/vclxprinter.cxx | 94 +++++--------------------- 3 files changed, 89 insertions(+), 152 deletions(-)
New commits: commit e86a67313e0fbd3c263497684c8d98f1a00d32e7 Author: Armin Le Grand <[email protected]> Date: Fri Oct 19 15:27:03 2012 +0000 Resolves: #i121224# Corrected to use the ApplicationDocumentColor... instead of the ApplicationBackgroundColor (cherry picked from commit 8d005e90cfee08663c02db2e75130b68bf143a93) Conflicts: sd/source/ui/tools/PreviewRenderer.cxx Change-Id: I5bb3d40724dbcca189fac8c9ba29b684b0b9ec67 diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx index 9a355aa..64b17f0 100644 --- a/sd/source/ui/tools/PreviewRenderer.cxx +++ b/sd/source/ui/tools/PreviewRenderer.cxx @@ -274,16 +274,28 @@ bool PreviewRenderer::Initialize ( if (pPageView == NULL) return false; - // Set background color of page view and outliner. - svtools::ColorConfig aColorConfig; - const Color aPageBackgroundColor(pPage->GetPageBackgroundColor(pPageView)); - pPageView->SetApplicationBackgroundColor(aPageBackgroundColor); - SdrOutliner& rOutliner (pDocument->GetDrawOutliner(NULL)); - rOutliner.SetBackgroundColor(aPageBackgroundColor); + // #i121224# No need to set SetApplicationBackgroundColor (which is the color + // of the area 'behind' the page (formally called 'Wiese') since the page previews + // produced exactly cover the page's area, so it would never be visible. What + // needs to be set is the ApplicationDocumentColor which is derived from + // svtools::DOCCOLOR normally + Color aApplicationDocumentColor; + + if (pPageView->GetApplicationDocumentColor() == COL_AUTO) + { + svtools::ColorConfig aColorConfig; + aApplicationDocumentColor = aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor; + } + else + { + aApplicationDocumentColor = pPageView->GetApplicationDocumentColor(); + } + + pPageView->SetApplicationDocumentColor(aApplicationDocumentColor); + SdrOutliner& rOutliner(pDocument->GetDrawOutliner(NULL)); + rOutliner.SetBackgroundColor(aApplicationDocumentColor); rOutliner.SetDefaultLanguage(pDocument->GetLanguage(EE_CHAR_LANGUAGE)); - mpView->SetApplicationBackgroundColor( - Color(aColorConfig.GetColorValue(svtools::APPBACKGROUND).nColor)); - mpPreviewDevice->SetBackground(Wallpaper(aPageBackgroundColor)); + mpPreviewDevice->SetBackground(Wallpaper(aApplicationDocumentColor)); mpPreviewDevice->Erase(); return true; commit 6858934fadcbe825ef59a3c7da4f82879163382b Author: Ariel Constenla-Haile <[email protected]> Date: Sat Oct 6 01:44:09 2012 +0000 Resolves: #i121170# - com::sun::star::awt::XPrinter API does nothing (cherry picked from commit 07abf70e9ecfca7e7898929259263bb307766374) Change-Id: I0b11a4a6337f0928ca43d4eb511831f5f96a246e diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index 209040b..69934d5 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -279,7 +279,7 @@ sal_Bool VCLXPrinter::start( const OUString& /*rJobName*/, sal_Int16 /*nCopies*/ ::osl::MutexGuard aGuard( Mutex ); sal_Bool bDone = sal_True; - if ( mpListener.get() ) + if ( mpPrinter.get() ) { maInitJobSetup = mpPrinter->GetJobSetup(); mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) ); commit 34a1250e0b4bf62dbf87ff6139fc3107f7543b82 Author: Andrew Rist <[email protected]> Date: Fri Oct 5 19:15:10 2012 +0000 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 diff --git a/include/toolkit/awt/vclxprinter.hxx b/include/toolkit/awt/vclxprinter.hxx index a3aca63..1a04013 100644 --- a/include/toolkit/awt/vclxprinter.hxx +++ b/include/toolkit/awt/vclxprinter.hxx @@ -25,16 +25,14 @@ #include <com/sun/star/awt/XPrinter.hpp> #include <com/sun/star/awt/XPrinterServer.hpp> #include <com/sun/star/awt/XInfoPrinter.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> -#include <cppuhelper/implbase2.hxx> #include <cppuhelper/weak.hxx> #include <osl/mutex.hxx> -#include <toolkit/helper/macros.hxx> #include <toolkit/helper/mutexandbroadcasthelper.hxx> -#include <toolkit/helper/servicenames.hxx> #include <cppuhelper/propshlp.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/uno3.hxx> #include "vcl/oldprintadaptor.hxx" @@ -51,10 +49,11 @@ // class VCLXPrinterPropertySet // ---------------------------------------------------- -class VCLXPrinterPropertySet : public ::com::sun::star::awt::XPrinterPropertySet, - public ::com::sun::star::lang::XTypeProvider, - public MutexAndBroadcastHelper, - public ::cppu::OPropertySetHelper +typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XPrinterPropertySet + > VCLXPrinterPropertySet_Base; +class VCLXPrinterPropertySet :public VCLXPrinterPropertySet_Base + ,public MutexAndBroadcastHelper + ,public ::cppu::OPropertySetHelper { protected: boost::shared_ptr<Printer> mpPrinter; @@ -70,20 +69,19 @@ public: ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > GetDevice(); // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + DECLARE_XINTERFACE(); // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + DECLARE_XTYPEPROVIDER(); // ::com::sun::star::beans::XPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::setPropertyValue( rPropertyName, aValue ); } - ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return OPropertySetHelper::getPropertyValue( rPropertyName ); } - void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addPropertyChangeListener( rPropertyName, rxListener ); } - void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removePropertyChangeListener( rPropertyName, rxListener ); } - void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addVetoableChangeListener( rPropertyName, rxListener ); } - void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removeVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL setPropertyValue( const ::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::setPropertyValue( rPropertyName, aValue ); } + ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return OPropertySetHelper::getPropertyValue( rPropertyName ); } + void SAL_CALL addPropertyChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addPropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removePropertyChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removePropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL addVetoableChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::addVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removeVetoableChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { OPropertySetHelper::removeVetoableChangeListener( rPropertyName, rxListener ); } // ::cppu::OPropertySetHelper ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); @@ -94,8 +92,8 @@ public: // ::com::sun::star::awt::XPrinterPropertySet void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectForm( const ::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException); void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); }; @@ -104,9 +102,10 @@ public: // class VCLXPrinter // ---------------------------------------------------- -class VCLXPrinter: public ::com::sun::star::awt::XPrinter, - public VCLXPrinterPropertySet, - public ::cppu::OWeakObject +typedef ::cppu::ImplInheritanceHelper1 < VCLXPrinterPropertySet + , ::com::sun::star::awt::XPrinter + > VCLXPrinter_Base; +class VCLXPrinter: public VCLXPrinter_Base { boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener; JobSetup maInitJobSetup; @@ -114,34 +113,24 @@ public: VCLXPrinter( const OUString& rPrinterName ); ~VCLXPrinter(); - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::release(); } - - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::beans::XPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); } - void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); } - ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); } - void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); } - void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); } - void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); } - void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL setPropertyValue( const ::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); } + ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); } + void SAL_CALL addPropertyChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removePropertyChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL addVetoableChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removeVetoableChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); } // ::com::sun::star::awt::XPrinterPropertySet void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); } - ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); } - void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); } + ::com::sun::star::uno::Sequence< ::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); } + void SAL_CALL selectForm( const ::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); } ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); } void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); } // ::com::sun::star::awt::XPrinter - sal_Bool SAL_CALL start( const OUString& nJobName, sal_Int16 nCopies, sal_Bool nCollate ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL start( const ::OUString& nJobName, sal_Int16 nCopies, sal_Bool nCollate ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); void SAL_CALL end( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException); void SAL_CALL terminate( ) throw(::com::sun::star::uno::RuntimeException); ::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > SAL_CALL startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException); @@ -152,37 +141,28 @@ public: // class VCLXInfoPrinter // ---------------------------------------------------- -class VCLXInfoPrinter: public ::com::sun::star::awt::XInfoPrinter, - public VCLXPrinterPropertySet, - public ::cppu::OWeakObject +typedef ::cppu::ImplInheritanceHelper1 < VCLXPrinterPropertySet + , ::com::sun::star::awt::XInfoPrinter + > VCLXInfoPrinter_Base; +class VCLXInfoPrinter: public VCLXInfoPrinter_Base { public: VCLXInfoPrinter( const OUString& rPrinterName ); ~VCLXInfoPrinter(); - // ::com::sun::star::uno::XInterface - ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); - void SAL_CALL acquire() throw() { OWeakObject::acquire(); } - void SAL_CALL release() throw() { OWeakObject::release(); } - - // ::com::sun::star::lang::XTypeProvider - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); - - // ::com::sun::star::beans::XPropertySet ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertySetInfo(); } - void SAL_CALL setPropertyValue( const OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); } - ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); } - void SAL_CALL addPropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); } - void SAL_CALL removePropertyChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); } - void SAL_CALL addVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); } - void SAL_CALL removeVetoableChangeListener( const OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL setPropertyValue( const ::OUString& rPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setPropertyValue( rPropertyName, aValue ); } + ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::OUString& rPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getPropertyValue( rPropertyName ); } + void SAL_CALL addPropertyChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addPropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removePropertyChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removePropertyChangeListener( rPropertyName, rxListener ); } + void SAL_CALL addVetoableChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::addVetoableChangeListener( rPropertyName, rxListener ); } + void SAL_CALL removeVetoableChangeListener( const ::OUString& rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& rxListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::removeVetoableChangeListener( rPropertyName, rxListener ); } // ::com::sun::star::awt::XPrinterPropertySet void SAL_CALL setHorizontal( sal_Bool bHorizontal ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setHorizontal( bHorizontal ); } - ::com::sun::star::uno::Sequence< OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); } - void SAL_CALL selectForm( const OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); } + ::com::sun::star::uno::Sequence< ::OUString > SAL_CALL getFormDescriptions( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getFormDescriptions(); } + void SAL_CALL selectForm( const ::OUString& aFormDescription ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::selectForm( aFormDescription ); } ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getBinarySetup( ) throw(::com::sun::star::uno::RuntimeException) { return VCLXPrinterPropertySet::getBinarySetup(); } void SAL_CALL setBinarySetup( const ::com::sun::star::uno::Sequence< sal_Int8 >& data ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) { VCLXPrinterPropertySet::setBinarySetup( data ); } @@ -194,16 +174,15 @@ public: // class VCLXPrinterServer // ---------------------------------------------------- -class VCLXPrinterServer : public ::cppu::WeakImplHelper2<com::sun::star::awt::XPrinterServer, - com::sun::star::lang::XServiceInfo> +typedef ::cppu::WeakImplHelper1 < ::com::sun::star::awt::XPrinterServer + > VCLXPrinterServer_Base; +class VCLXPrinterServer : public VCLXPrinterServer_Base { public: // ::com::sun::star::awt::XPrinterServer - ::com::sun::star::uno::Sequence< OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); - - DECLIMPL_SERVICEINFO(VCLXPrinterServer, szServiceName2_PrinterServer); + ::com::sun::star::uno::Sequence< ::OUString > SAL_CALL getPrinterNames( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPrinter > SAL_CALL createPrinter( const ::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XInfoPrinter > SAL_CALL createInfoPrinter( const ::OUString& printerName ) throw(::com::sun::star::uno::RuntimeException); }; #endif // _TOOLKIT_AWT_VCLXPRINTER_HXX_ diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx index 60ef231..209040b 100644 --- a/toolkit/source/awt/vclxprinter.cxx +++ b/toolkit/source/awt/vclxprinter.cxx @@ -33,7 +33,7 @@ #include <toolkit/awt/vclxdevice.hxx> -#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: <DisplayFormName;FormNameId;DisplayPaperBinName;PaperBinNameId;DisplayPaperName;PaperNameId> @@ -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<OUString>& 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: */ _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
