[Libreoffice-commits] core.git: slideshow/source

2023-09-05 Thread Tomaž Vajngerl (via logerrit)
 slideshow/source/engine/shapes/drawshape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 15e0dfe709636b517bc1876caa3853606d9b499c
Author: Tomaž Vajngerl 
AuthorDate: Tue Sep 5 11:10:45 2023 +0200
Commit: Tomaž Vajngerl 
CommitDate: Tue Sep 5 20:06:02 2023 +0200

tdf#154138 C/P regression - used setWidth instead of setHeight

Change-Id: I2433b4d32e939cadf499b61dfa9033125eaa3c76
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156557
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/slideshow/source/engine/shapes/drawshape.cxx 
b/slideshow/source/engine/shapes/drawshape.cxx
index 8993c8edbe77..cdda31da8a66 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -775,7 +775,7 @@ namespace slideshow::internal
 aAABorder.setWidth( ::std::max(
 rShapeBorder.getWidth(),
 aAABorder.getWidth() ) );
-aAABorder.setWidth( ::std::max(
+aAABorder.setHeight( ::std::max(
 rShapeBorder.getHeight(),
 aAABorder.getHeight() ) );
 }


[Libreoffice-commits] core.git: slideshow/source

2023-08-15 Thread Regina Henschel (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 64121a303b5ceb3dd149215529ef8346b6d00dcd
Author: Regina Henschel 
AuthorDate: Tue Aug 15 01:09:25 2023 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 15 09:52:30 2023 +0200

CID 1539919:  Null pointer dereferences

The problem was introduced in 631964a2ce1da3fbbeb53a5550c0e6728ba644aa
tfd#112687 Combine adjacent lines into one shape

Change-Id: I4c064a22e5fcc0040e249dbde09ee591ac2693c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155686
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 33a9825e544a..81661fab215a 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1445,14 +1445,16 @@ void lcl_setPropertiesToShape(const 
drawing::PointSequenceSequence& rPoints,
 aXPropSet->setPropertyValue("LineCap", uno::Any(eLC));
 
 //LineColor
-sal_uInt32 nLineColor;
-nLineColor = pCanvasPolyPoly->getRGBALineColor();
+sal_uInt32 nLineColor = 0;
+if (pCanvasPolyPoly)
+nLineColor = pCanvasPolyPoly->getRGBALineColor();
 //Transform polygon color from RRGGBBAA to AARRGGBB
 aXPropSet->setPropertyValue("LineColor", 
uno::Any(RGBAColor2UnoColor(nLineColor)));
 
 //LineWidth
-double  fLineWidth;
-fLineWidth = pCanvasPolyPoly->getStrokeWidth();
+double  fLineWidth = 0;
+if (pCanvasPolyPoly)
+fLineWidth = pCanvasPolyPoly->getStrokeWidth();
 aXPropSet->setPropertyValue("LineWidth", 
uno::Any(static_cast(fLineWidth)));
 }
 
@@ -1509,7 +1511,7 @@ void SlideShowImpl::registerUserPaintPolygons( const 
uno::Reference< lang::XMult
 // We collect these points into one B2DPolygon and use that to 
generate the shape on the
 // slide.
 ::basegfx::B2DPolygon aDrawingPoints;
-cppcanvas::PolyPolygonSharedPtr pFirstPolyPoly; // for style properties
+cppcanvas::PolyPolygonSharedPtr pFirstPolyPoly = aPolygons.front(); // 
for style properties
 for( const auto& pPolyPoly : aPolygons )
 {
 // Actually, each item in aPolygons has two points, but wrapped in 
a cppcanvas::PopyPolygon.


[Libreoffice-commits] core.git: slideshow/source

2023-08-14 Thread Samuel Mehrbrodt (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 850b66f969834e61f3cb1a1ccd4bfc15f23d558f
Author: Samuel Mehrbrodt 
AuthorDate: Mon Aug 14 14:13:05 2023 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Mon Aug 14 21:40:33 2023 +0200

tdf#154265 Disable automatic slide advancement when moving backwards

When a slide has a 0 second automatic slide advance setting, and you move
back to that slide, it would immediately move forward again.

Only enable automatic slide advancement when moving forwards.

Change-Id: I3c901bed5323569f5cf52aeca5b3227c87b6e539
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155663
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index f681dc2a9559..33a9825e544a 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -479,6 +479,7 @@ private:
 boolmbShowPaused;
 boolmbSlideShowIdle;
 boolmbDisableAnimationZOrder;
+boolmbMovingForward;
 
 EffectRewinder  maEffectRewinder;
 FrameSynchronizationmaFrameSynchronization;
@@ -590,6 +591,7 @@ SlideShowImpl::SlideShowImpl(
   mbShowPaused( false ),
   mbSlideShowIdle( true ),
   mbDisableAnimationZOrder( false ),
+  mbMovingForward( true ),
   maEffectRewinder(maEventMultiplexer, maEventQueue, maUserEventQueue),
   maFrameSynchronization(1.0 / FrameRate::PreferredFramesPerSecond)
 
@@ -1215,6 +1217,7 @@ void SlideShowImpl::redisplayCurrentSlide()
 
 sal_Bool SlideShowImpl::nextEffect()
 {
+mbMovingForward = true;
 osl::MutexGuard const guard( m_aMutex );
 
 if (isDisposed())
@@ -1231,6 +1234,7 @@ sal_Bool SlideShowImpl::nextEffect()
 
 sal_Bool SlideShowImpl::previousEffect()
 {
+mbMovingForward = false;
 osl::MutexGuard const guard( m_aMutex );
 
 if (isDisposed())
@@ -2310,7 +2314,8 @@ void SlideShowImpl::notifySlideAnimationsEnded()
 // step slides manually.
 if( !mbForceManualAdvance &&
 !mpRehearseTimingsActivity &&
-bHasAutomaticNextSlide )
+bHasAutomaticNextSlide &&
+mbMovingForward )
 {
 aNotificationEvents = makeInterruptableDelay(
 [this]() { return this->notifySlideEnded( false ); },


[Libreoffice-commits] core.git: slideshow/source

2023-08-13 Thread Regina Henschel (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |  148 --
 1 file changed, 103 insertions(+), 45 deletions(-)

New commits:
commit 631964a2ce1da3fbbeb53a5550c0e6728ba644aa
Author: Regina Henschel 
AuthorDate: Sat Aug 12 22:57:31 2023 +0200
Commit: Regina Henschel 
CommitDate: Sun Aug 13 14:57:02 2023 +0200

tfd#112687 Combine adjacent lines into one shape

When the user makes a 'mouse as pen' drawing in slideshow, then each
mouse drag step generates a separate, very short two-point line. When
the drawings were made persistent, from each of this mini lines an
individual shape was created.

Now lines, were the end point of one line equals the start point of
the next line, were combined to a polyline. That way a drawing, which
was drawn with one mouse drag, becomes one shape now.

This does not solve, that too many of such mini lines were generated.
But it makes it easier to handle them in edit mode.

Change-Id: I8662831f309b201c049844a613877190ca0da5b3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155643
Tested-by: Jenkins
Reviewed-by: Regina Henschel 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index f02647097ea8..f681dc2a9559 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -48,6 +48,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1398,6 +1399,59 @@ sal_Bool SlideShowImpl::removeView(
 return true;
 }
 
+drawing::PointSequenceSequence
+lcl_createPointSequenceSequenceFromB2DPolygon(const basegfx::B2DPolygon& rPoly)
+{
+drawing::PointSequenceSequence aRetval;
+//Create only one sequence for one pen drawing.
+aRetval.realloc(1);
+// Retrieve the sequence of points from aRetval
+drawing::PointSequence* pOuterSequence = aRetval.getArray();
+// Create points in this sequence from rPoly
+pOuterSequence->realloc(rPoly.count());
+// Get these points which are in an array
+awt::Point* pInnerSequence = pOuterSequence->getArray();
+for( sal_uInt32 n = 0; n < rPoly.count(); n++ )
+{
+//Create a point from the polygon
+*pInnerSequence++ = 
awt::Point(basegfx::fround(rPoly.getB2DPoint(n).getX()),
+   
basegfx::fround(rPoly.getB2DPoint(n).getY()));
+}
+return aRetval;
+}
+
+void lcl_setPropertiesToShape(const drawing::PointSequenceSequence& rPoints,
+  const cppcanvas::PolyPolygonSharedPtr 
pCanvasPolyPoly,
+  uno::Reference< drawing::XShape >& rPolyShape)
+{
+uno::Reference< beans::XPropertySet > aXPropSet(rPolyShape, 
uno::UNO_QUERY);
+//Give the built PointSequenceSequence.
+uno::Any aParam;
+aParam <<= rPoints;
+aXPropSet->setPropertyValue("PolyPolygon", aParam);
+
+//LineStyle : SOLID by default
+drawing::LineStyle eLS;
+eLS = drawing::LineStyle_SOLID;
+aXPropSet->setPropertyValue("LineStyle", uno::Any(eLS));
+
+//LineCap : ROUND by default, same as in show mode
+drawing::LineCap eLC;
+eLC = drawing::LineCap_ROUND;
+aXPropSet->setPropertyValue("LineCap", uno::Any(eLC));
+
+//LineColor
+sal_uInt32 nLineColor;
+nLineColor = pCanvasPolyPoly->getRGBALineColor();
+//Transform polygon color from RRGGBBAA to AARRGGBB
+aXPropSet->setPropertyValue("LineColor", 
uno::Any(RGBAColor2UnoColor(nLineColor)));
+
+//LineWidth
+double  fLineWidth;
+fLineWidth = pCanvasPolyPoly->getStrokeWidth();
+aXPropSet->setPropertyValue("LineWidth", 
uno::Any(static_cast(fLineWidth)));
+}
+
 void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< 
lang::XMultiServiceFactory >& xDocFactory )
 {
 //Retrieve Polygons if user ends presentation by context menu
@@ -1444,74 +1498,78 @@ void SlideShowImpl::registerUserPaintPolygons( const 
uno::Reference< lang::XMult
 PolyPolygonVector aPolygons = rPoly.second;
 //Get shapes for the slide
 css::uno::Reference< css::drawing::XShapes > Shapes = rPoly.first;
+
 //Retrieve polygons for one slide
+// #tdf112687 A pen drawing in slideshow is actually a chain of 
individual line shapes, where
+// the end point of one line shape equals the start point of the next 
line shape.
+// We collect these points into one B2DPolygon and use that to 
generate the shape on the
+// slide.
+::basegfx::B2DPolygon aDrawingPoints;
+cppcanvas::PolyPolygonSharedPtr pFirstPolyPoly; // for style properties
 for( const auto& pPolyPoly : aPolygons )
 {
+// Actually, each item in aPolygons has two points, but wrapped in 
a cppcanvas::PopyPolygon.
 ::basegfx::B2DPolyPolygon b2DPolyPoly = 
::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(pPolyPoly->getUNOPolyPolygon());
 
 

[Libreoffice-commits] core.git: slideshow/source

2023-07-05 Thread Khaled Hosny (via logerrit)
 slideshow/source/engine/shapes/drawshapesubsetting.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 5d2fa4ab6e75609c30351f0623dac63182be4c27
Author: Khaled Hosny 
AuthorDate: Wed Jul 5 17:12:19 2023 +0300
Commit: خالد حسني 
CommitDate: Wed Jul 5 23:21:24 2023 +0200

tdf#113290: Fix handling of grapheme clusters in slideshow animations

When doing animations by character cells (AKA grapheme clusters), we
were taking the first character of the cluster only and lumping the rest
with the next cluster, so a combining mark would appear at the start of
the next sequence instead of the end of the current one.

For surrogate pairs it was even more broken we were splitting in the
middle of the pair resulting in invalid Unicode sequence.

Change-Id: I9bbfe412e9b0a876b69e33c0916067bf75064122
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154066
Tested-by: Jenkins
Reviewed-by: خالد حسني 

diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx 
b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
index 264f8f3316b2..13ea0300fa63 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
@@ -579,16 +579,24 @@ namespace slideshow::internal
 aLastWordStart = aNext;
 [[fallthrough]];
 case DrawShapeSubsetting::CLASS_CHARACTER_CELL_END:
+// tdf#113290
+// This is a special case since a character cell
+// (AKA grapheme cluster) can have multiple
+// characters, so if we passed nCurrCharCount to
+// io_rFunctor() it would stop at the first
+// character in the cluster, so we subtract one
+// so that it matches when we reach the start of
+// the next cluster.
 if( !io_rFunctor( 
DrawShapeSubsetting::CLASS_CHARACTER_CELL_END,
-  nCurrCharCount,
+  nCurrCharCount - 1,
   aLastCharStart,
-  aNext ) )
+  aCurr ) )
 {
 return;
 }
 
 ++nCurrCharCount;
-aLastCharStart = aNext;
+aLastCharStart = aCurr;
 break;
 }
 


[Libreoffice-commits] core.git: slideshow/source

2023-04-30 Thread Mike Kaganski (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |2 +-
 slideshow/source/engine/slideview.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d049a1439d7db9cc3c68bbec3b496a61e7a7b855
Author: Mike Kaganski 
AuthorDate: Sun Apr 23 20:14:48 2023 +0300
Commit: Mike Kaganski 
CommitDate: Sun Apr 30 22:36:18 2023 +0200

Use getXWeak in slideshow

Change-Id: Ica0290ee46286ff6d82634c378e40b3605d48a54
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150869
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 9109bb6bb2e0..1d739ded44c7 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -668,7 +668,7 @@ void SlideShowImpl::disposing()
 
 // send all listeners a disposing() that we are going down:
 maListenerContainer.disposeAndClear(
-lang::EventObject( static_cast(this) ) );
+lang::EventObject( getXWeak() ) );
 
 maViewContainer.dispose();
 
diff --git a/slideshow/source/engine/slideview.cxx 
b/slideshow/source/engine/slideview.cxx
index 8b527630bca3..6db623468ac7 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -1025,7 +1025,7 @@ struct WeakRefWrapper
 
 WeakRefWrapper(SlideView & rObj, std::function func)
 : m_rObj(rObj)
-, m_wObj(static_cast<::cppu::OWeakObject*>())
+, m_wObj(rObj.getXWeak())
 , m_func(std::move(func))
 {
 }


[Libreoffice-commits] core.git: slideshow/source

2023-02-22 Thread niket1322git (via logerrit)
 slideshow/source/inc/attributableshape.hxx |5 +
 slideshow/source/inc/expressionnode.hxx|5 +
 slideshow/source/inc/hyperlinkarea.hxx |5 +
 3 files changed, 3 insertions(+), 12 deletions(-)

New commits:
commit e4fb37353e2f9f998c028319c5fa083bf3eaa4cc
Author: niket1322git 
AuthorDate: Wed Feb 22 21:55:03 2023 +0530
Commit: Ilmari Lauhakangas 
CommitDate: Thu Feb 23 05:52:01 2023 +

tdf#143148 Use pragma once instead of include guards

Change-Id: I3d3c34f5f131578c7208c12462f03efac357fa05
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147484
Reviewed-by: Julien Nabet 
Tested-by: Ilmari Lauhakangas 
Reviewed-by: Ilmari Lauhakangas 

diff --git a/slideshow/source/inc/attributableshape.hxx 
b/slideshow/source/inc/attributableshape.hxx
index d903c3b2abbb..f250b60d0e6d 100644
--- a/slideshow/source/inc/attributableshape.hxx
+++ b/slideshow/source/inc/attributableshape.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_ATTRIBUTABLESHAPE_HXX
-#define INCLUDED_SLIDESHOW_SOURCE_INC_ATTRIBUTABLESHAPE_HXX
+#pragma once
 
 #include 
 
@@ -215,6 +214,4 @@ namespace slideshow::internal
 
 }
 
-#endif // INCLUDED_SLIDESHOW_SOURCE_INC_ATTRIBUTABLESHAPE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/inc/expressionnode.hxx 
b/slideshow/source/inc/expressionnode.hxx
index 6f9139012e12..7e3e674a8814 100644
--- a/slideshow/source/inc/expressionnode.hxx
+++ b/slideshow/source/inc/expressionnode.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_EXPRESSIONNODE_HXX
-#define INCLUDED_SLIDESHOW_SOURCE_INC_EXPRESSIONNODE_HXX
+#pragma once
 
 /* Definition of ExpressionNode interface */
 
@@ -73,6 +72,4 @@ namespace slideshow::internal
 
 }
 
-#endif // INCLUDED_SLIDESHOW_SOURCE_INC_EXPRESSIONNODE_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/inc/hyperlinkarea.hxx 
b/slideshow/source/inc/hyperlinkarea.hxx
index d7d760c081f7..7ee124d43649 100644
--- a/slideshow/source/inc/hyperlinkarea.hxx
+++ b/slideshow/source/inc/hyperlinkarea.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_HYPERLINKAREA_HXX
-#define INCLUDED_SLIDESHOW_SOURCE_INC_HYPERLINKAREA_HXX
+#pragma once
 
 #include 
 
@@ -93,6 +92,4 @@ namespace slideshow::internal
 
 }
 
-#endif // INCLUDED_SLIDESHOW_SOURCE_INC_HYPERLINKAREA_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


[Libreoffice-commits] core.git: slideshow/source

2022-11-27 Thread Daniel Lohmann (via logerrit)
 slideshow/source/engine/pointersymbol.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 54681a12b38db29b4d65e3c4f4c52a12436965d0
Author: Daniel Lohmann 
AuthorDate: Sun Nov 27 11:52:56 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 28 08:47:47 2022 +0100

Presenter screen wrong position of pointer

The pointer is drawn on the presenting screen and the presenter
console. In the presenter console the position of the pointer
is not matching the position on the slide or position in the impress
remote app. This fixed by this commit.

Change-Id: I5650f62304934d2acb558e32a8e9de78a9f0a12a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143341
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/slideshow/source/engine/pointersymbol.cxx 
b/slideshow/source/engine/pointersymbol.cxx
index 50f4421add5c..00832a4edf26 100644
--- a/slideshow/source/engine/pointersymbol.cxx
+++ b/slideshow/source/engine/pointersymbol.cxx
@@ -96,8 +96,8 @@ basegfx::B2DPoint 
PointerSymbol::calcSpritePos(UnoViewSharedPtr const & rView) c
 const geometry::IntegerSize2D realTranslationOffset ( 
rView->getTranslationOffset() );
 
 return basegfx::B2DPoint(
-realTranslationOffset.Width + ((aViewArea.Width - aViewArea.X) - 2 * 
realTranslationOffset.Width) * maPos.X,
-realTranslationOffset.Height + ((aViewArea.Height - aViewArea.Y) - 2 * 
realTranslationOffset.Height) * maPos.Y);
+realTranslationOffset.Width + (aViewArea.Width * maPos.X),
+realTranslationOffset.Height + (aViewArea.Height * maPos.Y));
 }
 
 void PointerSymbol::viewAdded( const UnoViewSharedPtr& rView )


[Libreoffice-commits] core.git: slideshow/source

2022-11-27 Thread Daniel Lohmann (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 176f77607ed1001efca402d1807e12b93d914847
Author: Daniel Lohmann 
AuthorDate: Sun Nov 27 11:45:48 2022 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Nov 28 08:46:52 2022 +0100

Do not draw pointer on paused mode screen

If the pointer is drawn on the paused mode screen, around the pointer
the slide will be visible. Everywhere where the pointer was will the
slide is visible. Preventing to draw the pointer in the paused mode will
fix this issue.

Change-Id: Ica8fedca5710adfc79ed78a30485bd755e3b3b31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143340
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 1cbc167a4c4d..264a4dee8217 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1750,7 +1750,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 if (!(rProperty.Value >>= visible))
 return false;
 
-mpPointerSymbol->setVisible(visible);
+if (!mbShowPaused)
+mpPointerSymbol->setVisible(visible);
+
 return true;
 }
 
@@ -1760,7 +1762,9 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 if (! (rProperty.Value >>= pos))
 return false;
 
-mpPointerSymbol->viewsChanged(pos);
+if (!mbShowPaused)
+mpPointerSymbol->viewsChanged(pos);
+
 return true;
 }
 


[Libreoffice-commits] core.git: slideshow/source

2022-11-10 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/tools.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7ac572437ac972ef37aed8003f5a476f49b27b89
Author: Andrea Gelmini 
AuthorDate: Wed Nov 9 23:32:31 2022 +0100
Commit: Julien Nabet 
CommitDate: Thu Nov 10 12:53:58 2022 +0100

Fix typo

Change-Id: Iaadab3d52a47deff3c1d2539068d197bbddd2852
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142505
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/tools.cxx 
b/slideshow/source/engine/tools.cxx
index d48bda952462..de7030f80778 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -692,7 +692,7 @@ namespace slideshow::internal
 
 // tdf#148884 in dark mode impress's auto text color assumes it 
will render against
 // the DOCCOLOR by default, so leaving this as white gives white 
on white, this
-// looks the simplest approach, propogate dark mode into slideshow 
mode instead
+// looks the simplest approach, propagate dark mode into slideshow 
mode instead
 // of reformatting to render onto a white slideshow
 svtools::ColorConfig aColorConfig;
 Color aApplicationDocumentColor = 
aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;


[Libreoffice-commits] core.git: slideshow/source

2022-11-09 Thread Caolán McNamara (via logerrit)
 slideshow/source/engine/tools.cxx |   30 +-
 1 file changed, 21 insertions(+), 9 deletions(-)

New commits:
commit d39303f7ea696d36c4ab65286d4b7d8d1bb9069a
Author: Caolán McNamara 
AuthorDate: Tue Nov 8 16:02:14 2022 +
Commit: Caolán McNamara 
CommitDate: Wed Nov 9 11:57:31 2022 +0100

Resolves: tdf#148884 impress slideshow uses white text on white in dark mode

In dark mode impress's auto text color assumes it will render against
the DOCCOLOR by default, so leaving this as white gives white on white,
this looks the simplest approach, propogate DOCCOLOR as the default
slideshow background instead of reformatting to render onto a white
slideshow

Change-Id: Id484e14ce96fd05cb16a35586d83e37b36933c20
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142464
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/engine/tools.cxx 
b/slideshow/source/engine/tools.cxx
index 3567fa5c146b..d48bda952462 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -42,6 +42,8 @@
 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -688,19 +690,29 @@ namespace slideshow::internal
rSize.getY() ),
   0x00FFU );
 
-// fill the bounds rectangle in white. Subtract one pixel
-// from both width and height, because the slide size is
-// chosen one pixel larger than given by the drawing
-// layer. This is because shapes with line style, that
-// have the size of the slide would otherwise be cut
-// off. OTOH, every other slide background (solid fill,
-// gradient, bitmap) render one pixel less, thus revealing
-// ugly white pixel to the right and the bottom.
+// tdf#148884 in dark mode impress's auto text color assumes it 
will render against
+// the DOCCOLOR by default, so leaving this as white gives white 
on white, this
+// looks the simplest approach, propogate dark mode into slideshow 
mode instead
+// of reformatting to render onto a white slideshow
+svtools::ColorConfig aColorConfig;
+Color aApplicationDocumentColor = 
aColorConfig.GetColorValue(svtools::DOCCOLOR).nColor;
+cppcanvas::IntSRGBA nCanvasColor = 
cppcanvas::makeColor(aApplicationDocumentColor.GetRed(),
+
aApplicationDocumentColor.GetGreen(),
+
aApplicationDocumentColor.GetBlue(),
+0xFF);
+
+// fill the bounds rectangle in DOCCOLOR (typically white).
+// Subtract one pixel from both width and height, because the slide
+// size is chosen one pixel larger than given by the drawing layer.
+// This is because shapes with line style, that have the size of
+// the slide would otherwise be cut off. OTOH, every other slide
+// background (solid fill, gradient, bitmap) render one pixel less,
+// thus revealing ugly white pixel to the right and the bottom.
 fillRect( pCanvas,
   ::basegfx::B2DRectangle( 0.0, 0.0,
rSize.getX()-1,
rSize.getY()-1 ),
-  0xU );
+  nCanvasColor );
 }
 
 ::basegfx::B2DRectangle getAPIShapeBounds( const uno::Reference< 
drawing::XShape >& xShape )


[Libreoffice-commits] core.git: slideshow/source

2022-09-19 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/shapes/drawshape.cxx |2 +-
 slideshow/source/engine/shapes/drawshape.hxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c6c3e364697a908949409ab2c77d0e0b021b65d3
Author: Andrea Gelmini 
AuthorDate: Mon Sep 19 18:46:59 2022 +0200
Commit: Julien Nabet 
CommitDate: Mon Sep 19 21:21:21 2022 +0200

Fix typos

Change-Id: If24b9756d7fd8f6346580b4da84fac4f5ab1d3ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140198
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/shapes/drawshape.cxx 
b/slideshow/source/engine/shapes/drawshape.cxx
index bc50fc695375..f7ffbe1de622 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -401,7 +401,7 @@ namespace slideshow::internal
 // It lets us detect the potential error case that a PageField 
is contained in
 // the Text of the Shape. That is a hint that maBounds 
contains the wrong Range
 // and needs to be corrected. The correct size is in the 
PrefSize of the metafile.
-// For more backgrund information please refer to tdf#150402, 
Comment 16.
+// For more background information please refer to tdf#150402, 
Comment 16.
 const double fWidthDiff(fabs(mpCurrMtf->GetPrefSize().Width() 
- maBounds.getWidth()));
 const double 
fHeightDiff(fabs(mpCurrMtf->GetPrefSize().Height() - maBounds.getHeight()));
 
diff --git a/slideshow/source/engine/shapes/drawshape.hxx 
b/slideshow/source/engine/shapes/drawshape.hxx
index 4ede703cc982..6c71d151b6fa 100644
--- a/slideshow/source/engine/shapes/drawshape.hxx
+++ b/slideshow/source/engine/shapes/drawshape.hxx
@@ -349,7 +349,7 @@ namespace slideshow::internal
 /// whether a drawing layer animation has to be performed
 bool   
 mbDrawingLayerAnim;
 
-/// tdf#150402 wether mpCurrMtf contains any Text with a PageField 
("FIELD_SEQ_BEGIN;PageField")
+/// tdf#150402 whether mpCurrMtf contains any Text with a 
PageField ("FIELD_SEQ_BEGIN;PageField")
 mutable bool   
 mbContainsPageField;
 };
 


[Libreoffice-commits] core.git: slideshow/source

2022-09-19 Thread Armin Le Grand (allotropia) (via logerrit)
 slideshow/source/engine/shapes/drawshape.cxx |   33 ---
 slideshow/source/engine/shapes/drawshape.hxx |2 +
 2 files changed, 32 insertions(+), 3 deletions(-)

New commits:
commit 1b0ff1c166211b34370f53995ae9fb3f8eed182e
Author: Armin Le Grand (allotropia) 
AuthorDate: Mon Sep 19 11:48:20 2022 +0200
Commit: Armin Le Grand 
CommitDate: Mon Sep 19 16:24:46 2022 +0200

tdf#150402 Correct wrong Bound of Shape in Slideshow

Added and use mbContainsPageField that gets set in
prepareHyperlinkIndices() which has to be run anyways,
so this will cause no change in execution speed.

It lets us detect the potential error case that a
PageField is contained in the Text of the Shape.
That is a hint that maBounds contains the wrong Range
and needs to be corrected.

For more backgrund information please refer to
tdf#150402, Comment 16.

Change-Id: Ifee01fffdb6e2f5915aa705afc7b5842781aae91
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140144
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 

diff --git a/slideshow/source/engine/shapes/drawshape.cxx 
b/slideshow/source/engine/shapes/drawshape.cxx
index ba6f2b0cbfb2..bc50fc695375 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -367,7 +367,8 @@ namespace slideshow::internal
 mbIsVisible( true ),
 mbForceUpdate( false ),
 mbAttributeLayerRevoked( false ),
