/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
elseif ( aPropertyName == SC_UNO_SHOWZERO )
aViewOpt.SetOption(VOPT_NULLVALS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_SHOWNOTES )
aViewOpt.SetOption(VOPT_NOTES, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_SHOWNOTEAUTHOR )
aViewOpt.SetOption(VOPT_NOTEAUTHOR, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_SHOWFORMULASMARKS )
aViewOpt.SetOption(VOPT_FORMULAS_MARKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_SHOWGRID )
aViewOpt.SetOption(VOPT_GRID, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_GRIDCOLOR )
{
Color aColor; if (aValue >>= aColor)
aViewOpt.SetGridColor(aColor, OUString());
} elseif ( aPropertyName == SC_UNO_SHOWPAGEBR )
aViewOpt.SetOption(VOPT_PAGEBREAKS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNONAME_LINKUPD )
{ // XXX NOTE: this is the css::document::Settings property // LinkUpdateMode, not the css::sheet::XGlobalSheetSettings // attribute LinkUpdateMode.
sal_Int16 n; if (!(aValue >>= n) || n < css::document::LinkUpdateModes::NEVER ||
n > css::document::LinkUpdateModes::GLOBAL_SETTING)
{ throw css::lang::IllegalArgumentException(
(u"LinkUpdateMode property value must be a SHORT with a value in" " the range of the css::document::LinkUpdateModes constants"_ustr),
css::uno::Reference<css::uno::XInterface>(), -1);
}
ScLkUpdMode eMode; switch (n)
{ case css::document::LinkUpdateModes::NEVER:
eMode = LM_NEVER; break; case css::document::LinkUpdateModes::MANUAL:
eMode = LM_ON_DEMAND; break; case css::document::LinkUpdateModes::AUTO:
eMode = LM_ALWAYS; break; case css::document::LinkUpdateModes::GLOBAL_SETTING: default:
eMode = ScModule::get()->GetAppOptions().GetLinkMode(); break;
}
rDoc.SetLinkMode( eMode );
} elseif ( aPropertyName == SC_UNO_COLROWHDR )
aViewOpt.SetOption(VOPT_HEADER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_SHEETTABS )
aViewOpt.SetOption(VOPT_TABCONTROLS, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_OUTLSYMB )
aViewOpt.SetOption(VOPT_OUTLINER, ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_AUTOCALC )
rDoc.SetAutoCalc( ScUnoHelpFunctions::GetBoolFromAny( aValue ) ); elseif ( aPropertyName == SC_UNO_PRINTERNAME )
{
OUString sPrinterName; if ( !(aValue >>= sPrinterName) ) throw lang::IllegalArgumentException();
// #i75610# if the name is empty, do nothing (don't create any printer) if ( !sPrinterName.isEmpty() && pDocShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
{
SfxPrinter* pPrinter = pDocShell->GetPrinter(); if (!pPrinter) throw uno::RuntimeException();
if (pPrinter->GetName() != sPrinterName)
{
VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName ); if (pNewPrinter->IsKnown())
pDocShell->SetPrinter( pNewPrinter, SfxPrinterChangeFlags::PRINTER ); else
pNewPrinter.disposeAndClear();
}
}
} elseif ( aPropertyName == SC_UNO_PRINTERSETUP )
{
uno::Sequence<sal_Int8> aSequence; if ( aValue >>= aSequence )
{
sal_uInt32 nSize = aSequence.getLength(); // #i75610# if the sequence is empty, do nothing (don't create any printer) if ( nSize != 0 )
{
SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ );
aStream.Seek ( STREAM_SEEK_TO_BEGIN ); auto pSet = std::make_unique<SfxItemSetFixed
<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
SID_PRINT_SELECTEDSHEET, SID_PRINT_SELECTEDSHEET,
SID_SCPRINTOPTIONS, SID_SCPRINTOPTIONS>>( *rDoc.GetPool());
if ( !pDocShell->SetModifyPasswordInfo( aInfo ) ) throw beans::PropertyVetoException(
u"The hash is not allowed to be changed now!"_ustr );
} elseif (aPropertyName == SC_UNO_MODIFYPASSWORDHASH)
{
sal_Int32 nHash; if (!(aValue >>= nHash)) throw lang::IllegalArgumentException(u"Value of type sal_Int32 expected!"_ustr,
uno::Reference<uno::XInterface>(), 2);
// don't save "unspecified" string ref syntax ... query formula grammar // and save that instead if( eConv == formula::FormulaGrammar::CONV_UNSPECIFIED)
{
eConv = rDoc.GetAddressConvention();
}
// write if it has been read|imported or explicitly changed // or if ref syntax isn't what would be native for our file format // i.e. CalcA1 in this case if ( aCalcConfig.mbHasStringRefSyntax ||
(eConv != formula::FormulaGrammar::CONV_OOO) )
{ switch (eConv)
{ case formula::FormulaGrammar::CONV_OOO: case formula::FormulaGrammar::CONV_XL_A1: case formula::FormulaGrammar::CONV_XL_R1C1: case formula::FormulaGrammar::CONV_A1_XL_A1:
aRet <<= static_cast<sal_Int16>( eConv ); break;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.