configure.ac                           |    2 -
 include/vcl/print.hxx                  |    3 +
 sd/source/ui/view/DocumentRenderer.cxx |   38 +++++++++++++++++----
 vcl/osx/salprn.cxx                     |    2 -
 vcl/source/gdi/print.cxx               |   58 ++++++++++++++++++++++++++++++---
 vcl/source/gdi/print3.cxx              |   14 ++++---
 vcl/unx/generic/print/genprnpsp.cxx    |    2 -
 7 files changed, 97 insertions(+), 22 deletions(-)

New commits:
commit 0cccd293f77a30d3a3d67dba7e5a947d325188be
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Wed Aug 5 09:36:24 2020 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Wed Aug 5 09:36:24 2020 +0200

    Release 6.2.9.10
    
    Change-Id: I2ec4f4afe063952377fed1e7d80243e0020a5ae1

diff --git a/configure.ac b/configure.ac
index bc90cea801a8..670d715e0601 100644
--- a/configure.ac
+++ b/configure.ac
@@ -9,7 +9,7 @@ dnl in order to create a configure script.
 # several non-alphanumeric characters, those are split off and used only for 
the
 # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no 
idea.
 
-AC_INIT([LibreOffice],[6.2.9.9],[],[],[http://documentfoundation.org/])
+AC_INIT([LibreOffice],[6.2.9.10],[],[],[http://documentfoundation.org/])
 
 AC_PREREQ([2.59])
 
commit c614f280683533fc7c1e10d4f960efd420751c66
Author:     Gabor Kelemen <kelemen.gab...@nisz.hu>
AuthorDate: Mon Jul 22 00:49:03 2019 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Wed Aug 5 09:25:10 2020 +0200

    tdf#39742 tdf#44786 Consider Impress/Draw default printing settings
    
    Default settings can be set under Options - APP - Print but
    Impress/Draw has not used these as defaults unlike other apps
    
    Change-Id: I7d430f8fb24f9626cd628b4fe9e0520d9d42b848
    Reviewed-on: https://gerrit.libreoffice.org/76079
    Tested-by: Jenkins
    Reviewed-by: László Németh <nem...@numbertext.org>
    (cherry picked from commit 844be49e7e511f0c397e1faebca10b4fa25ea937)

diff --git a/sd/source/ui/view/DocumentRenderer.cxx 
b/sd/source/ui/view/DocumentRenderer.cxx
index 09a227c0a854..e43c942bf70d 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -59,6 +59,9 @@
 #include <xmloff/autolayout.hxx>
 #include <sfx2/objsh.hxx>
 
+#include <officecfg/Office/Draw.hxx>
+#include <officecfg/Office/Impress.hxx>
+
 #include <memory>
 #include <vector>
 
@@ -442,7 +445,7 @@ namespace {
                                     
SdResId(STR_IMPRESS_PRINT_UI_IS_PRINT_NAME),
                                     
".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ,
                                     "IsPrintName" ,
-                                    false
+                                    
officecfg::Office::Impress::Print::Other::PageName::get()
                                     )
                                 );
             }
@@ -452,7 +455,7 @@ namespace {
                                     SdResId(STR_DRAW_PRINT_UI_IS_PRINT_NAME),
                                     
".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ,
                                     "IsPrintName" ,
-                                    false
+                                    
officecfg::Office::Draw::Print::Other::PageName::get()
                                     )
                                 );
             }
@@ -461,7 +464,12 @@ namespace {
                                 SdResId(STR_IMPRESS_PRINT_UI_IS_PRINT_DATE),
                                 
".HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox" ,
                                 "IsPrintDateTime" ,
-                                false
+                                // Separate settings for time and date in 
Impress/Draw -> Print page, check that both are set
+                                mbImpress ?
+                                
officecfg::Office::Impress::Print::Other::Date::get() &&
+                                
officecfg::Office::Impress::Print::Other::Time::get() :
+                                
officecfg::Office::Draw::Print::Other::Date::get() &&
+                                
officecfg::Office::Draw::Print::Other::Time::get()
                                 )
                             );
 
@@ -471,7 +479,7 @@ namespace {
                                     
SdResId(STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN),
                                     
".HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox" ,
                                     "IsPrintHidden" ,
-                                    false
+                                    
officecfg::Office::Impress::Print::Other::HiddenPage::get()
                                     )
                                 );
             }
