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 <flyfrm.hxx>
67 #include <memory>
68 
69 constexpr OUStringLiteral TOOLBOX_NAME = u"colorbar";
70 
72  : public ExternalToolEdit
73 {
74 private:
76  std::shared_ptr<SwUnoCursor> const m_pCursor;
77 
78 public:
79  explicit SwExternalToolEdit(SwWrtShell *const pShell)
80  : m_pShell(pShell)
81  , m_pCursor( // need only Point, must point to SwGrfNode
82  pShell->GetDoc()->CreateUnoCursor(
83  *pShell->GetCurrentShellCursor().GetPoint()))
84  {
85  }
86 
87  virtual void Update(Graphic & rGraphic) override
88  {
90  m_pShell->Push();
91  m_pShell->GetCurrentShellCursor().DeleteMark();
92  *m_pShell->GetCurrentShellCursor().GetPoint() = *m_pCursor->GetPoint();
93  m_pShell->ReRead(OUString(), OUString(), &rGraphic);
94  m_pShell->Pop();
95  }
96 };
97 
99 
100 void SwGrfShell::InitInterface_Impl()
101 {
102  GetStaticInterface()->RegisterPopupMenu("graphic");
103 
104  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_OBJECT, SfxVisibilityFlags::Invisible, ToolbarId::Grafik_Toolbox);
105 }
106 
108 {
109  SwWrtShell &rSh = GetShell();
110 
111  sal_uInt16 nSlot = rReq.GetSlot();
112  switch(nSlot)
113  {
114  case SID_OBJECT_ROTATE:
115  {
116  // RotGrfFlyFrame: start rotation when possible
117  SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
118 
119  if(rSh.IsRotationOfSwGrfNodePossible() && pSdrView->IsRotateAllowed())
120  {
121  if(GetView().IsDrawRotate())
122  {
123  rSh.SetDragMode(SdrDragMode::Move);
124  }
125  else
126  {
127  rSh.SetDragMode(SdrDragMode::Rotate);
128  }
129 
131  }
132  }
133  break;
134 
135  case SID_TWAIN_TRANSFER:
136  {
137  GetView().ExecuteScan( rReq );
138  break;
139  }
140 
141  case SID_SAVE_GRAPHIC:
142  {
143  GraphicAttr aGraphicAttr;
144  rSh.GetGraphicAttr(aGraphicAttr);
145 
146  short nState = RET_CANCEL;
147  if (aGraphicAttr != GraphicAttr()) // the image has been modified
148  {
149  weld::Window* pWin = GetView().GetFrameWeld();
150  if (pWin)
151  {
153  }
154  }
155  else
156  {
157  nState = RET_NO;
158  }
159 
160  if (nState == RET_YES)
161  {
162  const GraphicObject* pGraphicObj = rSh.GetGraphicObj();
163  if (pGraphicObj)
164  {
165  Graphic aGraphic = pGraphicObj->GetTransformedGraphic(pGraphicObj->GetPrefSize(), pGraphicObj->GetPrefMapMode(), aGraphicAttr);
166  OUString sGrfNm;
167  OUString sFilterNm;
168  rSh.GetGrfNms( &sGrfNm, &sFilterNm );
169  GraphicHelper::ExportGraphic(GetView().GetFrameWeld(), aGraphic, sGrfNm);
170  }
171  }
172  else if (nState == RET_NO)
173  {
174  const Graphic *pGraphic = rSh.GetGraphic();
175  if(nullptr != pGraphic)
176  {
177  OUString sGrfNm;
178  OUString sFilterNm;
179  rSh.GetGrfNms( &sGrfNm, &sFilterNm );
180  GraphicHelper::ExportGraphic(GetView().GetFrameWeld(), *pGraphic, sGrfNm);
181  }
182  }
183  }
184  break;
185 
186  case SID_COMPRESS_GRAPHIC:
187  {
188  const Graphic* pGraphic = rSh.GetGraphic();
189  if( pGraphic )
190  {
191  Size aSize (
194 
196  rSh.GetCurAttr( aSet );
197  SwMirrorGrf aMirror( aSet.Get(RES_GRFATR_MIRRORGRF) );
198  SwCropGrf aCrop( aSet.Get(RES_GRFATR_CROPGRF) );
199 
200  tools::Rectangle aCropRectangle(
201  convertTwipToMm100(aCrop.GetLeft()),
202  convertTwipToMm100(aCrop.GetTop()),
203  convertTwipToMm100(aCrop.GetRight()),
204  convertTwipToMm100(aCrop.GetBottom()) );
205 
206  Graphic aGraphic = *pGraphic;
207 
208  CompressGraphicsDialog aDialog(GetView().GetFrameWeld(), aGraphic, aSize, aCropRectangle, GetView().GetViewFrame()->GetBindings());
209  if (aDialog.run() == RET_OK)
210  {
211  rSh.StartAllAction();
213  tools::Rectangle aScaledCropedRectangle = aDialog.GetScaledCropRectangle();
214 
215  aCrop.SetLeft( o3tl::toTwips( aScaledCropedRectangle.Left(), o3tl::Length::mm100 ));
216  aCrop.SetTop( o3tl::toTwips( aScaledCropedRectangle.Top(), o3tl::Length::mm100 ));
217  aCrop.SetRight( o3tl::toTwips( aScaledCropedRectangle.Right(), o3tl::Length::mm100 ));
218  aCrop.SetBottom( o3tl::toTwips( aScaledCropedRectangle.Bottom(), o3tl::Length::mm100 ));
219 
220  Graphic aCompressedGraphic( aDialog.GetCompressedGraphic() );
221  rSh.ReRead(OUString(), OUString(), const_cast<const Graphic*>(&aCompressedGraphic));
222 
223  rSh.SetAttrItem(aCrop);
224  rSh.SetAttrItem(aMirror);
225 
226  rSh.EndUndo(SwUndoId::END);
227  rSh.EndAllAction();
228  }
229  }
230  }
231  break;
232  case SID_EXTERNAL_EDIT:
233  {
234  // When the graphic is selected to be opened via some external tool
235  // for advanced editing
236  GraphicObject const*const pGraphicObject(rSh.GetGraphicObj());
237  if(nullptr != pGraphicObject)
238  {
239  m_ExternalEdits.push_back(std::make_unique<SwExternalToolEdit>(
240  &rSh));
241  m_ExternalEdits.back()->Edit(pGraphicObject);
242  }
243  }
244  break;
245  case SID_CHANGE_PICTURE:
246  case SID_INSERT_GRAPHIC:
247  {
248  // #i123922# implement slot independent from the two below to
249  // bring up the insert graphic dialog and associated actions
250  SwView& rLclView = GetView();
251  rReq.SetReturnValue(SfxBoolItem(nSlot, rLclView.InsertGraphicDlg( rReq )));
252  break;
253  }
255  case FN_DRAW_WRAP_DLG:
256  {
257  SwFlyFrameAttrMgr aMgr( false, &rSh, rSh.IsFrameSelected() ?
259  const SwViewOption* pVOpt = rSh.GetViewOptions();
260  SwViewOption aUsrPref( *pVOpt );
261 
264  // FillAttribute support:
266  SID_DOCFRAME, SID_DOCFRAME,
267  SID_REFERER, SID_REFERER,
268  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
269  SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, // 10051
270  // RotGrfFlyFrame: Need RotationAngle now
271  SID_ATTR_TRANSFORM_ANGLE, SID_ATTR_TRANSFORM_ANGLE, // 10095
272  // Items to hand over XPropertyList things like
273  // XColorList, XHatchList, XGradientList, and XBitmapList to
274  // the Area TabPage:
275  SID_COLOR_TABLE, SID_PATTERN_LIST, //10179
276  SID_HTML_MODE, SID_HTML_MODE, //10414
277  SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM, //10882
278  SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_GRAPHIC, // 10884
279  // contains SID_ATTR_GRAF_FRMSIZE_PERCENT
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  SwFlyFrame* pFly = rSh.GetSelectedFlyFrame();
322  if (pFly)
323  {
324  // Work with the up to date layout size if possible.
325  SwFormatFrameSize aSize = aSet.Get(RES_FRM_SIZE);
326  aSize.SetWidth(pFly->getFrameArea().Width());
327  aSize.SetHeight(pFly->getFrameArea().Height());
328  aSet.Put(aSize);
329  }
330  aSet.SetParent( aMgr.GetAttrSet().GetParent() );
331 
332  // At percentage values initialize size
333  SwFormatFrameSize aSizeCopy = aSet.Get(RES_FRM_SIZE);
334  if (aSizeCopy.GetWidthPercent() && aSizeCopy.GetWidthPercent() != SwFormatFrameSize::SYNCED)
336  if (aSizeCopy.GetHeightPercent() && aSizeCopy.GetHeightPercent() != SwFormatFrameSize::SYNCED)
338  // and now set the size for "external" tabpages
339  {
340  SvxSizeItem aSzItm( SID_ATTR_GRAF_FRMSIZE, aSizeCopy.GetSize() );
341  aSet.Put( aSzItm );
342 
343  Size aSz( aSizeCopy.GetWidthPercent(), aSizeCopy.GetHeightPercent() );
344  if( SwFormatFrameSize::SYNCED == aSz.Width() ) aSz.setWidth( 0 );
345  if( SwFormatFrameSize::SYNCED == aSz.Height() ) aSz.setHeight( 0 );
346 
347  aSzItm.SetSize( aSz );
348  aSzItm.SetWhich( SID_ATTR_GRAF_FRMSIZE_PERCENT );
349  aSet.Put( aSzItm );
350  }
351 
352  OUString sGrfNm;
353  OUString sFilterNm;
354  rSh.GetGrfNms( &sGrfNm, &sFilterNm );
355  if( !sGrfNm.isEmpty() )
356  {
357  aSet.Put( SvxBrushItem( INetURLObject::decode( sGrfNm,
359  sFilterNm, GPOS_LT,
360  SID_ATTR_GRAF_GRAPHIC ));
361  }
362  else
363  {
364  // #119353# - robust
365  const GraphicObject* pGrfObj = rSh.GetGraphicObj();
366  if ( pGrfObj )
367  {
368  aSet.Put( SvxBrushItem( *pGrfObj, GPOS_LT,
369  SID_ATTR_GRAF_GRAPHIC ) );
370  }
371  }
372  aSet.Put( SfxBoolItem( FN_PARAM_GRF_CONNECT, !sGrfNm.isEmpty() ) );
373 
374  // get Mirror and Crop
375  {
377 
378  rSh.GetCurAttr( aTmpSet );
379  aSet.Put( aTmpSet );
380  }
381 
382  aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio()));
383  aSet.Put(SfxBoolItem( SID_ATTR_GRAF_KEEP_ZOOM, aUsrPref.IsGrfKeepZoom()));
384 
385  aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame()));
386 
387  SfxObjectShell * sh = rSh.GetDoc()->GetPersist();
388  if (sh != nullptr && sh->HasName())
389  {
390  aSet.Put(
391  SfxStringItem(SID_REFERER, sh->GetMedium()->GetName()));
392  }
393 
394  Size aUnrotatedSize;
395  Degree10 nCurrentRotation;
396  { // RotGrfFlyFrame: Add current RotationAngle value, convert from
397  // RES_GRFATR_ROTATION to SID_ATTR_TRANSFORM_ANGLE. Do not forget to
398  // convert from 10th degrees to 100th degrees
400  rSh.GetCurAttr( aTmpSet );
401  const SwRotationGrf& rRotation = aTmpSet.Get(RES_GRFATR_ROTATION);
402  nCurrentRotation = rRotation.GetValue();
403  aUnrotatedSize = rRotation.GetUnrotatedSize();
404  aSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, to<Degree100>(nCurrentRotation)));
405  }
406 
408  ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateFrameTabDialog("PictureDialog",
409  GetView().GetViewFrame(),
410  GetView().GetFrameWeld(),
411  aSet, false));
412  if (nSlot == FN_DRAW_WRAP_DLG)
413  pDlg->SetCurPageId("wrap");
414 
415  if (pDlg->Execute() == RET_OK)
416  {
417  rSh.StartAllAction();
419  SfxItemSet* pSet = const_cast<SfxItemSet*>(pDlg->GetOutputItemSet());
420  rReq.Done(*pSet);
421  // change the 2 frmsize SizeItems to the correct SwFrameSizeItem
422  if( const SvxSizeItem* pSizeItem = pSet->GetItemIfSet(
423  SID_ATTR_GRAF_FRMSIZE, false ))
424  {
425  SwFormatFrameSize aSize;
426  const Size& rSz = pSizeItem->GetSize();
427  aSize.SetWidth( rSz.Width() );
428  aSize.SetHeight( rSz.Height() );
429 
430  pSizeItem = pSet->GetItemIfSet( SID_ATTR_GRAF_FRMSIZE_PERCENT, false );
431  if( pSizeItem )
432  {
433  const Size& rRelativeSize = pSizeItem->GetSize();
434  aSize.SetWidthPercent( static_cast< sal_uInt8 >( rRelativeSize.Width() ) );
435  aSize.SetHeightPercent( static_cast< sal_uInt8 >( rRelativeSize.Height() ) );
436  }
437  pSet->Put( aSize );
438  }
439 
440  // Templates AutoUpdate
441  SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
442  if(pFormat && pFormat->IsAutoUpdateFormat())
443  {
444  pFormat->SetFormatAttr(*pSet);
447  RES_SURROUND, RES_ANCHOR> aShellSet( GetPool() );
448  aShellSet.Put(*pSet);
449  aMgr.SetAttrSet(aShellSet);
450  }
451  else
452  {
453  aMgr.SetAttrSet(*pSet);
454  }
455  aMgr.UpdateFlyFrame();
456 
457  bool bApplyUsrPref = false;
458  if (const SfxBoolItem* pRatioItem = pSet->GetItemIfSet(
459  FN_KEEP_ASPECT_RATIO ))
460  {
461  aUsrPref.SetKeepRatio( pRatioItem->GetValue() );
462  bApplyUsrPref = true;
463  }
464  if( const SfxBoolItem* pZoomItem = pSet->GetItemIfSet(
465  SID_ATTR_GRAF_KEEP_ZOOM ))
466  {
467  aUsrPref.SetGrfKeepZoom( pZoomItem->GetValue() );
468  bApplyUsrPref = true;
469  }
470 
471  if( bApplyUsrPref )
472  SW_MOD()->ApplyUsrPref(aUsrPref, &GetView());
473 
474  // and now set all the graphic attributes and other stuff
475  if( const SvxBrushItem* pGraphicBrushItem = pSet->GetItemIfSet(
476  SID_ATTR_GRAF_GRAPHIC ))
477  {
478  if( !pGraphicBrushItem->GetGraphicLink().isEmpty() )
479  sGrfNm = pGraphicBrushItem->GetGraphicLink();
480  else
481  sGrfNm.clear();
482 
483  if( !pGraphicBrushItem->GetGraphicFilter().isEmpty() )
484  sFilterNm = pGraphicBrushItem->GetGraphicFilter();
485  else
486  sFilterNm.clear();
487 
488  if( !sGrfNm.isEmpty() )
489  {
490  SwDocShell* pDocSh = GetView().GetDocShell();
491  SwWait aWait( *pDocSh, true );
492  SfxMedium* pMedium = pDocSh->GetMedium();
493  INetURLObject aAbs;
494  if( pMedium )
495  aAbs = pMedium->GetURLObject();
497  aAbs, sGrfNm,
499  sFilterNm );
500  }
501  }
502  if ( const SfxStringItem* pNameItem = pSet->GetItemIfSet(
503  FN_SET_FRM_ALT_NAME ))
504  {
505  // #i73249#
506  rSh.SetObjTitle( pNameItem->GetValue() );
507  }
508 
509  if ( const SfxStringItem* pDescriptionItem = pSet->GetItemIfSet(
510  FN_UNO_DESCRIPTION ))
511  rSh.SetObjDescription( pDescriptionItem->GetValue() );
512 
513  // RotGrfFlyFrame: Get and process evtl. changed RotationAngle
514  if ( const SdrAngleItem* pAngleItem = pSet->GetItemIfSet(SID_ATTR_TRANSFORM_ANGLE, false ))
515  {
516  const Degree10 aNewRotation = to<Degree10>(pAngleItem->GetValue() % 36000_deg100);
517 
518  // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
519  aMgr.SetRotation(nCurrentRotation, aNewRotation, aUnrotatedSize);
520  }
521 
523  aGrfSet.Put( *pSet );
524  if( aGrfSet.Count() )
525  rSh.SetAttrSet( aGrfSet );
526 
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  SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END -1> aGrfSet( GetShell().GetAttrPool() );
567  const SfxItemSet *pArgs = rReq.GetArgs();
568  const SfxPoolItem* pItem;
569  sal_uInt16 nSlot = rReq.GetSlot();
570  if( !pArgs || SfxItemState::SET != pArgs->GetItemState( nSlot, false, &pItem ))
571  pItem = nullptr;
572 
573  switch( nSlot )
574  {
575  case SID_FLIP_VERTICAL:
576  case SID_FLIP_HORIZONTAL:
577  {
578  GetShell().GetCurAttr( aGrfSet );
579  SwMirrorGrf aMirror( aGrfSet.Get( RES_GRFATR_MIRRORGRF ) );
580  MirrorGraph nMirror = aMirror.GetValue();
581  if ( nSlot==SID_FLIP_HORIZONTAL )
582  switch( nMirror )
583  {
585  break;
587  break;
589  break;
591  break;
592  }
593  else
594  switch( nMirror )
595  {
597  break;
599  break;
601  break;
603  break;
604  }
605  aMirror.SetValue( nMirror );
606  aGrfSet.ClearItem();
607  aGrfSet.Put( aMirror );
608  }
609  break;
610 
611  case SID_ATTR_GRAF_LUMINANCE:
612  if( pItem )
613  aGrfSet.Put( SwLuminanceGrf(
614  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
615  break;
616 
617  case SID_ATTR_GRAF_CONTRAST:
618  if( pItem )
619  aGrfSet.Put( SwContrastGrf(
620  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
621  break;
622 
623  case SID_ATTR_GRAF_RED:
624  if( pItem )
625  aGrfSet.Put( SwChannelRGrf(
626  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
627  break;
628 
629  case SID_ATTR_GRAF_GREEN:
630  if( pItem )
631  aGrfSet.Put( SwChannelGGrf(
632  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
633  break;
634 
635  case SID_ATTR_GRAF_BLUE:
636  if( pItem )
637  aGrfSet.Put( SwChannelBGrf(
638  static_cast<const SfxInt16Item*>(pItem)->GetValue() ));
639  break;
640 
641  case SID_ATTR_GRAF_GAMMA:
642  if( pItem )
643  {
644  double fVal = static_cast<const SfxUInt32Item*>(pItem)->GetValue();
645  aGrfSet.Put( SwGammaGrf(fVal/100. ));
646  }
647  break;
648 
649  case SID_ATTR_GRAF_TRANSPARENCE:
650  if( pItem )
651  aGrfSet.Put( SwTransparencyGrf(
652  static_cast< sal_Int8 >( static_cast<const SfxUInt16Item*>(pItem )->GetValue() ) ) );
653  break;
654 
655  case SID_ATTR_GRAF_INVERT:
656  if( pItem )
657  aGrfSet.Put( SwInvertGrf(
658  static_cast<const SfxBoolItem*>(pItem)->GetValue() ));
659  break;
660 
661  case SID_ATTR_GRAF_MODE:
662  if( pItem )
663  aGrfSet.Put( SwDrawModeGrf(
664  static_cast<GraphicDrawMode>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()) ));
665  break;
666 
667  case SID_COLOR_SETTINGS:
668  {
669  svx::ToolboxAccess aToolboxAccess( TOOLBOX_NAME );
670  aToolboxAccess.toggleToolbox();
671  break;
672  }
673 
674  case SID_GRFFILTER:
675  case SID_GRFFILTER_INVERT:
676  case SID_GRFFILTER_SMOOTH:
677  case SID_GRFFILTER_SHARPEN:
678  case SID_GRFFILTER_REMOVENOISE:
679  case SID_GRFFILTER_SOBEL:
680  case SID_GRFFILTER_MOSAIC:
681  case SID_GRFFILTER_EMBOSS:
682  case SID_GRFFILTER_POSTER:
683  case SID_GRFFILTER_POPART:
684  case SID_GRFFILTER_SEPIA:
685  case SID_GRFFILTER_SOLARIZE:
686  if( GraphicType::Bitmap == nGrfType )
687  {
688  // #119353# - robust
689  const GraphicObject* pFilterObj( GetShell().GetGraphicObj() );
690  if ( pFilterObj )
691  {
692  GraphicObject aFilterObj( *pFilterObj );
693  if( SvxGraphicFilterResult::NONE ==
694  SvxGraphicFilter::ExecuteGrfFilterSlot( rReq, aFilterObj ))
695  GetShell().ReRead( OUString(), OUString(),
696  &aFilterObj.GetGraphic() );
697  }
698  }
699  break;
700 
701  default:
702  OSL_ENSURE(false, "wrong dispatcher");
703  }
704 
705  if( aGrfSet.Count() )
706  GetShell().SetAttrSet( aGrfSet );
707  }
709 }
710 
712 {
713  SwWrtShell &rSh = GetShell();
714  SfxItemSet aCoreSet( GetPool(), aNoTextNodeSetRange );
715  rSh.GetCurAttr( aCoreSet );
717  bool bIsGrfContent = CNT_GRF == GetShell().GetCntType();
718 
719  SetGetStateSet( &rSet );
720 
721  SfxWhichIter aIter( rSet );
722  sal_uInt16 nWhich = aIter.FirstWhich();
723  while( nWhich )
724  {
725  bool bDisable = bParentCntProt;
726  switch( nWhich )
727  {
728  case SID_OBJECT_ROTATE:
729  {
730  // RotGrfFlyFrame: steer rotation state
731  const bool bIsRotate(GetView().IsDrawRotate());
732  SdrView* pSdrView = rSh.GetDrawViewWithValidMarkList();
733 
734  if(!bIsRotate && !pSdrView->IsRotateAllowed())
735  {
736  rSet.DisableItem(nWhich);
737  }
738  else
739  {
740  rSet.Put(SfxBoolItem(nWhich, bIsRotate));
741  }
742 
743  break;
744  }
745  case SID_INSERT_GRAPHIC:
747  case SID_TWAIN_TRANSFER:
748  if( bParentCntProt || !bIsGrfContent )
749  bDisable = true;
750  else if ( nWhich == SID_INSERT_GRAPHIC
751  && rSh.CursorInsideInputField() )
752  {
753  bDisable = true;
754  }
755  break;
756 
757  case SID_SAVE_GRAPHIC:
758  case SID_EXTERNAL_EDIT:
759  if( rSh.GetGraphicType() == GraphicType::NONE || GetObjectShell()->isExportLocked())
760  bDisable = true;
761  break;
762 
763  case SID_COLOR_SETTINGS:
764  {
765  if ( bParentCntProt || !bIsGrfContent )
766  bDisable = true;
767  else
768  {
769  svx::ToolboxAccess aToolboxAccess( TOOLBOX_NAME );
770  rSet.Put( SfxBoolItem( nWhich, aToolboxAccess.isToolboxVisible() ) );
771  }
772  break;
773  }
774 
775  case SID_FLIP_HORIZONTAL:
776  if( !bParentCntProt )
777  {
778  MirrorGraph nState = aCoreSet.Get(
779  RES_GRFATR_MIRRORGRF ).GetValue();
780 
781  rSet.Put(SfxBoolItem( nWhich, nState == MirrorGraph::Vertical ||
782  nState == MirrorGraph::Both));
783  }
784  break;
785 
786  case SID_FLIP_VERTICAL:
787  if( !bParentCntProt )
788  {
790  rSet.Put(SfxBoolItem( nWhich, nState == MirrorGraph::Horizontal ||
791  nState == MirrorGraph::Both));
792  }
793  break;
794 
795  case SID_ATTR_GRAF_LUMINANCE:
796  if( !bParentCntProt )
797  rSet.Put( SfxInt16Item( nWhich,
798  aCoreSet.Get(RES_GRFATR_LUMINANCE).GetValue() ));
799  break;
800 
801  case SID_ATTR_GRAF_CONTRAST:
802  if( !bParentCntProt )
803  rSet.Put( SfxInt16Item( nWhich,
804  aCoreSet.Get(RES_GRFATR_CONTRAST).GetValue() ));
805  break;
806 
807  case SID_ATTR_GRAF_RED:
808  if( !bParentCntProt )
809  rSet.Put( SfxInt16Item( nWhich,
810  aCoreSet.Get(RES_GRFATR_CHANNELR).GetValue() ));
811  break;
812 
813  case SID_ATTR_GRAF_GREEN:
814  if( !bParentCntProt )
815  rSet.Put( SfxInt16Item( nWhich,
816  aCoreSet.Get(RES_GRFATR_CHANNELG).GetValue() ));
817  break;
818 
819  case SID_ATTR_GRAF_BLUE:
820  if( !bParentCntProt )
821  rSet.Put( SfxInt16Item( nWhich,
822  aCoreSet.Get(RES_GRFATR_CHANNELB).GetValue() ));
823  break;
824 
825  case SID_ATTR_GRAF_GAMMA:
826  if( !bParentCntProt )
827  rSet.Put( SfxUInt32Item( nWhich, static_cast< sal_uInt32 >(
828  aCoreSet.Get( RES_GRFATR_GAMMA ).GetValue() * 100 ) ) );
829  break;
830 
831  case SID_ATTR_GRAF_TRANSPARENCE:
832  if( !bParentCntProt )
833  {
834  // #119353# - robust
835  const GraphicObject* pGrafObj = rSh.GetGraphicObj();
836  if ( pGrafObj )
837  {
838  if( pGrafObj->IsAnimated() ||
839  GraphicType::GdiMetafile == pGrafObj->GetType() )
840  bDisable = true;
841  else
842  rSet.Put( SfxUInt16Item( nWhich,
843  aCoreSet.Get(RES_GRFATR_TRANSPARENCY).GetValue() ));
844  }
845  }
846  break;
847 
848  case SID_ATTR_GRAF_INVERT:
849  if( !bParentCntProt )
850  rSet.Put( SfxBoolItem( nWhich,
851  aCoreSet.Get(RES_GRFATR_INVERT).GetValue() ));
852  break;
853 
854  case SID_ATTR_GRAF_MODE:
855  if( !bParentCntProt )
856  rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(aCoreSet.Get(RES_GRFATR_DRAWMODE).GetValue()) ));
857  break;
858 
859  case SID_GRFFILTER:
860  case SID_GRFFILTER_INVERT:
861  case SID_GRFFILTER_SMOOTH:
862  case SID_GRFFILTER_SHARPEN:
863  case SID_GRFFILTER_REMOVENOISE:
864  case SID_GRFFILTER_SOBEL:
865  case SID_GRFFILTER_MOSAIC:
866  case SID_GRFFILTER_EMBOSS:
867  case SID_GRFFILTER_POSTER:
868  case SID_GRFFILTER_POPART:
869  case SID_GRFFILTER_SEPIA:
870  case SID_GRFFILTER_SOLARIZE:
871  {
872  if( bParentCntProt || !bIsGrfContent )
873  bDisable = true;
874  // #i59688# load graphic only if type is unknown
875  else
876  {
877  const GraphicType eGraphicType( rSh.GetGraphicType() );
878  if ( ( eGraphicType == GraphicType::NONE ||
879  eGraphicType == GraphicType::Default ) &&
880  rSh.IsLinkedGrfSwapOut() )
881  {
882  rSet.DisableItem( nWhich );
883  if( AddGrfUpdateSlot( nWhich ))
884  rSh.GetGraphic(false); // start the loading
885  }
886  else
887  {
888  bDisable = eGraphicType != GraphicType::Bitmap;
889  }
890  }
891  }
892  break;
893 
894  case SID_OBJECT_CROP:
895  {
897  if( rSh.GetGraphicType() == GraphicType::NONE )
898  bDisable = true;
899  }
900  break;
901 
902  default:
903  bDisable = false;
904  }
905 
906  if( bDisable )
907  rSet.DisableItem( nWhich );
908  nWhich = aIter.NextWhich();
909  }
910  SetGetStateSet( nullptr );
911 }
912 
914 {
915  // RotGrfFlyFrame: Modify rotation attribute instead of manipulating the graphic
916  Degree10 aRotation;
917 
918  if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_LEFT)
919  {
920  aRotation = 900_deg10;
921  }
922  else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RIGHT)
923  {
924  aRotation = 2700_deg10;
925  }
926  else if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_180)
927  {
928  aRotation = 1800_deg10;
929  }
930 
931  if (rReq.GetSlot() != SID_ROTATE_GRAPHIC_RESET && 0_deg10 == aRotation)
932  return;
933 
934  SwWrtShell& rShell = GetShell();
936  rShell.GetCurAttr( aSet );
937  const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
938  SwFlyFrameAttrMgr aMgr(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF, nullptr);
939 
940  // RotGrfFlyFrame: Possible rotation change here, SwFlyFrameAttrMgr aMgr is available
941  if (rReq.GetSlot() == SID_ROTATE_GRAPHIC_RESET)
942  {
943  aMgr.SetRotation(rRotation.GetValue(), 0_deg10, rRotation.GetUnrotatedSize());
944  }
945  else if(0_deg10 != aRotation)
946  {
947  const Degree10 aNewRotation((aRotation + rRotation.GetValue()) % 3600_deg10);
948 
949  aMgr.SetRotation(rRotation.GetValue(), aNewRotation, rRotation.GetUnrotatedSize());
950  }
951 }
952 
954 {
955  SwWrtShell& rShell = GetShell();
956  bool bIsParentContentProtected = FlyProtectFlags::NONE != rShell.IsSelObjProtected( FlyProtectFlags::Content|FlyProtectFlags::Parent );
957 
958  SetGetStateSet( &rSet );
959 
960  SfxWhichIter aIterator( rSet );
961  sal_uInt16 nWhich = aIterator.FirstWhich();
962  while( nWhich )
963  {
964  bool bDisable = bIsParentContentProtected;
965  switch( nWhich )
966  {
967  case SID_ROTATE_GRAPHIC_LEFT:
968  case SID_ROTATE_GRAPHIC_RIGHT:
969  case SID_ROTATE_GRAPHIC_180:
970  {
971  if( rShell.GetGraphicType() == GraphicType::NONE )
972  {
973  bDisable = true;
974  }
975  break;
976  }
977  case SID_ROTATE_GRAPHIC_RESET:
978  {
979  // RotGrfFlyFrame: disable when already no rotation
981  rShell.GetCurAttr( aSet );
982  const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
983  bDisable = (0_deg10 == rRotation.GetValue());
984  break;
985  }
986  case SID_ATTR_TRANSFORM_ANGLE:
987  {
988  // RotGrfFlyFrame: get rotation value from RES_GRFATR_ROTATION and copy to rSet as
989  // SID_ATTR_TRANSFORM_ANGLE, convert from 10th degrees to 100th degrees
991  rShell.GetCurAttr( aSet );
992  const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION);
993  rSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, to<Degree100>(rRotation.GetValue())));
994  break;
995  }
996  default:
997  bDisable = false;
998  }
999 
1000  if( bDisable )
1001  rSet.DisableItem( nWhich );
1002  nWhich = aIterator.NextWhich();
1003  }
1004  SetGetStateSet( nullptr );
1005 }
1006 
1008 {
1009 }
1010 
1012  SwBaseShell(_rView)
1013 {
1014  SetName("Graphic");
1016 }
1017 
1018 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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.
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SwView & GetView()
Definition: basesh.hxx:59
#define SFX_IMPL_INTERFACE(Class, SuperClass)
bool IsRotationOfSwGrfNodePossible() const
Definition: feshview.cxx:1271
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:1007
void SetGrfToggle(bool bNew)
Definition: grfatr.hxx:66
std::string GetValue
#define FN_PARAM_GRF_CONNECT
Definition: cmdid.h:799
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:2820
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:1993
#define FN_SET_FRM_ALT_NAME
Definition: cmdid.h:868
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:87
void Execute(SfxRequest &rRequest)
Definition: grfsh.cxx:107
MirrorGraph
Definition: grfatr.hxx:31
static SvxGraphicFilterResult ExecuteGrfFilterSlot(SfxRequest const &rReq, GraphicObject &rFilterObject)
void Done(bool bRemove=false)
virtual SfxBindings & GetBindings() override
void GetAttrStateForRotation(SfxItemSet &rRequest)
Definition: grfsh.cxx:953
constexpr TypedWhichId< SwContrastGrf > RES_GRFATR_CONTRAST(137)
const Size & GetUnrotatedSize() const
Definition: grfatr.hxx:108
void ExecuteScan(SfxRequest &rReq)
Definition: view2.cxx:2843
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()
SwFlyFrame * GetSelectedFlyFrame() const
Definition: fefly1.cxx:277
void StartCropImage()
Definition: feshview.cxx:683
#define FN_FORMAT_GRAFIC_DLG
Definition: cmdid.h:333
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:96
RET_NO
constexpr tools::Long Width() const
const SwView & GetView() const
Definition: wrtsh.hxx:437
RET_YES
constexpr sal_uInt16 RES_GRFATR_END(150)
const SwRect & getFrameArea() const
Definition: frame.hxx:179
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:913
constexpr TypedWhichId< SwChannelBGrf > RES_GRFATR_CHANNELB(140)
constexpr void SetLeft(tools::Long v)
OUString GetObjTitle() const
Definition: fefly1.cxx:1964
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:204
void SetObjDescription(const OUString &rDescription)
Definition: fefly1.cxx:2026
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:870
constexpr TypedWhichId< SwRotationGrf > RES_GRFATR_ROTATION(135)
std::shared_ptr< SwUnoCursor > const m_pCursor
Definition: grfsh.cxx:76
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:617
Style of a layout element.
Definition: frmfmt.hxx:59
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:755
GraphicType GetGraphicType() const
Definition: editsh.cxx:271
#define FN_KEEP_ASPECT_RATIO
Definition: cmdid.h:866
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:2248
constexpr TypedWhichId< SwCropGrf > RES_GRFATR_CROPGRF(134)
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:186
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:472
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:673
void SetName(const OUString &rName)
SwExternalToolEdit(SwWrtShell *const pShell)
Definition: grfsh.cxx:79
bool IsAutoUpdateFormat() const
Query / set bAutoUpdateFormat-flag.
Definition: format.hxx:188
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:2705
GraphicType GetType() const
SwDocShell * GetDocShell()
Definition: view.cxx:1132
#define FN_GET_PRINT_AREA
Definition: cmdid.h:751
SwWrtShell *const m_pShell
Definition: grfsh.cxx:75
#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:1213
constexpr tools::Long Bottom() const
Rect of current page.
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:448
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
general base class for all free-flowing frames
Definition: flyfrm.hxx:78
SwGrfShell(SwView &rView)
Definition: grfsh.cxx:1011
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:428
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:865
bool IsGrfKeepZoom() const
Definition: viewopt.hxx:537
constexpr TypedWhichId< SwDrawModeGrf > RES_GRFATR_DRAWMODE(144)
RET_OK
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:640
const INetURLObject & GetURLObject() const
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
constexpr OUStringLiteral TOOLBOX_NAME
Definition: grfsh.cxx:69
void SetDragMode(SdrDragMode eSdrDragMode)
Set DragMode (e.g. Rotate), but do nothing when frame is selected.
Definition: feshview.cxx:667
XBitmapListRef GetBitmapList() const
SAL_DLLPRIVATE bool InsertGraphicDlg(SfxRequest &)
Definition: view2.cxx:304
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:1984
#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:2006
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:1481
bool IsFrameSelected() const
Definition: feshview.cxx:1254
void ExecAttr(SfxRequest const &rRequest)
Definition: grfsh.cxx:558
#define FN_DRAW_WRAP_DLG
Definition: cmdid.h:156
virtual SfxObjectShell * GetObjectShell()
void SetRotation(Degree10 nOld, Degree10 nNew, const Size &rUnrotatedSize)
Definition: frmmgr.cxx:597
Definition: view.hxx:144
const Size & GetSize() const
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
void GetAttrState(SfxItemSet &rRequest)
Definition: grfsh.cxx:711
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:995
constexpr TypedWhichId< SwGammaGrf > RES_GRFATR_GAMMA(141)
SfxMedium * GetMedium() const