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