@@ -493,7 +501,9 @@ namespace {
                                 aHelpIds,
                                 "Quality" ,
                                 
CreateChoice(STR_IMPRESS_PRINT_UI_QUALITY_CHOICES, 
SAL_N_ELEMENTS(STR_IMPRESS_PRINT_UI_QUALITY_CHOICES)),
-                                0)
+                                mbImpress ? 
officecfg::Office::Impress::Print::Other::Quality::get() :
+                                            
officecfg::Office::Draw::Print::Other::Quality::get() )
+
                             );
 
             AddDialogControl( 
vcl::PrinterOptionsHelper::setSubgroupControlOpt("pagesizes",
@@ -510,6 +520,19 @@ namespace {
             aWidgetIds[2] = "distributeonmultiple";
             aWidgetIds[3] = "tilesheet";
 
+            // Mutually exclusive page options settings are stored in separate 
config keys...
+            // TODO: There is no config key to set the distributeonmultiple 
option as default
+            sal_Int32 nDefaultChoice = 0;
+            if ( mbImpress ? 
officecfg::Office::Impress::Print::Page::PageSize::get() :
+                             
officecfg::Office::Draw::Print::Page::PageSize::get() )
+            {
+                nDefaultChoice = 1;
+            }
+            else if ( mbImpress ? 
officecfg::Office::Impress::Print::Page::PageTile::get() :
+                                  
officecfg::Office::Draw::Print::Page::PageTile::get() )
+            {
+                nDefaultChoice = 3;
+            }
             vcl::PrinterOptionsHelper::UIControlOptions 
aPageOptionsOpt("PrintProspect", 0);
             AddDialogControl( 
vcl::PrinterOptionsHelper::setChoiceRadiosControlOpt(
                                 aWidgetIds,
@@ -518,7 +541,7 @@ namespace {
                                 "PageOptions" ,
                                 mbImpress ? 
CreateChoice(STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES, 
SAL_N_ELEMENTS(STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES)) :
                                             
CreateChoice(STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW, 
SAL_N_ELEMENTS(STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW)),
-                                0,
+                                nDefaultChoice,
                                 Sequence< sal_Bool >(),
                                 aPageOptionsOpt
                                 )
@@ -535,7 +558,8 @@ namespace {
                                 SdResId(STR_IMPRESS_PRINT_UI_BROCHURE),
                                 
".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ,
                                 "PrintProspect" ,
-                                false,
+                                mbImpress ? 
officecfg::Office::Impress::Print::Page::Booklet::get() :
+                                            
officecfg::Office::Draw::Print::Page::Booklet::get(),
                                 aBrochureOpt
                                 )
                             );
commit 71b761a35dd7daaabebbe27438938a1feb27867b
Author:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
AuthorDate: Wed Aug 5 09:21:12 2020 +0200
Commit:     Samuel Mehrbrodt <samuel.mehrbr...@cib.de>
CommitDate: Wed Aug 5 09:25:10 2020 +0200

    Revert "tdf#134646 Remove "nearest paper matching" feature"
    
    This reverts commit 1864add19d0703bb9e4588961ee1cb3a1aa6e15c.

diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index cfb981bef073..631c38a5ab42 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -210,7 +210,7 @@ private:
                                 ImplGetQueueInfo( const OUString& 
rPrinterName, const OUString* pDriver );
     VCL_DLLPRIVATE void         ImplUpdatePageData();
     VCL_DLLPRIVATE void         ImplUpdateFontList();
-    VCL_DLLPRIVATE void         ImplFindPaperFormatForUserSize( JobSetup& );
+    VCL_DLLPRIVATE void         ImplFindPaperFormatForUserSize( JobSetup&, 
bool bMatchNearest );
 
     VCL_DLLPRIVATE bool         StartJob( const OUString& rJobName, 
std::shared_ptr<vcl::PrinterController> const & );
 
@@ -310,6 +310,7 @@ public:
     sal_uInt16                  GetPaperBin() const;
     void                        SetPaper( Paper ePaper );
     bool                        SetPaperSizeUser( const Size& rSize );
+    bool                        SetPaperSizeUser( const Size& rSize, bool 
bMatchNearest );
     Paper                       GetPaper() const;
     static OUString             GetPaperName( Paper ePaper );
 
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 1cbb72e9baad..08f696345aa2 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -447,7 +447,7 @@ bool AquaSalInfoPrinter::StartJob( const OUString* 
i_pFileName,
             // platform independent paper matching algorithm
             VclPtr<Printer> pPrinter( i_rController.getPrinter() );
             pPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
-            pPrinter->SetPaperSizeUser( aCurSize );
+            pPrinter->SetPaperSizeUser( aCurSize, true );
 
             // create view
             NSView* pPrintView = [[AquaPrintView alloc] initWithController: 
&i_rController withInfoPrinter: this];
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index 38a985807dfe..3e9ce5d64b9c 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1220,13 +1220,16 @@ void Printer::SetPrinterSettingsPreferred( bool 
bPaperSizeFromSetup)
 }
 
 // Map user paper format to a available printer paper formats
-void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup )
+void Printer::ImplFindPaperFormatForUserSize( JobSetup& aJobSetup, bool 
bMatchNearest )
 {
     ImplJobSetup& rData = aJobSetup.ImplGetData();
 
     // The angle that a landscape page will be turned counterclockwise wrt to 
portrait.
     int     nLandscapeAngle = mpInfoPrinter ? 
mpInfoPrinter->GetLandscapeAngle( &maJobSetup.ImplGetConstData() ) : 900;
+
     int     nPaperCount     = GetPaperInfoCount();
+    bool    bFound = false;
+
     PaperInfo aInfo(rData.GetPaperWidth(), rData.GetPaperHeight());
 
     // Compare all paper formats and get the appropriate one
@@ -1240,7 +1243,8 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& 
aJobSetup )
                 ImplGetPaperFormat( rPaperInfo.getWidth(),
                     rPaperInfo.getHeight() ));
             rData.SetOrientation( Orientation::Portrait );
-            return;
+            bFound = true;
+            break;
         }
     }
 