-mbDrawingLayerAnim( false )
+mbDrawingLayerAnim( false ),
+mbContainsPageField( false )
 {
 ENSURE_OR_THROW( mxShape.is(), "DrawShape::DrawShape(): Invalid 
XShape" );
 ENSURE_OR_THROW( mxPage.is(), "DrawShape::DrawShape(): Invalid 
containing page" );
@@ -392,6 +393,26 @@ namespace slideshow::internal
 maSubsetting.reset( mpCurrMtf );
 
 prepareHyperlinkIndices();
+
+if(mbContainsPageField && mpCurrMtf && !maBounds.isEmpty())
+{
+// tdf#150402 Use mbContainsPageField that gets set in 
prepareHyperlinkIndices
+// which has to be run anyways, so this will cause no harm in 
execution speed.
+// It lets us detect the potential error case that a PageField 
is contained in
+// the Text of the Shape. That is a hint that maBounds 
contains the wrong Range
+// and needs to be corrected. The correct size is in the 
PrefSize of the metafile.
+// For more backgrund information please refer to tdf#150402, 
Comment 16.
+const double fWidthDiff(fabs(mpCurrMtf->GetPrefSize().Width() 
- maBounds.getWidth()));
+const double 
fHeightDiff(fabs(mpCurrMtf->GetPrefSize().Height() - maBounds.getHeight()));
+
+if(fWidthDiff > 1.0 || fHeightDiff > 1.0)
+{
+maBounds = basegfx::B2DRange(
+maBounds.getMinX(), maBounds.getMinY(),
+maBounds.getMinX() + mpCurrMtf->GetPrefSize().Width(),
+maBounds.getMinY() + 
mpCurrMtf->GetPrefSize().Height());
+}
+}
 }
 
 DrawShape::DrawShape( const uno::Reference< drawing::XShape >&  
xShape,
@@ -426,7 +447,8 @@ namespace slideshow::internal
 mbIsVisible( true ),
 mbForceUpdate( false ),
 mbAttributeLayerRevoked( false ),
-mbDrawingLayerAnim( false )
+mbDrawingLayerAnim( false ),
+mbContainsPageField( false )
 {
 ENSURE_OR_THROW( rGraphic.IsAnimated(),
   "DrawShape::DrawShape(): Graphic is no 
animation" );
@@ -476,7 +498,8 @@ namespace slideshow::internal
 mbIsVisible( rSrc.mbIsVisible ),
 mbForceUpdate( false ),
 mbAttributeLayerRevoked( false ),
-mbDrawingLayerAnim( false )
+mbDrawingLayerAnim( false ),
+mbContainsPageField( false )
 {
 ENSURE_OR_THROW( mxShape.is(), "DrawShape::DrawShape(): Invalid 
XShape" );
 ENSURE_OR_THROW( mpCurrMtf, "DrawShape::DrawShape(): Invalid 
metafile" );
@@ -868,6 +891,10 @@ namespace slideshow::internal
 {
 maHyperlinkIndices.back().second = nIndex;
 }
+else if 
(pAct->GetComment().equalsIgnoreAsciiCase("FIELD_SEQ_BEGIN;PageField"))
+{
+mbContainsPageField = true;
+}
 ++nIndex;
 }
 else
diff --git a/slideshow/source/engine/shapes/drawshape.hxx 
b/slideshow/source/engine/shapes/drawshape.hxx
index e775a891f679..4ede703cc982 100644
--- a/slideshow/source/engine/shapes/drawshape.hxx
+++ b/slideshow/source/engine/shapes/drawshape.hxx
@@ -349,6 +349,8 @@ 

[Libreoffice-commits] core.git: slideshow/source

2022-08-23 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/eventqueue.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4c27aaa787a67e05a592adcf6cf42e49b7a02eaf
Author: Stephan Bergmann 
AuthorDate: Tue Aug 23 15:37:06 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Aug 23 17:24:34 2022 +0200

-Werror=redundant-move

...with recent GCC 16 trunk.  Introduced with
1a2926a995fdbdcdae0ca6407877084f3520e539 "use std::move when popping stuff 
off
stacks" but which doesn't make sense here where std::priority_queue's top()
unconditionally returns a const reference (unlike std::stack's top()).

Change-Id: I408920220e3b7ffe775fa87f9edbfdc7721058db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138732
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index 4a46a0c806b6..86d58a5fe6b2 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -172,7 +172,7 @@ namespace slideshow::internal
 && !bFireAllEvents
 && (maEvents.empty() || maEvents.top().nTime > nCurrTime))
 {
-const EventEntry aEvent (std::move(maNextNextEvents.top()));
+const EventEntry aEvent (maNextNextEvents.top());
 maNextNextEvents.pop();
 maEvents.push(aEvent);
 }
@@ -184,7 +184,7 @@ namespace slideshow::internal
 while( !maEvents.empty() &&
(bFireAllEvents || maEvents.top().nTime <= nCurrTime) )
 {
-EventEntry event( std::move(maEvents.top()) );
+EventEntry event( maEvents.top() );
 maEvents.pop();
 
 // only process event, if it is still 'charged',


[Libreoffice-commits] core.git: slideshow/source

2022-08-03 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/activities/activitiesfactory.cxx   |   17 ++---
 slideshow/source/engine/activitiesqueue.cxx|5 -
 slideshow/source/engine/animatedsprite.cxx |5 -
 slideshow/source/engine/animationfactory.cxx   |   17 ++---
 slideshow/source/engine/animationnodes/animationaudionode.cxx  |5 -
 slideshow/source/engine/animationnodes/animationcolornode.cxx  |5 -
 slideshow/source/engine/animationnodes/basenode.cxx|5 -
 slideshow/source/engine/animationnodes/setactivity.hxx |9 +-
 slideshow/source/engine/box2dtools.cxx |3 
 slideshow/source/engine/effectrewinder.cxx |5 -
 slideshow/source/engine/eventmultiplexer.cxx   |4 -
 slideshow/source/engine/eventqueue.cxx |5 -
 slideshow/source/engine/expressionnodefactory.cxx  |9 +-
 slideshow/source/engine/opengl/TransitionerImpl.cxx|5 -
 slideshow/source/engine/pointersymbol.cxx  |5 -
 slideshow/source/engine/pointersymbol.hxx  |2 
 slideshow/source/engine/shapes/appletshape.cxx |7 +-
 slideshow/source/engine/shapes/drawinglayeranimation.cxx   |7 +-
 slideshow/source/engine/shapes/drawshape.cxx   |5 -
 slideshow/source/engine/shapes/drawshape.hxx   |2 
 slideshow/source/engine/shapes/gdimtftools.hxx |5 -
 slideshow/source/engine/shapes/shapeimporter.cxx   |   15 ++--
 slideshow/source/engine/shapes/viewappletshape.cxx |9 +-
 slideshow/source/engine/shapes/viewappletshape.hxx |4 -
 slideshow/source/engine/shapes/viewbackgroundshape.cxx |5 -
 slideshow/source/engine/shapes/viewbackgroundshape.hxx |2 
 slideshow/source/engine/shapes/viewmediashape.cxx  |9 +-
 slideshow/source/engine/shapes/viewmediashape.hxx  |4 -
 slideshow/source/engine/shapes/viewshape.cxx   |5 -
 slideshow/source/engine/shapes/viewshape.hxx   |2 
 slideshow/source/engine/shapesubset.cxx|   17 ++---
 slideshow/source/engine/slide/layer.cxx|5 -
 slideshow/source/engine/slide/layer.hxx|9 +-
 slideshow/source/engine/slide/layermanager.cxx |5 -
 slideshow/source/engine/slide/shapemanagerimpl.cxx |5 -
 slideshow/source/engine/slide/shapemanagerimpl.hxx |2 
 slideshow/source/engine/slide/slideanimations.cxx  |5 -
 slideshow/source/engine/slide/slideanimations.hxx  |2 
 slideshow/source/engine/slide/slideimpl.cxx|   13 ++-
 slideshow/source/engine/slide/targetpropertiescreator.cxx  |5 -
 slideshow/source/engine/slideshowcontext.cxx   |7 +-
 slideshow/source/engine/slideshowimpl.cxx  |7 +-
 slideshow/source/engine/slideview.cxx  |   13 ++-
 slideshow/source/engine/smilfunctionparser.cxx |   33 
+-
 slideshow/source/engine/transitions/figurewipe.hxx |4 -
 slideshow/source/engine/transitions/slidechangebase.cxx|9 +-
 slideshow/source/engine/transitions/slidechangebase.hxx|9 +-
 slideshow/source/engine/transitions/slidetransitionfactory.cxx |   11 +--
 slideshow/source/engine/waitsymbol.cxx |5 -
 slideshow/source/engine/waitsymbol.hxx |2 
 slideshow/source/inc/activitiesfactory.hxx |9 +-
 slideshow/source/inc/activitiesqueue.hxx   |2 
 slideshow/source/inc/animatedsprite.hxx|2 
 slideshow/source/inc/basenode.hxx  |7 +-
 slideshow/source/inc/delayevent.hxx|5 -
 slideshow/source/inc/event.hxx |5 -
 slideshow/source/inc/eventqueue.hxx|8 +-
 slideshow/source/inc/interruptabledelayevent.hxx   |6 +
 slideshow/source/inc/shapeimporter.hxx |4 -
 slideshow/source/inc/shapesubset.hxx   |8 +-
 slideshow/source/inc/slideshowcontext.hxx  |2 
 61 files changed, 230 insertions(+), 183 deletions(-)

New commits:
commit 41aad592685b0b36c2e5f1033e7263aef406c28b
Author: Noel Grandin 
AuthorDate: Wed Aug 3 12:08:53 2022 +0200
Commit: Noel Grandin 
CommitDate: Wed Aug 3 14:42:43 2022 +0200

clang-tidy modernize-pass-by-value in slideshow

Change-Id: I89a56aa3d267f22665769ba073a47d1208d8b55d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137745
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git 

[Libreoffice-commits] core.git: slideshow/source

2022-06-27 Thread dldld (via logerrit)
 slideshow/source/engine/opengl/TransitionerImpl.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 398ceced15ee4fdd24b1f8db5e09096c3afa4804
Author: dldld 
AuthorDate: Thu May 26 22:50:27 2022 +0200
Commit: Caolán McNamara 
CommitDate: Mon Jun 27 18:56:33 2022 +0200

tdf#91456 OpenGL context rendered without slide on it

When an OpenGL transition is initialized the screen might show
for a short time a black screen, because the slide was not directly
drawn onto the context and therefore a short black flash was visible
on the beginning of the silde transition.

This issue did on my side only occur, when the slide was changed
by going to a specific slide, moving to the next slide was fine, like
shown in the recorded video in the bug tracker. It seems that all
events which are going over the EventMultiplexer are not having
this flickering issue, as the moments when the drawing is
happening are different.

Change-Id: If57d9518e74d3a2ede166fd7e55ef5b290274109
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135031
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx 
b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index f3cc33abf3f6..faef77988442 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -444,6 +444,12 @@ bool OGLTransitionerImpl::setTransition( const 
std::shared_ptr

[Libreoffice-commits] core.git: slideshow/source

2022-05-31 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/animationnodes/basecontainernode.cxx |7 ---
 slideshow/source/engine/shapes/appletshape.cxx   |7 ---
 slideshow/source/engine/shapes/backgroundshape.cxx   |7 ---
 slideshow/source/engine/shapes/drawshape.cxx |7 ---
 slideshow/source/engine/shapes/mediashape.cxx|7 ---
 5 files changed, 20 insertions(+), 15 deletions(-)

New commits:
commit 4c60697daaecc8be0a00e900ba1b4b62713e43df
Author: Stephan Bergmann 
AuthorDate: Tue May 31 20:47:59 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Tue May 31 22:03:22 2022 +0200

The return value of std::count_if is guaranteed to be non-negative

...so use o3tl::make_unsigned when comparing it against an expression of
unsigned integer type, instead of casting that expression to a signed type

Change-Id: I487fd04eafbf8c56b8b6bfce579b477d8f34a052
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135206
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx 
b/slideshow/source/engine/animationnodes/basecontainernode.cxx
index cde434f3d7bd..709f5392ac8a 100644
--- a/slideshow/source/engine/animationnodes/basecontainernode.cxx
+++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx
@@ -24,6 +24,7 @@
 #include 
 #include "nodetools.hxx"
 #include 
+#include 
 #include 
 
 #include 
@@ -80,10 +81,10 @@ bool BaseContainerNode::init_children()
 mnFinishedChildren = 0;
 
 // initialize all children
-return (std::count_if(
+return (o3tl::make_unsigned(std::count_if(
 maChildren.begin(), maChildren.end(),
-std::mem_fn(::init) ) ==
-static_cast(maChildren.size()));
+std::mem_fn(::init) )) ==
+maChildren.size());
 }
 
 void BaseContainerNode::deactivate_st( NodeState eDestState )
diff --git a/slideshow/source/engine/shapes/appletshape.cxx 
b/slideshow/source/engine/shapes/appletshape.cxx
index 102dc6aaf3f4..ba7c6243b30b 100644
--- a/slideshow/source/engine/shapes/appletshape.cxx
+++ b/slideshow/source/engine/shapes/appletshape.cxx
@@ -23,6 +23,7 @@
 #include "viewappletshape.hxx"
 #include 
 
+#include 
 #include 
 
 #include 
@@ -210,12 +211,12 @@ namespace slideshow::internal
 bool AppletShape::implRender( const ::basegfx::B2DRange& rCurrBounds ) 
const
 {
 // redraw all view shapes, by calling their update() method
-if( ::std::count_if( maViewAppletShapes.begin(),
+if( o3tl::make_unsigned(::std::count_if( 
maViewAppletShapes.begin(),
  maViewAppletShapes.end(),
  []
  ( const ViewAppletShapeSharedPtr& pShape )
- { return pShape->render( rCurrBounds ); } )
-!= 
static_cast(maViewAppletShapes.size()) )
+ { return pShape->render( rCurrBounds ); } ))
+!= maViewAppletShapes.size() )
 {
 // at least one of the ViewShape::update() calls did return
 // false - update failed on at least one ViewLayer
diff --git a/slideshow/source/engine/shapes/backgroundshape.cxx 
b/slideshow/source/engine/shapes/backgroundshape.cxx
index b107fe4af038..d304b9f901e6 100644
--- a/slideshow/source/engine/shapes/backgroundshape.cxx
+++ b/slideshow/source/engine/shapes/backgroundshape.cxx
@@ -21,6 +21,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 #include 
@@ -258,11 +259,11 @@ namespace slideshow::internal
 }
 
 // redraw all view shapes, by calling their render() method
-if( ::std::count_if( maViewShapes.begin(),
+if( o3tl::make_unsigned(::std::count_if( maViewShapes.begin(),
  maViewShapes.end(),
  [this]( const ViewBackgroundShapeSharedPtr& 
pBgShape )
- { return pBgShape->render( this->mpMtf ); } )
-!= 
static_cast(maViewShapes.size()) )
+ { return pBgShape->render( this->mpMtf ); } ))
+!= maViewShapes.size() )
 {
 // at least one of the ViewBackgroundShape::render() calls did 
return
 // false - update failed on at least one ViewLayer
diff --git a/slideshow/source/engine/shapes/drawshape.cxx 
b/slideshow/source/engine/shapes/drawshape.cxx
index f8e03ebff36f..22b65bf28e21 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -21,6 +21,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -146,15 +147,15 @@ namespace slideshow::internal
 // redraw all view shapes, by calling their update() method
 ViewShape::RenderArgs renderArgs( getViewRenderArgs() 

[Libreoffice-commits] core.git: slideshow/source

2022-05-25 Thread Caolán McNamara (via logerrit)
 slideshow/source/engine/opengl/TransitionerImpl.cxx |   17 -
 1 file changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 1bfbef9ad2092106c8f1f6c3e5942940173c2d15
Author: Caolán McNamara 
AuthorDate: Wed May 25 11:49:24 2022 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 25 16:35:01 2022 +0200

tdf#149068 don't call any OpenGL if the context is initially 'invalid'

Change-Id: I6a966e84574716a215d1625cde8b6826185cc451
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134935
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx 
b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index 6f9e2a26001d..f3cc33abf3f6 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -266,15 +266,15 @@ bool OGLTransitionerImpl::initialize( const Reference< 
presentation::XSlideShowV
 
 setSlides( xLeavingSlide, xEnteringSlide );
 
-CHECK_GL_ERROR();
 return mbValidOpenGLContext;
 }
 
 void OGLTransitionerImpl::impl_initializeFlags( bool const bValidContext )
 {
-CHECK_GL_ERROR();
 mbValidOpenGLContext = bValidContext;
 if ( bValidContext ) {
+CHECK_GL_ERROR();
+
 mnGLVersion = OpenGLHelper::getGLVersion();
 SAL_INFO("slideshow.opengl", "GL version: " << mnGLVersion << "" );
 
@@ -283,8 +283,9 @@ void OGLTransitionerImpl::impl_initializeFlags( bool const 
bValidContext )
 /* TODO: check for version once the bug in fglrx driver is fixed */
 mbBrokenTexturesATI = (vendor && strcmp( reinterpret_cast(vendor), "ATI Technologies Inc." ) == 0 );
 #endif
+
+CHECK_GL_ERROR();
 }
-CHECK_GL_ERROR();
 }
 
 bool OGLTransitionerImpl::initWindowFromSlideShowView( const Reference< 
presentation::XSlideShowView >& xView )
@@ -1075,6 +1076,9 @@ void SAL_CALL OGLTransitionerImpl::viewChanged( const 
Reference< presentation::X
 
 void OGLTransitionerImpl::disposeTextures()
 {
+if (!mbValidOpenGLContext)
+return;
+
 mpContext->makeCurrent();
 CHECK_GL_ERROR();
 
@@ -1088,8 +1092,11 @@ void OGLTransitionerImpl::disposeTextures()
 
 void OGLTransitionerImpl::impl_dispose()
 {
-mpContext->makeCurrent();
-CHECK_GL_ERROR();
+if (mbValidOpenGLContext)
+{
+mpContext->makeCurrent();
+CHECK_GL_ERROR();
+}
 
 if( mpTransition && mpTransition->getSettings().mnRequiredGLVersion <= 
mnGLVersion )
 mpTransition->finish();


[Libreoffice-commits] core.git: slideshow/source

2022-05-08 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/eventqueue.cxx |   20 ++--
 slideshow/source/inc/eventqueue.hxx|4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 9974ed792a1141fe3c3dc0a1ec5255a23e76f27b
Author: Noel Grandin 
AuthorDate: Sat May 7 21:15:36 2022 +0200
Commit: Noel Grandin 
CommitDate: Sun May 8 16:38:52 2022 +0200

osl::Mutex->std::mutex in slideshow::EventQueue

Change-Id: Ie9e53e5dc2c842e11457846b5f177fc55683e0d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134016
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index 6094fa43bf89..b63db471d5ef 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -77,7 +77,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEvent( const EventSharedPtr& rEvent )
 {
-::osl::MutexGuard aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rEvent->GetDescription()
 << "\" [" << rEvent.get()
@@ -103,7 +103,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
 {
-::osl::MutexGuard aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rEvent->GetDescription()
 << "\" [" << rEvent.get()
@@ -120,7 +120,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEventWhenQueueIsEmpty (const EventSharedPtr& 
rpEvent)
 {
-::osl::MutexGuard aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rpEvent->GetDescription()
 << "\" [" << rpEvent.get()
@@ -140,20 +140,18 @@ namespace slideshow::internal
 
 void EventQueue::forceEmpty()
 {
-::osl::MutexGuard aGuard( maMutex );
-
 process_(true);
 }
 
 void EventQueue::process()
 {
-::osl::MutexGuard aGuard( maMutex );
-
 process_(false);
 }
 
 void EventQueue::process_( bool bFireAllEvents )
 {
+std::unique_lock aGuard( maMutex );
+
 SAL_INFO("slideshow.verbose", "EventQueue: heartbeat" );
 
 // add in all that have been added explicitly for this round:
@@ -197,6 +195,7 @@ namespace slideshow::internal
 // the need to prune queues of those inactive shells.
 if( event.pEvent->isCharged() )
 {
+aGuard.unlock();
 try
 {
 SAL_INFO("slideshow.eventqueue", "firing event \""
@@ -243,6 +242,7 @@ namespace slideshow::internal
 // still better let our clients now...
 SAL_WARN("slideshow.eventqueue", 
"::presentation::internal::EventQueue: Event threw a SlideShowException, action 
might not have been fully performed" );
 }
+aGuard.lock();
 }
 else
 {
@@ -257,14 +257,14 @@ namespace slideshow::internal
 
 bool EventQueue::isEmpty() const
 {
-::osl::MutexGuard aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 
 return maEvents.empty() && maNextEvents.empty() && 
maNextNextEvents.empty();
 }
 
 double EventQueue::nextTimeout() const
 {
-::osl::MutexGuard aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 
 // return time for next entry (if any)
 double nTimeout (::std::numeric_limits::max());
@@ -281,7 +281,7 @@ namespace slideshow::internal
 
 void EventQueue::clear()
 {
-::osl::MutexGuard aGuard( maMutex );
+std::unique_lock aGuard( maMutex );
 
 // TODO(P1): Maybe a plain vector and vector.swap will
 // be faster here. Profile.
diff --git a/slideshow/source/inc/eventqueue.hxx 
b/slideshow/source/inc/eventqueue.hxx
index 63c93f7a302d..fb0f1b8536eb 100644
--- a/slideshow/source/inc/eventqueue.hxx
+++ b/slideshow/source/inc/eventqueue.hxx
@@ -21,10 +21,10 @@
 #define INCLUDED_SLIDESHOW_SOURCE_INC_EVENTQUEUE_HXX
 
 #include 
-#include 
 
 #include "event.hxx"
 
+#include 
 #include 
 #include 
 
@@ -116,7 +116,7 @@ namespace slideshow::internal
 getTimer() const { return mpTimer; }
 
 private:
-mutable ::osl::Mutex  maMutex;
+mutable std::mutex  maMutex;
 
 struct EventEntry
 {


[Libreoffice-commits] core.git: slideshow/source

2022-05-03 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/animationnodes/basenode.cxx   |2 +-
 slideshow/source/engine/slide/targetpropertiescreator.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 75f008ff116f936e51f268c3fa6775de7addee7a
Author: Stephan Bergmann 
AuthorDate: Tue May 3 23:18:51 2022 +0200
Commit: Stephan Bergmann 
CommitDate: Wed May 4 06:54:45 2022 +0200

Just use Any ctor instead of makeAny in slideshow

Change-Id: I9b006826fe4a859e07340c8e39d99fd89d4f31c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133781
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/animationnodes/basenode.cxx 
b/slideshow/source/engine/animationnodes/basenode.cxx
index cf732f89701f..5e98b63bbd65 100644
--- a/slideshow/source/engine/animationnodes/basenode.cxx
+++ b/slideshow/source/engine/animationnodes/basenode.cxx
@@ -245,7 +245,7 @@ bool isMainSequenceRootNode_(
 // end-of-mainsequence signalling below)
 beans::NamedValue const aSearchKey(
 "node-type",
-uno::makeAny( presentation::EffectNodeType::MAIN_SEQUENCE ) );
+uno::Any( presentation::EffectNodeType::MAIN_SEQUENCE ) );
 
 uno::Sequence const userData(xNode->getUserData());
 return findNamedValue( userData, aSearchKey );
diff --git a/slideshow/source/engine/slide/targetpropertiescreator.cxx 
b/slideshow/source/engine/slide/targetpropertiescreator.cxx
index 035b6e6e1a98..fdc45c3daac6 100644
--- a/slideshow/source/engine/slide/targetpropertiescreator.cxx
+++ b/slideshow/source/engine/slide/targetpropertiescreator.cxx
@@ -300,7 +300,7 @@ namespace slideshow::internal
 beans::NamedValue(
 
//xAnimateNode->getAttributeName(),
 "visibility",
-uno::makeAny( bVisible ) ) ) );
+uno::Any( bVisible ) ) ) );
 break;
 }
 }


[Libreoffice-commits] core.git: slideshow/source

2022-04-14 Thread Thorsten Behrens (via logerrit)
 slideshow/source/engine/activities/simplecontinuousactivitybase.cxx |   12 
+++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit e1db8c27875eac73b1e619e4a23ecdb7a9924b61
Author: Thorsten Behrens 
AuthorDate: Thu Apr 14 12:01:50 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Thu Apr 14 19:29:03 2022 +0200

Resolves: tdf#143615 clamp relative times to 1.0

User input permits zero-length animations, so whenever we calculate
relative position within the animation time frame, the case
mnMinSimpleDuration == 0.0 means: we're already at the end of the
animation, i.e. set relative time to 1.0

Change-Id: I0e8c1e29f47bd9fa16f04115cf52d3a176e13fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133005
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git 
a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx 
b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
index 9e23fc2c76c8..01cb3b75007b 100644
--- a/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
+++ b/slideshow/source/engine/activities/simplecontinuousactivitybase.cxx
@@ -63,9 +63,12 @@ namespace slideshow::internal
 // perform will be called at least mnMinNumberOfTurns
 // times.
 
-// fraction of time elapsed
+// fraction of time elapsed (clamp to 1.0 for zero-length
+// animations)
 const double nFractionElapsedTime(
-nCurrElapsedTime / mnMinSimpleDuration );
+mnMinSimpleDuration != 0.0 ?
+nCurrElapsedTime / mnMinSimpleDuration :
+1.0 );
 
 // fraction of minimum calls performed
 const double nFractionRequiredCalls(
@@ -115,7 +118,10 @@ namespace slideshow::internal
 // ===
 
 const double nCurrElapsedTime( maTimer.getElapsedTime() );
-double nT( nCurrElapsedTime / mnMinSimpleDuration );
+// clamp to 1.0 for zero animation duration
+double nT( mnMinSimpleDuration != 0.0 ?
+   nCurrElapsedTime / mnMinSimpleDuration :
+   1.0 );
 
 
 // one of the stop criteria reached?


[Libreoffice-commits] core.git: slideshow/source

2022-02-24 Thread Caolán McNamara (via logerrit)
 slideshow/source/engine/smilfunctionparser.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 81b88be38651ae871f68f6a0425da56a12494ae2
Author: Caolán McNamara 
AuthorDate: Thu Feb 24 10:04:31 2022 +
Commit: Caolán McNamara 
CommitDate: Thu Feb 24 15:33:16 2022 +0100

cid#1500712 silence Explicit null dereferenced

Change-Id: I5f7fc843fadfde9f1807350fc879ecea22d4817f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130487
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/engine/smilfunctionparser.cxx 
b/slideshow/source/engine/smilfunctionparser.cxx
index 3576393751ed..06a2b9639959 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -313,9 +313,11 @@ namespace slideshow::internal
 // create combined ExpressionNode
 std::shared_ptr pNode( maGenerator( 
pFirstArg,
 pSecondArg ) );
+
+assert(pSecondArg && pFirstArg);
+
 // check for constness
-if( pFirstArg->isConstant() &&
-pSecondArg->isConstant() )
+if (pFirstArg->isConstant() && pSecondArg->isConstant())
 {
 // call the operator() at pNode, store result
 // in constant value ExpressionNode.


[Libreoffice-commits] core.git: slideshow/source

2022-02-02 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/box2dtools.cxx |4 ++--
 slideshow/source/inc/box2dtools.hxx|4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit ee91c0b0fa03a59581bbc67709756b565cddff52
Author: Andrea Gelmini 
AuthorDate: Tue Feb 1 16:18:49 2022 +0100
Commit: Julien Nabet 
CommitDate: Wed Feb 2 15:26:01 2022 +0100

Fix function name

Change-Id: I53a9018ed96b66095ddfc87ad24dc32e2e5bb485
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129319
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index cb365165a274..c6009afa6878 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -387,7 +387,7 @@ void box2DWorld::processUpdateQueue(const double 
fPassedTime)
 }
 }
 
-void box2DWorld::initateAllShapesAsStaticBodies(
+void box2DWorld::initiateAllShapesAsStaticBodies(
 const slideshow::internal::ShapeManagerSharedPtr& pShapeManager)
 {
 assert(mpBox2DWorld);
@@ -592,7 +592,7 @@ void box2DWorld::alertPhysicsAnimationStart(
 initiateWorld(rSlideSize);
 
 if (!mbShapesInitialized)
-initateAllShapesAsStaticBodies(pShapeManager);
+initiateAllShapesAsStaticBodies(pShapeManager);
 
 mnPhysicsAnimationCounter++;
 }
diff --git a/slideshow/source/inc/box2dtools.hxx 
b/slideshow/source/inc/box2dtools.hxx
index c7edd00ca27b..e876468df7e6 100644
--- a/slideshow/source/inc/box2dtools.hxx
+++ b/slideshow/source/inc/box2dtools.hxx
@@ -306,8 +306,8 @@ public:
 const float fDensity = 1.0f, const 
float fFriction = 0.3f);
 
 /// Initiate all the shapes in the current slide in the box2DWorld as 
static ones
-void
-initateAllShapesAsStaticBodies(const 
slideshow::internal::ShapeManagerSharedPtr& pShapeManager);
+void initiateAllShapesAsStaticBodies(
+const slideshow::internal::ShapeManagerSharedPtr& pShapeManager);
 
 /// @return whether the box2DWorld has a stepper or not
 bool hasWorldStepper() const;


[Libreoffice-commits] core.git: slideshow/source

2021-12-09 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/shapes/intrinsicanimationactivity.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0cfd60b12855bc1e40640eb2e4cd4ea87d18ff7b
Author: Noel Grandin 
AuthorDate: Thu Dec 9 10:06:11 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Dec 9 10:15:37 2021 +0100

tdf#146094 Impress refuses to go in presentation mode

regression from
commit 043ba6ddf8d90b04acfae8ec836c4b772fb36754
Author: Noel Grandin 
Date:   Mon Oct 11 16:08:12 2021 +0200
loplugin:moveparam in slideshow

Change-Id: I8d6ec81f60e9bdba5b371b8a79abf3d07c523dfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126567
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx 
b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
index 8e5acaef9c65..bcc353e0d6b4 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
@@ -129,7 +129,7 @@ namespace slideshow::internal
   
"IntrinsicAnimationActivity::IntrinsicAnimationActivity(): Invalid draw shape" 
);
 ENSURE_OR_THROW( rWakeupEvent,
   
"IntrinsicAnimationActivity::IntrinsicAnimationActivity(): Invalid wakeup 
event" );
-ENSURE_OR_THROW( !rTimeouts.empty(),
+ENSURE_OR_THROW( !maTimeouts.empty(),
   
"IntrinsicAnimationActivity::IntrinsicAnimationActivity(): Empty timeout 
vector" );
 
 maContext.mpSubsettableShapeManager->addIntrinsicAnimationHandler(


[Libreoffice-commits] core.git: slideshow/source

2021-08-24 Thread Caolán McNamara (via logerrit)
 slideshow/source/engine/animationnodes/animationphysicsnode.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 27273c2c43875acda77b3262c6a4e6138d5dacf6
Author: Caolán McNamara 
AuthorDate: Tue Aug 24 17:03:25 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 24 21:32:35 2021 +0200

WaE: silence -Wmaybe-uninitialized

Change-Id: Iddc7fd644b2fe45a4de420b926e1270887e5001f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120956
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/engine/animationnodes/animationphysicsnode.cxx 
b/slideshow/source/engine/animationnodes/animationphysicsnode.cxx
index 6d2e5b756df1..0502f35c18d7 100644
--- a/slideshow/source/engine/animationnodes/animationphysicsnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationphysicsnode.cxx
@@ -35,7 +35,7 @@ void AnimationPhysicsNode::dispose()
 
 AnimationActivitySharedPtr AnimationPhysicsNode::createActivity() const
 {
-double fDuration;
+double fDuration(0.0);
 ENSURE_OR_THROW((mxPhysicsMotionNode->getDuration() >>= fDuration),
 "Couldn't get the animation duration.");
 


[Libreoffice-commits] core.git: slideshow/source

2021-08-18 Thread Mike Kaganski (via logerrit)
 slideshow/source/inc/shapeattributelayer.hxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 19c6def56692ac23109f638f21a92c00b3d643bb
Author: Mike Kaganski 
AuthorDate: Wed Aug 18 09:02:29 2021 +0200
Commit: Mike Kaganski 
CommitDate: Wed Aug 18 13:52:29 2021 +0200

Fix erroneous comments

At least they work symmetrically with set* counterparts,
and seem to be used as returning radians.

Change-Id: I6fedbb127ff587822dbea2351c51e2472edaa962
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120591
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/slideshow/source/inc/shapeattributelayer.hxx 
b/slideshow/source/inc/shapeattributelayer.hxx
index ac4aad87ef49..b97722fee20c 100644
--- a/slideshow/source/inc/shapeattributelayer.hxx
+++ b/slideshow/source/inc/shapeattributelayer.hxx
@@ -230,7 +230,7 @@ namespace slideshow::internal
 bool isShearXAngleValid() const;
 /** Query the current shear angle at the x axis of the shape
 
-@return the shear angle in degrees.
+@return the shear angle in radians.
  */
 double getShearXAngle() const;
 /** Set the new shear angle at the x axis of the shape
@@ -245,7 +245,7 @@ namespace slideshow::internal
 bool isShearYAngleValid() const;
 /** Query the current shear angle at the y axis of the shape
 
-@return the shear angle in degrees.
+@return the shear angle in radians.
  */
 double getShearYAngle() const;
 /** Set the new shear angle at the y axis of the shape


[Libreoffice-commits] core.git: slideshow/source vcl/source

2021-08-10 Thread Caolán McNamara (via logerrit)
 slideshow/source/inc/tools.hxx |1 -
 vcl/source/outdev/textline.cxx |6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit ad09c49b34f78770fa2510381dbc8b555baf05a1
Author: Caolán McNamara 
AuthorDate: Tue Aug 10 16:51:09 2021 +0100
Commit: Caolán McNamara 
CommitDate: Tue Aug 10 20:24:34 2021 +0200

use o3tl::hash_combine

Change-Id: I0d6cd4313652669939cdbdc8e4ae7c62dae3022b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120280
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx
index f4210e477ea2..edfefe246fe4 100644
--- a/slideshow/source/inc/tools.hxx
+++ b/slideshow/source/inc/tools.hxx
@@ -70,7 +70,6 @@ namespace slideshow
 return d + (d >> 3);
 }
 
-// xxx todo: remove with boost::hash when 1.33 is available
 template 
 struct hash
 {
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 7d78f30fe326..127e1ce4a139 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -34,7 +34,7 @@
 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #define UNDERLINE_LAST  LINESTYLE_BOLDWAVE
@@ -90,8 +90,8 @@ namespace {
 size_t operator() ( const Key& rKey ) const
 {
 size_t aSeed = 0;
-boost::hash_combine(aSeed, rKey.m_aFirst);
-boost::hash_combine(aSeed, rKey.m_aSecond);
+o3tl::hash_combine(aSeed, rKey.m_aFirst);
+o3tl::hash_combine(aSeed, rKey.m_aSecond);
 return aSeed;
 }
 };


[Libreoffice-commits] core.git: slideshow/source

2021-08-05 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/eventqueue.cxx |   16 
 slideshow/source/inc/eventqueue.hxx|4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 63773ac90ed83987063077184e48b526f70216eb
Author: Noel Grandin 
AuthorDate: Thu Aug 5 13:54:17 2021 +0200
Commit: Noel Grandin 
CommitDate: Thu Aug 5 15:40:54 2021 +0200

tdf#143728 Certain presentation crashes Impress after starting slideshow

Revert "osl::Mutex->std::mutex in EventQueue"
This reverts commit c0ce120b55ba389729e97babf80f2cb39ce38e9f.

because we try to take the same lock twice

Change-Id: Ie62659ec3407089f616d1ea950a3755300d68eef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119988
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index 73bf2a398e73..6094fa43bf89 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -77,7 +77,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEvent( const EventSharedPtr& rEvent )
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rEvent->GetDescription()
 << "\" [" << rEvent.get()
@@ -103,7 +103,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rEvent->GetDescription()
 << "\" [" << rEvent.get()
@@ -120,7 +120,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEventWhenQueueIsEmpty (const EventSharedPtr& 
rpEvent)
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rpEvent->GetDescription()
 << "\" [" << rpEvent.get()
@@ -140,14 +140,14 @@ namespace slideshow::internal
 
 void EventQueue::forceEmpty()
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 process_(true);
 }
 
 void EventQueue::process()
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 process_(false);
 }
@@ -257,14 +257,14 @@ namespace slideshow::internal
 
 bool EventQueue::isEmpty() const
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 return maEvents.empty() && maNextEvents.empty() && 
maNextNextEvents.empty();
 }
 
 double EventQueue::nextTimeout() const
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 // return time for next entry (if any)
 double nTimeout (::std::numeric_limits::max());
@@ -281,7 +281,7 @@ namespace slideshow::internal
 
 void EventQueue::clear()
 {
-std::scoped_lock aGuard( maMutex );
+::osl::MutexGuard aGuard( maMutex );
 
 // TODO(P1): Maybe a plain vector and vector.swap will
 // be faster here. Profile.
diff --git a/slideshow/source/inc/eventqueue.hxx 
b/slideshow/source/inc/eventqueue.hxx
index fb0f1b8536eb..63c93f7a302d 100644
--- a/slideshow/source/inc/eventqueue.hxx
+++ b/slideshow/source/inc/eventqueue.hxx
@@ -21,10 +21,10 @@
 #define INCLUDED_SLIDESHOW_SOURCE_INC_EVENTQUEUE_HXX
 
 #include 
+#include 
 
 #include "event.hxx"
 
-#include 
 #include 
 #include 
 
@@ -116,7 +116,7 @@ namespace slideshow::internal
 getTimer() const { return mpTimer; }
 
 private:
-mutable std::mutex  maMutex;
+mutable ::osl::Mutex  maMutex;
 
 struct EventEntry
 {


[Libreoffice-commits] core.git: slideshow/source

2021-08-01 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/eventqueue.cxx |   16 
 slideshow/source/inc/eventqueue.hxx|4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit c0ce120b55ba389729e97babf80f2cb39ce38e9f
Author: Noel Grandin 
AuthorDate: Sun Aug 1 18:49:14 2021 +0200
Commit: Noel Grandin 
CommitDate: Sun Aug 1 22:18:33 2021 +0200

osl::Mutex->std::mutex in EventQueue

Change-Id: Ia936a28dd2ae5b5cb1797a0e703e9d96841a1f3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119829
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index 6094fa43bf89..0e888db85567 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -77,7 +77,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEvent( const EventSharedPtr& rEvent )
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rEvent->GetDescription()
 << "\" [" << rEvent.get()
@@ -103,7 +103,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rEvent->GetDescription()
 << "\" [" << rEvent.get()
@@ -120,7 +120,7 @@ namespace slideshow::internal
 
 bool EventQueue::addEventWhenQueueIsEmpty (const EventSharedPtr& 
rpEvent)
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 SAL_INFO("slideshow.eventqueue", "adding event \"" << 
rpEvent->GetDescription()
 << "\" [" << rpEvent.get()
@@ -140,14 +140,14 @@ namespace slideshow::internal
 
 void EventQueue::forceEmpty()
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 process_(true);
 }
 
 void EventQueue::process()
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 process_(false);
 }
@@ -257,14 +257,14 @@ namespace slideshow::internal
 
 bool EventQueue::isEmpty() const
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 return maEvents.empty() && maNextEvents.empty() && 
maNextNextEvents.empty();
 }
 
 double EventQueue::nextTimeout() const
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 // return time for next entry (if any)
 double nTimeout (::std::numeric_limits::max());
@@ -281,7 +281,7 @@ namespace slideshow::internal
 
 void EventQueue::clear()
 {
-::osl::MutexGuard aGuard( maMutex );
+std::lock_guard aGuard( maMutex );
 
 // TODO(P1): Maybe a plain vector and vector.swap will
 // be faster here. Profile.
diff --git a/slideshow/source/inc/eventqueue.hxx 
b/slideshow/source/inc/eventqueue.hxx
index 63c93f7a302d..fb0f1b8536eb 100644
--- a/slideshow/source/inc/eventqueue.hxx
+++ b/slideshow/source/inc/eventqueue.hxx
@@ -21,10 +21,10 @@
 #define INCLUDED_SLIDESHOW_SOURCE_INC_EVENTQUEUE_HXX
 
 #include 
-#include 
 
 #include "event.hxx"
 
+#include 
 #include 
 #include 
 
@@ -116,7 +116,7 @@ namespace slideshow::internal
 getTimer() const { return mpTimer; }
 
 private:
-mutable ::osl::Mutex  maMutex;
+mutable std::mutex  maMutex;
 
 struct EventEntry
 {


[Libreoffice-commits] core.git: slideshow/source

2021-07-23 Thread Collabora (via logerrit)
 slideshow/source/engine/activities/activitiesfactory.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a470d97f2ddcb3607ae9d1df871a59f04d823564
Author: Collabora 
AuthorDate: Thu Jul 15 12:32:39 2021 +0200
Commit: Luboš Luňák 
CommitDate: Fri Jul 23 10:31:51 2021 +0200

workaround accumulate() ambiguity on Mac with PCH

The PCH brings in , which has std::accumulate(), which also
gets considered for whatever reason.

Change-Id: I69f375c871034e156598c8886822279f78c7f73f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119010
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx 
b/slideshow/source/engine/activities/activitiesfactory.cxx
index 4732197657ba..2dadfea49e1c 100644
--- a/slideshow/source/engine/activities/activitiesfactory.cxx
+++ b/slideshow/source/engine/activities/activitiesfactory.cxx
@@ -573,7 +573,7 @@ public:
 // this is discrete, thus no lerp here.
 (*mpAnim)(
 getPresentationValue(
-accumulate( maValues.back(),
+slideshow::internal::accumulate( maValues.back(),
 mbCumulative ? nRepeatCount : 0,
 maValues[ nFrame ] ) ) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2021-06-02 Thread Julien Nabet (via logerrit)
 slideshow/source/engine/shapes/viewmediashape.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7e9c3569f9258877b5303f041283d4882d1290fe
Author: Julien Nabet 
AuthorDate: Tue Jun 1 19:08:13 2021 +0200
Commit: Julien Nabet 
CommitDate: Wed Jun 2 08:38:43 2021 +0200

tdf#92917: fix crash in Impress in viewmediashape (slideshow)

See bt here:
https://bugs.documentfoundation.org/attachment.cgi?id=172527

I thought about this patch comparing with 
OGLTransitionerImpl::initWindowFromSlideShowView in:
slideshow/source/engine/opengl/TransitionerImpl.cxx

304 /// take the XSlideShowView and extract the parent window from it. 
see viewmediashape.cxx
305 uno::Reference< rendering::XCanvas > xCanvas(mxView->getCanvas(), 
uno::UNO_QUERY_THROW);
306 uno::Sequence< uno::Any > aDeviceParams;
307 ::canvas::tools::getDeviceInfo( xCanvas, aDeviceParams );
...
317 OutputDevice* pDevice = reinterpret_cast(aVal);
318 vcl::Window* pWindow = pDevice ? pDevice->GetOwnerWindow() : 
nullptr;

Change-Id: I183cc8271f75fb145c27688c5594805792c1fdaf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116551
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx 
b/slideshow/source/engine/shapes/viewmediashape.cxx
index cddaea4c1b0b..2179f71ba78c 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -393,7 +393,8 @@ namespace slideshow::internal
 
 rVCLDeviceParams[ 1 ] >>= aVal;
 
-vcl::Window* pWindow = reinterpret_cast< vcl::Window* >( aVal 
);
+OutputDevice* pDevice = reinterpret_cast(aVal);
+vcl::Window* pWindow = pDevice ? pDevice->GetOwnerWindow() : 
nullptr;
 
 if( pWindow )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2021-06-01 Thread Julien Nabet (via logerrit)
 slideshow/source/engine/shapes/viewmediashape.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e45575443ca5e4b6683e81e1c2e8e4a543b506fb
Author: Julien Nabet 
AuthorDate: Tue Jun 1 12:59:08 2021 +0200
Commit: Julien Nabet 
CommitDate: Tue Jun 1 15:41:22 2021 +0200

Reduce scope (slideshow/viewmediashape)

Change-Id: I3190aa77c5a13c6a6d1cf484b63916784954ea87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116533
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx 
b/slideshow/source/engine/shapes/viewmediashape.cxx
index 29c6405b8725..cddaea4c1b0b 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -406,7 +406,6 @@ namespace slideshow::internal
 
 if( !rRangePix.isEmpty() )
 {
-uno::Sequence< uno::Any >   aArgs( 3 );
 awt::Rectangle  aAWTRect( 
rRangePix.getMinX(),
   
rRangePix.getMinY(),
 
rRangePix.getMaxX() - rRangePix.getMinX(),
@@ -433,6 +432,7 @@ namespace slideshow::internal
 
 if( mxPlayer.is() )
 {
+uno::Sequence< uno::Any >   aArgs( 3 );
 sal_IntPtr nParentWindowHandle(0);
 const SystemEnvData* pEnvData = 
mpMediaWindow->GetSystemData();
 // tdf#139609 gtk doesn't need the handle, and 
fetching it is undesirable
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2021-05-24 Thread Caolán McNamara (via logerrit)
 slideshow/source/engine/opengl/TransitionerImpl.cxx |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 7f6f57fe93cef0482e1e8b352987f185c56e2d64
Author: Caolán McNamara 
AuthorDate: Mon May 24 12:38:44 2021 +0100
Commit: Caolán McNamara 
CommitDate: Mon May 24 16:23:08 2021 +0200

crash on launching opengl slide transitions under gtk3

since...

commit 9090dc1f3b27195f5defd35586ac79357992be21
Date:   Mon Jan 18 18:27:19 2021 +0200

split OutputDevice from Window

note SpriteDeviceHelper::getDeviceHandle seems to return a vcl::Window
and not an OutputDevice like the other ::getDeviceHandle so that
probably needs changing too, or the others need to return the owner
window.

Change-Id: I84da379e680d3da5775855a16dc716decef22bbf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116052
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx 
b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index f206f2015664..bf8c23744fc3 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -314,9 +314,12 @@ bool OGLTransitionerImpl::initWindowFromSlideShowView( 
const Reference< presenta
 
 mpContext = OpenGLContext::Create();
 
-if( !mpContext->init( reinterpret_cast< vcl::Window* >( aVal ) ) ) {
+OutputDevice* pDevice = reinterpret_cast(aVal);
+vcl::Window* pWindow = pDevice ? pDevice->GetOwnerWindow() : nullptr;
+
+if( !mpContext->init( pWindow) ) {
 mpContext->requestLegacyContext();
-if( !mpContext->init( reinterpret_cast< vcl::Window* >( aVal ) ) )
+if( !mpContext->init( pWindow ) )
 return false;
 }
 SAL_INFO("slideshow.opengl", "created the context");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2021-04-08 Thread Mike Kaganski (via logerrit)
 slideshow/source/engine/opengl/TransitionImpl.cxx |   91 ++
 1 file changed, 43 insertions(+), 48 deletions(-)

New commits:
commit 4f3b811d6249af4bfec2a0cb07fce9928baf07cd
Author: Mike Kaganski 
AuthorDate: Fri Apr 2 20:14:41 2021 +0300
Commit: Stephan Bergmann 
CommitDate: Thu Apr 8 08:17:21 2021 +0200

Compute permutation2D at compile time

Change-Id: Ia69913a11aa47a2c37a1c7cb8316cb9d34dffeec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113522
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx 
b/slideshow/source/engine/opengl/TransitionImpl.cxx
index f8d062d34941..d45b17c2e953 100644
--- a/slideshow/source/engine/opengl/TransitionImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionImpl.cxx
@@ -1431,60 +1431,55 @@ void PermTextureTransition::finishTransition()
 CHECK_GL_ERROR();
 }
 
-int permutation256 [256]= {
-215, 100, 200, 204, 233,  50,  85, 196,
- 71, 141, 122, 160,  93, 131, 243, 234,
-162, 183,  36, 155,   4,  62,  35, 205,
- 40, 102,  33,  27, 255,  55, 214, 156,
- 75, 163, 134, 126, 249,  74, 197, 228,
- 72,  90, 206, 235,  17,  22,  49, 169,
-227,  89,  16,   5, 117,  60, 248, 230,
-217,  68, 138,  96, 194, 170, 136,  10,
-112, 238, 184, 189, 176,  42, 225, 212,
- 84,  58, 175, 244, 150, 168, 219, 236,
-101, 208, 123,  37, 164, 110, 158, 201,
- 78, 114,  57,  48,  70, 142, 106,  43,
-232,  26,  32, 252, 239,  98, 191,  94,
- 59, 149,  39, 187, 203, 190,  19,  13,
-133,  45,  61, 247,  23,  34,  20,  52,
-118, 209, 146, 193, 222,  18,   1, 152,
- 46,  41,  91, 148, 115,  25, 135,  77,
-254, 147, 224, 161,   9, 213, 223, 250,
-231, 251, 127, 166,  63, 179,  81, 130,
-139,  28, 120, 151, 241,  86, 111,   0,
- 88, 153, 172, 182, 159, 105, 178,  47,
- 51, 167,  65,  66,  92,  73, 198, 211,
-245, 195,  31, 220, 140,  76, 221, 186,
-154, 185,  56,  83,  38, 165, 109,  67,
-124, 226, 132,  53, 229,  29,  12, 181,
-121,  24, 207, 199, 177, 113,  30,  80,
-  3,  97, 188,  79, 216, 173,   8, 145,
- 87, 128, 180, 237, 240, 137, 125, 104,
- 15, 242, 119, 246, 103, 143,  95, 144,
-  2,  44,  69, 157, 192, 174,  14,  54,
-218,  82,  64, 210,  11,   6, 129,  21,
-116, 171,  99, 202,   7, 107, 253, 108
-};
+constexpr auto permutation2D = []() constexpr {
+int permutation256 [256]= {
+215, 100, 200, 204, 233,  50,  85, 196,
+ 71, 141, 122, 160,  93, 131, 243, 234,
+162, 183,  36, 155,   4,  62,  35, 205,
+ 40, 102,  33,  27, 255,  55, 214, 156,
+ 75, 163, 134, 126, 249,  74, 197, 228,
+ 72,  90, 206, 235,  17,  22,  49, 169,
+227,  89,  16,   5, 117,  60, 248, 230,
+217,  68, 138,  96, 194, 170, 136,  10,
+112, 238, 184, 189, 176,  42, 225, 212,
+ 84,  58, 175, 244, 150, 168, 219, 236,
+101, 208, 123,  37, 164, 110, 158, 201,
+ 78, 114,  57,  48,  70, 142, 106,  43,
+232,  26,  32, 252, 239,  98, 191,  94,
+ 59, 149,  39, 187, 203, 190,  19,  13,
+133,  45,  61, 247,  23,  34,  20,  52,
+118, 209, 146, 193, 222,  18,   1, 152,
+ 46,  41,  91, 148, 115,  25, 135,  77,
+254, 147, 224, 161,   9, 213, 223, 250,
+231, 251, 127, 166,  63, 179,  81, 130,
+139,  28, 120, 151, 241,  86, 111,   0,
+ 88, 153, 172, 182, 159, 105, 178,  47,
+ 51, 167,  65,  66,  92,  73, 198, 211,
+245, 195,  31, 220, 140,  76, 221, 186,
+154, 185,  56,  83,  38, 165, 109,  67,
+124, 226, 132,  53, 229,  29,  12, 181,
+121,  24, 207, 199, 177, 113,  30,  80,
+  3,  97, 188,  79, 216, 173,   8, 145,
+ 87, 128, 180, 237, 240, 137, 125, 104,
+ 15, 242, 119, 246, 103, 143,  95, 144,
+  2,  44,  69, 157, 192, 174,  14,  54,
+218,  82,  64, 210,  11,   6, 129,  21,
+116, 171,  99, 202,   7, 107, 253, 108
+};
+std::array a{};
+for (int y = 0; y < 256; y++)
+for (int x = 0; x < 256; x++)
+a[x + y * 256] = permutation256[(y + permutation256[x]) & 0xff];
+return a;
+}();
 
 void initPermTexture(GLuint *texID)
 {
 CHECK_GL_ERROR();
 glGenTextures(1, texID);
 glBindTexture(GL_TEXTURE_2D, *texID);
-
-static bool initialized = false;
-static unsigned char permutation2D[256*256];
-if( !initialized ) {
-  int x, y;
-
-  for( y=0; y < 256; y++ )
-  for( x=0; x < 256; x++ )
-  permutation2D[x + y*256] = permutation256[(y + 
permutation256[x]) & 0xff];
-
-  initialized = true;
-}
-
-glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RED, 
GL_UNSIGNED_BYTE, permutation2D );
+glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RED, 
GL_UNSIGNED_BYTE,
+ permutation2D.data());
 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
 CHECK_GL_ERROR();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: slideshow/source

2021-04-03 Thread Mike Kaganski (via logerrit)
 slideshow/source/engine/opengl/TransitionImpl.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit c1959f505eb9322557dd915f2eefb49ce02f2802
Author: Mike Kaganski 
AuthorDate: Sat Apr 3 09:49:16 2021 +0300
Commit: Mike Kaganski 
CommitDate: Sat Apr 3 10:13:49 2021 +0200

Use 64-KiB buffer instead of 256-KiB

We only use red channel anyway, so no need to also waste space for
G, B and A.

Change-Id: I2bacef36d1e9845287a205a5f6473952ef59083e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113552
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx 
b/slideshow/source/engine/opengl/TransitionImpl.cxx
index 98d6778fd197..f8d062d34941 100644
--- a/slideshow/source/engine/opengl/TransitionImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionImpl.cxx
@@ -1473,18 +1473,18 @@ void initPermTexture(GLuint *texID)
 glBindTexture(GL_TEXTURE_2D, *texID);
 
 static bool initialized = false;
-static unsigned char permutation2D[256*256*4];
+static unsigned char permutation2D[256*256];
 if( !initialized ) {
   int x, y;
 
   for( y=0; y < 256; y++ )
   for( x=0; x < 256; x++ )
-  permutation2D[x*4 + y*1024] = permutation256[(y + 
permutation256[x]) & 0xff];
+  permutation2D[x + y*256] = permutation256[(y + 
permutation256[x]) & 0xff];
 
   initialized = true;
 }
 
-glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RGBA, 
GL_UNSIGNED_BYTE, permutation2D );
+glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, 256, 256, 0, GL_RED, 
GL_UNSIGNED_BYTE, permutation2D );
 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );
 CHECK_GL_ERROR();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2021-03-11 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/opengl/Operation.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d148113591c554a3c6d8223767159334c014ad0c
Author: Stephan Bergmann 
AuthorDate: Thu Mar 11 09:02:18 2021 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Mar 11 13:31:20 2021 +0100

Work around MSVC 2019 16.9.0 warning C4103 compiler bug

With that compiler version (and --with-latest-c++), the build now started to
fail for me with

> [build CXX] slideshow/source/engine/opengl/Operation.cxx
> 
C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\Include\memory(14): 
error C2220: the following warning is treated as an error
> 
C:\PROGRA~2\MIB055~1\2019\COMMUN~1\VC\Tools\MSVC\1428~1.299\Include\memory(14): 
warning C4103: alignment changed after including header, may be due to missing 
#pragma pack(pop)
> C:\lo\core\slideshow\source\engine\opengl\Operation.hxx(34): warning 
C4103: alignment changed after including header, may be due to missing #pragma 
pack(pop)
> C:/lo/core/slideshow/source/engine/opengl/Operation.cxx(36): warning 
C4103: alignment changed after including header, may be due to missing #pragma 
pack(pop)

Mike had experienced the same (though without --with-latest-c++, but due to 
us
now always using /permissive-) as explained in the post-merge comments 
starting
at  "Use MSVC's /permissive- 
to
make it more standards conforming", linking to
 "Warning C4103 in Visual
Studio 16.6 Update".

At least for my --with-latest-c++ aka /std:c++latest case, I have reduced 
the
issue to a test.cc of

> #include 
> template void f(int[1]) {}
> #include 

failing with

> **
> ** Visual Studio 2019 Developer Command Prompt v16.9.0
> ** Copyright (c) 2021 Microsoft Corporation
> **
> [vcvarsall.bat] Environment initialized for: 'x64'
>
> C:\Program Files (x86)\Microsoft Visual Studio\2019\Community>cd \lo\core
>
> C:\test>cl /std:c++latest /c test.cc
> Microsoft (R) C/C++ Optimizing Compiler Version 19.28.29910 for x64
> Copyright (C) Microsoft Corporation.  All rights reserved.
>
> /std:c++latest is provided as a preview of language features from the 
latest C++
>
> working draft, and we're eager to hear about bugs and suggestions for 
improvemen
> ts.
> However, note that these features are provided as-is without support, and 
subjec
> t
> to changes or removal as the working draft evolves. See
> https://go.microsoft.com/fwlink/?linkid=2045807 for details.
>
> test.cc
> test.cc(3): warning C4103: alignment changed after including header, may 
be due
> to missing #pragma pack(pop)

which looks clearly like a compiler bug.

As it happens, reordering the includes here makes the issue disappear at 
least
for me.

Change-Id: Ib3d0756b38da4f24e62cafa900b44c8ec8e842b0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112317
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/opengl/Operation.cxx 
b/slideshow/source/engine/opengl/Operation.cxx
index e70f203edad7..ec83d6b74c32 100644
--- a/slideshow/source/engine/opengl/Operation.cxx
+++ b/slideshow/source/engine/opengl/Operation.cxx
@@ -28,13 +28,13 @@
 
 #include 
 
+#include "Operation.hxx"
+
 #include 
 
 #include 
 #include 
 
-#include "Operation.hxx"
-
 SRotate::SRotate(const glm::vec3& Axis, const glm::vec3& Origin,
 double Angle, bool bInter, double T0, double T1):
 Operation(bInter, T0, T1),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source starmath/source

2021-02-16 Thread Noel (via logerrit)
 slideshow/source/engine/eventmultiplexer.cxx|   12 ++--
 slideshow/source/engine/opengl/TransitionerImpl.cxx |2 +-
 starmath/source/AccessibleSmElement.cxx |2 +-
 starmath/source/AccessibleSmElementsControl.cxx |2 +-
 starmath/source/ElementsDockingWindow.cxx   |2 +-
 starmath/source/edit.cxx|2 +-
 starmath/source/view.cxx|2 +-
 7 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit 5ea8d87dfee68fe3564a58230664d2f2a2852a51
Author: Noel 
AuthorDate: Tue Feb 16 12:56:38 2021 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 16 15:00:01 2021 +0100

loplugin:referencecasting in slideshow..starmath

Change-Id: Id9dc0ac27897c8a3650424db65d3a05e2fe418f0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110986
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/eventmultiplexer.cxx 
b/slideshow/source/engine/eventmultiplexer.cxx
index 678c44e42e50..2b53073c7bea 100644
--- a/slideshow/source/engine/eventmultiplexer.cxx
+++ b/slideshow/source/engine/eventmultiplexer.cxx
@@ -589,7 +589,7 @@ void EventMultiplexerImpl::clear()
  ++aIter )
 {
 if( (*aIter)->getUnoView().is() )
-(*aIter)->getUnoView()->removeMouseListener( mxListener.get() 
);
+(*aIter)->getUnoView()->removeMouseListener( mxListener );
 }
 }
 
@@ -601,7 +601,7 @@ void EventMultiplexerImpl::clear()
  ++aIter )
 {
 if( (*aIter)->getUnoView().is() )
-(*aIter)->getUnoView()->removeMouseMotionListener( 
mxListener.get() );
+(*aIter)->getUnoView()->removeMouseMotionListener( mxListener 
);
 }
 }
 
@@ -1160,11 +1160,11 @@ void EventMultiplexer::notifyViewAdded( const 
UnoViewSharedPtr& rView )
 
 if( mpImpl->isMouseListenerRegistered() )
 rUnoView->addMouseListener(
-mpImpl->mxListener.get() );
+mpImpl->mxListener );
 
 if( !mpImpl->maMouseMoveHandlers.isEmpty() )
 rUnoView->addMouseMotionListener(
-mpImpl->mxListener.get() );
+mpImpl->mxListener );
 
 mpImpl->maViewHandlers.applyAll(
 []( const ViewEventHandlerWeakPtr& pHandler )
@@ -1182,11 +1182,11 @@ void EventMultiplexer::notifyViewRemoved( const 
UnoViewSharedPtr& rView )
 
 if( mpImpl->isMouseListenerRegistered() )
 rUnoView->removeMouseListener(
-mpImpl->mxListener.get() );
+mpImpl->mxListener );
 
 if( !mpImpl->maMouseMoveHandlers.isEmpty() )
 rUnoView->removeMouseMotionListener(
-mpImpl->mxListener.get() );
+mpImpl->mxListener );
 
 mpImpl->maViewHandlers.applyAll(
 []( const ViewEventHandlerWeakPtr& pHandler )
diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx 
b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index 3565e6ef104e..f206f2015664 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -1314,7 +1314,7 @@ public:
 if ( !pTransition || !xRes->setTransition(pTransition) )
 return uno::Reference< presentation::XTransition >();
 
-return uno::Reference(xRes.get());
+return xRes;
 }
 };
 
diff --git a/starmath/source/AccessibleSmElement.cxx 
b/starmath/source/AccessibleSmElement.cxx
index b995c23818cc..848af8af6b0d 100644
--- a/starmath/source/AccessibleSmElement.cxx
+++ b/starmath/source/AccessibleSmElement.cxx
@@ -137,7 +137,7 @@ uno::Reference 
AccessibleSmElement::getAccessibleParent()
 OContextEntryGuard aGuard(this);
 uno::Reference xParent;
 if (m_pSmElementsControl)
-xParent.set(m_pSmElementsControl->GetAccessible().get());
+xParent = m_pSmElementsControl->GetAccessible();
 return xParent;
 }
 
diff --git a/starmath/source/AccessibleSmElementsControl.cxx 
b/starmath/source/AccessibleSmElementsControl.cxx
index 15b226931a60..0b82f3f87e5a 100644
--- a/starmath/source/AccessibleSmElementsControl.cxx
+++ b/starmath/source/AccessibleSmElementsControl.cxx
@@ -198,7 +198,7 @@ uno::Reference 
AccessibleSmElementsControl::getAccessibleChild(sal_
 m_aAccessibleChildren[c] = pChild;
 xChild = pChild;
 }
-return xChild.get();
+return xChild;
 }
 
 uno::Reference AccessibleSmElementsControl::getAccessibleParent()
diff --git a/starmath/source/ElementsDockingWindow.cxx 
b/starmath/source/ElementsDockingWindow.cxx
index 754d819aa3f1..aae6027bbdc4 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -1087,7 +1087,7 @@ css::uno::Reference 
SmElementsControl::CreateAc
 m_xAccessible = new AccessibleSmElementsControl(*this);
 m_xAccessible->AddAllItems();
 }
-return m_xAccessible.get();
+return m_xAccessible;
 }
 
 bool 

[Libreoffice-commits] core.git: slideshow/source

2021-01-03 Thread Gülşah Köse (via logerrit)
 slideshow/source/engine/effectrewinder.cxx |   23 +++
 slideshow/source/engine/effectrewinder.hxx |1 +
 2 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit b83c16834792874524019495662b2f23a066611c
Author: Gülşah Köse 
AuthorDate: Fri Jan 1 18:09:29 2021 +0300
Commit: Gülşah Köse 
CommitDate: Sun Jan 3 20:17:19 2021 +0100

tdf#136278 Follow-up Check when the eventqueue needs to be emptied.

Follow up commit a63caf49958b40e33e0d7aaedbe6424f78ecdc46

Change-Id: I90b94f6aee1e1fe62f61ca20a75fd59e2a12d5da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108559
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/slideshow/source/engine/effectrewinder.cxx 
b/slideshow/source/engine/effectrewinder.cxx
index 7b4042ba2471..7d329c9ae411 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -84,7 +84,8 @@ EffectRewinder::EffectRewinder (
   mpAsynchronousRewindEvent(),
   mxCurrentAnimationRootNode(),
   mxCurrentSlide(),
-  mbNonUserTriggeredMainSequenceEffectSeen(false)
+  mbNonUserTriggeredMainSequenceEffectSeen(false),
+  mbHasAdvancedTimeSetting(false)
 {
 initialize();
 }
@@ -160,6 +161,15 @@ void EffectRewinder::setCurrentSlide (
 const uno::Reference& xSlide)
 {
 mxCurrentSlide = xSlide;
+
+// Check if the current slide has advance time setting or not
+uno::Reference< beans::XPropertySet > xPropSet( mxCurrentSlide, 
uno::UNO_QUERY );
+sal_Int32 nChange(0);
+
+if( xPropSet.is())
+getPropertyValue( nChange, xPropSet, "Change");
+
+mbHasAdvancedTimeSetting = nChange;
 }
 
 bool EffectRewinder::rewind (
@@ -179,6 +189,9 @@ bool EffectRewinder::rewind (
 // Abort (and skip over the rest of) any currently active animation.
 mrUserEventQueue.callSkipEffectEventHandler();
 
+if (!mbHasAdvancedTimeSetting)
+mrEventQueue.forceEmpty();
+
 const int nSkipCount (mnMainSequenceEffectCount - 1);
 if (nSkipCount < 0)
 {
@@ -417,13 +430,7 @@ void EffectRewinder::asynchronousRewind (
 // when the slide is shown.
 mbNonUserTriggeredMainSequenceEffectSeen = false;
 
-uno::Reference< beans::XPropertySet > xPropSet( mxCurrentSlide, 
uno::UNO_QUERY );
-sal_Int32 nChange(0);
-
-if( xPropSet.is())
-getPropertyValue( nChange, xPropSet, "Change");
-
-if (!nChange)
+if (!mbHasAdvancedTimeSetting)
 mrEventQueue.forceEmpty();
 
 if (mbNonUserTriggeredMainSequenceEffectSeen)
diff --git a/slideshow/source/engine/effectrewinder.hxx 
b/slideshow/source/engine/effectrewinder.hxx
index 4844991b8333..8084b03f6248 100644
--- a/slideshow/source/engine/effectrewinder.hxx
+++ b/slideshow/source/engine/effectrewinder.hxx
@@ -129,6 +129,7 @@ private:
 ::std::shared_ptr mpPaintLock;
 
 bool mbNonUserTriggeredMainSequenceEffectSeen;
+bool mbHasAdvancedTimeSetting; // Slide has advanced time setting or not.
 
 void initialize();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-12-26 Thread Gülşah Köse (via logerrit)
 slideshow/source/engine/effectrewinder.cxx |   16 
 slideshow/source/engine/effectrewinder.hxx |7 +++
 slideshow/source/engine/slideshowimpl.cxx  |1 +
 3 files changed, 24 insertions(+)

New commits:
commit a63caf49958b40e33e0d7aaedbe6424f78ecdc46
Author: Gülşah Köse 
AuthorDate: Fri Dec 25 14:08:32 2020 +0300
Commit: Gülşah Köse 
CommitDate: Sat Dec 26 23:11:36 2020 +0100

tdf#134133 Check when the eventqueue needs to be emptied.

To fix tdf#131254, forceEmpty call removed without a control.
Bug was related advance time setting. Now we control if slide has
advance time setting.

Change-Id: Ie83f4d7ff3e4bd0a744ca205173d747204918b39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108282
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/slideshow/source/engine/effectrewinder.cxx 
b/slideshow/source/engine/effectrewinder.cxx
index 5a784a7fe7d0..7b4042ba2471 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -82,6 +83,7 @@ EffectRewinder::EffectRewinder (
   mnMainSequenceEffectCount(0),
   mpAsynchronousRewindEvent(),
   mxCurrentAnimationRootNode(),
+  mxCurrentSlide(),
   mbNonUserTriggeredMainSequenceEffectSeen(false)
 {
 initialize();
@@ -154,6 +156,11 @@ void EffectRewinder::setRootAnimationNode (
 mxCurrentAnimationRootNode = xRootNode;
 }
 
+void EffectRewinder::setCurrentSlide (
+const uno::Reference& xSlide)
+{
+mxCurrentSlide = xSlide;
+}
 
 bool EffectRewinder::rewind (
 const ::std::shared_ptr& rpPaintLock,
@@ -410,6 +417,15 @@ void EffectRewinder::asynchronousRewind (
 // when the slide is shown.
 mbNonUserTriggeredMainSequenceEffectSeen = false;
 
+uno::Reference< beans::XPropertySet > xPropSet( mxCurrentSlide, 
uno::UNO_QUERY );
+sal_Int32 nChange(0);
+
+if( xPropSet.is())
+getPropertyValue( nChange, xPropSet, "Change");
+
+if (!nChange)
+mrEventQueue.forceEmpty();
+
 if (mbNonUserTriggeredMainSequenceEffectSeen)
 {
 mrUserEventQueue.callSkipEffectEventHandler();
diff --git a/slideshow/source/engine/effectrewinder.hxx 
b/slideshow/source/engine/effectrewinder.hxx
index 69891172e3c9..4844991b8333 100644
--- a/slideshow/source/engine/effectrewinder.hxx
+++ b/slideshow/source/engine/effectrewinder.hxx
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -66,6 +67,11 @@ public:
 void setRootAnimationNode (
 const css::uno::Reference& xRootNode);
 
+/** Store the XDrawPage to reach specific slide properties.
+*/
+void setCurrentSlide (
+const css::uno::Reference& xSlide);
+
 /** Rewind one effect of the main effect sequence.  When the current
 slide has not effects or no main sequence effect has yet been played
 then switch to the previous slide and replay all of its main
@@ -119,6 +125,7 @@ private:
 EventSharedPtr mpAsynchronousRewindEvent;
 
 css::uno::Reference 
mxCurrentAnimationRootNode;
+css::uno::Reference mxCurrentSlide;
 ::std::shared_ptr mpPaintLock;
 
 bool mbNonUserTriggeredMainSequenceEffectSeen;
diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 3bfee3cb88ba..5647170f9c4d 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -1059,6 +1059,7 @@ void SlideShowImpl::displaySlide(
 return;
 
 maEffectRewinder.setRootAnimationNode(xRootNode);
+maEffectRewinder.setCurrentSlide(xSlide);
 
 // precondition: must only be called from the main thread!
 DBG_TESTSOLARMUTEX();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source solenv/clang-format

2020-11-19 Thread Philipp Hofer (via logerrit)
 slideshow/source/engine/transitions/barndoorwipe.hxx |   17 +++---
 slideshow/source/engine/transitions/clockwipe.hxx|   11 +--
 slideshow/source/engine/transitions/doublediamondwipe.hxx|9 +--
 slideshow/source/engine/transitions/iriswipe.cxx |   13 +---
 slideshow/source/engine/transitions/iriswipe.hxx |   15 ++---
 slideshow/source/engine/transitions/randomwipe.hxx   |   17 ++
 slideshow/source/engine/transitions/transitionfactorytab.hxx |   10 +--
 slideshow/source/engine/transitions/transitiontools.hxx  |   12 +---
 slideshow/source/engine/transitions/veewipe.hxx  |9 +--
 slideshow/source/inc/animationnode.hxx   |   31 ---
 slideshow/source/inc/event.hxx   |   15 +++--
 slideshow/source/inc/framerate.hxx   |4 -
 solenv/clang-format/excludelist  |   12 
 13 files changed, 72 insertions(+), 103 deletions(-)

New commits:
commit 156da5b55362db37d4e61a22e43e489e48797452
Author: Philipp Hofer 
AuthorDate: Thu Nov 12 13:16:29 2020 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Nov 19 19:28:27 2020 +0100

tdf#123936 Formatting files in module slideshow with clang-format

Change-Id: I108be5e01ed319f42912a6762ebceb97795113ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105708
Reviewed-by: Christian Lohmaier 
Tested-by: Jenkins

diff --git a/slideshow/source/engine/transitions/barndoorwipe.hxx 
b/slideshow/source/engine/transitions/barndoorwipe.hxx
index decc63dab0ef..775c54b6c994 100644
--- a/slideshow/source/engine/transitions/barndoorwipe.hxx
+++ b/slideshow/source/engine/transitions/barndoorwipe.hxx
@@ -25,22 +25,23 @@
 #include "parametricpolypolygon.hxx"
 #include "transitiontools.hxx"
 
-
-namespace slideshow::internal {
-
+namespace slideshow::internal
+{
 /// Generate a barn door wipe or double barn door wipe:
 class BarnDoorWipe : public ParametricPolyPolygon
 {
 public:
-explicit BarnDoorWipe( bool doubled = false )
-: m_unitRect( createUnitRect() ), m_doubled(doubled) {}
-virtual ::basegfx::B2DPolyPolygon operator()( double x ) override;
+explicit BarnDoorWipe(bool doubled = false)
+: m_unitRect(createUnitRect())
+, m_doubled(doubled)
+{
+}
+virtual ::basegfx::B2DPolyPolygon operator()(double x) override;
+
 private:
 const ::basegfx::B2DPolygon m_unitRect;
 const bool m_doubled;
 };
-
-
 }
 
 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_TRANSITIONS_BARNDOORWIPE_HXX
diff --git a/slideshow/source/engine/transitions/clockwipe.hxx 
b/slideshow/source/engine/transitions/clockwipe.hxx
index 437f308285f3..b6745ed36c09 100644
--- a/slideshow/source/engine/transitions/clockwipe.hxx
+++ b/slideshow/source/engine/transitions/clockwipe.hxx
@@ -23,19 +23,16 @@
 #include 
 #include "parametricpolypolygon.hxx"
 
-
-namespace slideshow::internal {
-
+namespace slideshow::internal
+{
 /// Generates a clockWiseTwelve clock wipe:
 class ClockWipe : public ParametricPolyPolygon
 {
 public:
 /// 0,1 to 1,1 to 1,0 to 0,-1 to -1,0 to 0,1:
-static ::basegfx::B2DPolygon calcCenteredClock( double t, double e = 1.0 );
-virtual ::basegfx::B2DPolyPolygon operator () ( double t ) override;
+static ::basegfx::B2DPolygon calcCenteredClock(double t, double e = 1.0);
+virtual ::basegfx::B2DPolyPolygon operator()(double t) override;
 };
-
-
 }
 
 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_TRANSITIONS_CLOCKWIPE_HXX
diff --git a/slideshow/source/engine/transitions/doublediamondwipe.hxx 
b/slideshow/source/engine/transitions/doublediamondwipe.hxx
index eca5d865c0ef..c77a783ef707 100644
--- a/slideshow/source/engine/transitions/doublediamondwipe.hxx
+++ b/slideshow/source/engine/transitions/doublediamondwipe.hxx
@@ -24,18 +24,15 @@
 
 #include "parametricpolypolygon.hxx"
 
-
-namespace slideshow::internal {
-
+namespace slideshow::internal
+{
 /// Generates a double diamond wipe:
 class DoubleDiamondWipe : public ParametricPolyPolygon
 {
 public:
 DoubleDiamondWipe() {}
-virtual ::basegfx::B2DPolyPolygon operator()( double x ) override;
+virtual ::basegfx::B2DPolyPolygon operator()(double x) override;
 };
-
-
 }
 
 #endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_TRANSITIONS_DOUBLEDIAMONDWIPE_HXX
diff --git a/slideshow/source/engine/transitions/iriswipe.cxx 
b/slideshow/source/engine/transitions/iriswipe.cxx
index 72d3e5a61bdf..ebceddb19078 100644
--- a/slideshow/source/engine/transitions/iriswipe.cxx
+++ b/slideshow/source/engine/transitions/iriswipe.cxx
@@ -17,25 +17,22 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
 #include 
 #include 
 #include "iriswipe.hxx"
 
-
-namespace slideshow::internal {
-
-::basegfx::B2DPolyPolygon IrisWipe::operator () ( double t )
+namespace slideshow::internal
+{
+::basegfx::B2DPolyPolygon IrisWipe::operator()(double t)
 {
 const double d = 

[Libreoffice-commits] core.git: slideshow/source

2020-11-17 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/shapes/viewmediashape.cxx |5 ++---
 slideshow/source/engine/shapes/viewmediashape.hxx |3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit 289eb4131d7edc3de231cd68b0ec34b8757200f6
Author: Stephan Bergmann 
AuthorDate: Tue Nov 17 17:00:54 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Tue Nov 17 19:35:15 2020 +0100

Remove unused ViewMediaShape::implInitializePlayerWindow rMimeType parameter

unused since 08a43cc97ccf88faa9d3a04afc3aacd2c885a2d1 "related: tdf#103884
remove gltf/collada feature"

Change-Id: Ieed4a2dcd2f465de2356e640383bac2cd45b83d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106017
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx 
b/slideshow/source/engine/shapes/viewmediashape.cxx
index 957466dfbb34..950dacc22184 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -291,7 +291,7 @@ namespace slideshow::internal
 
 if( ::canvas::tools::getDeviceInfo( xCanvas, 
aDeviceParams ).getLength() > 1 )
 {
-implInitializePlayerWindow( rBounds, 
aDeviceParams, sMimeType );
+implInitializePlayerWindow( rBounds, aDeviceParams 
);
 }
 
 // set player properties
@@ -380,8 +380,7 @@ namespace slideshow::internal
 
 
 void ViewMediaShape::implInitializePlayerWindow( const 
::basegfx::B2DRectangle&   rBounds,
- const 
uno::Sequence< uno::Any >& rVCLDeviceParams,
- 
std::u16string_view )
+ const 
uno::Sequence< uno::Any >& rVCLDeviceParams )
 {
 SAL_INFO("slideshow", "ViewMediaShape::implInitializePlayerWindow" 
);
 if( mpMediaWindow || rBounds.isEmpty() )
diff --git a/slideshow/source/engine/shapes/viewmediashape.hxx 
b/slideshow/source/engine/shapes/viewmediashape.hxx
index e5cbe1be737b..ce9c9fbf5139 100644
--- a/slideshow/source/engine/shapes/viewmediashape.hxx
+++ b/slideshow/source/engine/shapes/viewmediashape.hxx
@@ -145,8 +145,7 @@ namespace slideshow::internal
 void implSetMediaProperties( const css::uno::Reference< 
css::beans::XPropertySet >& rxProps );
 void implInitializeMediaPlayer( const OUString& rMediaURL, const 
OUString& rMimeType );
 void implInitializePlayerWindow( const ::basegfx::B2DRectangle& 
rBounds,
- const css::uno::Sequence< 
css::uno::Any >& rVCLDeviceParams,
- std::u16string_view rMimeType );
+ const css::uno::Sequence< 
css::uno::Any >& rVCLDeviceParams );
 ViewLayerSharedPtrmpViewLayer;
 VclPtr< SystemChildWindow >   mpMediaWindow;
 mutable css::awt::Point   maWindowOffset;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-10-05 Thread Luboš Luňák (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit d3792300afec9c9cb8751cae5b46e8f9198214b4
Author: Luboš Luňák 
AuthorDate: Mon Oct 5 13:07:18 2020 +0200
Commit: Luboš Luňák 
CommitDate: Mon Oct 5 19:43:15 2020 +0200

try not to hog the CPU during slideshow animations

Try to sleep for most of the busy-waiting loop. Seeing this CPU
usage is annoying when profiling.

Change-Id: Ia01b547b28a22ffcb0e841ea582c93891cf1c5c5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103960
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Reviewed-by: Luboš Luňák 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index ba4d17cd6c1d..3bfee3cb88ba 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -2395,8 +2396,16 @@ void FrameSynchronization::Synchronize()
 if (mbIsActive)
 {
 // Do busy waiting for now.
-while (maTimer.getElapsedTime() < mnNextFrameTargetTime)
-;
+for(;;)
+{
+double remainingTime = mnNextFrameTargetTime - 
maTimer.getElapsedTime();
+if(remainingTime <= 0)
+break;
+// Try to sleep most of it.
+int remainingMilliseconds = remainingTime * 1000;
+if(remainingMilliseconds > 2)
+
osl::Thread::wait(std::chrono::milliseconds(remainingMilliseconds - 2));
+}
 }
 
 MarkCurrentFrame();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-08-31 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/box2dtools.cxx |   21 +++--
 slideshow/source/inc/box2dtools.hxx|3 +++
 2 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit 943aaf6c61d9594ec229984b5d5801afe5d89024
Author: Sarper Akdemir 
AuthorDate: Sun Aug 30 20:44:02 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Mon Aug 31 12:31:05 2020 +0200

tdf#136301: fix parallel physics animations over-stepping during lock 
transfer

introducing mbAlreadyStepped flag to make physics animation effects
aware that the lock was just obtained from another physics animation
which already stepped the time interval meant to be stepped through.

Change-Id: Id7c01c96e302d7da7aae785f56c09a9ddfe4bdf1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101665
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 3c7c3deb657c..1cc69b53632a 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -225,6 +225,7 @@ box2DWorld::box2DWorld(const ::basegfx::B2DVector& 
rSlideSize)
 , mfScaleFactor(calculateScaleFactor(rSlideSize))
 , mbShapesInitialized(false)
 , mbHasWorldStepper(false)
+, mbAlreadyStepped(false)
 , mnPhysicsAnimationCounter(0)
 , mpXShapeToBodyMap()
 , maShapeParallelUpdateQueue()
@@ -574,6 +575,13 @@ void box2DWorld::alertPhysicsAnimationEnd(const 
slideshow::internal::ShapeShared
 // destroyed if there's nothing else that owns them
 mpXShapeToBodyMap.clear();
 }
+else
+{
+// the physics animation that will take over the lock after this one
+// shouldn't step the world for an update cycle - since it was already
+// stepped.
+mbAlreadyStepped = true;
+}
 }
 
 void box2DWorld::alertPhysicsAnimationStart(
@@ -609,9 +617,18 @@ double box2DWorld::stepAmount(const double fPassedTime, 
const float fTimeStep,
 // do the updates required to simulate other animaton effects going in 
parallel
 processUpdateQueue(fTimeSteppedThrough);
 
-for (unsigned int nStepCounter = 0; nStepCounter < nStepAmount; 
nStepCounter++)
+if (!mbAlreadyStepped)
+{
+for (unsigned int nStepCounter = 0; nStepCounter < nStepAmount; 
nStepCounter++)
+{
+step(fTimeStep, nVelocityIterations, nPositionIterations);
+}
+}
+else
 {
-step(fTimeStep, nVelocityIterations, nPositionIterations);
+// just got the step lock from another physics animation
+// so skipping stepping the world for an update cycle
+mbAlreadyStepped = false;
 }
 
 return fTimeSteppedThrough;
diff --git a/slideshow/source/inc/box2dtools.hxx 
b/slideshow/source/inc/box2dtools.hxx
index a71af1d34bef..0f6707fbd7c6 100644
--- a/slideshow/source/inc/box2dtools.hxx
+++ b/slideshow/source/inc/box2dtools.hxx
@@ -85,6 +85,9 @@ private:
 /// Holds whether or not there is a PhysicsAnimation that
 /// is stepping the Box2D World. Used to create a lock mechanism
 bool mbHasWorldStepper;
+/// Flag used to stop overstepping that occurs when a physics
+/// animation effect transfers step-lock to another one.
+bool mbAlreadyStepped;
 /// Number of Physics Animations going on
 int mnPhysicsAnimationCounter;
 std::unordered_map, 
Box2DBodySharedPtr>
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source svtools/source

2020-08-29 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/slideshowimpl.cxx |2 +-
 svtools/source/misc/sampletext.cxx|2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 229827d09bf8257d3fc0b9e0519a92a225587cf3
Author: Andrea Gelmini 
AuthorDate: Sat Aug 29 10:08:22 2020 +0200
Commit: Andrea Gelmini 
CommitDate: Sat Aug 29 19:56:37 2020 +0200

Fix typos

Change-Id: I6517f3b68389c0f3581cc750c61b8e59d075d35e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101633
Tested-by: Jenkins
Reviewed-by: Andrea Gelmini 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index a91d5857bc7d..ba4d17cd6c1d 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -122,7 +122,7 @@ public:
 */
 void Activate();
 
-/** Deactivate frame sychronization when no animation is active and the
+/** Deactivate frame synchronization when no animation is active and the
 time between frames depends on user actions and other external
 sources.  While deactivated Synchronize() will return without delay.
 */
diff --git a/svtools/source/misc/sampletext.cxx 
b/svtools/source/misc/sampletext.cxx
index b1638d0907d6..608615496641 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -623,7 +623,7 @@ static OUString makeMinimalTextForScript(UScriptCode 
eScript)
 //These ones are typically for use in the font preview window in format
 //character
 
-//There we generally know the language. Though its possible for the language to
+//There we generally know the language. Though it's possible for the language 
to
 //be "none".
 
 //Currently we fall back to makeShortRepresentativeTextForScript when we don't
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-08-28 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/animationfactory.cxx |   16 +-
 slideshow/source/engine/box2dtools.cxx   |   29 +--
 slideshow/source/inc/box2dtools.hxx  |   10 +++--
 3 files changed, 45 insertions(+), 10 deletions(-)

New commits:
commit 490cab0539660aa8e1b51f0555b890f69940c04d
Author: Sarper Akdemir 
AuthorDate: Wed Aug 26 21:18:19 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Aug 28 09:24:37 2020 +0200

tdf#136152: make physics animation effects handle animations with jumpy 
starts

fixes the bug where an animation effect doesn't start on it's original 
location
and collides with everything as if it was moving from the original location 
to
wherever the animation effect starts in a single step.

Change-Id: Icd2919bcad665f8a1839a57642694d98ff73afca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101425
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index 8068bbfac83e..db141c906a50 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -214,6 +214,7 @@ namespace slideshow::internal
 maShapeOrig(),
 mnFlags( nFlags ),
 mbAnimationStarted( false ),
+mbAnimationFirstUpdate( true ),
 mnAdditive( nAdditive ),
 mpBox2DWorld( pBox2DWorld )
 {
@@ -324,10 +325,14 @@ namespace slideshow::internal
 mpShapeManager->notifyShapeUpdate( mpShape );
 if ( mpBox2DWorld->isInitialized() )
 {
-mpBox2DWorld->queueShapePathAnimationUpdate( 
mpShape->getXShape(), mpAttrLayer );
+mpBox2DWorld->queueShapePathAnimationUpdate( 
mpShape->getXShape(),
+ 
mpAttrLayer,
+ 
mbAnimationFirstUpdate );
 }
 }
 
+if( mbAnimationFirstUpdate ) mbAnimationFirstUpdate = 
false;
+
 return true;
 }
 
@@ -351,6 +356,7 @@ namespace slideshow::internal
 ::basegfx::B2DPointmaShapeOrig;
 const int  mnFlags;
 bool   mbAnimationStarted;
+bool   mbAnimationFirstUpdate;
 sal_Int16  mnAdditive;
 box2d::utils::Box2DWorldSharedPtr  mpBox2DWorld;
 };
@@ -587,6 +593,7 @@ namespace slideshow::internal
 mnFlags( nFlags ),
 maDefaultValue(rDefaultValue),
 mbAnimationStarted( false ),
+mbAnimationFirstUpdate( true ),
 meAttrType( eAttrType ),
 mpBox2DWorld ( pBox2DWorld )
 {
@@ -694,6 +701,8 @@ namespace slideshow::internal
 if( mpShape->isContentChanged() )
 mpShapeManager->notifyShapeUpdate( mpShape );
 
+if( mbAnimationFirstUpdate ) mbAnimationFirstUpdate = 
false;
+
 return true;
 }
 
@@ -708,12 +717,14 @@ namespace slideshow::internal
 
 if( mpBox2DWorld && mpBox2DWorld->isInitialized() )
 {
-mpBox2DWorld->queueShapeAnimationUpdate( 
mpShape->getXShape(), mpAttrLayer, meAttrType );
+mpBox2DWorld->queueShapeAnimationUpdate( 
mpShape->getXShape(), mpAttrLayer, meAttrType, mbAnimationFirstUpdate );
 }
 
 if( mpShape->isContentChanged() )
 mpShapeManager->notifyShapeUpdate( mpShape );
 
+if( mbAnimationFirstUpdate ) mbAnimationFirstUpdate = 
false;
+
 return true;
 }
 
@@ -746,6 +757,7 @@ namespace slideshow::internal
 
 const ValueT   maDefaultValue;
 bool   mbAnimationStarted;
+bool   mbAnimationFirstUpdate;
 
 const AttributeTypemeAttrType;
 const box2d::utils::Box2DWorldSharedPtr mpBox2DWorld;
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 565467fdb347..5cefff743b2e 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -341,10 +341,13 @@ void box2DWorld::processUpdateQueue(const double 
fPassedTime)
 switch (aQueueElement.meUpdateType)
 {

[Libreoffice-commits] core.git: slideshow/source

2020-08-26 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/animationfactory.cxx |   24 ++-
 slideshow/source/engine/box2dtools.cxx   |  164 ++-
 slideshow/source/inc/box2dtools.hxx  |   19 ---
 3 files changed, 83 insertions(+), 124 deletions(-)

New commits:
commit d29c27af4aff3f5268bd4a07647fd7435603ba11
Author: Sarper Akdemir 
AuthorDate: Tue Aug 25 11:24:22 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Wed Aug 26 14:47:52 2020 +0200

tdf#136097: make physics animation effects handle skips and rewinds

Making box2d world only stay populated when there's an animation
effect going on. This makes it possible to get rid of big chunk
of sequential update implementation.

Change-Id: Iaf50d4871b2355035495618354f0ae09abe94164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101304
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index 327a048afeb1..8068bbfac83e 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -406,23 +406,18 @@ namespace slideshow::internal
 mpShape = rShape;
 mpAttrLayer = rAttrLayer;
 
-if( !(mpBox2DWorld->isInitialized()) )
-mpBox2DWorld->initiateWorld(maPageSize);
-
-if( !(mpBox2DWorld->shapesInitialized()) )
-mpBox2DWorld->initateAllShapesAsStaticBodies( 
mpShapeManager );
-
 ENSURE_OR_THROW( rShape,
  "PhysicsAnimation::start(): Invalid 
shape" );
 ENSURE_OR_THROW( rAttrLayer,
  "PhysicsAnimation::start(): Invalid 
attribute layer" );
 
-mpBox2DBody = mpBox2DWorld->makeShapeDynamic( 
rShape->getXShape(), maStartVelocity, mfDensity, mfBounciness );
-
 if( !mbAnimationStarted )
 {
 mbAnimationStarted = true;
 
+mpBox2DWorld->alertPhysicsAnimationStart(maPageSize, 
mpShapeManager);
+mpBox2DBody = mpBox2DWorld->makeShapeDynamic( 
mpShape->getXShape(), maStartVelocity, mfDensity, mfBounciness );
+
 if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) )
 mpShapeManager->enterAnimationMode( mpShape );
 }
@@ -441,15 +436,22 @@ namespace slideshow::internal
 {
 mbAnimationStarted = false;
 
-// Animation have ended for this body, make it static
-box2d::utils::makeBodyStatic( mpBox2DBody );
-
 if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) )
 mpShapeManager->leaveAnimationMode( mpShape );
 
 if( mpShape->isContentChanged() )
 mpShapeManager->notifyShapeUpdate( mpShape );
+
+mpBox2DWorld->alertPhysicsAnimationEnd(mpShape);
+// if this was the only physics animation effect going 
on
+// all box2d bodies were destroyed on 
alertPhysicsAnimationEnd
+// except the one owned by the animation.
+// Try to destroy the remaining body - if it is unique
+// (it being unique means all physics animation 
effects have ended
+// since otherwise mpBox2DWorld would own a copy of 
the shared_ptr )
+mpBox2DBody.reset();
 }
+
 }
 
 // NumberAnimation interface
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 402a71542dd3..565467fdb347 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -11,6 +11,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -208,9 +209,9 @@ box2DWorld::box2DWorld(const ::basegfx::B2DVector& 
rSlideSize)
 , mfScaleFactor(calculateScaleFactor(rSlideSize))
 , mbShapesInitialized(false)
 , mbHasWorldStepper(false)
+, mnPhysicsAnimationCounter(0)
 , mpXShapeToBodyMap()
 , maShapeParallelUpdateQueue()
-, maShapeSequentialUpdate()
 {
 }
 
@@ -326,75 +327,41 @@ void box2DWorld::setShapeCollision(
 
 void box2DWorld::processUpdateQueue(const double fPassedTime)
 {
-if (maShapeSequentialUpdate.empty())
+while (!maShapeParallelUpdateQueue.empty())
 {
-while (!maShapeParallelUpdateQueue.empty())
-{
-Box2DDynamicUpdateInformation& aQueueElement = 
maShapeParallelUpdateQueue.front();
+Box2DDynamicUpdateInformation& aQueueElement = 
maShapeParallelUpdateQueue.front();
 
-if (aQueueElement.mnDelayForSteps > 0)
-   

[Libreoffice-commits] core.git: slideshow/source vcl/unx xmloff/source

2020-08-25 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/animationnodes/animationphysicsnode.cxx |   16 
++
 vcl/unx/gtk3/gtk3gtkinst.cxx|4 +-
 xmloff/source/draw/animationexport.cxx  |2 -
 3 files changed, 7 insertions(+), 15 deletions(-)

New commits:
commit ff87ef83edf77ba0a9bf11bb8e5306e3b8c7cb04
Author: Noel Grandin 
AuthorDate: Tue Aug 25 15:26:10 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Aug 25 16:47:46 2020 +0200

-Werror=maybe-uninitialized

which only shows up in an optimised build, using gcc

Change-Id: I16015c7d139680aba11bf183c3e2bceb79c9ecba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101330
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/animationnodes/animationphysicsnode.cxx 
b/slideshow/source/engine/animationnodes/animationphysicsnode.cxx
index 3c7c227f2d0c..c750d22a 100644
--- a/slideshow/source/engine/animationnodes/animationphysicsnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationphysicsnode.cxx
@@ -41,39 +41,31 @@ AnimationActivitySharedPtr 
AnimationPhysicsNode::createActivity() const
 "Couldn't get the animation duration.");
 
 ::css::uno::Any aTemp;
-double fStartVelocityX;
+double fStartVelocityX = fDefaultStartVelocityX;
 aTemp = mxPhysicsMotionNode->getStartVelocityX();
 if (aTemp.hasValue())
 aTemp >>= fStartVelocityX;
-else
-fStartVelocityX = fDefaultStartVelocityX;
 
-double fStartVelocityY;
+double fStartVelocityY = fDefaultStartVelocityY;
 aTemp = mxPhysicsMotionNode->getStartVelocityY();
 if (aTemp.hasValue())
 aTemp >>= fStartVelocityY;
-else
-fStartVelocityY = fDefaultStartVelocityY;
 
-double fDensity;
+double fDensity = fDefaultDensity;
 aTemp = mxPhysicsMotionNode->getDensity();
 if (aTemp.hasValue())
 {
 aTemp >>= fDensity;
 fDensity = (fDensity < 0.0) ? 0.0 : fDensity;
 }
-else
-fDensity = fDefaultDensity;
 
-double fBounciness;
+double fBounciness = fDefaultBounciness;
 aTemp = mxPhysicsMotionNode->getBounciness();
 if (aTemp.hasValue())
 {
 aTemp >>= fBounciness;
 fBounciness = std::clamp(fBounciness, 0.0, 1.0);
 }
-else
-fBounciness = fDefaultBounciness;
 
 ActivitiesFactory::CommonParameters const aParms(fillCommonParameters());
 return ActivitiesFactory::createSimpleActivity(
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 19cffc2640c3..c6e557a69275 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -8981,7 +8981,7 @@ public:
 
 virtual void set_alignment(TxtAlign eXAlign) override
 {
-gfloat xalign;
+gfloat xalign = 0;
 switch (eXAlign)
 {
 case TxtAlign::Left:
@@ -12879,7 +12879,7 @@ public:
 
 virtual void set_alignment(TxtAlign eXAlign) override
 {
-GtkJustification eJust;
+GtkJustification eJust = GTK_JUSTIFY_LEFT;
 switch (eXAlign)
 {
 case TxtAlign::Left:
diff --git a/xmloff/source/draw/animationexport.cxx 
b/xmloff/source/draw/animationexport.cxx
index c130f5a45919..af0ea3828eb1 100644
--- a/xmloff/source/draw/animationexport.cxx
+++ b/xmloff/source/draw/animationexport.cxx
@@ -1246,7 +1246,7 @@ void AnimationsExporterImpl::exportAnimate( const 
Reference< XAnimate >& xAnimat
 case AnimationNodeType::ANIMATEPHYSICS:
 {
 eElementToken = XML_ANIMATEPHYSICS;
-double fTemp;
+double fTemp = 0;
 
 Reference< XAnimatePhysics > xAnimatePhysics( xAnimate, 
UNO_QUERY_THROW );
 aTemp = xAnimatePhysics->getStartVelocityX();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-08-22 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/box2dtools.cxx   |   29 ++-
 slideshow/source/engine/shapes/shapeimporter.cxx |1 
 slideshow/source/inc/shape.hxx   |3 --
 3 files changed, 29 insertions(+), 4 deletions(-)

New commits:
commit 5edbac1b8c8b7aad36a0f2b1c5cacc8d6fd5fb44
Author: Sarper Akdemir 
AuthorDate: Sun Aug 16 00:03:43 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Sat Aug 22 18:58:47 2020 +0200

fix group shape crash for physics animations

Group shapes are now considered as foreground objects.

Physics animations now do not create individual bodies
for shapes that are part of a group but instead create
one body that represent all of them.

Change-Id: I27819c853af75aff93636c99f216a67ef18791d6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101174
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 845363501ca4..402a71542dd3 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -18,6 +18,9 @@
 
 #include 
 #include 
+#include 
+
+#include 
 
 #define BOX2D_SLIDE_SIZE_IN_METERS 100.00f
 constexpr double fDefaultStaticBodyBounciness(0.1);
@@ -403,11 +406,35 @@ void box2DWorld::initateAllShapesAsStaticBodies(
 mbShapesInitialized = true;
 auto aXShapeToShapeMap = pShapeManager->getXShapeToShapeMap();
 
-// iterate over shapes in the current slide
+std::unordered_map, bool> 
aXShapeBelongsToAGroup;
+
+// iterate over the shapes in the current slide and flag them if they 
belong to a group
 for (auto aIt = aXShapeToShapeMap.begin(); aIt != aXShapeToShapeMap.end(); 
aIt++)
 {
 slideshow::internal::ShapeSharedPtr pShape = aIt->second;
 if (pShape->isForeground())
+{
+SdrObject* pTemp = 
SdrObject::getSdrObjectFromXShape(pShape->getXShape());
+if (pTemp && pTemp->IsGroupObject())
+{
+SdrObjList* aObjList = pTemp->GetSubList();
+const size_t nObjCount(aObjList->GetObjCount());
+
+for (size_t nObjIndex = 0; nObjIndex < nObjCount; ++nObjIndex)
+{
+SdrObject* pGroupMember(aObjList->GetObj(nObjIndex));
+aXShapeBelongsToAGroup.insert(
+std::make_pair(GetXShapeForSdrObject(pGroupMember), 
true));
+}
+}
+}
+}
+
+// iterate over shapes in the current slide
+for (auto aIt = aXShapeToShapeMap.begin(); aIt != aXShapeToShapeMap.end(); 
aIt++)
+{
+slideshow::internal::ShapeSharedPtr pShape = aIt->second;
+if (pShape->isForeground() && 
!aXShapeBelongsToAGroup[pShape->getXShape()])
 {
 Box2DBodySharedPtr pBox2DBody = createStaticBody(pShape);
 
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx 
b/slideshow/source/engine/shapes/shapeimporter.cxx
index 8f2abded678d..b1b1b3417269 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -495,7 +495,6 @@ ShapeSharedPtr ShapeImporter::importShape() // throw 
(ShapeLoadFailedException)
 }
 if( bIsGroupShape && pRet )
 {
-pRet->setIsForeground(false);
 // push new group on the stack: group traversal
 maShapesStack.push( XShapesEntry( pRet ) );
 }
diff --git a/slideshow/source/inc/shape.hxx b/slideshow/source/inc/shape.hxx
index 6f0ee040d965..bbd2988e0254 100644
--- a/slideshow/source/inc/shape.hxx
+++ b/slideshow/source/inc/shape.hxx
@@ -267,8 +267,7 @@ namespace slideshow::internal
 private:
 /** Flag to check whether the shape belongs to the foreground.
 
-For instance, it is false if the shape belongs to the master 
slide or
-a group shape.
+For instance, it is false if the shape belongs to the master 
slide.
  */
 bool mbIsForeground;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-08-21 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/animationfactory.cxx |4 
 slideshow/source/engine/box2dtools.cxx   |  181 +--
 slideshow/source/inc/box2dtools.hxx  |   33 
 3 files changed, 175 insertions(+), 43 deletions(-)

New commits:
commit b240db92100aec92e0e659c6b404ed1cd0ffcbc3
Author: Sarper Akdemir 
AuthorDate: Thu Aug 13 03:40:25 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Aug 21 16:32:14 2020 +0200

make physics animations handle sequential animations correctly

fixes a bug where if there is a sequence of animations between
two physics animations that change the position, rotation or visibility
of a shape - changes are not picked up by the latter physics animation.

Change-Id: Ie8bb8b32588f4c7bf16317b5229adc5b0334d192
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100715
Reviewed-by: Thorsten Behrens 
Tested-by: Jenkins

diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index efc4587356dd..8f6534a30539 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -323,7 +323,9 @@ namespace slideshow::internal
 {
 mpShapeManager->notifyShapeUpdate( mpShape );
 if ( mpBox2DWorld->isInitialized() )
-mpBox2DWorld->queueDynamicPositionUpdate( 
mpShape->getXShape(), rOutPos );
+{
+mpBox2DWorld->queueShapePathAnimationUpdate( 
mpShape->getXShape(), mpAttrLayer );
+}
 }
 
 return true;
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index f99e03bcd893..bdeabc12e985 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -206,6 +206,7 @@ box2DWorld::box2DWorld(const ::basegfx::B2DVector& 
rSlideSize)
 , mbHasWorldStepper(false)
 , mpXShapeToBodyMap()
 , maShapeParallelUpdateQueue()
+, maShapeSequentialUpdate()
 {
 }
 
@@ -255,6 +256,13 @@ void box2DWorld::createStaticFrameAroundSlide(const 
::basegfx::B2DVector& rSlide
 pStaticBody->CreateFixture();
 }
 
+void box2DWorld::setShapePosition(const 
css::uno::Reference xShape,
+  const basegfx::B2DPoint& rOutPos)
+{
+Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(xShape)->second;
+pBox2DBody->setPosition(rOutPos);
+}
+
 void box2DWorld::setShapePositionByLinearVelocity(
 const css::uno::Reference xShape,
 const basegfx::B2DPoint& rOutPos, const double fPassedTime)
@@ -276,6 +284,13 @@ void box2DWorld::setShapeLinearVelocity(
 pBox2DBody->setLinearVelocity(rVelocity);
 }
 
+void box2DWorld::setShapeAngle(const 
css::uno::Reference xShape,
+   const double fAngle)
+{
+Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(xShape)->second;
+pBox2DBody->setAngle(fAngle);
+}
+
 void box2DWorld::setShapeAngleByAngularVelocity(
 const css::uno::Reference xShape, const 
double fAngle,
 const double fPassedTime)
@@ -307,41 +322,75 @@ void box2DWorld::setShapeCollision(
 
 void box2DWorld::processUpdateQueue(const double fPassedTime)
 {
-while (!maShapeParallelUpdateQueue.empty())
+if (maShapeSequentialUpdate.empty())
 {
-Box2DDynamicUpdateInformation& aQueueElement = 
maShapeParallelUpdateQueue.front();
-
-if (aQueueElement.mnDelayForSteps > 0)
+while (!maShapeParallelUpdateQueue.empty())
 {
-// it was queued as a delayed action, skip it, don't pop
-aQueueElement.mnDelayForSteps--;
+Box2DDynamicUpdateInformation& aQueueElement = 
maShapeParallelUpdateQueue.front();
+
+if (aQueueElement.mnDelayForSteps > 0)
+{
+// it was queued as a delayed action, skip it, don't pop
+aQueueElement.mnDelayForSteps--;
+}
+else
+{
+switch (aQueueElement.meUpdateType)
+{
+default:
+case BOX2D_UPDATE_POSITION:
+setShapePositionByLinearVelocity(aQueueElement.mxShape,
+ 
aQueueElement.maPosition, fPassedTime);
+break;
+case BOX2D_UPDATE_ANGLE:
+setShapeAngleByAngularVelocity(aQueueElement.mxShape, 
aQueueElement.mfAngle,
+   fPassedTime);
+break;
+case BOX2D_UPDATE_SIZE:
+break;
+case BOX2D_UPDATE_VISIBILITY:
+setShapeCollision(aQueueElement.mxShape, 
aQueueElement.mbVisibility);
+break;
+case 

[Libreoffice-commits] core.git: slideshow/source

2020-08-21 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/activitiesqueue.cxx |   23 
++
 slideshow/source/engine/animationnodes/animationbasenode.cxx|   11 +++-
 slideshow/source/engine/animationnodes/animationbasenode.hxx|5 +-
 slideshow/source/engine/animationnodes/animationphysicsnode.cxx |5 ++
 slideshow/source/engine/animationnodes/animationphysicsnode.hxx |1 
 slideshow/source/inc/activitiesqueue.hxx|7 +++
 6 files changed, 48 insertions(+), 4 deletions(-)

New commits:
commit 76f3218b32acbc1b67bd291ac84067c83f6e3c2f
Author: Sarper Akdemir 
AuthorDate: Thu Aug 6 10:32:55 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Aug 21 16:31:52 2020 +0200

make physics animation effects always processed last

Makes it possible to add activities that will be processed last in the 
queue.

Makes physics animation effects queued this way.

And fixes the bug that makes physics animation effects appear
out of sync for a frame with the shapes that other in parallel
animation effects control.

Change-Id: I92d436aced6ef3ee2c8b0bf0167c1f7e642ba3b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100713
Reviewed-by: Thorsten Behrens 
Tested-by: Jenkins

diff --git a/slideshow/source/engine/activitiesqueue.cxx 
b/slideshow/source/engine/activitiesqueue.cxx
index ba982385356e..2e3b29d9dbc7 100644
--- a/slideshow/source/engine/activitiesqueue.cxx
+++ b/slideshow/source/engine/activitiesqueue.cxx
@@ -50,6 +50,8 @@ namespace slideshow::internal
 {
 for( const auto& pActivity : maCurrentActivitiesWaiting )
 pActivity->dispose();
+for( const auto& pActivity : maCurrentTailActivitiesWaiting )
+pActivity->dispose();
 for( const auto& pActivity : maCurrentActivitiesReinsert )
 pActivity->dispose();
 }
@@ -72,10 +74,31 @@ namespace slideshow::internal
 return true;
 }
 
+bool ActivitiesQueue::addTailActivity(const ActivitySharedPtr 
)
+{
+OSL_ENSURE( pActivity, "ActivitiesQueue::addTailActivity: activity 
ptr NULL" );
+
+if( !pActivity )
+return false;
+
+// Activities that should be processed last are kept in a different
+// ActivityQueue, and later appended to the end of the 
maCurrentActivitiesWaiting
+// on the beginning of ActivitiesQueue::process()
+maCurrentTailActivitiesWaiting.push_back( pActivity );
+
+return true;
+}
+
 void ActivitiesQueue::process()
 {
 SAL_INFO("slideshow.verbose", "ActivitiesQueue: outer loop 
heartbeat" );
 
+// If there are activities to be processed last append them to the 
end of the ActivitiesQueue
+maCurrentActivitiesWaiting.insert( 
maCurrentActivitiesWaiting.end(),
+   
maCurrentTailActivitiesWaiting.begin(),
+   
maCurrentTailActivitiesWaiting.end() );
+maCurrentTailActivitiesWaiting.clear();
+
 // accumulate time lag for all activities, and lag time
 // base if necessary:
 double fLag = 0.0;
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx 
b/slideshow/source/engine/animationnodes/animationbasenode.cxx
index 4dcb640795aa..1a15bf2de843 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.cxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx
@@ -45,12 +45,12 @@ AnimationBaseNode::AnimationBaseNode(
   mxAnimateNode( xNode, uno::UNO_QUERY_THROW ),
   maAttributeLayerHolder(),
   maSlideSize( rContext.maSlideSize ),
-  mpActivity(),
   mpShape(),
   mpShapeSubset(),
   mpSubsetManager(rContext.maContext.mpSubsettableShapeManager),
   mbPreservedVisibility(true),
-  mbIsIndependentSubset( rContext.mbIsIndependentSubset )
+  mbIsIndependentSubset( rContext.mbIsIndependentSubset ),
+  mpActivity()
 {
 // extract native node targets
 // ===
@@ -294,7 +294,7 @@ void AnimationBaseNode::activate_st()
 mpActivity->setTargets( getShape(), maAttributeLayerHolder.get() );
 
 // add to activities queue
-getContext().mrActivitiesQueue.addActivity( mpActivity );
+enqueueActivity();
 }
 else {
 // Actually, DO generate the event for empty activity,
@@ -372,6 +372,11 @@ bool AnimationBaseNode::hasPendingAnimation() const
 return true;
 }
 
+bool AnimationBaseNode::enqueueActivity() const
+{
+return getContext().mrActivitiesQueue.addActivity( mpActivity );
+}
+
 #if defined(DBG_UTIL)
 void AnimationBaseNode::showState() const
 {
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.hxx 

[Libreoffice-commits] core.git: slideshow/source

2020-08-21 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/animationfactory.cxx |2 -
 slideshow/source/engine/box2dtools.cxx   |   36 +--
 slideshow/source/inc/box2dtools.hxx  |   13 +
 3 files changed, 26 insertions(+), 25 deletions(-)

New commits:
commit 7de41aa023408873c69d6d232ceee56a0f2f9aa5
Author: Sarper Akdemir 
AuthorDate: Fri Aug 21 10:12:25 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Fri Aug 21 13:05:51 2020 +0200

box2dtools renaming some for clarity

Change-Id: Idd872213ee3140e82fbd6e8e8bd1ebff78dfdc18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101132
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index 7f5910cfb992..efc4587356dd 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -323,7 +323,7 @@ namespace slideshow::internal
 {
 mpShapeManager->notifyShapeUpdate( mpShape );
 if ( mpBox2DWorld->isInitialized() )
-mpBox2DWorld->queuePositionUpdate( 
mpShape->getXShape(), rOutPos );
+mpBox2DWorld->queueDynamicPositionUpdate( 
mpShape->getXShape(), rOutPos );
 }
 
 return true;
diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index 6fa427c15c9a..f99e03bcd893 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -205,7 +205,7 @@ box2DWorld::box2DWorld(const ::basegfx::B2DVector& 
rSlideSize)
 , mbShapesInitialized(false)
 , mbHasWorldStepper(false)
 , mpXShapeToBodyMap()
-, maShapeUpdateQueue()
+, maShapeParallelUpdateQueue()
 {
 }
 
@@ -307,9 +307,9 @@ void box2DWorld::setShapeCollision(
 
 void box2DWorld::processUpdateQueue(const double fPassedTime)
 {
-while (!maShapeUpdateQueue.empty())
+while (!maShapeParallelUpdateQueue.empty())
 {
-Box2DShapeUpdateInformation& aQueueElement = 
maShapeUpdateQueue.front();
+Box2DDynamicUpdateInformation& aQueueElement = 
maShapeParallelUpdateQueue.front();
 
 if (aQueueElement.mnDelayForSteps > 0)
 {
@@ -340,7 +340,7 @@ void box2DWorld::processUpdateQueue(const double 
fPassedTime)
 case BOX2D_UPDATE_ANGULAR_VELOCITY:
 setShapeAngularVelocity(aQueueElement.mxShape, 
aQueueElement.mfAngularVelocity);
 }
-maShapeUpdateQueue.pop();
+maShapeParallelUpdateQueue.pop();
 }
 }
 }
@@ -378,47 +378,47 @@ void box2DWorld::setHasWorldStepper(const bool 
bHasWorldStepper)
 mbHasWorldStepper = bHasWorldStepper;
 }
 
-void box2DWorld::queuePositionUpdate(
+void box2DWorld::queueDynamicPositionUpdate(
 const css::uno::Reference& xShape,
 const basegfx::B2DPoint& rOutPos)
 {
-Box2DShapeUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_POSITION };
+Box2DDynamicUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_POSITION };
 aQueueElement.maPosition = rOutPos;
-maShapeUpdateQueue.push(aQueueElement);
+maShapeParallelUpdateQueue.push(aQueueElement);
 }
 
 void box2DWorld::queueLinearVelocityUpdate(
 const css::uno::Reference& xShape,
 const basegfx::B2DVector& rVelocity)
 {
-Box2DShapeUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_LINEAR_VELOCITY, 1 };
+Box2DDynamicUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_LINEAR_VELOCITY, 1 };
 aQueueElement.maVelocity = rVelocity;
-maShapeUpdateQueue.push(aQueueElement);
+maShapeParallelUpdateQueue.push(aQueueElement);
 }
 
-void box2DWorld::queueRotationUpdate(
+void box2DWorld::queueDynamicRotationUpdate(
 const css::uno::Reference& xShape, const 
double fAngle)
 {
-Box2DShapeUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_ANGLE };
+Box2DDynamicUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_ANGLE };
 aQueueElement.mfAngle = fAngle;
-maShapeUpdateQueue.push(aQueueElement);
+maShapeParallelUpdateQueue.push(aQueueElement);
 }
 
 void box2DWorld::queueAngularVelocityUpdate(
 const css::uno::Reference& xShape,
 const double fAngularVelocity)
 {
-Box2DShapeUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_ANGULAR_VELOCITY, 1 };
+Box2DDynamicUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_ANGULAR_VELOCITY, 1 };
 aQueueElement.mfAngularVelocity = fAngularVelocity;
-maShapeUpdateQueue.push(aQueueElement);
+maShapeParallelUpdateQueue.push(aQueueElement);
 }
 
 void box2DWorld::queueShapeVisibilityUpdate(
 const css::uno::Reference& xShape, const 
bool bVisibility)
 {
-Box2DShapeUpdateInformation aQueueElement = { xShape, {}, 
BOX2D_UPDATE_VISIBILITY };
+Box2DDynamicUpdateInformation 

[Libreoffice-commits] core.git: slideshow/source

2020-08-21 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/animationnodes/basenode.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 4c64a07b5861108c9095cc9cfc14616c9e238456
Author: Andrea Gelmini 
AuthorDate: Thu Aug 20 13:10:53 2020 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 21 12:36:16 2020 +0200

Fix typo in code

Change-Id: I65d54b3822177916850d296dcff1eb9baaebc964
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101110
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/animationnodes/basenode.cxx 
b/slideshow/source/engine/animationnodes/basenode.cxx
index 1b8a6d7fde02..cf732f89701f 100644
--- a/slideshow/source/engine/animationnodes/basenode.cxx
+++ b/slideshow/source/engine/animationnodes/basenode.cxx
@@ -633,8 +633,8 @@ void BaseNode::notifyDeactivating( const 
AnimationNodeSharedPtr& rNotifier )
 void BaseNode::notifyEndListeners() const
 {
 // notify all listeners
-for( const auto& rListner : maDeactivatingListeners )
-rListner->notifyDeactivating( mpSelf );
+for( const auto& rListener : maDeactivatingListeners )
+rListener->notifyDeactivating( mpSelf );
 
 // notify state change
 maContext.mrEventMultiplexer.notifyAnimationEnd( mpSelf );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-08-20 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/box2dtools.cxx |  209 ++---
 slideshow/source/inc/box2dtools.hxx|7 -
 2 files changed, 198 insertions(+), 18 deletions(-)

New commits:
commit 51275a633ff5f8aa5843ba1622c701fd7fdda5a0
Author: Sarper Akdemir 
AuthorDate: Mon Jul 27 23:02:48 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Thu Aug 20 15:23:01 2020 +0200

add support for complex shapes in physics animation effects

Makes it possible to represent complex shapes of LibreOffice
in physics animation effects by closely approximating their geometry.

Therefore enables more convincing animation effects.

Change-Id: I807bbde92c143b8c96792b3d8bf9603a31216486
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100432
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/box2dtools.cxx 
b/slideshow/source/engine/box2dtools.cxx
index c02a967a5f87..6fa427c15c9a 100644
--- a/slideshow/source/engine/box2dtools.cxx
+++ b/slideshow/source/engine/box2dtools.cxx
@@ -11,6 +11,13 @@
 #include 
 
 #include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
 
 #define BOX2D_SLIDE_SIZE_IN_METERS 100.00f
 
@@ -62,6 +69,134 @@ b2Vec2 convertB2DPointToBox2DVec2(const basegfx::B2DPoint& 
aPoint, const double
 return { static_cast(aPoint.getX() * fScaleFactor),
  static_cast(aPoint.getY() * -fScaleFactor) };
 }
+
+// expects rTriangleVector to have coordinates relative to the shape's 
bounding box center
+void addTriangleVectorToBody(const basegfx::triangulator::B2DTriangleVector& 
rTriangleVector,
+ b2Body* aBody, const float fDensity, const float 
fFriction,
+ const float fRestitution, const double 
fScaleFactor)
+{
+for (const basegfx::triangulator::B2DTriangle& aTriangle : rTriangleVector)
+{
+b2FixtureDef aFixture;
+b2PolygonShape aPolygonShape;
+b2Vec2 aTriangleVertices[3]
+= { convertB2DPointToBox2DVec2(aTriangle.getA(), fScaleFactor),
+convertB2DPointToBox2DVec2(aTriangle.getB(), fScaleFactor),
+convertB2DPointToBox2DVec2(aTriangle.getC(), fScaleFactor) };
+
+bool bValidPointDistance = true;
+for (int nPointIndexA = 0; nPointIndexA < 3; nPointIndexA++)
+{
+for (int nPointIndexB = 0; nPointIndexB < 3; nPointIndexB++)
+{
+if (nPointIndexA == nPointIndexB)
+continue;
+
+// check whether the triangle would be a degenerately small one
+if (b2DistanceSquared(aTriangleVertices[nPointIndexA],
+  aTriangleVertices[nPointIndexB])
+< 0.003f)
+{
+bValidPointDistance = false;
+}
+}
+}
+if (bValidPointDistance)
+{
+aPolygonShape.Set(aTriangleVertices, 3);
+aFixture.shape = 
+aFixture.density = fDensity;
+aFixture.friction = fFriction;
+aFixture.restitution = fRestitution;
+aBody->CreateFixture();
+}
+}
+}
+
+// expects rPolygon to have coordinates relative to it's center
+void addEdgeShapeToBody(const basegfx::B2DPolygon& rPolygon, b2Body* aBody, 
const float fDensity,
+const float fFriction, const float fRestitution, const 
double fScaleFactor)
+{
+// make sure there's no bezier curves on the polygon
+assert(!rPolygon.areControlPointsUsed());
+basegfx::B2DPolygon aPolygon = 
basegfx::utils::removeNeutralPoints(rPolygon);
+
+// value that somewhat defines half width of the quadrilateral
+// that will be representing edge segment in the box2d world
+const float fHalfWidth = 0.1f;
+bool bHasPreviousQuadrilateralEdge = false;
+b2Vec2 aQuadrilateralVertices[4];
+
+for (sal_uInt32 nIndex = 0; nIndex < aPolygon.count(); nIndex++)
+{
+b2FixtureDef aFixture;
+b2PolygonShape aPolygonShape;
+
+basegfx::B2DPoint aPointA;
+basegfx::B2DPoint aPointB;
+if (nIndex != 0)
+{
+aPointA = aPolygon.getB2DPoint(nIndex - 1);
+aPointB = aPolygon.getB2DPoint(nIndex);
+}
+else if (aPolygon.isClosed())
+{
+// start by connecting the last point to the first one
+aPointA = aPolygon.getB2DPoint(aPolygon.count() - 1);
+aPointB = aPolygon.getB2DPoint(nIndex);
+}
+else // the polygon isn't closed, won't connect last and first points
+{
+continue;
+}
+
+b2Vec2 aEdgeUnitVec(convertB2DPointToBox2DVec2(aPointB, fScaleFactor)
+- convertB2DPointToBox2DVec2(aPointA, 
fScaleFactor));
+aEdgeUnitVec.Normalize();
+
+b2Vec2 aEdgeNormal(-aEdgeUnitVec.y, aEdgeUnitVec.x);
+
+if 

[Libreoffice-commits] core.git: slideshow/source

2020-08-08 Thread Julien Nabet (via logerrit)
 slideshow/source/engine/slide/layermanager.cxx |2 +-
 slideshow/source/engine/slide/slideimpl.cxx|4 ++--
 slideshow/source/inc/slide.hxx |4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 749ac5f415a590da505eb5e3d4a37a49a9c82fcc
Author: Julien Nabet 
AuthorDate: Sat Aug 8 08:19:27 2020 +0200
Commit: Julien Nabet 
CommitDate: Sat Aug 8 10:21:28 2020 +0200

Typo bSlideBackgoundPainted

Change-Id: Ice11d37e9832b5841f36e8873f4d11e9c0d6b3c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100376
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/slide/layermanager.cxx 
b/slideshow/source/engine/slide/layermanager.cxx
index 35131ccb1a22..74a26d1e73b3 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -98,7 +98,7 @@ namespace slideshow::internal
 for( const auto& pLayer : maLayers )
 pLayer->clearUpdateRanges();
 
-updateShapeLayers( true/*bSlideBackgoundPainted*/ );
+updateShapeLayers( true/*bSlideBackgroundPainted*/ );
 }
 
 void LayerManager::deactivate()
diff --git a/slideshow/source/engine/slide/slideimpl.cxx 
b/slideshow/source/engine/slide/slideimpl.cxx
index a9120c6da829..b70f8b5abe4e 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -385,7 +385,7 @@ void SlideImpl::prefetch()
 applyInitialShapeAttributes(mxRootNode);
 }
 
-void SlideImpl::show( bool bSlideBackgoundPainted )
+void SlideImpl::show( bool bSlideBackgroundPainted )
 {
 if( mbActive )
 return; // already active
@@ -410,7 +410,7 @@ void SlideImpl::show( bool bSlideBackgoundPainted )
 
 
 // render slide to screen, if requested
-if( !bSlideBackgoundPainted )
+if( !bSlideBackgroundPainted )
 {
 for( const auto& rContext : maContext.mrViewContainer )
 slideRenderer( this, rContext );
diff --git a/slideshow/source/inc/slide.hxx b/slideshow/source/inc/slide.hxx
index db1c0d6f0917..bc3ffeb2aa63 100644
--- a/slideshow/source/inc/slide.hxx
+++ b/slideshow/source/inc/slide.hxx
@@ -71,13 +71,13 @@ namespace slideshow::internal
 After this call, the slide will render itself to the
 views, and start its animations.
 
-@param bSlideBackgoundPainted
+@param bSlideBackgroundPainted
 When true, the initial slide content on the background
 layer is already rendered (e.g. from a previous slide
 transition). When false, Slide renders initial content of
 slide.
  */
-virtual void show( bool bSlideBackgoundPainted ) = 0;
+virtual void show( bool bSlideBackgroundPainted ) = 0;
 
 /** Force-ends the slide
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-07-21 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/eventmultiplexer.cxx |2 +-
 slideshow/source/inc/listenercontainer.hxx   |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit f09c19d94ad97d03c64e318d153e93b53c099daf
Author: Stephan Bergmann 
AuthorDate: Tue Jul 21 18:00:25 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Tue Jul 21 22:50:32 2020 +0200

Deprecated std::result_of has been removed from C++20

...and is no longer provided at least by VS 2019 16.6.4 when using
--with-latest-c++

Change-Id: Iac68bd4eb74a1f805d30cca49da59f35d8af4240
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99169
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/eventmultiplexer.cxx 
b/slideshow/source/engine/eventmultiplexer.cxx
index 888f9039fd12..678c44e42e50 100644
--- a/slideshow/source/engine/eventmultiplexer.cxx
+++ b/slideshow/source/engine/eventmultiplexer.cxx
@@ -94,7 +94,7 @@ struct 
slideshow::internal::ListenerOperations
 std::shared_ptr pListener( rCurr.ptr.lock() );
 
 if( pListener.get() &&
-FunctionApply const&)>::type,
+FunctionApply const&>::type,
std::shared_ptr 
>::apply(func,pListener) )
 {
 bRet = true;
diff --git a/slideshow/source/inc/listenercontainer.hxx 
b/slideshow/source/inc/listenercontainer.hxx
index 6046f5f8efe4..8deb1be90617 100644
--- a/slideshow/source/inc/listenercontainer.hxx
+++ b/slideshow/source/inc/listenercontainer.hxx
@@ -84,7 +84,7 @@ template< typename ListenerT > struct ListenerOperations
 bool bRet(false);
 for( const auto& rCurr : rContainer )
 {
-if( FunctionApply< typename ::std::result_of< FuncT( const 
typename ContainerT::value_type& ) >::type,
+if( FunctionApply< typename ::std::invoke_result< FuncT, const 
typename ContainerT::value_type& >::type,
typename ContainerT::value_type >::apply(
func,
rCurr) )
@@ -135,7 +135,7 @@ struct ListenerOperations< std::weak_ptr >
 std::shared_ptr pListener( rCurr.lock() );
 
 if( pListener.get() &&
-FunctionApply const&)>::type,
+FunctionApply const&>::type,
std::shared_ptr 
>::apply(func,pListener) )
 {
 bRet = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-07-19 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/activities/accumulation.hxx  |
6 +
 slideshow/source/engine/activities/activitybase.hxx  |
6 +
 slideshow/source/engine/activities/activityparameters.hxx|
6 +
 slideshow/source/engine/activities/continuousactivitybase.hxx|
6 +
 slideshow/source/engine/activities/continuouskeytimeactivitybase.hxx |
6 +
 slideshow/source/engine/activities/discreteactivitybase.hxx  |
6 +
 slideshow/source/engine/activities/simplecontinuousactivitybase.hxx  |
6 +
 slideshow/source/engine/animationnodes/animationaudionode.hxx|
6 +
 slideshow/source/engine/animationnodes/animationbasenode.hxx |
6 +
 slideshow/source/engine/animationnodes/animationcolornode.hxx|
6 +
 slideshow/source/engine/animationnodes/animationcommandnode.hxx  |
6 +
 slideshow/source/engine/animationnodes/animationpathmotionnode.hxx   |
6 +
 slideshow/source/engine/animationnodes/animationsetnode.hxx  |
6 +
 slideshow/source/engine/animationnodes/animationtransformnode.hxx|
6 +
 slideshow/source/engine/animationnodes/animationtransitionfilternode.hxx |
6 +
 slideshow/source/engine/animationnodes/generateevent.hxx |
6 +
 slideshow/source/engine/animationnodes/nodetools.hxx |
5 
 slideshow/source/engine/animationnodes/paralleltimecontainer.hxx |
6 +
 slideshow/source/engine/animationnodes/propertyanimationnode.hxx |
6 +
 slideshow/source/engine/animationnodes/sequentialtimecontainer.hxx   |
6 +
 slideshow/source/engine/animationnodes/setactivity.hxx   |
6 +
 slideshow/source/engine/pointersymbol.hxx|
6 +
 slideshow/source/engine/rehearsetimingsactivity.hxx  |
6 +
 slideshow/source/engine/shapes/appletshape.hxx   |
5 
 slideshow/source/engine/shapes/backgroundshape.hxx   |
6 +
 slideshow/source/engine/shapes/drawinglayeranimation.hxx |
6 +
 slideshow/source/engine/shapes/drawshape.hxx |
6 +
 slideshow/source/engine/shapes/drawshapesubsetting.hxx   |
5 
 slideshow/source/engine/shapes/externalshapebase.hxx |
5 
 slideshow/source/engine/shapes/gdimtftools.hxx   |
5 
 slideshow/source/engine/shapes/intrinsicanimationactivity.hxx|
6 +
 slideshow/source/engine/shapes/mediashape.hxx|
6 +
 slideshow/source/engine/shapes/viewbackgroundshape.hxx   |
5 
 slideshow/source/engine/shapes/viewmediashape.hxx|
5 
 slideshow/source/engine/shapes/viewshape.hxx |
5 
 slideshow/source/engine/slide/layer.hxx  |
5 
 slideshow/source/engine/slide/layermanager.hxx   |
6 +
 slideshow/source/engine/slide/shapemanagerimpl.hxx   |
6 +
 slideshow/source/engine/slide/slideanimations.hxx|
6 +
 slideshow/source/engine/slide/targetpropertiescreator.hxx|   
10 +
 slideshow/source/engine/slide/userpaintoverlay.hxx   |
6 +
 slideshow/source/engine/transitions/barndoorwipe.hxx |
5 +---
 slideshow/source/engine/transitions/barwipepolypolygon.hxx   |
5 +---
 slideshow/source/engine/transitions/boxwipe.hxx  |
5 +---
 slideshow/source/engine/transitions/checkerboardwipe.hxx |
5 +---
 slideshow/source/engine/transitions/clippingfunctor.hxx  |
6 +
 slideshow/source/engine/transitions/clockwipe.hxx|
5 +---
 slideshow/source/engine/transitions/combtransition.hxx   |
6 +
 slideshow/source/engine/transitions/doublediamondwipe.hxx|
5 +---
 slideshow/source/engine/transitions/ellipsewipe.hxx  |
5 +---
 slideshow/source/engine/transitions/fanwipe.hxx  |
5 +---
 slideshow/source/engine/transitions/figurewipe.hxx   |
5 +---
 slideshow/source/engine/transitions/fourboxwipe.hxx  |
5 +---
 slideshow/source/engine/transitions/iriswipe.hxx |
5 +---
 slideshow/source/engine/transitions/parametricpolypolygon.hxx|
5 
 slideshow/source/engine/transitions/parametricpolypolygonfactory.hxx |
6 +
 slideshow/source/engine/transitions/pinwheelwipe.hxx |
5 +---
 

[Libreoffice-commits] core.git: slideshow/source slideshow/util

2020-07-16 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/opengl/TransitionerImpl.cxx |   39 ++-
 slideshow/source/engine/opengl/ogltrans.component   |5 +-
 slideshow/source/engine/slideshowimpl.cxx   |   41 +---
 slideshow/util/slideshow.component  |5 +-
 4 files changed, 55 insertions(+), 35 deletions(-)

New commits:
commit 6dbfba16d86b81419d833c6ab2c4904b67770069
Author: Noel Grandin 
AuthorDate: Thu Jul 16 09:31:52 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Jul 16 12:18:44 2020 +0200

slideshow: create instances with uno constructors

See tdf#74608 for motivation.

Change-Id: I0b0a74ec8133de55664e471fcf13d7c66f882b12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98871
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx 
b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index b9aa8326a438..41a95994062e 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -46,15 +46,14 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
-#include 
-
 #include 
 
 #include 
@@ -1154,15 +1153,29 @@ OGLTransitionerImpl::OGLTransitionerImpl()
 {
 }
 
-typedef cppu::WeakComponentImplHelper 
OGLTransitionFactoryImplBase;
+typedef cppu::WeakComponentImplHelper OGLTransitionFactoryImplBase;
 
 class OGLTransitionFactoryImpl : private cppu::BaseMutex, public 
OGLTransitionFactoryImplBase
 {
 public:
-explicit OGLTransitionFactoryImpl( const uno::Reference< 
uno::XComponentContext >& ) :
+explicit OGLTransitionFactoryImpl() :
 OGLTransitionFactoryImplBase(m_aMutex)
 {}
 
+// XServiceInfo
+virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override
+{
+return { "com.sun.star.presentation.TransitionFactory" };
+}
+virtual OUString SAL_CALL getImplementationName() override
+{
+return "com.sun.star.comp.presentation.OGLTransitionFactory";
+}
+virtual sal_Bool SAL_CALL supportsService(const OUString& aServiceName) 
override
+{
+return cppu::supportsService(this, aServiceName);
+}
+
 // XTransitionFactory
 virtual sal_Bool SAL_CALL hasTransition( sal_Int16 transitionType, 
sal_Int16 transitionSubType ) override
 {
@@ -1305,18 +1318,10 @@ public:
 
 }
 
-namespace sdecl = comphelper::service_decl;
- const sdecl::ServiceDecl OGLTransitionFactoryDecl(
- sdecl::class_(),
-"com.sun.star.comp.presentation.OGLTransitionFactory",
-"com.sun.star.presentation.TransitionFactory" );
-
-// The C shared lib entry points
-extern "C"
-SAL_DLLPUBLIC_EXPORT void* ogltrans_component_getFactory( char const* 
pImplName,
- void*, void* )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+slideshow_OGLTransitionFactoryImpl_get_implementation(
+css::uno::XComponentContext* , css::uno::Sequence const&)
 {
-return sdecl::component_getFactoryHelper( pImplName, 
{} );
+return cppu::acquire(new OGLTransitionFactoryImpl());
 }
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/engine/opengl/ogltrans.component 
b/slideshow/source/engine/opengl/ogltrans.component
index 20e5e0f07a6c..5ce59a80e335 100644
--- a/slideshow/source/engine/opengl/ogltrans.component
+++ b/slideshow/source/engine/opengl/ogltrans.component
@@ -18,8 +18,9 @@
  -->
 
 http://openoffice.org/2010/uno-components;>
-  
+xmlns="http://openoffice.org/2010/uno-components;>
+  
 
   
 
diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 9fd3d536dbce..cbc468d9f17b 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -23,9 +23,9 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 #include 
 #include 
 
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -177,7 +178,7 @@ private:
 
  
**/
 
-typedef cppu::WeakComponentImplHelper 
SlideShowImplBase;
+typedef cppu::WeakComponentImplHelper SlideShowImplBase;
 
 typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector;
 
@@ -255,6 +256,11 @@ public:
 virtual std::shared_ptr getMediaTempFile(const 
OUString& aUrl) override;
 
 private:
+// XServiceInfo
+virtual OUString SAL_CALL getImplementationName() override;
+virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) 
override;
+virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames 
() override;
+
 // XSlideShow:
 virtual sal_Bool SAL_CALL nextEffect() override;
 virtual sal_Bool SAL_CALL previousEffect() override;
@@ -664,6 +670,21 @@ void SlideShowImpl::disposing()
 

[Libreoffice-commits] core.git: slideshow/source

2020-07-01 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/transitions/transitionfactorytab.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f9766129b660193a886be36b74f4ca438047c778
Author: Stephan Bergmann 
AuthorDate: Wed Jul 1 23:47:40 2020 +0200
Commit: Stephan Bergmann 
CommitDate: Thu Jul 2 07:10:48 2020 +0200

Upcoming improved loplugin:staticanonymous -> redundantstatic: slideshow

Change-Id: If1edbfd2da7082cb5c03dda8c3c1a7af6de6da53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97666
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/transitions/transitionfactorytab.cxx 
b/slideshow/source/engine/transitions/transitionfactorytab.cxx
index 6ec5a57f56aa..6a22fdd0a4c9 100644
--- a/slideshow/source/engine/transitions/transitionfactorytab.cxx
+++ b/slideshow/source/engine/transitions/transitionfactorytab.cxx
@@ -33,7 +33,7 @@ namespace slideshow::internal {
 
 namespace {
 
-static const TransitionInfo lcl_transitionInfo[] =
+const TransitionInfo lcl_transitionInfo[] =
 {
 {
 0,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source svl/source

2020-07-01 Thread Andrea Gelmini (via logerrit)
 slideshow/source/inc/shape.hxx  |2 +-
 svl/source/notify/broadcast.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 67f5f45505458d0a22d14cf2c6f1e17bb2bd7932
Author: Andrea Gelmini 
AuthorDate: Wed Jul 1 11:22:20 2020 +0200
Commit: Julien Nabet 
CommitDate: Wed Jul 1 11:26:39 2020 +0200

Fix typos

Change-Id: I4f1c0d90fcb7726ceadd72c9cb9f96a57cade67a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97602
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/inc/shape.hxx b/slideshow/source/inc/shape.hxx
index 1638e87c08a7..3fcc516dda4b 100644
--- a/slideshow/source/inc/shape.hxx
+++ b/slideshow/source/inc/shape.hxx
@@ -214,7 +214,7 @@ namespace slideshow
 virtual bool isForeground() const { return mbIsForeground; };
 
 /**
-   Set the flag that holds wheter the shape is
+   Set the flag that holds whether the shape is
in the foreground or not
 
@param bIsForeground
diff --git a/svl/source/notify/broadcast.cxx b/svl/source/notify/broadcast.cxx
index 586a09600ef3..6c75e0f464c1 100644
--- a/svl/source/notify/broadcast.cxx
+++ b/svl/source/notify/broadcast.cxx
@@ -47,7 +47,7 @@
 static bool isDeletedPtr(SvtListener* p)
 {
 /** mark deleted entries by toggling the last bit,which is effectively 
unused, since the struct we point
- * to is at least 16-bit aligned. This allows the binary seach to continue 
working even when we have
+ * to is at least 16-bit aligned. This allows the binary search to 
continue working even when we have
  * deleted entries */
 #if SAL_TYPES_SIZEOFPOINTER == 4
 return (reinterpret_cast(p) & 0x01) == 0x01;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-06-30 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/shapes/backgroundshape.cxx |1 
 slideshow/source/engine/shapes/shapeimporter.cxx   |1 
 slideshow/source/engine/slide/slideimpl.cxx|3 ++
 slideshow/source/inc/shape.hxx |   28 -
 4 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit e13dd9546e27bdc3b894718fc2993f99722ea9f1
Author: Sarper Akdemir 
AuthorDate: Wed Jun 10 02:33:22 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jun 30 23:52:55 2020 +0200

Add Shape mbIsForeground flag and getters and setters for it

mbIsForeground is a flag that is set false if a shape is known to
not belong to the foreground.

It is set to false while shapes are being imported and the shape
belongs to the master slide or is a group shape, right now.

Change-Id: Id9738fc943f32a1e1a6e1888d179e69fd60bd022
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95968
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/shapes/backgroundshape.cxx 
b/slideshow/source/engine/shapes/backgroundshape.cxx
index 88d48b7e72e9..093502815eaf 100644
--- a/slideshow/source/engine/shapes/backgroundshape.cxx
+++ b/slideshow/source/engine/shapes/backgroundshape.cxx
@@ -83,6 +83,7 @@ namespace slideshow::internal
 virtual ::basegfx::B2DRectangle getUpdateArea() const override;
 virtual bool isVisible() const override;
 virtual double getPriority() const override;
+virtual bool isForeground() const override { return false; }
 virtual bool isBackgroundDetached() const override;
 
 
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx 
b/slideshow/source/engine/shapes/shapeimporter.cxx
index b1b1b3417269..8f2abded678d 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -495,6 +495,7 @@ ShapeSharedPtr ShapeImporter::importShape() // throw 
(ShapeLoadFailedException)
 }
 if( bIsGroupShape && pRet )
 {
+pRet->setIsForeground(false);
 // push new group on the stack: group traversal
 maShapesStack.push( XShapesEntry( pRet ) );
 }
diff --git a/slideshow/source/engine/slide/slideimpl.cxx 
b/slideshow/source/engine/slide/slideimpl.cxx
index 0805d084e9fa..a9120c6da829 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -981,7 +981,10 @@ bool SlideImpl::loadShapes()
 ShapeSharedPtr const& rShape(
 aMPShapesFunctor.importShape() );
 if( rShape )
+{
+rShape->setIsForeground(false);
 mpLayerManager->addShape( rShape );
+}
 }
 addPolygons(aMPShapesFunctor.getPolygons());
 
diff --git a/slideshow/source/inc/shape.hxx b/slideshow/source/inc/shape.hxx
index 9b6099462ab6..1638e87c08a7 100644
--- a/slideshow/source/inc/shape.hxx
+++ b/slideshow/source/inc/shape.hxx
@@ -52,7 +52,7 @@ namespace slideshow
 class Shape
 {
 public:
-Shape() = default;
+Shape() : mbIsForeground(true) {}
 virtual ~Shape() {}
 Shape(const Shape&) = delete;
 Shape& operator=(const Shape&) = delete;
@@ -204,6 +204,24 @@ namespace slideshow
  */
 virtual bool isBackgroundDetached() const = 0;
 
+/** Check whether the shape belongs to the foreground
+
+For instance, if the shape is in the master slide
+it does not belong to the foreground.
+
+   @return true if the shape is on the foreground
+ */
+virtual bool isForeground() const { return mbIsForeground; };
+
+/**
+   Set the flag that holds wheter the shape is
+   in the foreground or not
+
+   @param bIsForeground
+   Shape is on the foreground
+ */
+virtual void setIsForeground( const bool bIsForeground ) { 
mbIsForeground = bIsForeground; };
+
 // Misc
 
 
@@ -247,6 +265,14 @@ namespace slideshow
 }
 
 };
+
+private:
+/** Flag to check whether the shape belongs to the foreground.
+
+For instance, it is false if the shape belongs to the master 
slide or
+a group shape.
+ */
+bool mbIsForeground;
 };
 
 /** A set which contains all shapes in an ordered fashion.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-06-30 Thread Sarper Akdemir (via logerrit)
 slideshow/source/engine/slide/layermanager.cxx|7 +++
 slideshow/source/engine/slide/layermanager.hxx|   28 +-
 slideshow/source/engine/slide/shapemanagerimpl.cxx|6 +++
 slideshow/source/engine/slide/shapemanagerimpl.hxx|1 
 slideshow/source/engine/slide/targetpropertiescreator.cxx |   10 ++---
 slideshow/source/inc/shapemanager.hxx |   14 +++
 6 files changed, 50 insertions(+), 16 deletions(-)

New commits:
commit 7394ac17f3c8bdbb1cb3402a08ba7749906f6793
Author: Sarper Akdemir 
AuthorDate: Wed Jun 10 02:11:36 2020 +0300
Commit: Thorsten Behrens 
CommitDate: Tue Jun 30 23:50:18 2020 +0200

adding XShapeToShapeMapSharedPtr getter to ShapeManager

Refactoring XShapeHash in layermanager as XShapeToShapeMap
and XShapeHash in targetpropertiescreator as XShapeToNamedValuesMap.
This refactoring describes what the types are more clearly and
stops violating one define rule in the desired implementation.

And adding getter getXShapeToShapeMap to ShapeManager to enable
Animation::start() to access Shapes and XShapes of the current
slide.

Change-Id: I78d510ae43888fd6cf0f037e224b24f91b263b00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95967
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/slide/layermanager.cxx 
b/slideshow/source/engine/slide/layermanager.cxx
index a69f42d31372..35131ccb1a22 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -302,7 +302,7 @@ namespace slideshow::internal
 {
 ENSURE_OR_THROW( xShape.is(), "LayerManager::lookupShape(): 
invalid Shape" );
 
-const XShapeHash::const_iterator aIter( maXShapeHash.find( xShape 
));
+const XShapeToShapeMap::const_iterator aIter( maXShapeHash.find( 
xShape ));
 if( aIter == maXShapeHash.end() )
 return ShapeSharedPtr(); // not found
 
@@ -341,6 +341,11 @@ namespace slideshow::internal
 return pSubset;
 }
 
+const XShapeToShapeMap& LayerManager::getXShapeToShapeMap() const
+{
+return maXShapeHash;
+}
+
 void LayerManager::revokeSubset( const AttributableShapeSharedPtr& 
rOrigShape,
  const AttributableShapeSharedPtr& 
rSubsetShape )
 {
diff --git a/slideshow/source/engine/slide/layermanager.hxx 
b/slideshow/source/engine/slide/layermanager.hxx
index 0f2844ced967..ec95e08f364c 100644
--- a/slideshow/source/engine/slide/layermanager.hxx
+++ b/slideshow/source/engine/slide/layermanager.hxx
@@ -38,6 +38,16 @@ namespace slideshow
 {
 namespace internal
 {
+/** A hash map which maps the XShape to the corresponding Shape object.
+
+Provides quicker lookup than ShapeSet for simple mappings
+ */
+typedef std::unordered_map<
+  css::uno::Reference< css::drawing::XShape >,
+  ShapeSharedPtr,
+  hash< css::uno::Reference< css::drawing::XShape > >
+> XShapeToShapeMap;
+
 /* Definition of Layermanager class */
 
 /** This class manages all of a slide's layers (and shapes)
@@ -132,6 +142,13 @@ namespace slideshow
 AttributableShapeSharedPtr getSubsetShape( const 
AttributableShapeSharedPtr&rOrigShape,
const DocTreeNode&  
 rTreeNode );
 
+/** Get a map that maps all Shapes with their XShape reference as 
the key
+ *
+ * @return an unordered map that contains all shapes in the
+ * current page with their XShape reference as the key
+ */
+const XShapeToShapeMap& getXShapeToShapeMap() const;
+
 /** Revoke a previously queried subset shape.
 
 With this method, a previously requested subset shape
@@ -219,15 +236,6 @@ namespace slideshow
 bool renderTo( const ::cppcanvas::CanvasSharedPtr& rTargetCanvas ) 
const;
 
 private:
-/** A hash map which maps the XShape to the corresponding Shape 
object.
-
-Provides quicker lookup than ShapeSet for simple mappings
- */
-typedef std::unordered_map<
-  css::uno::Reference< css::drawing::XShape >,
-  ShapeSharedPtr,
-  hash< css::uno::Reference< css::drawing::XShape > >
-> XShapeHash;
 
 class ShapeComparator
 {
@@ -311,7 +319,7 @@ namespace slideshow
 
 /** Contains all shapes with their XShape reference as the key
  */
-XShapeHash   maXShapeHash;
+XShapeToShapeMap maXShapeHash;
 
 /** Set of shapes this LayerManager own
 
diff --git 

[Libreoffice-commits] core.git: slideshow/source

2020-05-25 Thread Luboš Luňák (via logerrit)
 slideshow/source/engine/animationfactory.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit b12d1c41a811f39d37c317f1f71a2ff663edcf27
Author: Luboš Luňák 
AuthorDate: Mon May 25 14:23:05 2020 +0200
Commit: Luboš Luňák 
CommitDate: Mon May 25 16:01:42 2020 +0200

fix an incorrectly removed line

The change in cfaf93d2b3efdbbe was supposed to just remove the call,
not the whole variable assignment.

Change-Id: Id104035a430d3c3f7f462bd115a023f3c541aeac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94788
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index 4dbcbd02696d..f81c37b77df3 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -223,6 +223,8 @@ namespace slideshow::internal
   "PathAnimation::PathAnimation(): failed 
to parse SVG:d path" );
 ENSURE_OR_THROW( aPolyPoly.count() == 1,
   "PathAnimation::PathAnimation(): motion 
path consists of multiple/zero polygon(s)" );
+
+maPathPoly = aPolyPoly.getB2DPolygon(0);
 }
 
 virtual ~PathAnimation() override
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-04-28 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/transitions/figurewipe.cxx   |   20 
+-
 slideshow/source/engine/transitions/figurewipe.hxx   |   12 
+++---
 slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx |   15 
++-
 slideshow/source/engine/transitions/slidetransitionfactory.cxx   |   15 
+++
 4 files changed, 27 insertions(+), 35 deletions(-)

New commits:
commit 429ef3e94af588626df17baf96ac1e085d993947
Author: Noel Grandin 
AuthorDate: Tue Apr 28 08:48:00 2020 +0200
Commit: Noel Grandin 
CommitDate: Tue Apr 28 12:07:01 2020 +0200

loplugin:makeshared in slideshow

Change-Id: Ia8991a50afe1889a29456bac8f61c47ca969d23b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92998
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/transitions/figurewipe.cxx 
b/slideshow/source/engine/transitions/figurewipe.cxx
index 1445eeb25139..f64145d5532e 100644
--- a/slideshow/source/engine/transitions/figurewipe.cxx
+++ b/slideshow/source/engine/transitions/figurewipe.cxx
@@ -34,7 +34,7 @@ namespace slideshow::internal {
 return res;
 }
 
-FigureWipe * FigureWipe::createTriangleWipe()
+std::shared_ptr FigureWipe::createTriangleWipe()
 {
 const double s60 = sin( basegfx::deg2rad(60.0) );
 const double s30 = sin( basegfx::deg2rad(30.0) );
@@ -43,10 +43,10 @@ FigureWipe * FigureWipe::createTriangleWipe()
 figure.append( ::basegfx::B2DPoint( 0.0, -0.5 - s60 ) );
 figure.append( ::basegfx::B2DPoint( -0.5 - s30, 0.5 ) );
 figure.setClosed(true);
-return new FigureWipe(figure);
+return std::make_shared(figure);
 }
 
-FigureWipe * FigureWipe::createArrowHeadWipe()
+std::shared_ptr FigureWipe::createArrowHeadWipe()
 {
 const double s60 = sin( basegfx::deg2rad(60.0) );
 const double s30 = sin( basegfx::deg2rad(30.0) );
@@ -57,10 +57,10 @@ FigureWipe * FigureWipe::createArrowHeadWipe()
 figure.append( ::basegfx::B2DPoint( -0.5 - s30 - off, 0.5 + off ) );
 figure.append( ::basegfx::B2DPoint( 0.0, 0.5 ) );
 figure.setClosed(true);
-return new FigureWipe(figure);
+return std::make_shared(figure);
 }
 
-FigureWipe * FigureWipe::createPentagonWipe()
+std::shared_ptr FigureWipe::createPentagonWipe()
 {
 const double s = sin( basegfx::deg2rad(18.0) );
 const double c = cos( basegfx::deg2rad(18.0) );
@@ -71,10 +71,10 @@ FigureWipe * FigureWipe::createPentagonWipe()
 figure.append( ::basegfx::B2DPoint( -0.5 - s, 0.5 - c ) );
 figure.append( ::basegfx::B2DPoint( -0.5, 0.5 ) );
 figure.setClosed(true);
-return new FigureWipe(figure);
+return std::make_shared(figure);
 }
 
-FigureWipe * FigureWipe::createHexagonWipe()
+std::shared_ptr FigureWipe::createHexagonWipe()
 {
 const double s = sin( basegfx::deg2rad(30.0) );
 const double c = cos( basegfx::deg2rad(30.0) );
@@ -86,10 +86,10 @@ FigureWipe * FigureWipe::createHexagonWipe()
 figure.append( ::basegfx::B2DPoint( -0.5 - s, 0.0 ) );
 figure.append( ::basegfx::B2DPoint( -0.5, c ) );
 figure.setClosed(true);
-return new FigureWipe(figure);
+return std::make_shared(figure);
 }
 
-FigureWipe * FigureWipe::createStarWipe( sal_Int32 nPoints )
+std::shared_ptr FigureWipe::createStarWipe( sal_Int32 nPoints )
 {
 const double v = M_PI / nPoints;
 const ::basegfx::B2DPoint p_( 0.0, -M_SQRT2 );
@@ -109,7 +109,7 @@ FigureWipe * FigureWipe::createStarWipe( sal_Int32 nPoints )
 figure.append(p);
 }
 figure.setClosed(true);
-return new FigureWipe(figure);
+return std::make_shared(figure);
 }
 
 }
diff --git a/slideshow/source/engine/transitions/figurewipe.hxx 
b/slideshow/source/engine/transitions/figurewipe.hxx
index 92f0735cfeaa..f5dc91bde155 100644
--- a/slideshow/source/engine/transitions/figurewipe.hxx
+++ b/slideshow/source/engine/transitions/figurewipe.hxx
@@ -29,15 +29,15 @@ namespace internal {
 class FigureWipe : public ParametricPolyPolygon
 {
 public:
-static FigureWipe * createTriangleWipe();
-static FigureWipe * createArrowHeadWipe();
-static FigureWipe * createStarWipe( sal_Int32 nPoints );
-static FigureWipe * createPentagonWipe();
-static FigureWipe * createHexagonWipe();
+static std::shared_ptr createTriangleWipe();
+static std::shared_ptr createArrowHeadWipe();
+static std::shared_ptr createStarWipe( sal_Int32 nPoints );
+static std::shared_ptr createPentagonWipe();
+static std::shared_ptr createHexagonWipe();
 
 virtual ::basegfx::B2DPolyPolygon operator () ( double t ) override;
-private:
 explicit FigureWipe( ::basegfx::B2DPolygon const & figure ) : 
m_figure(figure) {}
+private:
 const ::basegfx::B2DPolygon m_figure;
 };
 
diff --git 
a/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx 
b/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx
index f95d4e3f72fc..773f76aeaeb3 100644
--- 

[Libreoffice-commits] core.git: slideshow/source

2020-03-30 Thread Gülşah Köse (via logerrit)
 slideshow/source/engine/effectrewinder.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit 14a0727889699128f02ac0a79bdce0103c89bc01
Author: Gülşah Köse 
AuthorDate: Mon Mar 30 16:20:32 2020 +0300
Commit: Andras Timar 
CommitDate: Mon Mar 30 18:12:28 2020 +0200

tdf#131254 Follow-up Prevent extra eventqueue empty call.

When two advance timing set slides in a row, there is another
extra forceEmpty call that disables timing setting.
Follow up commit 80f386f787ad59936ead2022e6d932a6d441c6e9

Change-Id: I8e70ebf57328b51eab2baca9728a0f8e0561120c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91367
Tested-by: Jenkins
Reviewed-by: Andras Timar 

diff --git a/slideshow/source/engine/effectrewinder.cxx 
b/slideshow/source/engine/effectrewinder.cxx
index 060e1dfd92ee..8319856c1154 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -171,7 +171,6 @@ bool EffectRewinder::rewind (
 
 // Abort (and skip over the rest of) any currently active animation.
 mrUserEventQueue.callSkipEffectEventHandler();
-mrEventQueue.forceEmpty();
 
 const int nSkipCount (mnMainSequenceEffectCount - 1);
 if (nSkipCount < 0)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-03-26 Thread Gülşah Köse (via logerrit)
 slideshow/source/engine/effectrewinder.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 80f386f787ad59936ead2022e6d932a6d441c6e9
Author: Gülşah Köse 
AuthorDate: Mon Mar 23 15:33:40 2020 +0300
Commit: Gülşah Köse 
CommitDate: Thu Mar 26 19:36:07 2020 +0100

tdf#131254 Prevent extra eventqueue empty call.

That call disables advance timing setting when we back
to previous slide. Its comment line says "Process initial
events and skip any animations that are started when the
slide is shown" but it can still skip any animations.
It seems that is an unnneeded call here.

Change-Id: Iec23409da8285f5b7a8bff3d9c4f507a997ae885
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90913
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/slideshow/source/engine/effectrewinder.cxx 
b/slideshow/source/engine/effectrewinder.cxx
index 79b1f9159a29..060e1dfd92ee 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -410,7 +410,7 @@ void EffectRewinder::asynchronousRewind (
 // Process initial events and skip any animations that are started
 // when the slide is shown.
 mbNonUserTriggeredMainSequenceEffectSeen = false;
-mrEventQueue.forceEmpty();
+
 if (mbNonUserTriggeredMainSequenceEffectSeen)
 {
 mrUserEventQueue.callSkipEffectEventHandler();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2020-03-12 Thread Noel Grandin (via logerrit)
 slideshow/source/engine/animationfactory.cxx   |4 -
 slideshow/source/engine/animationnodes/animationbasenode.hxx   |4 -
 slideshow/source/engine/expressionnodefactory.cxx  |2 
 slideshow/source/engine/opengl/Operation.hxx   |   34 
+-
 slideshow/source/engine/opengl/TransitionerImpl.cxx|6 -
 slideshow/source/engine/rehearsetimingsactivity.cxx|2 
 slideshow/source/engine/shapes/drawinglayeranimation.cxx   |   14 ++--
 slideshow/source/engine/shapes/drawshapesubsetting.cxx |6 -
 slideshow/source/engine/shapes/externalshapebase.hxx   |2 
 slideshow/source/engine/shapes/gdimtftools.hxx |4 -
 slideshow/source/engine/shapes/intrinsicanimationactivity.cxx  |4 -
 slideshow/source/engine/shapes/viewappletshape.hxx |2 
 slideshow/source/engine/shapes/viewbackgroundshape.hxx |2 
 slideshow/source/engine/shapes/viewmediashape.hxx  |2 
 slideshow/source/engine/shapes/viewshape.hxx   |2 
 slideshow/source/engine/slide/layer.hxx|2 
 slideshow/source/engine/slide/layermanager.cxx |2 
 slideshow/source/engine/slide/layermanager.hxx |2 
 slideshow/source/engine/slide/slideanimations.hxx  |2 
 slideshow/source/engine/slide/slideimpl.cxx|2 
 slideshow/source/engine/slide/targetpropertiescreator.cxx  |4 -
 slideshow/source/engine/slideshowimpl.cxx  |2 
 slideshow/source/engine/smilfunctionparser.cxx |2 
 slideshow/source/engine/transitions/combtransition.hxx |2 
 slideshow/source/engine/transitions/ellipsewipe.hxx|2 
 slideshow/source/engine/transitions/pinwheelwipe.hxx   |2 
 slideshow/source/engine/transitions/randomwipe.hxx |2 
 slideshow/source/engine/transitions/slidetransitionfactory.cxx |6 -
 slideshow/source/engine/transitions/waterfallwipe.hxx  |2 
 slideshow/source/inc/activitiesfactory.hxx |   10 +-
 slideshow/source/inc/animatedsprite.hxx|4 -
 slideshow/source/inc/basenode.hxx  |4 -
 slideshow/source/inc/interruptabledelayevent.hxx   |2 
 slideshow/source/inc/shapeimporter.hxx |2 
 slideshow/source/inc/shapesubset.hxx   |4 -
 slideshow/source/inc/transitioninfo.hxx|   22 +++---
 36 files changed, 86 insertions(+), 86 deletions(-)

New commits:
commit 26b84cd8c5d1b0ab8c4cb765bbbaecf3c21e4ed2
Author: Noel Grandin 
AuthorDate: Thu Mar 12 16:54:40 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Mar 12 19:44:42 2020 +0100

Revert "loplugin:constfields in slideshow"

This reverts commit 56940b766e5d52cb1c17b4250e4c7e2c375b7b65.

Change-Id: I5b585ff44870193becc0770e6504ac645b254ef3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90418
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index 9996924880ac..fc5417ffaf8f 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -341,7 +341,7 @@ namespace slideshow::internal
 ::basegfx::B2DPointmaShapeOrig;
 const int  mnFlags;
 bool   mbAnimationStarted;
-sal_Int16 constmnAdditive;
+sal_Int16  mnAdditive;
 };
 
 
@@ -617,7 +617,7 @@ namespace slideshow::internal
 }
 
 private:
-double const mnScale;
+double mnScale;
 };
 
 /** Overload for NumberAnimations which need scaling 
(width,height,x,y currently)
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.hxx 
b/slideshow/source/engine/animationnodes/animationbasenode.hxx
index ec03c57034cc..c8716706c166 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.hxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.hxx
@@ -79,14 +79,14 @@ private:
 private:
 css::uno::Reference  mxAnimateNode;
 ShapeAttributeLayerHolder   maAttributeLayerHolder;
-::basegfx::B2DVector const  maSlideSize;
+::basegfx::B2DVectormaSlideSize;
 AnimationActivitySharedPtr  mpActivity;
 
 /// When valid, this node has a plain target shape
 AttributableShapeSharedPtr  mpShape;
 /// When valid, this is a subsetted target shape
 ShapeSubsetSharedPtr

[Libreoffice-commits] core.git: slideshow/source

2020-01-23 Thread Katarina Behrens (via logerrit)
 slideshow/source/engine/shapes/viewmediashape.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit d4561921dde7d350b3b4d5f793871bea8ba4546d
Author: Katarina Behrens 
AuthorDate: Tue Jan 21 13:16:09 2020 +0100
Commit: Katarina Behrens 
CommitDate: Thu Jan 23 10:17:44 2020 +0100

tdf#126459: Consider translated origin of the view also on resize

use-case is the presenter console on 2nd screen, media shape must
be placed relative to the window w/ slide preview, not relative to
the main window

Change-Id: I120f86e399563d2aafc31d88d0a7f9d357f4840c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87135
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx 
b/slideshow/source/engine/shapes/viewmediashape.cxx
index e68cdf2b543a..3e8056fa8539 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -227,8 +227,13 @@ namespace slideshow
 if( rRangePix.isEmpty() )
 return true;
 
-const Point aPosPixel( rRangePix.getMinX() + maWindowOffset.X,
-   rRangePix.getMinY() + maWindowOffset.Y );
+awt::Rectangle aCanvasArea;
+UnoViewSharedPtr 
xUnoView(std::dynamic_pointer_cast(mpViewLayer));
+if (xUnoView)
+aCanvasArea = xUnoView->getUnoView()->getCanvasArea();
+
+const Point aPosPixel( rRangePix.getMinX() + maWindowOffset.X + 
aCanvasArea.X,
+   rRangePix.getMinY() + maWindowOffset.Y + 
aCanvasArea.Y );
 const Size  aSizePixel( rRangePix.getMaxX() - rRangePix.getMinX(),
 rRangePix.getMaxY() - rRangePix.getMinY() 
);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2019-12-19 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/transitions/ellipsewipe.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2212bf8bbb1bce09a1b49accb459d260c1302bff
Author: Andrea Gelmini 
AuthorDate: Thu Dec 19 10:24:41 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 19 10:27:33 2019 +0100

Fix typo

Change-Id: I9180bbf41d6b8d92ef8a32ea85a692d50cea848c
Reviewed-on: https://gerrit.libreoffice.org/85491
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/slideshow/source/engine/transitions/ellipsewipe.cxx 
b/slideshow/source/engine/transitions/ellipsewipe.cxx
index 9cf694683adb..395b1a750de4 100644
--- a/slideshow/source/engine/transitions/ellipsewipe.cxx
+++ b/slideshow/source/engine/transitions/ellipsewipe.cxx
@@ -36,7 +36,7 @@ namespace internal {
 {
 // oval:
 ::basegfx::B2DPolygon poly (
-::basegfx::utils::createPolygonFromEllipse( rCenter, fRadius*2, 
fRadius ) ); //Horizontal Ellipse is rotated by 90 degress
+::basegfx::utils::createPolygonFromEllipse( rCenter, fRadius*2, 
fRadius ) ); //Horizontal Ellipse is rotated by 90 degrees
 return ::basegfx::B2DPolyPolygon( poly );
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2019-12-17 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/effectrewinder.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 532c4af5efce928245d22eb74e159bca8c7c3839
Author: Andrea Gelmini 
AuthorDate: Tue Dec 17 17:21:09 2019 +0100
Commit: Julien Nabet 
CommitDate: Tue Dec 17 18:15:33 2019 +0100

Fix typo

Change-Id: I64a13c892a5ae8b2c7e9614212be60d9a4300632
Reviewed-on: https://gerrit.libreoffice.org/85317
Reviewed-by: Julien Nabet 
Tested-by: Julien Nabet 

diff --git a/slideshow/source/engine/effectrewinder.hxx 
b/slideshow/source/engine/effectrewinder.hxx
index f71f8425e840..f23bd01995d7 100644
--- a/slideshow/source/engine/effectrewinder.hxx
+++ b/slideshow/source/engine/effectrewinder.hxx
@@ -97,7 +97,7 @@ public:
 */
 void skipAllMainSequenceEffects();
 
-//FIXME: That is an opengl issue(it doesn't allow to animate somea 
animations), remove that function when opengl fixed.
+//FIXME: That is an opengl issue(it doesn't allow to animate some 
animations), remove that function when opengl fixed.
 static bool hasBlockedAnimation( const 
css::uno::Reference& xNode);
 
 private:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2019-12-16 Thread Gülşah Köse (via logerrit)
 slideshow/source/engine/effectrewinder.cxx |   58 -
 slideshow/source/engine/effectrewinder.hxx |3 +
 2 files changed, 59 insertions(+), 2 deletions(-)

New commits:
commit 8eb2d2972583b909a249f5b0f22a9b1fbf533d24
Author: Gülşah Köse 
AuthorDate: Mon Dec 16 11:31:49 2019 +0300
Commit: Gülşah Köse 
CommitDate: Tue Dec 17 07:13:09 2019 +0100

tdf#125949 Allow the slide to continue with freezing animation.

Entrance (Zoom in, Spiral in, Sviwel, Stretchy) animations with
shapes freezes the presentation when OpenGL is enabled. As a
workaround, avoid playing these animations.

Change-Id: I054d87c4d3774339a9fe6fba42dea20bccd31bb1
Reviewed-on: https://gerrit.libreoffice.org/85201
Tested-by: Jenkins
Reviewed-by: Gülşah Köse 

diff --git a/slideshow/source/engine/effectrewinder.cxx 
b/slideshow/source/engine/effectrewinder.cxx
index d920bdd4ad06..5db91ff9a621 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -29,7 +29,7 @@
 #include 
 #include 
 #include 
-
+#include 
 using ::com::sun::star::uno::Reference;
 using namespace ::com::sun::star;
 
@@ -291,9 +291,64 @@ bool EffectRewinder::resetEffectCount()
 return false;
 }
 
+bool EffectRewinder::hasBlockedAnimation( const 
css::uno::Reference& xNode)
+{
+bool isShapeTarget = false;;
+OUString preset_id;
+OUString preset_sub_type;
+OUString preset_property;
+
+if (xNode->getUserData().getLength())
+{
+for(int i = 0; i < xNode->getUserData().getLength(); i++)
+{
+if(xNode->getUserData()[i].Name == "preset-id")
+xNode->getUserData()[i].Value >>= preset_id;
+if(xNode->getUserData()[i].Name == "preset-sub-type")
+xNode->getUserData()[i].Value >>= preset_sub_type;
+if(xNode->getUserData()[i].Name == "preset-property")
+xNode->getUserData()[i].Value >>= preset_property;
+}
+}
+
+uno::Reference xEnumerationAccess (xNode, 
uno::UNO_QUERY);
+if (xEnumerationAccess.is())
+{
+uno::Reference xEnumeration (
+xEnumerationAccess->createEnumeration());
+if (xEnumeration.is())
+while (xEnumeration->hasMoreElements())
+{
+uno::Reference xNext 
(xEnumeration->nextElement(), uno::UNO_QUERY);
+uno::Reference xAnimate( xNext, 
uno::UNO_QUERY );
+
+if(xAnimate.is())
+{
+uno::Reference< drawing::XShape > xShape( 
xAnimate->getTarget(), uno::UNO_QUERY );
+
+if (xShape.is() || xAnimate->getTarget().getValueType() == 
cppu::UnoType::get())
+isShapeTarget=true;
+}
+}
+}
+
+if(isShapeTarget &&
+   ((preset_id == "ooo-entrance-zoom" && preset_sub_type == "in") || // 
Entrance Zoom In
+(preset_id == "ooo-entrance-swivel" ) || // 
Entrance Swivel
+(preset_id == "ooo-entrance-spiral-in")   || // 
Entrance Spiral-In
+(preset_id == "ooo-entrance-stretchy"))) // 
Entrance Stretchy
+return true;
+
+return false;
+}
 
 bool EffectRewinder::notifyAnimationStart (const AnimationNodeSharedPtr& 
rpNode)
 {
+Reference xNode (rpNode->getXAnimationNode());
+
+if(xNode.is() && hasBlockedAnimation(xNode) )
+skipSingleMainSequenceEffects();
+
 // This notification is only relevant for us when the rpNode belongs to
 // the main sequence.
 BaseNodeSharedPtr pBaseNode 
(::std::dynamic_pointer_cast(rpNode));
@@ -308,7 +363,6 @@ bool EffectRewinder::notifyAnimationStart (const 
AnimationNodeSharedPtr& rpNode)
 // triggered.
 bool bIsUserTriggered (false);
 
-Reference xNode (rpNode->getXAnimationNode());
 if (xNode.is())
 {
 animations::Event aEvent;
diff --git a/slideshow/source/engine/effectrewinder.hxx 
b/slideshow/source/engine/effectrewinder.hxx
index 0a88409498ec..f71f8425e840 100644
--- a/slideshow/source/engine/effectrewinder.hxx
+++ b/slideshow/source/engine/effectrewinder.hxx
@@ -97,6 +97,9 @@ public:
 */
 void skipAllMainSequenceEffects();
 
+//FIXME: That is an opengl issue(it doesn't allow to animate somea 
animations), remove that function when opengl fixed.
+static bool hasBlockedAnimation( const 
css::uno::Reference& xNode);
+
 private:
 EventMultiplexer& mrEventMultiplexer;
 EventQueue& mrEventQueue;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2019-12-04 Thread Andrea Gelmini (via logerrit)
 slideshow/source/engine/activities/interpolation.hxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 7d97bdba4b5bd8ceda7f18c08ff636ffdb276660
Author: Andrea Gelmini 
AuthorDate: Wed Dec 4 20:22:34 2019 +0100
Commit: Julien Nabet 
CommitDate: Thu Dec 5 07:53:35 2019 +0100

Fix typo

Change-Id: I7d34e0a02c8ee102746a0da853cc665287deef54
Reviewed-on: https://gerrit.libreoffice.org/84490
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/slideshow/source/engine/activities/interpolation.hxx 
b/slideshow/source/engine/activities/interpolation.hxx
index ab0a0e5a63d1..0744b270d831 100644
--- a/slideshow/source/engine/activities/interpolation.hxx
+++ b/slideshow/source/engine/activities/interpolation.hxx
@@ -146,7 +146,7 @@ namespace slideshow
 {
 // until one half of the total frames are over, take from value.
 // after that, take to value.
-// For nFrames not divisable by 2, we prefer to over from, which
+// For nFrames not divisible by 2, we prefer to over from, which
 // also neatly yields to for 1 frame activities
 return nFrame < nTotalFrames/2 ? rFrom : rTo;
 }
@@ -160,7 +160,7 @@ namespace slideshow
 {
 // until one half of the total frames are over, take from value.
 // after that, take to value.
-// For nFrames not divisable by 2, we prefer to over from, which
+// For nFrames not divisible by 2, we prefer to over from, which
 // also neatly yields to for 1 frame activities
 return nFrame < nTotalFrames/2 ? rFrom : rTo;
 }
@@ -174,7 +174,7 @@ namespace slideshow
 {
 // until one half of the total frames are over, take from value.
 // after that, take to value.
-// For nFrames not divisable by 2, we prefer to over from, which
+// For nFrames not divisible by 2, we prefer to over from, which
 // also neatly yields to for 1 frame activities
 return nFrame < nTotalFrames/2 ? bFrom : bTo;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-10-14 Thread Caolán McNamara (via logerrit)
 slideshow/source/engine/opengl/TransitionerImpl.cxx |   22 
 1 file changed, 14 insertions(+), 8 deletions(-)

New commits:
commit 8715a067a3547cf91a3ed73fd893a621d5ee1a1c
Author: Caolán McNamara 
AuthorDate: Mon Oct 14 10:12:38 2019 +0100
Commit: Caolán McNamara 
CommitDate: Mon Oct 14 12:39:42 2019 +0200

Related: tdf#124729 check for GL_EXT_texture_filter_anisotropic support

Change-Id: I7cc7225c02e1c6688df22b237af59425fb64b79c
Reviewed-on: https://gerrit.libreoffice.org/80760
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/slideshow/source/engine/opengl/TransitionerImpl.cxx 
b/slideshow/source/engine/opengl/TransitionerImpl.cxx
index 2bec0badb196..3219e32f9abf 100644
--- a/slideshow/source/engine/opengl/TransitionerImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionerImpl.cxx
@@ -836,10 +836,13 @@ void OGLTransitionerImpl::impl_createTexture(
   GL_UNSIGNED_BYTE,
   [0]);
 
-//anistropic filtering (to make texturing not suck when looking at 
polygons from oblique angles)
-GLfloat largest_supported_anisotropy;
-glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, 
_supported_anisotropy);
-glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 
largest_supported_anisotropy);
+if (epoxy_has_gl_extension("GL_EXT_texture_filter_anisotropic"))
+{
+//anistropic filtering (to make texturing not suck when looking at 
polygons from oblique angles)
+GLfloat largest_supported_anisotropy;
+glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, 
_supported_anisotropy);
+glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 
largest_supported_anisotropy);
+}
 } else {
 if( mpTransition && !mbBrokenTexturesATI && !useMipmap) {
 glTexImage2D( GL_TEXTURE_2D, 0, pFormat->nInternalFormat, 
maSlideSize.Width, maSlideSize.Height, 0, pFormat->eFormat, pFormat->eType, 
[0] );
@@ -848,10 +851,13 @@ void OGLTransitionerImpl::impl_createTexture(
 } else {
 buildMipmaps( pFormat->nInternalFormat, maSlideSize.Width, 
maSlideSize.Height, pFormat->eFormat, pFormat->eType, [0] );
 
-//anistropic filtering (to make texturing not suck when looking at 
polygons from oblique angles)
-GLfloat largest_supported_anisotropy;
-glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, 
_supported_anisotropy );
-glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 
largest_supported_anisotropy );
+if (epoxy_has_gl_extension("GL_EXT_texture_filter_anisotropic"))
+{
+//anistropic filtering (to make texturing not suck when 
looking at polygons from oblique angles)
+GLfloat largest_supported_anisotropy;
+glGetFloatv( GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, 
_supported_anisotropy );
+glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 
largest_supported_anisotropy );
+}
 }
 }
 CHECK_GL_ERROR();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-09-02 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/eventmultiplexer.cxx |   77 ---
 1 file changed, 69 insertions(+), 8 deletions(-)

New commits:
commit e161826d5766cfb0816f666f6f65a7fb25d78f33
Author: Stephan Bergmann 
AuthorDate: Mon Sep 2 16:45:54 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Mon Sep 2 19:20:01 2019 +0200

tdf#127258: Fix ViewEventHandlerWeakPtrWrapper

...which had been introduced with 042e30a3dc057aef4a02d95960e4dd4fb8d083ae
"Avoid adding a function template declaration to namespace std" but without
taking the ListenerOperations> partial
specialization (in slideshow/source/inc/listenercontainer.hxx) into 
account, so
that commit had made some confused changes to the
mpImpl->maViewHandlers.applyAll calls (that can now be reverted).

Change-Id: Iaaafc560dfd34940f1708027808ab4f9b8db7764
Reviewed-on: https://gerrit.libreoffice.org/78405
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/eventmultiplexer.cxx 
b/slideshow/source/engine/eventmultiplexer.cxx
index 1ea583da8d9c..ae915bf3a2ca 100644
--- a/slideshow/source/engine/eventmultiplexer.cxx
+++ b/slideshow/source/engine/eventmultiplexer.cxx
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -64,6 +65,67 @@ namespace
 };
 }
 
+// Needed by ImplViewHandlers; see the 
ListenerOperations> partial
+// specialization in slideshow/source/inc/listenercontainer.hxx:
+template<>
+struct slideshow::internal::ListenerOperations
+{
+template< typename ContainerT,
+  typename FuncT >
+static bool notifySingleListener( ContainerT& rContainer,
+  FuncT   func )
+{
+for( const auto& rCurr : rContainer )
+{
+std::shared_ptr pListener( rCurr.ptr.lock() );
+
+if( pListener && func(pListener) )
+return true;
+}
+
+return false;
+}
+
+template< typename ContainerT,
+  typename FuncT >
+static bool notifyAllListeners( ContainerT& rContainer,
+FuncT   func )
+{
+bool bRet(false);
+for( const auto& rCurr : rContainer )
+{
+std::shared_ptr pListener( rCurr.ptr.lock() );
+
+if( pListener.get() &&
+FunctionApply const&)>::type,
+   std::shared_ptr 
>::apply(func,pListener) )
+{
+bRet = true;
+}
+}
+
+return bRet;
+}
+template< typename ContainerT >
+static void pruneListeners( ContainerT& rContainer,
+size_t  nSizeThreshold )
+{
+if( rContainer.size() <= nSizeThreshold )
+return;
+
+ContainerT aAliveListeners;
+aAliveListeners.reserve(rContainer.size());
+
+for( const auto& rCurr : rContainer )
+{
+if( !rCurr.ptr.expired() )
+aAliveListeners.push_back( rCurr );
+}
+
+std::swap( rContainer, aAliveListeners );
+}
+};
+
 namespace slideshow {
 namespace internal {
 
@@ -1105,8 +1167,8 @@ void EventMultiplexer::notifyViewAdded( const 
UnoViewSharedPtr& rView )
 mpImpl->mxListener.get() );
 
 mpImpl->maViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
-{ return pHandler.ptr.lock()->viewAdded( rView ); } );
+[]( const ViewEventHandlerWeakPtr& pHandler )
+{ return pHandler.lock()->viewAdded( rView ); } );
 }
 
 void EventMultiplexer::notifyViewRemoved( const UnoViewSharedPtr& rView )
@@ -1127,15 +1189,15 @@ void EventMultiplexer::notifyViewRemoved( const 
UnoViewSharedPtr& rView )
 mpImpl->mxListener.get() );
 
 mpImpl->maViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
-{ return pHandler.ptr.lock()->viewRemoved( rView ); } );
+[]( const ViewEventHandlerWeakPtr& pHandler )
+{ return pHandler.lock()->viewRemoved( rView ); } );
 }
 
 void EventMultiplexer::notifyViewChanged( const UnoViewSharedPtr& rView )
 {
 mpImpl->maViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
-{ return pHandler.ptr.lock()->viewChanged( rView ); } );
+[]( const ViewEventHandlerWeakPtr& pHandler )
+{ return pHandler.lock()->viewChanged( rView ); } );
 }
 
 void EventMultiplexer::notifyViewChanged( const 
uno::Reference& xView )
@@ -1151,8 +1213,7 @@ void EventMultiplexer::notifyViewChanged( const 
uno::ReferencemaViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
-{ return pHandler.ptr.lock()->viewsChanged(); } );
+std::mem_fn( ::viewsChanged ));
 }
 
 void EventMultiplexer::notifyViewClobbered(
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: slideshow/source

2019-08-28 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/slide/layermanager.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit cae9240a76cdb0eeed92421930d3b4cbef0ac201
Author: Stephan Bergmann 
AuthorDate: Wed Aug 28 08:42:39 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 28 09:35:06 2019 +0200

Avoid adding a function declaration to namespace std

Change-Id: Id6839850f249f2065de05a0fd929e68ca1003ec6
Reviewed-on: https://gerrit.libreoffice.org/78213
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/slide/layermanager.cxx 
b/slideshow/source/engine/slide/layermanager.cxx
index 595dd6abe757..a85317d20512 100644
--- a/slideshow/source/engine/slide/layermanager.cxx
+++ b/slideshow/source/engine/slide/layermanager.cxx
@@ -33,10 +33,10 @@
 
 using namespace ::com::sun::star;
 
-namespace std
+namespace
 {
 // add operator!= for weak_ptr
-static bool operator!=( slideshow::internal::LayerWeakPtr const& rLHS,
+bool notEqual( slideshow::internal::LayerWeakPtr const& rLHS,
 slideshow::internal::LayerWeakPtr const& rRHS )
 {
 return rLHS.lock().get() != rRHS.lock().get();
@@ -758,7 +758,7 @@ namespace slideshow
 bIsBackgroundLayer = false;
 
 if( aWeakLayers.size() <= nCurrLayerIndex ||
-aWeakLayers.at(nCurrLayerIndex) != 
aCurrShapeEntry->second )
+notEqual(aWeakLayers.at(nCurrLayerIndex), 
aCurrShapeEntry->second) )
 {
 // no more layers left, or shape was not
 // member of this layer - create a new one
@@ -775,7 +775,7 @@ namespace slideshow
 // above invalidates iterators
 LayerSharedPtr& rCurrLayer( maLayers.at(nCurrLayerIndex) );
 LayerWeakPtr& rCurrWeakLayer( aWeakLayers.at(nCurrLayerIndex) 
);
-if( rCurrWeakLayer != aCurrShapeEntry->second )
+if( notEqual(rCurrWeakLayer, aCurrShapeEntry->second) )
 {
 // mismatch: shape is not contained in current
 // layer - move shape to that layer, then.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-08-28 Thread Stephan Bergmann (via logerrit)
 slideshow/source/engine/eventmultiplexer.cxx |   37 +++
 1 file changed, 21 insertions(+), 16 deletions(-)

New commits:
commit 042e30a3dc057aef4a02d95960e4dd4fb8d083ae
Author: Stephan Bergmann 
AuthorDate: Wed Aug 28 08:43:44 2019 +0200
Commit: Stephan Bergmann 
CommitDate: Wed Aug 28 09:34:38 2019 +0200

Avoid adding a function template declaration to namespace std

Change-Id: I1368276c859d3c81f4ebfbeca47bb99e781f2fed
Reviewed-on: https://gerrit.libreoffice.org/78214
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/eventmultiplexer.cxx 
b/slideshow/source/engine/eventmultiplexer.cxx
index 07f7ddaa8af7..1ea583da8d9c 100644
--- a/slideshow/source/engine/eventmultiplexer.cxx
+++ b/slideshow/source/engine/eventmultiplexer.cxx
@@ -45,19 +45,23 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace ::com::sun::star;
 
-
-namespace std
+namespace
 {
 // add operator== for weak_ptr, so we can use std::find over lists of them
-template static bool operator==( weak_ptr const& rLHS,
-  weak_ptr const& rRHS )
-{
-return rLHS.lock().get() == rRHS.lock().get();
-}
+struct ViewEventHandlerWeakPtrWrapper final {
+slideshow::internal::ViewEventHandlerWeakPtr ptr;
+
+
ViewEventHandlerWeakPtrWrapper(slideshow::internal::ViewEventHandlerWeakPtr 
thePtr):
+ptr(std::move(thePtr)) {}
+
+bool operator ==(ViewEventHandlerWeakPtrWrapper const & other) const
+{ return ptr.lock().get() == other.ptr.lock().get(); }
+};
 }
 
 namespace slideshow {
@@ -209,8 +213,8 @@ struct EventMultiplexerImpl
 PauseEventHandlerSharedPtr,
 std::vector > ImplPauseHandlers;
 typedef ThreadUnsafeListenerContainer<
-ViewEventHandlerWeakPtr,
-std::vector >ImplViewHandlers;
+ViewEventHandlerWeakPtrWrapper,
+std::vector > ImplViewHandlers;
 typedef ThreadUnsafeListenerContainer<
 ViewRepaintHandlerSharedPtr,
 std::vector >ImplRepaintHandlers;
@@ -1101,8 +1105,8 @@ void EventMultiplexer::notifyViewAdded( const 
UnoViewSharedPtr& rView )
 mpImpl->mxListener.get() );
 
 mpImpl->maViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtr& pHandler )
-{ return pHandler.lock()->viewAdded( rView ); } );
+[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
+{ return pHandler.ptr.lock()->viewAdded( rView ); } );
 }
 
 void EventMultiplexer::notifyViewRemoved( const UnoViewSharedPtr& rView )
@@ -1123,15 +1127,15 @@ void EventMultiplexer::notifyViewRemoved( const 
UnoViewSharedPtr& rView )
 mpImpl->mxListener.get() );
 
 mpImpl->maViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtr& pHandler )
-{ return pHandler.lock()->viewRemoved( rView ); } );
+[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
+{ return pHandler.ptr.lock()->viewRemoved( rView ); } );
 }
 
 void EventMultiplexer::notifyViewChanged( const UnoViewSharedPtr& rView )
 {
 mpImpl->maViewHandlers.applyAll(
-[]( const ViewEventHandlerWeakPtr& pHandler )
-{ return pHandler.lock()->viewChanged( rView ); } );
+[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
+{ return pHandler.ptr.lock()->viewChanged( rView ); } );
 }
 
 void EventMultiplexer::notifyViewChanged( const 
uno::Reference& xView )
@@ -1147,7 +1151,8 @@ void EventMultiplexer::notifyViewChanged( const 
uno::ReferencemaViewHandlers.applyAll(
-std::mem_fn( ::viewsChanged ));
+[]( const ViewEventHandlerWeakPtrWrapper& pHandler )
+{ return pHandler.ptr.lock()->viewsChanged(); } );
 }
 
 void EventMultiplexer::notifyViewClobbered(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-04-17 Thread Miklos Vajna (via logerrit)
 slideshow/source/engine/shapes/viewmediashape.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit d7f4f5650dd2c7fe1ccec50efd806e695b8bc18a
Author: Miklos Vajna 
AuthorDate: Wed Apr 17 11:38:47 2019 +0200
Commit: Miklos Vajna 
CommitDate: Wed Apr 17 15:43:48 2019 +0200

tdf#124756 slideshow: avoid mbPaintDisabled for media windows

Commit 3e0092031b73bad107e3122d5d4be2f5bd487744 (tdf#112318 sd opengl:
fix lack of initial animation, 2019-04-05) enabled processing of idle
events between two updates of the slideshow to help OpenGL, which
uncovered a problem with media shapes.

On one hand,
slideshow::internal::ViewMediaShape::implInitializePlayerWindow() calls
EnablePaint(false) on the media window. OTOH,
vcl::Window::ImplCallPaint() handles mbPaintDisabled by invalidating the
relevant area of the window, which causes a paint<->invalidate loop.

Fix the problem by nominally still enabling paints on the media window:
nothing will change in practice (since the actual media overlay will be
on top of it), but this way the loop goes away.

mbPaintDisabled is handled like this since the initial import, the media
window flag was added much later, so it makes more sense to adapt the
later.

Change-Id: Ib89b68d93aa9d09dbcad33eb6e75a8a25ef1b752
Reviewed-on: https://gerrit.libreoffice.org/70869
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx 
b/slideshow/source/engine/shapes/viewmediashape.cxx
index 6aecf9502d1c..bd50a71b70cb 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -446,7 +446,6 @@ namespace slideshow
 mpMediaWindow->SetBackground( COL_BLACK );
 mpMediaWindow->SetParentClipMode( 
ParentClipMode::NoClip );
 mpMediaWindow->EnableEraseBackground( false );
-mpMediaWindow->EnablePaint( false );
 mpMediaWindow->SetForwardKey( true );
 mpMediaWindow->SetMouseTransparent( true );
 mpMediaWindow->Show();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-03-31 Thread Mark Hung (via logerrit)
 slideshow/source/engine/animationnodes/animationbasenode.cxx |   17 ++-
 slideshow/source/engine/animationnodes/animationbasenode.hxx |2 +
 slideshow/source/engine/animationnodes/basecontainernode.cxx |8 +
 slideshow/source/inc/animationnode.hxx   |7 
 slideshow/source/inc/basenode.hxx|7 ++--
 5 files changed, 37 insertions(+), 4 deletions(-)

New commits:
commit bf2f0c913774c90e4c9a65119d0219187bb4498c
Author: Mark Hung 
AuthorDate: Thu Mar 21 22:56:41 2019 +0800
Commit: Mark Hung 
CommitDate: Sun Mar 31 11:38:16 2019 +0200

tdf#73092 remove remaining shape of the repeating animation.

It is neccessary to set a drawshape to invisible (i.e. remove the
effect ) before the drawshape rewind, otherwise it remains at the
original place. The timenode container will ask its child to remove
the effect after all the child finished, before it start to repeat or
it deactivate.

Change-Id: Iaef1a8269b61afa0c37b03655e2ea169f1d3c453
Reviewed-on: https://gerrit.libreoffice.org/69543
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx 
b/slideshow/source/engine/animationnodes/animationbasenode.cxx
index 107ac68650a6..ed4d157c526f 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.cxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include "nodetools.hxx"
@@ -52,6 +53,7 @@ AnimationBaseNode::AnimationBaseNode(
   mpShape(),
   mpShapeSubset(),
   mpSubsetManager(rContext.maContext.mpSubsettableShapeManager),
+  mbPreservedVisibility(true),
   mbIsIndependentSubset( rContext.mbIsIndependentSubset )
 {
 // extract native node targets
@@ -234,8 +236,11 @@ bool AnimationBaseNode::resolve_st()
 
 void AnimationBaseNode::activate_st()
 {
+AttributableShapeSharedPtr const pShape(getShape());
+mbPreservedVisibility = pShape->isVisible();
+
 // create new attribute layer
-maAttributeLayerHolder.createAttributeLayer( getShape() );
+maAttributeLayerHolder.createAttributeLayer(pShape);
 
 ENSURE_OR_THROW( maAttributeLayerHolder.get(),
   "Could not generate shape attribute layer" );
@@ -354,6 +359,16 @@ void AnimationBaseNode::deactivate_st( NodeState 
eDestState )
 }
 }
 
+void AnimationBaseNode::removeEffect()
+{
+if (!isDependentSubsettedShape()) {
+AttributableShapeSharedPtr const pShape(getShape());
+pShape->setVisibility(!mbPreservedVisibility);
+getContext().mpSubsettableShapeManager->notifyShapeUpdate( pShape );
+pShape->setVisibility(mbPreservedVisibility);
+}
+}
+
 bool AnimationBaseNode::hasPendingAnimation() const
 {
 // TODO(F1): This might not always be true. Are there 'inactive'
diff --git a/slideshow/source/engine/animationnodes/animationbasenode.hxx 
b/slideshow/source/engine/animationnodes/animationbasenode.hxx
index 55ec060ac4ad..7751642517aa 100644
--- a/slideshow/source/engine/animationnodes/animationbasenode.hxx
+++ b/slideshow/source/engine/animationnodes/animationbasenode.hxx
@@ -46,6 +46,7 @@ public:
 #if defined(DBG_UTIL)
 virtual void showState() const override;
 #endif
+virtual void removeEffect() override;
 
 protected:
 virtual void dispose() override;
@@ -87,6 +88,7 @@ private:
 /// When valid, this is a subsetted target shape
 ShapeSubsetSharedPtrmpShapeSubset;
 SubsettableShapeManagerSharedPtr const  mpSubsetManager;
+boolmbPreservedVisibility;
 boolmbIsIndependentSubset;
 };
 
diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx 
b/slideshow/source/engine/animationnodes/basecontainernode.cxx
index e8e5dfbd7f88..02668ae7fd28 100644
--- a/slideshow/source/engine/animationnodes/basecontainernode.cxx
+++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx
@@ -20,6 +20,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include "nodetools.hxx"
@@ -161,6 +162,11 @@ bool BaseContainerNode::notifyDeactivatedChild(
 }
 if(mnLeftIterations >= 1.0 || mbRestart)
 {
+// SMIL spec said that "Accumulate" controls whether or not the 
animation
+// is cumulative, but XTimeContainer do not have this attribute, 
so always
+// remove the effect before next repeat.
+forEachChildNode(std::mem_fn(::removeEffect), -1);
+
 if (mnLeftIterations >= 1.0)
 bFinished = false;
 
@@ -172,6 +178,8 @@ bool BaseContainerNode::notifyDeactivatedChild(
 }
 else if (isDurationIndefinite())
 {
+if (getFillMode() == animations::AnimationFill::REMOVE)
+

[Libreoffice-commits] core.git: slideshow/source

2019-03-01 Thread Libreoffice Gerrit user
 slideshow/source/engine/animationnodes/animationaudionode.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8cc88f9473097b680f12a343d3a491926cd33847
Author: Andrea Gelmini 
AuthorDate: Fri Mar 1 08:55:03 2019 +0100
Commit: Mark Hung 
CommitDate: Fri Mar 1 10:21:21 2019 +0100

Fix typo

Change-Id: I0cd3e9e9d0f6a887bd27b6b6b2c5bc972570186a
Reviewed-on: https://gerrit.libreoffice.org/68534
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx 
b/slideshow/source/engine/animationnodes/animationaudionode.cxx
index 9e3f6bc25271..b5e6f53a6210 100644
--- a/slideshow/source/engine/animationnodes/animationaudionode.cxx
+++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx
@@ -83,7 +83,7 @@ void AnimationAudioNode::activate_st()
 scheduleDeactivationEvent(
 makeDelay( [this] () { this->checkPlayingStatus(); },
mpPlayer->getDuration(),
-   "AnimationAudioNode::check if sitll playing with 
delay") );
+   "AnimationAudioNode::check if still playing with 
delay") );
 }
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-02-28 Thread Libreoffice Gerrit user
 slideshow/source/engine/animationnodes/animationaudionode.cxx |   21 --
 slideshow/source/engine/animationnodes/animationaudionode.hxx |1 
 slideshow/source/engine/soundplayer.cxx   |5 ++
 slideshow/source/inc/soundplayer.hxx  |1 
 4 files changed, 25 insertions(+), 3 deletions(-)

New commits:
commit 71755f36394c1ffbf01af0180a05a258916dd5c9
Author: Mark Hung 
AuthorDate: Wed Feb 27 23:20:31 2019 +0800
Commit: Mark Hung 
CommitDate: Fri Mar 1 00:24:05 2019 +0100

tdf#123743 deactive after the player is stopped.

The queried media duration for gstreamer isn't ready at the beginning.
Instead of deactivate the audio node immediately after querying the
duration, schedule to update the media duration and use the updated
duration to schedule deactivation.

Change-Id: I8bfa69377fbc18b21baf48bc293d2d0853e8805a
Reviewed-on: https://gerrit.libreoffice.org/68451
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/slideshow/source/engine/animationnodes/animationaudionode.cxx 
b/slideshow/source/engine/animationnodes/animationaudionode.cxx
index b024de24de53..9e3f6bc25271 100644
--- a/slideshow/source/engine/animationnodes/animationaudionode.cxx
+++ b/slideshow/source/engine/animationnodes/animationaudionode.cxx
@@ -76,12 +76,14 @@ void AnimationAudioNode::activate_st()
 }
 else
 {
-// no node duration. Take inherent media time, then
+// no node duration. Take inherent media time. We have to recheck
+// if the player is playing in case the duration isn't accurate
+// or the progress fall behind.
 auto self(getSelf());
 scheduleDeactivationEvent(
-makeDelay( [self] () { self->deactivate(); },
+makeDelay( [this] () { this->checkPlayingStatus(); },
mpPlayer->getDuration(),
-   "AnimationAudioNode::deactivate with delay") );
+   "AnimationAudioNode::check if sitll playing with 
delay") );
 }
 }
 else
@@ -182,6 +184,19 @@ bool AnimationAudioNode::handleAnimationEvent(
 return true;
 }
 
+void AnimationAudioNode::checkPlayingStatus()
+{
+auto self(getSelf());
+double nDuration = mpPlayer->getDuration();
+if (!mpPlayer->isPlaying() || nDuration < 0.0)
+nDuration = 0.0;
+
+scheduleDeactivationEvent(
+makeDelay( [self] () { self->deactivate(); },
+nDuration,
+"AnimationAudioNode::deactivate with delay") );
+}
+
 } // namespace internal
 } // namespace presentation
 
diff --git a/slideshow/source/engine/animationnodes/animationaudionode.hxx 
b/slideshow/source/engine/animationnodes/animationaudionode.hxx
index 6efd40fdbd20..30de41cfb44e 100644
--- a/slideshow/source/engine/animationnodes/animationaudionode.hxx
+++ b/slideshow/source/engine/animationnodes/animationaudionode.hxx
@@ -59,6 +59,7 @@ private:
 
 void createPlayer() const;
 void resetPlayer() const;
+void checkPlayingStatus();
 };
 
 } // namespace internal
diff --git a/slideshow/source/engine/soundplayer.cxx 
b/slideshow/source/engine/soundplayer.cxx
index 65b578304d62..18a1948089f9 100644
--- a/slideshow/source/engine/soundplayer.cxx
+++ b/slideshow/source/engine/soundplayer.cxx
@@ -170,6 +170,11 @@ namespace slideshow
 if( mxPlayer.is() )
 mxPlayer->setPlaybackLoop( bLoop );
 }
+
+bool SoundPlayer::isPlaying() const
+{
+return mxPlayer->isPlaying();
+}
 }
 }
 
diff --git a/slideshow/source/inc/soundplayer.hxx 
b/slideshow/source/inc/soundplayer.hxx
index ea496d88b8cc..92ac94b851fb 100644
--- a/slideshow/source/inc/soundplayer.hxx
+++ b/slideshow/source/inc/soundplayer.hxx
@@ -83,6 +83,7 @@ namespace slideshow
 
 bool startPlayback();
 bool stopPlayback();
+bool isPlaying() const;
 
 void setPlaybackLoop( bool bLoop );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-02-24 Thread Libreoffice Gerrit user
 slideshow/source/engine/animationnodes/animationcommandnode.cxx |   22 
--
 slideshow/source/engine/animationnodes/animationcommandnode.hxx |2 
 2 files changed, 24 deletions(-)

New commits:
commit 7927bfcf46aaaee8a5ab4eeb10549436416cfc3a
Author: Mark Hung 
AuthorDate: Sat Feb 23 22:01:46 2019 +0800
Commit: Caolán McNamara 
CommitDate: Sun Feb 24 22:12:46 2019 +0100

slideshow: do not toggle pause when deactivate.

The command animation node schdules deactivation immediately after it is
activated, it turns what it might pause shortly then toggle the media to
play again, and it will not possible for user to insert many pause
commands to achieve toggling between play-pause-play-pause.

This commit will revert
1aa10fcb668f67f4313b7170a4090027e52164c5 tdf#121830 and the follwing
f820f6eb6036197bbb53e2d5e4bf4d5341ad280d tdf#121942

PowerPoint does not play the video file when the slide start. Instead it
insert a pause command in a interaction sequence that is triggered by
clicking the video file. I'm working on tdf#123557 to import start and
end condtions of a time node and tdf#123653 to allow triggering events
by clicking on the video. But there are still some more strange things
in the attachment of tdf#121830 that I have to investigate its start
condition and its media file format to understand whether it really
should play automatically ( or just a bogus file) and why it didn't
play.

Change-Id: I823afb4d1048471cebe43deb597f17a6e2611f06
Reviewed-on: https://gerrit.libreoffice.org/68245
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx 
b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index 1b764b1c5a4a..e765f2a5a531 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -38,7 +38,6 @@ AnimationCommandNode::AnimationCommandNode( 
uno::Reference const& pParent,
  NodeContext const& rContext ) :
 BaseNode( xNode, pParent, rContext ),
-mbToggled(false),
 mpShape(),
 mxCommandNode( xNode, css::uno::UNO_QUERY_THROW )
 {
@@ -87,7 +86,6 @@ void AnimationCommandNode::activate_st()
 mpShape->pause();
 else
 mpShape->play();
-mbToggled = true;
 }
 break;
 }
@@ -111,26 +109,6 @@ void AnimationCommandNode::activate_st()
"AnimationCommandNode::deactivate" ) );
 }
 
