LibreOffice Module sw (master) 1
grfsh.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 <cmdid.h>
21#include <hintids.hxx>
22#include <tools/urlobj.hxx>
24#include <svl/stritem.hxx>
25#include <svl/whiter.hxx>
26#include <svl/urihelper.hxx>
27#include <sfx2/bindings.hxx>
28#include <sfx2/docfile.hxx>
29#include <sfx2/objface.hxx>
30#include <sfx2/viewfrm.hxx>
31#include <editeng/sizeitem.hxx>
32#include <sfx2/request.hxx>
33#include <vcl/EnumContext.hxx>
34#include <sfx2/htmlmode.hxx>
35#include <svx/svdview.hxx>
36#include <editeng/brushitem.hxx>
37#include <svx/grfflt.hxx>
39#include <svx/tbxcolor.hxx>
40#include <svx/sdangitm.hxx>
41#include <osl/diagnose.h>
42#include <drawdoc.hxx>
43#include <view.hxx>
44#include <wrtsh.hxx>
45#include <viewopt.hxx>
46#include <swmodule.hxx>
47#include <swundo.hxx>
48#include <uitool.hxx>
49#include <docsh.hxx>
50#include <grfsh.hxx>
51#include <frmmgr.hxx>
52#include <frmfmt.hxx>
53#include <grfatr.hxx>
54#include <swwait.hxx>
55#include <svx/extedit.hxx>
56#include <svx/graphichelper.hxx>
57#include <doc.hxx>
59#include <svx/drawitem.hxx>
60#define ShellClass_SwGrfShell
61
62#include <sfx2/msg.hxx>
63#include <swslots.hxx>
64#include <swabstdlg.hxx>
65#include <unocrsr.hxx>
66#include <flyfrm.hxx>
67#include <memory>
68
69constexpr OUStringLiteral TOOLBOX_NAME = u"colorbar";
70
72 : public ExternalToolEdit
73{
74private:
76 std::shared_ptr<SwUnoCursor> const m_pCursor;
77
78public:
79 explicit SwExternalToolEdit(SwWrtShell *const pShell)
80 : m_pShell(pShell)
81 , m_pCursor( // need only Point, must point to SwGrfNode
82 pShell->GetDoc()->CreateUnoCursor(
83 *pShell->GetCurrentShellCursor().GetPoint()))
84 {
85 }
86
87 virtual void Update(Graphic & rGraphic) override
88 {
90 m_pShell->Push();
93 m_pShell->ReRead(OUString(), OUString(), &rGraphic);
94 m_pShell->Pop();
95 }
96};
97
99
100void SwGrfShell::InitInterface_Impl()
101{
102 GetStaticInterface()->RegisterPopupMenu("graphic");
103
104 GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Grafik_Toolbox);
105}
106
108{
109 SwWrtShell &rSh = GetShell();
110
111 sal_uInt16 nSlot = rReq.GetSlot();
112 switch(nSlot)
113 {
114 case SID_OBJECT_ROTATE:
115 {
116 // RotGrfFlyFrame: start rotation when possible
117 SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
118
119 if(rSh.IsRotationOfSwGrfNodePossible() && pSdrView->IsRotateAllowed())
120 {
121 if(GetView().IsDrawRotate())
122 {
123 rSh.SetDragMode(SdrDragMode::Move);
124 }
125 else
126 {
127 rSh.SetDragMode(SdrDragMode::Rotate);
128 }
129
131 }
132 }
133 break;
134
135 case SID_TWAIN_TRANSFER:
136 {
137 GetView().ExecuteScan( rReq );
138 break;
139 }
140
141 case SID_SAVE_GRAPHIC:
142 {
143 GraphicAttr aGraphicAttr;
144 rSh.GetGraphicAttr(aGraphicAttr);
145
146 short nState = RET_CANCEL;
147 if (aGraphicAttr != GraphicAttr()) // the image has been modified
148 {
150 if (pWin)
151 {
153 }
154 }
155 else
156 {
157 nState = RET_NO;
158 }
159
160 if (nState == RET_YES)
161 {
162 const GraphicObject* pGraphicObj = rSh.GetGraphicObj();
163 if (pGraphicObj)
164 {
165 Graphic aGraphic = pGraphicObj->GetTransformedGraphic(pGraphicObj->GetPrefSize(), pGraphicObj->GetPrefMapMode(), aGraphicAttr);
166 OUString sGrfNm;
167 OUString sFilterNm;
168 rSh.GetGrfNms( &sGrfNm, &sFilterNm );
170 }
171 }
172 else if (nState == RET_NO)
173 {
174 const Graphic *pGraphic = rSh.GetGraphic();
175 if(nullptr != pGraphic)
176 {
177 OUString sGrfNm;
178 OUString sFilterNm;
179 rSh.GetGrfNms( &sGrfNm, &sFilterNm );
180 GraphicHelper::ExportGraphic(GetView().GetFrameWeld(), *pGraphic, sGrfNm);
181 }
182 }
183 }
184 break;
185
186 case SID_COMPRESS_GRAPHIC:
187 {
188 const Graphic* pGraphic = rSh.GetGraphic();
189 if( pGraphic )
190 {
191 Size aSize (
194
196 rSh.GetCurAttr( aSet );
197 SwMirrorGrf aMirror( aSet.Get(RES_GRFATR_MIRRORGRF) );
198 SwCropGrf aCrop( aSet.Get(RES_GRFATR_CROPGRF) );
199
200 tools::Rectangle aCropRectangle(
202 convertTwipToMm100(aCrop.GetTop()),
204 convertTwipToMm100(aCrop.GetBottom()) );
205
206 Graphic aGraphic = *pGraphic;
207
208 CompressGraphicsDialog aDialog(GetView().GetFrameWeld(), std::move(aGraphic), aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings());
209 if (aDialog.run() == RET_OK)
210 {
211 rSh.StartAllAction();
213 tools::Rectangle aScaledCropedRectangle = aDialog.GetScaledCropRectangle();
214
215 aCrop.SetLeft( o3tl::toTwips( aScaledCropedRectangle.Left(), o3tl::Length::mm100 ));
216 aCrop.SetTop( o3tl::toTwips( aScaledCropedRectangle.Top(), o3tl::Length::mm100 ));
217 aCrop.SetRight( o3tl::toTwips( aScaledCropedRectangle.Right(), o3tl::Length::mm100 ));
218 aCrop.SetBottom( o3tl::toTwips( aScaledCropedRectangle.Bottom(), o3tl::Length::mm100 ));
219
220 Graphic aCompressedGraphic( aDialog.GetCompressedGraphic() );
221 rSh.ReRead(OUString(), OUString(), const_cast<const Graphic*>(&aCompressedGraphic));
222
223 rSh.SetAttrItem(aCrop);
224 rSh.SetAttrItem(aMirror);
225
227 rSh.EndAllAction();
228 }
229 }
230 }
231 break;
232 case SID_EXTERNAL_EDIT:
233 {
234 // When the graphic is selected to be opened via some external tool
235 // for advanced editing
236 GraphicObject const*const pGraphicObject(rSh.GetGraphicObj());
237 if(nullptr != pGraphicObject)
238 {
239 m_ExternalEdits.push_back(std::make_unique<SwExternalToolEdit>(
240 &rSh));
241 m_ExternalEdits.back()->Edit(pGraphicObject);
242 }
243 }
244 break;
245 case SID_CHANGE_PICTURE:
246 case SID_INSERT_GRAPHIC:
247 {
248 // #i123922# implement slot independent from the two below to
249 // bring up the insert graphic dialog and associated actions
250 SwView& rLclView = GetView();
251 rReq.SetReturnValue(SfxBoolItem(nSlot, rLclView.InsertGraphicDlg( rReq )));
252 break;
253 }
255 case FN_DRAW_WRAP_DLG:
256 {
257 SwFlyFrameAttrMgr aMgr( false, &rSh, rSh.IsFrameSelected() ?
259 const SwViewOption* pVOpt = rSh.GetViewOptions();
260 SwViewOption aUsrPref( *pVOpt );
261
264 // FillAttribute support:
266 SID_DOCFRAME, SID_DOCFRAME,
267 SID_REFERER, SID_REFERER,
268 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
269 SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, // 10051
270 // RotGrfFlyFrame: Need RotationAngle now
271 SID_ATTR_TRANSFORM_ANGLE, SID_ATTR_TRANSFORM_ANGLE, // 10095
272 // Items to hand over XPropertyList things like
273 // XColorList, XHatchList, XGradientList, and XBitmapList to
274 // the Area TabPage:
275 SID_COLOR_TABLE, SID_PATTERN_LIST, //10179
276 SID_HTML_MODE, SID_HTML_MODE, //10414
277 SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM, //10882
278 SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_GRAPHIC, // 10884
279 // contains SID_ATTR_GRAF_FRMSIZE_PERCENT
285
286 // create needed items for XPropertyList entries from the DrawModel so that
287 // the Area TabPage can access them
289
290 aSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
291 aSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
292 aSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST));
293 aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST));
294 aSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST));
295
296 sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
297 aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
298 FieldUnit eMetric = ::GetDfltMetric(0 != (nHtmlMode&HTMLMODE_ON));
299 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) );
300
301 const SwRect* pRect = &rSh.GetAnyCurRect(CurRectType::Page);
302 SwFormatFrameSize aFrameSize( SwFrameSize::Variable, pRect->Width(), pRect->Height());
303 aFrameSize.SetWhich( GetPool().GetWhich( SID_ATTR_PAGE_SIZE ) );
304 aSet.Put( aFrameSize );
305
306 aSet.Put(SfxStringItem(FN_SET_FRM_NAME, rSh.GetFlyName()));
308 if ( nSlot == FN_FORMAT_GRAFIC_DLG )
309 {
310 // #i73249#
311 aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
312 }
313
315 aFrameSize.SetWidth( pRect->Width() );
316 aFrameSize.SetHeight( pRect->Height() );
317 aFrameSize.SetWhich( GetPool().GetWhich(FN_GET_PRINT_AREA) );
318 aSet.Put( aFrameSize );
319
320 aSet.Put( aMgr.GetAttrSet() );
321 SwFlyFrame* pFly = rSh.GetSelectedFlyFrame();
322 if (pFly)
323 {
324 // Work with the up to date layout size if possible.
325 SwFormatFrameSize aSize = aSet.Get(RES_FRM_SIZE);
326 aSize.SetWidth(pFly->getFrameArea().Width());
327 aSize.SetHeight(pFly->getFrameArea().Height());
328 aSet.Put(aSize);
329 }
330 aSet.SetParent( aMgr.GetAttrSet().GetParent() );
331
332 // At percentage values initialize size
333 SwFormatFrameSize aSizeCopy = aSet.Get(RES_FRM_SIZE);
334 if (aSizeCopy.GetWidthPercent() && aSizeCopy.GetWidthPercent() != SwFormatFrameSize::SYNCED)
336 if (aSizeCopy.GetHeightPercent() && aSizeCopy.GetHeightPercent() != SwFormatFrameSize::SYNCED)
338 // and now set the size for "external" tabpages
339 {
340 SvxSizeItem aSzItm( SID_ATTR_GRAF_FRMSIZE, aSizeCopy.GetSize() );
341 aSet.Put( aSzItm );
342
343 Size aSz( aSizeCopy.GetWidthPercent(), aSizeCopy.GetHeightPercent() );
344 if( SwFormatFrameSize::SYNCED == aSz.Width() ) aSz.setWidth( 0 );
345 if( SwFormatFrameSize::SYNCED == aSz.Height() ) aSz.setHeight( 0 );
346
347 aSzItm.SetSize( aSz );
348 aSzItm.SetWhich( SID_ATTR_GRAF_FRMSIZE_PERCENT );
349 aSet.Put( aSzItm );
350 }
351
352 OUString sGrfNm;
353 OUString sFilterNm;
354 rSh.GetGrfNms( &sGrfNm, &sFilterNm );
355 if( !sGrfNm.isEmpty() )
356 {
357 aSet.Put( SvxBrushItem( INetURLObject::decode( sGrfNm,
359 sFilterNm, GPOS_LT,
360 SID_ATTR_GRAF_GRAPHIC ));
361 }
362 else
363 {
364 // #119353# - robust
365 const GraphicObject* pGrfObj = rSh.GetGraphicObj();
366 if ( pGrfObj )
367 {
368 aSet.Put( SvxBrushItem( *pGrfObj, GPOS_LT,
369 SID_ATTR_GRAF_GRAPHIC ) );
370 }
371 }
372 aSet.Put( SfxBoolItem( FN_PARAM_GRF_CONNECT, !sGrfNm.isEmpty() ) );
373
374 // get Mirror and Crop
375 {
377
378 rSh.GetCurAttr( aTmpSet );
379 aSet.Put( aTmpSet );
380 }
381
382 aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio()));
383 aSet.Put(SfxBoolItem( SID_ATTR_GRAF_KEEP_ZOOM, aUsrPref.IsGrfKeepZoom()));
384
385 aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame()));
386
387 SfxObjectShell * sh = rSh.GetDoc()->GetPersist();
388 if (sh != nullptr && sh->HasName())
389 {
390 aSet.Put(
391 SfxStringItem(SID_REFERER, sh->GetMedium()->GetName()));
392 }
393
394 Size aUnrotatedSize;
395 Degree10 nCurrentRotation;
396 { // RotGrfFlyFrame: Add current RotationAngle value, convert from
397 // RES_GRFATR_ROTATION to SID_ATTR_TRANSFORM_ANGLE. Do not forget to
398 // convert from 10th degrees to 100th degrees
400 rSh.GetCurAttr( aTmpSet );
401 const SwRotationGrf& rRotation = aTmpSet.Get(RES_GRFATR_ROTATION);
402 nCurrentRotation = rRotation.GetValue();
403 aUnrotatedSize = rRotation.GetUnrotatedSize();
404 aSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, to<Degree100>(nCurrentRotation)));
405 }
406
409 GetView().GetViewFrame(),
411 aSet, false));
412 if (nSlot == FN_DRAW_WRAP_DLG)
413 pDlg->SetCurPageId("wrap");
414
415 if (pDlg->Execute() == RET_OK)
416 {
417 rSh.StartAllAction();
419 SfxItemSet* pSet = const_cast<SfxItemSet*>(pDlg->GetOutputItemSet());
420 rReq.Done(*pSet);
421 // change the 2 frmsize SizeItems to the correct SwFrameSizeItem
422 if( const SvxSizeItem* pSizeItem = pSet->GetItemIfSet(
423 SID_ATTR_GRAF_FRMSIZE, false ))
424 {
425 SwFormatFrameSize aSize;
426 const Size& rSz = pSizeItem->GetSize();
427 aSize.SetWidth( rSz.Width() );
428 aSize.SetHeight( rSz.Height() );
429
430 pSizeItem = pSet->GetItemIfSet( SID_ATTR_GRAF_FRMSIZE_PERCENT, false );
431 if( pSizeItem )
432 {
433 const Size& rRelativeSize = pSizeItem->GetSize();
434 aSize.SetWidthPercent( static_cast< sal_uInt8 >( rRelativeSize.Width() ) );
435 aSize.SetHeightPercent( static_cast< sal_uInt8 >( rRelativeSize.Height() ) );
436 }
437 pSet->Put( aSize );
438 }
439
440 // Templates AutoUpdate
441 SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
442 if(pFormat && pFormat->IsAutoUpdateFormat())
443 {
444 pFormat->SetFormatAttr(*pSet);
447 RES_SURROUND, RES_ANCHOR> aShellSet( GetPool() );
448 aShellSet.Put(*pSet);
449 aMgr.SetAttrSet(aShellSet);
450 }
451 else
452 {
453 aMgr.SetAttrSet(*pSet);
454 }
455 aMgr.UpdateFlyFrame();
456
457 bool bApplyUsrPref = false;
458 if (const SfxBoolItem* pRatioItem = pSet->GetItemIfSet(
460 {
461 aUsrPref.SetKeepRatio( pRatioItem->GetValue() );
462 bApplyUsrPref = true;
463 }
464 if( const SfxBoolItem* pZoomItem = pSet->GetItemIfSet(
465 SID_ATTR_GRAF_KEEP_ZOOM ))
466 {
467 aUsrPref.SetGrfKeepZoom( pZoomItem->GetValue() );
468 bApplyUsrPref = true;
469 }
470
471 if( bApplyUsrPref )
472 SW_MOD()->ApplyUsrPref(aUsrPref, &GetView());
473
474 // and now set all the graphic attributes and other stuff
475 if( const SvxBrushItem* pGraphicBrushItem = pSet->GetItemIfSet(
476 SID_ATTR_GRAF_GRAPHIC ))
477 {
478 if( !pGraphicBrushItem->GetGraphicLink().isEmpty() )
479 sGrfNm = pGraphicBrushItem->GetGraphicLink();
480 else
481 sGrfNm.clear();
482
483 if( !pGraphicBrushItem->GetGraphicFilter().isEmpty() )
484 sFilterNm = pGraphicBrushItem->GetGraphicFilter();
485 else
486 sFilterNm.clear();
487
488 if( !sGrfNm.isEmpty() )
489 {
490 SwDocShell* pDocSh = GetView().GetDocShell();
491 SwWait aWait( *pDocSh, true );
492 SfxMedium* pMedium = pDocSh->GetMedium();
493 INetURLObject aAbs;
494 if( pMedium )
495 aAbs = pMedium->GetURLObject();
497 aAbs, sGrfNm,
499 sFilterNm );
500 }
501 }
502 if ( const SfxStringItem* pNameItem = pSet->GetItemIfSet(
504 {
505 // #i73249#
506 rSh.SetObjTitle( pNameItem->GetValue() );
507 }
508
509 if ( const SfxStringItem* pDescriptionItem = pSet->GetItemIfSet(
511 rSh.SetObjDescription( pDescriptionItem->GetValue() );
512
513 // RotGrfFlyFrame: Get and process evtl. changed RotationAngle
514 if ( const SdrAngleItem* pAngleItem = pSet->GetItemIfSet(SID_ATTR_TRANSFORM_ANGLE, false ))
515 {
516 const Degree10 aNewRotation = to<Degree10>(pAngleItem->GetValue() % 36000_deg100);
517
518 // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
519 aMgr.SetRotation(nCurrentRotation, aNewRotation, aUnrotatedSize);
520 }
521
523 aGrfSet.Put( *pSet );
524 if( aGrfSet.Count() )
525 rSh.SetAttrSet( aGrfSet );
526
528 rSh.EndAllAction();
529 }
530 }
531 break;
532
534 {
536 rSh.GetCurAttr( aSet );
538 aGrf.SetGrfToggle(!aGrf.IsGrfToggle());
539 rSh.SetAttrItem(aGrf);
540 }
541 break;
542
543 case SID_OBJECT_CROP:
544 {
545 GraphicObject const *pGraphicObject = rSh.GetGraphicObj();
546 if (nullptr != pGraphicObject && SdrDragMode::Crop != rSh.GetDragMode()) {
547 rSh.StartCropImage();
548 }
549 }
550 break;
551
552 default:
553 OSL_ENSURE(false, "wrong dispatcher");
554 return;
555 }
556}
557
559{
560 GraphicType nGrfType = GraphicType::NONE;
561 if (CNT_GRF == GetShell().GetCntType())
562 nGrfType = GetShell().GetGraphicType();
563 if (GraphicType::Bitmap == nGrfType ||
564 GraphicType::GdiMetafile == nGrfType)
565 {
566 SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END -1> aGrfSet( GetShell().GetAttrPool() );
567 const SfxItemSet *pArgs = rReq.GetArgs();
568 const SfxPoolItem* pItem;
569 sal_uInt16 nSlot = rReq.GetSlot();
570 if( !pArgs || SfxItemState::SET != pArgs->GetItemState( nSlot, false, &pItem ))
571 pItem = nullptr;
572
573 switch( nSlot )
574 {
575 case SID_FLIP_VERTICAL:
576 case SID_FLIP_HORIZONTAL:
577 {
578 GetShell().GetCurAttr( aGrfSet );
579 SwMirrorGrf aMirror( aGrfSet.Get( RES_GRFATR_MIRRORGRF ) );
580 MirrorGraph nMirror = aMirror.GetValue();
581 if ( nSlot==SID_FLIP_HORIZONTAL )
582 switch( nMirror )
583 {
585 break;
587 break;
589 break;
591 break;
592 }
593 else
594 switch( nMirror )
595 {
597 break;
599 break;
601 break;
603 break;
604 }
605 aMirror.SetValue( nMirror );
606 aGrfSet.ClearItem();
607 aGrfSet.Put( aMirror );
608 }
609 break;
610
611 case SID_ATTR_GRAF_LUMINANCE:
612 if( pItem )
613 aGrfSet.Put( SwLuminanceGrf(
614 static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
615 break;
616
617 case SID_ATTR_GRAF_CONTRAST:
618 if( pItem )
619 aGrfSet.Put( SwContrastGrf(
620 static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
621 break;
622
623 case SID_ATTR_GRAF_RED:
624 if( pItem )
625 aGrfSet.Put( SwChannelRGrf(
626 static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
627 break;
628
629 case SID_ATTR_GRAF_GREEN:
630 if( pItem )
631 aGrfSet.Put( SwChannelGGrf(
632 static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
633 break;
634
635 case SID_ATTR_GRAF_BLUE:
636 if( pItem )
637 aGrfSet.Put( SwChannelBGrf(
638 static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
639 break;
640
641 case SID_ATTR_GRAF_GAMMA:
642 if( pItem )
643 {
644 double fVal = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
645 aGrfSet.Put( SwGammaGrf(fVal/100. ));
646 }
647 break;
648
649 case SID_ATTR_GRAF_TRANSPARENCE:
650 if( pItem )
651 aGrfSet.Put( SwTransparencyGrf(
652 static_cast< sal_Int8 >( static_cast<const SfxUInt16Item*>(pItem )->GetValue() ) ) );
653 break;
654
655 case SID_ATTR_GRAF_INVERT:
656 if( pItem )
657 aGrfSet.Put( SwInvertGrf(
658 static_cast<const SfxBoolItem*>(pItem)->GetValue() ));
659 break;
660
661 case SID_ATTR_GRAF_MODE:
662 if( pItem )
663 aGrfSet.Put( SwDrawModeGrf(
664 static_cast<GraphicDrawMode>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ));
665 break;
666
667 case SID_COLOR_SETTINGS:
668 {
669 svx::ToolboxAccess aToolboxAccess( TOOLBOX_NAME );
670 aToolboxAccess.toggleToolbox();
671 break;
672 }
673
674 case SID_GRFFILTER:
675 case SID_GRFFILTER_INVERT:
676 case SID_GRFFILTER_SMOOTH:
677 case SID_GRFFILTER_SHARPEN:
678 case SID_GRFFILTER_REMOVENOISE:
679 case SID_GRFFILTER_SOBEL:
680 case SID_GRFFILTER_MOSAIC:
681 case SID_GRFFILTER_EMBOSS:
682 case SID_GRFFILTER_POSTER:
683 case SID_GRFFILTER_POPART:
684 case SID_GRFFILTER_SEPIA:
685 case SID_GRFFILTER_SOLARIZE:
686 if( GraphicType::Bitmap == nGrfType )
687 {
688 // #119353# - robust
689 const GraphicObject* pFilterObj( GetShell().GetGraphicObj() );
690 if ( pFilterObj )
691 {
692 GraphicObject aFilterObj( *pFilterObj );
693 if( SvxGraphicFilterResult::NONE ==
694 SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ))
695 GetShell().ReRead( OUString(), OUString(),
696 &aFilterObj.GetGraphic() );
697 }
698 }
699 break;
700
701 default:
702 OSL_ENSURE(false, "wrong dispatcher");
703 }
704
705 if( aGrfSet.Count() )
706 GetShell().SetAttrSet( aGrfSet );
707 }
709}
710
712{
713 SwWrtShell &rSh = GetShell();
715 rSh.GetCurAttr( aCoreSet );
717 bool bIsGrfContent = CNT_GRF == GetShell().GetCntType();
718
720
721 SfxWhichIter aIter( rSet );
722 sal_uInt16 nWhich = aIter.FirstWhich();
723 while( nWhich )
724 {
725 bool bDisable = bParentCntProt;
726 switch( nWhich )
727 {
728 case SID_OBJECT_ROTATE:
729 {
730 // RotGrfFlyFrame: steer rotation state
731 const bool bIsRotate(GetView().IsDrawRotate());
732 SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
733
734 if(!bIsRotate && !pSdrView->IsRotateAllowed())
735 {
736 rSet.DisableItem(nWhich);
737 }
738 else
739 {
740 rSet.Put(SfxBoolItem(nWhich, bIsRotate));
741 }
742
743 break;
744 }
745 case SID_INSERT_GRAPHIC:
747 case SID_TWAIN_TRANSFER:
748 if( bParentCntProt || !bIsGrfContent )
749 bDisable = true;
750 else if ( nWhich == SID_INSERT_GRAPHIC
751 && rSh.CursorInsideInputField() )
752 {
753 bDisable = true;
754 }
755 break;
756
757 case SID_SAVE_GRAPHIC:
758 case SID_EXTERNAL_EDIT:
759 if( rSh.GetGraphicType() == GraphicType::NONE || GetObjectShell()->isExportLocked())
760 bDisable = true;
761 break;
762
763 case SID_COLOR_SETTINGS:
764 {
765 if ( bParentCntProt || !bIsGrfContent )
766 bDisable = true;
767 else
768 {
769 svx::ToolboxAccess aToolboxAccess( TOOLBOX_NAME );
770 rSet.Put( SfxBoolItem( nWhich, aToolboxAccess.isToolboxVisible() ) );
771 }
772 break;
773 }
774
775 case SID_FLIP_HORIZONTAL:
776 if( !bParentCntProt )
777 {
778 MirrorGraph nState = aCoreSet.Get(
779 RES_GRFATR_MIRRORGRF ).GetValue();
780
783 }
784 break;
785
786 case SID_FLIP_VERTICAL:
787 if( !bParentCntProt )
788 {
792 }
793 break;
794
795 case SID_ATTR_GRAF_LUMINANCE:
796 if( !bParentCntProt )
797 rSet.Put( SfxInt16Item( nWhich,
798 aCoreSet.Get(RES_GRFATR_LUMINANCE).GetValue() ));
799 break;
800
801 case SID_ATTR_GRAF_CONTRAST:
802 if( !bParentCntProt )
803 rSet.Put( SfxInt16Item( nWhich,
804 aCoreSet.Get(RES_GRFATR_CONTRAST).GetValue() ));
805 break;
806
807 case SID_ATTR_GRAF_RED:
808 if( !bParentCntProt )
809 rSet.Put( SfxInt16Item( nWhich,
810 aCoreSet.Get(RES_GRFATR_CHANNELR).GetValue() ));
811 break;
812
813 case SID_ATTR_GRAF_GREEN:
814 if( !bParentCntProt )
815 rSet.Put( SfxInt16Item( nWhich,
816 aCoreSet.Get(RES_GRFATR_CHANNELG).GetValue() ));
817 break;
818
819 case SID_ATTR_GRAF_BLUE:
820 if( !bParentCntProt )
821 rSet.Put( SfxInt16Item( nWhich,
822 aCoreSet.Get(RES_GRFATR_CHANNELB).GetValue() ));
823 break;
824
825 case SID_ATTR_GRAF_GAMMA:
826 if( !bParentCntProt )
827 rSet.Put( SfxUInt32Item( nWhich, static_cast< sal_uInt32 >(
828 aCoreSet.Get( RES_GRFATR_GAMMA ).GetValue() * 100 ) ) );
829 break;
830
831 case SID_ATTR_GRAF_TRANSPARENCE:
832 if( !bParentCntProt )
833 {
834 // #119353# - robust
835 const GraphicObject* pGrafObj = rSh.GetGraphicObj();
836 if ( pGrafObj )
837 {
838 if( pGrafObj->IsAnimated() ||
839 GraphicType::GdiMetafile == pGrafObj->GetType() )
840 bDisable = true;
841 else
842 rSet.Put( SfxUInt16Item( nWhich,
843 aCoreSet.Get(RES_GRFATR_TRANSPARENCY).GetValue() ));
844 }
845 }
846 break;
847
848 case SID_ATTR_GRAF_INVERT:
849 if( !bParentCntProt )
850 rSet.Put( SfxBoolItem( nWhich,
851 aCoreSet.Get(RES_GRFATR_INVERT).GetValue() ));
852 break;
853
854 case SID_ATTR_GRAF_MODE:
855 if( !bParentCntProt )
856 rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(aCoreSet.Get(RES_GRFATR_DRAWMODE).GetValue()) ));
857 break;
858
859 case SID_GRFFILTER:
860 case SID_GRFFILTER_INVERT:
861 case SID_GRFFILTER_SMOOTH:
862 case SID_GRFFILTER_SHARPEN:
863 case SID_GRFFILTER_REMOVENOISE:
864 case SID_GRFFILTER_SOBEL:
865 case SID_GRFFILTER_MOSAIC:
866 case SID_GRFFILTER_EMBOSS:
867 case SID_GRFFILTER_POSTER:
868 case SID_GRFFILTER_POPART:
869 case SID_GRFFILTER_SEPIA:
870 case SID_GRFFILTER_SOLARIZE:
871 {
872 if( bParentCntProt || !bIsGrfContent )
873 bDisable = true;
874 // #i59688# load graphic only if type is unknown
875 else
876 {
877 const GraphicType eGraphicType( rSh.GetGraphicType() );
878 if ( ( eGraphicType == GraphicType::NONE ||
879 eGraphicType == GraphicType::Default ) &&
880 rSh.IsLinkedGrfSwapOut() )
881 {
882 rSet.DisableItem( nWhich );
883 if( AddGrfUpdateSlot( nWhich ))
884 rSh.GetGraphic(false); // start the loading
885 }
886 else
887 {
888 bDisable = eGraphicType != GraphicType::Bitmap;
889 }
890 }
891 }
892 break;
893
894 case SID_OBJECT_CROP:
895 {
897 if( rSh.GetGraphicType() == GraphicType::NONE )
898 bDisable = true;
899 }
900 break;
901
902 default:
903 bDisable = false;
904 }
905
906 if( bDisable )
907 rSet.DisableItem( nWhich );
908 nWhich = aIter.NextWhich();
909 }
910 SetGetStateSet( nullptr );
911}
912
914{
915 // RotGrfFlyFrame: Modify rotation attribute instead of manipulating the graphic
916 Degree10 aRotation;
917
918 if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_LEFT)
919 {
920 aRotation = 900_deg10;
921 }
922 else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RIGHT)
923 {
924 aRotation = 2700_deg10;
925 }
926 else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180)
927 {
928 aRotation = 1800_deg10;
929 }
930
931 if (rReq.GetSlot() != SID_ROTATE_GRAPHIC_RESET && 0_deg10 == aRotation)
932 return;
933
934 SwWrtShell& rShell = GetShell();
936 rShell.GetCurAttr( aSet );
937 const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
938 SwFlyFrameAttrMgr aMgr(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF, nullptr);
939
940 // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
941 if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RESET)
942 {
943 aMgr.SetRotation(rRotation.GetValue(), 0_deg10, rRotation.GetUnrotatedSize());
944 }
945 else if(0_deg10 != aRotation)
946 {
947 const Degree10 aNewRotation((aRotation + rRotation.GetValue()) % 3600_deg10);
948
949 aMgr.SetRotation(rRotation.GetValue(), aNewRotation, rRotation.GetUnrotatedSize());
950 }
951}
952
954{
955 SwWrtShell& rShell = GetShell();
957
959
960 SfxWhichIter aIterator( rSet );
961 sal_uInt16 nWhich = aIterator.FirstWhich();
962 while( nWhich )
963 {
964 bool bDisable = bIsParentContentProtected;
965 switch( nWhich )
966 {
967 case SID_ROTATE_GRAPHIC_LEFT:
968 case SID_ROTATE_GRAPHIC_RIGHT:
969 case SID_ROTATE_GRAPHIC_180:
970 {
971 if( rShell.GetGraphicType() == GraphicType::NONE )
972 {
973 bDisable = true;
974 }
975 break;
976 }
977 case SID_ROTATE_GRAPHIC_RESET:
978 {
979 // RotGrfFlyFrame: disable when already no rotation
981 rShell.GetCurAttr( aSet );
982 const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
983 bDisable = (0_deg10 == rRotation.GetValue());
984 break;
985 }
986 case SID_ATTR_TRANSFORM_ANGLE:
987 {
988 // RotGrfFlyFrame: get rotation value from RES_GRFATR_ROTATION and copy to rSet as
989 // SID_ATTR_TRANSFORM_ANGLE, convert from 10th degrees to 100th degrees
991 rShell.GetCurAttr( aSet );
992 const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
993 rSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, to<Degree100>(rRotation.GetValue())));
994 break;
995 }
996 default:
997 bDisable = false;
998 }
999
1000 if( bDisable )
1001 rSet.DisableItem( nWhich );
1002 nWhich = aIterator.NextWhich();
1003 }
1004 SetGetStateSet( nullptr );
1005}
1006
1008{
1009}
1010
1012 SwBaseShell(_rView)
1013{
1014 SetName("Graphic");
1016}
1017
1018/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
GraphicDrawMode
constexpr auto convertTwipToMm100(N n)
GPOS_LT
#define GetWhich(nSlot)
tools::Rectangle GetScaledCropRectangle() const
Graphic GetCompressedGraphic()
static OUString ExportGraphic(weld::Window *pWin, const Graphic &rGraphic, const OUString &rGraphicName)
static short HasToSaveTransformedImage(weld::Widget *pWin)
Size GetPrefSize() const
MapMode GetPrefMapMode() const
const Graphic & GetGraphic() const
GraphicType GetType() const
Graphic GetTransformedGraphic(const Size &rDestSize, const MapMode &rDestMap, const GraphicAttr &rAttr) const
bool IsAnimated() const
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
bool IsRotateAllowed(bool b90Deg=false) const
XBitmapListRef GetBitmapList() const
XGradientListRef GetGradientList() const
XPatternListRef GetPatternList() const
XColorListRef GetColorList() const
XHatchListRef GetHatchList() const
void Invalidate(sal_uInt16 nId)
EnumT GetValue() const
void SetValue(EnumT nTheValue)
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
const SfxItemSet * GetParent() const
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)
const INetURLObject & GetURLObject() const
const OUString & GetName() const
bool HasName() const
SfxMedium * GetMedium() const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
void SetReturnValue(const SfxPoolItem &)
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
void SetContextName(const OUString &rsContextName)
SfxViewFrame * GetFrame() const
virtual SfxObjectShell * GetObjectShell()
void SetName(const OUString &rName)
SfxBindings & GetBindings()
weld::Window * GetFrameWeld() const
SfxViewFrame * GetViewFrame() const
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
static SvxGraphicFilterResult ExecuteGrfFilterSlot(SfxRequest const &rReq, GraphicObject &rFilterObject)
void SetTop(sal_Int32 nVal)
void SetLeft(sal_Int32 nVal)
sal_Int32 GetTop() const
sal_Int32 GetRight() const
void SetBottom(sal_Int32 nVal)
void SetRight(sal_Int32 nVal)
sal_Int32 GetLeft() const
sal_Int32 GetBottom() const
void SetHeight(tools::Long n)
const Size & GetSize() const
void SetSize(const Size &rSize)
void SetWidth(tools::Long n)
virtual VclPtr< SfxAbstractTabDialog > CreateFrameTabDialog(const OUString &rDialogType, SfxViewFrame *pFrame, weld::Window *pParent, const SfxItemSet &rCoreSet, bool bNewFrame=true, const OString &sDefPage=OString())=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SwWrtShell & GetShell()
Definition: basesh.cxx:2827
bool AddGrfUpdateSlot(sal_uInt16 nSlot)
Definition: basesh.hxx:61
SwView & GetView()
Definition: basesh.hxx:59
void SetGetStateSet(SfxItemSet *p)
Definition: basesh.hxx:60
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2251
virtual SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:185
bool CursorInsideInputField() const
Definition: crstrvl.cxx:960
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:649
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:161
sal_uInt16 GetCntType() const
Determine form of content. Return Type at CurrentCursor->SPoint.
Definition: edws.cxx:126
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
GraphicType GetGraphicType() const
Definition: editsh.cxx:270
void GetGrfNms(OUString *pGrfName, OUString *pFltName, const SwFlyFrameFormat *=nullptr) const
Returns the name and the filter name of a graphic if the pointer is on a graphic.
Definition: editsh.cxx:304
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:98
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:129
bool IsLinkedGrfSwapOut() const
Definition: editsh.cxx:249
const GraphicAttr * GetGraphicAttr(GraphicAttr &rGA) const
Definition: editsh.cxx:263
const GraphicObject * GetGraphicObj() const
Definition: editsh.cxx:257
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
const Graphic * GetGraphic(bool bWait=true) const
Definition: editsh.cxx:238
void EndAllAction()
Definition: edws.cxx:97
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
Definition: editsh.cxx:294
SwFlyFrame * GetSelectedFlyFrame() const
Definition: fefly1.cxx:277
void SetObjDescription(const OUString &rDescription)
Definition: fefly1.cxx:2026
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2701
SdrDragMode GetDragMode() const
Definition: feshview.cxx:673
OUString GetFlyName() const
Definition: fefly1.cxx:1481
OUString GetObjTitle() const
Definition: fefly1.cxx:1964
void SetObjTitle(const OUString &rTitle)
Definition: fefly1.cxx:1984
bool IsFrameSelected() const
Definition: feshview.cxx:1253
OUString GetObjDescription() const
Definition: fefly1.cxx:2006
bool IsRotationOfSwGrfNodePossible() const
Definition: feshview.cxx:1270
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1213
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:667
const SwRect & GetAnyCurRect(CurRectType eType, const Point *pPt=nullptr, const css::uno::Reference< css::embed::XEmbeddedObject > &=css::uno::Reference< css::embed::XEmbeddedObject >()) const
Definition: fews.cxx:90
void StartCropImage()
Definition: feshview.cxx:683
void SetRotation(Degree10 nOld, Degree10 nNew, const Size &rUnrotatedSize)
Definition: frmmgr.cxx:598
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:619
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
void UpdateFlyFrame()
Definition: frmmgr.cxx:159
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
void SetWidthPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:95
void SetHeightPercent(sal_uInt8 n)
Definition: fmtfsize.hxx:93
sal_uInt8 GetWidthPercent() const
Definition: fmtfsize.hxx:91
sal_uInt8 GetHeightPercent() const
Definition: fmtfsize.hxx:88
bool IsAutoUpdateFormat() const
Query / set bAutoUpdateFormat-flag.
Definition: format.hxx:188
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SwRect & getFrameArea() const
Definition: frame.hxx:179
Style of a layout element.
Definition: frmfmt.hxx:62
std::shared_ptr< SwUnoCursor > const m_pCursor
Definition: grfsh.cxx:76
SwWrtShell *const m_pShell
Definition: grfsh.cxx:75
virtual void Update(Graphic &rGraphic) override
Definition: grfsh.cxx:87
SwExternalToolEdit(SwWrtShell *const pShell)
Definition: grfsh.cxx:79
void Execute(SfxRequest &rRequest)
Definition: grfsh.cxx:107
virtual ~SwGrfShell() override
Definition: grfsh.cxx:1007
SwGrfShell(SwView &rView)
Definition: grfsh.cxx:1011
void GetAttrStateForRotation(SfxItemSet &rRequest)
Definition: grfsh.cxx:953
std::vector< std::unique_ptr< SwExternalToolEdit > > m_ExternalEdits
Definition: grfsh.hxx:32
void GetAttrState(SfxItemSet &rRequest)
Definition: grfsh.cxx:711
void ExecAttr(SfxRequest const &rRequest)
Definition: grfsh.cxx:558
void ExecuteRotation(SfxRequest const &rRequest)
Definition: grfsh.cxx:913
bool IsGrfToggle() const
Definition: grfatr.hxx:65
void SetGrfToggle(bool bNew)
Definition: grfatr.hxx:66
void DeleteMark()
Definition: pam.hxx:231
const SwPosition * GetPoint() const
Definition: pam.hxx:261
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void Height(tools::Long nNew)
Definition: swrect.hxx:193
void Width(tools::Long nNew)
Definition: swrect.hxx:189
const Size & GetUnrotatedSize() const
Definition: grfatr.hxx:108
Degree10 GetValue() const
Definition: grfatr.hxx:109
void SetGrfKeepZoom(bool b)
Definition: viewopt.hxx:664
bool IsKeepRatio() const
Definition: viewopt.hxx:643
void SetKeepRatio(bool b)
Definition: viewopt.hxx:662
bool IsGrfKeepZoom() const
Definition: viewopt.hxx:645
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
SdrView * GetDrawViewWithValidMarkList()
Definition: vnew.cxx:378
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:624
Definition: view.hxx:146
void ExecuteScan(SfxRequest &rReq)
Definition: view2.cxx:3034
void FlipDrawRotate()
Definition: view.hxx:533
SwDocShell * GetDocShell()
Definition: view.cxx:1160
SAL_DLLPRIVATE bool InsertGraphicDlg(SfxRequest &)
Definition: view2.cxx:366
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
bool Pop(SwCursorShell::PopMode, ::std::optional< SwCallLink > &roLink)
Definition: wrtsh1.cxx:2030
const SwView & GetView() const
Definition: wrtsh.hxx:443
void toggleToolbox() const
bool isToolboxVisible() const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
static const OUString & GetContextName(const Context eContext)
#define FN_SET_FRM_ALT_NAME
Definition: cmdid.h:874
#define FN_SET_FRM_NAME
Definition: cmdid.h:871
#define FN_GET_PRINT_AREA
Definition: cmdid.h:756
#define FN_PARAM_GRF_CONNECT
Definition: cmdid.h:804
#define FN_FORMAT_GRAFIC_DLG
Definition: cmdid.h:338
#define FN_KEEP_ASPECT_RATIO
Definition: cmdid.h:872
#define FN_DRAW_WRAP_DLG
Definition: cmdid.h:153
#define FN_GRAPHIC_MIRROR_ON_EVEN_PAGES
Definition: cmdid.h:477
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:876
#define DBG_TESTSOLARMUTEX()
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
virtual SfxBindings & GetBindings() override
float u
#define CNT_GRF
Definition: editsh.hxx:131
sal_Int32 nState
@ Page
Rect of current page.
@ FlyEmbedded
Rect of current FlyFrame.
@ PagePrt
Rect of current PrtArea of page.
@ Parent
Check only parents.
FieldUnit
@ Variable
Frame is variable in Var-direction.
GraphicType
MirrorGraph
Definition: grfatr.hxx:32
constexpr OUStringLiteral TOOLBOX_NAME
Definition: grfsh.cxx:69
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
constexpr TypedWhichId< SwLuminanceGrf > RES_GRFATR_LUMINANCE(136)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr sal_uInt16 RES_GRFATR_BEGIN(RES_FRMATR_END)
constexpr TypedWhichId< SwChannelBGrf > RES_GRFATR_CHANNELB(140)
constexpr TypedWhichId< SwInvertGrf > RES_GRFATR_INVERT(142)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
constexpr TypedWhichId< SwChannelGGrf > RES_GRFATR_CHANNELG(139)
constexpr TypedWhichId< SwContrastGrf > RES_GRFATR_CONTRAST(137)
constexpr TypedWhichId< SwGammaGrf > RES_GRFATR_GAMMA(141)
constexpr TypedWhichId< SwMirrorGrf > RES_GRFATR_MIRRORGRF(RES_GRFATR_BEGIN)
constexpr sal_uInt16 RES_GRFATR_END(150)
constexpr TypedWhichId< SwChannelRGrf > RES_GRFATR_CHANNELR(138)
constexpr TypedWhichId< SwCropGrf > RES_GRFATR_CROPGRF(134)
constexpr TypedWhichId< SwDrawModeGrf > RES_GRFATR_DRAWMODE(144)
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(135)
constexpr TypedWhichId< SwTransparencyGrf > RES_GRFATR_TRANSPARENCY(143)
HTMLMODE_ON
WhichRangesContainer const aNoTextNodeSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_BEGIN, RES_GRFATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1 >)
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
SVL_DLLPUBLIC OUString SmartRel2Abs(INetURLObject const &rTheBaseURIRef, OUString const &rTheRelURIRef, Link< OUString *, bool > const &rMaybeFileHdl=Link< OUString *, bool >(), bool bCheckFileExists=true, bool bIgnoreFragment=false, INetURLObject::EncodeMechanism eEncodeMechanism=INetURLObject::EncodeMechanism::WasEncoded, INetURLObject::DecodeMechanism eDecodeMechanism=INetURLObject::DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8, FSysStyle eStyle=FSysStyle::Detect)
constexpr auto toTwips(N number, Length from)
#define SFX_OBJECTBAR_OBJECT
const char GetValue[]
static SfxItemSet & rSet
#define SFX_IMPL_INTERFACE(Class, SuperClass)
#define SW_MOD()
Definition: swmodule.hxx:256
unsigned char sal_uInt8
signed char sal_Int8
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:755
RET_OK
RET_CANCEL
RET_NO
RET_YES
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:332
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)