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 ?");
310 pObject = aIter.
Next();
324 OSL_ENSURE(pPage,
"Page ?");
332 if (
SdrGrafObj* pGrafObj = dynamic_cast<SdrGrafObj*>(pObject))
334 if ( pGrafObj->IsAnimated() )
336 pGrafObj->StartAnimation();
339 pObject = aIter.
Next();
350 OSL_ENSURE(pPage,
"Page ?");
358 while (pObject && !bFound)
362 pObject = aIter.
Next();
375 OSL_ENSURE(pPage,
"Page ?");
383 while (pObject && !bFound)
387 pObject = aIter.
Next();
406 OSL_ENSURE(pPage,
"Page ?");
428 pObject = aIter.
Next();
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 ?");
531 while (pObject && !bFound)
537 pObject = aIter.
Next();
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;
void SetCharSet(rtl_TextEncoding _eEncoding)
bool IsValidAsianKerning() const
std::shared_ptr< SvxForbiddenCharactersTable > xForbiddenCharacters
std::unique_ptr< ScFieldEditEngine > mpEditEngine
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...
virtual const tools::Rectangle & GetCurrentBoundRect() const
OUString GetTitle(sal_uInt16 nMaxLen=0) const
void SetAsianKerning(bool bNew)
static XColorListRef CreateStdColorList()
SC_DLLPUBLIC void SetDrawPageSize(SCTAB nTab)
SC_DLLPUBLIC void SetLayoutRTL(SCTAB nTab, bool bRTL, ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
static const sal_uInt16 nSrcVer
bool IsClipOrUndo() const
constexpr SdrLayerID SC_LAYER_BACK(1)
void SetKernAsianPunctuation(bool bEnabled)
constexpr TypedWhichId< SvxFontItem > ATTR_FONT(100)
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CJK(EE_CHAR_START+15)
virtual SdrObjKind GetObjIdentifier() const
void ApplyAsianEditSettings(ScEditEngineDefaulter &rEngine)
sc::DocumentLinkManager & GetDocLinkManager()
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
EmbeddedObjectRef * pObject
SC_DLLPUBLIC bool HasAttrib(SCCOL nCol1, SCROW nRow1, SCTAB nTab1, SCCOL nCol2, SCROW nRow2, SCTAB nTab2, HasAttrFlags nMask) const
sfx2::LinkManager * getLinkManager(bool bCreate=true)
void StartAnimations(SCTAB nTab)
LanguageType eCjkLanguage
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
SC_DLLPUBLIC void SetImportingXML(bool bVal)
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharacters() const
bool IsPrintEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bLeftIsEmpty=false, ScRange *pLastRange=nullptr, tools::Rectangle *pLastMM=nullptr) const
#define SC_ASIANKERNING_INVALID
SC_DLLPUBLIC SCTAB GetTableCount() const
static void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
rtl_TextEncoding GetCharSet() const
bool HasAnyDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
SC_DLLPUBLIC void TransferDrawPage(const ScDocument &rSrcDoc, SCTAB nSrcPos, SCTAB nDestPos)
void Clear(bool bFromDestructor=false)
std::unique_ptr< ScDrawLayer > mpDrawLayer
static void AdjustRangesOfChartsOnDestinationPage(const ScDocument &rSrcDoc, ScDocument &rDestDoc, const SCTAB nSrcTab, const SCTAB nDestTab)
SC_DLLPUBLIC const ScDocOptions & GetDocOptions() const
A pretty assertion that checks that the relevant bits in the are not set on the document at entry an...
bool IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const
bool HasDetectiveObjects(SCTAB nTab) const
bool HasOLEObjectsInArea(const ScRange &rRange, const ScMarkData *pTabMark=nullptr)
IMPL_LINK(ScDocument, GetUserDefinedColor, sal_uInt16, nColorIndex, Color *)
SC_DLLPUBLIC void InitDrawLayer(SfxObjectShell *pDocShell=nullptr)
LanguageType eCtlLanguage
bool HasBackgroundDraw(SCTAB nTab, const tools::Rectangle &rMMRect) const
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...
SdrObject * GetObjectAtPoint(SCTAB nTab, const Point &rPos)
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
void DeleteObjectsInArea(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const ScMarkData &rMark, bool bAnchored=false)
static void UpdateChartsOnDestinationPage(ScDocument &rDestDoc, const SCTAB nDestTab)
void SetLoadingMedium(bool bVal)
SC_DLLPUBLIC bool ExtendMerge(SCCOL nStartCol, SCROW nStartRow, SCCOL &rEndCol, SCROW &rEndRow, SCTAB nTab, bool bRefresh=false)
virtual SdrLayerID GetLayer() const
SfxItemPool * GetSecondaryPool() const
constexpr TypedWhichId< SvxLanguageItem > EE_CHAR_LANGUAGE_CTL(EE_CHAR_START+16)
SC_DLLPUBLIC OutputDevice * GetRefDevice()
bool GetAsianKerning() const
constexpr SdrLayerID SC_LAYER_HIDDEN(4)
CharCompressType nAsianCompression
void EnsureGraphicNames()
constexpr SdrLayerID SC_LAYER_INTERN(2)
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
void SetAsianCompressionMode(CharCompressType nCompression)
virtual SdrObject * CloneSdrObject(SdrModel &rTargetModel) const
SfxBroadcaster * GetDrawBroadcaster()
std::unique_ptr< ScPatternAttr > pSelectionAttr
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)
rtl::Reference< ScPoolHelper > mxPoolHelper
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
bool IsValidAsianCompression() const
void DeleteObjectsInSelection(const ScMarkData &rMark)
bool GetTableSelect(SCTAB nTab) const
void SetAsianCompression(CharCompressType nNew)
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
void SetForbiddenCharacters(const std::shared_ptr< SvxForbiddenCharactersTable > &rNew)
SC_DLLPUBLIC bool DrawGetPrintArea(ScRange &rRange, bool bSetHor, bool bSetVer) const
bool ValidTab(SCTAB nTab)
void UpdateDrawLanguages()
CharCompressType GetAsianCompression() const
void SetSecondaryPool(SfxItemPool *pPool)
void SetPoolDefaultItem(const SfxPoolItem &)