LibreOffice Module svx (master)  1
svdetc.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 <sal/config.h>
21 
22 #include <algorithm>
23 
24 #include <officecfg/Office/Common.hxx>
25 #include <svtools/colorcfg.hxx>
26 #include <svx/svdetc.hxx>
27 #include <svx/svdedxv.hxx>
28 #include <svx/svdmodel.hxx>
29 #include <svx/svdoutl.hxx>
30 #include <vcl/BitmapReadAccess.hxx>
31 #include <editeng/eeitem.hxx>
32 #include <svl/itemset.hxx>
33 #include <svl/whiter.hxx>
34 #include <svx/xgrad.hxx>
35 #include <svx/xfillit0.hxx>
36 #include <svx/xflclit.hxx>
37 #include <svx/xflhtit.hxx>
38 #include <svx/xbtmpit.hxx>
39 #include <svx/xflgrit.hxx>
40 #include <svx/svdoole2.hxx>
41 #include <svl/itempool.hxx>
42 #include <tools/debug.hxx>
43 #include <unotools/configmgr.hxx>
45 #include <unotools/syslocale.hxx>
46 #include <svx/xflbckit.hxx>
47 #include <svx/extrusionbar.hxx>
48 #include <svx/fontworkbar.hxx>
49 #include <vcl/svapp.hxx>
50 #include <vcl/settings.hxx>
52 #include <svx/svdpage.hxx>
53 #include <svx/svdpagv.hxx>
54 #include <svx/svdotable.hxx>
55 #include <svx/sdrhittesthelper.hxx>
56 
57 #include <com/sun/star/frame/XModel.hpp>
58 #include <com/sun/star/embed/XEmbeddedObject.hpp>
59 
60 using namespace ::com::sun::star;
61 
62 // Global data of the DrawingEngine
64  : pSysLocale(nullptr)
65 {
67  {
68  svx::ExtrusionBar::RegisterInterface();
69  svx::FontworkBar::RegisterInterface();
70  }
71 }
72 
74 {
75  if ( !pSysLocale )
77  return pSysLocale;
78 }
80 {
81  return &GetSysLocale()->GetLocaleData();
82 }
83 
84 namespace {
85 
86 struct TheSdrGlobalData: public rtl::Static<SdrGlobalData, TheSdrGlobalData> {};
87 
88 }
89 
91  return TheSdrGlobalData::get();
92 }
93 
95 {
97  nSize = officecfg::Office::Common::Cache::DrawingEngine::OLE_Objects::get();
98  else
99  nSize = 100;
100  pTimer.reset( new AutoTimer( "svx OLEObjCache pTimer UnloadCheck" ) );
101  pTimer->SetInvokeHandler( LINK(this, OLEObjCache, UnloadCheckHdl) );
102  pTimer->SetTimeout(20000);
103  pTimer->SetStatic();
104 }
105 
107 {
108  pTimer->Stop();
109 }
110 
111 IMPL_LINK_NOARG(OLEObjCache, UnloadCheckHdl, Timer*, void)
112 {
113  if (nSize >= maObjs.size())
114  return;
115 
116  // more objects than configured cache size try to remove objects
117  // of course not the freshly inserted one at nIndex=0
118  size_t nCount2 = maObjs.size();
119  size_t nIndex = nCount2-1;
120  while( nIndex && nCount2 > nSize )
121  {
122  SdrOle2Obj* pUnloadObj = maObjs[nIndex--];
123  if (!pUnloadObj)
124  continue;
125 
126  try
127  {
128  // it is important to get object without reinitialization to avoid reentrance
129  uno::Reference< embed::XEmbeddedObject > xUnloadObj = pUnloadObj->GetObjRef_NoInit();
130 
131  bool bUnload = !xUnloadObj || SdrOle2Obj::CanUnloadRunningObj( xUnloadObj, pUnloadObj->GetAspect() );
132 
133  // check whether the object can be unloaded before looking for the parent objects
134  if ( xUnloadObj.is() && bUnload )
135  {
136  uno::Reference< frame::XModel > xUnloadModel( xUnloadObj->getComponent(), uno::UNO_QUERY );
137  if ( xUnloadModel.is() )
138  {
139  for (SdrOle2Obj* pCacheObj : maObjs)
140  {
141  if ( pCacheObj && pCacheObj != pUnloadObj )
142  {
143  uno::Reference< frame::XModel > xParentModel = pCacheObj->GetParentXModel();
144  if ( xUnloadModel == xParentModel )
145  {
146  bUnload = false; // the object has running embedded objects
147  break;
148  }
149  }
150  }
151  }
152  }
153 
154  if (bUnload && UnloadObj(*pUnloadObj))
155  {
156  // object was successfully unloaded
157  RemoveObj(pUnloadObj);
158  nCount2 = std::min(nCount2 - 1, maObjs.size());
159  if (nIndex >= nCount2)
160  nIndex = nCount2 - 1;
161  }
162  }
163  catch( uno::Exception& )
164  {}
165  }
166 }
167 
169 {
170  if (!maObjs.empty())
171  {
172  SdrOle2Obj* pExistingObj = maObjs.front();
173  if ( pObj == pExistingObj )
174  // the object is already on the top, nothing has to be changed
175  return;
176  }
177 
178  // get the old position of the object to know whether it is already in container
179  std::vector<SdrOle2Obj*>::iterator it = std::find(maObjs.begin(), maObjs.end(), pObj);
180  bool bFound = it != maObjs.end();
181 
182  if (bFound)
183  maObjs.erase(it);
184  // insert object into first position
185  maObjs.insert(maObjs.begin(), pObj);
186 
187  // if a new object was inserted, recalculate the cache
188  if (!bFound)
189  pTimer->Invoke();
190 
191  if (!bFound || !pTimer->IsActive())
192  pTimer->Start();
193 }
194 
196 {
197  std::vector<SdrOle2Obj*>::iterator it = std::find(maObjs.begin(), maObjs.end(), pObj);
198  if (it != maObjs.end())
199  maObjs.erase(it);
200  if (maObjs.empty())
201  pTimer->Stop();
202 }
203 
204 size_t OLEObjCache::size() const
205 {
206  return maObjs.size();
207 }
208 
210 {
211  return maObjs[nPos];
212 }
213 
214 const SdrOle2Obj* OLEObjCache::operator[](size_t nPos) const
215 {
216  return maObjs[nPos];
217 }
218 
220 {
221  bool bUnloaded = false;
222 
223  //#i80528# The old mechanism is completely useless, only taking into account if
224  // in all views the GrafDraft feature is used. This will nearly never have been the
225  // case since no one ever used this option.
226 
227  // A much better (and working) criteria would be the VOC contact count.
228  // The question is what will happen when i make it work now suddenly? I
229  // will try it for 2.4.
230  const sdr::contact::ViewContact& rViewContact = rObj.GetViewContact();
231  const bool bVisible(rViewContact.HasViewObjectContacts());
232 
233  if(!bVisible)
234  {
235  bUnloaded = rObj.Unload();
236  }
237 
238  return bUnloaded;
239 }
240 
241 bool GetDraftFillColor(const SfxItemSet& rSet, Color& rCol)
242 {
243  drawing::FillStyle eFill=rSet.Get(XATTR_FILLSTYLE).GetValue();
244  bool bRetval = false;
245 
246  switch(eFill)
247  {
248  case drawing::FillStyle_SOLID:
249  {
250  rCol = rSet.Get(XATTR_FILLCOLOR).GetColorValue();
251  bRetval = true;
252 
253  break;
254  }
255  case drawing::FillStyle_HATCH:
256  {
257  Color aCol1(rSet.Get(XATTR_FILLHATCH).GetHatchValue().GetColor());
258  Color aCol2(COL_WHITE);
259 
260  // when hatched background is activated, use object fill color as hatch color
261  bool bFillHatchBackground = rSet.Get(XATTR_FILLBACKGROUND).GetValue();
262  if(bFillHatchBackground)
263  {
264  aCol2 = rSet.Get(XATTR_FILLCOLOR).GetColorValue();
265  }
266 
267  const basegfx::BColor aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor()));
268  rCol = Color(aAverageColor);
269  bRetval = true;
270 
271  break;
272  }
273  case drawing::FillStyle_GRADIENT: {
274  const XGradient& rGrad=rSet.Get(XATTR_FILLGRADIENT).GetGradientValue();
275  Color aCol1(rGrad.GetStartColor());
276  Color aCol2(rGrad.GetEndColor());
277  const basegfx::BColor aAverageColor(basegfx::average(aCol1.getBColor(), aCol2.getBColor()));
278  rCol = Color(aAverageColor);
279  bRetval = true;
280 
281  break;
282  }
283  case drawing::FillStyle_BITMAP:
284  {
285  Bitmap aBitmap(rSet.Get(XATTR_FILLBITMAP).GetGraphicObject().GetGraphic().GetBitmapEx().GetBitmap());
286  const Size aSize(aBitmap.GetSizePixel());
287  const sal_uInt32 nWidth = aSize.Width();
288  const sal_uInt32 nHeight = aSize.Height();
289  if (nWidth <= 0 || nHeight <= 0)
290  return bRetval;
291 
292  Bitmap::ScopedReadAccess pAccess(aBitmap);
293 
294  if (pAccess)
295  {
296  sal_uInt32 nRt(0);
297  sal_uInt32 nGn(0);
298  sal_uInt32 nBl(0);
299  const sal_uInt32 nMaxSteps(8);
300  const sal_uInt32 nXStep((nWidth > nMaxSteps) ? nWidth / nMaxSteps : 1);
301  const sal_uInt32 nYStep((nHeight > nMaxSteps) ? nHeight / nMaxSteps : 1);
302  sal_uInt32 nCount(0);
303 
304  for(sal_uInt32 nY(0); nY < nHeight; nY += nYStep)
305  {
306  for(sal_uInt32 nX(0); nX < nWidth; nX += nXStep)
307  {
308  const BitmapColor& rCol2 = pAccess->GetColor(nY, nX);
309 
310  nRt += rCol2.GetRed();
311  nGn += rCol2.GetGreen();
312  nBl += rCol2.GetBlue();
313  nCount++;
314  }
315  }
316 
317  nRt /= nCount;
318  nGn /= nCount;
319  nBl /= nCount;
320 
321  rCol = Color(sal_uInt8(nRt), sal_uInt8(nGn), sal_uInt8(nBl));
322 
323  bRetval = true;
324  }
325  break;
326  }
327  default: break;
328  }
329 
330  return bRetval;
331 }
332 
333 std::unique_ptr<SdrOutliner> SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel& rModel)
334 {
335  SfxItemPool* pPool = &rModel.GetItemPool();
336  std::unique_ptr<SdrOutliner> pOutl(new SdrOutliner( pPool, nOutlinerMode ));
337  pOutl->SetEditTextObjectPool( pPool );
338  pOutl->SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(rModel.GetStyleSheetPool()));
339  pOutl->SetDefTab(rModel.GetDefaultTabulator());
341  pOutl->SetAsianCompressionMode(rModel.GetCharCompressType());
342  pOutl->SetKernAsianPunctuation(rModel.IsKernAsianPunctuation());
343  pOutl->SetAddExtLeading(rModel.IsAddExtLeading());
344  return pOutl;
345 }
346 
347 std::vector<Link<SdrObjCreatorParams, SdrObject*>>& ImpGetUserMakeObjHdl()
348 {
349  SdrGlobalData& rGlobalData=GetSdrGlobalData();
350  return rGlobalData.aUserMakeObjHdl;
351 }
352 
353 bool SearchOutlinerItems(const SfxItemSet& rSet, bool bInklDefaults, bool* pbOnlyEE)
354 {
355  bool bHas=false;
356  bool bOnly=true;
357  bool bLookOnly=pbOnlyEE!=nullptr;
358  SfxWhichIter aIter(rSet);
359  sal_uInt16 nWhich=aIter.FirstWhich();
360  while (((bLookOnly && bOnly) || !bHas) && nWhich!=0) {
361  // For bInklDefaults, the entire Which range is decisive,
362  // in other cases only the set items are.
363  // Disabled and DontCare are regarded as holes in the Which range.
364  SfxItemState eState=rSet.GetItemState(nWhich);
365  if ((eState==SfxItemState::DEFAULT && bInklDefaults) || eState==SfxItemState::SET) {
366  if (nWhich<EE_ITEMS_START || nWhich>EE_ITEMS_END) bOnly=false;
367  else bHas=true;
368  }
369  nWhich=aIter.NextWhich();
370  }
371  if (!bHas) bOnly=false;
372  if (pbOnlyEE!=nullptr) *pbOnlyEE=bOnly;
373  return bHas;
374 }
375 
376 WhichRangesContainer RemoveWhichRange(const WhichRangesContainer& pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd)
377 {
378  // Six possible cases (per range):
379  // [Beg..End] [nRangeBeg, nRangeEnd], to delete
380  // [b..e] [b..e] [b..e] Cases 1,3,2: doesn't matter, delete, doesn't matter + Ranges
381  // [b........e] [b........e] Cases 4,5 : shrink range | in
382  // [b......................e] Case 6 : splitting + pOldWhichTable
383  std::vector<WhichPair> buf;
384  for (const auto & rPair : pOldWhichTable) {
385  auto const begin = rPair.first;
386  auto const end = rPair.second;
387  if (end < nRangeBeg || begin > nRangeEnd) { // cases 1, 2
388  buf.push_back({begin, end});
389  } else if (begin >= nRangeBeg && end <= nRangeEnd) { // case 3
390  // drop
391  } else if (end <= nRangeEnd) { // case 4
392  buf.push_back({begin, nRangeBeg - 1});
393  } else if (begin >= nRangeBeg) { // case 5
394  buf.push_back({nRangeEnd + 1, end});
395  } else { // case 6
396  buf.push_back({begin, nRangeBeg - 1});
397  buf.push_back({nRangeEnd + 1, end});
398  }
399  }
400  std::unique_ptr<WhichPair[]> pNewWhichTable(new WhichPair[buf.size()]);
401  std::copy(buf.begin(), buf.end(), pNewWhichTable.get());
402  return WhichRangesContainer(std::move(pNewWhichTable), buf.size());
403 }
404 
405 
407 {
408  maLink = _rLink;
409  m_nSumCurAction = 0;
410 
411  m_nObjCount = 0;
412  m_nCurObj = 0;
413 
414  m_nActionCount = 0;
415  m_nCurAction = 0;
416 
417  m_nInsertCount = 0;
418  m_nCurInsert = 0;
419 }
420 
421 void SvdProgressInfo::Init( size_t nObjCount )
422 {
423  m_nObjCount = nObjCount;
424 }
425 
426 bool SvdProgressInfo::ReportActions( size_t nActionCount )
427 {
428  m_nSumCurAction += nActionCount;
429  m_nCurAction += nActionCount;
432 
433  return maLink.Call(nullptr);
434 }
435 
436 void SvdProgressInfo::ReportInserts( size_t nInsertCount )
437 {
438  m_nSumCurAction += nInsertCount;
439  m_nCurInsert += nInsertCount;
440 
441  maLink.Call(nullptr);
442 }
443 
444 void SvdProgressInfo::ReportRescales( size_t nRescaleCount )
445 {
446  m_nSumCurAction += nRescaleCount;
447  maLink.Call(nullptr);
448 }
449 
450 void SvdProgressInfo::SetActionCount( size_t nActionCount )
451 {
452  m_nActionCount = nActionCount;
453 }
454 
455 void SvdProgressInfo::SetInsertCount( size_t nInsertCount )
456 {
457  m_nInsertCount = nInsertCount;
458 }
459 
461 {
462  m_nActionCount = 0;
463  m_nCurAction = 0;
464 
465  m_nInsertCount = 0;
466  m_nCurInsert = 0;
467 
468  m_nCurObj++;
469  ReportActions(0);
470 }
471 
472 // #i101872# isolate GetTextEditBackgroundColor to tooling; it will anyways only be used as long
473 // as text edit is not running on overlay
474 
475 namespace
476 {
477  bool impGetSdrObjListFillColor(
478  const SdrObjList& rList,
479  const Point& rPnt,
480  const SdrPageView& rTextEditPV,
481  const SdrLayerIDSet& rVisLayers,
482  Color& rCol)
483  {
484  bool bRet(false);
485  bool bMaster(rList.getSdrPageFromSdrObjList() && rList.getSdrPageFromSdrObjList()->IsMasterPage());
486 
487  for(size_t no(rList.GetObjCount()); !bRet && no > 0; )
488  {
489  no--;
490  SdrObject* pObj = rList.GetObj(no);
491  SdrObjList* pOL = pObj->GetSubList();
492 
493  if(pOL)
494  {
495  // group object
496  bRet = impGetSdrObjListFillColor(*pOL, rPnt, rTextEditPV, rVisLayers, rCol);
497  }
498  else
499  {
500  SdrTextObj* pText = dynamic_cast< SdrTextObj * >(pObj);
501 
502  // Exclude zero master page object (i.e. background shape) from color query
503  if(pText
504  && pObj->IsClosedObj()
505  && (!bMaster || (!pObj->IsNotVisibleAsMaster() && 0 != no))
506  && pObj->GetCurrentBoundRect().IsInside(rPnt)
507  && !pText->IsHideContour()
508  && SdrObjectPrimitiveHit(*pObj, rPnt, 0, rTextEditPV, &rVisLayers, false))
509  {
510  bRet = GetDraftFillColor(pObj->GetMergedItemSet(), rCol);
511  }
512  }
513  }
514 
515  return bRet;
516  }
517 
518  bool impGetSdrPageFillColor(
519  const SdrPage& rPage,
520  const Point& rPnt,
521  const SdrPageView& rTextEditPV,
522  const SdrLayerIDSet& rVisLayers,
523  Color& rCol,
524  bool bSkipBackgroundShape)
525  {
526  bool bRet(impGetSdrObjListFillColor(rPage, rPnt, rTextEditPV, rVisLayers, rCol));
527 
528  if(!bRet && !rPage.IsMasterPage())
529  {
530  if(rPage.TRG_HasMasterPage())
531  {
532  SdrLayerIDSet aSet(rVisLayers);
533  aSet &= rPage.TRG_GetMasterPageVisibleLayers();
534  SdrPage& rMasterPage = rPage.TRG_GetMasterPage();
535 
536  // Don't fall back to background shape on
537  // master pages. This is later handled by
538  // GetBackgroundColor, and is necessary to cater for
539  // the silly ordering: 1. shapes, 2. master page
540  // shapes, 3. page background, 4. master page
541  // background.
542  bRet = impGetSdrPageFillColor(rMasterPage, rPnt, rTextEditPV, aSet, rCol, true);
543  }
544  }
545 
546  // Only now determine background color from background shapes
547  if(!bRet && !bSkipBackgroundShape)
548  {
549  rCol = rPage.GetPageBackgroundColor();
550  return true;
551  }
552 
553  return bRet;
554  }
555 
556  Color impCalcBackgroundColor(
557  const tools::Rectangle& rArea,
558  const SdrPageView& rTextEditPV,
559  const SdrPage& rPage)
560  {
561  svtools::ColorConfig aColorConfig;
562  Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
563  const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
564 
565  if(!rStyleSettings.GetHighContrastMode())
566  {
567  // search in page
568  const sal_uInt16 SPOTCOUNT(5);
569  Point aSpotPos[SPOTCOUNT];
570  Color aSpotColor[SPOTCOUNT];
571  sal_uInt32 nHeight( rArea.GetSize().Height() );
572  sal_uInt32 nWidth( rArea.GetSize().Width() );
573  sal_uInt32 nWidth14 = nWidth / 4;
574  sal_uInt32 nHeight14 = nHeight / 4;
575  sal_uInt32 nWidth34 = ( 3 * nWidth ) / 4;
576  sal_uInt32 nHeight34 = ( 3 * nHeight ) / 4;
577 
578  sal_uInt16 i;
579  for ( i = 0; i < SPOTCOUNT; i++ )
580  {
581  // five spots are used
582  switch ( i )
583  {
584  case 0 :
585  {
586  // Center-Spot
587  aSpotPos[i] = rArea.Center();
588  }
589  break;
590 
591  case 1 :
592  {
593  // TopLeft-Spot
594  aSpotPos[i] = rArea.TopLeft();
595  aSpotPos[i].AdjustX(nWidth14 );
596  aSpotPos[i].AdjustY(nHeight14 );
597  }
598  break;
599 
600  case 2 :
601  {
602  // TopRight-Spot
603  aSpotPos[i] = rArea.TopLeft();
604  aSpotPos[i].AdjustX(nWidth34 );
605  aSpotPos[i].AdjustY(nHeight14 );
606  }
607  break;
608 
609  case 3 :
610  {
611  // BottomLeft-Spot
612  aSpotPos[i] = rArea.TopLeft();
613  aSpotPos[i].AdjustX(nWidth14 );
614  aSpotPos[i].AdjustY(nHeight34 );
615  }
616  break;
617 
618  case 4 :
619  {
620  // BottomRight-Spot
621  aSpotPos[i] = rArea.TopLeft();
622  aSpotPos[i].AdjustX(nWidth34 );
623  aSpotPos[i].AdjustY(nHeight34 );
624  }
625  break;
626 
627  }
628 
629  aSpotColor[i] = COL_WHITE;
630  impGetSdrPageFillColor(rPage, aSpotPos[i], rTextEditPV, rTextEditPV.GetVisibleLayers(), aSpotColor[i], false);
631  }
632 
633  sal_uInt16 aMatch[SPOTCOUNT];
634 
635  for ( i = 0; i < SPOTCOUNT; i++ )
636  {
637  // were same spot colors found?
638  aMatch[i] = 0;
639 
640  for ( sal_uInt16 j = 0; j < SPOTCOUNT; j++ )
641  {
642  if( j != i )
643  {
644  if( aSpotColor[i] == aSpotColor[j] )
645  {
646  aMatch[i]++;
647  }
648  }
649  }
650  }
651 
652  // highest weight to center spot
653  aBackground = aSpotColor[0];
654 
655  for ( sal_uInt16 nMatchCount = SPOTCOUNT - 1; nMatchCount > 1; nMatchCount-- )
656  {
657  // which spot color was found most?
658  for ( i = 0; i < SPOTCOUNT; i++ )
659  {
660  if( aMatch[i] == nMatchCount )
661  {
662  aBackground = aSpotColor[i];
663  nMatchCount = 1; // break outer for-loop
664  break;
665  }
666  }
667  }
668  }
669 
670  return aBackground;
671  }
672 } // end of anonymous namespace
673 
675 {
676  svtools::ColorConfig aColorConfig;
677  Color aBackground(aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor);
678  const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
679 
680  if(!rStyleSettings.GetHighContrastMode())
681  {
682  bool bFound(false);
683  SdrTextObj* pText = rView.GetTextEditObject();
684 
685  if(pText && pText->IsClosedObj())
686  {
687  sdr::table::SdrTableObj* pTable = dynamic_cast< sdr::table::SdrTableObj * >( pText );
688 
689  if( pTable )
690  bFound = GetDraftFillColor(pTable->GetActiveCellItemSet(), aBackground );
691 
692  if( !bFound )
693  bFound=GetDraftFillColor(pText->GetMergedItemSet(), aBackground);
694  }
695 
696  if(!bFound && pText)
697  {
698  SdrPageView* pTextEditPV = rView.GetTextEditPageView();
699 
700  if(pTextEditPV)
701  {
702  Point aPvOfs(pText->GetTextEditOffset());
703  const SdrPage* pPg = pTextEditPV->GetPage();
704 
705  if(pPg)
706  {
707  tools::Rectangle aSnapRect( pText->GetSnapRect() );
708  aSnapRect.Move(aPvOfs.X(), aPvOfs.Y());
709 
710  return impCalcBackgroundColor(aSnapRect, *pTextEditPV, *pPg);
711  }
712  }
713  }
714  }
715 
716  return aBackground;
717 }
718 
719 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SdrPage & TRG_GetMasterPage() const
Definition: svdpage.cxx:1631
void ReportRescales(size_t nRescaleCount)
Definition: svdetc.cxx:444
sal_Int32 nIndex
bool SearchOutlinerItems(const SfxItemSet &rSet, bool bInklDefaults, bool *pbOnlyEE)
Search an ItemSet for Outliner/EditEngine Items.
Definition: svdetc.cxx:353
bool bVisible
OutlinerMode
bool IsNotVisibleAsMaster() const
Definition: svdobj.hxx:832
bool IsClosedObj() const
Definition: svdobj.hxx:737
virtual const tools::Rectangle & GetCurrentBoundRect() const
Definition: svdobj.cxx:957
const SvtSysLocale * GetSysLocale()
Definition: svdetc.cxx:73
CharCompressType GetCharCompressType() const
Definition: svdmodel.hxx:556
Color GetPageBackgroundColor() const
deprecated returns an averaged background color of this page
Definition: svdpage.cxx:1797
bool IsKernAsianPunctuation() const
Definition: svdmodel.hxx:559
WhichRangesContainer RemoveWhichRange(const WhichRangesContainer &pOldWhichTable, sal_uInt16 nRangeBeg, sal_uInt16 nRangeEnd)
Definition: svdetc.cxx:376
std::pair< sal_uInt16, sal_uInt16 > WhichPair
SdrTextObj * GetTextEditObject() const
Definition: svdedxv.hxx:226
std::vector< Link< SdrObjCreatorParams, SdrObject * > > & ImpGetUserMakeObjHdl()
Definition: svdetc.cxx:347
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
constexpr TypedWhichId< XFillStyleItem > XATTR_FILLSTYLE(XATTR_FILL_FIRST)
void SetNextObject()
Definition: svdetc.cxx:460
SdrObject * GetObj(size_t nNum) const
Definition: svdpage.cxx:822
size_t GetObjCount() const
Definition: svdpage.cxx:816
sal_uInt16 FirstWhich()
constexpr sal_uInt16 EE_ITEMS_END(EE_FEATURE_END)
B2DTuple average(const B2DTuple &rOld1, const B2DTuple &rOld2)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
virtual const tools::Rectangle & GetSnapRect() const override
Definition: svdoattr.cxx:49
SVXCORE_DLLPUBLIC ~OLEObjCache()
Definition: svdetc.cxx:106
virtual SdrObjList * GetSubList() const
Definition: svdobj.cxx:748
constexpr TypedWhichId< XFillBackgroundItem > XATTR_FILLBACKGROUND(XATTR_FILL_FIRST+19)
sdr::contact::ViewContact & GetViewContact() const
Definition: svdobj.cxx:251
sal_uInt16 NextWhich()
const Color & GetStartColor() const
Definition: xgrad.hxx:69
constexpr tools::Long Width() const
const LocaleDataWrapper & GetLocaleData() const
enumrange< T >::Iterator begin(enumrange< T >)
const SvtSysLocale * pSysLocale
Definition: svdetc.hxx:185
static bool IsFuzzing()
int nCount
void Init(size_t _nObjCount)
Definition: svdetc.cxx:421
const LocaleDataWrapper * GetLocaleData()
Definition: svdetc.cxx:79
void RemoveObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:195
SdrObject * SdrObjectPrimitiveHit(const SdrObject &rObject, const Point &rPnt, sal_uInt16 nTol, const SdrPageView &rSdrPageView, const SdrLayerIDSet *pVisiLayer, bool bTextOnly, drawinglayer::primitive2d::Primitive2DContainer *pHitContainer)
std::vector< SdrOle2Obj * > maObjs
Definition: svdetc.hxx:162
const Point & GetTextEditOffset() const
Definition: svdotext.hxx:204
static bool Unload(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
SVX_DLLPRIVATE css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef_NoInit() const
Definition: svdoole2.cxx:1793
size_t nSize
Definition: svdetc.hxx:164
void SetInsertCount(size_t _nInsertCount)
Definition: svdetc.cxx:455
void SetActionCount(size_t _nActionCount)
Definition: svdetc.cxx:450
bool HasViewObjectContacts() const
const SdrLayerIDSet & GetVisibleLayers() const
Definition: svdpagv.hxx:210
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
int i
bool IsAddExtLeading() const
Definition: svdmodel.hxx:562
size_t m_nSumCurAction
Definition: svdetc.hxx:115
size_t m_nObjCount
Definition: svdetc.hxx:123
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
const SdrLayerIDSet & TRG_GetMasterPageVisibleLayers() const
Definition: svdpage.cxx:1637
BitmapColor GetColor(tools::Long nY, tools::Long nX) const
size_t m_nInsertCount
Definition: svdetc.hxx:120
size_t m_nActionCount
Definition: svdetc.hxx:117
size_t m_nCurInsert
Definition: svdetc.hxx:121
Link< void *, bool > maLink
Definition: svdetc.hxx:126
static bool CanUnloadRunningObj(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, sal_Int64 nAspect)
Definition: svdoole2.cxx:1662
bool IsHideContour() const
Definition: svdotext.cxx:1717
bool IsInside(const Point &rPOINT) const
bool IsMasterPage() const
Definition: svdpage.hxx:451
size_t m_nCurAction
Definition: svdetc.hxx:118
bool TRG_HasMasterPage() const
Definition: svdpage.hxx:487
Abstract DrawObject.
Definition: svdobj.hxx:259
bool ReportActions(size_t nActionCount)
Definition: svdetc.cxx:426
enumrange< T >::Iterator end(enumrange< T >)
constexpr Point Center() const
constexpr Point TopLeft() const
const SfxItemSet & GetActiveCellItemSet() const
Definition: svdotable.cxx:1302
static bool UnloadObj(SdrOle2Obj &rObj)
Definition: svdetc.cxx:219
SdrGlobalData & GetSdrGlobalData()
Definition: svdetc.cxx:90
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharsTable() const
Definition: svdmodel.hxx:553
constexpr TypedWhichId< XFillColorItem > XATTR_FILLCOLOR(XATTR_FILL_FIRST+1)
constexpr Size GetSize() const
SfxItemState
sal_Int64 GetAspect() const
Definition: svdoole2.cxx:807
ColorConfigValue GetColorValue(ColorConfigEntry eEntry, bool bSmart=true) const
IMPL_LINK_NOARG(OLEObjCache, UnloadCheckHdl, Timer *, void)
Definition: svdetc.cxx:111
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
constexpr tools::Long Height() const
SdrPageView * GetTextEditPageView() const
Definition: svdedxv.cxx:1676
unsigned char sal_uInt8
SdrPage * GetPage() const
Definition: svdpagv.hxx:166
OLEObjCache()
Definition: svdetc.cxx:94
SfxStyleSheetBasePool * GetStyleSheetPool() const
Definition: svdmodel.hxx:535
Color GetTextEditBackgroundColor(const SdrObjEditView &rView)
Definition: svdetc.cxx:674
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_WHITE
const SfxItemSet & GetMergedItemSet() const
Definition: svdobj.cxx:1978
std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rModel)
Create an Outliner with the engine-global default settings on the heap.
Definition: svdetc.cxx:333
static void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
SvdProgressInfo(const Link< void *, bool > &_pLink)
Definition: svdetc.cxx:406
virtual SdrPage * getSdrPageFromSdrObjList() const
Definition: svdpage.cxx:122
void ReportInserts(size_t nInsertCount)
Definition: svdetc.cxx:436
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
const SfxItemPool & GetItemPool() const
Definition: svdmodel.hxx:311
std::vector< Link< SdrObjCreatorParams, SdrObject * > > aUserMakeObjHdl
Definition: svdetc.hxx:188
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
Definition: svdpage.hxx:365
void InsertObj(SdrOle2Obj *pObj)
Definition: svdetc.cxx:168
SVXCORE_DLLPUBLIC SdrOle2Obj * operator[](size_t nPos)
Definition: svdetc.cxx:209
size_t m_nCurObj
Definition: svdetc.hxx:124
bool GetDraftFillColor(const SfxItemSet &rSet, Color &rCol)
Returns a replacement for an XFillStyle.
Definition: svdetc.cxx:241
SVXCORE_DLLPUBLIC size_t size() const
Definition: svdetc.cxx:204
const Color & GetEndColor() const
Definition: xgrad.hxx:70
std::unique_ptr< AutoTimer > pTimer
Definition: svdetc.hxx:165
sal_uInt16 GetDefaultTabulator() const
Definition: svdmodel.hxx:334