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

mmeof manik10044 at iiitd.ac.in
Thu May 9 08:42:39 PDT 2013


 officecfg/registry/schema/org/openoffice/Office/Impress.xcs |    7 ++++++
 sd/source/ui/app/optsitem.cxx                               |   13 +++++++++--
 sd/source/ui/dlg/tpoption.cxx                               |    9 +++++++
 sd/source/ui/dlg/tpoption.src                               |   10 +++++++-
 sd/source/ui/inc/optsitem.hxx                               |    3 ++
 sd/source/ui/inc/tpoption.hrc                               |    2 -
 sd/source/ui/inc/tpoption.hxx                               |    1 
 sdext/source/presenter/PresenterScreen.cxx                  |   14 +++++++++++-
 sdext/source/presenter/PresenterScreen.hxx                  |    2 +
 9 files changed, 56 insertions(+), 5 deletions(-)

New commits:
commit 39da7ee77e5c5add8aaef12bf1e80c66132782fa
Author: mmeof <manik10044 at iiitd.ac.in>
Date:   Fri May 3 09:20:28 2013 -0700

    fdo#56995 Created global option to disable presenter console in Impress
    
    Changes made are as Follows
    /officecfg/registry/schema/org/openoffice/Office/Impress.xcs
    	To add the new global checkbox to Libreoffice Impress>General>Start
    	A new xml block for EnablePresenterScreen was added
    		<prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" >
    		/sd/source/ui/app/optsitem.cxx
    		To add the setter/getter for the new checkbox button, namely:
    			SetEnablePresenterScreen
    			IsEnablePresenterScreen
    		EnablePresenterScreen added to index number 26 of:
    			GetPropNameArray()
    /sd/source/ui/dlg/tpoption.cxx
    	SdTpOptionsMisc() editted to attach EnablePresenterScreen to CBX_ENABLE_PRESENTER_SCREEN
    		aCbxEnablePresenterScreen  ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN))
    	Also Added to FillItemSet() and Reset() functions
    /sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src
    	enableSdRemote size changed to
    		Size = MAP_APPFONT ( 116 , 10 ) ;
    		Pos = MAP_APPFONT ( 12 , 171  ) ;
    		158 was correct but 171 was added on request
    		To allow enableSdRemote(CBX_ENABLE_SDREMOTE) and enablePresenterScreen( CBX_ENABLE_PRESENTER_SCREEN) to be drawn adjacent.
    		enablePresenterScreen checkbox CBX_ENABLE_PRESENTER_SCREEN added
    /sd/source/ui/inc/optsitem.hxx
    	Set default value for enablePresenterScreen as 1 or TRUE
    		sal_Bool    bEnablePresenterScreen : 1;
    	Added getter/setter named same as above for interface definition
    sd/source/ui/inc/tpoption.hrc
    	Defined CBX_ENABLE_PRESENTER_SCREEN as 42nd checkbox
    		#define CBX_ENABLE_PRESENTER_SCREEN 42
    /sd/source/ui/inc/tpoption.hxx
    	 Added interface declaration of aCbxEnablePresenterScreen which was attached to  CBX_ENABLE_PRESENTER_SCREEN
    /sdext/source/presenter/PresenterScreen.hxx
    	 Added interface declaration of
    		bool isPresenterScreenEnabled()
    		 to PresenterScreen class to allow presenterscreen to get if the option is checked
    /sdext/source/presenter/PresenterScreen.cxx
    	 Added definition of
    		 isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
    			Input : Current Process Context
    			Output : The 0/1 value of EnablePresenterScreen from presenterconfig
    	In PresenterScreenListener::notifyEvent( )
    		Added
    			 if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext)
    				mpPresenterScreen->InitializePresenterScreen()
     		To initialize PresenterScreen only when enabled
    
    Change-Id: If8242e607323df57d8e78d08cf2129d03c0c9e4f
    Reviewed-on: https://gerrit.libreoffice.org/3762
    Tested-by: LibreOffice gerrit bot <gerrit at libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index 1ec830b..8161806 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -601,6 +601,13 @@
           </info>
           <value>true</value>
         </prop>
+        <prop oor:name="EnablePresenterScreen" oor:type="xs:boolean" oor:nillable="false">
+           <info>
+            <desc>Indicates whether to show Presenter Screen Console which shows next slide, notes etc.</desc>
+            <label>Enable Presenter Screen</label>
+          </info>
+          <value>true</value>
+        </prop>
       </group>
       <group oor:name="Compatibility">
         <info>
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 9fe08cc..e960588 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -489,6 +489,7 @@ SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
     bClickChangeRotation( sal_False ),
     bStartWithActualPage( sal_False ),
     bEnableSdremote( sal_False ),
