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>
40#include <editeng/editeng.hxx>
52#include <svx/strings.hrc>
55#include <officecfg/Office/Common.hxx>
70#include <libxml/xmlwriter.h>
108 std::unique_ptr<model::ColorSet> pDefaultColorSet(
new model::ColorSet(*pColorSet));
109 mpTheme->SetColorSet(std::move(pDefaultColorSet));
119 , m_nUIUnitDecimalMark(0)
122 , m_pEmbeddedHelper(pEmbeddedHelper)
124 , m_pRefOutDev(nullptr)
125 , m_pDefaultStyleSheet(nullptr)
126 , mpDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(nullptr)
127 , m_pLinkManager(nullptr)
130 , m_bThemedControls(true)
131 , mbUndoEnabled(true)
133 , m_bPagNumsDirty(false)
134 , m_bMPgNumsDirty(false)
135 , m_bTransportContainer(false)
137 , m_bTransparentTextFrames(false)
138 , m_bSwapGraphics(false)
139 , m_bPasteResize(false)
140 , m_bStarDrawPreviewMode(false)
141 , mbDisableTextEditUsesCommonUndoManager(false)
142 , mbVOCInvalidationIsReliable(false)
143 , m_nDefaultTabulator(0)
144 , m_nMaxUndoCount(16)
148 , mnHandoutPageCount(0)
149 , mbModelLocked(false)
150 , mbKernAsianPunctuation(false)
151 , mbAddExtLeading(false)
152 , mbInDestruction(false)
157 officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get());
160 if (m_pItemPool ==
nullptr)
166 m_pItemPool->SetSecondaryPool(pOutlPool.get());
170 m_pItemPool->SetDefaultMetric(m_eObjUnit);
173 const SfxPoolItem* pPoolItem = m_pItemPool->GetPoolDefaultItem( EE_CHAR_FONTHEIGHT );
180 m_pLayerAdmin->SetModel(
this);
186 ImpSetOutlinerDefaults(m_pDrawOutliner.get(),
true);
189 ImpSetOutlinerDefaults(m_pHitTestOutliner.get(),
true);
193 m_pChainingOutliner =
SdrMakeOutliner( OutlinerMode::TextObject, *
this );
194 ImpSetOutlinerDefaults(m_pChainingOutliner.get(),
true);
223 "SdrModel::~SdrModel: Not all incarnations of SdrObjects deleted, possible memory leak");
225 SAL_WARN(
"svx",
"leaked instance of " <<
typeid(*pObj).name());
244 if( xComponent.is() )
try
246 xComponent->dispose();
248 catch (uno::RuntimeException&)
256 delete mpImpl->mpUndoFactory;
301 if(
mpImpl->mpUndoManager )
303 OSL_FAIL(
"svx::SdrModel::Undo(), method not supported with application undo manager!");
313 std::unique_ptr<SfxUndoAction>
p = std::move(
m_aUndoStack.front());
323 if(
mpImpl->mpUndoManager )
325 OSL_FAIL(
"svx::SdrModel::Redo(), method not supported with application undo manager!");
335 std::unique_ptr<SfxUndoAction>
p = std::move(
m_aRedoStack.front());
345 if(
mpImpl->mpUndoManager )
347 OSL_FAIL(
"svx::SdrModel::Redo(), method not supported with application undo manager!");
364 DBG_ASSERT(
mpImpl->mpUndoManager ==
nullptr,
"svx::SdrModel::ImpPostUndoAction(), method not supported with application undo manager!" );
385 if(
mpImpl->mpUndoManager )
389 nViewShellId = pViewShell->GetViewShellId();
390 mpImpl->mpUndoManager->EnterListAction(
"",
"",0,nViewShellId);
409 if(
mpImpl->mpUndoManager )
413 nViewShellId = pViewShell->GetViewShellId();
414 mpImpl->mpUndoManager->EnterListAction( rComment,
"", 0, nViewShellId );
429 if(
mpImpl->mpUndoManager )
431 OUString aComment(rComment);
432 if( !aComment.isEmpty() && !rObjDescr.isEmpty() )
434 aComment = aComment.replaceFirst(
"%1", rObjDescr);
438 nViewShellId = pViewShell->GetViewShellId();
439 mpImpl->mpUndoManager->EnterListAction( aComment,
"",0,nViewShellId );
457 if(
mpImpl->mpUndoManager )
462 mpImpl->mpUndoManager->LeaveListAction();
490 if(
mpImpl->mpUndoManager )
492 OSL_FAIL(
"svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
503 if(
mpImpl->mpUndoManager )
505 OSL_FAIL(
"svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
519 if(
mpImpl->mpUndoManager )
521 mpImpl->mpUndoManager->AddUndoAction( std::move(pUndo) );
538 if(
mpImpl->mpUndoManager )
540 mpImpl->mpUndoManager->EnableUndo( bEnable );
550 if(
mpImpl->mpUndoManager )
552 return mpImpl->mpUndoManager->IsUndoEnabled();
563 const OUString aTablePath(!bDisablePropertyFiles ?
SvtPathOptions().GetPalettePath() :
"");
573 if(bCalledFromDestructor)
609 return new SdrPage(*
this,bMasterPage);
724 for (nNum=0; nNum<
nCount; nNum++) {
728 for (nNum=0; nNum<
nCount; nNum++) {
744 for (nNum=0; nNum<
nCount; nNum++)
749 for (nNum=0; nNum<
nCount; nNum++)
757 uno::Reference<document::XStorageBasedDocument>
const xSBD(
764 return xSBD->getDocumentStorage();
767uno::Reference<io::XInputStream>
778 uno::Reference<io::XStream>
const xStream(
780 xStorage, rURL, embed::ElementModes::READ, rProxy));
783 catch (container::NoSuchElementException
const&)
787 catch (uno::Exception
const&)
799 for (nNum=0; nNum<
nCount; nNum++) {
803 for (nNum=0; nNum<
nCount; nNum++) {
847 case FieldUnit::CHAR:
848 case FieldUnit::LINE:
851 case FieldUnit::PERCENT:
858 sal_Int32 nMul = 1, nDiv = 1;
861 const auto& [mul,
div] = o3tl::getConversionMulDiv(eFrom, eTo);
874 while(0 == (nMul % 10))
881 while(0 == (nDiv % 10))
937 case FieldUnit::NONE :
938 case FieldUnit::CUSTOM :
940 case FieldUnit::MM_100TH:
941 return OUString{
"/100mm"};
943 return OUString{
"mm"};
945 return OUString{
"cm"};
947 return OUString{
"m"};
949 return OUString{
"km"};
950 case FieldUnit::TWIP :
951 return OUString{
"twip"};
952 case FieldUnit::POINT :
953 return OUString{
"pt"};
954 case FieldUnit::PICA :
955 return OUString{
"pica"};
956 case FieldUnit::INCH :
957 return OUString{
"\""};
958 case FieldUnit::FOOT :
959 return OUString{
"ft"};
960 case FieldUnit::MILE :
961 return OUString{
"mile(s)"};
962 case FieldUnit::PERCENT:
963 return OUString{
"%"};
971 const bool bNegative(nVal < 0);
978 fLocalValue = -fLocalValue;
981 if( -1 == nNumDigits )
988 if(nDecimalMark > nNumDigits)
990 const sal_Int32 nDiff(nDecimalMark - nNumDigits);
991 const double fFactor(pow(10.0,
static_cast<int>(nDiff)));
993 fLocalValue /= fFactor;
994 nDecimalMark = nNumDigits;
996 else if(nDecimalMark < nNumDigits)
998 const sal_Int32 nDiff(nNumDigits - nDecimalMark);
999 const double fFactor(pow(10.0,
static_cast<int>(nDiff)));
1001 fLocalValue *= fFactor;
1002 nDecimalMark = nNumDigits;
1005 OUStringBuffer
aBuf;
1006 aBuf.append(
static_cast<sal_Int32
>(fLocalValue + 0.5));
1008 if(nDecimalMark < 0)
1011 sal_Int32
nCount(-nDecimalMark);
1021 if (nDecimalMark > 0 &&
aBuf.getLength() <= nDecimalMark)
1024 sal_Int32
nCount = nDecimalMark -
aBuf.getLength();
1030 aBuf.insert(0,
'0');
1036 sal_Int32 nBeforeDecimalMark =
aBuf.getLength() - nDecimalMark;
1038 if(nDecimalMark > 0)
1039 aBuf.insert(nBeforeDecimalMark, cDec);
1043 sal_Int32 aPos=
aBuf.getLength()-1;
1046 while (aPos>=0 &&
aBuf[aPos]==
'0')
1050 if (aPos>=0 &&
aBuf[aPos]==cDec)
1054 if (++aPos<
aBuf.getLength())
1055 aBuf.truncate(aPos);
1059 if( nBeforeDecimalMark > 3 )
1062 if ( !aThoSep.isEmpty() )
1065 sal_Int32
i(nBeforeDecimalMark - 3);
1069 aBuf.insert(
i, cTho);
1080 aBuf.insert(0,
"-");
1086 return aBuf.makeStringAndClear();
1091 bool bNeg = nAngle < 0_deg100;
1096 OUStringBuffer
aBuf;
1097 aBuf.append(
static_cast<sal_Int32
>(nAngle));
1107 aBuf.insert(0,
'0');
1112 aBuf.insert(0,
'-');
1116 return aBuf.makeStringAndClear();
1137 sal_Int32 nPct = ((nMul*100) + nDiv/2)/nDiv;
1142 return OUString::number(nPct) +
"%";
1205 pPg->SetInserted(
false);
1220 pPg->SetInserted(
false);
1261 for(sal_uInt16 np(0); np < nPageCnt; np++)
1266 pRetPg->SetInserted(
false);
1282 pPg->SetInserted(
false);
1294 sal_uInt16 nDestPos,
1295 bool bUndo,
bool bMoveNoCopy)
1304 sal_uInt16 nMaxPage=nPageCnt;
1308 if (nFirstPageNum>nMaxPage)
1309 nFirstPageNum=nMaxPage;
1310 if (nLastPageNum>nMaxPage)
1311 nLastPageNum =nMaxPage;
1312 bool bReverse=nLastPageNum<nFirstPageNum;
1313 if (nDestPos>nPageCnt)
1317 sal_uInt16 nPageNum=nFirstPageNum;
1318 sal_uInt16 nCopyCnt=((!bReverse)?(nLastPageNum-nFirstPageNum):(nFirstPageNum-nLastPageNum))+1;
1319 std::unique_ptr<SdrPage*[]> pPagePtrs(
new SdrPage*[nCopyCnt]);
1320 sal_uInt16 nCopyNum;
1321 for(nCopyNum=0; nCopyNum<nCopyCnt; nCopyNum++)
1323 pPagePtrs[nCopyNum]=
GetPage(nPageNum);
1331 sal_uInt16 nDestNum=nDestPos;
1332 for (nCopyNum=0; nCopyNum<nCopyCnt; nCopyNum++)
1335 sal_uInt16 nPageNum2=pPg->GetPageNum();
1351 if (nDestNum>nPageNum2)
1374 sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
1375 sal_uInt16 nDestPos,
1376 bool bMergeMasterPages,
bool bAllMasterPages,
1377 bool bUndo,
bool bTreadSourceAsConst)
1379 if (&rSourceModel==
this)
1381 CopyPages(nFirstPageNum,nLastPageNum,nDestPos,bUndo,!bTreadSourceAsConst);
1394 bool bInsPages=(nFirstPageNum<nSrcPageCnt || nLastPageNum<nSrcPageCnt);
1395 sal_uInt16 nMaxSrcPage=nSrcPageCnt;
if (nMaxSrcPage!=0) nMaxSrcPage--;
1396 if (nFirstPageNum>nMaxSrcPage) nFirstPageNum=nMaxSrcPage;
1397 if (nLastPageNum>nMaxSrcPage) nLastPageNum =nMaxSrcPage;
1398 bool bReverse=nLastPageNum<nFirstPageNum;
1400 std::unique_ptr<sal_uInt16[]> pMasterMap;
1401 std::unique_ptr<bool[]> pMasterNeed;
1402 sal_uInt16 nMasterNeed=0;
1403 if (bMergeMasterPages && nSrcMasterPageCnt!=0) {
1405 pMasterMap.reset(
new sal_uInt16[nSrcMasterPageCnt]);
1406 pMasterNeed.reset(
new bool[nSrcMasterPageCnt]);
1407 memset(pMasterMap.get(),0xFF,nSrcMasterPageCnt*
sizeof(sal_uInt16));
1408 if (bAllMasterPages) {
1409 memset(pMasterNeed.get(),
true, nSrcMasterPageCnt *
sizeof(
bool));
1411 memset(pMasterNeed.get(),
false, nSrcMasterPageCnt *
sizeof(
bool));
1412 sal_uInt16 nStart= bReverse ? nLastPageNum : nFirstPageNum;
1413 sal_uInt16 nEnd= bReverse ? nFirstPageNum : nLastPageNum;
1414 for (sal_uInt16
i=nStart;
i<=nEnd;
i++) {
1419 sal_uInt16 nMPgNum(rMasterPage.
GetPageNum());
1421 if(nMPgNum < nSrcMasterPageCnt)
1423 pMasterNeed[nMPgNum] =
true;
1429 sal_uInt16 nCurrentMaPagNum=nDstMasterPageCnt;
1430 for (sal_uInt16
i=0;
i<nSrcMasterPageCnt;
i++) {
1431 if (pMasterNeed[
i]) {
1432 pMasterMap[
i]=nCurrentMaPagNum;
1440 if (pMasterMap && pMasterNeed && nMasterNeed!=0) {
1441 for (sal_uInt16
i=nSrcMasterPageCnt;
i>0;) {
1449 if(!bTreadSourceAsConst)
1465 OSL_FAIL(
"SdrModel::Merge(): MasterPage not found in SourceModel.");
1473 sal_uInt16 nSourcePos=nFirstPageNum;
1474 sal_uInt16 nMergeCount=sal_uInt16(std::abs(
static_cast<tools::Long>(
static_cast<tools::Long>(nFirstPageNum)-nLastPageNum))+1);
1476 while (nMergeCount>0)
1482 if(!bTreadSourceAsConst)
1492 if(pPg->TRG_HasMasterPage())
1494 SdrPage& rMasterPage = pPg->TRG_GetMasterPage();
1495 sal_uInt16 nMaPgNum(rMasterPage.
GetPageNum());
1497 if (bMergeMasterPages)
1499 sal_uInt16 nNewNum(0xFFFF);
1503 nNewNum = pMasterMap[nMaPgNum];
1506 if(nNewNum != 0xFFFF)
1514 pPg->TRG_ClearMasterPage();
1523 DBG_ASSERT(nNewNum!=0xFFFF,
"SdrModel::Merge(): Something is crooked with the mapping of the MasterPages.");
1525 if (nMaPgNum>=nDstMasterPageCnt) {
1527 pPg->TRG_ClearMasterPage();
1533 OSL_FAIL(
"SdrModel::Merge(): Drawing page not found in SourceModel.");
1536 if (bReverse) nSourcePos--;
1537 else if (bTreadSourceAsConst) nSourcePos++;
1543 pMasterNeed.reset();
1559 SAL_WARN(
"svx",
"SdrModel::SetStarDrawPreviewMode(): Resetting not allowed, because Model might not be complete.");
1569 mpImpl->mpTheme = std::move(pTheme);
1604 OSL_FAIL(
"SdrModel::createUnoModel() - base implementation should not be called!" );
1605 uno::Reference<uno::XInterface> xInt;
1626 assert(pNewModelel !=
nullptr);
1627 if( !(pSourceSet && pDestSet && (pSourceSet != pDestSet )) )
1636 if(SfxItemState::SET == aWhichIter.
GetItemState(
false, &pPoolItem))
1638 std::unique_ptr<SfxPoolItem> pResultItem;
1643 pResultItem =
static_cast<const XFillBitmapItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1646 pResultItem =
static_cast<const XLineDashItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1649 pResultItem =
static_cast<const XLineStartItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1652 pResultItem =
static_cast<const XLineEndItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1655 pResultItem =
static_cast<const XFillGradientItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1662 pResultItem =
static_cast<const XFillHatchItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1668 pDestSet->
Put(std::move(pResultItem));
1670 pDestSet->
Put(*pPoolItem);
1721 mpImpl->mbAnchoredTextOverflowLegacy = bEnabled;
1724 mpImpl->mbLegacySingleLineFontwork = bEnabled;
1727 mpImpl->mbConnectorUseSnapRect = bEnabled;
1730 mpImpl->mbIgnoreBreakAfterMultilineField = bEnabled;
1740 return mpImpl->mbAnchoredTextOverflowLegacy;
1742 return mpImpl->mbLegacySingleLineFontwork;
1744 return mpImpl->mbConnectorUseSnapRect;
1746 return mpImpl->mbIgnoreBreakAfterMultilineField;
1787 if (pValue->Name ==
"AnchoredTextOverflowLegacy")
1790 if (pValue->Value >>= bBool)
1792 mpImpl->mbAnchoredTextOverflowLegacy = bBool;
1795 else if (pValue->Name ==
"ConnectorUseSnapRect")
1798 if (pValue->Value >>= bBool)
1800 mpImpl->mbConnectorUseSnapRect = bBool;
1803 else if (pValue->Name ==
"LegacySingleLineFontwork")
1806 if (pValue->Value >>= bBool)
1808 mpImpl->mbLegacySingleLineFontwork = bBool;
1822 pShape->InvalidateRenderGeometry();
1829 else if (pValue->Name ==
"IgnoreBreakAfterMultilineField")
1832 if (pValue->Value >>= bBool)
1834 mpImpl->mbIgnoreBreakAfterMultilineField = bBool;
1839template <
typename T>
1840static void addPair(std::vector< std::pair< OUString, uno::Any > >& aUserData,
const OUString& name,
const T val)
1842 aUserData.push_back(std::pair< OUString, uno::Any >(
name,
uno::Any(val)));
1847 std::vector< std::pair< OUString, uno::Any > > aUserData;
1848 addPair(aUserData,
"AnchoredTextOverflowLegacy",
1850 addPair(aUserData,
"LegacySingleLineFontwork",
1852 addPair(aUserData,
"ConnectorUseSnapRect",
1854 addPair(aUserData,
"IgnoreBreakAfterMultilineField",
1857 const sal_Int32 nOldLength = rValues.getLength();
1858 rValues.realloc(nOldLength + aUserData.size());
1860 beans::PropertyValue* pValue = &(rValues.getArray()[nOldLength]);
1862 for (
const auto &aIter : aUserData)
1864 pValue->Name = aIter.first;
1865 pValue->Value = aIter.second;
1872 return nPgNum <
maPages.size() ?
maPages[nPgNum].get() :
nullptr;
1877 return nPgNum <
maPages.size() ?
maPages[nPgNum].get() :
nullptr;
1882 return sal_uInt16(
maPages.size());
1917 mpImpl->mpUndoManager = pUndoManager;
1922 return mpImpl->mpUndoManager;
1927 if( !
mpImpl->mpUndoFactory )
1929 return *
mpImpl->mpUndoFactory;
1934 if( pUndoFactory && (pUndoFactory !=
mpImpl->mpUndoFactory) )
1936 delete mpImpl->mpUndoFactory;
1937 mpImpl->mpUndoFactory = pUndoFactory;
1943 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrModel"));
1944 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
1946 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"maMasterPages"));
1951 pPage->dumpAsXml(pWriter);
1954 (void)xmlTextWriterEndElement(pWriter);
1956 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"maPages"));
1961 pPage->dumpAsXml(pWriter);
1964 (void)xmlTextWriterEndElement(pWriter);
1968 mpImpl->mpTheme->dumpAsXml(pWriter);
1971 (void)xmlTextWriterEndElement(pWriter);
1977 return theSdrModelUnoTunnelImplementationId.
getSeq();
1993 mpPage(rNewObj.getSdrPageFromSdrObject())
constexpr o3tl::Length FieldToO3tlLength(FieldUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
constexpr o3tl::Length MapToO3tlLength(MapUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
const LanguageTag & GetLanguageTag() const
static const AllSettings & GetSettings()
static rtl::Reference< SfxItemPool > CreatePool()
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
LanguageType getLanguageType(bool bResolveSystem=true) const
const OUString & getNumThousandSep() const
static bool isNumTrailingZeros()
const OUString & getNumDecimalSep() const
static sal_uInt16 getNumDigits()
static bool isNumLeadingZero()
void SetDefTab(sal_uInt16 nTab)
bool SetUpdateLayout(bool bUpdate)
void SetAsianCompressionMode(CharCompressType nCompressionMode)
void SetEditTextObjectPool(SfxItemPool *pPool)
void SetAddExtLeading(bool b)
void SetRefDevice(OutputDevice *pRefDev)
static void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
void SetRefMapMode(const MapMode &)
void SetKernAsianPunctuation(bool bEnabled)
void EraseVirtualDevice()
static vcl::Font GetDefaultFont(DefaultFontType nType, LanguageType eLang, GetDefaultFontFlags nFlags, const OutputDevice *pOutDev=nullptr)
SdrHint(SdrHintKind eNewHint)
void SetUIScale(const Fraction &rScale)
virtual rtl::Reference< SdrPage > RemovePage(sal_uInt16 nPgNum)
bool m_bStarDrawPreviewMode
virtual css::uno::Reference< css::embed::XStorage > GetDocumentStorage() const
VclPtr< OutputDevice > m_pRefOutDev
SdrOutliner & GetChainingOutliner(const SdrTextObj *pObj) const
bool IsKernAsianPunctuation() const
bool GetCompatibilityFlag(SdrCompatibilityFlag eFlag) const
std::function< void(std::unique_ptr< SdrUndoAction >)> m_aUndoLink
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
std::unique_ptr< SdrOutliner > createOutliner(OutlinerMode nOutlinerMode)
CharCompressType mnCharCompressType
void setTheme(std::unique_ptr< model::Theme > pTheme)
void SetMaxUndoActionCount(sal_uInt32 nCount)
sal_uInt16 m_nDefaultTabulator
void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue)
virtual SvxNumType GetPageNumType() const
returns the numbering type that is used to format page fields in drawing shapes
void SetCompatibilityFlag(SdrCompatibilityFlag eFlag, bool bEnabled)
void SetKernAsianPunctuation(bool bEnabled)
void SetCharCompressType(CharCompressType nType)
std::unique_ptr< SdrOutlinerCache > mpOutlinerCache
css::uno::Reference< css::uno::XInterface > mxUnoModel
std::unique_ptr< SdrModelImpl > mpImpl
virtual void adaptSizeAndBorderForAllPages(const Size &rNewSize, tools::Long nLeft=0, tools::Long nRight=0, tools::Long nUpper=0, tools::Long nLower=0)
virtual void SetChanged(bool bFlg=true)
std::unique_ptr< SdrUndoGroup > m_pCurrentUndoGroup
std::unique_ptr< SdrOutliner > m_pChainingOutliner
std::unique_ptr< SdrLayerAdmin > m_pLayerAdmin
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 SetSdrUndoManager(SfxUndoManager *pUndoManager)
application can set its own undo manager, BegUndo, EndUndo and AddUndoAction calls are routed to this...
const SdrPage * GetMasterPage(sal_uInt16 nPgNum) const
o3tl::enumarray< XPropertyListType, XPropertyListRef > maProperties
void SetForbiddenCharsTable(const std::shared_ptr< SvxForbiddenCharactersTable > &xForbiddenChars)
virtual rtl::Reference< SdrPage > RemoveMasterPage(sal_uInt16 nPgNum)
void SetUIUnit(FieldUnit eUnit)
void SetRefDevice(OutputDevice *pDev)
TextChain * GetTextChain() const
void SetDefaultTabulator(sal_uInt16 nVal)
css::uno::Reference< css::io::XInputStream > GetDocumentStream(OUString const &rURL, ::comphelper::LifecycleProxy const &rProxy) const
virtual void MasterPageListChanged()
void DeleteMasterPage(sal_uInt16 nPgNum)
virtual rtl::Reference< SdrPage > AllocPage(bool bMasterPage)
SVX_DLLPRIVATE void ImpSetUIUnit()
virtual void MovePage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
void Repeat(SfxRepeatTarget &)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
virtual css::uno::Reference< css::uno::XInterface > createUnoModel()
void ClearModel(bool bCalledFromDestructor)
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
virtual bool IsReadOnly() const
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
SfxUndoManager * GetSdrUndoManager() const
sal_uInt16 GetMasterPageCount() const
void SetTextDefaults() const
void SetAddExtLeading(bool bEnabled)
bool IsAddExtLeading() const
std::vector< rtl::Reference< SdrPage > > maMasterPages
void setUnoModel(const css::uno::Reference< css::uno::XInterface > &xModel)
void SetScaleUnit(MapUnit eMap)
void WriteUserDataSequence(css::uno::Sequence< css::beans::PropertyValue > &rValues)
void EnableUndo(bool bEnable)
enables (true) or disables (false) recording of undo actions If undo actions are added while undo is ...
bool mbMakePageObjectsNamesUnique
void SetReadOnly(bool bYes)
SVX_DLLPRIVATE void ImpReformatAllEdgeObjects()
rtl::Reference< SfxItemPool > m_pItemPool
std::unique_ptr< SdrOutliner > m_pDrawOutliner
OUString GetMetricString(tools::Long nVal, bool bNoUnitChars=false, sal_Int32 nNumDigits=-1) const
void CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, sal_uInt16 nDestPos, bool bUndo, bool bMoveNoCopy)
void SetUndoComment(const OUString &rComment)
SVX_DLLPRIVATE void ImpSetOutlinerDefaults(SdrOutliner *pOutliner, bool bInit=false)
std::vector< SdrOutliner * > GetActiveOutliners() const
void BurnInStyleSheetAttributes()
SdrUndoFactory & GetSdrUndoFactory() const
returns the models undo factory.
void SetDefaultFontHeight(sal_Int32 nVal)
const std::shared_ptr< SvxForbiddenCharactersTable > & GetForbiddenCharsTable() const
virtual void InsertMasterPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
OutputDevice * GetRefDevice() const
SVX_DLLPRIVATE void ImpReformatAllTextObjects()
sal_uInt32 m_nMaxUndoCount
virtual void DeletePage(sal_uInt16 nPgNum)
bool HasRedoActions() const
SVX_DLLPRIVATE void ImpCreateTables(bool bDisablePropertyFiles)
css::uno::Reference< css::uno::XInterface > const & getUnoModel()
void RecalcPageNums(bool bMaster)
std::deque< std::unique_ptr< SfxUndoAction > > m_aUndoStack
virtual void PageListChanged()
void MoveMasterPage(sal_uInt16 nPgNum, sal_uInt16 nNewPos)
virtual SdrModel * AllocModel() const
void SetSdrUndoFactory(SdrUndoFactory *pUndoFactory)
applications can set their own undo factory to override creation of undo actions.
void disposeOutliner(std::unique_ptr< SdrOutliner > pOutliner)
static OUString GetAngleString(Degree100 nAngle)
bool IsUndoEnabled() const
returns true if undo is currently enabled This returns false if undo was disabled using EnableUndo( f...
const SdrPage * GetPage(sal_uInt16 nPgNum) const
std::vector< rtl::Reference< SdrPage > > maPages
rtl::Reference< SfxStyleSheetBasePool > mxStyleSheetPool
SVX_DLLPRIVATE void ImpPostUndoAction(std::unique_ptr< SdrUndoAction > pUndo)
std::deque< std::unique_ptr< SfxUndoAction > > m_aRedoStack
const SdrTextObj * GetFormattingTextObj() const
static OUString GetPercentString(const Fraction &rVal)
void ReformatAllTextObjects()
std::unique_ptr< TextChain > m_pTextChain
std::unordered_set< SdrObject * > maAllIncarnatedObjects
bool HasUndoActions() const
virtual ~SdrModel() override
SdrModel(const SdrModel &rSrcModel)=delete
static void MigrateItemSet(const SfxItemSet *pSourceSet, SfxItemSet *pDestSet, SdrModel *pNewModel)
copies the items from the source set to the destination set.
static OUString GetUnitString(FieldUnit eUnit)
sal_uInt16 GetPageCount() const
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
std::unique_ptr< model::Theme > const & getTheme() const
bool mbKernAsianPunctuation
void SetStarDrawPreviewMode(bool bPreview)
std::shared_ptr< SvxForbiddenCharactersTable > mpForbiddenCharactersTable
std::unique_ptr< SdrOutliner > m_pHitTestOutliner
void ReformatAllTextObjects()
void BurnInStyleSheetAttributes()
convert attributes of the style to hard formatting
void ReformatAllEdgeObjects()
#103122# reformats all edge objects that are connected to other objects
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
virtual rtl::Reference< SdrPage > CloneSdrPage(SdrModel &rTargetModel) const
void MakePageObjectsNamesUnique()
SdrPage & TRG_GetMasterPage() const
void TRG_ImpMasterPageRemoved(const SdrPage &rRemovedPage)
sal_uInt16 GetPageNum() const
void SetInserted(bool bNew=true)
bool TRG_HasMasterPage() const
void SetPageNum(sal_uInt16 nNew)
The SdrUndoFactory can be set and retrieved from the SdrModel.
Aggregation of arbitrarily many UndoActions to a single UndoAction.
void Broadcast(const SfxHint &rHint)
void SetPoolDefaultItem(const SfxPoolItem &)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
virtual void Repeat(SfxRepeatTarget &)
virtual bool CanRepeat(SfxRepeatTarget &) const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
SfxItemState GetItemState(bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const LocaleDataWrapper & GetLocaleData() const
void SetStyleName(const OUString &rStyleName)
void SetFamily(FontFamily _eFamily)
void SetPitch(FontPitch _ePitch)
void SetFamilyName(const OUString &rFamilyName)
void SetCharSet(rtl_TextEncoding _eEncoding)
static XPropertyListRef CreatePropertyList(XPropertyListType t, const OUString &rPath, const OUString &rReferer)
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)
const css::uno::Sequence< sal_Int8 > & getSeq() const
const model::ColorSet & getColorSet(sal_uInt32 nIndex) const
FontFamily GetFamilyType()
const OUString & GetFamilyName() const
rtl_TextEncoding GetCharSet() const
SdrCompatibilityFlag
SdrCompatibilityFlags that are implemented in SdrModelImpl.
@ ConnectorUseSnapRect
for tdf#149756
@ IgnoreBreakAfterMultilineField
for tdf#148966
@ LegacySingleLineFontwork
for tdf#148000
@ AnchoredTextOverflowLegacy
for tdf#99729
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
OUString SvxResId(TranslateId aId)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CJK(EE_CHAR_START+17)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxColorItem > EE_CHAR_COLOR(EE_CHAR_START+0)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO_CTL(EE_CHAR_START+18)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr TypedWhichId< SvxFontItem > EE_CHAR_FONTINFO(EE_CHAR_START+1)
struct _xmlTextWriter * xmlTextWriterPtr
#define LANGUAGE_ENGLISH_US
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
Global default settings for the DrawingEngine.
double div(const double &fNumerator, const double &fDenominator)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SdrOnOffItem makeSdrTextWordWrapItem(bool bAuto)
bool mbLegacySingleLineFontwork
SdrUndoFactory * mpUndoFactory
SfxUndoManager * mpUndoManager
std::unique_ptr< model::Theme > mpTheme
bool mbIgnoreBreakAfterMultilineField
tdf#148966 compatibility flag
bool mbConnectorUseSnapRect
bool mbAnchoredTextOverflowLegacy
Reference< XModel > xModel
std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rModel)
Create an Outliner with the engine-global default settings on the heap.
static void addPair(std::vector< std::pair< OUString, uno::Any > > &aUserData, const OUString &name, const T val)
constexpr const sal_Unicode DEGREE_CHAR
constexpr TypedWhichId< XLineDashItem > XATTR_LINEDASH(XATTR_LINE_FIRST+1)
constexpr TypedWhichId< XLineEndItem > XATTR_LINEEND(XATTR_LINE_FIRST+5)
constexpr TypedWhichId< XLineStartItem > XATTR_LINESTART(XATTR_LINE_FIRST+4)
constexpr TypedWhichId< XFillHatchItem > XATTR_FILLHATCH(XATTR_FILL_FIRST+3)
constexpr TypedWhichId< XFillBitmapItem > XATTR_FILLBITMAP(XATTR_FILL_FIRST+4)
constexpr TypedWhichId< XFillFloatTransparenceItem > XATTR_FILLFLOATTRANSPARENCE(XATTR_FILL_FIRST+11)
constexpr TypedWhichId< XFillGradientItem > XATTR_FILLGRADIENT(XATTR_FILL_FIRST+2)