@@ -1265,10 +1269,49 @@ void Printer::ImplFindPaperFormatForUserSize( JobSetup& 
aJobSetup )
                     ImplGetPaperFormat( rPaperInfo.getWidth(),
                         rPaperInfo.getHeight() ));
                 rData.SetOrientation( Orientation::Landscape );
-                return;
+                bFound = true;
+                break;
             }
         }
     }
+
+    if( ! bFound && bMatchNearest )
+    {
+         sal_Int64 nBestMatch = SAL_MAX_INT64;
+         int nBestIndex = 0;
+         Orientation eBestOrientation = Orientation::Portrait;
+         for( int i = 0; i < nPaperCount; i++ )
+         {
+             const PaperInfo& rPaperInfo = GetPaperInfo( i );
+
+             // check portrait match
+             sal_Int64 nDX = rData.GetPaperWidth() - rPaperInfo.getWidth();
+             sal_Int64 nDY = rData.GetPaperHeight() - rPaperInfo.getHeight();
+             sal_Int64 nMatch = nDX*nDX + nDY*nDY;
+             if( nMatch < nBestMatch )
+             {
+                 nBestMatch = nMatch;
+                 nBestIndex = i;
+                 eBestOrientation = Orientation::Portrait;
+             }
+
+             // check landscape match
+             nDX = rData.GetPaperWidth() - rPaperInfo.getHeight();
+             nDY = rData.GetPaperHeight() - rPaperInfo.getWidth();
+             nMatch = nDX*nDX + nDY*nDY;
+             if( nMatch < nBestMatch )
+             {
+                 nBestMatch = nMatch;
+                 nBestIndex = i;
+                 eBestOrientation = Orientation::Landscape;
+             }
+         }
+         const PaperInfo& rBestInfo = GetPaperInfo( nBestIndex );
+         rData.SetPaperFormat(
+            ImplGetPaperFormat( rBestInfo.getWidth(),
+                rBestInfo.getHeight() ));
+         rData.SetOrientation(eBestOrientation);
+    }
 }
 
 void Printer::SetPaper( Paper ePaper )
@@ -1298,7 +1341,7 @@ void Printer::SetPaper( Paper ePaper )
 
         ReleaseGraphics();
         if ( ePaper == PAPER_USER )
-            ImplFindPaperFormatForUserSize( aJobSetup );
+            ImplFindPaperFormatForUserSize( aJobSetup, false );
         if ( mpInfoPrinter->SetData( JobSetFlags::PAPERSIZE | 
JobSetFlags::ORIENTATION, &rData ))
         {
             ImplUpdateJobSetupPaper( aJobSetup );
@@ -1311,6 +1354,11 @@ void Printer::SetPaper( Paper ePaper )
 }
 
 bool Printer::SetPaperSizeUser( const Size& rSize )
+{
+    return SetPaperSizeUser( rSize, false );
+}
+
+bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
 {
     if ( mbInPrintPage )
         return false;
@@ -1349,7 +1397,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize )
         }
 
         ReleaseGraphics();
