24 #include <rtl/ustrbuf.hxx>
25 #include <com/sun/star/lang/XComponent.hpp>
26 #include <com/sun/star/document/XStorageBasedDocument.hpp>
27 #include <com/sun/star/embed/ElementModes.hpp>
39 #include <editeng/editeng.hxx>
52 #include <svx/strings.hrc>
55 #include <officecfg/Office/Common.hxx>
70 #include <libxml/xmlwriter.h>
93 bool bDisablePropertyFiles)
96 mpImpl->mpUndoManager=
nullptr;
97 mpImpl->mpUndoFactory=
nullptr;
98 mpImpl->mbAnchoredTextOverflowLegacy =
false;
146 if ( pPool ==
nullptr )
195 bool bDisablePropertyFiles)
199 maAllIncarnatedObjects(),
204 ImpCtor(pPool,pPers,bDisablePropertyFiles);
229 SAL_WARN(
"svx",
"SdrModel::~SdrModel: Not all incarnations of SdrObjects deleted, possible memory leak (!)");
232 for(
auto pSdrObject : maRemainingObjects)
234 SdrObject* pCandidate(const_cast<SdrObject*>(pSdrObject));
253 Reference< XComponent > xComponent( static_cast< cppu::OWeakObject* >(
mxStyleSheetPool.get() ), UNO_QUERY );
254 if( xComponent.is() )
try
256 xComponent->dispose();
276 delete mpImpl->mpUndoFactory;
297 if (nCount<1) nCount=1;
324 if(
mpImpl->mpUndoManager )
326 OSL_FAIL(
"svx::SdrModel::Undo(), method not supported with application undo manager!");
337 m_pRedoStack.reset(
new std::deque<std::unique_ptr<SfxUndoAction>>);
338 std::unique_ptr<SfxUndoAction>
p = std::move(
m_pUndoStack->front());
348 if(
mpImpl->mpUndoManager )
350 OSL_FAIL(
"svx::SdrModel::Redo(), method not supported with application undo manager!");
361 m_pUndoStack.reset(
new std::deque<std::unique_ptr<SfxUndoAction>>);
362 std::unique_ptr<SfxUndoAction>
p = std::move(
m_pRedoStack->front());
372 if(
mpImpl->mpUndoManager )
374 OSL_FAIL(
"svx::SdrModel::Redo(), method not supported with application undo manager!");
391 DBG_ASSERT(
mpImpl->mpUndoManager ==
nullptr,
"svx::SdrModel::ImpPostUndoAction(), method not supported with application undo manager!" );
402 m_pUndoStack.reset(
new std::deque<std::unique_ptr<SfxUndoAction>>);
415 if(
mpImpl->mpUndoManager )
419 nViewShellId = pViewShell->GetViewShellId();
420 mpImpl->mpUndoManager->EnterListAction(
"",
"",0,nViewShellId);
439 if(
mpImpl->mpUndoManager )
443 nViewShellId = pViewShell->GetViewShellId();
444 mpImpl->mpUndoManager->EnterListAction( rComment,
"", 0, nViewShellId );
459 if(
mpImpl->mpUndoManager )
461 OUString aComment(rComment);
462 if( !aComment.isEmpty() && !rObjDescr.isEmpty() )
464 aComment = aComment.replaceFirst(
"%1", rObjDescr);
468 nViewShellId = pViewShell->GetViewShellId();
469 mpImpl->mpUndoManager->EnterListAction( aComment,
"",0,nViewShellId );
487 if(
mpImpl->mpUndoManager )
492 mpImpl->mpUndoManager->LeaveListAction();
520 if(
mpImpl->mpUndoManager )
522 OSL_FAIL(
"svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
533 if(
mpImpl->mpUndoManager )
535 OSL_FAIL(
"svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
549 if(
mpImpl->mpUndoManager )
551 mpImpl->mpUndoManager->AddUndoAction( std::move(pUndo) );
568 if(
mpImpl->mpUndoManager )
570 mpImpl->mpUndoManager->EnableUndo( bEnable );
580 if(
mpImpl->mpUndoManager )
582 return mpImpl->mpUndoManager->IsUndoEnabled();
593 const OUString aTablePath(!bDisablePropertyFiles ?
SvtPathOptions().GetPalettePath() :
"");
603 if(bCalledFromDestructor)
611 for (i=nCount-1; i>=0; i--)
620 for(i=nCount-1; i>=0; i--)
639 return new SdrPage(*
this,bMasterPage);
754 for (nNum=0; nNum<nCount; nNum++) {
758 for (nNum=0; nNum<nCount; nNum++) {
774 for (nNum=0; nNum<nCount; nNum++)
779 for (nNum=0; nNum<nCount; nNum++)
787 uno::Reference<document::XStorageBasedDocument>
const xSBD(
788 const_cast<SdrModel*>(
this)->
getUnoModel(), uno::UNO_QUERY);
794 return xSBD->getDocumentStorage();
797 uno::Reference<io::XInputStream>
808 uno::Reference<io::XStream>
const xStream(
810 xStorage, rURL, embed::ElementModes::READ, rProxy));
811 return (xStream.is()) ? xStream->getInputStream() :
nullptr;
813 catch (container::NoSuchElementException
const&)
817 catch (uno::Exception
const&)
829 for (nNum=0; nNum<nCount; nNum++) {
833 for (nNum=0; nNum<nCount; nNum++) {
877 case FieldUnit::CHAR:
878 case FieldUnit::LINE:
881 case FieldUnit::PERCENT:
888 sal_Int32 nMul = 1, nDiv = 1;
904 while(0 == (nMul % 10))
911 while(0 == (nDiv % 10))
991 case FieldUnit::NONE :
992 case FieldUnit::CUSTOM :
994 case FieldUnit::MM_100TH:
995 return OUString{
"/100mm"};
997 return OUString{
"mm"};
999 return OUString{
"cm"};
1001 return OUString{
"m"};
1002 case FieldUnit::KM :
1003 return OUString{
"km"};
1004 case FieldUnit::TWIP :
1005 return OUString{
"twip"};
1006 case FieldUnit::POINT :
1007 return OUString{
"pt"};
1008 case FieldUnit::PICA :
1009 return OUString{
"pica"};
1010 case FieldUnit::INCH :
1011 return OUString{
"\""};
1012 case FieldUnit::FOOT :
1013 return OUString{
"ft"};
1014 case FieldUnit::MILE :
1015 return OUString{
"mile(s)"};
1016 case FieldUnit::PERCENT:
1017 return OUString{
"%"};
1025 const bool bNegative(nVal < 0);
1032 fLocalValue = -fLocalValue;
1035 if( -1 == nNumDigits )
1042 if(nDecimalMark > nNumDigits)
1044 const sal_Int32 nDiff(nDecimalMark - nNumDigits);
1045 const double fFactor(pow(10.0, static_cast<int>(nDiff)));
1047 fLocalValue /= fFactor;
1048 nDecimalMark = nNumDigits;
1050 else if(nDecimalMark < nNumDigits)
1052 const sal_Int32 nDiff(nNumDigits - nDecimalMark);
1053 const double fFactor(pow(10.0, static_cast<int>(nDiff)));
1055 fLocalValue *= fFactor;
1056 nDecimalMark = nNumDigits;
1059 OUStringBuffer
aBuf;
1060 aBuf.append(static_cast<sal_Int32>(fLocalValue + 0.5));
1062 if(nDecimalMark < 0)
1065 sal_Int32
nCount(-nDecimalMark);
1067 for(sal_Int32
i=0;
i<nCount;
i++)
1075 if (nDecimalMark > 0 && aBuf.getLength() <= nDecimalMark)
1078 sal_Int32
nCount = nDecimalMark - aBuf.getLength();
1083 for(sal_Int32
i=0;
i<nCount;
i++)
1084 aBuf.insert(0,
'0');
1087 const sal_Unicode cDec( rLoc.getNumDecimalSep()[0] );
1090 sal_Int32 nBeforeDecimalMark = aBuf.getLength() - nDecimalMark;
1092 if(nDecimalMark > 0)
1093 aBuf.insert(nBeforeDecimalMark, cDec);
1097 sal_Int32 aPos=aBuf.getLength()-1;
1100 while (aPos>=0 && aBuf[aPos]==
'0')
1104 if (aPos>=0 && aBuf[aPos]==cDec)
1108 if (++aPos<aBuf.getLength())
1109 aBuf.truncate(aPos);
1113 if( nBeforeDecimalMark > 3 )
1115 const OUString& aThoSep( rLoc.getNumThousandSep() );
1116 if ( !aThoSep.isEmpty() )
1119 sal_Int32
i(nBeforeDecimalMark - 3);
1123 aBuf.insert(i, cTho);
1134 aBuf.insert(0,
"-");
1140 return aBuf.makeStringAndClear();
1145 bool bNeg = nAngle < 0_deg100;
1150 OUStringBuffer
aBuf;
1151 aBuf.append(static_cast<sal_Int32>(nAngle));
1160 while(aBuf.getLength() < nCount)
1161 aBuf.insert(0,
'0');
1166 aBuf.insert(0,
'-');
1170 return aBuf.makeStringAndClear();
1191 sal_Int32 nPct = ((nMul*100) + nDiv/2)/nDiv;
1196 return OUString::number(nPct) +
"%";
1210 for (i=0; i<nCount; i++) {
1220 for (i=0; i<nCount; i++) {
1231 if (nPos>nCount) nPos=nCount;
1283 if (nPos>nCount) nPos=nCount;
1315 for(sal_uInt16 np(0); np < nPageCnt; np++)
1348 sal_uInt16 nDestPos,
1349 bool bUndo,
bool bMoveNoCopy)
1358 sal_uInt16 nMaxPage=nPageCnt;
1362 if (nFirstPageNum>nMaxPage)
1363 nFirstPageNum=nMaxPage;
1364 if (nLastPageNum>nMaxPage)
1365 nLastPageNum =nMaxPage;
1366 bool bReverse=nLastPageNum<nFirstPageNum;
1367 if (nDestPos>nPageCnt)
1371 sal_uInt16 nPageNum=nFirstPageNum;
1372 sal_uInt16 nCopyCnt=((!bReverse)?(nLastPageNum-nFirstPageNum):(nFirstPageNum-nLastPageNum))+1;
1373 std::unique_ptr<SdrPage*[]> pPagePtrs(
new SdrPage*[nCopyCnt]);
1374 sal_uInt16 nCopyNum;
1375 for(nCopyNum=0; nCopyNum<nCopyCnt; nCopyNum++)
1377 pPagePtrs[nCopyNum]=
GetPage(nPageNum);
1385 sal_uInt16 nDestNum=nDestPos;
1386 for (nCopyNum=0; nCopyNum<nCopyCnt; nCopyNum++)
1388 SdrPage* pPg=pPagePtrs[nCopyNum];
1405 if (nDestNum>nPageNum2)
1428 sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
1429 sal_uInt16 nDestPos,
1430 bool bMergeMasterPages,
bool bAllMasterPages,
1431 bool bUndo,
bool bTreadSourceAsConst)
1433 if (&rSourceModel==
this)
1435 CopyPages(nFirstPageNum,nLastPageNum,nDestPos,bUndo,!bTreadSourceAsConst);
1448 bool bInsPages=(nFirstPageNum<nSrcPageCnt || nLastPageNum<nSrcPageCnt);
1449 sal_uInt16 nMaxSrcPage=nSrcPageCnt;
if (nMaxSrcPage!=0) nMaxSrcPage--;
1450 if (nFirstPageNum>nMaxSrcPage) nFirstPageNum=nMaxSrcPage;
1451 if (nLastPageNum>nMaxSrcPage) nLastPageNum =nMaxSrcPage;
1452 bool bReverse=nLastPageNum<nFirstPageNum;
1454 std::unique_ptr<sal_uInt16[]> pMasterMap;
1455 std::unique_ptr<bool[]> pMasterNeed;
1456 sal_uInt16 nMasterNeed=0;
1457 if (bMergeMasterPages && nSrcMasterPageCnt!=0) {
1459 pMasterMap.reset(
new sal_uInt16[nSrcMasterPageCnt]);
1460 pMasterNeed.reset(
new bool[nSrcMasterPageCnt]);
1461 memset(pMasterMap.get(),0xFF,nSrcMasterPageCnt*
sizeof(sal_uInt16));
1462 if (bAllMasterPages) {
1463 memset(pMasterNeed.get(),
true, nSrcMasterPageCnt *
sizeof(bool));
1465 memset(pMasterNeed.get(),
false, nSrcMasterPageCnt *
sizeof(bool));
1466 sal_uInt16 nStart= bReverse ? nLastPageNum : nFirstPageNum;
1467 sal_uInt16 nEnd= bReverse ? nFirstPageNum : nLastPageNum;
1468 for (sal_uInt16
i=nStart;
i<=nEnd;
i++) {
1473 sal_uInt16 nMPgNum(rMasterPage.
GetPageNum());
1475 if(nMPgNum < nSrcMasterPageCnt)
1477 pMasterNeed[nMPgNum] =
true;
1483 sal_uInt16 nCurrentMaPagNum=nDstMasterPageCnt;
1484 for (sal_uInt16
i=0;
i<nSrcMasterPageCnt;
i++) {
1485 if (pMasterNeed[
i]) {
1486 pMasterMap[i]=nCurrentMaPagNum;
1494 if (pMasterMap && pMasterNeed && nMasterNeed!=0) {
1495 for (sal_uInt16
i=nSrcMasterPageCnt;
i>0;) {
1501 SdrPage* pPg(pPg1->CloneSdrPage(*
this));
1503 if(!bTreadSourceAsConst)
1519 OSL_FAIL(
"SdrModel::Merge(): MasterPage not found in SourceModel.");
1527 sal_uInt16 nSourcePos=nFirstPageNum;
1528 sal_uInt16 nMergeCount=sal_uInt16(std::abs(static_cast<tools::Long>(static_cast<tools::Long>(nFirstPageNum)-nLastPageNum))+1);
1530 while (nMergeCount>0)
1534 SdrPage* pPg(pPg1->CloneSdrPage(*
this));
1536 if(!bTreadSourceAsConst)
1546 if(pPg->TRG_HasMasterPage())
1549 sal_uInt16 nMaPgNum(rMasterPage.
GetPageNum());
1551 if (bMergeMasterPages)
1553 sal_uInt16 nNewNum(0xFFFF);
1557 nNewNum = pMasterMap[nMaPgNum];
1560 if(nNewNum != 0xFFFF)
1568 pPg->TRG_ClearMasterPage();
1577 DBG_ASSERT(nNewNum!=0xFFFF,
"SdrModel::Merge(): Something is crooked with the mapping of the MasterPages.");
1579 if (nMaPgNum>=nDstMasterPageCnt) {
1581 pPg->TRG_ClearMasterPage();
1587 OSL_FAIL(
"SdrModel::Merge(): Drawing page not found in SourceModel.");
1590 if (bReverse) nSourcePos--;
1591 else if (bTreadSourceAsConst) nSourcePos++;
1597 pMasterNeed.reset();
1613 SAL_WARN(
"svx",
"SdrModel::SetStarDrawPreviewMode(): Resetting not allowed, because Model might not be complete.");
1648 OSL_FAIL(
"SdrModel::createUnoModel() - base implementation should not be called!" );
1649 css::uno::Reference< css::uno::XInterface > xInt;
1670 assert(pNewModelel !=
nullptr);
1671 if( !(pSourceSet && pDestSet && (pSourceSet != pDestSet )) )
1680 if(SfxItemState::SET == pSourceSet->
GetItemState(nWhich,
false, &pPoolItem))
1682 std::unique_ptr<SfxPoolItem> pResultItem;
1687 pResultItem =
static_cast<const XFillBitmapItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1690 pResultItem =
static_cast<const XLineDashItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1693 pResultItem =
static_cast<const XLineStartItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1696 pResultItem =
static_cast<const XLineEndItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1699 pResultItem =
static_cast<const XFillGradientItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1706 pResultItem =
static_cast<const XFillHatchItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1713 pDestSet->
Put(*pResultItem);
1714 pResultItem.reset();
1717 pDestSet->
Put(*pPoolItem);
1765 mpImpl->mbAnchoredTextOverflowLegacy = bEnabled;
1770 return mpImpl->mbAnchoredTextOverflowLegacy;
1808 if (pValue->Name ==
"AnchoredTextOverflowLegacy")
1811 if (pValue->Value >>= bBool)
1813 mpImpl->mbAnchoredTextOverflowLegacy = bBool;
1818 template <
typename T>
1819 static void addPair(std::vector< std::pair< OUString, Any > >& aUserData,
const OUString& name,
const T val)
1821 aUserData.push_back(std::pair< OUString, Any >(name, css::uno::makeAny(val)));
1826 std::vector< std::pair< OUString, Any > > aUserData;
1829 const sal_Int32 nOldLength = rValues.getLength();
1830 rValues.realloc(nOldLength + aUserData.size());
1832 css::beans::PropertyValue* pValue = &(rValues.getArray()[nOldLength]);
1834 for (
const auto &aIter : aUserData)
1836 pValue->Name = aIter.first;
1837 pValue->Value = aIter.second;
1844 DBG_ASSERT(nPgNum <
maPages.size(),
"SdrModel::GetPage: Access out of range (!)");
1850 DBG_ASSERT(nPgNum <
maPages.size(),
"SdrModel::GetPage: Access out of range (!)");
1856 return sal_uInt16(
maPages.size());
1870 DBG_ASSERT(nPgNum <
maMaPag.size(),
"SdrModel::GetMasterPage: Access out of range (!)");
1876 DBG_ASSERT(nPgNum <
maMaPag.size(),
"SdrModel::GetMasterPage: Access out of range (!)");
1882 return sal_uInt16(
maMaPag.size());
1891 mpImpl->mpUndoManager = pUndoManager;
1896 return mpImpl->mpUndoManager;
1901 if( !
mpImpl->mpUndoFactory )
1903 return *
mpImpl->mpUndoFactory;
1908 if( pUndoFactory && (pUndoFactory !=
mpImpl->mpUndoFactory) )
1910 delete mpImpl->mpUndoFactory;
1911 mpImpl->mpUndoFactory = pUndoFactory;
1917 xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrModel"));
1918 xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
1921 for (sal_uInt16
i = 0;
i < nPageCount; ++
i)
1924 pPage->dumpAsXml(pWriter);
1927 xmlTextWriterEndElement(pWriter);
1932 class theSdrModelUnoTunnelImplementationId :
public rtl::Static< UnoTunnelIdInit, theSdrModelUnoTunnelImplementationId > {};
1937 return theSdrModelUnoTunnelImplementationId::get().getSeq();
1953 mpPage(rNewObj.getSdrPageFromSdrObject())
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
SdrPage & TRG_GetMasterPage() const
void SetCharSet(rtl_TextEncoding _eEncoding)
bool IsAnchoredTextOverflowLegacy() const
void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
std::unique_ptr< SdrOutliner > m_pHitTestOutliner
TextChain * GetTextChain() const
SdrOutliner & GetChainingOutliner(const SdrTextObj *pObj) const
void SetStyleName(const OUString &rStyleName)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
SVX_DLLPRIVATE void ImpSetUIUnit()
const OUString & GetFamilyName() const
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
struct _xmlTextWriter * xmlTextWriterPtr
#define LANGUAGE_ENGLISH_US
bool IsKernAsianPunctuation() const
static void addPair(std::vector< std::pair< OUString, Any > > &aUserData, const OUString &name, const T val)
virtual void InsertMasterPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
void SetPitch(FontPitch _ePitch)
LanguageType getLanguageType(bool bResolveSystem=true) const
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
static OUString GetAngleString(Degree100 nAngle)
virtual css::uno::Reference< css::uno::XInterface > createUnoModel()
std::unique_ptr< std::deque< std::unique_ptr< SfxUndoAction > > > m_pUndoStack
std::unique_ptr< SdrUndoGroup > m_pCurrentUndoGroup
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
static const AllSettings & GetSettings()
virtual void adaptSizeAndBorderForAllPages(const Size &rNewSize, tools::Long nLeft=0, tools::Long nRight=0, tools::Long nUpper=0, tools::Long nLower=0)
std::vector< SdrPage * > maMaPag
rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool
void RecalcPageNums(bool bMaster)
std::unique_ptr< SdrOutlinerCache > mpOutlinerCache
void SetFamily(FontFamily _eFamily)
void MakePageObjectsNamesUnique()
constexpr o3tl::Length FieldToO3tlLength(FieldUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
static sal_uInt16 getNumDigits()
static bool isNumLeadingZero()
SdrOnOffItem makeSdrTextWordWrapItem(bool bAuto)
void SetCharCompressType(CharCompressType nType)
SfxStyleSheet * mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
css::uno::Reference< css::uno::XInterface > const & getUnoModel()
SVX_DLLPRIVATE void ImpCtor(SfxItemPool *pPool,::comphelper::IEmbeddedHelper *pPers, bool bDisablePropertyFiles)
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
static void Free(SdrObject *&_rpObject)
void SetSdrUndoManager(SfxUndoManager *pUndoManager)
application can set its own undo manager, BegUndo, EndUndo and AddUndoAction calls are routed to this...
void SetRefMapMode(const MapMode &)
void BurnInStyleSheetAttributes()
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
virtual void MasterPageListChanged()
bool mbMakePageObjectsNamesUnique
OutputDevice * GetRefDevice() const
FontFamily GetFamilyType()
void SetFamilyName(const OUString &rFamilyName)
void SetDefaultTabulator(sal_uInt16 nVal)
const LocaleDataWrapper & GetLocaleData() const
std::unique_ptr< SdrOutliner > m_pDrawOutliner
VclPtr< OutputDevice > m_pRefOutDev
void EnableUndo(bool bEnable)
enables (true) or disables (false) recording of undo actions If undo actions are added while undo is ...
void ReformatAllTextObjects()
OUString SvxResId(const char *pId)
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
bool m_bTransportContainer
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
void CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, sal_uInt16 nDestPos, bool bUndo, bool bMoveNoCopy)
css::uno::Reference< css::uno::XInterface > mxUnoModel
static SfxViewShell * Current()
std::function< void(std::unique_ptr< SdrUndoAction >)> m_aUndoLink
void SetKernAsianPunctuation(bool bEnabled)
SdrModel(const SdrModel &rSrcModel)=delete
void ReformatAllTextObjects()
std::unique_ptr< SdrOutliner > createOutliner(OutlinerMode nOutlinerMode)
sal_uInt32 m_nMaxUndoCount
SfxUndoManager * mpUndoManager
SVX_DLLPRIVATE void ImpPostUndoAction(std::unique_ptr< SdrUndoAction > pUndo)
virtual void SetChanged(bool bFlg=true)
virtual SdrPage * RemoveMasterPage(sal_uInt16 nPgNum)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rValues)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
const LanguageTag & GetLanguageTag() const
void ReformatAllEdgeObjects()
#103122# reformats all edge objects that are connected to other objects
void setUnoModel(const css::uno::Reference< css::uno::XInterface > &xModel)
virtual void DeletePage(sal_uInt16 nPgNum)
void SetPageNum(sal_uInt16 nNew)
std::unordered_set< const SdrObject * > maAllIncarnatedObjects
bool mbKernAsianPunctuation
const OUString & getNumDecimalSep() const
#define TOOLS_WARN_EXCEPTION(area, stream)
void SetTextDefaults() const
std::unique_ptr< TextChain > m_pTextChain
constexpr std::pair< sal_Int64, sal_Int64 > getConversionMulDiv(U from, U to)
static bool isNumTrailingZeros()
void SetScaleFraction(const Fraction &rFrac)
sal_uInt16 GetMasterPageCount() const
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
std::vector< SdrOutliner * > GetActiveOutliners() const
#define DBG_ASSERT(sCon, aError)
void Repeat(SfxRepeatTarget &)
SfxUndoManager * GetSdrUndoManager() const
static OUString GetUnitString(FieldUnit eUnit)
bool IsAddExtLeading() const
SVX_DLLPRIVATE void ImpCreateTables(bool bDisablePropertyFiles)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
void SetRefDevice(OutputDevice *pDev)
virtual SvxNumType GetPageNumType() const
returns the numbering type that is used to format page fields in drawing shapes
void SetReadOnly(bool bYes)
bool m_bStarDrawPreviewMode
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SVX_DLLPRIVATE void ImpReformatAllEdgeObjects()
const SdrTextObj * GetFormattingTextObj() const
sal_uInt16 mnHandoutPageCount
The SdrUndoFactory can be set and retrieved from the SdrModel.
static void MigrateItemSet(const SfxItemSet *pSourceSet, SfxItemSet *pDestSet, SdrModel *pNewModel)
copies the items from the source set to the destination set.
void SetSdrUndoFactory(SdrUndoFactory *pUndoFactory)
applications can set their own undo factory to override creation of undo actions. ...
Fraction GetMapFraction()
void SetUndoComment(const OUString &rComment)
static XPropertyListRef CreatePropertyList(XPropertyListType t, const OUString &rPath, const OUString &rReferer)
void DeleteMasterPage(sal_uInt16 nPgNum)
void SetDefaultFontHeight(sal_Int32 nVal)
bool TRG_HasMasterPage() const
virtual SdrPage * AllocPage(bool bMasterPage)
bool mbDisableTextEditUsesCommonUndoManager
std::shared_ptr< SvxForbiddenCharactersTable > mpForbiddenCharactersTable
void SetKernAsianPunctuation(bool bEnabled)
SdrHint(SdrHintKind eNewHint)
sal_uInt16 m_nDefaultTabulator
virtual ~SdrModel() override
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
static css::uno::Reference< css::io::XStream > GetStreamAtPackageURL(const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rURL, sal_uInt32 const nOpenMode, LifecycleProxy const &rNastiness)
static SfxItemPool * CreatePool()
SdrUndoFactory * mpUndoFactory
void SetStarDrawPreviewMode(bool bPreview)
Aggregation of arbitrarily many UndoActions to a single UndoAction.
SfxItemPool * GetSecondaryPool() const
virtual SdrPage * CloneSdrPage(SdrModel &rTargetModel) const
void SetDefTab(sal_uInt16 nTab)
SfxItemPool * m_pItemPool
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharsTable() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetUIScale(const Fraction &rScale)
void Broadcast(const SfxHint &rHint)
static void Free(SfxItemPool *pPool)
virtual bool IsReadOnly() const
void SetInserted(bool bNew=true)
bool HasRedoActions() const
void SetDefaultMetric(MapUnit eNewMetric)
bool mbAnchoredTextOverflowLegacy
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
void BurnInStyleSheetAttributes()
convert attributes of the style to hard formatting
std::unique_ptr< SdrOutliner > m_pChainingOutliner
sal_Int32 GetDenominator() const
void TRG_ImpMasterPageRemoved(const SdrPage &rRemovedPage)
virtual SdrModel * AllocModel() const
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
SfxStyleSheet * m_pDefaultStyleSheet
void SetAddExtLeading(bool bEnabled)
#define SAL_WARN_IF(condition, area, stream)
CharCompressType mnCharCompressType
constexpr o3tl::Length MapToO3tlLength(MapUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
sfx2::LinkManager * m_pLinkManager
#define SAL_INFO(area, stream)
std::unique_ptr< SdrModelImpl > mpImpl
comphelper::IEmbeddedHelper * m_pEmbeddedHelper
SVX_DLLPRIVATE void ImpReformatAllTextObjects()
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rModel)
Create an Outliner with the engine-global default settings on the heap.
static void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
virtual void Repeat(SfxRepeatTarget &)
void SetRefDevice(OutputDevice *pRefDev)
sal_Int32 GetNumerator() const
std::unique_ptr< SdrLayerAdmin > m_pLayerAdmin
void SetMaxUndoActionCount(sal_uInt32 nCount)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
virtual void PageListChanged()
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
void SetUpdateMode(bool bUpdate)
void SetAnchoredTextOverflowLegacy(bool bEnabled)
std::unique_ptr< std::deque< std::unique_ptr< SfxUndoAction > > > m_pRedoStack
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
void SetEditTextObjectPool(SfxItemPool *pPool)
virtual bool CanRepeat(SfxRepeatTarget &) const
void SetAsianCompressionMode(CharCompressType nCompressionMode)
#define SAL_WARN(area, stream)
void SetUIUnit(FieldUnit eUnit)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
bool m_bTransparentTextFrames
virtual SdrPage * RemovePage(sal_uInt16 nPgNum)
SVX_DLLPRIVATE void ImpSetOutlinerDefaults(SdrOutliner *pOutliner, bool bInit=false)
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
void SetScaleUnit(MapUnit eMap)
void EraseVirtualDevice()
static OUString GetPercentString(const Fraction &rVal)
void disposeOutliner(std::unique_ptr< SdrOutliner > pOutliner)
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
virtual void Merge(SdrModel &rSourceModel, sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, sal_uInt16 nDestPos, bool bMergeMasterPages, bool bAllMasterPages, bool bUndo=true, bool bTreadSourceAsConst=false)
void SetAddExtLeading(bool b)
sal_uInt16 GetPageNum() const
bool HasUndoActions() const
void ClearModel(bool bCalledFromDestructor)
virtual css::uno::Reference< css::embed::XStorage > GetDocumentStorage() const
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
css::uno::Reference< css::io::XInputStream > GetDocumentStream(OUString const &rURL,::comphelper::LifecycleProxy const &rProxy) const
double div(const double &fNumerator, const double &fDenominator)
void SetSecondaryPool(SfxItemPool *pPool)
rtl_TextEncoding GetCharSet() const
std::vector< SdrPage * > maPages
sal_uInt16 GetPageCount() const
o3tl::enumarray< XPropertyListType, XPropertyListRef > maProperties
void SetPoolDefaultItem(const SfxPoolItem &)