summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorobo <obo@openoffice.org>2011-03-16 12:21:09 +0100
committerobo <obo@openoffice.org>2011-03-16 12:21:09 +0100
commitd46e1d383278641d664dce56965c11b05ac95b4a (patch)
tree1e40204efe8ea027cd2dd8dba6d5504651d57666
parentae8ebca63dca37e1ef6584577d375248681b3d90 (diff)
parent8e4f6b1445dce34d809c4e376636280722b96af4 (diff)
CWS-TOOLING: integrate CWS vcl120ooo/DEV300_m103
-rwxr-xr-x[-rw-r--r--]framework/source/services/backingwindow.cxx57
-rwxr-xr-xsfx2/source/view/viewprn.cxx37
2 files changed, 61 insertions, 33 deletions
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx
index bdadba1a69..bd58f1aa74 100644..100755
--- a/framework/source/services/backingwindow.cxx
+++ b/framework/source/services/backingwindow.cxx
@@ -400,7 +400,7 @@ void BackingWindow::prepareRecentFileMenu()
void BackingWindow::initBackground()
{
- SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+ SetBackground();
bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
if( bDark )
@@ -707,36 +707,39 @@ void BackingWindow::layoutButton(
void BackingWindow::Paint( const Rectangle& )
{
+ Wallpaper aBack( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+ Region aClip( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+ Rectangle aBmpRect(maControlRect);
+ aBmpRect.Left() -= nShadowLeft;
+ aBmpRect.Top() -= nShadowTop;
+ aBmpRect.Right() += nShadowRight;
+ aBmpRect.Bottom() += nShadowBottom;
+ aClip.Exclude( aBmpRect );
+ Push( PUSH_CLIPREGION );
+ IntersectClipRegion( aClip );
+ DrawWallpaper( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ), aBack );
+ Pop();
+
+ VirtualDevice aDev( *this );
+ aDev.EnableRTL( IsRTLEnabled() );
+ aDev.SetOutputSizePixel( aBmpRect.GetSize() );
+ Point aOffset( Point( 0, 0 ) - aBmpRect.TopLeft() );
+ aDev.DrawWallpaper( Rectangle( aOffset, GetOutputSizePixel() ), aBack );
// draw bitmap
- if( GetSettings().GetLayoutRTL() )
- {
- Point aTL( maControlRect.TopLeft() );
- aTL.X() -= nShadowRight;
- aTL.Y() -= nShadowTop;
- DrawBitmapEx( aTL, maBackgroundLeft );
- aTL.X() += maBackgroundLeft.GetSizePixel().Width();
- if( !!maBackgroundMiddle )
- {
- DrawBitmapEx( aTL, maBackgroundMiddle );
- aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
- }
- DrawBitmapEx( aTL, maBackgroundRight );
- }
- else
+ Point aTL( 0, 0 );
+ aDev.DrawBitmapEx( aTL, maBackgroundLeft );
+ aTL.X() += maBackgroundLeft.GetSizePixel().Width();
+ if( !!maBackgroundMiddle )
{
- Point aTL( maControlRect.TopLeft() );
- aTL.X() -= nShadowLeft;
- aTL.Y() -= nShadowTop;
- DrawBitmapEx( aTL, maBackgroundLeft );
- aTL.X() += maBackgroundLeft.GetSizePixel().Width();
- if( !!maBackgroundMiddle )
- {
- DrawBitmapEx( aTL, maBackgroundMiddle );
- aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
- }
- DrawBitmapEx( aTL, maBackgroundRight );
+ aDev.DrawBitmapEx( aTL, maBackgroundMiddle );
+ aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
}
+ aDev.DrawBitmapEx( aTL, maBackgroundRight );
+
+ DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
+ Point( 0, 0 ), aBmpRect.GetSize(),
+ aDev );
}
long BackingWindow::Notify( NotifyEvent& rNEvt )
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index fc47c6785f..ec3aab66c0 100755
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -80,13 +80,15 @@ class SfxPrinterController : public vcl::PrinterController, public SfxListener
sal_Bool m_bOrigStatus;
sal_Bool m_bNeedsChange;
sal_Bool m_bApi;
+ sal_Bool m_bTempPrinter;
util::DateTime m_aLastPrinted;
::rtl::OUString m_aLastPrintedBy;
Sequence< beans::PropertyValue > getMergedOptions() const;
const Any& getSelectionObject() const;
public:
- SfxPrinterController( const Any& i_rComplete,
+ SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter,
+ const Any& i_rComplete,
const Any& i_rSelection,
const Any& i_rViewProp,
const Reference< view::XRenderable >& i_xRender,
@@ -105,7 +107,8 @@ public:
virtual void jobFinished( com::sun::star::view::PrintableState );
};
-SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
+SfxPrinterController::SfxPrinterController( const boost::shared_ptr<Printer>& i_rPrinter,
+ const Any& i_rComplete,
const Any& i_rSelection,
const Any& i_rViewProp,
const Reference< view::XRenderable >& i_xRender,
@@ -113,7 +116,8 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
SfxViewShell* pView,
const uno::Sequence< beans::PropertyValue >& rProps
)
- : maCompleteSelection( i_rComplete )
+ : PrinterController( i_rPrinter)
+ , maCompleteSelection( i_rComplete )
, maSelection( i_rSelection )
, mxRenderable( i_xRender )
, mpLastPrinter( NULL )
@@ -122,6 +126,7 @@ SfxPrinterController::SfxPrinterController( const Any& i_rComplete,
, m_bOrigStatus( sal_False )
, m_bNeedsChange( sal_False )
, m_bApi(i_bApi)
+ , m_bTempPrinter( i_rPrinter.get() != NULL )
{
if ( mpViewShell )
{
@@ -339,7 +344,7 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
rBind.Invalidate( SID_PRINTDOC );
rBind.Invalidate( SID_PRINTDOCDIRECT );
rBind.Invalidate( SID_SETUPPRINTER );
- bCopyJobSetup = true;
+ bCopyJobSetup = ! m_bTempPrinter;
break;
}
@@ -349,7 +354,12 @@ void SfxPrinterController::jobFinished( com::sun::star::view::PrintableState nSt
if( bCopyJobSetup && mpViewShell )
{
- SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_False);
+ // #i114306#
+ // Note: this possibly creates a printer that gets immediately replaced
+ // by a new one. The reason for this is that otherwise we would not get
+ // the printer's SfxItemSet here to copy. Awkward, but at the moment there is no
+ // other way here to get the item set.
+ SfxPrinter* pDocPrt = mpViewShell->GetPrinter(sal_True);
if( pDocPrt )
{
if( pDocPrt->GetName() == getPrinter()->GetName() )
@@ -608,8 +618,23 @@ void SfxViewShell::ExecPrint( const uno::Sequence < beans::PropertyValue >& rPro
aSelection <<= GetObjectShell()->GetModel();
Any aComplete( makeAny( GetObjectShell()->GetModel() ) );
Any aViewProp( makeAny( xController ) );
+ boost::shared_ptr<Printer> aPrt;
- boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController( aComplete,
+ const beans::PropertyValue* pVal = rProps.getConstArray();
+ for( sal_Int32 i = 0; i < rProps.getLength(); i++ )
+ {
+ if( pVal[i].Name.equalsAscii( "PrinterName" ) )
+ {
+ rtl::OUString aPrinterName;
+ pVal[i].Value >>= aPrinterName;
+ aPrt.reset( new Printer( aPrinterName ) );
+ break;
+ }
+ }
+
+ boost::shared_ptr<vcl::PrinterController> pController( new SfxPrinterController(
+ aPrt,
+ aComplete,
aSelection,
aViewProp,
GetRenderable(),