[Libreoffice-commits] core.git: sw/source vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 29 19:26:15 UTC 2019


 sw/source/uibase/uno/unotxdoc.cxx |   26 --------------------------
 vcl/source/window/printdlg.cxx    |   13 +------------
 2 files changed, 1 insertion(+), 38 deletions(-)

New commits:
commit eaec995a96b41963ae9e5156b6c5c7ac022f9a55
Author:     Daniel <danielfaleirosilva at gmail.com>
AuthorDate: Wed Jan 16 18:51:47 2019 -0200
Commit:     Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Tue Jan 29 20:25:48 2019 +0100

    tdf#122079 - Document orientation is no longer changed in print dialog
    
    Change-Id: I9d13cfd136f9b70674b3e43268525f8a6e1c0954
    Reviewed-on: https://gerrit.libreoffice.org/66483
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>

diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index c2f7f93b1935..24e360a76f90 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -2387,25 +2387,6 @@ static bool lcl_GetBoolProperty(
     return bRes;
 }
 
-static sal_Int32 lcl_GetIntProperty(
-    const uno::Sequence< beans::PropertyValue >& rOptions,
-    const sal_Char *pPropName,
-    sal_Int32 nDefault )
-{
-    sal_Int32 nRes = nDefault;
-    const sal_Int32 nLen = rOptions.getLength();
-    const beans::PropertyValue *pProps = rOptions.getConstArray();
-    for ( sal_Int32 i = 0;  i < nLen;  ++i )
-    {
-        if ( pProps[i].Name.equalsAscii( pPropName ) )
-        {
-            pProps[i].Value >>= nRes;
-            break;
-        }
-    }
-    return nRes;
-}
-
 SfxViewShell * SwXTextDocument::GetRenderView(
     bool &rbIsSwSrcView,
     const uno::Sequence< beans::PropertyValue >& rOptions,
@@ -2599,13 +2580,6 @@ sal_Int32 SAL_CALL SwXTextDocument::getRendererCount(
         if (!pViewShell || !pViewShell->GetLayout())
             return 0;
 
-        // make sure document orientation matches printer paper orientation
-        sal_Int32 nLandscape = lcl_GetIntProperty( rxOptions, "IsLandscape", -1 );
-        if ( nLandscape == 1 )
-            pViewShell->ChgAllPageOrientation( Orientation::Landscape );
-        else if ( nLandscape == 0 )
-            pViewShell->ChgAllPageOrientation( Orientation::Portrait );
-
         if (bFormat)
         {
             // #i38289
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 73d7b5b9a50f..e4a285e84575 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1006,21 +1006,14 @@ void PrintDialog::preparePreview( bool i_bMayUseCache )
 
 void PrintDialog::updateOrientationBox( const bool bAutomatic )
 {
-    Orientation eOrientation = maPController->getPrinter()->GetOrientation();
     if ( !bAutomatic )
     {
+        Orientation eOrientation = maPController->getPrinter()->GetOrientation();
         mpOrientationBox->SelectEntryPos( static_cast<sal_Int32>(eOrientation) + 1 );
-
-        maPController->setValue( "IsLandscape",
-                                 makeAny( static_cast<sal_Int32>(eOrientation) ) );
     }
     else if ( hasOrientationChanged() )
     {
         mpOrientationBox->SelectEntryPos( ORIENTATION_AUTOMATIC );
-
-        // used to make sure document orientation matches printer paper orientation
-        maPController->setValue( "IsLandscape",
-                                 makeAny( static_cast<sal_Int32>(eOrientation) ) );
     }
 }
 
@@ -1061,10 +1054,6 @@ void PrintDialog::setPaperOrientation( Orientation eOrientation )
         Size& aPaperSize = maPController->getPaperSizeSetup();
         checkPaperSize( aPaperSize );
     }
-
-    // used to sync printer paper orientation with document orientation
-    maPController->setValue( "IsLandscape",
-                             makeAny( static_cast<sal_Int32>(eOrientation) ) );
 }
 
 void PrintDialog::checkControlDependencies()


More information about the Libreoffice-commits mailing list