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::shared_ptr<model::ColorSet> pDefaultColorSet(
new model::ColorSet(*pColorSet));
109 mpTheme->setColorSet(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());
242 uno::Reference<lang::XComponent> xComponent( getXWeak(
mxStyleSheetPool.get() ), uno::UNO_QUERY );
243 if( xComponent.is() )
try
245 xComponent->dispose();
247 catch (uno::RuntimeException&)
255 delete mpImpl->mpUndoFactory;
300 if(
mpImpl->mpUndoManager )
302 OSL_FAIL(
"svx::SdrModel::Undo(), method not supported with application undo manager!");
312 std::unique_ptr<SfxUndoAction>
p = std::move(
m_aUndoStack.front());
322 if(
mpImpl->mpUndoManager )
324 OSL_FAIL(
"svx::SdrModel::Redo(), method not supported with application undo manager!");
334 std::unique_ptr<SfxUndoAction>
p = std::move(
m_aRedoStack.front());
344 if(
mpImpl->mpUndoManager )
346 OSL_FAIL(
"svx::SdrModel::Redo(), method not supported with application undo manager!");
363 DBG_ASSERT(
mpImpl->mpUndoManager ==
nullptr,
"svx::SdrModel::ImpPostUndoAction(), method not supported with application undo manager!" );
384 if(
mpImpl->mpUndoManager )
388 nViewShellId = pViewShell->GetViewShellId();
389 mpImpl->mpUndoManager->EnterListAction(
"",
"",0,nViewShellId);
408 if(
mpImpl->mpUndoManager )
412 nViewShellId = pViewShell->GetViewShellId();
413 mpImpl->mpUndoManager->EnterListAction( rComment,
"", 0, nViewShellId );
428 if(
mpImpl->mpUndoManager )
430 OUString aComment(rComment);
431 if( !aComment.isEmpty() && !rObjDescr.isEmpty() )
433 aComment = aComment.replaceFirst(
"%1", rObjDescr);
437 nViewShellId = pViewShell->GetViewShellId();
438 mpImpl->mpUndoManager->EnterListAction( aComment,
"",0,nViewShellId );
456 if(
mpImpl->mpUndoManager )
461 mpImpl->mpUndoManager->LeaveListAction();
489 if(
mpImpl->mpUndoManager )
491 OSL_FAIL(
"svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
502 if(
mpImpl->mpUndoManager )
504 OSL_FAIL(
"svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" );
518 if(
mpImpl->mpUndoManager )
520 mpImpl->mpUndoManager->AddUndoAction( std::move(pUndo) );
537 if(
mpImpl->mpUndoManager )
539 mpImpl->mpUndoManager->EnableUndo( bEnable );
549 if(
mpImpl->mpUndoManager )
551 return mpImpl->mpUndoManager->IsUndoEnabled();
562 const OUString aTablePath(!bDisablePropertyFiles ?
SvtPathOptions().GetPalettePath() :
"");
572 if(bCalledFromDestructor)
608 return new SdrPage(*
this,bMasterPage);
723 for (nNum=0; nNum<
nCount; nNum++) {
727 for (nNum=0; nNum<
nCount; nNum++) {
743 for (nNum=0; nNum<
nCount; nNum++)
748 for (nNum=0; nNum<
nCount; nNum++)
756 uno::Reference<document::XStorageBasedDocument>
const xSBD(
763 return xSBD->getDocumentStorage();
766uno::Reference<io::XInputStream>
777 uno::Reference<io::XStream>
const xStream(
779 xStorage, rURL, embed::ElementModes::READ, rProxy));
782 catch (container::NoSuchElementException
const&)
786 catch (uno::Exception
const&)
798 for (nNum=0; nNum<
nCount; nNum++) {
802 for (nNum=0; nNum<
nCount; nNum++) {
846 case FieldUnit::CHAR:
847 case FieldUnit::LINE:
850 case FieldUnit::PERCENT:
857 sal_Int32 nMul = 1, nDiv = 1;
860 const auto& [mul,
div] = o3tl::getConversionMulDiv(eFrom, eTo);
873 while(0 == (nMul % 10))
880 while(0 == (nDiv % 10))
936 case FieldUnit::NONE :
937 case FieldUnit::CUSTOM :
939 case FieldUnit::MM_100TH:
940 return OUString{
"/100mm"};
942 return OUString{
"mm"};
944 return OUString{
"cm"};
946 return OUString{
"m"};
948 return OUString{
"km"};
949 case FieldUnit::TWIP :
950 return OUString{
"twip"};
951 case FieldUnit::POINT :
952 return OUString{
"pt"};
953 case FieldUnit::PICA :
954 return OUString{
"pica"};
955 case FieldUnit::INCH :
956 return OUString{
"\""};
957 case FieldUnit::FOOT :
958 return OUString{
"ft"};
959 case FieldUnit::MILE :
960 return OUString{
"mile(s)"};
961 case FieldUnit::PERCENT:
962 return OUString{
"%"};
970 const bool bNegative(nVal < 0);
977 fLocalValue = -fLocalValue;
980 if( -1 == nNumDigits )
987 if(nDecimalMark > nNumDigits)
989 const sal_Int32 nDiff(nDecimalMark - nNumDigits);
990 const double fFactor(pow(10.0,
static_cast<int>(nDiff)));
992 fLocalValue /= fFactor;
993 nDecimalMark = nNumDigits;
995 else if(nDecimalMark < nNumDigits)
997 const sal_Int32 nDiff(nNumDigits - nDecimalMark);
998 const double fFactor(pow(10.0,
static_cast<int>(nDiff)));
1000 fLocalValue *= fFactor;
1001 nDecimalMark = nNumDigits;
1004 OUStringBuffer
aBuf = OUString::number(
static_cast<sal_Int32
>(fLocalValue + 0.5));
1006 if(nDecimalMark < 0)
1009 sal_Int32
nCount(-nDecimalMark);
1019 if (nDecimalMark > 0 &&
aBuf.getLength() <= nDecimalMark)
1022 sal_Int32
nCount = nDecimalMark -
aBuf.getLength();
1028 aBuf.insert(0,
'0');
1034 sal_Int32 nBeforeDecimalMark =
aBuf.getLength() - nDecimalMark;
1036 if(nDecimalMark > 0)
1037 aBuf.insert(nBeforeDecimalMark, cDec);
1041 sal_Int32 aPos=
aBuf.getLength()-1;
1044 while (aPos>=0 &&
aBuf[aPos]==
'0')
1048 if (aPos>=0 &&
aBuf[aPos]==cDec)
1052 if (++aPos<
aBuf.getLength())
1053 aBuf.truncate(aPos);
1057 if( nBeforeDecimalMark > 3 )
1060 if ( !aThoSep.isEmpty() )
1063 sal_Int32
i(nBeforeDecimalMark - 3);
1067 aBuf.insert(
i, cTho);
1078 aBuf.insert(0,
"-");
1084 return aBuf.makeStringAndClear();
1089 bool bNeg = nAngle < 0_deg100;
1094 OUStringBuffer
aBuf;
1095 aBuf.append(
static_cast<sal_Int32
>(nAngle));
1105 aBuf.insert(0,
'0');
1110 aBuf.insert(0,
'-');
1114 return aBuf.makeStringAndClear();
1135 sal_Int32 nPct = ((nMul*100) + nDiv/2)/nDiv;
1140 return OUString::number(nPct) +
"%";
1203 pPg->SetInserted(
false);
1218 pPg->SetInserted(
false);
1259 for(sal_uInt16 np(0); np < nPageCnt; np++)
1264 pRetPg->SetInserted(
false);
1280 pPg->SetInserted(
false);
1292 sal_uInt16 nDestPos,
1293 bool bUndo,
bool bMoveNoCopy)
1302 sal_uInt16 nMaxPage=nPageCnt;
1306 if (nFirstPageNum>nMaxPage)
1307 nFirstPageNum=nMaxPage;
1308 if (nLastPageNum>nMaxPage)
1309 nLastPageNum =nMaxPage;
1310 bool bReverse=nLastPageNum<nFirstPageNum;
1311 if (nDestPos>nPageCnt)
1315 sal_uInt16 nPageNum=nFirstPageNum;
1316 sal_uInt16 nCopyCnt=((!bReverse)?(nLastPageNum-nFirstPageNum):(nFirstPageNum-nLastPageNum))+1;
1317 std::unique_ptr<SdrPage*[]> pPagePtrs(
new SdrPage*[nCopyCnt]);
1318 sal_uInt16 nCopyNum;
1319 for(nCopyNum=0; nCopyNum<nCopyCnt; nCopyNum++)
1321 pPagePtrs[nCopyNum]=
GetPage(nPageNum);
1329 sal_uInt16 nDestNum=nDestPos;
1330 for (nCopyNum=0; nCopyNum<nCopyCnt; nCopyNum++)
1333 sal_uInt16 nPageNum2=pPg->GetPageNum();
1349 if (nDestNum>nPageNum2)
1372 sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum,
1373 sal_uInt16 nDestPos,
1374 bool bMergeMasterPages,
bool bAllMasterPages,
1375 bool bUndo,
bool bTreadSourceAsConst)
1377 if (&rSourceModel==
this)
1379 CopyPages(nFirstPageNum,nLastPageNum,nDestPos,bUndo,!bTreadSourceAsConst);
1392 bool bInsPages=(nFirstPageNum<nSrcPageCnt || nLastPageNum<nSrcPageCnt);
1393 sal_uInt16 nMaxSrcPage=nSrcPageCnt;
if (nMaxSrcPage!=0) nMaxSrcPage--;
1394 if (nFirstPageNum>nMaxSrcPage) nFirstPageNum=nMaxSrcPage;
1395 if (nLastPageNum>nMaxSrcPage) nLastPageNum =nMaxSrcPage;
1396 bool bReverse=nLastPageNum<nFirstPageNum;
1398 std::unique_ptr<sal_uInt16[]> pMasterMap;
1399 std::unique_ptr<bool[]> pMasterNeed;
1400 sal_uInt16 nMasterNeed=0;
1401 if (bMergeMasterPages && nSrcMasterPageCnt!=0) {
1403 pMasterMap.reset(
new sal_uInt16[nSrcMasterPageCnt]);
1404 pMasterNeed.reset(
new bool[nSrcMasterPageCnt]);
1405 memset(pMasterMap.get(),0xFF,nSrcMasterPageCnt*
sizeof(sal_uInt16));
1406 if (bAllMasterPages) {
1407 memset(pMasterNeed.get(),
true, nSrcMasterPageCnt *
sizeof(
bool));
1409 memset(pMasterNeed.get(),
false, nSrcMasterPageCnt *
sizeof(
bool));
1410 sal_uInt16 nStart= bReverse ? nLastPageNum : nFirstPageNum;
1411 sal_uInt16 nEnd= bReverse ? nFirstPageNum : nLastPageNum;
1412 for (sal_uInt16
i=nStart;
i<=nEnd;
i++) {
1417 sal_uInt16 nMPgNum(rMasterPage.
GetPageNum());
1419 if(nMPgNum < nSrcMasterPageCnt)
1421 pMasterNeed[nMPgNum] =
true;
1427 sal_uInt16 nCurrentMaPagNum=nDstMasterPageCnt;
1428 for (sal_uInt16
i=0;
i<nSrcMasterPageCnt;
i++) {
1429 if (pMasterNeed[
i]) {
1430 pMasterMap[
i]=nCurrentMaPagNum;
1438 if (pMasterMap && pMasterNeed && nMasterNeed!=0) {
1439 for (sal_uInt16
i=nSrcMasterPageCnt;
i>0;) {
1447 if(!bTreadSourceAsConst)
1463 OSL_FAIL(
"SdrModel::Merge(): MasterPage not found in SourceModel.");
1471 sal_uInt16 nSourcePos=nFirstPageNum;
1472 sal_uInt16 nMergeCount=sal_uInt16(std::abs(
static_cast<tools::Long>(
static_cast<tools::Long>(nFirstPageNum)-nLastPageNum))+1);
1474 while (nMergeCount>0)
1480 if(!bTreadSourceAsConst)
1490 if(pPg->TRG_HasMasterPage())
1492 SdrPage& rMasterPage = pPg->TRG_GetMasterPage();
1493 sal_uInt16 nMaPgNum(rMasterPage.
GetPageNum());
1495 if (bMergeMasterPages)
1497 sal_uInt16 nNewNum(0xFFFF);
1501 nNewNum = pMasterMap[nMaPgNum];
1504 if(nNewNum != 0xFFFF)
1512 pPg->TRG_ClearMasterPage();
1521 DBG_ASSERT(nNewNum!=0xFFFF,
"SdrModel::Merge(): Something is crooked with the mapping of the MasterPages.");
1523 if (nMaPgNum>=nDstMasterPageCnt) {
1525 pPg->TRG_ClearMasterPage();
1531 OSL_FAIL(
"SdrModel::Merge(): Drawing page not found in SourceModel.");
1534 if (bReverse) nSourcePos--;
1535 else if (bTreadSourceAsConst) nSourcePos++;
1541 pMasterNeed.reset();
1557 SAL_WARN(
"svx",
"SdrModel::SetStarDrawPreviewMode(): Resetting not allowed, because Model might not be complete.");
1567 mpImpl->mpTheme = pTheme;
1602 OSL_FAIL(
"SdrModel::createUnoModel() - base implementation should not be called!" );
1603 uno::Reference<uno::XInterface> xInt;
1624 assert(pNewModelel !=
nullptr);
1625 if( !(pSourceSet && pDestSet && (pSourceSet != pDestSet )) )
1634 if(SfxItemState::SET == aWhichIter.
GetItemState(
false, &pPoolItem))
1636 std::unique_ptr<SfxPoolItem> pResultItem;
1641 pResultItem =
static_cast<const XFillBitmapItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1644 pResultItem =
static_cast<const XLineDashItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1647 pResultItem =
static_cast<const XLineStartItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1650 pResultItem =
static_cast<const XLineEndItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1653 pResultItem =
static_cast<const XFillGradientItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1660 pResultItem =
static_cast<const XFillHatchItem*
>(pPoolItem)->checkForUniqueItem( pNewModelel );
1666 pDestSet->
Put(std::move(pResultItem));
1668 pDestSet->
Put(*pPoolItem);
1719 mpImpl->mbAnchoredTextOverflowLegacy = bEnabled;
1722 mpImpl->mbLegacySingleLineFontwork = bEnabled;
1725 mpImpl->mbConnectorUseSnapRect = bEnabled;
1728 mpImpl->mbIgnoreBreakAfterMultilineField = bEnabled;
1738 return mpImpl->mbAnchoredTextOverflowLegacy;
1740 return mpImpl->mbLegacySingleLineFontwork;
1742 return mpImpl->mbConnectorUseSnapRect;
1744 return mpImpl->mbIgnoreBreakAfterMultilineField;
1785 if (pValue->Name ==
"AnchoredTextOverflowLegacy")
1788 if (pValue->Value >>= bBool)
1790 mpImpl->mbAnchoredTextOverflowLegacy = bBool;
1793 else if (pValue->Name ==
"ConnectorUseSnapRect")
1796 if (pValue->Value >>= bBool)
1798 mpImpl->mbConnectorUseSnapRect = bBool;
1801 else if (pValue->Name ==
"LegacySingleLineFontwork")
1804 if (pValue->Value >>= bBool)
1806 mpImpl->mbLegacySingleLineFontwork = bBool;
1820 pShape->InvalidateRenderGeometry();
1827 else if (pValue->Name ==
"IgnoreBreakAfterMultilineField")
1830 if (pValue->Value >>= bBool)
1832 mpImpl->mbIgnoreBreakAfterMultilineField = bBool;
1839 std::vector< std::pair< OUString, uno::Any > > aUserData
1847 const sal_Int32 nOldLength = rValues.getLength();
1848 rValues.realloc(nOldLength + aUserData.size());
1850 beans::PropertyValue* pValue = &(rValues.getArray()[nOldLength]);
1852 for (
const auto &aIter : aUserData)
1854 pValue->Name = aIter.first;
1855 pValue->
Value = aIter.second;
1862 return nPgNum <
maPages.size() ?
maPages[nPgNum].get() :
nullptr;
1867 return nPgNum <
maPages.size() ?
maPages[nPgNum].get() :
nullptr;
1872 return sal_uInt16(
maPages.size());
1907 mpImpl->mpUndoManager = pUndoManager;
1912 return mpImpl->mpUndoManager;
1917 if( !
mpImpl->mpUndoFactory )
1919 return *
mpImpl->mpUndoFactory;
1924 if( pUndoFactory && (pUndoFactory !=
mpImpl->mpUndoFactory) )
1926 delete mpImpl->mpUndoFactory;
1927 mpImpl->mpUndoFactory = pUndoFactory;
1933 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"SdrModel"));
1934 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST(
"ptr"),
"%p",
this);
1936 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"maMasterPages"));
1941 pPage->dumpAsXml(pWriter);
1944 (void)xmlTextWriterEndElement(pWriter);
1946 (void)xmlTextWriterStartElement(pWriter, BAD_CAST(
"maPages"));
1951 pPage->dumpAsXml(pWriter);
1954 (void)xmlTextWriterEndElement(pWriter);
1958 mpImpl->mpTheme->dumpAsXml(pWriter);
1961 (void)xmlTextWriterEndElement(pWriter);
1967 return theSdrModelUnoTunnelImplementationId.
getSeq();
1983 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 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::shared_ptr< model::Theme > const & getTheme() const
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
void setTheme(std::shared_ptr< model::Theme > const &pTheme)
virtual void dumpAsXml(xmlTextWriterPtr pWriter) 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)
std::shared_ptr< model::Theme > mpTheme
bool mbLegacySingleLineFontwork
SdrUndoFactory * mpUndoFactory
SfxUndoManager * mpUndoManager
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.
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)