LibreOffice Module sc (master)  1
confuno.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <utility>
23 
24 #include <config_features.h>
25 
26 #include <confuno.hxx>
27 #include <unonames.hxx>
28 #include <docsh.hxx>
29 #include <miscuno.hxx>
30 #include <forbiuno.hxx>
31 #include <appoptio.hxx>
32 #include <viewopti.hxx>
33 #include <docpool.hxx>
34 #include <sc.hrc>
35 #include <scmod.hxx>
36 
37 #include <com/sun/star/beans/PropertyAttribute.hpp>
38 #include <com/sun/star/document/LinkUpdateModes.hpp>
40 #include <formula/grammar.hxx>
41 #include <sfx2/printer.hxx>
42 #include <svl/itemset.hxx>
43 #include <vcl/svapp.hxx>
44 #include <tools/stream.hxx>
45 
46 using namespace com::sun::star;
47 
48 constexpr OUStringLiteral SCSAVEVERSION = u"SaveVersionOnClose";
49 
51 {
52  static const SfxItemPropertyMapEntry aConfigPropertyMap_Impl[] =
53  {
76  {u"" SC_UNO_FORBIDDEN, 0, cppu::UnoType<i18n::XForbiddenCharacters>::get(), beans::PropertyAttribute::READONLY, 0},
81  /*Stampit enable/disable print cancel */
93  { u"", 0, css::uno::Type(), 0, 0 }
94  };
95  return aConfigPropertyMap_Impl;
96 }
97 
99  : pDocShell(pDocSh) ,
100  aPropSet ( lcl_GetConfigPropertyMap() )
101 {
103 }
104 
106 {
107  SolarMutexGuard g;
108 
109  if (pDocShell)
111 }
112 
114 {
115  // reference update does not matter here
116 
117  if ( rHint.GetId() == SfxHintId::Dying )
118  {
119  pDocShell = nullptr;
120  }
121 }
122 
123 // XPropertySet
124 
125 uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDocumentConfiguration::getPropertySetInfo()
126 {
127  SolarMutexGuard aGuard;
128  static uno::Reference<beans::XPropertySetInfo> aRef(
130  return aRef;
131 }
132 
134  const OUString& aPropertyName, const uno::Any& aValue )
135 {
136  SolarMutexGuard aGuard;
137 
138  if(!pDocShell)
139  throw uno::RuntimeException();
140 
141  ScDocument& rDoc = pDocShell->GetDocument();
142  bool bUpdateHeights = false;
143 
144  ScViewOptions aViewOpt(rDoc.GetViewOptions());
145 
146  /*Stampit enable/disable print cancel */
147  if ( aPropertyName == SC_UNO_ALLOWPRINTJOBCANCEL )
149  /*Stampit enable/disable print cancel */
150 
151  else if ( aPropertyName == SC_UNO_SHOWZERO )
152  aViewOpt.SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
153  else if ( aPropertyName == SC_UNO_SHOWNOTES )
154  aViewOpt.SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
155  else if ( aPropertyName == SC_UNO_SHOWGRID )
156  aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
157  else if ( aPropertyName == SC_UNO_GRIDCOLOR )
158  {
159  Color aColor;
160  if (aValue >>= aColor)
161  aViewOpt.SetGridColor(aColor, OUString());
162  }
163  else if ( aPropertyName == SC_UNO_SHOWPAGEBR )
164  aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
165  else if ( aPropertyName == SC_UNONAME_LINKUPD )
166  {
167  // XXX NOTE: this is the css::document::Settings property
168  // LinkUpdateMode, not the css::sheet::XGlobalSheetSettings
169  // attribute LinkUpdateMode.
170  sal_Int16 n;
171  if (!(aValue >>= n) || n < css::document::LinkUpdateModes::NEVER ||
172  n > css::document::LinkUpdateModes::GLOBAL_SETTING)
173  {
174  throw css::lang::IllegalArgumentException(
175  ("LinkUpdateMode property value must be a SHORT with a value in"
176  " the range of the css::document::LinkUpdateModes constants"),
177  css::uno::Reference<css::uno::XInterface>(), -1);
178  }
180  switch (n)
181  {
182  case css::document::LinkUpdateModes::NEVER:
183  eMode = LM_NEVER;
184  break;
185  case css::document::LinkUpdateModes::MANUAL:
186  eMode = LM_ON_DEMAND;
187  break;
188  case css::document::LinkUpdateModes::AUTO:
189  eMode = LM_ALWAYS;
190  break;
191  case css::document::LinkUpdateModes::GLOBAL_SETTING:
192  default:
193  eMode = SC_MOD()->GetAppOptions().GetLinkMode();
194  break;
195  }
196  rDoc.SetLinkMode( eMode );
197  }
198  else if ( aPropertyName == SC_UNO_COLROWHDR )
199  aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
200  else if ( aPropertyName == SC_UNO_SHEETTABS )
201  aViewOpt.SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
202  else if ( aPropertyName == SC_UNO_OUTLSYMB )
203  aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
204  else if ( aPropertyName == SC_UNO_AUTOCALC )
206  else if ( aPropertyName == SC_UNO_PRINTERNAME )
207  {
208  OUString sPrinterName;
209  if ( !(aValue >>= sPrinterName) )
210  throw lang::IllegalArgumentException();
211 
212  // #i75610# if the name is empty, do nothing (don't create any printer)
213  if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
214  {
215  SfxPrinter* pPrinter = pDocShell->GetPrinter();
216  if (!pPrinter)
217  throw uno::RuntimeException();
218 
219  if (pPrinter->GetName() != sPrinterName)
220  {
221  VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
222  if (pNewPrinter->IsKnown())
223  pDocShell->SetPrinter( pNewPrinter, SfxPrinterChangeFlags::PRINTER );
224  else
225  pNewPrinter.disposeAndClear();
226  }
227 
228  }
229 
230  }
231  else if ( aPropertyName == SC_UNO_PRINTERSETUP )
232  {
233  uno::Sequence<sal_Int8> aSequence;
234  if ( aValue >>= aSequence )
235  {
236  sal_uInt32 nSize = aSequence.getLength();
237  // #i75610# if the sequence is empty, do nothing (don't create any printer)
238  if ( nSize != 0 )
239  {
240  SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ );
241  aStream.Seek ( STREAM_SEEK_TO_BEGIN );
242  auto pSet = std::make_unique<SfxItemSet>( *rDoc.GetPool(),
243  svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
244  SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
245  SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
246  SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS> );
247 
248  SfxPrinter* pPrinter = pDocShell->GetPrinter();
249  bool bPreferPrinterPapersize = false;
250  if ( pPrinter )
251  bPreferPrinterPapersize = pPrinter->GetPrinterSettingsPreferred();
252 
253  VclPtr<SfxPrinter> pTempPrinter = SfxPrinter::Create( aStream, std::move(pSet) );
254  pTempPrinter->SetPrinterSettingsPreferred( bPreferPrinterPapersize );
255  pDocShell->SetPrinter( pTempPrinter );
256  }
257  }
258  }
259  else if ( aPropertyName == SC_UNO_PRINTERPAPER )
260  {
261  bool bPreferPrinterPapersize;
262  if( aValue >>= bPreferPrinterPapersize )
263  {
264  if( pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
265  {
266  SfxPrinter *pTempPrinter = pDocShell->GetPrinter( true );
267  if (pTempPrinter)
268  pTempPrinter->SetPrinterSettingsPreferred( bPreferPrinterPapersize );
269  }
270  }
271  }
272  else if ( aPropertyName == SC_UNO_APPLYDOCINF )
273  {
274  bool bTmp=true;
275  if ( aValue >>= bTmp )
276  pDocShell->SetUseUserData( bTmp );
277  }
278  else if ( aPropertyName == SC_UNO_SAVE_THUMBNAIL)
279  {
280  bool bTmp = true;
281  if (aValue >>= bTmp)
283  }
284  else if ( aPropertyName == SC_UNO_FORBIDDEN )
285  {
286  // read-only - should not be set
287  }
288  else if ( aPropertyName == SC_UNO_CHARCOMP )
289  {
290  // Int16 contains CharacterCompressionType values
291  sal_Int16 nUno = ScUnoHelpFunctions::GetInt16FromAny( aValue );
292  rDoc.SetAsianCompression( static_cast<CharCompressType>(nUno) );
293  bUpdateHeights = true;
294  }
295  else if ( aPropertyName == SC_UNO_ASIANKERN )
296  {
298  bUpdateHeights = true;
299  }
300  else if ( aPropertyName == SCSAVEVERSION )
301  {
302  bool bTmp=false;
303  if ( aValue >>= bTmp )
305  }
306  else if ( aPropertyName == SC_UNO_UPDTEMPL )
307  {
308  bool bTmp=true;
309  if ( aValue >>= bTmp )
311  }
312  else if ( aPropertyName == SC_UNO_LOADREADONLY )
313  {
314  bool bTmp=false;
315  if ( aValue >>= bTmp )
316  pDocShell->SetLoadReadonly( bTmp );
317  }
318  else if ( aPropertyName == SC_UNO_SHAREDOC )
319  {
320 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
321  bool bDocShared = false;
322  if ( aValue >>= bDocShared )
323  {
324  pDocShell->SetSharedXMLFlag( bDocShared );
325  }
326 #endif
327  }
328  else if ( aPropertyName == SC_UNO_MODIFYPASSWORDINFO )
329  {
330  uno::Sequence< beans::PropertyValue > aInfo;
331  if ( !( aValue >>= aInfo ) )
332  throw lang::IllegalArgumentException(
333  "Value of type Sequence<PropertyValue> expected!",
334  uno::Reference< uno::XInterface >(),
335  2 );
336 
337  if ( !pDocShell->SetModifyPasswordInfo( aInfo ) )
338  throw beans::PropertyVetoException(
339  "The hash is not allowed to be changed now!" );
340  }
341  else if (aPropertyName == SC_UNO_MODIFYPASSWORDHASH)
342  {
343  sal_Int32 nHash;
344  if (!(aValue >>= nHash))
345  throw lang::IllegalArgumentException("Value of type sal_Int32 expected!",
346  uno::Reference<uno::XInterface>(), 2);
347 
348  if (!pDocShell->SetModifyPasswordHash(nHash))
349  throw beans::PropertyVetoException("The hash is not allowed to be changed now!");
350  }
351  else if (aPropertyName == SC_UNO_EMBED_FONTS)
352  {
353  bool bVal = aValue.has<bool>() && aValue.get<bool>();
354  rDoc.SetEmbedFonts(bVal);
355  }
356  else if (aPropertyName == SC_UNO_EMBED_ONLY_USED_FONTS)
357  {
358  bool bVal = aValue.has<bool>() && aValue.get<bool>();
359  rDoc.SetEmbedUsedFontsOnly(bVal);
360  }
361  else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_LATIN)
362  {
363  bool bVal = aValue.has<bool>() && aValue.get<bool>();
364  rDoc.SetEmbedFontScriptLatin(bVal);
365  }
366  else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_ASIAN)
367  {
368  bool bVal = aValue.has<bool>() && aValue.get<bool>();
369  rDoc.SetEmbedFontScriptAsian(bVal);
370  }
371  else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_COMPLEX)
372  {
373  bool bVal = aValue.has<bool>() && aValue.get<bool>();
374  rDoc.SetEmbedFontScriptComplex(bVal);
375  }
376  else if ( aPropertyName == SC_UNO_SYNTAXSTRINGREF )
377  {
378  ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();
379  sal_Int16 nUno = 0;
380 
381  if( aValue >>= nUno )
382  {
383  switch (nUno)
384  {
385  case 0: // CONV_OOO
386  case 2: // CONV_XL_A1
387  case 3: // CONV_XL_R1C1
388  case 7: // CONV_A1_XL_A1
389  aCalcConfig.SetStringRefSyntax( static_cast<formula::FormulaGrammar::AddressConvention>( nUno ) );
390  break;
391  default:
393  break;
394 
395  }
396  rDoc.SetCalcConfig( aCalcConfig );
397  }
398  }
399 
400  else
401  {
402  ScGridOptions aGridOpt(aViewOpt.GetGridOptions());
403  if ( aPropertyName == SC_UNO_SNAPTORASTER )
405  else if ( aPropertyName == SC_UNO_RASTERVIS )
406  aGridOpt.SetGridVisible( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
407  else if ( aPropertyName == SC_UNO_RASTERRESX )
408  aGridOpt.SetFieldDrawX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
409  else if ( aPropertyName == SC_UNO_RASTERRESY )
410  aGridOpt.SetFieldDrawY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
411  else if ( aPropertyName == SC_UNO_RASTERSUBX )
412  aGridOpt.SetFieldDivisionX( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
413  else if ( aPropertyName == SC_UNO_RASTERSUBY )
414  aGridOpt.SetFieldDivisionY( static_cast <sal_uInt32> ( ScUnoHelpFunctions::GetInt32FromAny( aValue ) ) );
415  else if ( aPropertyName == SC_UNO_RASTERSYNC )
416  aGridOpt.SetSynchronize( ScUnoHelpFunctions::GetBoolFromAny( aValue ) );
417  else
418  throw beans::UnknownPropertyException(aPropertyName);
419  aViewOpt.SetGridOptions(aGridOpt);
420  }
421  rDoc.SetViewOptions(aViewOpt);
422 
423  if ( bUpdateHeights && !rDoc.IsImportingXML() )
424  {
425  // update automatic row heights and repaint
426  SCTAB nTabCount = rDoc.GetTableCount();
427  for (SCTAB nTab=0; nTab<nTabCount; nTab++)
428  if ( !pDocShell->AdjustRowHeight( 0, rDoc.MaxRow(), nTab ) )
429  pDocShell->PostPaint(ScRange(0, 0, nTab, rDoc.MaxCol(), rDoc.MaxRow(), nTab), PaintPartFlags::Grid);
431  }
432 
433 }
434 
435 uno::Any SAL_CALL ScDocumentConfiguration::getPropertyValue( const OUString& aPropertyName )
436 {
437  SolarMutexGuard aGuard;
438  uno::Any aRet;
439 
440  if(!pDocShell)
441  throw uno::RuntimeException();
442 
443  ScDocument& rDoc = pDocShell->GetDocument();
444  const ScViewOptions& aViewOpt = rDoc.GetViewOptions();
445 
446  /*Stampit enable/disable print cancel */
447  if ( aPropertyName == SC_UNO_ALLOWPRINTJOBCANCEL )
449  /*Stampit enable/disable print cancel */
450 
451  else if ( aPropertyName == SC_UNO_SHOWZERO )
452  aRet <<= aViewOpt.GetOption( VOPT_NULLVALS );
453  else if ( aPropertyName == SC_UNO_SHOWNOTES )
454  aRet <<= aViewOpt.GetOption( VOPT_NOTES );
455  else if ( aPropertyName == SC_UNO_SHOWGRID )
456  aRet <<= aViewOpt.GetOption( VOPT_GRID );
457  else if ( aPropertyName == SC_UNO_GRIDCOLOR )
458  {
459  OUString aColorName;
460  Color aColor = aViewOpt.GetGridColor(&aColorName);
461  aRet <<= aColor;
462  }
463  else if ( aPropertyName == SC_UNO_SHOWPAGEBR )
464  aRet <<= aViewOpt.GetOption( VOPT_PAGEBREAKS );
465  else if ( aPropertyName == SC_UNONAME_LINKUPD )
466  {
467  sal_Int16 nLUM;
468  switch (rDoc.GetLinkMode())
469  {
470  case LM_ALWAYS:
471  nLUM = css::document::LinkUpdateModes::AUTO;
472  break;
473  case LM_NEVER:
474  nLUM = css::document::LinkUpdateModes::NEVER;
475  break;
476  case LM_ON_DEMAND:
477  nLUM = css::document::LinkUpdateModes::MANUAL;
478  break;
479  case LM_UNKNOWN:
480  default:
481  nLUM = css::document::LinkUpdateModes::GLOBAL_SETTING;
482  break;
483  }
484  aRet <<= nLUM;
485  }
486  else if ( aPropertyName == SC_UNO_COLROWHDR )
487  aRet <<= aViewOpt.GetOption( VOPT_HEADER );
488  else if ( aPropertyName == SC_UNO_SHEETTABS )
489  aRet <<= aViewOpt.GetOption( VOPT_TABCONTROLS );
490  else if ( aPropertyName == SC_UNO_OUTLSYMB )
491  aRet <<= aViewOpt.GetOption( VOPT_OUTLINER );
492  else if ( aPropertyName == SC_UNO_AUTOCALC )
493  aRet <<= rDoc.GetAutoCalc();
494  else if ( aPropertyName == SC_UNO_PRINTERNAME )
495  {
496  // #i75610# don't create the printer, return empty string if no printer created yet
497  // (as in SwXDocumentSettings)
498  SfxPrinter* pPrinter = rDoc.GetPrinter( false );
499  if (pPrinter)
500  aRet <<= pPrinter->GetName();
501  else
502  aRet <<= OUString();
503  }
504  else if ( aPropertyName == SC_UNO_PRINTERSETUP )
505  {
506  // #i75610# don't create the printer, return empty sequence if no printer created yet
507  // (as in SwXDocumentSettings)
508  SfxPrinter* pPrinter = rDoc.GetPrinter( false );
509  if (pPrinter)
510  {
511  SvMemoryStream aStream;
512  pPrinter->Store( aStream );
513  aRet <<= uno::Sequence< sal_Int8 >( static_cast< const sal_Int8* >( aStream.GetData() ),
514  aStream.TellEnd() );
515  }
516  else
517  aRet <<= uno::Sequence<sal_Int8>();
518  }
519  else if ( aPropertyName == SC_UNO_PRINTERPAPER)
520  {
521  SfxPrinter *pTempPrinter = pDocShell->GetPrinter( false );
522  aRet <<= pTempPrinter && pTempPrinter->GetPrinterSettingsPreferred();
523 
524  }
525  else if ( aPropertyName == SC_UNO_APPLYDOCINF )
526  aRet <<= pDocShell->IsUseUserData();
527  else if ( aPropertyName == SC_UNO_SAVE_THUMBNAIL )
528  aRet <<= pDocShell->IsUseThumbnailSave();
529  else if ( aPropertyName == SC_UNO_FORBIDDEN )
530  {
531  aRet <<= uno::Reference<i18n::XForbiddenCharacters>(new ScForbiddenCharsObj( pDocShell ));
532  }
533  else if ( aPropertyName == SC_UNO_CHARCOMP )
534  aRet <<= static_cast<sal_Int16> ( rDoc.GetAsianCompression() );
535  else if ( aPropertyName == SC_UNO_ASIANKERN )
536  aRet <<= rDoc.GetAsianKerning();
537  else if ( aPropertyName == SCSAVEVERSION )
538  aRet <<= pDocShell->IsSaveVersionOnClose();
539  else if ( aPropertyName == SC_UNO_UPDTEMPL )
540  aRet <<= pDocShell->IsQueryLoadTemplate();
541  else if ( aPropertyName == SC_UNO_LOADREADONLY )
542  aRet <<= pDocShell->IsLoadReadonly();
543  else if ( aPropertyName == SC_UNO_SHAREDOC )
544  {
545 #if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
546  aRet <<= pDocShell->HasSharedXMLFlagSet();
547 #endif
548  }
549  else if ( aPropertyName == SC_UNO_MODIFYPASSWORDINFO )
550  aRet <<= pDocShell->GetModifyPasswordInfo();
551  else if (aPropertyName == SC_UNO_MODIFYPASSWORDHASH)
552  aRet <<= pDocShell->GetModifyPasswordHash();
553  else if (aPropertyName == SC_UNO_EMBED_FONTS)
554  aRet <<= rDoc.IsEmbedFonts();
555  else if (aPropertyName == SC_UNO_EMBED_ONLY_USED_FONTS)
556  aRet <<= rDoc.IsEmbedUsedFontsOnly();
557  else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_LATIN)
558  aRet <<= rDoc.IsEmbedFontScriptLatin();
559  else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_ASIAN)
560  aRet <<= rDoc.IsEmbedFontScriptAsian();
561  else if (aPropertyName == SC_UNO_EMBED_FONT_SCRIPT_COMPLEX)
562  aRet <<= rDoc.IsEmbedFontScriptComplex();
563  else if ( aPropertyName == SC_UNO_SYNTAXSTRINGREF )
564  {
565  ScCalcConfig aCalcConfig = rDoc.GetCalcConfig();
567 
568  // don't save "unspecified" string ref syntax ... query formula grammar
569  // and save that instead
571  {
572  eConv = rDoc.GetAddressConvention();
573  }
574 
575  // write if it has been read|imported or explicitly changed
576  // or if ref syntax isn't what would be native for our file format
577  // i.e. CalcA1 in this case
578  if ( aCalcConfig.mbHasStringRefSyntax ||
580  {
581  switch (eConv)
582  {
587  aRet <<= static_cast<sal_Int16>( eConv );
588  break;
589 
595  {
596  aRet <<= sal_Int16(9999);
597  break;
598  }
599  }
600  }
601  }
602 
603  else
604  {
605  const ScGridOptions& aGridOpt = aViewOpt.GetGridOptions();
606  if ( aPropertyName == SC_UNO_SNAPTORASTER )
607  aRet <<= aGridOpt.GetUseGridSnap();
608  else if ( aPropertyName == SC_UNO_RASTERVIS )
609  aRet <<= aGridOpt.GetGridVisible();
610  else if ( aPropertyName == SC_UNO_RASTERRESX )
611  aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDrawX() );
612  else if ( aPropertyName == SC_UNO_RASTERRESY )
613  aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDrawY() );
614  else if ( aPropertyName == SC_UNO_RASTERSUBX )
615  aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDivisionX() );
616  else if ( aPropertyName == SC_UNO_RASTERSUBY )
617  aRet <<= static_cast<sal_Int32> ( aGridOpt.GetFieldDivisionY() );
618  else if ( aPropertyName == SC_UNO_RASTERSYNC )
619  aRet <<= aGridOpt.GetSynchronize();
620  else
621  throw beans::UnknownPropertyException(aPropertyName);
622  }
623 
624 
625  return aRet;
626 }
627 
629 
630 // XServiceInfo
631 OUString SAL_CALL ScDocumentConfiguration::getImplementationName()
632 {
633  return "ScDocumentConfiguration";
634 }
635 
636 sal_Bool SAL_CALL ScDocumentConfiguration::supportsService( const OUString& rServiceName )
637 {
638  return cppu::supportsService(this, rServiceName);
639 }
640 
641 uno::Sequence<OUString> SAL_CALL ScDocumentConfiguration::getSupportedServiceNames()
642 {
643  return {"com.sun.star.comp.SpreadsheetSettings",
644  "com.sun.star.document.Settings"};
645 }
646 
647 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define SC_UNO_COLROWHDR
Definition: unonames.hxx:538
sal_uInt32 GetFieldDivisionY() const
#define SC_UNO_UPDTEMPL
Definition: unonames.hxx:574
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:451
SC_DLLPUBLIC ScLinkMode GetLinkMode(SCTAB nTab) const
Definition: documen3.cxx:504
void SetEmbedUsedFontsOnly(bool bUse)
Definition: document.hxx:580
bool IsUseUserData() const
#define SC_UNO_RASTERSYNC
Definition: unonames.hxx:562
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
merge with docfunc
Definition: docsh5.cxx:404
void SetEmbedFontScriptComplex(bool bUse)
Definition: document.hxx:583
static constexpr auto Items
bool HasSharedXMLFlagSet() const
void SetAsianKerning(bool bNew)
Definition: documen9.cxx:664
#define SC_UNO_RASTERRESX
Definition: unonames.hxx:558
signed char sal_Int8
#define SC_UNO_EMBED_FONT_SCRIPT_ASIAN
Definition: unonames.hxx:702
bool IsEmbedFontScriptLatin() const
Definition: document.hxx:575
#define SC_UNO_FORBIDDEN
Definition: unonames.hxx:46
sal_uInt32 GetFieldDrawX() const
sal_Int64 n
#define SC_UNO_SAVE_THUMBNAIL
Definition: unonames.hxx:568
void SetDocumentModified()
Definition: docsh.cxx:2941
sal_uInt64 Seek(sal_uInt64 nPos)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: confuno.cxx:435
ScDocShell * pDocShell
Definition: confuno.hxx:36
void SetSharedXMLFlag(bool bFlag) const
#define SC_UNO_EMBED_FONTS
Definition: unonames.hxx:699
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: confuno.cxx:113
virtual ~ScDocumentConfiguration() override
Definition: confuno.cxx:105
SC_DLLPUBLIC formula::FormulaGrammar::AddressConvention GetAddressConvention() const
Definition: documen3.cxx:494
SfxHintId GetId() const
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: confuno.cxx:636
#define SC_UNO_LOADREADONLY
Definition: unonames.hxx:667
#define SC_UNO_PRINTERNAME
Definition: unonames.hxx:564
#define SC_UNO_MODIFYPASSWORDINFO
Definition: unonames.hxx:668
virtual sal_uInt64 TellEnd() override
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6087
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: documen8.cxx:115
void SetEmbedFontScriptLatin(bool bUse)
Definition: document.hxx:581
#define SC_UNO_RASTERRESY
Definition: unonames.hxx:559
#define SC_UNO_SHOWGRID
Definition: unonames.hxx:548
#define SC_UNO_PRINTERSETUP
Definition: unonames.hxx:565
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: confuno.cxx:641
SC_DLLPUBLIC SCROW MaxRow() const
Definition: document.hxx:872
SC_DLLPUBLIC SCTAB GetTableCount() const
Definition: document.cxx:314
void SetEmbedFontScriptAsian(bool bUse)
Definition: document.hxx:582
ScLkUpdMode
Definition: global.hxx:419
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define SC_UNO_EMBED_FONT_SCRIPT_COMPLEX
Definition: unonames.hxx:703
#define SC_UNO_RASTERVIS
Definition: unonames.hxx:557
Mode eMode
bool IsEmbedUsedFontsOnly() const
Definition: document.hxx:574
#define SC_UNO_RASTERSUBX
Definition: unonames.hxx:560
#define SC_UNO_SHOWPAGEBR
Definition: unonames.hxx:552
SfxObjectCreateMode GetCreateMode() const
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: confuno.cxx:125
sal_uInt16 SetPrinter(VclPtr< SfxPrinter > const &pNewPrinter, SfxPrinterChangeFlags nDiffFlags=SFX_PRINTER_ALL)
Definition: docsh3.cxx:471
#define SC_UNO_EMBED_ONLY_USED_FONTS
Definition: unonames.hxx:700
const SfxItemSet & GetOptions() const
#define SC_UNO_RASTERSUBY
Definition: unonames.hxx:561
SC_DLLPUBLIC SCCOL MaxCol() const
Definition: document.hxx:871
bool IsImportingXML() const
Definition: document.hxx:2150
bool GetUseGridSnap() const
#define STREAM_SEEK_TO_BEGIN
#define SC_UNO_SNAPTORASTER
Definition: unonames.hxx:556
SC_DLLPUBLIC void SetAutoCalc(bool bNewAutoCalc)
Definition: documen7.cxx:602
#define SC_MOD()
Definition: scmod.hxx:250
#define SC_UNO_GRIDCOLOR
Definition: unonames.hxx:539
bool Stamp_GetPrintCancelState() const
SC_DLLPUBLIC void SetViewOptions(const ScViewOptions &rOpt)
Definition: documen3.cxx:1967
static sal_Int32 GetInt32FromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:152
const css::uno::Sequence< css::beans::PropertyValue > & GetModifyPasswordInfo() const
static VclPtr< SfxPrinter > Create(SvStream &rStream, std::unique_ptr< SfxItemSet > &&pOptions)
void SetSaveVersionOnClose(bool bSet)
sal_uInt32 GetFieldDivisionX() const
float u
unsigned char sal_Bool
const SfxItemPropertyMap & getPropertyMap() const
bool GetOption(ScViewOption eOpt) const
Definition: viewopti.hxx:88
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: confuno.cxx:133
sal_uInt32 GetModifyPasswordHash() const
css::uno::Type const & get()
void SetUseThumbnailSave(bool _bNew)
const ScGridOptions & GetGridOptions() const
Definition: viewopti.hxx:96
void SetUseUserData(bool bNew)
void Store(SvStream &rStream) const
#define SC_UNO_CHARCOMP
Definition: unonames.hxx:569
#define SC_UNO_SHOWZERO
Definition: unonames.hxx:553
static const SfxItemPropertyMapEntry * lcl_GetConfigPropertyMap()
Definition: confuno.cxx:50
ScDocumentConfiguration(ScDocShell *pDocShell)
Definition: confuno.cxx:98
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax
Definition: calcconfig.hxx:53
bool GetSynchronize() const
static sal_Int16 GetInt16FromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:144
#define SC_IMPL_DUMMY_PROPERTY_LISTENER(ClassName)
Definition: miscuno.hxx:72
SC_DLLPUBLIC const ScViewOptions & GetViewOptions() const
Definition: documen3.cxx:1961
void AddUnoObject(SfxListener &rObject)
Definition: documen3.cxx:898
Configuration options for formula interpreter.
Definition: calcconfig.hxx:43
#define SC_UNO_ASIANKERN
Definition: unonames.hxx:570
bool SetModifyPasswordHash(sal_uInt32 nHash)
#define SC_UNO_ALLOWPRINTJOBCANCEL
Definition: unonames.hxx:579
#define SC_UNO_APPLYDOCINF
Definition: unonames.hxx:567
#define SC_UNO_SHEETTABS
Definition: unonames.hxx:543
bool GetAsianKerning() const
Definition: documen9.cxx:656
bool IsEmbedFonts() const
Definition: document.hxx:573
bool IsUseThumbnailSave() const
bool mbHasStringRefSyntax
Definition: calcconfig.hxx:56
bool IsQueryLoadTemplate() const
bool IsSaveVersionOnClose() const
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
const ScCalcConfig & GetCalcConfig() const
Definition: document.hxx:2532
void SetEmbedFonts(bool bUse)
Definition: document.hxx:579
void SetUseGridSnap(bool bSet)
#define SC_UNO_EMBED_FONT_SCRIPT_LATIN
Definition: unonames.hxx:701
#define SC_UNO_OUTLSYMB
Definition: unonames.hxx:542
bool IsEmbedFontScriptComplex() const
Definition: document.hxx:577
#define SC_UNO_PRINTERPAPER
Definition: unonames.hxx:566
bool SetModifyPasswordInfo(const css::uno::Sequence< css::beans::PropertyValue > &aInfo)
sal_uInt32 GetFieldDrawY() const
void RemoveUnoObject(SfxListener &rObject)
Definition: documen3.cxx:906
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
SfxItemPropertySet aPropSet
Definition: confuno.hxx:37
#define SC_UNO_SHOWNOTES
Definition: unonames.hxx:550
Color const & GetGridColor(OUString *pStrName=nullptr) const
Definition: viewopti.cxx:118
void SetLinkMode(ScLkUpdMode nSet)
Definition: document.hxx:2184
constexpr OUStringLiteral SCSAVEVERSION
Definition: confuno.cxx:48
bool IsEmbedFontScriptAsian() const
Definition: document.hxx:576
#define SC_UNO_SYNTAXSTRINGREF
Definition: unonames.hxx:530
void SetLoadReadonly(bool _bReadonly)
void SetQueryLoadTemplate(bool b)
#define SC_UNONAME_LINKUPD
Definition: unonames.hxx:237
static bool GetBoolFromAny(const css::uno::Any &aAny)
Definition: miscuno.cxx:138
bool IsLoadReadonly() const
void Stamp_SetPrintCancelState(bool bState)
void SetAsianCompression(CharCompressType nNew)
Definition: documen9.cxx:642
bool GetGridVisible() const
SC_DLLPUBLIC void SetCalcConfig(const ScCalcConfig &rConfig)
Definition: document10.cxx:199
#define SC_UNO_SHAREDOC
Definition: unonames.hxx:690
CharCompressType GetAsianCompression() const
Definition: documen9.cxx:634
sal_Int16 SCTAB
Definition: types.hxx:22
const void * GetData()
SC_DLLPUBLIC bool GetAutoCalc() const
Definition: document.hxx:1360
void SetStringRefSyntax(formula::FormulaGrammar::AddressConvention eConv)
Definition: calcconfig.cxx:165
#define SC_UNO_AUTOCALC
Definition: unonames.hxx:563
#define SC_UNO_MODIFYPASSWORDHASH
Definition: unonames.hxx:669