LCOV - code coverage report
Current view: top level - cui/source/tabpages - paragrph.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 0 1239 0.0 %
Date: 2014-04-11 Functions: 0 84 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             : 
      20             : #include <svl/style.hxx>
      21             : #include <sfx2/app.hxx>
      22             : #include <sfx2/dialoghelper.hxx>
      23             : #include <sfx2/objsh.hxx>
      24             : #include <sfx2/module.hxx>
      25             : #include <vcl/mnemonic.hxx>
      26             : #include <svx/dialogs.hrc>
      27             : 
      28             : #include <svl/languageoptions.hxx>
      29             : #include <svl/cjkoptions.hxx>
      30             : #include <editeng/pgrditem.hxx>
      31             : #include <cuires.hrc>
      32             : #include "paragrph.hrc"
      33             : #include "paragrph.hxx"
      34             : #include <editeng/frmdiritem.hxx>
      35             : #include <editeng/lspcitem.hxx>
      36             : #include <editeng/adjustitem.hxx>
      37             : #include <editeng/orphitem.hxx>
      38             : #include <editeng/widwitem.hxx>
      39             : #include <editeng/tstpitem.hxx>
      40             : #include <editeng/pmdlitem.hxx>
      41             : #include <editeng/spltitem.hxx>
      42             : #include <editeng/hyphenzoneitem.hxx>
      43             : #include <editeng/ulspitem.hxx>
      44             : #include <editeng/lrspitem.hxx>
      45             : #include <editeng/formatbreakitem.hxx>
      46             : #include <editeng/keepitem.hxx>
      47             : #include "svx/dlgutil.hxx"
      48             : #include <dialmgr.hxx>
      49             : #include <sfx2/htmlmode.hxx>
      50             : #include <editeng/paravertalignitem.hxx>
      51             : #include <svl/eitem.hxx>
      52             : #include <sfx2/request.hxx>
      53             : #include <svl/intitem.hxx>
      54             : 
      55             : static sal_uInt16 pStdRanges[] =
      56             : {
      57             :     SID_ATTR_PARA_LINESPACE,        // 10033
      58             :     SID_ATTR_PARA_LINESPACE,
      59             :     SID_ATTR_LRSPACE,               // 10048 -
      60             :     SID_ATTR_ULSPACE,               // 10049
      61             :     SID_ATTR_PARA_REGISTER,         // 10413
      62             :     SID_ATTR_PARA_REGISTER,
      63             :     0
      64             : };
      65             : 
      66             : static sal_uInt16 pAlignRanges[] =
      67             : {
      68             :     SID_ATTR_PARA_ADJUST,           // 10027
      69             :     SID_ATTR_PARA_ADJUST,
      70             :     0
      71             : };
      72             : 
      73             : static sal_uInt16 pExtRanges[] =
      74             : {
      75             :     SID_ATTR_PARA_PAGEBREAK,        // 10037 -
      76             :     SID_ATTR_PARA_WIDOWS,           // 10041
      77             :     SID_ATTR_PARA_MODEL,            // 10065 -
      78             :     SID_ATTR_PARA_KEEP,             // 10066
      79             :     0
      80             : };
      81             : 
      82             : #define MAX_DURCH 5670      // 10 cm makes sense as maximum interline lead
      83             :                             // according to BP
      84             : #define FIX_DIST_DEF 283    // standard fix distance 0,5 cm
      85             : 
      86             : enum LineSpaceList
      87             : {
      88             :     LLINESPACE_1    = 0,
      89             :     LLINESPACE_15   = 1,
      90             :     LLINESPACE_2    = 2,
      91             :     LLINESPACE_PROP = 3,
      92             :     LLINESPACE_MIN  = 4,
      93             :     LLINESPACE_DURCH= 5,
      94             :     LLINESPACE_FIX  = 6,
      95             :     LLINESPACE_END
      96             : };
      97             : 
      98             : void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 );
      99             : 
     100           0 : void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace,
     101             :                         int eSpace, long lValue )
     102             : {
     103           0 :     switch ( eSpace )
     104             :     {
     105             :         case LLINESPACE_1:
     106           0 :             rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
     107           0 :             rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
     108           0 :             break;
     109             : 
     110             :         case LLINESPACE_15:
     111           0 :             rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
     112           0 :             rLineSpace.SetPropLineSpace( 150 );
     113           0 :             break;
     114             : 
     115             :         case LLINESPACE_2:
     116           0 :             rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
     117           0 :             rLineSpace.SetPropLineSpace( 200 );
     118           0 :             break;
     119             : 
     120             :         case LLINESPACE_PROP:
     121           0 :             rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
     122           0 :             rLineSpace.SetPropLineSpace( (sal_uInt8)lValue );
     123           0 :             break;
     124             : 
     125             :         case LLINESPACE_MIN:
     126           0 :             rLineSpace.SetLineHeight( (sal_uInt16)lValue );
     127           0 :             rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
     128           0 :             break;
     129             : 
     130             :         case LLINESPACE_DURCH:
     131           0 :             rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_AUTO;
     132           0 :             rLineSpace.SetInterLineSpace( (sal_uInt16)lValue );
     133           0 :             break;
     134             : 
     135             :         case LLINESPACE_FIX:
     136           0 :             rLineSpace.SetLineHeight((sal_uInt16)lValue);
     137           0 :             rLineSpace.GetLineSpaceRule() = SVX_LINE_SPACE_FIX;
     138           0 :             rLineSpace.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
     139           0 :         break;
     140             :     }
     141           0 : }
     142             : 
     143           0 : sal_uInt16 GetHtmlMode_Impl(const SfxItemSet& rSet)
     144             : {
     145           0 :     sal_uInt16 nHtmlMode = 0;
     146           0 :     const SfxPoolItem* pItem = 0;
     147             :     SfxObjectShell* pShell;
     148           0 :     if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, false, &pItem) ||
     149           0 :         ( 0 != (pShell = SfxObjectShell::Current()) &&
     150           0 :                     0 != (pItem = pShell->GetItem(SID_HTML_MODE))))
     151             :     {
     152           0 :         nHtmlMode = ((SfxUInt16Item*)pItem)->GetValue();
     153             :     }
     154           0 :     return nHtmlMode;
     155             : 
     156             : }
     157             : 
     158           0 : IMPL_LINK_NOARG(SvxStdParagraphTabPage, ELRLoseFocusHdl)
     159             : {
     160           0 :     SfxItemPool* pPool = GetItemSet().GetPool();
     161             :     DBG_ASSERT( pPool, "Wo ist der Pool" );
     162             :     FieldUnit eUnit =
     163           0 :         MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) );
     164             : 
     165           0 :     sal_Int64 nL = m_pLeftIndent->Denormalize( m_pLeftIndent->GetValue( eUnit ) );
     166           0 :     sal_Int64 nR = m_pRightIndent->Denormalize( m_pRightIndent->GetValue( eUnit ) );
     167           0 :     OUString aTmp = m_pFLineIndent->GetText();
     168             : 
     169           0 :     if( m_pLeftIndent->GetMin() < 0 )
     170           0 :         m_pFLineIndent->SetMin( -99999, FUNIT_MM );
     171             :     else
     172           0 :         m_pFLineIndent->SetMin( m_pFLineIndent->Normalize( -nL ), eUnit );
     173             : 
     174             :     // Check only for concrete width (Shell)
     175           0 :     sal_Int64 nTmp = nWidth - nL - nR - MM50;
     176           0 :     m_pFLineIndent->SetMax( m_pFLineIndent->Normalize( nTmp ), eUnit );
     177             : 
     178           0 :     if ( aTmp.isEmpty() )
     179           0 :         m_pFLineIndent->SetEmptyFieldValue();
     180             :     // maximum left right
     181           0 :     aTmp = m_pLeftIndent->GetText();
     182           0 :     nTmp = nWidth - nR - MM50;
     183           0 :     m_pLeftIndent->SetMax( m_pLeftIndent->Normalize( nTmp ), eUnit );
     184             : 
     185           0 :     if ( aTmp.isEmpty() )
     186           0 :         m_pLeftIndent->SetEmptyFieldValue();
     187           0 :     aTmp = m_pRightIndent->GetText();
     188           0 :     nTmp = nWidth - nL - MM50;
     189           0 :     m_pRightIndent->SetMax( m_pRightIndent->Normalize( nTmp ), eUnit );
     190             : 
     191           0 :     if ( aTmp.isEmpty() )
     192           0 :         m_pRightIndent->SetEmptyFieldValue();
     193           0 :     return 0;
     194             : }
     195             : 
     196           0 : SfxTabPage* SvxStdParagraphTabPage::Create( Window* pParent, const SfxItemSet& rSet)
     197             : {
     198           0 :     return new SvxStdParagraphTabPage( pParent, rSet );
     199             : }
     200             : 
     201           0 : bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
     202             : {
     203           0 :     SfxItemState eState = SFX_ITEM_UNKNOWN;
     204           0 :     const SfxPoolItem* pOld = 0;
     205           0 :     SfxItemPool* pPool = rOutSet.GetPool();
     206             :     DBG_ASSERT( pPool, "Wo ist der Pool" );
     207             : 
     208           0 :     sal_Bool bModified = sal_False;
     209             :     sal_uInt16 nWhich;
     210           0 :     sal_Int32 nPos = m_pLineDist->GetSelectEntryPos();
     211             : 
     212           0 :     if ( LISTBOX_ENTRY_NOTFOUND != nPos &&
     213           0 :          ( nPos != m_pLineDist->GetSavedValue() ||
     214           0 :            m_pLineDistAtPercentBox->IsValueModified() ||
     215           0 :            m_pLineDistAtMetricBox->IsValueModified() ) )
     216             :     {
     217           0 :         nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
     218           0 :         SfxMapUnit eUnit = pPool->GetMetric( nWhich );
     219             :         SvxLineSpacingItem aSpacing(
     220           0 :             (const SvxLineSpacingItem&)GetItemSet().Get( nWhich ) );
     221             : 
     222           0 :         switch ( nPos )
     223             :         {
     224             :             case LLINESPACE_1:
     225             :             case LLINESPACE_15:
     226             :             case LLINESPACE_2:
     227           0 :                 SetLineSpace_Impl( aSpacing, nPos );
     228           0 :                 break;
     229             : 
     230             :             case LLINESPACE_PROP:
     231             :                 SetLineSpace_Impl( aSpacing, nPos,
     232             :                                    static_cast<long>(m_pLineDistAtPercentBox->Denormalize(
     233           0 :                                    m_pLineDistAtPercentBox->GetValue() )) );
     234           0 :                 break;
     235             : 
     236             :             case LLINESPACE_MIN:
     237             :             case LLINESPACE_DURCH:
     238             :             case LLINESPACE_FIX:
     239             :                 SetLineSpace_Impl( aSpacing, nPos,
     240           0 :                     GetCoreValue( *m_pLineDistAtMetricBox, eUnit ) );
     241           0 :             break;
     242             : 
     243             :             default:
     244             :                 OSL_FAIL( "unbekannter Type fuer Zeilenabstand." );
     245           0 :                 break;
     246             :         }
     247           0 :         eState = GetItemSet().GetItemState( nWhich );
     248           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_PARA_LINESPACE );
     249             : 
     250           0 :         if ( !pOld || !( *(const SvxLineSpacingItem*)pOld == aSpacing ) ||
     251             :              SFX_ITEM_DONTCARE == eState )
     252             :         {
     253           0 :             rOutSet.Put( aSpacing );
     254           0 :             bModified = sal_True;
     255           0 :         }
     256             :     }
     257             : 
     258           0 :     if ( m_pTopDist->IsValueModified() || m_pBottomDist->IsValueModified()
     259           0 :          || m_pContextualCB->GetSavedValue() != TriState(m_pContextualCB->IsChecked()))
     260             :     {
     261           0 :         nWhich = GetWhich( SID_ATTR_ULSPACE );
     262           0 :         SfxMapUnit eUnit = pPool->GetMetric( nWhich );
     263           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_ULSPACE );
     264           0 :         SvxULSpaceItem aMargin( nWhich );
     265             : 
     266           0 :         if ( bRelativeMode )
     267             :         {
     268             :             DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
     269             : 
     270             :             const SvxULSpaceItem& rOldItem =
     271           0 :                 (const SvxULSpaceItem&)GetItemSet().GetParent()->Get( nWhich );
     272             : 
     273           0 :             if ( m_pTopDist->IsRelative() )
     274           0 :                 aMargin.SetUpper( rOldItem.GetUpper(),
     275           0 :                                   (sal_uInt16)m_pTopDist->GetValue() );
     276             :             else
     277           0 :                 aMargin.SetUpper( (sal_uInt16)GetCoreValue( *m_pTopDist, eUnit ) );
     278             : 
     279           0 :             if ( m_pBottomDist->IsRelative() )
     280           0 :                 aMargin.SetLower( rOldItem.GetLower(),
     281           0 :                                   (sal_uInt16)m_pBottomDist->GetValue() );
     282             :             else
     283           0 :                 aMargin.SetLower( (sal_uInt16)GetCoreValue( *m_pBottomDist, eUnit ) );
     284             : 
     285             :         }
     286             :         else
     287             :         {
     288           0 :             aMargin.SetUpper( (sal_uInt16)GetCoreValue( *m_pTopDist, eUnit ) );
     289           0 :             aMargin.SetLower( (sal_uInt16)GetCoreValue( *m_pBottomDist, eUnit ) );
     290             :         }
     291           0 :         aMargin.SetContextValue(m_pContextualCB->IsChecked());
     292           0 :         eState = GetItemSet().GetItemState( nWhich );
     293             : 
     294           0 :         if ( !pOld || !( *(const SvxULSpaceItem*)pOld == aMargin ) ||
     295             :              SFX_ITEM_DONTCARE == eState )
     296             :         {
     297           0 :             rOutSet.Put( aMargin );
     298           0 :             bModified = sal_True;
     299           0 :         }
     300             :     }
     301           0 :     bool bNullTab = false;
     302             : 
     303           0 :     if ( m_pLeftIndent->IsValueModified() ||
     304           0 :          m_pFLineIndent->IsValueModified() ||
     305           0 :          m_pRightIndent->IsValueModified()
     306           0 :          ||  m_pAutoCB->GetSavedValue() != TriState(m_pAutoCB->IsChecked()) )
     307             :     {
     308           0 :         nWhich = GetWhich( SID_ATTR_LRSPACE );
     309           0 :         SfxMapUnit eUnit = pPool->GetMetric( nWhich );
     310           0 :         SvxLRSpaceItem aMargin( nWhich );
     311           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_LRSPACE );
     312             : 
     313           0 :         if ( bRelativeMode )
     314             :         {
     315             :             DBG_ASSERT( GetItemSet().GetParent(), "No ParentSet" );
     316             : 
     317             :             const SvxLRSpaceItem& rOldItem =
     318           0 :                 (const SvxLRSpaceItem&)GetItemSet().GetParent()->Get( nWhich );
     319             : 
     320           0 :             if ( m_pLeftIndent->IsRelative() )
     321             :                 aMargin.SetTxtLeft( rOldItem.GetTxtLeft(),
     322           0 :                                     (sal_uInt16)m_pLeftIndent->GetValue() );
     323             :             else
     324           0 :                 aMargin.SetTxtLeft( GetCoreValue( *m_pLeftIndent, eUnit ) );
     325             : 
     326           0 :             if ( m_pRightIndent->IsRelative() )
     327             :                 aMargin.SetRight( rOldItem.GetRight(),
     328           0 :                                   (sal_uInt16)m_pRightIndent->GetValue() );
     329             :             else
     330           0 :                 aMargin.SetRight( GetCoreValue( *m_pRightIndent, eUnit ) );
     331             : 
     332           0 :             if ( m_pFLineIndent->IsRelative() )
     333           0 :                 aMargin.SetTxtFirstLineOfst( rOldItem.GetTxtFirstLineOfst(),
     334           0 :                                              (sal_uInt16)m_pFLineIndent->GetValue() );
     335             :             else
     336             :                 aMargin.SetTxtFirstLineOfst(
     337           0 :                     (sal_uInt16)GetCoreValue( *m_pFLineIndent, eUnit ) );
     338             :         }
     339             :         else
     340             :         {
     341           0 :             aMargin.SetTxtLeft( GetCoreValue( *m_pLeftIndent, eUnit ) );
     342           0 :             aMargin.SetRight( GetCoreValue( *m_pRightIndent, eUnit ) );
     343             :             aMargin.SetTxtFirstLineOfst(
     344           0 :                 (sal_uInt16)GetCoreValue( *m_pFLineIndent, eUnit ) );
     345             :         }
     346           0 :         aMargin.SetAutoFirst(m_pAutoCB->IsChecked());
     347           0 :         if ( aMargin.GetTxtFirstLineOfst() < 0 )
     348           0 :             bNullTab = true;
     349           0 :         eState = GetItemSet().GetItemState( nWhich );
     350             : 
     351           0 :         if ( !pOld || !( *(const SvxLRSpaceItem*)pOld == aMargin ) ||
     352             :              SFX_ITEM_DONTCARE == eState )
     353             :         {
     354           0 :             rOutSet.Put( aMargin );
     355           0 :             bModified = sal_True;
     356           0 :         }
     357             :     }
     358             : 
     359           0 :     if ( bNullTab )
     360             :     {
     361           0 :         MapUnit eUnit = (MapUnit)pPool->GetMetric( GetWhich( SID_ATTR_TABSTOP ) );
     362           0 :         if ( MAP_100TH_MM != eUnit )
     363             :         {
     364             : 
     365             :             // negative first line indent -> set null default tabstob if applicable
     366           0 :             sal_uInt16 _nWhich = GetWhich( SID_ATTR_TABSTOP );
     367           0 :             const SfxItemSet& rInSet = GetItemSet();
     368             : 
     369           0 :             if ( rInSet.GetItemState( _nWhich ) >= SFX_ITEM_AVAILABLE )
     370             :             {
     371             :                 const SvxTabStopItem& rTabItem =
     372           0 :                     (const SvxTabStopItem&)rInSet.Get( _nWhich );
     373           0 :                 SvxTabStopItem aNullTab( rTabItem );
     374           0 :                 SvxTabStop aNull( 0, SVX_TAB_ADJUST_DEFAULT );
     375           0 :                 aNullTab.Insert( aNull );
     376           0 :                 rOutSet.Put( aNullTab );
     377             :             }
     378             :         }
     379             :     }
     380           0 :     if( m_pRegisterCB->IsVisible())
     381             :     {
     382             :         const SfxBoolItem* pBoolItem = (SfxBoolItem*)GetOldItem(
     383           0 :                             rOutSet, SID_ATTR_PARA_REGISTER);
     384           0 :         if (!pBoolItem)
     385           0 :             return bModified;
     386           0 :         SfxBoolItem* pRegItem = (SfxBoolItem*)pBoolItem->Clone();
     387           0 :         sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
     388           0 :         bool bSet = pRegItem->GetValue();
     389             : 
     390           0 :         if(m_pRegisterCB->IsChecked() != bSet )
     391             :         {
     392           0 :             pRegItem->SetValue(!bSet);
     393           0 :             rOutSet.Put(*pRegItem);
     394           0 :             bModified = sal_True;
     395             :         }
     396           0 :         else if ( SFX_ITEM_DEFAULT == GetItemSet().GetItemState( _nWhich, false ) )
     397           0 :             rOutSet.ClearItem(_nWhich);
     398           0 :         delete pRegItem;
     399             :     }
     400             : 
     401           0 :     return bModified;
     402             : }
     403             : 
     404           0 : void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet )
     405             : {
     406           0 :     SfxItemPool* pPool = rSet.GetPool();
     407             :     DBG_ASSERT( pPool, "Wo ist der Pool?" );
     408             : 
     409             :     // adjust metric
     410           0 :     FieldUnit eFUnit = GetModuleFieldUnit( rSet );
     411             : 
     412           0 :     bool bApplyCharUnit = GetApplyCharUnit( rSet );
     413             : 
     414           0 :     SvtCJKOptions aCJKOptions;
     415           0 :     if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit )
     416           0 :         eFUnit = FUNIT_CHAR;
     417             : 
     418           0 :     SetFieldUnit( *m_pLeftIndent, eFUnit );
     419           0 :     SetFieldUnit( *m_pRightIndent, eFUnit );
     420           0 :     SetFieldUnit( *m_pFLineIndent, eFUnit );
     421           0 :     if ( eFUnit == FUNIT_CHAR )
     422             :     {
     423           0 :         SetFieldUnit( *m_pTopDist, FUNIT_LINE );
     424           0 :         SetFieldUnit( *m_pBottomDist, FUNIT_LINE );
     425           0 :         SetFieldUnit( *m_pLineDistAtMetricBox, FUNIT_POINT );
     426             :     }
     427             :     else
     428             :     {
     429           0 :         SetFieldUnit( *m_pTopDist, eFUnit );
     430           0 :         SetFieldUnit( *m_pBottomDist, eFUnit );
     431           0 :         SetFieldUnit( *m_pLineDistAtMetricBox, eFUnit );
     432             :     }
     433             : 
     434           0 :     ELRLoseFocusHdl( NULL ); // reset min/max values
     435             : 
     436           0 :     sal_uInt16 _nWhich = GetWhich( SID_ATTR_LRSPACE );
     437           0 :     SfxItemState eItemState = rSet.GetItemState( _nWhich );
     438             : 
     439           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
     440             :     {
     441           0 :         SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
     442             : 
     443           0 :         if ( bRelativeMode )
     444             :         {
     445             :             const SvxLRSpaceItem& rOldItem =
     446           0 :                 (const SvxLRSpaceItem&)rSet.Get( _nWhich );
     447             : 
     448           0 :             if ( rOldItem.GetPropLeft() != 100 )
     449             :             {
     450           0 :                 m_pLeftIndent->SetRelative( true );
     451           0 :                 m_pLeftIndent->SetValue( rOldItem.GetPropLeft() );
     452             :             }
     453             :             else
     454             :             {
     455           0 :                 m_pLeftIndent->SetRelative();
     456           0 :                 SetFieldUnit( *m_pLeftIndent, eFUnit );
     457           0 :                 SetMetricValue( *m_pLeftIndent, rOldItem.GetTxtLeft(), eUnit );
     458             :             }
     459             : 
     460           0 :             if ( rOldItem.GetPropRight() != 100 )
     461             :             {
     462           0 :                 m_pRightIndent->SetRelative( true );
     463           0 :                 m_pRightIndent->SetValue( rOldItem.GetPropRight() );
     464             :             }
     465             :             else
     466             :             {
     467           0 :                 m_pRightIndent->SetRelative();
     468           0 :                 SetFieldUnit( *m_pRightIndent, eFUnit );
     469           0 :                 SetMetricValue( *m_pRightIndent, rOldItem.GetRight(), eUnit );
     470             :             }
     471             : 
     472           0 :             if ( rOldItem.GetPropTxtFirstLineOfst() != 100 )
     473             :             {
     474           0 :                 m_pFLineIndent->SetRelative( true );
     475           0 :                 m_pFLineIndent->SetValue( rOldItem.GetPropTxtFirstLineOfst() );
     476             :             }
     477             :             else
     478             :             {
     479           0 :                 m_pFLineIndent->SetRelative();
     480           0 :                 m_pFLineIndent->SetMin(-9999);
     481           0 :                 SetFieldUnit( *m_pFLineIndent, eFUnit );
     482           0 :                 SetMetricValue( *m_pFLineIndent, rOldItem.GetTxtFirstLineOfst(),
     483           0 :                                 eUnit );
     484             :             }
     485           0 :             m_pAutoCB->Check(rOldItem.IsAutoFirst());
     486             :         }
     487             :         else
     488             :         {
     489             :             const SvxLRSpaceItem& rSpace =
     490           0 :                 (const SvxLRSpaceItem&)rSet.Get( _nWhich );
     491             : 
     492           0 :             SetMetricValue( *m_pLeftIndent, rSpace.GetTxtLeft(), eUnit );
     493           0 :             SetMetricValue( *m_pRightIndent, rSpace.GetRight(), eUnit );
     494           0 :             SetMetricValue( *m_pFLineIndent, rSpace.GetTxtFirstLineOfst(), eUnit );
     495           0 :             m_pAutoCB->Check(rSpace.IsAutoFirst());
     496             :         }
     497           0 :         AutoHdl_Impl(m_pAutoCB);
     498             :     }
     499             :     else
     500             :     {
     501           0 :         m_pLeftIndent->SetEmptyFieldValue();
     502           0 :         m_pRightIndent->SetEmptyFieldValue();
     503           0 :         m_pFLineIndent->SetEmptyFieldValue();
     504             :     }
     505             : 
     506           0 :     _nWhich = GetWhich( SID_ATTR_ULSPACE );
     507           0 :     eItemState = rSet.GetItemState( _nWhich );
     508             : 
     509           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
     510             :     {
     511           0 :         SfxMapUnit eUnit = pPool->GetMetric( _nWhich );
     512             : 
     513             :         const SvxULSpaceItem& rOldItem =
     514           0 :             (const SvxULSpaceItem&)rSet.Get( _nWhich );
     515           0 :         if ( bRelativeMode )
     516             :         {
     517             : 
     518           0 :             if ( rOldItem.GetPropUpper() != 100 )
     519             :             {
     520           0 :                 m_pTopDist->SetRelative( true );
     521           0 :                 m_pTopDist->SetValue( rOldItem.GetPropUpper() );
     522             :             }
     523             :             else
     524             :             {
     525           0 :                 m_pTopDist->SetRelative();
     526           0 :                 if ( eFUnit == FUNIT_CHAR )
     527           0 :                     SetFieldUnit( *m_pTopDist, FUNIT_LINE );
     528             :                 else
     529           0 :                     SetFieldUnit( *m_pTopDist, eFUnit );
     530           0 :                 SetMetricValue( *m_pTopDist, rOldItem.GetUpper(), eUnit );
     531             :             }
     532             : 
     533           0 :             if ( rOldItem.GetPropLower() != 100 )
     534             :             {
     535           0 :                 m_pBottomDist->SetRelative( true );
     536           0 :                 m_pBottomDist->SetValue( rOldItem.GetPropLower() );
     537             :             }
     538             :             else
     539             :             {
     540           0 :                 m_pBottomDist->SetRelative();
     541           0 :                 if ( eFUnit == FUNIT_CHAR )
     542           0 :                     SetFieldUnit( *m_pBottomDist, FUNIT_LINE );
     543             :                 else
     544           0 :                     SetFieldUnit( *m_pBottomDist, eFUnit );
     545           0 :                 SetMetricValue( *m_pBottomDist, rOldItem.GetLower(), eUnit );
     546             :             }
     547             :         }
     548             :         else
     549             :         {
     550           0 :             SetMetricValue( *m_pTopDist, rOldItem.GetUpper(), eUnit );
     551           0 :             SetMetricValue( *m_pBottomDist, rOldItem.GetLower(), eUnit );
     552             :         }
     553           0 :         m_pContextualCB->Check(rOldItem.GetContext());
     554             :     }
     555             :     else
     556             :     {
     557           0 :         m_pTopDist->SetEmptyFieldValue();
     558           0 :         m_pBottomDist->SetEmptyFieldValue();
     559             :     }
     560             : 
     561           0 :     _nWhich = GetWhich( SID_ATTR_PARA_LINESPACE );
     562           0 :     eItemState = rSet.GetItemState( _nWhich );
     563             : 
     564           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
     565           0 :         SetLineSpacing_Impl( (const SvxLineSpacingItem &)rSet.Get( _nWhich ) );
     566             :     else
     567           0 :         m_pLineDist->SetNoSelection();
     568             : 
     569           0 :     _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
     570           0 :     eItemState = rSet.GetItemState( _nWhich );
     571             : 
     572           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
     573           0 :         m_pRegisterCB->Check( ((const SfxBoolItem &)rSet.Get( _nWhich )).GetValue());
     574           0 :     m_pRegisterCB->SaveValue();
     575           0 :     sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet);
     576           0 :     if(nHtmlMode & HTMLMODE_ON)
     577             :     {
     578           0 :         m_pRegisterFL->Hide();
     579           0 :         m_pRegisterCB->Hide();
     580           0 :         m_pAutoCB->Hide();
     581             : 
     582           0 :         if(!(nHtmlMode & HTMLMODE_SOME_STYLES)) // IE or SW
     583             :         {
     584           0 :             m_pRightLabel->Disable();
     585           0 :             m_pRightIndent->Disable();
     586           0 :             m_pTopDist->Disable();  //HTML3.2 and NS 3.0
     587           0 :             m_pBottomDist->Disable();
     588           0 :             m_pFLineIndent->Disable();
     589           0 :             m_pFLineLabel->Disable();
     590             :         }
     591             :     }
     592             : 
     593           0 :     m_pAutoCB->SaveValue();
     594           0 :     m_pContextualCB->SaveValue();
     595           0 :     m_pLineDist->SaveValue();
     596           0 : }
     597             : 
     598           0 : void SvxStdParagraphTabPage::EnableRelativeMode()
     599             : {
     600             :     DBG_ASSERT( GetItemSet().GetParent(), "RelativeMode, but no parent-set!" );
     601             : 
     602           0 :     m_pLeftIndent->EnableRelativeMode( 0, 999 );
     603           0 :     m_pFLineIndent->EnableRelativeMode( 0, 999 );
     604           0 :     m_pRightIndent->EnableRelativeMode( 0, 999 );
     605           0 :     m_pTopDist->EnableRelativeMode( 0, 999 );
     606           0 :     m_pBottomDist->EnableRelativeMode( 0, 999 );
     607           0 :     bRelativeMode = sal_True;
     608           0 : }
     609             : 
     610           0 : int SvxStdParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
     611             : {
     612           0 :     ELRLoseFocusHdl( NULL );
     613             : 
     614           0 :     if ( _pSet )
     615           0 :         FillItemSet( *_pSet );
     616           0 :     return LEAVE_PAGE;
     617             : }
     618             : 
     619           0 : SvxStdParagraphTabPage::SvxStdParagraphTabPage( Window* pParent,  const SfxItemSet& rAttr ) :
     620             :     SfxTabPage( pParent, "ParaIndentSpacing","cui/ui/paraindentspacing.ui", rAttr ),
     621             : 
     622             :     nAbst           ( MAX_DURCH ),
     623             :     nWidth          ( 11905 /*567 * 50*/ ),
     624             :     nMinFixDist(0L),
     625             : 
     626             :     bRelativeMode   ( sal_False ),
     627           0 :     bNegativeIndents(sal_False)
     628             : 
     629             : {
     630           0 :     get(m_pLeftIndent,"spinED_LEFTINDENT");
     631           0 :     get(m_pRightIndent,"spinED_RIGHTINDENT");
     632           0 :     get(m_pRightLabel,"labelFT_RIGHTINDENT");
     633           0 :     get(m_pFLineLabel,"labelFT_FLINEINDENT");
     634           0 :     get(m_pFLineIndent,"spinED_FLINEINDENT");
     635           0 :     get(m_pAutoCB,"checkCB_AUTO");
     636             : 
     637           0 :     get(m_pTopDist,"spinED_TOPDIST");
     638           0 :     get(m_pBottomDist,"spinED_BOTTOMDIST");
     639           0 :     get(m_pContextualCB,"checkCB_CONTEXTUALSPACING");
     640             : 
     641           0 :     get(m_pLineDist,"comboLB_LINEDIST");
     642           0 :     get(m_pLineDistAtPercentBox,"spinED_LINEDISTPERCENT");
     643           0 :     get(m_pLineDistAtMetricBox,"spinED_LINEDISTMETRIC");
     644           0 :     get(m_pLineDistAtLabel,"labelFT_LINEDIST");
     645             : 
     646           0 :     get(m_pAbsDist,"labelST_LINEDIST_ABS");
     647           0 :     sAbsDist = m_pAbsDist->GetText();
     648             : 
     649           0 :     get(m_pRegisterFL,"frameFL_REGISTER");
     650           0 :     get(m_pRegisterCB,"checkCB_REGISTER");
     651             : 
     652           0 :     get(m_pExampleWin,"drawingareaWN_EXAMPLE");
     653             : 
     654             :     // this page needs ExchangeSupport
     655           0 :     SetExchangeSupport();
     656             : 
     657           0 :     m_pLineDistAtMetricBox->Hide();
     658             : 
     659           0 :     Init_Impl();
     660           0 :     m_pFLineIndent->SetMin(-9999);    // is set to 0 on default
     661             : 
     662           0 :     setPreviewsToSamePlace(pParent, this);
     663           0 : }
     664             : 
     665           0 : SvxStdParagraphTabPage::~SvxStdParagraphTabPage()
     666             : {
     667           0 : }
     668             : 
     669           0 : void SvxStdParagraphTabPage::EnableNegativeMode()
     670             : {
     671           0 :     m_pLeftIndent->SetMin(-9999);
     672           0 :     m_pRightIndent->SetMin(-9999);
     673           0 :     m_pRightIndent->EnableNegativeMode();
     674           0 :     m_pLeftIndent->EnableNegativeMode();
     675           0 :     bNegativeIndents = sal_True;
     676           0 : }
     677             : 
     678           0 : sal_uInt16* SvxStdParagraphTabPage::GetRanges()
     679             : {
     680           0 :     return pStdRanges;
     681             : }
     682             : 
     683           0 : void SvxStdParagraphTabPage::SetLineSpacing_Impl
     684             : (
     685             :     const SvxLineSpacingItem &rAttr
     686             : )
     687             : {
     688           0 :     SfxMapUnit eUnit = GetItemSet().GetPool()->GetMetric( rAttr.Which() );
     689             : 
     690           0 :     switch( rAttr.GetLineSpaceRule() )
     691             :     {
     692             :         case SVX_LINE_SPACE_AUTO:
     693             :         {
     694           0 :             SvxInterLineSpace eInter = rAttr.GetInterLineSpaceRule();
     695             : 
     696           0 :             switch( eInter )
     697             :             {
     698             :                 // Default single line spacing
     699             :                 case SVX_INTER_LINE_SPACE_OFF:
     700           0 :                     m_pLineDist->SelectEntryPos( LLINESPACE_1 );
     701           0 :                     break;
     702             : 
     703             :                 // Default single line spacing
     704             :                 case SVX_INTER_LINE_SPACE_PROP:
     705           0 :                     if ( 100 == rAttr.GetPropLineSpace() )
     706             :                     {
     707           0 :                         m_pLineDist->SelectEntryPos( LLINESPACE_1 );
     708           0 :                         break;
     709             :                     }
     710             :                     // 1.5 line spacing
     711           0 :                     if ( 150 == rAttr.GetPropLineSpace() )
     712             :                     {
     713           0 :                         m_pLineDist->SelectEntryPos( LLINESPACE_15 );
     714           0 :                         break;
     715             :                     }
     716             :                     // double line spacing
     717           0 :                     if ( 200 == rAttr.GetPropLineSpace() )
     718             :                     {
     719           0 :                         m_pLineDist->SelectEntryPos( LLINESPACE_2 );
     720           0 :                         break;
     721             :                     }
     722             :                     // the set per cent value
     723           0 :                     m_pLineDistAtPercentBox->SetValue( m_pLineDistAtPercentBox->Normalize(rAttr.GetPropLineSpace() ) );
     724           0 :                     m_pLineDist->SelectEntryPos( LLINESPACE_PROP );
     725           0 :                     break;
     726             : 
     727             :                 case SVX_INTER_LINE_SPACE_FIX:
     728           0 :                     SetMetricValue( *m_pLineDistAtMetricBox, rAttr.GetInterLineSpace(), eUnit );
     729           0 :                     m_pLineDist->SelectEntryPos( LLINESPACE_DURCH );
     730           0 :                     break;
     731             :                 default: ;//prevent warning
     732             :             }
     733             :         }
     734           0 :         break;
     735             :         case SVX_LINE_SPACE_FIX:
     736           0 :             SetMetricValue(*m_pLineDistAtMetricBox, rAttr.GetLineHeight(), eUnit);
     737           0 :             m_pLineDist->SelectEntryPos( LLINESPACE_FIX );
     738           0 :         break;
     739             : 
     740             :         case SVX_LINE_SPACE_MIN:
     741           0 :             SetMetricValue(*m_pLineDistAtMetricBox, rAttr.GetLineHeight(), eUnit);
     742           0 :             m_pLineDist->SelectEntryPos( LLINESPACE_MIN );
     743           0 :             break;
     744             :         default: ;//prevent warning
     745             :     }
     746           0 :     LineDistHdl_Impl( m_pLineDist );
     747           0 : }
     748             : 
     749           0 : IMPL_LINK( SvxStdParagraphTabPage, LineDistHdl_Impl, ListBox *, pBox )
     750             : {
     751           0 :     switch( pBox->GetSelectEntryPos() )
     752             :     {
     753             :         case LLINESPACE_1:
     754             :         case LLINESPACE_15:
     755             :         case LLINESPACE_2:
     756           0 :             m_pLineDistAtLabel->Enable(false);
     757           0 :             m_pLineDistAtPercentBox->Enable(false);
     758           0 :             m_pLineDistAtPercentBox->SetText( OUString() );
     759           0 :             m_pLineDistAtMetricBox->Enable(false);
     760           0 :             m_pLineDistAtMetricBox->SetText( OUString() );
     761           0 :             break;
     762             : 
     763             :         case LLINESPACE_DURCH:
     764             :             // setting a sensible default?
     765             :             // limit MS min(10, aPageSize)
     766           0 :             m_pLineDistAtMetricBox->SetMin(0);
     767             : 
     768           0 :             if ( m_pLineDistAtMetricBox->GetText().isEmpty() )
     769           0 :                 m_pLineDistAtMetricBox->SetValue( m_pLineDistAtMetricBox->Normalize( 1 ) );
     770           0 :             m_pLineDistAtPercentBox->Hide();
     771           0 :             m_pLineDistAtMetricBox->Show();
     772           0 :             m_pLineDistAtMetricBox->Enable();
     773           0 :             m_pLineDistAtLabel->Enable();
     774           0 :             break;
     775             : 
     776             :         case LLINESPACE_MIN:
     777           0 :             m_pLineDistAtMetricBox->SetMin(0);
     778             : 
     779           0 :             if ( m_pLineDistAtMetricBox->GetText().isEmpty() )
     780           0 :                 m_pLineDistAtMetricBox->SetValue( m_pLineDistAtMetricBox->Normalize( 10 ), FUNIT_TWIP );
     781           0 :             m_pLineDistAtPercentBox->Hide();
     782           0 :             m_pLineDistAtMetricBox->Show();
     783           0 :             m_pLineDistAtMetricBox->Enable();
     784           0 :             m_pLineDistAtLabel->Enable();
     785           0 :             break;
     786             : 
     787             :         case LLINESPACE_PROP:
     788             : 
     789           0 :             if ( m_pLineDistAtPercentBox->GetText().isEmpty() )
     790           0 :                 m_pLineDistAtPercentBox->SetValue( m_pLineDistAtPercentBox->Normalize( 100 ), FUNIT_TWIP );
     791           0 :             m_pLineDistAtMetricBox->Hide();
     792           0 :             m_pLineDistAtPercentBox->Show();
     793           0 :             m_pLineDistAtPercentBox->Enable();
     794           0 :             m_pLineDistAtLabel->Enable();
     795           0 :             break;
     796             :         case LLINESPACE_FIX:
     797             :         {
     798           0 :             sal_Int64 nTemp = m_pLineDistAtMetricBox->GetValue();
     799           0 :             m_pLineDistAtMetricBox->SetMin(m_pLineDistAtMetricBox->Normalize(nMinFixDist), FUNIT_TWIP);
     800             : 
     801             :             // if the value has been changed at SetMin,
     802             :             // it is time for the default
     803           0 :             if ( m_pLineDistAtMetricBox->GetValue() != nTemp )
     804           0 :                 SetMetricValue( *m_pLineDistAtMetricBox, FIX_DIST_DEF, SFX_MAPUNIT_TWIP ); // fix is only in Writer
     805           0 :             m_pLineDistAtPercentBox->Hide();
     806           0 :             m_pLineDistAtMetricBox->Show();
     807           0 :             m_pLineDistAtMetricBox->Enable();
     808           0 :             m_pLineDistAtLabel->Enable();
     809             :         }
     810           0 :         break;
     811             :     }
     812           0 :     UpdateExample_Impl( sal_True );
     813           0 :     return 0;
     814             : }
     815             : 
     816           0 : IMPL_LINK_NOARG_INLINE_START(SvxStdParagraphTabPage, ModifyHdl_Impl)
     817             : {
     818           0 :     UpdateExample_Impl();
     819           0 :     return 0;
     820             : }
     821           0 : IMPL_LINK_NOARG_INLINE_END(SvxStdParagraphTabPage, ModifyHdl_Impl)
     822             : 
     823           0 : void SvxStdParagraphTabPage::Init_Impl()
     824             : {
     825             :     m_pLineDist->SetSelectHdl(
     826           0 :         LINK( this, SvxStdParagraphTabPage, LineDistHdl_Impl ) );
     827             : 
     828           0 :     Link aLink = LINK( this, SvxStdParagraphTabPage, ELRLoseFocusHdl );
     829           0 :     m_pFLineIndent->SetLoseFocusHdl( aLink );
     830           0 :     m_pLeftIndent->SetLoseFocusHdl( aLink );
     831           0 :     m_pRightIndent->SetLoseFocusHdl( aLink );
     832             : 
     833           0 :     aLink = LINK( this, SvxStdParagraphTabPage, ModifyHdl_Impl );
     834           0 :     m_pFLineIndent->SetModifyHdl( aLink );
     835           0 :     m_pLeftIndent->SetModifyHdl( aLink );
     836           0 :     m_pRightIndent->SetModifyHdl( aLink );
     837           0 :     m_pTopDist->SetModifyHdl( aLink );
     838           0 :     m_pBottomDist->SetModifyHdl( aLink );
     839             : 
     840           0 :     m_pAutoCB->SetClickHdl( LINK( this, SvxStdParagraphTabPage, AutoHdl_Impl ));
     841           0 :     SfxItemPool* pPool = GetItemSet().GetPool();
     842             :     DBG_ASSERT( pPool, "Wo ist der Pool" );
     843           0 :     FieldUnit eUnit = MapToFieldUnit( pPool->GetMetric( GetWhich( SID_ATTR_LRSPACE ) ) );
     844             : 
     845           0 :     m_pTopDist->SetMax( m_pTopDist->Normalize( nAbst ), eUnit );
     846           0 :     m_pBottomDist->SetMax( m_pBottomDist->Normalize( nAbst ), eUnit );
     847           0 :     m_pLineDistAtMetricBox->SetMax( m_pLineDistAtMetricBox->Normalize( nAbst ), eUnit );
     848           0 : }
     849             : 
     850           0 : void SvxStdParagraphTabPage::UpdateExample_Impl( sal_Bool bAll )
     851             : {
     852           0 :     m_pExampleWin->SetFirstLineOfst( (short)m_pFLineIndent->Denormalize( m_pFLineIndent->GetValue( FUNIT_TWIP ) ) );
     853           0 :     m_pExampleWin->SetLeftMargin( static_cast<long>(m_pLeftIndent->Denormalize( m_pLeftIndent->GetValue( FUNIT_TWIP ) ) ) );
     854           0 :     m_pExampleWin->SetRightMargin( static_cast<long>(m_pRightIndent->Denormalize( m_pRightIndent->GetValue( FUNIT_TWIP ) ) ) );
     855           0 :     m_pExampleWin->SetUpper( (sal_uInt16)m_pTopDist->Denormalize( m_pTopDist->GetValue( FUNIT_TWIP ) ) );
     856           0 :     m_pExampleWin->SetLower( (sal_uInt16)m_pBottomDist->Denormalize( m_pBottomDist->GetValue( FUNIT_TWIP ) ) );
     857             : 
     858           0 :     sal_Int32 nPos = m_pLineDist->GetSelectEntryPos();
     859             : 
     860           0 :     switch ( nPos )
     861             :     {
     862             :         case LLINESPACE_1:
     863             :         case LLINESPACE_15:
     864             :         case LLINESPACE_2:
     865           0 :             m_pExampleWin->SetLineSpace( (SvxPrevLineSpace)nPos );
     866           0 :             break;
     867             : 
     868             :         case LLINESPACE_PROP:
     869             :             m_pExampleWin->SetLineSpace( (SvxPrevLineSpace)nPos,
     870           0 :                 (sal_uInt16)m_pLineDistAtPercentBox->Denormalize( m_pLineDistAtPercentBox->GetValue() ) );
     871           0 :             break;
     872             : 
     873             :         case LLINESPACE_MIN:
     874             :         case LLINESPACE_DURCH:
     875             :         case LLINESPACE_FIX:
     876             :             m_pExampleWin->SetLineSpace( (SvxPrevLineSpace)nPos,
     877           0 :                 (sal_uInt16)GetCoreValue( *m_pLineDistAtMetricBox, SFX_MAPUNIT_TWIP ) );
     878           0 :             break;
     879             :     }
     880           0 :     m_pExampleWin->Draw( bAll );
     881           0 : }
     882             : 
     883           0 : void SvxStdParagraphTabPage::EnableRegisterMode()
     884             : {
     885           0 :     m_pRegisterCB->Show();
     886           0 :     m_pRegisterFL->Show();
     887           0 : }
     888             : 
     889           0 : void SvxStdParagraphTabPage::EnableContextualMode()
     890             : {
     891           0 :     m_pContextualCB->Show();
     892           0 : }
     893             : 
     894           0 : IMPL_LINK( SvxStdParagraphTabPage, AutoHdl_Impl, CheckBox*, pBox )
     895             : {
     896           0 :     sal_Bool bEnable = !pBox->IsChecked();
     897           0 :     m_pFLineLabel->Enable(bEnable);
     898           0 :     m_pFLineIndent->Enable(bEnable);
     899           0 :     return 0;
     900             : }
     901             : 
     902           0 : void SvxStdParagraphTabPage::SetPageWidth( sal_uInt16 nPageWidth )
     903             : {
     904           0 :     nWidth = nPageWidth;
     905           0 : }
     906             : 
     907           0 : void SvxStdParagraphTabPage::EnableAutoFirstLine()
     908             : {
     909           0 :     m_pAutoCB->Show();
     910           0 : }
     911             : 
     912           0 : void    SvxStdParagraphTabPage::EnableAbsLineDist(long nMinTwip)
     913             : {
     914           0 :     m_pLineDist->InsertEntry(sAbsDist);
     915           0 :     nMinFixDist = nMinTwip;
     916           0 : }
     917             : 
     918           0 : void    SvxStdParagraphTabPage::PageCreated(SfxAllItemSet aSet)
     919             : {
     920             : 
     921             : /* different bit represent call to different method of SvxStdParagraphTabPage
     922             :                         0x0001 --->EnableRelativeMode()
     923             :                         0x0002 --->EnableRegisterMode()
     924             :                         0x0004 --->EnableAutoFirstLine()
     925             :                         0x0008 --->EnableNegativeMode()
     926             :                         0x0010 --->EnableContextualMode()
     927             :             */
     928           0 :     SFX_ITEMSET_ARG (&aSet,pPageWidthItem,SfxUInt16Item,SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH,false);
     929           0 :     SFX_ITEMSET_ARG (&aSet,pFlagSetItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,false);
     930           0 :     SFX_ITEMSET_ARG (&aSet,pLineDistItem,SfxUInt32Item,SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,false);
     931             : 
     932           0 :     if (pPageWidthItem)
     933           0 :         SetPageWidth(pPageWidthItem->GetValue());
     934             : 
     935           0 :     if (pFlagSetItem )
     936           0 :         if (( 0x0001 & pFlagSetItem->GetValue())== 0x0001 )
     937           0 :             EnableRelativeMode();
     938             : 
     939           0 :     if (pFlagSetItem)
     940           0 :         if (( 0x0002 & pFlagSetItem->GetValue())== 0x0002 )
     941           0 :                 EnableRegisterMode();
     942             : 
     943           0 :     if (pFlagSetItem)
     944           0 :         if ( ( 0x0004 & pFlagSetItem->GetValue())== 0x0004 )
     945           0 :             EnableAutoFirstLine();
     946             : 
     947           0 :     if(pLineDistItem)
     948           0 :         EnableAbsLineDist(pLineDistItem->GetValue());
     949             : 
     950           0 :     if (pFlagSetItem)
     951           0 :         if  (( 0x0008 & pFlagSetItem->GetValue()) == 0x0008 )
     952           0 :                 EnableNegativeMode();
     953             : 
     954           0 :     if (pFlagSetItem)
     955           0 :         if  (( 0x0010 & pFlagSetItem->GetValue()) == 0x0010 )
     956           0 :                 EnableContextualMode();
     957           0 : }
     958             : 
     959             : #define LASTLINEPOS_DEFAULT     0
     960             : #define LASTLINEPOS_LEFT        1
     961             : 
     962             : #define LASTLINECOUNT_OLD       3
     963             : #define LASTLINECOUNT_NEW       4
     964             : 
     965           0 : SvxParaAlignTabPage::SvxParaAlignTabPage( Window* pParent, const SfxItemSet& rSet )
     966             : 
     967           0 :     : SfxTabPage(pParent, "ParaAlignPage", "cui/ui/paragalignpage.ui",rSet)
     968             : {
     969           0 :     get(m_pLeft,"radioBTN_LEFTALIGN");
     970           0 :     get(m_pRight,"radioBTN_RIGHTALIGN");
     971           0 :     get(m_pCenter,"radioBTN_CENTERALIGN");
     972           0 :     get(m_pJustify,"radioBTN_JUSTIFYALIGN");
     973           0 :     get(m_pLeftBottom,"labelST_LEFTALIGN_ASIAN");
     974           0 :     get(m_pRightTop,"labelST_RIGHTALIGN_ASIAN");
     975             : 
     976           0 :     get(m_pLastLineFT,"labelLB_LASTLINE");
     977           0 :     get(m_pLastLineLB,"comboLB_LASTLINE");
     978           0 :     get(m_pExpandCB,"checkCB_EXPAND");
     979           0 :     get(m_pSnapToGridCB,"checkCB_SNAP");
     980           0 :     get(m_pExampleWin,"drawingareaWN_EXAMPLE");
     981             : 
     982           0 :     get(m_pVertAlignLB,"comboLB_VERTALIGN");
     983           0 :     get(m_pVertAlignFL,"frameFL_VERTALIGN");
     984             : 
     985           0 :     get(m_pPropertiesFL,"framePROPERTIES");
     986           0 :     get(m_pTextDirectionLB,"comboLB_TEXTDIRECTION");
     987             : 
     988           0 :     SvtLanguageOptions aLangOptions;
     989           0 :     sal_uInt16 nLastLinePos = LASTLINEPOS_DEFAULT;
     990             : 
     991           0 :     if ( aLangOptions.IsAsianTypographyEnabled() )
     992             :     {
     993           0 :         m_pLeft->SetText(m_pLeftBottom->GetText());
     994           0 :         m_pRight->SetText(m_pRightTop->GetText());
     995             : 
     996           0 :         OUString sLeft(m_pLeft->GetText());
     997           0 :         sLeft = MnemonicGenerator::EraseAllMnemonicChars( sLeft );
     998             : 
     999           0 :         if ( m_pLastLineLB->GetEntryCount() == LASTLINECOUNT_OLD )
    1000             :         {
    1001           0 :             m_pLastLineLB->RemoveEntry( 0 );
    1002           0 :             m_pLastLineLB->InsertEntry( sLeft, 0 );
    1003             :         }
    1004             :         else
    1005           0 :             nLastLinePos = LASTLINEPOS_LEFT;
    1006             :     }
    1007             : 
    1008             :     // remove "Default" or "Left" entry, depends on CJKOptions
    1009           0 :     if ( m_pLastLineLB->GetEntryCount() == LASTLINECOUNT_NEW )
    1010           0 :         m_pLastLineLB->RemoveEntry( nLastLinePos );
    1011             : 
    1012           0 :     Link aLink = LINK( this, SvxParaAlignTabPage, AlignHdl_Impl );
    1013           0 :     m_pLeft->SetClickHdl( aLink );
    1014           0 :     m_pRight->SetClickHdl( aLink );
    1015           0 :     m_pCenter->SetClickHdl( aLink );
    1016           0 :     m_pJustify->SetClickHdl( aLink );
    1017           0 :     m_pLastLineLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, LastLineHdl_Impl ) );
    1018           0 :     m_pTextDirectionLB->SetSelectHdl( LINK( this, SvxParaAlignTabPage, TextDirectionHdl_Impl ) );
    1019             : 
    1020           0 :     sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet);
    1021           0 :     if(!(nHtmlMode & HTMLMODE_ON) || (0 != (nHtmlMode & HTMLMODE_SOME_STYLES)) )
    1022             :     {
    1023           0 :         if( aLangOptions.IsCTLFontEnabled() )
    1024             :         {
    1025           0 :             m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_LTR ), FRMDIR_HORI_LEFT_TOP );
    1026           0 :             m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_RTL ), FRMDIR_HORI_RIGHT_TOP );
    1027           0 :             m_pTextDirectionLB->InsertEntryValue( CUI_RESSTR( RID_SVXSTR_FRAMEDIR_SUPER ), FRMDIR_ENVIRONMENT );
    1028             : 
    1029           0 :             m_pPropertiesFL->Show();
    1030             :         }
    1031             :     }
    1032             : 
    1033           0 :     setPreviewsToSamePlace(pParent, this);
    1034           0 : }
    1035             : 
    1036           0 : SvxParaAlignTabPage::~SvxParaAlignTabPage()
    1037             : {
    1038           0 : }
    1039             : 
    1040           0 : int SvxParaAlignTabPage::DeactivatePage( SfxItemSet* _pSet )
    1041             : {
    1042           0 :     if ( _pSet )
    1043           0 :         FillItemSet( *_pSet );
    1044           0 :     return LEAVE_PAGE;
    1045             : }
    1046             : 
    1047           0 : SfxTabPage* SvxParaAlignTabPage::Create( Window* pParent, const SfxItemSet& rSet )
    1048             : {
    1049           0 :     return new SvxParaAlignTabPage(pParent, rSet);
    1050             : }
    1051             : 
    1052           0 : sal_uInt16* SvxParaAlignTabPage::GetRanges()
    1053             : {
    1054           0 :     return pAlignRanges;
    1055             : }
    1056             : 
    1057           0 : bool SvxParaAlignTabPage::FillItemSet( SfxItemSet& rOutSet )
    1058             : {
    1059           0 :     sal_Bool bModified = sal_False;
    1060             : 
    1061           0 :     bool bAdj = false, bChecked = false;
    1062           0 :     SvxAdjust eAdjust = SVX_ADJUST_LEFT;
    1063             : 
    1064           0 :     if ( m_pLeft->IsChecked() )
    1065             :     {
    1066           0 :         eAdjust = SVX_ADJUST_LEFT;
    1067           0 :         bAdj = !m_pLeft->GetSavedValue();
    1068           0 :         bChecked = true;
    1069             :     }
    1070           0 :     else if ( m_pRight->IsChecked() )
    1071             :     {
    1072           0 :         eAdjust = SVX_ADJUST_RIGHT;
    1073           0 :         bAdj = !m_pRight->GetSavedValue();
    1074           0 :         bChecked = true;
    1075             :     }
    1076           0 :     else if ( m_pCenter->IsChecked() )
    1077             :     {
    1078           0 :         eAdjust = SVX_ADJUST_CENTER;
    1079           0 :         bAdj = !m_pCenter->GetSavedValue();
    1080           0 :         bChecked = true;
    1081             :     }
    1082           0 :     else if ( m_pJustify->IsChecked() )
    1083             :     {
    1084           0 :         eAdjust = SVX_ADJUST_BLOCK;
    1085           0 :         bAdj = !m_pJustify->GetSavedValue() ||
    1086           0 :             TriState(m_pExpandCB->IsChecked()) != m_pExpandCB->GetSavedValue() ||
    1087           0 :             m_pLastLineLB->GetSelectEntryPos() != m_pLastLineLB->GetSavedValue();
    1088           0 :         bChecked = true;
    1089             :     }
    1090           0 :     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
    1091             : 
    1092           0 :     if ( bAdj )
    1093             :     {
    1094           0 :         const SvxAdjustItem* pOld = (const SvxAdjustItem*)GetOldItem( rOutSet, SID_ATTR_PARA_ADJUST );
    1095             : 
    1096           0 :         SvxAdjust eOneWord = m_pExpandCB->IsChecked() ? SVX_ADJUST_BLOCK : SVX_ADJUST_LEFT;
    1097             : 
    1098           0 :         sal_Int32 nLBPos = m_pLastLineLB->GetSelectEntryPos();
    1099           0 :         SvxAdjust eLastBlock = SVX_ADJUST_LEFT;
    1100             : 
    1101           0 :         if ( 1 == nLBPos )
    1102           0 :             eLastBlock = SVX_ADJUST_CENTER;
    1103           0 :         else if ( 2 == nLBPos )
    1104           0 :             eLastBlock = SVX_ADJUST_BLOCK;
    1105             : 
    1106             :         bool bNothingWasChecked =
    1107           0 :             !m_pLeft->GetSavedValue() && !m_pRight->GetSavedValue() &&
    1108           0 :             !m_pCenter->GetSavedValue() && !m_pJustify->GetSavedValue();
    1109             : 
    1110           0 :         if ( !pOld || pOld->GetAdjust() != eAdjust ||
    1111           0 :              pOld->GetOneWord() != eOneWord ||
    1112           0 :              pOld->GetLastBlock() != eLastBlock ||
    1113           0 :              ( bChecked && bNothingWasChecked ) )
    1114             :         {
    1115           0 :             bModified = sal_True;
    1116             :             SvxAdjustItem aAdj(
    1117           0 :                 (const SvxAdjustItem&)GetItemSet().Get( _nWhich ) );
    1118           0 :             aAdj.SetAdjust( eAdjust );
    1119           0 :             aAdj.SetOneWord( eOneWord );
    1120           0 :             aAdj.SetLastBlock( eLastBlock );
    1121           0 :             rOutSet.Put( aAdj );
    1122             :         }
    1123             :     }
    1124           0 :     if(TriState(m_pSnapToGridCB->IsChecked()) != m_pSnapToGridCB->GetSavedValue())
    1125             :     {
    1126           0 :         rOutSet.Put(SvxParaGridItem(m_pSnapToGridCB->IsChecked(), GetWhich( SID_ATTR_PARA_SNAPTOGRID )));
    1127           0 :         bModified = sal_True;
    1128             :     }
    1129           0 :     if(m_pVertAlignLB->GetSavedValue() != m_pVertAlignLB->GetSelectEntryPos())
    1130             :     {
    1131           0 :         rOutSet.Put(SvxParaVertAlignItem(m_pVertAlignLB->GetSelectEntryPos(), GetWhich( SID_PARA_VERTALIGN )));
    1132           0 :         bModified = sal_True;
    1133             :     }
    1134             : 
    1135           0 :     if( m_pTextDirectionLB->IsVisible() )
    1136             :     {
    1137           0 :         SvxFrameDirection eDir = m_pTextDirectionLB->GetSelectEntryValue();
    1138           0 :         if( eDir != m_pTextDirectionLB->GetSavedValue() )
    1139             :         {
    1140           0 :             rOutSet.Put( SvxFrameDirectionItem( eDir, GetWhich( SID_ATTR_FRAMEDIRECTION ) ) );
    1141           0 :             bModified = sal_True;
    1142             :         }
    1143             :     }
    1144             : 
    1145           0 :     return bModified;
    1146             : }
    1147             : 
    1148           0 : void SvxParaAlignTabPage::Reset( const SfxItemSet& rSet )
    1149             : {
    1150           0 :     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_ADJUST );
    1151           0 :     SfxItemState eItemState = rSet.GetItemState( _nWhich );
    1152             : 
    1153           0 :     sal_Int32 nLBSelect = 0;
    1154           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
    1155             :     {
    1156           0 :         const SvxAdjustItem& rAdj = (const SvxAdjustItem&)rSet.Get( _nWhich );
    1157             : 
    1158           0 :         switch ( rAdj.GetAdjust() /*!!! ask VB rAdj.GetLastBlock()*/ )
    1159             :         {
    1160           0 :             case SVX_ADJUST_LEFT: m_pLeft->Check(); break;
    1161             : 
    1162           0 :             case SVX_ADJUST_RIGHT: m_pRight->Check(); break;
    1163             : 
    1164           0 :             case SVX_ADJUST_CENTER: m_pCenter->Check(); break;
    1165             : 
    1166           0 :             case SVX_ADJUST_BLOCK: m_pJustify->Check(); break;
    1167             :             default: ; //prevent warning
    1168             :         }
    1169           0 :         sal_Bool bEnable = m_pJustify->IsChecked();
    1170           0 :         m_pLastLineFT->Enable(bEnable);
    1171           0 :         m_pLastLineLB->Enable(bEnable);
    1172           0 :         m_pExpandCB->Enable(bEnable);
    1173             : 
    1174           0 :         m_pExpandCB->Check(SVX_ADJUST_BLOCK == rAdj.GetOneWord());
    1175           0 :         switch(rAdj.GetLastBlock())
    1176             :         {
    1177           0 :             case SVX_ADJUST_LEFT:  nLBSelect = 0; break;
    1178             : 
    1179           0 :             case SVX_ADJUST_CENTER: nLBSelect = 1;  break;
    1180             : 
    1181           0 :             case SVX_ADJUST_BLOCK: nLBSelect = 2;  break;
    1182             :             default: ; //prevent warning
    1183             :         }
    1184             :     }
    1185             :     else
    1186             :     {
    1187           0 :         m_pLeft->Check( false );
    1188           0 :         m_pRight->Check( false );
    1189           0 :         m_pCenter->Check( false );
    1190           0 :         m_pJustify->Check( false );
    1191             :     }
    1192           0 :     m_pLastLineLB->SelectEntryPos(nLBSelect);
    1193             : 
    1194           0 :     sal_uInt16 nHtmlMode = GetHtmlMode_Impl(rSet);
    1195           0 :     if(nHtmlMode & HTMLMODE_ON)
    1196             :     {
    1197           0 :         m_pLastLineLB->Hide();
    1198           0 :         m_pLastLineFT->Hide();
    1199           0 :         m_pExpandCB->Hide();
    1200           0 :         if(!(nHtmlMode & HTMLMODE_FULL_STYLES) )
    1201           0 :             m_pJustify->Disable();
    1202           0 :         m_pSnapToGridCB->Show(false);
    1203             :     }
    1204           0 :     _nWhich = GetWhich(SID_ATTR_PARA_SNAPTOGRID);
    1205           0 :     eItemState = rSet.GetItemState( _nWhich );
    1206           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
    1207             :     {
    1208           0 :         const SvxParaGridItem& rSnap = (const SvxParaGridItem&)rSet.Get( _nWhich );
    1209           0 :         m_pSnapToGridCB->Check(rSnap.GetValue());
    1210             :     }
    1211             : 
    1212           0 :     _nWhich = GetWhich( SID_PARA_VERTALIGN );
    1213           0 :     eItemState = rSet.GetItemState( _nWhich );
    1214             : 
    1215           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
    1216             :     {
    1217           0 :         m_pVertAlignFL->Show();
    1218             : 
    1219           0 :         const SvxParaVertAlignItem& rAlign = (const SvxParaVertAlignItem&)rSet.Get( _nWhich );
    1220             : 
    1221           0 :         m_pVertAlignLB->SelectEntryPos(rAlign.GetValue());
    1222             :     }
    1223             : 
    1224           0 :     _nWhich = GetWhich( SID_ATTR_FRAMEDIRECTION );
    1225             :     //text direction
    1226           0 :     if( SFX_ITEM_AVAILABLE <= rSet.GetItemState( _nWhich ) )
    1227             :     {
    1228           0 :         const SvxFrameDirectionItem& rFrameDirItem = ( const SvxFrameDirectionItem& ) rSet.Get( _nWhich );
    1229           0 :         m_pTextDirectionLB->SelectEntryValue( (SvxFrameDirection)rFrameDirItem.GetValue() );
    1230           0 :         m_pTextDirectionLB->SaveValue();
    1231             :     }
    1232             : 
    1233           0 :     m_pSnapToGridCB->SaveValue();
    1234           0 :     m_pVertAlignLB->SaveValue();
    1235           0 :     m_pLeft->SaveValue();
    1236           0 :     m_pRight->SaveValue();
    1237           0 :     m_pCenter->SaveValue();
    1238           0 :     m_pJustify->SaveValue();
    1239           0 :     m_pLastLineLB->SaveValue();
    1240           0 :     m_pExpandCB->SaveValue();
    1241             : 
    1242           0 :     UpdateExample_Impl(sal_True);
    1243           0 : }
    1244             : 
    1245           0 : IMPL_LINK_NOARG(SvxParaAlignTabPage, AlignHdl_Impl)
    1246             : {
    1247           0 :     sal_Bool bJustify = m_pJustify->IsChecked();
    1248           0 :     m_pLastLineFT->Enable(bJustify);
    1249           0 :     m_pLastLineLB->Enable(bJustify);
    1250           0 :     m_pExpandCB->Enable(bJustify);
    1251           0 :     UpdateExample_Impl(sal_False);
    1252           0 :     return 0;
    1253             : }
    1254             : 
    1255           0 : IMPL_LINK_NOARG(SvxParaAlignTabPage, LastLineHdl_Impl)
    1256             : {
    1257           0 :     UpdateExample_Impl(sal_False);
    1258           0 :     return 0;
    1259             : }
    1260             : 
    1261           0 : IMPL_LINK_NOARG(SvxParaAlignTabPage, TextDirectionHdl_Impl)
    1262             : {
    1263           0 :     SvxFrameDirection eDir = m_pTextDirectionLB->GetSelectEntryValue();
    1264           0 :     switch ( eDir )
    1265             :     {
    1266             :         // check the default alignment for this text direction
    1267           0 :         case FRMDIR_HORI_LEFT_TOP :     m_pLeft->Check( true ); break;
    1268           0 :         case FRMDIR_HORI_RIGHT_TOP :    m_pRight->Check( true ); break;
    1269           0 :         case FRMDIR_ENVIRONMENT :       /* do nothing */ break;
    1270             :         default:
    1271             :         {
    1272             :             SAL_WARN( "cui.tabpages", "SvxParaAlignTabPage::TextDirectionHdl_Impl(): other directions not supported" );
    1273             :         }
    1274             :     }
    1275             : 
    1276           0 :     return 0;
    1277             : }
    1278             : 
    1279           0 : void SvxParaAlignTabPage::UpdateExample_Impl( sal_Bool bAll )
    1280             : {
    1281           0 :     if ( m_pLeft->IsChecked() )
    1282           0 :         m_pExampleWin->SetAdjust( SVX_ADJUST_LEFT );
    1283           0 :     else if ( m_pRight->IsChecked() )
    1284           0 :         m_pExampleWin->SetAdjust( SVX_ADJUST_RIGHT );
    1285           0 :     else if ( m_pCenter->IsChecked() )
    1286           0 :         m_pExampleWin->SetAdjust( SVX_ADJUST_CENTER );
    1287           0 :     else if ( m_pJustify->IsChecked() )
    1288             :     {
    1289           0 :         m_pExampleWin->SetAdjust( SVX_ADJUST_BLOCK );
    1290           0 :         SvxAdjust eLastBlock = SVX_ADJUST_LEFT;
    1291           0 :         sal_Int32 nLBPos = m_pLastLineLB->GetSelectEntryPos();
    1292           0 :         if(nLBPos == 1)
    1293           0 :             eLastBlock = SVX_ADJUST_CENTER;
    1294           0 :         else if(nLBPos == 2)
    1295           0 :             eLastBlock = SVX_ADJUST_BLOCK;
    1296           0 :         m_pExampleWin->SetLastLine( eLastBlock );
    1297             :     }
    1298             : 
    1299           0 :     m_pExampleWin->Draw( bAll );
    1300           0 : }
    1301             : 
    1302           0 : void SvxParaAlignTabPage::EnableJustifyExt()
    1303             : {
    1304           0 :     m_pLastLineFT->Show();
    1305           0 :     m_pLastLineLB->Show();
    1306           0 :     m_pExpandCB->Show();
    1307           0 :     SvtLanguageOptions aCJKOptions;
    1308           0 :     if(aCJKOptions.IsAsianTypographyEnabled())
    1309           0 :         m_pSnapToGridCB->Show();
    1310             : 
    1311           0 : }
    1312             : 
    1313           0 : void SvxParaAlignTabPage::PageCreated (SfxAllItemSet aSet)
    1314             : {
    1315           0 :     SFX_ITEMSET_ARG (&aSet,pBoolItem,SfxBoolItem,SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,false);
    1316           0 :     if (pBoolItem)
    1317           0 :         if(pBoolItem->GetValue())
    1318           0 :             EnableJustifyExt();
    1319           0 : }
    1320             : 
    1321           0 : SfxTabPage* SvxExtParagraphTabPage::Create( Window* pParent,
    1322             :                                             const SfxItemSet& rSet )
    1323             : {
    1324           0 :     return new SvxExtParagraphTabPage( pParent, rSet );
    1325             : }
    1326             : 
    1327           0 : bool SvxExtParagraphTabPage::FillItemSet( SfxItemSet& rOutSet )
    1328             : {
    1329           0 :     sal_Bool bModified = sal_False;
    1330           0 :     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
    1331           0 :     const TriState eHyphenState = m_pHyphenBox->GetState();
    1332           0 :     const SfxPoolItem* pOld = GetOldItem( rOutSet, SID_ATTR_PARA_HYPHENZONE );
    1333             : 
    1334           0 :     if ( eHyphenState != m_pHyphenBox->GetSavedValue()     ||
    1335           0 :          m_pExtHyphenBeforeBox->IsValueModified()          ||
    1336           0 :          m_pExtHyphenAfterBox->IsValueModified()           ||
    1337           0 :          m_pMaxHyphenEdit->IsValueModified() )
    1338             :     {
    1339             :         SvxHyphenZoneItem aHyphen(
    1340           0 :             (const SvxHyphenZoneItem&)GetItemSet().Get( _nWhich ) );
    1341           0 :         aHyphen.SetHyphen( eHyphenState == TRISTATE_TRUE );
    1342             : 
    1343           0 :         if ( eHyphenState == TRISTATE_TRUE )
    1344             :         {
    1345           0 :             aHyphen.GetMinLead() = (sal_uInt8)m_pExtHyphenBeforeBox->GetValue();
    1346           0 :             aHyphen.GetMinTrail() = (sal_uInt8)m_pExtHyphenAfterBox->GetValue();
    1347             :         }
    1348           0 :         aHyphen.GetMaxHyphens() = (sal_uInt8)m_pMaxHyphenEdit->GetValue();
    1349             : 
    1350           0 :         if ( !pOld ||
    1351           0 :             !( *(SvxHyphenZoneItem*)pOld == aHyphen ) ||
    1352           0 :                 eHyphenState != m_pHyphenBox->GetSavedValue())
    1353             :         {
    1354           0 :             rOutSet.Put( aHyphen );
    1355           0 :             bModified = sal_True;
    1356           0 :         }
    1357             :     }
    1358             : 
    1359           0 :     if (m_pPagenumEdit->IsEnabled() && m_pPagenumEdit->IsValueModified())
    1360             :     {
    1361             :         SfxUInt16Item aPageNum( SID_ATTR_PARA_PAGENUM,
    1362           0 :                                 (sal_uInt16)m_pPagenumEdit->GetValue() );
    1363             : 
    1364           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_PARA_PAGENUM );
    1365             : 
    1366           0 :         if ( !pOld || ( (const SfxUInt16Item*)pOld )->GetValue() != aPageNum.GetValue() )
    1367             :         {
    1368           0 :             rOutSet.Put( aPageNum );
    1369           0 :             bModified = sal_True;
    1370           0 :         }
    1371             :     }
    1372             : 
    1373             :     // pagebreak
    1374             : 
    1375           0 :     TriState eState = m_pApplyCollBtn->GetState();
    1376           0 :     bool bIsPageModel = false;
    1377             : 
    1378           0 :     _nWhich = GetWhich( SID_ATTR_PARA_MODEL );
    1379           0 :     OUString sPage;
    1380           0 :     if ( eState != m_pApplyCollBtn->GetSavedValue() ||
    1381           0 :          ( TRISTATE_TRUE == eState &&
    1382           0 :            m_pApplyCollBox->GetSelectEntryPos() != m_pApplyCollBox->GetSavedValue() ) )
    1383             :     {
    1384           0 :         if ( eState == TRISTATE_TRUE )
    1385             :         {
    1386           0 :             sPage = m_pApplyCollBox->GetSelectEntry();
    1387           0 :             bIsPageModel = !sPage.isEmpty();
    1388             :         }
    1389           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_PARA_MODEL );
    1390             : 
    1391           0 :         if ( !pOld || ( (const SvxPageModelItem*)pOld )->GetValue() != sPage )
    1392             :         {
    1393           0 :             rOutSet.Put( SvxPageModelItem( sPage, false, _nWhich ) );
    1394           0 :             bModified = sal_True;
    1395             :         }
    1396             :         else
    1397           0 :             bIsPageModel = false;
    1398             :     }
    1399           0 :     else if(TRISTATE_TRUE == eState && m_pApplyCollBtn->IsEnabled())
    1400           0 :         bIsPageModel = true;
    1401             :     else
    1402           0 :         rOutSet.Put( SvxPageModelItem( sPage, false, _nWhich ) );
    1403             : 
    1404           0 :     _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
    1405             : 
    1406           0 :     if ( bIsPageModel )
    1407             :         // if PageModel is turned on, always turn off PageBreak
    1408           0 :         rOutSet.Put( SvxFmtBreakItem( SVX_BREAK_NONE, _nWhich ) );
    1409             :     else
    1410             :     {
    1411           0 :         eState = m_pPageBreakBox->GetState();
    1412           0 :         SfxItemState eModelState = GetItemSet().GetItemState(SID_ATTR_PARA_MODEL, false);
    1413             : 
    1414           0 :         if ( (eModelState == SFX_ITEM_SET && TRISTATE_TRUE == m_pPageBreakBox->GetState()) ||
    1415           0 :              eState != m_pPageBreakBox->GetSavedValue()                ||
    1416           0 :              m_pBreakTypeLB->GetSelectEntryPos() != m_pBreakTypeLB->GetSavedValue()   ||
    1417           0 :              m_pBreakPositionLB->GetSelectEntryPos() != m_pBreakPositionLB->GetSavedValue() )
    1418             :         {
    1419             :             const SvxFmtBreakItem rOldBreak(
    1420           0 :                     (const SvxFmtBreakItem&)GetItemSet().Get( _nWhich ));
    1421           0 :             SvxFmtBreakItem aBreak(rOldBreak.GetBreak(), rOldBreak.Which());
    1422             : 
    1423           0 :             switch ( eState )
    1424             :             {
    1425             :                 case TRISTATE_TRUE:
    1426             :                 {
    1427           0 :                     sal_Bool bBefore = m_pBreakPositionLB->GetSelectEntryPos() == 0;
    1428             : 
    1429           0 :                     if ( m_pBreakTypeLB->GetSelectEntryPos() == 0 )
    1430             :                     {
    1431           0 :                         if ( bBefore )
    1432           0 :                             aBreak.SetValue( SVX_BREAK_PAGE_BEFORE );
    1433             :                         else
    1434           0 :                             aBreak.SetValue( SVX_BREAK_PAGE_AFTER );
    1435             :                     }
    1436             :                     else
    1437             :                     {
    1438           0 :                         if ( bBefore )
    1439           0 :                             aBreak.SetValue( SVX_BREAK_COLUMN_BEFORE );
    1440             :                         else
    1441           0 :                             aBreak.SetValue( SVX_BREAK_COLUMN_AFTER );
    1442             :                     }
    1443           0 :                     break;
    1444             :                 }
    1445             : 
    1446             :                 case TRISTATE_FALSE:
    1447           0 :                     aBreak.SetValue( SVX_BREAK_NONE );
    1448           0 :                     break;
    1449             :                 default: ; //prevent warning
    1450             :             }
    1451           0 :             pOld = GetOldItem( rOutSet, SID_ATTR_PARA_PAGEBREAK );
    1452             : 
    1453           0 :             if ( eState != m_pPageBreakBox->GetSavedValue()                ||
    1454           0 :                     !pOld || !( *(const SvxFmtBreakItem*)pOld == aBreak ) )
    1455             :             {
    1456           0 :                 bModified = sal_True;
    1457           0 :                 rOutSet.Put( aBreak );
    1458           0 :             }
    1459             :         }
    1460             :     }
    1461             : 
    1462             :     // paragraph split
    1463           0 :     _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
    1464           0 :     eState = m_pKeepTogetherBox->GetState();
    1465             : 
    1466           0 :     if ( eState != m_pKeepTogetherBox->GetSavedValue() )
    1467             :     {
    1468           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_PARA_SPLIT );
    1469             : 
    1470           0 :         if ( !pOld || ( (const SvxFmtSplitItem*)pOld )->GetValue() !=
    1471           0 :                       ( eState == TRISTATE_FALSE ) )
    1472             :         {
    1473           0 :             rOutSet.Put( SvxFmtSplitItem( eState == TRISTATE_FALSE, _nWhich ) );
    1474           0 :             bModified = sal_True;
    1475             :         }
    1476             :     }
    1477             : 
    1478             :     // keep paragraphs
    1479           0 :     _nWhich = GetWhich( SID_ATTR_PARA_KEEP );
    1480           0 :     eState = m_pKeepParaBox->GetState();
    1481             : 
    1482           0 :     if ( eState != m_pKeepParaBox->GetSavedValue() )
    1483             :     {
    1484             :         // if the status has changed, putting is necessary
    1485           0 :         rOutSet.Put( SvxFmtKeepItem( eState == TRISTATE_TRUE, _nWhich ) );
    1486           0 :         bModified = sal_True;
    1487             :     }
    1488             : 
    1489             :     // widows and orphans
    1490           0 :     _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
    1491           0 :     eState = m_pWidowBox->GetState();
    1492             : 
    1493           0 :     if ( eState != m_pWidowBox->GetSavedValue() ||
    1494           0 :          m_pWidowRowNo->IsValueModified() )
    1495             :     {
    1496             :         SvxWidowsItem rItem( eState == TRISTATE_TRUE ?
    1497           0 :                              (sal_uInt8)m_pWidowRowNo->GetValue() : 0, _nWhich );
    1498           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_PARA_WIDOWS );
    1499             : 
    1500           0 :         if ( eState != m_pWidowBox->GetSavedValue() || !pOld || !( *(const SvxWidowsItem*)pOld == rItem ) )
    1501             :         {
    1502           0 :             rOutSet.Put( rItem );
    1503           0 :             bModified = sal_True;
    1504           0 :         }
    1505             :     }
    1506             : 
    1507           0 :     _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
    1508           0 :     eState = m_pOrphanBox->GetState();
    1509             : 
    1510           0 :     if ( eState != m_pOrphanBox->GetSavedValue() ||
    1511           0 :          m_pOrphanRowNo->IsValueModified() )
    1512             :     {
    1513             :         SvxOrphansItem rItem( eState == TRISTATE_TRUE ?
    1514           0 :                              (sal_uInt8)m_pOrphanRowNo->GetValue() : 0, _nWhich );
    1515           0 :         pOld = GetOldItem( rOutSet, SID_ATTR_PARA_ORPHANS );
    1516             : 
    1517           0 :         if ( eState != m_pOrphanBox->GetSavedValue() ||
    1518           0 :                 !pOld ||
    1519           0 :                     !( *(const SvxOrphansItem*)pOld == rItem ) )
    1520             :         {
    1521           0 :             rOutSet.Put( rItem );
    1522           0 :             bModified = sal_True;
    1523           0 :         }
    1524             :     }
    1525             : 
    1526           0 :     return bModified;
    1527             : }
    1528             : 
    1529           0 : void SvxExtParagraphTabPage::Reset( const SfxItemSet& rSet )
    1530             : {
    1531           0 :     sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_HYPHENZONE );
    1532           0 :     SfxItemState eItemState = rSet.GetItemState( _nWhich );
    1533             : 
    1534           0 :     sal_Bool bItemAvailable = eItemState >= SFX_ITEM_AVAILABLE;
    1535           0 :     sal_Bool bIsHyphen = sal_False;
    1536           0 :     if( !bHtmlMode && bItemAvailable )
    1537             :     {
    1538             :         const SvxHyphenZoneItem& rHyphen =
    1539           0 :             (const SvxHyphenZoneItem&)rSet.Get( _nWhich );
    1540           0 :         m_pHyphenBox->EnableTriState( false );
    1541             : 
    1542           0 :         bIsHyphen = rHyphen.IsHyphen();
    1543           0 :         m_pHyphenBox->SetState( bIsHyphen ? TRISTATE_TRUE : TRISTATE_FALSE );
    1544             : 
    1545           0 :         m_pExtHyphenBeforeBox->SetValue( rHyphen.GetMinLead() );
    1546           0 :         m_pExtHyphenAfterBox->SetValue( rHyphen.GetMinTrail() );
    1547           0 :         m_pMaxHyphenEdit->SetValue( rHyphen.GetMaxHyphens() );
    1548             :     }
    1549             :     else
    1550             :     {
    1551           0 :         m_pHyphenBox->SetState( TRISTATE_INDET );
    1552             :     }
    1553           0 :     sal_Bool bEnable = bItemAvailable && bIsHyphen;
    1554           0 :     m_pExtHyphenBeforeBox->Enable(bEnable);
    1555           0 :     m_pExtHyphenAfterBox->Enable(bEnable);
    1556           0 :     m_pBeforeText->Enable(bEnable);
    1557           0 :     m_pAfterText->Enable(bEnable);
    1558           0 :     m_pMaxHyphenLabel->Enable(bEnable);
    1559           0 :     m_pMaxHyphenEdit->Enable(bEnable);
    1560             : 
    1561           0 :     _nWhich = GetWhich( SID_ATTR_PARA_PAGENUM );
    1562             : 
    1563           0 :     if ( rSet.GetItemState(_nWhich) >= SFX_ITEM_AVAILABLE )
    1564             :     {
    1565             :         const sal_uInt16 nPageNum =
    1566           0 :             ( (const SfxUInt16Item&)rSet.Get( _nWhich ) ).GetValue();
    1567           0 :         m_pPagenumEdit->SetValue( nPageNum );
    1568             :     }
    1569             : 
    1570           0 :     if ( bPageBreak )
    1571             :     {
    1572             :         // first handle PageModel
    1573           0 :         _nWhich = GetWhich( SID_ATTR_PARA_MODEL );
    1574           0 :         sal_Bool bIsPageModel = sal_False;
    1575           0 :         eItemState = rSet.GetItemState( _nWhich );
    1576             : 
    1577           0 :         if ( eItemState >= SFX_ITEM_SET )
    1578             :         {
    1579           0 :             m_pApplyCollBtn->EnableTriState( false );
    1580             : 
    1581             :             const SvxPageModelItem& rModel =
    1582           0 :                 (const SvxPageModelItem&)rSet.Get( _nWhich );
    1583           0 :             OUString aStr( rModel.GetValue() );
    1584             : 
    1585           0 :             if ( !aStr.isEmpty() &&
    1586           0 :                  m_pApplyCollBox->GetEntryPos( aStr ) != LISTBOX_ENTRY_NOTFOUND )
    1587             :             {
    1588           0 :                 m_pApplyCollBox->SelectEntry( aStr );
    1589           0 :                 m_pApplyCollBtn->SetState( TRISTATE_TRUE );
    1590           0 :                 bIsPageModel = sal_True;
    1591             : 
    1592           0 :                 m_pPageBreakBox->Enable();
    1593           0 :                 m_pPageBreakBox->EnableTriState( false );
    1594           0 :                 m_pBreakTypeFT->Enable();
    1595           0 :                 m_pBreakTypeLB->Enable();
    1596           0 :                 m_pBreakPositionFT->Enable();
    1597           0 :                 m_pBreakPositionLB->Enable();
    1598           0 :                 m_pApplyCollBtn->Enable();
    1599           0 :                 m_pPageBreakBox->SetState( TRISTATE_TRUE );
    1600             : 
    1601             :                 //select page break
    1602           0 :                 m_pBreakTypeLB->SelectEntryPos(0);
    1603             :                 //select break before
    1604           0 :                 m_pBreakPositionLB->SelectEntryPos(0);
    1605             :             }
    1606             :             else
    1607             :             {
    1608           0 :                 m_pApplyCollBox->SetNoSelection();
    1609           0 :                 m_pApplyCollBtn->SetState( TRISTATE_FALSE );
    1610           0 :             }
    1611             :         }
    1612           0 :         else if ( SFX_ITEM_DONTCARE == eItemState )
    1613             :         {
    1614           0 :             m_pApplyCollBtn->EnableTriState( true );
    1615           0 :             m_pApplyCollBtn->SetState( TRISTATE_INDET );
    1616           0 :             m_pApplyCollBox->SetNoSelection();
    1617             :         }
    1618             :         else
    1619             :         {
    1620           0 :             m_pApplyCollBtn->Enable(false);
    1621           0 :             m_pApplyCollBox->Enable(false);
    1622           0 :             m_pPagenumEdit->Enable(false);
    1623           0 :             m_pPagenumText->Enable(false);
    1624             :         }
    1625             : 
    1626           0 :         if ( !bIsPageModel )
    1627             :         {
    1628           0 :             _nWhich = GetWhich( SID_ATTR_PARA_PAGEBREAK );
    1629           0 :             eItemState = rSet.GetItemState( _nWhich );
    1630             : 
    1631           0 :             if ( eItemState >= SFX_ITEM_AVAILABLE )
    1632             :             {
    1633             :                 const SvxFmtBreakItem& rPageBreak =
    1634           0 :                     (const SvxFmtBreakItem&)rSet.Get( _nWhich );
    1635             : 
    1636           0 :                 SvxBreak eBreak = (SvxBreak)rPageBreak.GetValue();
    1637             : 
    1638             :                 // PageBreak not via CTRL-RETURN,
    1639             :                 // then CheckBox can be freed
    1640           0 :                 m_pPageBreakBox->Enable();
    1641           0 :                 m_pPageBreakBox->EnableTriState( false );
    1642           0 :                 m_pBreakTypeFT->Enable();
    1643           0 :                 m_pBreakTypeLB->Enable();
    1644           0 :                 m_pBreakPositionFT->Enable();
    1645           0 :                 m_pBreakPositionLB->Enable();
    1646             : 
    1647           0 :                 m_pPageBreakBox->SetState( TRISTATE_TRUE );
    1648             : 
    1649           0 :                 sal_Bool _bEnable =     eBreak != SVX_BREAK_NONE &&
    1650           0 :                                 eBreak != SVX_BREAK_COLUMN_BEFORE &&
    1651           0 :                                 eBreak != SVX_BREAK_COLUMN_AFTER;
    1652           0 :                 m_pApplyCollBtn->Enable(_bEnable);
    1653           0 :                 if(!_bEnable)
    1654             :                 {
    1655           0 :                     m_pApplyCollBox->Enable(_bEnable);
    1656           0 :                     m_pPagenumEdit->Enable(_bEnable);
    1657             :                 }
    1658             : 
    1659           0 :                 if ( eBreak == SVX_BREAK_NONE )
    1660           0 :                     m_pPageBreakBox->SetState( TRISTATE_FALSE );
    1661             : 
    1662           0 :                 sal_Int32 nType = 0; // selection position in break type ListBox : Page
    1663           0 :                 sal_Int32 nPosition = 0; //  selection position in break position ListBox : Before
    1664           0 :                 switch ( eBreak )
    1665             :                 {
    1666             :                     case SVX_BREAK_PAGE_BEFORE:
    1667           0 :                         break;
    1668             :                     case SVX_BREAK_PAGE_AFTER:
    1669           0 :                         nPosition = 1;
    1670           0 :                         break;
    1671             :                     case SVX_BREAK_COLUMN_BEFORE:
    1672           0 :                         nType = 1;
    1673           0 :                         break;
    1674             :                     case SVX_BREAK_COLUMN_AFTER:
    1675           0 :                         nType = 1;
    1676           0 :                         nPosition = 1;
    1677           0 :                         break;
    1678             :                     default: ;//prevent warning
    1679             :                 }
    1680           0 :                 m_pBreakTypeLB->SelectEntryPos(nType);
    1681           0 :                 m_pBreakPositionLB->SelectEntryPos(nPosition);
    1682             :             }
    1683           0 :             else if ( SFX_ITEM_DONTCARE == eItemState )
    1684           0 :                 m_pPageBreakBox->SetState( TRISTATE_INDET );
    1685             :             else
    1686             :             {
    1687           0 :                 m_pPageBreakBox->Enable(false);
    1688           0 :                 m_pBreakTypeFT->Enable(false);
    1689           0 :                 m_pBreakTypeLB->Enable(false);
    1690           0 :                 m_pBreakPositionFT->Enable(false);
    1691           0 :                 m_pBreakPositionLB->Enable(false);
    1692             :             }
    1693             :         }
    1694             : 
    1695           0 :         PageBreakPosHdl_Impl( m_pBreakPositionLB );
    1696           0 :         PageBreakHdl_Impl( m_pPageBreakBox );
    1697             :     }
    1698             : 
    1699           0 :     _nWhich = GetWhich( SID_ATTR_PARA_KEEP );
    1700           0 :     eItemState = rSet.GetItemState( _nWhich );
    1701             : 
    1702           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
    1703             :     {
    1704           0 :         m_pKeepParaBox->EnableTriState( false );
    1705             :         const SvxFmtKeepItem& rKeep =
    1706           0 :             (const SvxFmtKeepItem&)rSet.Get( _nWhich );
    1707             : 
    1708           0 :         if ( rKeep.GetValue() )
    1709           0 :             m_pKeepParaBox->SetState( TRISTATE_TRUE );
    1710             :         else
    1711           0 :             m_pKeepParaBox->SetState( TRISTATE_FALSE );
    1712             :     }
    1713           0 :     else if ( SFX_ITEM_DONTCARE == eItemState )
    1714           0 :         m_pKeepParaBox->SetState( TRISTATE_INDET );
    1715             :     else
    1716           0 :         m_pKeepParaBox->Enable(false);
    1717             : 
    1718           0 :     _nWhich = GetWhich( SID_ATTR_PARA_SPLIT );
    1719           0 :     eItemState = rSet.GetItemState( _nWhich );
    1720             : 
    1721           0 :     if ( eItemState >= SFX_ITEM_AVAILABLE )
    1722             :     {
    1723             :         const SvxFmtSplitItem& rSplit =
    1724           0 :             (const SvxFmtSplitItem&)rSet.Get( _nWhich );
    1725           0 :         m_pKeepTogetherBox->EnableTriState( false );
    1726             : 
    1727           0 :         if ( !rSplit.GetValue() )
    1728           0 :             m_pKeepTogetherBox->SetState( TRISTATE_TRUE );
    1729             :         else
    1730             :         {
    1731           0 :             m_pKeepTogetherBox->SetState( TRISTATE_FALSE );
    1732             : 
    1733             :             // widows and orphans
    1734           0 :             m_pWidowBox->Enable();
    1735           0 :             _nWhich = GetWhich( SID_ATTR_PARA_WIDOWS );
    1736           0 :             SfxItemState eTmpState = rSet.GetItemState( _nWhich );
    1737             : 
    1738           0 :             if ( eTmpState >= SFX_ITEM_AVAILABLE )
    1739             :             {
    1740             :                 const SvxWidowsItem& rWidow =
    1741           0 :                     (const SvxWidowsItem&)rSet.Get( _nWhich );
    1742           0 :                 m_pWidowBox->EnableTriState( false );
    1743           0 :                 const sal_uInt16 nLines = rWidow.GetValue();
    1744             : 
    1745           0 :                 sal_Bool _bEnable = nLines > 0;
    1746           0 :                 m_pWidowRowNo->SetValue( m_pWidowRowNo->Normalize( nLines ) );
    1747           0 :                 m_pWidowBox->SetState( _bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
    1748           0 :                 m_pWidowRowNo->Enable(_bEnable);
    1749             :                 //m_pWidowRowLabel->Enable(_bEnable);
    1750             : 
    1751             :             }
    1752           0 :             else if ( SFX_ITEM_DONTCARE == eTmpState )
    1753           0 :                 m_pWidowBox->SetState( TRISTATE_INDET );
    1754             :             else
    1755           0 :                 m_pWidowBox->Enable(false);
    1756             : 
    1757           0 :             m_pOrphanBox->Enable();
    1758           0 :             _nWhich = GetWhich( SID_ATTR_PARA_ORPHANS );
    1759           0 :             eTmpState = rSet.GetItemState( _nWhich );
    1760             : 
    1761           0 :             if ( eTmpState >= SFX_ITEM_AVAILABLE )
    1762             :             {
    1763             :                 const SvxOrphansItem& rOrphan =
    1764           0 :                     (const SvxOrphansItem&)rSet.Get( _nWhich );
    1765           0 :                 const sal_uInt16 nLines = rOrphan.GetValue();
    1766           0 :                 m_pOrphanBox->EnableTriState( false );
    1767             : 
    1768           0 :                 sal_Bool _bEnable = nLines > 0;
    1769           0 :                 m_pOrphanBox->SetState( _bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
    1770           0 :                 m_pOrphanRowNo->SetValue( m_pOrphanRowNo->Normalize( nLines ) );
    1771           0 :                 m_pOrphanRowNo->Enable(_bEnable);
    1772           0 :                 m_pOrphanRowLabel->Enable(_bEnable);
    1773             : 
    1774             :             }
    1775           0 :             else if ( SFX_ITEM_DONTCARE == eTmpState )
    1776           0 :                 m_pOrphanBox->SetState( TRISTATE_INDET );
    1777             :             else
    1778           0 :                 m_pOrphanBox->Enable(false);
    1779             :         }
    1780             :     }
    1781           0 :     else if ( SFX_ITEM_DONTCARE == eItemState )
    1782           0 :         m_pKeepTogetherBox->SetState( TRISTATE_INDET );
    1783             :     else
    1784           0 :         m_pKeepTogetherBox->Enable(false);
    1785             : 
    1786             :     // so that everything is enabled correctly
    1787           0 :     KeepTogetherHdl_Impl( 0 );
    1788           0 :     WidowHdl_Impl( 0 );
    1789           0 :     OrphanHdl_Impl( 0 );
    1790             : 
    1791           0 :     m_pHyphenBox->SaveValue();
    1792           0 :     m_pExtHyphenBeforeBox->SaveValue();
    1793           0 :     m_pExtHyphenAfterBox->SaveValue();
    1794           0 :     m_pMaxHyphenEdit->SaveValue();
    1795           0 :     m_pPageBreakBox->SaveValue();
    1796           0 :     m_pBreakPositionLB->SaveValue();
    1797           0 :     m_pBreakTypeLB->SaveValue();
    1798           0 :     m_pApplyCollBtn->SaveValue();
    1799           0 :     m_pApplyCollBox->SaveValue();
    1800           0 :     m_pPagenumEdit->SaveValue();
    1801           0 :     m_pKeepTogetherBox->SaveValue();
    1802           0 :     m_pKeepParaBox->SaveValue();
    1803           0 :     m_pWidowBox->SaveValue();
    1804           0 :     m_pOrphanBox->SaveValue();
    1805           0 : }
    1806             : 
    1807           0 : int SvxExtParagraphTabPage::DeactivatePage( SfxItemSet* _pSet )
    1808             : {
    1809           0 :     if ( _pSet )
    1810           0 :         FillItemSet( *_pSet );
    1811           0 :     return LEAVE_PAGE;
    1812             : }
    1813             : 
    1814           0 : void SvxExtParagraphTabPage::DisablePageBreak()
    1815             : {
    1816           0 :     bPageBreak = sal_False;
    1817           0 :     m_pPageBreakBox->Enable(false);
    1818           0 :     m_pBreakTypeLB->RemoveEntry(0);
    1819           0 :     m_pBreakPositionFT->Enable(false);
    1820           0 :     m_pBreakPositionLB->Enable(false);
    1821           0 :     m_pApplyCollBtn->Enable(false);
    1822           0 :     m_pApplyCollBox->Enable(false);
    1823           0 :     m_pPagenumEdit->Enable(false);
    1824           0 : }
    1825             : 
    1826           0 : SvxExtParagraphTabPage::SvxExtParagraphTabPage( Window* pParent, const SfxItemSet& rAttr ) :
    1827             :     SfxTabPage( pParent, "TextFlowPage","cui/ui/textflowpage.ui", rAttr ),
    1828             : 
    1829             :     bPageBreak  ( sal_True ),
    1830             :     bHtmlMode   ( sal_False ),
    1831           0 :     nStdPos     ( 0 )
    1832             : {
    1833             :     // Hyphenation
    1834           0 :     get(m_pHyphenBox,"checkAuto");
    1835           0 :     get(m_pExtHyphenBeforeBox,"spinLineEnd");
    1836           0 :     get(m_pExtHyphenAfterBox,"spinLineBegin");
    1837           0 :     get(m_pMaxHyphenEdit,"spinMaxNum");
    1838           0 :     get(m_pBeforeText,"labelLineBegin");
    1839           0 :     get(m_pAfterText,"labelLineEnd");
    1840           0 :     get(m_pMaxHyphenLabel,"labelMaxNum");
    1841             : 
    1842             :     //Page break
    1843           0 :     get(m_pPageBreakBox,"checkInsert");
    1844           0 :     get(m_pBreakTypeLB,"comboBreakType");
    1845           0 :     get(m_pBreakPositionLB,"comboBreakPosition");
    1846           0 :     get(m_pApplyCollBtn,"checkPageStyle");
    1847           0 :     get(m_pApplyCollBox,"comboPageStyle");
    1848           0 :     get(m_pPagenumEdit,"spinPageNumber");
    1849           0 :     get(m_pBreakTypeFT,"labelType");
    1850           0 :     get(m_pBreakPositionFT,"labelPosition");
    1851           0 :     get(m_pPagenumText,"labelPageNum");
    1852             : 
    1853             :     // Options
    1854           0 :     get(m_pKeepTogetherBox,"checkSplitPara");
    1855           0 :     get(m_pKeepParaBox,"checkKeepPara");
    1856             : 
    1857           0 :     get(m_pOrphanBox,"checkOrphan");
    1858           0 :     get(m_pOrphanRowNo,"spinOrphan");
    1859           0 :     get(m_pOrphanRowLabel,"labelOrphan");
    1860             : 
    1861           0 :     get(m_pWidowBox,"checkWidow");
    1862           0 :     get(m_pWidowRowNo,"spinWidow");
    1863           0 :     get(m_pWidowRowLabel,"labelWidow");
    1864             : 
    1865           0 :     m_pApplyCollBox->SetAccessibleRelationLabeledBy(m_pApplyCollBtn);
    1866           0 :     m_pApplyCollBox->SetAccessibleName(CUI_RES(STR_PAGE_STYLE));
    1867             : 
    1868           0 :     m_pOrphanRowNo->SetAccessibleRelationLabeledBy(m_pOrphanBox);
    1869           0 :     m_pWidowRowNo->SetAccessibleRelationLabeledBy(m_pWidowBox);
    1870             : 
    1871             :     // this page needs ExchangeSupport
    1872           0 :     SetExchangeSupport();
    1873             : 
    1874           0 :     m_pHyphenBox->SetClickHdl(         LINK( this, SvxExtParagraphTabPage, HyphenClickHdl_Impl ) );
    1875           0 :     m_pPageBreakBox->SetClickHdl(      LINK( this, SvxExtParagraphTabPage, PageBreakHdl_Impl ) );
    1876           0 :     m_pKeepTogetherBox->SetClickHdl(   LINK( this, SvxExtParagraphTabPage, KeepTogetherHdl_Impl ) );
    1877           0 :     m_pWidowBox->SetClickHdl(          LINK( this, SvxExtParagraphTabPage, WidowHdl_Impl ) );
    1878           0 :     m_pOrphanBox->SetClickHdl(         LINK( this, SvxExtParagraphTabPage, OrphanHdl_Impl ) );
    1879           0 :     m_pApplyCollBtn->SetClickHdl(      LINK( this, SvxExtParagraphTabPage, ApplyCollClickHdl_Impl ) );
    1880           0 :     m_pBreakTypeLB->SetSelectHdl(      LINK( this, SvxExtParagraphTabPage, PageBreakTypeHdl_Impl ) );
    1881           0 :     m_pBreakPositionLB->SetSelectHdl(  LINK( this, SvxExtParagraphTabPage, PageBreakPosHdl_Impl ) );
    1882             : 
    1883           0 :     SfxObjectShell* pSh = SfxObjectShell::Current();
    1884           0 :     if ( pSh )
    1885             :     {
    1886           0 :         SfxStyleSheetBasePool* pPool = pSh->GetStyleSheetPool();
    1887           0 :         pPool->SetSearchMask( SFX_STYLE_FAMILY_PAGE );
    1888           0 :         SfxStyleSheetBase* pStyle = pPool->First();
    1889           0 :         OUString aStdName;
    1890             : 
    1891           0 :         while( pStyle )
    1892             :         {
    1893           0 :             if ( aStdName.isEmpty() )
    1894             :                 // first style == standard style
    1895           0 :                 aStdName = pStyle->GetName();
    1896           0 :             m_pApplyCollBox->InsertEntry( pStyle->GetName() );
    1897           0 :             pStyle = pPool->Next();
    1898             :         }
    1899           0 :         nStdPos = m_pApplyCollBox->GetEntryPos( aStdName );
    1900             :     }
    1901             : 
    1902           0 :     sal_uInt16 nHtmlMode = GetHtmlMode_Impl( rAttr );
    1903           0 :     if ( nHtmlMode & HTMLMODE_ON )
    1904             :     {
    1905           0 :         bHtmlMode = sal_True;
    1906           0 :         m_pHyphenBox           ->Enable(false);
    1907           0 :         m_pBeforeText          ->Enable(false);
    1908           0 :         m_pExtHyphenBeforeBox  ->Enable(false);
    1909           0 :         m_pAfterText           ->Enable(false);
    1910           0 :         m_pExtHyphenAfterBox   ->Enable(false);
    1911           0 :         m_pMaxHyphenLabel      ->Enable(false);
    1912           0 :         m_pMaxHyphenEdit       ->Enable(false);
    1913           0 :         m_pPagenumText         ->Enable(false);
    1914           0 :         m_pPagenumEdit         ->Enable(false);
    1915             :         // no column break in HTML
    1916           0 :         m_pBreakTypeLB->RemoveEntry(1);
    1917             :     }
    1918           0 : }
    1919             : 
    1920           0 : SvxExtParagraphTabPage::~SvxExtParagraphTabPage()
    1921             : {
    1922           0 : }
    1923             : 
    1924           0 : sal_uInt16* SvxExtParagraphTabPage::GetRanges()
    1925             : {
    1926           0 :     return pExtRanges;
    1927             : }
    1928             : 
    1929           0 : IMPL_LINK_NOARG(SvxExtParagraphTabPage, PageBreakHdl_Impl)
    1930             : {
    1931           0 :     switch ( m_pPageBreakBox->GetState() )
    1932             :     {
    1933             :         case TRISTATE_TRUE:
    1934           0 :             m_pBreakTypeFT->Enable();
    1935           0 :             m_pBreakTypeLB->Enable();
    1936           0 :             m_pBreakPositionFT->Enable();
    1937           0 :             m_pBreakPositionLB->Enable();
    1938             : 
    1939           0 :             if ( 0 == m_pBreakTypeLB->GetSelectEntryPos()&&
    1940           0 :                 0 == m_pBreakPositionLB->GetSelectEntryPos() )
    1941             :             {
    1942           0 :                 m_pApplyCollBtn->Enable();
    1943             : 
    1944           0 :                 sal_Bool bEnable = TRISTATE_TRUE == m_pApplyCollBtn->GetState() &&
    1945           0 :                                             m_pApplyCollBox->GetEntryCount();
    1946           0 :                 m_pApplyCollBox->Enable(bEnable);
    1947           0 :                 if(!bHtmlMode)
    1948             :                 {
    1949           0 :                     m_pPagenumText->Enable(bEnable);
    1950           0 :                     m_pPagenumEdit->Enable(bEnable);
    1951             :                 }
    1952             :             }
    1953           0 :             break;
    1954             : 
    1955             :         case TRISTATE_FALSE:
    1956             :         case TRISTATE_INDET:
    1957           0 :             m_pApplyCollBtn->SetState( TRISTATE_FALSE );
    1958           0 :             m_pApplyCollBtn->Enable(false);
    1959           0 :             m_pApplyCollBox->Enable(false);
    1960           0 :             m_pPagenumText->Enable(false);
    1961           0 :             m_pPagenumEdit->Enable(false);
    1962           0 :             m_pBreakTypeFT->Enable(false);
    1963           0 :             m_pBreakTypeLB->Enable(false);
    1964           0 :             m_pBreakPositionFT->Enable(false);
    1965           0 :             m_pBreakPositionLB->Enable(false);
    1966           0 :             break;
    1967             :     }
    1968           0 :     return 0;
    1969             : }
    1970             : 
    1971           0 : IMPL_LINK_NOARG(SvxExtParagraphTabPage, KeepTogetherHdl_Impl)
    1972             : {
    1973           0 :     sal_Bool bEnable = m_pKeepTogetherBox->GetState() == TRISTATE_FALSE;
    1974           0 :     m_pWidowBox->Enable(bEnable);
    1975           0 :     m_pOrphanBox->Enable(bEnable);
    1976             : 
    1977           0 :     return 0;
    1978             : }
    1979             : 
    1980           0 : IMPL_LINK_NOARG(SvxExtParagraphTabPage, WidowHdl_Impl)
    1981             : {
    1982           0 :     switch ( m_pWidowBox->GetState() )
    1983             :     {
    1984             :         case TRISTATE_TRUE:
    1985           0 :             m_pWidowRowNo->Enable();
    1986           0 :             m_pWidowRowLabel->Enable();
    1987           0 :             m_pKeepTogetherBox->Enable(false);
    1988           0 :             break;
    1989             : 
    1990             :         case TRISTATE_FALSE:
    1991           0 :             if ( m_pOrphanBox->GetState() == TRISTATE_FALSE )
    1992           0 :                 m_pKeepTogetherBox->Enable();
    1993             : 
    1994             :         // no break
    1995             :         case TRISTATE_INDET:
    1996           0 :             m_pWidowRowNo->Enable(false);
    1997           0 :             m_pWidowRowLabel->Enable(false);
    1998           0 :             break;
    1999             :     }
    2000           0 :     return 0;
    2001             : }
    2002             : 
    2003           0 : IMPL_LINK_NOARG(SvxExtParagraphTabPage, OrphanHdl_Impl)
    2004             : {
    2005           0 :     switch( m_pOrphanBox->GetState() )
    2006             :     {
    2007             :         case TRISTATE_TRUE:
    2008           0 :             m_pOrphanRowNo->Enable();
    2009           0 :             m_pOrphanRowLabel->Enable();
    2010           0 :             m_pKeepTogetherBox->Enable(false);
    2011           0 :             break;
    2012             : 
    2013             :         case TRISTATE_FALSE:
    2014           0 :             if ( m_pWidowBox->GetState() == TRISTATE_FALSE )
    2015           0 :                 m_pKeepTogetherBox->Enable();
    2016             : 
    2017             :         // no break
    2018             :         case TRISTATE_INDET:
    2019           0 :             m_pOrphanRowNo->Enable(false);
    2020           0 :             m_pOrphanRowLabel->Enable(false);
    2021           0 :             break;
    2022             :     }
    2023           0 :     return 0;
    2024             : }
    2025             : 
    2026           0 : IMPL_LINK_NOARG(SvxExtParagraphTabPage, HyphenClickHdl_Impl)
    2027             : {
    2028             : 
    2029           0 :     sal_Bool bEnable = m_pHyphenBox->GetState() == TRISTATE_TRUE;
    2030           0 :     m_pBeforeText->Enable(bEnable);
    2031           0 :     m_pExtHyphenBeforeBox->Enable(bEnable);
    2032           0 :     m_pAfterText->Enable(bEnable);
    2033           0 :     m_pExtHyphenAfterBox->Enable(bEnable);
    2034           0 :     m_pMaxHyphenLabel->Enable(bEnable);
    2035           0 :     m_pMaxHyphenEdit->Enable(bEnable);
    2036           0 :     m_pHyphenBox->SetState( bEnable ? TRISTATE_TRUE : TRISTATE_FALSE);
    2037             : 
    2038           0 :     return 0;
    2039             : }
    2040             : 
    2041           0 : IMPL_LINK_NOARG(SvxExtParagraphTabPage, ApplyCollClickHdl_Impl)
    2042             : {
    2043           0 :     sal_Bool bEnable = sal_False;
    2044           0 :     if ( m_pApplyCollBtn->GetState() == TRISTATE_TRUE &&
    2045           0 :          m_pApplyCollBox->GetEntryCount() )
    2046             :     {
    2047           0 :         bEnable = sal_True;
    2048           0 :         m_pApplyCollBox->SelectEntryPos( nStdPos );
    2049             :     }
    2050             :     else
    2051             :     {
    2052           0 :         m_pApplyCollBox->SetNoSelection();
    2053             :     }
    2054           0 :     m_pApplyCollBox->Enable(bEnable);
    2055           0 :     if(!bHtmlMode)
    2056             :     {
    2057           0 :         m_pPagenumText->Enable(bEnable);
    2058           0 :         m_pPagenumEdit->Enable(bEnable);
    2059             :     }
    2060           0 :     return 0;
    2061             : }
    2062             : 
    2063           0 : IMPL_LINK( SvxExtParagraphTabPage, PageBreakPosHdl_Impl, ListBox *, pListBox )
    2064             : {
    2065           0 :     if ( 0 == pListBox->GetSelectEntryPos() )
    2066             :     {
    2067           0 :         m_pApplyCollBtn->Enable();
    2068             : 
    2069           0 :         sal_Bool bEnable = m_pApplyCollBtn->GetState() == TRISTATE_TRUE &&
    2070           0 :                                     m_pApplyCollBox->GetEntryCount();
    2071             : 
    2072           0 :         m_pApplyCollBox->Enable(bEnable);
    2073           0 :         if(!bHtmlMode)
    2074             :         {
    2075           0 :             m_pPagenumText->Enable(bEnable);
    2076           0 :             m_pPagenumEdit->Enable(bEnable);
    2077             :         }
    2078             :     }
    2079           0 :     else if ( 1 == pListBox->GetSelectEntryPos() )
    2080             :     {
    2081           0 :         m_pApplyCollBtn->SetState( TRISTATE_FALSE );
    2082           0 :         m_pApplyCollBtn->Enable(false);
    2083           0 :         m_pApplyCollBox->Enable(false);
    2084           0 :         m_pPagenumText->Enable(false);
    2085           0 :         m_pPagenumEdit->Enable(false);
    2086             :     }
    2087           0 :     return 0;
    2088             : }
    2089             : 
    2090           0 : IMPL_LINK( SvxExtParagraphTabPage, PageBreakTypeHdl_Impl, ListBox *, pListBox )
    2091             : {
    2092             :     //column break or break break after
    2093           0 :     sal_Int32 nBreakPos = m_pBreakPositionLB->GetSelectEntryPos();
    2094           0 :     if ( pListBox->GetSelectEntryPos() == 1 || 1 == nBreakPos)
    2095             :     {
    2096           0 :         m_pApplyCollBtn->SetState( TRISTATE_FALSE );
    2097           0 :         m_pApplyCollBtn->Enable(false);
    2098           0 :         m_pApplyCollBox->Enable(false);
    2099           0 :         m_pPagenumText->Enable(false);
    2100           0 :         m_pPagenumEdit->Enable(false);
    2101             :     }
    2102             :     else
    2103           0 :         PageBreakPosHdl_Impl( m_pBreakPositionLB );
    2104           0 :     return 0;
    2105             : }
    2106             : 
    2107           0 : void SvxExtParagraphTabPage::PageCreated(SfxAllItemSet aSet)
    2108             : {
    2109           0 :     SFX_ITEMSET_ARG (&aSet,pDisablePageBreakItem,SfxBoolItem,SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,false);
    2110             : 
    2111           0 :     if (pDisablePageBreakItem)
    2112           0 :         if ( pDisablePageBreakItem->GetValue())
    2113           0 :                     DisablePageBreak();
    2114           0 : }
    2115             : 
    2116           0 : SvxAsianTabPage::SvxAsianTabPage( Window* pParent, const SfxItemSet& rSet ) :
    2117           0 :     SfxTabPage(pParent, "AsianTypography","cui/ui/asiantypography.ui", rSet)
    2118             : 
    2119             : {
    2120           0 :     get(m_pForbiddenRulesCB,"checkForbidList");
    2121           0 :     get(m_pHangingPunctCB,"checkHangPunct");
    2122           0 :     get(m_pScriptSpaceCB,"checkApplySpacing");
    2123             : 
    2124           0 :     Link aLink = LINK( this, SvxAsianTabPage, ClickHdl_Impl );
    2125           0 :     m_pHangingPunctCB->SetClickHdl( aLink );
    2126           0 :     m_pScriptSpaceCB->SetClickHdl( aLink );
    2127           0 :     m_pForbiddenRulesCB->SetClickHdl( aLink );
    2128             : 
    2129           0 : }
    2130             : 
    2131           0 : SvxAsianTabPage::~SvxAsianTabPage()
    2132             : {
    2133           0 : }
    2134             : 
    2135           0 : SfxTabPage* SvxAsianTabPage::Create(    Window* pParent, const SfxItemSet& rSet )
    2136             : {
    2137           0 :     return new SvxAsianTabPage(pParent, rSet);
    2138             : }
    2139             : 
    2140           0 : sal_uInt16*     SvxAsianTabPage::GetRanges()
    2141             : {
    2142             :     static sal_uInt16 pRanges[] =
    2143             :     {
    2144             :         SID_ATTR_PARA_SCRIPTSPACE, SID_ATTR_PARA_FORBIDDEN_RULES,
    2145             :         0
    2146             :     };
    2147           0 :     return pRanges;
    2148             : }
    2149             : 
    2150           0 : bool SvxAsianTabPage::FillItemSet( SfxItemSet& rSet )
    2151             : {
    2152           0 :     sal_Bool bRet = sal_False;
    2153           0 :     SfxItemPool* pPool = rSet.GetPool();
    2154           0 :     if (m_pScriptSpaceCB->IsEnabled() && TriState(m_pScriptSpaceCB->IsChecked()) != m_pScriptSpaceCB->GetSavedValue())
    2155             :     {
    2156             :         SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get(
    2157           0 :             pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone();
    2158           0 :         pNewItem->SetValue(m_pScriptSpaceCB->IsChecked());
    2159           0 :         rSet.Put(*pNewItem);
    2160           0 :         delete pNewItem;
    2161           0 :         bRet = sal_True;
    2162             :     }
    2163           0 :     if (m_pHangingPunctCB->IsEnabled() && TriState(m_pHangingPunctCB->IsChecked()) != m_pHangingPunctCB->GetSavedValue())
    2164             :     {
    2165             :         SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get(
    2166           0 :             pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone();
    2167           0 :         pNewItem->SetValue(m_pHangingPunctCB->IsChecked());
    2168           0 :         rSet.Put(*pNewItem);
    2169           0 :         delete pNewItem;
    2170           0 :         bRet = sal_True;
    2171             :     }
    2172           0 :     if (m_pForbiddenRulesCB->IsEnabled() && TriState(m_pForbiddenRulesCB->IsChecked()) != m_pForbiddenRulesCB->GetSavedValue())
    2173             :     {
    2174             :         SfxBoolItem* pNewItem = (SfxBoolItem*)rSet.Get(
    2175           0 :             pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone();
    2176           0 :         pNewItem->SetValue(m_pForbiddenRulesCB->IsChecked());
    2177           0 :         rSet.Put(*pNewItem);
    2178           0 :         delete pNewItem;
    2179           0 :         bRet = sal_True;
    2180             :     }
    2181           0 :     return bRet;
    2182             : }
    2183             : 
    2184           0 : static void lcl_SetBox(const SfxItemSet& rSet, sal_uInt16 nSlotId, CheckBox& rBox)
    2185             : {
    2186           0 :     sal_uInt16 _nWhich = rSet.GetPool()->GetWhich(nSlotId);
    2187           0 :     SfxItemState eState = rSet.GetItemState(_nWhich, true);
    2188           0 :     if(!eState || eState == SFX_ITEM_DISABLED )
    2189           0 :         rBox.Enable(false);
    2190           0 :     else if(eState >= SFX_ITEM_AVAILABLE)
    2191             :     {
    2192           0 :         rBox.EnableTriState( false );
    2193           0 :         rBox.Check(((const SfxBoolItem&)rSet.Get(_nWhich)).GetValue());
    2194             :     }
    2195             :     else
    2196           0 :         rBox.SetState( TRISTATE_INDET );
    2197           0 :     rBox.SaveValue();
    2198           0 : }
    2199             : 
    2200           0 : void SvxAsianTabPage::Reset( const SfxItemSet& rSet )
    2201             : {
    2202           0 :     lcl_SetBox(rSet, SID_ATTR_PARA_FORBIDDEN_RULES, *m_pForbiddenRulesCB );
    2203           0 :     lcl_SetBox(rSet, SID_ATTR_PARA_HANGPUNCTUATION, *m_pHangingPunctCB );
    2204             : 
    2205             :     //character distance not yet available
    2206           0 :     lcl_SetBox(rSet, SID_ATTR_PARA_SCRIPTSPACE, *m_pScriptSpaceCB );
    2207           0 : }
    2208             : 
    2209           0 : IMPL_LINK( SvxAsianTabPage, ClickHdl_Impl, CheckBox*, pBox )
    2210             : {
    2211           0 :     pBox->EnableTriState( false );
    2212           0 :     return 0;
    2213           0 : }
    2214             : 
    2215             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10