27#include <osl/thread.h>
28#include <osl/diagnose.h>
39#include <document.hxx>
50#include <charthelper.hxx>
74 if (pOldPage && pNewPage)
84 pStyleSheet->GetName(), pStyleSheet->GetFamily(),
true);
88 pNewObject->NbcMove(
Size(0,0));
92 mpDrawLayer->AddCalcUndo( std::make_unique<SdrUndoInsertObj>( *pNewObject ) );
94 pOldObject = aIter.
Next();
137 OSL_ENSURE(!pLocalPool->
GetSecondaryPool(),
"OOps, already a secondary pool set where the DrawingLayer ItemPool is to be placed (!)");
147 SCTAB nDrawPages = 0;
151 nDrawPages = nTab + 1;
153 for (nTab = 0; nTab < nDrawPages && nTab <
GetTableCount(); nTab++)
158 OUString aTabName =
maTabs[nTab]->GetName();
161 maTabs[nTab]->SetDrawPageSize(
false,
false);
206 pTable->SetDrawPageSize();
224 xColorList = mpDrawLayer->GetColorList();
228 if (!pColorList.is())
230 xColorList = pColorList;
232 return const_cast<Color*
>(&(xColorList->GetColor(nColorIndex)->GetColor()));
237 return mpDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer );
247 for (
const auto& rTab : rMark)
249 if (rTab >= nTabCount)
252 mpDrawLayer->DeleteObjectsInArea( rTab, nCol1, nRow1, nCol2, nRow2, bAnchored);
279 for (
SCTAB nTab = nStartTab; nTab <= nEndTab; nTab++)
287 OSL_ENSURE(pPage,
"Page ?");
294 if (
pObject->GetObjIdentifier() == SdrObjKind::OLE2 &&
312 OSL_ENSURE(pPage,
"Page ?");
322 if ( pGrafObj->IsAnimated() )
324 pGrafObj->StartAnimation();
338 OSL_ENSURE(pPage,
"Page ?");
363 OSL_ENSURE(pPage,
"Page ?");
373 if (
pObject->GetCurrentBoundRect().Overlaps( rMMRect ) )
394 OSL_ENSURE(pPage,
"Page ?");
401 if (
pObject->GetCurrentBoundRect().Contains(rPos) )
425 SCTAB nTab,
bool bLeftIsEmpty,
428 if (!
IsBlockEmpty( nStartCol, nStartRow, nEndCol, nEndRow, nTab ))
436 if ( pLastRange && pLastMM && nTab == pLastRange->
aStart.
Tab() &&
437 nStartRow == pLastRange->
aStart.
Row() && nEndRow == pLastRange->
aEnd.
Row() )
444 for (
i=0;
i<nStartCol;
i++)
447 for (
i=nStartCol;
i<=nEndCol;
i++)
454 aMMRect =
GetMMRect( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
456 if ( pLastRange && pLastMM )
458 *pLastRange =
ScRange( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab );
465 if ( nStartCol > 0 && !bLeftIsEmpty )
470 SCCOL nExtendCol = nStartCol - 1;
471 SCROW nTmpRow = nEndRow;
477 pThis->
ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab );
482 if ( nExtendCol >= nStartCol )
491 for (
auto& rxTab :
maTabs)
493 rxTab->GetCondFormList()->clear();
514 OSL_ENSURE(pPage,
"Page ?");
543 rtl_TextEncoding eSysSet = osl_getThreadTextEncoding();
544 if ( !(
eSrcSet != eSysSet || bUpdateOld) )
551 if ( pFontItem && ( pFontItem->GetCharSet() ==
eSrcSet ||
552 ( bUpdateOld && pFontItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
563 ( bUpdateOld && pFontItem->
GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
572 for (
auto& rxTab :
maTabs)
577 rxTab->SetLoadingMedium(bVal);
592 if (
maTabs[nTab]->IsLoadingRTL() )
596 maTabs[nTab]->SetLoadingRTL(
false );
626 return CharCompressType::NONE;
void SetKernAsianPunctuation(bool bEnabled)
void SetAsianCompressionMode(CharCompressType nCompression)
static void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
static void UpdateChartsOnDestinationPage(ScDocument &rDestDoc, const SCTAB nDestTab)
static void AdjustRangesOfChartsOnDestinationPage(const ScDocument &rSrcDoc, ScDocument &rDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab)
sal_uInt16 GetTabDistance() const
bool IsValidAsianKerning() const
bool IsPrintEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bLeftIsEmpty=false, ScRange *pLastRange=nullptr, tools::Rectangle *pLastMM=nullptr) const
bool GetAsianKerning() const
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
std::unique_ptr< ScFieldEditEngine > mpEditEngine
void Clear(bool bFromDestructor=false)
SC_DLLPUBLIC void SetLayoutRTL(SCTAB nTab, bool bRTL, ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
SC_DLLPUBLIC ScTable * FetchTable(SCTAB nTab)
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
SC_DLLPUBLIC void InitDrawLayer(SfxObjectShell *pDocShell=nullptr)
LanguageType eCtlLanguage
void EnsureGraphicNames()
static const sal_uInt16 nSrcVer
rtl::Reference< ScPoolHelper > mxPoolHelper
CharCompressType GetAsianCompression() const
std::unique_ptr< ScPatternAttr > pSelectionAttr
bool HasDetectiveObjects(SCTAB nTab) const
SC_DLLPUBLIC OutputDevice * GetRefDevice()
bool HasOLEObjectsInArea(const ScRange &rRange, const ScMarkData *pTabMark=nullptr)
bool IsValidAsianCompression() const
void SetAsianKerning(bool bNew)
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
void DeleteObjectsInSelection(const ScMarkData &rMark)
bool HasAnyDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharacters() const
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
SfxBroadcaster * GetDrawBroadcaster()
bool IsClipOrUndo() const
void DeleteObjectsInArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, bool bAnchored=false)
SC_DLLPUBLIC void SetImportingXML(bool bVal)
SC_DLLPUBLIC void TransferDrawPage(const ScDocument &rSrcDoc, SCTAB nSrcPos, SCTAB nDestPos)
static bool IsChart(const SdrObject *pObject)
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
std::shared_ptr< SvxForbiddenCharactersTable > xForbiddenCharacters
LanguageType eCjkLanguage
CharCompressType nAsianCompression
void ApplyAsianEditSettings(ScEditEngineDefaulter &rEngine)
SC_DLLPUBLIC bool DrawGetPrintArea(ScRange &rRange, bool bSetHor, bool bSetVer) const
sc::DocumentLinkManager & GetDocLinkManager()
bool HasBackgroundDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
void UpdateDrawLanguages()
bool IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
std::unique_ptr< ScDrawLayer > mpDrawLayer
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.
void SetForbiddenCharacters(const std::shared_ptr< SvxForbiddenCharactersTable > &rNew)
void SetAsianCompression(CharCompressType nNew)
void StartAnimations(SCTAB nTab)
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
void SetLoadingMedium(bool bVal)
SC_DLLPUBLIC SCTAB GetTableCount() const
SdrObject * GetObjectAtPoint(SCTAB nTab, const Point &rPos)
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool GetTableSelect(SCTAB nTab) const
void CopyStyleFrom(SfxStyleSheetBasePool *pSrcPool, const OUString &rName, SfxStyleFamily eFamily, bool bNewStyleHierarchy=false)
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SfxStyleSheet * GetStyleSheet() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const=0
virtual SdrLayerID GetLayer() const
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxItemPool * GetSecondaryPool() const
void SetPoolDefaultItem(const SfxPoolItem &)
void SetSecondaryPool(SfxItemPool *pPool)
OUString GetTitle(sal_uInt16 nMaxLen=0) const
rtl_TextEncoding GetCharSet() const
void SetCharSet(rtl_TextEncoding _eEncoding)
static XColorListRef CreateStdColorList()
sfx2::LinkManager * getLinkManager(bool bCreate=true)
IMPL_LINK(ScDocument, GetUserDefinedColor, sal_uInt16, nColorIndex, Color *)
#define SC_ASIANKERNING_INVALID
constexpr TypedWhichId< SvxAutoKernItem > EE_CHAR_PAIRKERNING(EE_CHAR_START+11)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE(EE_CHAR_START+14)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
EmbeddedObjectRef * pObject
constexpr SdrLayerID SC_LAYER_HIDDEN(4)
constexpr SdrLayerID SC_LAYER_INTERN(2)
constexpr SdrLayerID SC_LAYER_BACK(1)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
A pretty assertion that checks that the relevant bits in the @nFlags are not set on the document at e...