27#include <osl/thread.h>
28#include <osl/diagnose.h>
39#include <document.hxx>
49#include <charthelper.hxx>
73 if (pOldPage && pNewPage)
81 pNewObject->NbcMove(
Size(0,0));
85 mpDrawLayer->AddCalcUndo( std::make_unique<SdrUndoInsertObj>( *pNewObject ) );
87 pOldObject = aIter.
Next();
130 OSL_ENSURE(!pLocalPool->
GetSecondaryPool(),
"OOps, already a secondary pool set where the DrawingLayer ItemPool is to be placed (!)");
139 SCTAB nDrawPages = 0;
141 for (nTab=0; nTab < static_cast<SCTAB>(
maTabs.size()); nTab++)
143 nDrawPages = nTab + 1;
145 for (nTab=0; nTab<nDrawPages && nTab < static_cast<SCTAB>(
maTabs.size()); nTab++)
150 OUString aTabName =
maTabs[nTab]->GetName();
153 maTabs[nTab]->SetDrawPageSize(
false,
false);
200 maTabs[nTab]->SetDrawPageSize();
218 xColorList = mpDrawLayer->GetColorList();
222 if (!pColorList.is())
224 xColorList = pColorList;
226 return const_cast<Color*
>(&(xColorList->GetColor(nColorIndex)->GetColor()));
249 return mpDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer );
259 for (
const auto& rTab : rMark)
261 if (rTab >= nTabCount)
264 mpDrawLayer->DeleteObjectsInArea( rTab, nCol1, nRow1, nCol2, nRow2, bAnchored);
291 for (
SCTAB nTab = nStartTab; nTab <= nEndTab; nTab++)
299 OSL_ENSURE(pPage,
"Page ?");
306 if (
pObject->GetObjIdentifier() == SdrObjKind::OLE2 &&
324 OSL_ENSURE(pPage,
"Page ?");
334 if ( pGrafObj->IsAnimated() )
336 pGrafObj->StartAnimation();
350 OSL_ENSURE(pPage,
"Page ?");
375 OSL_ENSURE(pPage,
"Page ?");
385 if (
pObject->GetCurrentBoundRect().Overlaps( rMMRect ) )
406 OSL_ENSURE(pPage,
"Page ?");
413 if (
pObject->GetCurrentBoundRect().Contains(rPos) )
437 SCTAB nTab,
bool bLeftIsEmpty,
440 if (!
IsBlockEmpty( nStartCol, nStartRow, nEndCol, nEndRow, nTab ))
448 if ( pLastRange && pLastMM && nTab == pLastRange->
aStart.
Tab() &&
449 nStartRow == pLastRange->
aStart.
Row() && nEndRow == pLastRange->
aEnd.
Row() )
456 for (
i=0;
i<nStartCol;
i++)
459 for (
i=nStartCol;
i<=nEndCol;
i++)
466 aMMRect =
GetMMRect( nStartCol, nStartRow, nEndCol, nEndRow, nTab );
468 if ( pLastRange && pLastMM )
470 *pLastRange =
ScRange( nStartCol, nStartRow, nTab, nEndCol, nEndRow, nTab );
477 if ( nStartCol > 0 && !bLeftIsEmpty )
482 SCCOL nExtendCol = nStartCol - 1;
483 SCROW nTmpRow = nEndRow;
489 pThis->
ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab );
494 if ( nExtendCol >= nStartCol )
503 for (
auto& rxTab :
maTabs)
505 rxTab->GetCondFormList()->clear();
526 OSL_ENSURE(pPage,
"Page ?");
555 rtl_TextEncoding eSysSet = osl_getThreadTextEncoding();
556 if ( !(
eSrcSet != eSysSet || bUpdateOld) )
563 if ( pFontItem && ( pFontItem->GetCharSet() ==
eSrcSet ||
564 ( bUpdateOld && pFontItem->GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
575 ( bUpdateOld && pFontItem->
GetCharSet() != RTL_TEXTENCODING_SYMBOL ) ) )
584 for (
auto& rxTab :
maTabs)
589 rxTab->SetLoadingMedium(bVal);
603 for (
SCTAB nTab=0; nTab< static_cast<SCTAB>(
maTabs.size()) &&
maTabs[nTab]; nTab++ )
604 if (
maTabs[nTab]->IsLoadingRTL() )
608 maTabs[nTab]->SetLoadingRTL(
false );
638 return CharCompressType::NONE;
bool ValidTab(SCTAB nTab)
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 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)
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
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual SdrLayerID GetLayer() const
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) 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...