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