LCOV - code coverage report
Current view: top level - sd/source/ui/view - DocumentRenderer.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 853 0.0 %
Date: 2012-08-25 Functions: 0 92 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 2024 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include <com/sun/star/beans/XPropertySet.hpp>
      31                 :            : 
      32                 :            : #include "DocumentRenderer.hxx"
      33                 :            : #include "DocumentRenderer.hrc"
      34                 :            : 
      35                 :            : #include "drawdoc.hxx"
      36                 :            : #include "optsitem.hxx"
      37                 :            : #include "sdresid.hxx"
      38                 :            : #include "strings.hrc"
      39                 :            : #include "sdattr.hxx"
      40                 :            : #include "Window.hxx"
      41                 :            : #include "drawview.hxx"
      42                 :            : #include "DrawViewShell.hxx"
      43                 :            : #include "FrameView.hxx"
      44                 :            : #include "Outliner.hxx"
      45                 :            : #include "OutlineViewShell.hxx"
      46                 :            : 
      47                 :            : #include <basegfx/polygon/b2dpolygon.hxx>
      48                 :            : #include <basegfx/polygon/b2dpolypolygon.hxx>
      49                 :            : #include <basegfx/matrix/b2dhommatrix.hxx>
      50                 :            : #include <sfx2/printer.hxx>
      51                 :            : #include <editeng/editstat.hxx>
      52                 :            : #include <editeng/outlobj.hxx>
      53                 :            : #include <svx/svdetc.hxx>
      54                 :            : #include <svx/svditer.hxx>
      55                 :            : #include <svx/svdopage.hxx>
      56                 :            : #include <svx/svdopath.hxx>
      57                 :            : #include <svx/xlnclit.hxx>
      58                 :            : #include <toolkit/awt/vclxdevice.hxx>
      59                 :            : #include <tools/resary.hxx>
      60                 :            : #include <unotools/localedatawrapper.hxx>
      61                 :            : #include <vcl/msgbox.hxx>
      62                 :            : #include <unotools/moduleoptions.hxx>
      63                 :            : 
      64                 :            : #include <vector>
      65                 :            : 
      66                 :            : using namespace ::com::sun::star;
      67                 :            : using namespace ::com::sun::star::uno;
      68                 :            : using ::rtl::OUString;
      69                 :            : 
      70                 :            : 
      71                 :            : namespace sd {
      72                 :            : 
      73                 :            : namespace {
      74                 :            : 
      75                 :            : 
      76                 :            :     /** Convenience class to extract values from the sequence of properties
      77                 :            :         given to one of the XRenderable methods.
      78                 :            :     */
      79                 :          0 :     class PrintOptions
      80                 :            :     {
      81                 :            :     public:
      82                 :          0 :         PrintOptions (
      83                 :            :             const vcl::PrinterOptionsHelper& rHelper,
      84                 :            :             const ::std::vector<sal_Int32>& rSlidesPerPage)
      85                 :            :             : mrProperties(rHelper),
      86                 :          0 :               maSlidesPerPage(rSlidesPerPage)
      87                 :            :         {
      88                 :          0 :         }
      89                 :            : 
      90                 :          0 :         bool IsWarningOrientation() const
      91                 :            :         {
      92                 :          0 :             return GetBoolValue(NULL, true);
      93                 :            :         }
      94                 :            : 
      95                 :          0 :         bool IsPrintPageName() const
      96                 :            :         {
      97                 :          0 :             return GetBoolValue("IsPrintName");
      98                 :            :         }
      99                 :            : 
     100                 :          0 :         bool IsDate() const
     101                 :            :         {
     102                 :          0 :             return GetBoolValue("IsPrintDateTime");
     103                 :            :         }
     104                 :            : 
     105                 :          0 :         bool IsTime() const
     106                 :            :         {
     107                 :          0 :             return GetBoolValue("IsPrintDateTime");
     108                 :            :         }
     109                 :            : 
     110                 :          0 :         bool IsHiddenPages() const
     111                 :            :         {
     112                 :          0 :             return GetBoolValue("IsPrintHidden");
     113                 :            :         }
     114                 :            : 
     115                 :          0 :         bool IsHandoutHorizontal() const
     116                 :            :         {
     117                 :          0 :             return GetBoolValue("SlidesPerPageOrder", sal_Int32(0), true);
     118                 :            :         }
     119                 :            : 
     120                 :          0 :         sal_Int32 GetHandoutPageCount() const
     121                 :            :         {
     122                 :          0 :             sal_uInt32 nIndex = static_cast<sal_Int32>(mrProperties.getIntValue("SlidesPerPage", sal_Int32(0)));
     123         [ #  # ]:          0 :             if (nIndex<maSlidesPerPage.size())
     124                 :          0 :                 return maSlidesPerPage[nIndex];
     125         [ #  # ]:          0 :             else if ( ! maSlidesPerPage.empty())
     126                 :          0 :                 return maSlidesPerPage[0];
     127                 :            :             else
     128                 :          0 :                 return 0;
     129                 :            :         }
     130                 :            : 
     131                 :          0 :         bool IsDraw() const
     132                 :            :         {
     133                 :          0 :             return GetBoolValue("PageContentType", sal_Int32(0));
     134                 :            :         }
     135                 :            : 
     136                 :          0 :         bool IsHandout() const
     137                 :            :         {
     138                 :          0 :             return GetBoolValue("PageContentType", sal_Int32(1));
     139                 :            :         }
     140                 :            : 
     141                 :          0 :         bool IsNotes() const
     142                 :            :         {
     143                 :          0 :             return GetBoolValue("PageContentType", sal_Int32(2));
     144                 :            :         }
     145                 :            : 
     146                 :          0 :         bool IsOutline() const
     147                 :            :         {
     148                 :          0 :             return GetBoolValue("PageContentType", sal_Int32(3));
     149                 :            :         }
     150                 :            : 
     151                 :          0 :         sal_uLong GetOutputQuality() const
     152                 :            :         {
     153                 :          0 :             sal_Int32 nQuality = static_cast<sal_Int32>(mrProperties.getIntValue( "Quality", sal_Int32(0) ));
     154                 :          0 :             return nQuality;
     155                 :            :         }
     156                 :            : 
     157                 :          0 :         bool IsPageSize() const
     158                 :            :         {
     159                 :          0 :             return GetBoolValue("PageOptions", sal_Int32(1));
     160                 :            :         }
     161                 :            : 
     162                 :          0 :         bool IsTilePage() const
     163                 :            :         {
     164 [ #  # ][ #  # ]:          0 :             return GetBoolValue("PageOptions", sal_Int32(2)) || GetBoolValue("PageOptions", sal_Int32(3));
     165                 :            :         }
     166                 :            : 
     167                 :          0 :         bool IsCutPage() const
     168                 :            :         {
     169                 :          0 :             return GetBoolValue("PageOptions", sal_Int32(0));
     170                 :            :         }
     171                 :            : 
     172                 :          0 :         bool IsBooklet() const
     173                 :            :         {
     174                 :          0 :             return GetBoolValue("PrintProspect", false);
     175                 :            :         }
     176                 :            : 
     177                 :          0 :         bool IsPrintExcluded() const
     178                 :            :         {
     179 [ #  # ][ #  # ]:          0 :             return (IsNotes() || IsDraw() || IsHandout()) &&  IsHiddenPages();
         [ #  # ][ #  # ]
     180                 :            :         }
     181                 :            : 
     182                 :          0 :         bool IsPrintFrontPage() const
     183                 :            :         {
     184                 :          0 :             sal_Int32 nInclude = static_cast<sal_Int32>(mrProperties.getIntValue( "PrintProspectInclude", 0 ));
     185 [ #  # ][ #  # ]:          0 :             return nInclude == 0 || nInclude == 1;
     186                 :            :         }
     187                 :            : 
     188                 :          0 :         bool IsPrintBackPage() const
     189                 :            :         {
     190                 :          0 :             sal_Int32 nInclude = static_cast<sal_Int32>(mrProperties.getIntValue( "PrintProspectInclude", 0 ));
     191 [ #  # ][ #  # ]:          0 :             return nInclude == 0 || nInclude == 2;
     192                 :            :         }
     193                 :            : 
     194                 :          0 :         bool IsPaperBin() const
     195                 :            :         {
     196                 :          0 :             return GetBoolValue("PrintPaperFromSetup", false);
     197                 :            :         }
     198                 :            : 
     199                 :          0 :         bool IsPrintMarkedOnly() const
     200                 :            :         {
     201                 :          0 :             return GetBoolValue("PrintContent", sal_Int32(2));
     202                 :            :         }
     203                 :            : 
     204                 :          0 :         OUString GetPrinterSelection (sal_Int32 nPageCount, sal_Int32 nCurrentPageIndex) const
     205                 :            :         {
     206         [ #  # ]:          0 :             sal_Int32 nContent = static_cast<sal_Int32>(mrProperties.getIntValue( "PrintContent", 0 ));
     207                 :            :             OUString sFullRange = ::rtl::OUStringBuffer()
     208         [ #  # ]:          0 :                  .append(static_cast<sal_Int32>(1))
     209         [ #  # ]:          0 :                  .append(static_cast<sal_Unicode>('-'))
     210 [ #  # ][ #  # ]:          0 :                  .append(nPageCount).makeStringAndClear();
     211                 :            : 
     212         [ #  # ]:          0 :             if (nContent == 0) // all pages/slides
     213                 :            :             {
     214                 :          0 :                 return sFullRange;
     215                 :            :             }
     216                 :            : 
     217         [ #  # ]:          0 :             if (nContent == 1) // range
     218                 :            :             {
     219         [ #  # ]:          0 :                 OUString sValue = mrProperties.getStringValue("PageRange");
     220         [ #  # ]:          0 :                 return sValue.isEmpty() ? sFullRange : sValue;
     221                 :            :             }
     222                 :            : 
     223 [ #  # ][ #  # ]:          0 :             if (nContent == 2 && // selection
     224                 :            :                 nCurrentPageIndex >= 0)
     225                 :            :             {
     226                 :          0 :                 return OUString::valueOf(nCurrentPageIndex + 1);
     227                 :            :             }
     228                 :            : 
     229                 :          0 :             return OUString();
     230                 :            :         }
     231                 :            : 
     232                 :            :     private:
     233                 :            :         const vcl::PrinterOptionsHelper& mrProperties;
     234                 :            :         const ::std::vector<sal_Int32> maSlidesPerPage;
     235                 :            : 
     236                 :            :         /** When the value of the property with name pName is a boolean then
     237                 :            :             return its value. When the property is unknown then
     238                 :            :             bDefaultValue is returned.  Otherwise <FALSE/> is returned.
     239                 :            :         */
     240                 :          0 :         bool GetBoolValue (
     241                 :            :             const sal_Char* pName,
     242                 :            :             const bool bDefaultValue = false) const
     243                 :            :         {
     244                 :          0 :             sal_Bool bValue = mrProperties.getBoolValue( pName, bDefaultValue );
     245                 :          0 :             return bValue;
     246                 :            :         }
     247                 :            : 
     248                 :            :         /** Return <TRUE/> when the value of the property with name pName is
     249                 :            :             a string and its value equals pValue. When the property is
     250                 :            :             unknown then bDefaultValue is returned.  Otherwise <FALSE/> is
     251                 :            :             returned.
     252                 :            :         */
     253                 :          0 :         bool GetBoolValue (
     254                 :            :             const sal_Char* pName,
     255                 :            :             const sal_Char* pValue,
     256                 :            :             const bool bDefaultValue = false) const
     257                 :            :         {
     258         [ #  # ]:          0 :             OUString sValue( mrProperties.getStringValue( pName ) );
     259         [ #  # ]:          0 :             if (!sValue.isEmpty())
     260                 :          0 :                 return sValue.equalsAscii(pValue);
     261                 :            :             else
     262                 :          0 :                 return bDefaultValue;
     263                 :            :         }
     264                 :            : 
     265                 :            :         /** Return <TRUE/> when the value of the property with name pName is
     266                 :            :             an integer and its value is nTriggerValue. Otherwise <FALSE/> is
     267                 :            :             returned.
     268                 :            :         */
     269                 :          0 :         bool GetBoolValue (
     270                 :            :             const sal_Char* pName,
     271                 :            :             const sal_Int32 nTriggerValue) const
     272                 :            :         {
     273                 :          0 :             sal_Int32 nValue = static_cast<sal_Int32>(mrProperties.getIntValue( pName ));
     274                 :          0 :             return nValue == nTriggerValue;
     275                 :            :         }
     276                 :            :     };
     277                 :            : 
     278                 :            : 
     279                 :            : 
     280                 :            :     /** A collection of values that helps to reduce the number of arguments
     281                 :            :         given to some functions.  Note that not all values are set at the
     282                 :            :         same time.
     283                 :            :     */
     284         [ #  # ]:          0 :     class PrintInfo
     285                 :            :     {
     286                 :            :     public:
     287                 :          0 :         PrintInfo (
     288                 :            :             const Printer* pPrinter,
     289                 :            :             const bool bPrintMarkedOnly)
     290                 :            :             : mpPrinter(pPrinter),
     291                 :            :               mnDrawMode(DRAWMODE_DEFAULT),
     292                 :            :               msTimeDate(),
     293                 :            :               msPageString(),
     294                 :            :               maPrintSize(0,0),
     295                 :            :               maPageSize(0,0),
     296                 :            :               meOrientation(ORIENTATION_PORTRAIT),
     297                 :            :               maMap(),
     298         [ #  # ]:          0 :               mbPrintMarkedOnly(bPrintMarkedOnly)
     299                 :          0 :         {}
     300                 :            : 
     301                 :            :         const Printer* mpPrinter;
     302                 :            :         sal_uLong mnDrawMode;
     303                 :            :         ::rtl::OUString msTimeDate;
     304                 :            :         ::rtl::OUString msPageString;
     305                 :            :         Size maPrintSize;
     306                 :            :         Size maPageSize;
     307                 :            :         Orientation meOrientation;
     308                 :            :         MapMode maMap;
     309                 :            :         const bool mbPrintMarkedOnly;
     310                 :            :     };
     311                 :            : 
     312                 :            : 
     313                 :            : 
     314                 :            :     /** Output one page of the document to the given printer.  Note that
     315                 :            :         more than one document page may be output to one printer page.
     316                 :            :     */
     317                 :          0 :     void PrintPage (
     318                 :            :         Printer& rPrinter,
     319                 :            :         ::sd::View& rPrintView,
     320                 :            :         SdPage& rPage,
     321                 :            :         View* pView,
     322                 :            :         const bool bPrintMarkedOnly,
     323                 :            :         const SetOfByte& rVisibleLayers,
     324                 :            :         const SetOfByte& rPrintableLayers)
     325                 :            :     {
     326         [ #  # ]:          0 :         rPrintView.ShowSdrPage(&rPage);
     327                 :            : 
     328         [ #  # ]:          0 :         const MapMode aOriginalMapMode (rPrinter.GetMapMode());
     329                 :            : 
     330                 :            :         // Set the visible layers
     331                 :          0 :         SdrPageView* pPageView = rPrintView.GetSdrPageView();
     332                 :            :         OSL_ASSERT(pPageView!=NULL);
     333         [ #  # ]:          0 :         pPageView->SetVisibleLayers(rVisibleLayers);
     334                 :          0 :         pPageView->SetPrintableLayers(rPrintableLayers);
     335                 :            : 
     336 [ #  # ][ #  # ]:          0 :         if (pView!=NULL && bPrintMarkedOnly)
     337         [ #  # ]:          0 :             pView->DrawMarkedObj(rPrinter);
     338                 :            :         else
     339 [ #  # ][ #  # ]:          0 :             rPrintView.CompleteRedraw(&rPrinter, Rectangle(Point(0,0), rPage.GetSize()));
         [ #  # ][ #  # ]
                 [ #  # ]
     340                 :            : 
     341         [ #  # ]:          0 :         rPrinter.SetMapMode(aOriginalMapMode);
     342                 :            : 
     343 [ #  # ][ #  # ]:          0 :         rPrintView.HideSdrPage();
     344                 :          0 :     }
     345                 :            : 
     346                 :            : 
     347                 :            : 
     348                 :            : 
     349                 :            :     /** Output a string (that typically is not part of a document page) to
     350                 :            :         the given printer.
     351                 :            :     */
     352                 :          0 :     void PrintMessage (
     353                 :            :         Printer& rPrinter,
     354                 :            :         const ::rtl::OUString& rsPageString,
     355                 :            :         const Point& rPageStringOffset)
     356                 :            :     {
     357         [ #  # ]:          0 :         const Font aOriginalFont (rPrinter.OutputDevice::GetFont());
     358 [ #  # ][ #  # ]:          0 :         rPrinter.SetFont(Font(FAMILY_SWISS, Size(0, 423)));
                 [ #  # ]
     359 [ #  # ][ #  # ]:          0 :         rPrinter.DrawText(rPageStringOffset, rsPageString);
                 [ #  # ]
     360 [ #  # ][ #  # ]:          0 :         rPrinter.SetFont(aOriginalFont);
     361                 :          0 :     }
     362                 :            : 
     363                 :            : 
     364                 :            : 
     365                 :            : 
     366                 :            :     /** Read the resource file and process it into a sequence of properties
     367                 :            :         that can be passed to the printing dialog.
     368                 :            :     */
     369                 :          0 :     class DialogCreator : Resource
     370                 :            :     {
     371                 :            :     public:
     372                 :          0 :         DialogCreator (bool bImpress, sal_Int32 nCurPage)
     373                 :            :             : Resource(SdResId(_STR_IMPRESS_PRINT_UI_OPTIONS))
     374                 :            :             , mbImpress(bImpress)
     375 [ #  # ][ #  # ]:          0 :             , mnCurPage(nCurPage)
                 [ #  # ]
     376                 :            :         {
     377         [ #  # ]:          0 :             ProcessResource();
     378                 :          0 :         }
     379                 :            : 
     380                 :          0 :         Sequence< beans::PropertyValue > GetDialogControls() const
     381                 :            :         {
     382         [ #  # ]:          0 :             if (maProperties.empty())
     383                 :          0 :                 return Sequence< beans::PropertyValue >();
     384                 :            :             else
     385                 :            :             {
     386                 :            :                 return Sequence<beans::PropertyValue>(
     387                 :          0 :                         &maProperties.front(),
     388                 :          0 :                         maProperties.size());
     389                 :            :             }
     390                 :            :         }
     391                 :            : 
     392                 :          0 :         ::std::vector<sal_Int32> GetSlidesPerPage() const
     393                 :            :         {
     394                 :          0 :             return maSlidesPerPage;
     395                 :            :         }
     396                 :            : 
     397                 :            :     private:
     398                 :            :         Any maDialog;
     399                 :            :         ::std::vector<beans::PropertyValue> maProperties;
     400                 :            :         ::std::vector<sal_Int32> maSlidesPerPage;
     401                 :            :         bool mbImpress;
     402                 :            :         sal_Int32 mnCurPage;
     403                 :            : 
     404                 :          0 :         void ProcessResource()
     405                 :            :         {
     406         [ #  # ]:          0 :             SvtModuleOptions aOpt;
     407 [ #  # ][ #  # ]:          0 :             String aAppGroupname( String( SdResId( _STR_IMPRESS_PRINT_UI_GROUP_NAME ) ) );
     408                 :            :             aAppGroupname.SearchAndReplace( String( RTL_CONSTASCII_USTRINGPARAM( "%s" ) ),
     409 [ #  # ][ #  # ]:          0 :                                            aOpt.GetModuleName( mbImpress ? SvtModuleOptions::E_SIMPRESS : SvtModuleOptions::E_SDRAW ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     410                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getGroupControlOpt(
     411                 :            :                                 aAppGroupname,
     412                 :            :                                 ".HelpID:vcl:PrintDialog:TabPage:AppPage"
     413 [ #  # ][ #  # ]:          0 :                                 ) );
                 [ #  # ]
     414                 :            : 
     415         [ #  # ]:          0 :             uno::Sequence< rtl::OUString > aHelpIds;
     416         [ #  # ]:          0 :             if( mbImpress )
     417                 :            :             {
     418         [ #  # ]:          0 :                 vcl::PrinterOptionsHelper::UIControlOptions aPrintOpt;
     419                 :          0 :                 aPrintOpt.maGroupHint = "JobPage" ;
     420                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
     421                 :            :                                     String( SdResId(_STR_IMPRESS_PRINT_UI_PRINT_GROUP) ),
     422                 :            :                                     "",
     423                 :            :                                     aPrintOpt )
     424 [ #  # ][ #  # ]:          0 :                                     );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     425                 :            : 
     426         [ #  # ]:          0 :                 aHelpIds.realloc( 1 );
     427         [ #  # ]:          0 :                 aHelpIds[0] = ".HelpID:vcl:PrintDialog:PageContentType:ListBox" ;
     428                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     429                 :            :                                     String( SdResId( _STR_IMPRESS_PRINT_UI_CONTENT ) ),
     430                 :            :                                     aHelpIds,
     431                 :            :                                     "PageContentType" ,
     432                 :            :                                     CreateChoice(_STR_IMPRESS_PRINT_UI_CONTENT_CHOICES),
     433                 :            :                                     0,
     434                 :            :                                     "List"
     435                 :            :                                     )
     436 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     437                 :            : 
     438         [ #  # ]:          0 :                 aHelpIds[0] = ".HelpID:vcl:PrintDialog:SlidesPerPage:ListBox" ;
     439         [ #  # ]:          0 :                 vcl::PrinterOptionsHelper::UIControlOptions aContentOpt( "PageContentType" , 1 );
     440                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     441                 :            :                                     String( SdResId( _STR_IMPRESS_PRINT_UI_SLIDESPERPAGE ) ),
     442                 :            :                                     aHelpIds,
     443                 :            :                                     "SlidesPerPage" ,
     444                 :            :                                     GetSlidesPerPageSequence(),
     445                 :            :                                     0,
     446                 :            :                                     "List",
     447                 :            :                                     Sequence< sal_Bool >(),
     448                 :            :                                     aContentOpt
     449                 :            :                                     )
     450 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     451                 :            : 
     452         [ #  # ]:          0 :                 aHelpIds[0] = ".HelpID:vcl:PrintDialog:SlidesPerPageOrder:ListBox" ;
     453         [ #  # ]:          0 :                 vcl::PrinterOptionsHelper::UIControlOptions aSlidesPerPageOpt( "SlidesPerPage" , -1, sal_True );
     454                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     455                 :            :                                     String( SdResId( _STR_IMPRESS_PRINT_UI_ORDER ) ),
     456                 :            :                                     aHelpIds,
     457                 :            :                                     "SlidesPerPageOrder" ,
     458                 :            :                                     CreateChoice(_STR_IMPRESS_PRINT_UI_ORDER_CHOICES),
     459                 :            :                                     0,
     460                 :            :                                     "List" ,
     461                 :            :                                     Sequence< sal_Bool >(),
     462                 :            :                                     aSlidesPerPageOpt )
     463 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     464                 :            :             }
     465                 :            : 
     466                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
     467 [ #  # ][ #  # ]:          0 :                                String( SdResId(_STR_IMPRESS_PRINT_UI_INCLUDE_CONTENT) ), "" ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     468                 :            : 
     469                 :            : 
     470         [ #  # ]:          0 :             if( mbImpress )
     471                 :            :             {
     472                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
     473                 :            :                                     String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_NAME) ),
     474                 :            :                                     ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ,
     475                 :            :                                     "IsPrintName" ,
     476                 :            :                                     sal_False
     477                 :            :                                     )
     478 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     479                 :            :             }
     480                 :            :             else
     481                 :            :             {
     482                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
     483                 :            :                                     String( SdResId(_STR_DRAW_PRINT_UI_IS_PRINT_NAME) ),
     484                 :            :                                     ".HelpID:vcl:PrintDialog:IsPrintName:CheckBox" ,
     485                 :            :                                     "IsPrintName" ,
     486                 :            :                                     sal_False
     487                 :            :                                     )
     488 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     489                 :            :             }
     490                 :            : 
     491                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
     492                 :            :                                 String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_DATE) ),
     493                 :            :                                 ".HelpID:vcl:PrintDialog:IsPrintDateTime:CheckBox" ,
     494                 :            :                                 "IsPrintDateTime" ,
     495                 :            :                                 sal_False
     496                 :            :                                 )
     497 [ #  # ][ #  # ]:          0 :                             );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     498                 :            : 
     499         [ #  # ]:          0 :             if( mbImpress )
     500                 :            :             {
     501                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
     502                 :            :                                     String( SdResId(_STR_IMPRESS_PRINT_UI_IS_PRINT_HIDDEN) ),
     503                 :            :                                     ".HelpID:vcl:PrintDialog:IsPrintHidden:CheckBox" ,
     504                 :            :                                     "IsPrintHidden" ,
     505                 :            :                                     sal_False
     506                 :            :                                     )
     507 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     508                 :            :             }
     509                 :            : 
     510                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
     511 [ #  # ][ #  # ]:          0 :                                String( SdResId(_STR_IMPRESS_PRINT_UI_QUALITY) ), "" ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     512                 :            : 
     513         [ #  # ]:          0 :             aHelpIds.realloc( 3 );
     514         [ #  # ]:          0 :             aHelpIds[0] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:0" ;
     515         [ #  # ]:          0 :             aHelpIds[1] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:1" ;
     516         [ #  # ]:          0 :             aHelpIds[2] = ".HelpID:vcl:PrintDialog:Quality:RadioButton:2" ;
     517                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     518                 :            :                                 "",
     519                 :            :                                 aHelpIds,
     520                 :            :                                 "Quality" ,
     521                 :            :                                 CreateChoice(_STR_IMPRESS_PRINT_UI_QUALITY_CHOICES),
     522                 :            :                                 0
     523                 :            :                                 )
     524 [ #  # ][ #  # ]:          0 :                             );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     525                 :            : 
     526                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
     527 [ #  # ][ #  # ]:          0 :                                String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS) ), "" ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     528                 :            : 
     529         [ #  # ]:          0 :             aHelpIds.realloc( 4 );
     530         [ #  # ]:          0 :             aHelpIds[0] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:0" ;
     531         [ #  # ]:          0 :             aHelpIds[1] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:1" ;
     532         [ #  # ]:          0 :             aHelpIds[2] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:2" ;
     533         [ #  # ]:          0 :             aHelpIds[3] = ".HelpID:vcl:PrintDialog:PageOptions:RadioButton:3" ;
     534         [ #  # ]:          0 :             if( mbImpress )
     535                 :            :             {
     536                 :            :                 // FIXME: additional dependency on PrintProspect = false
     537         [ #  # ]:          0 :                 vcl::PrinterOptionsHelper::UIControlOptions aPageOptionsOpt( "PageContentType" , 0 );
     538                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     539                 :            :                                     "",
     540                 :            :                                     aHelpIds,
     541                 :            :                                     "PageOptions" ,
     542                 :            :                                     CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES),
     543                 :            :                                     0,
     544                 :            :                                     "Radio" ,
     545                 :            :                                     Sequence< sal_Bool >(),
     546                 :            :                                     aPageOptionsOpt
     547                 :            :                                     )
     548 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     549                 :            :             }
     550                 :            :             else
     551                 :            :             {
     552         [ #  # ]:          0 :                 vcl::PrinterOptionsHelper::UIControlOptions aPageOptionsOpt( "PrintProspect" , sal_False );
     553                 :            :                 AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     554                 :            :                                     "",
     555                 :            :                                     aHelpIds,
     556                 :            :                                     "PageOptions" ,
     557                 :            :                                     CreateChoice(_STR_IMPRESS_PRINT_UI_PAGE_OPTIONS_CHOICES_DRAW),
     558                 :            :                                     0,
     559                 :            :                                     "Radio" ,
     560                 :            :                                     Sequence< sal_Bool >(),
     561                 :            :                                     aPageOptionsOpt
     562                 :            :                                     )
     563 [ #  # ][ #  # ]:          0 :                                 );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     564                 :            :             }
     565                 :            : 
     566         [ #  # ]:          0 :             vcl::PrinterOptionsHelper::UIControlOptions aBrochureOpt;
     567                 :          0 :             aBrochureOpt.maGroupHint = "LayoutPage" ;
     568                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
     569                 :            :                                String( SdResId(_STR_IMPRESS_PRINT_UI_PAGE_SIDES) ), "",
     570 [ #  # ][ #  # ]:          0 :                                aBrochureOpt ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     571                 :            : 
     572                 :            :             // brochure printing
     573                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
     574                 :            :                                 String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE) ),
     575                 :            :                                 ".HelpID:vcl:PrintDialog:PrintProspect:CheckBox" ,
     576                 :            :                                 "PrintProspect" ,
     577                 :            :                                 sal_False,
     578                 :            :                                 aBrochureOpt
     579                 :            :                                 )
     580 [ #  # ][ #  # ]:          0 :                             );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     581                 :            : 
     582                 :            :             vcl::PrinterOptionsHelper::UIControlOptions
     583         [ #  # ]:          0 :                 aIncludeOpt( "PrintProspect" , -1, sal_False );
     584                 :          0 :             aIncludeOpt.maGroupHint =  "LayoutPage" ;
     585         [ #  # ]:          0 :             aHelpIds.realloc( 1 );
     586         [ #  # ]:          0 :             aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintProspectInclude:ListBox" ;
     587                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt(
     588                 :            :                                 String( SdResId(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE) ),
     589                 :            :                                 aHelpIds,
     590                 :            :                                 "PrintProspectInclude" ,
     591                 :            :                                 CreateChoice(_STR_IMPRESS_PRINT_UI_BROCHURE_INCLUDE_LIST),
     592                 :            :                                 0,
     593                 :            :                                 "List" ,
     594                 :            :                                 Sequence< sal_Bool >(),
     595                 :            :                                 aIncludeOpt
     596                 :            :                                 )
     597 [ #  # ][ #  # ]:          0 :                             );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     598                 :            : 
     599                 :            :             // paper tray (on options page)
     600         [ #  # ]:          0 :             vcl::PrinterOptionsHelper::UIControlOptions aPaperTrayOpt;
     601                 :          0 :             aPaperTrayOpt.maGroupHint = "OptionsPageOptGroup" ;
     602                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getBoolControlOpt(
     603                 :            :                                 String( SdResId(_STR_IMPRESS_PRINT_UI_PAPER_TRAY) ),
     604                 :            :                                 ".HelpID:vcl:PrintDialog:PrintPaperFromSetup:CheckBox" ,
     605                 :            :                                 "PrintPaperFromSetup" ,
     606                 :            :                                 sal_False,
     607                 :            :                                 aPaperTrayOpt
     608                 :            :                                 )
     609 [ #  # ][ #  # ]:          0 :                             );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     610                 :            :             // print range selection
     611         [ #  # ]:          0 :             vcl::PrinterOptionsHelper::UIControlOptions aPrintRangeOpt;
     612                 :          0 :             aPrintRangeOpt.mbInternalOnly = sal_True;
     613                 :          0 :             aPrintRangeOpt.maGroupHint = "PrintRange" ;
     614                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getSubgroupControlOpt(
     615                 :            :                                 String( SdResId( _STR_IMPRESS_PRINT_UI_PAGE_RANGE ) ),
     616                 :            :                                 "",
     617                 :            :                                 aPrintRangeOpt )
     618 [ #  # ][ #  # ]:          0 :                              );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     619                 :            : 
     620                 :            :             // create a choice for the content to create
     621                 :          0 :             rtl::OUString aPrintRangeName( "PrintContent" );
     622         [ #  # ]:          0 :             aHelpIds.realloc( 3 );
     623         [ #  # ]:          0 :             aHelpIds[0] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:0" ;
     624         [ #  # ]:          0 :             aHelpIds[1] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:1" ;
     625         [ #  # ]:          0 :             aHelpIds[2] = ".HelpID:vcl:PrintDialog:PrintContent:RadioButton:2" ;
     626                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getChoiceControlOpt( "",
     627                 :            :                                 aHelpIds,
     628                 :            :                                 aPrintRangeName,
     629                 :            :                                 CreateChoice(mbImpress
     630                 :            :                                              ? _STR_IMPRESS_PRINT_UI_PAGE_RANGE_CHOICE
     631                 :            :                                              : _STR_DRAW_PRINT_UI_PAGE_RANGE_CHOICE),
     632                 :            :                                 0 )
     633 [ #  # ][ #  # ]:          0 :                             );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     634                 :            :             // create a an Edit dependent on "Pages" selected
     635         [ #  # ]:          0 :             vcl::PrinterOptionsHelper::UIControlOptions aPageRangeOpt( aPrintRangeName, 1, sal_True );
     636                 :            :             AddDialogControl( vcl::PrinterOptionsHelper::getEditControlOpt( "",
     637                 :            :                                 ".HelpID:vcl:PrintDialog:PageRange:Edit" ,
     638                 :            :                                 "PageRange" ,
     639                 :            :                                 OUString::valueOf(mnCurPage + 1),
     640                 :            :                                 aPageRangeOpt )
     641 [ #  # ][ #  # ]:          0 :                             );
     642                 :            : 
     643 [ #  # ][ #  # ]:          0 :             FreeResource();
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     644                 :          0 :         }
     645                 :            : 
     646                 :          0 :         void AddDialogControl( const Any& i_rCtrl )
     647                 :            :         {
     648                 :          0 :             beans::PropertyValue aVal;
     649                 :          0 :             aVal.Value = i_rCtrl;
     650         [ #  # ]:          0 :             maProperties.push_back( aVal );
     651                 :          0 :         }
     652                 :            : 
     653                 :          0 :         Sequence<rtl::OUString> CreateChoice (const sal_uInt16 nResourceId) const
     654                 :            :         {
     655         [ #  # ]:          0 :             SdResId aResourceId (nResourceId);
     656         [ #  # ]:          0 :             ResStringArray aChoiceStrings (aResourceId);
     657                 :            : 
     658                 :          0 :             const sal_uInt32 nCount (aChoiceStrings.Count());
     659         [ #  # ]:          0 :             Sequence<rtl::OUString> aChoices (nCount);
     660         [ #  # ]:          0 :             for (sal_uInt32 nIndex=0; nIndex<nCount; ++nIndex)
     661 [ #  # ][ #  # ]:          0 :                 aChoices[nIndex] = aChoiceStrings.GetString(nIndex);
     662                 :            : 
     663         [ #  # ]:          0 :             return aChoices;
     664                 :            :         }
     665                 :            : 
     666                 :          0 :         Sequence<rtl::OUString> GetSlidesPerPageSequence()
     667                 :            :         {
     668                 :            :             const Sequence<rtl::OUString> aChoice (
     669                 :          0 :                 CreateChoice(_STR_IMPRESS_PRINT_UI_SLIDESPERPAGE_CHOICES));
     670                 :          0 :             maSlidesPerPage.clear();
     671         [ #  # ]:          0 :             maSlidesPerPage.push_back(0); // first is using the default
     672         [ #  # ]:          0 :             for (sal_Int32 nIndex=1,nCount=aChoice.getLength(); nIndex<nCount; ++nIndex)
     673         [ #  # ]:          0 :                 maSlidesPerPage.push_back(aChoice[nIndex].toInt32());
     674                 :          0 :             return aChoice;
     675                 :            :         }
     676                 :            :     };
     677                 :            : 
     678                 :            : 
     679                 :            : 
     680                 :            : 
     681                 :            :     /** The Prepare... methods of the DocumentRenderer::Implementation class
     682                 :            :         create a set of PrinterPage objects that contain all necessary
     683                 :            :         information to do the actual printing.  There is one PrinterPage
     684                 :            :         object per printed page.  Derived classes implement the actual, mode
     685                 :            :         specific printing.
     686                 :            : 
     687                 :            :         This and all derived classes support the asynchronous printing
     688                 :            :         process by not storing pointers to any data with lifetime shorter
     689                 :            :         than the PrinterPage objects, i.e. slides, shapes, (one of) the
     690                 :            :         outliner (of the document).
     691                 :            :     */
     692                 :            :     class PrinterPage
     693                 :            :     {
     694                 :            :     public:
     695                 :          0 :         PrinterPage (
     696                 :            :             const PageKind ePageKind,
     697                 :            :             const MapMode& rMapMode,
     698                 :            :             const bool bPrintMarkedOnly,
     699                 :            :             const ::rtl::OUString& rsPageString,
     700                 :            :             const Point& rPageStringOffset,
     701                 :            :             const sal_uLong nDrawMode,
     702                 :            :             const Orientation eOrientation,
     703                 :            :             const sal_uInt16 nPaperTray)
     704                 :            :             : mePageKind(ePageKind),
     705                 :            :               maMap(rMapMode),
     706                 :            :               mbPrintMarkedOnly(bPrintMarkedOnly),
     707                 :            :               msPageString(rsPageString),
     708                 :            :               maPageStringOffset(rPageStringOffset),
     709                 :            :               mnDrawMode(nDrawMode),
     710                 :            :               meOrientation(eOrientation),
     711                 :          0 :               mnPaperTray(nPaperTray)
     712                 :            :         {
     713                 :          0 :         }
     714                 :            : 
     715         [ #  # ]:          0 :         virtual ~PrinterPage() {}
     716                 :            : 
     717                 :            :         virtual void Print (
     718                 :            :             Printer& rPrinter,
     719                 :            :             SdDrawDocument& rDocument,
     720                 :            :             ViewShell& rViewShell,
     721                 :            :             View* pView,
     722                 :            :             DrawView& rPrintView,
     723                 :            :             const SetOfByte& rVisibleLayers,
     724                 :            :             const SetOfByte& rPrintableLayers) const = 0;
     725                 :            : 
     726                 :          0 :         sal_uLong GetDrawMode() const { return mnDrawMode; }
     727                 :          0 :         Orientation GetOrientation() const { return meOrientation; }
     728                 :          0 :         sal_uInt16 GetPaperTray() const { return mnPaperTray; }
     729                 :            : 
     730                 :            :     protected:
     731                 :            :         const PageKind mePageKind;
     732                 :            :         const MapMode maMap;
     733                 :            :         const bool mbPrintMarkedOnly;
     734                 :            :         const ::rtl::OUString msPageString;
     735                 :            :         const Point maPageStringOffset;
     736                 :            :         const sal_uLong mnDrawMode;
     737                 :            :         const Orientation meOrientation;
     738                 :            :         const sal_uInt16 mnPaperTray;
     739                 :            :     };
     740                 :            : 
     741                 :            : 
     742                 :            : 
     743                 :            : 
     744                 :            :     /** The RegularPrinterPage is used for printing one regular slide (no
     745                 :            :         notes, handout, or outline) to one printer page.
     746                 :            :     */
     747                 :            :     class RegularPrinterPage : public PrinterPage
     748                 :            :     {
     749                 :            :     public:
     750                 :          0 :         RegularPrinterPage (
     751                 :            :             const sal_uInt16 nPageIndex,
     752                 :            :             const PageKind ePageKind,
     753                 :            :             const MapMode& rMapMode,
     754                 :            :             const bool bPrintMarkedOnly,
     755                 :            :             const ::rtl::OUString& rsPageString,
     756                 :            :             const Point& rPageStringOffset,
     757                 :            :             const sal_uLong nDrawMode,
     758                 :            :             const Orientation eOrientation,
     759                 :            :             const sal_uInt16 nPaperTray)
     760                 :            :             : PrinterPage(ePageKind, rMapMode, bPrintMarkedOnly, rsPageString,
     761                 :            :                 rPageStringOffset, nDrawMode, eOrientation, nPaperTray),
     762                 :          0 :               mnPageIndex(nPageIndex)
     763                 :            :         {
     764                 :          0 :         }
     765                 :            : 
     766         [ #  # ]:          0 :         virtual ~RegularPrinterPage() {}
     767                 :            : 
     768                 :          0 :         virtual void Print (
     769                 :            :             Printer& rPrinter,
     770                 :            :             SdDrawDocument& rDocument,
     771                 :            :             ViewShell& rViewShell,
     772                 :            :             View* pView,
     773                 :            :             DrawView& rPrintView,
     774                 :            :             const SetOfByte& rVisibleLayers,
     775                 :            :             const SetOfByte& rPrintableLayers) const
     776                 :            :         {
     777                 :            :             (void)rViewShell;
     778                 :          0 :             SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind);
     779                 :          0 :             rPrinter.SetMapMode(maMap);
     780                 :            :             PrintPage(
     781                 :            :                 rPrinter,
     782                 :            :                 rPrintView,
     783                 :            :                 *pPageToPrint,
     784                 :            :                 pView,
     785                 :            :                 mbPrintMarkedOnly,
     786                 :            :                 rVisibleLayers,
     787                 :          0 :                 rPrintableLayers);
     788                 :            :             PrintMessage(
     789                 :            :                 rPrinter,
     790                 :            :                 msPageString,
     791                 :          0 :                 maPageStringOffset);
     792                 :          0 :         }
     793                 :            : 
     794                 :            :     private:
     795                 :            :         const sal_uInt16 mnPageIndex;
     796                 :            :     };
     797                 :            : 
     798                 :            : 
     799                 :            : 
     800                 :            : 
     801                 :            :     /** Print one slide multiple times on a printer page so that the whole
     802                 :            :         printer page is covered.
     803                 :            :     */
     804                 :            :     class TiledPrinterPage : public PrinterPage
     805                 :            :     {
     806                 :            :     public:
     807                 :          0 :         TiledPrinterPage (
     808                 :            :             const sal_uInt16 nPageIndex,
     809                 :            :             const PageKind ePageKind,
     810                 :            :             const sal_Int32 nGap,
     811                 :            :             const bool bPrintMarkedOnly,
     812                 :            :             const ::rtl::OUString& rsPageString,
     813                 :            :             const Point& rPageStringOffset,
     814                 :            :             const sal_uLong nDrawMode,
     815                 :            :             const Orientation eOrientation,
     816                 :            :             const sal_uInt16 nPaperTray)
     817                 :            :             : PrinterPage(ePageKind, MapMode(), bPrintMarkedOnly, rsPageString,
     818                 :            :                 rPageStringOffset, nDrawMode, eOrientation, nPaperTray),
     819                 :            :               mnPageIndex(nPageIndex),
     820         [ #  # ]:          0 :               mnGap(nGap)
     821                 :            :         {
     822                 :          0 :         }
     823                 :            : 
     824         [ #  # ]:          0 :         virtual ~TiledPrinterPage() {}
     825                 :            : 
     826                 :          0 :         virtual void Print (
     827                 :            :             Printer& rPrinter,
     828                 :            :             SdDrawDocument& rDocument,
     829                 :            :             ViewShell& rViewShell,
     830                 :            :             View* pView,
     831                 :            :             DrawView& rPrintView,
     832                 :            :             const SetOfByte& rVisibleLayers,
     833                 :            :             const SetOfByte& rPrintableLayers) const
     834                 :            :         {
     835                 :            :             (void)rViewShell;
     836         [ #  # ]:          0 :             SdPage* pPageToPrint = rDocument.GetSdPage(mnPageIndex, mePageKind);
     837         [ #  # ]:          0 :             if (pPageToPrint==NULL)
     838                 :            :                 return;
     839         [ #  # ]:          0 :             MapMode aMap (rPrinter.GetMapMode());
     840                 :            : 
     841         [ #  # ]:          0 :             const Size aPageSize (pPageToPrint->GetSize());
     842         [ #  # ]:          0 :             const Size aPrintSize (rPrinter.GetOutputSize());
     843                 :            : 
     844                 :          0 :             const sal_Int32 nPageWidth (aPageSize.Width() + mnGap
     845 [ #  # ][ #  # ]:          0 :                 - pPageToPrint->GetLftBorder() - pPageToPrint->GetRgtBorder());
     846                 :          0 :             const sal_Int32 nPageHeight (aPageSize.Height() + mnGap
     847 [ #  # ][ #  # ]:          0 :                 - pPageToPrint->GetUppBorder() - pPageToPrint->GetLwrBorder());
     848 [ #  # ][ #  # ]:          0 :             if (nPageWidth<=0 || nPageHeight<=0)
     849                 :            :                 return;
     850                 :            : 
     851                 :            :             // Print at least two rows and columns.  More if the document
     852                 :            :             // page fits completely onto the printer page.
     853                 :            :             const sal_Int32 nColumnCount (::std::max(sal_Int32(2),
     854         [ #  # ]:          0 :                     sal_Int32(aPrintSize.Width() / nPageWidth)));
     855                 :            :             const sal_Int32 nRowCount (::std::max(sal_Int32(2),
     856         [ #  # ]:          0 :                     sal_Int32(aPrintSize.Height() / nPageHeight)));
     857                 :          0 :             Point aPrintOrigin;
     858         [ #  # ]:          0 :             for (sal_Int32 nRow=0; nRow<nRowCount; ++nRow)
     859         [ #  # ]:          0 :                 for (sal_Int32 nColumn=0; nColumn<nColumnCount; ++nColumn)
     860                 :            :                 {
     861         [ #  # ]:          0 :                     aMap.SetOrigin(Point(nColumn*nPageWidth,nRow*nPageHeight));
     862         [ #  # ]:          0 :                     rPrinter.SetMapMode(aMap);
     863                 :            :                     PrintPage(
     864                 :            :                         rPrinter,
     865                 :            :                         rPrintView,
     866                 :            :                         *pPageToPrint,
     867                 :            :                         pView,
     868                 :            :                         mbPrintMarkedOnly,
     869                 :            :                         rVisibleLayers,
     870         [ #  # ]:          0 :                         rPrintableLayers);
     871                 :            :                 }
     872                 :            : 
     873                 :            :             PrintMessage(
     874                 :            :                 rPrinter,
     875                 :            :                 msPageString,
     876 [ #  # ][ #  # ]:          0 :                 maPageStringOffset);
                 [ #  # ]
     877                 :            :         }
     878                 :            : 
     879                 :            :     private:
     880                 :            :         const sal_uInt16 mnPageIndex;
     881                 :            :         const sal_Int32 mnGap;
     882                 :            :     };
     883                 :            : 
     884                 :            :     /** Print two slides to one printer page so that the resulting pages
     885                 :            :         form a booklet.
     886                 :            :     */
     887                 :            :     class BookletPrinterPage : public PrinterPage
     888                 :            :     {
     889                 :            :     public:
     890                 :          0 :         BookletPrinterPage (
     891                 :            :             const sal_uInt16 nFirstPageIndex,
     892                 :            :             const sal_uInt16 nSecondPageIndex,
     893                 :            :             const Point& rFirstOffset,
     894                 :            :             const Point& rSecondOffset,
     895                 :            :             const PageKind ePageKind,
     896                 :            :             const MapMode& rMapMode,
     897                 :            :             const bool bPrintMarkedOnly,
     898                 :            :             const sal_uLong nDrawMode,
     899                 :            :             const Orientation eOrientation,
     900                 :            :             const sal_uInt16 nPaperTray)
     901                 :            :             : PrinterPage(ePageKind, rMapMode, bPrintMarkedOnly, "",
     902                 :            :                 Point(), nDrawMode, eOrientation, nPaperTray),
     903                 :            :               mnFirstPageIndex(nFirstPageIndex),
     904                 :            :               mnSecondPageIndex(nSecondPageIndex),
     905                 :            :               maFirstOffset(rFirstOffset),
     906         [ #  # ]:          0 :               maSecondOffset(rSecondOffset)
     907                 :            :         {
     908                 :          0 :         }
     909                 :            : 
     910         [ #  # ]:          0 :         virtual ~BookletPrinterPage() {}
     911                 :            : 
     912                 :          0 :         virtual void Print (
     913                 :            :             Printer& rPrinter,
     914                 :            :             SdDrawDocument& rDocument,
     915                 :            :             ViewShell& rViewShell,
     916                 :            :             View* pView,
     917                 :            :             DrawView& rPrintView,
     918                 :            :             const SetOfByte& rVisibleLayers,
     919                 :            :             const SetOfByte& rPrintableLayers) const
     920                 :            :         {
     921                 :            :             (void)rViewShell;
     922         [ #  # ]:          0 :             MapMode aMap (maMap);
     923         [ #  # ]:          0 :             SdPage* pPageToPrint = rDocument.GetSdPage(mnFirstPageIndex, mePageKind);
     924         [ #  # ]:          0 :             if (pPageToPrint)
     925                 :            :             {
     926         [ #  # ]:          0 :                 aMap.SetOrigin(maFirstOffset);
     927         [ #  # ]:          0 :                 rPrinter.SetMapMode(aMap);
     928                 :            :                 PrintPage(
     929                 :            :                     rPrinter,
     930                 :            :                     rPrintView,
     931                 :            :                     *pPageToPrint,
     932                 :            :                     pView,
     933                 :            :                     mbPrintMarkedOnly,
     934                 :            :                     rVisibleLayers,
     935         [ #  # ]:          0 :                     rPrintableLayers);
     936                 :            :             }
     937                 :            : 
     938         [ #  # ]:          0 :             pPageToPrint = rDocument.GetSdPage(mnSecondPageIndex, mePageKind);
     939         [ #  # ]:          0 :             if( pPageToPrint )
     940                 :            :             {
     941         [ #  # ]:          0 :                 aMap.SetOrigin(maSecondOffset);
     942         [ #  # ]:          0 :                 rPrinter.SetMapMode(aMap);
     943                 :            :                 PrintPage(
     944                 :            :                     rPrinter,
     945                 :            :                     rPrintView,
     946                 :            :                     *pPageToPrint,
     947                 :            :                     pView,
     948                 :            :                     mbPrintMarkedOnly,
     949                 :            :                     rVisibleLayers,
     950         [ #  # ]:          0 :                     rPrintableLayers);
     951         [ #  # ]:          0 :             }
     952                 :          0 :         }
     953                 :            : 
     954                 :            :     private:
     955                 :            :         const sal_uInt16 mnFirstPageIndex;
     956                 :            :         const sal_uInt16 mnSecondPageIndex;
     957                 :            :         const Point maFirstOffset;
     958                 :            :         const Point maSecondOffset;
     959                 :            :     };
     960                 :            : 
     961                 :            : 
     962                 :            : 
     963                 :            : 
     964                 :            :     /** One handout page displays one to nine slides.
     965                 :            :     */
     966         [ #  # ]:          0 :     class HandoutPrinterPage : public PrinterPage
     967                 :            :     {
     968                 :            :     public:
     969                 :          0 :         HandoutPrinterPage (
     970                 :            :             const sal_uInt16 nHandoutPageIndex,
     971                 :            :             const ::std::vector<sal_uInt16>& rPageIndices,
     972                 :            :             const MapMode& rMapMode,
     973                 :            :             const ::rtl::OUString& rsPageString,
     974                 :            :             const Point& rPageStringOffset,
     975                 :            :             const sal_uLong nDrawMode,
     976                 :            :             const Orientation eOrientation,
     977                 :            :             const sal_uInt16 nPaperTray)
     978                 :            :             : PrinterPage(PK_HANDOUT, rMapMode, false, rsPageString,
     979                 :            :                 rPageStringOffset, nDrawMode, eOrientation, nPaperTray),
     980                 :            :               mnHandoutPageIndex(nHandoutPageIndex),
     981         [ #  # ]:          0 :               maPageIndices(rPageIndices)
     982                 :            :         {
     983                 :          0 :         }
     984                 :            : 
     985                 :          0 :         virtual void Print (
     986                 :            :             Printer& rPrinter,
     987                 :            :             SdDrawDocument& rDocument,
     988                 :            :             ViewShell& rViewShell,
     989                 :            :             View* pView,
     990                 :            :             DrawView& rPrintView,
     991                 :            :             const SetOfByte& rVisibleLayers,
     992                 :            :             const SetOfByte& rPrintableLayers) const
     993                 :            :         {
     994         [ #  # ]:          0 :             SdPage& rHandoutPage (*rDocument.GetSdPage(0, PK_HANDOUT));
     995                 :            : 
     996 [ #  # ][ #  # ]:          0 :             Reference< com::sun::star::beans::XPropertySet > xHandoutPage( rHandoutPage.getUnoPage(), UNO_QUERY );
     997                 :          0 :             const rtl::OUString sPageNumber( "Number" );
     998                 :            : 
     999                 :            :             // Collect the page objects of the handout master.
    1000         [ #  # ]:          0 :             std::vector<SdrPageObj*> aHandoutPageObjects;
    1001         [ #  # ]:          0 :             SdrObjListIter aShapeIter (rHandoutPage);
    1002         [ #  # ]:          0 :             while (aShapeIter.IsMore())
    1003                 :            :             {
    1004 [ #  # ][ #  # ]:          0 :                 SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(aShapeIter.Next());
    1005         [ #  # ]:          0 :                 if (pPageObj)
    1006         [ #  # ]:          0 :                     aHandoutPageObjects.push_back(pPageObj);
    1007                 :            :             }
    1008         [ #  # ]:          0 :             if (aHandoutPageObjects.empty())
    1009                 :          0 :                 return;
    1010                 :            : 
    1011                 :            :             // Connect page objects with pages.
    1012                 :          0 :             std::vector<SdrPageObj*>::iterator aPageObjIter (aHandoutPageObjects.begin());
    1013 [ #  # ][ #  # ]:          0 :             for (std::vector<sal_uInt16>::const_iterator
         [ #  # ][ #  # ]
    1014                 :          0 :                      iPageIndex(maPageIndices.begin()),
    1015                 :          0 :                      iEnd(maPageIndices.end());
    1016 [ #  # ][ #  # ]:          0 :                  iPageIndex!=iEnd && aPageObjIter!=aHandoutPageObjects.end();
         [ #  # ][ #  # ]
    1017                 :            :                  ++iPageIndex)
    1018                 :            :             {
    1019                 :            :                 // Check if the page still exists.
    1020 [ #  # ][ #  # ]:          0 :                 if (*iPageIndex >= rDocument.GetSdPageCount(PK_STANDARD))
                 [ #  # ]
    1021                 :          0 :                     continue;
    1022                 :            : 
    1023 [ #  # ][ #  # ]:          0 :                 SdrPageObj* pPageObj = (*aPageObjIter++);
    1024 [ #  # ][ #  # ]:          0 :                 pPageObj->SetReferencedPage(rDocument.GetSdPage(*iPageIndex, PK_STANDARD));
                 [ #  # ]
    1025                 :            :             }
    1026                 :            : 
    1027                 :            :             // if there are more page objects than pages left, set the rest to invisible
    1028                 :          0 :             int nHangoverCount = 0;
    1029 [ #  # ][ #  # ]:          0 :             while (aPageObjIter != aHandoutPageObjects.end())
    1030                 :            :             {
    1031 [ #  # ][ #  # ]:          0 :                 (*aPageObjIter++)->SetReferencedPage(0L);
                 [ #  # ]
    1032                 :          0 :                 nHangoverCount++;
    1033                 :            :             }
    1034                 :            : 
    1035                 :            :             // Hide outlines for objects that have pages attached.
    1036         [ #  # ]:          0 :             if (nHangoverCount > 0)
    1037                 :            :             {
    1038                 :          0 :                 int nSkip = aHandoutPageObjects.size() - nHangoverCount;
    1039                 :          0 :                 aShapeIter.Reset();
    1040         [ #  # ]:          0 :                 while (aShapeIter.IsMore())
    1041                 :            :                 {
    1042 [ #  # ][ #  # ]:          0 :                     SdrPathObj* pPathObj = dynamic_cast<SdrPathObj*>(aShapeIter.Next());
    1043         [ #  # ]:          0 :                     if (pPathObj)
    1044                 :            :                     {
    1045         [ #  # ]:          0 :                         if (nSkip > 0)
    1046                 :          0 :                             --nSkip;
    1047                 :            :                         else
    1048 [ #  # ][ #  # ]:          0 :                             pPathObj->SetMergedItem(XLineStyleItem(XLINE_NONE));
                 [ #  # ]
    1049                 :            :                     }
    1050                 :            :                 }
    1051                 :            :             }
    1052                 :            : 
    1053         [ #  # ]:          0 :             if( xHandoutPage.is() ) try
    1054                 :            :             {
    1055 [ #  # ][ #  # ]:          0 :                 xHandoutPage->setPropertyValue( sPageNumber, Any( static_cast<sal_Int16>(mnHandoutPageIndex) ) );
         [ #  # ][ #  # ]
    1056                 :            :             }
    1057         [ #  # ]:          0 :             catch( Exception& )
    1058                 :            :             {
    1059                 :            :             }
    1060                 :          0 :             rViewShell.SetPrintedHandoutPageNum( mnHandoutPageIndex + 1 );
    1061                 :            : 
    1062         [ #  # ]:          0 :             MapMode aMap (rPrinter.GetMapMode());
    1063         [ #  # ]:          0 :             rPrinter.SetMapMode(maMap);
    1064                 :            : 
    1065                 :            :             PrintPage(
    1066                 :            :                 rPrinter,
    1067                 :            :                 rPrintView,
    1068                 :            :                 rHandoutPage,
    1069                 :            :                 pView,
    1070                 :            :                 false,
    1071                 :            :                 rVisibleLayers,
    1072         [ #  # ]:          0 :                 rPrintableLayers);
    1073                 :            :             PrintMessage(
    1074                 :            :                 rPrinter,
    1075                 :            :                 msPageString,
    1076         [ #  # ]:          0 :                 maPageStringOffset);
    1077                 :            : 
    1078         [ #  # ]:          0 :             if( xHandoutPage.is() ) try
    1079                 :            :             {
    1080 [ #  # ][ #  # ]:          0 :                 xHandoutPage->setPropertyValue( sPageNumber, Any( static_cast<sal_Int16>(0) ) );
         [ #  # ][ #  # ]
    1081                 :            :             }
    1082         [ #  # ]:          0 :             catch( Exception& )
    1083                 :            :             {
    1084                 :            :             }
    1085                 :          0 :             rViewShell.SetPrintedHandoutPageNum(1);
    1086                 :            : 
    1087                 :            :             // Restore outlines.
    1088         [ #  # ]:          0 :             if (nHangoverCount > 0)
    1089                 :            :             {
    1090                 :          0 :                 aShapeIter.Reset();
    1091         [ #  # ]:          0 :                 while (aShapeIter.IsMore())
    1092                 :            :                 {
    1093 [ #  # ][ #  # ]:          0 :                     SdrPathObj* pPathObj = dynamic_cast<SdrPathObj*>(aShapeIter.Next());
    1094         [ #  # ]:          0 :                     if (pPathObj != NULL)
    1095 [ #  # ][ #  # ]:          0 :                         pPathObj->SetMergedItem(XLineStyleItem(XLINE_SOLID));
                 [ #  # ]
    1096                 :            :                 }
    1097 [ #  # ][ #  # ]:          0 :             }
         [ #  # ][ #  # ]
                 [ #  # ]
    1098                 :            : 
    1099                 :            :        }
    1100                 :            : 
    1101                 :            :     private:
    1102                 :            :         const sal_uInt16 mnHandoutPageIndex;
    1103                 :            :         const ::std::vector<sal_uInt16> maPageIndices;
    1104                 :            :     };
    1105                 :            : 
    1106                 :            : 
    1107                 :            : 
    1108                 :            : 
    1109                 :            :     /** The outline information (title, subtitle, outline objects) of the
    1110                 :            :         document.  There is no fixed mapping of slides to printer pages.
    1111                 :            :     */
    1112                 :            :     class OutlinerPrinterPage : public PrinterPage
    1113                 :            :     {
    1114                 :            :     public:
    1115                 :          0 :         OutlinerPrinterPage (
    1116                 :            :             OutlinerParaObject* pParaObject,
    1117                 :            :             const MapMode& rMapMode,
    1118                 :            :             const ::rtl::OUString& rsPageString,
    1119                 :            :             const Point& rPageStringOffset,
    1120                 :            :             const sal_uLong nDrawMode,
    1121                 :            :             const Orientation eOrientation,
    1122                 :            :             const sal_uInt16 nPaperTray)
    1123                 :            :             : PrinterPage(PK_HANDOUT, rMapMode, false, rsPageString,
    1124                 :            :                 rPageStringOffset, nDrawMode, eOrientation, nPaperTray),
    1125                 :          0 :               mpParaObject(pParaObject)
    1126                 :            :         {
    1127                 :          0 :         }
    1128                 :            : 
    1129                 :          0 :         ~OutlinerPrinterPage()
    1130         [ #  # ]:          0 :         {
    1131         [ #  # ]:          0 :             mpParaObject.reset();
    1132         [ #  # ]:          0 :         }
    1133                 :            : 
    1134                 :          0 :         virtual void Print (
    1135                 :            :             Printer& rPrinter,
    1136                 :            :             SdDrawDocument& rDocument,
    1137                 :            :             ViewShell& rViewShell,
    1138                 :            :             View* pView,
    1139                 :            :             DrawView& rPrintView,
    1140                 :            :             const SetOfByte& rVisibleLayers,
    1141                 :            :             const SetOfByte& rPrintableLayers) const
    1142                 :            :         {
    1143                 :            :             (void)rViewShell;
    1144                 :            :             (void)pView;
    1145                 :            :             (void)rPrintView;
    1146                 :            :             (void)rVisibleLayers;
    1147                 :            :             (void)rPrintableLayers;
    1148                 :            : 
    1149                 :            :             // Set up the printer.
    1150         [ #  # ]:          0 :             rPrinter.SetMapMode(maMap);
    1151                 :            : 
    1152                 :            :             // Get and set up the outliner.
    1153 [ #  # ][ #  # ]:          0 :             const Rectangle aOutRect (rPrinter.GetPageOffset(), rPrinter.GetOutputSize());
                 [ #  # ]
    1154         [ #  # ]:          0 :             Outliner* pOutliner = rDocument.GetInternalOutliner();
    1155                 :          0 :             const sal_uInt16 nSavedOutlMode (pOutliner->GetMode());
    1156         [ #  # ]:          0 :             const sal_Bool bSavedUpdateMode (pOutliner->GetUpdateMode());
    1157         [ #  # ]:          0 :             const Size aSavedPaperSize (pOutliner->GetPaperSize());
    1158                 :            : 
    1159         [ #  # ]:          0 :             pOutliner->Init(OUTLINERMODE_OUTLINEVIEW);
    1160 [ #  # ][ #  # ]:          0 :             pOutliner->SetPaperSize(aOutRect.GetSize());
    1161         [ #  # ]:          0 :             pOutliner->SetUpdateMode(sal_True);
    1162         [ #  # ]:          0 :             pOutliner->Clear();
    1163         [ #  # ]:          0 :             pOutliner->SetText(*mpParaObject);
    1164                 :            : 
    1165         [ #  # ]:          0 :             pOutliner->Draw(&rPrinter, aOutRect);
    1166                 :            : 
    1167                 :            :             PrintMessage(
    1168                 :            :                 rPrinter,
    1169                 :            :                 msPageString,
    1170         [ #  # ]:          0 :                 maPageStringOffset);
    1171                 :            : 
    1172                 :            :             // Restore outliner and printer.
    1173         [ #  # ]:          0 :             pOutliner->Clear();
    1174         [ #  # ]:          0 :             pOutliner->SetUpdateMode(bSavedUpdateMode);
    1175         [ #  # ]:          0 :             pOutliner->SetPaperSize(aSavedPaperSize);
    1176         [ #  # ]:          0 :             pOutliner->Init(nSavedOutlMode);
    1177                 :          0 :         }
    1178                 :            : 
    1179                 :            :     private:
    1180                 :            :         ::boost::scoped_ptr<OutlinerParaObject> mpParaObject;
    1181                 :            :     };
    1182                 :            : }
    1183                 :            : 
    1184                 :            : 
    1185                 :            : //===== DocumentRenderer::Implementation ======================================
    1186                 :            : 
    1187                 :            : class DocumentRenderer::Implementation
    1188                 :            :     : public SfxListener,
    1189                 :            :       public vcl::PrinterOptionsHelper
    1190                 :            : {
    1191                 :            : public:
    1192                 :          0 :     Implementation (ViewShellBase& rBase)
    1193         [ #  # ]:          0 :         : mxObjectShell(rBase.GetDocShell())
    1194                 :            :         , mrBase(rBase)
    1195                 :            :         , mbIsDisposed(false)
    1196                 :            :         , mpPrinter(NULL)
    1197                 :            :         , mpOptions()
    1198                 :            :         , maPrinterPages()
    1199                 :            :         , mpPrintView()
    1200 [ #  # ][ #  # ]:          0 :         , mbHasOrientationWarningBeenShown(false)
                 [ #  # ]
    1201                 :            :     {
    1202 [ #  # ][ #  # ]:          0 :         DialogCreator aCreator( mrBase.GetDocShell()->GetDocumentType() == DOCUMENT_TYPE_IMPRESS, GetCurrentPageIndex() );
                 [ #  # ]
    1203 [ #  # ][ #  # ]:          0 :         m_aUIProperties = aCreator.GetDialogControls();
                 [ #  # ]
    1204         [ #  # ]:          0 :         maSlidesPerPage = aCreator.GetSlidesPerPage();
    1205                 :            : 
    1206         [ #  # ]:          0 :         StartListening(mrBase);
    1207                 :          0 :     }
    1208                 :            : 
    1209                 :            : 
    1210                 :            : 
    1211                 :            : 
    1212                 :          0 :     virtual ~Implementation()
    1213 [ #  # ][ #  # ]:          0 :     {
         [ #  # ][ #  # ]
    1214         [ #  # ]:          0 :         EndListening(mrBase);
    1215         [ #  # ]:          0 :     }
    1216                 :            : 
    1217                 :            : 
    1218                 :            : 
    1219                 :            : 
    1220                 :          0 :     virtual void Notify (SfxBroadcaster& rBroadcaster, const SfxHint& rHint)
    1221                 :            :     {
    1222         [ #  # ]:          0 :         const SfxSimpleHint* pSimpleHint = dynamic_cast<const SfxSimpleHint*>(&rHint);
    1223   [ #  #  #  # ]:          0 :         if (pSimpleHint != NULL
         [ #  # ][ #  # ]
    1224                 :          0 :             && pSimpleHint->GetId() == SFX_HINT_DYING
    1225                 :            :             && &rBroadcaster == &static_cast<SfxBroadcaster&>(mrBase))
    1226                 :            :         {
    1227                 :          0 :             Dispose();
    1228                 :            :         }
    1229                 :          0 :     }
    1230                 :            : 
    1231                 :            : 
    1232                 :            : 
    1233                 :            :     /** Process the sequence of properties given to one of the XRenderable
    1234                 :            :         methods.
    1235                 :            :     */
    1236                 :          0 :     void ProcessProperties (const css::uno::Sequence<css::beans::PropertyValue >& rOptions)
    1237                 :            :     {
    1238                 :            :         OSL_ASSERT(!mbIsDisposed);
    1239         [ #  # ]:          0 :         if (mbIsDisposed)
    1240                 :          0 :             return;
    1241                 :            : 
    1242         [ #  # ]:          0 :         bool bIsValueChanged = processProperties( rOptions );
    1243                 :          0 :         bool bIsPaperChanged = false;
    1244                 :            : 
    1245                 :            :         // The RenderDevice property is handled specially: its value is
    1246                 :            :         // stored in mpPrinter instead of being retrieved on demand.
    1247         [ #  # ]:          0 :         Any aDev( getValue( "RenderDevice" ) );
    1248                 :          0 :         Reference<awt::XDevice> xRenderDevice;
    1249                 :            : 
    1250 [ #  # ][ #  # ]:          0 :         if (aDev >>= xRenderDevice)
    1251                 :            :         {
    1252                 :          0 :             VCLXDevice* pDevice = VCLXDevice::GetImplementation(xRenderDevice);
    1253         [ #  # ]:          0 :             OutputDevice* pOut = pDevice ? pDevice->GetOutputDevice() : NULL;
    1254         [ #  # ]:          0 :             mpPrinter = dynamic_cast<Printer*>(pOut);
    1255         [ #  # ]:          0 :             Size aPageSizePixel = mpPrinter ? mpPrinter->GetPaperSizePixel() : Size();
    1256         [ #  # ]:          0 :             if( aPageSizePixel != maPrinterPageSizePixel )
    1257                 :            :             {
    1258                 :          0 :                 bIsPaperChanged = true;
    1259                 :          0 :                 maPrinterPageSizePixel = aPageSizePixel;
    1260                 :            :             }
    1261                 :            :         }
    1262                 :            : 
    1263         [ #  # ]:          0 :         if (bIsValueChanged)
    1264                 :            :         {
    1265         [ #  # ]:          0 :             if ( ! mpOptions )
    1266 [ #  # ][ #  # ]:          0 :                 mpOptions.reset(new PrintOptions(*this, maSlidesPerPage));
                 [ #  # ]
    1267                 :            :         }
    1268 [ #  # ][ #  # ]:          0 :         if( bIsValueChanged || bIsPaperChanged )
    1269         [ #  # ]:          0 :             PreparePages();
    1270                 :            :     }
    1271                 :            : 
    1272                 :            : 
    1273                 :            : 
    1274                 :            :     /** Return the number of pages that are to be printed.
    1275                 :            :     */
    1276                 :          0 :     sal_Int32 GetPrintPageCount()
    1277                 :            :     {
    1278                 :            :         OSL_ASSERT(!mbIsDisposed);
    1279         [ #  # ]:          0 :         if (mbIsDisposed)
    1280                 :          0 :             return 0;
    1281                 :            :         else
    1282                 :          0 :             return maPrinterPages.size();
    1283                 :            :     }
    1284                 :            : 
    1285                 :            : 
    1286                 :            : 
    1287                 :            :     /** Return a sequence of properties that can be returned by the
    1288                 :            :         XRenderable::getRenderer() method.
    1289                 :            :     */
    1290                 :          0 :     css::uno::Sequence<css::beans::PropertyValue> GetProperties (
    1291                 :            :         const css::uno::Sequence<css::beans::PropertyValue>& rOptions)
    1292                 :            :     {
    1293                 :            :         (void)rOptions;
    1294                 :            : 
    1295                 :          0 :         css::uno::Sequence<css::beans::PropertyValue> aProperties (3);
    1296                 :            : 
    1297         [ #  # ]:          0 :         aProperties[0].Name = "ExtraPrintUIOptions";
    1298 [ #  # ][ #  # ]:          0 :         aProperties[0].Value <<= m_aUIProperties;
    1299                 :            : 
    1300         [ #  # ]:          0 :         aProperties[1].Name = "PageSize";
    1301 [ #  # ][ #  # ]:          0 :         aProperties[1].Value <<= maPrintSize;
    1302                 :            : 
    1303                 :            :         // FIXME: is this always true ?
    1304         [ #  # ]:          0 :         aProperties[2].Name = "PageIncludesNonprintableArea";
    1305 [ #  # ][ #  # ]:          0 :         aProperties[2].Value = makeAny( sal_True );
    1306                 :            : 
    1307                 :          0 :         return aProperties;
    1308                 :            :     }
    1309                 :            : 
    1310                 :            : 
    1311                 :            : 
    1312                 :            : 
    1313                 :            :     /** Print one of the prepared pages.
    1314                 :            :     */
    1315                 :          0 :     void PrintPage (const sal_Int32 nIndex)
    1316                 :            :     {
    1317                 :            :         OSL_ASSERT(!mbIsDisposed);
    1318         [ #  # ]:          0 :         if (mbIsDisposed)
    1319                 :            :             return;
    1320                 :            : 
    1321                 :          0 :         Printer& rPrinter (*mpPrinter);
    1322                 :            : 
    1323         [ #  # ]:          0 :         ::boost::shared_ptr<ViewShell> pViewShell (mrBase.GetMainViewShell());
    1324         [ #  # ]:          0 :         if ( ! pViewShell)
    1325                 :            :             return;
    1326                 :            : 
    1327         [ #  # ]:          0 :         SdDrawDocument* pDocument = pViewShell->GetDoc();
    1328                 :            :         OSL_ASSERT(pDocument!=NULL);
    1329                 :            : 
    1330                 :            :         ::boost::shared_ptr<DrawViewShell> pDrawViewShell(
    1331 [ #  # ][ #  # ]:          0 :             ::boost::dynamic_pointer_cast<DrawViewShell>(mrBase.GetMainViewShell()));
                 [ #  # ]
    1332                 :            : 
    1333         [ #  # ]:          0 :         if ( ! mpPrintView)
    1334 [ #  # ][ #  # ]:          0 :             mpPrintView.reset(new DrawView(mrBase.GetDocShell(), &rPrinter, NULL));
         [ #  # ][ #  # ]
    1335                 :            : 
    1336 [ #  # ][ #  # ]:          0 :         if (nIndex<0 || sal::static_int_cast<sal_uInt32>(nIndex)>=maPrinterPages.size())
                 [ #  # ]
    1337                 :            :             return;
    1338                 :            : 
    1339         [ #  # ]:          0 :         const ::boost::shared_ptr<PrinterPage> pPage (maPrinterPages[nIndex]);
    1340                 :            :         OSL_ASSERT(pPage);
    1341         [ #  # ]:          0 :         if ( ! pPage)
    1342                 :            :             return;
    1343                 :            : 
    1344         [ #  # ]:          0 :         const Orientation eSavedOrientation (rPrinter.GetOrientation());
    1345                 :          0 :         const sal_uLong nSavedDrawMode (rPrinter.GetDrawMode());
    1346         [ #  # ]:          0 :         const MapMode aSavedMapMode (rPrinter.GetMapMode());
    1347         [ #  # ]:          0 :         const sal_uInt16 nSavedPaperBin (rPrinter.GetPaperBin());
    1348                 :            : 
    1349                 :            : 
    1350                 :            :         // Set page orientation.
    1351 [ #  # ][ #  # ]:          0 :         if ( ! rPrinter.SetOrientation(pPage->GetOrientation()))
    1352                 :            :         {
    1353 [ #  # ][ #  # ]:          0 :             if ( ! mbHasOrientationWarningBeenShown
                 [ #  # ]
    1354         [ #  # ]:          0 :                 && mpOptions->IsWarningOrientation())
    1355                 :            :             {
    1356                 :          0 :                 mbHasOrientationWarningBeenShown = true;
    1357                 :            :                 // Show warning that the orientation could not be set.
    1358         [ #  # ]:          0 :                 if (pViewShell)
    1359                 :            :                 {
    1360                 :            :                     WarningBox aWarnBox(
    1361         [ #  # ]:          0 :                         pViewShell->GetActiveWindow(),
    1362                 :            :                         (WinBits)(WB_OK_CANCEL | WB_DEF_CANCEL),
    1363 [ #  # ][ #  # ]:          0 :                         String(SdResId(STR_WARN_PRINTFORMAT_FAILURE)));
         [ #  # ][ #  # ]
    1364 [ #  # ][ #  # ]:          0 :                     if (aWarnBox.Execute() != RET_OK)
    1365 [ #  # ][ #  # ]:          0 :                         return;
    1366                 :            :                 }
    1367                 :            :             }
    1368                 :            :         }
    1369                 :            : 
    1370                 :            :         // Set the draw mode.
    1371         [ #  # ]:          0 :         rPrinter.SetDrawMode(pPage->GetDrawMode());
    1372                 :            : 
    1373                 :            :         // Set paper tray.
    1374         [ #  # ]:          0 :         rPrinter.SetPaperBin(pPage->GetPaperTray());
    1375                 :            : 
    1376                 :            :         // Print the actual page.
    1377                 :          0 :         pPage->Print(
    1378                 :            :             rPrinter,
    1379                 :            :             *pDocument,
    1380                 :          0 :             *pViewShell,
    1381                 :          0 :             pDrawViewShell ? pDrawViewShell->GetView() : NULL,
    1382                 :          0 :             *mpPrintView,
    1383         [ #  # ]:          0 :             pViewShell->GetFrameView()->GetVisibleLayers(),
    1384 [ #  # ][ #  # ]:          0 :             pViewShell->GetFrameView()->GetPrintableLayers());
                 [ #  # ]
    1385                 :            : 
    1386         [ #  # ]:          0 :         rPrinter.SetOrientation(eSavedOrientation);
    1387         [ #  # ]:          0 :         rPrinter.SetDrawMode(nSavedDrawMode);
    1388         [ #  # ]:          0 :         rPrinter.SetMapMode(aSavedMapMode);
    1389 [ #  # ][ #  # ]:          0 :         rPrinter.SetPaperBin(nSavedPaperBin);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1390                 :            :     }
    1391                 :            : 
    1392                 :            : 
    1393                 :            : 
    1394                 :            : 
    1395                 :            : private:
    1396                 :            :     // rhbz#657394: keep the document alive: prevents crash when
    1397                 :            :     SfxObjectShellRef mxObjectShell; // destroying mpPrintView
    1398                 :            :     ViewShellBase& mrBase;
    1399                 :            :     bool mbIsDisposed;
    1400                 :            :     Printer* mpPrinter;
    1401                 :            :     Size maPrinterPageSizePixel;
    1402                 :            :     ::boost::scoped_ptr<PrintOptions> mpOptions;
    1403                 :            :     ::std::vector< ::boost::shared_ptr< ::sd::PrinterPage> > maPrinterPages;
    1404                 :            :     ::boost::scoped_ptr<DrawView> mpPrintView;
    1405                 :            :     bool mbHasOrientationWarningBeenShown;
    1406                 :            :     ::std::vector<sal_Int32> maSlidesPerPage;
    1407                 :            :     awt::Size maPrintSize;
    1408                 :            : 
    1409                 :          0 :     void Dispose()
    1410                 :            :     {
    1411                 :          0 :         mbIsDisposed = true;
    1412                 :          0 :     }
    1413                 :            : 
    1414                 :          0 :     sal_Int32 GetCurrentPageIndex() const
    1415                 :            :     {
    1416                 :          0 :         const ViewShell *pShell = mrBase.GetMainViewShell().get();
    1417         [ #  # ]:          0 :         const SdPage *pCurrentPage = pShell ? pShell->getCurrentPage() : NULL;
    1418         [ #  # ]:          0 :         return pCurrentPage ? (pCurrentPage->GetPageNum()-1)/2 : -1;
    1419                 :            :     }
    1420                 :            : 
    1421                 :            :     /** Determine and set the paper orientation.
    1422                 :            :     */
    1423                 :          0 :     bool SetupPaperOrientation (
    1424                 :            :         const PageKind ePageKind,
    1425                 :            :         PrintInfo& rInfo)
    1426                 :            :     {
    1427 [ #  # ][ #  # ]:          0 :         SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
                 [ #  # ]
    1428                 :          0 :         rInfo.meOrientation = ORIENTATION_PORTRAIT;
    1429                 :            : 
    1430 [ #  # ][ #  # ]:          0 :         if( ! mpOptions->IsBooklet())
    1431                 :            :         {
    1432 [ #  # ][ #  # ]:          0 :             rInfo.meOrientation = pDocument->GetSdPage(0, ePageKind)->GetOrientation();
    1433                 :            :         }
    1434         [ #  # ]:          0 :         else if (rInfo.maPageSize.Width() < rInfo.maPageSize.Height())
    1435                 :          0 :             rInfo.meOrientation = ORIENTATION_LANDSCAPE;
    1436                 :            : 
    1437         [ #  # ]:          0 :         const Size aPaperSize (rInfo.mpPrinter->GetPaperSize());
    1438   [ #  #  #  # ]:          0 :         if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
           [ #  #  #  # ]
                 [ #  # ]
    1439                 :          0 :               (aPaperSize.Width() < aPaperSize.Height()))
    1440                 :            :            ||
    1441                 :            :             (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
    1442                 :          0 :               (aPaperSize.Width() > aPaperSize.Height()))
    1443                 :            :           )
    1444                 :            :         {
    1445                 :          0 :             maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
    1446                 :            :         }
    1447                 :            :         else
    1448                 :            :         {
    1449                 :          0 :             maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
    1450                 :            :         }
    1451                 :            : 
    1452                 :          0 :         return true;
    1453                 :            :     }
    1454                 :            : 
    1455                 :            : 
    1456                 :            : 
    1457                 :            :     /** Top most method for preparing printer pages.  In this and the other
    1458                 :            :         Prepare... methods the various special cases are detected and
    1459                 :            :         handled.
    1460                 :            :         For every page that is to be printed (that may contain several
    1461                 :            :         slides) one PrinterPage object is created and inserted into
    1462                 :            :         maPrinterPages.
    1463                 :            :     */
    1464                 :          0 :     void PreparePages()
    1465                 :            :     {
    1466         [ #  # ]:          0 :         mpPrintView.reset();
    1467                 :          0 :         maPrinterPages.clear();
    1468                 :          0 :         mbHasOrientationWarningBeenShown = false;
    1469                 :            : 
    1470 [ #  # ][ #  # ]:          0 :         ViewShell* pShell = mrBase.GetMainViewShell().get();
    1471                 :            : 
    1472 [ #  # ][ #  # ]:          0 :         PrintInfo aInfo (mpPrinter, mpOptions->IsPrintMarkedOnly());
    1473                 :            : 
    1474 [ #  # ][ #  # ]:          0 :         if (aInfo.mpPrinter!=NULL && pShell!=NULL)
    1475                 :            :         {
    1476                 :            : 
    1477         [ #  # ]:          0 :             MapMode aMap (aInfo.mpPrinter->GetMapMode());
    1478         [ #  # ]:          0 :             aMap.SetMapUnit(MAP_100TH_MM);
    1479         [ #  # ]:          0 :             aInfo.maMap = aMap;
    1480         [ #  # ]:          0 :             mpPrinter->SetMapMode(aMap);
    1481                 :            : 
    1482 [ #  # ][ #  # ]:          0 :             ::Outliner& rOutliner = mrBase.GetDocument()->GetDrawOutliner();
    1483         [ #  # ]:          0 :             const sal_uLong nSavedControlWord (rOutliner.GetControlWord());
    1484                 :          0 :             sal_uLong nCntrl = nSavedControlWord;
    1485                 :          0 :             nCntrl &= ~EE_CNTRL_MARKFIELDS;
    1486                 :          0 :             nCntrl &= ~EE_CNTRL_ONLINESPELLING;
    1487         [ #  # ]:          0 :             rOutliner.SetControlWord( nCntrl );
    1488                 :            : 
    1489                 :            :             // When in outline view then apply all pending changes to the model.
    1490 [ #  # ][ #  # ]:          0 :             if (pShell->ISA(OutlineViewShell))
                 [ #  # ]
    1491         [ #  # ]:          0 :                 static_cast<OutlineViewShell*>(pShell)->PrepareClose (sal_False, sal_False);
    1492                 :            : 
    1493                 :            :             // Collect some frequently used data.
    1494 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsDate())
    1495                 :            :             {
    1496 [ #  # ][ #  # ]:          0 :                 aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getDate( Date( Date::SYSTEM ) );
         [ #  # ][ #  # ]
    1497                 :          0 :                 aInfo.msTimeDate += ::rtl::OUString((sal_Unicode)' ');
    1498                 :            :             }
    1499                 :            : 
    1500 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsTime())
    1501 [ #  # ][ #  # ]:          0 :                 aInfo.msTimeDate += GetSdrGlobalData().GetLocaleData()->getTime( Time( Time::SYSTEM ), sal_False, sal_False );
         [ #  # ][ #  # ]
    1502         [ #  # ]:          0 :             aInfo.maPrintSize = aInfo.mpPrinter->GetOutputSize();
    1503                 :            :             maPrintSize = awt::Size(
    1504         [ #  # ]:          0 :                 aInfo.mpPrinter->GetPaperSize().Width(),
    1505         [ #  # ]:          0 :                 aInfo.mpPrinter->GetPaperSize().Height());
    1506                 :            : 
    1507      [ #  #  # ]:          0 :             switch (mpOptions->GetOutputQuality())
                 [ #  # ]
    1508                 :            :             {
    1509                 :            :                 case 1:
    1510                 :            :                     aInfo.mnDrawMode = DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL
    1511                 :            :                         | DRAWMODE_GRAYTEXT | DRAWMODE_GRAYBITMAP
    1512                 :          0 :                         | DRAWMODE_GRAYGRADIENT;
    1513                 :          0 :                     break;
    1514                 :            : 
    1515                 :            :                 case 2:
    1516                 :            :                     aInfo.mnDrawMode = DRAWMODE_BLACKLINE | DRAWMODE_WHITEFILL
    1517                 :            :                         | DRAWMODE_BLACKTEXT | DRAWMODE_WHITEBITMAP
    1518                 :          0 :                         | DRAWMODE_WHITEGRADIENT;
    1519                 :          0 :                     break;
    1520                 :            : 
    1521                 :            :                 default:
    1522                 :          0 :                     aInfo.mnDrawMode = DRAWMODE_DEFAULT;
    1523                 :            :             }
    1524                 :            : 
    1525 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsDraw())
    1526         [ #  # ]:          0 :                 PrepareStdOrNotes(PK_STANDARD, aInfo);
    1527 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsNotes())
    1528         [ #  # ]:          0 :                 PrepareStdOrNotes(PK_NOTES, aInfo);
    1529 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsHandout())
    1530                 :            :             {
    1531         [ #  # ]:          0 :                 InitHandoutTemplate();
    1532         [ #  # ]:          0 :                 PrepareHandout(aInfo);
    1533                 :            :             }
    1534 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsOutline())
    1535         [ #  # ]:          0 :                 PrepareOutline(aInfo);
    1536                 :            : 
    1537 [ #  # ][ #  # ]:          0 :             rOutliner.SetControlWord(nSavedControlWord);
    1538         [ #  # ]:          0 :         }
    1539                 :          0 :     }
    1540                 :            : 
    1541                 :            : 
    1542                 :            : 
    1543                 :            : 
    1544                 :            :     /** Create the page objects of the handout template.  When the actual
    1545                 :            :         printing takes place then the page objects are assigned different
    1546                 :            :         sets of slides for each printed page (see HandoutPrinterPage::Print).
    1547                 :            :     */
    1548                 :          0 :     void InitHandoutTemplate()
    1549                 :            :     {
    1550         [ #  # ]:          0 :         const sal_Int32 nSlidesPerHandout (mpOptions->GetHandoutPageCount());
    1551         [ #  # ]:          0 :         const bool bHandoutHorizontal (mpOptions->IsHandoutHorizontal());
    1552                 :            : 
    1553                 :          0 :         AutoLayout eLayout = AUTOLAYOUT_HANDOUT6;
    1554   [ #  #  #  #  :          0 :         switch (nSlidesPerHandout)
                #  #  # ]
    1555                 :            :         {
    1556                 :          0 :             case 0: eLayout = AUTOLAYOUT_NONE; break; // AUTOLAYOUT_HANDOUT1; break;
    1557                 :          0 :             case 1: eLayout = AUTOLAYOUT_HANDOUT1; break;
    1558                 :          0 :             case 2: eLayout = AUTOLAYOUT_HANDOUT2; break;
    1559                 :          0 :             case 3: eLayout = AUTOLAYOUT_HANDOUT3; break;
    1560                 :          0 :             case 4: eLayout = AUTOLAYOUT_HANDOUT4; break;
    1561                 :            :             default:
    1562                 :          0 :             case 6: eLayout = AUTOLAYOUT_HANDOUT6; break;
    1563                 :          0 :             case 9: eLayout = AUTOLAYOUT_HANDOUT9; break;
    1564                 :            :         }
    1565                 :            : 
    1566 [ #  # ][ #  # ]:          0 :         if( !mrBase.GetDocument() )
    1567                 :            :             return;
    1568                 :            : 
    1569         [ #  # ]:          0 :         SdDrawDocument& rModel = *mrBase.GetDocument();
    1570                 :            : 
    1571                 :            :         // first, prepare handout page (not handout master)
    1572                 :            : 
    1573         [ #  # ]:          0 :         SdPage* pHandout = rModel.GetSdPage(0, PK_HANDOUT);
    1574         [ #  # ]:          0 :         if( !pHandout )
    1575                 :            :             return;
    1576                 :            : 
    1577                 :            :         // delete all previous shapes from handout page
    1578 [ #  # ][ #  # ]:          0 :         while( pHandout->GetObjCount() )
    1579                 :            :         {
    1580         [ #  # ]:          0 :             SdrObject* pObj = pHandout->NbcRemoveObject(0);
    1581         [ #  # ]:          0 :             if( pObj )
    1582         [ #  # ]:          0 :                 SdrObject::Free( pObj  );
    1583                 :            :         }
    1584                 :            : 
    1585                 :          0 :         const bool bDrawLines (eLayout == AUTOLAYOUT_HANDOUT3);
    1586                 :            : 
    1587         [ #  # ]:          0 :         std::vector< Rectangle > aAreas;
    1588         [ #  # ]:          0 :         SdPage::CalculateHandoutAreas( rModel, eLayout, bHandoutHorizontal, aAreas );
    1589                 :            : 
    1590                 :          0 :         std::vector< Rectangle >::iterator iter( aAreas.begin() );
    1591 [ #  # ][ #  # ]:          0 :         while( iter != aAreas.end() )
    1592                 :            :         {
    1593 [ #  # ][ #  # ]:          0 :             pHandout->NbcInsertObject( new SdrPageObj((*iter++)) );
         [ #  # ][ #  # ]
                 [ #  # ]
    1594                 :            : 
    1595 [ #  # ][ #  # ]:          0 :             if( bDrawLines && (iter != aAreas.end())  )
         [ #  # ][ #  # ]
           [ #  #  #  # ]
    1596                 :            :             {
    1597 [ #  # ][ #  # ]:          0 :                 Rectangle aRect( (*iter++) );
    1598                 :            : 
    1599         [ #  # ]:          0 :                 basegfx::B2DPolygon aPoly;
    1600         [ #  # ]:          0 :                 aPoly.insert(0, basegfx::B2DPoint( aRect.Left(), aRect.Top() ) );
    1601         [ #  # ]:          0 :                 aPoly.insert(1, basegfx::B2DPoint( aRect.Right(), aRect.Top() ) );
    1602                 :            : 
    1603         [ #  # ]:          0 :                 basegfx::B2DHomMatrix aMatrix;
    1604 [ #  # ][ #  # ]:          0 :                 aMatrix.translate( 0.0, static_cast< double >( aRect.GetHeight() / 7 ) );
    1605                 :            : 
    1606         [ #  # ]:          0 :                 basegfx::B2DPolyPolygon aPathPoly;
    1607         [ #  # ]:          0 :                 for( sal_uInt16 nLine = 0; nLine < 7; nLine++ )
    1608                 :            :                 {
    1609         [ #  # ]:          0 :                     aPoly.transform( aMatrix );
    1610         [ #  # ]:          0 :                     aPathPoly.append( aPoly );
    1611                 :            :                 }
    1612                 :            : 
    1613 [ #  # ][ #  # ]:          0 :                 SdrPathObj* pPathObj = new SdrPathObj(OBJ_PATHLINE, aPathPoly );
    1614 [ #  # ][ #  # ]:          0 :                 pPathObj->SetMergedItem(XLineStyleItem(XLINE_SOLID));
                 [ #  # ]
    1615 [ #  # ][ #  # ]:          0 :                 pPathObj->SetMergedItem(XLineColorItem(String(), Color(COL_BLACK)));
         [ #  # ][ #  # ]
                 [ #  # ]
    1616                 :            : 
    1617 [ #  # ][ #  # ]:          0 :                 pHandout->NbcInsertObject( pPathObj );
         [ #  # ][ #  # ]
    1618                 :            :             }
    1619                 :          0 :         }
    1620                 :            :     }
    1621                 :            : 
    1622                 :            : 
    1623                 :            : 
    1624                 :            : 
    1625                 :            :     /** Detect whether the specified slide is to be printed.
    1626                 :            :         @return
    1627                 :            :             When the slide is not to be printed then <NULL/> is returned.
    1628                 :            :             Otherwise a pointer to the slide is returned.
    1629                 :            :     */
    1630                 :          0 :     SdPage* GetFilteredPage (
    1631                 :            :         const sal_Int32 nPageIndex,
    1632                 :            :         const PageKind ePageKind) const
    1633                 :            :     {
    1634                 :            :         OSL_ASSERT(mrBase.GetDocument() != NULL);
    1635                 :            :         OSL_ASSERT(nPageIndex>=0);
    1636                 :            :         SdPage* pPage = mrBase.GetDocument()->GetSdPage(
    1637                 :          0 :             sal::static_int_cast<sal_uInt16>(nPageIndex),
    1638                 :          0 :             ePageKind);
    1639         [ #  # ]:          0 :         if (pPage == NULL)
    1640                 :          0 :             return NULL;
    1641 [ #  # ][ #  # ]:          0 :         if ( ! pPage->IsExcluded() || mpOptions->IsPrintExcluded())
                 [ #  # ]
    1642                 :          0 :             return pPage;
    1643                 :            :         else
    1644                 :          0 :             return NULL;
    1645                 :            :     }
    1646                 :            : 
    1647                 :            : 
    1648                 :            : 
    1649                 :            : 
    1650                 :            :     /** Prepare the outline of the document for printing.  There is no fixed
    1651                 :            :         number of slides whose outline data is put onto one printer page.
    1652                 :            :         If the current printer page has enough room for the outline of the
    1653                 :            :         current slide then that is added.  Otherwise a new printer page is
    1654                 :            :         started.
    1655                 :            :     */
    1656                 :          0 :     void PrepareOutline (PrintInfo& rInfo)
    1657                 :            :     {
    1658         [ #  # ]:          0 :         MapMode aMap (rInfo.maMap);
    1659         [ #  # ]:          0 :         Point aPageOfs (rInfo.mpPrinter->GetPageOffset() );
    1660 [ #  # ][ #  # ]:          0 :         aMap.SetScaleX(Fraction(1,2));
    1661 [ #  # ][ #  # ]:          0 :         aMap.SetScaleY(Fraction(1,2));
    1662         [ #  # ]:          0 :         mpPrinter->SetMapMode(aMap);
    1663                 :            : 
    1664 [ #  # ][ #  # ]:          0 :         Rectangle aOutRect(aPageOfs, rInfo.mpPrinter->GetOutputSize());
    1665 [ #  # ][ #  # ]:          0 :         if( aOutRect.GetWidth() > aOutRect.GetHeight() )
                 [ #  # ]
    1666                 :            :         {
    1667 [ #  # ][ #  # ]:          0 :             Size aPaperSize( rInfo.mpPrinter->PixelToLogic( rInfo.mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
                 [ #  # ]
    1668                 :          0 :             maPrintSize.Width  = aPaperSize.Height();
    1669                 :          0 :             maPrintSize.Height = aPaperSize.Width();
    1670                 :          0 :             aOutRect = Rectangle( Point( aPageOfs.Y(), aPageOfs.X() ),
    1671 [ #  # ][ #  # ]:          0 :                                   Size( aOutRect.GetHeight(), aOutRect.GetWidth() ) );
                 [ #  # ]
    1672                 :            :         }
    1673                 :            : 
    1674         [ #  # ]:          0 :         Link aOldLink;
    1675 [ #  # ][ #  # ]:          0 :         Outliner* pOutliner = mrBase.GetDocument()->GetInternalOutliner();
    1676         [ #  # ]:          0 :         pOutliner->Init(OUTLINERMODE_OUTLINEVIEW);
    1677                 :          0 :         const sal_uInt16 nSavedOutlMode (pOutliner->GetMode());
    1678         [ #  # ]:          0 :         const sal_Bool bSavedUpdateMode (pOutliner->GetUpdateMode());
    1679         [ #  # ]:          0 :         const Size aSavedPaperSize (pOutliner->GetPaperSize());
    1680         [ #  # ]:          0 :         const MapMode aSavedMapMode (pOutliner->GetRefMapMode());
    1681 [ #  # ][ #  # ]:          0 :         pOutliner->SetPaperSize(aOutRect.GetSize());
    1682         [ #  # ]:          0 :         pOutliner->SetUpdateMode(sal_True);
    1683                 :            : 
    1684         [ #  # ]:          0 :         long nPageH = aOutRect.GetHeight();
    1685                 :            : 
    1686         [ #  # ]:          0 :         ::std::vector< sal_Int32 > aPages;
    1687 [ #  # ][ #  # ]:          0 :         sal_Int32 nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD);
    1688                 :            :         StringRangeEnumerator::getRangesFromString(
    1689                 :            :             mpOptions->GetPrinterSelection(nPageCount, GetCurrentPageIndex()),
    1690 [ #  # ][ #  # ]:          0 :             aPages, 0, nPageCount-1);
                 [ #  # ]
    1691                 :            : 
    1692         [ #  # ]:          0 :         for (size_t nIndex = 0, nCount = aPages.size(); nIndex < nCount;)
    1693                 :            :         {
    1694         [ #  # ]:          0 :             pOutliner->Clear();
    1695         [ #  # ]:          0 :             pOutliner->SetFirstPageNumber(aPages[nIndex]+1);
    1696                 :            : 
    1697                 :          0 :             Paragraph* pPara = NULL;
    1698                 :          0 :             sal_Int32 nH (0);
    1699 [ #  # ][ #  # ]:          0 :             while (nH < nPageH && nIndex<nCount)
                 [ #  # ]
    1700                 :            :             {
    1701 [ #  # ][ #  # ]:          0 :                 SdPage* pPage = GetFilteredPage(aPages[nIndex], PK_STANDARD);
    1702                 :          0 :                 ++nIndex;
    1703         [ #  # ]:          0 :                 if (pPage == NULL)
    1704                 :          0 :                     continue;
    1705                 :            : 
    1706                 :          0 :                 SdrTextObj* pTextObj = NULL;
    1707                 :          0 :                 sal_uInt32 nObj (0);
    1708                 :            : 
    1709 [ #  # ][ #  # ]:          0 :                 while (pTextObj==NULL && nObj < pPage->GetObjCount())
         [ #  # ][ #  # ]
    1710                 :            :                 {
    1711         [ #  # ]:          0 :                     SdrObject* pObj = pPage->GetObj(nObj++);
    1712 [ #  # ][ #  # ]:          0 :                     if (pObj->GetObjInventor() == SdrInventor
         [ #  # ][ #  # ]
    1713         [ #  # ]:          0 :                         && pObj->GetObjIdentifier() == OBJ_TITLETEXT)
    1714                 :            :                     {
    1715         [ #  # ]:          0 :                         pTextObj = dynamic_cast<SdrTextObj*>(pObj);
    1716                 :            :                     }
    1717                 :            :                 }
    1718                 :            : 
    1719 [ #  # ][ #  # ]:          0 :                 pPara = pOutliner->GetParagraph(pOutliner->GetParagraphCount() - 1);
    1720                 :            : 
    1721 [ #  # ][ #  # ]:          0 :                 if (pTextObj!=NULL
         [ #  # ][ #  # ]
    1722         [ #  # ]:          0 :                     && !pTextObj->IsEmptyPresObj()
    1723         [ #  # ]:          0 :                     && pTextObj->GetOutlinerParaObject())
    1724                 :            :                 {
    1725 [ #  # ][ #  # ]:          0 :                     pOutliner->AddText(*(pTextObj->GetOutlinerParaObject()));
    1726                 :            :                 }
    1727                 :            :                 else
    1728 [ #  # ][ #  # ]:          0 :                     pOutliner->Insert(String());
                 [ #  # ]
    1729                 :            : 
    1730                 :          0 :                 pTextObj = NULL;
    1731                 :          0 :                 nObj = 0;
    1732                 :            : 
    1733 [ #  # ][ #  # ]:          0 :                 while (pTextObj==NULL && nObj<pPage->GetObjCount())
         [ #  # ][ #  # ]
    1734                 :            :                 {
    1735         [ #  # ]:          0 :                     SdrObject* pObj = pPage->GetObj(nObj++);
    1736 [ #  # ][ #  # ]:          0 :                     if (pObj->GetObjInventor() == SdrInventor
         [ #  # ][ #  # ]
    1737         [ #  # ]:          0 :                         && pObj->GetObjIdentifier() == OBJ_OUTLINETEXT)
    1738                 :            :                     {
    1739         [ #  # ]:          0 :                         pTextObj = dynamic_cast<SdrTextObj*>(pObj);
    1740                 :            :                     }
    1741                 :            :                 }
    1742                 :            : 
    1743                 :          0 :                 bool bSubTitle (false);
    1744         [ #  # ]:          0 :                 if (!pTextObj)
    1745                 :            :                 {
    1746                 :          0 :                     bSubTitle = true;
    1747 [ #  # ][ #  # ]:          0 :                     pTextObj = dynamic_cast<SdrTextObj*>(pPage->GetPresObj(PRESOBJ_TEXT));  // Untertitel vorhanden?
    1748                 :            :                 }
    1749                 :            : 
    1750         [ #  # ]:          0 :                 sal_uLong nParaCount1 = pOutliner->GetParagraphCount();
    1751                 :            : 
    1752 [ #  # ][ #  # ]:          0 :                 if (pTextObj!=NULL
         [ #  # ][ #  # ]
    1753         [ #  # ]:          0 :                     && !pTextObj->IsEmptyPresObj()
    1754         [ #  # ]:          0 :                     && pTextObj->GetOutlinerParaObject())
    1755                 :            :                 {
    1756 [ #  # ][ #  # ]:          0 :                     pOutliner->AddText(*(pTextObj->GetOutlinerParaObject()));
    1757                 :            :                 }
    1758                 :            : 
    1759         [ #  # ]:          0 :                 if (bSubTitle )
    1760                 :            :                 {
    1761         [ #  # ]:          0 :                     const sal_Int32 nParaCount2 (pOutliner->GetParagraphCount());
    1762         [ #  # ]:          0 :                     for (sal_Int32 nPara=nParaCount1; nPara<nParaCount2; ++nPara)
    1763                 :            :                     {
    1764         [ #  # ]:          0 :                         Paragraph* pP = pOutliner->GetParagraph(nPara);
    1765 [ #  # ][ #  # ]:          0 :                         if (pP!=NULL && pOutliner->GetDepth((sal_uInt16)nPara) > 0)
         [ #  # ][ #  # ]
    1766         [ #  # ]:          0 :                             pOutliner->SetDepth(pP, 0);
    1767                 :            :                     }
    1768                 :            :                 }
    1769                 :            : 
    1770         [ #  # ]:          0 :                 nH = pOutliner->GetTextHeight();
    1771                 :            :             }
    1772                 :            : 
    1773                 :            :             // Remove the last paragraph when that does not fit completely on
    1774                 :            :             // the current page.
    1775 [ #  # ][ #  # ]:          0 :             if (nH > nPageH && pPara!=NULL)
    1776                 :            :             {
    1777                 :            :                 sal_uLong nCnt = pOutliner->GetAbsPos(
    1778 [ #  # ][ #  # ]:          0 :                     pOutliner->GetParagraph( pOutliner->GetParagraphCount() - 1 ) );
                 [ #  # ]
    1779         [ #  # ]:          0 :                 sal_uLong nParaPos = pOutliner->GetAbsPos( pPara );
    1780                 :          0 :                 nCnt -= nParaPos;
    1781         [ #  # ]:          0 :                 pPara = pOutliner->GetParagraph( ++nParaPos );
    1782 [ #  # ][ #  # ]:          0 :                 if ( nCnt && pPara )
    1783                 :            :                 {
    1784         [ #  # ]:          0 :                     pOutliner->Remove(pPara, nCnt);
    1785                 :          0 :                     --nIndex;
    1786                 :            :                 }
    1787                 :            :             }
    1788                 :            : 
    1789                 :            :             maPrinterPages.push_back(
    1790                 :            :                 ::boost::shared_ptr<PrinterPage>(
    1791                 :            :                     new OutlinerPrinterPage(
    1792                 :          0 :                         pOutliner->CreateParaObject(),
    1793                 :            :                         aMap,
    1794                 :            :                         rInfo.msTimeDate,
    1795                 :            :                         aPageOfs,
    1796                 :            :                         rInfo.mnDrawMode,
    1797                 :            :                         rInfo.meOrientation,
    1798 [ #  # ][ #  # ]:          0 :                         rInfo.mpPrinter->GetPaperBin())));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
    1799                 :            :         }
    1800                 :            : 
    1801         [ #  # ]:          0 :         pOutliner->SetRefMapMode(aSavedMapMode);
    1802         [ #  # ]:          0 :         pOutliner->SetUpdateMode(bSavedUpdateMode);
    1803         [ #  # ]:          0 :         pOutliner->SetPaperSize(aSavedPaperSize);
    1804 [ #  # ][ #  # ]:          0 :         pOutliner->Init(nSavedOutlMode);
                 [ #  # ]
    1805                 :          0 :     }
    1806                 :            : 
    1807                 :            : 
    1808                 :            : 
    1809                 :            : 
    1810                 :            :     /** Prepare handout pages for slides that are to be printed.
    1811                 :            :     */
    1812                 :          0 :     void PrepareHandout (PrintInfo& rInfo)
    1813                 :            :     {
    1814         [ #  # ]:          0 :         SdDrawDocument* pDocument = mrBase.GetDocument();
    1815                 :            :         OSL_ASSERT(pDocument != NULL);
    1816         [ #  # ]:          0 :         SdPage& rHandoutPage (*pDocument->GetSdPage(0, PK_HANDOUT));
    1817                 :            : 
    1818         [ #  # ]:          0 :         const bool bScalePage (mpOptions->IsPageSize());
    1819                 :            : 
    1820                 :            :         sal_uInt16 nPaperBin;
    1821 [ #  # ][ #  # ]:          0 :         if ( ! mpOptions->IsPaperBin())
    1822                 :          0 :             nPaperBin = rHandoutPage.GetPaperBin();
    1823                 :            :         else
    1824         [ #  # ]:          0 :             nPaperBin = rInfo.mpPrinter->GetPaperBin();
    1825                 :            : 
    1826                 :            :         // Change orientation?
    1827 [ #  # ][ #  # ]:          0 :         SdPage& rMaster (dynamic_cast<SdPage&>(rHandoutPage.TRG_GetMasterPage()));
    1828         [ #  # ]:          0 :         rInfo.meOrientation = rMaster.GetOrientation();
    1829                 :            : 
    1830         [ #  # ]:          0 :         const Size aPaperSize (rInfo.mpPrinter->GetPaperSize());
    1831   [ #  #  #  # ]:          0 :         if( (rInfo.meOrientation == ORIENTATION_LANDSCAPE &&
           [ #  #  #  # ]
                 [ #  # ]
    1832                 :          0 :               (aPaperSize.Width() < aPaperSize.Height()))
    1833                 :            :            ||
    1834                 :            :             (rInfo.meOrientation == ORIENTATION_PORTRAIT &&
    1835                 :          0 :               (aPaperSize.Width() > aPaperSize.Height()))
    1836                 :            :           )
    1837                 :            :         {
    1838                 :          0 :             maPrintSize = awt::Size(aPaperSize.Height(), aPaperSize.Width());
    1839                 :            :         }
    1840                 :            :         else
    1841                 :            :         {
    1842                 :          0 :             maPrintSize = awt::Size(aPaperSize.Width(), aPaperSize.Height());
    1843                 :            :         }
    1844                 :            : 
    1845         [ #  # ]:          0 :         MapMode aMap (rInfo.maMap);
    1846         [ #  # ]:          0 :         const Point aPageOfs (rInfo.mpPrinter->GetPageOffset());
    1847                 :            : 
    1848         [ #  # ]:          0 :         if ( bScalePage )
    1849                 :            :         {
    1850         [ #  # ]:          0 :             const Size aPageSize (rHandoutPage.GetSize());
    1851         [ #  # ]:          0 :             const Size aPrintSize (rInfo.mpPrinter->GetOutputSize());
    1852                 :            : 
    1853                 :          0 :             const double fHorz = (double) aPrintSize.Width()    / aPageSize.Width();
    1854                 :          0 :             const double fVert = (double) aPrintSize.Height() / aPageSize.Height();
    1855                 :            : 
    1856                 :          0 :             Fraction    aFract;
    1857         [ #  # ]:          0 :             if ( fHorz < fVert )
    1858 [ #  # ][ #  # ]:          0 :                 aFract = Fraction(aPrintSize.Width(), aPageSize.Width());
    1859                 :            :             else
    1860 [ #  # ][ #  # ]:          0 :                 aFract = Fraction(aPrintSize.Height(), aPageSize.Height());
    1861                 :            : 
    1862         [ #  # ]:          0 :             aMap.SetScaleX(aFract);
    1863         [ #  # ]:          0 :             aMap.SetScaleY(aFract);
    1864         [ #  # ]:          0 :             aMap.SetOrigin(Point());
    1865                 :            :         }
    1866                 :            : 
    1867         [ #  # ]:          0 :         ::boost::shared_ptr<ViewShell> pViewShell (mrBase.GetMainViewShell());
    1868         [ #  # ]:          0 :         pViewShell->WriteFrameViewData();
    1869                 :            : 
    1870                 :            :         // Count page shapes.
    1871                 :          0 :         sal_uInt32 nShapeCount (0);
    1872         [ #  # ]:          0 :         SdrObjListIter aShapeIter (rHandoutPage);
    1873         [ #  # ]:          0 :         while (aShapeIter.IsMore())
    1874                 :            :         {
    1875 [ #  # ][ #  # ]:          0 :             SdrPageObj* pPageObj = dynamic_cast<SdrPageObj*>(aShapeIter.Next());
    1876         [ #  # ]:          0 :             if (pPageObj)
    1877                 :          0 :                 ++nShapeCount;
    1878                 :            :         }
    1879                 :            : 
    1880 [ #  # ][ #  # ]:          0 :         const sal_uInt16 nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD);
    1881         [ #  # ]:          0 :         const sal_uInt16 nHandoutPageCount = nShapeCount ? (nPageCount + nShapeCount - 1) / nShapeCount : 0;
    1882                 :          0 :         pViewShell->SetPrintedHandoutPageCount( nHandoutPageCount );
    1883         [ #  # ]:          0 :         mrBase.GetDocument()->setHandoutPageCount( nHandoutPageCount );
    1884                 :            : 
    1885                 :            :         // Distribute pages to handout pages.
    1886                 :            :         StringRangeEnumerator aRangeEnum(
    1887                 :            :             mpOptions->GetPrinterSelection(nPageCount, GetCurrentPageIndex()),
    1888 [ #  # ][ #  # ]:          0 :             0, nPageCount-1);
                 [ #  # ]
    1889         [ #  # ]:          0 :         ::std::vector<sal_uInt16> aPageIndices;
    1890                 :          0 :         sal_uInt16 nPrinterPageIndex = 0;
    1891 [ #  # ][ #  # ]:          0 :         StringRangeEnumerator::Iterator it = aRangeEnum.begin(), itEnd = aRangeEnum.end();
    1892         [ #  # ]:          0 :         bool bLastLoop = (it == itEnd);
    1893         [ #  # ]:          0 :         while (!bLastLoop)
    1894                 :            :         {
    1895         [ #  # ]:          0 :             sal_Int32 nPageIndex = *it;
    1896         [ #  # ]:          0 :             ++it;
    1897         [ #  # ]:          0 :             bLastLoop = (it == itEnd);
    1898                 :            : 
    1899 [ #  # ][ #  # ]:          0 :             if (GetFilteredPage(nPageIndex, PK_STANDARD))
    1900         [ #  # ]:          0 :                 aPageIndices.push_back(nPageIndex);
    1901         [ #  # ]:          0 :             else if (!bLastLoop)
    1902                 :          0 :                 continue;
    1903                 :            : 
    1904                 :            :             // Create a printer page when we have found one page for each
    1905                 :            :             // placeholder or when this is the last (and special) loop.
    1906 [ #  # ][ #  # ]:          0 :             if (aPageIndices.size() == nShapeCount
                 [ #  # ]
    1907                 :            :                 || bLastLoop)
    1908                 :            :             {
    1909                 :            :                 maPrinterPages.push_back(
    1910                 :            :                     ::boost::shared_ptr<PrinterPage>(
    1911                 :            :                         new HandoutPrinterPage(
    1912                 :            :                             nPrinterPageIndex++,
    1913                 :            :                             aPageIndices,
    1914                 :            :                             aMap,
    1915                 :            :                             rInfo.msTimeDate,
    1916                 :            :                             aPageOfs,
    1917                 :            :                             rInfo.mnDrawMode,
    1918                 :            :                             rInfo.meOrientation,
    1919 [ #  # ][ #  # ]:          0 :                             nPaperBin)));
         [ #  # ][ #  # ]
                 [ #  # ]
    1920                 :          0 :                 aPageIndices.clear();
    1921                 :            :             }
    1922 [ #  # ][ #  # ]:          0 :         }
    1923                 :          0 :     }
    1924                 :            : 
    1925                 :            : 
    1926                 :            : 
    1927                 :            : 
    1928                 :            :     /** Prepare the notes pages or regular slides.
    1929                 :            :     */
    1930                 :          0 :     void PrepareStdOrNotes (
    1931                 :            :         const PageKind ePageKind,
    1932                 :            :         PrintInfo& rInfo)
    1933                 :            :     {
    1934                 :            :         OSL_ASSERT(rInfo.mpPrinter != NULL);
    1935                 :            : 
    1936                 :            :         // Fill in page kind specific data.
    1937 [ #  # ][ #  # ]:          0 :         SdDrawDocument* pDocument = mrBase.GetMainViewShell()->GetDoc();
                 [ #  # ]
    1938 [ #  # ][ #  # ]:          0 :         if (pDocument->GetSdPageCount(ePageKind) == 0)
    1939                 :            :             return;
    1940         [ #  # ]:          0 :         SdPage* pRefPage = pDocument->GetSdPage(0, ePageKind);
    1941         [ #  # ]:          0 :         rInfo.maPageSize = pRefPage->GetSize();
    1942                 :            : 
    1943 [ #  # ][ #  # ]:          0 :         if ( ! SetupPaperOrientation(ePageKind, rInfo))
    1944                 :            :             return;
    1945                 :            : 
    1946         [ #  # ]:          0 :         MapMode aMap (rInfo.maMap);
    1947         [ #  # ]:          0 :         rInfo.maMap = aMap;
    1948                 :            : 
    1949 [ #  # ][ #  # ]:          0 :         if (mpOptions->IsBooklet())
    1950         [ #  # ]:          0 :             PrepareBooklet(ePageKind, rInfo);
    1951                 :            :         else
    1952 [ #  # ][ #  # ]:          0 :             PrepareRegularPages(ePageKind, rInfo);
    1953                 :            :     }
    1954                 :            : 
    1955                 :            : 
    1956                 :            : 
    1957                 :            : 
    1958                 :            :     /** Prepare slides in a non-booklet way: one slide per one to many
    1959                 :            :         printer pages.
    1960                 :            :     */
    1961                 :          0 :     void PrepareRegularPages (
    1962                 :            :         const PageKind ePageKind,
    1963                 :            :         PrintInfo& rInfo)
    1964                 :            :     {
    1965         [ #  # ]:          0 :         ::boost::shared_ptr<ViewShell> pViewShell (mrBase.GetMainViewShell());
    1966         [ #  # ]:          0 :         pViewShell->WriteFrameViewData();
    1967                 :          0 :         Point aPtZero;
    1968                 :            : 
    1969 [ #  # ][ #  # ]:          0 :         sal_Int32 nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD);
    1970                 :            :         StringRangeEnumerator aRangeEnum(
    1971                 :            :             mpOptions->GetPrinterSelection(nPageCount, GetCurrentPageIndex()),
    1972 [ #  # ][ #  # ]:          0 :             0, nPageCount-1);
                 [ #  # ]
    1973 [ #  # ][ #  # ]:          0 :         for (StringRangeEnumerator::Iterator
                 [ #  # ]
    1974         [ #  # ]:          0 :                  it = aRangeEnum.begin(),
    1975         [ #  # ]:          0 :                  itEnd = aRangeEnum.end();
    1976                 :            :              it != itEnd;
    1977                 :            :              ++it)
    1978                 :            :         {
    1979 [ #  # ][ #  # ]:          0 :             SdPage* pPage = GetFilteredPage(*it, ePageKind);
    1980         [ #  # ]:          0 :             if (pPage == NULL)
    1981                 :          0 :                 continue;
    1982                 :            : 
    1983         [ #  # ]:          0 :             MapMode aMap (rInfo.maMap);
    1984                 :            :             // Kann sich die Seitengroesse geaendert haben?
    1985         [ #  # ]:          0 :             const Size aPageSize = pPage->GetSize();
    1986                 :            : 
    1987 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsPageSize())
    1988                 :            :             {
    1989                 :          0 :                 const double fHorz ((double) rInfo.maPrintSize.Width()  / aPageSize.Width());
    1990                 :          0 :                 const double fVert ((double) rInfo.maPrintSize.Height() / aPageSize.Height());
    1991                 :            : 
    1992                 :          0 :                 Fraction aFract;
    1993         [ #  # ]:          0 :                 if (fHorz < fVert)
    1994 [ #  # ][ #  # ]:          0 :                     aFract = Fraction(rInfo.maPrintSize.Width(), aPageSize.Width());
    1995                 :            :                 else
    1996 [ #  # ][ #  # ]:          0 :                     aFract = Fraction(rInfo.maPrintSize.Height(), aPageSize.Height());
    1997                 :            : 
    1998         [ #  # ]:          0 :                 aMap.SetScaleX(aFract);
    1999         [ #  # ]:          0 :                 aMap.SetScaleY(aFract);
    2000         [ #  # ]:          0 :                 aMap.SetOrigin(Point());
    2001                 :            :             }
    2002                 :            : 
    2003 [ #  # ][ #  # ]:          0 :             if (mpOptions->IsPrintPageName())
    2004                 :            :             {
    2005 [ #  # ][ #  # ]:          0 :                 rInfo.msPageString = pPage->GetName();
    2006                 :          0 :                 rInfo.msPageString += rtl::OUString(sal_Unicode(' '));
    2007                 :            :             }
    2008                 :            :             else
    2009                 :          0 :                 rInfo.msPageString = "";
    2010                 :          0 :             rInfo.msPageString += rInfo.msTimeDate;
    2011                 :            : 
    2012 [ #  # ][ #  # ]:          0 :             long aPageWidth   = aPageSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder();
    2013 [ #  # ][ #  # ]:          0 :             long aPageHeight  = aPageSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder();
    2014                 :            :             // Bugfix zu 44530:
    2015                 :            :             // Falls implizit umgestellt wurde (Landscape/Portrait)
    2016                 :            :             // wird dies beim Kacheln, bzw. aufteilen (Poster) beruecksichtigt
    2017         [ #  # ]:          0 :             if( ( rInfo.maPrintSize.Width() > rInfo.maPrintSize.Height()
           [ #  #  #  # ]
         [ #  # ][ #  # ]
    2018                 :            :                     && aPageWidth < aPageHeight )
    2019                 :          0 :                 || ( rInfo.maPrintSize.Width() < rInfo.maPrintSize.Height()
    2020                 :            :                     && aPageWidth > aPageHeight ) )
    2021                 :            :             {
    2022                 :          0 :                 const sal_Int32 nTmp (rInfo.maPrintSize.Width());
    2023                 :          0 :                 rInfo.maPrintSize.Width() = rInfo.maPrintSize.Height();
    2024                 :          0 :                 rInfo.maPrintSize.Height() = nTmp;
    2025                 :            :             }
    2026                 :            : 
    2027 [ #  # ][ #  #  :          0 :             if (mpOptions->IsTilePage()
             #  #  #  # ]
                 [ #  # ]
    2028                 :          0 :                 && aPageWidth < rInfo.maPrintSize.Width()
    2029                 :          0 :                 && aPageHeight < rInfo.maPrintSize.Height())
    2030                 :            :             {
    2031                 :            :                 // Put multiple slides on one printer page.
    2032 [ #  # ][ #  # ]:          0 :                 PrepareTiledPage(*it, *pPage, ePageKind, rInfo);
    2033                 :            :             }
    2034                 :            :             else
    2035                 :            :             {
    2036         [ #  # ]:          0 :                 rInfo.maMap = aMap;
    2037 [ #  # ][ #  # ]:          0 :                 PrepareScaledPage(*it, *pPage, ePageKind, rInfo);
    2038                 :            :             }
    2039 [ #  # ][ #  # ]:          0 :         }
    2040                 :          0 :     }
    2041                 :            : 
    2042                 :            : 
    2043                 :            : 
    2044                 :            : 
    2045                 :            :     /** Put two slides on one printer page.
    2046                 :            :     */
    2047                 :          0 :     void PrepareBooklet (
    2048                 :            :         const PageKind ePageKind,
    2049                 :            :         const PrintInfo& rInfo)
    2050                 :            :     {
    2051         [ #  # ]:          0 :         MapMode aStdMap (rInfo.maMap);
    2052                 :          0 :         Point aOffset;
    2053                 :          0 :         Size aPrintSize_2 (rInfo.maPrintSize);
    2054                 :          0 :         Size aPageSize_2 (rInfo.maPageSize);
    2055                 :            : 
    2056         [ #  # ]:          0 :         if (rInfo.meOrientation == ORIENTATION_LANDSCAPE)
    2057                 :          0 :             aPrintSize_2.Width() >>= 1;
    2058                 :            :         else
    2059                 :          0 :             aPrintSize_2.Height() >>= 1;
    2060                 :            : 
    2061                 :          0 :         const double fPageWH = (double) aPageSize_2.Width() / aPageSize_2.Height();
    2062                 :          0 :         const double fPrintWH = (double) aPrintSize_2.Width() / aPrintSize_2.Height();
    2063                 :            : 
    2064         [ #  # ]:          0 :         if( fPageWH < fPrintWH )
    2065                 :            :         {
    2066                 :          0 :             aPageSize_2.Width() = (long) ( aPrintSize_2.Height() * fPageWH );
    2067                 :          0 :             aPageSize_2.Height()= aPrintSize_2.Height();
    2068                 :            :         }
    2069                 :            :         else
    2070                 :            :         {
    2071                 :          0 :             aPageSize_2.Width() = aPrintSize_2.Width();
    2072                 :          0 :             aPageSize_2.Height() = (long) ( aPrintSize_2.Width() / fPageWH );
    2073                 :            :         }
    2074                 :            : 
    2075         [ #  # ]:          0 :         MapMode aMap (rInfo.maMap);
    2076 [ #  # ][ #  # ]:          0 :         aMap.SetScaleX( Fraction( aPageSize_2.Width(), rInfo.maPageSize.Width() ) );
    2077 [ #  # ][ #  # ]:          0 :         aMap.SetScaleY( Fraction( aPageSize_2.Height(), rInfo.maPageSize.Height() ) );
    2078                 :            : 
    2079                 :            :         // calculate adjusted print size
    2080                 :            :         const Size aAdjustedPrintSize (OutputDevice::LogicToLogic(
    2081                 :            :             rInfo.maPrintSize,
    2082                 :            :             aStdMap,
    2083         [ #  # ]:          0 :             aMap));
    2084                 :            : 
    2085         [ #  # ]:          0 :         if (rInfo.meOrientation == ORIENTATION_LANDSCAPE)
    2086                 :            :         {
    2087                 :          0 :             aOffset.X() = ( ( aAdjustedPrintSize.Width() >> 1 ) - rInfo.maPageSize.Width() ) >> 1;
    2088                 :          0 :             aOffset.Y() = ( aAdjustedPrintSize.Height() - rInfo.maPageSize.Height() ) >> 1;
    2089                 :            :         }
    2090                 :            :         else
    2091                 :            :         {
    2092                 :          0 :             aOffset.X() = ( aAdjustedPrintSize.Width() - rInfo.maPageSize.Width() ) >> 1;
    2093                 :          0 :             aOffset.Y() = ( ( aAdjustedPrintSize.Height() >> 1 ) - rInfo.maPageSize.Height() ) >> 1;
    2094                 :            :         }
    2095                 :            : 
    2096                 :            :         // create vector of pages to print
    2097 [ #  # ][ #  # ]:          0 :         sal_Int32 nPageCount = mrBase.GetDocument()->GetSdPageCount(ePageKind);
    2098                 :            :         StringRangeEnumerator aRangeEnum(
    2099                 :            :             mpOptions->GetPrinterSelection(nPageCount, GetCurrentPageIndex()),
    2100 [ #  # ][ #  # ]:          0 :             0, nPageCount-1);
                 [ #  # ]
    2101         [ #  # ]:          0 :         ::std::vector< sal_uInt16 > aPageVector;
    2102 [ #  # ][ #  # ]:          0 :         for (StringRangeEnumerator::Iterator
                 [ #  # ]
    2103         [ #  # ]:          0 :                  it = aRangeEnum.begin(),
    2104         [ #  # ]:          0 :                  itEnd = aRangeEnum.end();
    2105                 :            :              it != itEnd;
    2106                 :            :              ++it)
    2107                 :            :         {
    2108 [ #  # ][ #  # ]:          0 :             SdPage* pPage = GetFilteredPage(*it, ePageKind);
    2109         [ #  # ]:          0 :             if (pPage != NULL)
    2110 [ #  # ][ #  # ]:          0 :                 aPageVector.push_back(*it);
    2111                 :            :         }
    2112                 :            : 
    2113                 :            :         // create pairs of pages to print on each page
    2114                 :            :         typedef ::std::vector< ::std::pair< sal_uInt16, sal_uInt16 > > PairVector;
    2115         [ #  # ]:          0 :         PairVector aPairVector;
    2116         [ #  # ]:          0 :         if ( ! aPageVector.empty())
    2117                 :            :         {
    2118                 :          0 :             sal_uInt32 nFirstIndex = 0, nLastIndex = aPageVector.size() - 1;
    2119                 :            : 
    2120         [ #  # ]:          0 :             if( aPageVector.size() & 1 )
    2121 [ #  # ][ #  # ]:          0 :                 aPairVector.push_back( ::std::make_pair( (sal_uInt16) 65535, aPageVector[ nFirstIndex++ ] ) );
                 [ #  # ]
    2122                 :            :             else
    2123 [ #  # ][ #  # ]:          0 :                 aPairVector.push_back( ::std::make_pair( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] ) );
         [ #  # ][ #  # ]
    2124                 :            : 
    2125         [ #  # ]:          0 :             while( nFirstIndex < nLastIndex )
    2126                 :            :             {
    2127         [ #  # ]:          0 :                 if( nFirstIndex & 1 )
    2128 [ #  # ][ #  # ]:          0 :                     aPairVector.push_back( ::std::make_pair( aPageVector[ nFirstIndex++ ], aPageVector[ nLastIndex-- ] ) );
         [ #  # ][ #  # ]
    2129                 :            :                 else
    2130 [ #  # ][ #  # ]:          0 :                     aPairVector.push_back( ::std::make_pair( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] ) );
         [ #  # ][ #  # ]
    2131                 :            :             }
    2132                 :            :         }
    2133                 :            : 
    2134         [ #  # ]:          0 :         for (sal_uInt32
    2135                 :          0 :                  nIndex=0,
    2136                 :          0 :                  nCount=aPairVector.size();
    2137                 :            :              nIndex < nCount;
    2138                 :            :              ++nIndex)
    2139                 :            :         {
    2140                 :          0 :             const bool bIsIndexOdd (nIndex & 1);
    2141 [ #  # ][ #  # ]:          0 :             if ((!bIsIndexOdd && mpOptions->IsPrintFrontPage())
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
    2142         [ #  # ]:          0 :                 || (bIsIndexOdd && mpOptions->IsPrintBackPage()))
    2143                 :            :             {
    2144         [ #  # ]:          0 :                 const ::std::pair<sal_uInt16, sal_uInt16> aPair (aPairVector[nIndex]);
    2145                 :          0 :                 Point aSecondOffset (aOffset);
    2146         [ #  # ]:          0 :                 if (rInfo.meOrientation == ORIENTATION_LANDSCAPE)
    2147                 :          0 :                     aSecondOffset.X() += aAdjustedPrintSize.Width() / 2;
    2148                 :            :                 else
    2149                 :          0 :                     aSecondOffset.Y() += aAdjustedPrintSize.Height() / 2;
    2150                 :            :                 maPrinterPages.push_back(
    2151                 :            :                     ::boost::shared_ptr<PrinterPage>(
    2152                 :            :                         new BookletPrinterPage(
    2153                 :            :                             aPair.first,
    2154                 :            :                             aPair.second,
    2155                 :            :                             aOffset,
    2156                 :            :                             aSecondOffset,
    2157                 :            :                             ePageKind,
    2158                 :            :                             aMap,
    2159                 :            :                             rInfo.mbPrintMarkedOnly,
    2160                 :            :                             rInfo.mnDrawMode,
    2161                 :            :                             rInfo.meOrientation,
    2162 [ #  # ][ #  # ]:          0 :                             rInfo.mpPrinter->GetPaperBin())));
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
    2163                 :            : 
    2164                 :            :             }
    2165 [ #  # ][ #  # ]:          0 :         }
    2166                 :          0 :     }
    2167                 :            : 
    2168                 :            : 
    2169                 :            : 
    2170                 :            : 
    2171                 :            :     /** Print one slide multiple times on one printer page so that the whole
    2172                 :            :         printer page is covered.
    2173                 :            :     */
    2174                 :          0 :     void PrepareTiledPage (
    2175                 :            :         const sal_Int32 nPageIndex,
    2176                 :            :         const SdPage& rPage,
    2177                 :            :         const PageKind ePageKind,
    2178                 :            :         const PrintInfo& rInfo)
    2179                 :            :     {
    2180                 :            :         sal_uInt16 nPaperBin;
    2181         [ #  # ]:          0 :         if ( ! mpOptions->IsPaperBin())
    2182                 :          0 :             nPaperBin = rPage.GetPaperBin();
    2183                 :            :         else
    2184                 :          0 :             nPaperBin = rInfo.mpPrinter->GetPaperBin();
    2185                 :            : 
    2186                 :            :         maPrinterPages.push_back(
    2187                 :            :             ::boost::shared_ptr<PrinterPage>(
    2188                 :            :                 new TiledPrinterPage(
    2189                 :          0 :                     sal::static_int_cast<sal_uInt16>(nPageIndex),
    2190                 :            :                     ePageKind,
    2191                 :            :                     500,
    2192                 :            :                     rInfo.mbPrintMarkedOnly,
    2193                 :            :                     rInfo.msPageString,
    2194                 :          0 :                     rInfo.mpPrinter->GetPageOffset(),
    2195                 :            :                     rInfo.mnDrawMode,
    2196                 :            :                     rInfo.meOrientation,
    2197 [ #  # ][ #  # ]:          0 :                     nPaperBin)));
         [ #  # ][ #  # ]
                 [ #  # ]
    2198                 :          0 :     }
    2199                 :            : 
    2200                 :            : 
    2201                 :            : 
    2202                 :            :     /** Print one standard slide or notes page on one to many printer
    2203                 :            :         pages.  More than on printer page is used when the slide is larger
    2204                 :            :         than the printable area.
    2205                 :            :     */
    2206                 :          0 :     void PrepareScaledPage (
    2207                 :            :         const sal_Int32 nPageIndex,
    2208                 :            :         const SdPage& rPage,
    2209                 :            :         const PageKind ePageKind,
    2210                 :            :         const PrintInfo& rInfo)
    2211                 :            :     {
    2212         [ #  # ]:          0 :         const Point aPageOffset (rInfo.mpPrinter->GetPageOffset());
    2213                 :            : 
    2214                 :            :         sal_uInt16 nPaperBin;
    2215 [ #  # ][ #  # ]:          0 :         if ( ! mpOptions->IsPaperBin())
    2216                 :          0 :             nPaperBin = rPage.GetPaperBin();
    2217                 :            :         else
    2218         [ #  # ]:          0 :             nPaperBin = rInfo.mpPrinter->GetPaperBin();
    2219                 :            : 
    2220                 :            :         // For pages larger then the printable area there
    2221                 :            :         // are three options:
    2222                 :            :         // 1. Scale down to the page to the printable area.
    2223                 :            :         // 2. Print only the upper left part of the page
    2224                 :            :         //    (without the unprintable borders).
    2225                 :            :         // 3. Split the page into parts of the size of the
    2226                 :            :         // printable area.
    2227         [ #  # ]:          0 :         const bool bScalePage (mpOptions->IsPageSize());
    2228         [ #  # ]:          0 :         const bool bCutPage (mpOptions->IsCutPage());
    2229         [ #  # ]:          0 :         MapMode aMap (rInfo.maMap);
    2230 [ #  # ][ #  # ]:          0 :         if (bScalePage || bCutPage)
    2231                 :            :         {
    2232                 :            :             // Handle 1 and 2.
    2233                 :            : 
    2234                 :            :             // if CutPage is set then do not move it, otherwise move the
    2235                 :            :             // scaled page to printable area
    2236                 :            :             maPrinterPages.push_back(
    2237                 :            :                 ::boost::shared_ptr<PrinterPage>(
    2238                 :            :                     new RegularPrinterPage(
    2239                 :          0 :                         sal::static_int_cast<sal_uInt16>(nPageIndex),
    2240                 :            :                         ePageKind,
    2241                 :            :                         aMap,
    2242                 :            :                         rInfo.mbPrintMarkedOnly,
    2243                 :            :                         rInfo.msPageString,
    2244                 :            :                         aPageOffset,
    2245                 :            :                         rInfo.mnDrawMode,
    2246                 :            :                         rInfo.meOrientation,
    2247 [ #  # ][ #  # ]:          0 :                         nPaperBin)));
         [ #  # ][ #  # ]
                 [ #  # ]
    2248                 :            :         }
    2249                 :            :         else
    2250                 :            :         {
    2251                 :            :             // Handle 3.  Print parts of the page in the size of the
    2252                 :            :             // printable area until the whole page is covered.
    2253                 :            : 
    2254                 :            :             // keep the page content at its position if it fits, otherwise
    2255                 :            :             // move it to the printable area
    2256                 :            :             const long nPageWidth (
    2257 [ #  # ][ #  # ]:          0 :                 rInfo.maPageSize.Width() - rPage.GetLftBorder() - rPage.GetRgtBorder());
    2258                 :            :             const long nPageHeight (
    2259 [ #  # ][ #  # ]:          0 :                 rInfo.maPageSize.Height() - rPage.GetUppBorder() - rPage.GetLwrBorder());
    2260                 :            : 
    2261                 :          0 :             Point aOrigin ( 0, 0 );
    2262                 :            : 
    2263         [ #  # ]:          0 :             for (Point aPageOrigin = aOrigin;
    2264                 :          0 :                  -aPageOrigin.Y()<nPageHeight;
    2265                 :          0 :                  aPageOrigin.Y() -= rInfo.maPrintSize.Height())
    2266                 :            :             {
    2267         [ #  # ]:          0 :                 for (aPageOrigin.X()=aOrigin.X();
    2268                 :          0 :                      -aPageOrigin.X()<nPageWidth;
    2269                 :          0 :                      aPageOrigin.X() -= rInfo.maPrintSize.Width())
    2270                 :            :                 {
    2271         [ #  # ]:          0 :                     aMap.SetOrigin(aPageOrigin);
    2272                 :            :                     maPrinterPages.push_back(
    2273                 :            :                         ::boost::shared_ptr<PrinterPage>(
    2274                 :            :                             new RegularPrinterPage(
    2275                 :          0 :                                 sal::static_int_cast<sal_uInt16>(nPageIndex),
    2276                 :            :                                 ePageKind,
    2277                 :            :                                 aMap,
    2278                 :            :                                 rInfo.mbPrintMarkedOnly,
    2279                 :            :                                 rInfo.msPageString,
    2280                 :            :                                 aPageOffset,
    2281                 :            :                                 rInfo.mnDrawMode,
    2282                 :            :                                 rInfo.meOrientation,
    2283 [ #  # ][ #  # ]:          0 :                                 nPaperBin)));
         [ #  # ][ #  # ]
                 [ #  # ]
    2284                 :            :                 }
    2285                 :            :             }
    2286         [ #  # ]:          0 :         }
    2287                 :          0 :     }
    2288                 :            : };
    2289                 :            : 
    2290                 :            : 
    2291                 :            : 
    2292                 :            : 
    2293                 :            : //===== DocumentRenderer ======================================================
    2294                 :            : 
    2295                 :          0 : DocumentRenderer::DocumentRenderer (ViewShellBase& rBase)
    2296                 :            :     : DocumentRendererInterfaceBase(m_aMutex),
    2297 [ #  # ][ #  # ]:          0 :       mpImpl(new Implementation(rBase))
    2298                 :            : {
    2299                 :          0 : }
    2300                 :            : 
    2301                 :            : 
    2302                 :            : 
    2303                 :            : 
    2304 [ #  # ][ #  # ]:          0 : DocumentRenderer::~DocumentRenderer()
    2305                 :            : {
    2306         [ #  # ]:          0 : }
    2307                 :            : 
    2308                 :            : 
    2309                 :            : 
    2310                 :            : 
    2311                 :            : //----- XRenderable -----------------------------------------------------------
    2312                 :            : 
    2313                 :          0 : sal_Int32 SAL_CALL DocumentRenderer::getRendererCount (
    2314                 :            :     const css::uno::Any& aSelection,
    2315                 :            :     const css::uno::Sequence<css::beans::PropertyValue >& rOptions)
    2316                 :            :     throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
    2317                 :            : {
    2318                 :            :     (void)aSelection;
    2319                 :          0 :     mpImpl->ProcessProperties(rOptions);
    2320                 :          0 :     return mpImpl->GetPrintPageCount();
    2321                 :            : }
    2322                 :            : 
    2323                 :            : 
    2324                 :            : 
    2325                 :            : 
    2326                 :          0 : Sequence<beans::PropertyValue> SAL_CALL DocumentRenderer::getRenderer (
    2327                 :            :     sal_Int32 nRenderer,
    2328                 :            :     const css::uno::Any& rSelection,
    2329                 :            :     const css::uno::Sequence<css::beans::PropertyValue>& rOptions)
    2330                 :            :     throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
    2331                 :            : {
    2332                 :            :     (void)nRenderer;
    2333                 :            :     (void)rSelection;
    2334                 :          0 :     mpImpl->ProcessProperties(rOptions);
    2335                 :          0 :     return mpImpl->GetProperties(rOptions);
    2336                 :            : }
    2337                 :            : 
    2338                 :            : 
    2339                 :            : 
    2340                 :            : 
    2341                 :          0 : void SAL_CALL DocumentRenderer::render (
    2342                 :            :     sal_Int32 nRenderer,
    2343                 :            :     const css::uno::Any& rSelection,
    2344                 :            :     const css::uno::Sequence<css::beans::PropertyValue>& rOptions)
    2345                 :            :     throw (css::lang::IllegalArgumentException, css::uno::RuntimeException)
    2346                 :            : {
    2347                 :            :     (void)rSelection;
    2348                 :          0 :     mpImpl->ProcessProperties(rOptions);
    2349                 :          0 :     mpImpl->PrintPage(nRenderer);
    2350                 :          0 : }
    2351                 :            : 
    2352                 :            : 
    2353                 :            : 
    2354                 :            : } // end of namespace sd
    2355                 :            : 
    2356                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10