Version 4.3.0.0.beta1, tag libreoffice-4.3.0.0.beta1
[LibreOffice.git] / sc / source / ui / unoobj / confuno.cxx
blob58f8b891c614afa719402af90e0fe1d97f5ad5b4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <config_features.h>
22 #include "confuno.hxx"
23 #include "unonames.hxx"
24 #include "scdll.hxx"
25 #include "docsh.hxx"
26 #include "miscuno.hxx"
27 #include "forbiuno.hxx"
28 #include "viewopti.hxx"
29 #include "docpool.hxx"
30 #include "sc.hrc"
32 #include <com/sun/star/beans/PropertyAttribute.hpp>
33 #include <cppuhelper/supportsservice.hxx>
34 #include <sfx2/printer.hxx>
35 #include <xmloff/xmluconv.hxx>
36 #include <rtl/ustrbuf.hxx>
37 #include <vcl/svapp.hxx>
39 using namespace com::sun::star;
41 #define SCSAVEVERSION "SaveVersionOnClose"
44 static const SfxItemPropertyMapEntry* lcl_GetConfigPropertyMap()
46 static const SfxItemPropertyMapEntry aConfigPropertyMap_Impl[] =
48 {OUString(SC_UNO_SHOWZERO), 0, getBooleanCppuType(), 0, 0},
49 {OUString(SC_UNO_SHOWNOTES), 0, getBooleanCppuType(), 0, 0},
50 {OUString(SC_UNO_SHOWGRID), 0, getBooleanCppuType(), 0, 0},
51 {OUString(SC_UNO_GRIDCOLOR), 0, cppu::UnoType<sal_Int32>::get(), 0, 0},
52 {OUString(SC_UNO_SHOWPAGEBR), 0, getBooleanCppuType(), 0, 0},
53 {OUString(SC_UNONAME_LINKUPD), 0, cppu::UnoType<sal_Int16>::get(), 0, 0},
54 {OUString(SC_UNO_COLROWHDR), 0, getBooleanCppuType(), 0, 0},
55 {OUString(SC_UNO_SHEETTABS), 0, getBooleanCppuType(), 0, 0},
56 {OUString(SC_UNO_OUTLSYMB), 0, getBooleanCppuType(), 0, 0},
57 {OUString(SC_UNO_SNAPTORASTER), 0, getBooleanCppuType(), 0, 0},
58 {OUString(SC_UNO_RASTERVIS), 0, getBooleanCppuType(), 0, 0},
59 {OUString(SC_UNO_RASTERRESX), 0, cppu::UnoType<sal_Int32>::get(), 0, 0},
60 {OUString(SC_UNO_RASTERRESY), 0, cppu::UnoType<sal_Int32>::get(), 0, 0},
61 {OUString(SC_UNO_RASTERSUBX), 0, cppu::UnoType<sal_Int32>::get(), 0, 0},
62 {OUString(SC_UNO_RASTERSUBY), 0, cppu::UnoType<sal_Int32>::get(), 0, 0},
63 {OUString(SC_UNO_RASTERSYNC), 0, getBooleanCppuType(), 0, 0},
64 {OUString(SC_UNO_AUTOCALC), 0, getBooleanCppuType(), 0, 0},
65 {OUString(SC_UNO_PRINTERNAME), 0, cppu::UnoType<OUString>::get(), 0, 0},
66 {OUString(SC_UNO_PRINTERSETUP), 0, getCppuType((uno::Sequence<sal_Int8>*)0), 0, 0},
67 {OUString(SC_UNO_APPLYDOCINF), 0, getBooleanCppuType(), 0, 0},
68 {OUString(SC_UNO_FORBIDDEN), 0, cppu::UnoType<i18n::XForbiddenCharacters>::get(), beans::PropertyAttribute::READONLY, 0},
69 {OUString(SC_UNO_CHARCOMP), 0, cppu::UnoType<sal_Int16>::get(), 0, 0},
70 {OUString(SC_UNO_ASIANKERN), 0, getBooleanCppuType(), 0, 0},
71 {OUString(SCSAVEVERSION), 0, getBooleanCppuType(), 0, 0},
72 {OUString(SC_UNO_UPDTEMPL), 0, getBooleanCppuType(), 0, 0},
73 /*Stampit enable/disable print cancel */
74 {OUString(SC_UNO_ALLOWPRINTJOBCANCEL), 0, getBooleanCppuType(), 0, 0},
75 {OUString(SC_UNO_LOADREADONLY), 0, getBooleanCppuType(), 0, 0},
76 {OUString(SC_UNO_SHAREDOC), 0, getBooleanCppuType(), 0, 0},
77 {OUString(SC_UNO_MODIFYPASSWORDINFO), 0, getCppuType((uno::Sequence< beans::PropertyValue >*)0), 0, 0},
78 {OUString(SC_UNO_EMBED_FONTS), 0, getBooleanCppuType(), 0, 0},
79 { OUString(), 0, css::uno::Type(), 0, 0 }
81 return aConfigPropertyMap_Impl;
84 ScDocumentConfiguration::ScDocumentConfiguration(ScDocShell* pDocSh)
85 : pDocShell(pDocSh) ,
86 aPropSet ( lcl_GetConfigPropertyMap() )
88 pDocShell->GetDocument()->AddUnoObject(*this);
91 ScDocumentConfiguration::~ScDocumentConfiguration()
93 if (pDocShell)
94 pDocShell->GetDocument()->RemoveUnoObject(*this);
97 void ScDocumentConfiguration::Notify( SfxBroadcaster&, const SfxHint& rHint )
99 // Referenz-Update interessiert hier nicht
101 if ( rHint.ISA( SfxSimpleHint ) &&
102 ((const SfxSimpleHint&)rHint).GetId() == SFX_HINT_DYING )
104 pDocShell = NULL; // ungueltig geworden
108 // XPropertySet
110 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDocumentConfiguration::getPropertySetInfo()
111 throw(uno::RuntimeException, std::exception)
113 SolarMutexGuard aGuard;
114 static uno::Reference<beans::XPropertySetInfo> aRef(
115 new SfxItemPropertySetInfo( aPropSet.getPropertyMap() ));
116 return aRef;
119 void SAL_CALL ScDocumentConfiguration::setPropertyValue(
120 const OUString& aPropertyName, const uno::Any& aValue )
121 throw(beans::UnknownPropertyException, beans::PropertyVetoException,
122 lang::IllegalArgumentException, lang::WrappedTargetException,
123 uno::RuntimeException, std::exception)
125 SolarMutexGuard aGuard;
127 if(pDocShell)
129 ScDocument* pDoc = pDocShell->GetDocument();
130 if (pDoc)
132 bool bUpdateHeights = false;
134 ScViewOptions aViewOpt(pDoc->GetViewOptions());
136 /*Stampit enable/disable print cancel */
137 if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) )
138 pDocShell->Stamp_SetPrintCancelState( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
139 /*Stampit enable/disable print cancel */
141 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) )
142 aViewOpt.SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
143 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) )
144 aViewOpt.SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
145 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) )
146 aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
147 else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) )
149 sal_Int64 nColor = 0;
150 if (aValue >>= nColor)
152 OUString aColorName;
153 Color aColor(static_cast<sal_uInt32>(nColor));
154 aViewOpt.SetGridColor(aColor, aColorName);
157 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) )
158 aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
159 else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) )
160 pDoc->SetLinkMode( static_cast<ScLkUpdMode> ( ScUnoHelpFunctions::GetInt16FromAny( aValue ) ) );
161 else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) )
162 aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
163 else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) )
164 aViewOpt.SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
165 else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) )
166 aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
167 else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) )
168 pDoc->SetAutoCalc( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
169 else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) )
171 OUString sPrinterName;
172 if ( aValue >>= sPrinterName )
174 // #i75610# if the name is empty, do nothing (don't create any printer)
175 if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
177 SfxPrinter* pPrinter = pDocShell->GetPrinter();
178 if (pPrinter)
180 if (pPrinter->GetName() != sPrinterName)
182 SfxPrinter* pNewPrinter = new SfxPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
183 if (pNewPrinter->IsKnown())
184 pDocShell->SetPrinter( pNewPrinter, SFX_PRINTER_PRINTER );
185 else
186 delete pNewPrinter;
189 else
190 throw uno::RuntimeException();
193 else
194 throw lang::IllegalArgumentException();
196 else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) )
198 uno::Sequence<sal_Int8> aSequence;
199 if ( aValue >>= aSequence )
201 sal_uInt32 nSize = aSequence.getLength();
202 // #i75610# if the sequence is empty, do nothing (don't create any printer)
203 if ( nSize != 0 )
205 SvMemoryStream aStream (aSequence.getArray(), nSize, STREAM_READ );
206 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
207 SfxItemSet* pSet = new SfxItemSet( *pDoc->GetPool(),
208 SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
209 SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
210 SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
211 SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS,
212 NULL );
213 pDocShell->SetPrinter( SfxPrinter::Create( aStream, pSet ) );
217 else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) )
219 bool bTmp=true;
220 if ( aValue >>= bTmp )
221 pDocShell->SetUseUserData( bTmp );
223 else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) )
225 // read-only - should not be set
227 else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) )
229 // Int16 contains CharacterCompressionType values
230 sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue );
231 pDoc->SetAsianCompression( (sal_uInt8) nUno );
232 bUpdateHeights = true;
234 else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) )
236 pDoc->SetAsianKerning( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
237 bUpdateHeights = true;
239 else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) )
241 bool bTmp=false;
242 if ( aValue >>= bTmp )
243 pDocShell->SetSaveVersionOnClose( bTmp );
245 else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) )
247 bool bTmp=true;
248 if ( aValue >>= bTmp )
249 pDocShell->SetQueryLoadTemplate( bTmp );
251 else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) )
253 bool bTmp=false;
254 if ( aValue >>= bTmp )
255 pDocShell->SetLoadReadonly( bTmp );
257 else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) )
259 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
260 bool bDocShared = false;
261 if ( aValue >>= bDocShared )
263 pDocShell->SetSharedXMLFlag( bDocShared );
265 #endif
267 else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) )
269 uno::Sequence< beans::PropertyValue > aInfo;
270 if ( !( aValue >>= aInfo ) )
271 throw lang::IllegalArgumentException(
272 OUString( "Value of type Sequence<PropertyValue> expected!" ),
273 uno::Reference< uno::XInterface >(),
274 2 );
276 if ( !pDocShell->SetModifyPasswordInfo( aInfo ) )
277 throw beans::PropertyVetoException(
278 OUString( "The hash is not allowed to be changed now!" ),
279 uno::Reference< uno::XInterface >() );
281 else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) )
283 bool bVal = false;
284 if ( aValue >>=bVal )
286 pDoc->SetIsUsingEmbededFonts(bVal);
290 else
292 ScGridOptions aGridOpt(aViewOpt.GetGridOptions());
293 if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) )
294 aGridOpt.SetUseGridSnap( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
295 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) )
296 aGridOpt.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
297 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) )
298 aGridOpt.SetFldDrawX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
299 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) )
300 aGridOpt.SetFldDrawY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
301 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) )
302 aGridOpt.SetFldDivisionX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
303 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) )
304 aGridOpt.SetFldDivisionY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
305 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) )
306 aGridOpt.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
307 else
308 throw beans::UnknownPropertyException();
309 aViewOpt.SetGridOptions(aGridOpt);
311 pDoc->SetViewOptions(aViewOpt);
313 if ( bUpdateHeights && !pDoc->IsImportingXML() )
315 // update automatic row heights and repaint
316 SCTAB nTabCount = pDoc->GetTableCount();
317 for (SCTAB nTab=0; nTab<nTabCount; nTab++)
318 if ( !pDocShell->AdjustRowHeight( 0, MAXROW, nTab ) )
319 pDocShell->PostPaint(ScRange(0, 0, nTab, MAXCOL, MAXROW, nTab), PAINT_GRID);
320 pDocShell->SetDocumentModified();
323 else
324 throw uno::RuntimeException();
326 else
327 throw uno::RuntimeException();
330 uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPropertyName )
331 throw(beans::UnknownPropertyException, lang::WrappedTargetException,
332 uno::RuntimeException, std::exception)
334 SolarMutexGuard aGuard;
335 uno::Any aRet;
337 if(pDocShell)
339 ScDocument* pDoc = pDocShell->GetDocument();
340 if (pDoc)
342 const ScViewOptions& aViewOpt = pDoc->GetViewOptions();
344 /*Stampit enable/disable print cancel */
345 if ( aPropertyName.equalsAscii( SC_UNO_ALLOWPRINTJOBCANCEL ) )
346 ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->Stamp_GetPrintCancelState() );
347 /*Stampit enable/disable print cancel */
349 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWZERO ) )
350 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NULLVALS ) );
351 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWNOTES ) )
352 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_NOTES ) );
353 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWGRID ) )
354 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_GRID ) );
355 else if ( aPropertyName.equalsAscii( SC_UNO_GRIDCOLOR ) )
357 OUString aColorName;
358 Color aColor = aViewOpt.GetGridColor(&aColorName);
359 aRet <<= static_cast<sal_Int64>(aColor.GetColor());
361 else if ( aPropertyName.equalsAscii( SC_UNO_SHOWPAGEBR ) )
362 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_PAGEBREAKS ) );
363 else if ( aPropertyName.equalsAscii( SC_UNONAME_LINKUPD ) )
364 aRet <<= static_cast<sal_Int16> ( pDoc->GetLinkMode() );
365 else if ( aPropertyName.equalsAscii( SC_UNO_COLROWHDR ) )
366 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_HEADER ) );
367 else if ( aPropertyName.equalsAscii( SC_UNO_SHEETTABS ) )
368 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_TABCONTROLS ) );
369 else if ( aPropertyName.equalsAscii( SC_UNO_OUTLSYMB ) )
370 ScUnoHelpFunctions::SetBoolInAny( aRet, aViewOpt.GetOption( VOPT_OUTLINER ) );
371 else if ( aPropertyName.equalsAscii( SC_UNO_AUTOCALC ) )
372 ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->GetAutoCalc() );
373 else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERNAME ) )
375 // #i75610# don't create the printer, return empty string if no printer created yet
376 // (as in SwXDocumentSettings)
377 SfxPrinter* pPrinter = pDoc->GetPrinter( false );
378 if (pPrinter)
379 aRet <<= OUString ( pPrinter->GetName());
380 else
381 aRet <<= OUString();
383 else if ( aPropertyName.equalsAscii( SC_UNO_PRINTERSETUP ) )
385 // #i75610# don't create the printer, return empty sequence if no printer created yet
386 // (as in SwXDocumentSettings)
387 SfxPrinter* pPrinter = pDoc->GetPrinter( false );
388 if (pPrinter)
390 SvMemoryStream aStream;
391 pPrinter->Store( aStream );
392 aStream.Seek ( STREAM_SEEK_TO_END );
393 sal_uInt32 nSize = aStream.Tell();
394 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
395 uno::Sequence < sal_Int8 > aSequence( nSize );
396 aStream.Read ( aSequence.getArray(), nSize );
397 aRet <<= aSequence;
399 else
400 aRet <<= uno::Sequence<sal_Int8>();
402 else if ( aPropertyName.equalsAscii( SC_UNO_APPLYDOCINF ) )
403 aRet <<= pDocShell->IsUseUserData();
404 else if ( aPropertyName.equalsAscii( SC_UNO_FORBIDDEN ) )
406 aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell ));
408 else if ( aPropertyName.equalsAscii( SC_UNO_CHARCOMP ) )
409 aRet <<= static_cast<sal_Int16> ( pDoc->GetAsianCompression() );
410 else if ( aPropertyName.equalsAscii( SC_UNO_ASIANKERN ) )
411 ScUnoHelpFunctions::SetBoolInAny( aRet, pDoc->GetAsianKerning() );
412 else if ( aPropertyName.equalsAscii( SCSAVEVERSION ) )
413 aRet <<= pDocShell->IsSaveVersionOnClose();
414 else if ( aPropertyName.equalsAscii( SC_UNO_UPDTEMPL ) )
415 aRet <<= pDocShell->IsQueryLoadTemplate();
416 else if ( aPropertyName.equalsAscii( SC_UNO_LOADREADONLY ) )
417 aRet <<= pDocShell->IsLoadReadonly();
418 else if ( aPropertyName.equalsAscii( SC_UNO_SHAREDOC ) )
420 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
421 ScUnoHelpFunctions::SetBoolInAny( aRet, pDocShell->HasSharedXMLFlagSet() );
422 #endif
424 else if ( aPropertyName.equalsAscii( SC_UNO_MODIFYPASSWORDINFO ) )
425 aRet <<= pDocShell->GetModifyPasswordInfo();
426 else if ( aPropertyName.equalsAscii( SC_UNO_EMBED_FONTS ) )
428 aRet <<= pDoc->IsUsingEmbededFonts();
431 else
433 const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions();
434 if ( aPropertyName.equalsAscii( SC_UNO_SNAPTORASTER ) )
435 ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetUseGridSnap() );
436 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERVIS ) )
437 ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetGridVisible() );
438 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESX ) )
439 aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDrawX() );
440 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERRESY ) )
441 aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDrawY() );
442 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBX ) )
443 aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDivisionX() );
444 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSUBY ) )
445 aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFldDivisionY() );
446 else if ( aPropertyName.equalsAscii( SC_UNO_RASTERSYNC ) )
447 ScUnoHelpFunctions::SetBoolInAny( aRet, aGridOpt.GetSynchronize() );
448 else
449 throw beans::UnknownPropertyException();
452 else
453 throw uno::RuntimeException();
455 else
456 throw uno::RuntimeException();
458 return aRet;
461 SC_IMPL_DUMMY_PROPERTY_LISTENER( ScDocumentConfiguration )
463 // XServiceInfo
464 OUString SAL_CALL ScDocumentConfiguration::getImplementationName() throw(uno::RuntimeException, std::exception)
466 return OUString( "ScDocumentConfiguration" );
469 sal_Bool SAL_CALL ScDocumentConfiguration::supportsService( const OUString& rServiceName )
470 throw(uno::RuntimeException, std::exception)
472 return cppu::supportsService(this, rServiceName);
475 uno::Sequence<OUString> SAL_CALL ScDocumentConfiguration::getSupportedServiceNames()
476 throw(uno::RuntimeException, std::exception)
478 uno::Sequence<OUString> aRet(2);
479 OUString* pArray = aRet.getArray();
480 pArray[0] = "com.sun.star.comp.SpreadsheetSettings";
481 pArray[1] = "com.sun.star.document.Settings";
482 return aRet;
485 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */