summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorChristian Lippka <cl@openoffice.org>2010-04-01 11:00:20 +0200
committerChristian Lippka <cl@openoffice.org>2010-04-01 11:00:20 +0200
commit646895d3ee78647feb51582e3cdea75d01960cd5 (patch)
treed67590818dbd11b1f4727dc7ab8cef0f719338b0 /sd
parent851fa3b48ac78b8b50e2ecc110d30ed2a3e8dfbd (diff)
enalbe assign slide layout dropdown for notes and handout view
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/controller/slidelayoutcontroller.cxx98
-rw-r--r--sd/source/ui/inc/DrawController.hxx3
-rw-r--r--sd/source/ui/inc/DrawSubController.hxx23
-rw-r--r--sd/source/ui/inc/SdUnoDrawView.hxx7
-rw-r--r--sd/source/ui/inc/SdUnoOutlineView.hxx5
-rw-r--r--sd/source/ui/inc/SdUnoPresView.hxx54
-rw-r--r--sd/source/ui/inc/SdUnoSlideView.hxx5
-rw-r--r--sd/source/ui/unoidl/DrawController.cxx6
-rw-r--r--sd/source/ui/unoidl/SdUnoDrawView.cxx41
-rw-r--r--sd/source/ui/unoidl/SdUnoOutlineView.cxx20
-rw-r--r--sd/source/ui/unoidl/SdUnoPresView.cxx54
-rw-r--r--sd/source/ui/unoidl/SdUnoSlideView.cxx27
-rw-r--r--sd/source/ui/unoidl/makefile.mk1
-rw-r--r--sd/source/ui/view/ViewShellImplementation.cxx17
14 files changed, 219 insertions, 142 deletions
diff --git a/sd/source/ui/controller/slidelayoutcontroller.cxx b/sd/source/ui/controller/slidelayoutcontroller.cxx
index ade37086827c..1c2815087c98 100644
--- a/sd/source/ui/controller/slidelayoutcontroller.cxx
+++ b/sd/source/ui/controller/slidelayoutcontroller.cxx
@@ -33,6 +33,8 @@
#include <com/sun/star/frame/status/FontHeight.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/drawing/DrawViewMode.hpp>
#include <memory>
#include <boost/scoped_ptr.hpp>
@@ -68,6 +70,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::frame;
+using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::beans;
namespace sd
@@ -104,6 +107,31 @@ struct snewfoil_value_info
WritingMode meWritingMode;
AutoLayout maAutoLayout;
};
+
+static snewfoil_value_info notes[] =
+{
+ {BMP_FOILN_01, BMP_FOILN_01_H, STR_AUTOLAYOUT_NOTES, WritingMode_LR_TB,
+ AUTOLAYOUT_NOTES},
+ {0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+};
+
+static snewfoil_value_info handout[] =
+{
+ {BMP_FOILH_01, BMP_FOILH_01_H, STR_AUTOLAYOUT_HANDOUT1, WritingMode_LR_TB,
+ AUTOLAYOUT_HANDOUT1},
+ {BMP_FOILH_02, BMP_FOILH_02_H, STR_AUTOLAYOUT_HANDOUT2, WritingMode_LR_TB,
+ AUTOLAYOUT_HANDOUT2},
+ {BMP_FOILH_03, BMP_FOILH_03_H, STR_AUTOLAYOUT_HANDOUT3, WritingMode_LR_TB,
+ AUTOLAYOUT_HANDOUT3},
+ {BMP_FOILH_04, BMP_FOILH_04_H, STR_AUTOLAYOUT_HANDOUT4, WritingMode_LR_TB,
+ AUTOLAYOUT_HANDOUT4},
+ {BMP_FOILH_06, BMP_FOILH_06_H, STR_AUTOLAYOUT_HANDOUT6, WritingMode_LR_TB,
+ AUTOLAYOUT_HANDOUT6},
+ {BMP_FOILH_09, BMP_FOILH_09_H, STR_AUTOLAYOUT_HANDOUT9, WritingMode_LR_TB,
+ AUTOLAYOUT_HANDOUT9},
+ {0, 0, 0, WritingMode_LR_TB, AUTOLAYOUT_NONE},
+};
+
static snewfoil_value_info standard[] =
{
{BMP_LAYOUT_EMPTY, BMP_LAYOUT_EMPTY_H, STR_AUTOLAYOUT_NONE, WritingMode_LR_TB, AUTOLAYOUT_NONE},
@@ -161,6 +189,20 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
, mpLayoutSet1( 0 )
, mpLayoutSet2( 0 )
{
+ DrawViewMode eMode = DrawViewMode_DRAW;
+
+ // find out which view is running
+ if( xFrame.is() ) try
+ {
+ Reference< XPropertySet > xControllerSet( xFrame->getController(), UNO_QUERY_THROW );
+ xControllerSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DrawViewMode" ) ) ) >>= eMode;
+ }
+ catch( Exception& e )
+ {
+ (void)e;
+ OSL_ASSERT(false);
+ }
+
const sal_Int32 LAYOUT_BORDER_PIX = 7;
String aTitle1( SdResId( STR_GLUE_ESCDIR_HORZ ) );
@@ -174,21 +216,30 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
mpLayoutSet1 = createEmptyValueSetControl();
mpLayoutSet1->SetSelectHdl( LINK( this, LayoutToolbarMenu, SelectHdl ) );
- mpLayoutSet1->SetColCount( 4 );
- fillLayoutValueSet( mpLayoutSet1, &standard[0], bHighContrast );
+ snewfoil_value_info* pInfo = 0;
+ sal_Int16 nColCount = 4;
+ switch( eMode )
+ {
+ case DrawViewMode_DRAW: pInfo = &standard[0]; break;
+ case DrawViewMode_HANDOUT: pInfo = &handout[0]; nColCount = 2; break;
+ case DrawViewMode_NOTES: pInfo = &notes[0]; nColCount = 1; break;
+ }
+
+ mpLayoutSet1->SetColCount( nColCount );
+
+ fillLayoutValueSet( mpLayoutSet1, pInfo, bHighContrast );
Size aSize( mpLayoutSet1->GetOutputSizePixel() );
aSize.Width() += (mpLayoutSet1->GetColCount() + 1) * LAYOUT_BORDER_PIX;
aSize.Height() += (mpLayoutSet1->GetLineCount() +1) * LAYOUT_BORDER_PIX;
mpLayoutSet1->SetOutputSizePixel( aSize );
-
- if( bVerticalEnabled )
+ if( bVerticalEnabled && (eMode == DrawViewMode_DRAW) )
appendEntry( -1, aTitle1 );
appendEntry( 0, mpLayoutSet1 );
- if( bVerticalEnabled )
+ if( bVerticalEnabled && (eMode == DrawViewMode_DRAW) )
{
mpLayoutSet2 = new ValueSet( this, WB_TABSTOP | WB_MENUSTYLEVALUESET | WB_FLATVALUESET | WB_NOBORDER | WB_NO_DIRECTSELECT );
// mpLayoutSet2->SetHelpId( HID_VALUESET_EXTRUSION_LIGHTING );
@@ -209,24 +260,27 @@ LayoutToolbarMenu::LayoutToolbarMenu( SlideLayoutController& rController, const
appendEntry( 1, mpLayoutSet2 );
}
- appendSeparator();
-
- OUString sSlotStr;
- Image aSlotImage;
- if( mxFrame.is() )
+ if( eMode == DrawViewMode_DRAW )
{
- if( bInsertPage )
- sSlotStr = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DuplicatePage" ) );
- else
- sSlotStr = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Undo" ) );
- aSlotImage = ::GetImage( mxFrame, sSlotStr, FALSE, FALSE );
-
- String sSlotTitle;
- if( bInsertPage )
- sSlotTitle = ImplRetrieveLabelFromCommand( mxFrame, sSlotStr );
- else
- sSlotTitle = String( SdResId( STR_RESET_LAYOUT ) );
- appendEntry( 2, sSlotTitle, aSlotImage);
+ appendSeparator();
+
+ OUString sSlotStr;
+ Image aSlotImage;
+ if( mxFrame.is() )
+ {
+ if( bInsertPage )
+ sSlotStr = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:DuplicatePage" ) );
+ else
+ sSlotStr = OUString( RTL_CONSTASCII_USTRINGPARAM( ".uno:Undo" ) );
+ aSlotImage = ::GetImage( mxFrame, sSlotStr, FALSE, FALSE );
+
+ String sSlotTitle;
+ if( bInsertPage )
+ sSlotTitle = ImplRetrieveLabelFromCommand( mxFrame, sSlotStr );
+ else
+ sSlotTitle = String( SdResId( STR_RESET_LAYOUT ) );
+ appendEntry( 2, sSlotTitle, aSlotImage);
+ }
}
SetOutputSizePixel( getMenuSize() );
diff --git a/sd/source/ui/inc/DrawController.hxx b/sd/source/ui/inc/DrawController.hxx
index 5afda083abbc..d2f56501f492 100644
--- a/sd/source/ui/inc/DrawController.hxx
+++ b/sd/source/ui/inc/DrawController.hxx
@@ -104,7 +104,8 @@ public:
PROPERTY_ACTIVE_LAYER = 5,
PROPERTY_ZOOMTYPE = 6,
PROPERTY_ZOOMVALUE = 7,
- PROPERTY_VIEWOFFSET = 8
+ PROPERTY_VIEWOFFSET = 8,
+ PROPERTY_DRAWVIEWMODE = 9
};
/** Create a new DrawController object for the given ViewShellBase.
diff --git a/sd/source/ui/inc/DrawSubController.hxx b/sd/source/ui/inc/DrawSubController.hxx
index 11816fa45902..3b02d74d05c0 100644
--- a/sd/source/ui/inc/DrawSubController.hxx
+++ b/sd/source/ui/inc/DrawSubController.hxx
@@ -29,12 +29,27 @@
#define SD_DRAW_SUB_CONTROLLER_HXX
#include <com/sun/star/drawing/XDrawSubController.hpp>
-#include <cppuhelper/compbase1.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/compbase2.hxx>
namespace {
- typedef ::cppu::WeakComponentImplHelper1 <
- ::com::sun::star::drawing::XDrawSubController
- > DrawSubControllerInterfaceBase;
+
+ class DrawSubControllerInterfaceBase : public ::cppu::WeakComponentImplHelper2<
+ ::com::sun::star::drawing::XDrawSubController,
+ ::com::sun::star::lang::XServiceInfo >
+ {
+ public:
+ DrawSubControllerInterfaceBase( ::osl::Mutex& aMutex )
+ : ::cppu::WeakComponentImplHelper2<
+ ::com::sun::star::drawing::XDrawSubController,
+ ::com::sun::star::lang::XServiceInfo >( aMutex ) {}
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException) = 0;
+ };
+
}
diff --git a/sd/source/ui/inc/SdUnoDrawView.hxx b/sd/source/ui/inc/SdUnoDrawView.hxx
index afd03acd256f..d29ca3b09d32 100644
--- a/sd/source/ui/inc/SdUnoDrawView.hxx
+++ b/sd/source/ui/inc/SdUnoDrawView.hxx
@@ -106,6 +106,11 @@ public:
css::lang::WrappedTargetException,
css::uno::RuntimeException);
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
protected:
sal_Bool getMasterPageMode(void) const throw();
void setMasterPageMode(sal_Bool MasterPageMode_) throw();
@@ -133,6 +138,8 @@ protected:
void SetZoomType( sal_Int16 nType );
+ ::com::sun::star::uno::Any getDrawViewMode() const;
+
private:
DrawController& mrController;
DrawViewShell& mrDrawViewShell;
diff --git a/sd/source/ui/inc/SdUnoOutlineView.hxx b/sd/source/ui/inc/SdUnoOutlineView.hxx
index a8c97b2e2610..d2a4d4bfd39d 100644
--- a/sd/source/ui/inc/SdUnoOutlineView.hxx
+++ b/sd/source/ui/inc/SdUnoOutlineView.hxx
@@ -111,6 +111,11 @@ public:
disposing (const ::com::sun::star::lang::EventObject& rEventObject)
throw (::com::sun::star::uno::RuntimeException);
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
private:
DrawController& mrController;
OutlineViewShell& mrOutlineViewShell;
diff --git a/sd/source/ui/inc/SdUnoPresView.hxx b/sd/source/ui/inc/SdUnoPresView.hxx
deleted file mode 100644
index 8edf171f60cc..000000000000
--- a/sd/source/ui/inc/SdUnoPresView.hxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef SD_UNO_PRES_VIEW_HXX
-#define SD_UNO_PRES_VIEW_HXX
-
-#include "SdUnoDrawView.hxx"
-
-namespace sd {
-
-/** The sub controller for the slide show (or preview?) It formerly reduced
- the property set inherited from SdUnoDrawView to just 'CurrentPage'.
- Now that we have to always support the whole set, we can as well try to
- do that as best as we can. Therefore the inherited functionality is
- provided as is.
-*/
-class SdUnoPresView
- : public SdUnoDrawView
-{
-public:
- SdUnoPresView (
- DrawController& rController,
- DrawViewShell& rViewShell,
- View& rView) throw();
- virtual ~SdUnoPresView (void) throw();
-};
-
-} // end of namespace sd
-
-#endif
diff --git a/sd/source/ui/inc/SdUnoSlideView.hxx b/sd/source/ui/inc/SdUnoSlideView.hxx
index e468d416bf56..6005704ec895 100644
--- a/sd/source/ui/inc/SdUnoSlideView.hxx
+++ b/sd/source/ui/inc/SdUnoSlideView.hxx
@@ -109,6 +109,11 @@ public:
css::lang::WrappedTargetException,
css::uno::RuntimeException);
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException);
+
private:
DrawController& mrController;
slidesorter::SlideSorter& mrSlideSorter;
diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx
index acd57f18d85c..230feabe956a 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -699,6 +699,11 @@ void DrawController::FillPropertyTable (
PROPERTY_VIEWOFFSET,
::getCppuType((const ::com::sun::star::awt::Point*)0),
beans::PropertyAttribute::BOUND ));
+ rProperties.push_back(
+ beans::Property( OUString( RTL_CONSTASCII_USTRINGPARAM("DrawViewMode") ),
+ PROPERTY_DRAWVIEWMODE,
+ ::getCppuType((const ::com::sun::star::awt::Point*)0),
+ beans::PropertyAttribute::BOUND|beans::PropertyAttribute::READONLY|beans::PropertyAttribute::MAYBEVOID ));
}
@@ -928,3 +933,4 @@ void DrawController::ThrowIfDisposed (void) const
} // end of namespace sd
+
diff --git a/sd/source/ui/unoidl/SdUnoDrawView.cxx b/sd/source/ui/unoidl/SdUnoDrawView.cxx
index 5a497231158d..8594d4e0ebf9 100644
--- a/sd/source/ui/unoidl/SdUnoDrawView.cxx
+++ b/sd/source/ui/unoidl/SdUnoDrawView.cxx
@@ -38,21 +38,27 @@
#include "unomodel.hxx"
#include "unopage.hxx"
#include "Window.hxx"
+#include "pres.hxx"
#include <cppuhelper/proptypehlp.hxx>
+#include <comphelper/serviceinfohelper.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/viewfrm.hxx>
#include <svx/svdpagv.hxx>
#include <svx/unoshape.hxx>
#include <svx/unoshcol.hxx>
#include <svx/zoomitem.hxx>
+#include <com/sun/star/drawing/DrawViewMode.hpp>
#include <com/sun/star/drawing/XLayerManager.hpp>
#include <com/sun/star/view/DocumentZoomType.hpp>
#include <vector>
+using rtl::OUString;
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::drawing;
namespace sd {
@@ -416,7 +422,6 @@ void SdUnoDrawView::setFastPropertyValue (
SetViewOffset( aOffset );
}
break;
-
default:
throw beans::UnknownPropertyException();
}
@@ -460,6 +465,10 @@ Any SAL_CALL SdUnoDrawView::getFastPropertyValue (
aValue <<= GetViewOffset();
break;
+ case DrawController::PROPERTY_DRAWVIEWMODE:
+ aValue = getDrawViewMode();
+ break;
+
default:
throw beans::UnknownPropertyException();
}
@@ -601,5 +610,35 @@ SdXImpressDocument* SdUnoDrawView::GetModel (void) const throw()
return NULL;
}
+Any SdUnoDrawView::getDrawViewMode() const
+{
+ Any aRet;
+ switch( mrDrawViewShell.GetPageKind() )
+ {
+ case PK_NOTES: aRet <<= DrawViewMode_NOTES; break;
+ case PK_HANDOUT: aRet <<= DrawViewMode_HANDOUT; break;
+ case PK_STANDARD: aRet <<= DrawViewMode_DRAW; break;
+ }
+ return aRet;
+}
+
+// XServiceInfo
+OUString SAL_CALL SdUnoDrawView::getImplementationName( ) throw (RuntimeException)
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sd.SdUnoDrawView") );
+}
+
+sal_Bool SAL_CALL SdUnoDrawView::supportsService( const OUString& ServiceName ) throw (RuntimeException)
+{
+ return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
+}
+
+Sequence< OUString > SAL_CALL SdUnoDrawView::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ OUString aSN( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocumentDrawView") );
+ uno::Sequence< OUString > aSeq( &aSN, 1 );
+ return aSeq;
+}
} // end of namespace sd
+
diff --git a/sd/source/ui/unoidl/SdUnoOutlineView.cxx b/sd/source/ui/unoidl/SdUnoOutlineView.cxx
index 5804765d633c..ff3e5dd501fb 100644
--- a/sd/source/ui/unoidl/SdUnoOutlineView.cxx
+++ b/sd/source/ui/unoidl/SdUnoOutlineView.cxx
@@ -28,6 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sd.hxx"
+#include <comphelper/serviceinfohelper.hxx>
+
#include "SdUnoOutlineView.hxx"
#include "DrawController.hxx"
@@ -237,6 +239,8 @@ Any SAL_CALL SdUnoOutlineView::getFastPropertyValue (
aValue <<= pPage->getUnoPage();
}
break;
+ case DrawController::PROPERTY_VIEWOFFSET:
+ break;
default:
throw beans::UnknownPropertyException();
@@ -246,6 +250,22 @@ Any SAL_CALL SdUnoOutlineView::getFastPropertyValue (
}
+// XServiceInfo
+OUString SAL_CALL SdUnoOutlineView::getImplementationName( ) throw (RuntimeException)
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sd.SdUnoOutlineView") );
+}
+sal_Bool SAL_CALL SdUnoOutlineView::supportsService( const OUString& ServiceName ) throw (RuntimeException)
+{
+ return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
+}
+
+Sequence< OUString > SAL_CALL SdUnoOutlineView::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ OUString aSN( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.OutlineView") );
+ uno::Sequence< OUString > aSeq( &aSN, 1 );
+ return aSeq;
+}
} // end of namespace sd
diff --git a/sd/source/ui/unoidl/SdUnoPresView.cxx b/sd/source/ui/unoidl/SdUnoPresView.cxx
deleted file mode 100644
index dcd5001ace38..000000000000
--- a/sd/source/ui/unoidl/SdUnoPresView.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_sd.hxx"
-
-#include "SdUnoPresView.hxx"
-
-
-namespace sd {
-
-
-SdUnoPresView::SdUnoPresView (
- DrawController& rController,
- DrawViewShell& rViewShell,
- View& rView) throw()
- : SdUnoDrawView (rController, rViewShell, rView)
-{
-}
-
-
-
-
-SdUnoPresView::~SdUnoPresView (void) throw()
-{
-}
-
-
-
-} // end of namespace sd
diff --git a/sd/source/ui/unoidl/SdUnoSlideView.cxx b/sd/source/ui/unoidl/SdUnoSlideView.cxx
index 34121dc5ac4b..a6502711ee72 100644
--- a/sd/source/ui/unoidl/SdUnoSlideView.cxx
+++ b/sd/source/ui/unoidl/SdUnoSlideView.cxx
@@ -27,6 +27,9 @@
#include "precompiled_sd.hxx"
+#include <comphelper/serviceinfohelper.hxx>
+
+#include "DrawController.hxx"
#include "SdUnoSlideView.hxx"
#include "SlideSorter.hxx"
@@ -39,6 +42,8 @@
#include "sdpage.hxx"
#include <com/sun/star/beans/XPropertySet.hpp>
+using ::rtl::OUString;
+
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -202,10 +207,30 @@ Any SAL_CALL SdUnoSlideView::getFastPropertyValue (
{
(void)nHandle;
- throw beans::UnknownPropertyException();
+ if( nHandle != DrawController::PROPERTY_VIEWOFFSET )
+ throw beans::UnknownPropertyException();
+
+ return Any();
+}
+
+
+// XServiceInfo
+OUString SAL_CALL SdUnoSlideView::getImplementationName( ) throw (RuntimeException)
+{
+ return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.sd.SdUnoSlideView") );
}
+sal_Bool SAL_CALL SdUnoSlideView::supportsService( const OUString& ServiceName ) throw (RuntimeException)
+{
+ return comphelper::ServiceInfoHelper::supportsService( ServiceName, getSupportedServiceNames() );
+}
+Sequence< OUString > SAL_CALL SdUnoSlideView::getSupportedServiceNames( ) throw (RuntimeException)
+{
+ OUString aSN( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.SlidesView") );
+ uno::Sequence< OUString > aSeq( &aSN, 1 );
+ return aSeq;
+}
/*
diff --git a/sd/source/ui/unoidl/makefile.mk b/sd/source/ui/unoidl/makefile.mk
index b3e71df86740..66d80e1a529a 100644
--- a/sd/source/ui/unoidl/makefile.mk
+++ b/sd/source/ui/unoidl/makefile.mk
@@ -50,7 +50,6 @@ NOOPTFILES= $(SLO)$/unowcntr.obj
SLO1FILES = \
$(SLO)$/DrawController.obj \
- $(SLO)$/SdUnoPresView.obj\
$(SLO)$/SdUnoSlideView.obj\
$(SLO)$/SdUnoOutlineView.obj\
$(SLO)$/SdUnoDrawView.obj \
diff --git a/sd/source/ui/view/ViewShellImplementation.cxx b/sd/source/ui/view/ViewShellImplementation.cxx
index 6f4460cb5b47..a5975b9f6ffa 100644
--- a/sd/source/ui/view/ViewShellImplementation.cxx
+++ b/sd/source/ui/view/ViewShellImplementation.cxx
@@ -324,12 +324,14 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP
const SfxUInt32Item* pWhatPage = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATPAGE, FALSE, TYPE(SfxUInt32Item) ) );
const SfxUInt32Item* pWhatLayout = static_cast< const SfxUInt32Item* > ( rRequest.GetArg( ID_VAL_WHATLAYOUT, FALSE, TYPE(SfxUInt32Item) ) );
+ SdDrawDocument* pDocument = mrViewShell.GetDoc();
+ if( !pDocument )
+ return;
+
SdPage* pPage = 0;
if( pWhatPage )
{
- SdDrawDocument* pDocument = mrViewShell.GetDoc();
- if( pDocument )
- pPage = pDocument->GetSdPage(static_cast<USHORT>(pWhatPage->GetValue()), ePageKind);
+ pPage = pDocument->GetSdPage(static_cast<USHORT>(pWhatPage->GetValue()), ePageKind);
}
if( pPage == 0 )
@@ -347,7 +349,14 @@ void ViewShell::Implementation::AssignLayout ( SfxRequest& rRequest, PageKind eP
SdrLayerAdmin& rLayerAdmin (mrViewShell.GetViewShellBase().GetDocument()->GetLayerAdmin());
BYTE aBackground (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRND)), FALSE));
BYTE aBackgroundObject (rLayerAdmin.GetLayerID(String(SdResId(STR_LAYER_BCKGRNDOBJ)), FALSE));
- SetOfByte aVisibleLayers (pPage->TRG_GetMasterPageVisibleLayers());
+
+ SetOfByte aVisibleLayers;
+
+ if( pPage->GetPageKind() == PK_HANDOUT )
+ aVisibleLayers.SetAll();
+ else
+ pPage->TRG_GetMasterPageVisibleLayers();
+
SfxRequest aRequest (mrViewShell.GetViewShellBase().GetViewFrame(), SID_MODIFYPAGE);
aRequest.AppendItem(SfxStringItem (ID_VAL_PAGENAME, pPage->GetName()));
aRequest.AppendItem(SfxUInt32Item (ID_VAL_WHATLAYOUT, eLayout));