Anonymous avatar Anonymous committed 881d031 Merge

CWS-TOOLING: integrate CWS vcl120

Comments (0)

Files changed (6)

framework/source/services/backingwindow.cxx

 
 void BackingWindow::initBackground()
 {
-    SetBackground( GetSettings().GetStyleSettings().GetWorkspaceGradient() );
+    SetBackground();
 
     bool bDark = GetSettings().GetStyleSettings().GetHighContrastMode();
     if( bDark )
 
 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( 0, 0 );
+    aDev.DrawBitmapEx( aTL, maBackgroundLeft );
+    aTL.X() += maBackgroundLeft.GetSizePixel().Width();
+    if( !!maBackgroundMiddle )
     {
-        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 );
+        aDev.DrawBitmapEx( aTL, maBackgroundMiddle );
+        aTL.X() += maBackgroundMiddle.GetSizePixel().Width();
     }
-    else
-    {
-        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, maBackgroundRight );
+    
+    DrawOutDev( aBmpRect.TopLeft(), aBmpRect.GetSize(),
+                Point( 0, 0 ), aBmpRect.GetSize(),
+                aDev );
 }
 
 long BackingWindow::Notify( NotifyEvent& rNEvt )

i18npool/source/paper/paper.cxx

 
 static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]);
 
-#define MAXSLOPPY 11
+#define MAXSLOPPY 21
 
 bool PaperInfo::doSloppyFit()
 {

sfx2/source/view/viewprn.cxx

 	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,
     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,
 										    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 )
 	, m_bOrigStatus( sal_False )
 	, m_bNeedsChange( sal_False )
 	, m_bApi(i_bApi)
+	, m_bTempPrinter( i_rPrinter.get() != NULL )
 {
 	if ( mpViewShell )
 	{
 				rBind.Invalidate( SID_PRINTDOC );
 				rBind.Invalidate( SID_PRINTDOCDIRECT );
 				rBind.Invalidate( SID_SETUPPRINTER );
-				bCopyJobSetup = true;
+				bCopyJobSetup = ! m_bTempPrinter;
 				break;
 			}
 
 		
 		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() )
         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(),

vcl/aqua/source/gdi/salprn.cxx

                 for( unsigned int i = 0; i < nPapers; i++ )
                 {
                     NSString* pPaper = [pPaperNames objectAtIndex: i];
-                    NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper];
-                    if( aPaperSize.width > 0 && aPaperSize.height > 0 )
+                    // first try to match the name
+                    rtl::OString aPaperName( [pPaper UTF8String] );
+                    Paper ePaper = PaperInfo::fromPSName( aPaperName );
+                    if( ePaper != PAPER_USER )
                     {
-                        PaperInfo aInfo( PtTo10Mu( aPaperSize.width ),
-                                         PtTo10Mu( aPaperSize.height ) );
-                        m_aPaperFormats.push_back( aInfo );
+                        m_aPaperFormats.push_back( PaperInfo( ePaper ) );
+                    }
+                    else
+                    {
+                        NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper];
+                        if( aPaperSize.width > 0 && aPaperSize.height > 0 )
+                        {
+                            PaperInfo aInfo( PtTo10Mu( aPaperSize.width ),
+                                             PtTo10Mu( aPaperSize.height ) );
+                            if( aInfo.getPaper() == PAPER_USER )
+                                aInfo.doSloppyFit();
+                            m_aPaperFormats.push_back( aInfo );
+                        }
                     }
                 }
             }

vcl/source/gdi/print3.cxx

     
     // setup printer
 
-    // if no specific printer is already set, create one
-    
-    // #i108686#
-    // in case of a UI (platform independent or system dialog) print job, make the printer persistent over jobs
-    // however if no printer was already set by the print job's originator,
-    // and this is an API job, then use the system default location (because
-    // this is the only sensible default available if the user has no means of changing
-    // the destination
+    // #i114306# changed behavior back from persistence
+    // if no specific printer is already set, create the default printer
     if( ! pController->getPrinter() )
     {
         rtl::OUString aPrinterName( i_rInitSetup.GetPrinterName() );
-        bool bSetJobSetup = true;
-        if( ! aPrinterName.getLength() && pController->isShowDialogs() && ! pController->isDirectPrint() )
-        {
-            // get printer name from configuration
-            SettingsConfigItem* pItem = SettingsConfigItem::get();
-            aPrinterName = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ),
-                                            rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPrinterUsed" ) ) );
-            bSetJobSetup = false;
-        }
-
         boost::shared_ptr<Printer> pPrinter( new Printer( aPrinterName ) );
-        if( bSetJobSetup )
-            pPrinter->SetJobSetup( i_rInitSetup );
+        pPrinter->SetJobSetup( i_rInitSetup );
         pController->setPrinter( pPrinter );
     }
     

vcl/source/window/printdlg.cxx

         maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() );
         // update text fields
         updatePrinterText();
+        preparePreview( true, false );
     }
     else if( pBox == &maNUpPage.maNupOrientationBox || pBox == &maNUpPage.maNupOrderBox )
     {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.