LCOV - code coverage report
Current view: top level - svx/source/items - rotmodit.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 32 46 69.6 %
Date: 2015-06-13 12:38:46 Functions: 13 16 81.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 <tools/stream.hxx>
      21             : #include <osl/diagnose.h>
      22             : #include <com/sun/star/table/BorderLine.hpp>
      23             : #include <com/sun/star/table/CellVertJustify2.hpp>
      24             : #include <com/sun/star/table/ShadowLocation.hpp>
      25             : #include <com/sun/star/table/TableBorder.hpp>
      26             : #include <com/sun/star/table/ShadowFormat.hpp>
      27             : #include <com/sun/star/table/CellRangeAddress.hpp>
      28             : #include <com/sun/star/table/CellContentType.hpp>
      29             : #include <com/sun/star/table/TableOrientation.hpp>
      30             : #include <com/sun/star/util/SortField.hpp>
      31             : #include <com/sun/star/util/SortFieldType.hpp>
      32             : #include <com/sun/star/table/CellOrientation.hpp>
      33             : #include <com/sun/star/table/CellAddress.hpp>
      34             : 
      35             : #include "svx/rotmodit.hxx"
      36             : 
      37             : using namespace ::com::sun::star;
      38             : 
      39      653948 : TYPEINIT1_FACTORY(SvxRotateModeItem, SfxEnumItem, new SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD, 0));
      40             : 
      41             : 
      42             : 
      43             : //  SvxRotateModeItem - orientation with turned text
      44             : 
      45             : 
      46        4315 : SvxRotateModeItem::SvxRotateModeItem( SvxRotateMode eMode, sal_uInt16 _nWhich )
      47        4315 :     : SfxEnumItem( _nWhich, (sal_uInt16)eMode )
      48             : {
      49        4315 : }
      50             : 
      51         301 : SvxRotateModeItem::SvxRotateModeItem( const SvxRotateModeItem& rItem )
      52         301 :     : SfxEnumItem( rItem )
      53             : {
      54         301 : }
      55             : 
      56        6625 : SvxRotateModeItem::~SvxRotateModeItem()
      57             : {
      58        6625 : }
      59             : 
      60         512 : SfxPoolItem* SvxRotateModeItem::Create( SvStream& rStream, sal_uInt16 ) const
      61             : {
      62             :     sal_uInt16 nVal;
      63         512 :     rStream.ReadUInt16( nVal );
      64         512 :     return new SvxRotateModeItem( (SvxRotateMode) nVal,Which() );
      65             : }
      66             : 
      67           0 : bool SvxRotateModeItem::GetPresentation(
      68             :                                 SfxItemPresentation ePres,
      69             :                                 SfxMapUnit /*eCoreUnit*/, SfxMapUnit /*ePresUnit*/,
      70             :                                 OUString& rText, const IntlWrapper * )  const
      71             : {
      72           0 :     rText.clear();
      73             : 
      74           0 :     switch ( ePres )
      75             :     {
      76             :         case SFX_ITEM_PRESENTATION_COMPLETE:
      77           0 :             rText += "...: ";
      78             : //          break; // FALL THROUGH!!!
      79             : 
      80             :         case SFX_ITEM_PRESENTATION_NAMELESS:
      81           0 :             rText += OUString( GetValue() );
      82           0 :             return true;
      83             :             break;
      84             :         default: ;//prevent warning
      85             :     }
      86             : 
      87           0 :     return false;
      88             : }
      89             : 
      90           0 : sal_uInt16 SvxRotateModeItem::GetValueCount() const
      91             : {
      92           0 :     return 4;       // STANDARD, TOP, CENTER, BOTTOM
      93             : }
      94             : 
      95         269 : SfxPoolItem* SvxRotateModeItem::Clone( SfxItemPool* ) const
      96             : {
      97         269 :     return new SvxRotateModeItem( *this );
      98             : }
      99             : 
     100         530 : sal_uInt16 SvxRotateModeItem::GetVersion( sal_uInt16 /*nFileVersion*/ ) const
     101             : {
     102         530 :     return 0;
     103             : }
     104             : 
     105          22 : bool SvxRotateModeItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
     106             : {
     107          22 :     sal_Int32 nUno = table::CellVertJustify2::STANDARD;
     108          22 :     switch ( (SvxRotateMode)GetValue() )
     109             :     {
     110          16 :         case SVX_ROTATE_MODE_STANDARD: nUno = table::CellVertJustify2::STANDARD; break;
     111           0 :         case SVX_ROTATE_MODE_TOP:      nUno = table::CellVertJustify2::TOP;      break;
     112           0 :         case SVX_ROTATE_MODE_CENTER:   nUno = table::CellVertJustify2::CENTER;   break;
     113           6 :         case SVX_ROTATE_MODE_BOTTOM:   nUno = table::CellVertJustify2::BOTTOM;   break;
     114             :     }
     115          22 :     rVal <<= nUno;
     116          22 :     return true;
     117             : }
     118             : 
     119          34 : bool SvxRotateModeItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
     120             : {
     121          34 :     sal_Int32 nUno(0);
     122          34 :     if(!(rVal >>= nUno))
     123             :     {
     124           0 :         nUno = table::CellVertJustify2::STANDARD;
     125             :     }
     126             : 
     127          34 :     SvxRotateMode eSvx = SVX_ROTATE_MODE_STANDARD;
     128          34 :     switch (nUno)
     129             :     {
     130          29 :         case table::CellVertJustify2::STANDARD: eSvx = SVX_ROTATE_MODE_STANDARD; break;
     131           0 :         case table::CellVertJustify2::TOP:      eSvx = SVX_ROTATE_MODE_TOP;      break;
     132           0 :         case table::CellVertJustify2::CENTER:   eSvx = SVX_ROTATE_MODE_CENTER;   break;
     133           1 :         case table::CellVertJustify2::BOTTOM:   eSvx = SVX_ROTATE_MODE_BOTTOM;   break;
     134             :         default: ;//prevent warning
     135             :     }
     136          34 :     SetValue( (sal_uInt16)eSvx );
     137          34 :     return true;
     138             : }
     139             : 
     140             : 
     141             : 
     142             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11