1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: UnoDocumentSettings.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/beans/XPropertySet.hpp>
37 #include <com/sun/star/beans/XMultiPropertySet.hpp>
38 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
39 #include <cppuhelper/implbase3.hxx>
40 #include <comphelper/propertysethelper.hxx>
41 #include <comphelper/propertysetinfo.hxx>
42 #include <tools/urlobj.hxx>
43 #include <svx/xtable.hxx>
44 #include <osl/diagnose.h>
45 #include <osl/mutex.hxx>
46 #include <vos/mutex.hxx>
47 #include <vcl/svapp.hxx>
49 #include "drawdoc.hxx"
51 #ifndef SD_DRAW_DOC_SHELL_HXX
52 #include "DrawDocShell.hxx"
55 #include "unomodel.hxx"
58 #ifndef _SD_OPTSITEM_HXX
59 #include "optsitem.hxx"
61 #include <sfx2/printer.hxx>
64 #include "../inc/ViewShell.hxx"
65 #include "../inc/FrameView.hxx"
67 #ifndef SD_OUTLINER_HXX
68 #include "Outliner.hxx"
71 #include <svx/svdoutl.hxx>
73 #include <svx/editstat.hxx>
74 #include <svx/unoapi.hxx>
76 #define MAP_LEN(x) x, sizeof(x)-1
78 using namespace ::comphelper
;
79 using namespace ::osl
;
80 using ::rtl::OUString
;
81 using namespace ::cppu
;
82 using namespace ::vos
;
83 using namespace ::com::sun::star
;
84 using namespace ::com::sun::star::uno
;
85 using namespace ::com::sun::star::util
;
86 using namespace ::com::sun::star::container
;
87 using namespace ::com::sun::star::drawing
;
88 using namespace ::com::sun::star::lang
;
89 using namespace ::com::sun::star::document
;
90 using namespace ::com::sun::star::frame
;
91 using namespace ::com::sun::star::beans
;
92 using namespace ::com::sun::star::i18n
;
96 class DocumentSettings
: public WeakImplHelper3
< XPropertySet
, XMultiPropertySet
, XServiceInfo
>,
97 public comphelper::PropertySetHelper
100 DocumentSettings( SdXImpressDocument
* pModel
);
101 virtual ~DocumentSettings() throw();
104 virtual Any SAL_CALL
queryInterface( const Type
& aType
) throw (RuntimeException
);
105 virtual void SAL_CALL
acquire( ) throw ();
106 virtual void SAL_CALL
release( ) throw ();
109 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
110 virtual void SAL_CALL
setPropertyValue( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Any
& aValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
111 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& PropertyName
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
112 virtual void SAL_CALL
addPropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& xListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
113 virtual void SAL_CALL
removePropertyChangeListener( const ::rtl::OUString
& aPropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertyChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
114 virtual void SAL_CALL
addVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
115 virtual void SAL_CALL
removeVetoableChangeListener( const ::rtl::OUString
& PropertyName
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XVetoableChangeListener
>& aListener
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
118 // virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
119 virtual void SAL_CALL
setPropertyValues( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aValues
) throw(::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
120 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> SAL_CALL
getPropertyValues( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
) throw(::com::sun::star::uno::RuntimeException
);
121 virtual void SAL_CALL
addPropertiesChangeListener( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw(::com::sun::star::uno::RuntimeException
);
122 virtual void SAL_CALL
removePropertiesChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw(::com::sun::star::uno::RuntimeException
);
123 virtual void SAL_CALL
firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& aPropertyNames
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw(::com::sun::star::uno::RuntimeException
);
126 virtual OUString SAL_CALL
getImplementationName( ) throw(RuntimeException
);
127 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw(RuntimeException
);
128 virtual Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(RuntimeException
);
131 virtual void _setPropertyValues( const comphelper::PropertyMapEntry
** ppEntries
, const ::com::sun::star::uno::Any
* pValues
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::beans::PropertyVetoException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::lang::WrappedTargetException
);
132 virtual void _getPropertyValues( const comphelper::PropertyMapEntry
** ppEntries
, ::com::sun::star::uno::Any
* pValue
) throw(::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
);
135 Reference
< XModel
> mxModel
;
136 SdXImpressDocument
* mpModel
;
139 Reference
< XInterface
> SAL_CALL
DocumentSettings_createInstance( SdXImpressDocument
* pModel
)
142 DBG_ASSERT( pModel
, "I need a model for the DocumentSettings!" );
143 return (XWeak
*)new DocumentSettings( pModel
);
146 enum SdDocumentSettingsPropertyHandles
148 HANDLE_PRINTDRAWING
, HANDLE_PRINTNOTES
, HANDLE_PRINTHANDOUT
, HANDLE_PRINTOUTLINE
, HANDLE_MEASUREUNIT
, HANDLE_SCALE_NUM
,
149 HANDLE_SCALE_DOM
, HANDLE_TABSTOP
, HANDLE_PRINTPAGENAME
, HANDLE_PRINTDATE
, HANDLE_PRINTTIME
,
150 HANDLE_PRINTHIDENPAGES
, HANDLE_PRINTFITPAGE
, HANDLE_PRINTTILEPAGE
, HANDLE_PRINTBOOKLET
, HANDLE_PRINTBOOKLETFRONT
,
151 HANDLE_PRINTBOOKLETBACK
, HANDLE_PRINTQUALITY
, HANDLE_COLORTABLEURL
, HANDLE_DASHTABLEURL
, HANDLE_LINEENDTABLEURL
, HANDLE_HATCHTABLEURL
,
152 HANDLE_GRADIENTTABLEURL
, HANDLE_BITMAPTABLEURL
, HANDLE_FORBIDDENCHARS
, HANDLE_APPLYUSERDATA
, HANDLE_PAGENUMFMT
,
153 HANDLE_PRINTERNAME
, HANDLE_PRINTERJOB
, HANDLE_PARAGRAPHSUMMATION
, HANDLE_CHARCOMPRESS
, HANDLE_ASIANPUNCT
, HANDLE_UPDATEFROMTEMPLATE
,
154 HANDLE_PRINTER_INDEPENDENT_LAYOUT
155 // --> PB 2004-08-23 #i33095#
156 ,HANDLE_LOAD_READONLY
, HANDLE_SAVE_VERSION
158 ,HANDLE_SLIDESPERHANDOUT
, HANDLE_HANDOUTHORIZONTAL
161 #define MID_PRINTER 1
163 PropertySetInfo
* createSettingsInfoImpl( sal_Bool bIsDraw
)
165 static PropertyMapEntry aImpressSettingsInfoMap
[] =
167 { MAP_LEN("IsPrintDrawing"), HANDLE_PRINTDRAWING
, &::getBooleanCppuType(), 0, MID_PRINTER
},
168 { MAP_LEN("IsPrintNotes"), HANDLE_PRINTNOTES
, &::getBooleanCppuType(), 0, MID_PRINTER
},
169 { MAP_LEN("IsPrintHandout"), HANDLE_PRINTHANDOUT
, &::getBooleanCppuType(), 0, MID_PRINTER
},
170 { MAP_LEN("IsPrintOutline"), HANDLE_PRINTOUTLINE
, &::getBooleanCppuType(), 0, MID_PRINTER
},
171 { MAP_LEN("SlidesPerHandout"), HANDLE_SLIDESPERHANDOUT
, &::getCppuType((const sal_Int16
*)0), 0, MID_PRINTER
},
172 { MAP_LEN("HandoutsHorizontal"), HANDLE_HANDOUTHORIZONTAL
, &::getBooleanCppuType(), 0, MID_PRINTER
},
173 { NULL
, 0, 0, NULL
, 0, 0 }
176 static PropertyMapEntry aDrawSettingsInfoMap
[] =
178 { MAP_LEN("MeasureUnit"), HANDLE_MEASUREUNIT
, &::getCppuType((const sal_Int16
*)0), 0, 0 },
179 { MAP_LEN("ScaleNumerator"), HANDLE_SCALE_NUM
, &::getCppuType((const sal_Int32
*)0), 0, 0 },
180 { MAP_LEN("ScaleDenominator"), HANDLE_SCALE_DOM
, &::getCppuType((const sal_Int32
*)0), 0, 0 },
181 { NULL
, 0, 0, NULL
, 0, 0 }
184 static PropertyMapEntry aCommonSettingsInfoMap
[] =
186 { MAP_LEN("DefaultTabStop"), HANDLE_TABSTOP
, &::getCppuType((const sal_Int32
*)0), 0, 0 },
187 { MAP_LEN("PrinterName"), HANDLE_PRINTERNAME
, &::getCppuType((const OUString
*)0), 0, 0 },
188 { MAP_LEN("PrinterSetup"), HANDLE_PRINTERJOB
, &::getCppuType((const uno::Sequence
< sal_Int8
> *)0), 0, MID_PRINTER
},
191 { MAP_LEN("IsPrintPageName"), HANDLE_PRINTPAGENAME
, &::getBooleanCppuType(), 0, MID_PRINTER
},
192 { MAP_LEN("IsPrintDate"), HANDLE_PRINTDATE
, &::getBooleanCppuType(), 0, MID_PRINTER
},
193 { MAP_LEN("IsPrintTime"), HANDLE_PRINTTIME
, &::getBooleanCppuType(), 0, MID_PRINTER
},
194 { MAP_LEN("IsPrintHiddenPages"), HANDLE_PRINTHIDENPAGES
, &::getBooleanCppuType(), 0, MID_PRINTER
},
195 { MAP_LEN("IsPrintFitPage"), HANDLE_PRINTFITPAGE
, &::getBooleanCppuType(), 0, MID_PRINTER
},
196 { MAP_LEN("IsPrintTilePage"), HANDLE_PRINTTILEPAGE
, &::getBooleanCppuType(), 0, MID_PRINTER
},
197 { MAP_LEN("IsPrintBooklet"), HANDLE_PRINTBOOKLET
, &::getBooleanCppuType(), 0, MID_PRINTER
},
198 { MAP_LEN("IsPrintBookletFront"), HANDLE_PRINTBOOKLETFRONT
, &::getBooleanCppuType(), 0, MID_PRINTER
},
199 { MAP_LEN("IsPrintBookletBack"), HANDLE_PRINTBOOKLETBACK
, &::getBooleanCppuType(), 0, MID_PRINTER
},
200 { MAP_LEN("PrintQuality"), HANDLE_PRINTQUALITY
, &::getCppuType((const sal_Int32
*)0), 0, MID_PRINTER
},
202 { MAP_LEN("ColorTableURL"), HANDLE_COLORTABLEURL
, &::getCppuType((const OUString
*)0), 0, 0 },
203 { MAP_LEN("DashTableURL"), HANDLE_DASHTABLEURL
, &::getCppuType((const OUString
*)0), 0, 0 },
204 { MAP_LEN("LineEndTableURL"), HANDLE_LINEENDTABLEURL
, &::getCppuType((const OUString
*)0), 0, 0 },
205 { MAP_LEN("HatchTableURL"), HANDLE_HATCHTABLEURL
, &::getCppuType((const OUString
*)0), 0, 0 },
206 { MAP_LEN("GradientTableURL"), HANDLE_GRADIENTTABLEURL
, &::getCppuType((const OUString
*)0), 0, 0 },
207 { MAP_LEN("BitmapTableURL"), HANDLE_BITMAPTABLEURL
, &::getCppuType((const OUString
*)0), 0, 0 },
209 { MAP_LEN("ForbiddenCharacters"), HANDLE_FORBIDDENCHARS
, &::getCppuType((const Reference
< XForbiddenCharacters
>*)0), 0, 0 },
210 { MAP_LEN("ApplyUserData"), HANDLE_APPLYUSERDATA
, &::getBooleanCppuType(), 0, 0 },
212 { MAP_LEN("PageNumberFormat"), HANDLE_PAGENUMFMT
, &::getCppuType((const sal_Int32
*)0), 0, 0 },
213 { MAP_LEN("ParagraphSummation"), HANDLE_PARAGRAPHSUMMATION
, &::getBooleanCppuType(), 0, 0 },
214 { MAP_LEN("CharacterCompressionType"),HANDLE_CHARCOMPRESS
, &::getCppuType((sal_Int16
*)0), 0, 0 },
215 { MAP_LEN("IsKernAsianPunctuation"),HANDLE_ASIANPUNCT
, &::getBooleanCppuType(), 0, 0 },
216 { MAP_LEN("UpdateFromTemplate"), HANDLE_UPDATEFROMTEMPLATE
, &::getBooleanCppuType(), 0, 0 },
217 { MAP_LEN("PrinterIndependentLayout"),HANDLE_PRINTER_INDEPENDENT_LAYOUT
,&::getCppuType((const sal_Int16
*)0), 0, 0 },
218 // --> PB 2004-08-23 #i33095#
219 { MAP_LEN("LoadReadonly"), HANDLE_LOAD_READONLY
, &::getBooleanCppuType(), 0, 0 },
220 { MAP_LEN("SaveVersionOnClose"), HANDLE_SAVE_VERSION
, &::getBooleanCppuType(), 0, 0 },
222 { NULL
, 0, 0, NULL
, 0, 0 }
225 PropertySetInfo
* pInfo
= new PropertySetInfo( aCommonSettingsInfoMap
);
226 pInfo
->add( bIsDraw
? aDrawSettingsInfoMap
: aImpressSettingsInfoMap
);
232 using namespace ::sd
;
234 DocumentSettings::DocumentSettings( SdXImpressDocument
* pModel
)
235 : PropertySetHelper( createSettingsInfoImpl( !pModel
->IsImpressDocument() ) ),
241 DocumentSettings::~DocumentSettings() throw()
245 void DocumentSettings::_setPropertyValues( const PropertyMapEntry
** ppEntries
, const Any
* pValues
) throw(UnknownPropertyException
, PropertyVetoException
, IllegalArgumentException
, WrappedTargetException
)
247 OGuard
aGuard( Application::GetSolarMutex() );
249 SdDrawDocument
* pDoc
= mpModel
->GetDoc();
250 ::sd::DrawDocShell
* pDocSh
= mpModel
->GetDocShell();
251 if( NULL
== pDoc
|| NULL
== pDocSh
)
252 throw UnknownPropertyException();
254 sal_Bool bOk
, bChanged
= sal_False
, bValue
= sal_False
, bOptionsChanged
= false;
256 SdOptionsPrintItem
aOptionsPrintItem( ATTR_OPTIONS_PRINT
);
258 SfxPrinter
* pPrinter
= pDocSh
->GetPrinter( FALSE
);
261 SdOptionsPrintItem
* pPrinterOptions
= NULL
;
262 if(pPrinter
->GetOptions().GetItemState( ATTR_OPTIONS_PRINT
, FALSE
, (const SfxPoolItem
**) &pPrinterOptions
) == SFX_ITEM_SET
)
263 aOptionsPrintItem
.GetOptionsPrint() = pPrinterOptions
->GetOptionsPrint();
267 aOptionsPrintItem
.SetOptions( SD_MOD()->GetSdOptions(pDoc
->GetDocumentType()) );
269 SdOptionsPrint
& aPrintOpts
= aOptionsPrintItem
.GetOptionsPrint();
271 for( ; *ppEntries
; ppEntries
++, pValues
++ )
275 switch( (*ppEntries
)->mnHandle
)
277 case HANDLE_COLORTABLEURL
:
280 if( *pValues
>>= aURLString
)
282 INetURLObject
aURL( aURLString
);
283 INetURLObject
aPathURL( aURL
);
285 aPathURL
.removeSegment();
286 aPathURL
.removeFinalSlash();
288 XColorTable
* pColTab
= new XColorTable( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), (XOutdevItemPool
*)&pDoc
->GetPool() );
289 pColTab
->SetName( aURL
.getName() );
290 if( pColTab
->Load() )
292 pDoc
->SetColorTable( pColTab
);
299 case HANDLE_DASHTABLEURL
:
302 if( *pValues
>>= aURLString
)
304 INetURLObject
aURL( aURLString
);
305 INetURLObject
aPathURL( aURL
);
307 aPathURL
.removeSegment();
308 aPathURL
.removeFinalSlash();
310 XDashList
* pDashTab
= new XDashList( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), (XOutdevItemPool
*)&pDoc
->GetPool() );
311 pDashTab
->SetName( aURL
.getName() );
312 if( pDashTab
->Load() )
314 pDoc
->SetDashList( pDashTab
);
321 case HANDLE_LINEENDTABLEURL
:
324 if( *pValues
>>= aURLString
)
326 INetURLObject
aURL( aURLString
);
327 INetURLObject
aPathURL( aURL
);
329 aPathURL
.removeSegment();
330 aPathURL
.removeFinalSlash();
332 XLineEndList
* pTab
= new XLineEndList( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), (XOutdevItemPool
*)&pDoc
->GetPool() );
333 pTab
->SetName( aURL
.getName() );
336 pDoc
->SetLineEndList( pTab
);
343 case HANDLE_HATCHTABLEURL
:
346 if( *pValues
>>= aURLString
)
348 INetURLObject
aURL( aURLString
);
349 INetURLObject
aPathURL( aURL
);
351 aPathURL
.removeSegment();
352 aPathURL
.removeFinalSlash();
354 XHatchList
* pTab
= new XHatchList( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), (XOutdevItemPool
*)&pDoc
->GetPool() );
355 pTab
->SetName( aURL
.getName() );
358 pDoc
->SetHatchList( pTab
);
365 case HANDLE_GRADIENTTABLEURL
:
368 if( *pValues
>>= aURLString
)
370 INetURLObject
aURL( aURLString
);
371 INetURLObject
aPathURL( aURL
);
373 aPathURL
.removeSegment();
374 aPathURL
.removeFinalSlash();
376 XGradientList
* pTab
= new XGradientList( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), (XOutdevItemPool
*)&pDoc
->GetPool() );
377 pTab
->SetName( aURL
.getName() );
380 pDoc
->SetGradientList( pTab
);
387 case HANDLE_BITMAPTABLEURL
:
390 if( *pValues
>>= aURLString
)
392 INetURLObject
aURL( aURLString
);
393 INetURLObject
aPathURL( aURL
);
395 aPathURL
.removeSegment();
396 aPathURL
.removeFinalSlash();
398 XBitmapList
* pTab
= new XBitmapList( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
), (XOutdevItemPool
*)&pDoc
->GetPool() );
399 pTab
->SetName( aURL
.getName() );
402 pDoc
->SetBitmapList( pTab
);
409 case HANDLE_FORBIDDENCHARS
:
414 case HANDLE_APPLYUSERDATA
:
416 sal_Bool bApplyUserData
= sal_False
;
417 if( *pValues
>>= bApplyUserData
)
419 bChanged
= ( bApplyUserData
!= pDocSh
->IsUseUserData() );
420 pDocSh
->SetUseUserData( bApplyUserData
);
425 case HANDLE_PRINTDRAWING
:
426 if( *pValues
>>= bValue
)
428 if( aPrintOpts
.IsDraw() != bValue
)
430 aPrintOpts
.SetDraw( bValue
);
431 bOptionsChanged
= true;
437 case HANDLE_PRINTNOTES
:
438 if( *pValues
>>= bValue
)
440 if( aPrintOpts
.IsNotes() != bValue
)
442 aPrintOpts
.SetNotes( bValue
);
443 bOptionsChanged
= true;
449 case HANDLE_PRINTHANDOUT
:
450 if( *pValues
>>= bValue
)
452 if( aPrintOpts
.IsHandout() != bValue
)
454 aPrintOpts
.SetHandout( bValue
);
455 bOptionsChanged
= true;
461 case HANDLE_PRINTOUTLINE
:
462 if( *pValues
>>= bValue
)
464 if( aPrintOpts
.IsOutline() != bValue
)
466 aPrintOpts
.SetOutline( bValue
);
467 bOptionsChanged
= true;
472 case HANDLE_SLIDESPERHANDOUT
:
474 sal_Int16 nValue
= 0;
475 if( (*pValues
>>= nValue
) && (nValue
>= 1) && (nValue
<= 9) )
477 if( static_cast<sal_Int16
>( aPrintOpts
.GetHandoutPages() ) != nValue
)
479 aPrintOpts
.SetHandoutPages( static_cast< UINT16
>( nValue
) );
480 bOptionsChanged
= true;
486 case HANDLE_HANDOUTHORIZONTAL
:
487 if( *pValues
>>= bValue
)
489 if( aPrintOpts
.IsHandoutHorizontal() != bValue
)
491 aPrintOpts
.SetHandoutHorizontal( bValue
);
492 bOptionsChanged
= true;
498 case HANDLE_PRINTPAGENAME
:
499 if( *pValues
>>= bValue
)
501 if( aPrintOpts
.IsPagename() != bValue
)
503 aPrintOpts
.SetPagename( bValue
);
504 bOptionsChanged
= true;
509 case HANDLE_PRINTDATE
:
510 if( *pValues
>>= bValue
)
512 if( aPrintOpts
.IsDate() != bValue
)
514 aPrintOpts
.SetDate( bValue
);
515 bOptionsChanged
= true;
520 case HANDLE_PRINTTIME
:
521 if( *pValues
>>= bValue
)
523 if( aPrintOpts
.IsDate() != bValue
)
525 aPrintOpts
.SetTime( bValue
);
526 bOptionsChanged
= true;
531 case HANDLE_PRINTHIDENPAGES
:
532 if( *pValues
>>= bValue
)
534 if( aPrintOpts
.IsHiddenPages() != bValue
)
536 aPrintOpts
.SetHiddenPages( bValue
);
537 bOptionsChanged
= true;
542 case HANDLE_PRINTFITPAGE
:
543 if( *pValues
>>= bValue
)
545 if( aPrintOpts
.IsPagesize() != bValue
)
547 aPrintOpts
.SetPagesize( bValue
);
548 bOptionsChanged
= true;
553 case HANDLE_PRINTTILEPAGE
:
554 if( *pValues
>>= bValue
)
556 if( aPrintOpts
.IsPagetile() != bValue
)
558 aPrintOpts
.SetPagetile( bValue
);
559 bOptionsChanged
= true;
564 case HANDLE_PRINTBOOKLET
:
565 if( *pValues
>>= bValue
)
567 if( aPrintOpts
.IsBooklet() != bValue
)
569 aPrintOpts
.SetBooklet( bValue
);
570 bOptionsChanged
= true;
575 case HANDLE_PRINTBOOKLETFRONT
:
576 if( *pValues
>>= bValue
)
578 if( aPrintOpts
.IsFrontPage() != bValue
)
580 aPrintOpts
.SetFrontPage( bValue
);
581 bOptionsChanged
= true;
586 case HANDLE_PRINTBOOKLETBACK
:
587 if( *pValues
>>= bValue
)
589 if( aPrintOpts
.IsBackPage() != bValue
)
591 aPrintOpts
.SetBackPage( bValue
);
592 bOptionsChanged
= true;
597 case HANDLE_PRINTQUALITY
:
599 sal_Int32 nValue
= 0;
600 if( *pValues
>>= nValue
)
602 if( aPrintOpts
.GetOutputQuality() != nValue
)
604 aPrintOpts
.SetOutputQuality( (sal_uInt16
)nValue
);
605 bOptionsChanged
= true;
611 case HANDLE_MEASUREUNIT
:
613 sal_Int16 nValue
= 0;
614 if( *pValues
>>= nValue
)
617 if( SvxMeasureUnitToFieldUnit( nValue
, nFieldUnit
) )
619 pDoc
->SetUIUnit((FieldUnit
)nFieldUnit
);
625 case HANDLE_SCALE_NUM
:
627 sal_Int32 nValue
= 0;
628 if( *pValues
>>= nValue
)
630 Fraction
aFract( nValue
, pDoc
->GetUIScale().GetDenominator() );
631 pDoc
->SetUIScale( aFract
);
637 case HANDLE_SCALE_DOM
:
639 sal_Int32 nValue
= 0;
640 if( *pValues
>>= nValue
)
642 Fraction
aFract( pDoc
->GetUIScale().GetNumerator(), nValue
);
643 pDoc
->SetUIScale( aFract
);
652 sal_Int32 nValue
= 0;
653 if( (*pValues
>>= nValue
) && (nValue
>= 0) )
655 pDoc
->SetDefaultTabulator((sal_uInt16
)nValue
);
661 case HANDLE_PAGENUMFMT
:
663 sal_Int32 nValue
= 0;
664 if( (*pValues
>>= nValue
) && (nValue
>= SVX_CHARS_UPPER_LETTER
) && (nValue
<= SVX_PAGEDESC
) )
666 pDoc
->SetPageNumType((SvxNumType
)nValue
);
672 case HANDLE_PRINTERNAME
:
674 OUString aPrinterName
;
675 if( *pValues
>>= aPrinterName
)
678 if( aPrinterName
.getLength() && pDocSh
->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED
)
680 SfxPrinter
*pTempPrinter
= pDocSh
->GetPrinter( sal_True
);
683 SfxPrinter
*pNewPrinter
= new SfxPrinter( pTempPrinter
->GetOptions().Clone(), aPrinterName
);
684 pDocSh
->SetPrinter( pNewPrinter
);
690 case HANDLE_PRINTERJOB
:
692 Sequence
< sal_Int8
> aSequence
;
693 if ( *pValues
>>= aSequence
)
696 sal_uInt32 nSize
= aSequence
.getLength();
699 SvMemoryStream
aStream (aSequence
.getArray(), nSize
, STREAM_READ
);
700 aStream
.Seek ( STREAM_SEEK_TO_BEGIN
);
701 SfxItemSet
* pItemSet
;
705 pItemSet
= pPrinter
->GetOptions().Clone();
709 pItemSet
= new SfxItemSet(pDoc
->GetPool(),
710 SID_PRINTER_NOTFOUND_WARN
, SID_PRINTER_NOTFOUND_WARN
,
711 SID_PRINTER_CHANGESTODOC
, SID_PRINTER_CHANGESTODOC
,
712 ATTR_OPTIONS_PRINT
, ATTR_OPTIONS_PRINT
,
716 pPrinter
= SfxPrinter::Create ( aStream
, pItemSet
);
718 MapMode
aMM (pPrinter
->GetMapMode());
719 aMM
.SetMapUnit(MAP_100TH_MM
);
720 pPrinter
->SetMapMode(aMM
);
722 pDocSh
->SetPrinter( pPrinter
);
730 case HANDLE_PARAGRAPHSUMMATION
:
732 sal_Bool bIsSummationOfParagraphs
= sal_False
;
733 if ( *pValues
>>= bIsSummationOfParagraphs
)
737 if ( pDoc
->GetDocumentType() == DOCUMENT_TYPE_IMPRESS
)
739 sal_uInt32 nSum
= bIsSummationOfParagraphs
? EE_CNTRL_ULSPACESUMMATION
: 0;
742 pDoc
->SetSummationOfParagraphs( bIsSummationOfParagraphs
);
743 SdDrawDocument
* pDocument
= pDocSh
->GetDoc();
744 SdrOutliner
& rOutl
= pDocument
->GetDrawOutliner( FALSE
);
745 nCntrl
= rOutl
.GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION
;
746 rOutl
.SetControlWord( nCntrl
| nSum
);
747 ::sd::Outliner
* pOutl
= pDocument
->GetOutliner( FALSE
);
750 nCntrl
= pOutl
->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION
;
751 pOutl
->SetControlWord( nCntrl
| nSum
);
753 pOutl
= pDocument
->GetInternalOutliner( FALSE
);
756 nCntrl
= pOutl
->GetControlWord() &~ EE_CNTRL_ULSPACESUMMATION
;
757 pOutl
->SetControlWord( nCntrl
| nSum
);
764 case HANDLE_CHARCOMPRESS
:
766 sal_Int16 nCharCompressType
= 0;
767 if( *pValues
>>= nCharCompressType
)
771 pDoc
->SetCharCompressType( (UINT16
)nCharCompressType
);
772 SdDrawDocument
* pDocument
= pDocSh
->GetDoc();
773 SdrOutliner
& rOutl
= pDocument
->GetDrawOutliner( FALSE
);
774 rOutl
.SetAsianCompressionMode( (UINT16
)nCharCompressType
);
775 ::sd::Outliner
* pOutl
= pDocument
->GetOutliner( FALSE
);
778 pOutl
->SetAsianCompressionMode( (UINT16
)nCharCompressType
);
780 pOutl
= pDocument
->GetInternalOutliner( FALSE
);
783 pOutl
->SetAsianCompressionMode( (UINT16
)nCharCompressType
);
789 case HANDLE_ASIANPUNCT
:
791 sal_Bool bAsianPunct
= sal_False
;
792 if( *pValues
>>= bAsianPunct
)
796 pDoc
->SetKernAsianPunctuation( bAsianPunct
);
797 SdDrawDocument
* pDocument
= pDocSh
->GetDoc();
798 SdrOutliner
& rOutl
= pDocument
->GetDrawOutliner( FALSE
);
799 rOutl
.SetKernAsianPunctuation( bAsianPunct
);
800 ::sd::Outliner
* pOutl
= pDocument
->GetOutliner( FALSE
);
803 pOutl
->SetKernAsianPunctuation( bAsianPunct
);
805 pOutl
= pDocument
->GetInternalOutliner( FALSE
);
808 pOutl
->SetKernAsianPunctuation( bAsianPunct
);
814 case HANDLE_UPDATEFROMTEMPLATE
:
816 sal_Bool value
= sal_False
;
817 if( *pValues
>>= value
)
819 bChanged
= ( value
!= pDocSh
->IsQueryLoadTemplate() );
820 pDocSh
->SetQueryLoadTemplate( value
);
826 case HANDLE_PRINTER_INDEPENDENT_LAYOUT
:
828 // Just propagate the new printer independent layout mode to
829 // the document and determine it really differs from the old
831 sal_Int16 nOldValue
=
832 (sal_Int16
)pDoc
->GetPrinterIndependentLayout ();
833 sal_Int16 nValue
= 0;
834 if (*pValues
>>= nValue
)
836 pDoc
->SetPrinterIndependentLayout (nValue
);
837 bChanged
= (nValue
!= nOldValue
);
843 // --> PB 2004-08-23 #i33095#
844 case HANDLE_LOAD_READONLY
:
846 sal_Bool bNewValue
= sal_False
;
847 if ( *pValues
>>= bNewValue
)
849 bChanged
= ( pDocSh
->IsLoadReadonly() != bNewValue
);
850 pDocSh
->SetLoadReadonly( bNewValue
);
857 case HANDLE_SAVE_VERSION
:
859 sal_Bool bNewValue
= sal_False
;
860 if ( *pValues
>>= bNewValue
)
862 bChanged
= ( pDocSh
->IsSaveVersionOnClose() != bNewValue
);
863 pDocSh
->SetSaveVersionOnClose( bNewValue
);
870 throw UnknownPropertyException();
874 throw IllegalArgumentException();
877 if( bOptionsChanged
)
880 pPrinter
= pDocSh
->GetPrinter( TRUE
);
881 SfxItemSet
aNewOptions( pPrinter
->GetOptions() );
882 aNewOptions
.Put( aOptionsPrintItem
);
883 pPrinter
->SetOptions( aNewOptions
);
886 if( bChanged
|| bOptionsChanged
)
887 mpModel
->SetModified( sal_True
);
890 void DocumentSettings::_getPropertyValues( const PropertyMapEntry
** ppEntries
, Any
* pValue
) throw(UnknownPropertyException
, WrappedTargetException
)
892 OGuard
aGuard( Application::GetSolarMutex() );
894 SdDrawDocument
* pDoc
= mpModel
->GetDoc();
895 ::sd::DrawDocShell
* pDocSh
= mpModel
->GetDocShell();
896 if( NULL
== pDoc
|| NULL
== pDocSh
)
897 throw UnknownPropertyException();
899 SdOptionsPrintItem
aOptionsPrintItem( ATTR_OPTIONS_PRINT
);
901 SfxPrinter
* pPrinter
= pDocSh
->GetPrinter( FALSE
);
904 SdOptionsPrintItem
* pPrinterOptions
= NULL
;
905 if(pPrinter
->GetOptions().GetItemState( ATTR_OPTIONS_PRINT
, FALSE
, (const SfxPoolItem
**) &pPrinterOptions
) == SFX_ITEM_SET
)
906 aOptionsPrintItem
.GetOptionsPrint() = pPrinterOptions
->GetOptionsPrint();
910 aOptionsPrintItem
.SetOptions( SD_MOD()->GetSdOptions(pDoc
->GetDocumentType()) );
912 SdOptionsPrint
& aPrintOpts
= aOptionsPrintItem
.GetOptionsPrint();
914 for( ; *ppEntries
; ppEntries
++, pValue
++ )
916 switch( (*ppEntries
)->mnHandle
)
918 case HANDLE_COLORTABLEURL
:
920 INetURLObject
aPathURL( pDoc
->GetColorTable()->GetPath() );
921 aPathURL
.insertName( pDoc
->GetColorTable()->GetName() );
922 String
aExt( RTL_CONSTASCII_USTRINGPARAM("soc") );
923 aPathURL
.setExtension( aExt
);
924 OUString
aPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
928 case HANDLE_DASHTABLEURL
:
930 INetURLObject
aPathURL( pDoc
->GetDashList()->GetPath() );
931 aPathURL
.insertName( pDoc
->GetDashList()->GetName() );
932 String
aExt( RTL_CONSTASCII_USTRINGPARAM("sod") );
933 aPathURL
.setExtension( aExt
);
934 OUString
aPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
938 case HANDLE_LINEENDTABLEURL
:
940 INetURLObject
aPathURL( pDoc
->GetLineEndList()->GetPath() );
941 aPathURL
.insertName( pDoc
->GetLineEndList()->GetName() );
942 String
aExt( RTL_CONSTASCII_USTRINGPARAM("soe") );
943 aPathURL
.setExtension( aExt
);
944 OUString
aPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
948 case HANDLE_HATCHTABLEURL
:
950 INetURLObject
aPathURL( pDoc
->GetHatchList()->GetPath() );
951 aPathURL
.insertName( pDoc
->GetHatchList()->GetName() );
952 String
aExt( RTL_CONSTASCII_USTRINGPARAM("soh") );
953 aPathURL
.setExtension( aExt
);
954 OUString
aPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
958 case HANDLE_GRADIENTTABLEURL
:
960 INetURLObject
aPathURL( pDoc
->GetGradientList()->GetPath() );
961 aPathURL
.insertName( pDoc
->GetGradientList()->GetName() );
962 String
aExt( RTL_CONSTASCII_USTRINGPARAM("sog") );
963 aPathURL
.setExtension( aExt
);
964 OUString
aPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
968 case HANDLE_BITMAPTABLEURL
:
970 INetURLObject
aPathURL( pDoc
->GetBitmapList()->GetPath() );
971 aPathURL
.insertName( pDoc
->GetBitmapList()->GetName() );
972 String
aExt( RTL_CONSTASCII_USTRINGPARAM("sob") );
973 aPathURL
.setExtension( aExt
);
974 OUString
aPath( aPathURL
.GetMainURL( INetURLObject::NO_DECODE
) );
978 case HANDLE_FORBIDDENCHARS
:
979 *pValue
<<= mpModel
->getForbiddenCharsTable();
982 case HANDLE_APPLYUSERDATA
:
983 *pValue
<<= pDocSh
->IsUseUserData();
986 case HANDLE_PRINTDRAWING
:
987 *pValue
<<= (sal_Bool
)aPrintOpts
.IsDraw();
989 case HANDLE_PRINTNOTES
:
990 *pValue
<<= (sal_Bool
)aPrintOpts
.IsNotes();
992 case HANDLE_PRINTHANDOUT
:
993 *pValue
<<= (sal_Bool
)aPrintOpts
.IsHandout();
995 case HANDLE_PRINTOUTLINE
:
996 *pValue
<<= (sal_Bool
)aPrintOpts
.IsOutline();
998 case HANDLE_SLIDESPERHANDOUT
:
999 *pValue
<<= (sal_Int16
)aPrintOpts
.GetHandoutPages();
1001 case HANDLE_HANDOUTHORIZONTAL
:
1002 *pValue
<<= (sal_Bool
)aPrintOpts
.IsHandoutHorizontal();
1004 case HANDLE_PRINTPAGENAME
:
1005 *pValue
<<= (sal_Bool
)aPrintOpts
.IsPagename();
1007 case HANDLE_PRINTDATE
:
1008 *pValue
<<= (sal_Bool
)aPrintOpts
.IsDate();
1010 case HANDLE_PRINTTIME
:
1011 *pValue
<<= (sal_Bool
)aPrintOpts
.IsTime();
1013 case HANDLE_PRINTHIDENPAGES
:
1014 *pValue
<<= (sal_Bool
)aPrintOpts
.IsHiddenPages();
1016 case HANDLE_PRINTFITPAGE
:
1017 *pValue
<<= (sal_Bool
)aPrintOpts
.IsPagesize();
1019 case HANDLE_PRINTTILEPAGE
:
1020 *pValue
<<= (sal_Bool
)aPrintOpts
.IsPagetile();
1022 case HANDLE_PRINTBOOKLET
:
1023 *pValue
<<= (sal_Bool
)aPrintOpts
.IsBooklet();
1025 case HANDLE_PRINTBOOKLETFRONT
:
1026 *pValue
<<= (sal_Bool
)aPrintOpts
.IsFrontPage();
1028 case HANDLE_PRINTBOOKLETBACK
:
1029 *pValue
<<= (sal_Bool
)aPrintOpts
.IsBackPage();
1031 case HANDLE_PRINTQUALITY
:
1032 *pValue
<<= (sal_Int32
)aPrintOpts
.GetOutputQuality();
1034 case HANDLE_MEASUREUNIT
:
1037 SvxFieldUnitToMeasureUnit( (const short)pDoc
->GetUIUnit(), nMeasure
);
1038 *pValue
<<= (sal_Int16
)nMeasure
;
1041 case HANDLE_SCALE_NUM
:
1042 *pValue
<<= (sal_Int32
)pDoc
->GetUIScale().GetNumerator();
1044 case HANDLE_SCALE_DOM
:
1045 *pValue
<<= (sal_Int32
)pDoc
->GetUIScale().GetDenominator();
1047 case HANDLE_TABSTOP
:
1048 *pValue
<<= (sal_Int32
)pDoc
->GetDefaultTabulator();
1050 case HANDLE_PAGENUMFMT
:
1051 *pValue
<<= (sal_Int32
)pDoc
->GetPageNumType();
1053 case HANDLE_PRINTERNAME
:
1055 SfxPrinter
*pTempPrinter
= pDocSh
->GetPrinter( sal_False
);
1056 *pValue
<<= pTempPrinter
? OUString ( pTempPrinter
->GetName()) : OUString();
1059 case HANDLE_PRINTERJOB
:
1061 SfxPrinter
*pTempPrinter
= pDocSh
->GetPrinter( sal_False
);
1064 SvMemoryStream aStream
;
1065 pTempPrinter
->Store( aStream
);
1066 aStream
.Seek ( STREAM_SEEK_TO_END
);
1067 sal_uInt32 nSize
= aStream
.Tell();
1068 aStream
.Seek ( STREAM_SEEK_TO_BEGIN
);
1069 Sequence
< sal_Int8
> aSequence ( nSize
);
1070 memcpy ( aSequence
.getArray(), aStream
.GetData(), nSize
);
1071 *pValue
<<= aSequence
;
1075 Sequence
< sal_Int8
> aSequence
;
1076 *pValue
<<= aSequence
;
1081 case HANDLE_PARAGRAPHSUMMATION
:
1083 sal_Bool bIsSummationOfParagraphs
= pDoc
->IsSummationOfParagraphs();
1084 *pValue
<<= bIsSummationOfParagraphs
;
1088 case HANDLE_CHARCOMPRESS
:
1090 *pValue
<<= (sal_Int16
)pDoc
->GetCharCompressType();
1094 case HANDLE_ASIANPUNCT
:
1096 *pValue
<<= (sal_Bool
)pDoc
->IsKernAsianPunctuation();
1100 case HANDLE_UPDATEFROMTEMPLATE
:
1102 *pValue
<<= pDocSh
->IsQueryLoadTemplate();
1106 case HANDLE_PRINTER_INDEPENDENT_LAYOUT
:
1108 sal_Int16 nPrinterIndependentLayout
=
1109 (sal_Int16
)pDoc
->GetPrinterIndependentLayout();
1110 *pValue
<<= nPrinterIndependentLayout
;
1114 // --> PB 2004-08-23 #i33095#
1115 case HANDLE_LOAD_READONLY
:
1117 *pValue
<<= pDocSh
->IsLoadReadonly();
1122 case HANDLE_SAVE_VERSION
:
1124 *pValue
<<= pDocSh
->IsSaveVersionOnClose();
1129 throw UnknownPropertyException();
1135 Any SAL_CALL
DocumentSettings::queryInterface( const Type
& aType
) throw (RuntimeException
)
1137 return WeakImplHelper3
< XPropertySet
, XMultiPropertySet
, XServiceInfo
>::queryInterface( aType
);
1140 void SAL_CALL
DocumentSettings::acquire( ) throw ()
1142 WeakImplHelper3
< XPropertySet
, XMultiPropertySet
, XServiceInfo
>::acquire();
1145 void SAL_CALL
DocumentSettings::release( ) throw ()
1147 WeakImplHelper3
< XPropertySet
, XMultiPropertySet
, XServiceInfo
>::release();
1152 Reference
< XPropertySetInfo
> SAL_CALL
DocumentSettings::getPropertySetInfo( ) throw(RuntimeException
)
1154 return PropertySetHelper::getPropertySetInfo();
1157 void SAL_CALL
DocumentSettings::setPropertyValue( const OUString
& aPropertyName
, const Any
& aValue
) throw(UnknownPropertyException
, PropertyVetoException
, IllegalArgumentException
, WrappedTargetException
, RuntimeException
)
1159 PropertySetHelper::setPropertyValue( aPropertyName
, aValue
);
1162 Any SAL_CALL
DocumentSettings::getPropertyValue( const OUString
& PropertyName
) throw(UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
1164 return PropertySetHelper::getPropertyValue( PropertyName
);
1167 void SAL_CALL
DocumentSettings::addPropertyChangeListener( const OUString
& aPropertyName
, const Reference
< XPropertyChangeListener
>& xListener
) throw(UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
1169 PropertySetHelper::addPropertyChangeListener( aPropertyName
, xListener
);
1172 void SAL_CALL
DocumentSettings::removePropertyChangeListener( const OUString
& aPropertyName
, const Reference
< XPropertyChangeListener
>& aListener
) throw(UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
1174 PropertySetHelper::removePropertyChangeListener( aPropertyName
, aListener
);
1177 void SAL_CALL
DocumentSettings::addVetoableChangeListener( const OUString
& PropertyName
, const Reference
< XVetoableChangeListener
>& aListener
) throw(UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
1179 PropertySetHelper::addVetoableChangeListener( PropertyName
, aListener
);
1182 void SAL_CALL
DocumentSettings::removeVetoableChangeListener( const OUString
& PropertyName
, const Reference
< XVetoableChangeListener
>& aListener
) throw(UnknownPropertyException
, WrappedTargetException
, RuntimeException
)
1184 PropertySetHelper::removeVetoableChangeListener( PropertyName
, aListener
);
1187 // XMultiPropertySet
1188 void SAL_CALL
DocumentSettings::setPropertyValues( const Sequence
< OUString
>& aPropertyNames
, const Sequence
< Any
>& aValues
) throw(PropertyVetoException
, IllegalArgumentException
, WrappedTargetException
, RuntimeException
)
1190 PropertySetHelper::setPropertyValues( aPropertyNames
, aValues
);
1193 Sequence
< Any
> SAL_CALL
DocumentSettings::getPropertyValues( const Sequence
< OUString
>& aPropertyNames
) throw(RuntimeException
)
1195 return PropertySetHelper::getPropertyValues( aPropertyNames
);
1198 void SAL_CALL
DocumentSettings::addPropertiesChangeListener( const Sequence
< OUString
>& aPropertyNames
, const Reference
< XPropertiesChangeListener
>& xListener
) throw(RuntimeException
)
1200 PropertySetHelper::addPropertiesChangeListener( aPropertyNames
, xListener
);
1203 void SAL_CALL
DocumentSettings::removePropertiesChangeListener( const Reference
< XPropertiesChangeListener
>& xListener
) throw(RuntimeException
)
1205 PropertySetHelper::removePropertiesChangeListener( xListener
);
1208 void SAL_CALL
DocumentSettings::firePropertiesChangeEvent( const Sequence
< OUString
>& aPropertyNames
, const Reference
< XPropertiesChangeListener
>& xListener
) throw(RuntimeException
)
1210 PropertySetHelper::firePropertiesChangeEvent( aPropertyNames
, xListener
);
1214 OUString SAL_CALL
DocumentSettings::getImplementationName( )
1215 throw(RuntimeException
)
1217 return OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Draw.DocumentSettings"));
1220 sal_Bool SAL_CALL
DocumentSettings::supportsService( const OUString
& ServiceName
)
1221 throw(RuntimeException
)
1223 const Sequence
< OUString
> aSeq( getSupportedServiceNames() );
1224 sal_Int32 nCount
= aSeq
.getLength();
1225 const OUString
* pServices
= aSeq
.getConstArray();
1228 if( *pServices
++ == ServiceName
)
1235 Sequence
< OUString
> SAL_CALL
DocumentSettings::getSupportedServiceNames( )
1236 throw(RuntimeException
)
1238 Sequence
< OUString
> aSeq( 2 );
1239 aSeq
[0] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.Settings") );
1240 if( mpModel
->IsImpressDocument() )
1242 aSeq
[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.DocumentSettings") );
1246 aSeq
[1] = OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DocumentSettings") );