[Libreoffice-commits] core.git: avmedia/source include/avmedia

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 2 12:14:07 UTC 2020


 avmedia/source/framework/mediacontrol.cxx  |   12 ++++++------
 avmedia/source/framework/mediatoolbox.cxx  |    2 +-
 avmedia/source/viewer/mediawindow_impl.cxx |    2 +-
 include/avmedia/MediaControlBase.hxx       |    6 +++---
 4 files changed, 11 insertions(+), 11 deletions(-)

New commits:
commit 7d9ae709c5c252a5360f3ef85f8fba39cdec5bda
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Sep 2 09:15:40 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Sep 2 14:13:23 2020 +0200

    convert MediaControlStyle to scoped enum
    
    Change-Id: If99d07d218499f7daa8b7294c216ddf2c0849b11
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101908
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index 1db23fdbb23b..a0ab139279f7 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -35,9 +35,9 @@ namespace avmedia
 {
 
 MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyle ) :
-    // MEDIACONTROLSTYLE_MULTILINE is the normal docking windows of tools->media player
-    // MEDIACONTROLSTYLE_SINGLELINE is the toolbar of view->toolbar->media playback
-    InterimItemWindow(pParent, eControlStyle == MEDIACONTROLSTYLE_MULTILINE ?
+    // MediaControlStyle::MultiLine is the normal docking windows of tools->media player
+    // MediaControlStyle::SingleLine is the toolbar of view->toolbar->media playback
+    InterimItemWindow(pParent, eControlStyle == MediaControlStyle::MultiLine ?
                                    OUString("svx/ui/mediawindow.ui") :
                                    OUString("svx/ui/medialine.ui"),
                                "MediaWindow"),
@@ -82,7 +82,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
 
     const OUString aMediaPath( AvmResId( AVMEDIA_MEDIA_PATH_DEFAULT ) );
     mxMediaPath->set_label(aMediaPath);
-    if (meControlStyle == MEDIACONTROLSTYLE_SINGLELINE)
+    if (meControlStyle == MediaControlStyle::SingleLine)
         mxMediaPath->set_size_request(mxMediaPath->get_preferred_size().Width() + 400, -1); // maybe extend the no. 400 to span the screen width
 
     // we want time field + progress slider to update as the media plays
@@ -93,7 +93,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
 
 void MediaControl::InitializeWidgets()
 {
-    if( meControlStyle != MEDIACONTROLSTYLE_SINGLELINE )
+    if( meControlStyle != MediaControlStyle::SingleLine )
     {
         mxPlayToolBox->set_item_help_id("open", HID_AVMEDIA_TOOLBOXITEM_OPEN);
         mxPlayToolBox->set_item_label("open", AvmResId(AVMEDIA_STR_OPEN));
@@ -128,7 +128,7 @@ void MediaControl::setState( const MediaItem& rItem )
     {
         mfTime = fTime;
         maItem.merge( rItem );
-        if( rItem.getURL().isEmpty() && meControlStyle == MEDIACONTROLSTYLE_SINGLELINE )
+        if( rItem.getURL().isEmpty() && meControlStyle == MediaControlStyle::SingleLine )
             mxPlayToolBox->set_sensitive(false);
         UpdateToolBoxes( maItem );
         UpdateTimeSlider( maItem );
diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index 0eac2eff0378..a109113a78fe 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -47,7 +47,7 @@ private:
 };
 
 MediaToolBoxControl_Impl::MediaToolBoxControl_Impl( vcl::Window& rParent, MediaToolBoxControl& rControl ) :
-    MediaControl( &rParent, MEDIACONTROLSTYLE_SINGLELINE ),
+    MediaControl( &rParent, MediaControlStyle::SingleLine ),
     mpToolBoxControl( &rControl )
 {
     SetSizePixel(m_xContainer->get_preferred_size());
diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx
index d030271b1c7f..78203960456c 100644
--- a/avmedia/source/viewer/mediawindow_impl.cxx
+++ b/avmedia/source/viewer/mediawindow_impl.cxx
@@ -46,7 +46,7 @@ using namespace ::com::sun::star;
 namespace avmedia::priv {
 
 MediaWindowControl::MediaWindowControl(vcl::Window* pParent)
-    : MediaControl(pParent, MEDIACONTROLSTYLE_MULTILINE)
+    : MediaControl(pParent, MediaControlStyle::MultiLine)
 {
 }
 
diff --git a/include/avmedia/MediaControlBase.hxx b/include/avmedia/MediaControlBase.hxx
index 7c5530019218..3060dd284f95 100644
--- a/include/avmedia/MediaControlBase.hxx
+++ b/include/avmedia/MediaControlBase.hxx
@@ -49,10 +49,10 @@ namespace avmedia { class MediaItem; }
 
 namespace avmedia {
 
-enum MediaControlStyle
+enum class MediaControlStyle
 {
-    MEDIACONTROLSTYLE_SINGLELINE = 0,
-    MEDIACONTROLSTYLE_MULTILINE = 1
+    SingleLine = 0,
+    MultiLine = 1
 };
 
 class UNLESS_MERGELIBS(AVMEDIA_DLLPUBLIC) MediaControlBase


More information about the Libreoffice-commits mailing list