[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - svx/inc svx/source
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 21 09:06:37 UTC 2021
svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx | 6 -
svx/source/sdr/contact/viewcontactofsdrole2obj.cxx | 76 ++++++---------------
svx/source/unodraw/unoshape.cxx | 10 --
3 files changed, 25 insertions(+), 67 deletions(-)
New commits:
commit 99679f4dbfae6eb51a9a76b1cebd87e3d38b0c9c
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Mon Apr 19 21:37:53 2021 +0200
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Wed Apr 21 11:06:04 2021 +0200
tdf#86321: Revert "Resolves: #i123539# some optimizations for 3D chart..."
This reverts commit db1d2af02861b49e4f53d726d59cd71c20cee9b1
The commit was already partically reverted in
bca8d8985666d3fd22b91eb280f9baaeb933c2d0 < Resolves: tdf#90583
3D pie-chart missing guide handles >.
This partial revert broke the optimization introduced in
db1d2af02861b49e4f53d726d59cd71c20cee9b1 <Resolves: #i123539#
some optimizations for 3D chart...> for 3D charts like
https://bz.apache.org/ooo/attachment.cgi?id=81810
Later, 3D charts were optimized again in
55a7e836a2db662a53adc4f8b98d08b06790c758 < chart2: When
creating objects prevent setting object rects dirty > so
the remaining code originally introduced can go.
Import time of https://bz.apache.org/ooo/attachment.cgi?id=81810
is the same with and without this patch
Change-Id: I25338d0dfb4b41651dfe05e7bfbd74c86091dacb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114313
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
(cherry picked from commit eec03e848cb6874ce6d64dc0b8f45dbaf52e6c2b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114277
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
Signed-off-by: Xisco Fauli <xiscofauli at libreoffice.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114325
diff --git a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx
index 7a79e3ee4f12..cd12229f2b40 100644
--- a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx
+++ b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx
@@ -31,9 +31,6 @@ namespace sdr::contact {
class ViewContactOfSdrOle2Obj final : public ViewContactOfSdrRectObj
{
private:
- // #i123539# allow local buffering of chart data (if chart)
- drawinglayer::primitive2d::Primitive2DReference mxChartContent;
-
// Create an Object-Specific ViewObjectContact, set ViewContact and
// ObjectContact. Always needs to return something.
virtual ViewObjectContact& CreateObjectSpecificViewObjectContact(ObjectContact& rObjectContact) override;
@@ -58,9 +55,6 @@ public:
// from the VOC which knows that
drawinglayer::primitive2d::Primitive2DContainer createPrimitive2DSequenceWithParameters() const;
- // #i123539# get rid of buffered chart content (if there) on change
- virtual void ActionChanged() override;
-
virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const override;
private:
diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
index 57077e7b30eb..6c9662a957f9 100644
--- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
+++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx
@@ -45,8 +45,7 @@ ViewObjectContact& ViewContactOfSdrOle2Obj::CreateObjectSpecificViewObjectContac
}
ViewContactOfSdrOle2Obj::ViewContactOfSdrOle2Obj(SdrOle2Obj& rOle2Obj)
-: ViewContactOfSdrRectObj(rOle2Obj),
- mxChartContent()
+: ViewContactOfSdrRectObj(rOle2Obj)
{
}
@@ -90,45 +89,30 @@ drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrOle2Obj::createP
if(GetOle2Obj().IsChart())
{
- // #i123539# allow buffering and reuse of local chart data to not need to rebuild it
- // on every ViewObjectContact::getPrimitive2DSequence call. TTTT: Not needed for
- // aw080, there this mechanism already works differently
- if(mxChartContent.is())
+ // try to get chart primitives and chart range directly from xChartModel
+ basegfx::B2DRange aChartContentRange;
+ const drawinglayer::primitive2d::Primitive2DContainer aChartSequence(
+ ChartHelper::tryToGetChartContentAsPrimitive2DSequence(
+ GetOle2Obj().getXModel(),
+ aChartContentRange));
+ const double fWidth(aChartContentRange.getWidth());
+ const double fHeight(aChartContentRange.getHeight());
+
+ if(!aChartSequence.empty()
+ && basegfx::fTools::more(fWidth, 0.0)
+ && basegfx::fTools::more(fHeight, 0.0))
{
- xContent = mxChartContent;
- }
- else
- {
- // try to get chart primitives and chart range directly from xChartModel
- basegfx::B2DRange aChartContentRange;
- const drawinglayer::primitive2d::Primitive2DContainer aChartSequence(
- ChartHelper::tryToGetChartContentAsPrimitive2DSequence(
- GetOle2Obj().getXModel(),
- aChartContentRange));
- const double fWidth(aChartContentRange.getWidth());
- const double fHeight(aChartContentRange.getHeight());
-
- if(!aChartSequence.empty()
- && basegfx::fTools::more(fWidth, 0.0)
- && basegfx::fTools::more(fHeight, 0.0))
- {
- // create embedding transformation
- basegfx::B2DHomMatrix aEmbed(
- basegfx::utils::createTranslateB2DHomMatrix(
- -aChartContentRange.getMinX(),
- -aChartContentRange.getMinY()));
-
- aEmbed.scale(1.0 / fWidth, 1.0 / fHeight);
- aEmbed = aObjectMatrix * aEmbed;
- xContent = new drawinglayer::primitive2d::TransformPrimitive2D(
- aEmbed,
- aChartSequence);
- }
-
- if(xContent.is())
- {
- const_cast< ViewContactOfSdrOle2Obj* >(this)->mxChartContent = xContent;
- }
+ // create embedding transformation
+ basegfx::B2DHomMatrix aEmbed(
+ basegfx::utils::createTranslateB2DHomMatrix(
+ -aChartContentRange.getMinX(),
+ -aChartContentRange.getMinY()));
+
+ aEmbed.scale(1.0 / fWidth, 1.0 / fHeight);
+ aEmbed = aObjectMatrix * aEmbed;
+ xContent = new drawinglayer::primitive2d::TransformPrimitive2D(
+ aEmbed,
+ aChartSequence);
}
}
@@ -185,18 +169,6 @@ basegfx::B2DRange ViewContactOfSdrOle2Obj::getRange( const drawinglayer::geometr
return drawinglayer::primitive2d::getB2DRangeFromPrimitive2DReference(xReference, rViewInfo2D);
}
-void ViewContactOfSdrOle2Obj::ActionChanged()
-{
- // call parent
- ViewContactOfSdrRectObj::ActionChanged();
-
- // #i123539# if we have buffered chart data, reset it
- if(mxChartContent.is())
- {
- mxChartContent.clear();
- }
-}
-
drawinglayer::primitive2d::Primitive2DContainer ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const
{
return createPrimitive2DSequenceWithParameters();
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index f5be3192d8c0..86e25f5e3654 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1227,15 +1227,7 @@ void SAL_CALL SvxShape::setSize( const awt::Size& rSize )
if(HasSdrObject())
{
- // #i123539# optimization for 3D chart object generation: do not use UNO
- // API commands to get the range, this is too expensive since for 3D
- // scenes it may recalculate the whole scene since in AOO this depends
- // on the contained geometry (layouted to show all content)
- const bool b3DConstruction(dynamic_cast< E3dObject* >(GetSdrObject()) && GetSdrObject()->getSdrModelFromSdrObject().isLocked());
- tools::Rectangle aRect(
- b3DConstruction ?
- tools::Rectangle(maPosition.X, maPosition.Y, maSize.Width, maSize.Height) :
- svx_getLogicRectHack(GetSdrObject()) );
+ tools::Rectangle aRect( svx_getLogicRectHack(GetSdrObject()) );
Size aLocalSize( rSize.Width, rSize.Height );
ForceMetricToItemPoolMetric(aLocalSize);
More information about the Libreoffice-commits
mailing list