LibreOffice Module sw (master)  1
unoframe.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 <com/sun/star/embed/NoVisualAreaSizeException.hpp>
21 #include <com/sun/star/container/XChild.hpp>
22 #include <com/sun/star/drawing/BitmapMode.hpp>
23 #include <com/sun/star/drawing/FillStyle.hpp>
24 #include <com/sun/star/awt/Gradient.hpp>
25 #include <com/sun/star/embed/XClassifiedObject.hpp>
26 #include <com/sun/star/embed/XVisualObject.hpp>
27 #include <com/sun/star/embed/XComponentSupplier.hpp>
28 #include <com/sun/star/embed/EmbedStates.hpp>
29 #include <com/sun/star/embed/Aspects.hpp>
30 #include <com/sun/star/frame/XTitle.hpp>
31 #include <com/sun/star/frame/XModel.hpp>
32 #include <com/sun/star/graphic/XGraphicProvider.hpp>
33 #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
34 #include <o3tl/any.hxx>
35 #include <svx/svxids.hrc>
36 #include <svx/xfillit0.hxx>
37 #include <svx/xflgrit.hxx>
38 #include <svx/sdtaitm.hxx>
39 #include <svx/xflclit.hxx>
40 #include <tools/globname.hxx>
41 #include <editeng/memberids.h>
42 #include <swtypes.hxx>
43 #include <cmdid.h>
44 #include <unomid.h>
45 #include <memory>
46 #include <utility>
47 #include <hints.hxx>
48 #include <doc.hxx>
49 #include <drawdoc.hxx>
50 #include <IDocumentUndoRedo.hxx>
54 #include <docsh.hxx>
55 #include <editsh.hxx>
56 #include <swcli.hxx>
57 #include <ndindex.hxx>
58 #include <pam.hxx>
59 #include <ndnotxt.hxx>
60 #include <svx/unomid.hxx>
61 #include <unocrsr.hxx>
62 #include <unocrsrhelper.hxx>
63 #include <docstyle.hxx>
64 #include <dcontact.hxx>
65 #include <fmtcnct.hxx>
66 #include <ndole.hxx>
67 #include <frmfmt.hxx>
68 #include <frame.hxx>
69 #include <textboxhelper.hxx>
70 #include <unotextrange.hxx>
71 #include <unotextcursor.hxx>
72 #include <unoparagraph.hxx>
73 #include <unomap.hxx>
74 #include <unoprnms.hxx>
75 #include <unoevent.hxx>
76 #include <com/sun/star/util/XModifyBroadcaster.hpp>
77 #include <com/sun/star/table/ShadowFormat.hpp>
78 #include <com/sun/star/style/GraphicLocation.hpp>
79 #include <com/sun/star/text/GraphicCrop.hpp>
80 #include <com/sun/star/text/TextContentAnchorType.hpp>
81 #include <com/sun/star/text/XTextColumns.hpp>
82 #include <com/sun/star/text/WrapTextMode.hpp>
83 #include <com/sun/star/beans/PropertyAttribute.hpp>
84 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
85 #include <com/sun/star/drawing/PointSequence.hpp>
86 #include <com/sun/star/drawing/ColorMode.hpp>
87 #include <tools/poly.hxx>
88 #include <swundo.hxx>
89 #include <unostyle.hxx>
90 #include <svx/svdmodel.hxx>
91 #include <svx/svdpage.hxx>
92 #include <editeng/brushitem.hxx>
93 #include <editeng/protitem.hxx>
94 #include <fmtornt.hxx>
95 #include <fmteiro.hxx>
96 #include <fmturl.hxx>
97 #include <editeng/lrspitem.hxx>
98 #include <editeng/ulspitem.hxx>
99 #include <editeng/boxitem.hxx>
100 #include <editeng/opaqitem.hxx>
101 #include <editeng/prntitem.hxx>
102 #include <editeng/shaditem.hxx>
103 #include <fmtsrnd.hxx>
104 #include <fmtfsize.hxx>
105 #include <grfatr.hxx>
106 #include <unoframe.hxx>
107 #include <fmtanchr.hxx>
108 #include <fmtclds.hxx>
109 #include <fmtcntnt.hxx>
110 #include <frmatr.hxx>
111 #include <ndtxt.hxx>
112 #include <ndgrf.hxx>
113 #include <osl/mutex.hxx>
114 #include <vcl/svapp.hxx>
115 #include <vcl/GraphicLoader.hxx>
116 #include <sfx2/printer.hxx>
117 #include <SwStyleNameMapper.hxx>
118 #include <editeng/xmlcnitm.hxx>
119 #include <poolfmt.hxx>
120 #include <pagedesc.hxx>
121 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
122 #include <editeng/frmdiritem.hxx>
123 #include <fmtfollowtextflow.hxx>
126 #include <calbck.hxx>
129 #include <sal/log.hxx>
130 
132 #include <svx/xbtmpit.hxx>
133 #include <svx/xgrscit.hxx>
134 #include <svx/xflbmtit.hxx>
135 #include <svx/xflbmpit.hxx>
136 #include <svx/xflbmsxy.hxx>
137 #include <svx/xflftrit.hxx>
138 #include <svx/xsflclit.hxx>
139 #include <svx/xflbmsli.hxx>
140 #include <svx/xflbtoxy.hxx>
141 #include <svx/xflbstit.hxx>
142 #include <svx/xflboxy.hxx>
143 #include <svx/xflbckit.hxx>
144 #include <svx/unoshape.hxx>
145 #include <svx/xflhtit.hxx>
146 #include <svx/xfltrit.hxx>
147 #include <swunohelper.hxx>
148 #include <fefly.hxx>
149 #include <fmtflcnt.hxx>
150 
151 using namespace ::com::sun::star;
152 
153 using ::com::sun::star::frame::XModel;
154 using ::com::sun::star::container::XNameAccess;
155 using ::com::sun::star::style::XStyleFamiliesSupplier;
156 
158 {
160 
161 public:
162  virtual ~BaseFrameProperties_Impl();
163 
164  void SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal);
165  bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& pAny );
166  bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, bool& rSizeFound);
167 
168  virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) = 0;
169 };
170 
172 {
173 }
174 
175 void BaseFrameProperties_Impl::SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any& rVal)
176 {
177  aAnyMap.SetValue( nWID, nMemberId, rVal );
178 }
179 
180 bool BaseFrameProperties_Impl::GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any*& rpAny)
181 {
182  return aAnyMap.FillValue( nWID, nMemberId, rpAny );
183 }
184 
185 bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, bool& rSizeFound)
186 {
187  // assert when the target SfxItemSet has no parent. It *should* have the pDfltFrameFormat
188  // from SwDoc set as parent (or similar) to have the necessary XFILL_NONE in the ItemSet
189  if(!rToSet.GetParent())
190  {
191  OSL_ENSURE(false, "OOps, target SfxItemSet *should* have a parent which contains XFILL_NONE as XFillStyleItem (!)");
192  }
193 
194  bool bRet = true;
195  // always add an anchor to the set
196  SwFormatAnchor aAnchor ( rFromSet.Get ( RES_ANCHOR ) );
197  {
198  const ::uno::Any* pAnchorPgNo;
199  if(GetProperty(RES_ANCHOR, MID_ANCHOR_PAGENUM, pAnchorPgNo))
200  bRet &= static_cast<SfxPoolItem&>(aAnchor).PutValue(*pAnchorPgNo, MID_ANCHOR_PAGENUM);
201  const ::uno::Any* pAnchorType;
202  if(GetProperty(RES_ANCHOR, MID_ANCHOR_ANCHORTYPE, pAnchorType))
203  bRet &= static_cast<SfxPoolItem&>(aAnchor).PutValue(*pAnchorType, MID_ANCHOR_ANCHORTYPE);
204  }
205 
206  rToSet.Put(aAnchor);
207 
208  // check for SvxBrushItem (RES_BACKGROUND) properties
209  const ::uno::Any* pCol = nullptr; GetProperty(RES_BACKGROUND, MID_BACK_COLOR, pCol );
210  const ::uno::Any* pRGBCol = nullptr; GetProperty(RES_BACKGROUND, MID_BACK_COLOR_R_G_B, pRGBCol );
211  const ::uno::Any* pColTrans = nullptr; GetProperty(RES_BACKGROUND, MID_BACK_COLOR_TRANSPARENCY, pColTrans);
212  const ::uno::Any* pTrans = nullptr; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENT, pTrans );
213  const ::uno::Any* pGrLoc = nullptr; GetProperty(RES_BACKGROUND, MID_GRAPHIC_POSITION, pGrLoc );
214  const ::uno::Any* pGraphic = nullptr; GetProperty(RES_BACKGROUND, MID_GRAPHIC, pGraphic );
215  const ::uno::Any* pGrFilter = nullptr; GetProperty(RES_BACKGROUND, MID_GRAPHIC_FILTER, pGrFilter );
216  const ::uno::Any* pGraphicURL = nullptr; GetProperty(RES_BACKGROUND, MID_GRAPHIC_URL, pGraphicURL );
217  const ::uno::Any* pGrTranparency = nullptr; GetProperty(RES_BACKGROUND, MID_GRAPHIC_TRANSPARENCY, pGrTranparency );
218  const bool bSvxBrushItemPropertiesUsed(
219  pCol ||
220  pTrans ||
221  pGraphic ||
222  pGraphicURL ||
223  pGrFilter ||
224  pGrLoc ||
225  pGrTranparency ||
226  pColTrans ||
227  pRGBCol);
228 
229  // check for FillStyle properties in the range XATTR_FILL_FIRST, XATTR_FILL_LAST
230  const uno::Any* pXFillStyleItem = nullptr; GetProperty(XATTR_FILLSTYLE, 0, pXFillStyleItem);
231  const uno::Any* pXFillColorItem = nullptr; GetProperty(XATTR_FILLCOLOR, 0, pXFillColorItem);
232 
233  // XFillGradientItem: two possible slots supported in UNO API
234  const uno::Any* pXFillGradientItem = nullptr; GetProperty(XATTR_FILLGRADIENT, MID_FILLGRADIENT, pXFillGradientItem);
235  const uno::Any* pXFillGradientNameItem = nullptr; GetProperty(XATTR_FILLGRADIENT, MID_NAME, pXFillGradientNameItem);
236 
237  // XFillHatchItem: two possible slots supported in UNO API
238  const uno::Any* pXFillHatchItem = nullptr; GetProperty(XATTR_FILLHATCH, MID_FILLHATCH, pXFillHatchItem);
239  const uno::Any* pXFillHatchNameItem = nullptr; GetProperty(XATTR_FILLHATCH, MID_NAME, pXFillHatchNameItem);
240 
241  // XFillBitmapItem: three possible slots supported in UNO API
242  const uno::Any* pXFillBitmapItem = nullptr; GetProperty(XATTR_FILLBITMAP, MID_BITMAP, pXFillBitmapItem);
243  const uno::Any* pXFillBitmapNameItem = nullptr; GetProperty(XATTR_FILLBITMAP, MID_NAME, pXFillBitmapNameItem);
244 
245  const uno::Any* pXFillTransparenceItem = nullptr; GetProperty(XATTR_FILLTRANSPARENCE, 0, pXFillTransparenceItem);
246  const uno::Any* pXGradientStepCountItem = nullptr; GetProperty(XATTR_GRADIENTSTEPCOUNT, 0, pXGradientStepCountItem);
247  const uno::Any* pXFillBmpPosItem = nullptr; GetProperty(XATTR_FILLBMP_POS, 0, pXFillBmpPosItem);
248  const uno::Any* pXFillBmpSizeXItem = nullptr; GetProperty(XATTR_FILLBMP_SIZEX, 0, pXFillBmpSizeXItem);
249  const uno::Any* pXFillBmpSizeYItem = nullptr; GetProperty(XATTR_FILLBMP_SIZEY, 0, pXFillBmpSizeYItem);
250 
251  // XFillFloatTransparenceItem: two possible slots supported in UNO API
252  const uno::Any* pXFillFloatTransparenceItem = nullptr; GetProperty(XATTR_FILLFLOATTRANSPARENCE, MID_FILLGRADIENT, pXFillFloatTransparenceItem);
253  const uno::Any* pXFillFloatTransparenceNameItem = nullptr; GetProperty(XATTR_FILLFLOATTRANSPARENCE, MID_NAME, pXFillFloatTransparenceNameItem);
254 
255  const uno::Any* pXSecondaryFillColorItem = nullptr; GetProperty(XATTR_SECONDARYFILLCOLOR, 0, pXSecondaryFillColorItem);
256  const uno::Any* pXFillBmpSizeLogItem = nullptr; GetProperty(XATTR_FILLBMP_SIZELOG, 0, pXFillBmpSizeLogItem);
257  const uno::Any* pXFillBmpTileOffsetXItem = nullptr; GetProperty(XATTR_FILLBMP_TILEOFFSETX, 0, pXFillBmpTileOffsetXItem);
258  const uno::Any* pXFillBmpTileOffsetYItem = nullptr; GetProperty(XATTR_FILLBMP_TILEOFFSETY, 0, pXFillBmpTileOffsetYItem);
259  const uno::Any* pXFillBmpPosOffsetXItem = nullptr; GetProperty(XATTR_FILLBMP_POSOFFSETX, 0, pXFillBmpPosOffsetXItem);
260  const uno::Any* pXFillBmpPosOffsetYItem = nullptr; GetProperty(XATTR_FILLBMP_POSOFFSETY, 0, pXFillBmpPosOffsetYItem);
261  const uno::Any* pXFillBackgroundItem = nullptr; GetProperty(XATTR_FILLBACKGROUND, 0, pXFillBackgroundItem);
262  const uno::Any* pOwnAttrFillBmpItem = nullptr; GetProperty(OWN_ATTR_FILLBMP_MODE, 0, pOwnAttrFillBmpItem);
263 
264  // tdf#91140: ignore SOLID fill style for determining if fill style is used
265  // but there is a Graphic
266  const bool bFillStyleUsed(pXFillStyleItem && pXFillStyleItem->hasValue() &&
267  (pXFillStyleItem->get<drawing::FillStyle>() != drawing::FillStyle_SOLID || (!pGraphic || !pGraphicURL) ));
268  SAL_INFO_IF(pXFillStyleItem && pXFillStyleItem->hasValue() && !bFillStyleUsed,
269  "sw.uno", "FillBaseProperties: ignoring invalid FillStyle");
270  const bool bXFillStyleItemUsed(
271  bFillStyleUsed ||
272  pXFillColorItem ||
273  pXFillGradientItem || pXFillGradientNameItem ||
274  pXFillHatchItem || pXFillHatchNameItem ||
275  pXFillBitmapItem || pXFillBitmapNameItem ||
276  pXFillTransparenceItem ||
277  pXGradientStepCountItem ||
278  pXFillBmpPosItem ||
279  pXFillBmpSizeXItem ||
280  pXFillBmpSizeYItem ||
281  pXFillFloatTransparenceItem || pXFillFloatTransparenceNameItem ||
282  pXSecondaryFillColorItem ||
283  pXFillBmpSizeLogItem ||
284  pXFillBmpTileOffsetXItem ||
285  pXFillBmpTileOffsetYItem ||
286  pXFillBmpPosOffsetXItem ||
287  pXFillBmpPosOffsetYItem ||
288  pXFillBackgroundItem ||
289  pOwnAttrFillBmpItem);
290 
291  // use brush items, but *only* if no FillStyle properties are used; if both are used and when applying both
292  // in the obvious order some attributes may be wrong since they are set by the 1st set, but not
293  // redefined as needed by the 2nd set when they are default (and thus no tset) in the 2nd set. If
294  // it is necessary for any reason to set both (it should not) a in-between step will be needed
295  // that resets the items for FillAttributes in rToSet to default.
296  // Note: There are other mechanisms in XMLOFF to pre-sort this relationship already, but this version
297  // was used initially, is tested and works. Keep it to be able to react when another feed adds attributes
298  // from both sets.
299  if(bSvxBrushItemPropertiesUsed && !bXFillStyleItemUsed)
300  {
301  // create a temporary SvxBrushItem, fill the attributes to it and use it to set
302  // the corresponding FillAttributes
304 
305  if(pCol)
306  {
307  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pCol,MID_BACK_COLOR );
308  }
309 
310  if(pColTrans)
311  {
312  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
313  }
314 
315  if(pRGBCol)
316  {
317  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B);
318  }
319 
320  if(pTrans)
321  {
322  // don't overwrite transparency with a non-transparence flag
323  if(!pColTrans || Any2Bool( *pTrans ))
324  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pTrans, MID_GRAPHIC_TRANSPARENT);
325  }
326 
327  if (pGraphic)
328  {
329  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pGraphic, MID_GRAPHIC);
330  }
331 
332  if (pGraphicURL)
333  {
334  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pGraphicURL, MID_GRAPHIC_URL);
335  }
336 
337  if(pGrFilter)
338  {
339  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pGrFilter, MID_GRAPHIC_FILTER);
340  }
341 
342  if(pGrLoc)
343  {
344  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pGrLoc, MID_GRAPHIC_POSITION);
345  }
346 
347  if(pGrTranparency)
348  {
349  bRet &= static_cast<SfxPoolItem&>(aBrush).PutValue(*pGrTranparency, MID_GRAPHIC_TRANSPARENCY);
350  }
351 
353  }
354 
355  if(bXFillStyleItemUsed)
356  {
357  XFillStyleItem aXFillStyleItem;
358  std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(RES_BACKGROUND));
359 
360  if(pXFillStyleItem)
361  {
362  aXFillStyleItem.PutValue(*pXFillStyleItem, 0);
363  rToSet.Put(aXFillStyleItem);
364  }
365 
366  if(pXFillColorItem)
367  {
368  const Color aNullCol(COL_DEFAULT_SHAPE_FILLING);
369  XFillColorItem aXFillColorItem(OUString(), aNullCol);
370 
371  aXFillColorItem.PutValue(*pXFillColorItem, 0);
372  rToSet.Put(aXFillColorItem);
373  //set old-school brush color if we later encounter the
374  //MID_BACK_COLOR_TRANSPARENCY case below
375  aBrush = getSvxBrushItemFromSourceSet(rToSet, RES_BACKGROUND, false);
376  }
377  else if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID && (pCol || pRGBCol))
378  {
379  // Fill style is set to solid, but no fill color is given.
380  // On the other hand, we have a BackColor, so use that.
381  if (pCol)
382  aBrush->PutValue(*pCol, MID_BACK_COLOR);
383  else
384  aBrush->PutValue(*pRGBCol, MID_BACK_COLOR_R_G_B);
386  }
387 
388  if(pXFillGradientItem || pXFillGradientNameItem)
389  {
390  if(pXFillGradientItem)
391  {
392  const XGradient aNullGrad(COL_BLACK, COL_WHITE);
393  XFillGradientItem aXFillGradientItem(aNullGrad);
394 
395  aXFillGradientItem.PutValue(*pXFillGradientItem, MID_FILLGRADIENT);
396  rToSet.Put(aXFillGradientItem);
397  }
398 
399  if(pXFillGradientNameItem)
400  {
401  OUString aTempName;
402 
403  if(!(*pXFillGradientNameItem >>= aTempName ))
404  {
405  throw lang::IllegalArgumentException();
406  }
407 
408  bool const bSuccess = SvxShape::SetFillAttribute(
409  XATTR_FILLGRADIENT, aTempName, rToSet);
410  if (aXFillStyleItem.GetValue() == drawing::FillStyle_GRADIENT)
411  { // tdf#90946 ignore invalid gradient-name if SOLID
412  bRet &= bSuccess;
413  }
414  else
415  {
416  SAL_INFO_IF(!bSuccess, "sw.uno",
417  "FillBaseProperties: ignoring invalid FillGradientName");
418  }
419  }
420  }
421 
422  if(pXFillHatchItem || pXFillHatchNameItem)
423  {
424  if(pXFillHatchItem)
425  {
426  const Color aNullCol(COL_DEFAULT_SHAPE_STROKE);
427  const XHatch aNullHatch(aNullCol);
428  XFillHatchItem aXFillHatchItem(aNullHatch);
429 
430  aXFillHatchItem.PutValue(*pXFillHatchItem, MID_FILLHATCH);
431  rToSet.Put(aXFillHatchItem);
432  }
433 
434  if(pXFillHatchNameItem)
435  {
436  OUString aTempName;
437 
438  if(!(*pXFillHatchNameItem >>= aTempName ))
439  {
440  throw lang::IllegalArgumentException();
441  }
442 
443  bRet &= SvxShape::SetFillAttribute(XATTR_FILLHATCH, aTempName, rToSet);
444  }
445  }
446 
447  if (pXFillBitmapItem || pXFillBitmapNameItem)
448  {
449  if(pXFillBitmapItem)
450  {
451  const Graphic aNullGraphic;
452  XFillBitmapItem aXFillBitmapItem(aNullGraphic);
453 
454  aXFillBitmapItem.PutValue(*pXFillBitmapItem, MID_BITMAP);
455  rToSet.Put(aXFillBitmapItem);
456  }
457 
458  if(pXFillBitmapNameItem)
459  {
460  OUString aTempName;
461 
462  if(!(*pXFillBitmapNameItem >>= aTempName ))
463  {
464  throw lang::IllegalArgumentException();
465  }
466 
467  bRet &= SvxShape::SetFillAttribute(XATTR_FILLBITMAP, aTempName, rToSet);
468  }
469  }
470 
471  if (pXFillTransparenceItem)
472  {
473  XFillTransparenceItem aXFillTransparenceItem;
474  aXFillTransparenceItem.PutValue(*pXFillTransparenceItem, 0);
475  rToSet.Put(aXFillTransparenceItem);
476  }
477  else if (pColTrans &&
478  !pXFillFloatTransparenceItem && !pXFillFloatTransparenceNameItem)
479  {
480  // No fill transparency is given. On the other hand, we have a
481  // BackColorTransparency, so use that.
482  // tdf#90640 tdf#90130: this is necessary for LO 4.4.0 - 4.4.2
483  // that forgot to write draw:opacity into documents
484  // but: the value was *always* wrong for bitmaps! => ignore it
485  sal_Int8 nGraphicTransparency(0);
486  *pColTrans >>= nGraphicTransparency;
487  if (aXFillStyleItem.GetValue() != drawing::FillStyle_BITMAP)
488  {
489  rToSet.Put(XFillTransparenceItem(nGraphicTransparency));
490  }
491  if (aXFillStyleItem.GetValue() == drawing::FillStyle_SOLID)
492  {
493  aBrush->PutValue(*pColTrans, MID_BACK_COLOR_TRANSPARENCY);
495  }
496  }
497 
498  if(pXGradientStepCountItem)
499  {
500  XGradientStepCountItem aXGradientStepCountItem;
501 
502  aXGradientStepCountItem.PutValue(*pXGradientStepCountItem, 0);
503  rToSet.Put(aXGradientStepCountItem);
504  }
505 
506  if(pXFillBmpPosItem)
507  {
508  XFillBmpPosItem aXFillBmpPosItem;
509 
510  aXFillBmpPosItem.PutValue(*pXFillBmpPosItem, 0);
511  rToSet.Put(aXFillBmpPosItem);
512  }
513 
514  if(pXFillBmpSizeXItem)
515  {
516  XFillBmpSizeXItem aXFillBmpSizeXItem;
517 
518  aXFillBmpSizeXItem.PutValue(*pXFillBmpSizeXItem, 0);
519  rToSet.Put(aXFillBmpSizeXItem);
520  }
521 
522  if(pXFillBmpSizeYItem)
523  {
524  XFillBmpSizeYItem aXFillBmpSizeYItem;
525 
526  aXFillBmpSizeYItem.PutValue(*pXFillBmpSizeYItem, 0);
527  rToSet.Put(aXFillBmpSizeYItem);
528  }
529 
530  if(pXFillFloatTransparenceItem || pXFillFloatTransparenceNameItem)
531  {
532  if(pXFillFloatTransparenceItem)
533  {
534  const XGradient aNullGrad(COL_BLACK, COL_WHITE);
535  XFillFloatTransparenceItem aXFillFloatTransparenceItem(aNullGrad, false);
536 
537  aXFillFloatTransparenceItem.PutValue(*pXFillFloatTransparenceItem, MID_FILLGRADIENT);
538  rToSet.Put(aXFillFloatTransparenceItem);
539  }
540 
541  if(pXFillFloatTransparenceNameItem)
542  {
543  OUString aTempName;
544 
545  if(!(*pXFillFloatTransparenceNameItem >>= aTempName ))
546  {
547  throw lang::IllegalArgumentException();
548  }
549 
550  bRet &= SvxShape::SetFillAttribute(XATTR_FILLFLOATTRANSPARENCE, aTempName, rToSet);
551  }
552  }
553 
554  if(pXSecondaryFillColorItem)
555  {
556  const Color aNullCol(COL_DEFAULT_SHAPE_FILLING);
557  XSecondaryFillColorItem aXSecondaryFillColorItem(OUString(), aNullCol);
558 
559  aXSecondaryFillColorItem.PutValue(*pXSecondaryFillColorItem, 0);
560  rToSet.Put(aXSecondaryFillColorItem);
561  }
562 
563  if(pXFillBmpSizeLogItem)
564  {
565  XFillBmpSizeLogItem aXFillBmpSizeLogItem;
566 
567  aXFillBmpSizeLogItem.PutValue(*pXFillBmpSizeLogItem, 0);
568  rToSet.Put(aXFillBmpSizeLogItem);
569  }
570 
571  if(pXFillBmpTileOffsetXItem)
572  {
573  XFillBmpTileOffsetXItem aXFillBmpTileOffsetXItem;
574 
575  aXFillBmpTileOffsetXItem.PutValue(*pXFillBmpTileOffsetXItem, 0);
576  rToSet.Put(aXFillBmpTileOffsetXItem);
577  }
578 
579  if(pXFillBmpTileOffsetYItem)
580  {
581  XFillBmpTileOffsetYItem aXFillBmpTileOffsetYItem;
582 
583  aXFillBmpTileOffsetYItem.PutValue(*pXFillBmpTileOffsetYItem, 0);
584  rToSet.Put(aXFillBmpTileOffsetYItem);
585  }
586 
587  if(pXFillBmpPosOffsetXItem)
588  {
589  XFillBmpPosOffsetXItem aXFillBmpPosOffsetXItem;
590 
591  aXFillBmpPosOffsetXItem.PutValue(*pXFillBmpPosOffsetXItem, 0);
592  rToSet.Put(aXFillBmpPosOffsetXItem);
593  }
594 
595  if(pXFillBmpPosOffsetYItem)
596  {
597  XFillBmpPosOffsetYItem aXFillBmpPosOffsetYItem;
598 
599  aXFillBmpPosOffsetYItem.PutValue(*pXFillBmpPosOffsetYItem, 0);
600  rToSet.Put(aXFillBmpPosOffsetYItem);
601  }
602 
603  if(pXFillBackgroundItem)
604  {
605  XFillBackgroundItem aXFillBackgroundItem;
606 
607  aXFillBackgroundItem.PutValue(*pXFillBackgroundItem, 0);
608  rToSet.Put(aXFillBackgroundItem);
609  }
610 
611  if(pOwnAttrFillBmpItem)
612  {
613  drawing::BitmapMode eMode;
614 
615  if(!(*pOwnAttrFillBmpItem >>= eMode))
616  {
617  sal_Int32 nMode = 0;
618 
619  if(!(*pOwnAttrFillBmpItem >>= nMode))
620  {
621  throw lang::IllegalArgumentException();
622  }
623 
624  eMode = static_cast<drawing::BitmapMode>(nMode);
625  }
626 
627  rToSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode));
628  rToSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode));
629  }
630  }
631  {
632  const ::uno::Any* pCont = nullptr;
634  const ::uno::Any* pPos = nullptr;
636  const ::uno::Any* pName = nullptr;
638  if(pCont||pPos||pName)
639  {
640  SvxProtectItem aProt ( rFromSet.Get ( RES_PROTECT ) );
641  if(pCont)
642  bRet &= static_cast<SfxPoolItem&>(aProt).PutValue(*pCont, MID_PROTECT_CONTENT);
643  if(pPos )
644  bRet &= static_cast<SfxPoolItem&>(aProt).PutValue(*pPos, MID_PROTECT_POSITION);
645  if(pName)
646  bRet &= static_cast<SfxPoolItem&>(aProt).PutValue(*pName, MID_PROTECT_SIZE);
647  rToSet.Put(aProt);
648  }
649  }
650  {
651  const ::uno::Any* pHori = nullptr;
653  const ::uno::Any* pHoriP = nullptr;
655  const ::uno::Any* pHoriR = nullptr;
657  const ::uno::Any* pPageT = nullptr;
659  if(pHori||pHoriP||pHoriR||pPageT)
660  {
661  SwFormatHoriOrient aOrient ( rFromSet.Get ( RES_HORI_ORIENT ) );
662  if(pHori )
663  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pHori, MID_HORIORIENT_ORIENT);
664  if(pHoriP)
665  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pHoriP, MID_HORIORIENT_POSITION|CONVERT_TWIPS);
666  if(pHoriR)
667  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pHoriR, MID_HORIORIENT_RELATION);
668  if(pPageT)
669  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pPageT, MID_HORIORIENT_PAGETOGGLE);
670  rToSet.Put(aOrient);
671  }
672  }
673 
674  {
675  const ::uno::Any* pVert = nullptr;
677  const ::uno::Any* pVertP = nullptr;
679  const ::uno::Any* pVertR = nullptr;
681  if(pVert||pVertP||pVertR)
682  {
683  SwFormatVertOrient aOrient ( rFromSet.Get ( RES_VERT_ORIENT ) );
684  if(pVert )
685  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pVert, MID_VERTORIENT_ORIENT);
686  if(pVertP)
687  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pVertP, MID_VERTORIENT_POSITION|CONVERT_TWIPS);
688  if(pVertR)
689  bRet &= static_cast<SfxPoolItem&>(aOrient).PutValue(*pVertR, MID_VERTORIENT_RELATION);
690  rToSet.Put(aOrient);
691  }
692  }
693  {
694  const ::uno::Any* pURL = nullptr;
696  const ::uno::Any* pTarget = nullptr;
697  GetProperty(RES_URL, MID_URL_TARGET, pTarget );
698  const ::uno::Any* pHyLNm = nullptr;
700  const ::uno::Any* pHySMp = nullptr;
702  if(pURL||pTarget||pHyLNm||pHySMp)
703  {
704  SwFormatURL aURL ( rFromSet.Get ( RES_URL ) );
705  if(pURL)
706  bRet &= static_cast<SfxPoolItem&>(aURL).PutValue(*pURL, MID_URL_URL);
707  if(pTarget)
708  bRet &= static_cast<SfxPoolItem&>(aURL).PutValue(*pTarget, MID_URL_TARGET);
709  if(pHyLNm)
710  bRet &= static_cast<SfxPoolItem&>(aURL).PutValue(*pHyLNm, MID_URL_HYPERLINKNAME );
711  if(pHySMp)
712  bRet &= static_cast<SfxPoolItem&>(aURL).PutValue(*pHySMp, MID_URL_SERVERMAP);
713  rToSet.Put(aURL);
714  }
715  }
716  const ::uno::Any* pL = nullptr;
718  const ::uno::Any* pR = nullptr;
720  if(pL||pR)
721  {
722  SvxLRSpaceItem aLR ( rFromSet.Get ( RES_LR_SPACE ) );
723  if(pL)
724  bRet &= static_cast<SfxPoolItem&>(aLR).PutValue(*pL, MID_L_MARGIN|CONVERT_TWIPS);
725  if(pR)
726  bRet &= static_cast<SfxPoolItem&>(aLR).PutValue(*pR, MID_R_MARGIN|CONVERT_TWIPS);
727  rToSet.Put(aLR);
728  }
729  const ::uno::Any* pT = nullptr;
731  const ::uno::Any* pB = nullptr;
733  if(pT||pB)
734  {
735  SvxULSpaceItem aTB ( rFromSet.Get ( RES_UL_SPACE ) );
736  if(pT)
737  bRet &= static_cast<SfxPoolItem&>(aTB).PutValue(*pT, MID_UP_MARGIN|CONVERT_TWIPS);
738  if(pB)
739  bRet &= static_cast<SfxPoolItem&>(aTB).PutValue(*pB, MID_LO_MARGIN|CONVERT_TWIPS);
740  rToSet.Put(aTB);
741  }
742  const ::uno::Any* pOp;
743  if(GetProperty(RES_OPAQUE, 0, pOp))
744  {
745  SvxOpaqueItem aOp ( rFromSet.Get ( RES_OPAQUE ) );
746  bRet &= static_cast<SfxPoolItem&>(aOp).PutValue(*pOp, 0);
747  rToSet.Put(aOp);
748  }
749  const ::uno::Any* pPrt;
750  if(GetProperty(RES_PRINT, 0, pPrt))
751  {
752  SvxPrintItem aPrt ( rFromSet.Get ( RES_PRINT ) );
753  bRet &= static_cast<SfxPoolItem&>(aPrt).PutValue(*pPrt, 0);
754  rToSet.Put(aPrt);
755  }
756  const ::uno::Any* pSh;
758  {
759  SvxShadowItem aSh ( rFromSet.Get ( RES_SHADOW ) );
760  bRet &= static_cast<SfxPoolItem&>(aSh).PutValue(*pSh, CONVERT_TWIPS);
761  rToSet.Put(aSh);
762  }
763  const ::uno::Any* pShTr;
765  {
766  SvxShadowItem aSh(rToSet.Get(RES_SHADOW));
767  bRet &= aSh.PutValue(*pShTr, MID_SHADOW_TRANSPARENCE);
768  rToSet.Put(aSh);
769  }
770  const ::uno::Any* pSur = nullptr;
772  const ::uno::Any* pSurAnch = nullptr;
774  if(pSur || pSurAnch)
775  {
776  SwFormatSurround aSrnd ( rFromSet.Get ( RES_SURROUND ) );
777  if(pSur)
778  bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSur, MID_SURROUND_SURROUNDTYPE );
779  if(pSurAnch)
780  bRet &= static_cast<SfxPoolItem&>(aSrnd).PutValue(*pSurAnch, MID_SURROUND_ANCHORONLY);
781  rToSet.Put(aSrnd);
782  }
783  const ::uno::Any* pLeft = nullptr;
785  const ::uno::Any* pRight = nullptr;
787  const ::uno::Any* pTop = nullptr;
789  const ::uno::Any* pBottom = nullptr;
791  const ::uno::Any* pDistance = nullptr;
793  const ::uno::Any* pLeftDistance = nullptr;
795  const ::uno::Any* pRightDistance = nullptr;
797  const ::uno::Any* pTopDistance = nullptr;
799  const ::uno::Any* pBottomDistance = nullptr;
801  const ::uno::Any* pLineStyle = nullptr;
802  GetProperty(RES_BOX, LINE_STYLE, pLineStyle);
803  const ::uno::Any* pLineWidth = nullptr;
804  GetProperty(RES_BOX, LINE_WIDTH, pLineWidth);
805  if( pLeft || pRight || pTop || pBottom || pDistance ||
806  pLeftDistance || pRightDistance || pTopDistance || pBottomDistance ||
807  pLineStyle || pLineWidth )
808  {
809  SvxBoxItem aBox ( rFromSet.Get ( RES_BOX ) );
810  if( pLeft )
811  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pLeft, CONVERT_TWIPS|LEFT_BORDER );
812  if( pRight )
813  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pRight, CONVERT_TWIPS|RIGHT_BORDER );
814  if( pTop )
815  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pTop, CONVERT_TWIPS|TOP_BORDER);
816  if( pBottom )
817  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pBottom, CONVERT_TWIPS|BOTTOM_BORDER);
818  if( pDistance )
819  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pDistance, CONVERT_TWIPS|BORDER_DISTANCE);
820  if( pLeftDistance )
821  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pLeftDistance, CONVERT_TWIPS|LEFT_BORDER_DISTANCE);
822  if( pRightDistance )
823  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pRightDistance, CONVERT_TWIPS|RIGHT_BORDER_DISTANCE);
824  if( pTopDistance )
825  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pTopDistance, CONVERT_TWIPS|TOP_BORDER_DISTANCE);
826  if( pBottomDistance )
827  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pBottomDistance, CONVERT_TWIPS|BOTTOM_BORDER_DISTANCE);
828  if( pLineStyle )
829  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pLineStyle, LINE_STYLE);
830  if( pLineWidth )
831  bRet &= static_cast<SfxPoolItem&>(aBox).PutValue(*pLineWidth, LINE_WIDTH|CONVERT_TWIPS);
832  rToSet.Put(aBox);
833  }
834  {
835  const ::uno::Any* pRelH = nullptr;
837  const ::uno::Any* pRelHRelation = nullptr;
839  const ::uno::Any* pRelW = nullptr;
841  const ::uno::Any* pRelWRelation = nullptr;
843  const ::uno::Any* pSyncWidth = nullptr;
845  const ::uno::Any* pSyncHeight = nullptr;
847  const ::uno::Any* pWidth = nullptr;
849  const ::uno::Any* pHeight = nullptr;
851  const ::uno::Any* pSize = nullptr;
853  const ::uno::Any* pSizeType = nullptr;
855  const ::uno::Any* pWidthType = nullptr;
857  if( pWidth || pHeight ||pRelH || pRelHRelation || pRelW || pRelWRelation || pSize ||pSizeType ||
858  pWidthType ||pSyncWidth || pSyncHeight )
859  {
860  rSizeFound = true;
861  SwFormatFrameSize aFrameSz ( rFromSet.Get ( RES_FRM_SIZE ) );
862  if(pWidth)
863  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pWidth, MID_FRMSIZE_WIDTH|CONVERT_TWIPS);
864  if(pHeight)
865  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pHeight, MID_FRMSIZE_HEIGHT|CONVERT_TWIPS);
866  if(pRelH )
867  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pRelH, MID_FRMSIZE_REL_HEIGHT);
868  if (pRelHRelation)
869  bRet &= aFrameSz.PutValue(*pRelHRelation, MID_FRMSIZE_REL_HEIGHT_RELATION);
870  if(pRelW )
871  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pRelW, MID_FRMSIZE_REL_WIDTH);
872  if (pRelWRelation)
873  bRet &= aFrameSz.PutValue(*pRelWRelation, MID_FRMSIZE_REL_WIDTH_RELATION);
874  if(pSyncWidth)
875  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pSyncWidth, MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT);
876  if(pSyncHeight)
877  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pSyncHeight, MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH);
878  if(pSize)
879  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pSize, MID_FRMSIZE_SIZE|CONVERT_TWIPS);
880  if(pSizeType)
881  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pSizeType, MID_FRMSIZE_SIZE_TYPE);
882  if(pWidthType)
883  bRet &= static_cast<SfxPoolItem&>(aFrameSz).PutValue(*pWidthType, MID_FRMSIZE_WIDTH_TYPE);
884  if(!aFrameSz.GetWidth())
885  aFrameSz.SetWidth(MINFLY);
886  if(!aFrameSz.GetHeight())
887  aFrameSz.SetHeight(MINFLY);
888  rToSet.Put(aFrameSz);
889  }
890  else
891  {
892  rSizeFound = false;
893  SwFormatFrameSize aFrameSz;
894  awt::Size aSize;
895  aSize.Width = 2 * MM50;
896  aSize.Height = 2 * MM50;
897  ::uno::Any aSizeVal;
898  aSizeVal <<= aSize;
899  static_cast<SfxPoolItem&>(aFrameSz).PutValue(aSizeVal, MID_FRMSIZE_SIZE|CONVERT_TWIPS);
900  rToSet.Put(aFrameSz);
901  }
902  }
903  const ::uno::Any* pFrameDirection = nullptr;
904  GetProperty(RES_FRAMEDIR, 0, pFrameDirection);
905  if(pFrameDirection)
906  {
907  SvxFrameDirectionItem aAttr(SvxFrameDirection::Horizontal_LR_TB, RES_FRAMEDIR);
908  aAttr.PutValue(*pFrameDirection, 0);
909  rToSet.Put(aAttr);
910  }
911  const ::uno::Any* pUnknown = nullptr;
913  if(pUnknown)
914  {
916  aAttr.PutValue(*pUnknown, 0);
917  rToSet.Put(aAttr);
918  }
919 
920  // #i18732#
921  const ::uno::Any* pFollowTextFlow = nullptr;
922  const ::uno::Any* pLayOutinCell = nullptr;
925 
926  if ( pFollowTextFlow || pLayOutinCell)
927  {
928  SwFormatFollowTextFlow aFormatFollowTextFlow;
929  if( pFollowTextFlow )
930  {
931  aFormatFollowTextFlow.PutValue(*pFollowTextFlow, MID_FOLLOW_TEXT_FLOW);
932  }
933 
934  if ( pLayOutinCell )
935  {
936  aFormatFollowTextFlow.PutValue(*pLayOutinCell, MID_FTF_LAYOUT_IN_CELL);
937  }
938  rToSet.Put(aFormatFollowTextFlow);
939  }
940 
941  // #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS
942  const ::uno::Any* pWrapInfluenceOnObjPos = nullptr;
944  if ( pWrapInfluenceOnObjPos )
945  {
946  SwFormatWrapInfluenceOnObjPos aFormatWrapInfluenceOnObjPos;
947  aFormatWrapInfluenceOnObjPos.PutValue( *pWrapInfluenceOnObjPos, MID_WRAP_INFLUENCE );
948  rToSet.Put(aFormatWrapInfluenceOnObjPos);
949  }
950 
951  {
952  const ::uno::Any* pTextVertAdjust = nullptr;
953  GetProperty(RES_TEXT_VERT_ADJUST, 0, pTextVertAdjust);
954  if ( pTextVertAdjust )
955  {
956  SdrTextVertAdjustItem aTextVertAdjust( rFromSet.Get ( RES_TEXT_VERT_ADJUST ) );
957  bRet &= static_cast<SfxPoolItem&>(aTextVertAdjust).PutValue(*pTextVertAdjust, 0);
958  rToSet.Put(aTextVertAdjust);
959  }
960  }
961 
962  return bRet;
963 }
964 
966 {
967 public:
969 
970  bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override;
971 };
972 
974  BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_FRAME)*/ )
975 {
976 }
977 
978 static void lcl_FillCol ( SfxItemSet &rToSet, const ::SfxItemSet &rFromSet, const ::uno::Any *pAny)
979 {
980  if ( pAny )
981  {
982  SwFormatCol aCol ( rFromSet.Get ( RES_COL ) );
983  static_cast<SfxPoolItem&>(aCol).PutValue( *pAny, MID_COLUMNS);
984  rToSet.Put(aCol);
985  }
986 }
987 
988 bool SwFrameProperties_Impl::AnyToItemSet(SwDoc *pDoc, SfxItemSet& rSet, SfxItemSet&, bool& rSizeFound)
989 {
990  // Properties for all frames
991  const ::uno::Any *pStyleName;
992  SwDocStyleSheet* pStyle = nullptr;
993  bool bRet;
994 
995  if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
996  {
997  OUString sStyle;
998  *pStyleName >>= sStyle;
1000  pStyle = static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle,
1001  SfxStyleFamily::Frame));
1002  }
1003 
1004  const ::uno::Any* pColumns = nullptr;
1005  GetProperty (RES_COL, MID_COLUMNS, pColumns);
1006  if ( pStyle )
1007  {
1008  rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet( *pStyle ) );
1009  const ::SfxItemSet *pItemSet = &xStyle->GetItemSet();
1010  bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
1011  lcl_FillCol ( rSet, *pItemSet, pColumns );
1012  }
1013  else
1014  {
1015  const ::SfxItemSet *pItemSet = &pDoc->getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_FRAME )->GetAttrSet();
1016  bRet = FillBaseProperties( rSet, *pItemSet, rSizeFound );
1017  lcl_FillCol ( rSet, *pItemSet, pColumns );
1018  }
1019  const ::uno::Any* pEdit;
1020  if(GetProperty(RES_EDIT_IN_READONLY, 0, pEdit))
1021  {
1023  item.PutValue(*pEdit, 0);
1024  rSet.Put(item);
1025  }
1026  return bRet;
1027 }
1028 
1030 {
1031 public:
1033 
1034  virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override;
1035 };
1036 
1038  BaseFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_TEXT_GRAPHIC)*/ )
1039 {
1040 }
1041 
1042 static void lcl_FillMirror ( SfxItemSet &rToSet, const ::SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, bool &rRet )
1043 {
1044  if(pHEvenMirror || pHOddMirror || pVMirror )
1045  {
1046  SwMirrorGrf aMirror ( rFromSet.Get ( RES_GRFATR_MIRRORGRF ) );
1047  if(pHEvenMirror)
1048  rRet &= static_cast<SfxPoolItem&>(aMirror).PutValue(*pHEvenMirror, MID_MIRROR_HORZ_EVEN_PAGES);
1049  if(pHOddMirror)
1050  rRet &= static_cast<SfxPoolItem&>(aMirror).PutValue(*pHOddMirror, MID_MIRROR_HORZ_ODD_PAGES);
1051  if(pVMirror)
1052  rRet &= static_cast<SfxPoolItem&>(aMirror).PutValue(*pVMirror, MID_MIRROR_VERT);
1053  rToSet.Put(aMirror);
1054  }
1055 }
1056 
1058  SwDoc* pDoc,
1059  SfxItemSet& rFrameSet,
1060  SfxItemSet& rGrSet,
1061  bool& rSizeFound)
1062 {
1063  // Properties for all frames
1064  bool bRet;
1065  const ::uno::Any *pStyleName;
1066  SwDocStyleSheet* pStyle = nullptr;
1067 
1068  if ( GetProperty ( FN_UNO_FRAME_STYLE_NAME, 0, pStyleName ) )
1069  {
1070  OUString sStyle;
1071  *pStyleName >>= sStyle;
1073  pStyle = static_cast<SwDocStyleSheet*>(pDoc->GetDocShell()->GetStyleSheetPool()->Find(sStyle,
1074  SfxStyleFamily::Frame));
1075  }
1076 
1077  const ::uno::Any* pHEvenMirror = nullptr;
1078  const ::uno::Any* pHOddMirror = nullptr;
1079  const ::uno::Any* pVMirror = nullptr;
1083 
1084  if ( pStyle )
1085  {
1086  rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) );
1087  const ::SfxItemSet *pItemSet = &xStyle->GetItemSet();
1088  bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound);
1089  lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
1090  }
1091  else
1092  {
1093  const ::SfxItemSet *pItemSet = &pDoc->getIDocumentStylePoolAccess().GetFrameFormatFromPool( RES_POOLFRM_GRAPHIC )->GetAttrSet();
1094  bRet = FillBaseProperties(rFrameSet, *pItemSet, rSizeFound);
1095  lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
1096  }
1097 
1098  static const ::sal_uInt16 nIDs[] =
1099  {
1111  0
1112  };
1113  const ::uno::Any* pAny;
1114  for(sal_Int16 nIndex = 0; nIDs[nIndex]; nIndex++)
1115  {
1116  sal_uInt8 nMId = RES_GRFATR_CROPGRF == nIDs[nIndex] ? CONVERT_TWIPS : 0;
1117  if(GetProperty(nIDs[nIndex], nMId, pAny ))
1118  {
1119  std::unique_ptr<SfxPoolItem> pItem(::GetDfltAttr( nIDs[nIndex] )->Clone());
1120  bRet &= pItem->PutValue(*pAny, nMId );
1121  rGrSet.Put(std::move(pItem));
1122  }
1123  }
1124 
1125  return bRet;
1126 }
1127 
1129 {
1130 public:
1132  SwFrameProperties_Impl(/*aSwMapProvider.GetPropertyMap(PROPERTY_MAP_EMBEDDED_OBJECT)*/ ){}
1133 
1134  virtual bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound) override;
1135 };
1136 
1138  SwDoc* pDoc, SfxItemSet& rFrameSet, SfxItemSet& rSet, bool& rSizeFound)
1139 {
1140  const ::uno::Any* pTemp;
1141  if(!GetProperty(FN_UNO_CLSID, 0, pTemp) && !GetProperty(FN_UNO_STREAM_NAME, 0, pTemp)
1142  && !GetProperty(FN_EMBEDDED_OBJECT, 0, pTemp)
1143  && !GetProperty(FN_UNO_VISIBLE_AREA_WIDTH, 0, pTemp)
1144  && !GetProperty(FN_UNO_VISIBLE_AREA_HEIGHT, 0, pTemp) )
1145  return false;
1146  SwFrameProperties_Impl::AnyToItemSet( pDoc, rFrameSet, rSet, rSizeFound);
1147 
1148  return true;
1149 }
1150 
1152 {
1153 private:
1154  ::osl::Mutex m_Mutex; // just for OInterfaceContainerHelper2
1155 
1156 public:
1157  uno::WeakReference<uno::XInterface> m_wThis;
1159 
1160  Impl() : m_EventListeners(m_Mutex) { }
1161 };
1162 
1163 namespace
1164 {
1165  class theSwXFrameUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXFrameUnoTunnelId > {};
1166 }
1167 
1168 const ::uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId()
1169 {
1170  return theSwXFrameUnoTunnelId::get().getSeq();
1171 }
1172 
1173 sal_Int64 SAL_CALL SwXFrame::getSomething( const ::uno::Sequence< sal_Int8 >& rId )
1174 {
1175  if( rId.getLength() == 16
1176  && 0 == memcmp( getUnoTunnelId().getConstArray(),
1177  rId.getConstArray(), 16 ) )
1178  {
1179  return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
1180  }
1181  return 0;
1182 }
1183 
1184 
1186 {
1187  return OUString("SwXFrame");
1188 }
1189 
1190 sal_Bool SwXFrame::supportsService(const OUString& rServiceName)
1191 {
1192  return cppu::supportsService(this, rServiceName);
1193 }
1194 
1195 uno::Sequence< OUString > SwXFrame::getSupportedServiceNames()
1196 {
1197  uno::Sequence< OUString > aRet(3);
1198  aRet[0] = "com.sun.star.text.BaseFrame";
1199  aRet[1] = "com.sun.star.text.TextContent";
1200  aRet[2] = "com.sun.star.document.LinkTarget";
1201  return aRet;
1202 }
1203 
1204 SwXFrame::SwXFrame(FlyCntType eSet, const ::SfxItemPropertySet* pSet, SwDoc *pDoc)
1205  : m_pImpl(new Impl)
1206  , m_pPropSet(pSet)
1207  , m_pDoc(pDoc)
1208  , eType(eSet)
1209  , bIsDescriptor(true)
1210  , m_nDrawAspect(embed::Aspects::MSOLE_CONTENT)
1211  , m_nVisibleAreaWidth(0)
1212  , m_nVisibleAreaHeight(0)
1213 {
1214  // Register ourselves as a listener to the document (via the page descriptor)
1216  // get the property set for the default style data
1217  // First get the model
1218  uno::Reference < XModel > xModel = pDoc->GetDocShell()->GetBaseModel();
1219  // Ask the model for its family supplier interface
1220  uno::Reference < XStyleFamiliesSupplier > xFamilySupplier ( xModel, uno::UNO_QUERY );
1221  // Get the style families
1222  uno::Reference < XNameAccess > xFamilies = xFamilySupplier->getStyleFamilies();
1223  // Get the Frame family (and keep it for later)
1224  const ::uno::Any aAny = xFamilies->getByName ("FrameStyles");
1225  aAny >>= mxStyleFamily;
1226  // In the derived class, we'll ask mxStyleFamily for the relevant default style
1227  // mxStyleFamily is initialised in the SwXFrame constructor
1228  switch(eType)
1229  {
1230  case FLYCNTTYPE_FRM:
1231  {
1232  uno::Any aAny2 = mxStyleFamily->getByName ("Frame");
1233  aAny2 >>= mxStyleData;
1234  m_pProps.reset(new SwFrameProperties_Impl);
1235  }
1236  break;
1237  case FLYCNTTYPE_GRF:
1238  {
1239  uno::Any aAny2 = mxStyleFamily->getByName ("Graphics");
1240  aAny2 >>= mxStyleData;
1242  }
1243  break;
1244  case FLYCNTTYPE_OLE:
1245  {
1246  uno::Any aAny2 = mxStyleFamily->getByName ("OLE");
1247  aAny2 >>= mxStyleData;
1248  m_pProps.reset(new SwOLEProperties_Impl);
1249  }
1250  break;
1251 
1252  default:
1253  m_pProps.reset();
1254  break;
1255  }
1256 }
1257 
1258 SwXFrame::SwXFrame(SwFrameFormat& rFrameFormat, FlyCntType eSet, const ::SfxItemPropertySet* pSet)
1259  : SwClient(&rFrameFormat)
1260  , m_pImpl(new Impl)
1261  , m_pPropSet(pSet)
1262  , m_pDoc(nullptr)
1263  , eType(eSet)
1264  , bIsDescriptor(false)
1265  , m_nDrawAspect(embed::Aspects::MSOLE_CONTENT)
1266  , m_nVisibleAreaWidth(0)
1267  , m_nVisibleAreaHeight(0)
1268 {
1269 }
1270 
1272 {
1273  SolarMutexGuard aGuard;
1274  m_pCopySource.reset();
1275  m_pProps.reset();
1276  EndListeningAll();
1277 }
1278 
1279 template<class Interface, class NameLookupIsHard>
1280 uno::Reference<Interface>
1281 SwXFrame::CreateXFrame(SwDoc & rDoc, SwFrameFormat *const pFrameFormat)
1282 {
1283  assert(!pFrameFormat || &rDoc == pFrameFormat->GetDoc());
1284  uno::Reference<Interface> xFrame;
1285  if (pFrameFormat)
1286  {
1287  xFrame.set(pFrameFormat->GetXObject(), uno::UNO_QUERY); // cached?
1288  }
1289  if (!xFrame.is())
1290  {
1291  NameLookupIsHard *const pNew(pFrameFormat
1292  ? new NameLookupIsHard(*pFrameFormat)
1293  : new NameLookupIsHard(&rDoc));
1294  xFrame.set(pNew);
1295  if (pFrameFormat)
1296  {
1297  pFrameFormat->SetXObject(xFrame);
1298  }
1299  // need a permanent Reference to initialize m_wThis
1300  pNew->SwXFrame::m_pImpl->m_wThis = xFrame;
1301  }
1302  return xFrame;
1303 }
1304 
1306 {
1307  SolarMutexGuard aGuard;
1308  SwFrameFormat* pFormat = GetFrameFormat();
1309  if(pFormat)
1310  return pFormat->GetName();
1311  if(!bIsDescriptor)
1312  throw uno::RuntimeException();
1313  return m_sName;
1314 }
1315 
1316 void SwXFrame::setName(const OUString& rName)
1317 {
1318  SolarMutexGuard aGuard;
1319  SwFrameFormat* pFormat = GetFrameFormat();
1320  if(pFormat)
1321  {
1322  pFormat->GetDoc()->SetFlyName(static_cast<SwFlyFrameFormat&>(*pFormat), rName);
1323  if(pFormat->GetName() != rName)
1324  {
1325  throw uno::RuntimeException();
1326  }
1327  }
1328  else if(bIsDescriptor)
1329  m_sName = rName;
1330  else
1331  throw uno::RuntimeException();
1332 }
1333 
1334 uno::Reference< beans::XPropertySetInfo > SwXFrame::getPropertySetInfo()
1335 {
1336  uno::Reference< beans::XPropertySetInfo > xRef;
1337  static uno::Reference< beans::XPropertySetInfo > xFrameRef;
1338  static uno::Reference< beans::XPropertySetInfo > xGrfRef;
1339  static uno::Reference< beans::XPropertySetInfo > xOLERef;
1340  switch(eType)
1341  {
1342  case FLYCNTTYPE_FRM:
1343  if( !xFrameRef.is() )
1344  xFrameRef = m_pPropSet->getPropertySetInfo();
1345  xRef = xFrameRef;
1346  break;
1347  case FLYCNTTYPE_GRF:
1348  if( !xGrfRef.is() )
1349  xGrfRef = m_pPropSet->getPropertySetInfo();
1350  xRef = xGrfRef;
1351  break;
1352  case FLYCNTTYPE_OLE:
1353  if( !xOLERef.is() )
1354  xOLERef = m_pPropSet->getPropertySetInfo();
1355  xRef = xOLERef;
1356  break;
1357  default:
1358  ;
1359  }
1360  return xRef;
1361 }
1362 
1363 void SwXFrame::SetSelection(SwPaM& rCopySource)
1364 {
1365  m_pCopySource.reset(new SwPaM(*rCopySource.Start()));
1366  m_pCopySource->SetMark();
1367  *m_pCopySource->GetMark() = *rCopySource.End();
1368 }
1369 
1371 {
1372  SdrObject* pObject = rFormat.FindSdrObject();
1373  if( !pObject )
1374  {
1375  SwDoc *pDoc = rFormat.GetDoc();
1376  // #i52858# - method name changed
1377  SwFlyDrawContact* pContactObject(rFormat.GetOrCreateContact());
1378  pObject = pContactObject->GetMaster();
1379 
1380  const ::SwFormatSurround& rSurround = rFormat.GetSurround();
1381  pObject->SetLayer(
1382  ( css::text::WrapTextMode_THROUGH == rSurround.GetSurround() &&
1383  !rFormat.GetOpaque().GetValue() ) ? pDoc->getIDocumentDrawModelAccess().GetHellId()
1386  pDrawModel->GetPage(0)->InsertObject( pObject );
1387  }
1388 
1389  return pObject;
1390 }
1391 
1392 static SwFrameFormat *lcl_GetFrameFormat( const ::uno::Any& rValue, SwDoc *pDoc )
1393 {
1394  SwFrameFormat *pRet = nullptr;
1395  SwDocShell* pDocSh = pDoc->GetDocShell();
1396  if(pDocSh)
1397  {
1398  OUString uTemp;
1399  rValue >>= uTemp;
1400  OUString sStyle;
1401  SwStyleNameMapper::FillUIName(uTemp, sStyle,
1403  SwDocStyleSheet* pStyle =
1404  static_cast<SwDocStyleSheet*>(pDocSh->GetStyleSheetPool()->Find(sStyle,
1405  SfxStyleFamily::Frame));
1406  if(pStyle)
1407  pRet = pStyle->GetFrameFormat();
1408  }
1409 
1410  return pRet;
1411 }
1412 
1413 void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& _rValue)
1414 {
1415  SolarMutexGuard aGuard;
1416  SwFrameFormat* pFormat = GetFrameFormat();
1417  const ::SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
1418 
1419  if (!pEntry)
1420  throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
1421 
1422  const sal_uInt8 nMemberId(pEntry->nMemberId);
1423  uno::Any aValue(_rValue);
1424 
1425  // check for needed metric translation
1426  if(pEntry->nMoreFlags & PropertyMoreFlags::METRIC_ITEM)
1427  {
1428  bool bDoIt(true);
1429 
1430  if(XATTR_FILLBMP_SIZEX == pEntry->nWID || XATTR_FILLBMP_SIZEY == pEntry->nWID)
1431  {
1432  // exception: If these ItemTypes are used, do not convert when these are negative
1433  // since this means they are intended as percent values
1434  sal_Int32 nValue = 0;
1435 
1436  if(aValue >>= nValue)
1437  {
1438  bDoIt = nValue > 0;
1439  }
1440  }
1441 
1442  if(bDoIt)
1443  {
1444  const SwDoc* pDoc = (IsDescriptor() ? m_pDoc : GetFrameFormat()->GetDoc());
1445  const SfxItemPool& rPool = pDoc->GetAttrPool();
1446  const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
1447 
1448  if(eMapUnit != MapUnit::Map100thMM)
1449  {
1450  SvxUnoConvertFromMM(eMapUnit, aValue);
1451  }
1452  }
1453  }
1454 
1455  if(pFormat)
1456  {
1457  bool bNextFrame = false;
1458  if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
1459  throw beans::PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
1460 
1461  SwDoc* pDoc = pFormat->GetDoc();
1462  if ( ((eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID)) ||
1463  (FN_PARAM_CONTOUR_PP == pEntry->nWID) ||
1464  (FN_UNO_IS_AUTOMATIC_CONTOUR == pEntry->nWID) ||
1465  (FN_UNO_IS_PIXEL_CONTOUR == pEntry->nWID) )
1466  {
1467  const ::SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1468  if(pIdx)
1469  {
1470  SwNodeIndex aIdx(*pIdx, 1);
1471  SwNoTextNode* pNoText = aIdx.GetNode().GetNoTextNode();
1472  if(pEntry->nWID == FN_PARAM_CONTOUR_PP)
1473  {
1474  drawing::PointSequenceSequence aParam;
1475  if(!aValue.hasValue())
1476  pNoText->SetContour(nullptr);
1477  else if(aValue >>= aParam)
1478  {
1479  tools::PolyPolygon aPoly(static_cast<sal_uInt16>(aParam.getLength()));
1480  for(sal_Int32 i = 0; i < aParam.getLength(); i++)
1481  {
1482  const ::drawing::PointSequence* pPointSeq = aParam.getConstArray();
1483  sal_Int32 nPoints = pPointSeq[i].getLength();
1484  const ::awt::Point* pPoints = pPointSeq[i].getConstArray();
1485  tools::Polygon aSet( static_cast<sal_uInt16>(nPoints) );
1486  for(sal_Int32 j = 0; j < nPoints; j++)
1487  {
1488  Point aPoint(pPoints[j].X, pPoints[j].Y);
1489  aSet.SetPoint(aPoint, static_cast<sal_uInt16>(j));
1490  }
1491  // Close polygon if it isn't closed already.
1492  aSet.Optimize( PolyOptimizeFlags::CLOSE );
1493  aPoly.Insert( aSet );
1494  }
1495  pNoText->SetContourAPI( &aPoly );
1496  }
1497  else
1498  throw lang::IllegalArgumentException();
1499  }
1500  else if(pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR )
1501  {
1502  pNoText->SetAutomaticContour( *o3tl::doAccess<bool>(aValue) );
1503  }
1504  else if(pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR )
1505  {
1506  // The IsPixelContour property can only be set if there
1507  // is no contour, or if the contour has been set by the
1508  // API itself (or in other words, if the contour isn't
1509  // used already).
1510  if( pNoText->HasContour_() && pNoText->IsContourMapModeValid() )
1511  throw lang::IllegalArgumentException();
1512 
1513  pNoText->SetPixelContour( *o3tl::doAccess<bool>(aValue) );
1514 
1515  }
1516  else
1517  {
1518  SfxItemSet aSet(pNoText->GetSwAttrSet());
1519  m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
1520  pNoText->SetAttr(aSet);
1521  }
1522  }
1523  }
1524  // New attribute Title
1525  else if( FN_UNO_TITLE == pEntry->nWID )
1526  {
1527  SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat);
1528  OUString sTitle;
1529  aValue >>= sTitle;
1530  // assure that <SdrObject> instance exists.
1531  GetOrCreateSdrObject(rFlyFormat);
1532  rFlyFormat.GetDoc()->SetFlyFrameTitle(rFlyFormat, sTitle);
1533  }
1534  // New attribute Description
1535  else if( FN_UNO_DESCRIPTION == pEntry->nWID )
1536  {
1537  SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat);
1538  OUString sDescription;
1539  aValue >>= sDescription;
1540  // assure that <SdrObject> instance exists.
1541  GetOrCreateSdrObject(rFlyFormat);
1542  rFlyFormat.GetDoc()->SetFlyFrameDescription(rFlyFormat, sDescription);
1543  }
1544  else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID)
1545  {
1546  SwFrameFormat *pFrameFormat = lcl_GetFrameFormat( aValue, pFormat->GetDoc() );
1547  if( !pFrameFormat )
1548  throw lang::IllegalArgumentException();
1549 
1550  UnoActionContext aAction(pFormat->GetDoc());
1551 
1552  std::unique_ptr<SfxItemSet> pSet;
1553  // #i31771#, #i25798# - No adjustment of
1554  // anchor ( no call of method <sw_ChkAndSetNewAnchor(..)> ),
1555  // if document is currently in reading mode.
1556  if ( !pFormat->GetDoc()->IsInReading() )
1557  {
1558  // see SwFEShell::SetFrameFormat( SwFrameFormat *pNewFormat, bool bKeepOrient, Point* pDocPos )
1559  SwFlyFrame *pFly = nullptr;
1560  if (auto pFlyFrameFormat = dynamic_cast<const SwFlyFrameFormat*>(pFormat) )
1561  pFly = pFlyFrameFormat->GetFrame();
1562  if ( pFly )
1563  {
1564  const ::SfxPoolItem* pItem;
1565  if( SfxItemState::SET == pFrameFormat->GetItemState( RES_ANCHOR, false, &pItem ))
1566  {
1567  pSet.reset(new SfxItemSet( pDoc->GetAttrPool(), aFrameFormatSetRange ));
1568  pSet->Put( *pItem );
1569  if ( pFormat->GetDoc()->GetEditShell() != nullptr
1570  && !sw_ChkAndSetNewAnchor( *pFly, *pSet ) )
1571  {
1572  pSet.reset();
1573  }
1574  }
1575  }
1576  }
1577 
1578  pFormat->GetDoc()->SetFrameFormatToFly( *pFormat, *pFrameFormat, pSet.get() );
1579  }
1580  else if (FN_UNO_GRAPHIC_FILTER == pEntry->nWID)
1581  {
1582  OUString sGrfName;
1583  OUString sFltName;
1584  SwDoc::GetGrfNms( *static_cast<SwFlyFrameFormat*>(pFormat), &sGrfName, &sFltName );
1585  aValue >>= sFltName;
1586  UnoActionContext aAction(pFormat->GetDoc());
1587  const ::SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1588  if (pIdx)
1589  {
1590  SwNodeIndex aIdx(*pIdx, 1);
1591  SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
1592  if(!pGrfNode)
1593  {
1594  throw uno::RuntimeException();
1595  }
1596  SwPaM aGrfPaM(*pGrfNode);
1597  pFormat->GetDoc()->getIDocumentContentOperations().ReRead(aGrfPaM, sGrfName, sFltName, nullptr);
1598  }
1599  }
1600  else if (FN_UNO_GRAPHIC == pEntry->nWID || FN_UNO_GRAPHIC_URL == pEntry->nWID)
1601  {
1602  Graphic aGraphic;
1603  if (aValue.has<OUString>())
1604  {
1605  OUString aURL = aValue.get<OUString>();
1606  if (!aURL.isEmpty())
1607  {
1608  aGraphic = vcl::graphic::loadFromURL(aURL);
1609  }
1610  }
1611  else if (aValue.has<uno::Reference<graphic::XGraphic>>())
1612  {
1613  uno::Reference<graphic::XGraphic> xGraphic = aValue.get<uno::Reference<graphic::XGraphic>>();
1614  if (xGraphic.is())
1615  {
1616  aGraphic = Graphic(xGraphic);
1617  }
1618  }
1619 
1620  if (!aGraphic.IsNone())
1621  {
1622  const ::SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
1623  if (pIdx)
1624  {
1625  SwNodeIndex aIdx(*pIdx, 1);
1626  SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
1627  if (!pGrfNode)
1628  {
1629  throw uno::RuntimeException();
1630  }
1631  SwPaM aGrfPaM(*pGrfNode);
1632  pFormat->GetDoc()->getIDocumentContentOperations().ReRead(aGrfPaM, OUString(), OUString(), &aGraphic);
1633  }
1634  }
1635  }
1636  else if (FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID || FN_UNO_REPLACEMENT_GRAPHIC_URL == pEntry->nWID)
1637  {
1638  Graphic aGraphic;
1639  if (aValue.has<OUString>())
1640  {
1641  OUString aURL = aValue.get<OUString>();
1642  if (!aURL.isEmpty())
1643  {
1644  aGraphic = vcl::graphic::loadFromURL(aURL);
1645  }
1646  }
1647  else if (aValue.has<uno::Reference<graphic::XGraphic>>())
1648  {
1649  uno::Reference<graphic::XGraphic> xGraphic = aValue.get<uno::Reference<graphic::XGraphic>>();
1650  if (xGraphic.is())
1651  {
1652  aGraphic = Graphic(xGraphic);
1653  }
1654  }
1655 
1656  if (!aGraphic.IsNone())
1657  {
1658  const ::SwFormatContent* pCnt = &pFormat->GetContent();
1659  if ( pCnt->GetContentIdx() && pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ] )
1660  {
1661  SwOLENode* pOleNode = pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ]->GetOLENode();
1662 
1663  if ( pOleNode )
1664  {
1665  svt::EmbeddedObjectRef &rEmbeddedObject = pOleNode->GetOLEObj().GetObject();
1666  rEmbeddedObject.SetGraphic(aGraphic, OUString() );
1667  }
1668  }
1669  }
1670  }
1671  else if((bNextFrame = (rPropertyName == UNO_NAME_CHAIN_NEXT_NAME))
1672  || rPropertyName == UNO_NAME_CHAIN_PREV_NAME)
1673  {
1674  OUString sChainName;
1675  aValue >>= sChainName;
1676  if (sChainName.isEmpty())
1677  {
1678  if(bNextFrame)
1679  pDoc->Unchain(*pFormat);
1680  else
1681  {
1682  const SwFormatChain& aChain( pFormat->GetChain() );
1683  SwFrameFormat *pPrev = aChain.GetPrev();
1684  if(pPrev)
1685  pDoc->Unchain(*pPrev);
1686  }
1687  }
1688  else
1689  {
1690  const size_t nCount = pDoc->GetFlyCount(FLYCNTTYPE_FRM);
1691 
1692  SwFrameFormat* pChain = nullptr;
1693  for( size_t i = 0; i < nCount; ++i )
1694  {
1695  SwFrameFormat* pFormat2 = pDoc->GetFlyNum(i, FLYCNTTYPE_FRM);
1696  if(sChainName == pFormat2->GetName() )
1697  {
1698  pChain = pFormat2;
1699  break;
1700  }
1701  }
1702  if(pChain)
1703  {
1704  SwFrameFormat* pSource = bNextFrame ? pFormat : pChain;
1705  SwFrameFormat* pDest = bNextFrame ? pChain: pFormat;
1706  pDoc->Chain(*pSource, *pDest);
1707  }
1708  }
1709  }
1710  else if(FN_UNO_Z_ORDER == pEntry->nWID)
1711  {
1712  sal_Int32 nZOrder = - 1;
1713  aValue >>= nZOrder;
1714 
1715  // Don't set an explicit ZOrder on TextBoxes.
1716  if( nZOrder >= 0 && !SwTextBoxHelper::isTextBox(pFormat, RES_FLYFRMFMT) )
1717  {
1718  SdrObject* pObject =
1719  GetOrCreateSdrObject( static_cast<SwFlyFrameFormat&>(*pFormat) );
1720  SwDrawModel *pDrawModel = pDoc->getIDocumentDrawModelAccess().GetDrawModel();
1721  pDrawModel->GetPage(0)->
1722  SetObjectOrdNum(pObject->GetOrdNum(), nZOrder);
1723  }
1724  }
1725  else if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORFRAME == nMemberId)
1726  {
1727  bool bDone = false;
1728  uno::Reference<text::XTextFrame> xFrame;
1729  if(aValue >>= xFrame)
1730  {
1731  uno::Reference<lang::XUnoTunnel> xTunnel(xFrame, uno::UNO_QUERY);
1732  SwXFrame* pFrame = xTunnel.is() ?
1733  reinterpret_cast< SwXFrame * >( sal::static_int_cast< sal_IntPtr >( xTunnel->getSomething(SwXFrame::getUnoTunnelId()) ))
1734  : nullptr;
1735  if(pFrame && this != pFrame && pFrame->GetFrameFormat() && pFrame->GetFrameFormat()->GetDoc() == pDoc)
1736  {
1737  SfxItemSet aSet( pDoc->GetAttrPool(),
1739  aSet.SetParent(&pFormat->GetAttrSet());
1740  SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(pEntry->nWID));
1741 
1742  SwPosition aPos(*pFrame->GetFrameFormat()->GetContent().GetContentIdx());
1743  aAnchor.SetAnchor(&aPos);
1744  aAnchor.SetType(RndStdIds::FLY_AT_FLY);
1745  aSet.Put(aAnchor);
1746  pDoc->SetFlyFrameAttr( *pFormat, aSet );
1747  bDone = true;
1748  }
1749  }
1750  if(!bDone)
1751  throw lang::IllegalArgumentException();
1752  }
1753  else
1754  {
1755  // standard UNO API write attributes
1756  // adapt former attr from SvxBrushItem::PutValue to new items XATTR_FILL_FIRST, XATTR_FILL_LAST
1757  SfxItemSet aSet( pDoc->GetAttrPool(),
1760 
1761  // FillAttribute support
1763  bool bDone(false);
1764 
1765  aSet.SetParent(&pFormat->GetAttrSet());
1766 
1767  if(RES_BACKGROUND == pEntry->nWID)
1768  {
1769  const SwAttrSet& rSet = pFormat->GetAttrSet();
1770  const std::shared_ptr<SvxBrushItem> aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND, true, pDoc->IsInXMLImport()));
1771  std::shared_ptr<SvxBrushItem> aChangedBrushItem(static_cast<SvxBrushItem*>(aOriginalBrushItem->Clone()));
1772 
1773  aChangedBrushItem->PutValue(aValue, nMemberId);
1774 
1775  if(*aChangedBrushItem != *aOriginalBrushItem)
1776  {
1777  setSvxBrushItemAsFillAttributesToTargetSet(*aChangedBrushItem, aSet);
1778  pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet );
1779  }
1780 
1781  bDone = true;
1782  }
1783  else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
1784  {
1785  drawing::BitmapMode eMode;
1786 
1787  if(!(aValue >>= eMode))
1788  {
1789  sal_Int32 nMode = 0;
1790 
1791  if(!(aValue >>= nMode))
1792  {
1793  throw lang::IllegalArgumentException();
1794  }
1795 
1796  eMode = static_cast<drawing::BitmapMode>(nMode);
1797  }
1798 
1799  aSet.Put(XFillBmpStretchItem(drawing::BitmapMode_STRETCH == eMode));
1800  aSet.Put(XFillBmpTileItem(drawing::BitmapMode_REPEAT == eMode));
1801  pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet );
1802  bDone = true;
1803  }
1804 
1805  switch(nMemberId)
1806  {
1807  case MID_NAME:
1808  {
1809  // when named items get set, replace these with the NameOrIndex items
1810  // which exist already in the pool
1811  switch(pEntry->nWID)
1812  {
1813  case XATTR_FILLGRADIENT:
1814  case XATTR_FILLHATCH:
1815  case XATTR_FILLBITMAP:
1817  {
1818  OUString aTempName;
1819 
1820  if(!(aValue >>= aTempName ))
1821  {
1822  throw lang::IllegalArgumentException();
1823  }
1824 
1825  bDone = SvxShape::SetFillAttribute(pEntry->nWID, aTempName, aSet);
1826  break;
1827  }
1828  default:
1829  {
1830  break;
1831  }
1832  }
1833  break;
1834  }
1835  case MID_BITMAP:
1836  {
1837  switch(pEntry->nWID)
1838  {
1839  case XATTR_FILLBITMAP:
1840  {
1841  const Graphic aNullGraphic;
1842  XFillBitmapItem aXFillBitmapItem(aNullGraphic);
1843 
1844  aXFillBitmapItem.PutValue(aValue, nMemberId);
1845  aSet.Put(aXFillBitmapItem);
1846  bDone = true;
1847  break;
1848  }
1849  default:
1850  {
1851  break;
1852  }
1853  }
1854  break;
1855  }
1856  default:
1857  {
1858  break;
1859  }
1860  }
1861 
1862  if(!bDone)
1863  {
1864  m_pPropSet->setPropertyValue(*pEntry, aValue, aSet);
1865  }
1866 
1867  if(RES_ANCHOR == pEntry->nWID && MID_ANCHOR_ANCHORTYPE == nMemberId)
1868  {
1869  SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(pEntry->nWID));
1870  if(aAnchor.GetAnchorId() == RndStdIds::FLY_AT_FLY)
1871  {
1872  const ::SwPosition* pPosition = aAnchor.GetContentAnchor();
1873  SwFrameFormat* pFlyFormat = pPosition ? pPosition->nNode.GetNode().GetFlyFormat() : nullptr;
1874  if(!pFlyFormat || pFlyFormat->Which() == RES_DRAWFRMFMT)
1875  {
1876  lang::IllegalArgumentException aExcept;
1877  aExcept.Message = "Anchor to frame: no frame found";
1878  throw aExcept;
1879  }
1880  else
1881  {
1882  SwPosition aPos = *pPosition;
1883  aPos.nNode = *pFlyFormat->GetContent().GetContentIdx();
1884  aAnchor.SetAnchor(&aPos);
1885  aSet.Put(aAnchor);
1886  }
1887  }
1888  else if ((aAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) &&
1889  !aAnchor.GetContentAnchor())
1890  {
1891  SwNode& rNode = pDoc->GetNodes().GetEndOfContent();
1892  SwPaM aPam(rNode);
1893  aPam.Move( fnMoveBackward, GoInDoc );
1894  aAnchor.SetAnchor( aPam.Start() );
1895  aSet.Put(aAnchor);
1896  }
1897 
1898  // #i31771#, #i25798# - No adjustment of
1899  // anchor ( no call of method <sw_ChkAndSetNewAnchor(..)> ),
1900  // if document is currently in reading mode.
1901  if ( !pFormat->GetDoc()->IsInReading() )
1902  {
1903  // see SwFEShell::SetFlyFrameAttr( SfxItemSet& rSet )
1904  SwFlyFrame *pFly = nullptr;
1905  if (auto pFrameFormat = dynamic_cast<SwFlyFrameFormat*>( pFormat) )
1906  pFly = pFrameFormat->GetFrame();
1907  if (pFly)
1908  {
1909  const ::SfxPoolItem* pItem;
1910  if( SfxItemState::SET == aSet.GetItemState( RES_ANCHOR, false, &pItem ))
1911  {
1912  aSet.Put( *pItem );
1913  if ( pFormat->GetDoc()->GetEditShell() != nullptr )
1914  {
1915  sw_ChkAndSetNewAnchor( *pFly, aSet );
1916  }
1917  }
1918  }
1919  }
1920 
1921  pFormat->GetDoc()->SetFlyFrameAttr( *pFormat, aSet );
1922  }
1923  else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_STREAM_NAME == pEntry->nWID || FN_EMBEDDED_OBJECT == pEntry->nWID)
1924  {
1925  throw lang::IllegalArgumentException();
1926  }
1927  else
1928  {
1929  pFormat->SetFormatAttr(aSet);
1930  }
1931  }
1932  }
1933  else if(IsDescriptor())
1934  {
1935  m_pProps->SetProperty(pEntry->nWID, nMemberId, aValue);
1936  if( FN_UNO_FRAME_STYLE_NAME == pEntry->nWID )
1937  {
1938  OUString sStyleName;
1939  aValue >>= sStyleName;
1940  try
1941  {
1942  uno::Any aAny = mxStyleFamily->getByName ( sStyleName );
1943  aAny >>= mxStyleData;
1944  }
1945  catch ( container::NoSuchElementException const & )
1946  {
1947  }
1948  catch ( lang::WrappedTargetException const & )
1949  {
1950  }
1951  catch ( uno::RuntimeException const & )
1952  {
1953  }
1954  }
1955  else if (FN_UNO_DRAW_ASPECT == pEntry->nWID)
1956  {
1957  OUString sAspect = "";
1958  aValue >>= sAspect;
1959 
1960  if (sAspect == "Icon")
1961  m_nDrawAspect = embed::Aspects::MSOLE_ICON;
1962  else if (sAspect == "Content")
1963  m_nDrawAspect = embed::Aspects::MSOLE_CONTENT;
1964  }
1965  else if (FN_UNO_VISIBLE_AREA_WIDTH == pEntry->nWID)
1966  {
1967  OUString sAspect = "";
1968  aValue >>= sAspect;
1969  m_nVisibleAreaWidth = sAspect.toInt64();
1970  }
1971  else if (FN_UNO_VISIBLE_AREA_HEIGHT == pEntry->nWID)
1972  {
1973  OUString sAspect = "";
1974  aValue >>= sAspect;
1975  m_nVisibleAreaHeight = sAspect.toInt64();
1976  }
1977  }
1978  else
1979  throw uno::RuntimeException();
1980 }
1981 
1982 uno::Any SwXFrame::getPropertyValue(const OUString& rPropertyName)
1983 {
1984  SolarMutexGuard aGuard;
1985  uno::Any aAny;
1986  SwFrameFormat* pFormat = GetFrameFormat();
1987  const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
1988  if (!pEntry)
1989  throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
1990 
1991  const sal_uInt8 nMemberId(pEntry->nMemberId);
1992 
1993  if(FN_UNO_ANCHOR_TYPES == pEntry->nWID)
1994  {
1995  uno::Sequence<text::TextContentAnchorType> aTypes(5);
1996  text::TextContentAnchorType* pArray = aTypes.getArray();
1997  pArray[0] = text::TextContentAnchorType_AT_PARAGRAPH;
1998  pArray[1] = text::TextContentAnchorType_AS_CHARACTER;
1999  pArray[2] = text::TextContentAnchorType_AT_PAGE;
2000  pArray[3] = text::TextContentAnchorType_AT_FRAME;
2001  pArray[4] = text::TextContentAnchorType_AT_CHARACTER;
2002  aAny <<= aTypes;
2003  }
2004  else if(pFormat)
2005  {
2006  if( ((eType == FLYCNTTYPE_GRF) || (eType == FLYCNTTYPE_OLE)) &&
2007  (isGRFATR(pEntry->nWID) ||
2008  pEntry->nWID == FN_PARAM_CONTOUR_PP ||
2009  pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR ||
2010  pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR ))
2011  {
2012  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2013  if(pIdx)
2014  {
2015  SwNodeIndex aIdx(*pIdx, 1);
2016  SwNoTextNode* pNoText = aIdx.GetNode().GetNoTextNode();
2017  if(pEntry->nWID == FN_PARAM_CONTOUR_PP)
2018  {
2019  tools::PolyPolygon aContour;
2020  if( pNoText->GetContourAPI( aContour ) )
2021  {
2022  drawing::PointSequenceSequence aPtSeq(aContour.Count());
2023  drawing::PointSequence* pPSeq = aPtSeq.getArray();
2024  for(sal_uInt16 i = 0; i < aContour.Count(); i++)
2025  {
2026  const tools::Polygon& rPoly = aContour.GetObject(i);
2027  pPSeq[i].realloc(rPoly.GetSize());
2028  awt::Point* pPoints = pPSeq[i].getArray();
2029  for(sal_uInt16 j = 0; j < rPoly.GetSize(); j++)
2030  {
2031  const Point& rPoint = rPoly.GetPoint(j);
2032  pPoints[j].X = rPoint.X();
2033  pPoints[j].Y = rPoint.Y();
2034  }
2035  }
2036  aAny <<= aPtSeq;
2037  }
2038  }
2039  else if(pEntry->nWID == FN_UNO_IS_AUTOMATIC_CONTOUR )
2040  {
2041  aAny <<= pNoText->HasAutomaticContour();
2042  }
2043  else if(pEntry->nWID == FN_UNO_IS_PIXEL_CONTOUR )
2044  {
2045  aAny <<= pNoText->IsPixelContour();
2046  }
2047  else
2048  {
2049  const SfxItemSet& aSet(pNoText->GetSwAttrSet());
2050  m_pPropSet->getPropertyValue(*pEntry, aSet, aAny);
2051  }
2052  }
2053  }
2054  else if (FN_UNO_REPLACEMENT_GRAPHIC == pEntry->nWID)
2055  {
2056  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2057  uno::Reference<graphic::XGraphic> xGraphic;
2058 
2059  if (pIdx)
2060  {
2061  SwNodeIndex aIdx(*pIdx, 1);
2062  SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
2063  if (!pGrfNode)
2064  throw uno::RuntimeException();
2065 
2066  const GraphicObject* pGraphicObject = pGrfNode->GetReplacementGrfObj();
2067 
2068  if (pGraphicObject)
2069  {
2070  xGraphic = pGraphicObject->GetGraphic().GetXGraphic();
2071  }
2072  }
2073  aAny <<= xGraphic;
2074  }
2075  else if( FN_UNO_GRAPHIC_FILTER == pEntry->nWID )
2076  {
2077  OUString sFltName;
2078  SwDoc::GetGrfNms( *static_cast<SwFlyFrameFormat*>(pFormat), nullptr, &sFltName );
2079  aAny <<= sFltName;
2080  }
2081  else if( FN_UNO_GRAPHIC_URL == pEntry->nWID )
2082  {
2083  throw uno::RuntimeException("Getting from this property is not supported");
2084  }
2085  else if( FN_UNO_GRAPHIC == pEntry->nWID )
2086  {
2087  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2088  if(pIdx)
2089  {
2090  SwNodeIndex aIdx(*pIdx, 1);
2091  SwGrfNode* pGrfNode = aIdx.GetNode().GetGrfNode();
2092  if(!pGrfNode)
2093  throw uno::RuntimeException();
2094  aAny <<= pGrfNode->GetGrf().GetXGraphic();
2095  }
2096  }
2097  else if(FN_UNO_FRAME_STYLE_NAME == pEntry->nWID)
2098  {
2100  }
2101  // #i73249#
2102  else if( FN_UNO_TITLE == pEntry->nWID )
2103  {
2104  SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat);
2105  // assure that <SdrObject> instance exists.
2106  GetOrCreateSdrObject(rFlyFormat);
2107  aAny <<= rFlyFormat.GetObjTitle();
2108  }
2109  // New attribute Description
2110  else if( FN_UNO_DESCRIPTION == pEntry->nWID )
2111  {
2112  SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat);
2113  // assure that <SdrObject> instance exists.
2114  GetOrCreateSdrObject(rFlyFormat);
2115  aAny <<= rFlyFormat.GetObjDescription();
2116  }
2117  else if(eType == FLYCNTTYPE_GRF &&
2118  (rPropertyName == UNO_NAME_ACTUAL_SIZE))
2119  {
2120  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2121  if(pIdx)
2122  {
2123  SwNodeIndex aIdx(*pIdx, 1);
2124  Size aActSize = aIdx.GetNode().GetNoTextNode()->GetTwipSize();
2125  awt::Size aTmp;
2126  aTmp.Width = convertTwipToMm100(aActSize.Width());
2127  aTmp.Height = convertTwipToMm100(aActSize.Height());
2128  aAny <<= aTmp;
2129  }
2130  }
2131  else if(FN_PARAM_LINK_DISPLAY_NAME == pEntry->nWID)
2132  {
2133  aAny <<= pFormat->GetName();
2134  }
2135  else if(FN_UNO_Z_ORDER == pEntry->nWID)
2136  {
2137  const SdrObject* pObj = pFormat->FindRealSdrObject();
2138  if( pObj == nullptr )
2139  pObj = pFormat->FindSdrObject();
2140  if( pObj )
2141  {
2142  aAny <<= static_cast<sal_Int32>(pObj->GetOrdNum());
2143  }
2144  }
2145  else if(FN_UNO_CLSID == pEntry->nWID || FN_UNO_MODEL == pEntry->nWID||
2146  FN_UNO_COMPONENT == pEntry->nWID ||FN_UNO_STREAM_NAME == pEntry->nWID||
2147  FN_EMBEDDED_OBJECT == pEntry->nWID)
2148  {
2149  SwDoc* pDoc = pFormat->GetDoc();
2150  const SwFormatContent* pCnt = &pFormat->GetContent();
2151  OSL_ENSURE( pCnt->GetContentIdx() &&
2152  pDoc->GetNodes()[ pCnt->GetContentIdx()->
2153  GetIndex() + 1 ]->GetOLENode(), "no OLE-Node?");
2154 
2155  SwOLENode* pOleNode = pDoc->GetNodes()[ pCnt->GetContentIdx()
2156  ->GetIndex() + 1 ]->GetOLENode();
2157  uno::Reference < embed::XEmbeddedObject > xIP = pOleNode->GetOLEObj().GetOleRef();
2158  OUString aHexCLSID;
2159  {
2160  SvGlobalName aClassName( xIP->getClassID() );
2161  aHexCLSID = aClassName.GetHexName();
2162  if(FN_UNO_CLSID != pEntry->nWID)
2163  {
2165  {
2166  uno::Reference < lang::XComponent > xComp( xIP->getComponent(), uno::UNO_QUERY );
2167  uno::Reference < frame::XModel > xModel( xComp, uno::UNO_QUERY );
2168  if ( FN_EMBEDDED_OBJECT == pEntry->nWID )
2169  {
2170  // when exposing the EmbeddedObject, ensure it has a client site
2171  OSL_ENSURE( pDoc->GetDocShell(), "no doc shell => no client site" );
2172  if ( pDoc->GetDocShell() )
2173  pDoc->GetDocShell()->GetIPClient( svt::EmbeddedObjectRef( xIP, embed::Aspects::MSOLE_CONTENT ) );
2174  aAny <<= xIP;
2175  }
2176  else if ( xModel.is() )
2177  aAny <<= xModel;
2178  else if ( FN_UNO_COMPONENT == pEntry->nWID )
2179  aAny <<= xComp;
2180  }
2181  }
2182  }
2183 
2184  if(FN_UNO_CLSID == pEntry->nWID)
2185  aAny <<= aHexCLSID;
2186  else if(FN_UNO_STREAM_NAME == pEntry->nWID)
2187  {
2188  aAny <<= pOleNode->GetOLEObj().GetCurrentPersistName();
2189  }
2190  else if(FN_EMBEDDED_OBJECT == pEntry->nWID)
2191  {
2192  aAny <<= pOleNode->GetOLEObj().GetOleRef();
2193  }
2194  }
2195  else if(WID_LAYOUT_SIZE == pEntry->nWID)
2196  {
2197  // format document completely in order to get correct value
2198  pFormat->GetDoc()->GetEditShell()->CalcLayout();
2199 
2200  SwFrame* pTmpFrame = SwIterator<SwFrame,SwFormat>( *pFormat ).First();
2201  if ( pTmpFrame )
2202  {
2203  OSL_ENSURE( pTmpFrame->isFrameAreaDefinitionValid(), "frame not valid" );
2204  const SwRect &rRect = pTmpFrame->getFrameArea();
2205  Size aMM100Size = OutputDevice::LogicToLogic(
2206  Size( rRect.Width(), rRect.Height() ),
2207  MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM ));
2208  aAny <<= awt::Size( aMM100Size.Width(), aMM100Size.Height() );
2209  }
2210  }
2211  else
2212  {
2213  // standard UNO API read attributes
2214  // adapt former attr from SvxBrushItem::PutValue to new items XATTR_FILL_FIRST, XATTR_FILL_LAST
2215  const SwAttrSet& rSet = pFormat->GetAttrSet();
2216  bool bDone(false);
2217 
2218  if(RES_BACKGROUND == pEntry->nWID)
2219  {
2220  const std::shared_ptr<SvxBrushItem> aOriginalBrushItem(getSvxBrushItemFromSourceSet(rSet, RES_BACKGROUND));
2221 
2222  if(!aOriginalBrushItem->QueryValue(aAny, nMemberId))
2223  {
2224  OSL_ENSURE(false, "Error getting attribute from RES_BACKGROUND (!)");
2225  }
2226 
2227  bDone = true;
2228  }
2229  else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
2230  {
2231  if (rSet.Get(XATTR_FILLBMP_TILE).GetValue())
2232  {
2233  aAny <<= drawing::BitmapMode_REPEAT;
2234  }
2235  else if (rSet.Get(XATTR_FILLBMP_STRETCH).GetValue())
2236  {
2237  aAny <<= drawing::BitmapMode_STRETCH;
2238  }
2239  else
2240  {
2241  aAny <<= drawing::BitmapMode_NO_REPEAT;
2242  }
2243 
2244  bDone = true;
2245  }
2246 
2247  if(!bDone)
2248  {
2249  m_pPropSet->getPropertyValue(*pEntry, rSet, aAny);
2250  }
2251  }
2252  }
2253  else if(IsDescriptor())
2254  {
2255  if ( ! m_pDoc )
2256  throw uno::RuntimeException();
2257  if(WID_LAYOUT_SIZE != pEntry->nWID) // there is no LayoutSize in a descriptor
2258  {
2259  const uno::Any* pAny = nullptr;
2260  if (!m_pProps->GetProperty(pEntry->nWID, nMemberId, pAny))
2261  aAny = mxStyleData->getPropertyValue( rPropertyName );
2262  else if ( pAny )
2263  aAny = *pAny;
2264  }
2265  }
2266  else
2267  throw uno::RuntimeException();
2268 
2269  if (pEntry->aType == ::cppu::UnoType<sal_Int16>::get() && pEntry->aType != aAny.getValueType())
2270  {
2271  // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here
2272  sal_Int32 nValue = 0;
2273  aAny >>= nValue;
2274  aAny <<= static_cast<sal_Int16>(nValue);
2275  }
2276 
2277  // check for needed metric translation
2278  if(pEntry->nMoreFlags & PropertyMoreFlags::METRIC_ITEM)
2279  {
2280  bool bDoIt(true);
2281 
2282  if(XATTR_FILLBMP_SIZEX == pEntry->nWID || XATTR_FILLBMP_SIZEY == pEntry->nWID)
2283  {
2284  // exception: If these ItemTypes are used, do not convert when these are negative
2285  // since this means they are intended as percent values
2286  sal_Int32 nValue = 0;
2287 
2288  if(aAny >>= nValue)
2289  {
2290  bDoIt = nValue > 0;
2291  }
2292  }
2293 
2294  if(bDoIt)
2295  {
2296  const SwDoc* pDoc = (IsDescriptor() ? m_pDoc : GetFrameFormat()->GetDoc());
2297  const SfxItemPool& rPool = pDoc->GetAttrPool();
2298  const MapUnit eMapUnit(rPool.GetMetric(pEntry->nWID));
2299 
2300  if(eMapUnit != MapUnit::Map100thMM)
2301  {
2302  SvxUnoConvertToMM(eMapUnit, aAny);
2303  }
2304  }
2305  }
2306 
2307  return aAny;
2308 }
2309 
2310 void SwXFrame::addPropertyChangeListener(const OUString& /*PropertyName*/,
2311  const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
2312 {
2313  OSL_FAIL("not implemented");
2314 }
2315 
2316 void SwXFrame::removePropertyChangeListener(const OUString& /*PropertyName*/,
2317  const uno::Reference< beans::XPropertyChangeListener > & /*aListener*/)
2318 {
2319  OSL_FAIL("not implemented");
2320 }
2321 
2322 void SwXFrame::addVetoableChangeListener(const OUString& /*PropertyName*/,
2323  const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2324 {
2325  OSL_FAIL("not implemented");
2326 }
2327 
2329  const OUString& /*PropertyName*/, const uno::Reference< beans::XVetoableChangeListener > & /*aListener*/)
2330 {
2331  OSL_FAIL("not implemented");
2332 }
2333 
2334 beans::PropertyState SwXFrame::getPropertyState( const OUString& rPropertyName )
2335 {
2336  SolarMutexGuard aGuard;
2337  uno::Sequence< OUString > aPropertyNames { rPropertyName };
2338  uno::Sequence< beans::PropertyState > aStates = getPropertyStates(aPropertyNames);
2339  return aStates.getConstArray()[0];
2340 }
2341 
2342 uno::Sequence< beans::PropertyState > SwXFrame::getPropertyStates(
2343  const uno::Sequence< OUString >& aPropertyNames )
2344 {
2345  SolarMutexGuard aGuard;
2346  uno::Sequence< beans::PropertyState > aStates(aPropertyNames.getLength());
2347  beans::PropertyState* pStates = aStates.getArray();
2348  SwFrameFormat* pFormat = GetFrameFormat();
2349  if(pFormat)
2350  {
2351  const OUString* pNames = aPropertyNames.getConstArray();
2352  const SwAttrSet& rFormatSet = pFormat->GetAttrSet();
2353  for(int i = 0; i < aPropertyNames.getLength(); i++)
2354  {
2355  const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName(pNames[i]);
2356  if (!pEntry)
2357  throw beans::UnknownPropertyException("Unknown property: " + pNames[i], static_cast < cppu::OWeakObject * > ( this ) );
2358 
2359  if(pEntry->nWID == FN_UNO_ANCHOR_TYPES||
2360  pEntry->nWID == FN_PARAM_LINK_DISPLAY_NAME||
2361  FN_UNO_FRAME_STYLE_NAME == pEntry->nWID||
2362  FN_UNO_GRAPHIC == pEntry->nWID||
2363  FN_UNO_GRAPHIC_URL == pEntry->nWID||
2364  FN_UNO_GRAPHIC_FILTER == pEntry->nWID||
2365  FN_UNO_ACTUAL_SIZE == pEntry->nWID||
2366  FN_UNO_ALTERNATIVE_TEXT == pEntry->nWID)
2367  {
2368  pStates[i] = beans::PropertyState_DIRECT_VALUE;
2369  }
2370  else if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
2371  {
2372  if(SfxItemState::SET == rFormatSet.GetItemState(XATTR_FILLBMP_STRETCH, false)
2373  || SfxItemState::SET == rFormatSet.GetItemState(XATTR_FILLBMP_TILE, false))
2374  {
2375  pStates[i] = beans::PropertyState_DIRECT_VALUE;
2376  }
2377  else
2378  {
2379  pStates[i] = beans::PropertyState_AMBIGUOUS_VALUE;
2380  }
2381  }
2382  // for FlyFrames we need to mark the used properties from type RES_BACKGROUND
2383  // as beans::PropertyState_DIRECT_VALUE to let users of this property call
2384  // getPropertyValue where the member properties will be mapped from the
2385  // fill attributes to the according SvxBrushItem entries
2386  else if (RES_BACKGROUND == pEntry->nWID)
2387  {
2389  pStates[i] = beans::PropertyState_DIRECT_VALUE;
2390  else
2391  pStates[i] = beans::PropertyState_DEFAULT_VALUE;
2392  }
2393  else
2394  {
2395  if ((eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID))
2396  {
2397  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2398  if(pIdx)
2399  {
2400  SwNodeIndex aIdx(*pIdx, 1);
2401  SwNoTextNode* pNoText = aIdx.GetNode().GetNoTextNode();
2402  const SfxItemSet& aSet(pNoText->GetSwAttrSet());
2403  aSet.GetItemState(pEntry->nWID);
2404  if(SfxItemState::SET == aSet.GetItemState( pEntry->nWID, false ))
2405  pStates[i] = beans::PropertyState_DIRECT_VALUE;
2406  }
2407  }
2408  else
2409  {
2410  if(SfxItemState::SET == rFormatSet.GetItemState( pEntry->nWID, false ))
2411  pStates[i] = beans::PropertyState_DIRECT_VALUE;
2412  else
2413  pStates[i] = beans::PropertyState_DEFAULT_VALUE;
2414  }
2415  }
2416  }
2417  }
2418  else if(IsDescriptor())
2419  {
2420  for(int i = 0; i < aPropertyNames.getLength(); i++)
2421  pStates[i] = beans::PropertyState_DIRECT_VALUE;
2422  }
2423  else
2424  throw uno::RuntimeException();
2425  return aStates;
2426 }
2427 
2428 void SwXFrame::setPropertyToDefault( const OUString& rPropertyName )
2429 {
2430  SolarMutexGuard aGuard;
2431  SwFrameFormat* pFormat = GetFrameFormat();
2432  if(pFormat)
2433  {
2434  const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
2435  if (!pEntry)
2436  throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2437  if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
2438  throw uno::RuntimeException("setPropertyToDefault: property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2439 
2440  bool bNextFrame;
2441  if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID)
2442  {
2443  SwDoc* pDoc = pFormat->GetDoc();
2445  aSet.SetParent(&pFormat->GetAttrSet());
2446 
2447  aSet.ClearItem(XATTR_FILLBMP_STRETCH);
2448  aSet.ClearItem(XATTR_FILLBMP_TILE);
2449 
2450  pFormat->SetFormatAttr(aSet);
2451  }
2452  else if( pEntry->nWID &&
2453  pEntry->nWID != FN_UNO_ANCHOR_TYPES &&
2454  pEntry->nWID != FN_PARAM_LINK_DISPLAY_NAME)
2455  {
2456  if ( (eType == FLYCNTTYPE_GRF) && isGRFATR(pEntry->nWID) )
2457  {
2458  const SwNodeIndex* pIdx = pFormat->GetContent().GetContentIdx();
2459  if(pIdx)
2460  {
2461  SwNodeIndex aIdx(*pIdx, 1);
2462  SwNoTextNode* pNoText = aIdx.GetNode().GetNoTextNode();
2463  {
2464  SfxItemSet aSet(pNoText->GetSwAttrSet());
2465  aSet.ClearItem(pEntry->nWID);
2466  pNoText->SetAttr(aSet);
2467  }
2468  }
2469  }
2470  // #i73249#
2471  else if( FN_UNO_TITLE == pEntry->nWID )
2472  {
2473  SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat);
2474  // assure that <SdrObject> instance exists.
2475  GetOrCreateSdrObject(rFlyFormat);
2476  rFlyFormat.GetDoc()->SetFlyFrameTitle(rFlyFormat, OUString());
2477  }
2478  // New attribute Description
2479  else if( FN_UNO_DESCRIPTION == pEntry->nWID )
2480  {
2481  SwFlyFrameFormat& rFlyFormat = dynamic_cast<SwFlyFrameFormat&>(*pFormat);
2482  // assure that <SdrObject> instance exists.
2483  GetOrCreateSdrObject(rFlyFormat);
2484  rFlyFormat.GetDoc()->SetFlyFrameDescription(rFlyFormat, OUString());
2485  }
2486  else
2487  {
2488  SwDoc* pDoc = pFormat->GetDoc();
2489  SfxItemSet aSet( pDoc->GetAttrPool(),
2491  aSet.SetParent(&pFormat->GetAttrSet());
2492  aSet.ClearItem(pEntry->nWID);
2493  if(rPropertyName != UNO_NAME_ANCHOR_TYPE)
2494  pFormat->SetFormatAttr(aSet);
2495  }
2496  }
2497  else
2498  {
2499  bNextFrame = rPropertyName == UNO_NAME_CHAIN_NEXT_NAME;
2500  if( bNextFrame || rPropertyName == UNO_NAME_CHAIN_PREV_NAME )
2501  {
2502  SwDoc* pDoc = pFormat->GetDoc();
2503  if(bNextFrame)
2504  pDoc->Unchain(*pFormat);
2505  else
2506  {
2507  const SwFormatChain& aChain( pFormat->GetChain() );
2508  SwFrameFormat *pPrev = aChain.GetPrev();
2509  if(pPrev)
2510  pDoc->Unchain(*pPrev);
2511  }
2512  }
2513  }
2514  }
2515  else if(!IsDescriptor())
2516  throw uno::RuntimeException();
2517 
2518 }
2519 
2520 uno::Any SwXFrame::getPropertyDefault( const OUString& rPropertyName )
2521 {
2522  SolarMutexGuard aGuard;
2523  uno::Any aRet;
2524  SwFrameFormat* pFormat = GetFrameFormat();
2525  if(pFormat)
2526  {
2527  const SfxItemPropertySimpleEntry* pEntry = m_pPropSet->getPropertyMap().getByName(rPropertyName);
2528  if(!pEntry)
2529  throw beans::UnknownPropertyException( "Unknown property: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
2530 
2531  if ( pEntry->nWID < RES_FRMATR_END )
2532  {
2533  const SfxPoolItem& rDefItem =
2534  pFormat->GetDoc()->GetAttrPool().GetDefaultItem(pEntry->nWID);
2535  rDefItem.QueryValue(aRet, pEntry->nMemberId);
2536  }
2537 
2538  }
2539  else if(!IsDescriptor())
2540  throw uno::RuntimeException();
2541  return aRet;
2542 }
2543 
2545  const uno::Reference<lang::XEventListener> & xListener)
2546 {
2547  // no need to lock here as m_pImpl is const and container threadsafe
2548  m_pImpl->m_EventListeners.addInterface(xListener);
2549 }
2550 
2552  const uno::Reference<lang::XEventListener> & xListener)
2553 {
2554  // no need to lock here as m_pImpl is const and container threadsafe
2555  m_pImpl->m_EventListeners.removeInterface(xListener);
2556 }
2557 
2558 void SwXFrame::Modify(const SfxPoolItem* pOld, const SfxPoolItem *pNew)
2559 {
2560  ClientModify(this, pOld, pNew);
2561  if (GetRegisteredIn())
2562  {
2563  return; // core object still alive
2564  }
2565  mxStyleData.clear();
2566  mxStyleFamily.clear();
2567  m_pDoc = nullptr;
2568  uno::Reference<uno::XInterface> const xThis(m_pImpl->m_wThis);
2569  if (!xThis.is())
2570  { // fdo#72695: if UNO object is already dead, don't revive it with event
2571  return;
2572  }
2573  lang::EventObject const ev(xThis);
2574  m_pImpl->m_EventListeners.disposeAndClear(ev);
2575 }
2576 
2578 {
2579  SolarMutexGuard aGuard;
2580  SwFrameFormat* pFormat = GetFrameFormat();
2581  if ( pFormat )
2582  {
2583  SdrObject* pObj = pFormat->FindSdrObject();
2584  // OD 11.09.2003 #112039# - add condition to perform delete of
2585  // format/anchor sign, not only if the object is inserted, but also
2586  // if a contact object is registered, which isn't in the destruction.
2587  if ( pObj &&
2588  ( pObj->IsInserted() ||
2589  ( pObj->GetUserCall() &&
2590  !static_cast<SwContact*>(pObj->GetUserCall())->IsInDTOR() ) ) )
2591  {
2592  if (pFormat->GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR)
2593  {
2594  const SwPosition &rPos = *(pFormat->GetAnchor().GetContentAnchor());
2595  SwTextNode *pTextNode = rPos.nNode.GetNode().GetTextNode();
2596  const sal_Int32 nIdx = rPos.nContent.GetIndex();
2597  pTextNode->DeleteAttributes( RES_TXTATR_FLYCNT, nIdx, nIdx );
2598  }
2599  else
2600  pFormat->GetDoc()->getIDocumentLayoutAccess().DelLayoutFormat(pFormat);
2601  }
2602  }
2603 
2604 }
2605 
2606 uno::Reference< text::XTextRange > SwXFrame::getAnchor()
2607 {
2608  SolarMutexGuard aGuard;
2609  uno::Reference< text::XTextRange > aRef;
2610  SwFrameFormat* pFormat = GetFrameFormat();
2611  if(!pFormat)
2612  throw uno::RuntimeException();
2613 
2614  const SwFormatAnchor& rAnchor = pFormat->GetAnchor();
2615  // return an anchor for non-page bound frames
2616  // and for page bound frames that have a page no == NULL and a content position
2617  if ((rAnchor.GetAnchorId() != RndStdIds::FLY_AT_PAGE) ||
2618  (rAnchor.GetContentAnchor() && !rAnchor.GetPageNum()))
2619  {
2620  const SwPosition &rPos = *(rAnchor.GetContentAnchor());
2621  aRef = SwXTextRange::CreateXTextRange(*pFormat->GetDoc(), rPos, nullptr);
2622  }
2623 
2624  return aRef;
2625 }
2626 
2628 {
2629  bIsDescriptor = false;
2630  mxStyleData.clear();
2631  mxStyleFamily.clear();
2632  m_pProps.reset();
2633 }
2634 
2635 void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRange)
2636 {
2637  SolarMutexGuard aGuard;
2638  if(!IsDescriptor())
2639  throw uno::RuntimeException();
2640  uno::Reference<lang::XUnoTunnel> xRangeTunnel( xTextRange, uno::UNO_QUERY);
2641  SwXTextRange* pRange = nullptr;
2642  OTextCursorHelper* pCursor = nullptr;
2643  if(xRangeTunnel.is())
2644  {
2645  pRange = reinterpret_cast< SwXTextRange * >(
2646  sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( SwXTextRange::getUnoTunnelId()) ));
2647  pCursor = reinterpret_cast< OTextCursorHelper * >(
2648  sal::static_int_cast< sal_IntPtr >( xRangeTunnel->getSomething( OTextCursorHelper::getUnoTunnelId()) ));
2649  }
2650 
2651  SwDoc* pDoc = pRange ? &pRange->GetDoc() : pCursor ? pCursor->GetDoc() : nullptr;
2652  if(!pDoc)
2653  throw lang::IllegalArgumentException();
2654 
2655  SwUnoInternalPaM aIntPam(*pDoc);
2656  // this now needs to return TRUE
2657  ::sw::XTextRangeToSwPaM(aIntPam, xTextRange);
2658 
2659  SwNode& rNode = pDoc->GetNodes().GetEndOfContent();
2660  SwPaM aPam(rNode);
2661  aPam.Move( fnMoveBackward, GoInDoc );
2662  static sal_uInt16 const aFrameAttrRange[] =
2663  {
2666 
2667  // FillAttribute support
2669 
2670  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
2671  0
2672  };
2673  static sal_uInt16 const aGrAttrRange[] =
2674  {
2676  0
2677  };
2678  SfxItemSet aGrSet(pDoc->GetAttrPool(), aGrAttrRange );
2679 
2680  SfxItemSet aFrameSet(pDoc->GetAttrPool(), aFrameAttrRange );
2681 
2682  // set correct parent to get the XFILL_NONE FillStyle as needed
2683  aFrameSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet());
2684 
2685  // no the related items need to be added to the set
2686  bool bSizeFound;
2687  if (!m_pProps->AnyToItemSet(pDoc, aFrameSet, aGrSet, bSizeFound))
2688  throw lang::IllegalArgumentException();
2689  // a TextRange is handled separately
2690  *aPam.GetPoint() = *aIntPam.GetPoint();
2691  if(aIntPam.HasMark())
2692  {
2693  aPam.SetMark();
2694  *aPam.GetMark() = *aIntPam.GetMark();
2695  }
2696 
2697  const SfxPoolItem* pItem;
2698  RndStdIds eAnchorId = RndStdIds::FLY_AT_PARA;
2699  if(SfxItemState::SET == aFrameSet.GetItemState(RES_ANCHOR, false, &pItem) )
2700  {
2701  eAnchorId = static_cast<const SwFormatAnchor*>(pItem)->GetAnchorId();
2702  if( RndStdIds::FLY_AT_FLY == eAnchorId &&
2703  !aPam.GetNode().FindFlyStartNode())
2704  {
2705  // framebound only where a frame exists
2706  SwFormatAnchor aAnchor(RndStdIds::FLY_AT_PARA);
2707  aFrameSet.Put(aAnchor);
2708  }
2709  else if ((RndStdIds::FLY_AT_PAGE == eAnchorId) &&
2710  0 == static_cast<const SwFormatAnchor*>(pItem)->GetPageNum() )
2711  {
2712  SwFormatAnchor aAnchor( *static_cast<const SwFormatAnchor*>(pItem) );
2713  aAnchor.SetAnchor( aPam.GetPoint() );
2714  aFrameSet.Put(aAnchor);
2715  }
2716  }
2717 
2718  const ::uno::Any* pStyle;
2719  SwFrameFormat *pParentFrameFormat = nullptr;
2720  if (m_pProps->GetProperty(FN_UNO_FRAME_STYLE_NAME, 0, pStyle))
2721  pParentFrameFormat = lcl_GetFrameFormat( *pStyle, pDoc );
2722 
2723  SwFlyFrameFormat* pFormat = nullptr;
2724  if( eType == FLYCNTTYPE_FRM)
2725  {
2726  UnoActionContext aCont(pDoc);
2727  if(m_pCopySource)
2728  {
2729  std::unique_ptr<SwFormatAnchor> pAnchorItem;
2730  // the frame is inserted bound to page
2731  // to prevent conflicts if the to-be-anchored position is part of the to-be-copied text
2732  if (eAnchorId != RndStdIds::FLY_AT_PAGE)
2733  {
2734  pAnchorItem.reset(static_cast<SwFormatAnchor*>(aFrameSet.Get(RES_ANCHOR).Clone()));
2735  aFrameSet.Put( SwFormatAnchor( RndStdIds::FLY_AT_PAGE, 1 ));
2736  }
2737 
2738  aPam.DeleteMark(); // mark position node will be deleted!
2739  aIntPam.DeleteMark(); // mark position node will be deleted!
2740  pFormat = pDoc->MakeFlyAndMove( *m_pCopySource, aFrameSet,
2741  nullptr,
2742  pParentFrameFormat );
2743  if(pAnchorItem && pFormat)
2744  {
2745  pFormat->DelFrames();
2746  pAnchorItem->SetAnchor( m_pCopySource->Start() );
2748  aAnchorSet.Put( *pAnchorItem );
2749  pDoc->SetFlyFrameAttr( *pFormat, aAnchorSet );
2750  }
2751  m_pCopySource.reset();
2752  }
2753  else
2754  {
2755  pFormat = pDoc->MakeFlySection( RndStdIds::FLY_AT_PARA, aPam.GetPoint(),
2756  &aFrameSet, pParentFrameFormat );
2757  }
2758  if(pFormat)
2759  {
2760  pFormat->Add(this);
2761  if(!m_sName.isEmpty())
2762  pDoc->SetFlyName(*pFormat, m_sName);
2763  }
2764  // wake up the SwXTextFrame
2765  static_cast<SwXTextFrame*>(this)->SetDoc( bIsDescriptor ? m_pDoc : GetFrameFormat()->GetDoc() );
2766  }
2767  else if( eType == FLYCNTTYPE_GRF)
2768  {
2769  UnoActionContext aActionContext(pDoc);
2770  Graphic aGraphic;
2771 
2772  // Read graphic URL from the descriptor, if it has any.
2773  const ::uno::Any* pGraphicURL;
2774  if (m_pProps->GetProperty(FN_UNO_GRAPHIC_URL, 0, pGraphicURL))
2775  {
2776  OUString sGraphicURL;
2777  uno::Reference<awt::XBitmap> xBitmap;
2778  if (((*pGraphicURL) >>= sGraphicURL) && !sGraphicURL.isEmpty())
2779  aGraphic = vcl::graphic::loadFromURL(sGraphicURL);
2780  else if ((*pGraphicURL) >>= xBitmap)
2781  {
2782  uno::Reference<graphic::XGraphic> xGraphic(xBitmap, uno::UNO_QUERY);
2783  if (xGraphic.is())
2784  aGraphic = xGraphic;
2785  }
2786  }
2787 
2788  const ::uno::Any* pGraphicAny;
2789  const bool bHasGraphic = m_pProps->GetProperty(FN_UNO_GRAPHIC, 0, pGraphicAny);
2790  if (bHasGraphic)
2791  {
2792  uno::Reference<graphic::XGraphic> xGraphic;
2793  (*pGraphicAny) >>= xGraphic;
2794  aGraphic = Graphic(xGraphic);
2795  }
2796 
2797  OUString sFilterName;
2798  const uno::Any* pFilterAny;
2799  if (m_pProps->GetProperty(FN_UNO_GRAPHIC_FILTER, 0, pFilterAny))
2800  {
2801  (*pFilterAny) >>= sFilterName;
2802  }
2803 
2804  pFormat = pDoc->getIDocumentContentOperations().InsertGraphic(
2805  aPam, OUString(), sFilterName, &aGraphic, &aFrameSet, &aGrSet, pParentFrameFormat);
2806  if (pFormat)
2807  {
2808  SwGrfNode *pGrfNd = pDoc->GetNodes()[ pFormat->GetContent().GetContentIdx()
2809  ->GetIndex()+1 ]->GetGrfNode();
2810  if (pGrfNd)
2811  pGrfNd->SetChgTwipSize( !bSizeFound );
2812  pFormat->Add(this);
2813  if(!m_sName.isEmpty())
2814  pDoc->SetFlyName(*pFormat, m_sName);
2815 
2816  }
2817  const ::uno::Any* pSurroundContour;
2818  if (m_pProps->GetProperty(RES_SURROUND, MID_SURROUND_CONTOUR, pSurroundContour))
2819  setPropertyValue(UNO_NAME_SURROUND_CONTOUR, *pSurroundContour);
2820  const ::uno::Any* pContourOutside;
2821  if (m_pProps->GetProperty(RES_SURROUND, MID_SURROUND_CONTOUROUTSIDE, pContourOutside))
2822  setPropertyValue(UNO_NAME_CONTOUR_OUTSIDE, *pContourOutside);
2823  const ::uno::Any* pContourPoly;
2824  if (m_pProps->GetProperty(FN_PARAM_CONTOUR_PP, 0, pContourPoly))
2826  const ::uno::Any* pPixelContour;
2827  if (m_pProps->GetProperty(FN_UNO_IS_PIXEL_CONTOUR, 0, pPixelContour))
2829  const ::uno::Any* pAutoContour;
2830  if (m_pProps->GetProperty(FN_UNO_IS_AUTOMATIC_CONTOUR, 0, pAutoContour))
2832  }
2833  else
2834  {
2835  const ::uno::Any* pCLSID = nullptr;
2836  const ::uno::Any* pStreamName = nullptr;
2837  const ::uno::Any* pEmbeddedObject = nullptr;
2838  if (!m_pProps->GetProperty(FN_UNO_CLSID, 0, pCLSID)
2839  && !m_pProps->GetProperty(FN_UNO_STREAM_NAME, 0, pStreamName)
2840  && !m_pProps->GetProperty(FN_EMBEDDED_OBJECT, 0, pEmbeddedObject))
2841  {
2842  throw uno::RuntimeException();
2843  }
2844  if(pCLSID)
2845  {
2846  OUString aCLSID;
2847  SvGlobalName aClassName;
2848  uno::Reference < embed::XEmbeddedObject > xIPObj;
2849  std::unique_ptr < comphelper::EmbeddedObjectContainer > pCnt;
2850  if( (*pCLSID) >>= aCLSID )
2851  {
2852  if( !aClassName.MakeId( aCLSID ) )
2853  {
2854  lang::IllegalArgumentException aExcept;
2855  aExcept.Message = "CLSID invalid";
2856  throw aExcept;
2857  }
2858 
2859  pCnt.reset( new comphelper::EmbeddedObjectContainer );
2860  OUString aName;
2861 
2862  OUString sDocumentBaseURL = pDoc->GetPersist()->getDocumentBaseURL();
2863  xIPObj = pCnt->CreateEmbeddedObject(aClassName.GetByteSequence(), aName,
2864  &sDocumentBaseURL);
2865  }
2866  if ( xIPObj.is() )
2867  {
2868  UnoActionContext aAction(pDoc);
2870 
2871  // tdf#99631 set imported VisibleArea settings of embedded XLSX OLE objects
2872  if ( m_nDrawAspect == embed::Aspects::MSOLE_CONTENT
2874  {
2875  sal_Int64 nAspect = m_nDrawAspect;
2876  MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xIPObj->getMapUnit( nAspect ) );
2878  MapMode(MapUnit::MapTwip), MapMode(aUnit)));
2879  awt::Size aSz;
2880  aSz.Width = aSize.Width();
2881  aSz.Height = aSize.Height();
2882  xIPObj->setVisualAreaSize(m_nDrawAspect, aSz);
2883  }
2884 
2885  if(!bSizeFound)
2886  {
2887  //TODO/LATER: how do I transport it to the OLENode?
2888  sal_Int64 nAspect = m_nDrawAspect;
2889 
2890  // TODO/LEAN: VisualArea still needs running state
2892 
2893  // set parent to get correct VisArea(in case of object needing parent printer)
2894  uno::Reference < container::XChild > xChild( xIPObj, uno::UNO_QUERY );
2895  if ( xChild.is() )
2896  xChild->setParent( pDoc->GetDocShell()->GetModel() );
2897 
2898  //The Size should be suggested by the OLE server if not manually set
2899  MapUnit aRefMap = VCLUnoHelper::UnoEmbed2VCLMapUnit( xIPObj->getMapUnit( nAspect ) );
2900  awt::Size aSize;
2901  try
2902  {
2903  aSize = xIPObj->getVisualAreaSize( nAspect );
2904  }
2905  catch ( embed::NoVisualAreaSizeException& )
2906  {
2907  // the default size will be set later
2908  }
2909 
2910  Size aSz( aSize.Width, aSize.Height );
2911  if ( !aSz.Width() || !aSz.Height() )
2912  {
2913  aSz.setWidth(5000);
2914  aSz.setHeight(5000);
2915  aSz = OutputDevice::LogicToLogic(aSz,
2916  MapMode(MapUnit::Map100thMM), MapMode(aRefMap));
2917  }
2918  MapMode aMyMap( MapUnit::MapTwip );
2919  aSz = OutputDevice::LogicToLogic(aSz, MapMode(aRefMap), aMyMap);
2920  SwFormatFrameSize aFrameSz;
2921  aFrameSz.SetSize(aSz);
2922  aFrameSet.Put(aFrameSz);
2923  }
2924  SwFlyFrameFormat* pFormat2 = nullptr;
2925 
2926  ::svt::EmbeddedObjectRef xObjRef( xIPObj, m_nDrawAspect);
2928  aPam, xObjRef, &aFrameSet );
2929 
2930  // store main document name to show in the title bar
2931  uno::Reference< frame::XTitle > xModelTitle( pDoc->GetDocShell()->GetModel(), css::uno::UNO_QUERY );
2932  if( xModelTitle.is() )
2933  xIPObj->setContainerName( xModelTitle->getTitle() );
2934 
2935  assert(pFormat2 && "Doc->Insert(notxt) failed.");
2936 
2937  pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
2938  pFormat2->Add(this);
2939  if(!m_sName.isEmpty())
2940  pDoc->SetFlyName(*pFormat2, m_sName);
2941  }
2942  }
2943  else if( pStreamName )
2944  {
2945  OUString sStreamName;
2946  (*pStreamName) >>= sStreamName;
2948 
2950  aPam, sStreamName, m_nDrawAspect, &aFrameSet, nullptr);
2951 
2952  // store main document name to show in the title bar
2953  SwOLENode* pNd = nullptr;
2954  const SwNodeIndex* pIdx = pFrameFormat->GetContent().GetContentIdx();
2955  if( pIdx )
2956  {
2957  SwNodeIndex aIdx( *pIdx, 1 );
2958  SwNoTextNode* pNoText = aIdx.GetNode().GetNoTextNode();
2959  pNd = pNoText->GetOLENode();
2960  }
2961  if( pNd )
2962  {
2963  uno::Reference < embed::XEmbeddedObject > xObj = pNd->GetOLEObj().GetOleRef();
2964  if( xObj.is() )
2965  {
2966  uno::Reference< frame::XTitle > xModelTitle( pDoc->GetDocShell()->GetModel(), css::uno::UNO_QUERY );
2967  if( xModelTitle.is() )
2968  xObj->setContainerName( xModelTitle->getTitle() );
2969  }
2970  }
2971 
2972  pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
2973  pFrameFormat->Add(this);
2974  if(!m_sName.isEmpty())
2975  pDoc->SetFlyName(*pFrameFormat, m_sName);
2976  }
2977  else if (pEmbeddedObject)
2978  {
2979  uno::Reference< embed::XEmbeddedObject > obj;
2980  (*pEmbeddedObject) >>= obj;
2982  xObj.Assign( obj, embed::Aspects::MSOLE_CONTENT );
2983 
2985 
2986  // Not sure if these setParent() and InsertEmbeddedObject() calls are really
2987  // needed, it seems to work without, but logic from code elsewhere suggests
2988  // they should be done.
2989  SfxObjectShell& rPers = *pDoc->GetPersist();
2990  uno::Reference < container::XChild > xChild( obj, uno::UNO_QUERY );
2991  if ( xChild.is() )
2992  xChild->setParent( rPers.GetModel() );
2993  OUString rName;
2994  rPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( obj, rName );
2995 
2996  SwFlyFrameFormat* pFrameFormat
2997  = pDoc->getIDocumentContentOperations().InsertEmbObject(aPam, xObj, &aFrameSet);
2998  pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT, nullptr);
2999  pFrameFormat->Add(this);
3000  if(!m_sName.isEmpty())
3001  pDoc->SetFlyName(*pFrameFormat, m_sName);
3002  }
3003  }
3004  if( pFormat && pDoc->getIDocumentDrawModelAccess().GetDrawModel() )
3005  GetOrCreateSdrObject(*pFormat);
3006  const ::uno::Any* pOrder;
3007  if (m_pProps->GetProperty(FN_UNO_Z_ORDER, 0, pOrder))
3009  const ::uno::Any* pReplacement;
3010  if (m_pProps->GetProperty(FN_UNO_REPLACEMENT_GRAPHIC, 0, pReplacement))
3011  setPropertyValue(UNO_NAME_GRAPHIC, *pReplacement);
3012  // new attribute Title
3013  const ::uno::Any* pTitle;
3014  if (m_pProps->GetProperty(FN_UNO_TITLE, 0, pTitle))
3015  {
3016  setPropertyValue(UNO_NAME_TITLE, *pTitle);
3017  }
3018  // new attribute Description
3019  const ::uno::Any* pDescription;
3020  if (m_pProps->GetProperty(FN_UNO_DESCRIPTION, 0, pDescription))
3021  {
3022  setPropertyValue(UNO_NAME_DESCRIPTION, *pDescription);
3023  }
3024 
3025  // For grabbag
3026  const uno::Any* pFrameIntropgrabbagItem;
3027  if (m_pProps->GetProperty(RES_FRMATR_GRABBAG, 0, pFrameIntropgrabbagItem))
3028  {
3029  setPropertyValue(UNO_NAME_FRAME_INTEROP_GRAB_BAG, *pFrameIntropgrabbagItem);
3030  }
3031 
3032  // reset the flag and delete Descriptor pointer
3033  ResetDescriptor();
3034 }
3035 
3036 void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
3037 {
3038  SwFrameFormat* pFormat;
3039  if(IsDescriptor())
3040  attachToRange(xTextRange);
3041  else if(nullptr != (pFormat = GetFrameFormat()))
3042  {
3043  SwDoc* pDoc = pFormat->GetDoc();
3044  SwUnoInternalPaM aIntPam(*pDoc);
3045  if (!::sw::XTextRangeToSwPaM(aIntPam, xTextRange))
3046  throw lang::IllegalArgumentException();
3047 
3049  aSet.SetParent(&pFormat->GetAttrSet());
3050  SwFormatAnchor aAnchor = aSet.Get(RES_ANCHOR);
3051  aAnchor.SetAnchor( aIntPam.Start() );
3052  aSet.Put(aAnchor);
3053  pDoc->SetFlyFrameAttr( *pFormat, aSet );
3054 
3055  }
3056 }
3057 
3059 {
3060  SolarMutexGuard aGuard;
3061  uno::RuntimeException aRuntime;
3062  aRuntime.Message = "position cannot be determined with this method";
3063  throw aRuntime;
3064 }
3065 
3066 void SwXFrame::setPosition(const awt::Point& /*aPosition*/)
3067 {
3068  SolarMutexGuard aGuard;
3069  uno::RuntimeException aRuntime;
3070  aRuntime.Message = "position cannot be changed with this method";
3071  throw aRuntime;
3072 }
3073 
3075 {
3076  const ::uno::Any aVal = getPropertyValue("Size");
3077  awt::Size const * pRet = o3tl::doAccess<awt::Size>(aVal);
3078  return *pRet;
3079 }
3080 
3081 void SwXFrame::setSize(const awt::Size& aSize)
3082 {
3083  const ::uno::Any aVal(&aSize, ::cppu::UnoType<awt::Size>::get());
3084  setPropertyValue("Size", aVal);
3085 }
3086 
3088 {
3089  return OUString("FrameShape");
3090 }
3091 
3093  SwXText(nullptr, CursorType::Frame),
3095 {
3096 }
3097 
3099  SwXText(rFormat.GetDoc(), CursorType::Frame),
3101 {
3102 
3103 }
3104 
3106 {
3107 }
3108 
3109 uno::Reference<text::XTextFrame>
3111 {
3112  return CreateXFrame<text::XTextFrame, SwXTextFrame>(rDoc, pFrameFormat);
3113 }
3114 
3115 void SAL_CALL SwXTextFrame::acquire( )throw()
3116 {
3117  SwXFrame::acquire();
3118 }
3119 
3120 void SAL_CALL SwXTextFrame::release( )throw()
3121 {
3122  SwXFrame::release();
3123 }
3124 
3126 {
3127  ::uno::Any aRet = SwXFrame::queryInterface(aType);
3128  if(aRet.getValueType() == cppu::UnoType<void>::get())
3129  aRet = SwXText::queryInterface(aType);
3130  if(aRet.getValueType() == cppu::UnoType<void>::get())
3131  aRet = SwXTextFrameBaseClass::queryInterface(aType);
3132  return aRet;
3133 }
3134 
3135 uno::Sequence< uno::Type > SAL_CALL SwXTextFrame::getTypes( )
3136 {
3138  SwXTextFrameBaseClass::getTypes(),
3139  SwXFrame::getTypes(),
3141  );
3142 }
3143 
3144 uno::Sequence< sal_Int8 > SAL_CALL SwXTextFrame::getImplementationId( )
3145 {
3146  return css::uno::Sequence<sal_Int8>();
3147 }
3148 
3149 uno::Reference< text::XText > SwXTextFrame::getText()
3150 {
3151  return this;
3152 }
3153 
3155 {
3156  const SwStartNode *pSttNd = nullptr;
3157 
3158  const SwFrameFormat* pFormat = GetFrameFormat();
3159  if(pFormat)
3160  {
3161  const SwFormatContent& rFlyContent = pFormat->GetContent();
3162  if( rFlyContent.GetContentIdx() )
3163  pSttNd = rFlyContent.GetContentIdx()->GetNode().GetStartNode();
3164  }
3165 
3166  return pSttNd;
3167 }
3168 
3169 uno::Reference< text::XTextCursor >
3171 {
3172  return createTextCursor();
3173 }
3174 
3175 uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursor()
3176 {
3177  SolarMutexGuard aGuard;
3178  uno::Reference< text::XTextCursor > aRef;
3179  SwFrameFormat* pFormat = GetFrameFormat();
3180  if(!pFormat)
3181  throw uno::RuntimeException();
3182 
3183  //save current start node to be able to check if there is content after the table -
3184  //otherwise the cursor would be in the body text!
3185  const SwNode& rNode = pFormat->GetContent().GetContentIdx()->GetNode();
3186  const SwStartNode* pOwnStartNode = rNode.FindSttNodeByType(SwFlyStartNode);
3187 
3188  SwPaM aPam(rNode);
3189  aPam.Move(fnMoveForward, GoInNode);
3190  SwTableNode* pTableNode = aPam.GetNode().FindTableNode();
3191  SwContentNode* pCont = nullptr;
3192  while( pTableNode )
3193  {
3194  aPam.GetPoint()->nNode = *pTableNode->EndOfSectionNode();
3195  pCont = GetDoc()->GetNodes().GoNext(&aPam.GetPoint()->nNode);
3196  pTableNode = pCont->FindTableNode();
3197  }
3198  if(pCont)
3199  aPam.GetPoint()->nContent.Assign(pCont, 0);
3200 
3201  const SwStartNode* pNewStartNode =
3203  if(!pNewStartNode || pNewStartNode != pOwnStartNode)
3204  {
3205  uno::RuntimeException aExcept;
3206  aExcept.Message = "no text available";
3207  throw aExcept;
3208  }
3209 
3210  SwXTextCursor *const pXCursor = new SwXTextCursor(
3211  *pFormat->GetDoc(), this, CursorType::Frame, *aPam.GetPoint());
3212  aRef = static_cast<text::XWordCursor*>(pXCursor);
3213 
3214  return aRef;
3215 }
3216 
3217 uno::Reference< text::XTextCursor > SwXTextFrame::createTextCursorByRange(const uno::Reference< text::XTextRange > & aTextPosition)
3218 {
3219  SolarMutexGuard aGuard;
3220  SwFrameFormat* pFormat = GetFrameFormat();
3221  if (!pFormat)
3222  throw uno::RuntimeException();
3223  SwUnoInternalPaM aPam(*GetDoc());
3224  if (!::sw::XTextRangeToSwPaM(aPam, aTextPosition))
3225  throw uno::RuntimeException();
3226 
3227  uno::Reference<text::XTextCursor> aRef;
3228  SwNode& rNode = pFormat->GetContent().GetContentIdx()->GetNode();
3229  if(aPam.GetNode().FindFlyStartNode() == rNode.FindFlyStartNode())
3230  {
3231  aRef = static_cast<text::XWordCursor*>(
3232  new SwXTextCursor(*pFormat->GetDoc(), this, CursorType::Frame,
3233  *aPam.GetPoint(), aPam.GetMark()));
3234  }
3235 
3236  return aRef;
3237 }
3238 
3239 uno::Reference< container::XEnumeration > SwXTextFrame::createEnumeration()
3240 {
3241  SolarMutexGuard aGuard;
3242  SwFrameFormat* pFormat = GetFrameFormat();
3243  if(!pFormat)
3244  return nullptr;
3245  SwPosition aPos(pFormat->GetContent().GetContentIdx()->GetNode());
3246  auto pUnoCursor(GetDoc()->CreateUnoCursor(aPos));
3247  pUnoCursor->Move(fnMoveForward, GoInNode);
3248  return SwXParagraphEnumeration::Create(this, pUnoCursor, CursorType::Frame);
3249 }
3250 
3252 {
3254 }
3255 
3257 {
3258  return true;
3259 }
3260 
3261 void SwXTextFrame::attach(const uno::Reference< text::XTextRange > & xTextRange)
3262 {
3263  SwXFrame::attach(xTextRange);
3264 }
3265 
3266 uno::Reference< text::XTextRange > SwXTextFrame::getAnchor()
3267 {
3268  SolarMutexGuard aGuard;
3269  return SwXFrame::getAnchor();
3270 }
3271 
3273 {
3274  SolarMutexGuard aGuard;
3276 }
3277 
3278 void SwXTextFrame::addEventListener(const uno::Reference< lang::XEventListener > & aListener)
3279 {
3280  SwXFrame::addEventListener(aListener);
3281 }
3282 
3283 void SwXTextFrame::removeEventListener(const uno::Reference< lang::XEventListener > & aListener)
3284 {
3285  SwXFrame::removeEventListener(aListener);
3286 }
3287 
3289 {
3290  return OUString("SwXTextFrame");
3291 }
3292 
3293 sal_Bool SwXTextFrame::supportsService(const OUString& rServiceName)
3294 {
3295  return cppu::supportsService(this, rServiceName);
3296 }
3297 
3298 uno::Sequence< OUString > SwXTextFrame::getSupportedServiceNames()
3299 {
3300  uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames();
3301  aRet.realloc(aRet.getLength() + 2);
3302  OUString* pArray = aRet.getArray();
3303  pArray[aRet.getLength() - 2] = "com.sun.star.text.TextFrame";
3304  pArray[aRet.getLength() - 1] = "com.sun.star.text.Text";
3305  return aRet;
3306 }
3307 
3308 uno::Reference<container::XNameReplace > SAL_CALL SwXTextFrame::getEvents()
3309 {
3310  return new SwFrameEventDescriptor( *this );
3311 }
3312 
3313 sal_Int64 SAL_CALL SwXTextFrame::getSomething( const uno::Sequence< sal_Int8 >& rId )
3314 {
3315  sal_Int64 nRet = SwXFrame::getSomething( rId );
3316  if( !nRet )
3317  nRet = SwXText::getSomething( rId );
3318 
3319  return nRet;
3320 }
3321 
3322 ::uno::Any SwXTextFrame::getPropertyValue(const OUString& rPropertyName)
3323 {
3324  SolarMutexGuard aGuard;
3325  ::uno::Any aRet;
3326  if(rPropertyName == UNO_NAME_START_REDLINE||
3327  rPropertyName == UNO_NAME_END_REDLINE)
3328  {
3329  //redline can only be returned if it's a living object
3330  if(!IsDescriptor())
3331  aRet = SwXText::getPropertyValue(rPropertyName);
3332  }
3333  else
3334  aRet = SwXFrame::getPropertyValue(rPropertyName);
3335  return aRet;
3336 }
3337 
3340  aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC), pDoc)
3341 {
3342 }
3343 
3346  aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_GRAPHIC))
3347 {
3348 }
3349 
3351 {
3352 }
3353 
3354 uno::Reference<text::XTextContent>
3356 {
3357  return CreateXFrame<text::XTextContent, SwXTextGraphicObject>(rDoc, pFrameFormat);
3358 }
3359 
3361 {
3362  return OUString("SwXTextGraphicObject");
3363 }
3364 
3366 {
3367  return cppu::supportsService(this, rServiceName);
3368 }
3369 
3371 {
3372  uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames();
3373  aRet.realloc(aRet.getLength() + 1);
3374  OUString* pArray = aRet.getArray();
3375  pArray[aRet.getLength() - 1] = "com.sun.star.text.TextGraphicObject";
3376  return aRet;
3377 }
3378 
3379 uno::Reference<container::XNameReplace> SAL_CALL
3381 {
3382  return new SwFrameEventDescriptor( *this );
3383 }
3384 
3387  aSwMapProvider.GetPropertySet(PROPERTY_MAP_EMBEDDED_OBJECT), pDoc)
3388 {
3389 }
3390 
3394 {
3395 }
3396 
3398 {
3399 }
3400 
3401 uno::Reference<text::XTextContent>
3403 {
3404  return CreateXFrame<text::XTextContent, SwXTextEmbeddedObject>(rDoc, pFrameFormat);
3405 }
3406 
3407 uno::Reference< lang::XComponent > SwXTextEmbeddedObject::getEmbeddedObject()
3408 {
3409  uno::Reference<embed::XEmbeddedObject> xObj(getExtendedControlOverEmbeddedObject());
3410  return xObj.is() ? uno::Reference<lang::XComponent>(xObj->getComponent(), uno::UNO_QUERY) : nullptr;
3411 }
3412 
3413 uno::Reference< embed::XEmbeddedObject > SAL_CALL SwXTextEmbeddedObject::getExtendedControlOverEmbeddedObject()
3414 {
3415  uno::Reference< embed::XEmbeddedObject > xResult;
3416  SwFrameFormat* pFormat = GetFrameFormat();
3417  if(pFormat)
3418  {
3419  SwDoc* pDoc = pFormat->GetDoc();
3420  const SwFormatContent* pCnt = &pFormat->GetContent();
3421  OSL_ENSURE( pCnt->GetContentIdx() &&
3422  pDoc->GetNodes()[ pCnt->GetContentIdx()->
3423  GetIndex() + 1 ]->GetOLENode(), "no OLE-Node?");
3424 
3425  SwOLENode* pOleNode = pDoc->GetNodes()[ pCnt->GetContentIdx()
3426  ->GetIndex() + 1 ]->GetOLENode();
3427  xResult = pOleNode->GetOLEObj().GetOleRef();
3428  if ( svt::EmbeddedObjectRef::TryRunningState( xResult ) )
3429  {
3430  // TODO/LATER: the listener registered after client creation should be able to handle scaling, after that the client is not necessary here
3431  if ( pDoc->GetDocShell() )
3432  pDoc->GetDocShell()->GetIPClient( svt::EmbeddedObjectRef( xResult, embed::Aspects::MSOLE_CONTENT ) );
3433 
3434  uno::Reference < lang::XComponent > xComp( xResult->getComponent(), uno::UNO_QUERY );
3435  uno::Reference< util::XModifyBroadcaster > xBrdcst( xComp, uno::UNO_QUERY);
3436  uno::Reference< frame::XModel > xModel( xComp, uno::UNO_QUERY);
3437  if(xBrdcst.is() && xModel.is() && !m_xOLEListener.is())
3438  {
3439  m_xOLEListener = new SwXOLEListener(*pFormat, xModel);
3440  xBrdcst->addModifyListener( m_xOLEListener );
3441  }
3442  }
3443  }
3444  return xResult;
3445 }
3446 
3448 {
3449  SwFrameFormat* pFormat = GetFrameFormat();
3450  if(pFormat)
3451  {
3452  SwDoc* pDoc = pFormat->GetDoc();
3453  const SwFormatContent* pCnt = &pFormat->GetContent();
3454  OSL_ENSURE( pCnt->GetContentIdx() &&
3455  pDoc->GetNodes()[ pCnt->GetContentIdx()->
3456  GetIndex() + 1 ]->GetOLENode(), "no OLE-Node?");
3457 
3458  return pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ]->GetOLENode()->GetAspect();
3459  }
3460 
3461  return embed::Aspects::MSOLE_CONTENT; // return the default value
3462 }
3463 
3464 void SAL_CALL SwXTextEmbeddedObject::setAspect( sal_Int64 nAspect )
3465 {
3466  SwFrameFormat* pFormat = GetFrameFormat();
3467  if(pFormat)
3468  {
3469  SwDoc* pDoc = pFormat->GetDoc();
3470  const SwFormatContent* pCnt = &pFormat->GetContent();
3471  OSL_ENSURE( pCnt->GetContentIdx() &&
3472  pDoc->GetNodes()[ pCnt->GetContentIdx()->
3473  GetIndex() + 1 ]->GetOLENode(), "no OLE-Node?");
3474 
3475  pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ]->GetOLENode()->SetAspect( nAspect );
3476  }
3477 }
3478 
3479 uno::Reference< graphic::XGraphic > SAL_CALL SwXTextEmbeddedObject::getReplacementGraphic()
3480 {
3481  SwFrameFormat* pFormat = GetFrameFormat();
3482  if(pFormat)
3483  {
3484  SwDoc* pDoc = pFormat->GetDoc();
3485  const SwFormatContent* pCnt = &pFormat->GetContent();
3486  OSL_ENSURE( pCnt->GetContentIdx() &&
3487  pDoc->GetNodes()[ pCnt->GetContentIdx()->
3488  GetIndex() + 1 ]->GetOLENode(), "no OLE-Node?");
3489 
3490  const Graphic* pGraphic = pDoc->GetNodes()[ pCnt->GetContentIdx()->GetIndex() + 1 ]->GetOLENode()->GetGraphic();
3491  if ( pGraphic )
3492  return pGraphic->GetXGraphic();
3493  }
3494 
3495  return uno::Reference< graphic::XGraphic >();
3496 }
3497 
3499 {
3500  return OUString("SwXTextEmbeddedObject");
3501 }
3502 
3504 {
3505  return cppu::supportsService(this, rServiceName);
3506 }
3507 
3509 {
3510  uno::Sequence < OUString > aRet = SwXFrame::getSupportedServiceNames();
3511  aRet.realloc(aRet.getLength() + 1);
3512  OUString* pArray = aRet.getArray();
3513  pArray[aRet.getLength() - 1] = "com.sun.star.text.TextEmbeddedObject";
3514  return aRet;
3515 }
3516 
3517 uno::Reference<container::XNameReplace> SAL_CALL
3519 {
3520  return new SwFrameEventDescriptor( *this );
3521 }
3522 
3523 namespace
3524 {
3525  SwOLENode* lcl_GetOLENode(const SwFormat* pFormat)
3526  {
3527  if(!pFormat)
3528  return nullptr;
3529  const SwNodeIndex* pIdx(pFormat->GetContent().GetContentIdx());
3530  if(!pIdx)
3531  return nullptr;
3532  const SwNodeIndex aIdx(*pIdx, 1);
3533  return aIdx.GetNode().GetNoTextNode()->GetOLENode();
3534  }
3535 }
3536 
3537 SwXOLEListener::SwXOLEListener( SwFormat& rOLEFormat, uno::Reference< XModel > const & xOLE)
3538  : m_pOLEFormat(&rOLEFormat)
3539  , m_xOLEModel(xOLE)
3540 {
3542 }
3543 
3545 {}
3546 
3547 void SwXOLEListener::modified( const lang::EventObject& /*rEvent*/ )
3548 {
3549  SolarMutexGuard aGuard;
3550  const auto pNd = lcl_GetOLENode(m_pOLEFormat);
3551  if(!pNd)
3552  throw uno::RuntimeException();
3553  const auto xIP = pNd->GetOLEObj().GetOleRef();
3554  if(xIP.is())
3555  {
3556  sal_Int32 nState = xIP->getCurrentState();
3557  if(nState == embed::EmbedStates::INPLACE_ACTIVE || nState == embed::EmbedStates::UI_ACTIVE)
3558  // if the OLE-Node is UI-Active do nothing
3559  return;
3560  }
3561  pNd->SetOLESizeInvalid(true);
3562  pNd->GetDoc()->SetOLEObjModified();
3563 }
3564 
3565 void SwXOLEListener::disposing( const lang::EventObject& rEvent )
3566 {
3567  SolarMutexGuard aGuard;
3568  uno::Reference<util::XModifyListener> xListener( this );
3569  uno::Reference<frame::XModel> xModel(rEvent.Source, uno::UNO_QUERY);
3570  uno::Reference<util::XModifyBroadcaster> xBrdcst(xModel, uno::UNO_QUERY);
3571  if(!xBrdcst.is())
3572  return;
3573  try
3574  {
3575  xBrdcst->removeModifyListener(xListener);
3576  }
3577  catch(uno::Exception const &)
3578  {
3579  OSL_FAIL("OLE Listener couldn't be removed");
3580  }
3581 }
3582 
3583 void SwXOLEListener::Notify( const SfxHint& rHint )
3584 {
3585  if(rHint.GetId() == SfxHintId::Dying)
3586  {
3587  m_xOLEModel = nullptr;
3588  m_pOLEFormat = nullptr;
3589  }
3590 }
3591 
3592 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SwStartNode * FindSttNodeByType(SwStartNodeType eTyp)
Definition: node.cxx:755
#define UNO_NAME_CONTOUR_OUTSIDE
Definition: unoprnms.hxx:241
#define MID_FILLGRADIENT
sal_uInt16 Count() const
long Width() const
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:682
Starts a section of nodes in the document model.
Definition: node.hxx:303
virtual bool AnyToItemSet(SwDoc *pDoc, SfxItemSet &rFrameSet, SfxItemSet &rSet, bool &rSizeFound) override
Definition: unoframe.cxx:1137
virtual OUString SAL_CALL getImplementationName() override
Definition: unoframe.cxx:1185
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Base class for the following contact objects (frame + draw objects).
Definition: dcontact.hxx:66
Base class of the Writer layout elements.
Definition: frame.hxx:295
static SwFrameFormat * lcl_GetFrameFormat(const ::uno::Any &rValue, SwDoc *pDoc)
Definition: unoframe.cxx:1392
virtual ~SwXOLEListener() override
Definition: unoframe.cxx:3544
void DeleteMark()
Definition: pam.hxx:177
#define RES_GRFATR_END
Definition: hintids.hxx:258
#define RES_FRM_SIZE
Definition: hintids.hxx:194
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:223
#define RES_COL
Definition: hintids.hxx:214
SwFlyDrawContact * GetOrCreateContact()
Definition: atrfrm.cxx:2832
#define XATTR_FILLHATCH
bool hasValue()
void Add(SwClient *pDepend)
Definition: calbck.cxx:217
virtual const SwDoc * GetDoc() const =0
const tools::Polygon & GetObject(sal_uInt16 nPos) const
#define RES_URL
Definition: hintids.hxx:216
#define MID_SURROUND_SURROUNDTYPE
Definition: unomid.h:29
virtual void SAL_CALL setName(const OUString &Name_) override
Definition: unoframe.cxx:1316
virtual void SAL_CALL setSize(const css::awt::Size &aSize) override
Definition: unoframe.cxx:3081
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
Marks a position in the document model.
Definition: pam.hxx:35
#define RES_EDIT_IN_READONLY
Definition: hintids.hxx:217
#define FN_UNO_VISIBLE_AREA_WIDTH
Definition: cmdid.h:608
void SvxUnoConvertFromMM(const MapUnit eDestinationMapUnit, uno::Any &rMetric)
OUString GetObjDescription() const
Definition: atrfrm.cxx:3138
SfxInPlaceClient * GetIPClient(const ::svt::EmbeddedObjectRef &xObjRef)
Definition: docsh2.cxx:1658
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:157
#define UNO_NAME_SURROUND_CONTOUR
Definition: unoprnms.hxx:317
bool HasAutomaticContour() const
Definition: ndnotxt.hxx:78
#define XATTR_FILLBMP_POSOFFSETX
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:110
CursorType
#define FN_EMBEDDED_OBJECT
Definition: cmdid.h:598
void SetSelection(SwPaM &rCopySource)
Definition: unoframe.cxx:1363
virtual bool AnyToItemSet(SwDoc *pDoc, SfxItemSet &rFrameSet, SfxItemSet &rSet, bool &rSizeFound)=0
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
Definition: unoframe.cxx:2334
#define MID_PROTECT_POSITION
virtual SwFlyFrameFormat * InsertGraphic(const SwPaM &rRg, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet, SwFrameFormat *)=0
Insert graphic or formula.
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
#define RES_HORI_ORIENT
Definition: hintids.hxx:208
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoframe.cxx:3508
#define WID_LAYOUT_SIZE
Definition: unomap.hxx:292
Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
#define MID_FRMSIZE_SIZE_TYPE
Definition: unomid.h:76
bool IsNone() const
#define RES_FRMATR_GRABBAG
Definition: hintids.hxx:234
#define MID_NAME
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
long Height() const
#define COL_DEFAULT_SHAPE_FILLING
Frame
signed char sal_Int8
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: unoframe.cxx:2316
#define MID_FTF_LAYOUT_IN_CELL
Definition: unomid.h:152
SwNodeIndex nNode
Definition: pam.hxx:37
#define UNO_NAME_END_REDLINE
Definition: unoprnms.hxx:559
SAL_DLLPRIVATE css::uno::WeakReference< css::uno::XInterface > const & GetXObject() const
Definition: frmfmt.hxx:167
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
Definition: unoframe.cxx:3380
#define RES_SHADOW
Definition: hintids.hxx:212
#define MID_FRMSIZE_IS_SYNC_WIDTH_TO_HEIGHT
Definition: unomid.h:84
#define MID_FRMSIZE_REL_WIDTH
Definition: unomid.h:72
sal_uInt16 GetPageNum() const
Definition: fmtanchr.hxx:66
virtual Size GetTwipSize() const =0
#define MINFLY
Definition: swtypes.hxx:65
#define SAL_INFO_IF(condition, area, stream)
std::unique_ptr< BaseFrameProperties_Impl > m_pProps
Definition: unoframe.hxx:69
const SwFrameFormat * GetFrameFormat() const
Definition: unoframe.hxx:150
virtual css::uno::Reference< css::embed::XEmbeddedObject > SAL_CALL getExtendedControlOverEmbeddedObject() override
Definition: unoframe.cxx:3413
Reference< XFrame > xFrame
#define RES_FRAMEDIR
Definition: hintids.hxx:225
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unoframe.cxx:3036
const SwPosition * GetMark() const
Definition: pam.hxx:209
#define RES_SURROUND
Definition: hintids.hxx:206
virtual SdrLayerID GetHeavenId() const =0
#define PROPERTY_MAP_TEXT_GRAPHIC
Definition: unomap.hxx:41
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:900
std::shared_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
#define FN_UNO_CLSID
Definition: cmdid.h:566
#define MID_VERTORIENT_RELATION
Definition: unomid.h:35
#define MID_URL_HYPERLINKNAME
Definition: unomid.h:47
#define RES_FRMATR_END
Definition: hintids.hxx:236
#define LINE_STYLE
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
#define XATTR_FILLGRADIENT
bool IsInserted() const
bool bIsDescriptor
Definition: unoframe.hxx:70
Definition: doc.hxx:185
#define FN_UNO_MODEL
Definition: cmdid.h:567
#define FN_UNO_VISIBLE_AREA_HEIGHT
Definition: cmdid.h:609
uno::WeakReference< uno::XInterface > m_wThis
Definition: unoframe.cxx:1157
SwFormat * m_pOLEFormat
Definition: unoframe.hxx:312
#define MID_GRAPHIC_TRANSPARENT
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
Definition: unoframe.cxx:3283
#define RIGHT_BORDER_DISTANCE
css::uno::Sequence< sal_Int8 > GetByteSequence() const
#define XATTR_FILLFLOATTRANSPARENCE
#define RES_GRFATR_CHANNELB
Definition: hintids.hxx:247
#define FN_UNO_STREAM_NAME
Definition: cmdid.h:580
SwNode & GetNode() const
Definition: ndindex.hxx:118
bool IsPixelContour() const
Definition: ndnotxt.cxx:215
SwDoc * m_pDoc
Definition: unoframe.hxx:64
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
#define MID_BACK_COLOR
const GraphicObject * GetReplacementGrfObj() const
Definition: ndgrf.cxx:380
virtual void SAL_CALL acquire() override
Definition: unoframe.cxx:3115
#define FN_UNO_ALTERNATIVE_TEXT
Definition: cmdid.h:556
#define MID_SURROUND_ANCHORONLY
Definition: unomid.h:30
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
css::uno::Reference< css::frame::XModel > GetModel() const
#define UNO_NAME_GRAPHIC
Definition: unoprnms.hxx:163
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
#define RES_WRAP_INFLUENCE_ON_OBJPOS
Definition: hintids.hxx:230
virtual SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)=0
Return required automatic format.
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
virtual const SwStartNode * GetStartNode() const override
Definition: unoframe.cxx:3154
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
void SetPoint(const Point &rPt, sal_uInt16 nPos)
virtual OUString getDocumentBaseURL() const override
#define RES_PROTECT
Definition: hintids.hxx:205
void ClientModify(SwClient *pClient, const SfxPoolItem *pOld, const SfxPoolItem *pNew)
helper function for implementing SwClient::Modify
Definition: unoobj2.cxx:312
Graphic loadFromURL(OUString const &rURL, weld::Window *pParentWin)
#define MID_GRAPHIC_TRANSPARENCY
#define MID_ANCHOR_PAGENUM
Definition: unomid.h:44
css::uno::Reference< css::beans::XPropertySetInfo > const & getPropertySetInfo() const
bool HasContour_() const
Definition: ndnotxt.hxx:73
#define UNO_NAME_ACTUAL_SIZE
Definition: unoprnms.hxx:307
#define RES_UNKNOWNATR_CONTAINER
Definition: hintids.hxx:267
SfxHintId GetId() const
#define LEFT_BORDER
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:167
css::uno::Reference< css::graphic::XGraphic > GetXGraphic() const
virtual void SAL_CALL dispose() override
Definition: unoframe.cxx:3272
#define XATTR_FILLBMP_STRETCH
static void lcl_FillMirror(SfxItemSet &rToSet, const ::SfxItemSet &rFromSet, const ::uno::Any *pHEvenMirror, const ::uno::Any *pHOddMirror, const ::uno::Any *pVMirror, bool &rRet)
Definition: unoframe.cxx:1042
virtual void SAL_CALL setPropertyToDefault(const OUString &PropertyName) override
Definition: unoframe.cxx:2428
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unotext.cxx:263
#define UNO_NAME_IS_PIXEL_CONTOUR
Definition: unoprnms.hxx:498
#define XATTR_FILLCOLOR
virtual ~SwXTextEmbeddedObject() override
Definition: unoframe.cxx:3397
#define RES_GRFATR_MIRRORGRF
Definition: hintids.hxx:239
static css::uno::Reference< Interface > CreateXFrame(SwDoc &rDoc, SwFrameFormat *const pFrameFormat)
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:187
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursor() override
Definition: unoframe.cxx:3175
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoframe.cxx:3298
SwChainRet Chain(SwFrameFormat &rSource, const SwFrameFormat &rDest)
Definition: docfly.cxx:1077
void ResetDescriptor()
Definition: unoframe.cxx:2627
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
virtual css::awt::Size SAL_CALL getSize() override
Definition: unoframe.cxx:3074
void SetChgTwipSize(bool b)
Definition: ndgrf.hxx:99
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
#define MID_FRMSIZE_HEIGHT
Definition: unomid.h:75
const SwDoc & GetDoc() const
Definition: unoobj2.cxx:806
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
Definition: unoframe.cxx:3547
SwFlyFrameFormat * MakeFlySection(RndStdIds eAnchorType, const SwPosition *pAnchorPos, const SfxItemSet *pSet=nullptr, SwFrameFormat *pParent=nullptr, bool bCalledFromShell=false)
Definition: doclay.cxx:302
css::uno::Reference< css::container::XNameAccess > mxStyleFamily
Definition: unoframe.hxx:81
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoframe.cxx:1195
#define UNO_NAME_CHAIN_NEXT_NAME
Definition: unoprnms.hxx:233
#define XATTR_FILL_LAST
bool isGRFATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:376
#define MID_FRMSIZE_SIZE
Definition: unomid.h:70
bool IsContourMapModeValid() const
Definition: ndnotxt.hxx:89
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoframe.cxx:3322
SwIndex nContent
Definition: pam.hxx:38
virtual ~SwXFrame() override
Definition: unoframe.cxx:1271
const SwRect & getFrameArea() const
Definition: frame.hxx:175
virtual bool QueryValue(css::uno::Any &rVal, sal_uInt8 nMemberId=0) const
#define XATTR_FILL_FIRST
#define MID_FOLLOW_TEXT_FLOW
Definition: unomid.h:151
#define X
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:458
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoframe.cxx:1190
svt::EmbeddedObjectRef & GetObject()
Definition: ndole.cxx:952
#define FN_PARAM_CONTOUR_PP
Definition: cmdid.h:781
const OUString & GetName() const
Definition: format.hxx:111
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
css::uno::Reference< css::beans::XPropertySet > mxStyleData
Definition: unoframe.hxx:80
virtual void DelLayoutFormat(SwFrameFormat *pFormat)=0
static bool isTextBox(const SwFrameFormat *pFormat, sal_uInt16 nType)
Is the frame format a text box?
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define XATTR_FILLBMP_TILEOFFSETY
SwFrameFormat * GetFrameFormat()
Definition: docstyle.cxx:2225
#define RES_GRFATR_LUMINANCE
Definition: hintids.hxx:243
virtual css::uno::Reference< css::text::XText > SAL_CALL getText() override
Definition: unoframe.cxx:3149
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unoframe.cxx:2606
void SetValue(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const css::uno::Any &rAny)
SwFlyFrameFormat * MakeFlyAndMove(const SwPaM &rPam, const SfxItemSet &rSet, const SwSelBoxes *pSelBoxes, SwFrameFormat *pParent)
Definition: doclay.cxx:357
#define RES_UL_SPACE
Definition: hintids.hxx:197
bool GetContourAPI(tools::PolyPolygon &rPoly) const
Definition: ndnotxt.cxx:181
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoframe.cxx:3293
void Insert(const tools::Polygon &rPoly, sal_uInt16 nPos=POLYPOLY_APPEND)
#define MID_FILLHATCH
const SwFormatSurround & GetSurround(bool=true) const
Definition: fmtsrnd.hxx:66
#define MID_MIRROR_HORZ_ODD_PAGES
Definition: unomid.h:24
const SfxPoolItem * GetDfltAttr(sal_uInt16 nWhich)
Get the default attribute from corresponding default attribute table.
Definition: hints.cxx:153
void SetFlyName(SwFlyFrameFormat &rFormat, const OUString &rName)
Definition: doclay.cxx:1424
OUString GetObjTitle() const
Definition: atrfrm.cxx:3101
SAL_DLLPRIVATE void SetXObject(css::uno::Reference< css::uno::XInterface > const &xObject)
Definition: frmfmt.hxx:169
SwFrameFormat * GetFlyNum(size_t nIdx, FlyCntType eType, bool bIgnoreTextBoxes=false)
Definition: docfly.cxx:121
void getPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const SfxItemSet &rSet, css::uno::Any &rAny) const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId)
void Unchain(SwFrameFormat &rFormat)
Definition: docfly.cxx:1120
#define RES_PRINT
Definition: hintids.hxx:203
#define MID_COLUMNS
Definition: unomid.h:90
#define RES_GRFATR_CONTRAST
Definition: hintids.hxx:244
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange)
Definition: unoobj2.cxx:1031
virtual void SAL_CALL release() override
Definition: unoframe.cxx:3120
#define FN_UNO_GRAPHIC_FILTER
Definition: cmdid.h:559
virtual void SAL_CALL setAspect(::sal_Int64 _aspect) override
Definition: unoframe.cxx:3464
css::uno::Reference< css::frame::XModel > GetBaseModel() const
virtual SwFlyFrameFormat * InsertOLE(const SwPaM &rRg, const OUString &rObjName, sal_Int64 nAspect, const SfxItemSet *pFlyAttrSet, const SfxItemSet *pGrfAttrSet)=0
#define XATTR_FILLBMP_POSOFFSETY
#define XATTR_FILLBMP_SIZELOG
#define RES_GRFATR_INVERT
Definition: hintids.hxx:249
static void lcl_FillCol(SfxItemSet &rToSet, const ::SfxItemSet &rFromSet, const ::uno::Any *pAny)
Definition: unoframe.cxx:978
#define XATTR_FILLBMP_POS
#define PROPERTY_MAP_TEXT_FRAME
Definition: unomap.hxx:40
#define FN_UNO_Z_ORDER
Definition: cmdid.h:546
#define RES_FOLLOW_TEXT_FLOW
Definition: hintids.hxx:228
virtual SwPageDesc * GetPageDescFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return required automatic page style.
#define LEFT_BORDER_DISTANCE
virtual OUString SAL_CALL getImplementationName() override
Definition: unoframe.cxx:3498
#define MID_SURROUND_CONTOUR
Definition: unomid.h:31
Base class for various Writer styles.
Definition: format.hxx:43
void EndListeningAll()
Definition: calbck.cxx:124
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:164
bool PutValue(const css::uno::Any &rVal, sal_uInt8 aInt) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
Definition: unoframe.cxx:3144
ContactObject for connection between frames (or their formats respectively) in SwClient and the drawo...
Definition: dcontact.hxx:175
virtual ~BaseFrameProperties_Impl()
Definition: unoframe.cxx:171
#define RES_BACKGROUND
Definition: hintids.hxx:210
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unoframe.cxx:3125
#define RES_FLYFRMFMT
Definition: hintids.hxx:274
#define MID_FRMSIZE_WIDTH
Definition: unomid.h:74
#define FN_UNO_DESCRIPTION
Definition: cmdid.h:827
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:483
#define MID_L_MARGIN
#define RES_GRFATR_DRAWMODE
Definition: hintids.hxx:251
#define MID_ANCHOR_ANCHORTYPE
Definition: unomid.h:43
Style of a layout element.
Definition: frmfmt.hxx:57
virtual css::uno::Reference< css::graphic::XGraphic > SAL_CALL getReplacementGraphic() override
Definition: unoframe.cxx:3479
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
const SfxItemSet * GetParent() const
#define MID_HORIORIENT_POSITION
Definition: unomid.h:40
#define RES_GRFATR_CHANNELG
Definition: hintids.hxx:246
virtual css::uno::Type SAL_CALL getElementType() override
Definition: unoframe.cxx:3251
#define RES_ANCHOR
Definition: hintids.hxx:209
virtual SwFlyFrameFormat * InsertEmbObject(const SwPaM &rRg, const svt::EmbeddedObjectRef &xObj, const SfxItemSet *pFlyAttrSet)=0
Insert OLE-objects.
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SwFormatAnchor & GetAnchor(bool=true) const
Definition: fmtanchr.hxx:81
Reference< XAnimationNode > Clone(const Reference< XAnimationNode > &xSourceNode, const SdPage *pSource, const SdPage *pTarget)
bool GoInNode(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:894
virtual css::uno::Reference< css::text::XTextCursor > CreateCursor() override
Definition: unoframe.cxx:3170
#define MID_URL_URL
Definition: unomid.h:50
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
Definition: unoframe.cxx:3518
virtual css::uno::Reference< css::container::XNameReplace > SAL_CALL getEvents() override
Definition: unoframe.cxx:3308
const SwPosition * GetPoint() const
Definition: pam.hxx:207
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &rIdentifier) override
Definition: unotext.cxx:1214
#define MID_FRMSIZE_WIDTH_TYPE
Definition: unomid.h:86
static bool SetFillAttribute(sal_uInt16 nWID, const OUString &rName, SfxItemSet &rSet, SdrModel const *pModel)
#define UNO_NAME_FRAME_INTEROP_GRAB_BAG
Definition: unoprnms.hxx:854
void SetContourAPI(const tools::PolyPolygon *pPoly)
Definition: ndnotxt.cxx:172
virtual OUString SAL_CALL getImplementationName() override
Definition: unoframe.cxx:3288
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
RndStdIds GetAnchorId() const
Definition: fmtanchr.hxx:65
OUString GetHexName() const
SwEditShell const * GetEditShell() const
Definition: doccorr.cxx:323
#define RES_GRFATR_ROTATION
Definition: hintids.hxx:242
FlyCntType
Definition: flyenum.hxx:23
#define RES_GRFATR_GAMMA
Definition: hintids.hxx:248
const SwPosition * GetContentAnchor() const
Definition: fmtanchr.hxx:67
bool GetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any *&pAny)
Definition: unoframe.cxx:180
#define LINE_WIDTH
virtual css::awt::Point SAL_CALL getPosition() override
Definition: unoframe.cxx:3058
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoframe.cxx:2328
#define RES_VERT_ORIENT
Definition: hintids.hxx:207
std::unique_ptr< SwPaM > m_pCopySource
Definition: unoframe.hxx:73
#define MID_VERTORIENT_POSITION
Definition: unomid.h:36
void SetFlyFrameDescription(SwFlyFrameFormat &rFlyFrameFormat, const OUString &sNewDescription)
Definition: docfly.cxx:599
#define TOP_BORDER
TElementType * First()
Definition: calbck.hxx:345
int i
void Assign(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
bool SetFrameFormatToFly(SwFrameFormat &rFlyFormat, SwFrameFormat &rNewFormat, SfxItemSet *pSet=nullptr, bool bKeepOrient=false)
Definition: docfly.cxx:622
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unoframe.cxx:3135
FlyAnchors.
Definition: fmtanchr.hxx:34
static SwXParagraphEnumeration * Create(css::uno::Reference< css::text::XText > const &xParent, const std::shared_ptr< SwUnoCursor > &pCursor, const CursorType eType, SwStartNode const *const pStartNode=nullptr, SwTable const *const pTable=nullptr)
Definition: unoobj2.cxx:523
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet &rSet, sal_uInt16 const nMID)
helper to check if fill style is set to color or bitmap and thus formerly used SvxBrushItem parts nee...
SwNoTextNode * GetNoTextNode()
Definition: ndnotxt.hxx:96
virtual css::uno::Any SAL_CALL getPropertyDefault(const OUString &aPropertyName) override
Definition: unoframe.cxx:2520
#define XATTR_FILLBMP_SIZEX
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
const SdrPage * GetPage(sal_uInt16 nPgNum) const
#define FN_UNO_COMPONENT
Definition: cmdid.h:568
static SW_DLLPUBLIC SdrObject * GetOrCreateSdrObject(SwFlyFrameFormat &rFormat)
Definition: unoframe.cxx:1370
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1160
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Definition: unotext.cxx:192
virtual void DelFrames()
Destroys all Frames in aDepend (Frames are identified via dynamic_cast).
Definition: atrfrm.cxx:2617
unsigned char sal_Bool
#define BOTTOM_BORDER_DISTANCE
void SetAutomaticContour(bool bSet)
Definition: ndnotxt.hxx:77
const SfxItemPropertyMap & getPropertyMap() const
#define MID_BACK_COLOR_R_G_B
css::uno::Reference< css::util::XModifyListener > m_xOLEListener
Definition: unoframe.hxx:280
sal_uInt32 GetOrdNum() const
virtual void ReRead(SwPaM &, const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic)=0
Transpose graphic (with undo)
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
#define MID_BACK_COLOR_TRANSPARENCY
virtual ~SwXTextFrame() override
Definition: unoframe.cxx:3105
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
Definition: atrfrm.cxx:1598
void setPropertyValue(const SfxItemPropertySimpleEntry &rEntry, const css::uno::Any &aVal, SfxItemSet &rSet) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
Definition: format.cxx:398
#define FN_UNO_TITLE
Definition: cmdid.h:826
sal_uInt16 GetSize() const
Connection (text flow) between two FlyFrames.
Definition: fmtcnct.hxx:31
Marks a node in the document model.
Definition: ndindex.hxx:31
css::uno::Type const & get()
sal_uInt16 sal_Char * pName
virtual css::uno::Reference< css::text::XTextCursor > SAL_CALL createTextCursorByRange(const css::uno::Reference< css::text::XTextRange > &aTextPosition) override
Definition: unoframe.cxx:3217
#define MID_SURROUND_CONTOUROUTSIDE
Definition: unomid.h:32
bool GoInDoc(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:882
#define XATTR_GRADIENTSTEPCOUNT
virtual OUString SAL_CALL getImplementationName() override
Definition: unoframe.cxx:3360
static SwOLENode * lcl_GetOLENode(const SwFrameFormat *pFrameFormat)
Definition: xmltexti.cxx:198
#define MID_R_MARGIN
::comphelper::OInterfaceContainerHelper2 m_EventListeners
Definition: unoframe.cxx:1158
const FlyCntType eType
Definition: unoframe.hxx:66
#define MID_GRAPHIC_POSITION
#define XATTR_FILLSTYLE
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
cppu::ImplInheritanceHelper< SwXFrame, css::document::XEmbeddedObjectSupplier2, css::document::XEventsSupplier > SwXTextEmbeddedObjectBaseClass
Definition: unoframe.hxx:276
bool StartListening(SvtBroadcaster &rBroadcaster)
virtual void Modify(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: unoframe.cxx:2558
virtual ::sal_Int64 SAL_CALL getAspect() override
Definition: unoframe.cxx:3447
SwStartNode * GetStartNode()
Definition: node.hxx:591
DocumentType const eType
virtual void SAL_CALL setPosition(const css::awt::Point &aPosition) override
Definition: unoframe.cxx:3066
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
virtual css::uno::Reference< css::lang::XComponent > SAL_CALL getEmbeddedObject() override
Definition: unoframe.cxx:3407
const SfxItemPropertySet * m_pPropSet
Definition: unoframe.hxx:63
#define UNO_NAME_CHAIN_PREV_NAME
Definition: unoprnms.hxx:234
bool FillValue(sal_uInt16 nWhichId, sal_uInt16 nMemberId, const css::uno::Any *&pAny)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
const SfxItemPropertySimpleEntry * getByName(const OUString &rName) const
bool SetFlyFrameAttr(SwFrameFormat &rFlyFormat, SfxItemSet &rSet)
Definition: docfly.cxx:548
css::uno::Reference< css::frame::XModel > m_xOLEModel
Definition: unoframe.hxx:313
static void GetGrfNms(const SwFlyFrameFormat &rFormat, OUString *pGrfName, OUString *pFltName)
Definition: docfly.cxx:709
long X() const
bool IsInReading() const
Definition: doc.hxx:948
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
#define Y
const SwPosition * Start() const
Definition: pam.hxx:212
#define UNO_NAME_IS_AUTOMATIC_CONTOUR
Definition: unoprnms.hxx:499
::osl::Mutex m_Mutex
Definition: unoframe.cxx:1154
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unoframe.cxx:3370
#define RES_GRFATR_BEGIN
Definition: hintids.hxx:238
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
Definition: unoframe.cxx:3239
#define MID_PROTECT_CONTENT
virtual SdrLayerID GetHellId() const =0
#define RES_LR_SPACE
Definition: hintids.hxx:196
SwXTextEmbeddedObject(SwDoc *pDoc)
Definition: unoframe.cxx:3385
#define FN_UNO_GRAPHIC
Definition: cmdid.h:574
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: unoframe.cxx:2310
virtual OUString SAL_CALL getShapeType() override
Definition: unoframe.cxx:3087
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:741
#define XATTR_SECONDARYFILLCOLOR
virtual void SAL_CALL attach(const css::uno::Reference< css::text::XTextRange > &xTextRange) override
Definition: unoframe.cxx:3261
#define MID_MIRROR_HORZ_EVEN_PAGES
Definition: unomid.h:23
bool FillBaseProperties(SfxItemSet &rToSet, const SfxItemSet &rFromSet, bool &rSizeFound)
Definition: unoframe.cxx:185
sal_uInt16 const aFrameFormatSetRange[]
Definition: init.cxx:229
bool Any2Bool(const css::uno::Any &rValue)
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
SvtBroadcaster & GetNotifier()
Definition: calbck.hxx:93
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unoframe.cxx:1173
virtual ~SwXTextGraphicObject() override
Definition: unoframe.cxx:3350
const Point & GetPoint(sal_uInt16 nPos) const
#define XATTR_FILLBMP_SIZEY
sal_uInt16 Which() const
for Querying of Writer-functions.
Definition: format.hxx:78
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoobj2.cxx:867
SwFormat * DerivedFrom() const
Definition: format.hxx:108
#define MID_GRAPHIC_URL
sal_Int64 m_nVisibleAreaWidth
Definition: unoframe.hxx:76
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
#define MID_HORIORIENT_ORIENT
Definition: unomid.h:38
void DeleteAttributes(const sal_uInt16 nWhich, const sal_Int32 nStart, const sal_Int32 nEnd=0)
delete all attributes of type nWhich at nStart (opt. end nEnd)
Definition: thints.cxx:1668
#define COL_DEFAULT_SHAPE_STROKE
#define MID_FRMSIZE_REL_HEIGHT_RELATION
Definition: unomid.h:88
const SwDoc * GetDoc() const
Definition: unotext.cxx:133
bool IsDescriptor() const
Definition: unoframe.hxx:160
#define XATTR_FILLBMP_TILE
SwXOLEListener(SwFormat &rOLEFormat, css::uno::Reference< css::frame::XModel > const &xOLE)
Definition: unoframe.cxx:3537
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
#define OWN_ATTR_FILLBMP_MODE
Definition: unomap.hxx:324
#define MID_ANCHOR_ANCHORFRAME
Definition: unomid.h:45
#define BOTTOM_BORDER
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unoframe.cxx:3313
virtual bool SetAttr(const SfxPoolItem &)
made virtual
Definition: node.cxx:1471
SwXFrame(FlyCntType eSet, const SfxItemPropertySet *pPropSet, SwDoc *pDoc)
void SetProperty(sal_uInt16 nWID, sal_uInt8 nMemberId, const uno::Any &rVal)
Definition: unoframe.cxx:175
const SwFormatChain & GetChain(bool=true) const
Definition: fmtcnct.hxx:70
const SvxOpaqueItem & GetOpaque(bool=true) const
Definition: frmatr.hxx:80
sal_Int64 m_nVisibleAreaHeight
Definition: unoframe.hxx:77
#define MM50
Definition: swtypes.hxx:59
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
SwUnoCursorHelper::SwAnyMapHelper aAnyMap
Definition: unoframe.cxx:159
static MapUnit UnoEmbed2VCLMapUnit(sal_Int32 nUnoEmbedMapUnit)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const Graphic & GetGraphic() const
#define MID_WRAP_INFLUENCE
Definition: unomid.h:148
#define RES_DRAWFRMFMT
Definition: hintids.hxx:277
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: unoframe.cxx:2322
#define MID_VERTORIENT_ORIENT
Definition: unomid.h:34
unsigned char sal_uInt8
#define UNO_NAME_ANCHOR_TYPE
Definition: unoprnms.hxx:227
#define FN_UNO_ACTUAL_SIZE
Definition: cmdid.h:557
#define FN_PARAM_LINK_DISPLAY_NAME
Definition: cmdid.h:779
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
#define MID_FRMSIZE_IS_SYNC_HEIGHT_TO_WIDTH
Definition: unomid.h:85
#define MID_FRMSIZE_REL_WIDTH_RELATION
Definition: unomid.h:87
#define RES_GRFATR_CHANNELR
Definition: hintids.hxx:245
#define RES_OPAQUE
Definition: hintids.hxx:204
sal_Int32 GetIndex() const
Definition: index.hxx:95
virtual SwDrawModel * GetOrCreateDrawModel()=0
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
SwNodes & GetNodes()
Definition: doc.hxx:403
#define FN_UNO_REPLACEMENT_GRAPHIC_URL
Definition: cmdid.h:576
#define MID_SHADOW_TRANSPARENCE
size_t GetFlyCount(FlyCntType eType, bool bIgnoreTextBoxes=false) const
Access to frames.
Definition: docfly.cxx:74
#define BORDER_DISTANCE
const SwPosition * End() const
Definition: pam.hxx:217
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:157
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:634
static SW_DLLPUBLIC css::uno::Reference< css::text::XTextFrame > CreateXTextFrame(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3110
#define TOP_BORDER_DISTANCE
bool HasItem(sal_uInt16 nWhich, const SfxPoolItem **ppItem=nullptr) const
void SetSize(const Size &rSize)
void SetGraphic(const Graphic &rGraphic, const OUString &rMediaType)
#define RES_GRFATR_CROPGRF
Definition: hintids.hxx:240
SwUnoPropertyMapProvider aSwMapProvider
Definition: unomap1.cxx:130
#define MID_LO_MARGIN
#define MID_GRAPHIC_FILTER
void SvxUnoConvertToMM(const MapUnit eSourceMapUnit, uno::Any &rMetric)
#define FN_UNO_GRAPHIC_URL
Definition: cmdid.h:558
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
void SetFlyFrameTitle(SwFlyFrameFormat &rFlyFrameFormat, const OUString &sNewTitle)
Definition: docfly.cxx:576
#define RES_GRFATR_TRANSPARENCY
Definition: hintids.hxx:250
void Optimize(PolyOptimizeFlags nOptimizeFlags)
#define RES_TXTATR_FLYCNT
Definition: hintids.hxx:151
#define FN_UNO_ANCHOR_TYPES
Definition: cmdid.h:536
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
Definition: edws.cxx:107
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:723
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:58
bool InsertEmbeddedObject(const css::uno::Reference< css::embed::XEmbeddedObject > &, OUString &)
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:351
::sw::UnoImplPtr< Impl > m_pImpl
Definition: unoframe.hxx:60
#define MID_HORIORIENT_PAGETOGGLE
Definition: unomid.h:41
#define MID_HORIORIENT_RELATION
Definition: unomid.h:39
#define FN_UNO_REPLACEMENT_GRAPHIC
Definition: cmdid.h:582
void SetType(RndStdIds nRndId)
Definition: fmtanchr.hxx:71
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: unoframe.cxx:1334
#define MID_FRMSIZE_REL_HEIGHT
Definition: unomid.h:71
#define UNO_NAME_Z_ORDER
Definition: unoprnms.hxx:532
OString const aName
const SwStartNode * FindFlyStartNode() const
Definition: node.hxx:198
bool AnyToItemSet(SwDoc *pDoc, SfxItemSet &rFrameSet, SfxItemSet &rSet, bool &rSizeFound) override
Definition: unoframe.cxx:988
#define RES_BOX
Definition: hintids.hxx:211
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoframe.cxx:3278
constexpr sal_Int64 convertTwipToMm100(sal_Int64 n)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoframe.cxx:3365
#define FN_UNO_IS_AUTOMATIC_CONTOUR
Definition: cmdid.h:554
#define XATTR_FILLBITMAP
#define UNO_NAME_START_REDLINE
Definition: unoprnms.hxx:558
#define XATTR_FILLBMP_TILEOFFSETX
cppu::ImplInheritanceHelper< SwXFrame, css::document::XEventsSupplier > SwXTextGraphicObjectBaseClass
Definition: unoframe.hxx:248
MapUnit
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unoframe.cxx:1168
#define RIGHT_BORDER
Reference< XModel > xModel
virtual void SAL_CALL dispose() override
Definition: unoframe.cxx:2577
#define UNO_NAME_DESCRIPTION
Definition: unoprnms.hxx:813
RndStdIds
void attachToRange(const css::uno::Reference< css::text::XTextRange > &xTextRange)
Definition: unoframe.cxx:2635
#define MID_URL_TARGET
Definition: unomid.h:51
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
static css::uno::Reference< css::text::XTextContent > CreateXTextEmbeddedObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3402
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: unoframe.cxx:1982
static css::uno::Reference< css::text::XTextContent > CreateXTextGraphicObject(SwDoc &rDoc, SwFrameFormat *pFrameFormat)
Definition: unoframe.cxx:3355
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:457
virtual void SAL_CALL disposing(const css::lang::EventObject &Source) override
Definition: unoframe.cxx:3565
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoframe.cxx:2544
SwGrfNode * GetGrfNode()
Definition: ndgrf.hxx:155
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
#define MID_URL_SERVERMAP
Definition: unomid.h:49
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1135
#define UNO_NAME_CONTOUR_POLY_POLYGON
Definition: unoprnms.hxx:495
#define FN_UNO_IS_PIXEL_CONTOUR
Definition: cmdid.h:555
#define PROPERTY_MAP_EMBEDDED_OBJECT
Definition: unomap.hxx:65
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getAnchor() override
Definition: unoframe.cxx:3266
#define MID_MIRROR_VERT
Definition: unomid.h:22
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unoframe.cxx:3503
#define FN_UNO_FRAME_STYLE_NAME
Definition: cmdid.h:498
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
#define MID_GRAPHIC
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &rPropertyName) override
Definition: unotext.cxx:1119
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
OUString m_sName
Definition: unoframe.hxx:71
void setWidth(long nWidth)
Standard page.
Definition: poolfmt.hxx:171
SwXTextGraphicObject(SwDoc *pDoc)
Definition: unoframe.cxx:3338
#define RES_FRMATR_BEGIN
Definition: hintids.hxx:192
SdrObjUserCall * GetUserCall() const
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
#define UNO_NAME_TITLE
Definition: unoprnms.hxx:322
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
SwXTextFrame(SwDoc *pDoc)
Definition: unoframe.cxx:3092
SdrObject * FindSdrObject()
Definition: frmfmt.hxx:137
sal_Int64 m_nDrawAspect
Definition: unoframe.hxx:75
SdrObject * FindRealSdrObject()
Definition: atrfrm.cxx:2686
bool MakeId(const OUString &rId)
#define MID_BITMAP
const Graphic & GetGrf(bool bWait=false) const
Definition: ndgrf.cxx:368
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
Definition: unoframe.cxx:2551
virtual sal_Bool SAL_CALL hasElements() override
Definition: unoframe.cxx:3256
virtual OUString SAL_CALL getName() override
Definition: unoframe.cxx:1305
virtual bool AnyToItemSet(SwDoc *pDoc, SfxItemSet &rFrameSet, SfxItemSet &rSet, bool &rSizeFound) override
Definition: unoframe.cxx:1057
#define FN_UNO_DRAW_ASPECT
Definition: cmdid.h:599
long Y() const
bool sw_ChkAndSetNewAnchor(const SwFlyFrame &rFly, SfxItemSet &rSet)
also used in unoframe.cxx
Definition: fefly1.cxx:217
bool IsInXMLImport() const
Definition: doc.hxx:961
void SetContour(const tools::PolyPolygon *pPoly, bool bAutomatic=false)
Definition: ndnotxt.cxx:87
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1307
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
Definition: unoframe.cxx:2342
PropertyMoreFlags nMoreFlags
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
#define RES_TEXT_VERT_ADJUST
Definition: hintids.hxx:235
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
#define XATTR_FILLBACKGROUND
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: unoframe.cxx:1413
void SetAnchor(const SwPosition *pPos)
Definition: atrfrm.cxx:1486
#define XATTR_FILLTRANSPARENCE
#define CONVERT_TWIPS
void SetPixelContour(bool bSet)
Definition: ndnotxt.hxx:86
virtual void Notify(const SfxHint &) override
Definition: unoframe.cxx:3583
virtual bool PutValue(const css::uno::Any &rVal, sal_uInt8 nMemberId) override
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)
Base class of the Writer document model elements.
Definition: node.hxx:79
void setHeight(long nHeight)
#define MID_UP_MARGIN
#define MID_PROTECT_SIZE