diff options
4 files changed, 37 insertions, 22 deletions
diff --git a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx index c7af9562adc1..93cb4e455d76 100644 --- a/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/texthierarchyprimitive2d.cxx @@ -136,8 +136,9 @@ namespace drawinglayer::primitive2d } - TextHierarchyEditPrimitive2D::TextHierarchyEditPrimitive2D(Primitive2DContainer&& aChildren) - : GroupPrimitive2D(std::move(aChildren)) + TextHierarchyEditPrimitive2D::TextHierarchyEditPrimitive2D(Primitive2DContainer&& aContent) + : BasePrimitive2D() + , maContent(std::move(aContent)) { } diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 539e01282a2f..eb5f32e0c678 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -926,6 +926,20 @@ void VclMetafileProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimi static_cast<const primitive2d::StructureTagPrimitive2D&>(rCandidate)); break; } + case PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D: + { + // This primitive is created if a text edit is active and contains it's + // current content, not from model data itself. + // Pixel renderers need to suppress that content, it gets displayed by the active + // TextEdit in the EditView. Suppression is done by decomposing to nothing. + // MetaFile renderers have to show it, so that the edited text is part of the + // MetaFile, e.g. needed for presentation previews and exports. + // So take action here and process it's content: + // Note: Former error was #i97628# + process(static_cast<const primitive2d::TextHierarchyEditPrimitive2D&>(rCandidate) + .getContent()); + break; + } case PRIMITIVE2D_ID_EPSPRIMITIVE2D: { RenderEpsPrimitive2D(static_cast<const primitive2d::EpsPrimitive2D&>(rCandidate)); diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index f701ad9bbeeb..7852131ee98f 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -355,17 +355,6 @@ void VclPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitiv static_cast<const primitive2d::BackgroundColorPrimitive2D&>(rCandidate)); break; } - case PRIMITIVE2D_ID_TEXTHIERARCHYEDITPRIMITIVE2D: - { - // #i97628# - // This primitive means that the content is derived from an active text edit, - // not from model data itself. Some renderers need to suppress this content, e.g. - // the pixel renderer used for displaying the edit view (like this one). It's - // not to be suppressed by the MetaFile renderers, so that the edited text is - // part of the MetaFile, e.g. needed for presentation previews. - // Action: Ignore here, do nothing. - break; - } case PRIMITIVE2D_ID_INVERTPRIMITIVE2D: { processInvertPrimitive2D(rCandidate); diff --git a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx index 00972a2843df..da388d935eac 100644 --- a/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/texthierarchyprimitive2d.hxx @@ -155,20 +155,31 @@ namespace drawinglayer::primitive2d /** TextHierarchyEditPrimitive2D class - #i97628# - Primitive to encapsulate text from an active text edit; some - renderers need to suppress this output due to painting the - edited text in e.g. an OutlinerEditView. It's derived from - GroupPrimitive2D, so the implicit decomposition will use the - content. To suppress, this primitive needs to be parsed by - the renderer without taking any action. + Primitive to encapsulate text from an active text edit; this is + separate from other text data since some renderers need to suppress + this output due to painting the edited text in e.g. an + OutlinerEditView in the active text edit control. + Deriving now from BasePrimitive2D to turn around functionality: + This will decompose to nothing -> suppress. In renderers that need to + visualize it (only VclMetafileProcessor2D for now), it needs + to be detected and used (see there). + Doing it this way around since we will potentially have many + pixel renderers and only one MetafileProcessor, so it will + be one action less to support (and to potentially forget about ) + in these implementations. */ - class DRAWINGLAYER_DLLPUBLIC TextHierarchyEditPrimitive2D final : public GroupPrimitive2D + class DRAWINGLAYER_DLLPUBLIC TextHierarchyEditPrimitive2D final : public BasePrimitive2D { private: + /// the content + Primitive2DContainer maContent; + public: /// constructor - explicit TextHierarchyEditPrimitive2D(Primitive2DContainer&& aChildren); + explicit TextHierarchyEditPrimitive2D(Primitive2DContainer&& aContent); + + /// data read access + const Primitive2DContainer& getContent() const { return maContent; } /// provide unique ID virtual sal_uInt32 getPrimitive2DID() const override; |