-        ImplFindPaperFormatForUserSize( aJobSetup );
+        ImplFindPaperFormatForUserSize( aJobSetup, bMatchNearest );
 
         // Changing the paper size can also change the orientation!
         if ( mpInfoPrinter->SetData( JobSetFlags::PAPERSIZE | 
JobSetFlags::ORIENTATION, &rData ))
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index dbcd3d5b581a..ab7cef6d6d75 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -203,6 +203,8 @@ public:
             return maMultiPage.aPaperSize;
         return i_rPageSize;
     }
+    bool isFixedPageSize() const
+    { return mbPapersizeFromSetup; }
     PrinterController::PageSize modifyJobSetup( const css::uno::Sequence< 
css::beans::PropertyValue >& i_rProps );
     void resetPaperToLastConfigured();
 };
@@ -854,7 +856,7 @@ void PrinterController::setupPrinter( weld::Window* 
i_pParent )
         {
             //restore to whatever it was before we entered this method
             if (aPaperSize != aNewPaperSize)
-                xPrinter->SetPaperSizeUser(aPaperSize);
+                xPrinter->SetPaperSizeUser(aPaperSize, 
!mpImplData->isFixedPageSize());
         }
         xPrinter->Pop();
     }
@@ -907,7 +909,7 @@ PrinterController::PageSize 
vcl::ImplPrinterControllerData::modifyJobSetup( cons
 
         Size aRealPaperSize( getRealPaperSize( aPageSize.aSize, true/*bNoNUP*/ 
) );
         if( aRealPaperSize != aCurSize )
-            mxPrinter->SetPaperSizeUser( aRealPaperSize );
+            mxPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
     }
 
     // paper bin set from properties in print dialog overrides
@@ -936,7 +938,7 @@ void 
vcl::ImplPrinterControllerData::resetPaperToLastConfigured()
     mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
     Size aCurSize(mxPrinter->GetPaperSize());
     if (aCurSize != maDefaultPageSize)
-        mxPrinter->SetPaperSizeUser(maDefaultPageSize);
+        mxPrinter->SetPaperSizeUser(maDefaultPageSize, !isFixedPageSize());
     mxPrinter->Pop();
 }
 
@@ -1083,7 +1085,7 @@ PrinterController::PageSize 
PrinterController::getFilteredPageFile( int i_nFilte
         }
         Size aPaperSize = mpImplData->getRealPaperSize( aPageSize.aSize, true 
);
         mpImplData->mxPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
-        mpImplData->mxPrinter->SetPaperSizeUser( aPaperSize );
+        mpImplData->mxPrinter->SetPaperSizeUser( aPaperSize, ! 
mpImplData->isFixedPageSize() );
         if( aPaperSize != aPageSize.aSize )
         {
             // user overridden page size, center Metafile
@@ -1193,7 +1195,7 @@ PrinterController::PageSize 
PrinterController::getFilteredPageFile( int i_nFilte
 
     // subsequent getPageFile calls have changed the paper, reset it to 
current value
     mpImplData->mxPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
-    mpImplData->mxPrinter->SetPaperSizeUser( aPaperSize );
+    mpImplData->mxPrinter->SetPaperSizeUser( aPaperSize, ! 
mpImplData->isFixedPageSize() );
 
     return PrinterController::PageSize( aPaperSize, true );
 }
@@ -1289,7 +1291,7 @@ void PrinterController::printFilteredPage( int i_nPage )
     // in N-Up printing set the correct page size
     mpImplData->mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
     // aPageSize was filtered through mpImplData->getRealPaperSize already by 
getFilteredPageFile()
-    mpImplData->mxPrinter->SetPaperSizeUser( aPageSize.aSize );
+    mpImplData->mxPrinter->SetPaperSizeUser( aPageSize.aSize, ! 
mpImplData->isFixedPageSize() );
     if( mpImplData->mnFixedPaperBin != -1 &&
         mpImplData->mxPrinter->GetPaperBin() != mpImplData->mnFixedPaperBin )
     {
diff --git a/vcl/unx/generic/print/genprnpsp.cxx 
b/vcl/unx/generic/print/genprnpsp.cxx
index 350128ef3372..376da8fcf51f 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -1059,7 +1059,7 @@ bool PspSalPrinter::StartJob( const OUString* 
i_pFileName, const OUString& i_rJo
         else
         {
             xPrinter->SetMapMode( MapMode( MapUnit::Map100thMM ) );
-            xPrinter->SetPaperSizeUser( aPageSize.aSize );
+            xPrinter->SetPaperSizeUser( aPageSize.aSize, true );
             PDFNewJobParameters aNewParm(xPrinter->GetPaperSize(), 
xPrinter->GetPaperBin());
 
             // create PDF writer on demand
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to