LibreOffice Module svx (master) 1
fontworkbar.cxx
Go to the documentation of this file.
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 <svx/svdundo.hxx>
21#include <sfx2/request.hxx>
22#include <sfx2/objface.hxx>
23#include <sfx2/viewsh.hxx>
24#include <svx/unoapi.hxx>
25#include <com/sun/star/drawing/XShape.hpp>
26#include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
27#include <sal/log.hxx>
28#include <svx/dialmgr.hxx>
29#include <svx/svdoashp.hxx>
30#include <svx/strings.hrc>
31#include <svx/svdpage.hxx>
32#include <svx/svdview.hxx>
33#include <svx/sdasitm.hxx>
34#include <svx/gallery.hxx>
35#include <svx/fmmodel.hxx>
36#include <svx/sdtfsitm.hxx>
37#include <svl/itempool.hxx>
38#include <svl/stritem.hxx>
39#include <sfx2/bindings.hxx>
40#include <editeng/eeitem.hxx>
42#include <editeng/kernitem.hxx>
43
44#include <svx/svxids.hrc>
45#include <svx/fontworkbar.hxx>
47
48
49using namespace ::svx;
50using namespace ::cppu;
51using namespace ::com::sun::star;
52using namespace ::com::sun::star::beans;
53using namespace ::com::sun::star::uno;
54
55static void SetAlignmentState( SdrView const * pSdrView, SfxItemSet& rSet )
56{
57 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
58 const size_t nCount = rMarkList.GetMarkCount();
59
60 sal_Int32 nAlignment = -1;
61 for( size_t i = 0; i < nCount; ++i )
62 {
63 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
64 if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr )
65 {
66 sal_Int32 nOldAlignment = nAlignment;
67 const SdrTextHorzAdjustItem& rTextHorzAdjustItem = pObj->GetMergedItem( SDRATTR_TEXT_HORZADJUST );
68 const SdrTextFitToSizeTypeItem& rTextFitToSizeTypeItem = pObj->GetMergedItem( SDRATTR_TEXT_FITTOSIZE );
69 switch ( rTextHorzAdjustItem.GetValue() )
70 {
71 case SDRTEXTHORZADJUST_LEFT : nAlignment = 0; break;
72 case SDRTEXTHORZADJUST_CENTER : nAlignment = 1; break;
73 case SDRTEXTHORZADJUST_RIGHT : nAlignment = 2; break;
75 {
76 auto const fit(rTextFitToSizeTypeItem.GetValue());
77 if (fit == drawing::TextFitToSizeType_NONE)
78 {
79 nAlignment = 3;
80 }
81 else if (fit == drawing::TextFitToSizeType_ALLLINES ||
82 fit == drawing::TextFitToSizeType_PROPORTIONAL)
83 {
84 nAlignment = 4;
85 }
86 }
87 }
88 if ( ( nOldAlignment != -1 ) && ( nOldAlignment != nAlignment ) )
89 {
90 nAlignment = -1;
91 break;
92 }
93 }
94 }
95 rSet.Put( SfxInt32Item( SID_FONTWORK_ALIGNMENT, nAlignment ) );
96}
97
98static void SetCharacterSpacingState( SdrView const * pSdrView, SfxItemSet& rSet )
99{
100 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
101 const size_t nCount = rMarkList.GetMarkCount();
102
103 sal_Int32 nCharacterSpacing = -1;
104 for( size_t i = 0; i < nCount; ++i )
105 {
106 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
107 if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr )
108 {
109 sal_Int32 nOldCharacterSpacing = nCharacterSpacing;
110 const SvxCharScaleWidthItem& rCharScaleWidthItem = pObj->GetMergedItem( EE_CHAR_FONTWIDTH );
111 nCharacterSpacing = rCharScaleWidthItem.GetValue();
112 if ( ( nOldCharacterSpacing != -1 ) && ( nOldCharacterSpacing != nCharacterSpacing ) )
113 {
114 nCharacterSpacing = -1;
115 break;
116 }
117 }
118 }
119 rSet.Put( SfxInt32Item( SID_FONTWORK_CHARACTER_SPACING, nCharacterSpacing ) );
120}
121
122
123static void SetKernCharacterPairsState( SdrView const * pSdrView, SfxItemSet& rSet )
124{
125 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
126 const size_t nCount = rMarkList.GetMarkCount();
127
128 bool bChecked = false;
129 for( size_t i = 0; i < nCount; ++i )
130 {
131 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
132 if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr )
133 {
134 const SvxKerningItem& rKerningItem = pObj->GetMergedItem( EE_CHAR_KERNING );
135 if ( rKerningItem.GetValue() )
136 bChecked = true;
137 }
138 }
139 rSet.Put( SfxBoolItem( SID_FONTWORK_KERN_CHARACTER_PAIRS, bChecked ) );
140}
141
142static void SetFontWorkShapeTypeState( SdrView const * pSdrView, SfxItemSet& rSet )
143{
144 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
145 const size_t nCount = rMarkList.GetMarkCount();
146
147 OUString aFontWorkShapeType;
148
149 for( size_t i = 0; i < nCount; ++i )
150 {
151 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
152 if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr )
153 {
155 const Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
156 if( pAny )
157 {
158 OUString aType;
159 if ( *pAny >>= aType )
160 {
161 if ( !aFontWorkShapeType.isEmpty() )
162 {
163 if ( aFontWorkShapeType != aType ) // different FontWorkShapeTypes selected ?
164 {
165 aFontWorkShapeType.clear();
166 break;
167 }
168 }
169 aFontWorkShapeType = aType;
170 }
171 }
172 }
173 }
174 rSet.Put( SfxStringItem( SID_FONTWORK_SHAPE_TYPE, aFontWorkShapeType ) );
175}
176
177// Declare the default interface. (The slotmap must not be empty, so
178// we enter something which never occurs here (hopefully).)
180{
181 { 0, SfxGroupId::NONE, SfxSlotMode::NONE, 0, 0, nullptr, nullptr, nullptr, nullptr, nullptr, 0, SfxDisableFlags::NONE, "" }
182};
183
184SFX_IMPL_INTERFACE(FontworkBar, SfxShell)
185
186void FontworkBar::InitInterface_Impl()
187{
188 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Svx_Fontwork_Bar);
189}
190
191
192FontworkBar::FontworkBar(SfxViewShell* pViewShell )
193: SfxShell(pViewShell)
194{
195 DBG_ASSERT( pViewShell, "svx::FontworkBar::FontworkBar(), I need a viewshell!" );
196 if( pViewShell )
197 SetPool(&pViewShell->GetPool());
198
199 SetName( SvxResId( RID_SVX_FONTWORK_BAR ));
200}
201
203{
204 SetRepeatTarget(nullptr);
205}
206
207namespace svx {
208bool checkForFontWork( const SdrObject* pObj )
209{
210 static constexpr OUStringLiteral sTextPath = u"TextPath";
211 bool bFound = false;
212
213 if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr )
214 {
216 const Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
217 if( pAny )
218 *pAny >>= bFound;
219 }
220
221 return bFound;
222}
223
224bool checkForSelectedFontWork( SdrView const * pSdrView )
225{
226 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList();
227 const size_t nCount = rMarkList.GetMarkCount();
228 bool bFound = false;
229 for(size_t i=0; (i<nCount) && !bFound ; ++i)
230 {
231 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
232 bFound = checkForFontWork(pObj);
233 }
234 return bFound;
235}
236
237static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj )
238{
239 sal_uInt16 nSID = rReq.GetSlot();
240 switch( nSID )
241 {
242 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
243 {
244 css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "TextPath", "SameLetterHeights" );
245 if( pAny )
246 {
247 bool bOn = false;
248 (*pAny) >>= bOn;
249 bOn = !bOn;
250 css::beans::PropertyValue aPropValue;
251 aPropValue.Name = "SameLetterHeights";
252 aPropValue.Value <<= bOn;
253 rGeometryItem.SetPropertyValue("TextPath", aPropValue);
254 }
255 }
256 break;
257
258 case SID_FONTWORK_ALIGNMENT:
259 {
260 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_FONTWORK_ALIGNMENT ) == SfxItemState::SET )
261 {
262 sal_Int32 nValue = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_ALIGNMENT)->GetValue();
263 if ( ( nValue >= 0 ) && ( nValue < 5 ) )
264 {
265 drawing::TextFitToSizeType eFTS = drawing::TextFitToSizeType_NONE;
266 SdrTextHorzAdjust eHorzAdjust;
267 switch ( nValue )
268 {
269 case 4 : eFTS = drawing::TextFitToSizeType_ALLLINES; [[fallthrough]];
270 case 3 : eHorzAdjust = SDRTEXTHORZADJUST_BLOCK; break;
271 default: eHorzAdjust = SDRTEXTHORZADJUST_LEFT; break;
272 case 1 : eHorzAdjust = SDRTEXTHORZADJUST_CENTER; break;
273 case 2 : eHorzAdjust = SDRTEXTHORZADJUST_RIGHT; break;
274 }
275 pObj->SetMergedItem( SdrTextHorzAdjustItem( eHorzAdjust ) );
277 pObj->BroadcastObjectChange();
278 }
279 }
280 }
281 break;
282
283 case SID_FONTWORK_CHARACTER_SPACING:
284 {
285 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
286 {
287 sal_Int32 nCharSpacing = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_CHARACTER_SPACING)->GetValue();
288 pObj->SetMergedItem( SvxCharScaleWidthItem( static_cast<sal_uInt16>(nCharSpacing), EE_CHAR_FONTWIDTH ) );
289 pObj->BroadcastObjectChange();
290 }
291 }
292 break;
293
294 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
295 {
296 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_KERN_CHARACTER_PAIRS ) == SfxItemState::SET ) )
297 {
298 // sal_Bool bKernCharacterPairs = ((const SfxBoolItem*)rReq.GetArgs()->GetItem(SID_FONTWORK_KERN_CHARACTER_PAIRS))->GetValue();
299//TODO: pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) );
300 pObj->BroadcastObjectChange();
301 }
302 }
303 break;
304 }
305}
306
307static void GetGeometryForCustomShape( SdrCustomShapeGeometryItem& rGeometryItem, const OUString& rCustomShape )
308{
309 static const OUStringLiteral sType( u"Type" );
310
311 css::beans::PropertyValue aPropVal;
312 aPropVal.Name = sType;
313 aPropVal.Value <<= rCustomShape;
314 rGeometryItem.SetPropertyValue( aPropVal );
315
316 static const OUStringLiteral sAdjustmentValues( u"AdjustmentValues" );
317 static const OUStringLiteral sCoordinateOrigin( u"CoordinateOrigin" );
318 static const OUStringLiteral sCoordinateSize( u"CoordinateSize" );
319 static const OUStringLiteral sEquations( u"Equations" );
320 static const OUStringLiteral sHandles( u"Handles" );
321 static const OUStringLiteral sPath( u"Path" );
322 rGeometryItem.ClearPropertyValue( sAdjustmentValues );
323 rGeometryItem.ClearPropertyValue( sCoordinateOrigin );
324 rGeometryItem.ClearPropertyValue( sCoordinateSize );
325 rGeometryItem.ClearPropertyValue( sEquations );
326 rGeometryItem.ClearPropertyValue( sHandles );
327 rGeometryItem.ClearPropertyValue( sPath );
328
329 /* SJ: CustomShapes that are available in the gallery are having the highest
330 priority, so we will take a look there before taking the internal default */
331
333 return;
334
335 std::vector< OUString > aObjList;
337 return;
338
339 for ( std::vector<OUString>::size_type i = 0; i < aObjList.size(); i++ )
340 {
341 if ( aObjList[ i ].equalsIgnoreAsciiCase( rCustomShape ) )
342 {
343 FmFormModel aFormModel;
344 SfxItemPool& rPool(aFormModel.GetItemPool());
345 rPool.FreezeIdRanges();
346
348 {
349 const SdrObject* pSourceObj = nullptr;
350 if (aFormModel.GetPageCount() > 0)
351 pSourceObj = aFormModel.GetPage( 0 )->GetObj( 0 );
352 SAL_WARN_IF(!pSourceObj, "svx.form", "No content in gallery custom shape '" << rCustomShape << "'" );
353 if( pSourceObj )
354 {
355 PropertyValue aPropVal_;
356 const SdrCustomShapeGeometryItem& rSourceGeometry = pSourceObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY );
357 const css::uno::Any* pAny = rSourceGeometry.GetPropertyValueByName( sType );
358 if ( pAny )
359 {
360 aPropVal_.Name = sType;
361 aPropVal_.Value = *pAny;
362 rGeometryItem.SetPropertyValue( aPropVal_ );
363 }
364 pAny = rSourceGeometry.GetPropertyValueByName( sAdjustmentValues );
365 if ( pAny )
366 {
367 aPropVal_.Name = sAdjustmentValues;
368 aPropVal_.Value = *pAny;
369 rGeometryItem.SetPropertyValue( aPropVal_ );
370 }
371 pAny = rSourceGeometry.GetPropertyValueByName( sCoordinateOrigin );
372 if ( pAny )
373 {
374 aPropVal_.Name = sCoordinateOrigin;
375 aPropVal_.Value = *pAny;
376 rGeometryItem.SetPropertyValue( aPropVal_ );
377 }
378 pAny = rSourceGeometry.GetPropertyValueByName( sCoordinateSize );
379 if ( pAny )
380 {
381 aPropVal_.Name = sCoordinateSize;
382 aPropVal_.Value = *pAny;
383 rGeometryItem.SetPropertyValue( aPropVal_ );
384 }
385 pAny = rSourceGeometry.GetPropertyValueByName( sEquations );
386 if ( pAny )
387 {
388 aPropVal_.Name = sEquations;
389 aPropVal_.Value = *pAny;
390 rGeometryItem.SetPropertyValue( aPropVal_ );
391 }
392 pAny = rSourceGeometry.GetPropertyValueByName( sHandles );
393 if ( pAny )
394 {
395 aPropVal_.Name = sHandles;
396 aPropVal_.Value = *pAny;
397 rGeometryItem.SetPropertyValue( aPropVal_ );
398 }
399 pAny = rSourceGeometry.GetPropertyValueByName( sPath );
400 if ( pAny )
401 {
402 aPropVal_.Name = sPath;
403 aPropVal_.Value = *pAny;
404 rGeometryItem.SetPropertyValue( aPropVal_ );
405 }
406 }
407 }
408 }
409 }
410}
411
412
413void FontworkBar::execute( SdrView& rSdrView, SfxRequest const & rReq, SfxBindings& rBindings )
414{
415 TranslateId pStrResId;
416
417 sal_uInt16 nSID = rReq.GetSlot();
418 switch( nSID )
419 {
420 case SID_FONTWORK_GALLERY_FLOATER:
421 {
422 std::shared_ptr<FontWorkGalleryDialog> pDlg = std::make_shared<FontWorkGalleryDialog>(rReq.GetFrameWeld(), rSdrView);
423 weld::DialogController::runAsync(pDlg, [](int){});
424 }
425 break;
426
427 case SID_FONTWORK_SHAPE_TYPE:
428 {
429 OUString aCustomShape;
430 const SfxItemSet* pArgs = rReq.GetArgs();
431 if ( pArgs )
432 {
433 const SfxStringItem& rItm = static_cast<const SfxStringItem&>(pArgs->Get( rReq.GetSlot() ));
434 aCustomShape = rItm.GetValue();
435 }
436 if ( !aCustomShape.isEmpty() )
437 {
438 const SdrMarkList& rMarkList = rSdrView.GetMarkedObjectList();
439 const size_t nCount = rMarkList.GetMarkCount();
440 for( size_t i = 0; i < nCount; ++i )
441 {
442 SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
443 if( auto pCustomShape = dynamic_cast<SdrObjCustomShape*>( pObj) )
444 {
445 const bool bUndo = rSdrView.IsUndoEnabled();
446
447 if( bUndo )
448 {
449 OUString aStr( SvxResId( RID_SVXSTR_UNDO_APPLY_FONTWORK_SHAPE ) );
450 rSdrView.BegUndo(aStr);
451 rSdrView.AddUndo(rSdrView.GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
452 }
454 GetGeometryForCustomShape( aGeometryItem, aCustomShape );
455 pObj->SetMergedItem( aGeometryItem );
456
457 Reference< drawing::XShape > aXShape = GetXShapeForSdrObject( pCustomShape );
458 if ( aXShape.is() )
459 {
460 Reference< drawing::XEnhancedCustomShapeDefaulter > xDefaulter( aXShape, UNO_QUERY );
461 if( xDefaulter.is() )
462 xDefaulter->createCustomShapeDefaults( aCustomShape );
463 }
464
465 pObj->BroadcastObjectChange();
466 if (bUndo)
467 rSdrView.EndUndo();
468 rSdrView.AdjustMarkHdl(); //HMH sal_True );
469 rBindings.Invalidate( SID_FONTWORK_SHAPE_TYPE );
470 }
471 }
472 }
473 }
474 break;
475
476 case SID_FONTWORK_CHARACTER_SPACING_DIALOG :
477 {
478 if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) )
479 {
480 sal_Int32 nCharSpacing = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_CHARACTER_SPACING)->GetValue();
481 FontworkCharacterSpacingDialog aDlg(rReq.GetFrameWeld(), nCharSpacing);
482 sal_uInt16 nRet = aDlg.run();
483 if (nRet != RET_CANCEL)
484 {
485 SfxInt32Item aItem(SID_FONTWORK_CHARACTER_SPACING, aDlg.getScale());
486 SfxPoolItem* aItems[] = { &aItem, nullptr };
487 rBindings.Execute( SID_FONTWORK_CHARACTER_SPACING, const_cast<const SfxPoolItem**>(aItems) );
488 }
489 }
490 }
491 break;
492
493 case SID_FONTWORK_SHAPE:
494 case SID_FONTWORK_ALIGNMENT:
495 {
496 if ( !pStrResId )
497 pStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_ALIGNMENT;
498 [[fallthrough]];
499 }
500 case SID_FONTWORK_CHARACTER_SPACING:
501 {
502 if ( !pStrResId )
503 pStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING;
504 [[fallthrough]];
505 }
506 case SID_FONTWORK_KERN_CHARACTER_PAIRS:
507 {
508 if ( !pStrResId )
509 pStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_CHARACTER_SPACING;
510 [[fallthrough]];
511 }
512 case SID_FONTWORK_SAME_LETTER_HEIGHTS:
513 {
514 if ( !pStrResId )
515 pStrResId = RID_SVXSTR_UNDO_APPLY_FONTWORK_SAME_LETTER_HEIGHT;
516
517 const SdrMarkList& rMarkList = rSdrView.GetMarkedObjectList();
518 const size_t nCount = rMarkList.GetMarkCount();
519 for( size_t i = 0; i < nCount; ++i )
520 {
521 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
522 if( dynamic_cast<const SdrObjCustomShape*>( pObj) != nullptr )
523 {
524 const bool bUndo = rSdrView.IsUndoEnabled();
525 if( bUndo )
526 {
527 OUString aStr( SvxResId( pStrResId ) );
528 rSdrView.BegUndo(aStr);
529 rSdrView.AddUndo(rSdrView.GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
530 }
532 impl_execute( rReq, aGeometryItem, pObj );
533 pObj->SetMergedItem( aGeometryItem );
534 pObj->BroadcastObjectChange();
535 if (bUndo)
536 rSdrView.EndUndo();
537 }
538 }
539 }
540 break;
541 }
542}
543
544void FontworkBar::getState( SdrView const * pSdrView, SfxItemSet& rSet )
545{
546 if ( checkForSelectedFontWork( pSdrView ) )
547 {
548 SetAlignmentState( pSdrView, rSet );
549 SetCharacterSpacingState( pSdrView, rSet );
550 SetKernCharacterPairsState( pSdrView, rSet );
551 SetFontWorkShapeTypeState( pSdrView, rSet );
552 }
553 else
554 {
555 rSet.DisableItem( SID_FONTWORK_ALIGNMENT_FLOATER );
556 rSet.DisableItem( SID_FONTWORK_ALIGNMENT );
557 rSet.DisableItem( SID_FONTWORK_CHARACTER_SPACING_FLOATER );
558 rSet.DisableItem( SID_FONTWORK_CHARACTER_SPACING );
559 rSet.DisableItem( SID_FONTWORK_KERN_CHARACTER_PAIRS );
560 rSet.DisableItem( SID_FONTWORK_SAME_LETTER_HEIGHTS );
561 rSet.DisableItem( SID_FONTWORK_SHAPE_TYPE );
562 }
563}
564}
565
566/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OptionalString sType
const OUString & GetValue() const
static sal_uInt32 GetSdrObjCount(std::u16string_view rThemeName)
Definition: galexpl.cxx:168
static bool FillObjListTitle(const sal_uInt32 nThemeId, std::vector< OUString > &rList)
Definition: galexpl.cxx:85
static bool GetSdrObj(std::u16string_view rThemeName, sal_uInt32 nSdrModelPos, SdrModel *pModel, BitmapEx *pThumb=nullptr)
Definition: galexpl.cxx:197
void SetPropertyValue(const css::beans::PropertyValue &rPropVal)
css::uno::Any * GetPropertyValueByName(const OUString &rPropName)
void ClearPropertyValue(const OUString &rPropertyName)
bool IsUndoEnabled() const
Definition: svdedtv.cxx:1056
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
Definition: svdedtv.hxx:196
void BegUndo()
Definition: svdedtv.hxx:178
void EndUndo()
Definition: svdedtv.cxx:295
size_t GetMarkCount() const
Definition: svdmark.hxx:178
SdrMark * GetMark(size_t nNum) const
Definition: svdmark.cxx:230
const SdrMarkList & GetMarkedObjectList() const
Definition: svdmrkv.hxx:258
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
Definition: svdmrkv.cxx:2609
SdrObject * GetMarkedSdrObj() const
Definition: svdmark.hxx:68
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:318
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
Definition: svdmodel.cxx:1923
const SdrPage * GetPage(sal_uInt16 nPgNum) const
Definition: svdmodel.cxx:1868
sal_uInt16 GetPageCount() const
Definition: svdmodel.cxx:1878
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:784
Abstract DrawObject.
Definition: svdobj.hxx:260
const SfxPoolItem & GetMergedItem(const sal_uInt16 nWhich) const
Definition: svdobj.cxx:1975
void BroadcastObjectChange() const
Definition: svdobj.cxx:984
void SetMergedItem(const SfxPoolItem &rItem)
Definition: svdobj.cxx:1950
SdrModel & GetModel() const
Definition: svdpntv.hxx:259
virtual std::unique_ptr< SdrUndoAction > CreateUndoAttrObject(SdrObject &rObject, bool bStyleSheet1=false, bool bSaveText=false)
Definition: svdundo.cxx:1654
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
void Invalidate(sal_uInt16 nId)
EnumT GetValue() const
void FreezeIdRanges()
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void DisableItem(sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
weld::Window * GetFrameWeld() const
SfxItemPool & GetPool() const
void SetRepeatTarget(SfxRepeatTarget *pTarget)
void SetPool(SfxItemPool *pNewPool)
void SetName(const OUString &rName)
virtual ~FontworkBar() override
static void getState(SdrView const *pSdrView, SfxItemSet &rSet)
static void execute(SdrView &rSdrView, SfxRequest const &rReq, SfxBindings &rBindings)
virtual short run()
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
int nCount
#define DBG_ASSERT(sCon, aError)
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
float u
constexpr TypedWhichId< SvxKerningItem > EE_CHAR_KERNING(EE_CHAR_START+12)
constexpr TypedWhichId< SvxCharScaleWidthItem > EE_CHAR_FONTWIDTH(EE_CHAR_START+3)
std::deque< AttachedObject_Impl > aObjList
sal_Int16 nValue
Definition: fmsrccfg.cxx:81
static void SetAlignmentState(SdrView const *pSdrView, SfxItemSet &rSet)
Definition: fontworkbar.cxx:55
static void SetCharacterSpacingState(SdrView const *pSdrView, SfxItemSet &rSet)
Definition: fontworkbar.cxx:98
static void SetFontWorkShapeTypeState(SdrView const *pSdrView, SfxItemSet &rSet)
static SfxSlot aFontworkBarSlots_Impl[]
static void SetKernCharacterPairsState(SdrView const *pSdrView, SfxItemSet &rSet)
#define GALLERY_THEME_POWERPOINT
Definition: gallery.hxx:32
#define SAL_WARN_IF(condition, area, stream)
aStr
int i
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
static void GetGeometryForCustomShape(SdrCustomShapeGeometryItem &rGeometryItem, const OUString &rCustomShape)
bool checkForFontWork(const SdrObject *pObj)
static void impl_execute(SfxRequest const &rReq, SdrCustomShapeGeometryItem &rGeometryItem, SdrObject *pObj)
bool checkForSelectedFontWork(SdrView const *pSdrView)
#define SFX_OBJECTBAR_OBJECT
const char GetValue[]
SdrTextHorzAdjust
Definition: sdtaitm.hxx:53
@ SDRTEXTHORZADJUST_LEFT
Definition: sdtaitm.hxx:53
@ SDRTEXTHORZADJUST_BLOCK
Definition: sdtaitm.hxx:56
@ SDRTEXTHORZADJUST_CENTER
Definition: sdtaitm.hxx:54
@ SDRTEXTHORZADJUST_RIGHT
Definition: sdtaitm.hxx:55
static SfxItemSet & rSet
#define SFX_IMPL_INTERFACE(Class, SuperClass)
constexpr TypedWhichId< SdrTextFitToSizeTypeItem > SDRATTR_TEXT_FITTOSIZE(SDRATTR_MISC_FIRST+3)
constexpr TypedWhichId< SdrTextHorzAdjustItem > SDRATTR_TEXT_HORZADJUST(SDRATTR_MISC_FIRST+13)
constexpr TypedWhichId< SdrCustomShapeGeometryItem > SDRATTR_CUSTOMSHAPE_GEOMETRY(SDRATTR_CUSTOMSHAPE_FIRST+2)
uno::Reference< drawing::XShape > GetXShapeForSdrObject(SdrObject *pObj) noexcept
returns a StarOffice API wrapper for the given SdrObject
Definition: unoshape.cxx:3998
RET_CANCEL