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