summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-12-03 21:21:30 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-12-04 09:01:40 +0100
commitac5970258eec9d541721b8a2018c882b3f66550d (patch)
tree28831a7a1aacb25c1ec6d48466b38a41c766a5d6 /svx
parent30c707666dbe810c577dc14bc995dc91c2293b17 (diff)
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@collabora.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/qa/unit/svdraw.cxx12
1 files changed, 4 insertions, 8 deletions
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);