summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2013-04-24 19:09:04 +0000
committerAriel Constenla-Haile <arielch@apache.org>2013-04-24 19:09:04 +0000
commit1eb66b9730e16f1dd1be426c7d0901b41c300b34 (patch)
tree28e24275a6c0349edfdb2de1f93f85453ae44c25
parent452d3dfb0eea34aee17d9613e5566fea3be178f1 (diff)
i121873 - Add option to disable starting the Presenter Screen together with the presentation
Notes
ignore: de-extension-ize Presentation Minimizer
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Impress.xcs7
-rw-r--r--sd/source/ui/app/optsitem.cxx15
-rw-r--r--sd/source/ui/dlg/tpoption.cxx11
-rw-r--r--sd/source/ui/dlg/tpoption.src10
-rw-r--r--sd/source/ui/inc/optsitem.hxx3
-rw-r--r--sd/source/ui/inc/tpoption.hrc2
-rw-r--r--sd/source/ui/inc/tpoption.hxx1
-rw-r--r--sdext/source/presenter/PresenterScreen.cxx84
8 files changed, 100 insertions, 33 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
index 7a88c7e3a432..a527053e9349 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Impress.xcs
@@ -728,6 +728,13 @@
</info>
<value>true</value>
</prop>
+ <prop oor:name="PresenterScreen" oor:type="xs:boolean">
+ <info>
+ <desc>Indicates whether to start the Presenter Screen together with the presentation, in a multiple monitor configuration.</desc>
+ <label>With 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 7175370636fe..b85315cf823c 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -498,6 +498,7 @@ SdOptionsMisc::SdOptionsMisc( sal_uInt16 nConfigId, sal_Bool bUseConfig ) :
bDoubleClickTextEdit( sal_True ),
bClickChangeRotation( sal_False ),
bStartWithActualPage( sal_False ),
+ bStartWithPresenterScreen( sal_True ), // default: Enable the Presenter Screen
bSolidDragging( sal_True ),
bSolidMarkHdl( sal_True ), // default: Use nice handles
bSummationOfParagraphs( sal_False ),
@@ -535,6 +536,7 @@ sal_Bool SdOptionsMisc::operator==( const SdOptionsMisc& rOpt ) const
IsDoubleClickTextEdit() == rOpt.IsDoubleClickTextEdit() &&
IsClickChangeRotation() == rOpt.IsClickChangeRotation() &&
IsStartWithActualPage() == rOpt.IsStartWithActualPage() &&
+ IsStartWithPresenterScreen() == rOpt.IsStartWithPresenterScreen() &&
IsSummationOfParagraphs() == rOpt.IsSummationOfParagraphs() &&
IsSolidDragging() == rOpt.IsSolidDragging() &&
IsSolidMarkHdl() == rOpt.IsSolidMarkHdl() &&
@@ -597,10 +599,12 @@ void SdOptionsMisc::GetPropNameArray( const char**& ppNames, sal_uLong& rCount )
"Display",
"PenColor",
- "PenWidth"
+ "PenWidth",
+
+ "Start/PresenterScreen"
};
- rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 27 : 16 );
+ rCount = ( ( GetConfigId() == SDCFG_IMPRESS ) ? 28 : 16 );
ppNames = aPropNames;
}
@@ -661,6 +665,9 @@ sal_Bool SdOptionsMisc::ReadData( const Any* pValues )
if( pValues[26].hasValue() )
SetPresentationPenWidth( getSafeValue< double >( pValues[ 26 ] ) );
+
+ if( pValues[27].hasValue() )
+ SetStartWithPresenterScreen( *(sal_Bool*) pValues[ 27 ].getValue() );
}
return sal_True;
@@ -707,6 +714,8 @@ sal_Bool SdOptionsMisc::WriteData( Any* pValues ) const
pValues[ 25 ] <<= GetPresentationPenColor();
pValues[ 26 ] <<= GetPresentationPenWidth();
+
+ pValues[ 27 ] <<= IsStartWithPresenterScreen();
}
return sal_True;
@@ -734,6 +743,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( sal_uInt16 _nWhich, SdOptions* pOpts, ::sd
{
maOptionsMisc.SetStartWithTemplate( pOpts->IsStartWithTemplate() );
maOptionsMisc.SetStartWithActualPage( pOpts->IsStartWithActualPage() );
+ maOptionsMisc.SetStartWithPresenterScreen( pOpts->IsStartWithPresenterScreen() );
maOptionsMisc.SetSummationOfParagraphs( pOpts->IsSummationOfParagraphs() );
// #90356#
maOptionsMisc.SetShowUndoDeleteWarning( pOpts->IsShowUndoDeleteWarning() );
@@ -823,6 +833,7 @@ void SdOptionsMiscItem::SetOptions( SdOptions* pOpts ) const
pOpts->SetDoubleClickTextEdit( maOptionsMisc.IsDoubleClickTextEdit() );
pOpts->SetClickChangeRotation( maOptionsMisc.IsClickChangeRotation() );
pOpts->SetStartWithActualPage( maOptionsMisc.IsStartWithActualPage() );
+ pOpts->SetStartWithPresenterScreen( maOptionsMisc.IsStartWithPresenterScreen() );
pOpts->SetSummationOfParagraphs( maOptionsMisc.IsSummationOfParagraphs() );
pOpts->SetSolidDragging( maOptionsMisc.IsSolidDragging() );
pOpts->SetSolidMarkHdl( maOptionsMisc.IsSolidMarkHdl() );
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 527fcb8a3724..002e177d36a2 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -261,6 +261,7 @@ SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs )
aMtrFldTabstop ( this, SdResId( MTR_FLD_TABSTOP ) ),
aCbxStartWithActualPage ( this, SdResId( CBX_START_WITH_ACTUAL_PAGE ) ),
+ aCbxStartWithPresenterScreen( this, SdResId( CBX_START_WITH_PRESENTER_SCREEN ) ),
aGrpStartWithActualPage ( this, SdResId( GRP_START_WITH_ACTUAL_PAGE ) ),
aTxtCompatibility ( this, SdResId( FT_COMPATIBILITY ) ),
aCbxUsePrinterMetrics ( this, SdResId( CB_USE_PRINTER_METRICS ) ),
@@ -427,6 +428,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
aCbxMasterPageCache.GetSavedValue() != aCbxMasterPageCache.IsChecked() ||
aCbxCopy.GetSavedValue() != aCbxCopy.IsChecked() ||
aCbxStartWithActualPage.GetSavedValue() != aCbxStartWithActualPage.IsChecked() ||
+ aCbxStartWithPresenterScreen.GetSavedValue() != aCbxStartWithPresenterScreen.IsChecked() ||
aCbxCompatibility.GetSavedValue() != aCbxCompatibility.IsChecked() ||
aCbxUsePrinterMetrics.GetSavedValue() != aCbxUsePrinterMetrics.IsChecked() )
{
@@ -440,6 +442,7 @@ sal_Bool SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
aOptsItem.GetOptionsMisc().SetMasterPagePaintCaching( aCbxMasterPageCache.IsChecked() );
aOptsItem.GetOptionsMisc().SetDragWithCopy( aCbxCopy.IsChecked() );
aOptsItem.GetOptionsMisc().SetStartWithActualPage( aCbxStartWithActualPage.IsChecked() );
+ aOptsItem.GetOptionsMisc().SetStartWithPresenterScreen( aCbxStartWithPresenterScreen.IsChecked() );
aOptsItem.GetOptionsMisc().SetSummationOfParagraphs( aCbxCompatibility.IsChecked() );
aOptsItem.GetOptionsMisc().SetPrinterIndependentLayout (
aCbxUsePrinterMetrics.IsChecked()
@@ -497,6 +500,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
aCbxMasterPageCache.Check( aOptsItem.GetOptionsMisc().IsMasterPagePaintCaching() );
aCbxCopy.Check( aOptsItem.GetOptionsMisc().IsDragWithCopy() );
aCbxStartWithActualPage.Check( aOptsItem.GetOptionsMisc().IsStartWithActualPage() );
+ aCbxStartWithPresenterScreen.Check( aOptsItem.GetOptionsMisc().IsStartWithPresenterScreen() );
aCbxCompatibility.Check( aOptsItem.GetOptionsMisc().IsSummationOfParagraphs() );
aCbxUsePrinterMetrics.Check( aOptsItem.GetOptionsMisc().GetPrinterIndependentLayout()==1 );
aCbxStartWithTemplate.SaveValue();
@@ -508,6 +512,7 @@ void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
aCbxMasterPageCache.SaveValue();
aCbxCopy.SaveValue();
aCbxStartWithActualPage.SaveValue();
+ aCbxStartWithPresenterScreen.SaveValue();
aCbxCompatibility.SaveValue();
aCbxUsePrinterMetrics.SaveValue();
@@ -634,6 +639,11 @@ void SdTpOptionsMisc::SetImpressMode (void)
lcl_MoveWin (aMtrFldTabstop, -nLineHeight);
lcl_MoveWin (aGrpStartWithActualPage, -nLineHeight);
lcl_MoveWin (aCbxStartWithActualPage, -nLineHeight);
+
+ lcl_MoveWin (aCbxStartWithPresenterScreen,
+ nDialogWidth/2 - aCbxStartWithPresenterScreen.GetPosPixel().X(),
+ -nLineHeight);
+
lcl_MoveWin (aTxtCompatibility, -nLineHeight);
// Move the printer-independent-metrics check box up two lines to change
@@ -646,6 +656,7 @@ void SdTpOptionsMisc::SetDrawMode()
aCbxStartWithTemplate.Hide();
aGrpProgramStart.Hide();
aCbxStartWithActualPage.Hide();
+ aCbxStartWithPresenterScreen.Hide();
aCbxCompatibility.Hide();
aGrpStartWithActualPage.Hide();
aCbxCrookNoContortion.Show();
diff --git a/sd/source/ui/dlg/tpoption.src b/sd/source/ui/dlg/tpoption.src
index b814f0dcfbca..090c3be119d9 100644
--- a/sd/source/ui/dlg/tpoption.src
+++ b/sd/source/ui/dlg/tpoption.src
@@ -203,10 +203,18 @@ TabPage TP_OPTIONS_MISC
{
HelpID = "sd:CheckBox:TP_OPTIONS_MISC:CBX_START_WITH_ACTUAL_PAGE";
Pos = MAP_APPFONT ( 12 , 145 ) ;
- Size = MAP_APPFONT ( 242 , 10 ) ;
+ Size = MAP_APPFONT ( 116 , 10 ) ;
TabStop = TRUE ;
Text [ en-US ] = "Always with current page" ;
};
+ CheckBox CBX_START_WITH_PRESENTER_SCREEN
+ {
+ HelpID = "sd:CheckBox:TP_OPTIONS_MISC:CBX_START_WITH_PRESENTER_SCREEN";
+ Pos = MAP_APPFONT ( 12 , 145 ) ;
+ Size = MAP_APPFONT ( 116 , 10 ) ;
+ TabStop = TRUE ;
+ Text [ en-US ] = "With Presenter Screen" ;
+ };
FixedLine FT_COMPATIBILITY
{
Pos = MAP_APPFONT ( 6 , 160 ) ;
diff --git a/sd/source/ui/inc/optsitem.hxx b/sd/source/ui/inc/optsitem.hxx
index 704aabc4a119..1348c89ab0aa 100644
--- a/sd/source/ui/inc/optsitem.hxx
+++ b/sd/source/ui/inc/optsitem.hxx
@@ -260,6 +260,7 @@ private:
sal_Bool bDoubleClickTextEdit : 1; // Misc/DclickTextedit
sal_Bool bClickChangeRotation : 1; // Misc/RotateClick
sal_Bool bStartWithActualPage : 1; // Misc/Start/CurrentPage
+ sal_Bool bStartWithPresenterScreen : 1; // Misc/Start/PresenterScreen
sal_Bool bSolidDragging : 1; // Misc/ModifyWithAttributes
sal_Bool bSolidMarkHdl : 1; // /Misc/SimpleHandles
sal_Bool bSummationOfParagraphs : 1; // misc/SummationOfParagraphs
@@ -311,6 +312,7 @@ public:
sal_Bool IsDoubleClickTextEdit() const { Init(); return (sal_Bool) bDoubleClickTextEdit; }
sal_Bool IsClickChangeRotation() const { Init(); return (sal_Bool) bClickChangeRotation; }
sal_Bool IsStartWithActualPage() const { Init(); return (sal_Bool) bStartWithActualPage; }
+ sal_Bool IsStartWithPresenterScreen() const { Init(); return (sal_Bool) bStartWithPresenterScreen; }
sal_Bool IsSolidDragging() const { Init(); return (sal_Bool) bSolidDragging; }
sal_Bool IsSolidMarkHdl() const { Init(); return (sal_Bool) bSolidMarkHdl; }
sal_Bool IsSummationOfParagraphs() const { Init(); return bSummationOfParagraphs != 0; };
@@ -353,6 +355,7 @@ public:
void SetDoubleClickTextEdit( sal_Bool bOn = sal_True ) { if( bDoubleClickTextEdit != bOn ) { OptionsChanged(); bDoubleClickTextEdit = bOn; } }
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 SetStartWithPresenterScreen( sal_Bool bOn = sal_True ) { if( bStartWithPresenterScreen != bOn ) { OptionsChanged(); bStartWithPresenterScreen = 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 dd0bff091273..de863976b7cf 100644
--- a/sd/source/ui/inc/tpoption.hrc
+++ b/sd/source/ui/inc/tpoption.hrc
@@ -89,3 +89,5 @@
#define FT_SCALE 39
#define CB_USE_PRINTER_METRICS 40
+
+#define CBX_START_WITH_PRESENTER_SCREEN 41
diff --git a/sd/source/ui/inc/tpoption.hxx b/sd/source/ui/inc/tpoption.hxx
index 47f7de97b633..2be900b0571e 100644
--- a/sd/source/ui/inc/tpoption.hxx
+++ b/sd/source/ui/inc/tpoption.hxx
@@ -117,6 +117,7 @@ private:
MetricField aMtrFldTabstop;
CheckBox aCbxStartWithActualPage;
+ CheckBox aCbxStartWithPresenterScreen;
FixedLine aGrpStartWithActualPage;
FixedLine aTxtCompatibility;
CheckBox aCbxUsePrinterMetrics;
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index d4f13d76f289..99fa57b52f5d 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -60,6 +60,25 @@ using ::rtl::OUString;
namespace sdext { namespace presenter {
namespace {
+
+ static sal_Bool lcl_IsPresenterEnabled(
+ const css::uno::Reference< css::uno::XComponentContext > &rxContext )
+ {
+ sal_Bool bEnabled( sal_True );
+ PresenterConfigurationAccess aConfig(
+ rxContext,
+ A2S( "/org.openoffice.Office.Impress" ),
+ PresenterConfigurationAccess::READ_ONLY );
+ if ( aConfig.IsValid() )
+ {
+ sal_Bool bVal( sal_False );
+ if ( ( aConfig.GetConfigurationNode(
+ A2S( "Misc/Start/PresenterScreen" )) >>= bVal ) )
+ bEnabled = bVal;
+ }
+ return bEnabled;
+ }
+
typedef ::cppu::WeakComponentImplHelper1 <
css::document::XEventListener
> PresenterScreenListenerInterfaceBase;
@@ -168,7 +187,7 @@ Any SAL_CALL PresenterScreenJob::execute(
const beans::NamedValue* p = Arguments.getConstArray();
for (i=0; i<c; ++i)
{
- if (p[i].Name.equalsAscii("Environment"))
+ if (p[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Environment")))
{
p[i].Value >>= lEnv;
break;
@@ -180,7 +199,7 @@ Any SAL_CALL PresenterScreenJob::execute(
p = lEnv.getConstArray();
for (i=0; i<c; ++i)
{
- if (p[i].Name.equalsAscii("Model"))
+ if (p[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Model")))
{
p[i].Value >>= xModel;
break;
@@ -188,14 +207,15 @@ Any SAL_CALL PresenterScreenJob::execute(
}
Reference< XServiceInfo > xInfo( xModel, UNO_QUERY );
- if( xInfo.is() && xInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) ) )
- {
- // Create a new listener that waits for the full screen presentation
- // to start and to end. It takes care of its own lifetime.
- ::rtl::Reference<PresenterScreenListener> pListener (
- new PresenterScreenListener(mxComponentContext, xModel));
- pListener->Initialize();
- }
+ if( !xInfo.is() || !xInfo->supportsService(
+ A2S( "com.sun.star.presentation.PresentationDocument" ) ) )
+ return Any();
+
+ // Create a new listener that waits for the full screen presentation
+ // to start and to end. It takes care of its own lifetime.
+ ::rtl::Reference<PresenterScreenListener> pListener (
+ new PresenterScreenListener(mxComponentContext, xModel));
+ pListener->Initialize();
return Any();
}
@@ -304,8 +324,7 @@ void PresenterScreenListener::ThrowIfDisposed (void) const throw (
if (rBHelper.bDisposed || rBHelper.bInDispose)
{
throw lang::DisposedException (
- OUString(RTL_CONSTASCII_USTRINGPARAM(
- "PresenterScreenListener object has already been disposed")),
+ A2S("PresenterScreenListener object has already been disposed"),
const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this)));
}
}
@@ -388,6 +407,11 @@ void PresenterScreen::InitializePresenterScreen (void)
try
{
Reference<XComponentContext> xContext (mxContextWeak);
+
+ // Check if disabled by configuration
+ if (!lcl_IsPresenterEnabled(xContext) )
+ return;
+
mpPaneContainer =
new PresenterPaneContainer(Reference<XComponentContext>(xContext));
@@ -541,11 +565,11 @@ sal_Int32 PresenterScreen::GetScreenNumber (
// is set.
PresenterConfigurationAccess aConfiguration (
xContext,
- OUString::createFromAscii("/org.openoffice.Office.PresenterScreen/"),
+ A2S("/org.openoffice.Office.PresenterScreen/"),
PresenterConfigurationAccess::READ_ONLY);
bool bStartAlways (false);
if (aConfiguration.GetConfigurationNode(
- OUString::createFromAscii("Presenter/StartAlways")) >>= bStartAlways)
+ A2S("Presenter/StartAlways")) >>= bStartAlways)
{
if (bStartAlways)
return nScreenNumber;
@@ -704,13 +728,13 @@ void PresenterScreen::SetupConfiguration (
{
PresenterConfigurationAccess aConfiguration (
rxContext,
- OUString::createFromAscii("org.openoffice.Office.PresenterScreen"),
+ A2S("org.openoffice.Office.PresenterScreen"),
PresenterConfigurationAccess::READ_ONLY);
maViewDescriptors.clear();
ProcessViewDescriptions(aConfiguration);
- OUString sLayoutName (OUString::createFromAscii("DefaultLayout"));
+ OUString sLayoutName (RTL_CONSTASCII_USTRINGPARAM("DefaultLayout"));
aConfiguration.GetConfigurationNode(
- OUString::createFromAscii("Presenter/CurrentLayout")) >>= sLayoutName;
+ A2S("Presenter/CurrentLayout")) >>= sLayoutName;
ProcessLayout(aConfiguration, sLayoutName, rxContext, rxAnchorId);
}
catch (RuntimeException&)
@@ -731,14 +755,14 @@ void PresenterScreen::ProcessLayout (
{
Reference<container::XHierarchicalNameAccess> xLayoutNode (
rConfiguration.GetConfigurationNode(
- OUString::createFromAscii("Presenter/Layouts/")+rsLayoutName),
+ A2S("Presenter/Layouts/") + rsLayoutName),
UNO_QUERY_THROW);
// Read the parent layout first, if one is referenced.
OUString sParentLayout;
rConfiguration.GetConfigurationNode(
xLayoutNode,
- OUString::createFromAscii("ParentLayout")) >>= sParentLayout;
+ A2S("ParentLayout")) >>= sParentLayout;
if (sParentLayout.getLength() > 0)
{
// Prevent infinite recursion.
@@ -750,16 +774,16 @@ void PresenterScreen::ProcessLayout (
Reference<container::XNameAccess> xList (
rConfiguration.GetConfigurationNode(
xLayoutNode,
- OUString::createFromAscii("Layout")),
+ A2S("Layout")),
UNO_QUERY_THROW);
::std::vector<rtl::OUString> aProperties (6);
- aProperties[0] = OUString::createFromAscii("PaneURL");
- aProperties[1] = OUString::createFromAscii("ViewURL");
- aProperties[2] = OUString::createFromAscii("RelativeX");
- aProperties[3] = OUString::createFromAscii("RelativeY");
- aProperties[4] = OUString::createFromAscii("RelativeWidth");
- aProperties[5] = OUString::createFromAscii("RelativeHeight");
+ aProperties[0] = A2S("PaneURL");
+ aProperties[1] = A2S("ViewURL");
+ aProperties[2] = A2S("RelativeX");
+ aProperties[3] = A2S("RelativeY");
+ aProperties[4] = A2S("RelativeWidth");
+ aProperties[5] = A2S("RelativeHeight");
mnComponentIndex = 1;
PresenterConfigurationAccess::ForAll(
xList,
@@ -788,10 +812,10 @@ void PresenterScreen::ProcessViewDescriptions (
UNO_QUERY_THROW);
::std::vector<rtl::OUString> aProperties (4);
- aProperties[0] = OUString::createFromAscii("ViewURL");
- aProperties[1] = OUString::createFromAscii("Title");
- aProperties[2] = OUString::createFromAscii("AccessibleTitle");
- aProperties[3] = OUString::createFromAscii("IsOpaque");
+ aProperties[0] = A2S("ViewURL");
+ aProperties[1] = A2S("Title");
+ aProperties[2] = A2S("AccessibleTitle");
+ aProperties[3] = A2S("IsOpaque");
mnComponentIndex = 1;
PresenterConfigurationAccess::ForAll(
xViewDescriptionsNode,