LCOV - code coverage report
Current view: top level - reportdesign/source/ui/report - dlgedfac.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 1 30 3.3 %
Date: 2015-06-13 12:38:46 Functions: 2 6 33.3 %
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             : #include "dlgedfac.hxx"
      20             : #include "uistrings.hrc"
      21             : #include "RptObject.hxx"
      22             : #include <RptDef.hxx>
      23             : #include <com/sun/star/container/XNameContainer.hpp>
      24             : #include <com/sun/star/lang/XServiceInfo.hpp>
      25             : #include <com/sun/star/beans/PropertyValue.hpp>
      26             : #include <com/sun/star/beans/XPropertySet.hpp>
      27             : #include <com/sun/star/awt/ScrollBarOrientation.hpp>
      28             : #include <svx/svdoole2.hxx>
      29             : namespace rptui
      30             : {
      31             : using namespace ::com::sun::star;
      32             : 
      33             : 
      34             : 
      35           0 : DlgEdFactory::DlgEdFactory()
      36             : {
      37           0 :     SdrObjFactory::InsertMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
      38           0 : }
      39             : 
      40             : 
      41             : 
      42           0 : DlgEdFactory::~DlgEdFactory()
      43             : {
      44           0 :     SdrObjFactory::RemoveMakeObjectHdl( LINK(this, DlgEdFactory, MakeObject) );
      45           0 : }
      46             : 
      47             : 
      48             : 
      49           0 : IMPL_STATIC_LINK(
      50             :     DlgEdFactory, MakeObject, SdrObjFactory *, pObjFactory )
      51             : {
      52           0 :     if ( pObjFactory->nInventor == ReportInventor )
      53             :     {
      54           0 :         switch( pObjFactory->nIdentifier )
      55             :         {
      56             :             case OBJ_DLG_FIXEDTEXT:
      57             :                     pObjFactory->pNewObj = new OUnoObject( SERVICE_FIXEDTEXT
      58             :                                                         ,OUString("com.sun.star.form.component.FixedText")
      59           0 :                                                         ,OBJ_DLG_FIXEDTEXT);
      60           0 :                     break;
      61             :             case OBJ_DLG_IMAGECONTROL:
      62             :                     pObjFactory->pNewObj = new OUnoObject( SERVICE_IMAGECONTROL
      63             :                                                         ,OUString("com.sun.star.form.component.DatabaseImageControl")
      64           0 :                                                         ,OBJ_DLG_IMAGECONTROL);
      65           0 :                     break;
      66             :             case OBJ_DLG_FORMATTEDFIELD:
      67             :                     pObjFactory->pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD
      68             :                                                         ,OUString("com.sun.star.form.component.FormattedField")
      69           0 :                                                         ,OBJ_DLG_FORMATTEDFIELD);
      70           0 :                     break;
      71             :             case OBJ_DLG_VFIXEDLINE:
      72             :             case OBJ_DLG_HFIXEDLINE:
      73             :                 {
      74             :                     OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE
      75             :                                                         ,OUString("com.sun.star.awt.UnoControlFixedLineModel")
      76           0 :                                                         ,pObjFactory->nIdentifier);
      77           0 :                     pObjFactory->pNewObj = pObj;
      78           0 :                     if ( pObjFactory->nIdentifier == OBJ_DLG_HFIXEDLINE )
      79             :                     {
      80           0 :                         uno::Reference<beans::XPropertySet> xProp = pObj->getAwtComponent();
      81           0 :                         xProp->setPropertyValue( PROPERTY_ORIENTATION, uno::makeAny(sal_Int32(0)) );
      82             :                     }
      83             :                 }
      84           0 :                 break;
      85             :             case OBJ_CUSTOMSHAPE:
      86           0 :                 pObjFactory->pNewObj = new OCustomShape(SERVICE_SHAPE);
      87           0 :                 break;
      88             :             case OBJ_DLG_SUBREPORT:
      89           0 :                 pObjFactory->pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT);
      90           0 :                 break;
      91             :             case OBJ_OLE2:
      92           0 :                 pObjFactory->pNewObj = new OOle2Obj(OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2);
      93           0 :                 break;
      94             :             default:
      95             :                 OSL_FAIL("Unknown object id");
      96           0 :                 break;
      97             :         }
      98             :     }
      99             : 
     100           0 :     return 0;
     101             : }
     102             : 
     103           3 : }
     104             : 
     105             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11