lose the caching in ViewObjectContact
we reload the data every time anyway, so the caching is useless Change-Id: I575cc2fbe5a2fe9f42c58894f471cabb842cdd46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126273 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -48,11 +48,6 @@ private:
|
||||
// This range defines the object's BoundRect
|
||||
basegfx::B2DRange maObjectRange;
|
||||
|
||||
// PrimitiveSequence of the ViewContact. This contains all necessary information
|
||||
// for the graphical visualisation and needs to be supported by all VCs which
|
||||
// can be visualized.
|
||||
drawinglayer::primitive2d::Primitive2DContainer mxPrimitive2DSequence;
|
||||
|
||||
// the PrimitiveAnimation if Primitive2DContainer contains animations
|
||||
std::unique_ptr<sdr::animation::PrimitiveAnimation> mpPrimitiveAnimation;
|
||||
|
||||
@@ -69,7 +64,7 @@ protected:
|
||||
|
||||
// Called from getPrimitive2DSequence() when vector has changed. Evaluate object animation
|
||||
// and setup accordingly
|
||||
void checkForPrimitive2DAnimations();
|
||||
void checkForPrimitive2DAnimations(const drawinglayer::primitive2d::Primitive2DContainer& );
|
||||
|
||||
// This method is responsible for creating the graphical visualisation data which is
|
||||
// stored/cached in the local primitive. Default gets view-independent Primitive
|
||||
@@ -78,9 +73,6 @@ protected:
|
||||
// This method will not handle included hierarchies and not check geometric visibility.
|
||||
virtual drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
|
||||
|
||||
// method for flushing Primitive2DContainer for VOC implementations
|
||||
void flushPrimitive2DSequence() { mxPrimitive2DSequence.clear(); }
|
||||
|
||||
public:
|
||||
// basic constructor.
|
||||
ViewObjectContact(ObjectContact& rObjectContact, ViewContact& rViewContact);
|
||||
@@ -111,7 +103,7 @@ public:
|
||||
// access to the local primitive. This will ensure that the local primitive is
|
||||
// current in comparing the local one with a fresh created incarnation
|
||||
// This method will not handle included hierarchies and not check visibility.
|
||||
drawinglayer::primitive2d::Primitive2DContainer const & getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
|
||||
drawinglayer::primitive2d::Primitive2DContainer getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const;
|
||||
|
||||
// test this VOC for visibility concerning model-view stuff like e.g. Layer
|
||||
virtual bool isPrimitiveVisible(const DisplayInfo& rDisplayInfo) const;
|
||||
|
||||
@@ -263,13 +263,13 @@ void ViewObjectContact::ActionChildInserted(ViewContact& rChild)
|
||||
// GetObjectContact().InvalidatePartOfView(rChildVOC.getObjectRange());
|
||||
}
|
||||
|
||||
void ViewObjectContact::checkForPrimitive2DAnimations()
|
||||
void ViewObjectContact::checkForPrimitive2DAnimations(const drawinglayer::primitive2d::Primitive2DContainer& xPrimitive2DSequence)
|
||||
{
|
||||
// remove old one
|
||||
mpPrimitiveAnimation.reset();
|
||||
|
||||
// check for animated primitives
|
||||
if(mxPrimitive2DSequence.empty())
|
||||
if(xPrimitive2DSequence.empty())
|
||||
return;
|
||||
|
||||
const bool bTextAnimationAllowed(GetObjectContact().IsTextAnimationAllowed());
|
||||
@@ -279,7 +279,7 @@ void ViewObjectContact::checkForPrimitive2DAnimations()
|
||||
{
|
||||
AnimatedExtractingProcessor2D aAnimatedExtractor(GetObjectContact().getViewInformation2D(),
|
||||
bTextAnimationAllowed, bGraphicAnimationAllowed);
|
||||
aAnimatedExtractor.process(mxPrimitive2DSequence);
|
||||
aAnimatedExtractor.process(xPrimitive2DSequence);
|
||||
|
||||
if(!aAnimatedExtractor.getPrimitive2DSequence().empty())
|
||||
{
|
||||
@@ -327,7 +327,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::createPrimiti
|
||||
return xRetval;
|
||||
}
|
||||
|
||||
drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
|
||||
drawinglayer::primitive2d::Primitive2DContainer ViewObjectContact::getPrimitive2DSequence(const DisplayInfo& rDisplayInfo) const
|
||||
{
|
||||
drawinglayer::primitive2d::Primitive2DContainer xNewPrimitiveSequence;
|
||||
|
||||
@@ -343,19 +343,12 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPr
|
||||
xNewPrimitiveSequence = createPrimitive2DSequence(rDisplayInfo);
|
||||
}
|
||||
|
||||
// local up-to-date checks. New list different from local one?
|
||||
if(mxPrimitive2DSequence == xNewPrimitiveSequence)
|
||||
return mxPrimitive2DSequence;
|
||||
|
||||
// has changed, copy content
|
||||
const_cast< ViewObjectContact* >(this)->mxPrimitive2DSequence = std::move(xNewPrimitiveSequence);
|
||||
|
||||
// check for animated stuff
|
||||
const_cast< ViewObjectContact* >(this)->checkForPrimitive2DAnimations();
|
||||
const_cast< ViewObjectContact* >(this)->checkForPrimitive2DAnimations(xNewPrimitiveSequence);
|
||||
|
||||
// always update object range when PrimitiveSequence changes
|
||||
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D());
|
||||
const_cast< ViewObjectContact* >(this)->maObjectRange = mxPrimitive2DSequence.getB2DRange(rViewInformation2D);
|
||||
const_cast< ViewObjectContact* >(this)->maObjectRange = xNewPrimitiveSequence.getB2DRange(rViewInformation2D);
|
||||
|
||||
// check and eventually embed to GridOffset transform primitive
|
||||
if(GetObjectContact().supportsGridOffsets())
|
||||
@@ -370,7 +363,7 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPr
|
||||
drawinglayer::primitive2d::Primitive2DReference aEmbed(
|
||||
new drawinglayer::primitive2d::TransformPrimitive2D(
|
||||
aTranslateGridOffset,
|
||||
std::move(const_cast< ViewObjectContact* >(this)->mxPrimitive2DSequence)));
|
||||
std::move(xNewPrimitiveSequence)));
|
||||
|
||||
// Set values at local data. So for now, the mechanism is to reset some of the
|
||||
// defining things (mxPrimitive2DSequence, maGridOffset) and re-create the
|
||||
@@ -381,13 +374,13 @@ drawinglayer::primitive2d::Primitive2DContainer const & ViewObjectContact::getPr
|
||||
// just allow re-creation of the PrimitiveSequence (and removing buffered
|
||||
// decomposed content of it). May be optimized, though. OTOH it only happens
|
||||
// in calc which traditionally does not have a huge amount of DrawObjects anyways.
|
||||
const_cast< ViewObjectContact* >(this)->mxPrimitive2DSequence = drawinglayer::primitive2d::Primitive2DContainer { aEmbed };
|
||||
xNewPrimitiveSequence = drawinglayer::primitive2d::Primitive2DContainer { aEmbed };
|
||||
const_cast< ViewObjectContact* >(this)->maObjectRange.transform(aTranslateGridOffset);
|
||||
}
|
||||
}
|
||||
|
||||
// return current Primitive2DContainer
|
||||
return mxPrimitive2DSequence;
|
||||
return xNewPrimitiveSequence;
|
||||
}
|
||||
|
||||
bool ViewObjectContact::isPrimitiveVisible(const DisplayInfo& /*rDisplayInfo*/) const
|
||||
@@ -458,7 +451,6 @@ void ViewObjectContact::resetGridOffset()
|
||||
maGridOffset.setY(0.0);
|
||||
|
||||
// also reset sequence to get a re-calculation when GridOffset changes
|
||||
mxPrimitive2DSequence.clear();
|
||||
maObjectRange.reset();
|
||||
}
|
||||
|
||||
|
||||
@@ -1749,12 +1749,6 @@ namespace sdr::contact {
|
||||
{
|
||||
// graphical invalidate at all views
|
||||
ActionChanged();
|
||||
|
||||
// #i93318# flush Primitive2DContainer to force recreation with updated XControlModel
|
||||
// since e.g. background color has changed and existing decompositions are possibly no
|
||||
// longer valid. Unfortunately this is not detected from ControlPrimitive2D::operator==
|
||||
// since it only has a uno reference to the XControlModel
|
||||
flushPrimitive2DSequence();
|
||||
}
|
||||
|
||||
UnoControlPrintOrPreviewContact::UnoControlPrintOrPreviewContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact )
|
||||
|
||||
Reference in New Issue
Block a user