LibreOffice Module sc (master)  1
documen9.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 <scitems.hxx>
21 #include <editeng/eeitem.hxx>
22 
23 #include <editeng/autokernitem.hxx>
24 #include <editeng/fontitem.hxx>
25 #include <editeng/langitem.hxx>
26 #include <o3tl/unit_conversion.hxx>
27 #include <osl/thread.h>
28 #include <osl/diagnose.h>
29 #include <svl/asiancfg.hxx>
30 #include <svx/svditer.hxx>
31 #include <svx/svdograf.hxx>
32 #include <svx/svdoole2.hxx>
33 #include <svx/svdpage.hxx>
34 #include <svx/svdundo.hxx>
35 #include <svx/xtable.hxx>
36 #include <sfx2/objsh.hxx>
37 #include <sfx2/printer.hxx>
38 
39 #include <document.hxx>
40 #include <docoptio.hxx>
41 #include <table.hxx>
42 #include <drwlayer.hxx>
43 #include <markdata.hxx>
44 #include <patattr.hxx>
45 #include <rechead.hxx>
46 #include <poolhelp.hxx>
47 #include <docpool.hxx>
48 #include <editutil.hxx>
49 #include <charthelper.hxx>
50 #include <conditio.hxx>
51 #include <documentlinkmgr.hxx>
52 
53 using namespace ::com::sun::star;
54 
56 {
57  return mpDrawLayer.get();
58 }
59 
61 {
62  if (mpDrawLayer)
63  mpDrawLayer->BeginCalcUndo(false);
64 }
65 
66 void ScDocument::TransferDrawPage(const ScDocument& rSrcDoc, SCTAB nSrcPos, SCTAB nDestPos)
67 {
68  if (mpDrawLayer && rSrcDoc.mpDrawLayer)
69  {
70  SdrPage* pOldPage = rSrcDoc.mpDrawLayer->GetPage(static_cast<sal_uInt16>(nSrcPos));
71  SdrPage* pNewPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nDestPos));
72 
73  if (pOldPage && pNewPage)
74  {
75  SdrObjListIter aIter( pOldPage, SdrIterMode::Flat );
76  SdrObject* pOldObject = aIter.Next();
77  while (pOldObject)
78  {
79  // Clone to target SdrModel
80  SdrObject* pNewObject(pOldObject->CloneSdrObject(*mpDrawLayer));
81  pNewObject->NbcMove(Size(0,0));
82  pNewPage->InsertObject( pNewObject );
83 
84  if (mpDrawLayer->IsRecording())
85  mpDrawLayer->AddCalcUndo( std::make_unique<SdrUndoInsertObj>( *pNewObject ) );
86 
87  pOldObject = aIter.Next();
88  }
89  }
90  }
91 
92  // make sure the data references of charts are adapted
93  // (this must be after InsertObject!)
94  ScChartHelper::AdjustRangesOfChartsOnDestinationPage( rSrcDoc, *this, nSrcPos, nDestPos );
96 }
97 
99 {
100  if (pDocShell && !mpShell)
101  {
103  mpShell = pDocShell;
104  }
105 
106  if (mpDrawLayer)
107  return;
108 
110  OUString aName;
111  if ( mpShell && !mpShell->IsLoading() ) // don't call GetTitle while loading
112  aName = mpShell->GetTitle();
113  mpDrawLayer.reset(new ScDrawLayer( this, aName ));
114 
116  if (pMgr)
117  mpDrawLayer->SetLinkManager(pMgr);
118 
119  // set DrawingLayer's SfxItemPool at Calc's SfxItemPool as
120  // secondary pool to support DrawingLayer FillStyle ranges (and similar)
121  // in SfxItemSets using the Calc SfxItemPool. This is e.g. needed when
122  // the PageStyle using SvxBrushItem is visualized and will be potentially
123  // used more intense in the future
124  if (mxPoolHelper.is() && !IsClipOrUndo()) //Using IsClipOrUndo as a proxy for SharePooledResources called
125  {
126  ScDocumentPool* pLocalPool = mxPoolHelper->GetDocPool();
127 
128  if (pLocalPool)
129  {
130  OSL_ENSURE(!pLocalPool->GetSecondaryPool(), "OOps, already a secondary pool set where the DrawingLayer ItemPool is to be placed (!)");
131  pLocalPool->SetSecondaryPool(&mpDrawLayer->GetItemPool());
132  }
133  }
134 
135  // Drawing pages are accessed by table number, so they must also be present
136  // for preceding table numbers, even if the tables aren't allocated
137  // (important for clipboard documents).
138 
139  SCTAB nDrawPages = 0;
140  SCTAB nTab;
141  for (nTab=0; nTab < static_cast<SCTAB>(maTabs.size()); nTab++)
142  if (maTabs[nTab])
143  nDrawPages = nTab + 1; // needed number of pages
144 
145  for (nTab=0; nTab<nDrawPages && nTab < static_cast<SCTAB>(maTabs.size()); nTab++)
146  {
147  mpDrawLayer->ScAddPage( nTab ); // always add page, with or without the table
148  if (maTabs[nTab])
149  {
150  OUString aTabName = maTabs[nTab]->GetName();
151  mpDrawLayer->ScRenamePage( nTab, aTabName );
152 
153  maTabs[nTab]->SetDrawPageSize(false,false); // set the right size immediately
154  }
155  }
156 
157  mpDrawLayer->SetDefaultTabulator( GetDocOptions().GetTabDistance() );
158 
160 
161  // set draw defaults directly
162  SfxItemPool& rDrawPool = mpDrawLayer->GetItemPool();
164 
166  if (bImportingXML)
167  mpDrawLayer->EnableAdjust(false);
168 
169  mpDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
170  mpDrawLayer->SetCharCompressType( GetAsianCompression() );
171  mpDrawLayer->SetKernAsianPunctuation( GetAsianKerning() );
172 }
173 
175 {
176  if (mpDrawLayer)
177  {
178  SfxItemPool& rDrawPool = mpDrawLayer->GetItemPool();
182  }
183 }
184 
186 {
187  if (mpDrawLayer)
188  {
189  // use the printer even if IsValid is false
190  // Application::GetDefaultDevice causes trouble with changing MapModes
191  mpDrawLayer->SetRefDevice(GetRefDevice());
192  }
193 }
194 
196 {
197  if (!ValidTab(nTab) || nTab >= static_cast<SCTAB>(maTabs.size()) || !maTabs[nTab])
198  return;
199 
200  maTabs[nTab]->SetDrawPageSize();
201 }
202 
203 bool ScDocument::IsChart( const SdrObject* pObject )
204 {
205  // IsChart() implementation moved to svx drawinglayer
206  if(pObject && OBJ_OLE2 == pObject->GetObjIdentifier())
207  {
208  return static_cast<const SdrOle2Obj*>(pObject)->IsChart();
209  }
210 
211  return false;
212 }
213 
214 IMPL_LINK( ScDocument, GetUserDefinedColor, sal_uInt16, nColorIndex, Color* )
215 {
216  rtl::Reference<XColorList> xColorList;
217  if (mpDrawLayer)
218  xColorList = mpDrawLayer->GetColorList();
219  else
220  {
222  if (!pColorList.is())
223  pColorList = XColorList::CreateStdColorList();
224  xColorList = pColorList;
225  }
226  return const_cast<Color*>(&(xColorList->GetColor(nColorIndex)->GetColor()));
227 }
228 
230 {
232 
233  // remove DrawingLayer's SfxItemPool from Calc's SfxItemPool where
234  // it is registered as secondary pool
235  if (mxPoolHelper.is() && !IsClipOrUndo()) //Using IsClipOrUndo as a proxy for SharePooledResources called
236  {
237  ScDocumentPool* pLocalPool = mxPoolHelper->GetDocPool();
238 
239  if(pLocalPool && pLocalPool->GetSecondaryPool())
240  {
241  pLocalPool->SetSecondaryPool(nullptr);
242  }
243  }
244  mpDrawLayer.reset();
245 }
246 
247 bool ScDocument::DrawGetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer ) const
248 {
249  return mpDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer );
250 }
251 
252 void ScDocument::DeleteObjectsInArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
253  const ScMarkData& rMark, bool bAnchored)
254 {
255  if (!mpDrawLayer)
256  return;
257 
258  SCTAB nTabCount = GetTableCount();
259  for (const auto& rTab : rMark)
260  {
261  if (rTab >= nTabCount)
262  break;
263  if (maTabs[rTab])
264  mpDrawLayer->DeleteObjectsInArea( rTab, nCol1, nRow1, nCol2, nRow2, bAnchored);
265  }
266 }
267 
269 {
270  if (!mpDrawLayer)
271  return;
272 
273  mpDrawLayer->DeleteObjectsInSelection( rMark );
274 }
275 
276 bool ScDocument::HasOLEObjectsInArea( const ScRange& rRange, const ScMarkData* pTabMark )
277 {
278  // pTabMark is used only for selected tables. If pTabMark is 0, all tables of rRange are used.
279 
280  if (!mpDrawLayer)
281  return false;
282 
283  SCTAB nStartTab = 0;
284  SCTAB nEndTab = static_cast<SCTAB>(maTabs.size());
285  if ( !pTabMark )
286  {
287  nStartTab = rRange.aStart.Tab();
288  nEndTab = rRange.aEnd.Tab();
289  }
290 
291  for (SCTAB nTab = nStartTab; nTab <= nEndTab; nTab++)
292  {
293  if ( !pTabMark || pTabMark->GetTableSelect(nTab) )
294  {
295  tools::Rectangle aMMRect = GetMMRect( rRange.aStart.Col(), rRange.aStart.Row(),
296  rRange.aEnd.Col(), rRange.aEnd.Row(), nTab );
297 
298  SdrPage* pPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
299  OSL_ENSURE(pPage,"Page ?");
300  if (pPage)
301  {
302  SdrObjListIter aIter( pPage, SdrIterMode::Flat );
303  SdrObject* pObject = aIter.Next();
304  while (pObject)
305  {
306  if ( pObject->GetObjIdentifier() == OBJ_OLE2 &&
307  aMMRect.IsInside( pObject->GetCurrentBoundRect() ) )
308  return true;
309 
310  pObject = aIter.Next();
311  }
312  }
313  }
314  }
315 
316  return false;
317 }
318 
320 {
321  if (!mpDrawLayer)
322  return;
323  SdrPage* pPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
324  OSL_ENSURE(pPage,"Page ?");
325  if (!pPage)
326  return;
327 
328  SdrObjListIter aIter( pPage, SdrIterMode::Flat );
329  SdrObject* pObject = aIter.Next();
330  while (pObject)
331  {
332  if (SdrGrafObj* pGrafObj = dynamic_cast<SdrGrafObj*>(pObject))
333  {
334  if ( pGrafObj->IsAnimated() )
335  {
336  pGrafObj->StartAnimation();
337  }
338  }
339  pObject = aIter.Next();
340  }
341 }
342 
343 bool ScDocument::HasBackgroundDraw( SCTAB nTab, const tools::Rectangle& rMMRect ) const
344 {
345  // Are there objects in the background layer who are (partly) affected by rMMRect
346  // (for Drawing optimization, no deletion in front of the background
347  if (!mpDrawLayer)
348  return false;
349  SdrPage* pPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
350  OSL_ENSURE(pPage,"Page ?");
351  if (!pPage)
352  return false;
353 
354  bool bFound = false;
355 
356  SdrObjListIter aIter( pPage, SdrIterMode::Flat );
357  SdrObject* pObject = aIter.Next();
358  while (pObject && !bFound)
359  {
360  if ( pObject->GetLayer() == SC_LAYER_BACK && pObject->GetCurrentBoundRect().IsOver( rMMRect ) )
361  bFound = true;
362  pObject = aIter.Next();
363  }
364 
365  return bFound;
366 }
367 
368 bool ScDocument::HasAnyDraw( SCTAB nTab, const tools::Rectangle& rMMRect ) const
369 {
370  // Are there any objects at all who are (partly) affected by rMMRect?
371  // (To detect blank pages when printing)
372  if (!mpDrawLayer)
373  return false;
374  SdrPage* pPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
375  OSL_ENSURE(pPage,"Page ?");
376  if (!pPage)
377  return false;
378 
379  bool bFound = false;
380 
381  SdrObjListIter aIter( pPage, SdrIterMode::Flat );
382  SdrObject* pObject = aIter.Next();
383  while (pObject && !bFound)
384  {
385  if ( pObject->GetCurrentBoundRect().IsOver( rMMRect ) )
386  bFound = true;
387  pObject = aIter.Next();
388  }
389 
390  return bFound;
391 }
392 
394 {
395  if (mpDrawLayer)
396  mpDrawLayer->EnsureGraphicNames();
397 }
398 
399 SdrObject* ScDocument::GetObjectAtPoint( SCTAB nTab, const Point& rPos )
400 {
401  // for Drag&Drop on draw object
402  SdrObject* pFound = nullptr;
403  if (mpDrawLayer && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab])
404  {
405  SdrPage* pPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
406  OSL_ENSURE(pPage,"Page ?");
407  if (pPage)
408  {
409  SdrObjListIter aIter( pPage, SdrIterMode::Flat );
410  SdrObject* pObject = aIter.Next();
411  while (pObject)
412  {
413  if ( pObject->GetCurrentBoundRect().IsInside(rPos) )
414  {
415  // Intern is of no interest
416  // Only object form background layer, when no object form another layer is found
417  SdrLayerID nLayer = pObject->GetLayer();
418  if ( (nLayer != SC_LAYER_INTERN) && (nLayer != SC_LAYER_HIDDEN) )
419  {
420  if ( nLayer != SC_LAYER_BACK ||
421  !pFound || pFound->GetLayer() == SC_LAYER_BACK )
422  {
423  pFound = pObject;
424  }
425  }
426  }
427  // Continue search -> take last (on top) found object
428  pObject = aIter.Next();
429  }
430  }
431  }
432  return pFound;
433 }
434 
435 bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow,
436  SCCOL nEndCol, SCROW nEndRow, bool bLeftIsEmpty,
437  ScRange* pLastRange, tools::Rectangle* pLastMM ) const
438 {
439  if (!IsBlockEmpty( nTab, nStartCol, nStartRow, nEndCol, nEndRow ))
440  return false;
441 
442  if (HasAttrib(ScRange(nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab), HasAttrFlags::Lines))
443  // We want to print sheets with borders even if there is no cell content.
444  return false;
445 
446  tools::Rectangle aMMRect;
447  if ( pLastRange && pLastMM && nTab == pLastRange->aStart.Tab() &&
448  nStartRow == pLastRange->aStart.Row() && nEndRow == pLastRange->aEnd.Row() )
449  {
450  // keep vertical part of aMMRect, only update horizontal position
451  aMMRect = *pLastMM;
452 
453  tools::Long nLeft = 0;
454  SCCOL i;
455  for (i=0; i<nStartCol; i++)
456  nLeft += GetColWidth(i,nTab);
457  tools::Long nRight = nLeft;
458  for (i=nStartCol; i<=nEndCol; i++)
459  nRight += GetColWidth(i,nTab);
460 
463  }
464  else
465  aMMRect = GetMMRect( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
466 
467  if ( pLastRange && pLastMM )
468  {
469  *pLastRange = ScRange( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab );
470  *pLastMM = aMMRect;
471  }
472 
473  if ( HasAnyDraw( nTab, aMMRect ))
474  return false;
475 
476  if ( nStartCol > 0 && !bLeftIsEmpty )
477  {
478  // similar to in ScPrintFunc::AdjustPrintArea
479  // ExtendPrintArea starting only from the start column of the print area
480 
481  SCCOL nExtendCol = nStartCol - 1;
482  SCROW nTmpRow = nEndRow;
483 
484  // ExtendMerge() is non-const, but called without refresh. GetPrinter()
485  // might create and assign a printer.
486  ScDocument* pThis = const_cast<ScDocument*>(this);
487 
488  pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab ); // no Refresh, incl. Attrs
489 
490  OutputDevice* pDev = pThis->GetPrinter();
491  pDev->SetMapMode(MapMode(MapUnit::MapPixel)); // Important for GetNeededSize
492  ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow );
493  if ( nExtendCol >= nStartCol )
494  return false;
495  }
496 
497  return true;
498 }
499 
500 void ScDocument::Clear( bool bFromDestructor )
501 {
502  for (auto& rxTab : maTabs)
503  if (rxTab)
504  rxTab->GetCondFormList()->clear();
505 
506  maTabs.clear();
507  pSelectionAttr.reset();
508 
509  if (mpDrawLayer)
510  {
511  mpDrawLayer->ClearModel( bFromDestructor );
512  }
513 }
514 
516 {
517  // looks for detective objects, annotations don't count
518  // (used to adjust scale so detective objects hit their cells better)
519 
520  bool bFound = false;
521 
522  if (mpDrawLayer)
523  {
524  SdrPage* pPage = mpDrawLayer->GetPage(static_cast<sal_uInt16>(nTab));
525  OSL_ENSURE(pPage,"Page ?");
526  if (pPage)
527  {
528  SdrObjListIter aIter( pPage, SdrIterMode::DeepNoGroups );
529  SdrObject* pObject = aIter.Next();
530  while (pObject && !bFound)
531  {
532  // anything on the internal layer except captions (annotations)
533  if ( (pObject->GetLayer() == SC_LAYER_INTERN) && !ScDrawLayer::IsNoteCaption( pObject ) )
534  bFound = true;
535 
536  pObject = aIter.Next();
537  }
538  }
539  }
540 
541  return bFound;
542 }
543 
545 {
546  // In old versions (until 4.0 without SP), when switching between systems,
547  // the Font attribute was not adjusted.
548  // This has to be redone for Documents until SP2:
549  // Everything that is not SYMBOL is set to system CharSet.
550  // CharSet should be correct for new documents (version SC_FONTCHARSET)
551 
552  bool bUpdateOld = ( nSrcVer < SC_FONTCHARSET );
553 
554  rtl_TextEncoding eSysSet = osl_getThreadTextEncoding();
555  if ( !(eSrcSet != eSysSet || bUpdateOld) )
556  return;
557 
558  ScDocumentPool* pPool = mxPoolHelper->GetDocPool();
559  for (const SfxPoolItem* pItem : pPool->GetItemSurrogates(ATTR_FONT))
560  {
561  auto pFontItem = const_cast<SvxFontItem*>(dynamic_cast<const SvxFontItem*>(pItem));
562  if ( pFontItem && ( pFontItem->GetCharSet() == eSrcSet ||
563  ( bUpdateOld && pFontItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
564  pFontItem->SetCharSet(eSysSet);
565  }
566 
567  if ( mpDrawLayer )
568  {
569  SfxItemPool& rDrawPool = mpDrawLayer->GetItemPool();
570  for (const SfxPoolItem* pItem : rDrawPool.GetItemSurrogates(EE_CHAR_FONTINFO))
571  {
572  SvxFontItem* pFontItem = const_cast<SvxFontItem*>(dynamic_cast<const SvxFontItem*>(pItem));
573  if ( pFontItem && ( pFontItem->GetCharSet() == eSrcSet ||
574  ( bUpdateOld && pFontItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
575  pFontItem->SetCharSet( eSysSet );
576  }
577  }
578 }
579 
581 {
582  bLoadingMedium = bVal;
583  for (auto& rxTab : maTabs)
584  {
585  if (!rxTab)
586  return;
587 
588  rxTab->SetLoadingMedium(bVal);
589  }
590 }
591 
593 {
594  bImportingXML = bVal;
595  if (mpDrawLayer)
596  mpDrawLayer->EnableAdjust(!bImportingXML);
597 
598  if ( !bVal )
599  {
600  // #i57869# after loading, do the real RTL mirroring for the sheets that have the LoadingRTL flag set
601 
602  for ( SCTAB nTab=0; nTab< static_cast<SCTAB>(maTabs.size()) && maTabs[nTab]; nTab++ )
603  if ( maTabs[nTab]->IsLoadingRTL() )
604  {
605  // SetLayoutRTL => SetDrawPageSize => ScDrawLayer::SetPageSize, includes RTL-mirroring;
606  // bImportingXML must be cleared first
607  maTabs[nTab]->SetLoadingRTL( false );
609  }
610  }
611 
612  SetLoadingMedium(bVal);
613 }
614 
615 const std::shared_ptr<SvxForbiddenCharactersTable>& ScDocument::GetForbiddenCharacters() const
616 {
617  return xForbiddenCharacters;
618 }
619 
620 void ScDocument::SetForbiddenCharacters(const std::shared_ptr<SvxForbiddenCharactersTable>& rNew)
621 {
622  xForbiddenCharacters = rNew;
623  if ( mpEditEngine )
625  if ( mpDrawLayer )
626  mpDrawLayer->SetForbiddenCharsTable( xForbiddenCharacters );
627 }
628 
630 {
631  return nAsianCompression != CharCompressType::Invalid;
632 }
633 
635 {
636  if ( nAsianCompression == CharCompressType::Invalid )
637  return CharCompressType::NONE;
638  else
639  return nAsianCompression;
640 }
641 
643 {
644  nAsianCompression = nNew;
645  if ( mpEditEngine )
646  mpEditEngine->SetAsianCompressionMode( nAsianCompression );
647  if ( mpDrawLayer )
648  mpDrawLayer->SetCharCompressType( nAsianCompression );
649 }
650 
652 {
654 }
655 
657 {
659  return false;
660  else
661  return static_cast<bool>(nAsianKerning);
662 }
663 
665 {
666  nAsianKerning = static_cast<sal_uInt8>(bNew);
667  if ( mpEditEngine )
668  mpEditEngine->SetKernAsianPunctuation( static_cast<bool>( nAsianKerning ) );
669  if ( mpDrawLayer )
670  mpDrawLayer->SetKernAsianPunctuation( static_cast<bool>( nAsianKerning ) );
671 }
672 
674 {
678 }
679 
680 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void BeginDrawUndo()
Definition: documen9.cxx:60
void SetCharSet(rtl_TextEncoding _eEncoding)
bool IsValidAsianKerning() const
Definition: documen9.cxx:651
std::shared_ptr< SvxForbiddenCharactersTable > xForbiddenCharacters
Definition: document.hxx:398
std::unique_ptr< ScFieldEditEngine > mpEditEngine
Definition: document.hxx:366
ScAddress aStart
Definition: address.hxx:499
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
Definition: markdata.hxx:42
virtual const tools::Rectangle & GetCurrentBoundRect() const
SCROW Row() const
Definition: address.hxx:261
OUString GetTitle(sal_uInt16 nMaxLen=0) const
void SetAsianKerning(bool bNew)
Definition: documen9.cxx:664
static XColorListRef CreateStdColorList()
SfxObjectShell * mpShell
Definition: document.hxx:368
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
Definition: documen9.cxx:195
SC_DLLPUBLIC void SetLayoutRTL(SCTAB nTab, bool bRTL, ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
Definition: document.cxx:949
long Long
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
static const sal_uInt16 nSrcVer
Definition: document.hxx:474
rtl_TextEncoding eSrcSet
Definition: document.hxx:452
bool IsOver(const tools::Rectangle &rRect) const
bool IsClipOrUndo() const
Definition: document.hxx:1532
constexpr SdrLayerID SC_LAYER_BACK(1)
ScAddress aEnd
Definition: address.hxx:500
bool bLoadingMedium
Definition: document.hxx:500
void SetKernAsianPunctuation(bool bEnabled)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
bool bImportingXML
Definition: document.hxx:501
virtual SdrObjKind GetObjIdentifier() const
void ApplyAsianEditSettings(ScEditEngineDefaulter &rEngine)
Definition: documen9.cxx:673
sc::DocumentLinkManager & GetDocLinkManager()
Definition: documen2.cxx:227
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
EmbeddedObjectRef * pObject
void SetMapMode()
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
Definition: document.cxx:5205
void SetRight(tools::Long v)
sfx2::LinkManager * getLinkManager(bool bCreate=true)
void StartAnimations(SCTAB nTab)
Definition: documen9.cxx:319
LanguageType eCjkLanguage
Definition: document.hxx:450
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: documen8.cxx:113
void DeleteDrawLayer()
Definition: documen9.cxx:229
SC_DLLPUBLIC void SetImportingXML(bool bVal)
Definition: documen9.cxx:592
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharacters() const
Definition: documen9.cxx:615
void SetLeft(tools::Long v)
#define SC_ASIANKERNING_INVALID
Definition: document.hxx:243
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:313
static void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
rtl_TextEncoding GetCharSet() const
bool HasAnyDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
Definition: documen9.cxx:368
TableContainer maTabs
Definition: document.hxx:375
SC_DLLPUBLIC void TransferDrawPage(const ScDocument &rSrcDoc, SCTAB nSrcPos, SCTAB nDestPos)
Definition: documen9.cxx:66
SCTAB Tab() const
Definition: address.hxx:270
void Clear(bool bFromDestructor=false)
Definition: documen9.cxx:500
std::unique_ptr< ScDrawLayer > mpDrawLayer
Definition: document.hxx:371
static void AdjustRangesOfChartsOnDestinationPage(const ScDocument &rSrcDoc, ScDocument &rDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab)
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
Definition: documen3.cxx:1939
bool IsPrintEmpty(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bLeftIsEmpty=false, ScRange *pLastRange=nullptr, tools::Rectangle *pLastMM=nullptr) const
Definition: documen9.cxx:435
A pretty assertion that checks that the relevant bits in the are not set on the document at entry an...
Definition: document.hxx:2661
bool HasDetectiveObjects(SCTAB nTab) const
Definition: documen9.cxx:515
bool HasOLEObjectsInArea(const ScRange &rRange, const ScMarkData *pTabMark=nullptr)
Definition: documen9.cxx:276
IMPL_LINK(ScDocument, GetUserDefinedColor, sal_uInt16, nColorIndex, Color *)
Definition: documen9.cxx:214
SC_DLLPUBLIC void InitDrawLayer(SfxObjectShell *pDocShell=nullptr)
Definition: documen9.cxx:98
LanguageType eCtlLanguage
Definition: document.hxx:451
int i
CharCompressType
sal_Int16 SCCOL
Definition: types.hxx:21
LanguageType eLanguage
Definition: document.hxx:449
bool HasBackgroundDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
Definition: documen9.cxx:343
void ExtendPrintArea(OutputDevice *pDev, SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW nEndRow) const
Find the maximum column position that contains printable data for the specified row range...
Definition: documen3.cxx:2101
SdrObject * GetObjectAtPoint(SCTAB nTab, const Point &rPos)
Definition: documen9.cxx:399
bool IsInside(const Point &rPOINT) const
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: documen3.cxx:1988
bool IsBlockEmpty(SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, bool bIgnoreNotes=false) const
Definition: document.cxx:5322
void DeleteObjectsInArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, bool bAnchored=false)
Definition: documen9.cxx:252
static void UpdateChartsOnDestinationPage(ScDocument &rDestDoc, const SCTAB nDestTab)
void SetLoadingMedium(bool bVal)
Definition: documen9.cxx:580
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
Definition: document.cxx:5594
SCCOL Col() const
Definition: address.hxx:266
virtual SdrLayerID GetLayer() const
SfxItemPool * GetSecondaryPool() const
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
SdrObject * Next()
sal_Int32 SCROW
Definition: types.hxx:17
SC_DLLPUBLIC OutputDevice * GetRefDevice()
Definition: documen8.cxx:198
bool GetAsianKerning() const
Definition: documen9.cxx:656
constexpr SdrLayerID SC_LAYER_HIDDEN(4)
CharCompressType nAsianCompression
Definition: document.hxx:529
unsigned char sal_uInt8
void UpdateDrawPrinter()
Definition: documen9.cxx:185
void EnsureGraphicNames()
Definition: documen9.cxx:393
OUString aName
constexpr SdrLayerID SC_LAYER_INTERN(2)
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
void SetAsianCompressionMode(CharCompressType nCompression)
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
SfxBroadcaster * GetDrawBroadcaster()
Definition: documen9.cxx:55
std::unique_ptr< ScPatternAttr > pSelectionAttr
Definition: document.hxx:382
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
static bool IsChart(const SdrObject *pObject)
Definition: documen9.cxx:203
bool bAutoCalc
Definition: document.hxx:483
rtl::Reference< ScPoolHelper > mxPoolHelper
Definition: document.hxx:355
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
Definition: drwlayer.cxx:2618
#define SC_FONTCHARSET
Definition: rechead.hxx:32
bool IsValidAsianCompression() const
Definition: documen9.cxx:629
void UpdateFontCharSet()
Definition: documen9.cxx:544
void DeleteObjectsInSelection(const ScMarkData &rMark)
Definition: documen9.cxx:268
bool GetTableSelect(SCTAB nTab) const
Definition: markdata.cxx:184
void SetAsianCompression(CharCompressType nNew)
Definition: documen9.cxx:642
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
Definition: document.cxx:4151
void SetForbiddenCharacters(const std::shared_ptr< SvxForbiddenCharactersTable > &rNew)
Definition: documen9.cxx:620
bool IsLoading() const
OBJ_OLE2
SC_DLLPUBLIC bool DrawGetPrintArea(ScRange &rRange, bool bSetHor, bool bSetVer) const
Definition: documen9.cxx:247
bool ValidTab(SCTAB nTab)
Definition: address.hxx:104
void UpdateDrawLanguages()
Definition: documen9.cxx:174
CharCompressType GetAsianCompression() const
Definition: documen9.cxx:634
sal_uInt8 nAsianKerning
Definition: document.hxx:530
void SetSecondaryPool(SfxItemPool *pPool)
sal_Int16 SCTAB
Definition: types.hxx:22
void SetPoolDefaultItem(const SfxPoolItem &)