LCOV - code coverage report
Current view: top level - sfx2/source/dialog - printopt.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 242 0.0 %
Date: 2012-08-25 Functions: 0 26 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 574 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*
       3                 :            :  * This file is part of the LibreOffice project.
       4                 :            :  *
       5                 :            :  * This Source Code Form is subject to the terms of the Mozilla Public
       6                 :            :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7                 :            :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8                 :            :  *
       9                 :            :  * This file incorporates work covered by the following license notice:
      10                 :            :  *
      11                 :            :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12                 :            :  *   contributor license agreements. See the NOTICE file distributed
      13                 :            :  *   with this work for additional information regarding copyright
      14                 :            :  *   ownership. The ASF licenses this file to you under the Apache
      15                 :            :  *   License, Version 2.0 (the "License"); you may not use this file
      16                 :            :  *   except in compliance with the License. You may obtain a copy of
      17                 :            :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18                 :            :  */
      19                 :            : 
      20                 :            : 
      21                 :            : #include <sal/macros.h>
      22                 :            : #include <vcl/msgbox.hxx>
      23                 :            : #include <unotools/printwarningoptions.hxx>
      24                 :            : #include <svtools/printoptions.hxx>
      25                 :            : #include <svl/flagitem.hxx>
      26                 :            : 
      27                 :            : 
      28                 :            : #include "printopt.hrc"
      29                 :            : #include "dialog.hrc"
      30                 :            : #include "sfx2/sfxresid.hxx"
      31                 :            : #include <sfx2/viewsh.hxx>
      32                 :            : #include <sfx2/printopt.hxx>
      33                 :            : 
      34                 :            : static sal_uInt16   aDPIArray[] = { 72, 96, 150, 200, 300, 600 };
      35                 :            : static sal_Bool     bOutputForPrinter = sal_True;
      36                 :            : 
      37                 :            : #define DPI_COUNT (sizeof(aDPIArray)/sizeof(aDPIArray[0 ]))
      38                 :            : 
      39                 :          0 : SfxCommonPrintOptionsTabPage::SfxCommonPrintOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
      40                 :            :     SfxTabPage( pParent, SfxResId( TP_COMMONPRINTOPTIONS ), rSet ),
      41                 :            : 
      42                 :            :     aReduceGB( this, SfxResId( GB_REDUCE ) ),
      43                 :            :     aOutputTypeFT( this, SfxResId( FT_OUTPUTTYPE ) ),
      44                 :            :     aPrinterOutputRB( this, SfxResId( RB_PRINTEROUTPUT ) ),
      45                 :            :     aPrintFileOutputRB( this, SfxResId( RB_PRINTFILEOUTPUT ) ),
      46                 :            :     aOutputGB( this, SfxResId( GB_OUTPUT ) ),
      47                 :            :     aReduceTransparencyCB( this, SfxResId( CB_REDUCETRANSPARENCY ) ),
      48                 :            :     aReduceTransparencyAutoRB( this, SfxResId( RB_REDUCETRANSPARENCY_AUTO ) ),
      49                 :            :     aReduceTransparencyNoneRB( this, SfxResId( RB_REDUCETRANSPARENCY_NONE ) ),
      50                 :            :     aReduceGradientsCB( this, SfxResId( CB_REDUCEGRADIENTS ) ),
      51                 :            :     aReduceGradientsStripesRB( this, SfxResId( RB_REDUCEGRADIENTS_STRIPES ) ),
      52                 :            :     aReduceGradientsColorRB( this, SfxResId( RB_REDUCEGRADIENTS_COLOR ) ),
      53                 :            :     aReduceGradientsStepCountNF( this, SfxResId( NF_REDUCEGRADIENTS_STEPCOUNT ) ),
      54                 :            :     aReduceBitmapsCB( this, SfxResId( CB_REDUCEBITMAPS ) ),
      55                 :            :     aReduceBitmapsOptimalRB( this, SfxResId( RB_REDUCEBITMAPS_OPTIMAL ) ),
      56                 :            :     aReduceBitmapsNormalRB( this, SfxResId( RB_REDUCEBITMAPS_NORMAL ) ),
      57                 :            :     aReduceBitmapsResolutionRB( this, SfxResId( RB_REDUCEBITMAPS_RESOLUTION ) ),
      58                 :            :     aReduceBitmapsResolutionLB( this, SfxResId( LB_REDUCEBITMAPS_RESOLUTION ) ),
      59                 :            :     aReduceBitmapsTransparencyCB( this, SfxResId( CB_REDUCEBITMAPS_TRANSPARENCY ) ),
      60                 :            :     aConvertToGreyscalesCB( this, SfxResId( CB_CONVERTTOGREYSCALES ) ),
      61                 :            :     aWarnGB( this, SfxResId( GB_PRINT_WARN ) ),
      62                 :            :     aPaperSizeCB( this, SfxResId( CB_PAPERSIZE ) ),
      63                 :            :     aPaperOrientationCB( this, SfxResId( CB_PAPERORIENTATION ) ),
      64 [ #  # ][ #  # ]:          0 :     aTransparencyCB( this, SfxResId( CB_TRANSPARENCY ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
      65                 :            : {
      66         [ #  # ]:          0 :     FreeResource();
      67                 :            : 
      68 [ #  # ][ #  # ]:          0 :     aOutputGB.SetStyle( aOutputGB.GetStyle() | WB_NOLABEL );
      69                 :            : 
      70         [ #  # ]:          0 :     if( bOutputForPrinter )
      71                 :            :     {
      72         [ #  # ]:          0 :         aPrinterOutputRB.Check( sal_True );
      73 [ #  # ][ #  # ]:          0 :         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrinterOutputRB.GetText() ) );
         [ #  # ][ #  # ]
                 [ #  # ]
      74                 :            :     }
      75                 :            :     else
      76                 :            :     {
      77         [ #  # ]:          0 :         aPrintFileOutputRB.Check( sal_True );
      78 [ #  # ][ #  # ]:          0 :         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( aPrintFileOutputRB.GetText() ) );
         [ #  # ][ #  # ]
                 [ #  # ]
      79                 :            :     }
      80                 :            : 
      81         [ #  # ]:          0 :     aPrinterOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl ) );
      82         [ #  # ]:          0 :     aPrintFileOutputRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl ) );
      83                 :            : 
      84         [ #  # ]:          0 :     aReduceTransparencyCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl ) );
      85         [ #  # ]:          0 :     aReduceGradientsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl ) );
      86         [ #  # ]:          0 :     aReduceBitmapsCB.SetClickHdl( LINK( this, SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl ) );
      87                 :            : 
      88         [ #  # ]:          0 :     aReduceGradientsStripesRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl ) );
      89         [ #  # ]:          0 :     aReduceBitmapsResolutionRB.SetToggleHdl( LINK( this, SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl ) );
      90                 :            : 
      91                 :            :     // #i89164# calculate dynamically the width of radiobutton and listbox
      92                 :          0 :     const long nOffset = 10;
      93         [ #  # ]:          0 :     Size aOldSize = aReduceBitmapsResolutionRB.GetSizePixel();
      94         [ #  # ]:          0 :     Size aNewSize = aReduceBitmapsResolutionRB.GetOptimalSize( WINDOWSIZE_PREFERRED );
      95                 :          0 :     aNewSize.Width() += nOffset;
      96                 :          0 :     aNewSize.Height() = aOldSize.Height();
      97                 :          0 :     long nDelta = aOldSize.Width() - aNewSize.Width();
      98         [ #  # ]:          0 :     aReduceBitmapsResolutionRB.SetSizePixel( aNewSize );
      99         [ #  # ]:          0 :     Point aPos = aReduceBitmapsResolutionLB.GetPosPixel();
     100                 :          0 :     aPos.X() -= nDelta;
     101         [ #  # ]:          0 :     aOldSize = aReduceBitmapsResolutionLB.GetSizePixel();
     102         [ #  # ]:          0 :     aNewSize = aReduceBitmapsResolutionLB.GetOptimalSize( WINDOWSIZE_PREFERRED );
     103                 :          0 :     aNewSize.Width() += nOffset;
     104                 :          0 :     aNewSize.Height() = aOldSize.Height();
     105         [ #  # ]:          0 :     aReduceBitmapsResolutionLB.SetPosSizePixel( aPos, aNewSize );
     106                 :          0 : }
     107                 :            : 
     108 [ #  # ][ #  # ]:          0 : SfxCommonPrintOptionsTabPage::~SfxCommonPrintOptionsTabPage()
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     109                 :            : {
     110         [ #  # ]:          0 : }
     111                 :            : 
     112                 :          0 : SfxTabPage* SfxCommonPrintOptionsTabPage::Create( Window* pParent, const SfxItemSet& rAttrSet )
     113                 :            : {
     114         [ #  # ]:          0 :     return( new SfxCommonPrintOptionsTabPage( pParent, rAttrSet ) );
     115                 :            : }
     116                 :            : 
     117                 :          0 : Window* SfxCommonPrintOptionsTabPage::GetParentLabeledBy( const Window* pWindow ) const
     118                 :            : {
     119         [ #  # ]:          0 :     if ( pWindow == (Window *)&aReduceGradientsStepCountNF )
     120                 :          0 :         return (Window *)&aReduceGradientsStripesRB;
     121         [ #  # ]:          0 :     else if ( pWindow == (Window *)&aReduceBitmapsResolutionLB )
     122                 :          0 :         return (Window *)&aReduceBitmapsResolutionRB;
     123                 :            :     else
     124                 :          0 :         return SfxTabPage::GetParentLabeledBy( pWindow );
     125                 :            : }
     126                 :            : 
     127                 :          0 : Window* SfxCommonPrintOptionsTabPage::GetParentLabelFor( const Window* pWindow ) const
     128                 :            : {
     129         [ #  # ]:          0 :     if ( pWindow == (Window *)&aReduceGradientsStripesRB )
     130                 :          0 :         return (Window *)&aReduceGradientsStepCountNF;
     131         [ #  # ]:          0 :     else if ( pWindow == (Window *)&aReduceBitmapsResolutionRB )
     132                 :          0 :         return (Window *)&aReduceBitmapsResolutionLB;
     133                 :            :     else
     134                 :          0 :         return SfxTabPage::GetParentLabelFor( pWindow );
     135                 :            : }
     136                 :            : 
     137                 :          0 : sal_Bool SfxCommonPrintOptionsTabPage::FillItemSet( SfxItemSet& /*rSet*/ )
     138                 :            : {
     139         [ #  # ]:          0 :     SvtPrintWarningOptions  aWarnOptions;
     140         [ #  # ]:          0 :     SvtPrinterOptions       aPrinterOptions;
     141         [ #  # ]:          0 :     SvtPrintFileOptions     aPrintFileOptions;
     142                 :          0 :     sal_Bool                    bModified = sal_False;
     143                 :            : 
     144                 :            : 
     145 [ #  # ][ #  # ]:          0 :     if( aPaperSizeCB.IsChecked() != aPaperSizeCB.GetSavedValue())
     146 [ #  # ][ #  # ]:          0 :         aWarnOptions.SetPaperSize(aPaperSizeCB.IsChecked());
     147 [ #  # ][ #  # ]:          0 :     if( aPaperOrientationCB.IsChecked() != aPaperOrientationCB.GetSavedValue() )
     148 [ #  # ][ #  # ]:          0 :         aWarnOptions.SetPaperOrientation(aPaperOrientationCB.IsChecked());
     149                 :            : 
     150 [ #  # ][ #  # ]:          0 :     if( aTransparencyCB.IsChecked() != aTransparencyCB.GetSavedValue() )
     151 [ #  # ][ #  # ]:          0 :         aWarnOptions.SetTransparency( aTransparencyCB.IsChecked() );
     152                 :            : 
     153 [ #  # ][ #  # ]:          0 :     ImplSaveControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
     154                 :            : 
     155         [ #  # ]:          0 :     aPrinterOptions.SetPrinterOptions( maPrinterOptions );
     156         [ #  # ]:          0 :     aPrintFileOptions.SetPrinterOptions( maPrintFileOptions );
     157                 :            : 
     158 [ #  # ][ #  # ]:          0 :     return bModified;
                 [ #  # ]
     159                 :            : }
     160                 :            : 
     161                 :          0 : void SfxCommonPrintOptionsTabPage::Reset( const SfxItemSet& /*rSet*/ )
     162                 :            : {
     163         [ #  # ]:          0 :     SvtPrintWarningOptions  aWarnOptions;
     164         [ #  # ]:          0 :     SvtPrinterOptions       aPrinterOptions;
     165         [ #  # ]:          0 :     SvtPrintFileOptions     aPrintFileOptions;
     166                 :            : 
     167 [ #  # ][ #  # ]:          0 :     aPaperSizeCB.Check( aWarnOptions.IsPaperSize() );
     168 [ #  # ][ #  # ]:          0 :     aPaperOrientationCB.Check( aWarnOptions.IsPaperOrientation() );
     169                 :            : 
     170 [ #  # ][ #  # ]:          0 :     aTransparencyCB.Check( aWarnOptions.IsTransparency() );
     171                 :            : 
     172                 :          0 :     aPaperSizeCB.SaveValue();
     173                 :          0 :     aPaperOrientationCB.SaveValue();
     174                 :          0 :     aTransparencyCB.SaveValue();
     175                 :            : 
     176         [ #  # ]:          0 :     aPrinterOptions.GetPrinterOptions( maPrinterOptions );
     177         [ #  # ]:          0 :     aPrintFileOptions.GetPrinterOptions( maPrintFileOptions );
     178                 :            : 
     179 [ #  # ][ #  # ]:          0 :     ImplUpdateControls( aPrinterOutputRB.IsChecked() ? &maPrinterOptions : &maPrintFileOptions );
     180                 :            : 
     181                 :            :     // #i63982#
     182 [ #  # ][ #  # ]:          0 :     ImplSetAccessibleNames();
         [ #  # ][ #  # ]
     183                 :          0 : }
     184                 :            : 
     185                 :          0 : int SfxCommonPrintOptionsTabPage::DeactivatePage( SfxItemSet* pItemSet )
     186                 :            : {
     187         [ #  # ]:          0 :     if( pItemSet )
     188                 :          0 :         FillItemSet( *pItemSet );
     189                 :            : 
     190                 :          0 :     return LEAVE_PAGE;
     191                 :            : }
     192                 :            : 
     193                 :          0 : void SfxCommonPrintOptionsTabPage::ImplUpdateControls( const PrinterOptions* pCurrentOptions )
     194                 :            : {
     195                 :          0 :     aReduceTransparencyCB.Check( pCurrentOptions->IsReduceTransparency() );
     196                 :            : 
     197         [ #  # ]:          0 :     if( pCurrentOptions->GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO )
     198                 :          0 :         aReduceTransparencyAutoRB.Check( sal_True );
     199                 :            :     else
     200                 :          0 :         aReduceTransparencyNoneRB.Check( sal_True );
     201                 :            : 
     202                 :          0 :     aReduceGradientsCB.Check( pCurrentOptions->IsReduceGradients() );
     203                 :            : 
     204         [ #  # ]:          0 :     if( pCurrentOptions->GetReducedGradientMode() == PRINTER_GRADIENT_STRIPES )
     205                 :          0 :         aReduceGradientsStripesRB.Check( sal_True );
     206                 :            :     else
     207                 :          0 :         aReduceGradientsColorRB.Check( sal_True );
     208                 :            : 
     209                 :          0 :     aReduceGradientsStepCountNF.SetValue( pCurrentOptions->GetReducedGradientStepCount() );
     210                 :            : 
     211                 :          0 :     aReduceBitmapsCB.Check( pCurrentOptions->IsReduceBitmaps() );
     212                 :            : 
     213         [ #  # ]:          0 :     if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_OPTIMAL )
     214                 :          0 :         aReduceBitmapsOptimalRB.Check( sal_True );
     215         [ #  # ]:          0 :     else if( pCurrentOptions->GetReducedBitmapMode() == PRINTER_BITMAP_NORMAL )
     216                 :          0 :         aReduceBitmapsNormalRB.Check( sal_True );
     217                 :            :     else
     218                 :          0 :         aReduceBitmapsResolutionRB.Check( sal_True );
     219                 :            : 
     220                 :          0 :     const sal_uInt16 nDPI = pCurrentOptions->GetReducedBitmapResolution();
     221                 :            : 
     222         [ #  # ]:          0 :     if( nDPI < aDPIArray[ 0 ] )
     223                 :          0 :         aReduceBitmapsResolutionLB.SelectEntryPos( 0 );
     224                 :            :     else
     225                 :            :     {
     226         [ #  # ]:          0 :         for( long i = ( DPI_COUNT - 1 ); i >= 0; i-- )
     227                 :            :         {
     228         [ #  # ]:          0 :             if( nDPI >= aDPIArray[ i ] )
     229                 :            :             {
     230                 :          0 :                 aReduceBitmapsResolutionLB.SelectEntryPos( (sal_uInt16) i );
     231                 :          0 :                 i = -1;
     232                 :            :             }
     233                 :            :         }
     234                 :            :     }
     235                 :            : 
     236         [ #  # ]:          0 :     aReduceBitmapsResolutionLB.SetText( aReduceBitmapsResolutionLB.GetEntry( aReduceBitmapsResolutionLB.GetSelectEntryPos() ) );
     237                 :            : 
     238                 :          0 :     aReduceBitmapsTransparencyCB.Check( pCurrentOptions->IsReducedBitmapIncludesTransparency() );
     239                 :          0 :     aConvertToGreyscalesCB.Check( pCurrentOptions->IsConvertToGreyscales() );
     240                 :            : 
     241                 :          0 :     ClickReduceTransparencyCBHdl( &aReduceTransparencyCB );
     242                 :          0 :     ClickReduceGradientsCBHdl( &aReduceGradientsCB );
     243                 :          0 :     ClickReduceBitmapsCBHdl( &aReduceBitmapsCB );
     244                 :          0 : }
     245                 :            : 
     246                 :          0 : void SfxCommonPrintOptionsTabPage::ImplSetAccessibleNames()
     247                 :            : {
     248                 :          0 :     const rtl::OUString cSeparator(" - ");
     249                 :            : 
     250         [ #  # ]:          0 :     String sReduceText = aReduceGB.GetDisplayText();
     251         [ #  # ]:          0 :     sReduceText += cSeparator;
     252                 :            : 
     253         [ #  # ]:          0 :     String sAccessibleName = sReduceText;
     254 [ #  # ][ #  # ]:          0 :     sAccessibleName += aPrinterOutputRB.GetDisplayText();
                 [ #  # ]
     255         [ #  # ]:          0 :     aPrinterOutputRB.SetAccessibleName( sAccessibleName );
     256                 :            : 
     257         [ #  # ]:          0 :     sAccessibleName = sReduceText;
     258 [ #  # ][ #  # ]:          0 :     sAccessibleName += aPrintFileOutputRB.GetDisplayText();
                 [ #  # ]
     259         [ #  # ]:          0 :     aPrintFileOutputRB.SetAccessibleName( sAccessibleName );
     260                 :            : 
     261         [ #  # ]:          0 :     String sOutputText = sReduceText;
     262 [ #  # ][ #  # ]:          0 :     sOutputText += aOutputGB.GetDisplayText();
                 [ #  # ]
     263         [ #  # ]:          0 :     sOutputText += cSeparator;
     264                 :            : 
     265         [ #  # ]:          0 :     sAccessibleName = sOutputText;
     266 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceTransparencyCB.GetDisplayText();
                 [ #  # ]
     267         [ #  # ]:          0 :     aReduceTransparencyCB.SetAccessibleName( sAccessibleName );
     268                 :            : 
     269         [ #  # ]:          0 :     String sTransparencyText = aReduceTransparencyCB.GetAccessibleName();
     270         [ #  # ]:          0 :     sTransparencyText += cSeparator;
     271                 :            : 
     272         [ #  # ]:          0 :     sAccessibleName = sTransparencyText;
     273 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceTransparencyAutoRB.GetDisplayText();
                 [ #  # ]
     274         [ #  # ]:          0 :     aReduceTransparencyAutoRB.SetAccessibleName( sAccessibleName );
     275                 :            : 
     276         [ #  # ]:          0 :     sAccessibleName = sTransparencyText;
     277 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceTransparencyNoneRB.GetDisplayText();
                 [ #  # ]
     278         [ #  # ]:          0 :     aReduceTransparencyNoneRB.SetAccessibleName( sAccessibleName );
     279                 :            : 
     280         [ #  # ]:          0 :     sAccessibleName = sOutputText;
     281 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceGradientsCB.GetDisplayText();
                 [ #  # ]
     282         [ #  # ]:          0 :     aReduceGradientsCB.SetAccessibleName( sAccessibleName );
     283                 :            : 
     284         [ #  # ]:          0 :     String sGradientText = aReduceGradientsCB.GetAccessibleName();
     285         [ #  # ]:          0 :     sGradientText += cSeparator;
     286                 :            : 
     287         [ #  # ]:          0 :     sAccessibleName = sGradientText;
     288 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceGradientsStripesRB.GetDisplayText();
                 [ #  # ]
     289         [ #  # ]:          0 :     aReduceGradientsStripesRB.SetAccessibleName( sAccessibleName );
     290                 :            : 
     291 [ #  # ][ #  # ]:          0 :     sAccessibleName = aReduceGradientsStripesRB.GetAccessibleName();
                 [ #  # ]
     292         [ #  # ]:          0 :     aReduceGradientsStepCountNF.SetAccessibleName( sAccessibleName );
     293                 :            : 
     294         [ #  # ]:          0 :     sAccessibleName = sGradientText;
     295 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceGradientsColorRB.GetDisplayText();
                 [ #  # ]
     296         [ #  # ]:          0 :     aReduceGradientsColorRB.SetAccessibleName( sAccessibleName );
     297                 :            : 
     298         [ #  # ]:          0 :     sAccessibleName = sOutputText;
     299 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceBitmapsCB.GetDisplayText();
                 [ #  # ]
     300         [ #  # ]:          0 :     aReduceBitmapsCB.SetAccessibleName( sAccessibleName );
     301                 :            : 
     302         [ #  # ]:          0 :     String sBitmapText = aReduceBitmapsCB.GetAccessibleName();
     303         [ #  # ]:          0 :     sBitmapText += cSeparator;
     304                 :            : 
     305         [ #  # ]:          0 :     sAccessibleName = sBitmapText;
     306 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceBitmapsOptimalRB.GetDisplayText();
                 [ #  # ]
     307         [ #  # ]:          0 :     aReduceBitmapsOptimalRB.SetAccessibleName( sAccessibleName );
     308                 :            : 
     309         [ #  # ]:          0 :     sAccessibleName = sBitmapText;
     310 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceBitmapsNormalRB.GetDisplayText();
                 [ #  # ]
     311         [ #  # ]:          0 :     aReduceBitmapsNormalRB.SetAccessibleName( sAccessibleName );
     312                 :            : 
     313         [ #  # ]:          0 :     sAccessibleName = sBitmapText;
     314 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceBitmapsResolutionRB.GetDisplayText();
                 [ #  # ]
     315         [ #  # ]:          0 :     aReduceBitmapsResolutionRB.SetAccessibleName( sAccessibleName );
     316                 :            : 
     317 [ #  # ][ #  # ]:          0 :     sAccessibleName = aReduceBitmapsResolutionRB.GetAccessibleName();
                 [ #  # ]
     318         [ #  # ]:          0 :     aReduceBitmapsResolutionLB.SetAccessibleName( sAccessibleName );
     319                 :            : 
     320         [ #  # ]:          0 :     sAccessibleName = sBitmapText;
     321 [ #  # ][ #  # ]:          0 :     sAccessibleName += aReduceBitmapsTransparencyCB.GetDisplayText();
                 [ #  # ]
     322         [ #  # ]:          0 :     aReduceBitmapsTransparencyCB.SetAccessibleName( sAccessibleName );
     323                 :            : 
     324         [ #  # ]:          0 :     sAccessibleName = sOutputText;
     325 [ #  # ][ #  # ]:          0 :     sAccessibleName += aConvertToGreyscalesCB.GetDisplayText();
                 [ #  # ]
     326         [ #  # ]:          0 :     aConvertToGreyscalesCB.SetAccessibleName( sAccessibleName );
     327                 :            : 
     328         [ #  # ]:          0 :     String sWarnText = aWarnGB.GetDisplayText();
     329         [ #  # ]:          0 :     sWarnText += cSeparator;
     330                 :            : 
     331         [ #  # ]:          0 :     sAccessibleName = sWarnText;
     332 [ #  # ][ #  # ]:          0 :     sAccessibleName += aPaperSizeCB.GetDisplayText();
                 [ #  # ]
     333         [ #  # ]:          0 :     aPaperSizeCB.SetAccessibleName( sAccessibleName );
     334                 :            : 
     335         [ #  # ]:          0 :     sAccessibleName = sWarnText;
     336 [ #  # ][ #  # ]:          0 :     sAccessibleName += aPaperOrientationCB.GetDisplayText();
                 [ #  # ]
     337         [ #  # ]:          0 :     aPaperOrientationCB.SetAccessibleName( sAccessibleName );
     338                 :            : 
     339         [ #  # ]:          0 :     sAccessibleName = sWarnText;
     340 [ #  # ][ #  # ]:          0 :     sAccessibleName += aTransparencyCB.GetDisplayText();
                 [ #  # ]
     341 [ #  # ][ #  # ]:          0 :     aTransparencyCB.SetAccessibleName( sAccessibleName );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     342                 :          0 : }
     343                 :            : 
     344                 :          0 : void SfxCommonPrintOptionsTabPage::ImplSaveControls( PrinterOptions* pCurrentOptions )
     345                 :            : {
     346                 :          0 :     pCurrentOptions->SetReduceTransparency( aReduceTransparencyCB.IsChecked() );
     347                 :          0 :     pCurrentOptions->SetReducedTransparencyMode( aReduceTransparencyAutoRB.IsChecked() ? PRINTER_TRANSPARENCY_AUTO : PRINTER_TRANSPARENCY_NONE );
     348                 :          0 :     pCurrentOptions->SetReduceGradients( aReduceGradientsCB.IsChecked() );
     349                 :          0 :     pCurrentOptions->SetReducedGradientMode( aReduceGradientsStripesRB.IsChecked() ? PRINTER_GRADIENT_STRIPES : PRINTER_GRADIENT_COLOR  );
     350                 :          0 :     pCurrentOptions->SetReducedGradientStepCount( (sal_uInt16) aReduceGradientsStepCountNF.GetValue() );
     351                 :          0 :     pCurrentOptions->SetReduceBitmaps( aReduceBitmapsCB.IsChecked() );
     352                 :          0 :     pCurrentOptions->SetReducedBitmapMode( aReduceBitmapsOptimalRB.IsChecked() ? PRINTER_BITMAP_OPTIMAL :
     353 [ #  # ][ #  # ]:          0 :                                            ( aReduceBitmapsNormalRB.IsChecked() ? PRINTER_BITMAP_NORMAL : PRINTER_BITMAP_RESOLUTION ) );
     354                 :          0 :     pCurrentOptions->SetReducedBitmapResolution( aDPIArray[ Min( (sal_uInt16) aReduceBitmapsResolutionLB.GetSelectEntryPos(),
     355                 :          0 :                                                             (sal_uInt16)( (sizeof (aDPIArray) / sizeof (aDPIArray[0])) - 1 ) ) ] );
     356                 :          0 :     pCurrentOptions->SetReducedBitmapIncludesTransparency( aReduceBitmapsTransparencyCB.IsChecked() );
     357                 :          0 :     pCurrentOptions->SetConvertToGreyscales( aConvertToGreyscalesCB.IsChecked() );
     358                 :          0 : }
     359                 :            : 
     360                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceTransparencyCBHdl, CheckBox*, pBox )
     361                 :            : {
     362                 :            :     (void)pBox; //unused
     363                 :          0 :     const sal_Bool bReduceTransparency = aReduceTransparencyCB.IsChecked();
     364                 :            : 
     365                 :          0 :     aReduceTransparencyAutoRB.Enable( bReduceTransparency );
     366                 :          0 :     aReduceTransparencyNoneRB.Enable( bReduceTransparency );
     367                 :            : 
     368                 :          0 :     aTransparencyCB.Enable( !bReduceTransparency );
     369                 :            : 
     370                 :          0 :     return 0;
     371                 :            : }
     372                 :            : 
     373                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceGradientsCBHdl, CheckBox*, pBox )
     374                 :            : {
     375                 :            :     (void)pBox; //unused
     376                 :          0 :     const sal_Bool bEnable = aReduceGradientsCB.IsChecked();
     377                 :            : 
     378                 :          0 :     aReduceGradientsStripesRB.Enable( bEnable );
     379                 :          0 :     aReduceGradientsColorRB.Enable( bEnable );
     380                 :          0 :     aReduceGradientsStepCountNF.Enable( bEnable );
     381                 :            : 
     382                 :          0 :     ToggleReduceGradientsStripesRBHdl( &aReduceGradientsStripesRB );
     383                 :            : 
     384                 :          0 :     return 0;
     385                 :            : }
     386                 :            : 
     387                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ClickReduceBitmapsCBHdl, CheckBox*, pBox )
     388                 :            : {
     389                 :            :     (void)pBox; //unused
     390                 :          0 :     const sal_Bool bEnable = aReduceBitmapsCB.IsChecked();
     391                 :            : 
     392                 :          0 :     aReduceBitmapsOptimalRB.Enable( bEnable );
     393                 :          0 :     aReduceBitmapsNormalRB.Enable( bEnable );
     394                 :          0 :     aReduceBitmapsResolutionRB.Enable( bEnable );
     395                 :          0 :     aReduceBitmapsTransparencyCB.Enable( bEnable );
     396                 :          0 :     aReduceBitmapsResolutionLB.Enable( bEnable );
     397                 :            : 
     398                 :          0 :     ToggleReduceBitmapsResolutionRBHdl( &aReduceBitmapsResolutionRB );
     399                 :            : 
     400                 :          0 :     return 0;
     401                 :            : }
     402                 :            : 
     403                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceGradientsStripesRBHdl, RadioButton*, pButton )
     404                 :            : {
     405                 :            :     (void)pButton; //unused
     406 [ #  # ][ #  # ]:          0 :     const sal_Bool bEnable = aReduceGradientsCB.IsChecked() && aReduceGradientsStripesRB.IsChecked();
     407                 :            : 
     408                 :          0 :     aReduceGradientsStepCountNF.Enable( bEnable );
     409                 :            : 
     410                 :          0 :     return 0;
     411                 :            : }
     412                 :            : 
     413                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleReduceBitmapsResolutionRBHdl, RadioButton*, pButton )
     414                 :            : {
     415                 :            :     (void)pButton; //unused
     416 [ #  # ][ #  # ]:          0 :     const sal_Bool bEnable = aReduceBitmapsCB.IsChecked() && aReduceBitmapsResolutionRB.IsChecked();
     417                 :            : 
     418                 :          0 :     aReduceBitmapsResolutionLB.Enable( bEnable );
     419                 :            : 
     420                 :          0 :     return 0;
     421                 :            : }
     422                 :            : 
     423                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrinterRBHdl, RadioButton*, pButton )
     424                 :            : {
     425         [ #  # ]:          0 :     if( pButton->IsChecked() )
     426                 :            :     {
     427 [ #  # ][ #  # ]:          0 :         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
                 [ #  # ]
     428                 :          0 :         ImplUpdateControls( &maPrinterOptions );
     429                 :          0 :         bOutputForPrinter = sal_True;
     430                 :            :         // #i63982#
     431                 :          0 :         ImplSetAccessibleNames();
     432                 :            :     }
     433                 :            :     else
     434                 :          0 :         ImplSaveControls( &maPrinterOptions );
     435                 :            : 
     436                 :          0 :     return 0;
     437                 :            : }
     438                 :            : 
     439                 :          0 : IMPL_LINK( SfxCommonPrintOptionsTabPage, ToggleOutputPrintFileRBHdl, RadioButton*, pButton )
     440                 :            : {
     441         [ #  # ]:          0 :     if( pButton->IsChecked() )
     442                 :            :     {
     443 [ #  # ][ #  # ]:          0 :         aOutputGB.SetText( OutputDevice::GetNonMnemonicString( pButton->GetText() ) );
                 [ #  # ]
     444                 :          0 :         ImplUpdateControls( &maPrintFileOptions );
     445                 :          0 :         bOutputForPrinter = sal_False;
     446                 :            :         // #i63982#
     447                 :          0 :         ImplSetAccessibleNames();
     448                 :            :     }
     449                 :            :     else
     450                 :          0 :         ImplSaveControls( &maPrintFileOptions );
     451                 :            : 
     452                 :          0 :     return 0;
     453                 :            : }
     454                 :            : 
     455                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10