LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/sd/source/ui/dlg - inspagob.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 38 0.0 %
Date: 2013-07-09 Functions: 0 11 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 "inspagob.hxx"
      21             : 
      22             : #include "strings.hrc"
      23             : #include "res_bmp.hrc"
      24             : #include "sdresid.hxx"
      25             : #include "drawdoc.hxx"
      26             : #include "DrawDocShell.hxx"
      27             : #include "ViewShell.hxx"
      28             : #include "inspagob.hrc"
      29             : 
      30             : 
      31           0 : SdInsertPagesObjsDlg::SdInsertPagesObjsDlg(
      32             :     ::Window* pWindow,
      33             :     const SdDrawDocument* pInDoc,
      34             :     SfxMedium* pSfxMedium,
      35             :     const String& rFileName )
      36             :     : ModalDialog     ( pWindow, SdResId( DLG_INSERT_PAGES_OBJS ) ),
      37             :       aLbTree         ( this, SdResId( LB_TREE ) ),
      38             :       aCbxLink        ( this, SdResId( CBX_LINK ) ),
      39             :       aCbxMasters     ( this, SdResId( CBX_CHECK_MASTERS ) ),
      40             :       aBtnOk          ( this, SdResId( BTN_OK ) ),
      41             :       aBtnCancel      ( this, SdResId( BTN_CANCEL ) ),
      42             :       aBtnHelp        ( this, SdResId( BTN_HELP ) ),
      43             :       pMedium       ( pSfxMedium ),
      44             :       mpDoc         ( pInDoc ),
      45           0 :       rName         ( rFileName )
      46             : {
      47           0 :     FreeResource();
      48             : 
      49           0 :     aLbTree.SetViewFrame( ( (SdDrawDocument*) pInDoc )->GetDocSh()->GetViewShell()->GetViewFrame() );
      50             : 
      51           0 :     aLbTree.SetSelectHdl( LINK( this, SdInsertPagesObjsDlg, SelectObjectHdl ) );
      52             : 
      53             :     // insert text
      54           0 :     if( !pMedium )
      55           0 :         SetText( String( SdResId( STR_INSERT_TEXT ) ) );
      56             : 
      57           0 :     Reset();
      58           0 : }
      59             : 
      60             : 
      61           0 : SdInsertPagesObjsDlg::~SdInsertPagesObjsDlg()
      62             : {
      63           0 : }
      64             : 
      65             : /**
      66             :  * Fills the TreeLB dependent on the medium. Is not medium available, then
      67             :  * it is a text and not a draw document.
      68             :  */
      69           0 : void SdInsertPagesObjsDlg::Reset()
      70             : {
      71           0 :     if( pMedium )
      72             :     {
      73           0 :         aLbTree.SetSelectionMode( MULTIPLE_SELECTION );
      74             : 
      75             :         // transfer ownership of Medium
      76           0 :         aLbTree.Fill( mpDoc, pMedium, rName );
      77             :     }
      78             :     else
      79             :     {
      80           0 :         Color aColor( COL_WHITE );
      81           0 :         Bitmap aBmpText( SdResId( BMP_DOC_TEXT ) );
      82           0 :         Image aImgText( aBmpText, aColor );
      83           0 :         aLbTree.InsertEntry( rName, aImgText, aImgText );
      84             :     }
      85             : 
      86           0 :     aCbxMasters.Check( sal_True );
      87           0 : }
      88             : 
      89           0 : std::vector<OUString> SdInsertPagesObjsDlg::GetList( const sal_uInt16 nType )
      90             : {
      91             :     // With Draw documents, we have to return NULL on selection of the document
      92           0 :     if( pMedium )
      93             :     {
      94             :         // to ensure that bookmarks are opened
      95             :         // (when the whole document is selected)
      96           0 :         aLbTree.GetBookmarkDoc();
      97             : 
      98             :         // If the document is selected (too) or nothing is selected,
      99             :         // the whole document is inserted (but not more!)
     100           0 :         if( aLbTree.GetSelectionCount() == 0 ||
     101           0 :             ( aLbTree.IsSelected( aLbTree.First() ) ) )
     102           0 :             return std::vector<OUString>();
     103             :     }
     104             : 
     105           0 :     return aLbTree.GetSelectEntryList( nType );
     106             : }
     107             : 
     108             : /**
     109             :  *  is link checked
     110             :  */
     111           0 : sal_Bool SdInsertPagesObjsDlg::IsLink()
     112             : {
     113           0 :     return( aCbxLink.IsChecked() );
     114             : }
     115             : 
     116             : /**
     117             :  *  is link checked
     118             :  */
     119           0 : sal_Bool SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
     120             : {
     121           0 :     return( aCbxMasters.IsChecked() );
     122             : }
     123             : 
     124             : /**
     125             :  * Enabled and selects end-color-LB
     126             :  */
     127           0 : IMPL_LINK_NOARG(SdInsertPagesObjsDlg, SelectObjectHdl)
     128             : {
     129           0 :     if( aLbTree.IsLinkableSelected() )
     130           0 :         aCbxLink.Enable();
     131             :     else
     132           0 :         aCbxLink.Disable();
     133             : 
     134           0 :     return( 0 );
     135           0 : }
     136             : 
     137             : 
     138             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10