Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / filter / excel / xepage.cxx
blob31c17b6d251e6a313eb5a18eb94eb8762d9bffd4
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "xepage.hxx"
21 #include <svl/itemset.hxx>
22 #include "scitems.hxx"
23 #include <svl/eitem.hxx>
24 #include <svl/intitem.hxx>
25 #include <svx/pageitem.hxx>
26 #include <editeng/sizeitem.hxx>
27 #include <editeng/lrspitem.hxx>
28 #include <editeng/ulspitem.hxx>
29 #include <editeng/brushitem.hxx>
30 #include "document.hxx"
31 #include "stlpool.hxx"
32 #include "stlsheet.hxx"
33 #include "attrib.hxx"
34 #include "xehelper.hxx"
35 #include "xeescher.hxx"
37 #include <set>
38 #include <limits>
40 using namespace ::oox;
42 using ::std::set;
43 using ::std::numeric_limits;
45 // Page settings records ======================================================
47 // Header/footer --------------------------------------------------------------
49 XclExpHeaderFooter::XclExpHeaderFooter( sal_uInt16 nRecId, const OUString& rHdrString ) :
50 XclExpRecord( nRecId ),
51 maHdrString( rHdrString )
55 void XclExpHeaderFooter::SaveXml( XclExpXmlStream& rStrm )
57 sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
58 sal_Int32 nElement = GetRecId() == EXC_ID_HEADER ? XML_oddHeader : XML_oddFooter;
59 rWorksheet->startElement( nElement, FSEND );
60 rWorksheet->writeEscaped( maHdrString );
61 rWorksheet->endElement( nElement );
64 void XclExpHeaderFooter::WriteBody( XclExpStream& rStrm )
66 if( !maHdrString.isEmpty() )
68 XclExpString aExString;
69 if( rStrm.GetRoot().GetBiff() <= EXC_BIFF5 )
70 aExString.AssignByte( maHdrString, rStrm.GetRoot().GetTextEncoding(), EXC_STR_8BITLENGTH );
71 else
72 aExString.Assign( maHdrString, EXC_STR_DEFAULT, 255 ); // 16-bit length, but max 255 chars
73 rStrm << aExString;
77 // General page settings ------------------------------------------------------
79 XclExpSetup::XclExpSetup( const XclPageData& rPageData ) :
80 XclExpRecord( EXC_ID_SETUP, 34 ),
81 mrData( rPageData )
85 void XclExpSetup::SaveXml( XclExpXmlStream& rStrm )
87 sax_fastparser::FastAttributeList* pAttrList = sax_fastparser::FastSerializerHelper::createAttrList();
88 if( rStrm.getVersion() != oox::core::ISOIEC_29500_2008 ||
89 mrData.mnStrictPaperSize != EXC_PAPERSIZE_USER )
91 pAttrList->add( XML_paperSize, OString::number( mrData.mnPaperSize ).getStr() );
93 else
95 pAttrList->add( XML_paperWidth, OString::number( mrData.mnPaperWidth ).concat(OString("mm")).getStr() );
96 pAttrList->add( XML_paperHeight, OString::number( mrData.mnPaperHeight ).concat(OString("mm")).getStr() );
97 // pAttrList->add( XML_paperUnits, "mm" );
99 pAttrList->add( XML_scale, OString::number( mrData.mnScaling ).getStr() );
100 pAttrList->add( XML_firstPageNumber, OString::number( mrData.mnStartPage ).getStr() );
101 pAttrList->add( XML_fitToWidth, OString::number( mrData.mnFitToWidth ).getStr() );
102 pAttrList->add( XML_fitToHeight, OString::number( mrData.mnFitToHeight ).getStr() );
103 pAttrList->add( XML_pageOrder, mrData.mbPrintInRows ? "overThenDown" : "downThenOver" );
104 pAttrList->add( XML_orientation, mrData.mbPortrait ? "portrait" : "landscape" ); // OOXTODO: "default"?
105 // tdf#48767 if XML_usePrinterDefaults field is exist, then XML_orientation is always "portrait" in MS Excel
106 // To resolve that import issue, if XML_usePrinterDefaults has default value (false) then XML_usePrinterDefaults is not added.
107 if ( !mrData.mbValid )
108 pAttrList->add( XML_usePrinterDefaults, XclXmlUtils::ToPsz( !mrData.mbValid ) );
109 pAttrList->add( XML_blackAndWhite, XclXmlUtils::ToPsz( mrData.mbBlackWhite ) );
110 pAttrList->add( XML_draft, XclXmlUtils::ToPsz( mrData.mbDraftQuality ) );
111 pAttrList->add( XML_cellComments, mrData.mbPrintNotes ? "atEnd" : "none" ); // OOXTODO: "asDisplayed"?
112 pAttrList->add( XML_useFirstPageNumber, XclXmlUtils::ToPsz( mrData.mbManualStart ) );
113 // OOXTODO: XML_errors, // == displayed|blank|dash|NA
114 pAttrList->add( XML_horizontalDpi, OString::number( mrData.mnHorPrintRes ).getStr() );
115 pAttrList->add( XML_verticalDpi, OString::number( mrData.mnVerPrintRes ).getStr() );
116 pAttrList->add( XML_copies, OString::number( mrData.mnCopies ).getStr() );
117 // OOXTODO: devMode settings part RelationshipId: FSNS( XML_r, XML_id ),
119 css::uno::Reference< css::xml::sax::XFastAttributeList > aAttrs(pAttrList);
120 rStrm.GetCurrentStream()->singleElement( XML_pageSetup, aAttrs );
123 void XclExpSetup::WriteBody( XclExpStream& rStrm )
125 XclBiff eBiff = rStrm.GetRoot().GetBiff();
127 sal_uInt16 nFlags = 0;
128 ::set_flag( nFlags, EXC_SETUP_INROWS, mrData.mbPrintInRows );
129 ::set_flag( nFlags, EXC_SETUP_PORTRAIT, mrData.mbPortrait );
130 ::set_flag( nFlags, EXC_SETUP_INVALID, !mrData.mbValid );
131 ::set_flag( nFlags, EXC_SETUP_BLACKWHITE, mrData.mbBlackWhite );
132 if( eBiff >= EXC_BIFF5 )
134 ::set_flag( nFlags, EXC_SETUP_DRAFT, mrData.mbDraftQuality );
135 /* Set the Comments/Notes to "At end of sheet" if Print Notes is true.
136 We don't currently support "as displayed on sheet". Thus this value
137 will be re-interpreted to "At end of sheet". */
138 const sal_uInt16 nNotes = EXC_SETUP_PRINTNOTES | EXC_SETUP_NOTES_END;
139 ::set_flag( nFlags, nNotes, mrData.mbPrintNotes );
140 ::set_flag( nFlags, EXC_SETUP_STARTPAGE, mrData.mbManualStart );
143 rStrm << mrData.mnPaperSize << mrData.mnScaling << mrData.mnStartPage
144 << mrData.mnFitToWidth << mrData.mnFitToHeight << nFlags;
145 if( eBiff >= EXC_BIFF5 )
147 rStrm << mrData.mnHorPrintRes << mrData.mnVerPrintRes
148 << mrData.mfHeaderMargin << mrData.mfFooterMargin << mrData.mnCopies;
152 // Manual page breaks ---------------------------------------------------------
154 XclExpPageBreaks::XclExpPageBreaks( sal_uInt16 nRecId, const ScfUInt16Vec& rPageBreaks, sal_uInt16 nMaxPos ) :
155 XclExpRecord( nRecId ),
156 mrPageBreaks( rPageBreaks ),
157 mnMaxPos( nMaxPos )
161 void XclExpPageBreaks::Save( XclExpStream& rStrm )
163 if( !mrPageBreaks.empty() )
165 SetRecSize( 2 + ((rStrm.GetRoot().GetBiff() <= EXC_BIFF5) ? 2 : 6) * mrPageBreaks.size() );
166 XclExpRecord::Save( rStrm );
170 void XclExpPageBreaks::WriteBody( XclExpStream& rStrm )
172 bool bWriteRange = (rStrm.GetRoot().GetBiff() == EXC_BIFF8);
174 rStrm << static_cast< sal_uInt16 >( mrPageBreaks.size() );
175 for( ScfUInt16Vec::const_iterator aIt = mrPageBreaks.begin(), aEnd = mrPageBreaks.end(); aIt != aEnd; ++aIt )
177 rStrm << *aIt;
178 if( bWriteRange )
179 rStrm << sal_uInt16( 0 ) << mnMaxPos;
183 void XclExpPageBreaks::SaveXml( XclExpXmlStream& rStrm )
185 if( mrPageBreaks.empty() )
186 return;
188 sal_Int32 nElement = GetRecId() == EXC_ID_HORPAGEBREAKS ? XML_rowBreaks : XML_colBreaks;
189 sax_fastparser::FSHelperPtr& pWorksheet = rStrm.GetCurrentStream();
190 OString sNumPageBreaks = OString::number( mrPageBreaks.size() );
191 pWorksheet->startElement( nElement,
192 XML_count, sNumPageBreaks.getStr(),
193 XML_manualBreakCount, sNumPageBreaks.getStr(),
194 FSEND );
195 for( ScfUInt16Vec::const_iterator aIt = mrPageBreaks.begin(), aEnd = mrPageBreaks.end(); aIt != aEnd; ++aIt )
197 pWorksheet->singleElement( XML_brk,
198 XML_id, OString::number( *aIt ).getStr(),
199 XML_man, "true",
200 XML_max, OString::number( mnMaxPos ).getStr(),
201 XML_min, "0",
202 // OOXTODO: XML_pt, "",
203 FSEND );
205 pWorksheet->endElement( nElement );
208 // Page settings ==============================================================
210 XclExpPageSettings::XclExpPageSettings( const XclExpRoot& rRoot ) :
211 XclExpRoot( rRoot )
213 ScDocument& rDoc = GetDoc();
214 SCTAB nScTab = GetCurrScTab();
216 if( SfxStyleSheetBase* pStyleSheet = GetStyleSheetPool().Find( rDoc.GetPageStyle( nScTab ), SfxStyleFamily::Page ) )
218 const SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
219 maData.mbValid = true;
221 // *** page settings ***
223 maData.mbPrintInRows = !GETITEMBOOL( rItemSet, ATTR_PAGE_TOPDOWN );
224 maData.mbHorCenter = GETITEMBOOL( rItemSet, ATTR_PAGE_HORCENTER );
225 maData.mbVerCenter = GETITEMBOOL( rItemSet, ATTR_PAGE_VERCENTER );
226 maData.mbPrintHeadings = GETITEMBOOL( rItemSet, ATTR_PAGE_HEADERS );
227 maData.mbPrintGrid = GETITEMBOOL( rItemSet, ATTR_PAGE_GRID );
228 maData.mbPrintNotes = GETITEMBOOL( rItemSet, ATTR_PAGE_NOTES );
230 maData.mnStartPage = GETITEMVALUE( rItemSet, SfxUInt16Item, ATTR_PAGE_FIRSTPAGENO, sal_uInt16 );
231 maData.mbManualStart = maData.mnStartPage && (!nScTab || rDoc.NeedPageResetAfterTab( nScTab - 1 ));
233 const SvxLRSpaceItem& rLRItem = GETITEM( rItemSet, SvxLRSpaceItem, ATTR_LRSPACE );
234 maData.mfLeftMargin = XclTools::GetInchFromTwips( rLRItem.GetLeft() );
235 maData.mfRightMargin = XclTools::GetInchFromTwips( rLRItem.GetRight() );
236 const SvxULSpaceItem& rULItem = GETITEM( rItemSet, SvxULSpaceItem, ATTR_ULSPACE );
237 maData.mfTopMargin = XclTools::GetInchFromTwips( rULItem.GetUpper() );
238 maData.mfBottomMargin = XclTools::GetInchFromTwips( rULItem.GetLower() );
240 const SvxPageItem& rPageItem = GETITEM( rItemSet, SvxPageItem, ATTR_PAGE );
241 const SvxSizeItem& rSizeItem = GETITEM( rItemSet, SvxSizeItem, ATTR_PAGE_SIZE );
242 maData.SetScPaperSize( rSizeItem.GetSize(), !rPageItem.IsLandscape() );
244 const ScPageScaleToItem& rScaleToItem = GETITEM( rItemSet, ScPageScaleToItem, ATTR_PAGE_SCALETO );
245 sal_uInt16 nPages = GETITEMVALUE( rItemSet, SfxUInt16Item, ATTR_PAGE_SCALETOPAGES, sal_uInt16 );
246 sal_uInt16 nScale = GETITEMVALUE( rItemSet, SfxUInt16Item, ATTR_PAGE_SCALE, sal_uInt16 );
248 if( ScfTools::CheckItem( rItemSet, ATTR_PAGE_SCALETO, false ) && rScaleToItem.IsValid() )
250 maData.mnFitToWidth = rScaleToItem.GetWidth();
251 maData.mnFitToHeight = rScaleToItem.GetHeight();
252 maData.mbFitToPages = true;
255 else if( ScfTools::CheckItem( rItemSet, ATTR_PAGE_SCALETOPAGES, false ) && nPages )
257 maData.mnFitToWidth = 1;
258 maData.mnFitToHeight = nPages;
259 maData.mbFitToPages = true;
261 else if( nScale )
263 maData.mnScaling = nScale;
264 maData.mbFitToPages = false;
267 maData.mxBrushItem.reset( new SvxBrushItem( GETITEM( rItemSet, SvxBrushItem, ATTR_BACKGROUND ) ) );
269 // *** header and footer ***
271 XclExpHFConverter aHFConv( GetRoot() );
273 // header
274 const SfxItemSet& rHdrItemSet = GETITEM( rItemSet, SvxSetItem, ATTR_PAGE_HEADERSET ).GetItemSet();
275 if( GETITEMBOOL( rHdrItemSet, ATTR_PAGE_ON ) )
277 const ScPageHFItem& rHFItem = GETITEM( rItemSet, ScPageHFItem, ATTR_PAGE_HEADERRIGHT );
278 aHFConv.GenerateString( rHFItem.GetLeftArea(), rHFItem.GetCenterArea(), rHFItem.GetRightArea() );
279 maData.maHeader = aHFConv.GetHFString();
280 // header height (Excel excludes header from top margin)
281 sal_Int32 nHdrHeight = GETITEMBOOL( rHdrItemSet, ATTR_PAGE_DYNAMIC ) ?
282 // dynamic height: calculate header height, add header <-> sheet area distance
283 (aHFConv.GetTotalHeight() + GETITEM( rHdrItemSet, SvxULSpaceItem, ATTR_ULSPACE ).GetLower()) :
284 // static height: ATTR_PAGE_SIZE already includes header <-> sheet area distance
285 static_cast< sal_Int32 >( GETITEM( rHdrItemSet, SvxSizeItem, ATTR_PAGE_SIZE ).GetSize().Height() );
286 maData.mfHeaderMargin = maData.mfTopMargin;
287 maData.mfTopMargin += XclTools::GetInchFromTwips( nHdrHeight );
290 // footer
291 const SfxItemSet& rFtrItemSet = GETITEM( rItemSet, SvxSetItem, ATTR_PAGE_FOOTERSET ).GetItemSet();
292 if( GETITEMBOOL( rFtrItemSet, ATTR_PAGE_ON ) )
294 const ScPageHFItem& rHFItem = GETITEM( rItemSet, ScPageHFItem, ATTR_PAGE_FOOTERRIGHT );
295 aHFConv.GenerateString( rHFItem.GetLeftArea(), rHFItem.GetCenterArea(), rHFItem.GetRightArea() );
296 maData.maFooter = aHFConv.GetHFString();
297 // footer height (Excel excludes footer from bottom margin)
298 sal_Int32 nFtrHeight = GETITEMBOOL( rFtrItemSet, ATTR_PAGE_DYNAMIC ) ?
299 // dynamic height: calculate footer height, add sheet area <-> footer distance
300 (aHFConv.GetTotalHeight() + GETITEM( rFtrItemSet, SvxULSpaceItem, ATTR_ULSPACE ).GetUpper()) :
301 // static height: ATTR_PAGE_SIZE already includes sheet area <-> footer distance
302 static_cast< sal_Int32 >( GETITEM( rFtrItemSet, SvxSizeItem, ATTR_PAGE_SIZE ).GetSize().Height() );
303 maData.mfFooterMargin = maData.mfBottomMargin;
304 maData.mfBottomMargin += XclTools::GetInchFromTwips( nFtrHeight );
308 // *** page breaks ***
310 set<SCROW> aRowBreaks;
311 rDoc.GetAllRowBreaks(aRowBreaks, nScTab, false, true);
313 SCROW nMaxRow = numeric_limits<sal_uInt16>::max();
314 for (set<SCROW>::const_iterator itr = aRowBreaks.begin(), itrEnd = aRowBreaks.end(); itr != itrEnd; ++itr)
316 SCROW nRow = *itr;
317 if (nRow > nMaxRow)
318 break;
320 maData.maHorPageBreaks.push_back(nRow);
323 if (maData.maHorPageBreaks.size() > 1026)
325 // Excel allows only up to 1026 page breaks. Trim any excess page breaks.
326 ScfUInt16Vec::iterator itr = maData.maHorPageBreaks.begin();
327 ::std::advance(itr, 1026);
328 maData.maHorPageBreaks.erase(itr, maData.maHorPageBreaks.end());
331 set<SCCOL> aColBreaks;
332 rDoc.GetAllColBreaks(aColBreaks, nScTab, false, true);
333 for (set<SCCOL>::const_iterator itr = aColBreaks.begin(), itrEnd = aColBreaks.end(); itr != itrEnd; ++itr)
334 maData.maVerPageBreaks.push_back(*itr);
337 class XclExpXmlStartHeaderFooterElementRecord : public XclExpXmlElementRecord
339 public:
340 explicit XclExpXmlStartHeaderFooterElementRecord(sal_Int32 const nElement)
341 : XclExpXmlElementRecord(nElement) {}
343 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
346 void XclExpXmlStartHeaderFooterElementRecord::SaveXml(XclExpXmlStream& rStrm)
348 // OOXTODO: we currently only emit oddHeader/oddFooter elements, and
349 // do not support the first/even/odd page distinction.
350 sax_fastparser::FSHelperPtr& rStream = rStrm.GetCurrentStream();
351 rStream->startElement( mnElement,
352 // OOXTODO: XML_alignWithMargins,
353 XML_differentFirst, "false", // OOXTODO
354 XML_differentOddEven, "false", // OOXTODO
355 // OOXTODO: XML_scaleWithDoc
356 FSEND );
359 void XclExpPageSettings::Save( XclExpStream& rStrm )
361 XclExpBoolRecord( EXC_ID_PRINTHEADERS, maData.mbPrintHeadings ).Save( rStrm );
362 XclExpBoolRecord( EXC_ID_PRINTGRIDLINES, maData.mbPrintGrid ).Save( rStrm );
363 XclExpBoolRecord( EXC_ID_GRIDSET, true ).Save( rStrm );
364 XclExpPageBreaks( EXC_ID_HORPAGEBREAKS, maData.maHorPageBreaks, static_cast< sal_uInt16 >( GetXclMaxPos().Col() ) ).Save( rStrm );
365 XclExpPageBreaks( EXC_ID_VERPAGEBREAKS, maData.maVerPageBreaks, static_cast< sal_uInt16 >( GetXclMaxPos().Row() ) ).Save( rStrm );
366 XclExpHeaderFooter( EXC_ID_HEADER, maData.maHeader ).Save( rStrm );
367 XclExpHeaderFooter( EXC_ID_FOOTER, maData.maFooter ).Save( rStrm );
368 XclExpBoolRecord( EXC_ID_HCENTER, maData.mbHorCenter ).Save( rStrm );
369 XclExpBoolRecord( EXC_ID_VCENTER, maData.mbVerCenter ).Save( rStrm );
370 XclExpDoubleRecord( EXC_ID_LEFTMARGIN, maData.mfLeftMargin ).Save( rStrm );
371 XclExpDoubleRecord( EXC_ID_RIGHTMARGIN, maData.mfRightMargin ).Save( rStrm );
372 XclExpDoubleRecord( EXC_ID_TOPMARGIN, maData.mfTopMargin ).Save( rStrm );
373 XclExpDoubleRecord( EXC_ID_BOTTOMMARGIN, maData.mfBottomMargin ).Save( rStrm );
374 XclExpSetup( maData ).Save( rStrm );
376 if( (GetBiff() == EXC_BIFF8) && maData.mxBrushItem.get() )
377 if( const Graphic* pGraphic = maData.mxBrushItem->GetGraphic() )
378 XclExpImgData( *pGraphic, EXC_ID8_IMGDATA ).Save( rStrm );
381 void XclExpPageSettings::SaveXml( XclExpXmlStream& rStrm )
383 XclExpXmlStartSingleElementRecord( XML_printOptions ).SaveXml( rStrm );
384 XclExpBoolRecord( EXC_ID_PRINTHEADERS, maData.mbPrintHeadings, XML_headings ).SaveXml( rStrm );
385 XclExpBoolRecord( EXC_ID_PRINTGRIDLINES, maData.mbPrintGrid, XML_gridLines ).SaveXml( rStrm );
386 XclExpBoolRecord( EXC_ID_GRIDSET, true, XML_gridLinesSet ).SaveXml( rStrm );
387 XclExpBoolRecord( EXC_ID_HCENTER, maData.mbHorCenter, XML_horizontalCentered ).SaveXml( rStrm );
388 XclExpBoolRecord( EXC_ID_VCENTER, maData.mbVerCenter, XML_verticalCentered ).SaveXml( rStrm );
389 XclExpXmlEndSingleElementRecord().SaveXml( rStrm ); // XML_printOptions
391 XclExpXmlStartSingleElementRecord( XML_pageMargins ).SaveXml( rStrm );
392 XclExpDoubleRecord( EXC_ID_LEFTMARGIN, maData.mfLeftMargin ).SetAttribute( XML_left )->SaveXml( rStrm );
393 XclExpDoubleRecord( EXC_ID_RIGHTMARGIN, maData.mfRightMargin ).SetAttribute( XML_right )->SaveXml( rStrm );
394 XclExpDoubleRecord( EXC_ID_TOPMARGIN, maData.mfTopMargin ).SetAttribute( XML_top )->SaveXml( rStrm );
395 XclExpDoubleRecord( EXC_ID_BOTTOMMARGIN, maData.mfBottomMargin ).SetAttribute( XML_bottom )->SaveXml( rStrm );
396 XclExpDoubleRecord( 0, maData.mfHeaderMargin).SetAttribute( XML_header )->SaveXml( rStrm );
397 XclExpDoubleRecord( 0, maData.mfFooterMargin).SetAttribute( XML_footer )->SaveXml( rStrm );
398 XclExpXmlEndSingleElementRecord().SaveXml( rStrm ); // XML_pageMargins
400 XclExpSetup( maData ).SaveXml( rStrm );
402 XclExpXmlStartHeaderFooterElementRecord(XML_headerFooter).SaveXml(rStrm);
403 XclExpHeaderFooter( EXC_ID_HEADER, maData.maHeader ).SaveXml( rStrm );
404 XclExpHeaderFooter( EXC_ID_FOOTER, maData.maFooter ).SaveXml( rStrm );
405 XclExpXmlEndElementRecord( XML_headerFooter ).SaveXml( rStrm );
407 XclExpPageBreaks( EXC_ID_HORPAGEBREAKS, maData.maHorPageBreaks,
408 static_cast< sal_uInt16 >( GetXclMaxPos().Col() ) ).SaveXml( rStrm );
409 XclExpPageBreaks( EXC_ID_VERPAGEBREAKS, maData.maVerPageBreaks,
410 static_cast< sal_uInt16 >( GetXclMaxPos().Row() ) ).SaveXml( rStrm );
413 XclExpImgData* XclExpPageSettings::getGraphicExport()
415 if( const Graphic* pGraphic = maData.mxBrushItem->GetGraphic() )
416 return new XclExpImgData( *pGraphic, EXC_ID8_IMGDATA );
418 return nullptr;
421 XclExpChartPageSettings::XclExpChartPageSettings( const XclExpRoot& rRoot ) :
422 XclExpRoot( rRoot )
426 void XclExpChartPageSettings::Save( XclExpStream& rStrm )
428 XclExpHeaderFooter( EXC_ID_HEADER, maData.maHeader ).Save( rStrm );
429 XclExpHeaderFooter( EXC_ID_FOOTER, maData.maFooter ).Save( rStrm );
430 XclExpBoolRecord( EXC_ID_HCENTER, maData.mbHorCenter ).Save( rStrm );
431 XclExpBoolRecord( EXC_ID_VCENTER, maData.mbVerCenter ).Save( rStrm );
432 XclExpSetup( maData ).Save( rStrm );
433 XclExpUInt16Record( EXC_ID_PRINTSIZE, EXC_PRINTSIZE_FULL ).Save( rStrm );
436 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */