20#include <com/sun/star/uno/Reference.hxx>
21#include <com/sun/star/chart/XChartDocument.hpp>
22#include <com/sun/star/chart2/XChartDocument.hpp>
23#include <com/sun/star/embed/XClassifiedObject.hpp>
24#include <com/sun/star/embed/XEmbeddedObject.hpp>
43#include <svx/svxids.hrc>
57#include <osl/diagnose.h>
65#include <document.hxx>
73#include <charthelper.hxx>
83#define DET_ARROW_OFFSET 1000
111 OSL_ENSURE(
pData,
"ScUndoObjData: Data missing");
130 OSL_ENSURE(
pData,
"ScUndoObjData: Data missing");
162 if (
mxObj->IsInserted() &&
mxObj->getSdrPageFromSdrObject())
165 mxObj->getSdrModelFromSdrObject().Broadcast(aHint);
182 if (
mxObj->IsInserted() &&
mxObj->getSdrPageFromSdrObject())
185 mxObj->getSdrModelFromSdrObject().Broadcast(aHint);
207#define MAXMM 10000000
226 nClipEndX = nClipEndX + nClipStartX;
227 nClipEndY += nClipStartY;
229 return ScRange(nClipStartX, nClipStartY, nClipTab, nClipEndX, nClipEndY, nClipTab);
235 pGlobalDrawPersist ? pGlobalDrawPersist : (pDocument ? pDocument->GetDocumentShell() : nullptr)),
239 bAdjustEnabled( true ),
240 bHyphenatorSet( false )
308 if ( pHitOutlinerPool )
329 Broadcast(
SdrHint(SdrHintKind::ModelCleared));
345 css::uno::Reference< css::linguistic2::XHyphenator >
365 for (sal_uInt16
i=0;
i<
nCount && !bFound;
i++)
386 InsertPage(pPage.get(),
static_cast<sal_uInt16
>(nTab));
388 AddCalcUndo(std::make_unique<SdrUndoNewPage>(*pPage));
403 AddCalcUndo(std::make_unique<SdrUndoDelPage>(*pPage));
422 sal_uInt16 nMinPos = std::min(nOldPos, nNewPos);
436 if (pOldPage && pNewPage)
454 pNewObject->NbcMove(
Size(0,0));
464 AddCalcUndo( std::make_unique<SdrUndoInsertObj>( *pNewObject ) );
466 pOldObject = aIter.
Next();
480 if (nEnd >= nPageSize)
482 nEnd = nPageSize - 1;
484 for (
SCTAB i = nStart;
i <= nEnd; ++
i)
505 return rPos.
Col() >= nCol1 && rPos.
Col() <= nCol2 &&
506 rPos.
Row() >= nRow1 && rPos.
Row() <= nRow2;
510 SCCOL nDx,
SCROW nDy,
bool bUpdateNoteCaptionPos )
513 OSL_ENSURE(pPage,
"Page not found");
528 bool bChange =
false;
531 pData->maStart.IncCol( nDx );
532 pData->maStart.IncRow( nDy );
537 pData->maEnd.IncCol( nDx );
538 pData->maEnd.IncRow( nDy );
543 if (
dynamic_cast<const SdrRectObj*
>( pObj) !=
nullptr &&
pData->maStart.IsValid() &&
pData->maEnd.IsValid() )
548 if ( pNoRotatedAnchor )
552 if ( aOldSttNoRotatedAnchor.
IsValid() &&
IsInBlock( aOldSttNoRotatedAnchor, nCol1,nRow1, nCol2,nRow2 ) )
557 if ( aOldEndNoRotatedAnchor.
IsValid() &&
IsInBlock( aOldEndNoRotatedAnchor, nCol1,nRow1, nCol2,nRow2 ) )
564 AddCalcUndo( std::make_unique<ScUndoObjData>( pObj, aOldStt, aOldEnd,
pData->maStart,
pData->maEnd ) );
578 if ( rSize != pPage->
GetSize() )
610 switch (eObjectHandling)
628 switch (eObjectHandling)
660 Point aAvailableDiff(aWantedDiff);
663 if (aAvailableDiff.Y() > nHeight)
664 aAvailableDiff.setY( nHeight );
665 if (aAvailableDiff.X() > nWidth)
666 aAvailableDiff.setX( nWidth );
667 return aAvailableDiff;
682 if (std::abs(rRectA.
Left() - rRectB.
Left()) > 1)
684 if (std::abs(rRectA.
Top() - rRectB.
Top()) > 1)
686 if (std::abs(rRectA.
Right() - rRectB.
Right()) > 1)
693bool lcl_NeedsMirrorYCorrection(
const SdrObject* pObj)
711 const bool bNeedsMirrorYCorrection = lcl_NeedsMirrorYCorrection(pObj);
712 if (bNeedsMirrorYCorrection)
716 const Point aRight(aLeft.X() + 1000, aLeft.Y());
724 Point aStartPoint(aStartCellRect.Left(), aStartCellRect.Top());
731 Point aEndPoint(aEndCellRect.Left(), aEndCellRect.Top());
737 aNewRectangle.Normalize();
738 if (!lcl_AreRectanglesApproxEqual(pObj->
GetLogicRect(), aNewRectangle))
742 if (bNeedsMirrorYCorrection)
746 const Point aRight(aLeft.X() + 1000, aLeft.Y());
754 bool bNegativePage,
bool bCanResize)
787 aEnd += lcl_calcAvailableDiff(*
pDoc, nCol2, nRow2, nTab2, rData.
maEndOffset);
791 else if (!aLastCellRect.
IsEmpty())
804 if(nCurrentWidth + 1 == nLastWidth || nCurrentWidth == nLastWidth + 1)
806 nCurrentWidth = nLastWidth;
809 if(nCurrentHeight + 1 == nLastHeight || nCurrentHeight == nLastHeight + 1)
811 nCurrentHeight = nLastHeight;
815 double fWidthFactor(nCurrentWidth == nLastWidth || 0 == nLastWidth
817 :
static_cast<double>(nCurrentWidth) /
static_cast<double>(nLastWidth));
818 double fHeightFactor(nCurrentHeight == nLastHeight || 0 == nLastHeight
820 :
static_cast<double>(nCurrentHeight) /
static_cast<double>(nLastHeight));
823 const bool bIsGrowing(nCurrentWidth > nLastWidth || nCurrentHeight > nLastHeight);
824 const bool bIsShrinking(nCurrentWidth < nLastWidth || nCurrentHeight < nLastHeight);
825 const bool bIsSizeChanged(bIsGrowing || bIsShrinking);
834 assert(nWidth &&
"div-by-zero");
835 double fMaxWidthFactor =
static_cast<double>(nCurrentWidth)
836 /
static_cast<double>(nWidth);
838 assert(nHeight &&
"div-by-zero");
839 double fMaxHeightFactor =
static_cast<double>(nCurrentHeight)
840 /
static_cast<double>(nHeight);
841 double fMaxFactor = std::min(fMaxHeightFactor, fMaxWidthFactor);
846 fWidthFactor = std::max(fWidthFactor, fHeightFactor);
848 else if(bIsShrinking)
850 fWidthFactor = std::min(fWidthFactor, fHeightFactor);
854 fWidthFactor = fHeightFactor = std::min(fWidthFactor, fMaxFactor);
861 bool bNeedToScale(bIsGrowing);
863 if(!bNeedToScale && bIsShrinking)
867 const bool bFitsInX(aRect.
Right() <= aCurrentCellRect.
Left() + nCurrentWidth);
868 const bool bFitsInY(aRect.
Bottom() <= aCurrentCellRect.
Top() + nCurrentHeight);
871 bNeedToScale = (!bFitsInX || !bFitsInY);
883 aChange.
scale(fWidthFactor, fHeightFactor);
954 static_cast<SdrPathObj*
>(pObj)->GetPathPoly().getB2DPolygon(0));
985 lcl_SetLogicRectFromAnchor(pObj, rNoRotatedAnchor,
pDoc);
1025 OSL_ENSURE(
pDoc,
"ScDrawLayer::RecalcPos - missing document" );
1031 OSL_ENSURE( rData.
maStart.
IsValid(),
"ScDrawLayer::RecalcPos - invalid position for cell note" );
1038 if (bUpdateNoteCaptionPos && pObj->
IsVisible())
1045 pNote->UpdateCaptionPos( rData.
maStart );
1070 if ( bNegativePage )
1076 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1108 Point aStartPos = aPos;
1109 if ( bNegativePage )
1110 aStartPos.setX( -aStartPos.X() );
1111 if ( pObj->
GetPoint( 0 ) != aStartPos )
1114 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1123 if (aEndPos.Y() < 0)
1125 if ( bNegativePage )
1126 aEndPos.setX( -aEndPos.X() );
1127 if ( pObj->
GetPoint( 1 ) != aEndPos )
1130 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1146 Point aEndPos = aPos;
1147 if ( bNegativePage )
1148 aEndPos.setX( -aEndPos.X() );
1149 if ( pObj->
GetPoint( 1 ) != aEndPos )
1152 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1161 if (aStartPos.X() < 0)
1163 if (aStartPos.Y() < 0)
1165 if ( bNegativePage )
1166 aStartPos.setX( -aStartPos.X() );
1167 if ( pObj->
GetPoint( 0 ) != aStartPos )
1170 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1199 if (!lcl_AreRectanglesApproxEqual(aNew, aOld))
1202 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1207 if (pObj->
IsPolyObj() && nOldWidth && nOldHeight)
1213 double fXFrac =
static_cast<double>(aNew.
GetWidth()) /
static_cast<double>(nOldWidth);
1214 double fYFrac =
static_cast<double>(aNew.
GetHeight()) /
static_cast<double>(nOldHeight);
1235 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
1246 if (bEndAnchorIsBad)
1263 OSL_ENSURE(
pDoc,
"ScDrawLayer::GetPrintArea without document" );
1268 OSL_ENSURE( rRange.
aEnd.
Tab() == nTab,
"GetPrintArea: Tab differ" );
1285 for (
i=0;
i<nStartCol;
i++)
1289 for (
i=nStartCol;
i<=nEndCol;
i++)
1303 if ( bNegativePage )
1307 ::std::swap( nStartX, nEndX );
1311 OSL_ENSURE(pPage,
"Page not found");
1322 if ( !bSetHor && ( aObjRect.
Right() < nStartX || aObjRect.
Left() > nEndX ) )
1324 if ( !bSetVer && ( aObjRect.
Bottom() < nStartY || aObjRect.
Top() > nEndY ) )
1331 if (aObjRect.
Left() < nStartX) nStartX = aObjRect.
Left();
1332 if (aObjRect.
Right() > nEndX) nEndX = aObjRect.
Right();
1336 if (aObjRect.
Top() < nStartY) nStartY = aObjRect.
Top();
1337 if (aObjRect.
Bottom() > nEndY) nEndY = aObjRect.
Bottom();
1346 if ( bNegativePage )
1350 ::std::swap( nStartX, nEndX );
1355 OSL_ENSURE( nStartX<=nEndX && nStartY<=nEndY,
"Start/End wrong in ScDrawLayer::GetPrintArea" );
1365 if (nWidth <= nStartX)
1370 if (nWidth > nStartX)
1380 if (nWidth <= nEndX)
1402 (nRow>0 ? (nRow-1) : 0));
1441 std::unique_ptr<SdrUndoGroup> pRet = std::move(
pUndoGroup);
1448 SCCOL nDx,
SCROW nDy,
bool bInsDel,
bool bUpdateNoteCaptionPos )
1450 OSL_ENSURE(
pDoc,
"ScDrawLayer::MoveArea without document" );
1466 for (
SCCOL s=0; s<nDx; s++)
1469 for (
SCCOL s=-1; s>=nDx; s--)
1474 aMove.AdjustY( -sal_Int16(
pDoc->
GetRowHeight( nRow1+nDy, nRow1-1, nTab)) );
1476 if ( bNegativePage )
1477 aMove.setX( -aMove.X() );
1482 if ( aMove.X() != 0 && nDx < 0 )
1483 aTopLeft.AdjustX(aMove.X() );
1484 if ( aMove.Y() < 0 )
1485 aTopLeft.AdjustY(aMove.Y() );
1490 MoveCells( nTab, nCol1,nRow1, nCol2,nRow2, nDx,nDy, bUpdateNoteCaptionPos );
1495 OSL_ENSURE(
pDoc,
"ScDrawLayer::HasObjectsInRows without document" );
1500 OSL_ENSURE(pPage,
"Page not found");
1527 if ( bNegativePage )
1530 bool bFound =
false;
1537 aObjRect =
pObject->GetSnapRect();
1550 OSL_ENSURE(
pDoc,
"ScDrawLayer::DeleteObjectsInArea without document" );
1555 OSL_ENSURE(pPage,
"Page ?");
1572 std::vector<SdrObject*> ppObj;
1573 ppObj.reserve(nObjCount);
1587 aObjRect =
pObject->GetLogicRect();
1593 aObjRect =
pObject->GetCurrentBoundRect();
1612 for (
auto p : ppObj)
1615 for (
auto p : ppObj)
1621 OSL_ENSURE(
pDoc,
"ScDrawLayer::DeleteObjectsInSelection without document" );
1631 for (
const SCTAB nTab : rMark)
1633 if (nTab >= nTabCount)
1648 std::vector<SdrObject*> ppObj;
1649 ppObj.reserve(nObjCount);
1661 bool bObjectInMarkArea =
1665 bool bObjectAnchoredToMarkedCell
1670 if (bObjectInMarkArea || bObjectAnchoredToMarkedCell)
1682 for (
auto p : ppObj)
1685 for (
auto p : ppObj)
1713 bool bObjectInArea = rRange.
Contains(aObjRect);
1718 bObjectInArea = bObjectInArea || aClipRange.
Contains(pObjData->
maStart);
1736 pDestPage = pDestModel->
GetPage(
static_cast<sal_uInt16
>(nTab) );
1739 OSL_ENSURE( pDestPage,
"no page" );
1747 pNewObject->NbcMove(
Size(0,0));
1755 pOldObject = aIter.
Next();
1767 const ScRange & rRange = rRanges[
i ];
1768 if ( !rClipRange.
Contains( rRange ) )
1781 bool bChanged =
false;
1789 if ( rSourceRange.
Contains( rRange ) )
1794 if (!rRange.
Move( nDiffX, nDiffY, nDiffZ, aErrorRange, rDoc ))
1796 assert(!
"can't move range");
1809 OSL_ENSURE(
pDoc,
"ScDrawLayer::CopyFromClip without document" );
1818 OSL_FAIL(
"CopyFromClip, bDrawIsInUndo");
1822 bool bMirrorObj = ( rSourceRange.
Left() < 0 && rSourceRange.
Right() < 0 &&
1823 rDestRange.
Left() > 0 && rDestRange.
Right() > 0 ) ||
1824 ( rSourceRange.
Left() > 0 && rSourceRange.
Right() > 0 &&
1825 rDestRange.
Left() < 0 && rDestRange.
Right() < 0 );
1832 SdrPage* pSrcPage = pClipModel->
GetPage(
static_cast<sal_uInt16
>(nSourceTab));
1834 OSL_ENSURE( pSrcPage && pDestPage,
"draw page missing" );
1835 if ( !pSrcPage || !pDestPage )
1850 OUString aDestTabName;
1851 bool bRestoreDestTabName =
false;
1852 if( pOldObject && !bSameDoc && !bDestClip )
1854 if(
pDoc && pClipDoc )
1856 OUString aSourceTabName;
1857 if( pClipDoc->
GetName( nSourceTab, aSourceTabName )
1860 if( aSourceTabName != aDestTabName &&
1863 bRestoreDestTabName =
pDoc->
RenameTab( nDestTab, aSourceTabName );
1870 Size aMove( rDestRange.
Left() - aMirroredSource.
Left(), rDestRange.
Top() - aMirroredSource.
Top() );
1877 tools::Long nWidthDiff = nDestWidth - nSourceWidth;
1878 tools::Long nHeightDiff = nDestHeight - nSourceHeight;
1882 bool bResize =
false;
1885 if ( std::abs(nWidthDiff) > 1 && nDestWidth > 1 && nSourceWidth > 1 )
1887 aHorFract =
Fraction( nDestWidth, nSourceWidth );
1890 if ( std::abs(nHeightDiff) > 1 && nDestHeight > 1 && nSourceHeight > 1 )
1892 aVerFract =
Fraction( nDestHeight, nSourceHeight );
1902 SCTAB nClipTab = bRestoreDestTabName ? nDestTab : nSourceTab;
1905 bool bObjectInArea = rSourceRange.
Contains(aObjRect);
1908 bObjectInArea = bObjectInArea || aClipRange.
Contains(pObjData->
maStart);
1918 pNewObject->NbcMove( aMove );
1920 pNewObject->NbcResize( aRefPos, aHorFract, aVerFract );
1924 AddCalcUndo( std::make_unique<SdrUndoInsertObj>( *pNewObject ) );
1928 if ( pNewObject->GetObjIdentifier() == SdrObjKind::OLE2 )
1930 uno::Reference< embed::XEmbeddedObject > xIPObj =
static_cast<SdrOle2Obj*
>(pNewObject.get())->GetObjRef();
1931 uno::Reference< embed::XClassifiedObject > xClassified = xIPObj;
1933 if ( xClassified.is() )
1936 aObjectClassName =
SvGlobalName( xClassified->getClassID() );
1937 }
catch( uno::Exception& )
1946 if( xNewChart.is() && !xNewChart->hasInternalDataProvider() )
1948 OUString aChartName =
static_cast<SdrOle2Obj*
>(pNewObject.get())->GetPersistName();
1949 ::std::vector< ScRangeList > aRangesVector;
1951 if( !aRangesVector.empty() )
1953 bool bInSourceRange =
false;
1960 if ( ( bInSourceRange || bSameDoc ) && !bDestClip )
1962 if ( bInSourceRange )
1964 if ( rDestPos != aClipRange.
aStart )
1982 uno::Reference< chart::XChartDocument > xNewChartDoc( xNewChart, uno::UNO_QUERY );
1983 if( xOldChartDoc.is() && xNewChartDoc.is() )
1984 xNewChartDoc->attachData( xOldChartDoc->getData() );
1994 pOldObject = aIter.
Next();
1997 if( bRestoreDestTabName )
2003 OSL_ENSURE(
pDoc,
"ScDrawLayer::MirrorRTL - missing document" );
2011 bool bCanMirror = ( nIdent != SdrObjKind::Graphic && nIdent != SdrObjKind::OLE2 );
2029 if (!pNoRotatedAnchor)
2038 assert(pNoRotatedAnchor);
2041 Point aRef1( 0, 0 );
2042 Point aRef2( 0, 1 );
2044 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
2045 pObj->
Mirror( aRef1, aRef2 );
2051 const Point aMirroredLogicLT = aLogicLT +
Point(nInverseShift, 0);
2052 const Point aOffsetDiff = aMirroredLogicLT - aOldLogicRect.
TopLeft();
2059 Point aRef1( 0, 0 );
2060 Point aRef2( 0, 1 );
2062 AddCalcUndo( std::make_unique<SdrUndoGeoObj>( *pObj ) );
2063 pObj->
Mirror( aRef1, aRef2 );
2074 AddCalcUndo( std::make_unique<SdrUndoMoveObj>( *pObj, aMoveSize ) );
2075 pObj->
Move( aMoveSize );
2093 AddCalcUndo( std::make_unique<SdrUndoMoveObj>( *pObj, aMoveSize ) );
2094 pObj->
Move( aMoveSize );
2117 OSL_ENSURE( rDoc.
ValidColRowTab( rPos.
Col(), rPos.
Row(), rPos.
Tab() ),
"ScDrawLayer::GetCellRect - invalid cell address" );
2122 for(
SCCOL nCol = 0; nCol < rPos.
Col(); ++nCol )
2124 if( rPos.
Row() > 0 )
2137 Point aBotRight = aTopLeft;
2138 for(
SCCOL nCol = rPos.
Col(); nCol <= aEndPos.
Col(); ++nCol )
2163 if (
aName.isEmpty() )
2174 return ( pObj->
GetName() == rName ||
2182 for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++)
2185 OSL_ENSURE(pPage,
"Page ?");
2192 if (
nId == SdrObjKind::NONE ||
pObject->GetObjIdentifier() ==
nId )
2195 rFoundTab =
static_cast<SCTAB>(nTab);
2209 OUString aBase =
ScResId(STR_GRAPHICNAME) +
" ";
2212 OUString aGraphicName;
2218 aGraphicName = aBase + OUString::number(
nId );
2219 bThere = (
GetNamedObject( aGraphicName, SdrObjKind::NONE, nDummy ) != nullptr );
2225 return aGraphicName;
2233 for (sal_uInt16 nTab=0; nTab<nTabCount; nTab++)
2236 OSL_ENSURE(pPage,
"Page ?");
2249 if (
pObject->GetObjIdentifier() == SdrObjKind::Graphic &&
pObject->GetName().isEmpty())
2263 for( sal_uInt16 i = 0;
i <
nCount;
i++ )
2266 if( pData &&
pData->GetInventor() == SdrInventor::ScOrSwDraw &&
pData->GetId() == nId )
2272 void DeleteFirstUserDataOfType(
SdrObject *pObj, sal_uInt16 nId)
2275 for( sal_uInt16 i = nCount;
i > 0;
i-- )
2278 if( pData &&
pData->GetInventor() == SdrInventor::ScOrSwDraw &&
pData->GetId() == nId )
2305 bool bResizeWithCell )
2334 if (lcl_NeedsMirrorYCorrection(&rObj))
2338 const Point aRight(aLeft.X() + 1000, aLeft.Y());
2347 static_cast<SdrMeasureObj&
>(rObj).TakeUnrotatedSnapRect(aObjRect2);
2433 return GetFirstUserDataOfType(&rObj,
SC_UD_OBJDATA) !=
nullptr;
2470std::vector<SdrObject*>
2475 return std::vector<SdrObject*>();
2477 std::vector<SdrObject*> aObjects;
2491std::map<SCROW, std::vector<SdrObject*>>
2496 return std::map<SCROW, std::vector<SdrObject*>>();
2498 std::map<SCROW, std::vector<SdrObject*>> aRowObjects;
2501 ScRange aRange( nCol, nStartRow, nTab, nCol, nEndRow, nTab);
2544 return std::vector<SdrObject*>();
2546 std::vector<SdrObject*> aObjects;
2570 pObjData->
maStart = rNewPosition;
2573 const SCCOL nObjectColSpan = aOldEnd.
Col() - aOldStart.
Col();
2574 const SCROW nObjectRowSpan = aOldEnd.
Row() - aOldStart.
Row();
2576 aNewEnd.
IncRow(nObjectRowSpan);
2577 aNewEnd.
IncCol(nObjectColSpan);
2578 pObjData->
maEnd = aNewEnd;
2587 sal_uInt16 nFound = 0;
2588 for( sal_uInt16
i = 0;
i <
nCount;
i++ )
2594 if( pObj && bCreate )
2608 if( pObj && bCreate )
2622 if (
pData->maStart.IsValid() )
2623 pData->maStart.SetTab( nTab );
2624 if (
pData->maEnd.IsValid() )
2625 pData->maEnd.SetTab( nTab );
2671 css::uno::Reference< css::uno::XInterface > xRet;
constexpr auto convertTwipToMm100(N n)
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
void SetName(const OUString &rName)
LanguageType getLanguageType(bool bResolveSystem=true) const
static css::uno::Reference< css::linguistic2::XHyphenator > GetHyphenator()
static bool isKorean(LanguageType nLang)
SfxItemPool * GetEditTextObjectPool() const
void SetCalcFieldValueHdl(const Link< EditFieldInfo *, void > &rLink)
void IncCol(SCCOL nDelta=1)
void IncRow(SCROW nDelta=1)
static css::uno::Reference< css::chart2::XChartDocument > GetChartFromSdrObject(const SdrObject *pObject)
SC_DLLPUBLIC sal_uInt16 GetRowHeight(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC ScRange GetRange(SCTAB nTab, const tools::Rectangle &rMMRect, bool bHiddenAsZero=true) const
SC_DLLPUBLIC sal_uInt16 GetColWidth(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC tools::Long GetColOffset(SCCOL nCol, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC void InitDrawLayer(SfxObjectShell *pDocShell=nullptr)
SC_DLLPUBLIC bool ValidNewTabName(const OUString &rName) const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC bool RenameTab(SCTAB nTab, const OUString &rName, bool bExternalDocument=false)
SCROW GetRowForHeight(SCTAB nTab, tools::Long nHeight) const
Given the height i.e.
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC SCROW MaxRow() const
bool ValidColRowTab(SCCOL nCol, SCROW nRow, SCTAB nTab) const
SC_DLLPUBLIC void GetChartRanges(std::u16string_view rChartName, std::vector< ScRangeList > &rRanges, const ScDocument &rSheetNameDoc)
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
SC_DLLPUBLIC bool IsNegativePage(SCTAB nTab) const
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
SC_DLLPUBLIC bool RowHidden(SCROW nRow, SCTAB nTab, SCROW *pFirstRow=nullptr, SCROW *pLastRow=nullptr) const
SfxObjectShell * GetDocumentShell() const
void GetClipArea(SCCOL &nClipX, SCROW &nClipY, bool bIncludeFiltered)
SC_DLLPUBLIC bool ColHidden(SCCOL nCol, SCTAB nTab, SCCOL *pFirstCol=nullptr, SCCOL *pLastCol=nullptr) const
void SetChartRanges(std::u16string_view rChartName, const std::vector< ScRangeList > &rRanges)
bool IsUndoEnabled() const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC const SfxPoolItem * GetAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt16 nWhich) const
SC_DLLPUBLIC ScColumnsRange GetColumnsRange(SCTAB nTab, SCCOL nColBegin, SCCOL nColEnd) const
void SetChartListenerCollectionNeedsUpdate(bool bFlg)
void GetClipStart(SCCOL &nClipX, SCROW &nClipY)
SC_DLLPUBLIC tools::Rectangle GetMMRect(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bHiddenAsZero=true) const
SC_DLLPUBLIC tools::Long GetRowOffset(SCROW nRow, SCTAB nTab, bool bHiddenAsZero=true) const
bool IsImportingXML() const
SC_DLLPUBLIC SCTAB GetTableCount() const
static SfxObjectShell * pGlobalDrawPersist
void ScCopyPage(sal_uInt16 nOldPos, sal_uInt16 nNewPos)
static ScDrawObjData * GetObjDataTab(SdrObject *pObj, SCTAB nTab)
static tools::Rectangle GetCellRect(const ScDocument &rDoc, const ScAddress &rPos, bool bMergedCell)
Returns the rectangle for the passed cell address in 1/100 mm.
virtual css::uno::Reference< css::uno::XInterface > createUnoModel() override
void ResetTab(SCTAB nStart, SCTAB nEnd)
std::map< SCROW, std::vector< SdrObject * > > GetObjectsAnchoredToRange(SCTAB nTab, SCCOL nCol, SCROW nStartRow, SCROW nEndRow)
void MoveArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, bool bInsDel, bool bUpdateNoteCaptionPos)
void ScRenamePage(SCTAB nTab, const OUString &rNewName)
static ScDrawObjData * GetObjData(SdrObject *pObj, bool bCreate=false)
static OUString GetVisibleName(const SdrObject *pObj)
static void GetCellAnchorFromPosition(const tools::Rectangle &rRectangle, ScDrawObjData &rAnchor, const ScDocument &rDoc, SCTAB nTab, bool bHiddenAsZero=true)
static void SetNonRotatedAnchor(SdrObject &, const ScDrawObjData &rAnchor)
static bool IsNoteCaption(SdrObject *pObj)
Returns true, if the passed object is the caption of a cell note.
void CopyFromClip(ScDrawLayer *pClipModel, SCTAB nSourceTab, const tools::Rectangle &rSourceRange, const ScAddress &rDestPos, const tools::Rectangle &rDestRange)
ScDocument * GetDocument() const
void SetPageSize(sal_uInt16 nPageNo, const Size &rSize, bool bUpdateNoteCaptionPos, const ScObjectHandling eObjectHandling=ScObjectHandling::RecalcPosMode)
static ScMacroInfo * GetMacroInfo(SdrObject *pObj, bool bCreate=false)
void EnsureGraphicNames()
static void SetCellAnchoredFromPosition(SdrObject &rObj, const ScDocument &rDoc, SCTAB nTab, bool bResizeWithCell)
std::vector< SdrObject * > GetObjectsAnchoredToCols(SCTAB nTab, SCCOL nStartCol, SCCOL nEndCol)
std::unique_ptr< SdrUndoGroup > pUndoGroup
void RecalcPos(SdrObject *pObj, ScDrawObjData &rData, bool bNegativePage, bool bUpdateNoteCaptionPos)
void DeleteObjectsInArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool bAnchored=false)
virtual ~ScDrawLayer() override
bool HasObjectsAnchoredInRange(const ScRange &rRange)
static void SetPageAnchored(SdrObject &)
bool ScAddPage(SCTAB nTab)
void BeginCalcUndo(bool bDisableTextEditUsesCommonUndoManager)
std::unique_ptr< SdrUndoGroup > GetCalcUndo()
void ScMovePage(sal_uInt16 nOldPos, sal_uInt16 nNewPos)
void DeleteObjectsInSelection(const ScMarkData &rMark)
static ScAnchorType GetAnchorType(const SdrObject &)
static ScDrawObjData * GetNonRotatedObjData(SdrObject *pObj, bool bCreate=false)
static bool IsResizeWithCell(const SdrObject &rObj)
static ScDrawObjData * GetNoteCaptionData(SdrObject *pObj, SCTAB nTab)
Returns the object data, if the passed object is a cell note caption.
bool HasObjectsInRows(SCTAB nTab, SCROW nStartRow, SCROW nEndRow)
void MirrorRTL(SdrObject *pObj)
void ScRemovePage(SCTAB nTab)
bool GetPrintArea(ScRange &rRange, bool bSetHor, bool bSetVer) const
void MoveObject(SdrObject *pObj, const ScAddress &rNewPosition)
void AddCalcUndo(std::unique_ptr< SdrUndoAction > pUndo)
ScDrawLayer(ScDocument *pDocument, OUString aName)
virtual rtl::Reference< SdrPage > AllocPage(bool bMasterPage) override
static void SetCellAnchored(SdrObject &, const ScDrawObjData &rAnchor)
void CopyToClip(ScDocument *pClipDoc, SCTAB nTab, const tools::Rectangle &rRange)
void MoveCells(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCCOL nDx, SCROW nDy, bool bUpdateNoteCaptionPos)
void MoveRTL(SdrObject *pObj)
static void MirrorRectRTL(tools::Rectangle &rRect)
void InitializeCellAnchoredObj(SdrObject *pObj, ScDrawObjData &rData)
std::vector< SdrObject * > GetObjectsAnchoredToRows(SCTAB nTab, SCROW nStartRow, SCROW nEndRow)
void ResizeLastRectFromAnchor(const SdrObject *pObj, ScDrawObjData &rData, bool bNegativePage, bool bCanResize)
static void UpdateCellAnchorFromPositionEnd(const SdrObject &rObj, ScDrawObjData &rAnchor, const ScDocument &rDoc, SCTAB nTab, bool bUseLogicRect=true)
static void SetGlobalDrawPersist(SfxObjectShell *pPersist)
virtual void SetChanged(bool bFlg=true) override
static bool IsCellAnchored(const SdrObject &rObj)
OUString GetNewGraphicName(tools::Long *pnCounter=nullptr) const
virtual SdrModel * AllocModel() const override
SdrObject * GetNamedObject(std::u16string_view rName, SdrObjKind nId, SCTAB &rFoundTab) const
const tools::Rectangle & getShapeRect() const
const tools::Rectangle & getLastCellRect() const
void setShapeRect(const ScDocument *rDoc, tools::Rectangle rNewRect, bool bIsVisible=true)
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
bool IsAllMarked(const ScRange &rRange) const
const ScRange & GetMultiMarkArea() const
bool IsMultiMarked() const
bool IsCellMarked(SCCOL nCol, SCROW nRow, bool bNoSimple=false) const
SCCOL GetColMerge() const
SCROW GetRowMerge() const
Additional class containing cell annotation data.
bool Move(SCCOL aDeltaX, SCROW aDeltaY, SCTAB aDeltaZ, ScRange &rErrorRange, const ScDocument &rDoc)
bool Contains(const ScAddress &) const
is Address& fully in Range?
ScTabDeletedHint(SCTAB nTabNo)
virtual ~ScTabDeletedHint() override
virtual ~ScTabSizeChangedHint() override
ScTabSizeChangedHint(SCTAB nTabNo)
virtual void Redo() override
virtual ~ScUndoAnchorData() override
virtual void Undo() override
ScUndoAnchorData(SdrObject *pObj, ScDocument *pDoc, SCTAB nTab)
virtual ~ScUndoObjData() override
virtual void Redo() override
virtual void Undo() override
ScUndoObjData(SdrObject *pObj, const ScAddress &rOS, const ScAddress &rOE, const ScAddress &rNS, const ScAddress &rNE)
const OUString & GetControlLayerName() const
SdrLayer * NewLayer(const OUString &rName, sal_uInt16 nPos=0xFFFF)
virtual void TakeUnrotatedSnapRect(tools::Rectangle &rRect) const override
virtual void SetChanged(bool bFlg=true)
void SetVOCInvalidationIsReliable(bool b)
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
void ClearModel(bool bCalledFromDestructor)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
const SfxItemPool & GetItemPool() const
void SetScaleUnit(MapUnit eMap)
void EnableUndo(bool bEnable)
rtl::Reference< SfxItemPool > m_pItemPool
void SetDisableTextEditUsesCommonUndoManager(bool bNew)
virtual void DeletePage(sal_uInt16 nPgNum)
void SetPropertyList(XPropertyListRef const &p)
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const SdrLayerAdmin & GetLayerAdmin() const
sal_uInt16 GetPageCount() const
SdrOutliner & GetHitTestOutliner() const
virtual void InsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
bool IsResizeProtect() const
virtual void NbcSetLogicRect(const tools::Rectangle &rRect)
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact)
void AppendUserData(std::unique_ptr< SdrObjUserData > pData)
virtual Point GetPoint(sal_uInt32 i) const
void BroadcastObjectChange() const
sal_uInt16 GetUserDataCount() const
void SetVisible(bool bVisible)
virtual void Mirror(const Point &rRef1, const Point &rRef2)
virtual bool IsPolyObj() const
virtual void Move(const Size &rSiz)
virtual const tools::Rectangle & GetCurrentBoundRect() const
virtual void NbcMirror(const Point &rRef1, const Point &rRef2)
SdrModel & getSdrModelFromSdrObject() const
virtual const tools::Rectangle & GetSnapRect() const
virtual void SetLogicRect(const tools::Rectangle &rRect)
virtual const OUString & GetName() const
SdrObjUserData * GetUserData(sal_uInt16 nNum) const
virtual void AdjustToMaxRect(const tools::Rectangle &rMaxRect, bool bShrinkOnly=false)
void SetPoint(const Point &rPnt, sal_uInt32 i)
virtual SdrObjKind GetObjIdentifier() const
virtual void SetSnapRect(const tools::Rectangle &rRect)
virtual SdrLayerID GetLayer() const
void DeleteUserData(sal_uInt16 nNum)
virtual rtl::Reference< SdrObject > CloneSdrObject(SdrModel &rTargetModel) const
virtual void SetRelativePos(const Point &rPnt)
virtual bool shouldKeepAspectRatio() const
virtual void NbcMove(const Size &rSiz)
virtual Point GetRelativePos() const
virtual void TakeObjInfo(SdrObjTransformInfoRec &rInfo) const
virtual const tools::Rectangle & GetLogicRect() const
const OUString & GetPersistName() const
virtual void SetSize(const Size &aSiz)
rtl::Reference< SdrObject > mxObj
SfxItemPool * GetSecondaryPool() const
void SetPoolDefaultItem(const SfxPoolItem &)
void SetDefaultMetric(MapUnit eNewMetric)
css::uno::Reference< css::frame::XModel3 > GetModel() const
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
static sal_uInt16 IsChart(const SvGlobalName &rName)
const XColorListRef & GetColorList() const
static XColorListRef GetStdColorList()
void translate(double fX, double fY)
void scale(double fX, double fY)
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint &rValue)
basegfx::B2DPoint const & getB2DPoint(sal_uInt32 nIndex) const
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
static E3dObjFactory * pF3d
static bool lcl_IsAllInRange(const ::std::vector< ScRangeList > &rRangesVector, const ScRange &rClipRange)
static bool lcl_MoveRanges(::std::vector< ScRangeList > &rRangesVector, const ScRange &rSourceRange, const ScAddress &rDestPos, const ScDocument &rDoc)
static ScRange lcl_getClipRangeFromClipDoc(ScDocument *pClipDoc, SCTAB nClipTab)
static bool IsNamedObject(const SdrObject *pObj, std::u16string_view rName)
static bool IsInBlock(const ScAddress &rPos, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
static void lcl_ReverseTwipsToMM(tools::Rectangle &rRect)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr TypedWhichId< SvxScriptSpaceItem > EE_PARA_ASIANCJKSPACING(EE_PARA_START+4)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
EmbeddedObjectRef * pObject
constexpr SdrLayerID SC_LAYER_HIDDEN(4)
constexpr SdrLayerID SC_LAYER_FRONT(0)
constexpr SdrLayerID SC_LAYER_INTERN(2)
constexpr SdrLayerID SC_LAYER_BACK(1)
constexpr SdrLayerID SC_LAYER_CONTROLS(3)
tools::Long FRound(double fVal)
#define LANGUAGE_JAPANESE
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
B2DRange getRange(const B2DPolygon &rCandidate)
B2IRange fround(const B2DRange &rRange)
constexpr auto toTwips(N number, Length from)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
OUString ScResId(TranslateId aId)
constexpr TypedWhichId< ScMergeAttr > ATTR_MERGE(144)
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
UNDERLYING_TYPE get() const