-void AnimationCommandNode::deactivate_st( NodeState /*eDestState*/ )
-{
-switch( mxCommandNode->getCommand() ) {
-// the command toggles the pause status on a media object
-case EffectCommands::TOGGLEPAUSE:
-{
-if (mpShape && mbToggled)
-{
-if( mpShape->isPlaying() )
-mpShape->pause();
-else
-mpShape->play();
-mbToggled = false;
-}
-break;
-}
-
-}
-}
-
 bool AnimationCommandNode::hasPendingAnimation() const
 {
 return mxCommandNode->getCommand() == EffectCommands::STOPAUDIO || mpShape;
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx 
b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
index 1aacd1b6a071..675da7c3b0e8 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
@@ -46,11 +46,9 @@ protected:
 
 private:
 virtual void activate_st() override;
-virtual void deactivate_st( NodeState eDestState ) override;
 virtual bool hasPendingAnimation() const override;
 
 private:
-bool mbToggled;
 IExternalMediaShapeBaseSharedPtr mpShape;
 css::uno::Reference mxCommandNode;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-02-22 Thread Libreoffice Gerrit user
 slideshow/source/engine/slideshowimpl.cxx |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

New commits:
commit bacd06e9270ab64fa2c8243181c19c977d2bb649
Author: Noel Grandin 
AuthorDate: Fri Feb 22 11:11:35 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Feb 22 18:03:06 2019 +0100

loplugin:unusedfields in slideshow

Change-Id: I98d599c40e36906022fc5d0b1d992a42c3d784ce
Reviewed-on: https://gerrit.libreoffice.org/68201
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/slideshowimpl.cxx 
b/slideshow/source/engine/slideshowimpl.cxx
index 9865d7fa5776..3b18bd75 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -430,8 +430,6 @@ private:
 
 //changed for the eraser project
 boost::optional   maEraseAllInk;
-boost::optional   maSwitchPenMode;
-boost::optional   maSwitchEraserMode;
 boost::optional  maEraseInk;
 //end changed
 
@@ -1582,9 +1580,8 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 "setProperty(): User paint overrides invisible mouse" 
);
 
 if(bSwitchPenMode){
-// Switch to Pen Mode
-maSwitchPenMode = bSwitchPenMode;
-maEventMultiplexer.notifySwitchPenMode();
+// Switch to Pen Mode
+maEventMultiplexer.notifySwitchPenMode();
 }
 }
 return true;
