LibreOffice Module starmath (master) 1
unomodel.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#include <sal/log.hxx>
22
23#include <utility>
24
25#include <o3tl/any.hxx>
26#include <sfx2/printer.hxx>
27#include <svl/itemprop.hxx>
28#include <svl/itemset.hxx>
29#include <vcl/svapp.hxx>
31#include <vcl/settings.hxx>
32#include <vcl/print.hxx>
34#include <com/sun/star/beans/PropertyAttribute.hpp>
35#include <com/sun/star/formula/SymbolDescriptor.hpp>
36#include <com/sun/star/awt/Size.hpp>
43#include <editeng/paperinf.hxx>
45#include <tools/mapunit.hxx>
46#include <tools/stream.hxx>
47
48#include <unomodel.hxx>
49#include <document.hxx>
50#include <view.hxx>
51#include <symbol.hxx>
52#include <starmath.hrc>
53#include <strings.hrc>
54#include <smmod.hxx>
55#include <cfgitem.hxx>
56
57using namespace ::cppu;
58using namespace ::comphelper;
59using namespace ::com::sun::star;
60using namespace ::com::sun::star::uno;
61using namespace ::com::sun::star::beans;
62using namespace ::com::sun::star::lang;
63using namespace ::com::sun::star::formula;
64using namespace ::com::sun::star::view;
65using namespace ::com::sun::star::script;
66
68{
69 SmModule *pp = SM_MOD();
70 SmMathConfig *pConfig = pp->GetConfig();
71 SAL_WARN_IF( !pConfig, "starmath", "SmConfig not found" );
72 if (!pConfig)
73 return;
74
75 sal_Int32 nNumProps = 10, nIdx=0;
76
77 // create sequence of print UI options
78 // (Actually IsIgnoreSpacesRight is a parser option. Without it we need only 8 properties here.)
79 m_aUIProperties.resize( nNumProps );
80
81 // load the math PrinterOptions into the custom tab
82 m_aUIProperties[nIdx].Name = "OptionsUIFile";
83 m_aUIProperties[nIdx++].Value <<= OUString("modules/smath/ui/printeroptions.ui");
84
85 // create Section for formula (results in an extra tab page in dialog)
87 OUString aAppGroupname(
88 SmResId( RID_PRINTUIOPT_PRODNAME ).
89 replaceFirst( "%s", aOpt.GetModuleName( SvtModuleOptions::EModule::MATH ) ) );
90 m_aUIProperties[nIdx++].Value = setGroupControlOpt("tabcontrol-page2", aAppGroupname, ".HelpID:vcl:PrintDialog:TabPage:AppPage");
91
92 // create subgroup for print options
93 m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("contents", SmResId( RID_PRINTUIOPT_CONTENTS ), OUString());
94
95 // create a bool option for title row (matches to SID_PRINTTITLE)
96 m_aUIProperties[nIdx++].Value = setBoolControlOpt("title", SmResId( RID_PRINTUIOPT_TITLE ),
97 ".HelpID:vcl:PrintDialog:TitleRow:CheckBox",
99 pConfig->IsPrintTitle());
100 // create a bool option for formula text (matches to SID_PRINTTEXT)
101 m_aUIProperties[nIdx++].Value = setBoolControlOpt("formulatext", SmResId( RID_PRINTUIOPT_FRMLTXT ),
102 ".HelpID:vcl:PrintDialog:FormulaText:CheckBox",
104 pConfig->IsPrintFormulaText());
105 // create a bool option for border (matches to SID_PRINTFRAME)
106 m_aUIProperties[nIdx++].Value = setBoolControlOpt("borders", SmResId( RID_PRINTUIOPT_BORDERS ),
107 ".HelpID:vcl:PrintDialog:Border:CheckBox",
109 pConfig->IsPrintFrame());
110
111 // create subgroup for print format
112 m_aUIProperties[nIdx++].Value = setSubgroupControlOpt("size", SmResId( RID_PRINTUIOPT_SIZE ), OUString());
113
114 // create a radio button group for print format (matches to SID_PRINTSIZE)
115 Sequence< OUString > aChoices{
116 SmResId( RID_PRINTUIOPT_ORIGSIZE ),
117 SmResId( RID_PRINTUIOPT_FITTOPAGE ),
118 SmResId( RID_PRINTUIOPT_SCALING )
119 };
120 Sequence< OUString > aHelpIds{
121 ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:0",
122 ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:1",
123 ".HelpID:vcl:PrintDialog:PrintFormat:RadioButton:2"
124 };
125 Sequence< OUString > aWidgetIds{
126 "originalsize",
127 "fittopage",
128 "scaling"
129 };
130 OUString aPrintFormatProp( PRTUIOPT_PRINT_FORMAT );
131 m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(),
132 aHelpIds,
133 aPrintFormatProp,
134 aChoices, static_cast< sal_Int32 >(pConfig->GetPrintSize())
135 );
136
137 // create a numeric box for scale dependent on PrintFormat = "Scaling" (matches to SID_PRINTZOOM)
138 vcl::PrinterOptionsHelper::UIControlOptions aRangeOpt( aPrintFormatProp, 2, true );
139 m_aUIProperties[nIdx++].Value = setRangeControlOpt("scalingspin", OUString(),
140 ".HelpID:vcl:PrintDialog:PrintScale:NumericField",
142 pConfig->GetPrintZoomFactor(), // initial value
143 10, // min value
144 1000, // max value
145 aRangeOpt);
146
147 Sequence aHintNoLayoutPage{ comphelper::makePropertyValue("HintNoLayoutPage", true) };
148 m_aUIProperties[nIdx++].Value <<= aHintNoLayoutPage;
149
150 assert(nIdx == nNumProps);
151}
152
153
154
155namespace {
156
157enum SmModelPropertyHandles
158{
159 HANDLE_FORMULA,
160 HANDLE_FONT_NAME_VARIABLES,
161 HANDLE_FONT_NAME_FUNCTIONS,
162 HANDLE_FONT_NAME_NUMBERS,
163 HANDLE_FONT_NAME_TEXT,
164 HANDLE_CUSTOM_FONT_NAME_SERIF,
165 HANDLE_CUSTOM_FONT_NAME_SANS,
166 HANDLE_CUSTOM_FONT_NAME_FIXED,
167 HANDLE_CUSTOM_FONT_FIXED_POSTURE,
168 HANDLE_CUSTOM_FONT_FIXED_WEIGHT,
169 HANDLE_CUSTOM_FONT_SANS_POSTURE,
170 HANDLE_CUSTOM_FONT_SANS_WEIGHT,
171 HANDLE_CUSTOM_FONT_SERIF_POSTURE,
172 HANDLE_CUSTOM_FONT_SERIF_WEIGHT,
173 HANDLE_FONT_VARIABLES_POSTURE,
174 HANDLE_FONT_VARIABLES_WEIGHT,
175 HANDLE_FONT_FUNCTIONS_POSTURE,
176 HANDLE_FONT_FUNCTIONS_WEIGHT,
177 HANDLE_FONT_NUMBERS_POSTURE,
178 HANDLE_FONT_NUMBERS_WEIGHT,
179 HANDLE_FONT_TEXT_POSTURE,
180 HANDLE_FONT_TEXT_WEIGHT,
181 HANDLE_BASE_FONT_HEIGHT,
182 HANDLE_RELATIVE_FONT_HEIGHT_TEXT,
183 HANDLE_RELATIVE_FONT_HEIGHT_INDICES,
184 HANDLE_RELATIVE_FONT_HEIGHT_FUNCTIONS,
185 HANDLE_RELATIVE_FONT_HEIGHT_OPERATORS,
186 HANDLE_RELATIVE_FONT_HEIGHT_LIMITS,
187 HANDLE_IS_TEXT_MODE,
188 HANDLE_GREEK_CHAR_STYLE,
189 HANDLE_ALIGNMENT,
190 HANDLE_RELATIVE_SPACING,
191 HANDLE_RELATIVE_LINE_SPACING,
192 HANDLE_RELATIVE_ROOT_SPACING,
193 HANDLE_RELATIVE_INDEX_SUPERSCRIPT,
194 HANDLE_RELATIVE_INDEX_SUBSCRIPT,
195 HANDLE_RELATIVE_FRACTION_NUMERATOR_HEIGHT,
196 HANDLE_RELATIVE_FRACTION_DENOMINATOR_DEPTH,
197 HANDLE_RELATIVE_FRACTION_BAR_EXCESS_LENGTH,
198 HANDLE_RELATIVE_FRACTION_BAR_LINE_WEIGHT,
199 HANDLE_RELATIVE_UPPER_LIMIT_DISTANCE,
200 HANDLE_RELATIVE_LOWER_LIMIT_DISTANCE,
201 HANDLE_RELATIVE_BRACKET_EXCESS_SIZE,
202 HANDLE_RELATIVE_BRACKET_DISTANCE,
203 HANDLE_IS_SCALE_ALL_BRACKETS,
204 HANDLE_RELATIVE_SCALE_BRACKET_EXCESS_SIZE,
205 HANDLE_RELATIVE_MATRIX_LINE_SPACING,
206 HANDLE_RELATIVE_MATRIX_COLUMN_SPACING,
207 HANDLE_RELATIVE_SYMBOL_PRIMARY_HEIGHT,
208 HANDLE_RELATIVE_SYMBOL_MINIMUM_HEIGHT,
209 HANDLE_RELATIVE_OPERATOR_EXCESS_SIZE,
210 HANDLE_RELATIVE_OPERATOR_SPACING,
211 HANDLE_LEFT_MARGIN,
212 HANDLE_RIGHT_MARGIN,
213 HANDLE_TOP_MARGIN,
214 HANDLE_BOTTOM_MARGIN,
215 HANDLE_PRINTER_NAME,
216 HANDLE_PRINTER_SETUP,
217 HANDLE_SYMBOLS,
218 HANDLE_SAVE_THUMBNAIL,
219 HANDLE_USED_SYMBOLS,
220 HANDLE_BASIC_LIBRARIES,
221 HANDLE_RUNTIME_UID,
222 HANDLE_LOAD_READONLY, // Security Options
223 HANDLE_DIALOG_LIBRARIES, // #i73329#
224 HANDLE_BASELINE,
225 HANDLE_INTEROP_GRAB_BAG,
226 HANDLE_STARMATH_VERSION
227};
228
229}
230
232{
233 static const PropertyMapEntry aModelPropertyInfoMap[] =
234 {
235 { OUString("Alignment") , HANDLE_ALIGNMENT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
236 { OUString("BaseFontHeight") , HANDLE_BASE_FONT_HEIGHT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
237 { OUString("BasicLibraries") , HANDLE_BASIC_LIBRARIES , cppu::UnoType<script::XLibraryContainer>::get(), PropertyAttribute::READONLY, 0 },
238 { OUString("BottomMargin") , HANDLE_BOTTOM_MARGIN , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_BOTTOMSPACE },
239 { OUString("CustomFontNameFixed") , HANDLE_CUSTOM_FONT_NAME_FIXED , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_FIXED },
240 { OUString("CustomFontNameSans") , HANDLE_CUSTOM_FONT_NAME_SANS , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_SANS },
241 { OUString("CustomFontNameSerif") , HANDLE_CUSTOM_FONT_NAME_SERIF , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_SERIF },
242 { OUString("DialogLibraries") , HANDLE_DIALOG_LIBRARIES , cppu::UnoType<script::XLibraryContainer>::get(), PropertyAttribute::READONLY, 0 },
243 { OUString("FontFixedIsBold") , HANDLE_CUSTOM_FONT_FIXED_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_FIXED },
244 { OUString("FontFixedIsItalic") , HANDLE_CUSTOM_FONT_FIXED_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_FIXED },
245 { OUString("FontFunctionsIsBold") , HANDLE_FONT_FUNCTIONS_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_FUNCTION },
246 { OUString("FontFunctionsIsItalic") , HANDLE_FONT_FUNCTIONS_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_FUNCTION },
247 { OUString("FontNameFunctions") , HANDLE_FONT_NAME_FUNCTIONS , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_FUNCTION },
248 { OUString("FontNameNumbers") , HANDLE_FONT_NAME_NUMBERS , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_NUMBER },
249 { OUString("FontNameText") , HANDLE_FONT_NAME_TEXT , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_TEXT },
250 { OUString("FontNameVariables") , HANDLE_FONT_NAME_VARIABLES , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, FNT_VARIABLE },
251 { OUString("FontNumbersIsBold") , HANDLE_FONT_NUMBERS_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_NUMBER },
252 { OUString("FontNumbersIsItalic") , HANDLE_FONT_NUMBERS_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_NUMBER },
253 { OUString("FontSansIsBold") , HANDLE_CUSTOM_FONT_SANS_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_SANS },
254 { OUString("FontSansIsItalic") , HANDLE_CUSTOM_FONT_SANS_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_SANS },
255 { OUString("FontSerifIsBold") , HANDLE_CUSTOM_FONT_SERIF_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_SERIF },
256 { OUString("FontSerifIsItalic") , HANDLE_CUSTOM_FONT_SERIF_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_SERIF },
257 { OUString("FontTextIsBold") , HANDLE_FONT_TEXT_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_TEXT },
258 { OUString("FontTextIsItalic") , HANDLE_FONT_TEXT_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_TEXT },
259 { OUString("FontVariablesIsBold") , HANDLE_FONT_VARIABLES_WEIGHT , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_VARIABLE },
260 { OUString("FontVariablesIsItalic") , HANDLE_FONT_VARIABLES_POSTURE , cppu::UnoType<bool>::get(), PROPERTY_NONE, FNT_VARIABLE },
261 { OUString("Formula") , HANDLE_FORMULA , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
262 { OUString("IsScaleAllBrackets") , HANDLE_IS_SCALE_ALL_BRACKETS , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
263 { OUString("IsTextMode") , HANDLE_IS_TEXT_MODE , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
264 { OUString("GreekCharStyle") , HANDLE_GREEK_CHAR_STYLE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
265 { OUString("LeftMargin") , HANDLE_LEFT_MARGIN , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_LEFTSPACE },
266 { OUString("PrinterName") , HANDLE_PRINTER_NAME , ::cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0 },
267 { OUString("PrinterSetup") , HANDLE_PRINTER_SETUP , cppu::UnoType<const Sequence < sal_Int8 >>::get(), PROPERTY_NONE, 0 },
268 { OUString("RelativeBracketDistance") , HANDLE_RELATIVE_BRACKET_DISTANCE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_BRACKETSPACE },
269 { OUString("RelativeBracketExcessSize") , HANDLE_RELATIVE_BRACKET_EXCESS_SIZE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_BRACKETSIZE },
270 { OUString("RelativeFontHeightFunctions") , HANDLE_RELATIVE_FONT_HEIGHT_FUNCTIONS , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, SIZ_FUNCTION },
271 { OUString("RelativeFontHeightIndices") , HANDLE_RELATIVE_FONT_HEIGHT_INDICES , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, SIZ_INDEX },
272 { OUString("RelativeFontHeightLimits") , HANDLE_RELATIVE_FONT_HEIGHT_LIMITS , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, SIZ_LIMITS },
273 { OUString("RelativeFontHeightOperators") , HANDLE_RELATIVE_FONT_HEIGHT_OPERATORS , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, SIZ_OPERATOR },
274 { OUString("RelativeFontHeightText") , HANDLE_RELATIVE_FONT_HEIGHT_TEXT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, SIZ_TEXT },
275 { OUString("RelativeFractionBarExcessLength") , HANDLE_RELATIVE_FRACTION_BAR_EXCESS_LENGTH, ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_FRACTION },
276 { OUString("RelativeFractionBarLineWeight") , HANDLE_RELATIVE_FRACTION_BAR_LINE_WEIGHT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_STROKEWIDTH },
277 { OUString("RelativeFractionDenominatorDepth") , HANDLE_RELATIVE_FRACTION_DENOMINATOR_DEPTH, ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_DENOMINATOR },
278 { OUString("RelativeFractionNumeratorHeight") , HANDLE_RELATIVE_FRACTION_NUMERATOR_HEIGHT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_NUMERATOR },
279 { OUString("RelativeIndexSubscript") , HANDLE_RELATIVE_INDEX_SUBSCRIPT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_SUBSCRIPT },
280 { OUString("RelativeIndexSuperscript") , HANDLE_RELATIVE_INDEX_SUPERSCRIPT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_SUPERSCRIPT },
281 { OUString("RelativeLineSpacing") , HANDLE_RELATIVE_LINE_SPACING , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_VERTICAL },
282 { OUString("RelativeLowerLimitDistance") , HANDLE_RELATIVE_LOWER_LIMIT_DISTANCE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_LOWERLIMIT },
283 { OUString("RelativeMatrixColumnSpacing") , HANDLE_RELATIVE_MATRIX_COLUMN_SPACING , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_MATRIXCOL },
284 { OUString("RelativeMatrixLineSpacing") , HANDLE_RELATIVE_MATRIX_LINE_SPACING , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_MATRIXROW },
285 { OUString("RelativeOperatorExcessSize") , HANDLE_RELATIVE_OPERATOR_EXCESS_SIZE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_OPERATORSIZE },
286 { OUString("RelativeOperatorSpacing") , HANDLE_RELATIVE_OPERATOR_SPACING , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_OPERATORSPACE },
287 { OUString("RelativeRootSpacing") , HANDLE_RELATIVE_ROOT_SPACING , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_ROOT },
288 { OUString("RelativeScaleBracketExcessSize") , HANDLE_RELATIVE_SCALE_BRACKET_EXCESS_SIZE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_NORMALBRACKETSIZE },
289 { OUString("RelativeSpacing") , HANDLE_RELATIVE_SPACING , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_HORIZONTAL },
290 { OUString("RelativeSymbolMinimumHeight") , HANDLE_RELATIVE_SYMBOL_MINIMUM_HEIGHT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_ORNAMENTSPACE },
291 { OUString("RelativeSymbolPrimaryHeight") , HANDLE_RELATIVE_SYMBOL_PRIMARY_HEIGHT , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_ORNAMENTSIZE },
292 { OUString("RelativeUpperLimitDistance") , HANDLE_RELATIVE_UPPER_LIMIT_DISTANCE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_UPPERLIMIT },
293 { OUString("RightMargin") , HANDLE_RIGHT_MARGIN , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_RIGHTSPACE },
294 { OUString("RuntimeUID") , HANDLE_RUNTIME_UID , cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0 },
295 { OUString("SaveThumbnail") , HANDLE_SAVE_THUMBNAIL , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
296 { OUString("Symbols") , HANDLE_SYMBOLS , cppu::UnoType<Sequence < SymbolDescriptor >>::get(), PROPERTY_NONE, 0 },
297 { OUString("UserDefinedSymbolsInUse") , HANDLE_USED_SYMBOLS , cppu::UnoType<Sequence < SymbolDescriptor >>::get(), PropertyAttribute::READONLY, 0 },
298 { OUString("TopMargin") , HANDLE_TOP_MARGIN , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, DIS_TOPSPACE },
299 // #i33095# Security Options
300 { OUString("LoadReadonly") , HANDLE_LOAD_READONLY , cppu::UnoType<bool>::get(), PROPERTY_NONE, 0 },
301 // #i972#
302 { OUString("BaseLine") , HANDLE_BASELINE , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
303 { OUString("InteropGrabBag") , HANDLE_INTEROP_GRAB_BAG , cppu::UnoType<uno::Sequence< beans::PropertyValue >>::get(), PROPERTY_NONE, 0 },
304 { OUString("SyntaxVersion") , HANDLE_STARMATH_VERSION , ::cppu::UnoType<sal_Int16>::get(), PROPERTY_NONE, 0 },
305 };
306 static const rtl::Reference<PropertySetInfo> PROPS_INFO = new PropertySetInfo ( aModelPropertyInfoMap );
307 return PROPS_INFO;
308}
309
311: SfxBaseModel(pObjSh)
312, PropertySetHelper ( lcl_createModelPropertyInfo () )
313{
314}
315
317{
318}
319
321{
322 uno::Any aRet = ::cppu::queryInterface ( rType,
323 // PropertySetHelper interfaces
324 static_cast< XPropertySet* > ( this ),
325 static_cast< XMultiPropertySet* > ( this ),
326 // my own interfaces
327 static_cast< XServiceInfo* > ( this ),
328 static_cast< XRenderable* > ( this ) );
329 if (!aRet.hasValue())
330 aRet = SfxBaseModel::queryInterface ( rType );
331 return aRet;
332}
333
334void SAL_CALL SmModel::acquire() noexcept
335{
336 OWeakObject::acquire();
337}
338
339void SAL_CALL SmModel::release() noexcept
340{
341 OWeakObject::release();
342}
343
344uno::Sequence< uno::Type > SAL_CALL SmModel::getTypes( )
345{
347 uno::Sequence {
352}
353
354const uno::Sequence< sal_Int8 > & SmModel::getUnoTunnelId()
355{
356 static const comphelper::UnoIdInit theSmModelUnoTunnelId;
357 return theSmModelUnoTunnelId.getSeq();
358}
359
360sal_Int64 SAL_CALL SmModel::getSomething( const uno::Sequence< sal_Int8 >& rId )
361{
362 return comphelper::getSomethingImpl(rId, this,
364}
365
366static sal_Int16 lcl_AnyToINT16(const uno::Any& rAny)
367{
368 sal_Int16 nRet = 0;
369 if( auto x = o3tl::tryAccess<double>(rAny) )
370 nRet = static_cast<sal_Int16>(*x);
371 else
372 rAny >>= nRet;
373 return nRet;
374}
375
377{
378 return "com.sun.star.comp.Math.FormulaDocument";
379}
380
381sal_Bool SmModel::supportsService(const OUString& rServiceName)
382{
383 return cppu::supportsService(this, rServiceName);
384}
385
386uno::Sequence< OUString > SmModel::getSupportedServiceNames()
387{
388 static constexpr OUStringLiteral service1 = u"com.sun.star.document.OfficeDocument";
389 static constexpr OUStringLiteral service2 = u"com.sun.star.formula.FormulaProperties";
390 return uno::Sequence<OUString>{ service1, service2 };
391}
392
393void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* pValues)
394{
395 SolarMutexGuard aGuard;
396
397 SmDocShell *pDocSh = static_cast < SmDocShell * > (GetObjectShell());
398
399 if ( nullptr == pDocSh )
400 throw UnknownPropertyException();
401
402 SmFormat aFormat = pDocSh->GetFormat();
403
404 for (; *ppEntries; ppEntries++, pValues++ )
405 {
406 if ((*ppEntries)->mnAttributes & PropertyAttribute::READONLY)
407 throw PropertyVetoException();
408
409 switch ( (*ppEntries)->mnHandle )
410 {
411 case HANDLE_FORMULA:
412 {
413 OUString aText;
414 *pValues >>= aText;
415 pDocSh->SetText(aText);
416 }
417 break;
418 case HANDLE_FONT_NAME_VARIABLES :
419 case HANDLE_FONT_NAME_FUNCTIONS :
420 case HANDLE_FONT_NAME_NUMBERS :
421 case HANDLE_FONT_NAME_TEXT :
422 case HANDLE_CUSTOM_FONT_NAME_SERIF :
423 case HANDLE_CUSTOM_FONT_NAME_SANS :
424 case HANDLE_CUSTOM_FONT_NAME_FIXED :
425 {
426 OUString sFontName;
427 *pValues >>= sFontName;
428 if(sFontName.isEmpty())
429 throw IllegalArgumentException();
430
431 if(aFormat.GetFont((*ppEntries)->mnMemberId).GetFamilyName() != sFontName)
432 {
433 const SmFace rOld = aFormat.GetFont((*ppEntries)->mnMemberId);
434
435 SmFace aSet( sFontName, rOld.GetFontSize() );
436 aSet.SetBorderWidth( rOld.GetBorderWidth() );
438 aFormat.SetFont( (*ppEntries)->mnMemberId, aSet );
439 }
440 }
441 break;
442 case HANDLE_CUSTOM_FONT_FIXED_POSTURE:
443 case HANDLE_CUSTOM_FONT_SANS_POSTURE :
444 case HANDLE_CUSTOM_FONT_SERIF_POSTURE:
445 case HANDLE_FONT_VARIABLES_POSTURE :
446 case HANDLE_FONT_FUNCTIONS_POSTURE :
447 case HANDLE_FONT_NUMBERS_POSTURE :
448 case HANDLE_FONT_TEXT_POSTURE :
449 {
450 auto bVal = o3tl::tryAccess<bool>(*pValues);
451 if(!bVal)
452 throw IllegalArgumentException();
453 vcl::Font aNewFont(aFormat.GetFont((*ppEntries)->mnMemberId));
454 aNewFont.SetItalic(*bVal ? ITALIC_NORMAL : ITALIC_NONE);
455 aFormat.SetFont((*ppEntries)->mnMemberId, aNewFont);
456 }
457 break;
458 case HANDLE_CUSTOM_FONT_FIXED_WEIGHT :
459 case HANDLE_CUSTOM_FONT_SANS_WEIGHT :
460 case HANDLE_CUSTOM_FONT_SERIF_WEIGHT :
461 case HANDLE_FONT_VARIABLES_WEIGHT :
462 case HANDLE_FONT_FUNCTIONS_WEIGHT :
463 case HANDLE_FONT_NUMBERS_WEIGHT :
464 case HANDLE_FONT_TEXT_WEIGHT :
465 {
466 auto bVal = o3tl::tryAccess<bool>(*pValues);
467 if(!bVal)
468 throw IllegalArgumentException();
469 vcl::Font aNewFont(aFormat.GetFont((*ppEntries)->mnMemberId));
470 aNewFont.SetWeight(*bVal ? WEIGHT_BOLD : WEIGHT_NORMAL);
471 aFormat.SetFont((*ppEntries)->mnMemberId, aNewFont);
472 }
473 break;
474 case HANDLE_BASE_FONT_HEIGHT :
475 {
476 // Point!
477 sal_Int16 nVal = lcl_AnyToINT16(*pValues);
478 if(nVal < 1)
479 throw IllegalArgumentException();
480 Size aSize = aFormat.GetBaseSize();
482 aFormat.SetBaseSize(aSize);
483
484 // apply base size to fonts
485 const Size aTmp( aFormat.GetBaseSize() );
486 for (sal_uInt16 i = FNT_BEGIN; i <= FNT_END; i++)
487 aFormat.SetFontSize(i, aTmp);
488 }
489 break;
490 case HANDLE_RELATIVE_FONT_HEIGHT_TEXT :
491 case HANDLE_RELATIVE_FONT_HEIGHT_INDICES :
492 case HANDLE_RELATIVE_FONT_HEIGHT_FUNCTIONS :
493 case HANDLE_RELATIVE_FONT_HEIGHT_OPERATORS :
494 case HANDLE_RELATIVE_FONT_HEIGHT_LIMITS :
495 {
496 sal_Int16 nVal = 0;
497 *pValues >>= nVal;
498 if(nVal < 1)
499 throw IllegalArgumentException();
500 aFormat.SetRelSize((*ppEntries)->mnMemberId, nVal);
501 }
502 break;
503
504 case HANDLE_IS_TEXT_MODE :
505 {
506 aFormat.SetTextmode(*o3tl::doAccess<bool>(*pValues));
507 }
508 break;
509
510 case HANDLE_GREEK_CHAR_STYLE :
511 {
512 sal_Int16 nVal = 0;
513 *pValues >>= nVal;
514 if (nVal < 0 || nVal > 2)
515 throw IllegalArgumentException();
516 aFormat.SetGreekCharStyle( nVal );
517 }
518 break;
519
520 case HANDLE_ALIGNMENT :
521 {
522 // SmHorAlign uses the same values as HorizontalAlignment
523 sal_Int16 nVal = 0;
524 *pValues >>= nVal;
525 if(nVal < 0 || nVal > 2)
526 throw IllegalArgumentException();
527 aFormat.SetHorAlign(static_cast<SmHorAlign>(nVal));
528 }
529 break;
530
531 case HANDLE_RELATIVE_SPACING :
532 case HANDLE_RELATIVE_LINE_SPACING :
533 case HANDLE_RELATIVE_ROOT_SPACING :
534 case HANDLE_RELATIVE_INDEX_SUPERSCRIPT :
535 case HANDLE_RELATIVE_INDEX_SUBSCRIPT :
536 case HANDLE_RELATIVE_FRACTION_NUMERATOR_HEIGHT :
537 case HANDLE_RELATIVE_FRACTION_DENOMINATOR_DEPTH:
538 case HANDLE_RELATIVE_FRACTION_BAR_EXCESS_LENGTH:
539 case HANDLE_RELATIVE_FRACTION_BAR_LINE_WEIGHT :
540 case HANDLE_RELATIVE_UPPER_LIMIT_DISTANCE :
541 case HANDLE_RELATIVE_LOWER_LIMIT_DISTANCE :
542 case HANDLE_RELATIVE_BRACKET_EXCESS_SIZE :
543 case HANDLE_RELATIVE_BRACKET_DISTANCE :
544 case HANDLE_RELATIVE_SCALE_BRACKET_EXCESS_SIZE :
545 case HANDLE_RELATIVE_MATRIX_LINE_SPACING :
546 case HANDLE_RELATIVE_MATRIX_COLUMN_SPACING :
547 case HANDLE_RELATIVE_SYMBOL_PRIMARY_HEIGHT :
548 case HANDLE_RELATIVE_SYMBOL_MINIMUM_HEIGHT :
549 case HANDLE_RELATIVE_OPERATOR_EXCESS_SIZE :
550 case HANDLE_RELATIVE_OPERATOR_SPACING :
551 case HANDLE_LEFT_MARGIN :
552 case HANDLE_RIGHT_MARGIN :
553 case HANDLE_TOP_MARGIN :
554 case HANDLE_BOTTOM_MARGIN :
555 {
556 sal_Int16 nVal = 0;
557 *pValues >>= nVal;
558 if(nVal < 0)
559 throw IllegalArgumentException();
560 aFormat.SetDistance((*ppEntries)->mnMemberId, nVal);
561 }
562 break;
563 case HANDLE_IS_SCALE_ALL_BRACKETS :
564 aFormat.SetScaleNormalBrackets(*o3tl::doAccess<bool>(*pValues));
565 break;
566 case HANDLE_PRINTER_NAME:
567 {
568 // embedded documents just ignore this property for now
569 if ( pDocSh->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
570 {
571 SfxPrinter *pPrinter = pDocSh->GetPrinter ( );
572 if (pPrinter)
573 {
574 OUString sPrinterName;
575 if ( !(*pValues >>= sPrinterName) )
576 throw IllegalArgumentException();
577
578 if ( !sPrinterName.isEmpty() )
579 {
580 VclPtrInstance<SfxPrinter> pNewPrinter( pPrinter->GetOptions().Clone(), sPrinterName );
581 if (pNewPrinter->IsKnown())
582 pDocSh->SetPrinter ( pNewPrinter );
583 else
584 pNewPrinter.disposeAndClear();
585 }
586 }
587 }
588 }
589 break;
590 case HANDLE_PRINTER_SETUP:
591 {
592 Sequence < sal_Int8 > aSequence;
593 if ( !(*pValues >>= aSequence) )
594 throw IllegalArgumentException();
595
596 sal_uInt32 nSize = aSequence.getLength();
597 SvMemoryStream aStream ( aSequence.getArray(), nSize, StreamMode::READ );
598 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
599 auto pItemSet = std::make_unique<SfxItemSetFixed<
600 SID_PRINTTITLE, SID_PRINTTITLE,
601 SID_PRINTTEXT, SID_PRINTTEXT,
602 SID_PRINTFRAME, SID_PRINTFRAME,
603 SID_PRINTSIZE, SID_PRINTSIZE,
604 SID_PRINTZOOM, SID_PRINTZOOM,
605 SID_NO_RIGHT_SPACES, SID_NO_RIGHT_SPACES,
606 SID_SAVE_ONLY_USED_SYMBOLS, SID_SAVE_ONLY_USED_SYMBOLS,
607 SID_AUTO_CLOSE_BRACKETS, SID_SMEDITWINDOWZOOM>> ( SmDocShell::GetPool() );
608 SmModule *pp = SM_MOD();
609 pp->GetConfig()->ConfigToItemSet(*pItemSet);
610 VclPtr<SfxPrinter> pPrinter = SfxPrinter::Create ( aStream, std::move(pItemSet) );
611
612 pDocSh->SetPrinter( pPrinter );
613 }
614 break;
615 case HANDLE_SYMBOLS:
616 {
617 // this is set
618 Sequence < SymbolDescriptor > aSequence;
619 if ( !(*pValues >>= aSequence) )
620 throw IllegalArgumentException();
621
622 SmModule *pp = SM_MOD();
623 SmSymbolManager &rManager = pp->GetSymbolManager();
624 for (const SymbolDescriptor& rDescriptor : std::as_const(aSequence))
625 {
626 vcl::Font aFont;
627 aFont.SetFamilyName ( rDescriptor.sFontName );
628 aFont.SetCharSet ( static_cast < rtl_TextEncoding > (rDescriptor.nCharSet) );
629 aFont.SetFamily ( static_cast < FontFamily > (rDescriptor.nFamily ) );
630 aFont.SetPitch ( static_cast < FontPitch > (rDescriptor.nPitch ) );
631 aFont.SetWeight ( static_cast < FontWeight > (rDescriptor.nWeight ) );
632 aFont.SetItalic ( static_cast < FontItalic > (rDescriptor.nItalic ) );
633 SmSym aSymbol ( rDescriptor.sName, aFont, static_cast < sal_Unicode > (rDescriptor.nCharacter),
634 rDescriptor.sSymbolSet );
635 aSymbol.SetExportName ( rDescriptor.sExportName );
636 rManager.AddOrReplaceSymbol ( aSymbol );
637 }
638 }
639 break;
640 // #i33095# Security Options
641 case HANDLE_LOAD_READONLY :
642 {
643 if ( (*pValues).getValueType() != cppu::UnoType<bool>::get() )
644 throw IllegalArgumentException();
645 bool bReadonly = false;
646 if ( *pValues >>= bReadonly )
647 pDocSh->SetLoadReadonly( bReadonly );
648 break;
649 }
650 case HANDLE_INTEROP_GRAB_BAG:
652 break;
653 case HANDLE_SAVE_THUMBNAIL:
654 {
655 if ((*pValues).getValueType() != cppu::UnoType<bool>::get())
656 throw IllegalArgumentException();
657 bool bThumbnail = false;
658 if (*pValues >>= bThumbnail)
659 pDocSh->SetUseThumbnailSave(bThumbnail);
660 }
661 break;
662 case HANDLE_STARMATH_VERSION:
663 pDocSh->SetSmSyntaxVersion(pValues->get<sal_uInt16>());
664 break;
665 }
666 }
667
668 pDocSh->SetFormat( aFormat );
669
670 // #i67283# since about all of the above changes are likely to change
671 // the formula size we have to recalculate the vis-area now
672 pDocSh->SetVisArea( tools::Rectangle( Point(0, 0), pDocSh->GetSize() ) );
673}
674
675void SmModel::_getPropertyValues( const PropertyMapEntry **ppEntries, Any *pValue )
676{
677 SmDocShell *pDocSh = static_cast < SmDocShell * > (GetObjectShell());
678
679 if ( nullptr == pDocSh )
680 throw UnknownPropertyException();
681
682 const SmFormat & aFormat = pDocSh->GetFormat();
683
684 for (; *ppEntries; ppEntries++, pValue++ )
685 {
686 switch ( (*ppEntries)->mnHandle )
687 {
688 case HANDLE_FORMULA:
689 *pValue <<= pDocSh->GetText();
690 break;
691 case HANDLE_FONT_NAME_VARIABLES :
692 case HANDLE_FONT_NAME_FUNCTIONS :
693 case HANDLE_FONT_NAME_NUMBERS :
694 case HANDLE_FONT_NAME_TEXT :
695 case HANDLE_CUSTOM_FONT_NAME_SERIF :
696 case HANDLE_CUSTOM_FONT_NAME_SANS :
697 case HANDLE_CUSTOM_FONT_NAME_FIXED :
698 {
699 const SmFace & rFace = aFormat.GetFont((*ppEntries)->mnMemberId);
700 *pValue <<= rFace.GetFamilyName();
701 }
702 break;
703 case HANDLE_CUSTOM_FONT_FIXED_POSTURE:
704 case HANDLE_CUSTOM_FONT_SANS_POSTURE :
705 case HANDLE_CUSTOM_FONT_SERIF_POSTURE:
706 case HANDLE_FONT_VARIABLES_POSTURE :
707 case HANDLE_FONT_FUNCTIONS_POSTURE :
708 case HANDLE_FONT_NUMBERS_POSTURE :
709 case HANDLE_FONT_TEXT_POSTURE :
710 {
711 const SmFace & rFace = aFormat.GetFont((*ppEntries)->mnMemberId);
712 *pValue <<= IsItalic( rFace );
713 }
714 break;
715 case HANDLE_CUSTOM_FONT_FIXED_WEIGHT :
716 case HANDLE_CUSTOM_FONT_SANS_WEIGHT :
717 case HANDLE_CUSTOM_FONT_SERIF_WEIGHT :
718 case HANDLE_FONT_VARIABLES_WEIGHT :
719 case HANDLE_FONT_FUNCTIONS_WEIGHT :
720 case HANDLE_FONT_NUMBERS_WEIGHT :
721 case HANDLE_FONT_TEXT_WEIGHT :
722 {
723 const SmFace & rFace = aFormat.GetFont((*ppEntries)->mnMemberId);
724 *pValue <<= IsBold( rFace );
725 }
726 break;
727 case HANDLE_BASE_FONT_HEIGHT :
728 {
729 // Point!
730 *pValue <<= sal_Int16(o3tl::convert(aFormat.GetBaseSize().Height(),
732 }
733 break;
734 case HANDLE_RELATIVE_FONT_HEIGHT_TEXT :
735 case HANDLE_RELATIVE_FONT_HEIGHT_INDICES :
736 case HANDLE_RELATIVE_FONT_HEIGHT_FUNCTIONS :
737 case HANDLE_RELATIVE_FONT_HEIGHT_OPERATORS :
738 case HANDLE_RELATIVE_FONT_HEIGHT_LIMITS :
739 *pValue <<= static_cast<sal_Int16>(aFormat.GetRelSize((*ppEntries)->mnMemberId));
740 break;
741
742 case HANDLE_IS_TEXT_MODE :
743 *pValue <<= aFormat.IsTextmode();
744 break;
745
746 case HANDLE_GREEK_CHAR_STYLE :
747 *pValue <<= aFormat.GetGreekCharStyle();
748 break;
749
750 case HANDLE_ALIGNMENT :
751 // SmHorAlign uses the same values as HorizontalAlignment
752 *pValue <<= static_cast<sal_Int16>(aFormat.GetHorAlign());
753 break;
754
755 case HANDLE_RELATIVE_SPACING :
756 case HANDLE_RELATIVE_LINE_SPACING :
757 case HANDLE_RELATIVE_ROOT_SPACING :
758 case HANDLE_RELATIVE_INDEX_SUPERSCRIPT :
759 case HANDLE_RELATIVE_INDEX_SUBSCRIPT :
760 case HANDLE_RELATIVE_FRACTION_NUMERATOR_HEIGHT :
761 case HANDLE_RELATIVE_FRACTION_DENOMINATOR_DEPTH:
762 case HANDLE_RELATIVE_FRACTION_BAR_EXCESS_LENGTH:
763 case HANDLE_RELATIVE_FRACTION_BAR_LINE_WEIGHT :
764 case HANDLE_RELATIVE_UPPER_LIMIT_DISTANCE :
765 case HANDLE_RELATIVE_LOWER_LIMIT_DISTANCE :
766 case HANDLE_RELATIVE_BRACKET_EXCESS_SIZE :
767 case HANDLE_RELATIVE_BRACKET_DISTANCE :
768 case HANDLE_RELATIVE_SCALE_BRACKET_EXCESS_SIZE :
769 case HANDLE_RELATIVE_MATRIX_LINE_SPACING :
770 case HANDLE_RELATIVE_MATRIX_COLUMN_SPACING :
771 case HANDLE_RELATIVE_SYMBOL_PRIMARY_HEIGHT :
772 case HANDLE_RELATIVE_SYMBOL_MINIMUM_HEIGHT :
773 case HANDLE_RELATIVE_OPERATOR_EXCESS_SIZE :
774 case HANDLE_RELATIVE_OPERATOR_SPACING :
775 case HANDLE_LEFT_MARGIN :
776 case HANDLE_RIGHT_MARGIN :
777 case HANDLE_TOP_MARGIN :
778 case HANDLE_BOTTOM_MARGIN :
779 *pValue <<= static_cast<sal_Int16>(aFormat.GetDistance((*ppEntries)->mnMemberId));
780 break;
781 case HANDLE_IS_SCALE_ALL_BRACKETS :
782 *pValue <<= aFormat.IsScaleNormalBrackets();
783 break;
784 case HANDLE_PRINTER_NAME:
785 {
786 SfxPrinter *pPrinter = pDocSh->GetPrinter ( );
787 *pValue <<= pPrinter ? pPrinter->GetName() : OUString();
788 }
789 break;
790 case HANDLE_PRINTER_SETUP:
791 {
792 SfxPrinter *pPrinter = pDocSh->GetPrinter ();
793 if (pPrinter)
794 {
795 SvMemoryStream aStream;
796 pPrinter->Store( aStream );
797 sal_uInt32 nSize = aStream.TellEnd();
798 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
799 Sequence < sal_Int8 > aSequence ( nSize );
800 aStream.ReadBytes(aSequence.getArray(), nSize);
801 *pValue <<= aSequence;
802 }
803 }
804 break;
805 case HANDLE_SYMBOLS:
806 case HANDLE_USED_SYMBOLS:
807 {
808 const bool bUsedSymbolsOnly = (*ppEntries)->mnHandle == HANDLE_USED_SYMBOLS;
809 const std::set< OUString > &rUsedSymbols = pDocSh->GetUsedSymbols();
810
811 // this is get
812 SmModule *pp = SM_MOD();
813 const SmSymbolManager &rManager = pp->GetSymbolManager();
814 std::vector < const SmSym * > aVector;
815
816 const SymbolPtrVec_t aSymbols( rManager.GetSymbols() );
817 for (const SmSym* pSymbol : aSymbols)
818 {
819 if (pSymbol && !pSymbol->IsPredefined() &&
820 (!bUsedSymbolsOnly ||
821 rUsedSymbols.find( pSymbol->GetName() ) != rUsedSymbols.end()))
822 aVector.push_back ( pSymbol );
823 }
824 Sequence < SymbolDescriptor > aSequence ( aVector.size() );
825 SymbolDescriptor * pDescriptor = aSequence.getArray();
826
827 for (const SmSym* pSymbol : aVector)
828 {
829 pDescriptor->sName = pSymbol->GetName();
830 pDescriptor->sExportName = pSymbol->GetExportName();
831 pDescriptor->sSymbolSet = pSymbol->GetSymbolSetName();
832 pDescriptor->nCharacter = static_cast < sal_Int32 > (pSymbol->GetCharacter());
833
834 vcl::Font rFont = pSymbol->GetFace();
835 pDescriptor->sFontName = rFont.GetFamilyName();
836 pDescriptor->nCharSet = sal::static_int_cast< sal_Int16 >(rFont.GetCharSet());
837 pDescriptor->nFamily = sal::static_int_cast< sal_Int16 >(rFont.GetFamilyType());
838 pDescriptor->nPitch = sal::static_int_cast< sal_Int16 >(rFont.GetPitch());
839 pDescriptor->nWeight = sal::static_int_cast< sal_Int16 >(rFont.GetWeight());
840 pDescriptor->nItalic = sal::static_int_cast< sal_Int16 >(rFont.GetItalic());
841 pDescriptor++;
842 }
843 *pValue <<= aSequence;
844 }
845 break;
846 case HANDLE_BASIC_LIBRARIES:
847 *pValue <<= pDocSh->GetBasicContainer();
848 break;
849 case HANDLE_DIALOG_LIBRARIES:
850 *pValue <<= pDocSh->GetDialogContainer();
851 break;
852 case HANDLE_RUNTIME_UID:
853 *pValue <<= getRuntimeUID();
854 break;
855 // #i33095# Security Options
856 case HANDLE_LOAD_READONLY :
857 {
858 *pValue <<= pDocSh->IsLoadReadonly();
859 break;
860 }
861 // #i972#
862 case HANDLE_BASELINE:
863 {
864 if ( !pDocSh->GetFormulaTree() )
865 pDocSh->Parse();
866 if ( pDocSh->GetFormulaTree() )
867 {
868 pDocSh->ArrangeFormula();
869
870 *pValue <<= static_cast<sal_Int32>( pDocSh->GetFormulaTree()->GetFormulaBaseline() );
871 }
872 break;
873 }
874 case HANDLE_INTEROP_GRAB_BAG:
875 getGrabBagItem(*pValue);
876 break;
877 case HANDLE_SAVE_THUMBNAIL:
878 {
879 *pValue <<= pDocSh->IsUseThumbnailSave();
880 }
881 break;
882 case HANDLE_STARMATH_VERSION:
883 *pValue <<= pDocSh->GetSmSyntaxVersion();
884 break;
885 }
886 }
887}
888
889
890sal_Int32 SAL_CALL SmModel::getRendererCount(
891 const uno::Any& /*rSelection*/,
892 const uno::Sequence< beans::PropertyValue >& /*xOptions*/ )
893{
894 return 1;
895}
896
897uno::Sequence< beans::PropertyValue > SAL_CALL SmModel::getRenderer(
898 sal_Int32 nRenderer,
899 const uno::Any& /*rSelection*/,
900 const uno::Sequence< beans::PropertyValue >& /*rxOptions*/ )
901{
902 SolarMutexGuard aGuard;
903
904 if (0 != nRenderer)
905 throw IllegalArgumentException();
906
907 SmDocShell *pDocSh = static_cast < SmDocShell * >( GetObjectShell() );
908 if (!pDocSh)
909 throw RuntimeException();
910
911 SmPrinterAccess aPrinterAccess( *pDocSh );
912 Printer *pPrinter = aPrinterAccess.GetPrinter();
913 Size aPrtPaperSize ( pPrinter->GetPaperSize() );
914
915 // if paper size is 0 (usually if no 'real' printer is found),
916 // guess the paper size
917 if (aPrtPaperSize.IsEmpty())
919 awt::Size aPageSize( aPrtPaperSize.Width(), aPrtPaperSize.Height() );
920
921 uno::Sequence< beans::PropertyValue > aRenderer(1);
922 PropertyValue &rValue = aRenderer.getArray()[0];
923 rValue.Name = "PageSize";
924 rValue.Value <<= aPageSize;
925
928 m_pPrintUIOptions->appendPrintUIOptions( aRenderer );
929
930 return aRenderer;
931}
932
933void SAL_CALL SmModel::render(
934 sal_Int32 nRenderer,
935 const uno::Any& rSelection,
936 const uno::Sequence< beans::PropertyValue >& rxOptions )
937{
938 SolarMutexGuard aGuard;
939
940 if (0 != nRenderer)
941 throw IllegalArgumentException();
942
943 SmDocShell *pDocSh = static_cast < SmDocShell * >( GetObjectShell() );
944 if (!pDocSh)
945 throw RuntimeException();
946
947 // get device to be rendered in
948 uno::Reference< awt::XDevice > xRenderDevice;
949 for (const auto& rxOption : rxOptions)
950 {
951 if( rxOption.Name == "RenderDevice" )
952 rxOption.Value >>= xRenderDevice;
953 }
954
955 if (!xRenderDevice.is())
956 return;
957
958 VCLXDevice* pDevice = dynamic_cast<VCLXDevice*>( xRenderDevice.get() );
959 VclPtr< OutputDevice> pOut = pDevice ? pDevice->GetOutputDevice()
961 if (!pOut)
962 throw RuntimeException();
963
964 pOut->SetMapMode(MapMode(SmMapUnit()));
965
966 uno::Reference< frame::XModel > xModel;
967 rSelection >>= xModel;
968 if (xModel != pDocSh->GetModel())
969 return;
970
973 SfxViewShell* pViewSh = SfxViewShell::GetFirst( false /* search non-visible views as well*/, checkSfxViewShell<SmViewShell> );
974 while (pViewSh && pViewSh->GetObjectShell() != pDocSh)
975 pViewSh = SfxViewShell::GetNext( *pViewSh, false /* search non-visible views as well*/, checkSfxViewShell<SmViewShell> );
976 SmViewShell *pView = dynamic_cast< SmViewShell *>( pViewSh );
977 SAL_WARN_IF( !pView, "starmath", "SmModel::render : no SmViewShell found" );
978
979 if (!pView)
980 return;
981
982 SmPrinterAccess aPrinterAccess( *pDocSh );
983 Printer *pPrinter = aPrinterAccess.GetPrinter();
984
985 Size aPrtPaperSize ( pPrinter->GetPaperSize() );
986 Size aOutputSize ( pPrinter->GetOutputSize() );
987 Point aPrtPageOffset( pPrinter->GetPageOffset() );
988
989 // no real printer ??
990 if (aPrtPaperSize.IsEmpty())
991 {
993 // factors from Windows DIN A4
994 aOutputSize = Size( static_cast<tools::Long>(aPrtPaperSize.Width() * 0.941),
995 static_cast<tools::Long>(aPrtPaperSize.Height() * 0.961));
996 aPrtPageOffset = Point( static_cast<tools::Long>(aPrtPaperSize.Width() * 0.0250),
997 static_cast<tools::Long>(aPrtPaperSize.Height() * 0.0214));
998 }
999 tools::Rectangle OutputRect( Point(), aOutputSize );
1000
1001
1002 // set minimum top and bottom border
1003 if (aPrtPageOffset.Y() < 2000)
1004 OutputRect.AdjustTop(2000 - aPrtPageOffset.Y() );
1005 if ((aPrtPaperSize.Height() - (aPrtPageOffset.Y() + OutputRect.Bottom())) < 2000)
1006 OutputRect.AdjustBottom( -(2000 - (aPrtPaperSize.Height() -
1007 (aPrtPageOffset.Y() + OutputRect.Bottom()))) );
1008
1009 // set minimum left and right border
1010 if (aPrtPageOffset.X() < 2500)
1011 OutputRect.AdjustLeft(2500 - aPrtPageOffset.X() );
1012 if ((aPrtPaperSize.Width() - (aPrtPageOffset.X() + OutputRect.Right())) < 1500)
1013 OutputRect.AdjustRight( -(1500 - (aPrtPaperSize.Width() -
1014 (aPrtPageOffset.X() + OutputRect.Right()))) );
1015
1016 if (!m_pPrintUIOptions)
1018 m_pPrintUIOptions->processProperties( rxOptions );
1019
1020 pView->Impl_Print( *pOut, *m_pPrintUIOptions, OutputRect );
1021
1022 // release SmPrintUIOptions when everything is done.
1023 // That way, when SmPrintUIOptions is needed again it will read the latest configuration settings in its c-tor.
1024 if (m_pPrintUIOptions->getBoolValue( "IsLastPage" ))
1025 {
1026 m_pPrintUIOptions.reset();
1027 }
1028}
1029
1030void SAL_CALL SmModel::setParent( const uno::Reference< uno::XInterface >& xParent)
1031{
1032 SolarMutexGuard aGuard;
1033 SfxBaseModel::setParent( xParent );
1035 GetObjectShell()->OnDocumentPrinterChanged(pDoc->GetDocumentPrinter());
1036}
1037
1039 ::sax_fastparser::FSHelperPtr const pSerializer,
1040 oox::core::OoxmlVersion const version,
1041 oox::drawingml::DocumentType const documentType, sal_Int8 nAlign)
1042{
1043 static_cast<SmDocShell*>(GetObjectShell())->writeFormulaOoxml(pSerializer, version, documentType, nAlign);
1044}
1045
1046void SmModel::writeFormulaRtf(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding)
1047{
1048 static_cast<SmDocShell*>(GetObjectShell())->writeFormulaRtf(rBuffer, nEncoding);
1049}
1050
1052{
1053 static_cast< SmDocShell* >( GetObjectShell())->readFormulaOoxml( stream );
1054}
1055
1057{
1058 return static_cast< SmDocShell* >( GetObjectShell())->GetSize();
1059}
1060
1061/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const PropertyValue * pValues
Size GetOutputSize() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
Point GetPageOffset() const
Size GetPaperSize() const
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
void getGrabBagItem(css::uno::Any &rVal) const
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &xParent) override
SfxObjectShell * GetObjectShell() const
OUString const & getRuntimeUID() const
void setGrabBagItem(const css::uno::Any &rVal)
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
virtual std::unique_ptr< SfxItemSet > Clone(bool bItems=true, SfxItemPool *pToPool=nullptr) const
css::uno::Reference< css::script::XLibraryContainer > GetBasicContainer()
virtual void OnDocumentPrinterChanged(Printer *pNewPrinter)
bool IsLoadReadonly() const
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
css::uno::Reference< css::script::XLibraryContainer > GetDialogContainer()
css::uno::Reference< css::frame::XModel3 > GetModel() const
void SetUseThumbnailSave(bool _bNew)
bool IsUseThumbnailSave() const
void SetLoadReadonly(bool _bReadonly)
SfxObjectCreateMode GetCreateMode() const
void Store(SvStream &rStream) const
static VclPtr< SfxPrinter > Create(SvStream &rStream, std::unique_ptr< SfxItemSet > &&pOptions)
const SfxItemSet & GetOptions() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
virtual SfxObjectShell * GetObjectShell() override
bool IsEmpty() const
constexpr tools::Long Height() const
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
void SetFormat(SmFormat const &rFormat)
Definition: document.cxx:189
void SetText(const OUString &rBuffer)
Definition: document.cxx:138
virtual void SetVisArea(const tools::Rectangle &rVisArea) override
Definition: document.cxx:1153
const SmTableNode * GetFormulaTree() const
Definition: document.hxx:176
SfxPrinter * GetPrinter()
Definition: document.hxx:160
void SetPrinter(SfxPrinter *)
Definition: document.cxx:505
static SfxItemPool & GetPool()
Definition: document.cxx:1148
Size GetSize()
Definition: document.cxx:364
const OUString & GetText() const
Definition: document.hxx:170
void Parse()
Definition: document.cxx:223
void ArrangeFormula()
Definition: document.cxx:235
void SetSmSyntaxVersion(sal_uInt16 nSmSyntaxVersion)
Definition: document.cxx:101
const SmFormat & GetFormat() const
Definition: document.hxx:172
sal_uInt16 GetSmSyntaxVersion() const
Definition: document.hxx:178
const std::set< OUString > & GetUsedSymbols() const
Definition: document.hxx:181
tools::Long GetBorderWidth() const
Definition: utility.cxx:218
void SetBorderWidth(tools::Long nWidth)
Definition: utility.hxx:66
void SetTextmode(bool bVal)
Definition: format.hxx:127
const Size & GetBaseSize() const
Definition: format.hxx:107
const SmFace & GetFont(sal_uInt16 nIdent) const
Definition: format.hxx:110
sal_uInt16 GetRelSize(sal_uInt16 nIdent) const
Definition: format.hxx:117
void SetRelSize(sal_uInt16 nIdent, sal_uInt16 nVal)
Definition: format.hxx:118
bool IsTextmode() const
Definition: format.hxx:126
bool IsScaleNormalBrackets() const
Definition: format.hxx:132
void SetHorAlign(SmHorAlign eAlign)
Definition: format.hxx:124
void SetScaleNormalBrackets(bool bVal)
Definition: format.hxx:133
void SetGreekCharStyle(sal_Int16 nVal)
Definition: format.hxx:130
void SetFontSize(sal_uInt16 nIdent, const Size &rSize)
Definition: format.hxx:112
void SetFont(sal_uInt16 nIdent, const SmFace &rFont, bool bDefault=false)
Definition: format.cxx:91
sal_uInt16 GetDistance(sal_uInt16 nIdent) const
Definition: format.hxx:120
void SetDistance(sal_uInt16 nIdent, sal_uInt16 nVal)
Definition: format.hxx:121
sal_Int16 GetGreekCharStyle() const
Definition: format.hxx:129
SmHorAlign GetHorAlign() const
Definition: format.hxx:123
void SetBaseSize(const Size &rSize)
Definition: format.hxx:108
bool IsPrintFrame() const
Definition: cfgitem.cxx:1253
bool IsPrintTitle() const
Definition: cfgitem.cxx:1199
sal_uInt16 GetPrintZoomFactor() const
Definition: cfgitem.cxx:1142
bool IsPrintFormulaText() const
Definition: cfgitem.cxx:1215
SmPrintSize GetPrintSize() const
Definition: cfgitem.cxx:1121
virtual OUString SAL_CALL getImplementationName() override
Definition: unomodel.cxx:376
virtual void SAL_CALL acquire() noexcept override
Definition: unomodel.cxx:334
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: unomodel.cxx:386
virtual void SAL_CALL render(sal_Int32 nRenderer, const css::uno::Any &rSelection, const css::uno::Sequence< css::beans::PropertyValue > &rxOptions) override
Definition: unomodel.cxx:933
virtual sal_Int32 SAL_CALL getRendererCount(const css::uno::Any &rSelection, const css::uno::Sequence< css::beans::PropertyValue > &rxOptions) override
Definition: unomodel.cxx:890
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unomodel.cxx:354
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: unomodel.cxx:381
virtual void SAL_CALL release() noexcept override
Definition: unomodel.cxx:339
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
Definition: unomodel.cxx:320
virtual ~SmModel() noexcept override
Definition: unomodel.cxx:316
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getRenderer(sal_Int32 nRenderer, const css::uno::Any &rSelection, const css::uno::Sequence< css::beans::PropertyValue > &rxOptions) override
Definition: unomodel.cxx:897
virtual void _getPropertyValues(const comphelper::PropertyMapEntry **ppEntries, css::uno::Any *pValue) override
Definition: unomodel.cxx:675
virtual void writeFormulaOoxml(::sax_fastparser::FSHelperPtr pSerializer, oox::core::OoxmlVersion version, oox::drawingml::DocumentType documentType, sal_Int8 nAlign) override
Definition: unomodel.cxx:1038
virtual Size getFormulaSize() const override
Definition: unomodel.cxx:1056
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &xParent) override
Definition: unomodel.cxx:1030
std::unique_ptr< SmPrintUIOptions > m_pPrintUIOptions
Definition: unomodel.hxx:49
virtual void _setPropertyValues(const comphelper::PropertyMapEntry **ppEntries, const css::uno::Any *pValues) override
Definition: unomodel.cxx:393
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
Definition: unomodel.cxx:344
virtual void writeFormulaRtf(OStringBuffer &rBuffer, rtl_TextEncoding nEncoding) override
Definition: unomodel.cxx:1046
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: unomodel.cxx:360
virtual void readFormulaOoxml(oox::formulaimport::XmlStream &stream) override
Definition: unomodel.cxx:1051
SmModel(SfxObjectShell *pObjSh)
Definition: unomodel.cxx:310
SmMathConfig * GetConfig()
Definition: smmod.cxx:162
SmSymbolManager & GetSymbolManager()
Definition: smmod.cxx:169
Printer * GetPrinter()
Definition: document.hxx:72
Definition: symbol.hxx:37
void SetExportName(const OUString &rName)
Definition: symbol.hxx:61
bool AddOrReplaceSymbol(const SmSym &rSymbol, bool bForceChange=false)
Definition: symbol.cxx:133
SymbolPtrVec_t GetSymbols() const
Definition: symbol.cxx:122
tools::Long GetFormulaBaseline() const
Gets the formula baseline.
Definition: node.cxx:577
void Impl_Print(OutputDevice &rOutDev, const SmPrintUIOptions &rPrintUIOptions, tools::Rectangle aOutRect)
Definition: view.cxx:1368
virtual sal_uInt64 TellEnd() override
sal_uInt64 Seek(sal_uInt64 nPos)
std::size_t ReadBytes(void *pData, std::size_t nSize)
OUString GetModuleName(EModule eModule) const
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
const VclPtr< OutputDevice > & GetOutputDevice() const
void disposeAndClear()
const css::uno::Sequence< sal_Int8 > & getSeq() const
css::uno::Type const & get()
constexpr tools::Long Right() const
tools::Long AdjustTop(tools::Long nVertMoveDelta)
tools::Long AdjustRight(tools::Long nHorzMoveDelta)
tools::Long AdjustBottom(tools::Long nVertMoveDelta)
tools::Long AdjustLeft(tools::Long nHorzMoveDelta)
constexpr tools::Long Bottom() const
FontFamily GetFamilyType()
void SetPitch(FontPitch ePitch)
FontItalic GetItalic()
void SetItalic(FontItalic)
void SetWeight(FontWeight)
const OUString & GetFamilyName() const
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
const Size & GetFontSize() const
void SetAlignment(TextAlign)
FontPitch GetPitch()
FontWeight GetWeight()
void SetFamilyName(const OUString &rFamilyName)
rtl_TextEncoding GetCharSet() const
static css::uno::Any setGroupControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId)
static css::uno::Any setChoiceRadiosControlOpt(const css::uno::Sequence< OUString > &i_rIDs, const OUString &i_rTitle, const css::uno::Sequence< OUString > &i_rHelpId, const OUString &i_rProperty, const css::uno::Sequence< OUString > &i_rChoices, sal_Int32 i_nValue, const css::uno::Sequence< sal_Bool > &i_rDisabledChoices=css::uno::Sequence< sal_Bool >(), const UIControlOptions &i_rControlOptions=UIControlOptions())
std::vector< css::beans::PropertyValue > m_aUIProperties
static css::uno::Any setBoolControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId, const OUString &i_rProperty, bool i_bValue, const UIControlOptions &i_rControlOptions=UIControlOptions())
static css::uno::Any setSubgroupControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId, const UIControlOptions &i_rControlOptions=UIControlOptions())
static css::uno::Any setRangeControlOpt(const OUString &i_rID, const OUString &i_rTitle, const OUString &i_rHelpId, const OUString &i_rProperty, sal_Int32 i_nValue, sal_Int32 i_nMinValue, sal_Int32 i_nMaxValue, const UIControlOptions &i_rControlOptions)
Reference< XOutputStream > stream
float u
float x
FontPitch
FontItalic
ITALIC_NORMAL
ITALIC_NONE
ALIGN_BASELINE
FontFamily
WEIGHT_BOLD
WEIGHT_NORMAL
#define FNT_SERIF
Definition: format.hxx:50
#define DIS_NUMERATOR
Definition: format.hxx:63
#define DIS_HORIZONTAL
Definition: format.hxx:58
#define DIS_BOTTOMSPACE
Definition: format.hxx:80
#define DIS_SUPERSCRIPT
Definition: format.hxx:61
#define DIS_BRACKETSIZE
Definition: format.hxx:69
#define DIS_BRACKETSPACE
Definition: format.hxx:70
#define DIS_TOPSPACE
Definition: format.hxx:79
#define FNT_FIXED
Definition: format.hxx:52
#define DIS_MATRIXCOL
Definition: format.hxx:72
#define DIS_SUBSCRIPT
Definition: format.hxx:62
#define DIS_OPERATORSIZE
Definition: format.hxx:75
#define SIZ_OPERATOR
Definition: format.hxx:40
#define SIZ_FUNCTION
Definition: format.hxx:39
#define SIZ_INDEX
Definition: format.hxx:38
#define DIS_NORMALBRACKETSIZE
Definition: format.hxx:81
#define DIS_LOWERLIMIT
Definition: format.hxx:68
#define DIS_OPERATORSPACE
Definition: format.hxx:76
#define DIS_STROKEWIDTH
Definition: format.hxx:66
#define DIS_RIGHTSPACE
Definition: format.hxx:78
#define DIS_DENOMINATOR
Definition: format.hxx:64
#define DIS_UPPERLIMIT
Definition: format.hxx:67
#define FNT_FUNCTION
Definition: format.hxx:47
#define FNT_NUMBER
Definition: format.hxx:48
#define FNT_BEGIN
Definition: format.hxx:45
#define DIS_FRACTION
Definition: format.hxx:65
#define FNT_TEXT
Definition: format.hxx:49
#define DIS_VERTICAL
Definition: format.hxx:59
SmHorAlign
Definition: format.hxx:85
#define DIS_ORNAMENTSPACE
Definition: format.hxx:74
#define FNT_END
Definition: format.hxx:54
#define SIZ_TEXT
Definition: format.hxx:37
#define DIS_LEFTSPACE
Definition: format.hxx:77
#define SIZ_LIMITS
Definition: format.hxx:41
#define DIS_MATRIXROW
Definition: format.hxx:71
#define DIS_ORNAMENTSIZE
Definition: format.hxx:73
#define FNT_SANS
Definition: format.hxx:51
#define DIS_ROOT
Definition: format.hxx:60
#define FNT_VARIABLE
Definition: format.hxx:46
#define PROPERTY_NONE
#define SAL_WARN_IF(condition, area, stream)
class SAL_NO_VTABLE XPropertySet
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
css::beans::PropertyValue makePropertyValue(const OUString &rName, T &&rValue)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
int i
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
detail::Optional< double >::type tryAccess< double >(css::uno::Any const &any)
std::shared_ptr< FastSerializerHelper > FSHelperPtr
FontWeight
std::pair< OUString const, DataAccessDescriptorProperty > PropertyMapEntry
long Long
OUString SmResId(TranslateId aId)
Definition: smmod.cxx:42
#define SM_MOD()
Definition: smmod.hxx:98
#define STREAM_SEEK_TO_BEGIN
bool hasValue()
Reference< XModel > xModel
std::vector< const SmSym * > SymbolPtrVec_t
Definition: symbol.hxx:71
unsigned char sal_Bool
sal_uInt16 sal_Unicode
signed char sal_Int8
static sal_Int16 lcl_AnyToINT16(const uno::Any &rAny)
Definition: unomodel.cxx:366
static const rtl::Reference< PropertySetInfo > & lcl_createModelPropertyInfo()
Definition: unomodel.cxx:231
constexpr OUStringLiteral PRTUIOPT_TITLE_ROW
Definition: unomodel.hxx:30
constexpr OUStringLiteral PRTUIOPT_BORDER
Definition: unomodel.hxx:32
constexpr OUStringLiteral PRTUIOPT_PRINT_SCALE
Definition: unomodel.hxx:34
constexpr OUStringLiteral PRTUIOPT_PRINT_FORMAT
Definition: unomodel.hxx:33
constexpr OUStringLiteral PRTUIOPT_FORMULA_TEXT
Definition: unomodel.hxx:31
bool IsItalic(const vcl::Font &rFont)
Definition: utility.cxx:176
bool IsBold(const vcl::Font &rFont)
Definition: utility.cxx:184
MapUnit SmMapUnit()
Definition: utility.hxx:121
o3tl::Length SmO3tlLengthUnit()
Definition: utility.hxx:125
oslFileHandle & pOut