summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-06-18 18:09:19 +0530
committerDennis Francis <dennis.francis@collabora.com>2020-07-11 07:34:10 +0200
commita910703bcbd2d8a767aff3f50185233baf601a32 (patch)
tree057c8699ec3e41d662ee263b4ca2c1695593d136 /svx
parent539e4124739feffdceecb5207fdc2428396a9dd4 (diff)
scPrintTwipsMsgs: Use print logical coordinates for draw objects
as a result LOK_CALLBACK_GRAPHIC(_VIEW)_SELECTION messages will now be in print-twips. For tile-rendering, it needs the pixel-aligned coordinates of each object. The translation of print coordinates to pixel-aligned coordinates can be done behind the scenes by the ViewContact/ObjectContact/ViewObjectContact objects associated with the draw object which uses the cached "grid-offset" for each object (introduced in the patch "Refactor calc non-linear ViewToDevice transform"). For doing this, a subclass of FmFormView with a specialized "createViewSpecificObjectContact" method is used for tile-rendering. The createViewSpecificObjectContact creates a "proxy" object-contact object that delegates the grid-offsets queries to the actual ScDrawView generated ObjectContact. This is needed because currently there is no way to share the ObjectContact/ViewObjectContact instances between different SdrPaintWindow's without making changes ~everywhere. Change-Id: Ifdfb623c8d6dd81700ec4a5dfeeb6b2391a96154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98166 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com> (cherry picked from commit 345f9480618d0867f6b42a83a7ae1d62c8ef9c0c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98161 Tested-by: Jenkins
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/contact/viewobjectcontact.cxx1
-rw-r--r--svx/source/svdraw/svdmrkv.cxx3
2 files changed, 3 insertions, 1 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index 3cad7e4699fe..7676bb535fbc 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -467,6 +467,7 @@ void ViewObjectContact::resetGridOffset()
// also reset sequence to get a re-calculation when GridOffset changes
mxPrimitive2DSequence.clear();
+ maObjectRange.reset();
}
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 8ff7b08a17ee..b1472651875c 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -43,6 +43,7 @@
#include <svx/sdr/overlay/overlaymanager.hxx>
#include <svx/sdr/overlay/overlayselection.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
+#include <svx/sdr/contact/viewobjectcontact.hxx>
#include <svx/sdrpaintwindow.hxx>
#include <svx/sdrpagewindow.hxx>
#include <svx/sdrhittesthelper.hxx>
@@ -2029,7 +2030,7 @@ bool SdrMarkView::getPossibleGridOffsetForSdrObject(
const sdr::contact::ViewObjectContact& rVOC(pObj->GetViewContact().GetViewObjectContact(
const_cast<sdr::contact::ObjectContact&>(rObjectContact)));
- rObjectContact.calculateGridOffsetForViewOjectContact(rOffset, rVOC);
+ rOffset = rVOC.getGridOffset();
return !rOffset.equalZero();
}