LibreOffice Module sc (master) 1
xlroot.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 <memory>
21#include <utility>
22#include <xlroot.hxx>
23#include <sal/log.hxx>
24#include <com/sun/star/awt/XDevice.hpp>
25#include <com/sun/star/frame/Desktop.hpp>
26#include <com/sun/star/frame/XFrame.hpp>
27#include <com/sun/star/i18n/ScriptType.hpp>
30#include <sot/storage.hxx>
31#include <vcl/svapp.hxx>
32#include <svl/numformat.hxx>
33#include <svl/stritem.hxx>
35#include <sfx2/objsh.hxx>
36#include <sfx2/docfile.hxx>
37#include <sfx2/sfxsids.hrc>
38#include <vcl/font.hxx>
39#include <vcl/settings.hxx>
41
42#include <editeng/editstat.hxx>
43#include <scitems.hxx>
44#include <editeng/eeitem.hxx>
45#include <editeng/fhgtitem.hxx>
46#include <document.hxx>
47#include <docpool.hxx>
48#include <docuno.hxx>
49#include <editutil.hxx>
50#include <drwlayer.hxx>
51#include <scextopt.hxx>
52#include <patattr.hxx>
53#include <fapihelper.hxx>
54#include <xlconst.hxx>
55#include <xlstyle.hxx>
56#include <xlchart.hxx>
57#include <xltracer.hxx>
58#include <xltools.hxx>
61#include <root.hxx>
62
63namespace ApiScriptType = ::com::sun::star::i18n::ScriptType;
64
65using ::com::sun::star::uno::Exception;
66using ::com::sun::star::uno::Reference;
67using ::com::sun::star::uno::UNO_QUERY_THROW;
68using ::com::sun::star::uno::UNO_SET_THROW;
69using ::com::sun::star::awt::XDevice;
70using ::com::sun::star::awt::DeviceInfo;
71using ::com::sun::star::frame::XFrame;
72
73using namespace ::com::sun::star;
74
75// Global data ================================================================
76
77#ifdef DBG_UTIL
79{
80 OSL_ENSURE( mnObjCnt == 0, "XclDebugObjCounter::~XclDebugObjCounter - wrong root object count" );
81}
82#endif
83
85 tools::SvRef<SotStorage> xRootStrg, ScDocument& rDoc, rtl_TextEncoding eTextEnc, bool bExport ) :
86 meBiff( eBiff ),
87 meOutput( EXC_OUTPUT_BINARY ),
88 mrMedium( rMedium ),
89 mxRootStrg(std::move( xRootStrg )),
90 mrDoc( rDoc ),
91 meTextEnc( eTextEnc ),
92 meSysLang( Application::GetSettings().GetLanguageTag().getLanguageType() ),
93 meDocLang( Application::GetSettings().GetLanguageTag().getLanguageType() ),
94 meUILang( Application::GetSettings().GetUILanguageTag().getLanguageType() ),
95 mnDefApiScript( ApiScriptType::LATIN ),
96 maScMaxPos( mrDoc.MaxCol(), mrDoc.MaxRow(), MAXTAB ),
97 maXclMaxPos( EXC_MAXCOL2, EXC_MAXROW2, EXC_MAXTAB2 ),
99 mxFontPropSetHlp( std::make_shared<XclFontPropSetHelper>() ),
100 mxChPropSetHlp( std::make_shared<XclChPropSetHelper>() ),
101 mxRD( std::make_shared<RootData>() ),
102 mfScreenPixelX( 50.0 ),
103 mfScreenPixelY( 50.0 ),
104 mnCharWidth( 110 ),
105 mnSpaceWidth(45),
106 mnScTab( 0 ),
107 mbExport( bExport )
108{
110 maUserName = SvtUserOptions().GetLastName();
111 if (maUserName.isEmpty())
112 maUserName = "Calc";
113
115 {
116 case SvtScriptType::LATIN: mnDefApiScript = ApiScriptType::LATIN; break;
117 case SvtScriptType::ASIAN: mnDefApiScript = ApiScriptType::ASIAN; break;
118 case SvtScriptType::COMPLEX: mnDefApiScript = ApiScriptType::COMPLEX; break;
119 default: SAL_WARN( "sc", "XclRootData::XclRootData - unknown script type" );
120 }
121
122 // maximum cell position
123 switch( meBiff )
124 {
130 default: DBG_ERROR_BIFF();
131 }
132 maMaxPos.SetCol( ::std::min( maScMaxPos.Col(), maXclMaxPos.Col() ) );
133 maMaxPos.SetRow( ::std::min( maScMaxPos.Row(), maXclMaxPos.Row() ) );
134 maMaxPos.SetTab( ::std::min( maScMaxPos.Tab(), maXclMaxPos.Tab() ) );
135
136 // document URL and path
137 if( const SfxItemSet* pItemSet = mrMedium.GetItemSet() )
138 if( const SfxStringItem* pItem = pItemSet->GetItem<SfxStringItem>( SID_FILE_NAME ) )
139 maDocUrl = pItem->GetValue();
140 maBasePath = maDocUrl.copy( 0, maDocUrl.lastIndexOf( '/' ) + 1 );
141
142 // extended document options - always own object, try to copy existing data from document
143 if( const ScExtDocOptions* pOldDocOpt = mrDoc.GetExtDocOptions() )
144 mxExtDocOpt = std::make_shared<ScExtDocOptions>( *pOldDocOpt );
145 else
146 mxExtDocOpt = std::make_shared<ScExtDocOptions>();
147
148 // screen pixel size
149 try
150 {
151 Reference< frame::XDesktop2 > xFramesSupp = frame::Desktop::create( ::comphelper::getProcessComponentContext() );
152 Reference< XFrame > xFrame( xFramesSupp->getActiveFrame(), UNO_SET_THROW );
153 Reference< XDevice > xDevice( xFrame->getContainerWindow(), UNO_QUERY_THROW );
154 DeviceInfo aDeviceInfo = xDevice->getInfo();
155 mfScreenPixelX = (aDeviceInfo.PixelPerMeterX > 0) ? (100000.0 / aDeviceInfo.PixelPerMeterX) : 50.0;
156 mfScreenPixelY = (aDeviceInfo.PixelPerMeterY > 0) ? (100000.0 / aDeviceInfo.PixelPerMeterY) : 50.0;
157 }
158 catch( const Exception&)
159 {
160 TOOLS_WARN_EXCEPTION( "sc", "XclRootData::XclRootData - cannot get output device info");
161 }
162}
163
165{
166}
167
169 mrData( rRootData )
170{
171#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 0
173#endif
174
175 // filter tracer
176 mrData.mxTracer = std::make_shared<XclTracer>( GetDocUrl() );
177}
178
179XclRoot::XclRoot( const XclRoot& rRoot ) :
180 mrData( rRoot.mrData )
181{
182#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 0
184#endif
185}
186
188{
189#if defined(DBG_UTIL) && OSL_DEBUG_LEVEL > 0
191#endif
192}
193
195{
196 (void)rRoot; // avoid compiler warning
197 // allowed for assignment in derived classes - but test if the same root data is used
198 OSL_ENSURE( &mrData == &rRoot.mrData, "XclRoot::operator= - incompatible root data" );
199 return *this;
200}
201
202void XclRoot::SetTextEncoding( rtl_TextEncoding eTextEnc )
203{
204 if( eTextEnc != RTL_TEXTENCODING_DONTKNOW )
205 mrData.meTextEnc = eTextEnc;
206}
207
208void XclRoot::SetCharWidth( const XclFontData& rFontData )
209{
211 if( OutputDevice* pPrinter = GetPrinter() )
212 {
213 vcl::Font aFont( rFontData.maName, Size( 0, rFontData.mnHeight ) );
214 aFont.SetFamily( rFontData.GetScFamily( GetTextEncoding() ) );
215 aFont.SetCharSet( rFontData.GetFontEncoding() );
216 aFont.SetWeight( rFontData.GetScWeight() );
217 pPrinter->SetFont( aFont );
218 // Usually digits have the same width, but in some fonts they don't ...
219 // Match the import in sc/source/filter/oox/unitconverter.cxx
220 // UnitConverter::finalizeImport()
221 for (sal_Unicode cChar = '0'; cChar <= '9'; ++cChar)
222 mrData.mnCharWidth = std::max( pPrinter->GetTextWidth( OUString(cChar)), mrData.mnCharWidth);
223
224 // Set the width of space ' ' character.
225 mrData.mnSpaceWidth = pPrinter->GetTextWidth(OUString(' '));
226 }
227 if( mrData.mnCharWidth <= 0 )
228 {
229 // #i48717# Win98 with HP LaserJet returns 0
230 SAL_WARN( "sc", "XclRoot::SetCharWidth - invalid character width (no printer?)" );
231 mrData.mnCharWidth = 11 * rFontData.mnHeight / 20;
232 }
233 if (mrData.mnSpaceWidth <= 0)
234 {
235 SAL_WARN( "sc", "XclRoot::SetCharWidth - invalid character width (no printer?)" );
236 mrData.mnSpaceWidth = 45;
237 }
238}
239
240sal_Int32 XclRoot::GetHmmFromPixelX( double fPixelX ) const
241{
242 return static_cast< sal_Int32 >( fPixelX * mrData.mfScreenPixelX + 0.5 );
243}
244
245sal_Int32 XclRoot::GetHmmFromPixelY( double fPixelY ) const
246{
247 return static_cast< sal_Int32 >( fPixelY * mrData.mfScreenPixelY + 0.5 );
248}
249
250uno::Sequence< beans::NamedValue > XclRoot::RequestEncryptionData( ::comphelper::IDocPasswordVerifier& rVerifier ) const
251{
252 ::std::vector< OUString > aDefaultPasswords { XclRootData::gaDefPassword };
253 return ScfApiHelper::QueryEncryptionDataForMedium( mrData.mrMedium, rVerifier, &aDefaultPasswords );
254}
255
257{
259 return xRootStrg.is() && xRootStrg->IsContained( EXC_STORAGE_VBA_PROJECT );
260}
261
262tools::SvRef<SotStorage> XclRoot::OpenStorage( tools::SvRef<SotStorage> const & xStrg, const OUString& rStrgName ) const
263{
264 return mrData.mbExport ?
265 ScfTools::OpenStorageWrite( xStrg, rStrgName ) :
266 ScfTools::OpenStorageRead( xStrg, rStrgName );
267}
268
269tools::SvRef<SotStorage> XclRoot::OpenStorage( const OUString& rStrgName ) const
270{
271 return OpenStorage( GetRootStorage(), rStrgName );
272}
273
274tools::SvRef<SotStorageStream> XclRoot::OpenStream( tools::SvRef<SotStorage> const & xStrg, const OUString& rStrmName ) const
275{
276 return mrData.mbExport ?
277 ScfTools::OpenStorageStreamWrite( xStrg, rStrmName ) :
278 ScfTools::OpenStorageStreamRead( xStrg, rStrmName );
279}
280
281tools::SvRef<SotStorageStream> XclRoot::OpenStream( const OUString& rStrmName ) const
282{
283 return OpenStream( GetRootStorage(), rStrmName );
284}
285
287{
288 return mrData.mrDoc;
289}
290
292{
293 return GetDoc().GetDocumentShell();
294}
295
297{
298 SfxObjectShell* pDocShell = GetDocShell();
299 return pDocShell ? comphelper::getFromUnoTunnel<ScModelObj>( pDocShell->GetModel() ) : nullptr;
300}
301
303{
304 return GetDoc().GetRefDevice();
305}
306
308{
309 return *GetDoc().GetStyleSheetPool();
310}
311
313{
314 return *GetDoc().GetRangeName();
315}
316
318{
319 return ((nScTab >= 0) && GetDoc().GetDrawLayer()) ?
320 GetDoc().GetDrawLayer()->GetPage( static_cast< sal_uInt16 >( nScTab ) ) : nullptr;
321}
322
324{
325 return *GetDoc().GetFormatTable();
326}
327
329{
330 return GetFormatter().GetNullDate();
331}
332
333sal_uInt16 XclRoot::GetBaseYear() const
334{
335 // return 1904 for 1904-01-01, and 1900 for 1899-12-30
336 return (GetNullDate().GetYear() == 1904) ? 1904 : 1900;
337}
338
339const DateTime theOurCompatNullDate( Date( 30, 12, 1899 ));
340const DateTime theExcelCutOverDate( Date( 1, 3, 1900 ));
341
342double XclRoot::GetDoubleFromDateTime( const DateTime& rDateTime ) const
343{
344 double fValue = rDateTime - GetNullDate();
345 // adjust dates before 1900-03-01 to get correct time values in the range [0.0,1.0)
346 /* XXX: this is only used when reading BIFF, otherwise we'd have to check
347 * for dateCompatibility==true as mentioned below. */
349 fValue -= 1.0;
350 return fValue;
351}
352
354{
355 DateTime aDateTime = GetNullDate() + fValue;
356 // adjust dates before 1900-03-01 to get correct time values
357 /* FIXME: correction should only be done when writing BIFF or OOXML
358 * transitional with dateCompatibility==true (or absent for default true),
359 * but not if strict ISO/IEC 29500 which does not have the Excel error
360 * compatibility and the null date is the same 1899-12-30 as ours. */
362 aDateTime.AddDays(1);
363 return aDateTime;
364}
365
367{
368 if( !mrData.mxEditEngine )
369 {
370 mrData.mxEditEngine = std::make_shared<ScEditEngineDefaulter>( GetDoc().GetEnginePool() );
372 rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM));
373 rEE.SetEditTextObjectPool( GetDoc().GetEditPool() );
374 rEE.SetUpdateLayout( false );
375 rEE.EnableUndo( false );
376 rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS );
377 }
378 return *mrData.mxEditEngine;
379}
380
382{
384 {
385 mrData.mxHFEditEngine = std::make_shared<ScHeaderEditEngine>( EditEngine::CreatePool().get() );
387 rEE.SetRefMapMode(MapMode(MapUnit::MapTwip)); // headers/footers use twips as default metric
388 rEE.SetUpdateLayout( false );
389 rEE.EnableUndo( false );
390 rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS );
391
392 // set Calc header/footer defaults
393 auto pEditSet = std::make_unique<SfxItemSet>( rEE.GetEmptyItemSet() );
395 ScPatternAttr::FillToEditItemSet( *pEditSet, aItemSet );
396 // FillToEditItemSet() adjusts font height to 1/100th mm, we need twips
397 pEditSet->Put( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
398 pEditSet->Put( aItemSet.Get( ATTR_CJK_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
399 pEditSet->Put( aItemSet.Get( ATTR_CTL_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
400 rEE.SetDefaults( std::move(pEditSet) ); // takes ownership
401 }
402 return *mrData.mxHFEditEngine;
403}
404
406{
407 if( !mrData.mxDrawEditEng )
408 {
409 mrData.mxDrawEditEng = std::make_shared<EditEngine>( &GetDoc().GetDrawLayer()->GetItemPool() );
411 rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM));
412 rEE.SetUpdateLayout( false );
413 rEE.EnableUndo( false );
414 rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS );
415 }
416 return *mrData.mxDrawEditEng;
417}
418
420{
421 return *mrData.mxFontPropSetHlp;
422}
423
425{
426 return *mrData.mxChPropSetHlp;
427}
428
430{
431 return *mrData.mxExtDocOpt;
432}
433
435{
436 return *mrData.mxTracer;
437}
438
439/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
const SCTAB MAXTAB
Definition: address.hxx:70
bool mbExport
void AddDays(sal_Int32 nAddDays)
bool SetUpdateLayout(bool bUpdate, bool bRestoring=false)
void SetEditTextObjectPool(SfxItemPool *pPool)
EEControlBits GetControlWord() const
void EnableUndo(bool bEnable)
void SetRefMapMode(const MapMode &rMapMode)
static rtl::Reference< SfxItemPool > CreatePool()
const SfxItemSet & GetEmptyItemSet() const
void SetControlWord(EEControlBits nWord)
SCTAB Tab() const
Definition: address.hxx:283
void Set(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: address.hxx:403
void SetCol(SCCOL nColP)
Definition: address.hxx:291
SCROW Row() const
Definition: address.hxx:274
void SetRow(SCROW nRowP)
Definition: address.hxx:287
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
SC_DLLPUBLIC OutputDevice * GetRefDevice()
Definition: documen8.cxx:199
ScExtDocOptions * GetExtDocOptions()
Definition: document.hxx:643
SC_DLLPUBLIC ScDrawLayer * GetDrawLayer()
Definition: document.hxx:1082
SfxObjectShell * GetDocumentShell() const
Definition: document.hxx:1081
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6174
SC_DLLPUBLIC SvNumberFormatter * GetFormatTable() const
Definition: documen2.cxx:461
SC_DLLPUBLIC ScRangeName * GetRangeName(SCTAB nTab) const
Definition: documen3.cxx:174
void SetDefaults(const SfxItemSet &rDefaults, bool bRememberCopy=true)
Creates a copy of SfxItemSet if bRememberCopy set.
Definition: editutil.cxx:561
Extended options held by an ScDocument containing additional settings for filters.
Definition: scextopt.hxx:77
static SC_DLLPUBLIC SvtScriptType GetDefaultScriptType()
Definition: global.cxx:898
static void FillToEditItemSet(SfxItemSet &rEditSet, const SfxItemSet &rSrcSet, const SfxItemSet *pCondSet=nullptr)
Converts all Calc items contained in rSrcSet to edit engine items and puts them into rEditSet.
Definition: patattr.cxx:601
static css::uno::Sequence< css::beans::NamedValue > QueryEncryptionDataForMedium(SfxMedium &rMedium, ::comphelper::IDocPasswordVerifier &rVerifier, const ::std::vector< OUString > *pDefaultPasswords)
Opens a password dialog and returns the encryption data.
Definition: fapihelper.cxx:102
static tools::SvRef< SotStorage > OpenStorageRead(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrgName)
Tries to open an existing storage with the specified name in the passed storage (read-only).
Definition: ftools.cxx:165
static tools::SvRef< SotStorage > OpenStorageWrite(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrgName)
Creates and opens a storage with the specified name in the passed storage (read/write).
Definition: ftools.cxx:173
static tools::SvRef< SotStorageStream > OpenStorageStreamRead(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName)
Tries to open an existing stream with the specified name in the passed storage (read-only).
Definition: ftools.cxx:181
static tools::SvRef< SotStorageStream > OpenStorageStreamWrite(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName)
Creates and opens a stream with the specified name in the passed storage (read/write).
Definition: ftools.cxx:189
const SdrPage * GetPage(sal_uInt16 nPgNum) const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SfxItemSet * GetItemSet() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
const Date & GetNullDate() const
Helper class for usage of property sets.
Definition: xlchart.hxx:1310
Helper class for usage of property sets.
Definition: xlstyle.hxx:403
Access to global data for a filter object (imported or exported document) from other classes.
Definition: xlroot.hxx:128
SfxObjectShell * GetDocShell() const
Returns the object shell of the Calc document.
Definition: xlroot.cxx:291
ScModelObj * GetDocModelObj() const
Returns the object model of the Calc document.
Definition: xlroot.cxx:296
tools::SvRef< SotStorage > OpenStorage(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrgName) const
Tries to open a storage as child of the specified storage for reading or writing.
Definition: xlroot.cxx:262
const tools::SvRef< SotStorage > & GetRootStorage() const
Returns the OLE2 root storage of the imported/exported file.
Definition: xlroot.hxx:186
ScHeaderEditEngine & GetHFEditEngine() const
Returns the edit engine for import/export of headers/footers.
Definition: xlroot.cxx:381
const OUString & GetDocUrl() const
Returns the document URL of the imported/exported file.
Definition: xlroot.hxx:172
virtual ~XclRoot()
Definition: xlroot.cxx:187
ScExtDocOptions & GetExtDocOptions() const
Returns the extended document options.
Definition: xlroot.cxx:429
rtl_TextEncoding GetTextEncoding() const
Returns the text encoding to import/export byte strings.
Definition: xlroot.hxx:147
XclRoot(XclRootData &rRootData)
Definition: xlroot.cxx:168
OutputDevice * GetPrinter() const
Returns pointer to the printer of the Calc document.
Definition: xlroot.cxx:302
css::uno::Sequence< css::beans::NamedValue > RequestEncryptionData(::comphelper::IDocPasswordVerifier &rVerifier) const
Requests and verifies a password from the medium or the user.
Definition: xlroot.cxx:250
void SetTextEncoding(rtl_TextEncoding eTextEnc)
Sets the text encoding to import/export byte strings.
Definition: xlroot.cxx:202
DateTime GetNullDate() const
Returns the null date of the current number formatter.
Definition: xlroot.cxx:328
XclTracer & GetTracer() const
Returns the filter tracer.
Definition: xlroot.cxx:434
SvNumberFormatter & GetFormatter() const
Returns the number formatter of the Calc document.
Definition: xlroot.cxx:323
tools::SvRef< SotStorageStream > OpenStream(tools::SvRef< SotStorage > const &xStrg, const OUString &rStrmName) const
Tries to open a new stream in the specified storage for reading or writing.
Definition: xlroot.cxx:274
sal_Int32 GetHmmFromPixelX(double fPixelX) const
Calculates the width of the passed number of pixels in 1/100 mm.
Definition: xlroot.cxx:240
ScEditEngineDefaulter & GetEditEngine() const
Returns the edit engine for import/export of rich strings etc.
Definition: xlroot.cxx:366
XclRootData & mrData
Definition: xlroot.hxx:266
EditEngine & GetDrawEditEngine() const
Returns the edit engine for import/export of drawing text boxes.
Definition: xlroot.cxx:405
void SetCharWidth(const XclFontData &rFontData)
Sets the width of the '0' - '9' digit character as well as the ' ' space char (using the default font...
Definition: xlroot.cxx:208
XclChPropSetHelper & GetChartPropSetHelper() const
Returns the property set helper for the chart filters.
Definition: xlroot.cxx:424
bool HasVbaStorage() const
Returns true, if the document contains a VBA storage.
Definition: xlroot.cxx:256
ScStyleSheetPool & GetStyleSheetPool() const
Returns the style sheet pool of the Calc document.
Definition: xlroot.cxx:307
sal_Int32 GetHmmFromPixelY(double fPixelY) const
Calculates the height of the passed number of pixels in 1/100 mm.
Definition: xlroot.cxx:245
DateTime GetDateTimeFromDouble(double fValue) const
Converts a floating-point value to a date/time value.
Definition: xlroot.cxx:353
ScRangeName & GetNamedRanges() const
Returns the defined names container of the Calc document.
Definition: xlroot.cxx:312
XclRoot & operator=(const XclRoot &rRoot)
Definition: xlroot.cxx:194
double GetDoubleFromDateTime(const DateTime &rDateTime) const
Converts a date/time value to a floating-point value.
Definition: xlroot.cxx:342
sal_uInt16 GetBaseYear() const
Returns the base year depending on the current null date (1900 or 1904).
Definition: xlroot.cxx:333
ScDocument & GetDoc() const
Returns reference to the destination document (import) or source document (export).
Definition: xlroot.cxx:286
SdrPage * GetSdrPage(SCTAB nScTab) const
Returns the drawing layer page of the passed sheet, if present.
Definition: xlroot.cxx:317
XclFontPropSetHelper & GetFontPropSetHelper() const
Returns the property set helper for fonts.
Definition: xlroot.cxx:419
This class wraps an MSFilterTracer to create trace logs for import/export filters.
Definition: xltracer.hxx:51
bool is() const
static bool IsFuzzing()
void SetWeight(FontWeight)
void SetFamily(FontFamily)
void SetCharSet(rtl_TextEncoding)
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
#define SAL_WARN(area, stream)
@ Exception
std::shared_ptr< T > make_shared(Args &&... args)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
ObjectFormatterData & mrData
constexpr TypedWhichId< SvxFontHeightItem > ATTR_FONT_HEIGHT(101)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CJK_FONT_HEIGHT(112)
constexpr TypedWhichId< SvxFontHeightItem > ATTR_CTL_FONT_HEIGHT(117)
sal_Int32 mnObjCnt
Definition: xlroot.hxx:43
This struct helps reading and writing Excel fonts.
Definition: xlstyle.hxx:286
sal_uInt16 mnHeight
Font color.
Definition: xlstyle.hxx:290
FontWeight GetScWeight() const
Returns the Calc font weight.
Definition: xlstyle.cxx:260
FontFamily GetScFamily(rtl_TextEncoding eDefTextEnc) const
Returns the Calc font family.
Definition: xlstyle.cxx:229
rtl_TextEncoding GetFontEncoding() const
Returns the font text encoding.
Definition: xlstyle.cxx:249
OUString maName
Definition: xlstyle.hxx:287
Stores global buffers and data needed elsewhere in the Excel filters.
Definition: xlroot.hxx:65
XclChPropSetHlpRef mxChPropSetHlp
Property set helper for fonts.
Definition: xlroot.hxx:98
XclBiff meBiff
Definition: xlroot.hxx:75
rtl_TextEncoding meTextEnc
The default password used for stream encryption.
Definition: xlroot.hxx:84
XclFontPropSetHlpRef mxFontPropSetHlp
Edit engine for text boxes.
Definition: xlroot.hxx:97
ScAddress maMaxPos
Highest Excel cell position.
Definition: xlroot.hxx:91
ScAddress maScMaxPos
Default script type for blank cells (API constant).
Definition: xlroot.hxx:89
virtual ~XclRootData()
Definition: xlroot.cxx:164
ScAddress maXclMaxPos
Highest Calc cell position.
Definition: xlroot.hxx:90
const bool mbExport
Current Calc sheet index.
Definition: xlroot.hxx:109
double mfScreenPixelX
Old RootData struct. Will be removed.
Definition: xlroot.hxx:104
SfxMedium & mrMedium
Current Output format.
Definition: xlroot.hxx:77
tools::Long mnCharWidth
Height of a screen pixel (1/100 mm).
Definition: xlroot.hxx:106
EditEngineRef mxDrawEditEng
Edit engine for header/footer.
Definition: xlroot.hxx:95
OUString maBasePath
Document URL of imported/exported file.
Definition: xlroot.hxx:81
static constexpr OUStringLiteral gaDefPassword
Current user name.
Definition: xlroot.hxx:83
OUString maDocUrl
The source or destination document.
Definition: xlroot.hxx:80
ScExtDocOptRef mxExtDocOpt
Property set helper for chart filter.
Definition: xlroot.hxx:100
ScHeaderEERef mxHFEditEngine
Edit engine for rich strings etc.
Definition: xlroot.hxx:94
OUString maUserName
Base path of imported/exported file (path of maDocUrl).
Definition: xlroot.hxx:82
sal_Int16 mnDefApiScript
UI language (import: from file, export: from system).
Definition: xlroot.hxx:88
XclTracerRef mxTracer
Extended document options.
Definition: xlroot.hxx:101
ScDocument & mrDoc
The root OLE storage of imported/exported file.
Definition: xlroot.hxx:79
tools::Long mnSpaceWidth
Width of '0' in default font (twips).
Definition: xlroot.hxx:107
ScEEDefaulterRef mxEditEngine
Highest position valid in Calc and Excel.
Definition: xlroot.hxx:93
double mfScreenPixelY
Width of a screen pixel (1/100 mm).
Definition: xlroot.hxx:105
XclRootData(XclBiff eBiff, SfxMedium &rMedium, tools::SvRef< SotStorage > xRootStrg, ScDocument &rDoc, rtl_TextEncoding eTextEnc, bool bExport)
false = Import, true = Export.
Definition: xlroot.cxx:84
Reference< XFrame > xFrame
sal_uInt16 sal_Unicode
sal_Int16 SCTAB
Definition: types.hxx:22
const SCCOL EXC_MAXCOL8
Definition: xlconst.hxx:64
const SCROW EXC_MAXROW3
Definition: xlconst.hxx:53
const SCTAB EXC_MAXTAB8
Definition: xlconst.hxx:66
const SCCOL EXC_MAXCOL3
Definition: xlconst.hxx:52
const SCROW EXC_MAXROW2
Definition: xlconst.hxx:49
const SCTAB EXC_MAXTAB4
Definition: xlconst.hxx:58
const SCROW EXC_MAXROW8
Definition: xlconst.hxx:65
XclBiff
An enumeration for all Excel file format types (BIFF types).
Definition: xlconst.hxx:30
@ EXC_BIFF5
MS Excel 4.0.
Definition: xlconst.hxx:34
@ EXC_BIFF4
MS Excel 3.0.
Definition: xlconst.hxx:33
@ EXC_BIFF2
Definition: xlconst.hxx:31
@ EXC_BIFF8
MS Excel 5.0, MS Excel 7.0 (95)
Definition: xlconst.hxx:35
@ EXC_BIFF3
MS Excel 2.1.
Definition: xlconst.hxx:32
@ EXC_OUTPUT_BINARY
Definition: xlconst.hxx:42
const SCCOL EXC_MAXCOL4
Definition: xlconst.hxx:56
const SCROW EXC_MAXROW5
Definition: xlconst.hxx:61
const SCCOL EXC_MAXCOL2
Definition: xlconst.hxx:48
constexpr OUStringLiteral EXC_STORAGE_VBA_PROJECT
Definition: xlconst.hxx:80
const SCTAB EXC_MAXTAB3
Definition: xlconst.hxx:54
const SCCOL EXC_MAXCOL5
Definition: xlconst.hxx:60
const SCTAB EXC_MAXTAB2
Definition: xlconst.hxx:50
const SCTAB EXC_MAXTAB5
Definition: xlconst.hxx:62
const SCROW EXC_MAXROW4
Definition: xlconst.hxx:57
const DateTime theOurCompatNullDate(Date(30, 12, 1899))
const DateTime theExcelCutOverDate(Date(1, 3, 1900))
#define DBG_ERROR_BIFF()
Definition: xltools.hxx:33