21#include <osl/diagnose.h>
42 m_bAutomaticContour( false ),
43 m_bContourMapModeValid( true ),
44 m_bPixelContour( false )
59 OSL_ENSURE( !
mpAttrSet,
"AttrSet is already set" );
67 aNewAttrSet.
Put( aFormatColl );
98 OSL_ENSURE( !
m_pContour,
"Contour available." );
110 bool bPixelGrf = aGrfMap.
GetMapUnit() == MapUnit::MapPixel;
111 const MapMode aContourMap( bPixelGrf ? MapUnit::MapPixel : MapUnit::Map100thMM );
114 double nGrfDPIx = 0.0;
115 double nGrfDPIy = 0.0;
124 OSL_ENSURE( !bPixelGrf || aGrfMap == aContourMap,
125 "scale factor for pixel unsupported" );
130 for( sal_uInt16 j=0; j<nPolyCount; j++ )
144 if ( nGrfDPIx != 0 && nGrfDPIy != 0 )
146 rPoly[
i] =
Point( rPoly[
i].getX() * pOutDev->
GetDPIX() / nGrfDPIx,
147 rPoly[
i].getY() * pOutDev->
GetDPIY() / nGrfDPIy );
166 OSL_ENSURE(
m_pContour,
"Contour not available." );
188 const MapMode aContourMap( MapUnit::Map100thMM );
189 OSL_ENSURE( aGrfMap.
GetMapUnit() != MapUnit::MapPixel ||
190 aGrfMap ==
MapMode( MapUnit::MapPixel ),
191 "scale factor for pixel unsupported" );
192 if( aGrfMap.
GetMapUnit() != MapUnit::MapPixel &&
193 aGrfMap != aContourMap )
195 sal_uInt16 nPolyCount = rContour.
Count();
196 for( sal_uInt16 j=0; j<nPolyCount; j++ )
219 bRet = aGrfMap.
GetMapUnit() == MapUnit::MapPixel;
234 aRet =
static_cast<const SwGrfNode*
>(
this)->GetGrf(
true);
238 OSL_ENSURE(
GetOLENode(),
"new type of Node?" );
239 aRet = *
const_cast<SwOLENode*
>(
static_cast<const SwOLENode*
>(
this))->SwOLENode::GetGraphic();
249 OSL_ENSURE( pFlyFormat,
"<SwNoTextNode::SetTitle(..)> - missing <SwFlyFrameFormat> instance" );
261 OSL_ENSURE( pFlyFormat,
"<SwNoTextNode::GetTitle(..)> - missing <SwFlyFrameFormat> instance" );
273 OSL_ENSURE( pFlyFormat,
"<SwNoTextNode::SetDescription(..)> - missing <SwFlyFrameFormat> instance" );
285 OSL_ENSURE( pFlyFormat,
"<SwNoTextNode::GetDescription(..)> - missing <SwFlyFrameFormat> instance" );
static OutputDevice * GetDefaultDevice()
basegfx::B2DSize GetPPI() const
virtual std::shared_ptr< SfxItemSet > getAutomaticStyle(const SfxItemSet &rSet, SwAutoStyleFamily eFamily, const OUString *pParentName=nullptr)=0
MapUnit GetMapUnit() const
SAL_DLLPRIVATE sal_Int32 GetDPIX() const
SAL_DLLPRIVATE sal_Int32 GetDPIY() const
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
void SetParent(const SfxItemSet *pNew)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
static tools::PolyPolygon CreateAutoContour(const Graphic &rGraphic, const tools::Rectangle *pRect=nullptr)
SwFormatColl * GetFormatColl() const
std::shared_ptr< const SfxItemSet > mpAttrSet
Attribute-set for all auto attributes of a ContentNode.
virtual bool SetAttr(const SfxPoolItem &)
made virtual
IStyleAccess & GetIStyleAccess()
SwNoTextNode(const SwNoTextNode &)=delete
void SetContour(const tools::PolyPolygon *pPoly, bool bAutomatic=false)
OUString GetDescription() const
void GetContour(tools::PolyPolygon &rPoly) const
void SetContourAPI(const tools::PolyPolygon *pPoly)
virtual bool SavePersistentData()
virtual bool RestorePersistentData()
Dummies for loading/saving of persistent data when working with graphics and OLE objects.
OUString GetTitle() const
bool GetContourAPI(tools::PolyPolygon &rPoly) const
const tools::PolyPolygon * HasContour() const
virtual ~SwNoTextNode() override
void SetTitle(const OUString &rTitle)
std::optional< tools::PolyPolygon > m_pContour
bool IsPixelContour() const
Graphic GetGraphic() const
bool m_bContourMapModeValid
virtual void NewAttrSet(SwAttrPool &) override
Creates an AttrSet for all derivations with ranges for frame- and graphics-attributes.
void SetDescription(const OUString &rDescription)
Base class of the Writer document model elements.
SwFrameFormat * GetFlyFormat() const
If node is in a fly return the respective format.
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
constexpr TypedWhichId< SfxStringItem > RES_FRMATR_STYLE_NAME(134)
WhichRangesContainer const aNoTextNodeSetRange(svl::Items< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_BEGIN, RES_GRFATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1 >)