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