LCOV - code coverage report
Current view: top level - libreoffice/reportdesign/source/core/sdr - ReportUndoFactory.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 60 0.0 %
Date: 2012-12-27 Functions: 0 26 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             : #include "ReportUndoFactory.hxx"
      20             : #include "RptObject.hxx"
      21             : #include "UndoActions.hxx"
      22             : #include "RptResId.hrc"
      23             : 
      24             : namespace rptui
      25             : {
      26             :     using namespace ::com::sun::star;
      27             : // -----------------------------------------------------------------------------
      28           0 : SdrUndoAction* lcl_createUndo(SdrObject& rObject,Action _eAction,sal_uInt16 _nCommentId)
      29             : {
      30           0 :     OObjectBase* pObj = dynamic_cast<OObjectBase*>(&rObject);
      31           0 :     if ( !pObj )
      32           0 :         return NULL;
      33           0 :     uno::Reference< report::XReportComponent> xReportComponent = pObj->getReportComponent();
      34           0 :     uno::Reference< report::XSection> xSection = pObj->getSection();
      35           0 :     uno::Reference< report::XGroup> xGroup = xSection->getGroup();
      36           0 :     SdrUndoAction* pUndo = NULL;
      37           0 :     if ( xGroup.is() )
      38           0 :         pUndo = new OUndoGroupSectionAction(*rObject.GetModel(),_eAction,OGroupHelper::getMemberFunction(xSection),xGroup,xReportComponent,_nCommentId);
      39             :     else
      40           0 :         pUndo = new OUndoReportSectionAction(*rObject.GetModel(),_eAction,OReportHelper::getMemberFunction(xSection),xSection->getReportDefinition(),xReportComponent,_nCommentId);
      41           0 :     return pUndo;
      42             : }
      43             : // -----------------------------------------------------------------------------
      44             : DBG_NAME( rpt_OReportUndoFactory )
      45             : // -----------------------------------------------------------------------------
      46           0 : OReportUndoFactory::OReportUndoFactory() : m_pUndoFactory(new SdrUndoFactory)
      47             : {
      48             :     DBG_CTOR( rpt_OReportUndoFactory,NULL);
      49           0 : }
      50             : // -----------------------------------------------------------------------------
      51           0 : OReportUndoFactory::~OReportUndoFactory()
      52             : {
      53             :     DBG_DTOR( rpt_OReportUndoFactory,NULL);
      54           0 : }
      55             : ///////////////////////////////////////////////////////////////////////
      56             : // shapes
      57           0 : SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject )
      58             : {
      59           0 :     return m_pUndoFactory->CreateUndoMoveObject( rObject );
      60             : }
      61             : 
      62           0 : SdrUndoAction* OReportUndoFactory::CreateUndoMoveObject( SdrObject& rObject, const Size& rDist )
      63             : {
      64           0 :     return m_pUndoFactory->CreateUndoMoveObject( rObject, rDist );
      65             : }
      66             : 
      67           0 : SdrUndoAction* OReportUndoFactory::CreateUndoGeoObject( SdrObject& rObject )
      68             : {
      69           0 :     return m_pUndoFactory->CreateUndoGeoObject( rObject );
      70             : }
      71             : 
      72           0 : SdrUndoAction* OReportUndoFactory::CreateUndoAttrObject( SdrObject& rObject, bool bStyleSheet1, bool bSaveText )
      73             : {
      74           0 :     return m_pUndoFactory->CreateUndoAttrObject( rObject, bStyleSheet1 ? sal_True : sal_False, bSaveText ? sal_True : sal_False );
      75             : }
      76             : 
      77           0 : SdrUndoAction* OReportUndoFactory::CreateUndoRemoveObject( SdrObject& rObject, bool bOrdNumDirect )
      78             : {
      79           0 :     return m_pUndoFactory->CreateUndoRemoveObject( rObject, bOrdNumDirect ? sal_True : sal_False );
      80             : }
      81             : 
      82           0 : SdrUndoAction* OReportUndoFactory::CreateUndoInsertObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
      83             : {
      84           0 :     return lcl_createUndo(rObject,rptui::Inserted,RID_STR_UNDO_INSERT_CONTROL);
      85             : }
      86             : 
      87           0 : SdrUndoAction* OReportUndoFactory::CreateUndoDeleteObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
      88             : {
      89           0 :     return lcl_createUndo(rObject,rptui::Removed,RID_STR_UNDO_DELETE_CONTROL);
      90             : }
      91             : 
      92           0 : SdrUndoAction* OReportUndoFactory::CreateUndoNewObject( SdrObject& rObject, bool /*bOrdNumDirect*/ )
      93             : {
      94           0 :     return lcl_createUndo(rObject,rptui::Inserted,RID_STR_UNDO_INSERT_CONTROL);
      95             : }
      96             : 
      97           0 : SdrUndoAction* OReportUndoFactory::CreateUndoCopyObject( SdrObject& rObject, bool bOrdNumDirect )
      98             : {
      99           0 :     return m_pUndoFactory->CreateUndoCopyObject( rObject, bOrdNumDirect ? sal_True : sal_False );
     100             : }
     101             : 
     102           0 : SdrUndoAction* OReportUndoFactory::CreateUndoObjectOrdNum( SdrObject& rObject, sal_uInt32 nOldOrdNum1, sal_uInt32 nNewOrdNum1)
     103             : {
     104           0 :     return m_pUndoFactory->CreateUndoObjectOrdNum( rObject, nOldOrdNum1, nNewOrdNum1 );
     105             : }
     106             : 
     107           0 : SdrUndoAction* OReportUndoFactory::CreateUndoReplaceObject( SdrObject& rOldObject, SdrObject& rNewObject, bool bOrdNumDirect )
     108             : {
     109           0 :     return m_pUndoFactory->CreateUndoReplaceObject( rOldObject, rNewObject, bOrdNumDirect ? sal_True : sal_False );
     110             : }
     111             : 
     112           0 : SdrUndoAction* OReportUndoFactory::CreateUndoObjectLayerChange( SdrObject& rObject, SdrLayerID aOldLayer, SdrLayerID aNewLayer )
     113             : {
     114           0 :     return m_pUndoFactory->CreateUndoObjectLayerChange( rObject, aOldLayer, aNewLayer );
     115             : }
     116             : 
     117           0 : SdrUndoAction* OReportUndoFactory::CreateUndoObjectSetText( SdrObject& rNewObj, sal_Int32 nText )
     118             : {
     119           0 :     return m_pUndoFactory->CreateUndoObjectSetText( rNewObj, nText );
     120             : }
     121             : 
     122             : // layer
     123           0 : SdrUndoAction* OReportUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
     124             : {
     125           0 :     return m_pUndoFactory->CreateUndoNewLayer( nLayerNum, rNewLayerAdmin, rNewModel );
     126             : }
     127             : 
     128           0 : SdrUndoAction* OReportUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel)
     129             : {
     130           0 :     return m_pUndoFactory->CreateUndoDeleteLayer( nLayerNum, rNewLayerAdmin, rNewModel );
     131             : }
     132             : 
     133           0 : SdrUndoAction* OReportUndoFactory::CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1)
     134             : {
     135           0 :     return m_pUndoFactory->CreateUndoMoveLayer( nLayerNum, rNewLayerAdmin, rNewModel, nNeuPos1 );
     136             : }
     137             : 
     138             : // page
     139           0 : SdrUndoAction*  OReportUndoFactory::CreateUndoDeletePage(SdrPage& rPage)
     140             : {
     141           0 :     return m_pUndoFactory->CreateUndoDeletePage( rPage );
     142             : }
     143             : 
     144           0 : SdrUndoAction* OReportUndoFactory::CreateUndoNewPage(SdrPage& rPage)
     145             : {
     146           0 :     return m_pUndoFactory->CreateUndoNewPage( rPage );
     147             : }
     148             : 
     149           0 : SdrUndoAction* OReportUndoFactory::CreateUndoCopyPage(SdrPage& rPage)
     150             : {
     151           0 :     return m_pUndoFactory->CreateUndoCopyPage( rPage );
     152             : }
     153             : 
     154           0 : SdrUndoAction* OReportUndoFactory::CreateUndoSetPageNum(SdrPage& rNewPg, sal_uInt16 nOldPageNum1, sal_uInt16 nNewPageNum1)
     155             : {
     156           0 :     return m_pUndoFactory->CreateUndoSetPageNum( rNewPg, nOldPageNum1, nNewPageNum1 );
     157             : }
     158             :     // master page
     159           0 : SdrUndoAction* OReportUndoFactory::CreateUndoPageRemoveMasterPage(SdrPage& rChangedPage)
     160             : {
     161           0 :     return m_pUndoFactory->CreateUndoPageRemoveMasterPage( rChangedPage );
     162             : }
     163             : 
     164           0 : SdrUndoAction* OReportUndoFactory::CreateUndoPageChangeMasterPage(SdrPage& rChangedPage)
     165             : {
     166           0 :     return m_pUndoFactory->CreateUndoPageChangeMasterPage(rChangedPage);
     167             : }
     168             : 
     169             : //==================================================================
     170             : }   //rptui
     171             : //==================================================================
     172             : 
     173             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10