32 #include <com/sun/star/beans/XPropertySet.hpp>
40 sal_Int16 getPageNumber(
const uno::Reference< drawing::XDrawPage >& rxDrawPage)
43 uno::Reference< beans::XPropertySet > xSet(rxDrawPage, uno::UNO_QUERY);
49 const uno::Any aNumber(xSet->getPropertyValue(
"Number"));
52 catch(
const uno::Exception&)
61 sal_Int16
getPageCount(
const uno::Reference< drawing::XDrawPage >& rxDrawPage)
76 nRetval = (
static_cast<sal_Int16
>(nPageCount) - 1) / 2;
95 SdrTextPrimitive2D::SdrTextPrimitive2D(
99 mrSdrText(const_cast<
SdrText* >(pSdrText)),
100 maOutlinerParaObject(rOutlinerParaObject),
101 mxLastVisualizingPage(),
104 maLastTextBackgroundColor(),
105 mbContainsPageField(false),
106 mbContainsPageCountField(false),
107 mbContainsOtherFields(false)
123 if(BufferedDecompositionPrimitive2D::operator==(rPrimitive))
141 uno::Reference< drawing::XDrawPage > xCurrentlyVisualizingPage;
142 bool bCurrentlyVisualizingPageIsSet(
false);
143 Color aNewTextBackgroundColor;
144 bool bNewTextBackgroundColorIsSet(
false);
145 sal_Int16 nCurrentlyValidPageNumber(0);
146 sal_Int16 nCurrentlyValidPageCount(0);
150 bool bDoDelete(
false);
157 bCurrentlyVisualizingPageIsSet =
true;
167 nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage);
178 nCurrentlyValidPageCount =
getPageCount(xCurrentlyVisualizingPage);
192 bNewTextBackgroundColorIsSet =
true;
215 nCurrentlyValidPageNumber = getPageNumber(xCurrentlyVisualizingPage);
220 nCurrentlyValidPageCount =
getPageCount(xCurrentlyVisualizingPage);
223 if(!bNewTextBackgroundColorIsSet &&
getSdrText())
256 maUnitPolyPolygon(rUnitPolyPolygon),
257 maObjectTransform(rObjectTransform)
263 if(SdrTextPrimitive2D::operator==(rPrimitive))
276 return std::make_unique<SdrContourTextPrimitive2D>(
291 getSdrText()->GetObject().impDecomposePathTextPrimitive(aRetval, *
this, aViewInformation);
293 encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval);
301 : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
302 maPathPolyPolygon(rPathPolyPolygon),
303 maSdrFormTextAttribute(rSdrFormTextAttribute)
309 if(SdrTextPrimitive2D::operator==(rPrimitive))
320 std::unique_ptr<SdrTextPrimitive2D> SdrPathTextPrimitive2D::createTransformedClone(
const basegfx::B2DHomMatrix& rTransform)
const
325 return std::make_unique<SdrPathTextPrimitive2D>(
327 getOutlinerParaObject(),
329 getSdrFormTextAttribute());
340 getSdrText()->GetObject().impDecomposeBlockTextPrimitive(aRetval, *
this, aViewInformation);
342 encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval);
345 SdrBlockTextPrimitive2D::SdrBlockTextPrimitive2D(
351 bool bFixedCellHeight,
355 : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
356 maTextRangeTransform(rTextRangeTransform),
357 maSdrTextHorzAdjust(aSdrTextHorzAdjust),
358 maSdrTextVertAdjust(aSdrTextVertAdjust),
359 mbFixedCellHeight(bFixedCellHeight),
360 mbUnlimitedPage(bUnlimitedPage),
361 mbCellText(bCellText),
362 mbWordWrap(bWordWrap)
368 if(SdrTextPrimitive2D::operator==(rPrimitive))
384 std::unique_ptr<SdrTextPrimitive2D> SdrBlockTextPrimitive2D::createTransformedClone(
const basegfx::B2DHomMatrix& rTransform)
const
386 return std::make_unique<SdrBlockTextPrimitive2D>(
388 getOutlinerParaObject(),
389 rTransform * getTextRangeTransform(),
390 getSdrTextHorzAdjust(),
391 getSdrTextVertAdjust(),
406 getSdrText()->GetObject().impDecomposeAutoFitTextPrimitive(aRetval, *
this, aViewInformation);
408 encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval);
411 SdrAutoFitTextPrimitive2D::SdrAutoFitTextPrimitive2D(
414 const ::basegfx::B2DHomMatrix& rTextRangeTransform,
416 : SdrTextPrimitive2D(pSdrText, rParaObj),
417 maTextRangeTransform(rTextRangeTransform),
418 mbWordWrap(bWordWrap)
424 if(SdrTextPrimitive2D::operator==(rPrimitive))
435 std::unique_ptr<SdrTextPrimitive2D> SdrAutoFitTextPrimitive2D::createTransformedClone(const ::basegfx::B2DHomMatrix& rTransform)
const
437 return std::make_unique<SdrAutoFitTextPrimitive2D>(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform(), getWordWrap());
449 const
basegfx::B2DHomMatrix& rTextRangeTransform)
451 maTextRangeTransform(rTextRangeTransform)
457 getSdrText()->GetObject().impDecomposeChainedTextPrimitive(aRetval, *
this, aViewInformation);
459 encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval);
464 if(SdrTextPrimitive2D::operator==(rPrimitive))
474 std::unique_ptr<SdrTextPrimitive2D> SdrChainedTextPrimitive2D::createTransformedClone(
const basegfx::B2DHomMatrix& rTransform)
const
476 return std::make_unique<SdrChainedTextPrimitive2D>(getSdrText(), getOutlinerParaObject(), rTransform * getTextRangeTransform());
486 getSdrText()->GetObject().impDecomposeStretchTextPrimitive(aRetval, *
this, aViewInformation);
488 encapsulateWithTextHierarchyBlockPrimitive2D(rContainer, aRetval);
491 SdrStretchTextPrimitive2D::SdrStretchTextPrimitive2D(
495 bool bFixedCellHeight)
496 : SdrTextPrimitive2D(pSdrText, rOutlinerParaObject),
497 maTextRangeTransform(rTextRangeTransform),
498 mbFixedCellHeight(bFixedCellHeight)
504 if(SdrTextPrimitive2D::operator==(rPrimitive))
515 std::unique_ptr<SdrTextPrimitive2D> SdrStretchTextPrimitive2D::createTransformedClone(
const basegfx::B2DHomMatrix& rTransform)
const
517 return std::make_unique<SdrStretchTextPrimitive2D>(
519 getOutlinerParaObject(),
520 rTransform * getTextRangeTransform(),
521 isFixedCellHeight());
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
bool isFixedCellHeight() const
static constexpr auto CLASS_ID
#define PRIMITIVE2D_ID_SDRCONTOURTEXTPRIMITIVE2D
virtual std::unique_ptr< SdrTextPrimitive2D > createTransformedClone(const basegfx::B2DHomMatrix &rTransform) const override
void impDecomposeContourTextPrimitive(drawinglayer::primitive2d::Primitive2DContainer &rTarget, const drawinglayer::primitive2d::SdrContourTextPrimitive2D &rSdrContourTextPrimitive, const drawinglayer::geometry::ViewInformation2D &aViewInformation) const
static constexpr auto CLASS_ID
bool isWrongListEqual(const OutlinerParaObject &rCompare) const
const basegfx::B2DHomMatrix & getTextRangeTransform() const
const OutlinerParaObject & getOutlinerParaObject() const
bool getUnlimitedPage() const
bool mbContainsOtherFields
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
SdrPage * GetSdrPageFromXDrawPage(const uno::Reference< drawing::XDrawPage > &xDrawPage)
returns the SdrObject from the given StarOffice API wrapper
bool isFixedCellHeight() const
SdrTextVertAdjust getSdrTextVertAdjust() const
sal_Int16 mnLastPageCount
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
const basegfx::B2DPolyPolygon & getUnitPolyPolygon() const
virtual bool operator==(const BasePrimitive2D &rPrimitive) const override
#define PRIMITIVE2D_ID_SDRAUTOFITTEXTPRIMITIVE2D
Color maLastTextBackgroundColor
static void encapsulateWithTextHierarchyBlockPrimitive2D(Primitive2DContainer &rContainer, const Primitive2DContainer &rCandidate)
const attribute::SdrFormTextAttribute & getSdrFormTextAttribute() const
SdrPathTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, const basegfx::B2DPolyPolygon &rPathPolyPolygon, const attribute::SdrFormTextAttribute &rSdrFormTextAttribute)
const EditTextObject & GetTextObject() const
const Primitive2DContainer & getBuffered2DDecomposition() const
bool HasField(sal_Int32 nType=css::text::textfield::Type::UNSPECIFIED) const
#define PRIMITIVE2D_ID_SDRSTRETCHTEXTPRIMITIVE2D
virtual void get2DDecomposition(Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override
const basegfx::B2DPolyPolygon & getPathPolyPolygon() const
SdrTextObj & GetObject() const
#define PRIMITIVE2D_ID_SDRBLOCKTEXTPRIMITIVE2D
sal_uInt16 getHandoutPageCount() const
ImplPrimitive2DIDBlock(SdrChainedTextPrimitive2D, PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D) void SdrStretchTextPrimitive2D
SdrModel & getSdrModelFromSdrObject() const
void transform(const basegfx::B2DHomMatrix &rMatrix)
#define PRIMITIVE2D_ID_SDRCHAINEDTEXTPRIMITIVE2D
virtual void create2DDecomposition(Primitive2DContainer &rContainer, const geometry::ViewInformation2D &aViewInformation) const override
static constexpr auto CLASS_ID
bool IsMasterPage() const
css::uno::Reference< css::drawing::XDrawPage > mxLastVisualizingPage
ImplPrimitive2DIDBlock(BorderLinePrimitive2D, PRIMITIVE2D_ID_BORDERLINEPRIMITIVE2D) Primitive2DReference tryMergeBorderLinePrimitive2D(const BorderLinePrimitive2D *pCandidateA
sal_Int32 getPageCount(const uno::Reference< frame::XModel > &xModel)
const basegfx::B2DHomMatrix & getObjectTransform() const
SdrModel & getSdrModelFromSdrPage() const
SdrContourTextPrimitive2D(const SdrText *pSdrText, const OutlinerParaObject &rOutlinerParaObjectPtr, const basegfx::B2DPolyPolygon &rUnitPolyPolygon, const basegfx::B2DHomMatrix &rObjectTransform)
static constexpr auto CLASS_ID
sal_Int16 mnLastPageNumber
const OutlinerParaObject maOutlinerParaObject
::tools::WeakReference< SdrText > mrSdrText
bool mbContainsPageCountField
const SdrText * getSdrText() const
const basegfx::B2DHomMatrix & getTextRangeTransform() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
SdrTextHorzAdjust getSdrTextHorzAdjust() const
sal_uInt16 GetPageNum() const
sal_uInt16 GetPageCount() const
void setBuffered2DDecomposition(const Primitive2DContainer &rNew)
Color const & GetBackgroundColor() const
#define PRIMITIVE2D_ID_SDRPATHTEXTPRIMITIVE2D