[Libreoffice-commits] core.git: 2 commits - basebmp/source basebmp/test officecfg/registry sdext/source sd/source

Michael Meeks michael.meeks at suse.com
Thu Jul 18 06:57:55 PDT 2013


 basebmp/source/bitmapdevice.cxx                             |    6 -
 basebmp/source/intconversion.hxx                            |    1 
 basebmp/test/bmpdemo.cxx                                    |    2 
 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |    5 
 sd/source/ui/dlg/present.cxx                                |   63 ++++++++----
 sd/source/ui/inc/present.hxx                                |    4 
 sd/source/ui/slideshow/slideshow.cxx                        |   28 ++---
 sdext/source/presenter/PresenterScreen.cxx                  |   13 +-
 8 files changed, 70 insertions(+), 52 deletions(-)

New commits:
commit ee4569efa8322497112e8e951a67b9adca4ac55e
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Thu Jul 18 14:55:12 2013 +0100

    fdo#67045 - fix several nasty screen selection issues with presenter console.
    
    Also add the ability to select the external screen (whatever it is) to the
    configuration dialog.
    
    Change-Id: Id2d157eafff0031d7ae9fa2140d7022ae4a0cc6b

diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index 8161806..410a869 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -504,7 +504,10 @@
         <!-- OldLocation: -->
         <!-- UIHints: slide show settings display listbox -->
         <info>
-          <desc>Number of the display used for full screen slide show mode.</desc>
+          <desc>Offset number of the display used for full screen slide show mode;
+	        -1   means all screens,
+	         0   means default external screen,
+	         N>0 means real-screen number + 1.</desc>
           <label>Display for full screen slide show mode</label>
         </info>
         <value>0</value>
diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx
index fa63859..6aec289 100644
--- a/sd/source/ui/dlg/present.cxx
+++ b/sd/source/ui/dlg/present.cxx
@@ -149,6 +149,26 @@ SdStartPresentationDlg::SdStartPresentationDlg( Window* pWindow,
     ChangePauseHdl( NULL );
 }
 
