[Libreoffice-commits] core.git: svx/qa
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Wed Dec 4 08:02:23 UTC 2019
svx/qa/unit/svdraw.cxx | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
New commits:
commit ac5970258eec9d541721b8a2018c882b3f66550d
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Dec 3 21:21:30 2019 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Wed Dec 4 09:01:40 2019 +0100
CppunitTest_svx_unit: simplify testSemiTransparentText
Reading SvxXShadowPreview::Paint() shows how to use
sdr::contact::ObjectContactOfObjListPainter, which makes it possible to
avoid the whole chain of dummy SdrView, SdrPageView and SdrPageWindow,
just to turn an SdrObject into primitives.
Change-Id: I10c85476af20a2addbd070198b9c75341275ff8d
Reviewed-on: https://gerrit.libreoffice.org/84375
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx
index d702effe2dbe..a0b32dc5c08e 100644
--- a/svx/qa/unit/svdraw.cxx
+++ b/svx/qa/unit/svdraw.cxx
@@ -22,12 +22,10 @@
#include <svx/sdr/contact/displayinfo.hxx>
#include <svx/sdr/contact/viewcontact.hxx>
#include <svx/sdr/contact/viewobjectcontact.hxx>
-#include <svx/sdrpagewindow.hxx>
#include <svx/svdpage.hxx>
-#include <svx/svdpagv.hxx>
-#include <svx/svdview.hxx>
#include <svx/unopage.hxx>
#include <vcl/virdev.hxx>
+#include <svx/sdr/contact/objectcontactofobjlistpainter.hxx>
using namespace ::com::sun::star;
@@ -86,12 +84,10 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testSemiTransparentText)
CPPUNIT_ASSERT(pDrawPage);
SdrPage* pSdrPage = pDrawPage->GetSdrPage();
ScopedVclPtrInstance<VirtualDevice> aVirtualDevice;
- SdrView aSdrView(pSdrPage->getSdrModelFromSdrPage(), aVirtualDevice);
- SdrPageView aSdrPageView(pSdrPage, aSdrView);
- SdrPageWindow* pSdrPageWindow = aSdrPageView.GetPageWindow(0);
- sdr::contact::ObjectContact& rObjectContactOfPageView = pSdrPageWindow->GetObjectContact();
+ sdr::contact::ObjectContactOfObjListPainter aObjectContact(*aVirtualDevice,
+ { pSdrPage->GetObj(0) }, nullptr);
const sdr::contact::ViewObjectContact& rDrawPageVOContact
- = pSdrPage->GetViewContact().GetViewObjectContact(rObjectContactOfPageView);
+ = pSdrPage->GetViewContact().GetViewObjectContact(aObjectContact);
sdr::contact::DisplayInfo aDisplayInfo;
drawinglayer::primitive2d::Primitive2DContainer xPrimitiveSequence
= rDrawPageVOContact.getPrimitive2DSequenceHierarchy(aDisplayInfo);
More information about the Libreoffice-commits
mailing list