24#include <com/sun/star/embed/XStorage.hpp>
25#include <com/sun/star/embed/ElementModes.hpp>
26#include <com/sun/star/embed/XTransactedObject.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
28#include <com/sun/star/beans/XPropertySet.hpp>
29#include <com/sun/star/beans/XMultiPropertySet.hpp>
30#include <com/sun/star/i18n/XForbiddenCharacters.hpp>
44#include <unomodel.hxx>
48#include <sfx2/sfxsids.hrc>
57using namespace ::
cppu;
72 class DocumentSettings :
public WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >,
74 public DocumentSettingsSerializer
81 virtual void SAL_CALL acquire( ) noexcept override;
82 virtual
void SAL_CALL release( ) noexcept override;
85 virtual css::
uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
86 virtual
void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::
uno::Any& aValue ) override;
87 virtual css::
uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
88 virtual
void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::
uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
89 virtual
void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::
uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
90 virtual
void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::
uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
91 virtual
void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::
uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
94 virtual
void SAL_CALL setPropertyValues( const css::
uno::Sequence< OUString >& aPropertyNames, const css::
uno::Sequence< css::
uno::Any >& aValues ) override;
95 virtual css::
uno::Sequence< css::
uno::Any > SAL_CALL getPropertyValues( const css::
uno::Sequence< OUString >& aPropertyNames ) override;
96 virtual
void SAL_CALL addPropertiesChangeListener( const css::
uno::Sequence< OUString >& aPropertyNames, const css::
uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
97 virtual
void SAL_CALL removePropertiesChangeListener( const css::
uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
98 virtual
void SAL_CALL firePropertiesChangeEvent( const css::
uno::Sequence< OUString >& aPropertyNames, const css::
uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
101 virtual OUString SAL_CALL getImplementationName( ) override;
102 virtual
sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
103 virtual Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
106 virtual
uno::Sequence<beans::PropertyValue>
107 filterStreamsFromStorage(OUString const & referer,
108 const
uno::Reference< embed::XStorage > &xStorage,
109 const
uno::Sequence<beans::PropertyValue>& aConfigProps ) override;
110 virtual
uno::Sequence<beans::PropertyValue>
111 filterStreamsToStorage(const
uno::Reference< embed::XStorage > &xStorage,
112 const
uno::Sequence<beans::PropertyValue>& aConfigProps ) override;
120 const OUString &rReferer,
121 const
uno::Reference< embed::XStorage > &xStorage );
132 DBG_ASSERT( pModel,
"I need a model for the DocumentSettings!" );
133 return static_cast<XWeak*
>(
new DocumentSettings( pModel ));
138enum SdDocumentSettingsPropertyHandles
140 HANDLE_PRINTDRAWING, HANDLE_PRINTNOTES, HANDLE_PRINTHANDOUT, HANDLE_PRINTOUTLINE, HANDLE_MEASUREUNIT, HANDLE_SCALE_NUM,
141 HANDLE_SCALE_DOM, HANDLE_TABSTOP, HANDLE_PRINTPAGENAME, HANDLE_PRINTDATE, HANDLE_PRINTTIME,
142 HANDLE_PRINTHIDDENPAGES, HANDLE_PRINTFITPAGE, HANDLE_PRINTTILEPAGE, HANDLE_PRINTBOOKLET, HANDLE_PRINTBOOKLETFRONT,
143 HANDLE_PRINTBOOKLETBACK, HANDLE_PRINTQUALITY, HANDLE_COLORTABLEURL, HANDLE_DASHTABLEURL, HANDLE_LINEENDTABLEURL, HANDLE_HATCHTABLEURL,
144 HANDLE_GRADIENTTABLEURL, HANDLE_BITMAPTABLEURL, HANDLE_FORBIDDENCHARS, HANDLE_APPLYUSERDATA, HANDLE_SAVETHUMBNAIL, HANDLE_PAGENUMFMT,
145 HANDLE_PRINTERNAME, HANDLE_PRINTERJOB, HANDLE_PRINTERPAPERSIZE, HANDLE_PARAGRAPHSUMMATION, HANDLE_CHARCOMPRESS, HANDLE_ASIANPUNCT,
146 HANDLE_UPDATEFROMTEMPLATE, HANDLE_PRINTER_INDEPENDENT_LAYOUT
148 ,HANDLE_LOAD_READONLY, HANDLE_MODIFY_PASSWD, HANDLE_SAVE_VERSION
149 ,HANDLE_SLIDESPERHANDOUT, HANDLE_HANDOUTHORIZONTAL,
150 HANDLE_EMBED_FONTS, HANDLE_EMBED_USED_FONTS,
151 HANDLE_EMBED_LATIN_SCRIPT_FONTS, HANDLE_EMBED_ASIAN_SCRIPT_FONTS, HANDLE_EMBED_COMPLEX_SCRIPT_FONTS,
152 HANDLE_IMAGE_PREFERRED_DPI
226 xInfo->add( aDrawSettingsInfoMap );
228 xInfo->add( aImpressSettingsInfoMap );
243 const OUString &rReferer,
244 const uno::Reference< embed::XStorage > &xStorage )
248 sal_Int32 nSlash = rInPath.lastIndexOf(
'/');
249 OUString aPath,
aName;
253 aName = rInPath.copy( nSlash + 1 );
254 aPath = rInPath.copy( 0, nSlash );
258 t, aPath, rReferer );
259 pList->SetName( aName );
261 if( pList->LoadFrom( xStorage, rInPath, rReferer ) )
271 bool *pOk,
bool *pChanged )
274 if( !( *pValue >>= aURL ) )
277 if( LoadList(
t, aURL,
"", uno::Reference< embed::XStorage >() ) )
278 *pOk = *pChanged =
true;
285 {
"ColorTableURL", XPropertyListType::Color },
286 {
"DashTableURL", XPropertyListType::Dash },
287 {
"LineEndTableURL", XPropertyListType::LineEnd },
288 {
"HatchTableURL", XPropertyListType::Hatch },
289 {
"GradientTableURL", XPropertyListType::Gradient },
290 {
"BitmapTableURL", XPropertyListType::Bitmap }
297 return rURLPropertyName.t;
299 return XPropertyListType::Unknown;
305 if(
t == rURLPropertyName.t )
306 return OUString( rURLPropertyName.pName,
307 strlen( rURLPropertyName.pName ) - 3,
308 RTL_TEXTENCODING_ASCII_US );
313uno::Sequence<beans::PropertyValue>
314 DocumentSettings::filterStreamsFromStorage(
315 OUString
const & referer,
316 const uno::Reference< embed::XStorage > &xStorage,
317 const uno::Sequence<beans::PropertyValue>& aConfigProps )
319 uno::Sequence<beans::PropertyValue> aRet( aConfigProps.getLength() );
320 auto aRetRange = asNonConstRange(aRet);
322 for(
const auto& rConfigProp : aConfigProps )
325 if (
t == XPropertyListType::Unknown)
326 aRetRange[nRet++] = rConfigProp;
330 rConfigProp.Value >>=
aURL;
331 LoadList(
t, aURL, referer, xStorage );
334 aRet.realloc( nRet );
338uno::Sequence<beans::PropertyValue>
339 DocumentSettings::filterStreamsToStorage(
340 const uno::Reference< embed::XStorage > &xStorage,
341 const uno::Sequence<beans::PropertyValue>& aConfigProps )
343 uno::Sequence<beans::PropertyValue> aRet( aConfigProps.getLength() );
345 bool bHasEmbed =
false;
350 bHasEmbed = pList.is() && pList->IsEmbedInDocument();
359 uno::Reference< embed::XStorage > xSubStorage = xStorage->openStorageElement(
"Settings" ,
360 embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE );
361 if( !xSubStorage.is() )
364 auto aRetRange = asNonConstRange(aRet);
366 for( sal_Int32 i = 0;
i < aConfigProps.getLength();
i++ )
369 aRetRange[
i] = aConfigProps[
i];
370 if (
t != XPropertyListType::Unknown) {
372 if( !pList.is() || !pList->IsEmbedInDocument() )
380 if( pList->SaveTo( xSubStorage, aName, &aResult ) )
382 OUString aRealPath =
"Settings/" + aResult;
383 aRetRange[
i].Value <<= aRealPath;
390 uno::Reference< embed::XTransactedObject > xTrans( xSubStorage, UNO_QUERY );
393 if( xSubStorage.is() )
394 xSubStorage->dispose();
395 }
catch (
const uno::Exception &) {
415 if(
nullptr == pDoc ||
nullptr == pDocSh )
418 static_cast<OWeakObject *
>(
this));
422 bool bOk, bChanged =
false, bOptionsChanged =
false;
429 SdOptionsPrintItem const * pPrinterOptions = pPrinter->GetOptions().GetItemIfSet( ATTR_OPTIONS_PRINT,
false );
439 for( ; *ppEntries; ppEntries++,
pValues++ )
443 switch( (*ppEntries)->mnHandle )
445 case HANDLE_COLORTABLEURL:
446 AssignURL( XPropertyListType::Color, pValues, &bOk, &bChanged );
449 case HANDLE_DASHTABLEURL:
450 AssignURL( XPropertyListType::Dash, pValues, &bOk, &bChanged );
453 case HANDLE_LINEENDTABLEURL:
454 AssignURL( XPropertyListType::LineEnd, pValues, &bOk, &bChanged );
457 case HANDLE_HATCHTABLEURL:
458 AssignURL( XPropertyListType::Hatch, pValues, &bOk, &bChanged );
461 case HANDLE_GRADIENTTABLEURL:
462 AssignURL( XPropertyListType::Gradient, pValues, &bOk, &bChanged );
465 case HANDLE_BITMAPTABLEURL:
466 AssignURL( XPropertyListType::Bitmap, pValues, &bOk, &bChanged );
469 case HANDLE_FORBIDDENCHARS:
473 case HANDLE_APPLYUSERDATA:
475 bool bApplyUserData =
false;
476 if( *pValues >>= bApplyUserData )
484 case HANDLE_SAVETHUMBNAIL:
486 bool bSaveThumbnail =
false;
487 if (*pValues >>= bSaveThumbnail)
496 case HANDLE_PRINTDRAWING:
497 if( *pValues >>= bValue )
499 if( aPrintOpts.
IsDraw() != bValue )
502 bOptionsChanged =
true;
508 case HANDLE_PRINTNOTES:
509 if( *pValues >>= bValue )
511 if( aPrintOpts.
IsNotes() != bValue )
514 bOptionsChanged =
true;
520 case HANDLE_PRINTHANDOUT:
521 if( *pValues >>= bValue )
526 bOptionsChanged =
true;
532 case HANDLE_PRINTOUTLINE:
533 if( *pValues >>= bValue )
538 bOptionsChanged =
true;
543 case HANDLE_SLIDESPERHANDOUT:
546 if( (*pValues >>= nValue) && (
nValue >= 1) && (nValue <= 9) )
551 bOptionsChanged =
true;
557 case HANDLE_HANDOUTHORIZONTAL:
558 if( *pValues >>= bValue )
563 bOptionsChanged =
true;
569 case HANDLE_PRINTPAGENAME:
570 if( *pValues >>= bValue )
575 bOptionsChanged =
true;
580 case HANDLE_PRINTDATE:
581 if( *pValues >>= bValue )
583 if( aPrintOpts.
IsDate() != bValue)
586 bOptionsChanged =
true;
591 case HANDLE_PRINTTIME:
592 if( *pValues >>= bValue )
594 if( aPrintOpts.
IsDate() != bValue)
597 bOptionsChanged =
true;
602 case HANDLE_PRINTHIDDENPAGES:
603 if( *pValues >>= bValue )
608 bOptionsChanged =
true;
613 case HANDLE_PRINTFITPAGE:
614 if( *pValues >>= bValue )
619 bOptionsChanged =
true;
624 case HANDLE_PRINTTILEPAGE:
625 if( *pValues >>= bValue )
630 bOptionsChanged =
true;
635 case HANDLE_PRINTBOOKLET:
636 if( *pValues >>= bValue )
641 bOptionsChanged =
true;
646 case HANDLE_PRINTBOOKLETFRONT:
647 if( *pValues >>= bValue )
652 bOptionsChanged =
true;
657 case HANDLE_PRINTBOOKLETBACK:
658 if( *pValues >>= bValue )
663 bOptionsChanged =
true;
668 case HANDLE_PRINTQUALITY:
671 if( *pValues >>= nValue )
676 bOptionsChanged =
true;
682 case HANDLE_MEASUREUNIT:
685 if( *pValues >>= nValue )
696 case HANDLE_SCALE_NUM:
699 if( *pValues >>= nValue )
708 case HANDLE_SCALE_DOM:
711 if( *pValues >>= nValue )
714 assert(nNumerator != 0);
715 Fraction aFract(nNumerator, nValue);
726 if( (*pValues >>= nValue) && (nValue >= 0) )
734 case HANDLE_PAGENUMFMT:
737 if( (*pValues >>= nValue ) && (nValue >= css::style::NumberingType::CHARS_UPPER_LETTER ) && (nValue <= css::style::NumberingType::PAGE_DESCRIPTOR) )
745 case HANDLE_PRINTERNAME:
747 OUString aPrinterName;
748 if( *pValues >>= aPrinterName )
751 if( !aPrinterName.isEmpty() && pDocSh->
GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
763 case HANDLE_PRINTERJOB:
765 Sequence < sal_Int8 > aSequence;
766 if ( *pValues >>= aSequence )
769 sal_uInt32 nSize = aSequence.getLength();
772 SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ );
773 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
774 std::unique_ptr<SfxItemSet> pItemSet;
776 bool bPreferPrinterPapersize =
false;
779 pItemSet = pPrinter->GetOptions().Clone();
780 bPreferPrinterPapersize = pPrinter->GetPrinterSettingsPreferred();
785 <SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
786 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
787 ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>>(pDoc->
GetPool());
791 pPrinter->SetPrinterSettingsPreferred( bPreferPrinterPapersize );
793 MapMode aMM (pPrinter->GetMapMode());
794 aMM.SetMapUnit(MapUnit::Map100thMM);
795 pPrinter->SetMapMode(aMM);
805 case HANDLE_PRINTERPAPERSIZE:
807 bool bPreferPrinterPapersize;
808 if( *pValues >>= bPreferPrinterPapersize )
811 if( pDocSh->
GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
815 pTempPrinter->SetPrinterSettingsPreferred( bPreferPrinterPapersize );
821 case HANDLE_PARAGRAPHSUMMATION :
823 bool bIsSummationOfParagraphs =
false;
824 if ( *pValues >>= bIsSummationOfParagraphs )
830 EEControlBits nSum = bIsSummationOfParagraphs ? EEControlBits::ULSPACESUMMATION : EEControlBits::NONE;
837 rOutl.SetControlWord( nCntrl | nSum );
842 pOutl->SetControlWord( nCntrl | nSum );
848 pOutl->SetControlWord( nCntrl | nSum );
855 case HANDLE_CHARCOMPRESS:
857 sal_Int16 nCharCompressType = 0;
858 if( *pValues >>= nCharCompressType )
865 rOutl.SetAsianCompressionMode(
static_cast<CharCompressType>(nCharCompressType) );
869 pOutl->SetAsianCompressionMode(
static_cast<CharCompressType>(nCharCompressType) );
874 pOutl->SetAsianCompressionMode(
static_cast<CharCompressType>(nCharCompressType) );
880 case HANDLE_ASIANPUNCT:
882 bool bAsianPunct =
false;
883 if( *pValues >>= bAsianPunct )
890 rOutl.SetKernAsianPunctuation( bAsianPunct );
894 pOutl->SetKernAsianPunctuation( bAsianPunct );
899 pOutl->SetKernAsianPunctuation( bAsianPunct );
905 case HANDLE_UPDATEFROMTEMPLATE:
908 if( *pValues >>= value )
917 case HANDLE_PRINTER_INDEPENDENT_LAYOUT:
922 sal_Int16 nOldValue =
925 if (*pValues >>= nValue)
928 bChanged = (
nValue != nOldValue);
935 case HANDLE_LOAD_READONLY:
937 bool bNewValue =
false;
938 if ( *pValues >>= bNewValue )
947 case HANDLE_MODIFY_PASSWD:
949 uno::Sequence< beans::PropertyValue > aInfo;
950 if ( !( *pValues >>= aInfo ) )
951 throw lang::IllegalArgumentException(
952 "Value of type Sequence<PropertyValue> expected!",
953 uno::Reference< uno::XInterface >(),
957 throw beans::PropertyVetoException(
958 "The hash is not allowed to be changed now!" );
966 case HANDLE_SAVE_VERSION:
968 bool bNewValue =
false;
969 if ( *pValues >>= bNewValue )
978 case HANDLE_EMBED_FONTS:
982 bool bNewValue =
pValues->get<
bool>();
990 case HANDLE_EMBED_USED_FONTS:
994 bool bNewValue =
pValues->get<
bool>();
1002 case HANDLE_EMBED_LATIN_SCRIPT_FONTS:
1006 bool bNewValue =
pValues->get<
bool>();
1014 case HANDLE_EMBED_ASIAN_SCRIPT_FONTS:
1018 bool bNewValue =
pValues->get<
bool>();
1026 case HANDLE_EMBED_COMPLEX_SCRIPT_FONTS:
1030 bool bNewValue =
pValues->get<
bool>();
1038 case HANDLE_IMAGE_PREFERRED_DPI:
1040 if (
pValues->has<sal_Int32>())
1042 auto nNewValue =
pValues->get<sal_Int32>();
1051 throw UnknownPropertyException( OUString::number((*ppEntries)->mnHandle),
static_cast<cppu::OWeakObject*
>(
this));
1055 throw IllegalArgumentException();
1058 if( bOptionsChanged )
1062 SfxItemSet aNewOptions( pPrinter->GetOptions() );
1063 aNewOptions.Put( aOptionsPrintItem );
1064 pPrinter->SetOptions( aNewOptions );
1067 if( bChanged || bOptionsChanged )
1078 aPathURL.insertName( pList->GetName() );
1079 aPathURL.setExtension( pList->GetDefaultExt() );
1085DocumentSettings::_getPropertyValues(
1092 if(
nullptr == pDoc ||
nullptr == pDocSh )
1095 static_cast<OWeakObject *
>(
this));
1104 if (pPrinterOptions)
1113 for( ; *ppEntries; ppEntries++, pValue++ )
1115 switch( (*ppEntries)->mnHandle )
1117 case HANDLE_COLORTABLEURL:
1118 ExtractURL( XPropertyListType::Color, pValue );
1120 case HANDLE_DASHTABLEURL:
1121 ExtractURL( XPropertyListType::Dash, pValue );
1123 case HANDLE_LINEENDTABLEURL:
1124 ExtractURL( XPropertyListType::LineEnd, pValue );
1126 case HANDLE_HATCHTABLEURL:
1127 ExtractURL( XPropertyListType::Hatch, pValue );
1129 case HANDLE_GRADIENTTABLEURL:
1130 ExtractURL( XPropertyListType::Gradient, pValue );
1132 case HANDLE_BITMAPTABLEURL:
1133 ExtractURL( XPropertyListType::Bitmap, pValue );
1135 case HANDLE_FORBIDDENCHARS:
1136 *pValue <<=
mxModel->getForbiddenCharsTable();
1138 case HANDLE_APPLYUSERDATA:
1141 case HANDLE_SAVETHUMBNAIL:
1144 case HANDLE_PRINTDRAWING:
1145 *pValue <<= aPrintOpts.
IsDraw();
1147 case HANDLE_PRINTNOTES:
1148 *pValue <<= aPrintOpts.
IsNotes();
1150 case HANDLE_PRINTHANDOUT:
1153 case HANDLE_PRINTOUTLINE:
1156 case HANDLE_SLIDESPERHANDOUT:
1159 case HANDLE_HANDOUTHORIZONTAL:
1162 case HANDLE_PRINTPAGENAME:
1165 case HANDLE_PRINTDATE:
1166 *pValue <<= aPrintOpts.
IsDate();
1168 case HANDLE_PRINTTIME:
1169 *pValue <<= aPrintOpts.
IsTime();
1171 case HANDLE_PRINTHIDDENPAGES:
1174 case HANDLE_PRINTFITPAGE:
1177 case HANDLE_PRINTTILEPAGE:
1180 case HANDLE_PRINTBOOKLET:
1183 case HANDLE_PRINTBOOKLETFRONT:
1186 case HANDLE_PRINTBOOKLETBACK:
1189 case HANDLE_PRINTQUALITY:
1192 case HANDLE_MEASUREUNIT:
1196 *pValue <<= static_cast<sal_Int16>(nMeasure);
1199 case HANDLE_SCALE_NUM:
1202 case HANDLE_SCALE_DOM:
1205 case HANDLE_TABSTOP:
1208 case HANDLE_PAGENUMFMT:
1211 case HANDLE_PRINTERNAME:
1214 *pValue <<= pTempPrinter ? pTempPrinter->GetName() : OUString();
1217 case HANDLE_PRINTERJOB:
1223 pTempPrinter->
Store( aStream );
1224 *pValue <<= Sequence< sal_Int8 >(
static_cast< const sal_Int8*
>( aStream.
GetData() ),
1229 Sequence < sal_Int8 > aSequence;
1230 *pValue <<= aSequence;
1235 case HANDLE_PRINTERPAPERSIZE:
1238 *pValue <<= pTempPrinter && pTempPrinter->GetPrinterSettingsPreferred();
1242 case HANDLE_PARAGRAPHSUMMATION :
1245 *pValue <<= bIsSummationOfParagraphs;
1249 case HANDLE_CHARCOMPRESS:
1255 case HANDLE_ASIANPUNCT:
1261 case HANDLE_UPDATEFROMTEMPLATE:
1267 case HANDLE_PRINTER_INDEPENDENT_LAYOUT:
1269 sal_Int16 nPrinterIndependentLayout =
1271 *pValue <<= nPrinterIndependentLayout;
1276 case HANDLE_LOAD_READONLY:
1282 case HANDLE_MODIFY_PASSWD:
1288 case HANDLE_SAVE_VERSION:
1294 case HANDLE_EMBED_FONTS:
1300 case HANDLE_EMBED_USED_FONTS:
1306 case HANDLE_EMBED_LATIN_SCRIPT_FONTS:
1312 case HANDLE_EMBED_ASIAN_SCRIPT_FONTS:
1318 case HANDLE_EMBED_COMPLEX_SCRIPT_FONTS:
1324 case HANDLE_IMAGE_PREFERRED_DPI:
1331 throw UnknownPropertyException( OUString::number((*ppEntries)->mnHandle),
static_cast<cppu::OWeakObject*
>(
this));
1337Any SAL_CALL DocumentSettings::queryInterface(
const Type& aType )
1339 return WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::queryInterface( aType );
1342void SAL_CALL DocumentSettings::acquire( ) noexcept
1344 WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::acquire();
1347void SAL_CALL DocumentSettings::release( ) noexcept
1349 WeakImplHelper< XPropertySet, XMultiPropertySet, XServiceInfo >::release();
1353Reference< XPropertySetInfo > SAL_CALL DocumentSettings::getPropertySetInfo( )
1355 return PropertySetHelper::getPropertySetInfo();
1358void SAL_CALL DocumentSettings::setPropertyValue(
const OUString& aPropertyName,
const Any& aValue )
1360 PropertySetHelper::setPropertyValue( aPropertyName, aValue );
1363Any SAL_CALL DocumentSettings::getPropertyValue(
const OUString& PropertyName )
1365 return PropertySetHelper::getPropertyValue( PropertyName );
1368void SAL_CALL DocumentSettings::addPropertyChangeListener(
const OUString& aPropertyName,
const Reference< XPropertyChangeListener >& xListener )
1370 PropertySetHelper::addPropertyChangeListener( aPropertyName, xListener );
1373void SAL_CALL DocumentSettings::removePropertyChangeListener(
const OUString& aPropertyName,
const Reference< XPropertyChangeListener >& aListener )
1375 PropertySetHelper::removePropertyChangeListener( aPropertyName, aListener );
1378void SAL_CALL DocumentSettings::addVetoableChangeListener(
const OUString& PropertyName,
const Reference< XVetoableChangeListener >& aListener )
1380 PropertySetHelper::addVetoableChangeListener( PropertyName, aListener );
1383void SAL_CALL DocumentSettings::removeVetoableChangeListener(
const OUString& PropertyName,
const Reference< XVetoableChangeListener >& aListener )
1385 PropertySetHelper::removeVetoableChangeListener( PropertyName, aListener );
1389void SAL_CALL DocumentSettings::setPropertyValues(
const Sequence< OUString >& aPropertyNames,
const Sequence< Any >& aValues )
1391 PropertySetHelper::setPropertyValues( aPropertyNames, aValues );
1394Sequence< Any > SAL_CALL DocumentSettings::getPropertyValues(
const Sequence< OUString >& aPropertyNames )
1396 return PropertySetHelper::getPropertyValues( aPropertyNames );
1399void SAL_CALL DocumentSettings::addPropertiesChangeListener(
const Sequence< OUString >& aPropertyNames,
const Reference< XPropertiesChangeListener >& xListener )
1401 PropertySetHelper::addPropertiesChangeListener( aPropertyNames, xListener );
1404void SAL_CALL DocumentSettings::removePropertiesChangeListener(
const Reference< XPropertiesChangeListener >& xListener )
1406 PropertySetHelper::removePropertiesChangeListener( xListener );
1409void SAL_CALL DocumentSettings::firePropertiesChangeEvent(
const Sequence< OUString >& aPropertyNames,
const Reference< XPropertiesChangeListener >& xListener )
1411 PropertySetHelper::firePropertiesChangeEvent( aPropertyNames, xListener );
1415OUString SAL_CALL DocumentSettings::getImplementationName( )
1417 return "com.sun.star.comp.Draw.DocumentSettings";
1420sal_Bool SAL_CALL DocumentSettings::supportsService(
const OUString& ServiceName )
1425Sequence< OUString > SAL_CALL DocumentSettings::getSupportedServiceNames( )
1427 return {
"com.sun.star.document.Settings" ,
1428 mxModel->IsImpressDocument()?OUString(
"com.sun.star.presentation.DocumentSettings"):OUString(
"com.sun.star.drawing.DocumentSettings") };
const PropertyValue * pValues
css::uno::Reference< css::frame::XModel2 > mxModel
static OUString getNameOfType(XPropertyListType t)
struct @1 aURLPropertyNames[]
static XPropertyListType getTypeOfName(std::u16string_view aName)
sal_Int32 GetNumerator() const
sal_Int32 GetDenominator() const
SAL_DLLPRIVATE bool IsEmbedFonts() const
SAL_DLLPRIVATE void SetEmbedFontScriptComplex(bool bUse)
SAL_DLLPRIVATE void SetPrinterIndependentLayout(sal_Int32 nMode)
Set the mode that controls whether (and later how) the formatting of the document depends on the curr...
SAL_DLLPRIVATE void SetEmbedFontScriptLatin(bool bUse)
SAL_DLLPRIVATE void SetEmbedFonts(bool bUse)
SAL_DLLPRIVATE SfxItemPool & GetPool()
SAL_DLLPRIVATE void SetSummationOfParagraphs(bool bOn=true)
SAL_DLLPRIVATE void SetPageNumType(SvxNumType eType)
SAL_DLLPRIVATE bool IsSummationOfParagraphs() const
SdOutliner * GetInternalOutliner(bool bCreateOutliner=true)
SAL_DLLPRIVATE SdOutliner * GetOutliner(bool bCreateOutliner=true)
SAL_DLLPRIVATE bool IsEmbedFontScriptLatin() const
SAL_DLLPRIVATE void SetEmbedUsedFontsOnly(bool bUse)
void setImagePreferredDPI(sal_Int32 nValue)
SAL_DLLPRIVATE bool IsEmbedFontScriptComplex() const
SAL_DLLPRIVATE bool IsEmbedUsedFontsOnly() const
SAL_DLLPRIVATE sal_Int32 GetPrinterIndependentLayout() const
Get the flag that controls whether the formatting of the document depends on the current printer metr...
SAL_DLLPRIVATE bool IsEmbedFontScriptAsian() const
SAL_DLLPRIVATE void SetEmbedFontScriptAsian(bool bUse)
sal_Int32 getImagePreferredDPI() const override
SAL_DLLPRIVATE SvxNumType GetPageNumType() const override
SAL_DLLPRIVATE DocumentType GetDocumentType() const
SdOptionsPrint & GetOptionsPrint()
void SetOptions(SdOptions *pOpts) const
sal_uInt16 GetHandoutPages() const
void SetHandoutHorizontal(bool bHandoutHorizontal)
void SetFrontPage(bool bOn)
void SetBackPage(bool bOn)
void SetBooklet(bool bOn)
void SetPagesize(bool bOn)
void SetHiddenPages(bool bOn)
void SetPagename(bool bOn)
void SetOutline(bool bOn)
void SetOutputQuality(sal_uInt16 nInQuality)
bool IsHandoutHorizontal() const
void SetPagetile(bool bOn)
void SetHandoutPages(sal_uInt16 nHandoutPages)
bool IsHiddenPages() const
void SetHandout(bool bOn)
sal_uInt16 GetOutputQuality() const
The main purpose of this class is searching and replacing as well as spelling of impress documents.
void SetUIScale(const Fraction &rScale)
bool IsKernAsianPunctuation() const
void SetKernAsianPunctuation(bool bEnabled)
void SetCharCompressType(CharCompressType nType)
sal_uInt16 GetDefaultTabulator() const
void SetUIUnit(FieldUnit eUnit)
void SetDefaultTabulator(sal_uInt16 nVal)
SdrOutliner & GetDrawOutliner(const SdrTextObj *pObj=nullptr) const
CharCompressType GetCharCompressType() const
FieldUnit GetUIUnit() const
void SetPropertyList(XPropertyListRef const &p)
const Fraction & GetUIScale() const
const XPropertyListRef & GetPropertyList(XPropertyListType t) const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
bool SetModifyPasswordInfo(const css::uno::Sequence< css::beans::PropertyValue > &aInfo)
bool IsLoadReadonly() const
bool IsUseUserData() const
void SetQueryLoadTemplate(bool b)
void SetSaveVersionOnClose(bool bSet)
void SetUseThumbnailSave(bool _bNew)
void SetUseUserData(bool bNew)
bool IsUseThumbnailSave() const
bool IsSaveVersionOnClose() const
void SetLoadReadonly(bool _bReadonly)
SfxObjectCreateMode GetCreateMode() const
const css::uno::Sequence< css::beans::PropertyValue > & GetModifyPasswordInfo() const
bool IsQueryLoadTemplate() const
void Store(SvStream &rStream) const
static VclPtr< SfxPrinter > Create(SvStream &rStream, std::unique_ptr< SfxItemSet > &&pOptions)
const SfxItemSet & GetOptions() const
virtual sal_uInt64 TellEnd() override
static VclPtr< reference_type > Create(Arg &&... arg)
static XPropertyListRef CreatePropertyList(XPropertyListType t, const OUString &rPath, const OUString &rReferer)
css::uno::Type const & get()
void SetPrinter(SfxPrinter *pNewPrinter)
Set new SfxPrinter (transfer of ownership)
SfxPrinter * GetPrinter(bool bCreate)
Creates (if necessary) and returns a SfxPrinter.
SdDrawDocument * GetDoc()
#define DBG_ASSERT(sCon, aError)
#define SAL_N_ELEMENTS(arr)
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
bool equalsAscii(std::u16string_view s1, std::string_view s2)
static rtl::Reference< PropertySetInfo > createSettingsInfoImpl(bool bIsDraw)
Reference< XInterface > DocumentSettings_createInstance(SdXImpressDocument *pModel) noexcept
std::pair< OUString const, DataAccessDescriptorProperty > PropertyMapEntry
SVXCORE_DLLPUBLIC bool SvxMeasureUnitToFieldUnit(const short eApi, FieldUnit &nVcl) noexcept
SVXCORE_DLLPUBLIC bool SvxFieldUnitToMeasureUnit(const FieldUnit nVcl, short &eApi) noexcept