bump product version to 5.0.4.1
[LibreOffice.git] / svx / source / toolbars / fontworkbar.cxx
blob72b2661cfd734785d8fa99c61cfae303d3888180
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 const size_t nCount = rMarkList.GetMarkCount();
56 sal_Int32 nAlignment = -1;
57 for( size_t i = 0; i < nCount; ++i )
59 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
60 if( pObj->ISA(SdrObjCustomShape) )
62 sal_Int32 nOldAlignment = nAlignment;
63 const SdrTextHorzAdjustItem& rTextHorzAdjustItem = static_cast<const SdrTextHorzAdjustItem&>(pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST ));
64 const SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = static_cast<const 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 const size_t nCount = rMarkList.GetMarkCount();
93 sal_Int32 nCharacterSpacing = -1;
94 for( size_t i = 0; i < nCount; ++i )
96 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
97 if( pObj->ISA(SdrObjCustomShape) )
99 sal_Int32 nOldCharacterSpacing = nCharacterSpacing;
100 const SvxCharScaleWidthItem& rCharScaleWidthItem = static_cast<const 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 const size_t nCount = rMarkList.GetMarkCount();
118 bool bChecked = false;
119 for( size_t i = 0; i < nCount; ++i )
121 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
122 if( pObj->ISA(SdrObjCustomShape) )
124 const SvxKerningItem& rKerningItem = static_cast<const SvxKerningItem&>(pObj->GetMergedItem( EE_CHAR_KERNING ));
125 if ( rKerningItem.GetValue() )
126 bChecked = 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 const size_t nCount = rMarkList.GetMarkCount();
137 OUString aFontWorkShapeType;
139 for( size_t i = 0; i < nCount; ++i )
141 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
142 if( pObj->ISA( SdrObjCustomShape ) )
144 const OUString sType( "Type" );
145 const SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )));
146 const 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.clear();
157 break;
160 aFontWorkShapeType = aType;
165 rSet.Put( SfxStringItem( SID_FONTWORK_SHAPE_TYPE, aFontWorkShapeType ) );
168 // Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also
169 // tragen wir etwas ein, was hier (hoffentlich) nie vorkommt).
170 static SfxSlot aFontworkBarSlots_Impl[] =
172 { 0, 0, 0, SfxSlotMode::NONE, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
175 SFX_IMPL_INTERFACE(FontworkBar, SfxShell)
177 void FontworkBar::InitInterface_Impl()
179 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, RID_SVX_FONTWORK_BAR);
182 TYPEINIT1( FontworkBar, SfxShell );
184 FontworkBar::FontworkBar(SfxViewShell* pViewShell )
185 : SfxShell(pViewShell)
187 DBG_ASSERT( pViewShell, "svx::FontworkBar::FontworkBar(), I need a viewshell!" );
188 if( pViewShell )
189 SetPool(&pViewShell->GetPool());
191 SetHelpId( SVX_INTERFACE_FONTWORK_BAR );
192 SetName( SVX_RESSTR( RID_SVX_FONTWORK_BAR ));
195 FontworkBar::~FontworkBar()
197 SetRepeatTarget(NULL);
200 static vcl::Window* ImpGetViewWin(SdrView* pView)
202 if( pView )
204 const sal_uInt32 nCount(pView->PaintWindowCount());
205 for(sal_uInt32 nNum(0L); nNum < nCount; nNum++)
207 OutputDevice* pOut = &(pView->GetPaintWindow(nNum)->GetOutputDevice());
209 if(OUTDEV_WINDOW == pOut->GetOutDevType())
211 return static_cast<vcl::Window*>(pOut);
216 return 0L;
219 namespace svx {
220 bool checkForSelectedFontWork( SdrView* pSdrView, sal_uInt32& nCheckStatus )
222 if ( nCheckStatus & 2 )
223 return ( nCheckStatus & 1 ) != 0;
225 static const char sTextPath[] = "TextPath";
227 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
228 const size_t nCount = rMarkList.GetMarkCount();
229 bool bFound = false;
230 for(size_t i=0; (i<nCount) && !bFound ; ++i)
232 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
233 if( pObj->ISA(SdrObjCustomShape) )
235 const SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )));
236 const Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
237 if( pAny )
238 *pAny >>= bFound;
241 if ( bFound )
242 nCheckStatus |= 1;
243 nCheckStatus |= 2;
244 return bFound;
248 static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj )
250 static const char sTextPath[] = "TextPath";
251 static const char sSameLetterHeights[] = "SameLetterHeights";
253 sal_uInt16 nSID = rReq.GetSlot();
254 switch( nSID )
256 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
258 com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sSameLetterHeights );
259 if( pAny )
261 bool bOn = false;
262 (*pAny) >>= bOn;
263 bOn = !bOn;
264 (*pAny) <<= bOn;
267 break;
269 case SID_FONTWORK_ALIGNMENT:
271 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_FONTWORK_ALIGNMENT ) == SfxItemState::SET )
273 sal_Int32 nValue = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_ALIGNMENT))->GetValue();
274 if ( ( nValue >= 0 ) && ( nValue < 5 ) )
276 SdrFitToSizeType eFTS = SDRTEXTFIT_NONE;
277 SdrTextHorzAdjust eHorzAdjust;
278 switch ( nValue )
280 case 4 : eFTS = SDRTEXTFIT_ALLLINES; // passthrough
281 case 3 : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
282 default: eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
283 case 1 : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
284 case 2 : eHorzAdjust = SDRTEXTHORZADJUST_RIGHT; break;
286 pObj->SetMergedItem( SdrTextHorzAdjustItem( eHorzAdjust ) );
287 pObj->SetMergedItem( SdrTextFitToSizeTypeItem( eFTS ) );
288 pObj->BroadcastObjectChange();
292 break;
294 case SID_FONTWORK_CHARACTER_SPACING:
296 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
298 sal_Int32 nCharSpacing = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
299 pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
300 pObj->BroadcastObjectChange();
303 break;
305 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
307 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_KERN_CHARACTER_PAIRS ) == SfxItemState::SET ) )
309 // sal_Bool bKernCharacterPairs = ((const SfxBoolItem*)rReq.GetArgs()->GetItem(SID_FONTWORK_KERN_CHARACTER_PAIRS))->GetValue();
310 //TODO: pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
311 pObj->BroadcastObjectChange();
314 break;
318 #include "svx/gallery.hxx"
319 #include <svx/fmmodel.hxx>
320 #include <svx/fmpage.hxx>
321 #include <svl/itempool.hxx>
323 void GetGeometryForCustomShape( SdrCustomShapeGeometryItem& rGeometryItem, const OUString& rCustomShape )
325 const OUString sType( "Type" );
327 com::sun::star::beans::PropertyValue aPropVal;
328 aPropVal.Name = sType;
329 aPropVal.Value <<= rCustomShape;
330 rGeometryItem.SetPropertyValue( aPropVal );
332 const OUString sAdjustmentValues( "AdjustmentValues" );
333 const OUString sCoordinateOrigin( "CoordinateOrigin" );
334 const OUString sCoordinateSize( "CoordinateSize" );
335 const OUString sEquations( "Equations" );
336 const OUString sHandles( "Handles" );
337 const OUString sPath( "Path" );
338 rGeometryItem.ClearPropertyValue( sAdjustmentValues );
339 rGeometryItem.ClearPropertyValue( sCoordinateOrigin );
340 rGeometryItem.ClearPropertyValue( sCoordinateSize );
341 rGeometryItem.ClearPropertyValue( sEquations );
342 rGeometryItem.ClearPropertyValue( sHandles );
343 rGeometryItem.ClearPropertyValue( sPath );
345 /* SJ: CustomShapes that are available in the gallery are having the highest
346 priority, so we will take a look there before taking the internal default */
348 if ( GalleryExplorer::GetSdrObjCount( GALLERY_THEME_POWERPOINT ) )
350 std::vector< OUString > aObjList;
351 if ( GalleryExplorer::FillObjListTitle( GALLERY_THEME_POWERPOINT, aObjList ) )
353 sal_uInt16 i;
354 for ( i = 0; i < aObjList.size(); i++ )
356 if ( aObjList[ i ].equalsIgnoreAsciiCase( rCustomShape ) )
358 FmFormModel aFormModel;
359 SfxItemPool& rPool = aFormModel.GetItemPool();
360 rPool.FreezeIdRanges();
361 if ( GalleryExplorer::GetSdrObj( GALLERY_THEME_POWERPOINT, i, &aFormModel ) )
363 const SdrObject* pSourceObj = aFormModel.GetPage( 0 )->GetObj( 0 );
364 if( pSourceObj )
366 PropertyValue aPropVal_;
367 const SdrCustomShapeGeometryItem& rSourceGeometry = static_cast<const SdrCustomShapeGeometryItem&>(pSourceObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ));
368 const com::sun::star::uno::Any* pAny = rSourceGeometry.GetPropertyValueByName( sType );
369 if ( pAny )
371 aPropVal_.Name = sType;
372 aPropVal_.Value = *pAny;
373 rGeometryItem.SetPropertyValue( aPropVal_ );
375 pAny = rSourceGeometry.GetPropertyValueByName( sAdjustmentValues );
376 if ( pAny )
378 aPropVal_.Name = sAdjustmentValues;
379 aPropVal_.Value = *pAny;
380 rGeometryItem.SetPropertyValue( aPropVal_ );
382 pAny = rSourceGeometry.GetPropertyValueByName( sCoordinateOrigin );
383 if ( pAny )
385 aPropVal_.Name = sCoordinateOrigin;
386 aPropVal_.Value = *pAny;
387 rGeometryItem.SetPropertyValue( aPropVal_ );
389 pAny = rSourceGeometry.GetPropertyValueByName( sCoordinateSize );
390 if ( pAny )
392 aPropVal_.Name = sCoordinateSize;
393 aPropVal_.Value = *pAny;
394 rGeometryItem.SetPropertyValue( aPropVal_ );
396 pAny = rSourceGeometry.GetPropertyValueByName( sEquations );
397 if ( pAny )
399 aPropVal_.Name = sEquations;
400 aPropVal_.Value = *pAny;
401 rGeometryItem.SetPropertyValue( aPropVal_ );
403 pAny = rSourceGeometry.GetPropertyValueByName( sHandles );
404 if ( pAny )
406 aPropVal_.Name = sHandles;
407 aPropVal_.Value = *pAny;
408 rGeometryItem.SetPropertyValue( aPropVal_ );
410 pAny = rSourceGeometry.GetPropertyValueByName( sPath );
411 if ( pAny )
413 aPropVal_.Name = sPath;
414 aPropVal_.Value = *pAny;
415 rGeometryItem.SetPropertyValue( aPropVal_ );
426 void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBindings )
428 sal_uInt16 nStrResId = 0;
430 sal_uInt16 nSID = rReq.GetSlot();
431 switch( nSID )
433 case SID_FONTWORK_GALLERY_FLOATER:
435 ScopedVclPtrInstance< FontWorkGalleryDialog > aDlg( pSdrView, ImpGetViewWin(pSdrView), nSID );
436 aDlg->Execute();
438 break;
440 case SID_FONTWORK_SHAPE_TYPE:
442 OUString aCustomShape;
443 const SfxItemSet* pArgs = rReq.GetArgs();
444 if ( pArgs )
446 const SfxStringItem& rItm = static_cast<const SfxStringItem&>(pArgs->Get( rReq.GetSlot() ));
447 aCustomShape = rItm.GetValue();
449 if ( !aCustomShape.isEmpty() )
451 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
452 const size_t nCount = rMarkList.GetMarkCount();
453 for( size_t i = 0; i < nCount; ++i )
455 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
456 if( pObj->ISA(SdrObjCustomShape) )
458 const bool bUndo = pSdrView->IsUndoEnabled();
460 if( bUndo )
462 OUString aStr( SVX_RESSTR( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
463 pSdrView->BegUndo( aStr );
464 pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
466 SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )));
467 GetGeometryForCustomShape( aGeometryItem, aCustomShape );
468 pObj->SetMergedItem( aGeometryItem );
470 Reference< drawing::XShape > aXShape = GetXShapeForSdrObject( static_cast<SdrObjCustomShape*>(pObj) );
471 if ( aXShape.is() )
473 Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( aXShape, UNO_QUERY );
474 if( xDefaulter.is() )
475 xDefaulter->createCustomShapeDefaults( aCustomShape );
478 pObj->BroadcastObjectChange();
479 if( bUndo )
480 pSdrView->EndUndo();
481 pSdrView->AdjustMarkHdl(); //HMH sal_True );
482 rBindings.Invalidate( SID_FONTWORK_SHAPE_TYPE );
487 break;
489 case SID_FONTWORK_CHARACTER_SPACING_DIALOG :
491 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
493 sal_Int32 nCharSpacing = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue();
494 ScopedVclPtrInstance< FontworkCharacterSpacingDialog > aDlg( nullptr, nCharSpacing );
495 sal_uInt16 nRet = aDlg->Execute();
496 if( nRet != 0 )
498 SfxInt32Item aItem( SID_FONTWORK_CHARACTER_SPACING, aDlg->getScale() );
499 SfxPoolItem* aItems[] = { &aItem, 0 };
500 rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, (const SfxPoolItem**)aItems );
504 break;
506 case SID_FONTWORK_SHAPE:
507 case SID_FONTWORK_ALIGNMENT:
509 if ( !nStrResId )
510 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT;
511 } // PASSTROUGH
512 case SID_FONTWORK_CHARACTER_SPACING:
514 if ( !nStrResId )
515 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING;
516 } // PASSTROUGH
517 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
519 if ( !nStrResId )
520 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING;
521 } // PASSTROUGH
522 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
524 if ( !nStrResId )
525 nStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT;
527 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
528 const size_t nCount = rMarkList.GetMarkCount();
529 for( size_t i = 0; i < nCount; ++i )
531 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
532 if( pObj->ISA(SdrObjCustomShape) )
534 const bool bUndo = pSdrView->IsUndoEnabled();
535 if( bUndo )
537 OUString aStr( SVX_RESSTR( nStrResId ) );
538 pSdrView->BegUndo( aStr );
539 pSdrView->AddUndo( pSdrView->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj ) );
541 SdrCustomShapeGeometryItem aGeometryItem( static_cast<const SdrCustomShapeGeometryItem&>(pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY )));
542 impl_execute( pSdrView, rReq, aGeometryItem, pObj );
543 pObj->SetMergedItem( aGeometryItem );
544 pObj->BroadcastObjectChange();
545 if( bUndo )
546 pSdrView->EndUndo();
550 break;
554 void FontworkBar::getState( SdrView* pSdrView, SfxItemSet& rSet )
556 sal_uInt32 nCheckStatus = 0;
558 if ( rSet.GetItemState( SID_FONTWORK_ALIGNMENT_FLOATER ) != SfxItemState::UNKNOWN )
560 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
561 rSet.DisableItem( SID_FONTWORK_ALIGNMENT_FLOATER );
563 if ( rSet.GetItemState( SID_FONTWORK_ALIGNMENT ) != SfxItemState::UNKNOWN )
565 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
566 rSet.DisableItem( SID_FONTWORK_ALIGNMENT );
567 else
568 SetAlignmentState( pSdrView, rSet );
570 if ( rSet.GetItemState( SID_FONTWORK_CHARACTER_SPACING_FLOATER ) != SfxItemState::UNKNOWN )
572 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
573 rSet.DisableItem( SID_FONTWORK_CHARACTER_SPACING_FLOATER );
575 if ( rSet.GetItemState( SID_FONTWORK_CHARACTER_SPACING ) != SfxItemState::UNKNOWN )
577 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
578 rSet.DisableItem( SID_FONTWORK_CHARACTER_SPACING );
579 else
580 SetCharacterSpacingState( pSdrView, rSet );
582 if ( rSet.GetItemState( SID_FONTWORK_KERN_CHARACTER_PAIRS ) != SfxItemState::UNKNOWN )
584 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
585 rSet.DisableItem( SID_FONTWORK_KERN_CHARACTER_PAIRS );
586 else
587 SetKernCharacterPairsState( pSdrView, rSet );
589 if ( rSet.GetItemState( SID_FONTWORK_SAME_LETTER_HEIGHTS ) != SfxItemState::UNKNOWN )
591 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
592 rSet.DisableItem( SID_FONTWORK_SAME_LETTER_HEIGHTS );
594 if ( rSet.GetItemState( SID_FONTWORK_SHAPE_TYPE ) != SfxItemState::UNKNOWN )
596 if ( !checkForSelectedFontWork( pSdrView, nCheckStatus ) )
597 rSet.DisableItem( SID_FONTWORK_SHAPE_TYPE );
598 else
599 SetFontWorkShapeTypeState( pSdrView, rSet );
603 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */