LCOV - code coverage report
Current view: top level - sd/source/ui/dlg - dlgpage.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 34 0.0 %
Date: 2014-04-14 Functions: 0 4 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include <svl/intitem.hxx>
      21             : #include <svx/dialogs.hrc>
      22             : #include <svx/drawitem.hxx>
      23             : 
      24             : #include "sdresid.hxx"
      25             : #include "dlgpage.hxx"
      26             : 
      27             : #include "DrawDocShell.hxx"
      28             : #include <svl/aeitem.hxx>
      29             : #include <svx/flagsdef.hxx>
      30             : #include <svx/svxdlg.hxx>
      31             : #include <editeng/svxenum.hxx>
      32             : 
      33             : /**
      34             :  * Constructor of tab dialog: appends pages to the dialog
      35             :  */
      36           0 : SdPageDlg::SdPageDlg( SfxObjectShell* pDocSh, Window* pParent, const SfxItemSet* pAttr, sal_Bool bAreaPage ) :
      37             :         SfxTabDialog ( pParent
      38             :                       ,"DrawPageDialog"
      39             :                       ,"modules/sdraw/ui/drawpagedialog.ui"
      40             :                       , pAttr ),
      41           0 :         mpDocShell  ( pDocSh )
      42             : {
      43             :     SvxColorListItem aColorListItem(*( (const SvxColorListItem*)
      44           0 :         ( mpDocShell->GetItem( SID_COLOR_TABLE ) ) ) );
      45             :     SvxGradientListItem aGradientListItem(*( (const SvxGradientListItem*)
      46           0 :         ( mpDocShell->GetItem( SID_GRADIENT_LIST ) ) ) );
      47             :     SvxBitmapListItem aBitmapListItem(*( (const SvxBitmapListItem*)
      48           0 :         ( mpDocShell->GetItem( SID_BITMAP_LIST ) ) ) );
      49             :     SvxHatchListItem aHatchListItem(*( (const SvxHatchListItem*)
      50           0 :         ( mpDocShell->GetItem( SID_HATCH_LIST ) ) ) );
      51             : 
      52           0 :     mpColorList = aColorListItem.GetColorList();
      53           0 :     mpGradientList = aGradientListItem.GetGradientList();
      54           0 :     mpHatchingList = aHatchListItem.GetHatchList();
      55           0 :     mpBitmapList = aBitmapListItem.GetBitmapList();
      56             : 
      57           0 :     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
      58             :     OSL_ENSURE(pFact, "Dialogdiet fail!");
      59             : 
      60           0 :     mnPage = AddTabPage( "RID_SVXPAGE_PAGE", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), 0 );
      61           0 :     mnArea = AddTabPage( "RID_SVXPAGE_AREA", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_AREA ), 0 );
      62             : 
      63           0 :     if(!bAreaPage)  // I have to add the page before I remove it !
      64           0 :         RemoveTabPage( "RID_SVXPAGE_AREA" );
      65           0 : }
      66             : 
      67             : 
      68           0 : void SdPageDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage)
      69             : {
      70           0 :     SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
      71           0 :     if (nId == mnPage)
      72             :     {
      73           0 :         aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_ENUM_PAGE_MODE, SVX_PAGE_MODE_PRESENTATION));
      74           0 :         aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_START, PAPER_A0));
      75           0 :         aSet.Put (SfxAllEnumItem((const sal_uInt16)SID_PAPER_END, PAPER_E));
      76           0 :         rPage.PageCreated(aSet);
      77             :     }
      78           0 :     else if (nId == mnArea)
      79             :     {
      80           0 :         aSet.Put (SvxColorListItem(mpColorList,SID_COLOR_TABLE));
      81           0 :         aSet.Put (SvxGradientListItem(mpGradientList,SID_GRADIENT_LIST));
      82           0 :         aSet.Put (SvxHatchListItem(mpHatchingList,SID_HATCH_LIST));
      83           0 :         aSet.Put (SvxBitmapListItem(mpBitmapList,SID_BITMAP_LIST));
      84           0 :         aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,0));
      85           0 :         aSet.Put (SfxUInt16Item(SID_DLG_TYPE,1));
      86           0 :         aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,0));
      87           0 :         rPage.PageCreated(aSet);
      88           0 :     }
      89           0 : }
      90             : 
      91             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10