LCOV - code coverage report
Current view: top level - editeng/source/uno - unoforou.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 141 246 57.3 %
Date: 2014-11-03 Functions: 31 57 54.4 %
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             : 
      21             : #include <algorithm>
      22             : #include <svl/style.hxx>
      23             : #include <com/sun/star/i18n/WordType.hpp>
      24             : 
      25             : #include <svl/itemset.hxx>
      26             : #include <editeng/editeng.hxx>
      27             : #include <editeng/editdata.hxx>
      28             : #include <editeng/outliner.hxx>
      29             : #include <editeng/unoedhlp.hxx>
      30             : #include <svl/poolitem.hxx>
      31             : #include <vcl/wrkwin.hxx>
      32             : #include <editeng/eeitem.hxx>
      33             : 
      34             : #include <editeng/unoforou.hxx>
      35             : #include <editeng/unofored.hxx>
      36             : #include <editeng/outlobj.hxx>
      37             : #include <unofored_internal.hxx>
      38             : 
      39             : using namespace ::com::sun::star;
      40             : 
      41             : 
      42             : 
      43       21697 : SvxOutlinerForwarder::SvxOutlinerForwarder( Outliner& rOutl, bool bOutlText /* = false */ ) :
      44             :     rOutliner( rOutl ),
      45             :     bOutlinerText( bOutlText ),
      46             :     mpAttribsCache( NULL ),
      47             :     mpParaAttribsCache( NULL ),
      48       21697 :     mnParaAttribsCache( 0 )
      49             : {
      50       21697 : }
      51             : 
      52       64347 : SvxOutlinerForwarder::~SvxOutlinerForwarder()
      53             : {
      54       21449 :     flushCache();
      55       42898 : }
      56             : 
      57      526926 : sal_Int32 SvxOutlinerForwarder::GetParagraphCount() const
      58             : {
      59      526926 :     return rOutliner.GetParagraphCount();
      60             : }
      61             : 
      62     1401418 : sal_Int32 SvxOutlinerForwarder::GetTextLen( sal_Int32 nParagraph ) const
      63             : {
      64     1401418 :     return rOutliner.GetEditEngine().GetTextLen( nParagraph );
      65             : }
      66             : 
      67        5748 : OUString SvxOutlinerForwarder::GetText( const ESelection& rSel ) const
      68             : {
      69             :     //! GetText (ESelection) should probably also be in the Outliner
      70             :     // in the time being use as the hack for the EditEngine:
      71        5748 :     EditEngine* pEditEngine = (EditEngine*)&rOutliner.GetEditEngine();
      72        5748 :     return pEditEngine->GetText( rSel, LINEEND_LF );
      73             : }
      74             : 
      75       20186 : static SfxItemSet ImplOutlinerForwarderGetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib, EditEngine& rEditEngine )
      76             : {
      77       20186 :     if( rSel.nStartPara == rSel.nEndPara )
      78             :     {
      79       19856 :         sal_uInt8 nFlags = 0;
      80             : 
      81       19856 :         switch( nOnlyHardAttrib )
      82             :         {
      83             :         case EditEngineAttribs_All:
      84       19222 :             nFlags = GETATTRIBS_ALL;
      85       19222 :             break;
      86             :         case EditEngineAttribs_HardAndPara:
      87           0 :             nFlags = GETATTRIBS_PARAATTRIBS|GETATTRIBS_CHARATTRIBS;
      88           0 :             break;
      89             :         case EditEngineAttribs_OnlyHard:
      90         634 :             nFlags = GETATTRIBS_CHARATTRIBS;
      91         634 :             break;
      92             :         default:
      93             :             OSL_FAIL("unknown flags for SvxOutlinerForwarder::GetAttribs");
      94             :         }
      95       19856 :         return rEditEngine.GetAttribs( rSel.nStartPara, rSel.nStartPos, rSel.nEndPos, nFlags );
      96             :     }
      97             :     else
      98             :     {
      99         330 :         return rEditEngine.GetAttribs( rSel, nOnlyHardAttrib );
     100             :     }
     101             : }
     102             : 
     103       25560 : SfxItemSet SvxOutlinerForwarder::GetAttribs( const ESelection& rSel, EditEngineAttribs nOnlyHardAttrib ) const
     104             : {
     105       25560 :     if( mpAttribsCache && ( EditEngineAttribs_All == nOnlyHardAttrib ) )
     106             :     {
     107             :         // have we the correct set in cache?
     108        5960 :         if( ((SvxOutlinerForwarder*)this)->maAttribCacheSelection.IsEqual(rSel) )
     109             :         {
     110             :             // yes! just return the cache
     111        5374 :             return *mpAttribsCache;
     112             :         }
     113             :         else
     114             :         {
     115             :             // no, we need delete the old cache
     116         586 :             delete mpAttribsCache;
     117         586 :             mpAttribsCache = NULL;
     118             :         }
     119             :     }
     120             : 
     121             :     //! Does it not exist on the Outliner?
     122             :     //! and why is the GetAttribs on the EditEngine not a const?
     123       20186 :     EditEngine& rEditEngine = (EditEngine&)rOutliner.GetEditEngine();
     124             : 
     125       20186 :     SfxItemSet aSet( ImplOutlinerForwarderGetAttribs( rSel, nOnlyHardAttrib, rEditEngine ) );
     126             : 
     127       20186 :     if( EditEngineAttribs_All == nOnlyHardAttrib )
     128             :     {
     129       19552 :         mpAttribsCache = new SfxItemSet( aSet );
     130       19552 :         maAttribCacheSelection = rSel;
     131             :     }
     132             : 
     133       20186 :     SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( rSel.nStartPara );
     134       20186 :     if( pStyle )
     135       13694 :         aSet.SetParent( &(pStyle->GetItemSet() ) );
     136             : 
     137       20186 :     return aSet;
     138             : }
     139             : 
     140       26984 : SfxItemSet SvxOutlinerForwarder::GetParaAttribs( sal_Int32 nPara ) const
     141             : {
     142       26984 :     if( mpParaAttribsCache )
     143             :     {
     144             :         // have we the correct set in cache?
     145        7680 :         if( nPara == mnParaAttribsCache )
     146             :         {
     147             :             // yes! just return the cache
     148        7404 :             return *mpParaAttribsCache;
     149             :         }
     150             :         else
     151             :         {
     152             :             // no, we need delete the old cache
     153         276 :             delete mpParaAttribsCache;
     154         276 :             mpParaAttribsCache = NULL;
     155             :         }
     156             :     }
     157             : 
     158       19580 :     mpParaAttribsCache = new SfxItemSet( rOutliner.GetParaAttribs( nPara ) );
     159       19580 :     mnParaAttribsCache = nPara;
     160             : 
     161       19580 :     EditEngine& rEditEngine = (EditEngine&)rOutliner.GetEditEngine();
     162             : 
     163       19580 :     SfxStyleSheet* pStyle = rEditEngine.GetStyleSheet( nPara );
     164       19580 :     if( pStyle )
     165       14512 :         mpParaAttribsCache->SetParent( &(pStyle->GetItemSet() ) );
     166             : 
     167       19580 :     return *mpParaAttribsCache;
     168             : }
     169             : 
     170       17420 : void SvxOutlinerForwarder::SetParaAttribs( sal_Int32 nPara, const SfxItemSet& rSet )
     171             : {
     172       17420 :     flushCache();
     173             : 
     174       17420 :     const SfxItemSet* pOldParent = rSet.GetParent();
     175       17420 :     if( pOldParent )
     176       13476 :         ((SfxItemSet*)&rSet)->SetParent( NULL );
     177             : 
     178       17420 :     rOutliner.SetParaAttribs( nPara, rSet );
     179             : 
     180       17420 :     if( pOldParent )
     181       13476 :         ((SfxItemSet*)&rSet)->SetParent( pOldParent );
     182       17420 : }
     183             : 
     184         910 : void SvxOutlinerForwarder::RemoveAttribs( const ESelection& rSelection, bool bRemoveParaAttribs, sal_uInt16 nWhich )
     185             : {
     186         910 :     rOutliner.RemoveAttribs( rSelection, bRemoveParaAttribs, nWhich );
     187         910 : }
     188             : 
     189          12 : SfxItemPool* SvxOutlinerForwarder::GetPool() const
     190             : {
     191          12 :     return rOutliner.GetEmptyItemSet().GetPool();
     192             : }
     193             : 
     194        1432 : void SvxOutlinerForwarder::GetPortions( sal_Int32 nPara, std::vector<sal_Int32>& rList ) const
     195             : {
     196        1432 :     ((EditEngine&)rOutliner.GetEditEngine()).GetPortions( nPara, rList );
     197        1432 : }
     198             : 
     199       27261 : void SvxOutlinerForwarder::QuickInsertText( const OUString& rText, const ESelection& rSel )
     200             : {
     201       27261 :     flushCache();
     202       27261 :     if( rText.isEmpty() )
     203             :     {
     204        3328 :         rOutliner.QuickDelete( rSel );
     205             :     }
     206             :     else
     207             :     {
     208       23933 :         rOutliner.QuickInsertText( rText, rSel );
     209             :     }
     210       27261 : }
     211             : 
     212          68 : void SvxOutlinerForwarder::QuickInsertLineBreak( const ESelection& rSel )
     213             : {
     214          68 :     flushCache();
     215          68 :     rOutliner.QuickInsertLineBreak( rSel );
     216          68 : }
     217             : 
     218         512 : void SvxOutlinerForwarder::QuickInsertField( const SvxFieldItem& rFld, const ESelection& rSel )
     219             : {
     220         512 :     flushCache();
     221         512 :     rOutliner.QuickInsertField( rFld, rSel );
     222         512 : }
     223             : 
     224       11662 : void SvxOutlinerForwarder::QuickSetAttribs( const SfxItemSet& rSet, const ESelection& rSel )
     225             : {
     226       11662 :     flushCache();
     227       11662 :     rOutliner.QuickSetAttribs( rSet, rSel );
     228       11662 : }
     229             : 
     230         236 : OUString SvxOutlinerForwarder::CalcFieldValue( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos, Color*& rpTxtColor, Color*& rpFldColor )
     231             : {
     232         236 :     return rOutliner.CalcFieldValue( rField, nPara, nPos, rpTxtColor, rpFldColor );
     233             : }
     234             : 
     235           0 : void SvxOutlinerForwarder::FieldClicked( const SvxFieldItem& rField, sal_Int32 nPara, sal_Int32 nPos )
     236             : {
     237           0 :     rOutliner.FieldClicked( rField, nPara, nPos );
     238           0 : }
     239             : 
     240           0 : bool SvxOutlinerForwarder::IsValid() const
     241             : {
     242             :     // cannot reliably query outliner state
     243             :     // while in the middle of an update
     244           0 :     return rOutliner.GetUpdateMode();
     245             : }
     246             : 
     247        1216 : SfxItemState SvxOutlinerForwarder::GetItemState( const ESelection& rSel, sal_uInt16 nWhich ) const
     248             : {
     249        1216 :     return GetSvxEditEngineItemState( (EditEngine&)rOutliner.GetEditEngine(), rSel, nWhich );
     250             : }
     251             : 
     252         892 : SfxItemState SvxOutlinerForwarder::GetItemState( sal_Int32 nPara, sal_uInt16 nWhich ) const
     253             : {
     254         892 :     const SfxItemSet& rSet = rOutliner.GetParaAttribs( nPara );
     255         892 :     return rSet.GetItemState( nWhich );
     256             : }
     257             : 
     258             : 
     259      100587 : void SvxOutlinerForwarder::flushCache()
     260             : {
     261      100587 :     if( mpAttribsCache )
     262             :     {
     263       18966 :         delete mpAttribsCache;
     264       18966 :         mpAttribsCache = NULL;
     265             :     }
     266             : 
     267      100587 :     if( mpParaAttribsCache )
     268             :     {
     269       19304 :         delete mpParaAttribsCache;
     270       19304 :         mpParaAttribsCache = NULL;
     271             :     }
     272      100587 : }
     273             : 
     274           0 : LanguageType SvxOutlinerForwarder::GetLanguage( sal_Int32 nPara, sal_Int32 nIndex ) const
     275             : {
     276           0 :     return rOutliner.GetLanguage(nPara, nIndex);
     277             : }
     278             : 
     279           0 : sal_Int32 SvxOutlinerForwarder::GetFieldCount( sal_Int32 nPara ) const
     280             : {
     281           0 :     return rOutliner.GetEditEngine().GetFieldCount(nPara);
     282             : }
     283             : 
     284           0 : EFieldInfo SvxOutlinerForwarder::GetFieldInfo( sal_Int32 nPara, sal_uInt16 nField ) const
     285             : {
     286           0 :     return rOutliner.GetEditEngine().GetFieldInfo( nPara, nField );
     287             : }
     288             : 
     289           0 : EBulletInfo SvxOutlinerForwarder::GetBulletInfo( sal_Int32 nPara ) const
     290             : {
     291           0 :     return rOutliner.GetBulletInfo( nPara );
     292             : }
     293             : 
     294           0 : Rectangle SvxOutlinerForwarder::GetCharBounds( sal_Int32 nPara, sal_Int32 nIndex ) const
     295             : {
     296             :     // EditEngine's 'internal' methods like GetCharacterBounds()
     297             :     // don't rotate for vertical text.
     298           0 :     Size aSize( rOutliner.CalcTextSize() );
     299           0 :     ::std::swap( aSize.Width(), aSize.Height() );
     300           0 :     bool bIsVertical( rOutliner.IsVertical() );
     301             : 
     302             :     // #108900# Handle virtual position one-past-the end of the string
     303           0 :     if( nIndex >= GetTextLen(nPara) )
     304             :     {
     305           0 :         Rectangle aLast;
     306             : 
     307           0 :         if( nIndex )
     308             :         {
     309             :             // use last character, if possible
     310           0 :             aLast = rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex-1) );
     311             : 
     312             :             // move at end of this last character, make one pixel wide
     313           0 :             aLast.Move( aLast.Right() - aLast.Left(), 0 );
     314           0 :             aLast.SetSize( Size(1, aLast.GetHeight()) );
     315             : 
     316             :             // take care for CTL
     317           0 :             aLast = SvxEditSourceHelper::EEToUserSpace( aLast, aSize, bIsVertical );
     318             :         }
     319             :         else
     320             :         {
     321             :             // #109864# Bounds must lie within the paragraph
     322           0 :             aLast = GetParaBounds( nPara );
     323             : 
     324             :             // #109151# Don't use paragraph height, but line height
     325             :             // instead. aLast is already CTL-correct
     326           0 :             if( bIsVertical)
     327           0 :                 aLast.SetSize( Size( rOutliner.GetLineHeight(nPara,0), 1 ) );
     328             :             else
     329           0 :                 aLast.SetSize( Size( 1, rOutliner.GetLineHeight(nPara,0) ) );
     330             :         }
     331             : 
     332           0 :         return aLast;
     333             :     }
     334             :     else
     335             :     {
     336           0 :         return SvxEditSourceHelper::EEToUserSpace( rOutliner.GetEditEngine().GetCharacterBounds( EPosition(nPara, nIndex) ),
     337           0 :                                                    aSize, bIsVertical );
     338             :     }
     339             : }
     340             : 
     341           0 : Rectangle SvxOutlinerForwarder::GetParaBounds( sal_Int32 nPara ) const
     342             : {
     343           0 :     Point aPnt = rOutliner.GetDocPosTopLeft( nPara );
     344           0 :     Size aSize = rOutliner.CalcTextSize();
     345             : 
     346           0 :     if( rOutliner.IsVertical() )
     347             :     {
     348             :         // Hargl. Outliner's 'external' methods return the rotated
     349             :         // dimensions, 'internal' methods like GetTextHeight( n )
     350             :         // don't rotate.
     351           0 :         sal_uLong nWidth = rOutliner.GetTextHeight( nPara );
     352             : 
     353           0 :         return Rectangle( aSize.Width() - aPnt.Y() - nWidth, 0, aSize.Width() - aPnt.Y(), aSize.Height() );
     354             :     }
     355             :     else
     356             :     {
     357           0 :         sal_uLong nHeight = rOutliner.GetTextHeight( nPara );
     358             : 
     359           0 :         return Rectangle( 0, aPnt.Y(), aSize.Width(), aPnt.Y() + nHeight );
     360             :     }
     361             : }
     362             : 
     363           0 : MapMode SvxOutlinerForwarder::GetMapMode() const
     364             : {
     365           0 :     return rOutliner.GetRefMapMode();
     366             : }
     367             : 
     368           0 : OutputDevice* SvxOutlinerForwarder::GetRefDevice() const
     369             : {
     370           0 :     return rOutliner.GetRefDevice();
     371             : }
     372             : 
     373           0 : bool SvxOutlinerForwarder::GetIndexAtPoint( const Point& rPos, sal_Int32& nPara, sal_Int32& nIndex ) const
     374             : {
     375           0 :     Size aSize( rOutliner.CalcTextSize() );
     376           0 :     ::std::swap( aSize.Width(), aSize.Height() );
     377             :     Point aEEPos( SvxEditSourceHelper::UserSpaceToEE( rPos,
     378             :                                                       aSize,
     379           0 :                                                       rOutliner.IsVertical() ));
     380             : 
     381           0 :     EPosition aDocPos = rOutliner.GetEditEngine().FindDocPosition( aEEPos );
     382             : 
     383           0 :     nPara = aDocPos.nPara;
     384           0 :     nIndex = aDocPos.nIndex;
     385             : 
     386           0 :     return true;
     387             : }
     388             : 
     389           0 : bool SvxOutlinerForwarder::GetWordIndices( sal_Int32 nPara, sal_Int32 nIndex, sal_Int32& nStart, sal_Int32& nEnd ) const
     390             : {
     391           0 :     ESelection aRes = rOutliner.GetEditEngine().GetWord( ESelection(nPara, nIndex, nPara, nIndex), com::sun::star::i18n::WordType::DICTIONARY_WORD );
     392             : 
     393           0 :     if( aRes.nStartPara == nPara &&
     394           0 :         aRes.nStartPara == aRes.nEndPara )
     395             :     {
     396           0 :         nStart = aRes.nStartPos;
     397           0 :         nEnd = aRes.nEndPos;
     398             : 
     399           0 :         return true;
     400             :     }
     401             : 
     402           0 :     return false;
     403             : }
     404             : 
     405           0 : bool SvxOutlinerForwarder::GetAttributeRun( sal_Int32& nStartIndex, sal_Int32& nEndIndex, sal_Int32 nPara, sal_Int32 nIndex, bool bInCell ) const
     406             : {
     407           0 :     return SvxEditSourceHelper::GetAttributeRun( nStartIndex, nEndIndex, rOutliner.GetEditEngine(), nPara, nIndex, bInCell );
     408             : }
     409             : 
     410           0 : sal_Int32 SvxOutlinerForwarder::GetLineCount( sal_Int32 nPara ) const
     411             : {
     412           0 :     return rOutliner.GetLineCount(nPara);
     413             : }
     414             : 
     415           0 : sal_Int32 SvxOutlinerForwarder::GetLineLen( sal_Int32 nPara, sal_Int32 nLine ) const
     416             : {
     417           0 :     return rOutliner.GetLineLen(nPara, nLine);
     418             : }
     419             : 
     420           0 : void SvxOutlinerForwarder::GetLineBoundaries( /*out*/sal_Int32 &rStart, /*out*/sal_Int32 &rEnd, sal_Int32 nPara, sal_Int32 nLine ) const
     421             : {
     422           0 :     return rOutliner.GetEditEngine().GetLineBoundaries( rStart, rEnd, nPara, nLine );
     423             : }
     424             : 
     425           0 : sal_Int32 SvxOutlinerForwarder::GetLineNumberAtIndex( sal_Int32 nPara, sal_Int32 nIndex ) const
     426             : {
     427           0 :     return rOutliner.GetEditEngine().GetLineNumberAtIndex( nPara, nIndex );
     428             : }
     429             : 
     430           0 : bool SvxOutlinerForwarder::QuickFormatDoc( bool )
     431             : {
     432           0 :     rOutliner.QuickFormatDoc();
     433             : 
     434           0 :     return true;
     435             : }
     436             : 
     437           0 : bool SvxOutlinerForwarder::Delete( const ESelection& rSelection )
     438             : {
     439           0 :     flushCache();
     440           0 :     rOutliner.QuickDelete( rSelection );
     441           0 :     rOutliner.QuickFormatDoc();
     442             : 
     443           0 :     return true;
     444             : }
     445             : 
     446           0 : bool SvxOutlinerForwarder::InsertText( const OUString& rStr, const ESelection& rSelection )
     447             : {
     448           0 :     flushCache();
     449           0 :     rOutliner.QuickInsertText( rStr, rSelection );
     450           0 :     rOutliner.QuickFormatDoc();
     451             : 
     452           0 :     return true;
     453             : }
     454             : 
     455        1082 : sal_Int16 SvxOutlinerForwarder::GetDepth( sal_Int32 nPara ) const
     456             : {
     457             :     DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::GetDepth: Invalid paragraph index");
     458             : 
     459        1082 :     Paragraph* pPara = rOutliner.GetParagraph( nPara );
     460             : 
     461        1082 :     sal_Int16 nLevel = -1;
     462             : 
     463        1082 :     if( pPara )
     464        1082 :         nLevel = rOutliner.GetDepth( nPara );
     465             : 
     466        1082 :     return nLevel;
     467             : }
     468             : 
     469        4896 : bool SvxOutlinerForwarder::SetDepth( sal_Int32 nPara, sal_Int16 nNewDepth )
     470             : {
     471             :     DBG_ASSERT( 0 <= nPara && nPara < GetParagraphCount(), "SvxOutlinerForwarder::SetDepth: Invalid paragraph index");
     472             : 
     473        4896 :     if( (nNewDepth >= -1) && (nNewDepth <= 9) && (0 <= nPara && nPara < GetParagraphCount()) )
     474             :     {
     475        4896 :         Paragraph* pPara = rOutliner.GetParagraph( nPara );
     476        4896 :         if( pPara )
     477             :         {
     478        4896 :             rOutliner.SetDepth( pPara, nNewDepth );
     479             : 
     480             : //          const bool bOutlinerText = pSdrObject && (pSdrObject->GetObjInventor() == SdrInventor) && (pSdrObject->GetObjIdentifier() == OBJ_OUTLINETEXT);
     481        4896 :             if( bOutlinerText )
     482         160 :                 rOutliner.SetLevelDependendStyleSheet( nPara );
     483             : 
     484        4896 :             return true;
     485             :         }
     486             :     }
     487             : 
     488           0 :     return false;
     489             : }
     490             : 
     491           4 : sal_Int32 SvxOutlinerForwarder::GetNumberingStartValue( sal_Int32 nPara )
     492             : {
     493           4 :     if( 0 <= nPara && nPara < GetParagraphCount() )
     494             :     {
     495           4 :         return rOutliner.GetNumberingStartValue( nPara );
     496             :     }
     497             :     else
     498             :     {
     499             :         OSL_FAIL( "SvxOutlinerForwarder::GetNumberingStartValue)(), Invalid paragraph index");
     500           0 :         return -1;
     501             :     }
     502             : }
     503             : 
     504           0 : void SvxOutlinerForwarder::SetNumberingStartValue(  sal_Int32 nPara, sal_Int32 nNumberingStartValue )
     505             : {
     506           0 :     if( 0 <= nPara && nPara < GetParagraphCount() )
     507             :     {
     508           0 :         rOutliner.SetNumberingStartValue( nPara, nNumberingStartValue );
     509             :     }
     510             :     else
     511             :     {
     512             :         OSL_FAIL( "SvxOutlinerForwarder::SetNumberingStartValue)(), Invalid paragraph index");
     513             :     }
     514           0 : }
     515             : 
     516          20 : bool SvxOutlinerForwarder::IsParaIsNumberingRestart( sal_Int32 nPara )
     517             : {
     518          20 :     if( 0 <= nPara && nPara < GetParagraphCount() )
     519             :     {
     520          20 :         return rOutliner.IsParaIsNumberingRestart( nPara );
     521             :     }
     522             :     else
     523             :     {
     524             :         OSL_FAIL( "SvxOutlinerForwarder::IsParaIsNumberingRestart)(), Invalid paragraph index");
     525           0 :         return false;
     526             :     }
     527             : }
     528             : 
     529           8 : void SvxOutlinerForwarder::SetParaIsNumberingRestart(  sal_Int32 nPara, bool bParaIsNumberingRestart )
     530             : {
     531           8 :     if( 0 <= nPara && nPara < GetParagraphCount() )
     532             :     {
     533           8 :         rOutliner.SetParaIsNumberingRestart( nPara, bParaIsNumberingRestart );
     534             :     }
     535             :     else
     536             :     {
     537             :         OSL_FAIL( "SvxOutlinerForwarder::SetParaIsNumberingRestart)(), Invalid paragraph index");
     538             :     }
     539           8 : }
     540             : 
     541         968 : const SfxItemSet * SvxOutlinerForwarder::GetEmptyItemSetPtr()
     542             : {
     543         968 :     EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
     544         968 :     return &rEditEngine.GetEmptyItemSet();
     545             : }
     546             : 
     547          58 : void SvxOutlinerForwarder::AppendParagraph()
     548             : {
     549          58 :     EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
     550          58 :     rEditEngine.InsertParagraph( rEditEngine.GetParagraphCount(), OUString() );
     551          58 : }
     552             : 
     553         910 : sal_Int32 SvxOutlinerForwarder::AppendTextPortion( sal_Int32 nPara, const OUString &rText, const SfxItemSet & /*rSet*/ )
     554             : {
     555         910 :     sal_Int32 nLen = 0;
     556             : 
     557         910 :     EditEngine& rEditEngine = const_cast< EditEngine& >( rOutliner.GetEditEngine() );
     558         910 :     sal_Int32 nParaCount = rEditEngine.GetParagraphCount();
     559             :     DBG_ASSERT( 0 <= nPara && nPara < nParaCount, "paragraph index out of bounds" );
     560         910 :     if (0 <= nPara && nPara < nParaCount)
     561             :     {
     562         910 :         nLen = rEditEngine.GetTextLen( nPara );
     563         910 :         rEditEngine.QuickInsertText( rText, ESelection( nPara, nLen, nPara, nLen ) );
     564             :     }
     565             : 
     566         910 :     return nLen;
     567             : }
     568             : 
     569           0 : void  SvxOutlinerForwarder::CopyText(const SvxTextForwarder& rSource)
     570             : {
     571           0 :     const SvxOutlinerForwarder* pSourceForwarder = dynamic_cast< const SvxOutlinerForwarder* >( &rSource );
     572           0 :     if( !pSourceForwarder )
     573           0 :         return;
     574           0 :     OutlinerParaObject* pNewOutlinerParaObject = pSourceForwarder->rOutliner.CreateParaObject();
     575           0 :     rOutliner.SetText( *pNewOutlinerParaObject );
     576           0 :     delete pNewOutlinerParaObject;
     577             : }
     578             : 
     579             : 
     580             : 
     581             : 
     582           0 : sal_Int32 SvxTextForwarder::GetNumberingStartValue( sal_Int32 )
     583             : {
     584           0 :     return -1;
     585             : }
     586             : 
     587           0 : void SvxTextForwarder::SetNumberingStartValue( sal_Int32, sal_Int32 )
     588             : {
     589           0 : }
     590             : 
     591           0 : bool SvxTextForwarder::IsParaIsNumberingRestart( sal_Int32  )
     592             : {
     593           0 :     return false;
     594             : }
     595             : 
     596           0 : void SvxTextForwarder::SetParaIsNumberingRestart( sal_Int32, bool )
     597             : {
     598         669 : }
     599             : 
     600             : 
     601             : 
     602             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10