LCOV - code coverage report
Current view: top level - sw/source/ui/vba - vbarows.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 180 0.0 %
Date: 2012-08-25 Functions: 0 27 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 367 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2008 by Sun Microsystems, Inc.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #include "vbarows.hxx"
      29                 :            : #include "vbarow.hxx"
      30                 :            : #include <com/sun/star/text/HoriOrientation.hpp>
      31                 :            : #include <com/sun/star/table/XCellRange.hpp>
      32                 :            : #include <ooo/vba/word/WdRowAlignment.hpp>
      33                 :            : #include <ooo/vba/word/WdConstants.hpp>
      34                 :            : #include <ooo/vba/word/WdRulerStyle.hpp>
      35                 :            : #include "wordvbahelper.hxx"
      36                 :            : #include "vbacolumns.hxx"
      37                 :            : #include "vbatablehelper.hxx"
      38                 :            : 
      39                 :            : using namespace ::ooo::vba;
      40                 :            : using namespace ::com::sun::star;
      41                 :            : 
      42 [ #  # ][ #  # ]:          0 : class RowsEnumWrapper : public EnumerationHelper_BASE
      43                 :            : {
      44                 :            :     uno::WeakReference< XHelperInterface > mxParent;
      45                 :            :     uno::Reference< uno::XComponentContext > mxContext;
      46                 :            :     uno::Reference< text::XTextTable > mxTextTable;
      47                 :            :     uno::Reference< container::XIndexAccess > mxIndexAccess;
      48                 :            :     sal_Int32 nIndex;
      49                 :            : 
      50                 :            : public:
      51         [ #  # ]:          0 :     RowsEnumWrapper( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< text::XTextTable >& xTextTable ) : mxParent( xParent ), mxContext( xContext ), mxTextTable( xTextTable ), nIndex( 0 )
      52                 :            :     {
      53 [ #  # ][ #  # ]:          0 :         mxIndexAccess.set( mxTextTable->getRows(), uno::UNO_QUERY );
                 [ #  # ]
      54                 :          0 :     }
      55                 :          0 :     virtual ::sal_Bool SAL_CALL hasMoreElements(  ) throw (uno::RuntimeException)
      56                 :            :     {
      57                 :          0 :         return ( nIndex < mxIndexAccess->getCount() );
      58                 :            :     }
      59                 :            : 
      60                 :          0 :     virtual uno::Any SAL_CALL nextElement(  ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException)
      61                 :            :     {
      62         [ #  # ]:          0 :         if( nIndex < mxIndexAccess->getCount() )
      63                 :            :         {
      64 [ #  # ][ #  # ]:          0 :             return uno::makeAny( uno::Reference< word::XRow > ( new SwVbaRow( mxParent, mxContext, mxTextTable, nIndex++ ) ) );
         [ #  # ][ #  # ]
      65                 :            :         }
      66         [ #  # ]:          0 :         throw container::NoSuchElementException();
      67                 :            :     }
      68                 :            : };
      69                 :            : 
      70         [ #  # ]:          0 : SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows ) throw (uno::RuntimeException) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows )
      71                 :            : {
      72                 :          0 :     mnStartRowIndex = 0;
      73 [ #  # ][ #  # ]:          0 :     mnEndRowIndex = m_xIndexAccess->getCount() - 1;
      74                 :          0 : }
      75                 :            : 
      76         [ #  # ]:          0 : SwVbaRows::SwVbaRows( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< text::XTextTable >& xTextTable, const uno::Reference< table::XTableRows >& xTableRows, sal_Int32 nStarIndex, sal_Int32 nEndIndex ) throw (uno::RuntimeException) : SwVbaRows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess >( xTableRows, uno::UNO_QUERY_THROW ) ), mxTextTable( xTextTable ), mxTableRows( xTableRows ), mnStartRowIndex( nStarIndex ), mnEndRowIndex( nEndIndex )
      77                 :            : {
      78         [ #  # ]:          0 :     if( mnEndRowIndex < mnStartRowIndex )
      79         [ #  # ]:          0 :         throw uno::RuntimeException();
      80                 :          0 : }
      81                 :            : 
      82                 :            : /**
      83                 :            :  * get the alignment of the rows: SO format com.sun.star.text.HoriOrientation
      84                 :            :  * is mapped to WdRowAlignment in Word
      85                 :            :  * @return the alignment
      86                 :            :  */
      87                 :          0 : ::sal_Int32 SAL_CALL SwVbaRows::getAlignment() throw (uno::RuntimeException)
      88                 :            : {
      89                 :          0 :     sal_Int16 nAlignment = text::HoriOrientation::LEFT;
      90         [ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
      91 [ #  # ][ #  # ]:          0 :     xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ) ) >>= nAlignment;
                 [ #  # ]
      92                 :          0 :     sal_Int32 nRet = 0;
      93      [ #  #  # ]:          0 :     switch( nAlignment )
      94                 :            :     {
      95                 :            :         case text::HoriOrientation::CENTER:
      96                 :            :         {
      97                 :          0 :            nRet = word::WdRowAlignment::wdAlignRowCenter;
      98                 :          0 :            break;
      99                 :            :         }
     100                 :            :         case text::HoriOrientation::RIGHT:
     101                 :            :         {
     102                 :          0 :             nRet = word::WdRowAlignment::wdAlignRowRight;
     103                 :          0 :             break;
     104                 :            :         }
     105                 :            :         default:
     106                 :            :         {
     107                 :          0 :             nRet = word::WdRowAlignment::wdAlignRowLeft;
     108                 :            :         }
     109                 :            :     }
     110                 :          0 :     return nRet;
     111                 :            : }
     112                 :            : 
     113                 :          0 : void SAL_CALL SwVbaRows::setAlignment( ::sal_Int32 _alignment ) throw (uno::RuntimeException)
     114                 :            : {
     115                 :          0 :     sal_Int16 nAlignment = text::HoriOrientation::LEFT;
     116      [ #  #  # ]:          0 :     switch( _alignment )
     117                 :            :     {
     118                 :            :         case word::WdRowAlignment::wdAlignRowCenter:
     119                 :            :         {
     120                 :          0 :             nAlignment = text::HoriOrientation::CENTER;
     121                 :          0 :             break;
     122                 :            :         }
     123                 :            :         case word::WdRowAlignment::wdAlignRowRight:
     124                 :            :         {
     125                 :          0 :             nAlignment = text::HoriOrientation::RIGHT;
     126                 :          0 :             break;
     127                 :            :         }
     128                 :            :         default:
     129                 :            :         {
     130                 :          0 :             nAlignment = text::HoriOrientation::LEFT;
     131                 :            :         }
     132                 :            :     }
     133         [ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
     134 [ #  # ][ #  # ]:          0 :     xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ), uno::makeAny( nAlignment ) );
         [ #  # ][ #  # ]
     135                 :          0 : }
     136                 :            : 
     137                 :          0 : uno::Any SAL_CALL SwVbaRows::getAllowBreakAcrossPages() throw (uno::RuntimeException)
     138                 :            : {
     139                 :          0 :     sal_Bool bAllowBreak = sal_False;
     140         [ #  # ]:          0 :     uno::Reference< container::XIndexAccess > xRowsAccess( mxTableRows, uno::UNO_QUERY_THROW );
     141         [ #  # ]:          0 :     for( sal_Int32 index = mnStartRowIndex; index <= mnEndRowIndex; ++index )
     142                 :            :     {
     143 [ #  # ][ #  # ]:          0 :         uno::Reference< beans::XPropertySet > xRowProps( xRowsAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
                 [ #  # ]
     144                 :          0 :         sal_Bool bSplit = sal_False;
     145 [ #  # ][ #  # ]:          0 :         xRowProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsSplitAllowed") ) ) >>= bSplit;
                 [ #  # ]
     146         [ #  # ]:          0 :         if( index == 0 )
     147                 :            :         {
     148                 :          0 :             bAllowBreak = bSplit;
     149                 :            :         }
     150         [ #  # ]:          0 :         if( bSplit != bAllowBreak )
     151                 :            :         {
     152                 :          0 :             sal_Int32 nRet = word::WdConstants::wdUndefined;
     153         [ #  # ]:          0 :             return uno::makeAny( nRet );
     154                 :            :         }
     155         [ #  # ]:          0 :     }
     156         [ #  # ]:          0 :     return uno::makeAny( bAllowBreak );
     157                 :            : }
     158                 :            : 
     159                 :          0 : void SAL_CALL SwVbaRows::setAllowBreakAcrossPages( const uno::Any& _allowbreakacrosspages ) throw (uno::RuntimeException)
     160                 :            : {
     161                 :          0 :     sal_Bool bAllowBreak = sal_False;
     162                 :          0 :     _allowbreakacrosspages >>= bAllowBreak;
     163         [ #  # ]:          0 :     uno::Reference< container::XIndexAccess > xRowsAccess( mxTableRows, uno::UNO_QUERY_THROW );
     164         [ #  # ]:          0 :     for( sal_Int32 index = mnStartRowIndex; index <= mnEndRowIndex; ++index )
     165                 :            :     {
     166 [ #  # ][ #  # ]:          0 :         uno::Reference< beans::XPropertySet > xRowProps( xRowsAccess->getByIndex( index ), uno::UNO_QUERY_THROW );
                 [ #  # ]
     167 [ #  # ][ #  # ]:          0 :         xRowProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IsSplitAllowed") ), uno::makeAny( bAllowBreak ) );
         [ #  # ][ #  # ]
     168                 :          0 :     }
     169                 :          0 : }
     170                 :            : 
     171                 :          0 : float SAL_CALL SwVbaRows::getSpaceBetweenColumns() throw (uno::RuntimeException)
     172                 :            : {
     173                 :            :     // just get the first spacing of the first cell
     174         [ #  # ]:          0 :     uno::Reference< table::XCellRange > xCellRange( mxTextTable, uno::UNO_QUERY_THROW );
     175 [ #  # ][ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xCellProps( xCellRange->getCellByPosition( 0, mnStartRowIndex ), uno::UNO_QUERY_THROW );
                 [ #  # ]
     176                 :          0 :     sal_Int32 nLeftBorderDistance = 0;
     177                 :          0 :     sal_Int32 nRightBorderDistance = 0;
     178 [ #  # ][ #  # ]:          0 :     xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorderDistance") ) ) >>= nLeftBorderDistance;
                 [ #  # ]
     179 [ #  # ][ #  # ]:          0 :     xCellProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorderDistance") ) ) >>= nRightBorderDistance;
                 [ #  # ]
     180         [ #  # ]:          0 :     return static_cast< float >( Millimeter::getInPoints( nLeftBorderDistance + nRightBorderDistance ) );
     181                 :            : }
     182                 :            : 
     183                 :          0 : void SAL_CALL SwVbaRows::setSpaceBetweenColumns( float _spacebetweencolumns ) throw (uno::RuntimeException)
     184                 :            : {
     185         [ #  # ]:          0 :     sal_Int32 nSpace = Millimeter::getInHundredthsOfOneMillimeter( _spacebetweencolumns ) / 2;
     186 [ #  # ][ #  # ]:          0 :     uno::Reference< container::XIndexAccess > xColumnAccess( mxTextTable->getColumns(), uno::UNO_QUERY_THROW );
                 [ #  # ]
     187         [ #  # ]:          0 :     uno::Reference< table::XCellRange > xCellRange( mxTextTable, uno::UNO_QUERY_THROW );
     188         [ #  # ]:          0 :     SwVbaTableHelper aTableHelper( mxTextTable );
     189         [ #  # ]:          0 :     for( sal_Int32 row = mnStartRowIndex; row <= mnEndRowIndex; ++row )
     190                 :            :     {
     191         [ #  # ]:          0 :         sal_Int32 nColumns = aTableHelper.getTabColumnsCount( row );
     192         [ #  # ]:          0 :         for( sal_Int32 column = 0; column < nColumns; ++column )
     193                 :            :         {
     194 [ #  # ][ #  # ]:          0 :             uno::Reference< beans::XPropertySet > xCellProps( xCellRange->getCellByPosition( column, row ), uno::UNO_QUERY_THROW );
                 [ #  # ]
     195 [ #  # ][ #  # ]:          0 :             xCellProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftBorderDistance") ), uno::makeAny( nSpace ) );
         [ #  # ][ #  # ]
     196 [ #  # ][ #  # ]:          0 :             xCellProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("RightBorderDistance") ), uno::makeAny( nSpace ) );
         [ #  # ][ #  # ]
     197                 :          0 :         }
     198         [ #  # ]:          0 :     }
     199                 :          0 : }
     200                 :            : 
     201                 :          0 : void SAL_CALL SwVbaRows::Delete(  ) throw (uno::RuntimeException)
     202                 :            : {
     203                 :          0 :     mxTableRows->removeByIndex( mnStartRowIndex, getCount() );
     204                 :          0 : }
     205                 :            : 
     206                 :          0 : void SAL_CALL SwVbaRows::SetLeftIndent( float LeftIndent, ::sal_Int32 RulerStyle ) throw (uno::RuntimeException)
     207                 :            : {
     208 [ #  # ][ #  # ]:          0 :     uno::Reference< word::XColumns > xColumns( new SwVbaColumns( getParent(), mxContext, mxTextTable, mxTextTable->getColumns() ) );
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     209                 :          0 :     sal_Int32 nIndent = (sal_Int32)( LeftIndent );
     210   [ #  #  #  #  :          0 :     switch( RulerStyle )
                      # ]
     211                 :            :     {
     212                 :            :         case word::WdRulerStyle::wdAdjustFirstColumn:
     213                 :            :         {
     214         [ #  # ]:          0 :             setIndentWithAdjustFirstColumn( xColumns, nIndent );
     215                 :          0 :             break;
     216                 :            :         }
     217                 :            :         case word::WdRulerStyle::wdAdjustNone:
     218                 :            :         {
     219         [ #  # ]:          0 :             setIndentWithAdjustNone( nIndent );
     220                 :          0 :             break;
     221                 :            :         }
     222                 :            :         case word::WdRulerStyle::wdAdjustProportional:
     223                 :            :         {
     224         [ #  # ]:          0 :             setIndentWithAdjustProportional( xColumns, nIndent );
     225                 :          0 :             break;
     226                 :            :         }
     227                 :            :         case word::WdRulerStyle::wdAdjustSameWidth:
     228                 :            :         {
     229         [ #  # ]:          0 :             setIndentWithAdjustSameWidth( xColumns, nIndent );
     230                 :          0 :             break;
     231                 :            :         }
     232                 :            :         default:
     233                 :            :         {
     234         [ #  # ]:          0 :             DebugHelper::exception(SbERR_BAD_ARGUMENT, rtl::OUString());
     235                 :            :         }
     236                 :          0 :     }
     237                 :          0 : }
     238                 :            : 
     239                 :          0 : void SwVbaRows::setIndentWithAdjustNone( sal_Int32 indent ) throw (uno::RuntimeException)
     240                 :            : {
     241         [ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
     242                 :          0 :     sal_Int32 nMargin = 0;
     243 [ #  # ][ #  # ]:          0 :     xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin") ) ) >>= nMargin;
                 [ #  # ]
     244                 :          0 :     nMargin += indent;
     245 [ #  # ][ #  # ]:          0 :     xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("LeftMargin") ), uno::makeAny( nMargin ) );
         [ #  # ][ #  # ]
     246                 :          0 : }
     247                 :            : 
     248                 :          0 :  void SwVbaRows::setIndentWithAdjustFirstColumn( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException)
     249                 :            :  {
     250                 :          0 :     sal_Int32 nIndex = 1;
     251         [ #  # ]:          0 :     uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW );
     252 [ #  # ][ #  # ]:          0 :     uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( nIndex ), uno::Any() ), uno::UNO_QUERY_THROW );
         [ #  # ][ #  # ]
     253 [ #  # ][ #  # ]:          0 :     sal_Int32 nWidth = xColumn->getWidth();
     254                 :          0 :     nWidth -= indent;
     255 [ #  # ][ #  # ]:          0 :     xColumn->setWidth( nWidth );
     256         [ #  # ]:          0 :     setIndentWithAdjustNone( indent );
     257                 :          0 :  }
     258                 :            : 
     259                 :          0 :  void SwVbaRows::setIndentWithAdjustProportional(
     260                 :            :     const uno::Reference< word::XColumns >& xColumns,
     261                 :            :     sal_Int32 indent
     262                 :            : ) throw (uno::RuntimeException)
     263                 :            :  {
     264                 :            :     // calculate the new width and get the proportion between old and new
     265         [ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
     266                 :          0 :     sal_Int32 nWidth = 0;
     267 [ #  # ][ #  # ]:          0 :     xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth;
                 [ #  # ]
     268                 :          0 :     sal_Int32 nNewWidth = nWidth - indent;
     269 [ #  # ][ #  # ]:          0 :     if ((nNewWidth <= 0) || (nWidth <= 0))
     270                 :            :     {
     271                 :            :         throw uno::RuntimeException(
     272                 :            :             ::rtl::OUString(
     273                 :            :                 RTL_CONSTASCII_USTRINGPARAM(
     274                 :            :                     "Pb with width, in SwVbaRows::setIndentWithAdjustProportional (nNewWidth <= 0) || (nWidth <= 0)"
     275                 :            :                 )
     276                 :            :             ),
     277                 :            :             uno::Reference< uno::XInterface >()
     278 [ #  # ][ #  # ]:          0 :         );
     279                 :            :     }
     280                 :          0 :     double propFactor = (double)nNewWidth/(double)nWidth;
     281                 :            : 
     282                 :            :     // get all columns, calculate and set the new width of the columns
     283         [ #  # ]:          0 :     uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW );
     284 [ #  # ][ #  # ]:          0 :     sal_Int32 nColCount = xCol->getCount();
     285         [ #  # ]:          0 :     for( sal_Int32 i = 0; i < nColCount; i++ )
     286                 :            :     {
     287 [ #  # ][ #  # ]:          0 :         uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( i ), uno::Any() ), uno::UNO_QUERY_THROW );
         [ #  # ][ #  # ]
     288 [ #  # ][ #  # ]:          0 :         sal_Int32 nColWidth = xColumn->getWidth();
     289                 :          0 :         sal_Int32 nNewColWidth = ( sal_Int32 )( propFactor * nColWidth );
     290 [ #  # ][ #  # ]:          0 :         xColumn->setWidth( nNewColWidth );
     291                 :          0 :     }
     292                 :            : 
     293                 :            :     // set the width and position of the table
     294         [ #  # ]:          0 :     setIndentWithAdjustNone( indent );
     295 [ #  # ][ #  # ]:          0 :     xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( nNewWidth ) );
         [ #  # ][ #  # ]
     296                 :          0 :  }
     297                 :            : 
     298                 :          0 :  void SwVbaRows::setIndentWithAdjustSameWidth( const uno::Reference< word::XColumns >& xColumns, sal_Int32 indent ) throw (uno::RuntimeException)
     299                 :            :  {
     300                 :            :     // calculate the new width and get the width of all columns
     301         [ #  # ]:          0 :     uno::Reference< beans::XPropertySet > xTableProps( mxTextTable, uno::UNO_QUERY_THROW );
     302                 :          0 :     sal_Int32 nWidth = 0;
     303 [ #  # ][ #  # ]:          0 :     xTableProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ) ) >>= nWidth;
                 [ #  # ]
     304                 :          0 :     sal_Int32 nNewWidth = nWidth - indent;
     305                 :            : 
     306                 :            :     // get all columns, calculate and set the new width of the columns
     307         [ #  # ]:          0 :     uno::Reference< XCollection > xCol( xColumns, uno::UNO_QUERY_THROW );
     308 [ #  # ][ #  # ]:          0 :     sal_Int32 nColCount = xCol->getCount();
     309                 :          0 :     sal_Int32 nNewColWidth = (sal_Int32)( double( nNewWidth )/nColCount );
     310         [ #  # ]:          0 :     for( sal_Int32 i = 0; i < nColCount; i++ )
     311                 :            :     {
     312 [ #  # ][ #  # ]:          0 :         uno::Reference< word::XColumn > xColumn( xCol->Item( uno::makeAny( i ), uno::Any() ), uno::UNO_QUERY_THROW );
         [ #  # ][ #  # ]
     313 [ #  # ][ #  # ]:          0 :         xColumn->setWidth( nNewColWidth );
     314                 :          0 :     }
     315                 :            : 
     316                 :            :     // set the width and position of the table
     317         [ #  # ]:          0 :     setIndentWithAdjustNone( indent );
     318 [ #  # ][ #  # ]:          0 :     xTableProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Width") ), uno::makeAny( nNewWidth ) );
         [ #  # ][ #  # ]
     319                 :          0 :  }
     320                 :            : 
     321                 :          0 : void SAL_CALL SwVbaRows::Select(  ) throw (uno::RuntimeException)
     322                 :            : {
     323         [ #  # ]:          0 :     SwVbaRow::SelectRow( getCurrentWordDoc(mxContext), mxTextTable, mnStartRowIndex, mnEndRowIndex );
     324                 :          0 : }
     325                 :            : 
     326                 :          0 : ::sal_Int32 SAL_CALL SwVbaRows::getCount() throw (uno::RuntimeException)
     327                 :            : {
     328                 :          0 :     return ( mnEndRowIndex - mnStartRowIndex + 1 );
     329                 :            : }
     330                 :            : 
     331                 :          0 : uno::Any SAL_CALL SwVbaRows::Item( const uno::Any& Index1, const uno::Any& /*not processed in this base class*/ ) throw (uno::RuntimeException)
     332                 :            : {
     333                 :          0 :     sal_Int32 nIndex = 0;
     334         [ #  # ]:          0 :     if( ( Index1 >>= nIndex ) == sal_True )
     335                 :            :     {
     336 [ #  # ][ #  # ]:          0 :         if( nIndex <= 0 || nIndex > getCount() )
         [ #  # ][ #  # ]
     337                 :            :         {
     338 [ #  # ][ #  # ]:          0 :             throw  lang::IndexOutOfBoundsException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
     339                 :            :         }
     340 [ #  # ][ #  # ]:          0 :         return uno::makeAny( uno::Reference< word::XRow >( new SwVbaRow( this, mxContext, mxTextTable, nIndex - 1 ) ) );
         [ #  # ][ #  # ]
                 [ #  # ]
     341                 :            :     }
     342 [ #  # ][ #  # ]:          0 :     throw  uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Index out of bounds") ), uno::Reference< uno::XInterface >() );
     343                 :            : }
     344                 :            : 
     345                 :            : // XEnumerationAccess
     346                 :            : uno::Type
     347                 :          0 : SwVbaRows::getElementType() throw (uno::RuntimeException)
     348                 :            : {
     349                 :          0 :     return word::XRow::static_type(0);
     350                 :            : }
     351                 :            : uno::Reference< container::XEnumeration >
     352                 :          0 : SwVbaRows::createEnumeration() throw (uno::RuntimeException)
     353                 :            : {
     354 [ #  # ][ #  # ]:          0 :     return new RowsEnumWrapper( this, mxContext, mxTextTable );
                 [ #  # ]
     355                 :            : }
     356                 :            : 
     357                 :            : uno::Any
     358                 :          0 : SwVbaRows::createCollectionObject( const uno::Any& aSource )
     359                 :            : {
     360                 :          0 :     return aSource;
     361                 :            : }
     362                 :            : 
     363                 :            : rtl::OUString
     364                 :          0 : SwVbaRows::getServiceImplName()
     365                 :            : {
     366                 :          0 :     return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SwVbaRows"));
     367                 :            : }
     368                 :            : 
     369                 :            : uno::Sequence<rtl::OUString>
     370                 :          0 : SwVbaRows::getServiceNames()
     371                 :            : {
     372 [ #  # ][ #  # ]:          0 :     static uno::Sequence< rtl::OUString > sNames;
         [ #  # ][ #  # ]
     373         [ #  # ]:          0 :     if ( sNames.getLength() == 0 )
     374                 :            :     {
     375                 :          0 :         sNames.realloc( 1 );
     376         [ #  # ]:          0 :         sNames[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.word.Rows") );
     377                 :            :     }
     378                 :          0 :     return sNames;
     379                 :            : }
     380                 :            : 
     381                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10