diff options
author | Kurt Zenker <kz@openoffice.org> | 2004-08-31 08:39:25 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2004-08-31 08:39:25 +0000 |
commit | 073cd54b16cbc0aa6faa23566d624cea6d22e120 (patch) | |
tree | a5a849d4b59adbf16a2257721569b237f1235cdc /sd/source/ui/unoidl/UnoDocumentSettings.cxx | |
parent | a933b458d57a9f462966f6aa394ef43d00d631c0 (diff) |
INTEGRATION: CWS xmlsec05 (1.27.142); FILE MERGED
2004/08/24 10:27:09 pb 1.27.142.1: fix: #i33095# load and save 'LoadReadonly' in settings.xml
Diffstat (limited to 'sd/source/ui/unoidl/UnoDocumentSettings.cxx')
-rw-r--r-- | sd/source/ui/unoidl/UnoDocumentSettings.cxx | 105 |
1 files changed, 68 insertions, 37 deletions
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index b06ea3765..b0d092ba2 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -2,9 +2,9 @@ * * $RCSfile: UnoDocumentSettings.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: obo $ $Date: 2004-01-20 12:33:16 $ + * last change: $Author: kz $ $Date: 2004-08-31 09:39:25 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,15 +65,15 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #endif -#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ +#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_ #include <com/sun/star/beans/XPropertySet.hpp> #endif -#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_ +#ifndef _COM_SUN_STAR_BEANS_XMULTIPROPERTYSET_HPP_ #include <com/sun/star/beans/XMultiPropertySet.hpp> #endif -#ifndef _COM_SUN_STAR_I18N_XFORBIDDENCHARACTERS_HPP_ +#ifndef _COM_SUN_STAR_I18N_XFORBIDDENCHARACTERS_HPP_ #include <com/sun/star/i18n/XForbiddenCharacters.hpp> #endif @@ -81,23 +81,23 @@ #include <cppuhelper/implbase3.hxx> #endif -#ifndef _COMPHELPER_PROPERTYSETHELPER_HXX_ +#ifndef _COMPHELPER_PROPERTYSETHELPER_HXX_ #include <comphelper/propertysethelper.hxx> #endif -#ifndef _COMPHELPER_PROPERTSETINFO_HXX_ +#ifndef _COMPHELPER_PROPERTSETINFO_HXX_ #include <comphelper/propertysetinfo.hxx> #endif -#ifndef _SFXDOCINF_HXX +#ifndef _SFXDOCINF_HXX #include <sfx2/docinf.hxx> #endif -#ifndef _URLOBJ_HXX +#ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif -#ifndef _XTABLE_HXX +#ifndef _XTABLE_HXX #include <svx/xtable.hxx> #endif @@ -105,14 +105,14 @@ #include <osl/diagnose.h> #endif -#ifndef _OSL_MUTEX_HXX_ +#ifndef _OSL_MUTEX_HXX_ #include <osl/mutex.hxx> #endif -#ifndef _VOS_MUTEX_HXX_ +#ifndef _VOS_MUTEX_HXX_ #include <vos/mutex.hxx> #endif -#ifndef _SV_SVAPP_HXX +#ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> #endif @@ -128,10 +128,10 @@ #ifndef _SD_OPTSITEM_HXX #include "optsitem.hxx" #endif -#ifndef _SFX_PRINTER_HXX +#ifndef _SFX_PRINTER_HXX #include <sfx2/printer.hxx> #endif -#ifndef _SDATTR_HXX +#ifndef _SDATTR_HXX #include "sdattr.hxx" #endif #endif @@ -237,6 +237,9 @@ enum SdDocumentSettingsPropertyHandles HANDLE_GRADIENTTABLEURL, HANDLE_BITMAPTABLEURL, HANDLE_FORBIDDENCHARS, HANDLE_APPLYUSERDATA, HANDLE_PAGENUMFMT, HANDLE_PRINTERNAME, HANDLE_PRINTERJOB, HANDLE_PARAGRAPHSUMMATION, HANDLE_CHARCOMPRESS, HANDLE_ASIANPUNCT, HANDLE_UPDATEFROMTEMPLATE, HANDLE_PRINTER_INDEPENDENT_LAYOUT + // --> PB 2004-08-23 #i33095# + ,HANDLE_LOAD_READONLY + // <-- }; #define MID_PRINTER 1 @@ -296,6 +299,9 @@ enum SdDocumentSettingsPropertyHandles { MAP_LEN("IsKernAsianPunctuation"),HANDLE_ASIANPUNCT, &::getBooleanCppuType(), 0, 0 }, { MAP_LEN("UpdateFromTemplate"), HANDLE_UPDATEFROMTEMPLATE, &::getBooleanCppuType(), 0, 0 }, { MAP_LEN("PrinterIndependentLayout"),HANDLE_PRINTER_INDEPENDENT_LAYOUT,&::getCppuType((const sal_Int16*)0), 0, 0 }, + // --> PB 2004-08-23 #i33095# + { MAP_LEN("LoadReadonly"), HANDLE_LOAD_READONLY, &::getBooleanCppuType(), 0, 0 }, + // <-- { NULL, 0, 0, NULL, 0, 0 } }; @@ -360,9 +366,9 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( *pValues >>= aURLString ) { INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); aPathURL.removeFinalSlash(); XColorTable* pColTab = new XColorTable( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); @@ -382,9 +388,9 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( *pValues >>= aURLString ) { INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); aPathURL.removeFinalSlash(); XDashList* pDashTab = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); @@ -404,9 +410,9 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( *pValues >>= aURLString ) { INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); aPathURL.removeFinalSlash(); XLineEndList* pTab = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); @@ -426,9 +432,9 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( *pValues >>= aURLString ) { INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); aPathURL.removeFinalSlash(); XHatchList* pTab = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); @@ -448,9 +454,9 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( *pValues >>= aURLString ) { INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); aPathURL.removeFinalSlash(); XGradientList* pTab = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); @@ -470,9 +476,9 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c if( *pValues >>= aURLString ) { INetURLObject aURL( aURLString ); - INetURLObject aPathURL( aURL ); - - aPathURL.removeSegment(); + INetURLObject aPathURL( aURL ); + + aPathURL.removeSegment(); aPathURL.removeFinalSlash(); XBitmapList* pTab = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), (XOutdevItemPool*)&pDoc->GetPool() ); @@ -700,7 +706,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); SfxItemSet* pItemSet; - + if( pPrinter ) { pItemSet = pPrinter->GetOptions().Clone(); @@ -727,7 +733,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c } } break; - + case HANDLE_PARAGRAPHSUMMATION : { sal_Bool bIsSummationOfParagraphs; @@ -829,7 +835,7 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c // Just propagate the new printer independent layout mode to // the document and determine it really differs from the old // one. - sal_Int16 nOldValue = + sal_Int16 nOldValue = (sal_Int16)pDoc->GetPrinterIndependentLayout (); sal_Int16 nValue; if (*pValues >>= nValue) @@ -841,6 +847,22 @@ void DocumentSettings::_setPropertyValues( const PropertyMapEntry** ppEntries, c } break; + // --> PB 2004-08-23 #i33095# + case HANDLE_LOAD_READONLY: + { + SfxDocumentInfo& rDocInfo = pDocSh->GetDocInfo(); + sal_Bool bOldValue = rDocInfo.IsLoadReadonly(); + sal_Bool bNewValue; + if ( *pValues >>= bNewValue ) + { + rDocInfo.SetLoadReadonly( bNewValue ); + bChanged = ( bOldValue != bNewValue ); + bOk = sal_True; + } + } + break; + // <-- + default: throw UnknownPropertyException(); @@ -1090,12 +1112,21 @@ void DocumentSettings::_getPropertyValues( const PropertyMapEntry** ppEntries, A case HANDLE_PRINTER_INDEPENDENT_LAYOUT: { - sal_Int16 nPrinterIndependentLayout = + sal_Int16 nPrinterIndependentLayout = (sal_Int16)pDoc->GetPrinterIndependentLayout(); *pValue <<= nPrinterIndependentLayout; } break; + // --> PB 2004-08-23 #i33095# + case HANDLE_LOAD_READONLY: + { + sal_Bool bLoadReadonly = pDocSh->GetDocInfo().IsLoadReadonly(); + *pValue <<= bLoadReadonly; + } + break; + // <-- + default: throw UnknownPropertyException(); } |