LCOV - code coverage report
Current view: top level - chart2/source/controller/dialogs - tp_TitleRotation.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 43 2.3 %
Date: 2014-11-03 Functions: 2 9 22.2 %
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 "tp_TitleRotation.hxx"
      21             : 
      22             : #include "ResId.hxx"
      23             : #include "ResourceIds.hrc"
      24             : #include "chartview/ChartSfxItemIds.hxx"
      25             : #include "HelpIds.hrc"
      26             : 
      27             : #include <editeng/eeitem.hxx>
      28             : #include <editeng/frmdiritem.hxx>
      29             : #include <svl/intitem.hxx>
      30             : 
      31             : namespace chart
      32             : {
      33             : 
      34           0 : SchAlignmentTabPage::SchAlignmentTabPage(vcl::Window* pWindow,
      35             :                                          const SfxItemSet& rInAttrs, bool bWithRotation) :
      36           0 :     SfxTabPage(pWindow, "TitleRotationTabPage","modules/schart/ui/titlerotationtabpage.ui", &rInAttrs)
      37             : {
      38           0 :     get(m_pCtrlDial,"dialCtrl");
      39           0 :     get(m_pFtRotate,"degreeL");
      40           0 :     get(m_pNfRotate,"OrientDegree");
      41           0 :     get(m_pCbStacked,"stackedCB");
      42           0 :     get(m_pFtTextDirection,"textdirL");
      43           0 :     get(m_pLbTextDirection,"textdirLB");
      44           0 :     get(m_pFtABCD,"labelABCD");
      45           0 :     m_pCtrlDial->SetText(m_pFtABCD->GetText());
      46           0 :     m_pOrientHlp = new svx::OrientationHelper(*m_pCtrlDial, *m_pNfRotate, *m_pCbStacked);
      47             : 
      48           0 :     m_pCbStacked->EnableTriState( false );
      49           0 :     m_pOrientHlp->Enable( true );
      50           0 :     m_pOrientHlp->AddDependentWindow( *m_pFtRotate, TRISTATE_TRUE );
      51             : 
      52           0 :     if( !bWithRotation )
      53             :     {
      54           0 :         m_pOrientHlp->Hide();
      55             :     }
      56           0 : }
      57             : 
      58           0 : SchAlignmentTabPage::~SchAlignmentTabPage()
      59             : {
      60           0 :     delete m_pOrientHlp;
      61           0 : }
      62             : 
      63           0 : SfxTabPage* SchAlignmentTabPage::Create(vcl::Window* pParent,
      64             :                                         const SfxItemSet* rInAttrs)
      65             : {
      66           0 :     return new SchAlignmentTabPage(pParent, *rInAttrs);
      67             : }
      68             : 
      69           0 : SfxTabPage* SchAlignmentTabPage::CreateWithoutRotation(vcl::Window* pParent,
      70             :                                         const SfxItemSet* rInAttrs)
      71             : {
      72           0 :     return new SchAlignmentTabPage(pParent, *rInAttrs, false);
      73             : }
      74             : 
      75           0 : bool SchAlignmentTabPage::FillItemSet(SfxItemSet* rOutAttrs)
      76             : {
      77             :     //Since 04/1998 text can be rotated by an arbitrary angle: SCHATTR_TEXT_DEGREES
      78           0 :     bool bStacked = m_pOrientHlp->GetStackedState() == TRISTATE_TRUE;
      79           0 :     rOutAttrs->Put( SfxBoolItem( SCHATTR_TEXT_STACKED, bStacked ) );
      80             : 
      81           0 :     sal_Int32 nDegrees = bStacked ? 0 : m_pCtrlDial->GetRotation();
      82           0 :     rOutAttrs->Put( SfxInt32Item( SCHATTR_TEXT_DEGREES, nDegrees ) );
      83             : 
      84           0 :     SvxFrameDirection aDirection( m_pLbTextDirection->GetSelectEntryValue() );
      85           0 :     rOutAttrs->Put( SvxFrameDirectionItem( aDirection, EE_PARA_WRITINGDIR ) );
      86             : 
      87           0 :     return true;
      88             : }
      89             : 
      90           0 : void SchAlignmentTabPage::Reset(const SfxItemSet* rInAttrs)
      91             : {
      92           0 :     const SfxPoolItem* pItem = GetItem( *rInAttrs, SCHATTR_TEXT_DEGREES );
      93             : 
      94           0 :     sal_Int32 nDegrees = pItem ? static_cast<const SfxInt32Item*>(pItem)->GetValue() : 0;
      95           0 :     m_pCtrlDial->SetRotation( nDegrees );
      96             : 
      97           0 :     pItem = GetItem( *rInAttrs, SCHATTR_TEXT_STACKED );
      98           0 :     bool bStacked = pItem && static_cast<const SfxBoolItem*>(pItem)->GetValue();
      99           0 :     m_pOrientHlp->SetStackedState( bStacked ? TRISTATE_TRUE : TRISTATE_FALSE );
     100             : 
     101           0 :     if( rInAttrs->GetItemState(EE_PARA_WRITINGDIR, true, &pItem) == SfxItemState::SET)
     102           0 :         m_pLbTextDirection->SelectEntryValue( SvxFrameDirection(static_cast<const SvxFrameDirectionItem*>(pItem)->GetValue()) );
     103           0 : }
     104             : 
     105         102 : } //namespace chart
     106             : 
     107             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10