LibreOffice Module reportdesign (master) 1
xmlExport.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 "xmlExport.hxx"
22#include "xmlAutoStyle.hxx"
23#include <xmloff/xmltoken.hxx>
25#include <xmloff/xmluconv.hxx>
27#include <xmloff/txtprmap.hxx>
28#include <xmloff/numehelp.hxx>
29#include "xmlHelper.hxx"
30#include <strings.hxx>
32#include <com/sun/star/util/NumberFormat.hpp>
33#include <com/sun/star/util/MeasureUnit.hpp>
34#include <com/sun/star/report/GroupOn.hpp>
35#include <com/sun/star/report/XFixedText.hpp>
36#include <com/sun/star/report/XImageControl.hpp>
37#include <com/sun/star/report/XShape.hpp>
38#include <com/sun/star/report/XFunction.hpp>
39#include <com/sun/star/awt/FontDescriptor.hpp>
40#include <com/sun/star/table/BorderLine2.hpp>
41#include <com/sun/star/table/BorderLineStyle.hpp>
42#include <com/sun/star/report/XFixedLine.hpp>
43#include <RptDef.hxx>
44#include <vcl/svapp.hxx>
45#include <osl/diagnose.h>
46#include <tools/color.hxx>
47#include <o3tl/string_view.hxx>
48
49#define DEFAULT_LINE_WIDTH 2
50
51namespace rptxml
52{
53 using namespace xmloff;
54 using namespace comphelper;
55 using namespace ::com::sun::star;
56 using namespace ::com::sun::star::report;
57 using namespace ::com::sun::star::uno;
58 using namespace ::com::sun::star::util;
59 using namespace ::com::sun::star::xml;
60
61
66 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
68 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
69 {
70 return cppu::acquire(new ORptExport(context,
71 "com.sun.star.comp.report.XMLSettingsExporter",
72 SvXMLExportFlags::SETTINGS ));
73 }
74
79 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
81 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
82 {
83 return cppu::acquire(new ORptExport(context,
84 "com.sun.star.comp.report.XMLContentExporter",
85 SvXMLExportFlags::CONTENT ));
86 }
87
92 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
94 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
95 {
96 return cppu::acquire(new ORptExport(context,
97 "com.sun.star.comp.report.XMLStylesExporter",
98 SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
99 SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS ));
100 }
101
106 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
108 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
109 {
110 return cppu::acquire(new ORptExport(context,
111 "com.sun.star.comp.report.XMLMetaExporter",
112 SvXMLExportFlags::META ));
113 }
114
119 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
121 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
122 {
123 return cppu::acquire(new ORptExport(context,
124 "com.sun.star.comp.report.XMLFullExporter",
125 SvXMLExportFlags::ALL));
126 }
127
128 namespace {
129
130 class OSpecialHandleXMLExportPropertyMapper : public SvXMLExportPropertyMapper
131 {
132 public:
133 explicit OSpecialHandleXMLExportPropertyMapper(const rtl::Reference< XMLPropertySetMapper >& rMapper) : SvXMLExportPropertyMapper(rMapper )
134 {
135 }
138 virtual void handleSpecialItem(
139 SvXMLAttributeList& /*rAttrList*/,
140 const XMLPropertyState& /*rProperty*/,
141 const SvXMLUnitConverter& /*rUnitConverter*/,
142 const SvXMLNamespaceMap& /*rNamespaceMap*/,
143 const ::std::vector< XMLPropertyState >* /*pProperties*/ = nullptr,
144 sal_uInt32 /*nIdx*/ = 0 ) const override
145 {
146 // nothing to do here
147 }
148 };
149
150 }
151
153{
154 for (auto& rEntry : _rGrid)
155 {
156 ORptExport::TGrid::iterator aRowIter = rEntry.second.begin();
157 ORptExport::TGrid::const_iterator aRowEnd = rEntry.second.end();
158 for (; aRowIter != aRowEnd; ++aRowIter)
159 {
160 if ( aRowIter->first )
161 {
162 sal_Int32 nColIndex = 0;
163 for (const auto& rCell : aRowIter->second)
164 {
165 if ( rCell.nRowSpan > 1 )
166 {
167 sal_Int32 nColSpan = rCell.nColSpan;
168 for (sal_Int32 i = 1; i < rCell.nRowSpan; ++i)
169 {
170 (aRowIter+i)->second[nColIndex].nColSpan = nColSpan;
171 }
172 }
173 ++nColIndex;
174 }
175 }
176 }
177 }
178}
179
180ORptExport::ORptExport(const Reference< XComponentContext >& _rxContext, OUString const & implementationName, SvXMLExportFlags nExportFlag)
181: SvXMLExport( _rxContext, implementationName, util::MeasureUnit::MM_100TH, XML_REPORT, SvXMLExportFlags::OASIS)
182,m_bAllreadyFilled(false)
183{
184 setExportFlags( SvXMLExportFlags::OASIS | nExportFlag);
185 GetMM100UnitConverter().SetCoreMeasureUnit(css::util::MeasureUnit::MM_100TH);
186 GetMM100UnitConverter().SetXMLMeasureUnit(css::util::MeasureUnit::CM);
187
188 // (getExportFlags() & EXPORT_CONTENT) != 0 ? : XML_N_OOO
191
197
198
199 if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS) )
201
202 if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS) )
203 {
205 }
206 if( getExportFlags() & SvXMLExportFlags::SETTINGS )
207 {
209 }
210
211 if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS) )
212 {
214 }
215 // RDFa: needed for content and header/footer styles
216 if( getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
217 {
219 // loext, needed for paragraphs inside shapes
221 {
225 }
226 }
227 // GRDDL: to convert RDFa and meta.xml to RDF
228 if( getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
229 {
231 }
232
235
238
239
241 rtl::Reference < XMLPropertyHandlerFactory> xFac = new ::xmloff::OControlPropertyHandlerFactory();
243 rtl::Reference < XMLPropertySetMapper > xTableStylesPropertySetMapper2 = new XMLTextPropertySetMapper(TextPropMap::TABLE_DEFAULTS, true );
244 xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2);
245
246 m_xTableStylesExportPropertySetMapper = new SvXMLExportPropertyMapper(xTableStylesPropertySetMapper1);
247
249 m_xCellStylesExportPropertySetMapper = new OSpecialHandleXMLExportPropertyMapper(m_xCellStylesPropertySetMapper);
251
253 m_xColumnStylesExportPropertySetMapper = new OSpecialHandleXMLExportPropertyMapper(xColumnStylesPropertySetMapper);
254
256 m_xRowStylesExportPropertySetMapper = new OSpecialHandleXMLExportPropertyMapper(xRowStylesPropertySetMapper);
257
258 rtl::Reference < XMLPropertySetMapper > xPropMapper(new XMLTextPropertySetMapper( TextPropMap::PARA, true ));
259 m_xParaPropMapper = new OSpecialHandleXMLExportPropertyMapper( xPropMapper);
260
261 const OUString& sFamily( GetXMLToken(XML_PARAGRAPH) );
262 GetAutoStylePool()->AddFamily( XmlStyleFamily::TEXT_PARAGRAPH, sFamily,
263 m_xParaPropMapper, "P" );
264
265 GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_CELL, XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME,
267 GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_COLUMN, XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME,
269 GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_ROW, XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME,
271 GetAutoStylePool()->AddFamily(XmlStyleFamily::TABLE_TABLE, XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME,
273}
274
275extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
277 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
278{
279 return cppu::acquire(new ORptExport(context,
280 "com.sun.star.comp.report.ExportFilter",
281 SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::FONTDECLS));
282}
283
284
285void ORptExport::exportFunctions(const Reference<XIndexAccess>& _xFunctions)
286{
287 const sal_Int32 nCount = _xFunctions->getCount();
288 for (sal_Int32 i = 0; i< nCount; ++i)
289 {
290 uno::Reference< report::XFunction> xFunction(_xFunctions->getByIndex(i),uno::UNO_QUERY_THROW);
291 exportFunction(xFunction);
292 }
293}
294
295void ORptExport::exportFunction(const uno::Reference< XFunction>& _xFunction)
296{
297 exportFormula(XML_FORMULA,_xFunction->getFormula());
298 beans::Optional< OUString> aInitial = _xFunction->getInitialFormula();
299 if ( aInitial.IsPresent && !aInitial.Value.isEmpty() )
300 exportFormula(XML_INITIAL_FORMULA ,aInitial.Value );
301 AddAttribute( XML_NAMESPACE_REPORT, XML_NAME , _xFunction->getName() );
302 if ( _xFunction->getPreEvaluated() )
304 if ( _xFunction->getDeepTraversing() )
306
307 SvXMLElementExport aFunction(*this,XML_NAMESPACE_REPORT, XML_FUNCTION, true, true);
308}
309
310void ORptExport::exportMasterDetailFields(const Reference<XReportComponent>& _xReportComponent)
311{
312 const uno::Sequence< OUString> aMasterFields = _xReportComponent->getMasterFields();
313 if ( !aMasterFields.hasElements() )
314 return;
315
317 const uno::Sequence< OUString> aDetailFields = _xReportComponent->getDetailFields();
318
319 OSL_ENSURE(aDetailFields.getLength() == aMasterFields.getLength(),"not equal length for master and detail fields!");
320
321 const OUString* pDetailFieldsIter = aDetailFields.getConstArray();
322 for(const OUString& rMasterField : aMasterFields)
323 {
325 if ( !pDetailFieldsIter->isEmpty() )
326 AddAttribute( XML_NAMESPACE_REPORT, XML_DETAIL , *pDetailFieldsIter );
328 ++pDetailFieldsIter;
329 }
330}
331
332void ORptExport::exportReport(const Reference<XReportDefinition>& _xReportDefinition)
333{
334 if ( !_xReportDefinition.is() )
335 return;
336
337 exportFunctions(_xReportDefinition->getFunctions());
338 exportGroupsExpressionAsFunction(_xReportDefinition->getGroups());
339
340 if ( _xReportDefinition->getReportHeaderOn() )
341 {
342 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_REPORT_HEADER, true, true);
343 exportSection(_xReportDefinition->getReportHeader());
344 }
345 if ( _xReportDefinition->getPageHeaderOn() )
346 {
347 OUStringBuffer sValue;
348 sal_Int16 nRet = _xReportDefinition->getPageHeaderOption();
350 if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
351 AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear());
352
353 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_HEADER, true, true);
354 exportSection(_xReportDefinition->getPageHeader(),true);
355 }
356
357 exportGroup(_xReportDefinition,0);
358
359 if ( _xReportDefinition->getPageFooterOn() )
360 {
361 OUStringBuffer sValue;
362 sal_Int16 nRet = _xReportDefinition->getPageFooterOption();
364 if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
365 AddAttribute(XML_NAMESPACE_REPORT, XML_PAGE_PRINT_OPTION,sValue.makeStringAndClear());
366 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_PAGE_FOOTER, true, true);
367 exportSection(_xReportDefinition->getPageFooter(),true);
368 }
369 if ( _xReportDefinition->getReportFooterOn() )
370 {
371 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_REPORT_FOOTER, true, true);
372 exportSection(_xReportDefinition->getReportFooter());
373 }
374}
375
376void ORptExport::exportComponent(const Reference<XReportComponent>& _xReportComponent)
377{
378 OSL_ENSURE(_xReportComponent.is(),"No component interface!");
379 if ( !_xReportComponent.is() )
380 return;
381
382 AddAttribute(XML_NAMESPACE_DRAW, XML_NAME,_xReportComponent->getName());
383
385}
386
387void ORptExport::exportFormatConditions(const Reference<XReportControlModel>& _xReportElement)
388{
389 OSL_ENSURE(_xReportElement.is(),"_xReportElement is NULL -> GPF");
390 const sal_Int32 nCount = _xReportElement->getCount();
391 try
392 {
393 for (sal_Int32 i = 0; i < nCount ; ++i)
394 {
395 uno::Reference< report::XFormatCondition > xCond(_xReportElement->getByIndex(i),uno::UNO_QUERY);
396 if ( !xCond->getEnabled() )
398
399 AddAttribute(XML_NAMESPACE_REPORT, XML_FORMULA,xCond->getFormula());
400
403 }
404 }
405 catch(uno::Exception&)
406 {
407 OSL_FAIL("Can not access format condition!");
408 }
409}
410
411void ORptExport::exportReportElement(const Reference<XReportControlModel>& _xReportElement)
412{
413 OSL_ENSURE(_xReportElement.is(),"_xReportElement is NULL -> GPF");
414 if ( !_xReportElement->getPrintWhenGroupChange() )
416
417 if ( !_xReportElement->getPrintRepeatedValues() )
419
421 if ( _xReportElement->getCount() )
422 {
423 exportFormatConditions(_xReportElement);
424 }
425
426 OUString sExpr = _xReportElement->getConditionalPrintExpression();
427 if ( !sExpr.isEmpty() )
428 {
431 }
432
433 // only export when parent exists
434 uno::Reference< report::XSection> xParent(_xReportElement->getParent(),uno::UNO_QUERY);
435 if ( xParent.is() )
436 exportComponent(_xReportElement);
437}
438
439static void lcl_calculate(const ::std::vector<sal_Int32>& _aPosX,const ::std::vector<sal_Int32>& _aPosY,ORptExport::TGrid& _rColumns)
440{
441 sal_Int32 nCountX = _aPosX.size() - 1;
442 sal_Int32 nCountY = _aPosY.size() - 1;
443 for (sal_Int32 j = 0; j < nCountY; ++j)
444 {
445 sal_Int32 nHeight = _aPosY[j+1] - _aPosY[j];
446 if ( nHeight )
447 for (sal_Int32 i = 0; i < nCountX ; ++i)
448 {
449 _rColumns[j].second[i] = ORptExport::TCell(1,1);
450 _rColumns[j].second[i].bSet = true;
451 }
452 }
453}
454
455void ORptExport::collectStyleNames(XmlStyleFamily _nFamily,const ::std::vector< sal_Int32>& _aSize, std::vector<OUString>& _rStyleNames)
456{
457 ::std::vector<sal_Int32>::const_iterator aIter = _aSize.begin();
458 ::std::vector<sal_Int32>::const_iterator aIter2 = aIter + 1;
459 ::std::vector<sal_Int32>::const_iterator aEnd = _aSize.end();
460 for (;aIter2 != aEnd ; ++aIter,++aIter2)
461 {
462 ::std::vector< XMLPropertyState > aPropertyStates(1, 0);
463 sal_Int32 nValue = static_cast<sal_Int32>(*aIter2 - *aIter);
464 aPropertyStates[0].maValue <<= nValue;
465 _rStyleNames.push_back(GetAutoStylePool()->Add(_nFamily, std::move(aPropertyStates) ));
466 }
467}
468
469void ORptExport::collectStyleNames(XmlStyleFamily _nFamily, const ::std::vector< sal_Int32>& _aSize, const ::std::vector< sal_Int32>& _aSizeAutoGrow, std::vector<OUString>& _rStyleNames)
470{
471 ::std::vector<sal_Int32>::const_iterator aIter = _aSize.begin();
472 ::std::vector<sal_Int32>::const_iterator aIter2 = aIter + 1;
473 ::std::vector<sal_Int32>::const_iterator aEnd = _aSize.end();
474 for (;aIter2 != aEnd; ++aIter, ++aIter2)
475 {
476 ::std::vector< XMLPropertyState > aPropertyStates(1, 0);
477 sal_Int32 nValue = static_cast<sal_Int32>(*aIter2 - *aIter);
478 aPropertyStates[0].maValue <<= nValue;
479 // note: there cannot be 0-height rows, because a call to std::unique has removed them
480 // it cannot be predicted that the size of _aSizeAutoGrow has any relation to the size of
481 // _aSize, because of the same std::unique operation (and _aSizeAutoGrow wasn't even the same
482 // size before that), so the matching element in _aSizeAutoGrow has to be found by lookup.
483 ::std::vector<sal_Int32>::const_iterator aAutoGrow = ::std::find(_aSizeAutoGrow.begin(), _aSizeAutoGrow.end(), *aIter2);
484 bool bAutoGrow = aAutoGrow != _aSizeAutoGrow.end();
485 // the mnIndex is into the array returned by OXMLHelper::GetRowStyleProps()
486 aPropertyStates[0].mnIndex = bAutoGrow ? 1 : 0;
487 _rStyleNames.push_back(GetAutoStylePool()->Add(_nFamily, std::move(aPropertyStates)));
488 }
489}
490
491void ORptExport::exportSectionAutoStyle(const Reference<XSection>& _xProp)
492{
493 OSL_ENSURE(_xProp != nullptr,"Section is NULL -> GPF");
494 exportAutoStyle(_xProp);
495
496 Reference<XReportDefinition> xReport = _xProp->getReportDefinition();
497 const awt::Size aSize = rptui::getStyleProperty<awt::Size>(xReport,PROPERTY_PAPERSIZE);
498 const sal_Int32 nOffset = rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_LEFTMARGIN);
499 const sal_Int32 nCount = _xProp->getCount();
500
501 ::std::vector<sal_Int32> aColumnPos;
502 aColumnPos.reserve(2*(nCount + 1));
503 aColumnPos.push_back(nOffset);
504 aColumnPos.push_back(aSize.Width - rptui::getStyleProperty<sal_Int32>(xReport,PROPERTY_RIGHTMARGIN));
505
506 ::std::vector<sal_Int32> aRowPos;
507 aRowPos.reserve(2*(nCount + 1));
508 aRowPos.push_back(0);
509 aRowPos.push_back(_xProp->getHeight());
510
511
512 ::std::vector<sal_Int32> aRowPosAutoGrow;
513 aRowPosAutoGrow.reserve(2 * (nCount + 1));
514
515
516 sal_Int32 i;
517 for (i = 0 ; i< nCount ; ++i)
518 {
519 Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
520 uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
521 if ( xShape.is() )
522 continue;
523 OSL_ENSURE( xReportElement.is(),"NULL Element in Section!" );
524 if ( !xReportElement.is() )
525 continue;
526 sal_Int32 nX = xReportElement->getPositionX();
527 aColumnPos.push_back(nX);
528 Reference<XFixedLine> xFixedLine(xReportElement,uno::UNO_QUERY);
529 if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
530 {
531 sal_Int32 nWidth = static_cast<sal_Int32>(xReportElement->getWidth()*0.5);
532 nX += nWidth;
533 aColumnPos.push_back(nX);
534 nX += xReportElement->getWidth() - nWidth;
535 }
536 else
537 nX += xReportElement->getWidth();
538 aColumnPos.push_back(nX); // --nX why?
539
540 sal_Int32 nY = xReportElement->getPositionY();
541 aRowPos.push_back(nY);
542 nY += xReportElement->getHeight();
543 aRowPos.push_back(nY); // --nY why?
544 bool bAutoGrow = xReportElement->getAutoGrow();
545 if (bAutoGrow)
546 {
547 // the resulting table row ending at nY should auto-grow
548 aRowPosAutoGrow.push_back(nY);
549 }
550 }
551
552 ::std::sort(aColumnPos.begin(),aColumnPos.end(),::std::less<sal_Int32>());
553 aColumnPos.erase(::std::unique(aColumnPos.begin(),aColumnPos.end()),aColumnPos.end());
554
555 // note: the aRowPos contains top and bottom position of every report control; we now compute the
556 // top of every row in the resulting table, by sorting and eliminating unnecessary duplicate
557 // positions. (the same for the columns in the preceding lines.)
558 ::std::sort(aRowPos.begin(),aRowPos.end(),::std::less<sal_Int32>());
559 aRowPos.erase(::std::unique(aRowPos.begin(),aRowPos.end()),aRowPos.end());
560
561 TSectionsGrid::iterator aInsert = m_aSectionsGrid.emplace(
562 _xProp.get(),
563 TGrid(aRowPos.size() - 1,TGrid::value_type(false,TRow(aColumnPos.size() - 1)))
564 ).first;
565 lcl_calculate(aColumnPos,aRowPos,aInsert->second);
566
567 TGridStyleMap::iterator aPos = m_aColumnStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first;
568 collectStyleNames(XmlStyleFamily::TABLE_COLUMN,aColumnPos,aPos->second);
569 aPos = m_aRowStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first;
570 collectStyleNames(XmlStyleFamily::TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second);
571
572 sal_Int32 x1 = 0;
573 sal_Int32 y1 = 0;
574 sal_Int32 x2 = 0;
575 sal_Int32 y2 = 0;
576 sal_Int32 xi = 0;
577 sal_Int32 yi = 0;
578 bool isOverlap = false;
579
580 for (i = 0 ; i< nCount ; ++i)
581 {
582 Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
583 uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
584 if ( xShape.is() )
585 continue;
586 sal_Int32 nPos = xReportElement->getPositionX();
587 x1 = (::std::find(aColumnPos.begin(),aColumnPos.end(),nPos) - aColumnPos.begin());
588 Reference<XFixedLine> xFixedLine(xReportElement,uno::UNO_QUERY);
589 if ( xFixedLine.is() && xFixedLine->getOrientation() == 1 ) // vertical
590 nPos += static_cast<sal_Int32>(xReportElement->getWidth()*0.5);
591 else
592 nPos += xReportElement->getWidth(); // -1 why
593 x2 = (::std::find(aColumnPos.begin(),aColumnPos.end(),nPos) - aColumnPos.begin());
594
595 nPos = xReportElement->getPositionY();
596 y1 = (::std::find(aRowPos.begin(),aRowPos.end(),nPos) - aRowPos.begin());
597 nPos += xReportElement->getHeight(); // -1 why?
598 y2 = (::std::find(aRowPos.begin(),aRowPos.end(),nPos) - aRowPos.begin());
599
600 isOverlap = false;
601 yi = y1;
602 while(yi < y2 && !isOverlap) // find overlapping controls
603 {
604 xi = x1;
605 while(xi < x2 && !isOverlap)
606 {
607 if ( aInsert->second[yi].second[xi].xElement.is() )
608 {
609 isOverlap = true;
610 }
611 ++xi;
612 }
613 ++yi;
614 }
615
616 if (!isOverlap)
617 {
618 yi = y1;
619 while(yi < y2)
620 {
621 xi = x1;
622 while(xi < x2)
623 {
624 aInsert->second[yi].second[xi] = TCell();
625 ++xi;
626 }
627 aInsert->second[yi].first = true;
628 ++yi;
629 }
630
631 if (x2 - x1 != 0 && y2 - y1 != 0)
632 {
633 sal_Int32 nColSpan = x2 - x1;
634 sal_Int32 nRowSpan = y2 - y1;
635 aInsert->second[y1].second[x1] =
636 TCell(
637 nColSpan,
638 nRowSpan,
639 xReportElement
640 );
641 }
642 }
643 }
644
647}
648
649void ORptExport::exportReportComponentAutoStyles(const Reference<XSection>& _xProp)
650{
651 const sal_Int32 nCount = _xProp->getCount();
652 for (sal_Int32 i = 0 ; i< nCount ; ++i)
653 {
654 const Reference<XReportComponent> xReportElement(_xProp->getByIndex(i),uno::UNO_QUERY);
655 const Reference< report::XShape > xShape(xReportElement,uno::UNO_QUERY);
656 if ( xShape.is() )
657 {
659 xShapeExport->seekShapes(_xProp);
660 SolarMutexGuard aGuard;
661 css::uno::Sequence<OUString> aAutoStylePropNames = GetAutoStylePool()->GetPropertyNames();
662 xShapeExport->collectShapeAutoStyles(xShape, aAutoStylePropNames);
663 }
664 else
665 {
666 exportAutoStyle(xReportElement.get());
667
668 Reference<XFormattedField> xFormattedField(xReportElement,uno::UNO_QUERY);
669 if ( xFormattedField.is() )
670 {
671 try
672 {
673 const sal_Int32 nFormatCount = xFormattedField->getCount();
674 for (sal_Int32 j = 0; j < nFormatCount ; ++j)
675 {
676 uno::Reference< report::XFormatCondition > xCond(xFormattedField->getByIndex(j),uno::UNO_QUERY);
677 exportAutoStyle(xCond.get(),xFormattedField);
678 }
679 }
680 catch(uno::Exception&)
681 {
682 OSL_FAIL("Can not access format condition!");
683 }
684 }
685 }
686 }
687}
688
689void ORptExport::exportSection(const Reference<XSection>& _xSection,bool bHeader)
690{
691 OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
692 AddAttribute(XML_NAMESPACE_TABLE, XML_NAME,_xSection->getName());
693
694 if ( !_xSection->getVisible() )
696
697 if ( !bHeader )
698 {
699 OUStringBuffer sValue;
700 sal_Int16 nRet = _xSection->getForceNewPage();
702 if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
703 AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_PAGE,sValue.makeStringAndClear());
704
705 nRet = _xSection->getNewRowOrCol();
706 if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
707 AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_COLUMN,sValue.makeStringAndClear());
708 if ( _xSection->getKeepTogether() )
710 }
711
712 exportStyleName(_xSection.get(),GetAttrList(),m_sTableStyle);
713
715 SvXMLElementExport aComponents(*this,XML_NAMESPACE_TABLE, XML_TABLE, true, true);
716
717 OUString sExpr = _xSection->getConditionalPrintExpression();
718 if ( !sExpr.isEmpty() )
719 {
722 }
723
724 exportContainer(_xSection);
725}
726
727void ORptExport::exportTableColumns(const Reference< XSection>& _xSection)
728{
729 SvXMLElementExport aColumns(*this,XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, true, true);
730 TGridStyleMap::const_iterator aColFind = m_aColumnStyleNames.find(_xSection);
731 OSL_ENSURE(aColFind != m_aColumnStyleNames.end(),"ORptExport::exportTableColumns: Section not found in m_aColumnStyleNames!");
732 if ( aColFind == m_aColumnStyleNames.end() )
733 return;
734
735 for (auto& aCol : aColFind->second)
736 {
738 SvXMLElementExport aColumn(*this,XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, true, true);
739 }
740}
741
742void ORptExport::exportContainer(const Reference< XSection>& _xSection)
743{
744 OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
745
746 exportTableColumns(_xSection);
747
748 TSectionsGrid::const_iterator aFind = m_aSectionsGrid.find(_xSection);
749 OSL_ENSURE(aFind != m_aSectionsGrid.end(),"ORptExport::exportContainer: Section not found in grid!");
750 if ( aFind == m_aSectionsGrid.end() )
751 return;
752 TGrid::const_iterator aRowIter = aFind->second.begin();
753 TGrid::const_iterator aRowEnd = aFind->second.end();
754
755 TGridStyleMap::const_iterator aRowFind = m_aRowStyleNames.find(_xSection);
756 auto aHeightIter = aRowFind->second.cbegin();
757 OSL_ENSURE(aRowFind->second.size() == aFind->second.size(),"Different count for rows");
758
759 bool bShapeHandled = false;
760 ::std::map<sal_Int32,sal_Int32> aRowSpan;
761 for (sal_Int32 j = 0; aRowIter != aRowEnd; ++aRowIter,++j,++aHeightIter)
762 {
763 AddAttribute( m_sTableStyle,*aHeightIter );
765 if ( aRowIter->first )
766 {
767 ::std::vector< TCell >::const_iterator aColIter = aRowIter->second.begin();
768 ::std::vector< TCell >::const_iterator aColEnd = aRowIter->second.end();
769 sal_Int32 nEmptyCellColSpan = 0;
770 for (; aColIter != aColEnd; ++aColIter)
771 {
772 bool bCoveredCell = false;
773 sal_Int32 nColSpan = 0;
774 sal_Int32 nColIndex = aColIter - aRowIter->second.begin();
775 ::std::map<sal_Int32,sal_Int32>::iterator aRowSpanFind = aRowSpan.find(nColIndex);
776 if ( aRowSpanFind != aRowSpan.end() )
777 {
778 nColSpan = 1;
779 if ( !--(aRowSpanFind->second) )
780 aRowSpan.erase(aRowSpanFind);
781
782 if ( aColIter->nColSpan > 1 )
783 nColSpan += aColIter->nColSpan - 1;
784
785 bCoveredCell = true;
786 aColIter = aColIter + (aColIter->nColSpan - 1);
787 }
788 else if ( aColIter->bSet )
789 {
790 if ( nEmptyCellColSpan > 0 )
791 {
792 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) );
793 bCoveredCell = true;
794 nColSpan = nEmptyCellColSpan - 1;
795 nEmptyCellColSpan = 0;
796 }
797 sal_Int32 nSpan = aColIter->nColSpan;
798 if ( nSpan > 1 )
799 {
801 nColSpan = nSpan - 1;
802 bCoveredCell = true;
803 }
804 nSpan = aColIter->nRowSpan;
805 if ( nSpan > 1 )
806 {
807 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_ROWS_SPANNED, OUString::number(nSpan) );
808 aRowSpan[nColIndex] = nSpan - 1;
809 }
810 if ( aColIter->xElement.is() )
811 exportStyleName(aColIter->xElement.get(),GetAttrList(),m_sTableStyle);
812
813 // start <table:table-cell>
814 Reference<XFormattedField> xFormattedField(aColIter->xElement,uno::UNO_QUERY);
815 if ( xFormattedField.is() )
816 {
817 sal_Int32 nFormatKey = xFormattedField->getFormatKey();
819 bool bIsStandard = false;
820 sal_Int16 nCellType = aHelper.GetCellType(nFormatKey,bIsStandard);
821 // "Standard" means "no format set, value could be anything",
822 // so don't set a format attribute in this case.
823 // P.S.: "Standard" is called "General" in some languages
824 if (!bIsStandard)
825 {
826 if ( nCellType == util::NumberFormat::TEXT )
827 aHelper.SetNumberFormatAttributes("", u"");
828 else
829 aHelper.SetNumberFormatAttributes(nFormatKey, 0.0, false);
830 }
831 }
832 SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, false);
833
834 if ( aColIter->xElement.is() )
835 {
836 // start <text:p>
837 SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, true, false);
838 Reference<XServiceInfo> xElement(aColIter->xElement,uno::UNO_QUERY);
839
840 if ( !bShapeHandled )
841 {
842 bShapeHandled = true;
843 exportShapes(_xSection,false);
844 }
845 uno::Reference< XShape > xShape(xElement,uno::UNO_QUERY);
846 uno::Reference< XFixedLine > xFixedLine(xElement,uno::UNO_QUERY);
847 if ( !xShape.is() && !xFixedLine.is() )
848 {
849 Reference<XReportControlModel> xReportElement(xElement,uno::UNO_QUERY);
850 Reference<XReportDefinition> xReportDefinition(xElement,uno::UNO_QUERY);
851 Reference< XImageControl > xImage(xElement,uno::UNO_QUERY);
852 Reference<XSection> xSection(xElement,uno::UNO_QUERY);
853
855 bool bExportData = false;
856 if ( xElement->supportsService(SERVICE_FIXEDTEXT) )
857 {
859 }
860 else if ( xElement->supportsService(SERVICE_FORMATTEDFIELD) )
861 {
863 bExportData = true;
864 }
865 else if ( xElement->supportsService(SERVICE_IMAGECONTROL) )
866 {
868 OUString sTargetLocation = xImage->getImageURL();
869 if ( !sTargetLocation.isEmpty() )
870 {
871 sTargetLocation = GetRelativeReference(sTargetLocation);
873 }
874 bExportData = true;
875 OUStringBuffer sValue;
876 const SvXMLEnumMapEntry<sal_Int16>* aXML_ImageScaleEnumMap = OXMLHelper::GetImageScaleOptions();
877 if ( SvXMLUnitConverter::convertEnum( sValue, xImage->getScaleMode(),aXML_ImageScaleEnumMap ) )
878 AddAttribute(XML_NAMESPACE_REPORT, XML_SCALE, sValue.makeStringAndClear() );
879 }
880 else if ( xReportDefinition.is() )
881 {
883 }
884
885 if ( bExportData )
886 {
887 const bool bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
888 if ( bPageSet )
890 else if ( eToken == XML_IMAGE )
892 }
893
894 {
895 // start <report:eToken>
896 SvXMLElementExport aComponents(*this,XML_NAMESPACE_REPORT, eToken, false, false);
897 if ( eToken == XML_FIXED_CONTENT )
898 exportParagraph(xReportElement);
899 if ( xReportElement.is() )
900 exportReportElement(xReportElement);
901
902 if (eToken == XML_SUB_DOCUMENT && xReportDefinition.is())
903 {
904 SvXMLElementExport aOfficeElement( *this, XML_NAMESPACE_OFFICE, XML_BODY, true, true );
905 SvXMLElementExport aElem( *this, true,
907 true, true );
908
909 exportReportAttributes(xReportDefinition);
910 exportReport(xReportDefinition);
911 }
912 else if ( xSection.is() )
913 exportSection(xSection);
914 }
915 }
916 }
917 else if ( !bShapeHandled )
918 {
919 bShapeHandled = true;
920 exportShapes(_xSection);
921 }
922 aColIter = aColIter + (aColIter->nColSpan - 1);
923 }
924 else
925 ++nEmptyCellColSpan;
926 if ( bCoveredCell )
927 {
928 for (sal_Int32 k = 0; k < nColSpan; ++k)
929 {
931 }
932
933 }
934 }
935 if ( nEmptyCellColSpan )
936 {
937 {
938 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) );
939 SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true);
940 if ( !bShapeHandled )
941 {
942 bShapeHandled = true;
943 exportShapes(_xSection);
944 }
945 }
946 for (sal_Int32 k = 0; k < nEmptyCellColSpan; ++k)
947 {
948 SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, true, true);
949 }
950 }
951 }
952 else
953 { // empty rows
954 sal_Int32 nEmptyCellColSpan = aRowIter->second.size();
955 if ( nEmptyCellColSpan )
956 {
957 {
958 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) );
959 SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true);
960 if ( !bShapeHandled )
961 {
962 bShapeHandled = true;
963 exportShapes(_xSection);
964 }
965 }
966 for (sal_Int32 k = 1; k < nEmptyCellColSpan; ++k)
967 {
968 SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, true, true);
969 }
970 }
971 }
972 }
973}
974
975OUString ORptExport::convertFormula(const OUString& _sFormula)
976{
977 OUString sFormula = _sFormula;
978 if ( _sFormula == "rpt:" )
979 sFormula.clear();
980 return sFormula;
981}
982
983bool ORptExport::exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OUString& _sFormula)
984{
985 const OUString sFieldData = convertFormula(_sFormula);
986 sal_Int32 nPageNumberIndex = sFieldData.indexOf("PageNumber()");
987 sal_Int32 nPageCountIndex = sFieldData.indexOf("PageCount()");
988 bool bRet = nPageNumberIndex != -1 || nPageCountIndex != -1;
989 if ( !bRet )
990 AddAttribute(XML_NAMESPACE_REPORT, eName,sFieldData);
991
992 return bRet;
993}
994
995void ORptExport::exportStyleName(XPropertySet* _xProp,SvXMLAttributeList& _rAtt,const OUString& _sName)
996{
997 Reference<XPropertySet> xFind(_xProp);
998 TPropertyStyleMap::const_iterator aFind = m_aAutoStyleNames.find(xFind);
999 if ( aFind != m_aAutoStyleNames.end() )
1000 {
1001 _rAtt.AddAttribute( _sName,
1002 aFind->second );
1003 m_aAutoStyleNames.erase(aFind);
1004 }
1005}
1006
1007void ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDefinition,sal_Int32 _nPos,bool _bExportAutoStyle)
1008{
1009 if ( !_xReportDefinition.is() )
1010 return;
1011
1012 Reference< XGroups > xGroups = _xReportDefinition->getGroups();
1013 if ( !xGroups.is() )
1014 return;
1015
1016 sal_Int32 nCount = xGroups->getCount();
1017 if ( _nPos >= 0 && _nPos < nCount )
1018 {
1019 Reference<XGroup> xGroup(xGroups->getByIndex(_nPos),uno::UNO_QUERY);
1020 OSL_ENSURE(xGroup.is(),"No Group prepare for GPF");
1021 if ( _bExportAutoStyle )
1022 {
1023 if ( xGroup->getHeaderOn() )
1024 exportSectionAutoStyle(xGroup->getHeader());
1025 exportGroup(_xReportDefinition,_nPos+1,_bExportAutoStyle);
1026 if ( xGroup->getFooterOn() )
1027 exportSectionAutoStyle(xGroup->getFooter());
1028 }
1029 else
1030 {
1031 if ( xGroup->getSortAscending() )
1033
1034 if ( xGroup->getStartNewColumn() )
1036 if ( xGroup->getResetPageNumber() )
1038
1039 const OUString sField = xGroup->getExpression();
1040 OUString sExpression = sField;
1041 if ( !sExpression.isEmpty() )
1042 {
1043 sExpression = sExpression.replaceAll(u"\"", u"\"\"");
1044
1045 TGroupFunctionMap::const_iterator aGroupFind = m_aGroupFunctionMap.find(xGroup);
1046 if ( aGroupFind != m_aGroupFunctionMap.end() )
1047 sExpression = aGroupFind->second->getName();
1048 sExpression = "rpt:HASCHANGED(\"" + sExpression + "\")";
1049 }
1052 sal_Int16 nRet = xGroup->getKeepTogether();
1053 OUStringBuffer sValue;
1054 const SvXMLEnumMapEntry<sal_Int16>* aXML_KeepTogetherEnumMap = OXMLHelper::GetKeepTogetherOptions();
1055 if ( SvXMLUnitConverter::convertEnum( sValue, nRet, aXML_KeepTogetherEnumMap ) )
1056 AddAttribute(XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER,sValue.makeStringAndClear());
1057
1058 SvXMLElementExport aGroup(*this,XML_NAMESPACE_REPORT, XML_GROUP, true, true);
1059 exportFunctions(xGroup->getFunctions());
1060 if ( xGroup->getHeaderOn() )
1061 {
1062 Reference<XSection> xSection = xGroup->getHeader();
1063 if ( xSection->getRepeatSection() )
1065 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_HEADER, true, true);
1066 exportSection(xSection);
1067 }
1068 exportGroup(_xReportDefinition,_nPos+1,_bExportAutoStyle);
1069 if ( xGroup->getFooterOn() )
1070 {
1071 Reference<XSection> xSection = xGroup->getFooter();
1072 if ( xSection->getRepeatSection() )
1074 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_FOOTER, true, true);
1075 exportSection(xSection);
1076 }
1077 }
1078 }
1079 else if ( _bExportAutoStyle )
1080 {
1081 exportSectionAutoStyle(_xReportDefinition->getDetail());
1082 }
1083 else
1084 {
1085 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_DETAIL, true, true);
1086 exportSection(_xReportDefinition->getDetail());
1087 }
1088}
1089
1090void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormattedField>& _xParentFormattedField)
1091{
1092 const uno::Reference<report::XReportControlFormat> xFormat(_xProp,uno::UNO_QUERY);
1093 if ( xFormat.is() )
1094 {
1095 try
1096 {
1097 const awt::FontDescriptor aFont = xFormat->getFontDescriptor();
1098 OSL_ENSURE(!aFont.Name.isEmpty(),"No Font Name !");
1099 GetFontAutoStylePool()->Add(aFont.Name,aFont.StyleName,static_cast<FontFamily>(aFont.Family),
1100 static_cast<FontPitch>(aFont.Pitch),aFont.CharSet );
1101 }
1102 catch(beans::UnknownPropertyException&)
1103 {
1104 // not interested in
1105 }
1106 }
1107 const uno::Reference< report::XShape> xShape(_xProp,uno::UNO_QUERY);
1108 if ( xShape.is() )
1109 {
1110 ::std::vector<XMLPropertyState> aPropertyStates(m_xParaPropMapper->Filter(*this, _xProp));
1111 if ( !aPropertyStates.empty() )
1112 m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TEXT_PARAGRAPH, std::move(aPropertyStates) ));
1113 }
1114 ::std::vector<XMLPropertyState> aPropertyStates(m_xCellStylesExportPropertySetMapper->Filter(*this, _xProp));
1115 Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY);
1116 if ( xFixedLine.is() )
1117 {
1118 uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet();
1119 table::BorderLine2 aValue;
1120 aValue.Color = sal_uInt32(COL_BLACK);
1121 aValue.InnerLineWidth = aValue.LineDistance = 0;
1122 aValue.OuterLineWidth = DEFAULT_LINE_WIDTH;
1123 aValue.LineStyle = table::BorderLineStyle::SOLID;
1124 aValue.LineWidth = DEFAULT_LINE_WIDTH;
1125
1126 awt::Point aPos = xFixedLine->getPosition();
1127 awt::Size aSize = xFixedLine->getSize();
1128 sal_Int32 nSectionHeight = xFixedLine->getSection()->getHeight();
1129
1130 OUString sBorderProp;
1131 ::std::vector< OUString> aProps;
1132 if ( xFixedLine->getOrientation() == 1 ) // vertical
1133 {
1134 // check if border should be left
1135 if ( !aPos.X )
1136 {
1137 sBorderProp = PROPERTY_BORDERLEFT;
1138 aProps.emplace_back(PROPERTY_BORDERRIGHT);
1139 }
1140 else
1141 {
1142 sBorderProp = PROPERTY_BORDERRIGHT;
1143 aProps.emplace_back(PROPERTY_BORDERLEFT);
1144 }
1145 aProps.emplace_back(PROPERTY_BORDERTOP);
1146 aProps.emplace_back(PROPERTY_BORDERBOTTOM);
1147 }
1148 else // horizontal
1149 {
1150 // check if border should be bottom
1151 if ( (aPos.Y + aSize.Height) == nSectionHeight )
1152 {
1153 sBorderProp = PROPERTY_BORDERBOTTOM;
1154 aProps.emplace_back(PROPERTY_BORDERTOP);
1155 }
1156 else
1157 {
1158 sBorderProp = PROPERTY_BORDERTOP;
1159 aProps.emplace_back(PROPERTY_BORDERBOTTOM);
1160 }
1161 aProps.emplace_back(PROPERTY_BORDERRIGHT);
1162 aProps.emplace_back(PROPERTY_BORDERLEFT);
1163 }
1164
1165 xBorderProp->setPropertyValue(sBorderProp,uno::Any(aValue));
1166
1167 aValue.Color = aValue.OuterLineWidth = aValue.LineWidth = 0;
1168 aValue.LineStyle = table::BorderLineStyle::NONE;
1169 uno::Any aEmpty;
1170 aEmpty <<= aValue;
1171 for (auto const& it : aProps)
1172 {
1173 xBorderProp->setPropertyValue(it, aEmpty);
1174 }
1175
1176 ::std::vector<XMLPropertyState> aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(*this, xBorderProp));
1177 aPropertyStates.insert( aPropertyStates.end(), aBorderStates.begin(), aBorderStates.end() );
1178 }
1179 else
1180 {
1181 const Reference<XFormattedField> xFormattedField(_xProp,uno::UNO_QUERY);
1182 if ( (_xParentFormattedField.is() || xFormattedField.is()) && !aPropertyStates.empty() )
1183 {
1184 sal_Int32 nNumberFormat = 0;
1185 if ( _xParentFormattedField.is() )
1186 nNumberFormat = _xParentFormattedField->getFormatKey();
1187 else
1188 nNumberFormat = xFormattedField->getFormatKey();
1189 {
1190 sal_Int32 nStyleMapIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_RPT_NUMBERFORMAT );
1191 addDataStyle(nNumberFormat);
1192 XMLPropertyState aNumberStyleState( nStyleMapIndex, uno::Any( getDataStyleName(nNumberFormat) ) );
1193 auto const iter(::std::find_if(
1194 aPropertyStates.begin(), aPropertyStates.end(),
1195 [nStyleMapIndex] (XMLPropertyState const& rItem)
1196 { return rItem.mnIndex == nStyleMapIndex; } ));
1197 if (iter == aPropertyStates.end())
1198 {
1199 aPropertyStates.push_back( aNumberStyleState );
1200 }
1201 else
1202 { // there is already a property but it has the wrong type
1203 // (integer not string); TODO: can we prevent it
1204 // getting added earlier?
1205 (*iter) = aNumberStyleState;
1206 }
1207 }
1208 }
1209 }
1210
1211 if ( !aPropertyStates.empty() )
1212 m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TABLE_CELL, std::move(aPropertyStates) ));
1213}
1214
1215void ORptExport::exportAutoStyle(const Reference<XSection>& _xProp)
1216{
1217 ::std::vector<XMLPropertyState> aPropertyStates(m_xTableStylesExportPropertySetMapper->Filter(*this, _xProp));
1218 if ( !aPropertyStates.empty() )
1219 m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XmlStyleFamily::TABLE_TABLE, std::move(aPropertyStates) ));
1220}
1221
1223{
1224 Reference<XReportDefinition> xProp(getReportDefinition());
1226}
1227
1228void ORptExport::exportReportAttributes(const Reference<XReportDefinition>& _xReport)
1229{
1230 if ( !_xReport.is() )
1231 return;
1232
1233 OUStringBuffer sValue;
1234 const SvXMLEnumMapEntry<sal_Int32>* aXML_CommandTypeEnumMap = OXMLHelper::GetCommandTypeOptions();
1235 if ( SvXMLUnitConverter::convertEnum( sValue, _xReport->getCommandType(), aXML_CommandTypeEnumMap ) )
1236 AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND_TYPE,sValue.makeStringAndClear());
1237
1238 OUString sCommand = _xReport->getCommand();
1239 if ( !sCommand.isEmpty() )
1241
1242 OUString sFilter( _xReport->getFilter() );
1243 if ( !sFilter.isEmpty() )
1245
1246 AddAttribute(XML_NAMESPACE_OFFICE, XML_MIMETYPE,_xReport->getMimeType());
1247
1248 bool bEscapeProcessing( _xReport->getEscapeProcessing() );
1249 if ( !bEscapeProcessing )
1250 AddAttribute( XML_NAMESPACE_REPORT, XML_ESCAPE_PROCESSING, ::xmloff::token::GetXMLToken( XML_FALSE ) );
1251
1252 OUString sName = _xReport->getCaption();
1253 if ( !sName.isEmpty() )
1255 sName = _xReport->getName();
1256 if ( !sName.isEmpty() )
1258}
1259
1261{
1263}
1264
1266{
1267 GetPageExport()->exportMasterStyles( true );
1268}
1269
1271{
1272 if ( m_bAllreadyFilled )
1273 return;
1274
1275 m_bAllreadyFilled = true;
1276 Reference<XReportDefinition> xProp(getReportDefinition());
1277 if ( !xProp.is() )
1278 return;
1279
1280 uno::Reference< report::XSection> xParent(xProp->getParent(),uno::UNO_QUERY);
1281 if ( xParent.is() )
1282 exportAutoStyle(xProp.get());
1283
1284 if ( xProp->getReportHeaderOn() )
1285 exportSectionAutoStyle(xProp->getReportHeader());
1286 if ( xProp->getPageHeaderOn() )
1287 exportSectionAutoStyle(xProp->getPageHeader());
1288
1289 exportGroup(xProp,0,true);
1290
1291 if ( xProp->getPageFooterOn() )
1292 exportSectionAutoStyle(xProp->getPageFooter());
1293 if ( xProp->getReportFooterOn() )
1294 exportSectionAutoStyle(xProp->getReportFooter());
1295}
1296
1298{
1299 // there are no styles that require their own autostyles
1300 if ( getExportFlags() & SvXMLExportFlags::CONTENT )
1301 {
1303 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_TABLE);
1304 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_COLUMN);
1305 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_ROW);
1306 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_CELL);
1308 GetShapeExport()->exportAutoStyles();
1309 }
1310 // exported in _ExportMasterStyles
1311 if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES )
1312 GetPageExport()->collectAutoStyles( false );
1313 if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES )
1314 GetPageExport()->exportAutoStyles();
1315}
1316
1318{
1320
1321 // write draw:style-name for object graphic-styles
1322 GetShapeExport()->ExportGraphicDefaults();
1323}
1324
1326{
1327 return new OXMLAutoStylePoolP(*this);
1328}
1329
1330void SAL_CALL ORptExport::setSourceDocument( const Reference< XComponent >& xDoc )
1331{
1332 m_xReportDefinition.set(xDoc,UNO_QUERY_THROW);
1334}
1335
1337{
1338 GetFontAutoStylePool(); // make sure the pool is created
1341}
1342
1343void ORptExport::exportParagraph(const Reference< XReportControlModel >& _xReportElement)
1344{
1345 OSL_PRECOND(_xReportElement.is(),"Element is null!");
1346 // start <text:p>
1347 SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, false, false);
1348 if ( Reference<XFormattedField>(_xReportElement,uno::UNO_QUERY).is() )
1349 {
1350 OUString sFieldData = _xReportElement->getDataField();
1351 static const sal_Unicode s_sPageNumber[] = u"PageNumber()";
1352 static const char s_sReportPrefix[] = "rpt:";
1353 sFieldData = sFieldData.copy(strlen(s_sReportPrefix));
1354 sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber);
1355 if ( nPageNumberIndex != -1 )
1356 {
1357 sal_Int32 nIndex = 0;
1358 do
1359 {
1360 std::u16string_view sToken = o3tl::getToken(sFieldData, 0, '&', nIndex );
1361 sToken = o3tl::trim(sToken);
1362 if ( !sToken.empty() )
1363 {
1364 if ( sToken == s_sPageNumber )
1365 {
1367 SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_NUMBER, false, false);
1368 Characters("1");
1369 }
1370 else if ( sToken == u"PageCount()" )
1371 {
1372 SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_COUNT, false, false);
1373 Characters("1");
1374 }
1375 else
1376 {
1377
1378 if ( o3tl::starts_with(sToken, u"\"") && o3tl::ends_with(sToken, u"\"") )
1379 sToken = sToken.substr(1, sToken.size() - 2);
1380
1381 bool bPrevCharIsSpace = false;
1382 GetTextParagraphExport()->exportCharacterData(OUString(sToken), bPrevCharIsSpace);
1383 }
1384 }
1385 }
1386 while ( nIndex >= 0 );
1387 }
1388 }
1389 Reference< XFixedText > xFT(_xReportElement,UNO_QUERY);
1390 if ( xFT.is() )
1391 {
1392 OUString sExpr = xFT->getLabel();
1393 bool bPrevCharIsSpace = false; // FIXME this looks quite broken - does the corresponding import filter do whitespace collapsing at all?
1394 GetTextParagraphExport()->exportCharacterData(sExpr, bPrevCharIsSpace);
1395 }
1396}
1397
1399{
1401 return pShapeExport;
1402}
1403
1404void ORptExport::exportShapes(const Reference< XSection>& _xSection,bool _bAddParagraph)
1405{
1407 xShapeExport->seekShapes(_xSection);
1408 const sal_Int32 nCount = _xSection->getCount();
1409 ::std::unique_ptr<SvXMLElementExport> pParagraphContent;
1410 if ( _bAddParagraph )
1411 pParagraphContent.reset(new SvXMLElementExport(*this,XML_NAMESPACE_TEXT, XML_P, true, false));
1412
1413 awt::Point aRefPoint;
1414 aRefPoint.X = rptui::getStyleProperty<sal_Int32>(_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
1415 for (sal_Int32 i = 0; i < nCount; ++i)
1416 {
1417 uno::Reference< XShape > xShape(_xSection->getByIndex(i),uno::UNO_QUERY);
1418 if ( xShape.is() )
1419 {
1420 ::std::unique_ptr<SvXMLElementExport> pSubDocument;
1421 uno::Reference< frame::XModel> xModel(xShape->getPropertyValue("Model"),uno::UNO_QUERY);
1422 if ( xModel.is() ) // special handling for chart object
1423 {
1424 pSubDocument.reset(new SvXMLElementExport(*this,XML_NAMESPACE_REPORT, XML_SUB_DOCUMENT, false, false));
1426 exportReportElement(xShape);
1427 }
1428
1430 xShapeExport->exportShape(xShape, SEF_DEFAULT|XMLShapeExportFlags::NO_WS,&aRefPoint);
1431 }
1432 }
1433}
1434
1435void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups)
1436{
1437 if ( !_xGroups.is() )
1438 return;
1439
1440 uno::Reference< XFunctions> xFunctions = _xGroups->getReportDefinition()->getFunctions();
1441 const sal_Int32 nCount = _xGroups->getCount();
1442 for (sal_Int32 i = 0; i < nCount; ++i)
1443 {
1444 uno::Reference< XGroup> xGroup(_xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
1445 const ::sal_Int16 nGroupOn = xGroup->getGroupOn();
1446 if ( nGroupOn != report::GroupOn::DEFAULT )
1447 {
1448 uno::Reference< XFunction> xFunction = xFunctions->createFunction();
1449 OUString sFunction,sPrefix,sPostfix;
1450 OUString sExpression = xGroup->getExpression();
1451 OUString sFunctionName;
1452 OUString sInitialFormula;
1453 switch(nGroupOn)
1454 {
1455 case report::GroupOn::PREFIX_CHARACTERS:
1456 sFunction = "LEFT";
1457 sPrefix = ";" + OUString::number(xGroup->getGroupInterval());
1458 break;
1459 case report::GroupOn::YEAR:
1460 sFunction = "YEAR";
1461 break;
1462 case report::GroupOn::QUARTAL:
1463 sFunction = "INT((MONTH";
1464 sPostfix = "-1)/3)+1";
1465 sFunctionName = "QUARTAL_" + sExpression;
1466 break;
1467 case report::GroupOn::MONTH:
1468 sFunction = "MONTH";
1469 break;
1470 case report::GroupOn::WEEK:
1471 sFunction = "WEEK";
1472 break;
1473 case report::GroupOn::DAY:
1474 sFunction = "DAY";
1475 break;
1476 case report::GroupOn::HOUR:
1477 sFunction = "HOUR";
1478 break;
1479 case report::GroupOn::MINUTE:
1480 sFunction = "MINUTE";
1481 break;
1482 case report::GroupOn::INTERVAL:
1483 {
1484 sFunction = "INT";
1485 uno::Reference< XFunction> xCountFunction = xFunctions->createFunction();
1486 xCountFunction->setInitialFormula(beans::Optional< OUString>(true,OUString("rpt:0")));
1487 OUString sCountName = sFunction + "_count_" + sExpression;
1488 xCountFunction->setName(sCountName);
1489 xCountFunction->setFormula( "rpt:[" + sCountName + "] + 1" );
1490 exportFunction(xCountFunction);
1491 sExpression = sCountName;
1492 // The reference to sCountName in the formula of sFunctionName refers to the *old* value
1493 // so we need to expand the formula of sCountName
1494 sPrefix = " + 1) / " + OUString::number(xGroup->getGroupInterval());
1495 sFunctionName = sFunction + "_" + sExpression;
1496 sFunction += "(";
1497 sInitialFormula = "rpt:0";
1498 }
1499 break;
1500 default:
1501 ;
1502 }
1503 if ( sFunctionName.isEmpty() )
1504 sFunctionName = sFunction + "_" + sExpression;
1505 if ( !sFunction.isEmpty() )
1506 {
1507 const sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
1508 for(sal_Unicode ch : pReplaceChars)
1509 sFunctionName = sFunctionName.replace(ch,'_');
1510
1511 xFunction->setName(sFunctionName);
1512 if ( !sInitialFormula.isEmpty() )
1513 xFunction->setInitialFormula(beans::Optional< OUString>(true, sInitialFormula));
1514 sFunction = "rpt:" + sFunction + "([" + sExpression + "]";
1515
1516 if ( !sPrefix.isEmpty() )
1517 sFunction += sPrefix;
1518 sFunction += ")";
1519 if ( !sPostfix.isEmpty() )
1520 sFunction += sPostfix;
1521 xFunction->setFormula(sFunction);
1522 exportFunction(xFunction);
1523 m_aGroupFunctionMap.emplace(xGroup,xFunction);
1524 }
1525 }
1526 }
1527}
1528
1529
1530}// rptxml
1531
1532
1533/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void AddAttribute(const OUString &sName, const OUString &sValue)
const SvXMLNamespaceMap & GetNamespaceMap() const
virtual void ExportStyles_(bool bUsed)
OUString GetRelativeReference(const OUString &rValue)
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
void Characters(const OUString &rChars)
SvXMLExportFlags getExportFlags() const
css::uno::Reference< css::util::XNumberFormatsSupplier > & GetNumberFormatsSupplier()
SvXMLNamespaceMap & GetNamespaceMap_()
virtual void exportDataStyles()
rtl::Reference< XMLFontAutoStylePool > const & GetFontAutoStylePool()
SvXMLAttributeList & GetAttrList()
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
virtual void ExportFontDecls_()
rtl::Reference< XMLPageExport > const & GetPageExport()
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
rtl::Reference< XMLShapeExport > const & GetShapeExport()
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false)
void setExportFlags(SvXMLExportFlags nExportFlags)
const SvXMLUnitConverter & GetMM100UnitConverter() const
OUString GetQNameByKey(sal_uInt16 nKey, const OUString &rLocalName, bool bCache=true) const
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
static bool convertEnum(EnumT &rEnum, std::u16string_view rValue, const SvXMLEnumMapEntry< EnumT > *pMap)
void SetCoreMeasureUnit(sal_Int16 const eCoreMeasureUnit)
void SetXMLMeasureUnit(sal_Int16 const eXMLMeasureUnit)
static SvXMLExportPropertyMapper * CreateShapeExtPropMapper(SvXMLExport &rExport)
static SvXMLExportPropertyMapper * CreateParaExtPropMapper(SvXMLExport &rExport)
rtl::Reference< SvXMLExportPropertyMapper > m_xRowStylesExportPropertySetMapper
Definition: xmlExport.hxx:97
rtl::Reference< SvXMLExportPropertyMapper > m_xCellStylesExportPropertySetMapper
Definition: xmlExport.hxx:95
rtl::Reference< XMLPropertySetMapper > m_xCellStylesPropertySetMapper
Definition: xmlExport.hxx:101
const Reference< XReportDefinition > & getReportDefinition() const
Definition: xmlExport.hxx:151
::std::vector< ::std::pair< bool, TRow > > TGrid
Definition: xmlExport.hxx:81
void exportComponent(const Reference< XReportComponent > &_xReportComponent)
Definition: xmlExport.cxx:376
void collectComponentStyles()
Definition: xmlExport.cxx:1270
virtual void ExportStyles_(bool bUsed) override
Definition: xmlExport.cxx:1317
virtual void ExportAutoStyles_() override
Definition: xmlExport.cxx:1297
virtual void ExportFontDecls_() override
Definition: xmlExport.cxx:1336
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: xmlExport.cxx:1330
OUString m_sTableStyle
Definition: xmlExport.hxx:92
Reference< XReportDefinition > m_xReportDefinition
Definition: xmlExport.hxx:102
ORptExport(const Reference< XComponentContext > &_rxContext, OUString const &implementationName, SvXMLExportFlags nExportFlag)
Definition: xmlExport.cxx:180
void exportStyleName(XPropertySet *_xProp, SvXMLAttributeList &_rAtt, const OUString &_sName)
Definition: xmlExport.cxx:995
void exportContainer(const Reference< XSection > &_xSection)
Definition: xmlExport.cxx:742
::std::map< Reference< XPropertySet >,TGrid > TSectionsGrid
Definition: xmlExport.hxx:82
virtual void ExportContent_() override
Definition: xmlExport.cxx:1260
TGroupFunctionMap m_aGroupFunctionMap
Definition: xmlExport.hxx:90
virtual XMLShapeExport * CreateShapeExport() override
Definition: xmlExport.cxx:1398
static OUString convertFormula(const OUString &_sFormula)
Definition: xmlExport.cxx:975
void exportSection(const Reference< XSection > &_xProp, bool bHeader=false)
Definition: xmlExport.cxx:689
rtl::Reference< XMLPropertyHandlerFactory > m_xPropHdlFactory
Definition: xmlExport.hxx:99
void exportGroupsExpressionAsFunction(const Reference< XGroups > &_xGroups)
Definition: xmlExport.cxx:1435
virtual SvXMLAutoStylePoolP * CreateAutoStylePool() override
Definition: xmlExport.cxx:1325
void exportFormatConditions(const Reference< XReportControlModel > &_xReportElement)
Definition: xmlExport.cxx:387
TSectionsGrid m_aSectionsGrid
Definition: xmlExport.hxx:85
TPropertyStyleMap m_aAutoStyleNames
Definition: xmlExport.hxx:87
void exportShapes(const Reference< XSection > &_xSection, bool _bAddParagraph=true)
Definition: xmlExport.cxx:1404
void exportGroup(const Reference< XReportDefinition > &_xReportDefinition, sal_Int32 _nPos, bool _bExportAutoStyle=false)
Definition: xmlExport.cxx:1007
void exportReportAttributes(const Reference< XReportDefinition > &_xReport)
<element name="office:report">
Definition: xmlExport.cxx:1228
void exportReport(const Reference< XReportDefinition > &_xReportDefinition)
Definition: xmlExport.cxx:332
virtual void ExportMasterStyles_() override
Definition: xmlExport.cxx:1265
rtl::Reference< SvXMLExportPropertyMapper > m_xParaPropMapper
Definition: xmlExport.hxx:98
void exportSectionAutoStyle(const Reference< XSection > &_xProp)
Definition: xmlExport.cxx:491
OUString m_sCellStyle
Definition: xmlExport.hxx:93
void exportReportComponentAutoStyles(const Reference< XSection > &_xProp)
Definition: xmlExport.cxx:649
TGridStyleMap m_aRowStyleNames
Definition: xmlExport.hxx:89
void exportMasterDetailFields(const Reference< XReportComponent > &_xReportComponent)
Definition: xmlExport.cxx:310
void exportParagraph(const Reference< XReportControlModel > &_xReportElement)
Definition: xmlExport.cxx:1343
bool exportFormula(enum ::xmloff::token::XMLTokenEnum eName, const OUString &_sFormula)
Definition: xmlExport.cxx:983
void collectStyleNames(XmlStyleFamily _nFamily, const ::std::vector< sal_Int32 > &_aSize, std::vector< OUString > &_rStyleNames)
Definition: xmlExport.cxx:455
void exportAutoStyle(XPropertySet *_xProp, const Reference< XFormattedField > &_xParentFormattedField=Reference< XFormattedField >())
Definition: xmlExport.cxx:1090
::std::vector< TCell > TRow
Definition: xmlExport.hxx:80
TGridStyleMap m_aColumnStyleNames
Definition: xmlExport.hxx:88
rtl::Reference< SvXMLExportPropertyMapper > m_xTableStylesExportPropertySetMapper
Definition: xmlExport.hxx:94
void exportReportElement(const Reference< XReportControlModel > &_xReportElement)
Definition: xmlExport.cxx:411
void exportFunctions(const Reference< XIndexAccess > &_xFunctions)
Definition: xmlExport.cxx:285
void exportFunction(const Reference< XFunction > &_xFunction)
<ref name="rpt-function">
Definition: xmlExport.cxx:295
virtual void SetBodyAttributes() override
Definition: xmlExport.cxx:1222
void exportTableColumns(const Reference< XSection > &_xSection)
Definition: xmlExport.cxx:727
rtl::Reference< SvXMLExportPropertyMapper > m_xColumnStylesExportPropertySetMapper
Definition: xmlExport.hxx:96
static const SvXMLEnumMapEntry< sal_Int16 > * GetReportPrintOptions()
Definition: xmlHelper.cxx:185
static css::uno::Reference< css::beans::XPropertySet > createBorderPropertySet()
Definition: xmlHelper.cxx:315
static const SvXMLEnumMapEntry< sal_Int16 > * GetKeepTogetherOptions()
Definition: xmlHelper.cxx:209
static const SvXMLEnumMapEntry< sal_Int32 > * GetCommandTypeOptions()
Definition: xmlHelper.cxx:220
static const SvXMLEnumMapEntry< sal_Int16 > * GetImageScaleOptions()
Definition: xmlHelper.cxx:367
static const XMLPropertyMapEntry * GetColumnStyleProps()
Definition: xmlHelper.cxx:175
static const SvXMLEnumMapEntry< sal_Int16 > * GetForceNewPageOptions()
Definition: xmlHelper.cxx:197
static const XMLPropertyMapEntry * GetRowStyleProps()
Definition: xmlHelper.cxx:164
static const XMLPropertyMapEntry * GetTableStyleProps()
Definition: xmlHelper.cxx:153
static rtl::Reference< XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat, bool bForExport)
Definition: xmlHelper.cxx:106
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
int nCount
OString sFormula
float u
Any aHelper
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX
XmlStyleFamily
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_COLUMN_STYLES_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_TABLE_STYLES_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_ROW_STYLES_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_CELL_STYLES_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_TABLE_STYLES_NAME
sal_Int16 nValue
FontPitch
FontFamily
OUString sPrefix
sal_Int32 nIndex
sal_uInt16 nPos
const char * sName
int i
constexpr OUStringLiteral implementationName
constexpr bool ends_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
std::u16string_view trim(std::u16string_view str)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptStylesExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports only styles.
Definition: xmlExport.cxx:93
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ODBFullExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports all.
Definition: xmlExport.cxx:120
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports only settings.
Definition: xmlExport.cxx:67
static void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid &_rGrid)
Definition: xmlExport.cxx:152
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptContentExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports only content.
Definition: xmlExport.cxx:80
static void lcl_calculate(const ::std::vector< sal_Int32 > &_aPosX, const ::std::vector< sal_Int32 > &_aPosY, ORptExport::TGrid &_rColumns)
Definition: xmlExport.cxx:439
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptMetaExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports only meta data.
Definition: xmlExport.cxx:107
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptExport_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlExport.cxx:276
XML_MASTER
XML_MIMETYPE
XML_GROUP_HEADER
XML_TABLE_ROW
XML_FORMATTED_TEXT
XML_COVERED_TABLE_CELL
XML_START_NEW_COLUMN
XML_N_XLINK
XML_MASTER_DETAIL_FIELD
XML_SCALE
XML_NP_XHTML
XML_N_OFFICE
XML_FILTER
XML_MASTER_DETAIL_FIELDS
XML_TABLE_COLUMNS
XML_REPORT_COMPONENT
XML_TABLE
XML_N_LO_EXT
XML_N_SVG_COMPAT
XML_N_RPT
XML_SECTION
XML_NP_DRAW
XML_REPEAT_SECTION
XML_N_STYLE
XML_NP_NUMBER
XML_ENABLED
XML_SORT_ASCENDING
XML_GROUP_FOOTER
XML_N_FORM
XML_TRUE
XML_N_TABLE
XML_PAGE_COUNT
XML_TABLE_COLUMN
XML_PAGE_PRINT_OPTION
XML_COMMAND
XML_NP_XLINK
XML_FUNCTION
XML_REPORT
XML_IMAGE_DATA
XML_COMMAND_TYPE
XML_NP_OFFICE
XML_NP_FORM
XML_RESET_PAGE_NUMBER
XML_NP_TEXT
XML_REPORT_FOOTER
XML_N_GRDDL
XML_FORCE_NEW_PAGE
XML_N_TEXT
XML_NP_STYLE
XML_REPORT_ELEMENT
XML_FORMULA
XML_PARAGRAPH
XML_NP_OOO
XML_NP_TABLE
XML_N_XHTML
XML_PRE_EVALUATED
XML_NP_LO_EXT
XML_ESCAPE_PROCESSING
XML_FALSE
XML_STYLE_NAME
XML_N_FO_COMPAT
XML_PAGE_NUMBER
XML_NP_FO
XML_PAGE_HEADER
XML_NAME
XML_NP_CONFIG
XML_FORCE_NEW_COLUMN
XML_P
XML_VISIBLE
XML_NUMBER_COLUMNS_SPANNED
XML_NUMBER_ROWS_SPANNED
XML_FIXED_CONTENT
XML_KEEP_TOGETHER
XML_INITIAL_FORMULA
XML_SORT_EXPRESSION
XML_SUB_DOCUMENT
XML_BODY
XML_IMAGE
XML_GROUP_EXPRESSION
XML_DEEP_TRAVERSING
XML_CAPTION
XML_NP_GRDDL
XML_CONDITIONAL_PRINT_EXPRESSION
XML_N_CONFIG
XML_GROUP
XML_SELECT_PAGE
XML_FORMAT_CONDITION
XML_NP_RPT
XML_TABLE_CELL
XML_PRINT_REPEATED_VALUES
XML_PRINT_WHEN_GROUP_CHANGE
XML_NP_SVG
XML_ANCHOR_TYPE
XML_DETAIL
XML_PAGE_FOOTER
XML_N_DRAW
XML_N_NUMBER
XML_PRESERVE_IRI
XML_REPORT_HEADER
XML_N_OOO
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
#define SEF_DEFAULT
constexpr OUStringLiteral PROPERTY_BORDERTOP
Definition: strings.hxx:276
constexpr OUStringLiteral PROPERTY_RIGHTMARGIN
Definition: strings.hxx:103
constexpr OUStringLiteral PROPERTY_BORDERLEFT
Definition: strings.hxx:274
constexpr OUStringLiteral PROPERTY_BORDERBOTTOM
Definition: strings.hxx:277
constexpr OUStringLiteral SERVICE_IMAGECONTROL
Definition: strings.hxx:24
constexpr OUStringLiteral SERVICE_FIXEDTEXT
Definition: strings.hxx:22
constexpr OUStringLiteral SERVICE_FORMATTEDFIELD
Definition: strings.hxx:23
constexpr OUStringLiteral PROPERTY_LEFTMARGIN
Definition: strings.hxx:102
constexpr OUStringLiteral PROPERTY_BORDERRIGHT
Definition: strings.hxx:275
constexpr OUStringLiteral PROPERTY_PAPERSIZE
Definition: strings.hxx:62
Reference< XModel > xModel
sal_uInt16 sal_Unicode
#define DEFAULT_LINE_WIDTH
Definition: xmlExport.cxx:49
#define CTF_RPT_NUMBERFORMAT
Definition: xmlHelper.hxx:29
sal_Int32 _nPos
SvXMLExportFlags
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_XHTML
constexpr sal_uInt16 XML_NAMESPACE_REPORT
constexpr sal_uInt16 XML_NAMESPACE_XLINK
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_FORM
constexpr sal_uInt16 XML_NAMESPACE_TABLE
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_OFFICE
constexpr sal_uInt16 XML_NAMESPACE_CONFIG
constexpr sal_uInt16 XML_NAMESPACE_OOO
constexpr sal_uInt16 XML_NAMESPACE_GRDDL
constexpr sal_uInt16 XML_NAMESPACE_STYLE
constexpr sal_uInt16 XML_NAMESPACE_FO
constexpr sal_uInt16 XML_NAMESPACE_NUMBER
XMLTokenEnum eToken