/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
class SwLayoutFrame; class SwFont; class SwFormatAnchor; class SwViewShell; class SwPageFrame; class SwFlyFrame; class SwContentFrame; class SwRootFrame; class SwDoc; class SdrObject; class SvxBrushItem; class SdrMarkList; class GraphicObject; class GraphicAttr; class SwPageDesc; class SwRegionRects; class SwTextNode; namespace basegfx::utils { class B2DClipState; }
#define FAR_AWAY (SAL_MAX_INT32 - 20000) // initial position of a Fly
constexpr tools::Long BROWSE_HEIGHT = 56700 * 10; // 10 Meters #define GRFNUM_NO 0 #define GRFNUM_YES 1 #define GRFNUM_REPLACE 2
// MM02 new VOC and primitive-based version void paintGraphicUsingPrimitivesHelper(
vcl::RenderContext & rOutputDevice,
drawinglayer::primitive2d::Primitive2DContainer& rContent, const basegfx::B2DHomMatrix& rGraphicTransform, const OUString& rName, const OUString& rTitle, const OUString& rDescription);
// method to align rectangle. // Created declaration here to avoid <extern> declarations void SwAlignRect( SwRect &rRect, const SwViewShell *pSh, const vcl::RenderContext* pRenderContext );
// method to align graphic rectangle // Created declaration here to avoid <extern> declarations void SwAlignGrfRect( SwRect *pGrfRect, const vcl::RenderContext &rOut );
/** * Paint border around a run of characters using frame painting code. * * @param[in] rFont font object of actual text, which specify the border * @param[in] rPaintArea rectangle area in which line portion takes place * @param[in] bVerticalLayout corresponding text frame verticality * @param[in] bVerticalLayoutLRBT corresponding text frame verticality (LRBT subset) * @param[in] bJoinWithPrev leave border with which actual border joins to the previous portion * @param[in] bJoinWithNext leave border with which actual border joins to the next portion
**/ void PaintCharacterBorder(const SwFont& rFont, const SwRect& rPaintArea, constbool bVerticalLayout, constbool bVerticalLayoutLRBT, constbool bJoinWithPrev, constbool bJoinWithNext);
// get Fly, if no List is given use the current shell // Implementation in feshview.cxx
SwFlyFrame *GetFlyFromMarked( const SdrMarkList *pLst, SwViewShell *pSh );
/** @see SwContentNode::getLayoutFrame() @param pPos Document model position; for a text frame, the returned frame will be one containing this position. @param pViewPosAndCalcFrame First is a point in the document view; the returned frame will be the one with the minimal distance to this point. To get the first frame in the document, pass in a default-initialized Point with coordinates 0,0. Second indicates whether the frames should be formatted before retrieving their position for the test; this cannot be done by every caller so use with care!
*/
SwFrame* GetFrameOfModify( const SwRootFrame* pLayout,
sw::BroadcastingModify const&,
SwFrameType const nFrameType, const SwPosition *pPos = nullptr,
std::pair<Point, bool> const* pViewPosAndCalcFrame = nullptr);
// Should extra data (redline stroke, line numbers) be painted? bool IsExtraData( const SwDoc &rDoc );
// Notify classes memorize the current sizes in their constructor and do // the necessary notifications in their destructor if needed class SwFrameNotify
{ private: void ImplDestroy();
// SwBorderAttrs encapsulates the calculation for margin attributes including // border. The whole class is cached.
// WARNING! If more attributes should be cached also adjust the method // Modify::Modify! class SwBorderAttrs final : public SwCacheObj
{ const SwAttrSet &m_rAttrSet; const SvxULSpaceItem &m_rUL;
std::unique_ptr<SvxFirstLineIndentItem> m_pFirstLineIndent;
std::unique_ptr<SvxTextLeftMarginItem> m_pTextLeftMargin;
std::unique_ptr<SvxRightMarginItem> m_pRightMargin;
std::shared_ptr<SvxLRSpaceItem> m_xLR; const SvxBoxItem &m_rBox; const SvxShadowItem &m_rShadow; const Size m_aFrameSize;
// the following bool values set the cached values to INVALID - until they // are calculated for the first time bool m_bTopLine : 1; bool m_bBottomLine : 1; bool m_bLeftLine : 1; bool m_bRightLine : 1; bool m_bTop : 1; bool m_bBottom : 1; bool m_bLine : 1; bool m_bLineSpacing : 1;
bool m_bIsLine : 1; // border on at least one side?
bool m_bCacheGetLine : 1; // cache GetTopLine(), GetBottomLine()? bool m_bCachedGetTopLine : 1; // is GetTopLine() cached? bool m_bCachedGetBottomLine : 1; // is GetBottomLine() cached? // Booleans indicate that <m_bJoinedWithPrev> and <m_bJoinedWithNext> are // cached and valid. // Caching depends on value of <m_bCacheGetLine>. mutablebool m_bCachedJoinedWithPrev : 1; mutablebool m_bCachedJoinedWithNext : 1; // Booleans indicate that borders are joined with previous/next frame. mutablebool m_bJoinedWithPrev :1; mutablebool m_bJoinedWithNext :1;
// The cached values (un-defined until calculated for the first time)
sal_uInt16 m_nTopLine,
m_nBottomLine,
m_nLeftLine,
m_nRightLine,
m_nTop,
m_nBottom,
m_nGetTopLine,
m_nGetBottomLine,
m_nLineSpacing;
// only calculate lines and shadow void CalcTopLine_(); void CalcBottomLine_(); void CalcLeftLine_(); void CalcRightLine_();
// #i25029# - If <_pPrevFrame> is set, its value is taken for testing, if // borders/shadow have to be joined with previous frame. void GetTopLine_ ( const SwFrame& _rFrame, const SwFrame* _pPrevFrame ); void GetBottomLine_( const SwFrame& _rFrame );
// calculate cached values <m_bJoinedWithPrev> and <m_bJoinedWithNext> // #i25029# - If <_pPrevFrame> is set, its value is taken for testing, if // borders/shadow have to be joined with previous frame. void CalcJoinedWithPrev( const SwFrame& _rFrame, const SwFrame* _pPrevFrame ) const; void CalcJoinedWithNext( const SwFrame& _rFrame ) const;
// internal helper method for CalcJoinedWithPrev and CalcJoinedWithNext bool JoinWithCmp( const SwFrame& _rCallerFrame, const SwFrame& _rCmpFrame ) const;
// Are the left and right line and the LRSpace equal? bool CmpLeftRight( const SwBorderAttrs &rCmpAttrs, const SwFrame *pCaller, const SwFrame *pCmp ) const;
// tdf#125300 line spacing before cell border void CalcLineSpacing_();
// Should upper (or lower) border be evaluated for this frame? // #i25029# - If <_pPrevFrame> is set, its value is taken for testing, if // borders/shadow have to be joined with previous frame. inline sal_uInt16 GetTopLine ( const SwFrame& _rFrame, const SwFrame* _pPrevFrame = nullptr ) const; inline sal_uInt16 GetBottomLine( const SwFrame& _rFrame ) const; inlinevoid SetGetCacheLine( bool bNew ) const;
// Accessors for cached values <m_bJoinedWithPrev> and <m_bJoinedWithNext> // #i25029# - If <_pPrevFrame> is set, its value is taken for testing, if // borders/shadow have to be joined with previous frame. bool JoinedWithPrev( const SwFrame& _rFrame, const SwFrame* _pPrevFrame = nullptr ) const; bool JoinedWithNext( const SwFrame& _rFrame ) const;
};
class SwBorderAttrAccess final : public SwCacheAccess
{ const SwFrame *m_pConstructor; //opt: for passing on to SwBorderAttrs
// Iterator for draw objects of a page. The objects will be iterated sorted by // their Z-order. Iterating is not cheap since for each operation the _whole_ // SortArray needs to be traversed. class SwOrderIter
{ const SwPageFrame *m_pPage; const SdrObject *m_pCurrent;
/** method to determine the spacing values of a frame
#i28701# Values only provided for flow frames (table, section or text frames) Note: line spacing value is only determined for text frames #i102458# Add output parameter <obIsLineSpacingProportional>
@param rFrame input parameter - frame, for which the spacing values are determined.
@param onPrevLowerSpacing output parameter - lower spacing of the frame in SwTwips
@param onPrevLineSpacing output parameter - line spacing of the frame in SwTwips
@param obIsLineSpacingProportional
@param bIdenticalStyles true if the styles of the actual and the next paragraphs (text-frames) are the same
*/ void GetSpacingValuesOfFrame( const SwFrame& rFrame,
SwTwips& onLowerSpacing,
SwTwips& onLineSpacing, bool& obIsLineSpacingProportional, bool bIdenticalStyles );
/** method to get the content of the table cell
Content from any nested tables will be omitted. Note: line spacing value is only determined for text frames
@param rCell_ input parameter - the cell which should be searched for content.
/** helper class to check if a frame has been deleted during an operation * WARNING! This should only be used as a last and desperate means to make the * code robust.
*/
class SwDeletionChecker
{ private: const SwFrame* mpFrame; const sw::BroadcastingModify* mpRegIn;
public:
SwDeletionChecker(const SwFrame* pFrame);
/** * return * true if mpFrame != 0 and mpFrame is not client of pRegIn * false otherwise
*/ bool HasBeenDeleted() const;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.