@@ -1598,9 +1595,8 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue 
const& rProperty )
 OSL_ENSURE( mbMouseVisible,
 "setProperty(): User paint overrides invisible mouse" 
);
 if(bSwitchEraserMode){
-// switch to Eraser mode
-maSwitchEraserMode = bSwitchEraserMode;
-maEventMultiplexer.notifySwitchEraserMode();
+// switch to Eraser mode
+maEventMultiplexer.notifySwitchEraserMode();
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: slideshow/source

2019-02-19 Thread Libreoffice Gerrit user
 slideshow/source/engine/animationnodes/basecontainernode.cxx |   16 ---
 slideshow/source/engine/animationnodes/basenode.cxx  |   24 ---
 slideshow/source/inc/basecontainernode.hxx   |1 
 3 files changed, 29 insertions(+), 12 deletions(-)

New commits:
commit cacdb1ae9d9e249737d0b3732e6fd198cfdd9d82
Author: Mark Hung 
AuthorDate: Sat Feb 16 08:44:36 2019 +0800
Commit: Mark Hung 
CommitDate: Tue Feb 19 18:25:03 2019 +0100

tdf#77186 handle time container indefinite repetition.

Indefinite duration isn't necessary for indefinite repetition,
so simply check the number of iteration left and do not decrease
the number when the repetition is indefinite.

Note: a known issue is that the next effect starts before
"until click" or "until next slide" if the starting time of
the next slide is "after previous". A workaround is to set
the starting time of the next slide to "click".

Change-Id: Ie9c73b472dc400bc41501029ff19ecc3e3fab2df
Reviewed-on: https://gerrit.libreoffice.org/67896
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/slideshow/source/engine/animationnodes/basecontainernode.cxx 
b/slideshow/source/engine/animationnodes/basecontainernode.cxx
index bb3c7e3739a7..d48df81161cb 100644
--- a/slideshow/source/engine/animationnodes/basecontainernode.cxx
+++ b/slideshow/source/engine/animationnodes/basecontainernode.cxx
@@ -41,6 +41,7 @@ BaseContainerNode::BaseContainerNode(
   maChildren(),
   mnFinishedChildren(0),
   mnLeftIterations(0),
+  mbRepeatIndefinite(xNode->getRepeatCount().hasValue() && 
isIndefiniteTiming(xNode->getRepeatCount())),
   mbDurationIndefinite( isIndefiniteTiming( xNode->getEnd() ) &&
 isIndefiniteTiming( xNode->getDuration() ) )
 {
@@ -137,12 +138,9 @@ bool BaseContainerNode::notifyDeactivatedChild(
 ++mnFinishedChildren;
 bool bFinished = (mnFinishedChildren >= nSize);
 
-// all children finished, and we've got indefinite duration?
-// think of ParallelTimeContainer::notifyDeactivating()
-// if duration given, we will be deactivated by some end event
-// @see fillCommonParameters()
-if (bFinished && isDurationIndefinite()) {
-if( mnLeftIterations >= 1.0 )
+// Handle repetition here.
+if (bFinished) {
+if(!mbRepeatIndefinite && mnLeftIterations >= 1.0)
 {
 mnLeftIterations -= 1.0;
 }
@@ -155,7 +153,7 @@ bool BaseContainerNode::notifyDeactivatedChild(
"BaseContainerNode::repeat");
 getContext().mrEventQueue.addEvent( aRepetitionEvent );
 }
-else
+else if (isDurationIndefinite())
 {
 deactivate();
 }
@@ -166,6 +164,10 @@ bool BaseContainerNode::notifyDeactivatedChild(
 
 void BaseContainerNode::repeat()
 {
+// Prevent repeat event scheduled before deactivation.
+if (getState() == FROZEN || getState() == ENDED)
+return;
+
 forEachChildNode( std::mem_fn(::end), ~ENDED );
 bool bState = init_children();
 if( bState )
diff --git a/slideshow/source/engine/animationnodes/basenode.cxx 
b/slideshow/source/engine/animationnodes/basenode.cxx
index f47076e57ae1..afe0a0111e50 100644
--- a/slideshow/source/engine/animationnodes/basenode.cxx
+++ b/slideshow/source/engine/animationnodes/basenode.cxx
@@ -539,12 +539,26 @@ void BaseNode::scheduleDeactivationEvent( EventSharedPtr 
const& pEvent )
 // if anim base node has no activity, this is called to schedule 
deactivation,
 // but what if it does not schedule anything?
 
-// TODO(F2): Handle end time attribute, too
 auto self(mpSelf);
-mpCurrentEvent = generateEvent(
-mxAnimationNode->getDuration(),
-[self] () { self->deactivate(); },
-maContext, 0.0 );
+if (mxAnimationNode->getEnd().hasValue())
+{
+// TODO: We may need to calculate the duration if the end value is 
numeric.
+// We expect that the end value contains EventTrigger::ON_NEXT 
here.
+// LibreOffice does not generate numeric values, so we can leave it
+// until we find a test case.
+mpCurrentEvent = generateEvent(
+mxAnimationNode->getEnd(),
+[self] () { self->deactivate(); },
+maContext, 0.0 );
+
+}
+else
+{
+mpCurrentEvent = generateEvent(
+mxAnimationNode->getDuration(),
+[self] () { self->deactivate(); },
+maContext, 0.0 );
+}
 }
 }
 
diff --git a/slideshow/source/inc/basecontainernode.hxx 
b/slideshow/source/inc/basecontainernode.hxx
index 94547302d7e6..ca07eff16687 100644
--- a/slideshow/source/inc/basecontainernode.hxx
+++ b/slideshow/source/inc/basecontainernode.hxx
@@ -85,6 +85,7 @@ protected:
 double   mnLeftIterations;
 
 

[Libreoffice-commits] core.git: slideshow/source

2019-02-05 Thread Libreoffice Gerrit user
 slideshow/source/engine/animatedsprite.cxx   |   54 -
 slideshow/source/engine/animationfactory.cxx |   64 +-
 slideshow/source/engine/animationnodes/animationbasenode.cxx |   38 -
 slideshow/source/engine/animationnodes/basenode.cxx  |   76 +-
 slideshow/source/engine/eventmultiplexer.cxx |   26 
 slideshow/source/engine/opengl/TransitionerImpl.cxx  |   25 
 slideshow/source/engine/pointersymbol.cxx|   52 -
 slideshow/source/engine/rehearsetimingsactivity.cxx  |   22 
 slideshow/source/engine/shapeattributelayer.cxx  |   30 -
 slideshow/source/engine/shapes/drawinglayeranimation.cxx |  328 +--
 slideshow/source/engine/shapes/drawshapesubsetting.cxx   |   26 
 slideshow/source/engine/shapes/viewmediashape.cxx|  226 +++
 slideshow/source/engine/slide/layermanager.cxx   |   38 -
 slideshow/source/engine/slide/shapemanagerimpl.cxx   |   58 -
 slideshow/source/engine/slide/slideanimations.cxx|   22 
 slideshow/source/engine/transitions/slidechangebase.cxx  |   36 -
 slideshow/source/engine/waitsymbol.cxx   |   28 
 17 files changed, 575 insertions(+), 574 deletions(-)

New commits:
commit 5509d639d0b245415f647690619de5a5163ca620
Author: Noel Grandin 
AuthorDate: Tue Feb 5 14:16:28 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Feb 5 14:43:11 2019 +0100

loplugin:flatten in slideshow

Change-Id: I826a43b36e35f9145c971b3608b6f56d27ff5f81
Reviewed-on: https://gerrit.libreoffice.org/67405
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/animatedsprite.cxx 
b/slideshow/source/engine/animatedsprite.cxx
index 46379897168a..481a625afe7a 100644
--- a/slideshow/source/engine/animatedsprite.cxx
+++ b/slideshow/source/engine/animatedsprite.cxx
@@ -119,34 +119,34 @@ namespace slideshow
 bNeedResize = true;
 }
 
-if( bNeedResize )
+if( !bNeedResize )
+return;
+
+// as the old sprite might have already been altered
+// (and therefore been placed in the update list of
+// the spritecanvas for this frame), must hide it
+// here, to ensure it's not visible on screen any
+// longer.
+mpSprite->hide();
+
+maEffectiveSpriteSizePixel = aNewSize;
+mpSprite = mpViewLayer->createSprite( maEffectiveSpriteSizePixel,
+  mnSpritePrio );
+
+ENSURE_OR_THROW( mpSprite,
+  "AnimatedSprite::resize(): Could not create new 
sprite" );
+
+// set attributes similar to previous sprite
+if (mbSpriteVisible)
 {
-// as the old sprite might have already been altered
-// (and therefore been placed in the update list of
-// the spritecanvas for this frame), must hide it
-// here, to ensure it's not visible on screen any
-// longer.
-mpSprite->hide();
-
-maEffectiveSpriteSizePixel = aNewSize;
-mpSprite = mpViewLayer->createSprite( 
maEffectiveSpriteSizePixel,
-  mnSpritePrio );
-
-ENSURE_OR_THROW( mpSprite,
-  "AnimatedSprite::resize(): Could not create 
new sprite" );
-
-// set attributes similar to previous sprite
-if (mbSpriteVisible)
-{
-mpSprite->show();
-mpSprite->setAlpha( mnAlpha );
-
-if( maPosPixel )
-mpSprite->movePixel( *maPosPixel );
-
-if( maClip )
-mpSprite->setClip( *maClip );
-}
+mpSprite->show();
+mpSprite->setAlpha( mnAlpha );
+
+if( maPosPixel )
+mpSprite->movePixel( *maPosPixel );
+
+if( maClip )
+mpSprite->setClip( *maClip );
 }
 }
 
diff --git a/slideshow/source/engine/animationfactory.cxx 
b/slideshow/source/engine/animationfactory.cxx
index 38f3eb0825f8..4967bdc9c519 100644
--- a/slideshow/source/engine/animationfactory.cxx
+++ b/slideshow/source/engine/animationfactory.cxx
@@ -478,38 +478,38 @@ namespace slideshow
 
 // only stop animation once per repeated end() call,
 // and only if sprites are used for display
-if( mbAnimationStarted )
-{
-mbAnimationStarted = false;
-
-if( !(mnFlags & AnimationFactory::FLAG_NO_SPRITE) )
-mpShapeManager->leaveAnimationMode( mpShape );
-
-// 

[Libreoffice-commits] core.git: slideshow/source

2018-12-06 Thread Libreoffice Gerrit user
 slideshow/source/engine/animationnodes/animationcommandnode.cxx |7 +--
 slideshow/source/engine/animationnodes/animationcommandnode.hxx |1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f820f6eb6036197bbb53e2d5e4bf4d5341ad280d
Author: Caolán McNamara 
AuthorDate: Thu Dec 6 13:19:57 2018 +
Commit: Caolán McNamara 
CommitDate: Thu Dec 6 16:44:56 2018 +0100

Resolves: tdf#121942 action deactivated twice

Change-Id: I25b1ed89b8d0e7a7c0e36c621a43644bc2b4aa7b
Reviewed-on: https://gerrit.libreoffice.org/64708
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx 
b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index 3bd05db936b2..1b764b1c5a4a 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -38,6 +38,7 @@ AnimationCommandNode::AnimationCommandNode( 
uno::Reference const& pParent,
  NodeContext const& rContext ) :
 BaseNode( xNode, pParent, rContext ),
+mbToggled(false),
 mpShape(),
 mxCommandNode( xNode, css::uno::UNO_QUERY_THROW )
 {
@@ -80,12 +81,13 @@ void AnimationCommandNode::activate_st()
 // the command toggles the pause status on a media object
 case EffectCommands::TOGGLEPAUSE:
 {
-if( mpShape )
+if (mpShape)
 {
 if( mpShape->isPlaying() )
 mpShape->pause();
 else
 mpShape->play();
+mbToggled = true;
 }
 break;
 }
@@ -115,12 +117,13 @@ void AnimationCommandNode::deactivate_st( NodeState 
/*eDestState*/ )
 // the command toggles the pause status on a media object
 case EffectCommands::TOGGLEPAUSE:
 {
-if( mpShape )
+if (mpShape && mbToggled)
 {
 if( mpShape->isPlaying() )
 mpShape->pause();
 else
 mpShape->play();
+mbToggled = false;
 }
 break;
 }
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx 
b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
index cf753e001949..1aacd1b6a071 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
@@ -50,6 +50,7 @@ private:
 virtual bool hasPendingAnimation() const override;
 
 private:
+bool mbToggled;
 IExternalMediaShapeBaseSharedPtr mpShape;
 css::uno::Reference mxCommandNode;
 };
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2018-12-05 Thread Libreoffice Gerrit user
 slideshow/source/engine/animationnodes/animationcommandnode.cxx |   19 
++
 slideshow/source/engine/animationnodes/animationcommandnode.hxx |1 
 2 files changed, 20 insertions(+)

New commits:
commit 1aa10fcb668f67f4313b7170a4090027e52164c5
Author: Caolán McNamara 
AuthorDate: Tue Dec 4 16:42:10 2018 +
Commit: Thorsten Behrens 
CommitDate: Wed Dec 5 13:51:59 2018 +0100

tdf#121830 TogglePause should reset to original state on deactivate_st ?

is that how it should work, or should there be an additional TogglePause
created at import time to get the apparent intended pause effect

Change-Id: I0573bd8d9534271f2b36d7ab3b8cdc20e0f985a1
Reviewed-on: https://gerrit.libreoffice.org/64548
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.cxx 
b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
index 0c9519589ed0..3bd05db936b2 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.cxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.cxx
@@ -109,6 +109,25 @@ void AnimationCommandNode::activate_st()
"AnimationCommandNode::deactivate" ) );
 }
 
+void AnimationCommandNode::deactivate_st( NodeState /*eDestState*/ )
+{
+switch( mxCommandNode->getCommand() ) {
+// the command toggles the pause status on a media object
+case EffectCommands::TOGGLEPAUSE:
+{
+if( mpShape )
+{
+if( mpShape->isPlaying() )
+mpShape->pause();
+else
+mpShape->play();
+}
+break;
+}
+
+}
+}
+
 bool AnimationCommandNode::hasPendingAnimation() const
 {
 return mxCommandNode->getCommand() == EffectCommands::STOPAUDIO || mpShape;
diff --git a/slideshow/source/engine/animationnodes/animationcommandnode.hxx 
b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
index 675da7c3b0e8..cf753e001949 100644
--- a/slideshow/source/engine/animationnodes/animationcommandnode.hxx
+++ b/slideshow/source/engine/animationnodes/animationcommandnode.hxx
@@ -46,6 +46,7 @@ protected:
 
 private:
 virtual void activate_st() override;
+virtual void deactivate_st( NodeState eDestState ) override;
 virtual bool hasPendingAnimation() const override;
 
 private:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source sot/qa sot/source starmath/source stoc/source

2018-11-29 Thread Libreoffice Gerrit user
 slideshow/source/engine/activitiesqueue.cxx|8 -
 slideshow/source/engine/eventqueue.cxx |   12 -
 slideshow/source/engine/slide/shapemanagerimpl.cxx |   75 
--
 slideshow/source/engine/slide/slideimpl.cxx|9 -
 slideshow/source/engine/slide/userpaintoverlay.cxx |   38 ++---
 slideshow/source/engine/slideshowimpl.cxx  |   28 +--
 slideshow/source/engine/transitions/slidetransitionfactory.cxx |   12 -
 slideshow/source/engine/usereventqueue.cxx |   29 +--
 slideshow/source/inc/basecontainernode.hxx |5 
 sot/qa/cppunit/test_sot.cxx|   11 -
 sot/source/base/formats.cxx|   16 --
 sot/source/sdstor/stgcache.cxx |   31 +---
 starmath/source/accessibility.cxx  |   20 +-
 starmath/source/cfgitem.cxx|   11 -
 starmath/source/cursor.cxx |   47 ++
 starmath/source/dialog.cxx |   10 -
 starmath/source/symbol.cxx |   17 --
 starmath/source/unomodel.cxx   |   14 -
 stoc/source/inspect/introspection.cxx  |   10 -
 stoc/source/invocation_adapterfactory/iafactory.cxx|7 
 stoc/source/servicemanager/servicemanager.cxx  |   10 -
 stoc/source/simpleregistry/simpleregistry.cxx  |5 
 22 files changed, 168 insertions(+), 257 deletions(-)

New commits:
commit 0ded54c33f01d18d2cd06547bd8307bd140cf28f
Author: Arkadiy Illarionov 
AuthorDate: Tue Nov 27 22:17:40 2018 +0300
Commit: Noel Grandin 
CommitDate: Thu Nov 29 12:06:44 2018 +0100

Simplify containers iterations in slideshow, sot, starmath, stoc

Use range-based loop or replace with STL functions

Change-Id: I94792c28b283a0998bf813317e5beb37d93e0c23
Reviewed-on: https://gerrit.libreoffice.org/64125
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/activitiesqueue.cxx 
b/slideshow/source/engine/activitiesqueue.cxx
index 8eadd83428e8..484c04283236 100644
--- a/slideshow/source/engine/activitiesqueue.cxx
+++ b/slideshow/source/engine/activitiesqueue.cxx
@@ -81,13 +81,9 @@ namespace slideshow
 
 // accumulate time lag for all activities, and lag time
 // base if necessary:
-ActivityQueue::const_iterator iPos(
-maCurrentActivitiesWaiting.begin() );
-const ActivityQueue::const_iterator iEnd(
-maCurrentActivitiesWaiting.end() );
 double fLag = 0.0;
-for ( ; iPos != iEnd; ++iPos )
-fLag = std::max( fLag, (*iPos)->calcTimeLag() );
+for ( const auto& rxActivity : maCurrentActivitiesWaiting )
+fLag = std::max( fLag, rxActivity->calcTimeLag() );
 if (fLag > 0.0)
 {
 mpTimer->adjustTimer( -fLag );
diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index e1c53c4da4f6..33955faa61e4 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -59,11 +59,9 @@ namespace slideshow
 EventQueue::~EventQueue()
 {
 // add in all that have been added explicitly for this round:
-EventEntryVector::const_iterator const iEnd( maNextEvents.end() );
-for ( EventEntryVector::const_iterator iPos( maNextEvents.begin() 
);
-  iPos != iEnd; ++iPos )
+for ( const auto& rEvent : maNextEvents )
 {
-maEvents.push(*iPos);
+maEvents.push(rEvent);
 }
 EventEntryVector().swap( maNextEvents );
 
@@ -166,10 +164,8 @@ namespace slideshow
 SAL_INFO("slideshow.verbose", "EventQueue: heartbeat" );
 
 // add in all that have been added explicitly for this round:
-EventEntryVector::const_iterator const iEnd( maNextEvents.end() );
-for ( EventEntryVector::const_iterator iPos( maNextEvents.begin() 
);
-  iPos != iEnd; ++iPos ) {
-maEvents.push(*iPos);
+for ( const auto& rEvent : maNextEvents ) {
+maEvents.push(rEvent);
 }
 EventEntryVector().swap( maNextEvents );
 
diff --git a/slideshow/source/engine/slide/shapemanagerimpl.cxx 
b/slideshow/source/engine/slide/shapemanagerimpl.cxx
index 3b8f730eb2c0..e6a3bea58c1e 100644
--- a/slideshow/source/engine/slide/shapemanagerimpl.cxx
+++ b/slideshow/source/engine/slide/shapemanagerimpl.cxx
@@ -128,35 +128,30 @@ bool ShapeManagerImpl::handleMouseReleased( 
awt::MouseEvent const& e )
 
 // find matching shape (scan reversely, to 

[Libreoffice-commits] core.git: slideshow/source

2018-09-03 Thread Libreoffice Gerrit user
 slideshow/source/engine/shapes/drawshapesubsetting.cxx |   23 +++--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit a8aaffa6ea0f0fd8cf1d22883173df64a93e3322
Author: Mike Kaganski 
AuthorDate: Mon Sep 3 19:27:57 2018 +0300
Commit: Mike Kaganski 
CommitDate: Mon Sep 3 22:25:35 2018 +0200

tdf#119146: fix populating maCurrentSubsets

Regression from commit 4600b07c1d787f959618d9ecf54161e4ea4ffa61

Before the mentioned commit, creating a subset X, and then adding
sub-subsets until all the subset is excluded, had left the subset X
with two *empty* nodes in maCurrentSubsets, 1st of them having both
mnStartIndex and mnEndIndex equal to maSubset.mnStartIndex, and 2nd
having both mnStartIndex and mnEndIndex equal to maSubset.mnEndIndex.

The commit above changed that to adding maSubset to maCurrentSubsets
in the beginning of each exclusion, which finally resulted in a messy
maCurrentSubsets with multiple duplicating nodes effectively covering
all maSubset. That resulted in the item as a whole handled *besides*
the sub-subsets.

This commit (1) avoids adding extra maSubset to maCurrentSubsets, and
(2) adds the two empty nodes in case all the subset has been excluded
by its sub-subsets.

Change-Id: I7fc5f2d0b6ecf4f9247351da3a2746032150557b
Reviewed-on: https://gerrit.libreoffice.org/59948
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx 
b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
index 308e0502ab7a..3bc64b7125ee 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
@@ -214,6 +214,25 @@ namespace slideshow
 
 maCurrentSubsets.insert(maCurrentSubsets.end(), 
aNodesToAppend.begin(),
 aNodesToAppend.end());
+// Excluding subsets must not leave an absolutely empty 
maCurrentSubsets, because it
+// would mean "non-subsetting" mode unconditionally, with whole 
object added to subsets.
+// So to indicate a subset with all parts excluded, add two empty 
subsets (starting and
+// ending).
+if (maCurrentSubsets.empty())
+{
+if (maSubset.isEmpty())
+{
+maCurrentSubsets.emplace_back(0, 0);
+maCurrentSubsets.emplace_back(maActionClassVector.size(),
+  maActionClassVector.size());
+}
+else
+{
+maCurrentSubsets.emplace_back(maSubset.getStartIndex(),
+  maSubset.getStartIndex());
+maCurrentSubsets.emplace_back(maSubset.getEndIndex(), 
maSubset.getEndIndex());
+}
+}
 }
 
 void DrawShapeSubsetting::updateSubsets()
@@ -276,10 +295,10 @@ namespace slideshow
 
 void DrawShapeSubsetting::initCurrentSubsets()
 {
-// only add subset to vector, if it's not empty - that's
+// only add subset to vector, if vector is empty, and subset is 
not empty - that's
 // because the vector's content is later literally used
 // for e.g. painting.
-if( !maSubset.isEmpty() )
+if (maCurrentSubsets.empty() && !maSubset.isEmpty())
 maCurrentSubsets.push_back( maSubset );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2018-07-27 Thread Libreoffice Gerrit user
 slideshow/source/engine/activities/activitiesfactory.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9605b998438a62501f58c6e028f79b679629b333
Author: Mark Hung 
AuthorDate: Thu Jul 26 20:19:34 2018 +0800
Commit: Mark Hung 
CommitDate: Fri Jul 27 16:23:39 2018 +0200

tdf#76436 initialize maStartInterpolationValue.

Fix regrssion caused by 372c47309a192e67220913309fa1ccffdff8cde1,
where a from-to or from-by animation always interpolate with a
empty maStartInterpolationValue, ignoring original from value.

That also affect many animations, such as unexpected magnify effect
at the end of put-on-the-brake animation.

Change-Id: If63960816f2f284774c51e12be2fcac8c8a1b57e
Reviewed-on: https://gerrit.libreoffice.org/58109
Tested-by: Jenkins
Reviewed-by: Mark Hung 

diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx 
b/slideshow/source/engine/activities/activitiesfactory.cxx
index dadd590257e0..1955be399fe1 100644
--- a/slideshow/source/engine/activities/activitiesfactory.cxx
+++ b/slideshow/source/engine/activities/activitiesfactory.cxx
@@ -208,6 +208,7 @@ public:
 maStartValue = *maFrom;
 maEndValue = maStartValue + *maBy;
 }
+maStartInterpolationValue = maStartValue;
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2018-07-04 Thread Stephan Bergmann
 slideshow/source/inc/shapesubset.hxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit efa1d0df9a108b585bddd0a7e8ba5a4f64df3489
Author: Stephan Bergmann 
Date:   Wed Jul 4 13:12:12 2018 +0200

-Werror=deprecated-copy (GCC trunk towards GCC 9)

Change-Id: I12d5cfafab17e02dc041eff8af207ba36df9bb5a
Reviewed-on: https://gerrit.libreoffice.org/56938
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/inc/shapesubset.hxx 
b/slideshow/source/inc/shapesubset.hxx
index 7f0a8a747148..0929658b0f30 100644
--- a/slideshow/source/inc/shapesubset.hxx
+++ b/slideshow/source/inc/shapesubset.hxx
@@ -91,6 +91,12 @@ namespace slideshow
 
 ~ShapeSubset();
 
+// For a rationale for this hacky combination of user-provided 
dtor, defaulted copy
+// ctor, and deleted copy assignment op, see the "TODO(Q1)" 
comment in
+// CloningNodeCreator 
(slideshow/source/engine/animationnodes/animationnodefactory.cxx):
+ShapeSubset(ShapeSubset const &) = default;
+void operator =(ShapeSubset) = delete;
+
 /** Get the actual subset shape.
 
 If the subset is currently revoked, this method
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2018-06-28 Thread Mike Kaganski
 slideshow/source/engine/shapes/drawshapesubsetting.cxx |  102 -
 slideshow/source/engine/shapes/drawshapesubsetting.hxx |8 -
 slideshow/source/inc/doctreenode.hxx   |1 
 3 files changed, 52 insertions(+), 59 deletions(-)

New commits:
commit 4600b07c1d787f959618d9ecf54161e4ea4ffa61
Author: Mike Kaganski 
Date:   Thu Jun 28 14:51:31 2018 +1000

tdf#102195: don't exclude everything between first and last subset

When subsets are non-contiguous, we need to include the parts between
subsets.

Change-Id: I28214dccc75e6a6af5c65397b2126049a65bf79f
Reviewed-on: https://gerrit.libreoffice.org/56571
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/slideshow/source/engine/shapes/drawshapesubsetting.cxx 
b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
index 1de7934719d9..849df8d9897c 100644
--- a/slideshow/source/engine/shapes/drawshapesubsetting.cxx
+++ b/slideshow/source/engine/shapes/drawshapesubsetting.cxx
@@ -164,50 +164,65 @@ namespace slideshow
 mbNodeTreeInitialized = true;
 }
 
-void DrawShapeSubsetting::updateSubsetBounds( const SubsetEntry& 
rSubsetEntry )
+void DrawShapeSubsetting::excludeSubset(sal_Int32 nExcludedStart, 
sal_Int32 nExcludedEnd)
 {
-// TODO(F1): This removes too much from non-contiguous subsets
-mnMinSubsetActionIndex = ::std::min(
-mnMinSubsetActionIndex,
-rSubsetEntry.mnStartActionIndex );
-mnMaxSubsetActionIndex = ::std::max(
-mnMaxSubsetActionIndex,
-rSubsetEntry.mnEndActionIndex );
-}
-
-void DrawShapeSubsetting::updateSubsets()
-{
-maCurrentSubsets.clear();
+// If current subsets are empty, fill it with initial range
+initCurrentSubsets();
+if (maCurrentSubsets.empty())
+{
+// Non-subsetting mode (not a subset of anything; child 
subsets subtract content)
+maCurrentSubsets.emplace_back(0, maActionClassVector.size());
+}
 
-if( !maSubsetShapes.empty() )
+slideshow::internal::VectorOfDocTreeNodes aNodesToAppend;
+for (auto i = maCurrentSubsets.begin(); i != 
maCurrentSubsets.end();)
 {
-if( maSubset.isEmpty() )
+if (i->getStartIndex() < nExcludedStart)
 {
-// non-subsetted node, with some child subsets
-// that subtract from it
-maCurrentSubsets.emplace_back( 0,
- 
mnMinSubsetActionIndex );
-maCurrentSubsets.emplace_back( mnMaxSubsetActionIndex,
- 
maActionClassVector.size() );
+if (i->getEndIndex() > nExcludedStart)
+{
+// Some overlap -> append new node (if required), and 
correct this node's end
+if (i->getEndIndex() > nExcludedEnd)
+{
+aNodesToAppend.emplace_back(nExcludedEnd, 
i->getEndIndex());
+}
+i->setEndIndex(nExcludedStart);
+}
+++i;
+}
+else if (i->getStartIndex() < nExcludedEnd)
+{
+if (i->getEndIndex() > nExcludedEnd)
+{
+// Partial overlap; change the node's start
+i->setStartIndex(nExcludedEnd);
+++i;
+}
+else
+{
+// Node is fully inside the removed range: erase it
+i = maCurrentSubsets.erase(i);
+}
 }
 else
 {
-// subsetted node, from which some further child
-// subsets subtract content
-maCurrentSubsets.emplace_back( maSubset.getStartIndex(),
- 
mnMinSubsetActionIndex );
-maCurrentSubsets.emplace_back( mnMaxSubsetActionIndex,
- 
maSubset.getEndIndex() );
+// Node is fully outside (after) excluded range
+++i;
 }
 }
-else
+
+maCurrentSubsets.insert(maCurrentSubsets.end(), 
aNodesToAppend.begin(),
+aNodesToAppend.end());
+}
+
+void DrawShapeSubsetting::updateSubsets()
+{
+maCurrentSubsets.clear();
+initCurrentSubsets();
+
+for (const auto& rSubsetShape : maSubsetShapes)
 

[Libreoffice-commits] core.git: slideshow/source

2018-03-23 Thread Noel Grandin
 slideshow/source/engine/transitions/slidetransitionfactory.cxx |   17 
+-
 1 file changed, 3 insertions(+), 14 deletions(-)

New commits:
commit 0bbfb4733289782e042a76e3c87c8df6c1819c05
Author: Noel Grandin 
Date:   Thu Mar 22 14:03:33 2018 +0200

loplugin:useuniqueptr in PluginSlideChange

Change-Id: I60474c40012c2afa2573bc5ba5013e46551d1309
Reviewed-on: https://gerrit.libreoffice.org/51760
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx 
b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
index 8b675e975d13..5ed99a951026 100644
--- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx
+++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx
@@ -154,13 +154,6 @@ public:
 virtual ~PluginSlideChange() override
 {
 mxFactory.clear();
-
-for( const auto& pCurrView : maTransitions )
-{
-delete pCurrView;
-}
-
-maTransitions.clear();
 }
 
 bool addTransition( const UnoViewSharedPtr& rView )
@@ -173,7 +166,7 @@ public:
 getEnteringBitmap(ViewEntry(rView))->getXBitmap() );
 
 if( rTransition.is() )
-maTransitions.push_back( new TransitionViewPair( rTransition, 
rView ) );
+maTransitions.emplace_back( new TransitionViewPair( rTransition, 
rView ) );
 else
 return false;
 
@@ -213,15 +206,11 @@ public:
 SAL_INFO("slideshow", "PluginSlideChange viewRemoved");
 SlideChangeBase::viewRemoved( rView );
 
-::std::vector< TransitionViewPair* >::const_iterator 
aEnd(maTransitions.end());
-for( ::std::vector< TransitionViewPair* >::iterator aIter 
=maTransitions.begin();
- aIter != aEnd;
- ++aIter )
+for( auto aIter = maTransitions.begin(); aIter != maTransitions.end(); 
++aIter )
 {
 if( ( *aIter )->mpView == rView )
 {
 SAL_INFO("slideshow", "view removed" );
-delete *aIter;
 maTransitions.erase( aIter );
 break;
 }
@@ -264,7 +253,7 @@ public:
 
 private:
 // One transition object per view
-std::vector< TransitionViewPair* > maTransitions;
+std::vector< std::unique_ptr > maTransitions;
 
 // bool
 bool mbSuccess;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2018-03-10 Thread Tomaž Vajngerl
 slideshow/source/engine/shapes/shapeimporter.cxx |   71 ++-
 1 file changed, 7 insertions(+), 64 deletions(-)

New commits:
commit 80918a529bed72a06779fc59d9379be97cb8aca3
Author: Tomaž Vajngerl 
Date:   Sat Mar 10 16:06:54 2018 +0900

slideshow: convert use of GraphicURL to Graphic property

Change-Id: I4e933d592d3408dd7887b81f2efb69068af88202
Reviewed-on: https://gerrit.libreoffice.org/51040
Tested-by: Jenkins 
Reviewed-by: Tomaž Vajngerl 

diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx 
b/slideshow/source/engine/shapes/shapeimporter.cxx
index 3d4122cda94b..3f31fac1099a 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -64,77 +65,19 @@ std::unique_ptr 
importShapeGraphic(uno::Reference xRet;
 
-OUString aURL;
-if( !getPropertyValue( aURL, xPropSet, "GraphicURL") ||
-aURL.isEmpty() )
+uno::Reference xGraphic;
+if (!getPropertyValue(xGraphic, xPropSet, "Graphic") || !xGraphic.is())
 {
 // no or empty property - cannot import shape graphic
 return xRet;
 }
 
-OUString const aVndUrl(
-"vnd.sun.star.GraphicObject:"  );
-sal_Int32 nIndex( aURL.indexOf( aVndUrl ) );
+Graphic aGraphic(xGraphic);
+xRet.reset(new GraphicObject(aGraphic));
 
-if(nIndex != -1)
+if (GraphicType::Default == xRet->GetType() || GraphicType::NONE == 
xRet->GetType())
 {
-// skip past the end of the "vnd..." prefix
-nIndex += aVndUrl.getLength();
-
-if(nIndex >= aURL.getLength())
-{
-OSL_FAIL( "ShapeImporter::importShape(): "
-"embedded graphic has no graphic ID" );
-return nullptr;
-}
-
-// unique ID string found in URL, extract
-// to separate string
-OUString const aUniqueId( aURL.copy( nIndex ) );
-
-// TODO(T2): Creating a GraphicObject is not
-// thread safe (internally calls VCL, and has
-// unguarded internal singleton mpGlobalMgr)
-
-// fetch already loaded graphic from graphic manager.
-OString const aOldString(OUStringToOString(aUniqueId,
-RTL_TEXTENCODING_UTF8));
-xRet.reset(new GraphicObject(aOldString));
-
-
-if (GraphicType::Default == xRet->GetType()
-|| GraphicType::NONE == xRet->GetType())
-{
-// even the GrfMgr does not seem to know this graphic
-return nullptr;
-}
-}
-else
-{
-// no special string found, graphic must be
-// external. Load via GraphicIm porter
-INetURLObject aTmp( aURL );
-std::unique_ptr pGraphicStream(
-utl::UcbStreamHelper::CreateStream(
-aTmp.GetMainURL( INetURLObject::DecodeMechanism::NONE ),
-StreamMode::READ ) );
-if( !pGraphicStream )
-{
-OSL_FAIL( "ShapeImporter::importShape(): "
-"cannot create input stream for graphic" );
-return nullptr;
-}
-
-Graphic aTmpGraphic;
-if( GraphicConverter::Import(
-*pGraphicStream, aTmpGraphic ) != ERRCODE_NONE )
-{
-OSL_FAIL( "ShapeImporter::importShape(): "
-"Failed to import shape graphic from given URL" );
-return nullptr;
-}
-
-xRet.reset(new GraphicObject(aTmpGraphic));
+xRet.reset();
 }
 return xRet;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-12-05 Thread Stephan Bergmann
 slideshow/source/engine/smilfunctionparser.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2b082696754819bb00f3fd382b8a3f376893556d
Author: Stephan Bergmann 
Date:   Tue Dec 5 11:00:22 2017 +0100

Replace deprecated std::mem_fun et al in slideshow

(as std::mem_fun is gone by default at least from recent libc++ in C++17 
mode)

Change-Id: I561f6bda7d2e3aa15ebf3f697f41700082377039
Reviewed-on: https://gerrit.libreoffice.org/45865
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/smilfunctionparser.cxx 
b/slideshow/source/engine/smilfunctionparser.cxx
index d7c5e8befb9f..8b25d849c5cc 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -426,10 +426,10 @@ namespace slideshow
 str_p( "$"  )[ ValueTFunctor(  
self.getContext()) ]
   | str_p( "pi" )[ ConstantFunctor(M_PI,   
self.getContext()) ]
   | str_p( "e"  )[ ConstantFunctor(M_E,
self.getContext()) ]
-  | str_p( "x"  )[ 
makeShapeBoundsFunctor(::std::mem_fun_ref(&::basegfx::B2DRange::getCenterX),self.getContext())
 ]
-  | str_p( "y"  )[ 
makeShapeBoundsFunctor(::std::mem_fun_ref(&::basegfx::B2DRange::getCenterY),self.getContext())
 ]
-  | str_p( "width"  )[ 
makeShapeBoundsFunctor(::std::mem_fun_ref(&::basegfx::B2DRange::getWidth),  
self.getContext()) ]
-  | str_p( "height" )[ 
makeShapeBoundsFunctor(::std::mem_fun_ref(&::basegfx::B2DRange::getHeight), 
self.getContext()) ]
+  | str_p( "x"  )[ 
makeShapeBoundsFunctor(::std::mem_fn(&::basegfx::B2DRange::getCenterX),self.getContext())
 ]
+  | str_p( "y"  )[ 
makeShapeBoundsFunctor(::std::mem_fn(&::basegfx::B2DRange::getCenterY),self.getContext())
 ]
+  | str_p( "width"  )[ 
makeShapeBoundsFunctor(::std::mem_fn(&::basegfx::B2DRange::getWidth),  
self.getContext()) ]
+  | str_p( "height" )[ 
makeShapeBoundsFunctor(::std::mem_fn(&::basegfx::B2DRange::getHeight), 
self.getContext()) ]
   ;
 
 unaryFunction =
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-10-19 Thread Stephan Bergmann
 slideshow/source/engine/effectrewinder.cxx |2 +-
 slideshow/source/inc/basecontainernode.hxx |6 +++---
 slideshow/source/inc/basenode.hxx  |6 +++---
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit db90b1aa477baacf8cb85384343aba171b91eb5c
Author: Stephan Bergmann 
Date:   Thu Oct 19 15:58:04 2017 +0200

Move slideshow include files to common include directory

...that are included from various places.  Change done in preparation of
loplugin:includeform.

Change-Id: I6507189a380a547321903d71e3cb425c37bb16ad
Reviewed-on: https://gerrit.libreoffice.org/43563
Tested-by: Jenkins 
Reviewed-by: Stephan Bergmann 

diff --git a/slideshow/source/engine/effectrewinder.cxx 
b/slideshow/source/engine/effectrewinder.cxx
index 96ba0e048281..cdf1a02f7685 100644
--- a/slideshow/source/engine/effectrewinder.cxx
+++ b/slideshow/source/engine/effectrewinder.cxx
@@ -22,7 +22,7 @@
 #include "eventqueue.hxx"
 #include "usereventqueue.hxx"
 #include "mouseeventhandler.hxx"
-#include "animationnodes/basecontainernode.hxx"
+#include "basecontainernode.hxx"
 #include "delayevent.hxx"
 
 #include 
diff --git a/slideshow/source/engine/animationnodes/basecontainernode.hxx 
b/slideshow/source/inc/basecontainernode.hxx
similarity index 93%
rename from slideshow/source/engine/animationnodes/basecontainernode.hxx
rename to slideshow/source/inc/basecontainernode.hxx
index 3d6e568d5e0f..6338fb026c7c 100644
--- a/slideshow/source/engine/animationnodes/basecontainernode.hxx
+++ b/slideshow/source/inc/basecontainernode.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_BASECONTAINERNODE_HXX
-#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_BASECONTAINERNODE_HXX
+#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_BASECONTAINERNODE_HXX
+#define INCLUDED_SLIDESHOW_SOURCE_INC_BASECONTAINERNODE_HXX
 
 #include "basenode.hxx"
 
@@ -96,6 +96,6 @@ typedef ::std::shared_ptr< BaseContainerNode > 
BaseContainerNodeSharedPtr;
 } // namespace interface
 } // namespace presentation
 
-#endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_BASECONTAINERNODE_HXX
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/slideshow/source/engine/animationnodes/basenode.hxx 
b/slideshow/source/inc/basenode.hxx
similarity index 97%
rename from slideshow/source/engine/animationnodes/basenode.hxx
rename to slideshow/source/inc/basenode.hxx
index 495e03f9ee5c..9798aa11a171 100644
--- a/slideshow/source/engine/animationnodes/basenode.hxx
+++ b/slideshow/source/inc/basenode.hxx
@@ -16,8 +16,8 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_BASENODE_HXX
-#define INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_BASENODE_HXX
+#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_BASENODE_HXX
+#define INCLUDED_SLIDESHOW_SOURCE_INC_BASENODE_HXX
 
 #include 
 #include 
@@ -205,6 +205,6 @@ typedef ::std::shared_ptr< BaseNode > BaseNodeSharedPtr;
 } // namespace internal
 } // namespace slideshow
 
-#endif // INCLUDED_SLIDESHOW_SOURCE_ENGINE_ANIMATIONNODES_BASENODE_HXX
+#endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-09-28 Thread Caolán McNamara
 slideshow/source/engine/shapes/viewmediashape.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit 69c88654881a4aa0db05df9fb94e3d9e7dfbfa30
Author: Caolán McNamara 
Date:   Thu Sep 28 10:28:44 2017 +0100

Resolves: tdf#42873 videos in presenter console misplaced

Change-Id: Ib7559246f6f3173acea72268db0489b79df38ae3
Reviewed-on: https://gerrit.libreoffice.org/42892
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/slideshow/source/engine/shapes/viewmediashape.cxx 
b/slideshow/source/engine/shapes/viewmediashape.cxx
index a518fdae5780..9059b218cdf4 100644
--- a/slideshow/source/engine/shapes/viewmediashape.cxx
+++ b/slideshow/source/engine/shapes/viewmediashape.cxx
@@ -50,15 +50,16 @@
 #include 
 #endif
 
-#include 
-#include 
-#include 
+#include 
 #include 
+#include 
 #include 
 #include 
-#include 
+#include 
+#include 
+#include 
+#include 
 #include 
-#include 
 
 #include "viewmediashape.hxx"
 #include "mediashape.hxx"
@@ -460,6 +461,13 @@ namespace slideshow
 {
 mpMediaWindow.disposeAndClear();
 mpMediaWindow = 
VclPtr::Create( pWindow, WB_CLIPCHILDREN );
+UnoViewSharedPtr 
xUnoView(std::dynamic_pointer_cast(mpViewLayer));
+if (xUnoView)
+{
+awt::Rectangle aCanvasArea = 
xUnoView->getUnoView()->getCanvasArea();
+aAWTRect.X += aCanvasArea.X;
+aAWTRect.Y += aCanvasArea.Y;
+}
 mpMediaWindow->SetPosSizePixel( Point( 
aAWTRect.X, aAWTRect.Y ),
Size( 
aAWTRect.Width, aAWTRect.Height ) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-09-13 Thread Noel Grandin
 slideshow/source/engine/eventqueue.cxx  |5 ++---
 slideshow/source/engine/opengl/TransitionImpl.cxx   |   14 +++---
 slideshow/source/engine/pointersymbol.cxx   |2 +-
 slideshow/source/engine/rehearsetimingsactivity.cxx |2 +-
 slideshow/source/engine/screenupdater.cxx   |3 +--
 slideshow/source/engine/shapes/drawshape.cxx|   15 ++-
 slideshow/source/engine/shapes/drawshapesubsetting.cxx  |   16 
 slideshow/source/engine/shapes/gdimtftools.cxx  |3 +--
 slideshow/source/engine/shapes/viewshape.cxx|2 +-
 slideshow/source/engine/slide/layer.cxx |5 ++---
 slideshow/source/engine/slide/slideimpl.cxx |5 ++---
 slideshow/source/engine/transitions/slidechangebase.cxx |2 +-
 slideshow/source/engine/waitsymbol.cxx  |2 +-
 13 files changed, 34 insertions(+), 42 deletions(-)

New commits:
commit cc233992dfe0fa9732c24774852d037d161546ce
Author: Noel Grandin 
Date:   Wed Sep 13 13:20:59 2017 +0200

clang-tidy modernize-use-emplace in slideshow

Change-Id: Ice6ab0dcd6785a751be5a66b262690640e0a2780
Reviewed-on: https://gerrit.libreoffice.org/42239
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/eventqueue.cxx 
b/slideshow/source/engine/eventqueue.cxx
index df2ce3cdf3cb..3ecad820b1a7 100644
--- a/slideshow/source/engine/eventqueue.cxx
+++ b/slideshow/source/engine/eventqueue.cxx
@@ -119,9 +119,8 @@ namespace slideshow
 
 ENSURE_OR_RETURN_FALSE( rEvent.get() != nullptr,
"EventQueue::addEvent: event ptr NULL" );
-maNextEvents.push_back(
-EventEntry( rEvent, rEvent->getActivationTime(
-mpTimer->getElapsedTime()) ) );
+maNextEvents.emplace_back( rEvent, rEvent->getActivationTime(
+mpTimer->getElapsedTime()) );
 return true;
 }
 
diff --git a/slideshow/source/engine/opengl/TransitionImpl.cxx 
b/slideshow/source/engine/opengl/TransitionImpl.cxx
index ad83e50b5dc6..706816f55bd4 100644
--- a/slideshow/source/engine/opengl/TransitionImpl.cxx
+++ b/slideshow/source/engine/opengl/TransitionImpl.cxx
@@ -961,7 +961,7 @@ std::shared_ptr makeRevolvingCircles( 
sal_uInt16 nCircles , s
 float TempAngle(0.0);
 for(unsigned int Point(0); Point < nPointsOnCircles; ++Point)
 {
-unScaledTexCoords.push_back( glm::vec2( cos(TempAngle - 3.1415926/2.0) 
, sin(TempAngle- 3.1415926/2.0) ) );
+unScaledTexCoords.emplace_back( cos(TempAngle - 3.1415926/2.0) , 
sin(TempAngle- 3.1415926/2.0) );
 
 TempAngle += dAngle;
 }
@@ -1157,9 +1157,9 @@ void Primitive::pushTriangle(const glm::vec2& 
SlideLocation0,const glm::vec2& Sl
 Verts.reserve(3);
 Texs.reserve(3);
 
-Verts.push_back(glm::vec3( 2*SlideLocation0.x - 1, -2*SlideLocation0.y + 1 
, 0.0 ));
-Verts.push_back(glm::vec3( 2*SlideLocation1.x - 1, -2*SlideLocation1.y + 1 
, 0.0 ));
-Verts.push_back(glm::vec3( 2*SlideLocation2.x - 1, -2*SlideLocation2.y + 1 
, 0.0 ));
+Verts.emplace_back( 2*SlideLocation0.x - 1, -2*SlideLocation0.y + 1 , 0.0 
);
+Verts.emplace_back( 2*SlideLocation1.x - 1, -2*SlideLocation1.y + 1 , 0.0 
);
+Verts.emplace_back( 2*SlideLocation2.x - 1, -2*SlideLocation2.y + 1 , 0.0 
);
 
 //figure out if they're facing the correct way, and make them face the 
correct way.
 glm::vec3 Normal( glm::cross( Verts[0] - Verts[1] , Verts[1] - Verts[2] ) 
);
@@ -1175,9 +1175,9 @@ void Primitive::pushTriangle(const glm::vec2& 
SlideLocation0,const glm::vec2& Sl
 Texs.push_back(SlideLocation2);
 Texs.push_back(SlideLocation1);
 Verts.clear();
-Verts.push_back(glm::vec3( 2*SlideLocation0.x - 1, -2*SlideLocation0.y 
+ 1 , 0.0 ));
-Verts.push_back(glm::vec3( 2*SlideLocation2.x - 1, -2*SlideLocation2.y 
+ 1 , 0.0 ));
-Verts.push_back(glm::vec3( 2*SlideLocation1.x - 1, -2*SlideLocation1.y 
+ 1 , 0.0 ));
+Verts.emplace_back( 2*SlideLocation0.x - 1, -2*SlideLocation0.y + 1 , 
0.0 );
+Verts.emplace_back( 2*SlideLocation2.x - 1, -2*SlideLocation2.y + 1 , 
0.0 );
+Verts.emplace_back( 2*SlideLocation1.x - 1, -2*SlideLocation1.y + 1 , 
0.0 );
 }
 
 Vertices.push_back({Verts[0], glm::vec3(0, 0, 1), Texs[0]}); //all normals 
always face the screen when untransformed.
diff --git a/slideshow/source/engine/pointersymbol.cxx 
b/slideshow/source/engine/pointersymbol.cxx
index b539cf6a1055..29728a522189 100644
--- a/slideshow/source/engine/pointersymbol.cxx
+++ b/slideshow/source/engine/pointersymbol.cxx
@@ -128,7 +128,7 @@ void PointerSymbol::viewAdded( const UnoViewSharedPtr& 
rView )
 SAL_WARN( "slideshow", comphelper::anyToString( 

[Libreoffice-commits] core.git: slideshow/source vcl/headless

2017-09-04 Thread Caolán McNamara
 slideshow/source/engine/shapes/gdimtftools.cxx |2 +-
 vcl/headless/svpgdi.cxx|9 -
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 67951d08ddd20ac87fc7eb54a90cb81901a89f8c
Author: Caolán McNamara 
Date:   Mon Sep 4 17:12:02 2017 +0100

Resolves: tdf#111073 incorrect gif background color

a) set correct palette entries for the 1bit bitmap returned
b) only use a BITMASK for the mask (like its AnimatedGraphicPrimitive2D
brother in drawinglayer does)

Change-Id: I704997de554dc4d0e523458d45ab329815b5046a
Reviewed-on: https://gerrit.libreoffice.org/41905
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx 
b/slideshow/source/engine/shapes/gdimtftools.cxx
index 3d7e643dfb7b..fb12c9853392 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -285,7 +285,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames&   
o_rFrames,
 pVDev->EnableMapMode( false );
 
 // setup mask VDev (alpha VDev is currently rather slow)
-ScopedVclPtrInstance< VirtualDevice > pVDevMask;
+ScopedVclPtrInstance pVDevMask(DeviceFormat::BITMASK);
 pVDevMask->SetOutputSizePixel( aAnimSize );
 pVDevMask->EnableMapMode( false );
 
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 170d6c6087e6..5b8c0a8a66e0 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1145,7 +1145,14 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rTR,
 SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long 
nHeight )
 {
 SvpSalBitmap* pBitmap = new SvpSalBitmap();
-pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), BitmapPalette());
+BitmapPalette aPal;
+if (GetBitCount() == 1)
+{
+aPal.SetEntryCount(2);
+aPal[0] = Color(COL_BLACK);
+aPal[1] = Color(COL_WHITE);
+}
+pBitmap->Create(Size(nWidth, nHeight), GetBitCount(), aPal);
 
 cairo_surface_t* target = 
SvpSalGraphics::createCairoSurface(pBitmap->GetBuffer());
 cairo_t* cr = cairo_create(target);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-07-27 Thread Noel Grandin
 slideshow/source/engine/animationnodes/animationnodefactory.cxx |2 +-
 slideshow/source/engine/slide/slideimpl.cxx |2 +-
 slideshow/source/engine/usereventqueue.cxx  |2 +-
 slideshow/source/inc/animationnodefactory.hxx   |2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit b9982b51f42b1e1ede3b8e95cb2b6f724520e32f
Author: Noel Grandin 
Date:   Thu Jul 27 08:52:08 2017 +0200

loplugin:constparams in slideshow

Change-Id: Ifa9fda35020d456338781879df9fba4c0ee535fd
Reviewed-on: https://gerrit.libreoffice.org/40469
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx 
b/slideshow/source/engine/animationnodes/animationnodefactory.cxx
index 7abb97bae370..cd9594df3e87 100644
--- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx
+++ b/slideshow/source/engine/animationnodes/animationnodefactory.cxx
@@ -580,7 +580,7 @@ AnimationNodeSharedPtr 
AnimationNodeFactory::createAnimationNode(
 }
 
 #if defined(DBG_UTIL)
-void AnimationNodeFactory::showTree( AnimationNodeSharedPtr& pRootNode )
+void AnimationNodeFactory::showTree( AnimationNodeSharedPtr const & pRootNode )
 {
 if( pRootNode )
 DEBUG_NODES_SHOWTREE( std::dynamic_pointer_cast(
diff --git a/slideshow/source/engine/slide/slideimpl.cxx 
b/slideshow/source/engine/slide/slideimpl.cxx
index 0f5515a0cae8..8f4ae3001a7b 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -274,7 +274,7 @@ private:
 };
 
 
-void slideRenderer( SlideImpl* pSlide, const UnoViewSharedPtr& rView )
+void slideRenderer( SlideImpl const * pSlide, const UnoViewSharedPtr& rView )
 {
 // fully clear view content to background color
 rView->clearAll();
diff --git a/slideshow/source/engine/usereventqueue.cxx 
b/slideshow/source/engine/usereventqueue.cxx
index 6bcfd5c9bfa8..66ddcb716318 100644
--- a/slideshow/source/engine/usereventqueue.cxx
+++ b/slideshow/source/engine/usereventqueue.cxx
@@ -340,7 +340,7 @@ protected:
 return false; // nothing hit
 }
 
-bool sendEvent( ImpShapeEventMap::reverse_iterator& io_rHitShape )
+bool sendEvent( ImpShapeEventMap::reverse_iterator const & io_rHitShape )
 {
 // take next event from queue
 const bool bRet( fireSingleEvent( io_rHitShape->second,
diff --git a/slideshow/source/inc/animationnodefactory.hxx 
b/slideshow/source/inc/animationnodefactory.hxx
index d7c9162824f4..f23428449255 100644
--- a/slideshow/source/inc/animationnodefactory.hxx
+++ b/slideshow/source/inc/animationnodefactory.hxx
@@ -50,7 +50,7 @@ namespace slideshow
 
 
 #if defined(DBG_UTIL)
-void showTree( AnimationNodeSharedPtr& pRootNode );
+void showTree( AnimationNodeSharedPtr const & pRootNode );
 # define SHOW_NODE_TREE(a) AnimationNodeFactory::showTree(a)
 #else
 # define SHOW_NODE_TREE(a)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-06-11 Thread Caolán McNamara
 slideshow/source/engine/shapes/viewappletshape.cxx |7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 756e090b7fb618402d2e8d25f13acba5416536d4
Author: Caolán McNamara 
Date:   Sun Jun 11 13:38:04 2017 +0100

logging the simple message is sufficient

Change-Id: I84bced2b8dd92082f4777e00261ac87752278527

diff --git a/slideshow/source/engine/shapes/viewappletshape.cxx 
b/slideshow/source/engine/shapes/viewappletshape.cxx
index 8550ed5e2f56..d7a9b8a41644 100644
--- a/slideshow/source/engine/shapes/viewappletshape.cxx
+++ b/slideshow/source/engine/shapes/viewappletshape.cxx
@@ -97,26 +97,23 @@ namespace slideshow
 }
 }
 
-
 ViewAppletShape::~ViewAppletShape()
 {
 try
 {
 endApplet();
 }
-catch (uno::Exception &)
+catch (const uno::Exception )
 {
-SAL_WARN( "slideshow", comphelper::anyToString( 
cppu::getCaughtException() ) );
+SAL_WARN("slideshow", "" << e.Message);
 }
 }
 
-
 const ViewLayerSharedPtr& ViewAppletShape::getViewLayer() const
 {
 return mpViewLayer;
 }
 
-
 void ViewAppletShape::startApplet( const ::basegfx::B2DRectangle& 
rBounds )
 {
 ENSURE_OR_RETURN_VOID( mpViewLayer && mpViewLayer->getCanvas() && 
mpViewLayer->getCanvas()->getUNOCanvas().is(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: slideshow/source

2017-03-23 Thread Noel Grandin
 slideshow/source/engine/shapes/drawshape.cxx |   28 +++---
 slideshow/source/engine/shapes/drawshape.hxx |4 +--
 slideshow/source/engine/shapes/viewshape.cxx |   18 +++---
 slideshow/source/engine/shapes/viewshape.hxx |   33 +++
 4 files changed, 44 insertions(+), 39 deletions(-)

New commits:
commit 53bfd644d2c19fcd5ac1b387b5b69cf7f118d285
Author: Noel Grandin 
Date:   Wed Mar 22 14:58:02 2017 +0200

convert UpdateFlags to scoped enum

Change-Id: I73121e85a927bae3f042a2bbc0283a28067b891f
Reviewed-on: https://gerrit.libreoffice.org/35553
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 

diff --git a/slideshow/source/engine/shapes/drawshape.cxx 
b/slideshow/source/engine/shapes/drawshape.cxx
index 143786adebb9..98f1cae40ac7 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -144,7 +144,7 @@ namespace slideshow
 mnPriority);
 }
 
-bool DrawShape::implRender( int nUpdateFlags ) const
+bool DrawShape::implRender( UpdateFlags nUpdateFlags ) const
 {
 SAL_INFO( "slideshow", 
"::presentation::internal::DrawShape::implRender()" );
 SAL_INFO( "slideshow", "::presentation::internal::DrawShape: 0x" 
<< std::hex << this );
@@ -188,15 +188,15 @@ namespace slideshow
 return true;
 }
 
-int DrawShape::getUpdateFlags() const
+UpdateFlags DrawShape::getUpdateFlags() const
 {
 // default: update nothing, unless ShapeAttributeStack
 // tells us below, or if the attribute layer was revoked
-int nUpdateFlags(ViewShape::NONE);
+UpdateFlags nUpdateFlags(UpdateFlags::NONE);
 
 // possibly the whole shape content changed
 if( mbAttributeLayerRevoked )
-nUpdateFlags = ViewShape::CONTENT;
+nUpdateFlags = UpdateFlags::Content;
 
 
 // determine what has to be updated
@@ -216,30 +216,30 @@ namespace slideshow
 // content change because when the visibility
 // changes then usually a sprite is shown or hidden
 // and the background under has to be painted once.
-nUpdateFlags |= ViewShape::CONTENT;
+nUpdateFlags |= UpdateFlags::Content;
 }
 
 // TODO(P1): This can be done without conditional 
branching.
 // See HAKMEM.
 if( mpAttributeLayer->getPositionState() != 
mnAttributePositionState )
 {
-nUpdateFlags |= ViewShape::POSITION;
+nUpdateFlags |= UpdateFlags::Position;
 }
 if( mpAttributeLayer->getAlphaState() != 
mnAttributeAlphaState )
 {
-nUpdateFlags |= ViewShape::ALPHA;
+nUpdateFlags |= UpdateFlags::Alpha;
 }
 if( mpAttributeLayer->getClipState() != 
mnAttributeClipState )
 {
-nUpdateFlags |= ViewShape::CLIP;
+nUpdateFlags |= UpdateFlags::Clip;
 }
 if( mpAttributeLayer->getTransformationState() != 
mnAttributeTransformationState )
 {
-nUpdateFlags |= ViewShape::TRANSFORMATION;
+nUpdateFlags |= UpdateFlags::Transformation;
 }
 if( mpAttributeLayer->getContentState() != 
mnAttributeContentState )
 {
-nUpdateFlags |= ViewShape::CONTENT;
+nUpdateFlags |= UpdateFlags::Content;
 }
 }
 }
@@ -639,7 +639,7 @@ namespace slideshow
 {
 pNewShape->update( mpCurrMtf,
getViewRenderArgs(),
-   ViewShape::FORCE,
+   UpdateFlags::Force,
isVisible() );
 }
 }
@@ -695,15 +695,15 @@ namespace slideshow
 // force redraw. Have to also pass on the update flags,
 // because e.g. content update (regeneration of the
 // metafile renderer) is normally not performed. A simple
-// ViewShape::FORCE would only paint the metafile in its
+// UpdateFlags::Force would only paint the metafile in its
 // old state.
-return implRender( ViewShape::FORCE | getUpdateFlags() );
+return implRender( UpdateFlags::Force | getUpdateFlags() );
 }
 
 bool DrawShape::isContentChanged() const
 {
 

  1   2   3   >