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 comphelper::AttributeList& /*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 xShapeExport->collectShapeAutoStyles(xShape);
662 }
663 else
664 {
665 exportAutoStyle(xReportElement.get());
666
667 Reference<XFormattedField> xFormattedField(xReportElement,uno::UNO_QUERY);
668 if ( xFormattedField.is() )
669 {
670 try
671 {
672 const sal_Int32 nFormatCount = xFormattedField->getCount();
673 for (sal_Int32 j = 0; j < nFormatCount ; ++j)
674 {
675 uno::Reference< report::XFormatCondition > xCond(xFormattedField->getByIndex(j),uno::UNO_QUERY);
676 exportAutoStyle(xCond.get(),xFormattedField);
677 }
678 }
679 catch(uno::Exception&)
680 {
681 OSL_FAIL("Can not access format condition!");
682 }
683 }
684 }
685 }
686}
687
688void ORptExport::exportSection(const Reference<XSection>& _xSection,bool bHeader)
689{
690 OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
691 AddAttribute(XML_NAMESPACE_TABLE, XML_NAME,_xSection->getName());
692
693 if ( !_xSection->getVisible() )
695
696 if ( !bHeader )
697 {
698 OUStringBuffer sValue;
699 sal_Int16 nRet = _xSection->getForceNewPage();
701 if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
702 AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_PAGE,sValue.makeStringAndClear());
703
704 nRet = _xSection->getNewRowOrCol();
705 if ( SvXMLUnitConverter::convertEnum( sValue, nRet,aXML_EnumMap ) )
706 AddAttribute(XML_NAMESPACE_REPORT, XML_FORCE_NEW_COLUMN,sValue.makeStringAndClear());
707 if ( _xSection->getKeepTogether() )
709 }
710
711 exportStyleName(_xSection.get(),GetAttrList(),m_sTableStyle);
712
714 SvXMLElementExport aComponents(*this,XML_NAMESPACE_TABLE, XML_TABLE, true, true);
715
716 OUString sExpr = _xSection->getConditionalPrintExpression();
717 if ( !sExpr.isEmpty() )
718 {
721 }
722
723 exportContainer(_xSection);
724}
725
726void ORptExport::exportTableColumns(const Reference< XSection>& _xSection)
727{
728 SvXMLElementExport aColumns(*this,XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, true, true);
729 TGridStyleMap::const_iterator aColFind = m_aColumnStyleNames.find(_xSection);
730 OSL_ENSURE(aColFind != m_aColumnStyleNames.end(),"ORptExport::exportTableColumns: Section not found in m_aColumnStyleNames!");
731 if ( aColFind == m_aColumnStyleNames.end() )
732 return;
733
734 for (auto& aCol : aColFind->second)
735 {
737 SvXMLElementExport aColumn(*this,XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, true, true);
738 }
739}
740
741void ORptExport::exportContainer(const Reference< XSection>& _xSection)
742{
743 OSL_ENSURE(_xSection.is(),"Section is NULL -> GPF");
744
745 exportTableColumns(_xSection);
746
747 TSectionsGrid::const_iterator aFind = m_aSectionsGrid.find(_xSection);
748 OSL_ENSURE(aFind != m_aSectionsGrid.end(),"ORptExport::exportContainer: Section not found in grid!");
749 if ( aFind == m_aSectionsGrid.end() )
750 return;
751 TGrid::const_iterator aRowIter = aFind->second.begin();
752 TGrid::const_iterator aRowEnd = aFind->second.end();
753
754 TGridStyleMap::const_iterator aRowFind = m_aRowStyleNames.find(_xSection);
755 auto aHeightIter = aRowFind->second.cbegin();
756 OSL_ENSURE(aRowFind->second.size() == aFind->second.size(),"Different count for rows");
757
758 bool bShapeHandled = false;
759 ::std::map<sal_Int32,sal_Int32> aRowSpan;
760 for (sal_Int32 j = 0; aRowIter != aRowEnd; ++aRowIter,++j,++aHeightIter)
761 {
762 AddAttribute( m_sTableStyle,*aHeightIter );
764 if ( aRowIter->first )
765 {
766 ::std::vector< TCell >::const_iterator aColIter = aRowIter->second.begin();
767 ::std::vector< TCell >::const_iterator aColEnd = aRowIter->second.end();
768 sal_Int32 nEmptyCellColSpan = 0;
769 for (; aColIter != aColEnd; ++aColIter)
770 {
771 bool bCoveredCell = false;
772 sal_Int32 nColSpan = 0;
773 sal_Int32 nColIndex = aColIter - aRowIter->second.begin();
774 ::std::map<sal_Int32,sal_Int32>::iterator aRowSpanFind = aRowSpan.find(nColIndex);
775 if ( aRowSpanFind != aRowSpan.end() )
776 {
777 nColSpan = 1;
778 if ( !--(aRowSpanFind->second) )
779 aRowSpan.erase(aRowSpanFind);
780
781 if ( aColIter->nColSpan > 1 )
782 nColSpan += aColIter->nColSpan - 1;
783
784 bCoveredCell = true;
785 aColIter = aColIter + (aColIter->nColSpan - 1);
786 }
787 else if ( aColIter->bSet )
788 {
789 if ( nEmptyCellColSpan > 0 )
790 {
791 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) );
792 bCoveredCell = true;
793 nColSpan = nEmptyCellColSpan - 1;
794 nEmptyCellColSpan = 0;
795 }
796 sal_Int32 nSpan = aColIter->nColSpan;
797 if ( nSpan > 1 )
798 {
800 nColSpan = nSpan - 1;
801 bCoveredCell = true;
802 }
803 nSpan = aColIter->nRowSpan;
804 if ( nSpan > 1 )
805 {
806 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_ROWS_SPANNED, OUString::number(nSpan) );
807 aRowSpan[nColIndex] = nSpan - 1;
808 }
809 if ( aColIter->xElement.is() )
810 exportStyleName(aColIter->xElement.get(),GetAttrList(),m_sTableStyle);
811
812 // start <table:table-cell>
813 Reference<XFormattedField> xFormattedField(aColIter->xElement,uno::UNO_QUERY);
814 if ( xFormattedField.is() )
815 {
816 sal_Int32 nFormatKey = xFormattedField->getFormatKey();
818 bool bIsStandard = false;
819 sal_Int16 nCellType = aHelper.GetCellType(nFormatKey,bIsStandard);
820 // "Standard" means "no format set, value could be anything",
821 // so don't set a format attribute in this case.
822 // P.S.: "Standard" is called "General" in some languages
823 if (!bIsStandard)
824 {
825 if ( nCellType == util::NumberFormat::TEXT )
826 aHelper.SetNumberFormatAttributes("", u"");
827 else
828 aHelper.SetNumberFormatAttributes(nFormatKey, 0.0, false);
829 }
830 }
831 SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, false);
832
833 if ( aColIter->xElement.is() )
834 {
835 // start <text:p>
836 SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, true, false);
837 Reference<XServiceInfo> xElement(aColIter->xElement,uno::UNO_QUERY);
838
839 if ( !bShapeHandled )
840 {
841 bShapeHandled = true;
842 exportShapes(_xSection,false);
843 }
844 uno::Reference< XShape > xShape(xElement,uno::UNO_QUERY);
845 uno::Reference< XFixedLine > xFixedLine(xElement,uno::UNO_QUERY);
846 if ( !xShape.is() && !xFixedLine.is() )
847 {
848 Reference<XReportControlModel> xReportElement(xElement,uno::UNO_QUERY);
849 Reference<XReportDefinition> xReportDefinition(xElement,uno::UNO_QUERY);
850 Reference< XImageControl > xImage(xElement,uno::UNO_QUERY);
851 Reference<XSection> xSection(xElement,uno::UNO_QUERY);
852
854 bool bExportData = false;
855 if ( xElement->supportsService(SERVICE_FIXEDTEXT) )
856 {
858 }
859 else if ( xElement->supportsService(SERVICE_FORMATTEDFIELD) )
860 {
862 bExportData = true;
863 }
864 else if ( xElement->supportsService(SERVICE_IMAGECONTROL) )
865 {
867 OUString sTargetLocation = xImage->getImageURL();
868 if ( !sTargetLocation.isEmpty() )
869 {
870 sTargetLocation = GetRelativeReference(sTargetLocation);
872 }
873 bExportData = true;
874 OUStringBuffer sValue;
875 const SvXMLEnumMapEntry<sal_Int16>* aXML_ImageScaleEnumMap = OXMLHelper::GetImageScaleOptions();
876 if ( SvXMLUnitConverter::convertEnum( sValue, xImage->getScaleMode(),aXML_ImageScaleEnumMap ) )
877 AddAttribute(XML_NAMESPACE_REPORT, XML_SCALE, sValue.makeStringAndClear() );
878 }
879 else if ( xReportDefinition.is() )
880 {
882 }
883
884 if ( bExportData )
885 {
886 const bool bPageSet = exportFormula(XML_FORMULA,xReportElement->getDataField());
887 if ( bPageSet )
889 else if ( eToken == XML_IMAGE )
891 }
892
893 {
894 // start <report:eToken>
895 SvXMLElementExport aComponents(*this,XML_NAMESPACE_REPORT, eToken, false, false);
896 if ( eToken == XML_FIXED_CONTENT )
897 exportParagraph(xReportElement);
898 if ( xReportElement.is() )
899 exportReportElement(xReportElement);
900
901 if (eToken == XML_SUB_DOCUMENT && xReportDefinition.is())
902 {
903 SvXMLElementExport aOfficeElement( *this, XML_NAMESPACE_OFFICE, XML_BODY, true, true );
904 SvXMLElementExport aElem( *this, true,
906 true, true );
907
908 exportReportAttributes(xReportDefinition);
909 exportReport(xReportDefinition);
910 }
911 else if ( xSection.is() )
912 exportSection(xSection);
913 }
914 }
915 }
916 else if ( !bShapeHandled )
917 {
918 bShapeHandled = true;
919 exportShapes(_xSection);
920 }
921 aColIter = aColIter + (aColIter->nColSpan - 1);
922 }
923 else
924 ++nEmptyCellColSpan;
925 if ( bCoveredCell )
926 {
927 for (sal_Int32 k = 0; k < nColSpan; ++k)
928 {
930 }
931
932 }
933 }
934 if ( nEmptyCellColSpan )
935 {
936 {
937 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) );
938 SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true);
939 if ( !bShapeHandled )
940 {
941 bShapeHandled = true;
942 exportShapes(_xSection);
943 }
944 }
945 for (sal_Int32 k = 0; k < nEmptyCellColSpan; ++k)
946 {
947 SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, true, true);
948 }
949 }
950 }
951 else
952 { // empty rows
953 sal_Int32 nEmptyCellColSpan = aRowIter->second.size();
954 if ( nEmptyCellColSpan )
955 {
956 {
957 AddAttribute( XML_NAMESPACE_TABLE,XML_NUMBER_COLUMNS_SPANNED, OUString::number(nEmptyCellColSpan) );
958 SvXMLElementExport aCell(*this,XML_NAMESPACE_TABLE, XML_TABLE_CELL, true, true);
959 if ( !bShapeHandled )
960 {
961 bShapeHandled = true;
962 exportShapes(_xSection);
963 }
964 }
965 for (sal_Int32 k = 1; k < nEmptyCellColSpan; ++k)
966 {
967 SvXMLElementExport aCoveredCell(*this,XML_NAMESPACE_TABLE, XML_COVERED_TABLE_CELL, true, true);
968 }
969 }
970 }
971 }
972}
973
974OUString ORptExport::convertFormula(const OUString& _sFormula)
975{
976 OUString sFormula = _sFormula;
977 if ( _sFormula == "rpt:" )
978 sFormula.clear();
979 return sFormula;
980}
981
982bool ORptExport::exportFormula(enum ::xmloff::token::XMLTokenEnum eName,const OUString& _sFormula)
983{
984 const OUString sFieldData = convertFormula(_sFormula);
985 sal_Int32 nPageNumberIndex = sFieldData.indexOf("PageNumber()");
986 sal_Int32 nPageCountIndex = sFieldData.indexOf("PageCount()");
987 bool bRet = nPageNumberIndex != -1 || nPageCountIndex != -1;
988 if ( !bRet )
989 AddAttribute(XML_NAMESPACE_REPORT, eName,sFieldData);
990
991 return bRet;
992}
993
994void ORptExport::exportStyleName(XPropertySet* _xProp,comphelper::AttributeList& _rAtt,const OUString& _sName)
995{
996 Reference<XPropertySet> xFind(_xProp);
997 TPropertyStyleMap::const_iterator aFind = m_aAutoStyleNames.find(xFind);
998 if ( aFind != m_aAutoStyleNames.end() )
999 {
1000 _rAtt.AddAttribute( _sName,
1001 aFind->second );
1002 m_aAutoStyleNames.erase(aFind);
1003 }
1004}
1005
1006void ORptExport::exportGroup(const Reference<XReportDefinition>& _xReportDefinition,sal_Int32 _nPos,bool _bExportAutoStyle)
1007{
1008 if ( !_xReportDefinition.is() )
1009 return;
1010
1011 Reference< XGroups > xGroups = _xReportDefinition->getGroups();
1012 if ( !xGroups.is() )
1013 return;
1014
1015 sal_Int32 nCount = xGroups->getCount();
1016 if ( _nPos >= 0 && _nPos < nCount )
1017 {
1018 Reference<XGroup> xGroup(xGroups->getByIndex(_nPos),uno::UNO_QUERY);
1019 OSL_ENSURE(xGroup.is(),"No Group prepare for GPF");
1020 if ( _bExportAutoStyle )
1021 {
1022 if ( xGroup->getHeaderOn() )
1023 exportSectionAutoStyle(xGroup->getHeader());
1024 exportGroup(_xReportDefinition,_nPos+1,_bExportAutoStyle);
1025 if ( xGroup->getFooterOn() )
1026 exportSectionAutoStyle(xGroup->getFooter());
1027 }
1028 else
1029 {
1030 if ( xGroup->getSortAscending() )
1032
1033 if ( xGroup->getStartNewColumn() )
1035 if ( xGroup->getResetPageNumber() )
1037
1038 const OUString sField = xGroup->getExpression();
1039 OUString sExpression = sField;
1040 if ( !sExpression.isEmpty() )
1041 {
1042 sExpression = sExpression.replaceAll(u"\"", u"\"\"");
1043
1044 TGroupFunctionMap::const_iterator aGroupFind = m_aGroupFunctionMap.find(xGroup);
1045 if ( aGroupFind != m_aGroupFunctionMap.end() )
1046 sExpression = aGroupFind->second->getName();
1047 sExpression = "rpt:HASCHANGED(\"" + sExpression + "\")";
1048 }
1051 sal_Int16 nRet = xGroup->getKeepTogether();
1052 OUStringBuffer sValue;
1053 const SvXMLEnumMapEntry<sal_Int16>* aXML_KeepTogetherEnumMap = OXMLHelper::GetKeepTogetherOptions();
1054 if ( SvXMLUnitConverter::convertEnum( sValue, nRet, aXML_KeepTogetherEnumMap ) )
1055 AddAttribute(XML_NAMESPACE_REPORT, XML_KEEP_TOGETHER,sValue.makeStringAndClear());
1056
1057 SvXMLElementExport aGroup(*this,XML_NAMESPACE_REPORT, XML_GROUP, true, true);
1058 exportFunctions(xGroup->getFunctions());
1059 if ( xGroup->getHeaderOn() )
1060 {
1061 Reference<XSection> xSection = xGroup->getHeader();
1062 if ( xSection->getRepeatSection() )
1064 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_HEADER, true, true);
1065 exportSection(xSection);
1066 }
1067 exportGroup(_xReportDefinition,_nPos+1,_bExportAutoStyle);
1068 if ( xGroup->getFooterOn() )
1069 {
1070 Reference<XSection> xSection = xGroup->getFooter();
1071 if ( xSection->getRepeatSection() )
1073 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_GROUP_FOOTER, true, true);
1074 exportSection(xSection);
1075 }
1076 }
1077 }
1078 else if ( _bExportAutoStyle )
1079 {
1080 exportSectionAutoStyle(_xReportDefinition->getDetail());
1081 }
1082 else
1083 {
1084 SvXMLElementExport aGroupSection(*this,XML_NAMESPACE_REPORT, XML_DETAIL, true, true);
1085 exportSection(_xReportDefinition->getDetail());
1086 }
1087}
1088
1089void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormattedField>& _xParentFormattedField)
1090{
1091 const uno::Reference<report::XReportControlFormat> xFormat(_xProp,uno::UNO_QUERY);
1092 if ( xFormat.is() )
1093 {
1094 try
1095 {
1096 const awt::FontDescriptor aFont = xFormat->getFontDescriptor();
1097 OSL_ENSURE(!aFont.Name.isEmpty(),"No Font Name !");
1098 GetFontAutoStylePool()->Add(aFont.Name,aFont.StyleName,static_cast<FontFamily>(aFont.Family),
1099 static_cast<FontPitch>(aFont.Pitch),aFont.CharSet );
1100 }
1101 catch(beans::UnknownPropertyException&)
1102 {
1103 // not interested in
1104 }
1105 }
1106 const uno::Reference< report::XShape> xShape(_xProp,uno::UNO_QUERY);
1107 if ( xShape.is() )
1108 {
1109 ::std::vector<XMLPropertyState> aPropertyStates(m_xParaPropMapper->Filter(*this, _xProp));
1110 if ( !aPropertyStates.empty() )
1111 m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TEXT_PARAGRAPH, std::move(aPropertyStates) ));
1112 }
1113 ::std::vector<XMLPropertyState> aPropertyStates(m_xCellStylesExportPropertySetMapper->Filter(*this, _xProp));
1114 Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY);
1115 if ( xFixedLine.is() )
1116 {
1117 uno::Reference<beans::XPropertySet> xBorderProp = OXMLHelper::createBorderPropertySet();
1118 table::BorderLine2 aValue;
1119 aValue.Color = sal_uInt32(COL_BLACK);
1120 aValue.InnerLineWidth = aValue.LineDistance = 0;
1121 aValue.OuterLineWidth = DEFAULT_LINE_WIDTH;
1122 aValue.LineStyle = table::BorderLineStyle::SOLID;
1123 aValue.LineWidth = DEFAULT_LINE_WIDTH;
1124
1125 awt::Point aPos = xFixedLine->getPosition();
1126 awt::Size aSize = xFixedLine->getSize();
1127 sal_Int32 nSectionHeight = xFixedLine->getSection()->getHeight();
1128
1129 OUString sBorderProp;
1130 ::std::vector< OUString> aProps;
1131 if ( xFixedLine->getOrientation() == 1 ) // vertical
1132 {
1133 // check if border should be left
1134 if ( !aPos.X )
1135 {
1136 sBorderProp = PROPERTY_BORDERLEFT;
1137 aProps.emplace_back(PROPERTY_BORDERRIGHT);
1138 }
1139 else
1140 {
1141 sBorderProp = PROPERTY_BORDERRIGHT;
1142 aProps.emplace_back(PROPERTY_BORDERLEFT);
1143 }
1144 aProps.emplace_back(PROPERTY_BORDERTOP);
1145 aProps.emplace_back(PROPERTY_BORDERBOTTOM);
1146 }
1147 else // horizontal
1148 {
1149 // check if border should be bottom
1150 if ( (aPos.Y + aSize.Height) == nSectionHeight )
1151 {
1152 sBorderProp = PROPERTY_BORDERBOTTOM;
1153 aProps.emplace_back(PROPERTY_BORDERTOP);
1154 }
1155 else
1156 {
1157 sBorderProp = PROPERTY_BORDERTOP;
1158 aProps.emplace_back(PROPERTY_BORDERBOTTOM);
1159 }
1160 aProps.emplace_back(PROPERTY_BORDERRIGHT);
1161 aProps.emplace_back(PROPERTY_BORDERLEFT);
1162 }
1163
1164 xBorderProp->setPropertyValue(sBorderProp,uno::Any(aValue));
1165
1166 aValue.Color = aValue.OuterLineWidth = aValue.LineWidth = 0;
1167 aValue.LineStyle = table::BorderLineStyle::NONE;
1168 uno::Any aEmpty;
1169 aEmpty <<= aValue;
1170 for (auto const& it : aProps)
1171 {
1172 xBorderProp->setPropertyValue(it, aEmpty);
1173 }
1174
1175 ::std::vector<XMLPropertyState> aBorderStates(m_xCellStylesExportPropertySetMapper->Filter(*this, xBorderProp));
1176 aPropertyStates.insert( aPropertyStates.end(), aBorderStates.begin(), aBorderStates.end() );
1177 }
1178 else
1179 {
1180 const Reference<XFormattedField> xFormattedField(_xProp,uno::UNO_QUERY);
1181 if ( (_xParentFormattedField.is() || xFormattedField.is()) && !aPropertyStates.empty() )
1182 {
1183 sal_Int32 nNumberFormat = 0;
1184 if ( _xParentFormattedField.is() )
1185 nNumberFormat = _xParentFormattedField->getFormatKey();
1186 else
1187 nNumberFormat = xFormattedField->getFormatKey();
1188 {
1189 sal_Int32 nStyleMapIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_RPT_NUMBERFORMAT );
1190 addDataStyle(nNumberFormat);
1191 XMLPropertyState aNumberStyleState( nStyleMapIndex, uno::Any( getDataStyleName(nNumberFormat) ) );
1192 auto const iter(::std::find_if(
1193 aPropertyStates.begin(), aPropertyStates.end(),
1194 [nStyleMapIndex] (XMLPropertyState const& rItem)
1195 { return rItem.mnIndex == nStyleMapIndex; } ));
1196 if (iter == aPropertyStates.end())
1197 {
1198 aPropertyStates.push_back( aNumberStyleState );
1199 }
1200 else
1201 { // there is already a property but it has the wrong type
1202 // (integer not string); TODO: can we prevent it
1203 // getting added earlier?
1204 (*iter) = aNumberStyleState;
1205 }
1206 }
1207 }
1208 }
1209
1210 if ( !aPropertyStates.empty() )
1211 m_aAutoStyleNames.emplace( _xProp,GetAutoStylePool()->Add( XmlStyleFamily::TABLE_CELL, std::move(aPropertyStates) ));
1212}
1213
1214void ORptExport::exportAutoStyle(const Reference<XSection>& _xProp)
1215{
1216 ::std::vector<XMLPropertyState> aPropertyStates(m_xTableStylesExportPropertySetMapper->Filter(*this, _xProp));
1217 if ( !aPropertyStates.empty() )
1218 m_aAutoStyleNames.emplace( _xProp.get(),GetAutoStylePool()->Add( XmlStyleFamily::TABLE_TABLE, std::move(aPropertyStates) ));
1219}
1220
1222{
1223 Reference<XReportDefinition> xProp(getReportDefinition());
1225}
1226
1227void ORptExport::exportReportAttributes(const Reference<XReportDefinition>& _xReport)
1228{
1229 if ( !_xReport.is() )
1230 return;
1231
1232 OUStringBuffer sValue;
1233 const SvXMLEnumMapEntry<sal_Int32>* aXML_CommandTypeEnumMap = OXMLHelper::GetCommandTypeOptions();
1234 if ( SvXMLUnitConverter::convertEnum( sValue, _xReport->getCommandType(), aXML_CommandTypeEnumMap ) )
1235 AddAttribute(XML_NAMESPACE_REPORT, XML_COMMAND_TYPE,sValue.makeStringAndClear());
1236
1237 OUString sCommand = _xReport->getCommand();
1238 if ( !sCommand.isEmpty() )
1240
1241 OUString sFilter( _xReport->getFilter() );
1242 if ( !sFilter.isEmpty() )
1244
1245 AddAttribute(XML_NAMESPACE_OFFICE, XML_MIMETYPE,_xReport->getMimeType());
1246
1247 bool bEscapeProcessing( _xReport->getEscapeProcessing() );
1248 if ( !bEscapeProcessing )
1249 AddAttribute( XML_NAMESPACE_REPORT, XML_ESCAPE_PROCESSING, ::xmloff::token::GetXMLToken( XML_FALSE ) );
1250
1251 OUString sName = _xReport->getCaption();
1252 if ( !sName.isEmpty() )
1254 sName = _xReport->getName();
1255 if ( !sName.isEmpty() )
1257}
1258
1260{
1262}
1263
1265{
1266 GetPageExport()->exportMasterStyles( true );
1267}
1268
1270{
1271 if ( m_bAllreadyFilled )
1272 return;
1273
1274 m_bAllreadyFilled = true;
1275 Reference<XReportDefinition> xProp(getReportDefinition());
1276 if ( !xProp.is() )
1277 return;
1278
1279 uno::Reference< report::XSection> xParent(xProp->getParent(),uno::UNO_QUERY);
1280 if ( xParent.is() )
1281 exportAutoStyle(xProp.get());
1282
1283 if ( xProp->getReportHeaderOn() )
1284 exportSectionAutoStyle(xProp->getReportHeader());
1285 if ( xProp->getPageHeaderOn() )
1286 exportSectionAutoStyle(xProp->getPageHeader());
1287
1288 exportGroup(xProp,0,true);
1289
1290 if ( xProp->getPageFooterOn() )
1291 exportSectionAutoStyle(xProp->getPageFooter());
1292 if ( xProp->getReportFooterOn() )
1293 exportSectionAutoStyle(xProp->getReportFooter());
1294}
1295
1297{
1298 // there are no styles that require their own autostyles
1299 if ( getExportFlags() & SvXMLExportFlags::CONTENT )
1300 {
1302 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_TABLE);
1303 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_COLUMN);
1304 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_ROW);
1305 GetAutoStylePool()->exportXML(XmlStyleFamily::TABLE_CELL);
1307 GetShapeExport()->exportAutoStyles();
1308 }
1309 // exported in _ExportMasterStyles
1310 if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES )
1311 GetPageExport()->collectAutoStyles( false );
1312 if( getExportFlags() & SvXMLExportFlags::MASTERSTYLES )
1313 GetPageExport()->exportAutoStyles();
1314}
1315
1317{
1319
1320 // write draw:style-name for object graphic-styles
1321 GetShapeExport()->ExportGraphicDefaults();
1322}
1323
1325{
1326 return new OXMLAutoStylePoolP(*this);
1327}
1328
1329void SAL_CALL ORptExport::setSourceDocument( const Reference< XComponent >& xDoc )
1330{
1331 m_xReportDefinition.set(xDoc,UNO_QUERY_THROW);
1333}
1334
1336{
1337 GetFontAutoStylePool(); // make sure the pool is created
1340}
1341
1342void ORptExport::exportParagraph(const Reference< XReportControlModel >& _xReportElement)
1343{
1344 OSL_PRECOND(_xReportElement.is(),"Element is null!");
1345 // start <text:p>
1346 SvXMLElementExport aParagraphContent(*this,XML_NAMESPACE_TEXT, XML_P, false, false);
1347 if ( Reference<XFormattedField>(_xReportElement,uno::UNO_QUERY).is() )
1348 {
1349 OUString sFieldData = _xReportElement->getDataField();
1350 static const sal_Unicode s_sPageNumber[] = u"PageNumber()";
1351 static const char s_sReportPrefix[] = "rpt:";
1352 sFieldData = sFieldData.copy(strlen(s_sReportPrefix));
1353 sal_Int32 nPageNumberIndex = sFieldData.indexOf(s_sPageNumber);
1354 if ( nPageNumberIndex != -1 )
1355 {
1356 sal_Int32 nIndex = 0;
1357 do
1358 {
1359 std::u16string_view sToken = o3tl::getToken(sFieldData, 0, '&', nIndex );
1360 sToken = o3tl::trim(sToken);
1361 if ( !sToken.empty() )
1362 {
1363 if ( sToken == s_sPageNumber )
1364 {
1366 SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_NUMBER, false, false);
1367 Characters("1");
1368 }
1369 else if ( sToken == u"PageCount()" )
1370 {
1371 SvXMLElementExport aPageNumber(*this,XML_NAMESPACE_TEXT, XML_PAGE_COUNT, false, false);
1372 Characters("1");
1373 }
1374 else
1375 {
1376
1377 if ( o3tl::starts_with(sToken, u"\"") && o3tl::ends_with(sToken, u"\"") )
1378 sToken = sToken.substr(1, sToken.size() - 2);
1379
1380 bool bPrevCharIsSpace = false;
1381 GetTextParagraphExport()->exportCharacterData(OUString(sToken), bPrevCharIsSpace);
1382 }
1383 }
1384 }
1385 while ( nIndex >= 0 );
1386 }
1387 }
1388 Reference< XFixedText > xFT(_xReportElement,UNO_QUERY);
1389 if ( xFT.is() )
1390 {
1391 OUString sExpr = xFT->getLabel();
1392 bool bPrevCharIsSpace = false; // FIXME this looks quite broken - does the corresponding import filter do whitespace collapsing at all?
1393 GetTextParagraphExport()->exportCharacterData(sExpr, bPrevCharIsSpace);
1394 }
1395}
1396
1398{
1400 return pShapeExport;
1401}
1402
1403void ORptExport::exportShapes(const Reference< XSection>& _xSection,bool _bAddParagraph)
1404{
1406 xShapeExport->seekShapes(_xSection);
1407 const sal_Int32 nCount = _xSection->getCount();
1408 ::std::unique_ptr<SvXMLElementExport> pParagraphContent;
1409 if ( _bAddParagraph )
1410 pParagraphContent.reset(new SvXMLElementExport(*this,XML_NAMESPACE_TEXT, XML_P, true, false));
1411
1412 awt::Point aRefPoint;
1413 aRefPoint.X = rptui::getStyleProperty<sal_Int32>(_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN);
1414 for (sal_Int32 i = 0; i < nCount; ++i)
1415 {
1416 uno::Reference< XShape > xShape(_xSection->getByIndex(i),uno::UNO_QUERY);
1417 if ( xShape.is() )
1418 {
1419 ::std::unique_ptr<SvXMLElementExport> pSubDocument;
1420 uno::Reference< frame::XModel> xModel(xShape->getPropertyValue("Model"),uno::UNO_QUERY);
1421 if ( xModel.is() ) // special handling for chart object
1422 {
1423 pSubDocument.reset(new SvXMLElementExport(*this,XML_NAMESPACE_REPORT, XML_SUB_DOCUMENT, false, false));
1425 exportReportElement(xShape);
1426 }
1427
1429 xShapeExport->exportShape(xShape, SEF_DEFAULT|XMLShapeExportFlags::NO_WS,&aRefPoint);
1430 }
1431 }
1432}
1433
1434void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xGroups)
1435{
1436 if ( !_xGroups.is() )
1437 return;
1438
1439 uno::Reference< XFunctions> xFunctions = _xGroups->getReportDefinition()->getFunctions();
1440 const sal_Int32 nCount = _xGroups->getCount();
1441 for (sal_Int32 i = 0; i < nCount; ++i)
1442 {
1443 uno::Reference< XGroup> xGroup(_xGroups->getByIndex(i),uno::UNO_QUERY_THROW);
1444 const ::sal_Int16 nGroupOn = xGroup->getGroupOn();
1445 if ( nGroupOn != report::GroupOn::DEFAULT )
1446 {
1447 uno::Reference< XFunction> xFunction = xFunctions->createFunction();
1448 OUString sFunction,sPrefix,sPostfix;
1449 OUString sExpression = xGroup->getExpression();
1450 OUString sFunctionName;
1451 OUString sInitialFormula;
1452 switch(nGroupOn)
1453 {
1454 case report::GroupOn::PREFIX_CHARACTERS:
1455 sFunction = "LEFT";
1456 sPrefix = ";" + OUString::number(xGroup->getGroupInterval());
1457 break;
1458 case report::GroupOn::YEAR:
1459 sFunction = "YEAR";
1460 break;
1461 case report::GroupOn::QUARTAL:
1462 sFunction = "INT((MONTH";
1463 sPostfix = "-1)/3)+1";
1464 sFunctionName = "QUARTAL_" + sExpression;
1465 break;
1466 case report::GroupOn::MONTH:
1467 sFunction = "MONTH";
1468 break;
1469 case report::GroupOn::WEEK:
1470 sFunction = "WEEK";
1471 break;
1472 case report::GroupOn::DAY:
1473 sFunction = "DAY";
1474 break;
1475 case report::GroupOn::HOUR:
1476 sFunction = "HOUR";
1477 break;
1478 case report::GroupOn::MINUTE:
1479 sFunction = "MINUTE";
1480 break;
1481 case report::GroupOn::INTERVAL:
1482 {
1483 sFunction = "INT";
1484 uno::Reference< XFunction> xCountFunction = xFunctions->createFunction();
1485 xCountFunction->setInitialFormula(beans::Optional< OUString>(true,OUString("rpt:0")));
1486 OUString sCountName = sFunction + "_count_" + sExpression;
1487 xCountFunction->setName(sCountName);
1488 xCountFunction->setFormula( "rpt:[" + sCountName + "] + 1" );
1489 exportFunction(xCountFunction);
1490 sExpression = sCountName;
1491 // The reference to sCountName in the formula of sFunctionName refers to the *old* value
1492 // so we need to expand the formula of sCountName
1493 sPrefix = " + 1) / " + OUString::number(xGroup->getGroupInterval());
1494 sFunctionName = sFunction + "_" + sExpression;
1495 sFunction += "(";
1496 sInitialFormula = "rpt:0";
1497 }
1498 break;
1499 default:
1500 ;
1501 }
1502 if ( sFunctionName.isEmpty() )
1503 sFunctionName = sFunction + "_" + sExpression;
1504 if ( !sFunction.isEmpty() )
1505 {
1506 const sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
1507 for(sal_Unicode ch : pReplaceChars)
1508 sFunctionName = sFunctionName.replace(ch,'_');
1509
1510 xFunction->setName(sFunctionName);
1511 if ( !sInitialFormula.isEmpty() )
1512 xFunction->setInitialFormula(beans::Optional< OUString>(true, sInitialFormula));
1513 sFunction = "rpt:" + sFunction + "([" + sExpression + "]";
1514
1515 if ( !sPrefix.isEmpty() )
1516 sFunction += sPrefix;
1517 sFunction += ")";
1518 if ( !sPostfix.isEmpty() )
1519 sFunction += sPostfix;
1520 xFunction->setFormula(sFunction);
1521 exportFunction(xFunction);
1522 m_aGroupFunctionMap.emplace(xGroup,xFunction);
1523 }
1524 }
1525 }
1526}
1527
1528
1529}// rptxml
1530
1531
1532/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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()
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
comphelper::AttributeList & GetAttrList()
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)
void AddAttribute(const OUString &sName, const OUString &sValue)
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:1269
virtual void ExportStyles_(bool bUsed) override
Definition: xmlExport.cxx:1316
virtual void ExportAutoStyles_() override
Definition: xmlExport.cxx:1296
virtual void ExportFontDecls_() override
Definition: xmlExport.cxx:1335
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Definition: xmlExport.cxx:1329
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 exportContainer(const Reference< XSection > &_xSection)
Definition: xmlExport.cxx:741
::std::map< Reference< XPropertySet >,TGrid > TSectionsGrid
Definition: xmlExport.hxx:82
virtual void ExportContent_() override
Definition: xmlExport.cxx:1259
TGroupFunctionMap m_aGroupFunctionMap
Definition: xmlExport.hxx:90
virtual XMLShapeExport * CreateShapeExport() override
Definition: xmlExport.cxx:1397
static OUString convertFormula(const OUString &_sFormula)
Definition: xmlExport.cxx:974
void exportSection(const Reference< XSection > &_xProp, bool bHeader=false)
Definition: xmlExport.cxx:688
rtl::Reference< XMLPropertyHandlerFactory > m_xPropHdlFactory
Definition: xmlExport.hxx:99
void exportGroupsExpressionAsFunction(const Reference< XGroups > &_xGroups)
Definition: xmlExport.cxx:1434
virtual SvXMLAutoStylePoolP * CreateAutoStylePool() override
Definition: xmlExport.cxx:1324
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:1403
void exportGroup(const Reference< XReportDefinition > &_xReportDefinition, sal_Int32 _nPos, bool _bExportAutoStyle=false)
Definition: xmlExport.cxx:1006
void exportReportAttributes(const Reference< XReportDefinition > &_xReport)
<element name="office:report">
Definition: xmlExport.cxx:1227
void exportReport(const Reference< XReportDefinition > &_xReportDefinition)
Definition: xmlExport.cxx:332
virtual void ExportMasterStyles_() override
Definition: xmlExport.cxx:1264
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 exportStyleName(XPropertySet *_xProp, comphelper::AttributeList &_rAtt, const OUString &_sName)
Definition: xmlExport.cxx:994
void exportParagraph(const Reference< XReportControlModel > &_xReportElement)
Definition: xmlExport.cxx:1342
bool exportFormula(enum ::xmloff::token::XMLTokenEnum eName, const OUString &_sFormula)
Definition: xmlExport.cxx:982
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:1089
::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:1221
void exportTableColumns(const Reference< XSection > &_xSection)
Definition: xmlExport.cxx:726
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 sName
OUString sPrefix
sal_Int32 nIndex
sal_uInt16 nPos
int i
constexpr OUStringLiteral implementationName
std::basic_string_view< charT, traits > trim(std::basic_string_view< charT, traits > str)
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)
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