+    bEnablePresenterScreen( sal_True),
     bSolidDragging( sal_True ),
     bSummationOfParagraphs( sal_False ),
     bShowUndoDeleteWarning( sal_True ),
@@ -524,6 +525,7 @@ sal_Bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
             IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
             IsStartWithActualPage() == rOpt.IsStartWithActualPage() &&
             IsEnableSdremote() == rOpt.IsEnableSdremote() &&
+            IsEnablePresenterScreen() == rOpt.IsEnablePresenterScreen()&&
             IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
             IsSolidDragging() == rOpt.IsSolidDragging() &&
             IsShowUndoDeleteWarning() == rOpt.IsShowUndoDeleteWarning() &&
@@ -580,10 +582,11 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
 
         "PenColor",
         "PenWidth",
-        "Start/EnableSdremote"
+        "Start/EnableSdremote",
+        "Start/EnablePresenterScreen"
     };
 
-    rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 26 : 14 );
+    rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 14 );
     ppNames = aPropNames;
 }
 
@@ -642,6 +645,9 @@ sal_Bool SdOptionsMisc::ReadData( const Any* pValues )
 
         if( pValues[25].hasValue() )
             SetEnableSdremote( *(sal_Bool*) pValues[ 25 ].getValue() );
+
+        if( pValues[26].hasValue() )
+            SetEnablePresenterScreen( *(sal_Bool*) pValues[ 26 ].getValue() );
     }
 
     return sal_True;
@@ -685,6 +691,7 @@ sal_Bool SdOptionsMisc::WriteData( Any* pValues ) const
         pValues[ 23 ] <<= GetPresentationPenColor();
         pValues[ 24 ] <<= GetPresentationPenWidth();
         pValues[ 25 ] <<= IsEnableSdremote();
+        pValues[ 26 ] <<= IsEnablePresenterScreen();
     }
 
     return sal_True;
@@ -713,6 +720,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd
         maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
         maOptionsMisc.SetStartWithActualPage( pOpts->IsStartWithActualPage() );
         maOptionsMisc.SetEnableSdremote( pOpts->IsEnableSdremote() );
+        maOptionsMisc.SetEnablePresenterScreen( pOpts->IsEnablePresenterScreen() );
         maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() );
         maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() );
         maOptionsMisc.SetPrinterIndependentLayout( pOpts->GetPrinterIndependentLayout() );
@@ -796,6 +804,7 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
         pOpts->SetClickChangeRotation( maOptionsMisc.IsClickChangeRotation() );
         pOpts->SetStartWithActualPage( maOptionsMisc.IsStartWithActualPage() );
         pOpts->SetEnableSdremote( maOptionsMisc.IsEnableSdremote() );
+        pOpts->SetEnablePresenterScreen( maOptionsMisc.IsEnablePresenterScreen() );
         pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() );
         pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() );
         pOpts->SetShowUndoDeleteWarning( maOptionsMisc.IsShowUndoDeleteWarning() );
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index e87baa8..603cd60 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -236,6 +236,7 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs  )
     aCbxStartWithActualPage     ( this, SdResId( CBX_START_WITH_ACTUAL_PAGE ) ),
     aGrpStartWithActualPage     ( this, SdResId( GRP_START_WITH_ACTUAL_PAGE ) ),
     aCbxEnableSdremote          ( this, SdResId( CBX_ENABLE_SDREMOTE ) ),
+    aCbxEnablePresenterScreen  ( this, SdResId( CBX_ENABLE_PRESENTER_SCREEN ) ),
     aTxtCompatibility           ( this, SdResId( FT_COMPATIBILITY ) ),
     aCbxUsePrinterMetrics       ( this, SdResId( CB_USE_PRINTER_METRICS ) ),
     aCbxCompatibility           ( this, SdResId( CB_MERGE_PARA_DIST ) ),
@@ -402,6 +403,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
         aCbxCopy.GetSavedValue()                != aCbxCopy.IsChecked() ||
         aCbxStartWithActualPage.GetSavedValue() != aCbxStartWithActualPage.IsChecked() ||
         aCbxEnableSdremote.GetSavedValue()      != aCbxEnableSdremote.IsChecked() ||