+String SdStartPresentationDlg::GetDisplayName( sal_Int32 nDisplay, bool bExternal )
+{
+    String aName( bExternal ? msExternalMonitor->GetText() :
+                  msMonitor->GetText() );
+    const String aNumber( OUString::number( nDisplay ) );
+    aName.SearchAndReplace( String("%1"), aNumber );
+    return aName;
+}
+
+/// Store display index together with name in user data
+sal_Int32 SdStartPresentationDlg::InsertDisplayEntry(const rtl::OUString &aName,
+                                                     sal_Int32            nDisplay)
+{
+    maLBMonitor->InsertEntry( aName );
+    const sal_uInt32 nEntryIndex = maLBMonitor->GetEntryCount() - 1;
+    maLBMonitor->SetEntryData( nEntryIndex, (void*)(sal_IntPtr)nDisplay );
+
+    return nEntryIndex;
+}
+
 void SdStartPresentationDlg::InitMonitorSettings()
 {
     try
@@ -172,36 +192,39 @@ void SdStartPresentationDlg::InitMonitorSettings()
             sal_Int32 nDefaultExternalIndex (-1);
             const sal_Int32 nDefaultSelectedDisplay (
                 ( ( const SfxInt32Item& ) rOutAttrs.Get( ATTR_PRESENT_DISPLAY ) ).GetValue());
-            const String sPlaceHolder( "%1" );
+
+            // Un-conditionally add a version for '0' the default external display
+            sal_Int32 nInsertedEntry;
+
+            // FIXME: string-freeze this should really be 'External (display %)'
+            String aName = GetDisplayName( nExternalIndex + 1, true);
+            nInsertedEntry = InsertDisplayEntry( aName, 0 );
+            if( nDefaultSelectedDisplay == 0)
+                nSelectedIndex = nInsertedEntry;
+
+            // The user data contains the real setting
             for( sal_Int32 nDisplay = 0; nDisplay < mnMonitors; nDisplay++ )
             {
-                String aName( nDisplay == nExternalIndex ?
-                    msExternalMonitor->GetText() :
-                    msMonitor->GetText() );
-                const String aNumber( OUString::number( nDisplay + 1 ) );
-                aName.SearchAndReplace( sPlaceHolder, aNumber );
-                maLBMonitor->InsertEntry( aName );
-
-                // Store display index together with name.
-                const sal_uInt32 nEntryIndex (maLBMonitor->GetEntryCount()-1);
-                maLBMonitor->SetEntryData(nEntryIndex, (void*)(sal_IntPtr)nDisplay);
+                bool bIsExternal = nDisplay == nExternalIndex;
+                // FIXME: string-freeze, use true to denote external for now
+                bIsExternal = false;
+                aName = GetDisplayName( nDisplay + 1, bIsExternal );
+                nInsertedEntry = InsertDisplayEntry( aName, nDisplay + 1 );
 
                 // Remember the index of the default selection.
-                if (nDefaultSelectedDisplay == nDisplay)
-                    nSelectedIndex = nEntryIndex;
+                if( nDisplay + 1 == nDefaultSelectedDisplay )
+                    nSelectedIndex = nInsertedEntry;
 
                 // Remember index of the default display.
-                if (nDisplay == nExternalIndex)
-                    nDefaultExternalIndex = nEntryIndex;
+                if( nDisplay == nExternalIndex )
+                    nDefaultExternalIndex = nInsertedEntry;
             }
 
             if( bUnifiedDisplay )
             {
-                maLBMonitor->InsertEntry( msAllMonitors->GetText() );
-                const sal_uInt32 nEntryIndex (maLBMonitor->GetEntryCount()-1);
-                maLBMonitor->SetEntryData(nEntryIndex, (void*)-1);
-                if (nDefaultSelectedDisplay == -1)
-                    nSelectedIndex = nEntryIndex;
+                nInsertedEntry = InsertDisplayEntry( msAllMonitors->GetText(), -1 );
+                if( nDefaultSelectedDisplay == -1 )
+                    nSelectedIndex = nInsertedEntry;
             }
 
             if (nSelectedIndex < 0)
diff --git a/sd/source/ui/inc/present.hxx b/sd/source/ui/inc/present.hxx
index 393e03a..ef27bfb 100644
--- a/sd/source/ui/inc/present.hxx
+++ b/sd/source/ui/inc/present.hxx
@@ -74,7 +74,9 @@ private:
                         DECL_LINK( ChangePauseHdl, void * );
 
     void                InitMonitorSettings();
-
+    sal_Int32           InsertDisplayEntry(const rtl::OUString &aName,
+                                           sal_Int32            nDisplay);
+    String              GetDisplayName( sal_Int32 nDisplay, bool bExternal );
 public:
                         SdStartPresentationDlg( Window* pWindow,
                                 const SfxItemSet& rInAttrs,
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index 0fa3194..a34e660 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -550,14 +550,6 @@ void SAL_CALL SlideShow::setPropertyValue( const OUString& aPropertyName, const
         sal_Int32 nDisplay = 0;
         if( aValue >>= nDisplay )
         {
-            // Convert value to true display id.
-            if (nDisplay == 0)
-                nDisplay = Application::GetDisplayExternalScreen();
-            else if (nDisplay < 0)
-                nDisplay = -1;
-            else
-                --nDisplay;
-
             bIllegalArgument = false;
 
             SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
@@ -642,14 +634,7 @@ Any SAL_CALL SlideShow::getPropertyValue( const OUString& PropertyName ) throw(U
     case ATTR_PRESENT_DISPLAY:
     {
         SdOptions* pOptions = SD_MOD()->GetSdOptions(DOCUMENT_TYPE_IMPRESS);
-        const sal_Int32 nDisplay (pOptions->GetDisplay());
-        // Convert true display id to the previously used schema.
-        if (nDisplay == (sal_Int32)Application::GetDisplayExternalScreen())
-            return Any(sal_Int32(0));
-        else if (nDisplay < 0)
-            return Any(sal_Int32(-1));
-        else
-            return Any(nDisplay+1);
+        return Any(pOptions->GetDisplay());
     }
 
     default:
@@ -1288,8 +1273,8 @@ void SlideShow::StartFullscreenPresentation( )
 
 // ---------------------------------------------------------
 
+/// convert configuration setting display concept to real screens
 sal_Int32 SlideShow::GetDisplay()
-
 {
     sal_Int32 nDisplay = 0;
 
@@ -1297,6 +1282,15 @@ sal_Int32 SlideShow::GetDisplay()
     if( pOptions )
         nDisplay = pOptions->GetDisplay();
 
+    if( nDisplay < 0 )
+        nDisplay = -1;
+    else if( nDisplay == 0)
+        nDisplay = (sal_Int32)Application::GetDisplayExternalScreen();
+    else
+        nDisplay--;
+
+    SAL_INFO("sd", "Presenting on real screen " << nDisplay);
+
     return nDisplay;
 }
 
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index 2f1aeaa..05caa7e 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -448,9 +448,10 @@ void PresenterScreen::SwitchMonitors()
     }
 }
 
-// FIXME: really VCL should hold the current 'external' and 'built-in'
-// display states, and hide them behind some attractive API, and
-// the PresenterConsole should link VCL directly ...
+/**
+ * Return the real VCL screen number to show the presenter console
+ * on or -1 to not show anything.
+ */
 sal_Int32 PresenterScreen::GetPresenterScreenNumber (
     const Reference<presentation::XPresentation2>& rxPresentation) const
 {
@@ -475,6 +476,8 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber (
             return -1;
         }
 
+        SAL_INFO("sdext.presenter", "Display number is " << nDisplayNumber);
+
         if (nDisplayNumber > 0)
         {
             nScreenNumber = nDisplayNumber - 1;
@@ -518,7 +521,7 @@ sal_Int32 PresenterScreen::GetPresenterScreenNumber (
         // For some reason we can not access the screen number.  Use
         // the default instead.
     }
-
+    SAL_INFO("sdext.presenter", "Get presenter screen for screen " << nScreenNumber);
     return GetPresenterScreenFromScreen(nScreenNumber);
 }
 
@@ -538,6 +541,8 @@ sal_Int32 PresenterScreen::GetPresenterScreenFromScreen( sal_Int32 nPresentation
             break;
 
         default:
+            SAL_INFO("sdext.presenter", "Warning unexpected, out of bound screen "
+                     "mapped to 0" << nPresentationScreen);
             // When the full screen presentation is displayed on a screen
             // other than 0 or 1 then place the presenter on the first
             // available screen.
commit 8ac71b29eeca8b025d7548e1cee519277af7b90f
Author: Jelle van der Waa <jelle at vdwaa.nl>
Date:   Sat Jul 13 22:25:25 2013 +0200

    fdo#62475 removed pointless comments
    
    Change-Id: I85bee68e89c41642b2da72e11b695588b3dfe346

diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx
index 00fc1c2..24d9ef1 100644
--- a/basebmp/source/bitmapdevice.cxx
+++ b/basebmp/source/bitmapdevice.cxx
@@ -126,7 +126,6 @@ namespace
 
 
     // Actual BitmapDevice implementation (templatized by accessor and iterator)
-    //--------------------------------------------------------------------------
 
     /** Implementation of the BitmapDevice interface
 
@@ -1673,7 +1672,6 @@ void BitmapDevice::drawMaskedBitmap( const BitmapDeviceSharedPtr& rSrcBitmap,
 }
 
 
-//----------------------------------------------------------------------------------
 
 /** Standard clip and alpha masks
  */
@@ -1689,7 +1687,6 @@ struct StdMasks
     static const bool alphamask_polarity = true;
 };
 
-//----------------------------------------------------------------------------------
 
 // Some compilers don't like the nested template wrap_accessor
 // reference in the parameter list - being slightly less type safe,
@@ -1830,7 +1827,6 @@ BitmapDeviceSharedPtr createRenderer(
                                       pDamage);
 }
 
-//----------------------------------------------------------------------------------
 
 // TODO(Q3): consolidate with canvas/canvastools.hxx! Best move this
 // to o3tl or sal/bithacks.hxx ...
@@ -1854,7 +1850,6 @@ inline sal_uInt32 nextPow2( sal_uInt32 x )
     return ++x;
 }
 
-//----------------------------------------------------------------------------------
 
 namespace
 {
@@ -2156,7 +2151,6 @@ BitmapDeviceSharedPtr cloneBitmapDevice( const basegfx::B2IVector&    rSize,
                                    rProto->getDamageTracker() );
 }
 
-//----------------------------------------------------------------------------------
 
 /// Clone our device, with GenericImageAccessor to handle all formats
 BitmapDeviceSharedPtr BitmapDevice::getGenericRenderer() const
diff --git a/basebmp/source/intconversion.hxx b/basebmp/source/intconversion.hxx
index e1e3ff5..5d16182 100644
--- a/basebmp/source/intconversion.hxx
+++ b/basebmp/source/intconversion.hxx
@@ -26,7 +26,6 @@
 namespace basebmp
 {
     // metafunctions to retrieve correct POD from/to basebmp::Color
-    //------------------------------------------------------------------------
 
     /// type-safe conversion from RgbValue to packed int32
     template< class RgbVal > struct UInt32FromRgbValue
diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx
index fc9e1ae..f4ccc95 100644
--- a/basebmp/test/bmpdemo.cxx
+++ b/basebmp/test/bmpdemo.cxx
@@ -1196,9 +1196,7 @@ USHORT TestApp::Exception( USHORT nError )
 
 void TestApp::Main()
 {
-    //-------------------------------------------------
     // create the global service-manager
-    //-------------------------------------------------
     uno::Reference< lang::XMultiServiceFactory > xFactory;
     try
     {


More information about the Libreoffice-commits mailing list