summaryrefslogtreecommitdiffstats
path: root/office/texstudio/texstudio-2.6.4-phonon-build-fix.patch
blob: 2dea40f603dfc353a1642b4f2432bc6f8e32da3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
--- a/PDFDocument.cpp
+++ b/PDFDocument.cpp
@@ -781,19 +781,17 @@
 	event->accept();
 }
 
-void PDFWidget::annotationClicked(Poppler::Annotation *annotation, const QPointF &scaledPos) {
+void PDFWidget::annotationClicked(Poppler::Annotation *annotation, int page) {
 	switch (annotation->subType()) {
 	case Poppler::Annotation::AMovie: {
 #ifdef PHONON
-		if (page > -1 && clickedAnnotation->boundary().contains(scaledPos) ) {
-			if (movie) delete movie;
-			movie = new PDFMovie(this, dynamic_cast<Poppler::MovieAnnotation*>(clickedAnnotation), page);
-			movie->place();
-			movie->show();
-			movie->play();
-		}
+		if (movie) delete movie;
+		movie = new PDFMovie(this, dynamic_cast<Poppler::MovieAnnotation*>(annotation), page);
+		movie->place();
+		movie->show();
+		movie->play();
 #else
-		Q_UNUSED(scaledPos)
+		Q_UNUSED(page)
 		txsWarning("You clicked on a video, but the video playing mode was disabled by you or the package creator.\nRecompile TeXstudio with the option PHONON=true");
 #endif
 		break;
@@ -826,7 +824,9 @@
 		int page;
 		QPointF scaledPos;
 		mapToScaledPosition(event->pos(), page, scaledPos);
-		annotationClicked(clickedAnnotation, scaledPos);
+		if (page > -1 && clickedAnnotation->boundary().contains(scaledPos)) {
+			annotationClicked(clickedAnnotation, page);
+		}
 	} else if (currentTool == kPresentation) {
 		if (event->button() == Qt::LeftButton) goNext();
 		else if (event->button() == Qt::RightButton) goPrev();
--- a/PDFDocument.h
+++ b/PDFDocument.h
@@ -237,7 +237,7 @@
 	void useMagnifier(const QMouseEvent *inEvent);
 	void goToDestination(const Poppler::LinkDestination& dest);
 	void doLink(const Poppler::Link *link);
-	void annotationClicked(Poppler::Annotation *annotation, const QPointF &scaledPos);
+	void annotationClicked(Poppler::Annotation *annotation, int page);
 	void doZoom(const QPoint& clickPos, int dir, qreal newScaleFactor=1.0);
 
 	PDFScrollArea* getScrollArea();