LCOV - code coverage report
Current view: top level - sfx2/source/dialog - mgetempl.cxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 1 244 0.4 %
Date: 2014-04-11 Functions: 2 16 12.5 %
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 <comphelper/string.hxx>
      21             : #include <vcl/msgbox.hxx>
      22             : #include <vcl/field.hxx>
      23             : #include <svl/eitem.hxx>
      24             : #include <svl/intitem.hxx>
      25             : #include <svl/style.hxx>
      26             : 
      27             : #include <sfx2/styfitem.hxx>
      28             : #include <sfx2/styledlg.hxx>
      29             : #include <sfx2/app.hxx>
      30             : #include <sfx2/mgetempl.hxx>
      31             : #include <sfx2/objsh.hxx>
      32             : #include "sfxtypes.hxx"
      33             : #include <sfx2/sfxresid.hxx>
      34             : #include <sfx2/module.hxx>
      35             : 
      36             : #include <sfx2/sfx.hrc>
      37             : #include "dialog.hrc"
      38             : 
      39             : #include <svl/style.hrc>
      40             : 
      41             : /*  SfxManageStyleSheetPage Constructor
      42             :  *
      43             :  *  initializes the list box with the templates
      44             :  */
      45           0 : SfxManageStyleSheetPage::SfxManageStyleSheetPage(Window* pParent, const SfxItemSet& rAttrSet)
      46             :     : SfxTabPage(pParent, "ManageStylePage", "sfx/ui/managestylepage.ui", rAttrSet)
      47           0 :     , pStyle(&((SfxStyleDialog*)GetParentDialog())->GetStyleSheet())
      48             :     , pItem(0)
      49             :     , bModified(false)
      50           0 :     , aName(pStyle->GetName())
      51           0 :     , aFollow(pStyle->GetFollow())
      52           0 :     , aParent(pStyle->GetParent())
      53           0 :     , nFlags(pStyle->GetMask())
      54             : {
      55           0 :     get(m_pNameRo, "namero");
      56           0 :     get(m_pNameRw, "namerw");
      57           0 :     m_pNameRo->set_width_request(m_pNameRw->get_preferred_size().Width());
      58           0 :     get(m_pAutoCB, "autoupdate");
      59           0 :     get(m_pFollowFt, "nextstyleft");
      60           0 :     get(m_pFollowLb, "nextstyle");
      61           0 :     m_pFollowLb->SetStyle(m_pFollowLb->GetStyle() | WB_SORT);
      62           0 :     const sal_Int32 nMaxWidth(62);
      63           0 :     m_pFollowLb->setMaxWidthChars(nMaxWidth);
      64           0 :     get(m_pBaseFt, "linkedwithft");
      65           0 :     get(m_pBaseLb, "linkedwith");
      66           0 :     m_pBaseLb->SetStyle(m_pBaseLb->GetStyle() | WB_SORT);
      67           0 :     m_pBaseLb->setMaxWidthChars(nMaxWidth);
      68           0 :     get(m_pFilterFt, "categoryft");
      69           0 :     get(m_pFilterLb, "category");
      70           0 :     m_pFilterLb->SetStyle(m_pFilterLb->GetStyle() | WB_SORT);
      71           0 :     m_pFilterLb->setMaxWidthChars(nMaxWidth);
      72           0 :     get(m_pDescFt, "desc");
      73             : 
      74             :     // this Page needs ExchangeSupport
      75           0 :     SetExchangeSupport();
      76             : 
      77           0 :     ResMgr* pResMgr = SFX_APP()->GetModule_Impl()->GetResMgr();
      78             :     OSL_ENSURE( pResMgr, "No ResMgr in Module" );
      79           0 :     pFamilies = new SfxStyleFamilies( ResId( DLG_STYLE_DESIGNER, *pResMgr ) );
      80             : 
      81           0 :     SfxStyleSheetBasePool* pPool = 0;
      82           0 :     SfxObjectShell* pDocShell = SfxObjectShell::Current();
      83             : 
      84           0 :     if ( pDocShell )
      85           0 :         pPool = pDocShell->GetStyleSheetPool();
      86             :     OSL_ENSURE( pPool, "no Pool or no DocShell" );
      87             : 
      88           0 :     if ( pPool )
      89             :     {
      90           0 :         pPool->SetSearchMask( pStyle->GetFamily() );
      91           0 :         pPool->First();     // for SW - update internal list
      92             :     }
      93             : 
      94           0 :     if ( pStyle->GetName().isEmpty() && pPool )
      95             :     {
      96             :         // NullString as Name -> generate Name
      97           0 :         OUString aNoName( SfxResId(STR_NONAME).toString() );
      98           0 :         sal_uInt16 nNo = 1;
      99           0 :         OUString aNo( aNoName );
     100           0 :         aNoName += OUString::number( nNo );
     101           0 :         while ( pPool->Find( aNoName ) )
     102             :         {
     103           0 :             ++nNo;
     104           0 :             aNoName = aNo;
     105           0 :             aNoName += OUString::number( nNo );
     106             :         }
     107           0 :         pStyle->SetName( aNoName );
     108           0 :         aName = aNoName;
     109           0 :         aFollow = pStyle->GetFollow();
     110           0 :         aParent = pStyle->GetParent();
     111             :     }
     112           0 :     m_pNameRw->SetText(pStyle->GetName());
     113             : 
     114             :     // Set the field read-only if it is NOT an user-defined style
     115             :     // but allow selecting and copying
     116           0 :     if (!pStyle->IsUserDefined())
     117             :     {
     118           0 :         m_pNameRo->SetText(m_pNameRw->GetText());
     119           0 :         m_pNameRw->Hide();
     120           0 :         m_pNameRo->Show();
     121           0 :         FixedText *pLabel = get<FixedText>("nameft");
     122           0 :         pLabel->set_mnemonic_widget(m_pNameRo);
     123             :     }
     124             : 
     125           0 :     if ( pStyle->HasFollowSupport() && pPool )
     126             :     {
     127           0 :         SfxStyleSheetBase* pPoolStyle = pPool->First();
     128             : 
     129           0 :         while ( pPoolStyle )
     130             :         {
     131           0 :             m_pFollowLb->InsertEntry( pPoolStyle->GetName() );
     132           0 :             pPoolStyle = pPool->Next();
     133             :         }
     134             : 
     135             :         // A new Template is not yet in the Pool
     136           0 :         if ( LISTBOX_ENTRY_NOTFOUND == m_pFollowLb->GetEntryPos( pStyle->GetName() ) )
     137           0 :             m_pFollowLb->InsertEntry( pStyle->GetName() );
     138             :     }
     139             :     else
     140             :     {
     141           0 :         m_pFollowFt->Hide();
     142           0 :         m_pFollowLb->Hide();
     143             :     }
     144             : 
     145           0 :     if ( pStyle->HasParentSupport() && pPool )
     146             :     {
     147           0 :         if ( pStyle->HasClearParentSupport() )
     148             :             // the base template can be set to NULL
     149           0 :             m_pBaseLb->InsertEntry( SfxResId(STR_NONE).toString() );
     150             : 
     151           0 :         SfxStyleSheetBase* pPoolStyle = pPool->First();
     152             : 
     153           0 :         while ( pPoolStyle )
     154             :         {
     155           0 :             const OUString aStr( pPoolStyle->GetName() );
     156             :             // own name as base template
     157           0 :             if ( aStr != aName )
     158           0 :                 m_pBaseLb->InsertEntry( aStr );
     159           0 :             pPoolStyle = pPool->Next();
     160           0 :         }
     161             :     }
     162             :     else
     163             :     {
     164           0 :         m_pBaseFt->Disable();
     165           0 :         m_pBaseLb->Disable();
     166             :     }
     167             : 
     168           0 :     size_t nCount = pFamilies->size();
     169             :     size_t i;
     170           0 :     for ( i = 0; i < nCount; ++i )
     171             :     {
     172           0 :         pItem = pFamilies->at( i );
     173             : 
     174           0 :         if ( pItem->GetFamily() == pStyle->GetFamily() )
     175           0 :             break;
     176             :     }
     177             : 
     178           0 :     if ( i < nCount )
     179             :     {
     180           0 :         sal_uInt16 nStyleFilterIdx = 0xffff;
     181             :         // Filter flags
     182           0 :         const SfxStyleFilter& rList = pItem->GetFilterList();
     183           0 :         nCount = rList.size();
     184           0 :         sal_uInt16 nIdx = 0;
     185           0 :         sal_uInt16 nMask = pStyle->GetMask() & ~SFXSTYLEBIT_USERDEF;
     186             : 
     187           0 :         if ( !nMask )   // User Template?
     188           0 :             nMask = pStyle->GetMask();
     189             : 
     190           0 :         for ( i = 0; i < nCount; ++i )
     191             :         {
     192           0 :             SfxFilterTupel* pTupel = rList[ i ];
     193             : 
     194           0 :             if ( pTupel->nFlags != SFXSTYLEBIT_AUTO     &&
     195           0 :                  pTupel->nFlags != SFXSTYLEBIT_USED     &&
     196           0 :                  pTupel->nFlags != SFXSTYLEBIT_ALL )
     197             :             {
     198           0 :                 m_pFilterLb->InsertEntry( pTupel->aName, nIdx );
     199           0 :                 m_pFilterLb->SetEntryData(nIdx, (void*)(sal_IntPtr)i);
     200             : 
     201           0 :                 if ( ( pTupel->nFlags & nMask ) == nMask )
     202           0 :                     nStyleFilterIdx = nIdx;
     203           0 :                 ++nIdx;
     204             :             }
     205             :         }
     206             : 
     207           0 :         if ( nStyleFilterIdx != 0xFFFF )
     208           0 :             m_pFilterLb->SelectEntryPos( nStyleFilterIdx );
     209             :     }
     210             : 
     211           0 :     if ( !m_pFilterLb->GetEntryCount() || !pStyle->IsUserDefined() )
     212             :     {
     213           0 :         pItem = 0;
     214           0 :         m_pFilterFt->Disable();
     215           0 :         m_pFilterLb->Disable();
     216             :     }
     217             :     else
     218           0 :         m_pFilterLb->SaveValue();
     219           0 :     SetDescriptionText_Impl();
     220             : 
     221           0 :     if ( m_pFollowLb->IsEnabled() || m_pBaseLb->IsEnabled() )
     222             :     {
     223             :         m_pNameRw->SetGetFocusHdl(
     224           0 :             LINK( this, SfxManageStyleSheetPage, GetFocusHdl ) );
     225             :         m_pNameRw->SetLoseFocusHdl(
     226           0 :             LINK( this, SfxManageStyleSheetPage, LoseFocusHdl ) );
     227             :     }
     228             :     // It is a style with auto update? (SW only)
     229           0 :     if(SFX_ITEM_SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
     230           0 :         m_pAutoCB->Show();
     231           0 : }
     232             : 
     233             : 
     234             : 
     235           0 : SfxManageStyleSheetPage::~SfxManageStyleSheetPage()
     236             : 
     237             : /*  [Description]
     238             : 
     239             :     Destructor, release of the data
     240             : */
     241             : 
     242             : {
     243           0 :     m_pNameRw->SetGetFocusHdl( Link() );
     244           0 :     m_pNameRw->SetLoseFocusHdl( Link() );
     245           0 :     delete pFamilies;
     246           0 :     pItem = 0;
     247           0 :     pStyle = 0;
     248             : 
     249           0 : }
     250             : 
     251             : 
     252             : 
     253           0 : void SfxManageStyleSheetPage::UpdateName_Impl( ListBox* pBox,
     254             :                                                const OUString& rNew )
     255             : 
     256             : /*  [Description]
     257             : 
     258             :     After the change of a template name update the ListBox pBox
     259             : 
     260             :     [Parameter]
     261             : 
     262             :     ListBox* pBox         ListBox, whose entries are to be updated
     263             :     const String& rNew    the new Name
     264             : */
     265             : 
     266             : {
     267           0 :     if ( pBox->IsEnabled() )
     268             :     {
     269             :         // it is the current entry, which name was modified
     270           0 :         const bool bSelect = pBox->GetSelectEntry() == aBuf;
     271           0 :         pBox->RemoveEntry( aBuf );
     272           0 :         pBox->InsertEntry( rNew );
     273             : 
     274           0 :         if ( bSelect )
     275           0 :             pBox->SelectEntry( rNew );
     276             :     }
     277           0 : }
     278             : 
     279             : 
     280             : 
     281           0 : void SfxManageStyleSheetPage::SetDescriptionText_Impl()
     282             : 
     283             : /*  [Description]
     284             : 
     285             :     Set attribute description. Get the set metric for this.
     286             : */
     287             : 
     288             : {
     289           0 :     SfxMapUnit eUnit = SFX_MAPUNIT_CM;
     290           0 :     FieldUnit eFieldUnit( FUNIT_CM );
     291           0 :     SfxModule* pModule = SfxModule::GetActiveModule();
     292           0 :     if ( pModule )
     293             :     {
     294           0 :         const SfxPoolItem* pPoolItem = pModule->GetItem( SID_ATTR_METRIC );
     295           0 :         if ( pPoolItem )
     296           0 :             eFieldUnit = (FieldUnit)( (SfxUInt16Item*)pPoolItem )->GetValue();
     297             :     }
     298             : 
     299           0 :     switch ( eFieldUnit )
     300             :     {
     301           0 :         case FUNIT_MM:      eUnit = SFX_MAPUNIT_MM; break;
     302             :         case FUNIT_CM:
     303             :         case FUNIT_M:
     304           0 :         case FUNIT_KM:      eUnit = SFX_MAPUNIT_CM; break;
     305             :         case FUNIT_POINT:
     306           0 :         case FUNIT_PICA:    eUnit = SFX_MAPUNIT_POINT; break;
     307             :         case FUNIT_INCH:
     308             :         case FUNIT_FOOT:
     309           0 :         case FUNIT_MILE:    eUnit = SFX_MAPUNIT_INCH; break;
     310             : 
     311             :         default:
     312             :             OSL_FAIL( "non supported field unit" );
     313             :     }
     314           0 :     m_pDescFt->SetText( pStyle->GetDescription( eUnit ) );
     315           0 : }
     316             : 
     317             : 
     318             : 
     319           0 : IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
     320             : 
     321             : /*  [Description]
     322             : 
     323             :     StarView Handler; GetFocus-Handler of the Edits with the template name.
     324             : */
     325             : 
     326             : {
     327           0 :     aBuf = comphelper::string::stripStart(pEdit->GetText(), ' ');
     328           0 :     return 0;
     329             : }
     330           0 : IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, GetFocusHdl, Edit *, pEdit )
     331             : 
     332             : 
     333             : 
     334           0 : IMPL_LINK_INLINE_START( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
     335             : 
     336             : /*  [Description]
     337             : 
     338             :     StarView Handler; loose-focus-handler of the edits of the template name.
     339             :     This will update the listbox with the subsequent templates. The current
     340             :     template itself is not returned in the listbox of the base templates.
     341             : */
     342             : 
     343             : {
     344           0 :     const OUString aStr(comphelper::string::stripStart(pEdit->GetText(), ' '));
     345           0 :     pEdit->SetText( aStr );
     346             :     // Update the Listbox of the base template if possible
     347           0 :     if ( aStr != aBuf )
     348           0 :         UpdateName_Impl(m_pFollowLb, aStr);
     349           0 :     return 0;
     350             : }
     351           0 : IMPL_LINK_INLINE_END( SfxManageStyleSheetPage, LoseFocusHdl, Edit *, pEdit )
     352             : 
     353             : 
     354             : 
     355           0 : bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet& rSet )
     356             : 
     357             : /*  [Description]
     358             : 
     359             :     Handler for setting the (modified) data. I called from the OK of the
     360             :     SfxTabDialog.
     361             : 
     362             :     [Parameter]
     363             : 
     364             :     SfxItemSet &rAttrSet    The set, which receives the data.
     365             : 
     366             :     [Return value]
     367             : 
     368             :     sal_Bool                sal_True:  The data had been changed
     369             :                             sal_False: The data had not been changed
     370             : 
     371             :     [Cross-reference]
     372             : 
     373             :     <class SfxTabDialog>
     374             : */
     375             : 
     376             : {
     377           0 :     const sal_Int32 nFilterIdx = m_pFilterLb->GetSelectEntryPos();
     378             : 
     379             :     // Set Filter
     380             : 
     381           0 :     if ( LISTBOX_ENTRY_NOTFOUND  != nFilterIdx      &&
     382           0 :          nFilterIdx != m_pFilterLb->GetSavedValue()    &&
     383           0 :          m_pFilterLb->IsEnabled() )
     384             :     {
     385           0 :         bModified = true;
     386             :         OSL_ENSURE( pItem, "No Item" );
     387             :         // is only possibly for user templates
     388           0 :         sal_uInt16 nMask = pItem->GetFilterList()[ (size_t)m_pFilterLb->GetEntryData( nFilterIdx ) ]->nFlags | SFXSTYLEBIT_USERDEF;
     389           0 :         pStyle->SetMask( nMask );
     390             :     }
     391           0 :     if(m_pAutoCB->IsVisible() &&
     392           0 :        TriState(m_pAutoCB->IsChecked()) != m_pAutoCB->GetSavedValue())
     393             :     {
     394           0 :         rSet.Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, m_pAutoCB->IsChecked()));
     395             :     }
     396             : 
     397           0 :     return bModified;
     398             : }
     399             : 
     400             : 
     401             : 
     402           0 : void SfxManageStyleSheetPage::Reset( const SfxItemSet& /*rAttrSet*/ )
     403             : 
     404             : /*  [Description]
     405             : 
     406             :     Handler to initialize the page with the initial data.
     407             : 
     408             :     [Parameter]
     409             : 
     410             :     const SfxItemSet &rAttrSet          The data set
     411             : 
     412             :     [Cross-reference]
     413             : 
     414             :     <class SfxTabDialog>
     415             : */
     416             : 
     417             : {
     418           0 :     bModified = false;
     419           0 :     OUString sCmp( pStyle->GetName() );
     420             : 
     421           0 :     if ( sCmp != aName )
     422           0 :         pStyle->SetName( aName );
     423           0 :     m_pNameRw->SetText( aName );
     424           0 :     m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
     425             : 
     426           0 :     if ( m_pFollowLb->IsEnabled() )
     427             :     {
     428           0 :         sCmp = pStyle->GetFollow();
     429             : 
     430           0 :         if ( sCmp != aFollow )
     431           0 :             pStyle->SetFollow( aFollow );
     432             : 
     433           0 :         if ( aFollow.isEmpty() )
     434           0 :             m_pFollowLb->SelectEntry( aName );
     435             :         else
     436           0 :             m_pFollowLb->SelectEntry( aFollow );
     437             :     }
     438             : 
     439           0 :     if ( m_pBaseLb->IsEnabled() )
     440             :     {
     441           0 :         sCmp = pStyle->GetParent();
     442             : 
     443           0 :         if ( sCmp != aParent )
     444           0 :             pStyle->SetParent( aParent );
     445             : 
     446           0 :         if ( aParent.isEmpty() )
     447           0 :             m_pBaseLb->SelectEntry( SfxResId(STR_NONE).toString() );
     448             :         else
     449           0 :             m_pBaseLb->SelectEntry( aParent );
     450             : 
     451           0 :         if ( SfxResId(STR_STANDARD).toString().equals(aName) )
     452             :         {
     453             :             // the default template can not be linked
     454           0 :             m_pBaseFt->Disable();
     455           0 :             m_pBaseLb->Disable();
     456             :         }
     457             :     }
     458             : 
     459           0 :     if ( m_pFilterLb->IsEnabled() )
     460             :     {
     461           0 :         sal_uInt16 nCmp = pStyle->GetMask();
     462             : 
     463           0 :         if ( nCmp != nFlags )
     464           0 :             pStyle->SetMask( nFlags );
     465           0 :         m_pFilterLb->SelectEntryPos( m_pFilterLb->GetSavedValue() );
     466           0 :     }
     467           0 : }
     468             : 
     469             : 
     470             : 
     471           0 : SfxTabPage* SfxManageStyleSheetPage::Create( Window* pParent,
     472             :                                              const SfxItemSet &rAttrSet )
     473             : 
     474             : /*  [Description]
     475             : 
     476             :     Factory for the creation of the page.
     477             : 
     478             :     [Cross-reference]
     479             : 
     480             :     <class SfxTabDialog>
     481             : */
     482             : 
     483             : {
     484           0 :     return new SfxManageStyleSheetPage( pParent, rAttrSet );
     485             : }
     486             : 
     487             : 
     488             : 
     489           0 : void SfxManageStyleSheetPage::ActivatePage( const SfxItemSet& rSet)
     490             : 
     491             : /*  [Description]
     492             : 
     493             :     ActivatePage handler of SfxTabDialog, is used for the update of the
     494             :     descriptive text, since this might have changed through changes of data on
     495             :     other pages.
     496             : 
     497             :     [Parameter]
     498             : 
     499             :     const SfxItemSet&    the set for the exchange of data; is not used here.
     500             : 
     501             :     [Cross-reference]
     502             : 
     503             :     <SfxTabDialog::ActivatePage(const SfxItemSet &)>
     504             : */
     505             : 
     506             : {
     507           0 :     SetDescriptionText_Impl();
     508             : 
     509             :     // It is a style with auto update? (SW only)
     510             :     const SfxPoolItem* pPoolItem;
     511             : 
     512           0 :     if ( SFX_ITEM_SET ==
     513           0 :          rSet.GetItemState( SID_ATTR_AUTO_STYLE_UPDATE, false, &pPoolItem ) )
     514           0 :         m_pAutoCB->Check( ( (const SfxBoolItem*)pPoolItem )->GetValue() );
     515           0 :     m_pAutoCB->SaveValue();
     516           0 : }
     517             : 
     518             : 
     519             : 
     520           0 : int SfxManageStyleSheetPage::DeactivatePage( SfxItemSet* pItemSet )
     521             : 
     522             : /*  [Description]
     523             : 
     524             :     DeactivatePage-handler of SfxTabDialog; data is set on the template, so
     525             :     that the correct inheritance on the other pages of the dialog is made.
     526             :     If an error occurs, leaving the page is prevented.
     527             :     [Parameter]
     528             : 
     529             :     SfxItemSet*    the set for the exchange of data; is not used here.
     530             : 
     531             :     [Cross-reference]
     532             : 
     533             :     <SfxTabDialog::DeactivatePage(SfxItemSet*)>
     534             : */
     535             : 
     536             : {
     537           0 :     int nRet = SfxTabPage::LEAVE_PAGE;
     538             : 
     539           0 :     if ( m_pNameRw->IsModified() )
     540             :     {
     541             :         // By pressing <Enter> LoseFocus() is not trigged through StarView
     542           0 :         if ( m_pNameRw->HasFocus() )
     543           0 :             LoseFocusHdl( m_pNameRw );
     544             : 
     545           0 :         if (!pStyle->SetName(comphelper::string::stripStart(m_pNameRw->GetText(), ' ')))
     546             :         {
     547           0 :             InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDNAME ) );
     548           0 :             aBox.Execute();
     549           0 :             m_pNameRw->GrabFocus();
     550           0 :             m_pNameRw->SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
     551           0 :             return SfxTabPage::KEEP_PAGE;
     552             :         }
     553           0 :         bModified = true;
     554             :     }
     555             : 
     556           0 :     if ( pStyle->HasFollowSupport() && m_pFollowLb->IsEnabled() )
     557             :     {
     558           0 :         const OUString aFollowEntry( m_pFollowLb->GetSelectEntry() );
     559             : 
     560           0 :         if ( pStyle->GetFollow() != aFollowEntry )
     561             :         {
     562           0 :             if ( !pStyle->SetFollow( aFollowEntry ) )
     563             :             {
     564           0 :                 InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDSTYLE ) );
     565           0 :                 aBox.Execute();
     566           0 :                 m_pFollowLb->GrabFocus();
     567           0 :                 return SfxTabPage::KEEP_PAGE;
     568             :             }
     569           0 :             bModified = true;
     570           0 :         }
     571             :     }
     572             : 
     573           0 :     if ( m_pBaseLb->IsEnabled() )
     574             :     {
     575           0 :         OUString aParentEntry( m_pBaseLb->GetSelectEntry() );
     576             : 
     577           0 :         if ( SfxResId(STR_NONE).toString().equals(aParentEntry) || aParentEntry == pStyle->GetName() )
     578           0 :             aParentEntry = OUString();
     579             : 
     580           0 :         if ( pStyle->GetParent() != aParentEntry )
     581             :         {
     582           0 :             if ( !pStyle->SetParent( aParentEntry ) )
     583             :             {
     584           0 :                 InfoBox aBox( this, SfxResId( MSG_TABPAGE_INVALIDPARENT ) );
     585           0 :                 aBox.Execute();
     586           0 :                 m_pBaseLb->GrabFocus();
     587           0 :                 return SfxTabPage::KEEP_PAGE;
     588             :             }
     589           0 :             bModified = true;
     590           0 :             nRet |= (int)SfxTabPage::REFRESH_SET;
     591           0 :         }
     592             :     }
     593             : 
     594           0 :     if ( pItemSet )
     595           0 :         FillItemSet( *pItemSet );
     596             : 
     597           0 :     return nRet;
     598         447 : }
     599             : 
     600             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10