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