32#include <com/sun/star/beans/XPropertySet.hpp>
34#include <osl/diagnose.h>
42 sal_Int16 getPageNumber(
const uno::Reference< drawing::XDrawPage >& rxDrawPage)
45 uno::Reference< beans::XPropertySet > xSet(rxDrawPage, uno::UNO_QUERY);
51 const uno::Any aNumber(xSet->getPropertyValue(
"Number"));
54 catch(
const uno::Exception&)
63 sal_Int16
getPageCount(
const uno::Reference< drawing::XDrawPage >& rxDrawPage)
78 nRetval = (
static_cast<sal_Int16
>(nPageCount) - 1) / 2;
100 : mxSdrText(const_cast<
SdrText* >(pSdrText)),
101 maOutlinerParaObject(
std::move(aOutlinerParaObject)),
104 mbContainsPageField(false),
105 mbContainsPageCountField(false),
106 mbContainsOtherFields(false)
122 if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
140 uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage;
141 bool bCurrentlyVisualizingPageIsSet(
false);
142 Color aNewTextBackgroundColor;
143 bool bNewTextBackgroundColorIsSet(
false);
144 sal_Int16 nCurrentlyValidPageNumber(0);
145 sal_Int16 nCurrentlyValidPageCount(0);
149 bool bDoDelete(
false);
156 bCurrentlyVisualizingPageIsSet =
true;
166 nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage);
177 nCurrentlyValidPageCount =
getPageCount(xCurrentlyVisualizingPage);
191 bNewTextBackgroundColorIsSet =
true;
214 nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage);
219 nCurrentlyValidPageCount =
getPageCount(xCurrentlyVisualizingPage);
222 if(!bNewTextBackgroundColorIsSet &&
getSdrText())
255 maUnitPolyPolygon(
std::move(aUnitPolyPolygon)),
256 maObjectTransform(
std::move(aObjectTransform))
262 if(SdrTextPrimitive2D::operator==(rPrimitive))
304 maPathPolyPolygon(
std::move(aPathPolyPolygon)),
305 maSdrFormTextAttribute(
std::move(aSdrFormTextAttribute))
311 if(SdrTextPrimitive2D::operator==(rPrimitive))
330 std::move(aNewPolyPolygon),
356 bool bFixedCellHeight,
361 maTextRangeTransform(
std::move(aTextRangeTransform)),
362 maSdrTextHorzAdjust(aSdrTextHorzAdjust),
363 maSdrTextVertAdjust(aSdrTextVertAdjust),
364 mbFixedCellHeight(bFixedCellHeight),
365 mbUnlimitedPage(bUnlimitedPage),
366 mbCellText(bCellText),
367 mbWordWrap(bWordWrap)
373 if(SdrTextPrimitive2D::operator==(rPrimitive))
425 maTextRangeTransform(
std::move(aTextRangeTransform)),
426 mbWordWrap(bWordWrap)
432 if(SdrTextPrimitive2D::operator==(rPrimitive))
462 maTextRangeTransform(
std::move(aTextRangeTransform))
475 if(SdrTextPrimitive2D::operator==(rPrimitive))
509 bool bFixedCellHeight)
511 maTextRangeTransform(
std::move(aTextRangeTransform)),
512 mbFixedCellHeight(bFixedCellHeight)
518 if(SdrTextPrimitive2D::operator==(rPrimitive))
virtual bool HasField(sal_Int32 nType=css::text::textfield::Type::UNSPECIFIED) const=0
bool isWrongListEqual(const OutlinerParaObject &rCompare) const
const EditTextObject & GetTextObject() const
Color const & GetBackgroundColor() const
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
sal_uInt16 getHandoutPageCount() const
sal_uInt16 GetPageCount() const
SdrModel & getSdrModelFromSdrObject() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
sal_uInt16 GetPageNum() const
bool IsMasterPage() const
SdrModel & getSdrModelFromSdrPage() const
void impDecomposeContourTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrContourTextPrimitive2D &rSdrContourTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
void impDecomposeBlockTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrBlockTextPrimitive2D &rSdrBlockTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
void impDecomposePathTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrPathTextPrimitive2D &rSdrPathTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
void impDecomposeStretchTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrStretchTextPrimitive2D &rSdrStretchTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
void impDecomposeChainedTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrChainedTextPrimitive2D &rSdrChainedTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
void impDecomposeAutoFitTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D &rSdrAutofitTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
SdrTextObj & GetObject() const
static constexpr auto CLASS_ID
static constexpr auto CLASS_ID
static constexpr auto CLASS_ID
static constexpr auto CLASS_ID
void transform(const basegfx::B2DHomMatrix &rMatrix)
const Primitive2DContainer & getBuffered2DDecomposition() const
void setBuffered2DDecomposition(Primitive2DContainer &&rNew)
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
virtual sal_uInt32 getPrimitive2DID() const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const ::basegfx::B2DHomMatrix &rTransform) const override
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
const basegfx::B2DHomMatrix & getTextRangeTransform() const
SdrAutoFitTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, ::basegfx::B2DHomMatrix aTextRangeTransform, bool bWordWrap)
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
const basegfx::B2DHomMatrix & getTextRangeTransform() const
bool isFixedCellHeight() const
SdrTextHorzAdjust getSdrTextHorzAdjust() const
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual sal_uInt32 getPrimitive2DID() const override
SdrTextVertAdjust getSdrTextVertAdjust() const
SdrBlockTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DHomMatrix aTextRangeTransform, SdrTextHorzAdjust aSdrTextHorzAdjust, SdrTextVertAdjust aSdrTextVertAdjust, bool bFixedCellHeight, bool bUnlimitedPage, bool bCellText, bool bWordWrap)
bool getUnlimitedPage() const
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual sal_uInt32 getPrimitive2DID() const override
SdrChainedTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtrs, ::basegfx::B2DHomMatrix aTextRangeTransform)
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
const basegfx::B2DHomMatrix & getTextRangeTransform() const
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
const basegfx::B2DPolyPolygon & getUnitPolyPolygon() const
virtual sal_uInt32 getPrimitive2DID() const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
SdrContourTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DPolyPolygon aUnitPolyPolygon, basegfx::B2DHomMatrix aObjectTransform)
const basegfx::B2DHomMatrix & getObjectTransform() const
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
const basegfx::B2DPolyPolygon & getPathPolyPolygon() const
const attribute::SdrFormTextAttribute & getSdrFormTextAttribute() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual sal_uInt32 getPrimitive2DID() const override
SdrPathTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DPolyPolygon aPathPolyPolygon, attribute::SdrFormTextAttribute aSdrFormTextAttribute)
bool isFixedCellHeight() const
virtual sal_uInt32 getPrimitive2DID() const override
SdrStretchTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, basegfx::B2DHomMatrix aTextRangeTransform, bool bFixedCellHeight)
const basegfx::B2DHomMatrix & getTextRangeTransform() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
virtual rtl::Reference< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
const OutlinerParaObject & getOutlinerParaObject() const
sal_Int16 mnLastPageCount
sal_Int16 mnLastPageNumber
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
const OutlinerParaObject maOutlinerParaObject
bool mbContainsPageCountField
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
const SdrText * getSdrText() const
static void encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer &rContainer, Primitive2DContainer &&aCandidate)
bool mbContainsOtherFields
SdrTextPrimitive2D(const SdrText *pSdrText, OutlinerParaObject aOutlinerParaObjectPtr)
::unotools::WeakReference< SdrText > mxSdrText
Color maLastTextBackgroundColor
css::uno::Reference< css::drawing::XDrawPage > mxLastVisualizingPage
sal_Int32 getPageCount(const uno::Reference< frame::XModel > &xModel)
#define PRIMITIVE2D_ID_SDRSTRETCHTEXTPRIMITIVE2D
#define PRIMITIVE2D_ID_SDRBLOCKTEXTPRIMITIVE2D
#define PRIMITIVE2D_ID_SDRPATHTEXTPRIMITIVE2D
#define PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D
#define PRIMITIVE2D_ID_SDRCONTOURTEXTPRIMITIVE2D
#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D
SdrPage * GetSdrPageFromXDrawPage(const uno::Reference< drawing::XDrawPage > &xDrawPage) noexcept
returns the SdrObject from the given StarOffice API wrapper