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