+        aCbxEnablePresenterScreen.GetSavedValue()!= aCbxEnablePresenterScreen.IsChecked() ||
         aCbxCompatibility.GetSavedValue()       != aCbxCompatibility.IsChecked() ||
         aCbxUsePrinterMetrics.GetSavedValue()   != aCbxUsePrinterMetrics.IsChecked() )
     {
@@ -416,6 +418,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
         aOptsItem.GetOptionsMisc().SetDragWithCopy( aCbxCopy.IsChecked() );
         aOptsItem.GetOptionsMisc().SetStartWithActualPage( aCbxStartWithActualPage.IsChecked() );
         aOptsItem.GetOptionsMisc().SetEnableSdremote( aCbxEnableSdremote.IsChecked() );
+        aOptsItem.GetOptionsMisc().SetEnablePresenterScreen( aCbxEnablePresenterScreen.IsChecked() );
         aOptsItem.GetOptionsMisc().SetSummationOfParagraphs( aCbxCompatibility.IsChecked() );
         aOptsItem.GetOptionsMisc().SetPrinterIndependentLayout (
             aCbxUsePrinterMetrics.IsChecked()
@@ -474,6 +477,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
     aCbxCopy.Check( aOptsItem.GetOptionsMisc().IsDragWithCopy() );
     aCbxStartWithActualPage.Check( aOptsItem.GetOptionsMisc().IsStartWithActualPage() );
     aCbxEnableSdremote.Check( aOptsItem.GetOptionsMisc().IsEnableSdremote() );
+    aCbxEnablePresenterScreen.Check( aOptsItem.GetOptionsMisc().IsEnablePresenterScreen() );
     aCbxCompatibility.Check( aOptsItem.GetOptionsMisc().IsSummationOfParagraphs() );
     aCbxUsePrinterMetrics.Check( aOptsItem.GetOptionsMisc().GetPrinterIndependentLayout()==1 );
     aCbxStartWithTemplate.SaveValue();
@@ -485,6 +489,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
     aCbxMasterPageCache.SaveValue();
     aCbxCopy.SaveValue();
     aCbxEnableSdremote.SaveValue();
+    aCbxEnablePresenterScreen.SaveValue();
     aCbxCompatibility.SaveValue();
     aCbxUsePrinterMetrics.SaveValue();
 
@@ -611,6 +616,9 @@ void SdTpOptionsMisc::SetImpressMode (void)
     lcl_MoveWin (aGrpStartWithActualPage, -nLineHeight);
     lcl_MoveWin (aCbxStartWithActualPage, -nLineHeight);
     lcl_MoveWin (aCbxEnableSdremote, -nLineHeight);
+    lcl_MoveWin (aCbxEnablePresenterScreen,
+        nDialogWidth/2 - aCbxEnablePresenterScreen.GetPosPixel().X(),
+        -nLineHeight);
     lcl_MoveWin (aTxtCompatibility, -nLineHeight);
 
     // Move the printer-independent-metrics check box up two lines to change
@@ -627,6 +635,7 @@ void    SdTpOptionsMisc::SetDrawMode()
     aGrpProgramStart.Hide();
     aCbxStartWithActualPage.Hide();
     aCbxEnableSdremote.Hide();
+    aCbxEnablePresenterScreen.Hide();
     aCbxCompatibility.Hide();
     aGrpStartWithActualPage.Hide();
     aCbxCrookNoContortion.Show();
diff --git a/sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src
index c1374f3..fa68037 100644
--- a/sd/source/ui/dlg/tpoption.src
+++ b/sd/source/ui/dlg/tpoption.src
@@ -210,10 +210,18 @@ TabPage TP_OPTIONS_MISC
     {
         HelpID = "sd:CheckBox:TP_OPTIONS_MISC:CBX_ENABLE_SDREMOTE";
         Pos = MAP_APPFONT ( 12 , 158  ) ;
-        Size = MAP_APPFONT ( 242 , 10 ) ;
+        Size = MAP_APPFONT ( 116 , 10 ) ;
         TabStop = TRUE ;
         Text [ en-US ] = "Enable remote control" ;
     };
+    CheckBox CBX_ENABLE_PRESENTER_SCREEN
+    {
+        HelpID = "sd:CheckBox:TP_OPTIONS_MISC:CBX_ENABLE_PRESENTER_SCREEN";
+        Pos = MAP_APPFONT ( 12 , 171  ) ;
+        Size = MAP_APPFONT ( 116 , 10 ) ;
+        TabStop = TRUE ;
+        Text [ en-US ] = "Enable Presenter Console" ;
+    };
     FixedLine FT_COMPATIBILITY
     {
         Pos = MAP_APPFONT ( 6 , 173 ) ;
diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index 99e6bf3..9fa4b23 100644
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -224,6 +224,7 @@ private:
     sal_Bool    bClickChangeRotation    : 1;    // Misc/RotateClick
     sal_Bool    bStartWithActualPage    : 1;    // Misc/Start/CurrentPage
     sal_Bool    bEnableSdremote         : 1;    // Misc/Start/EnableSdremote
+    sal_Bool    bEnablePresenterScreen : 1;    // Misc/Start/EnablePresenterDisplay
     sal_Bool    bSolidDragging          : 1;    // Misc/ModifyWithAttributes
     sal_Bool    bSummationOfParagraphs  : 1;    // misc/SummationOfParagraphs
     sal_Bool    bShowUndoDeleteWarning  : 1;    // Misc/ShowUndoDeleteWarning
@@ -273,6 +274,7 @@ public:
     sal_Bool    IsClickChangeRotation() const { Init(); return (sal_Bool) bClickChangeRotation; }
     sal_Bool    IsStartWithActualPage() const { Init(); return (sal_Bool) bStartWithActualPage; }
     sal_Bool    IsEnableSdremote() const { Init(); return (sal_Bool) bEnableSdremote; }
+    sal_Bool    IsEnablePresenterScreen() const { Init(); return (sal_Bool) bEnablePresenterScreen; }
     sal_Bool    IsSolidDragging() const { Init(); return (sal_Bool) bSolidDragging; }
     sal_Bool    IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
 
@@ -312,6 +314,7 @@ public:
     void    SetClickChangeRotation( sal_Bool bOn = sal_True ) { if( bClickChangeRotation != bOn ) { OptionsChanged(); bClickChangeRotation = bOn; } }
     void    SetStartWithActualPage( sal_Bool bOn = sal_True ) { if( bStartWithActualPage != bOn ) { OptionsChanged(); bStartWithActualPage = bOn; } }
     void    SetEnableSdremote( sal_Bool bOn = sal_True ) { if( bEnableSdremote != bOn ) { OptionsChanged(); bEnableSdremote = bOn; } }
+    void    SetEnablePresenterScreen( sal_Bool bOn = sal_True ) { if( bEnablePresenterScreen != bOn ) { OptionsChanged(); bEnablePresenterScreen = bOn; } }
     void    SetSummationOfParagraphs( sal_Bool bOn = sal_True ){ if ( bOn != bSummationOfParagraphs ) { OptionsChanged(); bSummationOfParagraphs = bOn; } }
     /** Set the printer independent layout mode.
         @param nOn
diff --git a/sd/source/ui/inc/tpoption.hrc b/sd/source/ui/inc/tpoption.hrc
index 59915ab..7ff6656 100644
--- a/sd/source/ui/inc/tpoption.hrc
+++ b/sd/source/ui/inc/tpoption.hrc
@@ -74,5 +74,5 @@
 
 #define CB_USE_PRINTER_METRICS 40
 #define CBX_ENABLE_SDREMOTE 41
-
+#define CBX_ENABLE_PRESENTER_SCREEN 42
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 9d04085..e64e621 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -97,6 +97,7 @@ private:
     CheckBox    aCbxStartWithActualPage;
     FixedLine   aGrpStartWithActualPage;
     CheckBox    aCbxEnableSdremote;
+    CheckBox    aCbxEnablePresenterScreen;
     FixedLine   aTxtCompatibility;
     CheckBox    aCbxUsePrinterMetrics;
     CheckBox    aCbxCompatibility;
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index 8fe7fce..f361912 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -220,7 +220,8 @@ void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventOb
     if ( Event.EventName == "OnStartPresentation" )
     {
         mpPresenterScreen = new PresenterScreen(mxComponentContext, mxModel);
-        mpPresenterScreen->InitializePresenterScreen();
+        if(mpPresenterScreen->isPresenterScreenEnabled(mxComponentContext))
+            mpPresenterScreen->InitializePresenterScreen();
     }
     else if ( Event.EventName == "OnEndPresentation" )
     {
@@ -286,6 +287,17 @@ PresenterScreen::~PresenterScreen (void)
 {
 }
 
+bool PresenterScreen::isPresenterScreenEnabled(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
+{
+        bool dEnablePresenterScreen=true;
+        PresenterConfigurationAccess aConfiguration (
+            rxContext,
+            OUString("/org.openoffice.Office.Impress/"),
+            PresenterConfigurationAccess::READ_ONLY);
+        aConfiguration.GetConfigurationNode("Misc/Start/EnablePresenterScreen")
+            >>= dEnablePresenterScreen;
+        return dEnablePresenterScreen;
+}
 void SAL_CALL PresenterScreen::disposing (void)
 {
     Reference<XConfigurationController> xCC (mxConfigurationControllerWeak);
diff --git a/sdext/source/presenter/PresenterScreen.hxx b/sdext/source/presenter/PresenterScreen.hxx
index 1647f84..c97447d 100644
--- a/sdext/source/presenter/PresenterScreen.hxx
+++ b/sdext/source/presenter/PresenterScreen.hxx
@@ -109,6 +109,8 @@ public:
 
     virtual void SAL_CALL disposing (void);
 
+    bool isPresenterScreenEnabled(
+        const css::uno::Reference<css::uno::XComponentContext>& rxContext);
     /** Make the presenter screen visible.
     */
     void InitializePresenterScreen (void);


More information about the Libreoffice-commits mailing list