30#include <osl/diagnose.h>
62#include <com/sun/star/embed/XEmbeddedObject.hpp>
79 aFrameSize.
SetSize( aPhysSize );
90 sal_Int32 nMinTop, nMinBottom, nMinLeft, nMinRight;
110 aUL.
SetUpper( o3tl::narrowing<sal_uInt16>(nMinTop) );
111 aUL.
SetLower( o3tl::narrowing<sal_uInt16>(nMinBottom) );
133 const bool bPage =
true )
139 sal_uInt16
const aIdArr[] = {
156 for( sal_uInt16
n = 0; aIdArr[
n ];
n += 2 )
158 for( sal_uInt16
nId = aIdArr[
n ];
nId <= aIdArr[
n+1]; ++
nId )
165 bool bExecuteId(
true);
235 return getFrameFormat(
const_cast<SwPageDesc&
>(rDesc), bLeft, bFirst);
241 assert(bLeft || bFirst);
242 SwFrameFormat& rDescFrameFormat = getFrameFormat(rDesc, bLeft, bFirst);
275 const SwFrameFormat& rChgedFrameFormat = getConstFrameFormat(rChged, bLeft, bFirst);
292 bFirst ?
"First header" :
"Left header",
319 assert(bLeft || bFirst);
320 SwFrameFormat& rDescFrameFormat = getFrameFormat(rDesc, bLeft, bFirst);
352 const SwFrameFormat& rChgedFrameFormat = getConstFrameFormat(rChged, bLeft, bFirst);
369 bFirst ?
"First footer" :
"Left footer",
464 pFormat->Remove(pToRemove);
499 if (rDescMasterHeaderFormat.GetHeaderFormat() && rDescMasterHeaderFormat != rChgedMasterHeaderFormat)
500 lDelHFFormat(&rDescMasterHeaderFormat, rDescMasterHeaderFormat.GetHeaderFormat());
501 else if (rDescLeftHeaderFormat.GetHeaderFormat() && rDescLeftHeaderFormat != rChgedLeftHeaderFormat)
502 lDelHFFormat(&rDescLeftHeaderFormat, rDescLeftHeaderFormat.GetHeaderFormat());
503 else if (rDescFirstLeftHeaderFormat.GetHeaderFormat() && rDescFirstLeftHeaderFormat != rChgedFirstLeftHeaderFormat)
504 lDelHFFormat(&rDescFirstLeftHeaderFormat, rDescFirstLeftHeaderFormat.GetHeaderFormat());
506 else if (rDescMasterFooterFormat.GetFooterFormat() && rDescMasterFooterFormat != rChgedMasterFooterFormat)
507 lDelHFFormat(&rDescMasterFooterFormat, rDescMasterFooterFormat.GetFooterFormat());
508 else if (rDescLeftFooterFormat.GetFooterFormat() && rDescLeftFooterFormat != rChgedLeftFooterFormat)
509 lDelHFFormat(&rDescLeftFooterFormat, rDescLeftFooterFormat.GetFooterFormat());
510 else if (rDescFirstLeftFooterFormat.GetFooterFormat() && rDescFirstLeftFooterFormat != rChgedFirstLeftFooterFormat)
511 lDelHFFormat(&rDescFirstLeftFooterFormat, rDescFirstLeftFooterFormat.GetFooterFormat());
562 CopyMasterHeader(rChged, pStashedFirstMasterFormat ? pStashedFirstMasterFormat->
GetHeader() : rMasterHead, rDesc,
false,
true);
563 CopyMasterHeader(rChged, pStashedFirstLeftFormat ? pStashedFirstLeftFormat->
GetHeader() : rMasterHead, rDesc,
true,
true);
565 if (pStashedLeftFormat)
568 if (pStashedFirstMasterFormat)
571 if (pStashedFirstLeftFormat)
586 CopyMasterFooter(rChged, pStashedFirstMasterFoot ? pStashedFirstMasterFoot->
GetFooter() : rMasterFoot, rDesc,
false,
true);
589 if (pStashedLeftFormat)
592 if (pStashedFirstMasterFoot)
595 if (pStashedFirstLeftFoot)
610 bool bFollow =
false;
633 if ( (bUseOn || bFollow) && pTmpRoot)
637 aLayout->AllCheckPageDescs();
651 rDesc.
GetMaster().CallSwClientNotify(aHint);
652 rDesc.
GetLeft().CallSwClientNotify(aHint);
665 pBindings->
Invalidate( SID_ATTR_PAGE_ULSPACE );
666 pBindings->
Invalidate( SID_ATTR_PAGE_LRSPACE );
687 pDel->CallSwClientNotify( aHint );
696 aLayout->CheckFootnotePageDescs(
false);
705 aLayout->CheckFootnotePageDescs(
true);
711 if (pPageDesc->GetFollow() == pDel)
713 pPageDesc->SetFollow(
nullptr);
717 aLayout->AllCheckPageDescs();
734 if (pBase !=
nullptr)
743 OSL_ENSURE(
i != 0,
"You cannot delete the default Pagedesc.");
751 SfxHintId::StyleSheetErased);
756 std::make_unique<SwUndoPageDescDelete>(rDel,
this));
766 bool bRegardLanguage,
bool bBroadcast)
788 : SvxFrameDirection::Horizontal_LR_TB;
797 SAL_WARN_IF(!res.second,
"sw",
"MakePageDesc called with existing name" );
801 SfxHintId::StyleSheetCreated);
821 if(
auto pFEShell =
dynamic_cast<SwFEShell*
>( &rShell))
854 for( SwOLENodes::size_type
i = 0;
i < pNodes->size(); ++
i )
874 for ( std::vector<SvGlobalName>::size_type j = 0;
878 bFound = (*pGlobalOLEExcludeList)[j] ==
aName;
903 mbOLEPrtNotifyPending = mbAllOLENotify =
false;
910 0, pNodes->size(), GetDocShell());
911 getIDocumentLayoutAccess().GetCurrentLayout()->StartAllAction();
913 for( SwOLENodes::size_type
i = 0;
i < pNodes->size(); ++
i )
927 getIDocumentLayoutAccess().GetCurrentLayout()->EndAllAction();
932 size_t *pPos,
const OUString &rName )
936 if( it != pPageDescs->
end() )
940 *pPos = std::distance( pPageDescs->
begin(), it );
954 if( pDesc ==
nullptr )
966 SAL_WARN_IF( desc != pDesc,
"sw",
"SwPageDescs container is broken!" );
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual SwFieldType * GetSysFieldType(const SwFieldIds eWhich) const =0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual bool HasLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void SetModified()=0
Must be called manually at changes of format.
void Invalidate(sal_uInt16 nId)
void Broadcast(const SfxHint &rHint)
SfxBindings * GetBindings() const
SfxDispatcher * GetDispatcher() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All)
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
SvxNumType GetNumberingType() const
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetSize(const Size &rSize)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
const SwModify * GetRegisteredIn() const
static std::unique_ptr< SwOLENodes > CreateOLENodesArray(const SwFormatColl &rColl, bool bOnlyWithInvalidSize)
void UpdateAttr(const SwUpdateAttr &)
void ParkCursor(const SwNode &rIdx)
Remove selections and additional cursors of all shells.
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
void CheckDefaultPageFormat()
The html import sometimes overwrites the page sizes set in the page descriptions.
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
bool ContainsPageDesc(const SwPageDesc *pDesc, size_t *pPos) const
void BroadcastStyleOperation(const OUString &rName, SfxStyleFamily eFamily, SfxHintId nOp)
IDocumentState const & getIDocumentState() const
void PreDelPageDesc(SwPageDesc const *pDel)
All descriptors whose Follow point to the to-be-deleted have to be adapted.
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
const SwGrfFormatColl * GetDfltGrfFormatColl() const
size_t GetPageDescCnt() const
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
void PrtOLENotify(bool bAll)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
std::unique_ptr< SwFootnoteInfo > mpFootnoteInfo
SwPageDesc * MakePageDesc(const OUString &rName, const SwPageDesc *pCpy=nullptr, bool bRegardLanguage=true, bool bBroadcast=false)
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwFootnoteIdxs & GetFootnoteIdxs()
const SfxPoolItem & GetDefault(sal_uInt16 nFormatHint) const
Get the default attribute in this document.
void CopyMasterFooter(const SwPageDesc &rChged, const SwFormatFooter &rFoot, SwPageDesc &pDesc, bool bLeft, bool bFirst)
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
bool IsSquaredPageMode() const
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
const SwAttrPool & GetAttrPool() const
void SetDefaultPageMode(bool bSquaredPageMode)
std::unique_ptr< SwEndNoteInfo > mpEndNoteInfo
const SwFrameFormat * GetDfltFrameFormat() const
void DelPageDesc(const OUString &rName, bool bBroadcast=false)
SwDocShell * GetDocShell()
bool mbOLEPrtNotifyPending
TRUE: Printer has changed.
const SwPageDesc & GetPageDesc(const size_t i) const
void CopyMasterHeader(const SwPageDesc &rChged, const SwFormatHeader &rHead, SwPageDesc &pDesc, bool bLeft, bool bFirst)
virtual void UpdateFields()
Content, content of frame (header, footer, fly).
void SetNewContentIdx(const SwNodeIndex *pIdx)
const SwNodeIndex * GetContentIdx() const
Marks a node in the document model.
Base class of the Writer document model elements.
bool IsContentNode() const
SwNodeOffset EndOfSectionIndex() const
const SwEndNode * EndOfSectionNode() const
static SwStartNode * MakeEmptySection(SwNode &rWhere, SwStartNodeType=SwNormalStartNode)
Create an empty section of Start- and EndNote.
void Copy_(const SwNodeRange &rRg, SwNode &rInsPos, bool bNewFrames=true) const
const SwOLEObj & GetOLEObj() const
void SetOLESizeInvalid(bool b)
svt::EmbeddedObjectRef & GetObject()
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
PaM is Point and Mark: a selection of the document model.
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
void ChgFooterShare(bool bNew)
void StashFrameFormat(const SwFrameFormat &rFormat, bool bHeader, bool bLeft, bool bFirst)
Remember original header/footer formats even when they are hidden by "sharing".
const OUString & GetName() const
void SetPoolHlpFileId(sal_uInt8 const nId)
void SetFollow(const SwPageDesc *pNew)
SwFrameFormat & GetMaster()
bool IsHeaderShared() const
const SvxNumberType & GetNumType() const
void ChgHeaderShare(bool bNew)
bool IsFirstShared() const
bool IsFooterShared() const
SwFrameFormat & GetFirstLeft()
SwFrameFormat & GetFirstMaster()
void SetPoolFormatId(sal_uInt16 const nId)
void SetPoolHelpId(sal_uInt16 const nId)
bool GetLandscape() const
bool HasStashedFormat(bool bHeader, bool bLeft, bool bFirst)
Checks if the pagedescriptor has a stashed format according to the parameters or not.
UseOnPage GetUseOn() const
void SetNumType(const SvxNumberType &rNew)
bool SetName(const OUString &rNewName)
void SetFootnoteInfo(const SwPageFootnoteInfo &rNew)
SwFrameFormat & GetLeft()
void ChgFirstShare(bool bNew)
const SwPageDesc * GetFollow() const
const SwPageFootnoteInfo & GetFootnoteInfo() const
void RemoveStashedFormat(bool bHeader, bool bLeft, bool bFirst)
Gives the feature of removing the stashed format by hand if it is necessary.
void SetRegisterFormatColl(const SwTextFormatColl *rFormat)
set the style for the grid alignment
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
void SetLandscape(bool bNew)
const SwFrameFormat * GetStashedFrameFormat(bool bHeader, bool bLeft, bool bFirst) const
Used to restore hidden header/footer formats.
const SwTextFormatColl * GetRegisterFormatColl() const
retrieve the style for the grid alignment
std::pair< const_iterator, bool > push_back(const value_type &x)
const_iterator begin() const
void erase(const value_type &x)
const_iterator end() const
ByPos::const_iterator const_iterator
const_iterator find(const OUString &name) const
bool contains(const value_type &x) const
The root element of a Writer document layout.
void StartAllAction()
Set up Start-/EndAction for all Shells on an as high as possible (Shell section) level.
Starts a section of nodes in the document model.
const SwFormatFootnote & GetFootnote() const
void SwitchPaperMode(bool bNew)
void SetSquaredMode(bool bNew)
bool IsSquaredMode() const
std::vector< Value >::size_type size_type
void CopyFlyInFlyImpl(const SwNodeRange &rRg, SwPaM const *const pCopiedPaM, SwNode &rStartIdx, const bool bCopyFlyAtFly=false, SwCopyFlags flags=SwCopyFlags::Default) const
ring_container GetRingContainer()
#define SID_ATTR_PAGE_COLUMN
static void lcl_DescSetAttr(const SwFrameFormat &rSource, SwFrameFormat &rDest, const bool bPage=true)
static void lcl_DefaultPageFormat(sal_uInt16 nPoolFormatId, SwFrameFormat &rFormat1, SwFrameFormat &rFormat2, SwFrameFormat &rFormat3, SwFrameFormat &rFormat4)
IMPL_LINK_NOARG(SwDoc, DoUpdateModifiedOLE, Timer *, void)
static SwPageDesc * lcl_FindPageDesc(const SwPageDescs *pPageDescs, size_t *pPos, const OUString &rName)
@ Fixed
Frame cannot be moved in Var-direction.
constexpr TypedWhichId< SvxFrameDirectionItem > RES_FRAMEDIR(126)
constexpr TypedWhichId< SwFormatHeader > RES_HEADER(102)
constexpr TypedWhichId< SwFormatFrameSize > RES_FRM_SIZE(89)
constexpr TypedWhichId< SwFormatCol > RES_COL(115)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SfxBoolItem > RES_RTL_GUTTER(139)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SwTextGridItem > RES_TEXTGRID(121)
constexpr TypedWhichId< SwHeaderAndFooterEatSpacingItem > RES_HEADER_FOOTER_EAT_SPACING(127)
constexpr TypedWhichId< SwFormatFooter > RES_FOOTER(103)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr TypedWhichId< SfxBoolItem > RES_BACKGROUND_FULL_SIZE(138)
std::vector< SvGlobalName > * pGlobalOLEExcludeList
LanguageType GetAppLanguage()
#define SAL_WARN_IF(condition, area, stream)
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
void EndProgress(SwDocShell const *pDocShell)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
constexpr auto toTwips(N number, Length from)
void CopyBookmarks(const SwPaM &rPam, const SwPosition &rCpyPam, SwCopyFlags flags)
const LocaleDataWrapper & GetLocaleData()
SvxFrameDirection GetDefaultFrameDirection(LanguageType nLanguage)
Return the AutoCollection by its Id.
Marks a position in the document model.
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)