fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / svx / source / toolbars / fontworkbar.cxx
blobd77bb338d1694d8fc5f4f55c71258f50b40fa73a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <svx/svdundo.hxx>
21 #include <sfx2/app.hxx>
22 #include <sfx2/request.hxx>
23 #include <sfx2/objface.hxx>
24 #include <sfx2/viewsh.hxx>
25 #include "svx/unoapi.hxx"
26 #include <com/sun/star/drawing/XShape.hpp>
27 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
28 #include <svx/dialmgr.hxx>
29 #include <svx/svdoashp.hxx>
30 #include <svx/dialogs.hrc>
31 #include <svx/svdview.hxx>
32 #include <svx/sdasitm.hxx>
33 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
34 #include <sfx2/bindings.hxx>
35 #include <editeng/eeitem.hxx>
36 #include <editeng/charscaleitem.hxx>
37 #include <editeng/kernitem.hxx>
38 #include <svx/sdrpaintwindow.hxx>
40 #include <svx/svxids.hrc>
41 #include <svx/fontworkbar.hxx>
42 #include "svx/fontworkgallery.hxx"
45 using namespace ::svx;
46 using namespace ::cppu;
47 using namespace ::com::sun::star;
48 using namespace ::com::sun::star::beans;
49 using namespace ::com::sun::star::uno;
51 void SetAlignmentState( SdrView* pSdrView, SfxItemSet& rSet )
53 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
54 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
56 sal_Int32 nAlignment = -1;
57 for( i = 0; i < nCount; i++ )
59 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
60 if( pObj->ISA(SdrObjCustomShape) )
62 sal_Int32 nOldAlignment = nAlignment;
63 SdrTextHorzAdjustItem& rTextHorzAdjustItem = (SdrTextHorzAdjustItem&)pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST );
64 SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = (SdrTextFitToSizeTypeItem&)pObj->GetMergedItem( SDRATTR_TEXT_FITTOSIZE );
65 switch ( rTextHorzAdjustItem.GetValue() )
67 case SDRTEXTHORZADJUST_LEFT : nAlignment = 0; break;
68 case SDRTEXTHORZADJUST_CENTER : nAlignment = 1; break;
69 case SDRTEXTHORZADJUST_RIGHT : nAlignment = 2; break;
70 case SDRTEXTHORZADJUST_BLOCK :
72 if ( rTextFitToSizeTypeItem.GetValue() == SDRTEXTFIT_NONE )
73 nAlignment = 3;
74 else if ( rTextFitToSizeTypeItem.GetValue() == SDRTEXTFIT_ALLLINES )
75 nAlignment = 4;
78 if ( ( nOldAlignment != -1 ) && ( nOldAlignment != nAlignment ) )
80 nAlignment = -1;
81 break;
85 rSet.Put( SfxInt32Item( SID_FONTWORK_ALIGNMENT, nAlignment ) );
88 void SetCharacterSpacingState( SdrView* pSdrView, SfxItemSet& rSet )
90 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
91 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
93 sal_Int32 nCharacterSpacing = -1;
94 for( i = 0; i < nCount; i++ )
96 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
97 if( pObj->ISA(SdrObjCustomShape) )
99 sal_Int32 nOldCharacterSpacing = nCharacterSpacing;
100 SvxCharScaleWidthItem& rCharScaleWidthItem = (SvxCharScaleWidthItem&)pObj->GetMergedItem( EE_CHAR_FONTWIDTH );
101 nCharacterSpacing = rCharScaleWidthItem.GetValue();
102 if ( ( nOldCharacterSpacing != -1 ) && ( nOldCharacterSpacing != nCharacterSpacing ) )
104 nCharacterSpacing = -1;
105 break;
109 rSet.Put( SfxInt32Item( SID_FONTWORK_CHARACTER_SPACING, nCharacterSpacing ) );
113 void SetKernCharacterPairsState( SdrView* pSdrView, SfxItemSet& rSet )
115 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
116 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
118 sal_Bool bChecked = sal_False;
119 for( i = 0; i < nCount; i++ )
121 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
122 if( pObj->ISA(SdrObjCustomShape) )
124 SvxKerningItem& rKerningItem = (SvxKerningItem&)pObj->GetMergedItem( EE_CHAR_KERNING );
125 if ( rKerningItem.GetValue() )
126 bChecked = sal_True;
129 rSet.Put( SfxBoolItem( SID_FONTWORK_KERN_CHARACTER_PAIRS, bChecked ) );
132 void SetFontWorkShapeTypeState( SdrView* pSdrView, SfxItemSet& rSet )
134 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
135 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
137 OUString aFontWorkShapeType;
139 for( i = 0; i < nCount; i++ )
141 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
142 if( pObj->ISA( SdrObjCustomShape ) )
144 const OUString sType( "Type" );
145 SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
146 Any* pAny = aGeometryItem.GetPropertyValueByName( sType );
147 if( pAny )
149 OUString aType;
150 if ( *pAny >>= aType )
152 if ( !aFontWorkShapeType.isEmpty() )
154 if ( !aFontWorkShapeType.equals( aType ) ) // different FontWorkShapeTypes selected ?
156 aFontWorkShapeType = OUString();
157 break;
160 aFontWorkShapeType = aType;
165 rSet.Put( SfxStringItem( SID_FONTWORK_SHAPE_TYPE, aFontWorkShapeType ) );
168 /*************************************************************************
170 |* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also
171 |* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt).
173 \************************************************************************/
175 SFX_SLOTMAP(FontworkBar)
177 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
180 SFX_IMPL_INTERFACE(FontworkBar, SfxShell, SVX_RES(RID_SVX_FONTWORK_BAR))
182 SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT, SVX_RES(RID_SVX_FONTWORK_BAR) );
185 TYPEINIT1( FontworkBar, SfxShell );
188 /*************************************************************************
190 |* Standard-Konstruktor
192 \************************************************************************/
194 FontworkBar::FontworkBar(SfxViewShell* pViewShell )
195 : SfxShell(pViewShell)
197 DBG_ASSERT( pViewShell, "svx::FontworkBar::FontworkBar(), I need a viewshell!" );
198 if( pViewShell )
199 SetPool(&pViewShell->GetPool());
201 SetHelpId( SVX_INTERFACE_FONTWORK_BAR );
202 SetName( String( SVX_RES( RID_SVX_FONTWORK_BAR) ));
206 /*************************************************************************
208 |* Destruktor
210 \************************************************************************/
212 FontworkBar::~FontworkBar()
214 SetRepeatTarget(NULL);
217 static Window* ImpGetViewWin(SdrView* pView)
219 if( pView )
221 const sal_uInt32 nAnz(pView->PaintWindowCount());
222 for(sal_uInt32 nNum(0L); nNum < nAnz; nNum++)
224 OutputDevice* pOut = &(pView->GetPaintWindow(nNum)->GetOutputDevice());
226 if(OUTDEV_WINDOW == pOut->GetOutDevType())
228 return (Window*)pOut;
233 return 0L;
236 namespace svx {
237 bool checkForSelectedFontWork( SdrView* pSdrView, sal_uInt32& nCheckStatus )
239 if ( nCheckStatus & 2 )
240 return ( nCheckStatus & 1 ) != 0;
242 static const OUString sTextPath( "TextPath" );
244 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
245 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
246 sal_Bool bFound = sal_False;
247 for(i=0;(i<nCount) && !bFound ; i++)
249 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
250 if( pObj->ISA(SdrObjCustomShape) )
252 SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
253 Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
254 if( pAny )
255 *pAny >>= bFound;
258 if ( bFound )
259 nCheckStatus |= 1;
260 nCheckStatus |= 2;
261 return bFound;
265 static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj )
267 static const OUString sTextPath( "TextPath" );
268 static const OUString sSameLetterHeights( "SameLetterHeights" );
270 sal_uInt16 nSID = rReq.GetSlot();
271 switch( nSID )
273 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
275 com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sSameLetterHeights );
276 if( pAny )
278 sal_Bool bOn;
279 (*pAny) >>= bOn;
280 bOn = !bOn;
281 (*pAny) <<= bOn;
284 break;
286 case SID_FONTWORK_ALIGNMENT:
288 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_FONTWORK_ALIGNMENT ) == SFX_ITEM_SET )
290 sal_Int32 nValue = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_FONTWORK_ALIGNMENT))->GetValue();
291 if ( ( nValue >= 0 ) && ( nValue < 5 ) )
293 SdrFitToSizeType eFTS = SDRTEXTFIT_NONE;
294 SdrTextHorzAdjust eHorzAdjust;
295 switch ( nValue )
297 case 4 : eFTS = SDRTEXTFIT_ALLLINES; // passthrough
298 case 3 : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
299 default:
300 case 0 : eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
301 case 1 : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
302 case 2 : eHorzAdjust = SDRTEXTHORZADJUST_RIGHT; break;
304 pObj->SetMergedItem( SdrTextHorzAdjustItem( eHorzAdjust ) );
305 pObj->SetMergedItem( SdrTextFitToSizeTypeItem( eFTS ) );
306 pObj->BroadcastObjectChange();
310 break;
312 case SID_FONTWORK_CHARACTER_SPACING:
314 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SFX_ITEM_SET ) )
316 sal_Int32 nCharSpacing = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
317 pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
318 pObj->BroadcastObjectChange();
321 break;
323 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
325 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_KERN_CHARACTER_PAIRS ) == SFX_ITEM_SET ) )
327 // sal_Bool bKernCharacterPairs = ((const SfxBoolItem*)rReq.GetArgs()->GetItem(SID_FONTWORK_KERN_CHARACTER_PAIRS))->GetValue();
328 //TODO: pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
329 pObj->BroadcastObjectChange();
332 break;
336 #include "svx/gallery.hxx"
337 #include <svx/fmmodel.hxx>
338 #include <svx/fmpage.hxx>
339 #include <svl/itempool.hxx>
341 void GetGeometryForCustomShape( SdrCustomShapeGeometryItem& rGeometryItem, const OUString rCustomShape )
343 const OUString sType( "Type" );
345 com::sun::star::beans::PropertyValue aPropVal;
346 aPropVal.Name = sType;
347 aPropVal.Value <<= rCustomShape;
348 rGeometryItem.SetPropertyValue( aPropVal );
350 const OUString sAdjustmentValues( "AdjustmentValues" );
351 const OUString sCoordinateOrigin( "CoordinateOrigin" );
352 const OUString sCoordinateSize( "CoordinateSize" );
353 const OUString sEquations( "Equations" );
354 const OUString sHandles( "Handles" );
355 const OUString sPath( "Path" );
356 rGeometryItem.ClearPropertyValue( sAdjustmentValues );
357 rGeometryItem.ClearPropertyValue( sCoordinateOrigin );
358 rGeometryItem.ClearPropertyValue( sCoordinateSize );
359 rGeometryItem.ClearPropertyValue( sEquations );
360 rGeometryItem.ClearPropertyValue( sHandles );
361 rGeometryItem.ClearPropertyValue( sPath );
363 /* SJ: CustomShapes that are available in the gallery are having the highest
364 priority, so we will take a look there before taking the internal default */
366 if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
368 std::vector< OUString > aObjList;
369 if ( GalleryExplorer::FillObjListTitle( GALLERY_THEME_POWERPOINT, aObjList ) )
371 sal_uInt16 i;
372 for ( i = 0; i < aObjList.size(); i++ )
374 if ( aObjList[ i ].equalsIgnoreAsciiCase( rCustomShape ) )
376 FmFormModel aFormModel;
377 SfxItemPool& rPool = aFormModel.GetItemPool();
378 rPool.FreezeIdRanges();
379 if ( GalleryExplorer::GetSdrObj( GALLERY_THEME_POWERPOINT, i, &aFormModel ) )
381 const SdrObject* pSourceObj = aFormModel.GetPage( 0 )->GetObj( 0 );
382 if( pSourceObj )
384 PropertyValue aPropVal_;
385 SdrCustomShapeGeometryItem& rSourceGeometry = (SdrCustomShapeGeometryItem&)pSourceObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
386 com::sun::star::uno::Any* pAny = rSourceGeometry.GetPropertyValueByName( sType );
387 if ( pAny )
389 aPropVal_.Name = sType;
390 aPropVal_.Value = *pAny;
391 rGeometryItem.SetPropertyValue( aPropVal_ );
393 pAny = rSourceGeometry.GetPropertyValueByName( sAdjustmentValues );
394 if ( pAny )
396 aPropVal_.Name = sAdjustmentValues;
397 aPropVal_.Value = *pAny;
398 rGeometryItem.SetPropertyValue( aPropVal_ );
400 pAny = rSourceGeometry.GetPropertyValueByName( sCoordinateOrigin );
401 if ( pAny )
403 aPropVal_.Name = sCoordinateOrigin;
404 aPropVal_.Value = *pAny;
405 rGeometryItem.SetPropertyValue( aPropVal_ );
407 pAny = rSourceGeometry.GetPropertyValueByName( sCoordinateSize );
408 if ( pAny )
410 aPropVal_.Name = sCoordinateSize;
411 aPropVal_.Value = *pAny;
412 rGeometryItem.SetPropertyValue( aPropVal_ );
414 pAny = rSourceGeometry.GetPropertyValueByName( sEquations );
415 if ( pAny )
417 aPropVal_.Name = sEquations;
418 aPropVal_.Value = *pAny;
419 rGeometryItem.SetPropertyValue( aPropVal_ );
421 pAny = rSourceGeometry.GetPropertyValueByName( sHandles );
422 if ( pAny )
424 aPropVal_.Name = sHandles;
425 aPropVal_.Value = *pAny;
426 rGeometryItem.SetPropertyValue( aPropVal_ );
428 pAny = rSourceGeometry.GetPropertyValueByName( sPath );
429 if ( pAny )
431 aPropVal_.Name = sPath;
432 aPropVal_.Value = *pAny;
433 rGeometryItem.SetPropertyValue( aPropVal_ );
444 void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBindings )
446 sal_uInt16 nStrResId = 0;
448 sal_uInt16 nSID = rReq.GetSlot();
449 switch( nSID )
451 case SID_FONTWORK_GALLERY_FLOATER:
453 FontWorkGalleryDialog aDlg( pSdrView, ImpGetViewWin(pSdrView), nSID );
454 aDlg.Execute();
456 break;
458 case SID_FONTWORK_SHAPE_TYPE:
460 OUString aCustomShape;
461 const SfxItemSet* pArgs = rReq.GetArgs();
462 if ( pArgs )
464 const SfxStringItem& rItm = (const SfxStringItem&)pArgs->Get( rReq.GetSlot() );
465 aCustomShape = rItm.GetValue();
467 if ( !aCustomShape.isEmpty() )
469 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
470 sal_uInt32 nCount = rMarkList.GetMarkCount(), i;
471 for( i = 0; i < nCount; i++ )
473 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
474 if( pObj->ISA(SdrObjCustomShape) )
476 const bool bUndo = pSdrView->IsUndoEnabled();
478 if( bUndo )
480 String aStr( SVX_RES( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
481 pSdrView->BegUndo( aStr );
482 pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
484 SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
485 GetGeometryForCustomShape( aGeometryItem, aCustomShape );
486 pObj->SetMergedItem( aGeometryItem );
488 Reference< drawing::XShape > aXShape = GetXShapeForSdrObject( (SdrObjCustomShape*)pObj );
489 if ( aXShape.is() )
491 Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( aXShape, UNO_QUERY );
492 if( xDefaulter.is() )
493 xDefaulter->createCustomShapeDefaults( aCustomShape );
496 pObj->BroadcastObjectChange();
497 if( bUndo )
498 pSdrView->EndUndo();
499 pSdrView->AdjustMarkHdl(); //HMH sal_True );
500 rBindings.Invalidate( SID_FONTWORK_SHAPE_TYPE );
505 break;
507 case SID_FONTWORK_CHARACTER_SPACING_DIALOG :
509 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SFX_ITEM_SET ) )
511 sal_Int32 nCharSpacing = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
512 FontworkCharacterSpacingDialog aDlg( 0L, nCharSpacing );
513 sal_uInt16 nRet = aDlg.Execute();
514 if( nRet != 0 )
516 SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, aDlg.getScale() );
517 SfxPoolItem* aItems[] = { &aItem, 0 };
518 rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, (const SfxPoolItem**)aItems );
522 break;
524 case SID_FONTWORK_SHAPE:
525 case SID_FONTWORK_ALIGNMENT:
527 if ( !nStrResId )
528 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT;
529 } // PASSTROUGH
530 case SID_FONTWORK_CHARACTER_SPACING:
532 if ( !nStrResId )
533 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING;
534 } // PASSTROUGH
535 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
537 if ( !nStrResId )
538 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING;
539 } // PASSTROUGH
540 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
542 if ( !nStrResId )
543 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT;
545 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
546 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i;
547 for( i = 0; i < nCount; i++ )
549 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
550 if( pObj->ISA(SdrObjCustomShape) )
552 const bool bUndo = pSdrView->IsUndoEnabled();
553 if( bUndo )
555 String aStr( SVX_RES( nStrResId ) );
556 pSdrView->BegUndo( aStr );
557 pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
559 SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
560 impl_execute( pSdrView, rReq, aGeometryItem, pObj );
561 pObj->SetMergedItem( aGeometryItem );
562 pObj->BroadcastObjectChange();
563 if( bUndo )
564 pSdrView->EndUndo();
568 break;
572 void FontworkBar::getState( SdrView* pSdrView, SfxItemSet& rSet )
574 sal_uInt32 nCheckStatus = 0;
576 if ( rSet.GetItemState( SID_FONTWORK_ALIGNMENT_FLOATER ) != SFX_ITEM_UNKNOWN )
578 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
579 rSet.DisableItem( SID_FONTWORK_ALIGNMENT_FLOATER );
581 if ( rSet.GetItemState( SID_FONTWORK_ALIGNMENT ) != SFX_ITEM_UNKNOWN )
583 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
584 rSet.DisableItem( SID_FONTWORK_ALIGNMENT );
585 else
586 SetAlignmentState( pSdrView, rSet );
588 if ( rSet.GetItemState( SID_FONTWORK_CHARACTER_SPACING_FLOATER ) != SFX_ITEM_UNKNOWN )
590 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
591 rSet.DisableItem( SID_FONTWORK_CHARACTER_SPACING_FLOATER );
593 if ( rSet.GetItemState( SID_FONTWORK_CHARACTER_SPACING ) != SFX_ITEM_UNKNOWN )
595 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
596 rSet.DisableItem( SID_FONTWORK_CHARACTER_SPACING );
597 else
598 SetCharacterSpacingState( pSdrView, rSet );
600 if ( rSet.GetItemState( SID_FONTWORK_KERN_CHARACTER_PAIRS ) != SFX_ITEM_UNKNOWN )
602 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
603 rSet.DisableItem( SID_FONTWORK_KERN_CHARACTER_PAIRS );
604 else
605 SetKernCharacterPairsState( pSdrView, rSet );
607 if ( rSet.GetItemState( SID_FONTWORK_SAME_LETTER_HEIGHTS ) != SFX_ITEM_UNKNOWN )
609 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
610 rSet.DisableItem( SID_FONTWORK_SAME_LETTER_HEIGHTS );
612 if ( rSet.GetItemState( SID_FONTWORK_SHAPE_TYPE ) != SFX_ITEM_UNKNOWN )
614 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
615 rSet.DisableItem( SID_FONTWORK_SHAPE_TYPE );
616 else
617 SetFontWorkShapeTypeState( pSdrView, rSet );
621 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */