24#include <osl/diagnose.h>
79 explicit SwDrawViewSave(
SdrView* pSdrView );
90 while ( pPt->
pSh != pNew && pPt->
pNext )
92 if ( pPt->
pSh == pNew )
142 while ( pPt && pPt->
pSh != pSh )
159 OSL_ENSURE( !pSh->
GetWin(),
"Print with window?" );
174 pOut->SetMapMode( aMapMode );
209 bool bNewOri = eOri != Orientation::Portrait;
211 for(
size_t i = 0;
i < nAll; ++
i )
250 for(
size_t i = 0;
i < nAll; ++
i )
286 for ( sal_uInt16
i = 1; pPage &&
i <= nMax; pPage = pPage->
GetNext(), ++
i )
308 assert(
dynamic_cast<const SwFEShell*
>(
this) &&
"SwViewShell::Prt for FEShell only");
322 if(
nullptr != pCpyItem )
334 pActCursor = pActCursor->
GetPrev();
350 pContentFrame->
GetCharRect( aCharRect, *pShellTableCursor->
Start(), &aTmpState );
354 else if (pFirstCursor)
360 OSL_ENSURE( pPage,
"no page found!" );
380 pFESh->
Copy(rPrtDoc);
395 if( pFirstCursor && pFirstCursor->
HasMark() )
420 for (sal_Int32
i = nPage; pPage && (
i > 0); --
i)
427 OSL_ENSURE(pPage,
"ERROR: SwPageFrame expected");
428 OSL_FAIL(
"non-existent page requested");
452 OSL_ENSURE( 0 <= nRenderer && nRenderer <= nMaxRenderer,
"nRenderer out of bounds");
453 if (!pOutDev || nMaxRenderer < 0 || nRenderer < 0 || nRenderer > nMaxRenderer)
462 ::std::optional<tools::Long> oOrigHeight;
470 std::unique_ptr<SwViewShell> pShell(
new SwViewShell(*
this,
nullptr, pOutDev));
472 SdrView *pDrawView = pShell->GetDrawView();
484 if(
mpOpt->IsReadonly() )
485 pShell->mpOpt->SetReadonly(
true );
488 SwDrawViewSave aDrawViewSave( pShell->GetDrawView() );
489 pShell->PrepareForPrint( rPrintData, bIsPDFExport );
492 OSL_ENSURE( nPage < 0 ||
494 "SwViewShell::PrintOrPDFExport: nPage not valid" );
501 OSL_ENSURE( pStPage,
"failed to get start page" );
511 pShell->InitPrt(pOutDev);
519 SwPostItMgr *pPostItManager = bHasPostItsToPrintInMargins ? pShell->GetPostItMgr() :
nullptr;
541 double fScale = 0.75;
557 bool bOutputForScreen )
561 std::unique_ptr<SwViewShell> pSh;
565 pSh.reset(
new SwViewShell( *pDoc,
nullptr, pOpt, &rRenderContext));
567 pSh->setOutputToWindow(bOutputForScreen);
571 pSh->PrepareForPrint( rOptions );
572 pSh->SetPrtFormatOption(
true );
575 pSh->maVisArea = aSwRect;
577 if ( pSh->GetViewOptions()->getBrowseMode() &&
578 pSh->GetRingContainer().size() == 1 )
580 pSh->InvalidateLayout(
false );
581 pSh->GetLayout()->Lower()->InvalidateSize();
592 pSh->GetLayout()->PaintSwFrame( rRenderContext, aSwRect );
594 rRenderContext.
Pop();
604 auto pFormatField =
dynamic_cast<const SwFormatField*
>(pItem);
607 const SwTextField* pTextField = pFormatField->GetTextField();
632SwDrawViewSave::SwDrawViewSave(
SdrView* pSdrView )
634 , bPrintControls(true)
638 bPrintControls = pDV->IsLayerPrintable(
"Controls" );
642SwDrawViewSave::~SwDrawViewSave()
646 pDV->SetLayerPrintable(
"Controls", bPrintControls );
constexpr auto convertTwipToMm100(N n)
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
virtual void LockExpFields()=0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
void SetOrigin(const Point &rOrigin)
void SetMapUnit(MapUnit eUnit)
const Point & GetOrigin() const
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
GDIMetaFile * GetConnectMetaFile() const
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
const MapMode & GetMapMode() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
void IntersectClipRegion(const tools::Rectangle &rRect)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
void SetBufferedOverlayAllowed(bool bNew)
void SetLayerPrintable(const OUString &rName, bool bPrn)
void SetBufferedOutputAllowed(bool bNew)
void SetLayerVisible(const OUString &rName, bool bShow)
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
void SetPoolDefaultItem(const SfxPoolItem &)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
tools::Long GetHeight() const
tools::Long GetWidth() const
void SetHeight(tools::Long n)
void SetSize(const Size &rSize)
void SetWidth(tools::Long n)
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual bool SetAttr(const SfxPoolItem &)
made virtual
SwShellCursor * GetCursor_()
const SwShellTableCursor * GetTableCursor() const
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId,...
SwPageDesc * FindPageDesc(const OUString &rName, size_t *pPos=nullptr) const
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
size_t GetPageDescCnt() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void ChgPageDesc(const OUString &rName, const SwPageDesc &)
const SwAttrPool & GetAttrPool() const
void ReplaceStyles(const SwDoc &rSource, bool bIncludePageStyles=true)
const SwPageDesc & GetPageDesc(const size_t i) const
void Copy(SwDoc &rClpDoc, const OUString *pNewClpText=nullptr)
Copy and Paste methods for internal clipboard.
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
virtual void Calc(vcl::RenderContext *pRenderContext) const
SwLayoutFrame * GetUpper()
virtual bool GetCharRect(SwRect &, const SwPosition &, SwCursorMoveState *=nullptr, bool bAllowFarAway=true) const
The usage of LayAction is always the same:
void Action(OutputDevice *pRenderContext)
void SetReschedule(bool bNew)
void SetWaitAllowed(bool bNew)
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
const SwFrame * Lower() const
Marks a node in the document model.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwStartNode * StartOfSectionNode() const
SwContentNode * GetContentNode()
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
SwContentNode * GoNext(SwNodeIndex *) const
const SwPosition * GetMark() const
SwContentNode * GetPointContentNode() const
SwContentNode * GetMarkContentNode() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
const OUString & GetName() const
SwFrameFormat & GetMaster()
bool GetLandscape() const
void SetLandscape(bool bNew)
A page of the document layout.
SwPageDesc * GetPageDesc()
static void Remove(SwViewShell const *pSh)
static void Add(SwViewShell *pSh, const SwRect &rNew)
static SwQueuedPaint * s_pPaintQueue
void DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage)
SwPostItMode GetPrintPostIts() const
bool m_bPrintPageBackground
const SwRenderData & GetRenderData() const
Note: in the context where this class is used the pointers should always be valid during the lifetime...
SwQueuedPaint(SwViewShell *pNew, const SwRect &rRect)
Of course Writer needs its own rectangles.
void Height(tools::Long nNew)
SwRect & Union(const SwRect &rRect)
void Top(const tools::Long nTop)
void Pos(const Point &rNew)
tools::Rectangle SVRect() const
void Left(const tools::Long nLeft)
std::unique_ptr< SwViewShell > m_pPostItShell
this contains a SwDoc with the post-it content
o3tl::sorted_vector< sal_Int32 > & GetValidPagesSet()
std::vector< sal_Int32 > & GetPagesToPrint()
used for 'normal' printing A page value of 0 as entry indicates that this page is not from the docume...
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.
const SwPageFrame * GetPageAtPos(const Point &rPt, const Size *pSize=nullptr, bool bExtend=false) const
Point rPt: The point that should be used to find the page Size pSize: If given, we return the (first)...
Represents the current text cursor of one opened edit window.
const Point & GetSttPos() const
SwShellCursor * GetNext()
SwShellCursor * GetPrev()
const SwTable & GetTable() const
SwTableFormat * GetFrameFormat()
SwTextNode & GetTextNode() const
SwTextNode is a paragraph in the document model.
void CopyCollFormat(SwTextNode &rDestNd, bool bUndoForChgFormatColl=true)
Copy collection with all auto formats to dest-node.
void SetFirstVisPageInvalid()
static void PrtOle2(SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData &rOptions, vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect, bool bOutputForScreen)
vcl::RenderContext * GetOut() const
VclPtr< vcl::Window > mpWin
= 0 during printing or pdf export
friend void SetSwVisArea(SwViewShell *pSh, const SwRect &)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
VclPtr< OutputDevice > mpOut
Window, Printer, VirtDev, ...
void ChgAllPageOrientation(Orientation eOri)
rtl::Reference< SwDoc > mxDoc
The document; never 0.
SwViewShell(SwViewShell &, vcl::Window *pWin, OutputDevice *pOut=nullptr, tools::Long nFlags=0)
CTor for further Shells on a document.
bool IsAnyFieldInDoc() const
Check if the DocNodesArray contains fields.
std::unique_ptr< SwViewOption > mpOpt
SwRootFrame * GetLayout() const
SwRect maVisArea
The modern version of VisArea.
vcl::Window * GetWin() const
const SwRect & VisArea() const
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
void ChgAllPageSize(Size const &rSz)
void FillPrtDoc(SwDoc &rPrtDoc, const SfxPrinter *pPrt)
sal_uInt16 mnStartAction
!= 0 if at least one Action is active.
bool PrintOrPDFExport(OutputDevice *pOutDev, SwPrintData const &rPrintData, sal_Int32 nRenderer, bool bIsPDFExport)
SAL_DLLPRIVATE void PrepareForPrint(const SwPrintData &rOptions, bool bIsPDFExport=false)
const SfxItemPool & GetAttrPool() const
void InitPrt(OutputDevice *pOutDev)
void CalcPagesForPrint(sal_uInt16 nMax)
size_type count(const Value &v) const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool sw_GetPostIts(const IDocumentFieldsAccess &rIDFA, SetGetExpFields *pSrtLst)
constexpr sal_uInt16 POOLATTR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_FIELD(RES_TXTATR_NOEND_BEGIN)
constexpr TypedWhichId< SwFormatField > RES_TXTATR_INPUTFIELD(55)
constexpr sal_uInt16 POOLATTR_END(RES_UNKNOWNATR_END)
Dialog to specify the properties of date form field.
bool IsShrinkPageForPostIts(SwViewShell const &rShell, SwPrintData const &)
SwNodeOffset abs(const SwNodeOffset &a)
SwPostItMode
this must match the definitions in css::text::NotePrintMode
#define VSHELLFLAG_SHARELAYOUT
void SetSwVisArea(SwViewShell *pSh, const SwRect &rRect)
SwPageFrame const * sw_getPage(SwRootFrame const &rLayout, sal_Int32 const nPage)