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 constexpr OUStringLiteral 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( o3tl::toTwips( aScaledCropedRectangle.Left(), o3tl::Length::mm100 ));
215  aCrop.SetTop( o3tl::toTwips( aScaledCropedRectangle.Top(), o3tl::Length::mm100 ));
216  aCrop.SetRight( o3tl::toTwips( aScaledCropedRectangle.Right(), o3tl::Length::mm100 ));
217  aCrop.SetBottom( o3tl::toTwips( aScaledCropedRectangle.Bottom(), o3tl::Length::mm100 ));
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 
263  // FillAttribute support:
265  SID_DOCFRAME, SID_DOCFRAME,
266  SID_REFERER, SID_REFERER,
267  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
268  SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, // 10051
269  // RotGrfFlyFrame: Need RotationAngle now
270  SID_ATTR_TRANSFORM_ANGLE, SID_ATTR_TRANSFORM_ANGLE, // 10095
271  // Items to hand over XPropertyList things like
272  // XColorList, XHatchList, XGradientList, and XBitmapList to
273  // the Area TabPage:
274  SID_COLOR_TABLE, SID_PATTERN_LIST, //10179
275  SID_HTML_MODE, SID_HTML_MODE, //10414
276  SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM, //10882
277  SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_GRAPHIC, // 10884
278  // contains SID_ATTR_GRAF_FRMSIZE_PERCENT
284  FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION> aSet( GetPool() );
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()));
307  aSet.Put(SfxStringItem(FN_UNO_DESCRIPTION, rSh.GetObjDescription()));
308  if ( nSlot == FN_FORMAT_GRAFIC_DLG )
309  {
310  // #i73249#
311  aSet.Put( SfxStringItem( FN_SET_FRM_ALT_NAME, rSh.GetObjTitle() ) );
312  }
313 
314  pRect = &rSh.GetAnyCurRect(CurRectType::PagePrt);
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  aSet.SetParent( aMgr.GetAttrSet().GetParent() );
322 
323  // At percentage values initialize size
324  SwFormatFrameSize aSizeCopy = aSet.Get(RES_FRM_SIZE);
325  if (aSizeCopy.GetWidthPercent() && aSizeCopy.GetWidthPercent() != SwFormatFrameSize::SYNCED)
327  if (aSizeCopy.GetHeightPercent() && aSizeCopy.GetHeightPercent() != SwFormatFrameSize::SYNCED)
329  // and now set the size for "external" tabpages
330  {
331  SvxSizeItem aSzItm( SID_ATTR_GRAF_FRMSIZE, aSizeCopy.GetSize() );
332  aSet.Put( aSzItm );
333 
334  Size aSz( aSizeCopy.GetWidthPercent(), aSizeCopy.GetHeightPercent() );
335  if( SwFormatFrameSize::SYNCED == aSz.Width() ) aSz.setWidth( 0 );
336  if( SwFormatFrameSize::SYNCED == aSz.Height() ) aSz.setHeight( 0 );
337 
338  aSzItm.SetSize( aSz );
339  aSzItm.SetWhich( SID_ATTR_GRAF_FRMSIZE_PERCENT );
340  aSet.Put( aSzItm );
341  }
342 
343  OUString sGrfNm;
344  OUString sFilterNm;
345  rSh.GetGrfNms( &sGrfNm, &sFilterNm );
346  if( !sGrfNm.isEmpty() )
347  {
348  aSet.Put( SvxBrushItem( INetURLObject::decode( sGrfNm,
350  sFilterNm, GPOS_LT,
351  SID_ATTR_GRAF_GRAPHIC ));
352  }
353  else
354  {
355  // #119353# - robust
356  const GraphicObject* pGrfObj = rSh.GetGraphicObj();
357  if ( pGrfObj )
358  {
359  aSet.Put( SvxBrushItem( *pGrfObj, GPOS_LT,
360  SID_ATTR_GRAF_GRAPHIC ) );
361  }
362  }
363  aSet.Put( SfxBoolItem( FN_PARAM_GRF_CONNECT, !sGrfNm.isEmpty() ) );
364 
365  // get Mirror and Crop
366  {
368 
369  rSh.GetCurAttr( aTmpSet );
370  aSet.Put( aTmpSet );
371  }
372 
373  aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio()));
374  aSet.Put(SfxBoolItem( SID_ATTR_GRAF_KEEP_ZOOM, aUsrPref.IsGrfKeepZoom()));
375 
376  aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame()));
377 
378  SfxObjectShell * sh = rSh.GetDoc()->GetPersist();
379  if (sh != nullptr && sh->HasName())
380  {
381  aSet.Put(
382  SfxStringItem(SID_REFERER, sh->GetMedium()->GetName()));
383  }
384 
385  Size aUnrotatedSize;
386  Degree10 nCurrentRotation;
387  { // RotGrfFlyFrame: Add current RotationAngle value, convert from
388  // RES_GRFATR_ROTATION to SID_ATTR_TRANSFORM_ANGLE. Do not forget to
389  // convert from 10th degrees to 100th degrees
391  rSh.GetCurAttr( aTmpSet );
392  const SwRotationGrf& rRotation = aTmpSet.Get(RES_GRFATR_ROTATION);
393  nCurrentRotation = rRotation.GetValue();
394  aUnrotatedSize = rRotation.GetUnrotatedSize();
395  aSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, toDegree100(nCurrentRotation)));
396  }
397 
399  ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog("PictureDialog",
400  GetView().GetViewFrame(),
401  GetView().GetFrameWeld(),
402  aSet, false));
403  if (nSlot == FN_DRAW_WRAP_DLG)
404  pDlg->SetCurPageId("wrap");
405 
406  if (pDlg->Execute() == RET_OK)
407  {
408  rSh.StartAllAction();
410  const SfxPoolItem* pItem;
411  SfxItemSet* pSet = const_cast<SfxItemSet*>(pDlg->GetOutputItemSet());
412  rReq.Done(*pSet);
413  // change the 2 frmsize SizeItems to the correct SwFrameSizeItem
414  if( SfxItemState::SET == pSet->GetItemState(
415  SID_ATTR_GRAF_FRMSIZE, false, &pItem ))
416  {
417  SwFormatFrameSize aSize;
418  const Size& rSz = static_cast<const SvxSizeItem*>(pItem)->GetSize();
419  aSize.SetWidth( rSz.Width() );
420  aSize.SetHeight( rSz.Height() );
421 
422  if( SfxItemState::SET == pSet->GetItemState(
423  SID_ATTR_GRAF_FRMSIZE_PERCENT, false, &pItem ))
424  {
425  const Size& rRelativeSize = static_cast<const SvxSizeItem*>(pItem)->GetSize();
426  aSize.SetWidthPercent( static_cast< sal_uInt8 >( rRelativeSize.Width() ) );
427  aSize.SetHeightPercent( static_cast< sal_uInt8 >( rRelativeSize.Height() ) );
428  }
429  pSet->Put( aSize );
430  }
431 
432  // Templates AutoUpdate
433  SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
434  if(pFormat && pFormat->IsAutoUpdateFormat())
435  {
436  pFormat->SetFormatAttr(*pSet);
439  RES_SURROUND, RES_ANCHOR> aShellSet( GetPool() );
440  aShellSet.Put(*pSet);
441  aMgr.SetAttrSet(aShellSet);
442  }
443  else
444  {
445  aMgr.SetAttrSet(*pSet);
446  }
447  aMgr.UpdateFlyFrame();
448 
449  bool bApplyUsrPref = false;
450  if (SfxItemState::SET == pSet->GetItemState(
451  FN_KEEP_ASPECT_RATIO, true, &pItem ))
452  {
453  aUsrPref.SetKeepRatio(
454  static_cast<const SfxBoolItem*>(pItem)->GetValue() );
455  bApplyUsrPref = true;
456  }
457  if( SfxItemState::SET == pSet->GetItemState(
458  SID_ATTR_GRAF_KEEP_ZOOM, true, &pItem ))
459  {
460  aUsrPref.SetGrfKeepZoom(
461  static_cast<const SfxBoolItem*>(pItem)->GetValue() );
462  bApplyUsrPref = true;
463  }
464 
465  if( bApplyUsrPref )
466  SW_MOD()->ApplyUsrPref(aUsrPref, &GetView());
467 
468  // and now set all the graphic attributes and other stuff
469  if( SfxItemState::SET == pSet->GetItemState(
470  SID_ATTR_GRAF_GRAPHIC, true, &pItem ))
471  {
472  if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink().isEmpty() )
473  sGrfNm = static_cast<const SvxBrushItem*>(pItem)->GetGraphicLink();
474  else
475  sGrfNm.clear();
476 
477  if( !static_cast<const SvxBrushItem*>(pItem)->GetGraphicFilter().isEmpty() )
478  sFilterNm = static_cast<const SvxBrushItem*>(pItem)->GetGraphicFilter();
479  else
480  sFilterNm.clear();
481 
482  if( !sGrfNm.isEmpty() )
483  {
484  SwDocShell* pDocSh = GetView().GetDocShell();
485  SwWait aWait( *pDocSh, true );
486  SfxMedium* pMedium = pDocSh->GetMedium();
487  INetURLObject aAbs;
488  if( pMedium )
489  aAbs = pMedium->GetURLObject();
491  aAbs, sGrfNm,
493  sFilterNm );
494  }
495  }
496  if ( SfxItemState::SET == pSet->GetItemState(
497  FN_SET_FRM_ALT_NAME, true, &pItem ))
498  {
499  // #i73249#
500  rSh.SetObjTitle( static_cast<const SfxStringItem*>(pItem)->GetValue() );
501  }
502 
503  if ( SfxItemState::SET == pSet->GetItemState(
504  FN_UNO_DESCRIPTION, true, &pItem ))
505  rSh.SetObjDescription( static_cast<const SfxStringItem*>(pItem)->GetValue() );
506 
507  // RotGrfFlyFrame: Get and process evtl. changed RotationAngle
508  if ( SfxItemState::SET == pSet->GetItemState(SID_ATTR_TRANSFORM_ANGLE, false, &pItem ))
509  {
510  const Degree10 aNewRotation = toDegree10(static_cast<const SdrAngleItem*>(pItem)->GetValue() % 36000_deg100);
511 
512  // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
513  aMgr.SetRotation(nCurrentRotation, aNewRotation, aUnrotatedSize);
514  }
515 
517  aGrfSet.Put( *pSet );
518  if( aGrfSet.Count() )
519  rSh.SetAttrSet( aGrfSet );
520 
521  rSh.EndUndo(SwUndoId::END);
522  rSh.EndAllAction();
523  }
524  }
525  break;
526 
528  {
530  rSh.GetCurAttr( aSet );
531  SwMirrorGrf aGrf(aSet.Get(RES_GRFATR_MIRRORGRF));
532  aGrf.SetGrfToggle(!aGrf.IsGrfToggle());
533  rSh.SetAttrItem(aGrf);
534  }
535  break;
536 
537  case SID_OBJECT_CROP:
538  {
539  GraphicObject const *pGraphicObject = rSh.GetGraphicObj();
540  if (nullptr != pGraphicObject && SdrDragMode::Crop != rSh.GetDragMode()) {
541  rSh.StartCropImage();
542  }
543  }
544  break;
545 
546  default:
547  OSL_ENSURE(false, "wrong dispatcher");
548  return;
549  }
550 }
551 
552 void SwGrfShell::ExecAttr( SfxRequest const &rReq )
553 {
554  GraphicType nGrfType = GraphicType::NONE;
555  if (CNT_GRF == GetShell().GetCntType())
556  nGrfType = GetShell().GetGraphicType();
557  if (GraphicType::Bitmap == nGrfType ||
558  GraphicType::GdiMetafile == nGrfType)
559  {
560  SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END -1> aGrfSet( GetShell().GetAttrPool() );
561  const SfxItemSet *pArgs = rReq.GetArgs();
562  const SfxPoolItem* pItem;
563  sal_uInt16 nSlot = rReq.GetSlot();
564  if( !pArgs || SfxItemState::SET != pArgs->GetItemState( nSlot, false, &pItem ))
565  pItem = nullptr;
566 
567  switch( nSlot )
568  {
569  case SID_FLIP_VERTICAL:
570  case SID_FLIP_HORIZONTAL:
571  {
572  GetShell().GetCurAttr( aGrfSet );
573  SwMirrorGrf aMirror( aGrfSet.Get( RES_GRFATR_MIRRORGRF ) );
574  MirrorGraph nMirror = aMirror.GetValue();
575  if ( nSlot==SID_FLIP_HORIZONTAL )
576  switch( nMirror )
577  {
579  break;
581  break;
583  break;
585  break;
586  }
587  else
588  switch( nMirror )
589  {
591  break;
593  break;
595  break;
597  break;
598  }
599  aMirror.SetValue( nMirror );
600  aGrfSet.ClearItem();
601  aGrfSet.Put( aMirror );
602  }
603  break;
604 
605  case SID_ATTR_GRAF_LUMINANCE:
606  if( pItem )
607  aGrfSet.Put( SwLuminanceGrf(
608  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
609  break;
610 
611  case SID_ATTR_GRAF_CONTRAST:
612  if( pItem )
613  aGrfSet.Put( SwContrastGrf(
614  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
615  break;
616 
617  case SID_ATTR_GRAF_RED:
618  if( pItem )
619  aGrfSet.Put( SwChannelRGrf(
620  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
621  break;
622 
623  case SID_ATTR_GRAF_GREEN:
624  if( pItem )
625  aGrfSet.Put( SwChannelGGrf(
626  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
627  break;
628 
629  case SID_ATTR_GRAF_BLUE:
630  if( pItem )
631  aGrfSet.Put( SwChannelBGrf(
632  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
633  break;
634 
635  case SID_ATTR_GRAF_GAMMA:
636  if( pItem )
637  {
638  double fVal = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
639  aGrfSet.Put( SwGammaGrf(fVal/100. ));
640  }
641  break;
642 
643  case SID_ATTR_GRAF_TRANSPARENCE:
644  if( pItem )
645  aGrfSet.Put( SwTransparencyGrf(
646  static_cast< sal_Int8 >( static_cast<const SfxUInt16Item*>(pItem )->GetValue() ) ) );
647  break;
648 
649  case SID_ATTR_GRAF_INVERT:
650  if( pItem )
651  aGrfSet.Put( SwInvertGrf(
652  static_cast<const SfxBoolItem*>(pItem)->GetValue() ));
653  break;
654 
655  case SID_ATTR_GRAF_MODE:
656  if( pItem )
657  aGrfSet.Put( SwDrawModeGrf(
658  static_cast<GraphicDrawMode>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ));
659  break;
660 
661  case SID_COLOR_SETTINGS:
662  {
663  svx::ToolboxAccess aToolboxAccess( TOOLBOX_NAME );
664  aToolboxAccess.toggleToolbox();
665  break;
666  }
667 
668  case SID_GRFFILTER:
669  case SID_GRFFILTER_INVERT:
670  case SID_GRFFILTER_SMOOTH:
671  case SID_GRFFILTER_SHARPEN:
672  case SID_GRFFILTER_REMOVENOISE:
673  case SID_GRFFILTER_SOBEL:
674  case SID_GRFFILTER_MOSAIC:
675  case SID_GRFFILTER_EMBOSS:
676  case SID_GRFFILTER_POSTER:
677  case SID_GRFFILTER_POPART:
678  case SID_GRFFILTER_SEPIA:
679  case SID_GRFFILTER_SOLARIZE:
680  if( GraphicType::Bitmap == nGrfType )
681  {
682  // #119353# - robust
683  const GraphicObject* pFilterObj( GetShell().GetGraphicObj() );
684  if ( pFilterObj )
685  {
686  GraphicObject aFilterObj( *pFilterObj );
687  if( SvxGraphicFilterResult::NONE ==
688  SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ))
689  GetShell().ReRead( OUString(), OUString(),
690  &aFilterObj.GetGraphic() );
691  }
692  }
693  break;
694 
695  default:
696  OSL_ENSURE(false, "wrong dispatcher");
697  }
698 
699  if( aGrfSet.Count() )
700  GetShell().SetAttrSet( aGrfSet );
701  }
703 }
704 
706 {
707  SwWrtShell &rSh = GetShell();
708  SfxItemSet aCoreSet( GetPool(), aNoTextNodeSetRange );
709  rSh.GetCurAttr( aCoreSet );
711  bool bIsGrfContent = CNT_GRF == GetShell().GetCntType();
712 
713  SetGetStateSet( &rSet );
714 
715  SfxWhichIter aIter( rSet );
716  sal_uInt16 nWhich = aIter.FirstWhich();
717  while( nWhich )
718  {
719  bool bDisable = bParentCntProt;
720  switch( nWhich )
721  {
722  case SID_OBJECT_ROTATE:
723  {
724  // RotGrfFlyFrame: steer rotation state
725  const bool bIsRotate(GetView().IsDrawRotate());
726  SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
727 
728  if(!bIsRotate && !pSdrView->IsRotateAllowed())
729  {
730  rSet.DisableItem(nWhich);
731  }
732  else
733  {
734  rSet.Put(SfxBoolItem(nWhich, bIsRotate));
735  }
736 
737  break;
738  }
739  case SID_INSERT_GRAPHIC:
741  case SID_TWAIN_TRANSFER:
742  if( bParentCntProt || !bIsGrfContent )
743  bDisable = true;
744  else if ( nWhich == SID_INSERT_GRAPHIC
745  && rSh.CursorInsideInputField() )
746  {
747  bDisable = true;
748  }
749  break;
750 
751  case SID_SAVE_GRAPHIC:
752  case SID_EXTERNAL_EDIT:
753  if( rSh.GetGraphicType() == GraphicType::NONE || GetObjectShell()->isExportLocked())
754  bDisable = true;
755  break;
756 
757  case SID_COLOR_SETTINGS:
758  {
759  if ( bParentCntProt || !bIsGrfContent )
760  bDisable = true;
761  else
762  {
763  svx::ToolboxAccess aToolboxAccess( TOOLBOX_NAME );
764  rSet.Put( SfxBoolItem( nWhich, aToolboxAccess.isToolboxVisible() ) );
765  }
766  break;
767  }
768 
769  case SID_FLIP_HORIZONTAL:
770  if( !bParentCntProt )
771  {
772  MirrorGraph nState = aCoreSet.Get(
773  RES_GRFATR_MIRRORGRF ).GetValue();
774 
775  rSet.Put(SfxBoolItem( nWhich, nState == MirrorGraph::Vertical ||
776  nState == MirrorGraph::Both));
777  }
778  break;
779 
780  case SID_FLIP_VERTICAL:
781  if( !bParentCntProt )
782  {
784  rSet.Put(SfxBoolItem( nWhich, nState == MirrorGraph::Horizontal ||
785  nState == MirrorGraph::Both));
786  }
787  break;
788 
789  case SID_ATTR_GRAF_LUMINANCE:
790  if( !bParentCntProt )
791  rSet.Put( SfxInt16Item( nWhich,
792  aCoreSet.Get(RES_GRFATR_LUMINANCE).GetValue() ));
793  break;
794 
795  case SID_ATTR_GRAF_CONTRAST:
796  if( !bParentCntProt )
797  rSet.Put( SfxInt16Item( nWhich,
798  aCoreSet.Get(RES_GRFATR_CONTRAST).GetValue() ));
799  break;
800 
801  case SID_ATTR_GRAF_RED:
802  if( !bParentCntProt )
803  rSet.Put( SfxInt16Item( nWhich,
804  aCoreSet.Get(RES_GRFATR_CHANNELR).GetValue() ));
805  break;
806 
807  case SID_ATTR_GRAF_GREEN:
808  if( !bParentCntProt )
809  rSet.Put( SfxInt16Item( nWhich,
810  aCoreSet.Get(RES_GRFATR_CHANNELG).GetValue() ));
811  break;
812 
813  case SID_ATTR_GRAF_BLUE:
814  if( !bParentCntProt )
815  rSet.Put( SfxInt16Item( nWhich,
816  aCoreSet.Get(RES_GRFATR_CHANNELB).GetValue() ));
817  break;
818 
819  case SID_ATTR_GRAF_GAMMA:
820  if( !bParentCntProt )
821  rSet.Put( SfxUInt32Item( nWhich, static_cast< sal_uInt32 >(
822  aCoreSet.Get( RES_GRFATR_GAMMA ).GetValue() * 100 ) ) );
823  break;
824 
825  case SID_ATTR_GRAF_TRANSPARENCE:
826  if( !bParentCntProt )
827  {
828  // #119353# - robust
829  const GraphicObject* pGrafObj = rSh.GetGraphicObj();
830  if ( pGrafObj )
831  {
832  if( pGrafObj->IsAnimated() ||
833  GraphicType::GdiMetafile == pGrafObj->GetType() )
834  bDisable = true;
835  else
836  rSet.Put( SfxUInt16Item( nWhich,
837  aCoreSet.Get(RES_GRFATR_TRANSPARENCY).GetValue() ));
838  }
839  }
840  break;
841 
842  case SID_ATTR_GRAF_INVERT:
843  if( !bParentCntProt )
844  rSet.Put( SfxBoolItem( nWhich,
845  aCoreSet.Get(RES_GRFATR_INVERT).GetValue() ));
846  break;
847 
848  case SID_ATTR_GRAF_MODE:
849  if( !bParentCntProt )
850  rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(aCoreSet.Get(RES_GRFATR_DRAWMODE).GetValue()) ));
851  break;
852 
853  case SID_GRFFILTER:
854  case SID_GRFFILTER_INVERT:
855  case SID_GRFFILTER_SMOOTH:
856  case SID_GRFFILTER_SHARPEN:
857  case SID_GRFFILTER_REMOVENOISE:
858  case SID_GRFFILTER_SOBEL:
859  case SID_GRFFILTER_MOSAIC:
860  case SID_GRFFILTER_EMBOSS:
861  case SID_GRFFILTER_POSTER:
862  case SID_GRFFILTER_POPART:
863  case SID_GRFFILTER_SEPIA:
864  case SID_GRFFILTER_SOLARIZE:
865  {
866  if( bParentCntProt || !bIsGrfContent )
867  bDisable = true;
868  // #i59688# load graphic only if type is unknown
869  else
870  {
871  const GraphicType eGraphicType( rSh.GetGraphicType() );
872  if ( ( eGraphicType == GraphicType::NONE ||
873  eGraphicType == GraphicType::Default ) &&
874  rSh.IsLinkedGrfSwapOut() )
875  {
876  rSet.DisableItem( nWhich );
877  if( AddGrfUpdateSlot( nWhich ))
878  rSh.GetGraphic(false); // start the loading
879  }
880  else
881  {
882  bDisable = eGraphicType != GraphicType::Bitmap;
883  }
884  }
885  }
886  break;
887 
888  case SID_OBJECT_CROP:
889  {
891  if( rSh.GetGraphicType() == GraphicType::NONE )
892  bDisable = true;
893  }
894  break;
895 
896  default:
897  bDisable = false;
898  }
899 
900  if( bDisable )
901  rSet.DisableItem( nWhich );
902  nWhich = aIter.NextWhich();
903  }
904  SetGetStateSet( nullptr );
905 }
906 
908 {
909  // RotGrfFlyFrame: Modify rotation attribute instead of manipulating the graphic
910  Degree10 aRotation;
911 
912  if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_LEFT)
913  {
914  aRotation = 900_deg10;
915  }
916  else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RIGHT)
917  {
918  aRotation = 2700_deg10;
919  }
920  else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180)
921  {
922  aRotation = 1800_deg10;
923  }
924 
925  if (rReq.GetSlot() != SID_ROTATE_GRAPHIC_RESET && 0_deg10 == aRotation)
926  return;
927 
928  SwWrtShell& rShell = GetShell();
930  rShell.GetCurAttr( aSet );
931  const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
932  SwFlyFrameAttrMgr aMgr(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF, nullptr);
933 
934  // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
935  if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RESET)
936  {
937  aMgr.SetRotation(rRotation.GetValue(), 0_deg10, rRotation.GetUnrotatedSize());
938  }
939  else if(0_deg10 != aRotation)
940  {
941  const Degree10 aNewRotation((aRotation + rRotation.GetValue()) % 3600_deg10);
942 
943  aMgr.SetRotation(rRotation.GetValue(), aNewRotation, rRotation.GetUnrotatedSize());
944  }
945 }
946 
948 {
949  SwWrtShell& rShell = GetShell();
950  bool bIsParentContentProtected = FlyProtectFlags::NONE != rShell.IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent );
951 
952  SetGetStateSet( &rSet );
953 
954  SfxWhichIter aIterator( rSet );
955  sal_uInt16 nWhich = aIterator.FirstWhich();
956  while( nWhich )
957  {
958  bool bDisable = bIsParentContentProtected;
959  switch( nWhich )
960  {
961  case SID_ROTATE_GRAPHIC_LEFT:
962  case SID_ROTATE_GRAPHIC_RIGHT:
963  case SID_ROTATE_GRAPHIC_180:
964  {
965  if( rShell.GetGraphicType() == GraphicType::NONE )
966  {
967  bDisable = true;
968  }
969  break;
970  }
971  case SID_ROTATE_GRAPHIC_RESET:
972  {
973  // RotGrfFlyFrame: disable when already no rotation
975  rShell.GetCurAttr( aSet );
976  const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
977  bDisable = (0_deg10 == rRotation.GetValue());
978  break;
979  }
980  case SID_ATTR_TRANSFORM_ANGLE:
981  {
982  // RotGrfFlyFrame: get rotation value from RES_GRFATR_ROTATION and copy to rSet as
983  // SID_ATTR_TRANSFORM_ANGLE, convert from 10th degrees to 100th degrees
985  rShell.GetCurAttr( aSet );
986  const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
987  rSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, toDegree100(rRotation.GetValue())));
988  break;
989  }
990  default:
991  bDisable = false;
992  }
993 
994  if( bDisable )
995  rSet.DisableItem( nWhich );
996  nWhich = aIterator.NextWhich();
997  }
998  SetGetStateSet( nullptr );
999 }
1000 
1002 {
1003 }
1004 
1006  SwBaseShell(_rView)
1007 {
1008  SetName("Graphic");
1010 }
1011 
1012 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
void DeleteMark()
Definition: pam.hxx:178
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
static short HasToSaveTransformedImage(weld::Widget *pWin)
FieldUnit
Rect of current FlyFrame.
SwView & GetView()
Definition: basesh.hxx:59
#define SFX_IMPL_INTERFACE(Class, SuperClass)
bool IsRotationOfSwGrfNodePossible() const
Definition: feshview.cxx:1265
void SetHeight(tools::Long n)
constexpr auto toTwips(N number, Length from)
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:1001
void SetGrfToggle(bool bNew)
Definition: grfatr.hxx:66
std::string GetValue
#define FN_PARAM_GRF_CONNECT
Definition: cmdid.h:785
constexpr tools::Long Left() const
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:2773
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:1843
#define FN_SET_FRM_ALT_NAME
Definition: cmdid.h:858
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:947
constexpr TypedWhichId< SwContrastGrf > RES_GRFATR_CONTRAST(137)
const Size & GetUnrotatedSize() const
Definition: grfatr.hxx:108
void ExecuteScan(SfxRequest &rReq)
Definition: view2.cxx:2755
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
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()
XPatternListRef GetPatternList() const
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:93
RET_NO
constexpr tools::Long Width() const
Degree100 toDegree100(Degree10 x)
const SwView & GetView() const
Definition: wrtsh.hxx:431
RET_YES
constexpr sal_uInt16 RES_GRFATR_END(150)
Degree10 toDegree10(Degree100 x)
void SetGetStateSet(SfxItemSet *p)
Definition: basesh.hxx:60
void Width(tools::Long nNew)
Definition: swrect.hxx:189
Size GetPrefSize() const
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
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:907
constexpr TypedWhichId< SwChannelBGrf > RES_GRFATR_CHANNELB(140)
constexpr void SetLeft(tools::Long v)
OUString GetObjTitle() const
Definition: fefly1.cxx:1966
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:2028
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:860
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:613
Style of a layout element.
Definition: frmfmt.hxx:59
Rect of current PrtArea of page.
#define SW_MOD()
Definition: swmodule.hxx:256
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:763
GraphicType GetGraphicType() const
Definition: editsh.cxx:271
#define FN_KEEP_ASPECT_RATIO
Definition: cmdid.h:856
const SwPosition * GetPoint() const
Definition: pam.hxx:208
SVL_DLLPUBLIC Link< OUString *, bool > const & GetMaybeFileHdl()
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2239
constexpr TypedWhichId< SwCropGrf > RES_GRFATR_CROPGRF(134)
#define FN_PARAM_GRF_DIALOG
Definition: cmdid.h:791
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 SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:185
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 tools::Long Right() const
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
#define FN_GRAPHIC_MIRROR_ON_EVEN_PAGES
Definition: cmdid.h:460
XGradientListRef GetGradientList() const
float u
constexpr tools::Long Top() const
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
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:2683
GraphicType GetType() const
SwDocShell * GetDocShell()
Definition: view.cxx:1127
#define FN_GET_PRINT_AREA
Definition: cmdid.h:736
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:1215
constexpr tools::Long Bottom() const
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
XHatchListRef GetHatchList() const
void DisableItem(sal_uInt16 nWhich)
weld::Window * GetFrameWeld() const
SwGrfShell(SwView &rView)
Definition: grfsh.cxx:1005
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:424
constexpr TypedWhichId< SwInvertGrf > RES_GRFATR_INVERT(142)
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 >)
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:378
#define FN_SET_FRM_NAME
Definition: cmdid.h:855
bool IsGrfKeepZoom() const
Definition: viewopt.hxx:537
constexpr TypedWhichId< SwDrawModeGrf > RES_GRFATR_DRAWMODE(144)
RET_OK
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:639
const INetURLObject & GetURLObject() const
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
constexpr OUStringLiteral TOOLBOX_NAME
Definition: grfsh.cxx:68
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:661
XBitmapListRef GetBitmapList() const
SAL_DLLPRIVATE bool InsertGraphicDlg(SfxRequest &)
Definition: view2.cxx:298
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:1986
#define DBG_TESTSOLARMUTEX()
bool IsAnimated() const
XColorListRef GetColorList() const
const GraphicAttr * GetGraphicAttr(GraphicAttr &rGA) const
Definition: editsh.cxx:264
Frame is variable in Var-direction.
OUString GetObjDescription() const
Definition: fefly1.cxx:2008
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:193
sal_Int32 nState
void SetContextName(const OUString &rsContextName)
constexpr sal_uInt16 RES_FRMATR_BEGIN(RES_PARATR_LIST_END)
OUString GetFlyName() const
Definition: fefly1.cxx:1483
bool IsFrameSelected() const
Definition: feshview.cxx:1248
void ExecAttr(SfxRequest const &rRequest)
Definition: grfsh.cxx:552
#define FN_DRAW_WRAP_DLG
Definition: cmdid.h:149
virtual SfxObjectShell * GetObjectShell()
void SetRotation(Degree10 nOld, Degree10 nNew, const Size &rUnrotatedSize)
Definition: frmmgr.cxx:600
Definition: view.hxx:144
const Size & GetSize() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
void GetAttrState(SfxItemSet &rRequest)
Definition: grfsh.cxx:705
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:950
constexpr TypedWhichId< SwGammaGrf > RES_GRFATR_GAMMA(141)
SfxMedium * GetMedium() const