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>
45#include <osl/diagnose.h>
49#define DEFAULT_LINE_WIDTH 2
66 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
68 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
71 "com.sun.star.comp.report.XMLSettingsExporter",
72 SvXMLExportFlags::SETTINGS ));
79 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
81 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
84 "com.sun.star.comp.report.XMLContentExporter",
85 SvXMLExportFlags::CONTENT ));
92 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
94 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
97 "com.sun.star.comp.report.XMLStylesExporter",
98 SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
99 SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::OASIS ));
106 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
108 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
111 "com.sun.star.comp.report.XMLMetaExporter",
112 SvXMLExportFlags::META ));
119 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
121 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
124 "com.sun.star.comp.report.XMLFullExporter",
125 SvXMLExportFlags::ALL));
138 virtual void handleSpecialItem(
143 const ::std::vector< XMLPropertyState >* =
nullptr,
144 sal_uInt32 = 0 )
const override
154 for (
auto& rEntry : _rGrid)
156 ORptExport::TGrid::iterator aRowIter = rEntry.second.begin();
157 ORptExport::TGrid::const_iterator aRowEnd = rEntry.second.end();
158 for (; aRowIter != aRowEnd; ++aRowIter)
160 if ( aRowIter->first )
162 sal_Int32 nColIndex = 0;
163 for (
const auto& rCell : aRowIter->second)
165 if ( rCell.nRowSpan > 1 )
167 sal_Int32 nColSpan = rCell.nColSpan;
168 for (sal_Int32
i = 1;
i < rCell.nRowSpan; ++
i)
170 (aRowIter+
i)->second[nColIndex].nColSpan = nColSpan;
182,m_bAllreadyFilled(false)
199 if(
getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::FONTDECLS) )
202 if(
getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::SCRIPTS|SvXMLExportFlags::SETTINGS) )
211 if(
getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::CONTENT|SvXMLExportFlags::FONTDECLS) )
216 if(
getExportFlags() & (SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
228 if(
getExportFlags() & (SvXMLExportFlags::META|SvXMLExportFlags::STYLES|SvXMLExportFlags::AUTOSTYLES|SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
244 xTableStylesPropertySetMapper1->AddMapperEntry(xTableStylesPropertySetMapper2);
275extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
277 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const&)
280 "com.sun.star.comp.report.ExportFilter",
281 SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::FONTDECLS));
287 const sal_Int32
nCount = _xFunctions->getCount();
290 uno::Reference< report::XFunction> xFunction(_xFunctions->getByIndex(
i),uno::UNO_QUERY_THROW);
298 beans::Optional< OUString> aInitial = _xFunction->getInitialFormula();
299 if ( aInitial.IsPresent && !aInitial.Value.isEmpty() )
302 if ( _xFunction->getPreEvaluated() )
304 if ( _xFunction->getDeepTraversing() )
312 const uno::Sequence< OUString> aMasterFields = _xReportComponent->getMasterFields();
313 if ( !aMasterFields.hasElements() )
317 const uno::Sequence< OUString> aDetailFields = _xReportComponent->getDetailFields();
319 OSL_ENSURE(aDetailFields.getLength() == aMasterFields.getLength(),
"not equal length for master and detail fields!");
321 const OUString* pDetailFieldsIter = aDetailFields.getConstArray();
322 for(
const OUString& rMasterField : aMasterFields)
325 if ( !pDetailFieldsIter->isEmpty() )
334 if ( !_xReportDefinition.is() )
340 if ( _xReportDefinition->getReportHeaderOn() )
345 if ( _xReportDefinition->getPageHeaderOn() )
347 OUStringBuffer sValue;
348 sal_Int16 nRet = _xReportDefinition->getPageHeaderOption();
359 if ( _xReportDefinition->getPageFooterOn() )
361 OUStringBuffer sValue;
362 sal_Int16 nRet = _xReportDefinition->getPageFooterOption();
369 if ( _xReportDefinition->getReportFooterOn() )
378 OSL_ENSURE(_xReportComponent.is(),
"No component interface!");
379 if ( !_xReportComponent.is() )
389 OSL_ENSURE(_xReportElement.is(),
"_xReportElement is NULL -> GPF");
390 const sal_Int32
nCount = _xReportElement->getCount();
395 uno::Reference< report::XFormatCondition > xCond(_xReportElement->getByIndex(
i),uno::UNO_QUERY);
396 if ( !xCond->getEnabled() )
405 catch(uno::Exception&)
407 OSL_FAIL(
"Can not access format condition!");
413 OSL_ENSURE(_xReportElement.is(),
"_xReportElement is NULL -> GPF");
414 if ( !_xReportElement->getPrintWhenGroupChange() )
417 if ( !_xReportElement->getPrintRepeatedValues() )
421 if ( _xReportElement->getCount() )
426 OUString sExpr = _xReportElement->getConditionalPrintExpression();
427 if ( !sExpr.isEmpty() )
434 uno::Reference< report::XSection> xParent(_xReportElement->getParent(),uno::UNO_QUERY);
441 sal_Int32 nCountX = _aPosX.size() - 1;
442 sal_Int32 nCountY = _aPosY.size() - 1;
443 for (sal_Int32 j = 0; j < nCountY; ++j)
445 sal_Int32 nHeight = _aPosY[j+1] - _aPosY[j];
447 for (sal_Int32
i = 0;
i < nCountX ; ++
i)
450 _rColumns[j].second[
i].bSet =
true;
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)
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) ));
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)
476 ::std::vector< XMLPropertyState > aPropertyStates(1, 0);
477 sal_Int32
nValue =
static_cast<sal_Int32
>(*aIter2 - *aIter);
478 aPropertyStates[0].maValue <<=
nValue;
483 ::std::vector<sal_Int32>::const_iterator aAutoGrow = ::std::find(_aSizeAutoGrow.begin(), _aSizeAutoGrow.end(), *aIter2);
484 bool bAutoGrow = aAutoGrow != _aSizeAutoGrow.end();
486 aPropertyStates[0].mnIndex = bAutoGrow ? 1 : 0;
493 OSL_ENSURE(_xProp !=
nullptr,
"Section is NULL -> GPF");
496 Reference<XReportDefinition> xReport = _xProp->getReportDefinition();
497 const awt::Size aSize = rptui::getStyleProperty<awt::Size>(xReport,
PROPERTY_PAPERSIZE);
499 const sal_Int32
nCount = _xProp->getCount();
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));
506 ::std::vector<sal_Int32> aRowPos;
507 aRowPos.reserve(2*(
nCount + 1));
508 aRowPos.push_back(0);
509 aRowPos.push_back(_xProp->getHeight());
512 ::std::vector<sal_Int32> aRowPosAutoGrow;
513 aRowPosAutoGrow.reserve(2 * (
nCount + 1));
519 Reference<XReportComponent> xReportElement(_xProp->getByIndex(
i),uno::UNO_QUERY);
520 uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
523 OSL_ENSURE( xReportElement.is(),
"NULL Element in Section!" );
524 if ( !xReportElement.is() )
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 )
531 sal_Int32 nWidth =
static_cast<sal_Int32
>(xReportElement->getWidth()*0.5);
533 aColumnPos.push_back(nX);
534 nX += xReportElement->getWidth() - nWidth;
537 nX += xReportElement->getWidth();
538 aColumnPos.push_back(nX);
540 sal_Int32 nY = xReportElement->getPositionY();
541 aRowPos.push_back(nY);
542 nY += xReportElement->getHeight();
543 aRowPos.push_back(nY);
544 bool bAutoGrow = xReportElement->getAutoGrow();
548 aRowPosAutoGrow.push_back(nY);
552 ::std::sort(aColumnPos.begin(),aColumnPos.end(),::std::less<sal_Int32>());
553 aColumnPos.erase(::std::unique(aColumnPos.begin(),aColumnPos.end()),aColumnPos.end());
558 ::std::sort(aRowPos.begin(),aRowPos.end(),::std::less<sal_Int32>());
559 aRowPos.erase(::std::unique(aRowPos.begin(),aRowPos.end()),aRowPos.end());
563 TGrid(aRowPos.size() - 1,TGrid::value_type(
false,
TRow(aColumnPos.size() - 1)))
567 TGridStyleMap::iterator aPos =
m_aColumnStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first;
569 aPos =
m_aRowStyleNames.emplace(_xProp.get(),std::vector<OUString>()).first;
570 collectStyleNames(XmlStyleFamily::TABLE_ROW, aRowPos, aRowPosAutoGrow, aPos->second);
578 bool isOverlap =
false;
582 Reference<XReportComponent> xReportElement(_xProp->getByIndex(
i),uno::UNO_QUERY);
583 uno::Reference< XShape> xShape(xReportElement,uno::UNO_QUERY);
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 )
590 nPos +=
static_cast<sal_Int32
>(xReportElement->getWidth()*0.5);
592 nPos += xReportElement->getWidth();
593 x2 = (::std::find(aColumnPos.begin(),aColumnPos.end(),
nPos) - aColumnPos.begin());
595 nPos = xReportElement->getPositionY();
596 y1 = (::std::find(aRowPos.begin(),aRowPos.end(),
nPos) - aRowPos.begin());
597 nPos += xReportElement->getHeight();
598 y2 = (::std::find(aRowPos.begin(),aRowPos.end(),
nPos) - aRowPos.begin());
602 while(yi < y2 && !isOverlap)
605 while(xi < x2 && !isOverlap)
607 if ( aInsert->second[yi].second[xi].xElement.is() )
624 aInsert->second[yi].second[xi] =
TCell();
627 aInsert->second[yi].first =
true;
631 if (x2 - x1 != 0 && y2 - y1 != 0)
633 sal_Int32 nColSpan = x2 - x1;
634 sal_Int32 nRowSpan = y2 - y1;
635 aInsert->second[y1].second[x1] =
651 const sal_Int32
nCount = _xProp->getCount();
654 const Reference<XReportComponent> xReportElement(_xProp->getByIndex(
i),uno::UNO_QUERY);
655 const Reference< report::XShape > xShape(xReportElement,uno::UNO_QUERY);
659 xShapeExport->seekShapes(_xProp);
661 xShapeExport->collectShapeAutoStyles(xShape);
667 Reference<XFormattedField> xFormattedField(xReportElement,uno::UNO_QUERY);
668 if ( xFormattedField.is() )
672 const sal_Int32 nFormatCount = xFormattedField->getCount();
673 for (sal_Int32 j = 0; j < nFormatCount ; ++j)
675 uno::Reference< report::XFormatCondition > xCond(xFormattedField->getByIndex(j),uno::UNO_QUERY);
679 catch(uno::Exception&)
681 OSL_FAIL(
"Can not access format condition!");
690 OSL_ENSURE(_xSection.is(),
"Section is NULL -> GPF");
693 if ( !_xSection->getVisible() )
698 OUStringBuffer sValue;
699 sal_Int16 nRet = _xSection->getForceNewPage();
704 nRet = _xSection->getNewRowOrCol();
707 if ( _xSection->getKeepTogether() )
716 OUString sExpr = _xSection->getConditionalPrintExpression();
717 if ( !sExpr.isEmpty() )
730 OSL_ENSURE(aColFind !=
m_aColumnStyleNames.end(),
"ORptExport::exportTableColumns: Section not found in m_aColumnStyleNames!");
734 for (
auto& aCol : aColFind->second)
743 OSL_ENSURE(_xSection.is(),
"Section is NULL -> GPF");
748 OSL_ENSURE(aFind !=
m_aSectionsGrid.end(),
"ORptExport::exportContainer: Section not found in grid!");
751 TGrid::const_iterator aRowIter = aFind->second.begin();
752 TGrid::const_iterator aRowEnd = aFind->second.end();
755 auto aHeightIter = aRowFind->second.cbegin();
756 OSL_ENSURE(aRowFind->second.size() == aFind->second.size(),
"Different count for rows");
758 bool bShapeHandled =
false;
759 ::std::map<sal_Int32,sal_Int32> aRowSpan;
760 for (sal_Int32 j = 0; aRowIter != aRowEnd; ++aRowIter,++j,++aHeightIter)
764 if ( aRowIter->first )
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)
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() )
778 if ( !--(aRowSpanFind->second) )
779 aRowSpan.erase(aRowSpanFind);
781 if ( aColIter->nColSpan > 1 )
782 nColSpan += aColIter->nColSpan - 1;
785 aColIter = aColIter + (aColIter->nColSpan - 1);
787 else if ( aColIter->bSet )
789 if ( nEmptyCellColSpan > 0 )
793 nColSpan = nEmptyCellColSpan - 1;
794 nEmptyCellColSpan = 0;
796 sal_Int32 nSpan = aColIter->nColSpan;
800 nColSpan = nSpan - 1;
803 nSpan = aColIter->nRowSpan;
807 aRowSpan[nColIndex] = nSpan - 1;
809 if ( aColIter->xElement.is() )
813 Reference<XFormattedField> xFormattedField(aColIter->xElement,uno::UNO_QUERY);
814 if ( xFormattedField.is() )
816 sal_Int32 nFormatKey = xFormattedField->getFormatKey();
818 bool bIsStandard =
false;
819 sal_Int16 nCellType =
aHelper.GetCellType(nFormatKey,bIsStandard);
825 if ( nCellType == util::NumberFormat::TEXT )
826 aHelper.SetNumberFormatAttributes(
"",
u"");
828 aHelper.SetNumberFormatAttributes(nFormatKey, 0.0,
false);
833 if ( aColIter->xElement.is() )
837 Reference<XServiceInfo> xElement(aColIter->xElement,uno::UNO_QUERY);
839 if ( !bShapeHandled )
841 bShapeHandled =
true;
844 uno::Reference< XShape > xShape(xElement,uno::UNO_QUERY);
845 uno::Reference< XFixedLine > xFixedLine(xElement,uno::UNO_QUERY);
846 if ( !xShape.is() && !xFixedLine.is() )
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);
854 bool bExportData =
false;
867 OUString sTargetLocation = xImage->getImageURL();
868 if ( !sTargetLocation.isEmpty() )
874 OUStringBuffer sValue;
879 else if ( xReportDefinition.is() )
898 if ( xReportElement.is() )
911 else if ( xSection.is() )
916 else if ( !bShapeHandled )
918 bShapeHandled =
true;
921 aColIter = aColIter + (aColIter->nColSpan - 1);
927 for (sal_Int32 k = 0; k < nColSpan; ++k)
934 if ( nEmptyCellColSpan )
939 if ( !bShapeHandled )
941 bShapeHandled =
true;
945 for (sal_Int32 k = 0; k < nEmptyCellColSpan; ++k)
953 sal_Int32 nEmptyCellColSpan = aRowIter->second.size();
954 if ( nEmptyCellColSpan )
959 if ( !bShapeHandled )
961 bShapeHandled =
true;
965 for (sal_Int32 k = 1; k < nEmptyCellColSpan; ++k)
977 if ( _sFormula ==
"rpt:" )
985 sal_Int32 nPageNumberIndex = sFieldData.indexOf(
"PageNumber()");
986 sal_Int32 nPageCountIndex = sFieldData.indexOf(
"PageCount()");
987 bool bRet = nPageNumberIndex != -1 || nPageCountIndex != -1;
996 Reference<XPropertySet> xFind(_xProp);
1008 if ( !_xReportDefinition.is() )
1011 Reference< XGroups > xGroups = _xReportDefinition->getGroups();
1012 if ( !xGroups.is() )
1015 sal_Int32
nCount = xGroups->getCount();
1018 Reference<XGroup> xGroup(xGroups->getByIndex(
_nPos),uno::UNO_QUERY);
1019 OSL_ENSURE(xGroup.is(),
"No Group prepare for GPF");
1020 if ( _bExportAutoStyle )
1022 if ( xGroup->getHeaderOn() )
1025 if ( xGroup->getFooterOn() )
1030 if ( xGroup->getSortAscending() )
1033 if ( xGroup->getStartNewColumn() )
1035 if ( xGroup->getResetPageNumber() )
1038 const OUString sField = xGroup->getExpression();
1039 OUString sExpression = sField;
1040 if ( !sExpression.isEmpty() )
1042 sExpression = sExpression.replaceAll(
u"\"",
u"\"\"");
1046 sExpression = aGroupFind->second->getName();
1047 sExpression =
"rpt:HASCHANGED(\"" + sExpression +
"\")";
1051 sal_Int16 nRet = xGroup->getKeepTogether();
1052 OUStringBuffer sValue;
1059 if ( xGroup->getHeaderOn() )
1061 Reference<XSection> xSection = xGroup->getHeader();
1062 if ( xSection->getRepeatSection() )
1068 if ( xGroup->getFooterOn() )
1070 Reference<XSection> xSection = xGroup->getFooter();
1071 if ( xSection->getRepeatSection() )
1078 else if ( _bExportAutoStyle )
1091 const uno::Reference<report::XReportControlFormat> xFormat(_xProp,uno::UNO_QUERY);
1096 const awt::FontDescriptor aFont = xFormat->getFontDescriptor();
1097 OSL_ENSURE(!aFont.Name.isEmpty(),
"No Font Name !");
1099 static_cast<FontPitch>(aFont.Pitch),aFont.CharSet );
1101 catch(beans::UnknownPropertyException&)
1106 const uno::Reference< report::XShape> xShape(_xProp,uno::UNO_QUERY);
1109 ::std::vector<XMLPropertyState> aPropertyStates(
m_xParaPropMapper->Filter(*
this, _xProp));
1110 if ( !aPropertyStates.empty() )
1114 Reference<XFixedLine> xFixedLine(_xProp,uno::UNO_QUERY);
1115 if ( xFixedLine.is() )
1118 table::BorderLine2 aValue;
1120 aValue.InnerLineWidth = aValue.LineDistance = 0;
1122 aValue.LineStyle = table::BorderLineStyle::SOLID;
1125 awt::Point aPos = xFixedLine->getPosition();
1126 awt::Size aSize = xFixedLine->getSize();
1127 sal_Int32 nSectionHeight = xFixedLine->getSection()->getHeight();
1129 OUString sBorderProp;
1130 ::std::vector< OUString> aProps;
1131 if ( xFixedLine->getOrientation() == 1 )
1150 if ( (aPos.Y + aSize.Height) == nSectionHeight )
1164 xBorderProp->setPropertyValue(sBorderProp,
uno::Any(aValue));
1166 aValue.Color = aValue.OuterLineWidth = aValue.LineWidth = 0;
1167 aValue.LineStyle = table::BorderLineStyle::NONE;
1170 for (
auto const& it : aProps)
1172 xBorderProp->setPropertyValue(it, aEmpty);
1176 aPropertyStates.insert( aPropertyStates.end(), aBorderStates.begin(), aBorderStates.end() );
1180 const Reference<XFormattedField> xFormattedField(_xProp,uno::UNO_QUERY);
1181 if ( (_xParentFormattedField.is() || xFormattedField.is()) && !aPropertyStates.empty() )
1183 sal_Int32 nNumberFormat = 0;
1184 if ( _xParentFormattedField.is() )
1185 nNumberFormat = _xParentFormattedField->getFormatKey();
1187 nNumberFormat = xFormattedField->getFormatKey();
1192 auto const iter(::std::find_if(
1193 aPropertyStates.begin(), aPropertyStates.end(),
1195 { return rItem.mnIndex == nStyleMapIndex; } ));
1196 if (iter == aPropertyStates.end())
1198 aPropertyStates.push_back( aNumberStyleState );
1204 (*iter) = aNumberStyleState;
1210 if ( !aPropertyStates.empty() )
1217 if ( !aPropertyStates.empty() )
1229 if ( !_xReport.is() )
1232 OUStringBuffer sValue;
1237 OUString sCommand = _xReport->getCommand();
1238 if ( !sCommand.isEmpty() )
1241 OUString sFilter( _xReport->getFilter() );
1242 if ( !sFilter.isEmpty() )
1247 bool bEscapeProcessing( _xReport->getEscapeProcessing() );
1248 if ( !bEscapeProcessing )
1251 OUString
sName = _xReport->getCaption();
1252 if ( !
sName.isEmpty() )
1254 sName = _xReport->getName();
1255 if ( !
sName.isEmpty() )
1279 uno::Reference< report::XSection> xParent(xProp->getParent(),uno::UNO_QUERY);
1283 if ( xProp->getReportHeaderOn() )
1285 if ( xProp->getPageHeaderOn() )
1290 if ( xProp->getPageFooterOn() )
1292 if ( xProp->getReportFooterOn() )
1344 OSL_PRECOND(_xReportElement.is(),
"Element is null!");
1347 if ( Reference<XFormattedField>(_xReportElement,uno::UNO_QUERY).is() )
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 )
1361 if ( !sToken.empty() )
1363 if ( sToken == s_sPageNumber )
1369 else if ( sToken ==
u"PageCount()" )
1378 sToken = sToken.substr(1, sToken.size() - 2);
1380 bool bPrevCharIsSpace =
false;
1388 Reference< XFixedText > xFT(_xReportElement,UNO_QUERY);
1391 OUString sExpr = xFT->getLabel();
1392 bool bPrevCharIsSpace =
false;
1400 return pShapeExport;
1406 xShapeExport->seekShapes(_xSection);
1407 const sal_Int32
nCount = _xSection->getCount();
1408 ::std::unique_ptr<SvXMLElementExport> pParagraphContent;
1409 if ( _bAddParagraph )
1412 awt::Point aRefPoint;
1413 aRefPoint.X = rptui::getStyleProperty<sal_Int32>(_xSection->getReportDefinition(),
PROPERTY_LEFTMARGIN);
1416 uno::Reference< XShape > xShape(_xSection->getByIndex(
i),uno::UNO_QUERY);
1419 ::std::unique_ptr<SvXMLElementExport> pSubDocument;
1420 uno::Reference< frame::XModel>
xModel(xShape->getPropertyValue(
"Model"),uno::UNO_QUERY);
1429 xShapeExport->exportShape(xShape,
SEF_DEFAULT|XMLShapeExportFlags::NO_WS,&aRefPoint);
1436 if ( !_xGroups.is() )
1439 uno::Reference< XFunctions> xFunctions = _xGroups->getReportDefinition()->getFunctions();
1440 const sal_Int32
nCount = _xGroups->getCount();
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 )
1447 uno::Reference< XFunction> xFunction = xFunctions->createFunction();
1448 OUString sFunction,
sPrefix,sPostfix;
1449 OUString sExpression = xGroup->getExpression();
1450 OUString sFunctionName;
1451 OUString sInitialFormula;
1454 case report::GroupOn::PREFIX_CHARACTERS:
1456 sPrefix =
";" + OUString::number(xGroup->getGroupInterval());
1458 case report::GroupOn::YEAR:
1461 case report::GroupOn::QUARTAL:
1462 sFunction =
"INT((MONTH";
1463 sPostfix =
"-1)/3)+1";
1464 sFunctionName =
"QUARTAL_" + sExpression;
1466 case report::GroupOn::MONTH:
1467 sFunction =
"MONTH";
1469 case report::GroupOn::WEEK:
1472 case report::GroupOn::DAY:
1475 case report::GroupOn::HOUR:
1478 case report::GroupOn::MINUTE:
1479 sFunction =
"MINUTE";
1481 case report::GroupOn::INTERVAL:
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" );
1490 sExpression = sCountName;
1493 sPrefix =
" + 1) / " + OUString::number(xGroup->getGroupInterval());
1494 sFunctionName = sFunction +
"_" + sExpression;
1496 sInitialFormula =
"rpt:0";
1502 if ( sFunctionName.isEmpty() )
1503 sFunctionName = sFunction +
"_" + sExpression;
1504 if ( !sFunction.isEmpty() )
1506 const sal_Unicode pReplaceChars[] = {
'(',
')',
';',
',',
'+',
'-',
'[',
']',
'/',
'*'};
1508 sFunctionName = sFunctionName.replace(
ch,
'_');
1510 xFunction->setName(sFunctionName);
1511 if ( !sInitialFormula.isEmpty() )
1512 xFunction->setInitialFormula(beans::Optional< OUString>(
true, sInitialFormula));
1513 sFunction =
"rpt:" + sFunction +
"([" + sExpression +
"]";
1518 if ( !sPostfix.isEmpty() )
1519 sFunction += sPostfix;
1520 xFunction->setFormula(sFunction);
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
rtl::Reference< SvXMLExportPropertyMapper > m_xCellStylesExportPropertySetMapper
rtl::Reference< XMLPropertySetMapper > m_xCellStylesPropertySetMapper
const Reference< XReportDefinition > & getReportDefinition() const
::std::vector< ::std::pair< bool, TRow > > TGrid
void exportComponent(const Reference< XReportComponent > &_xReportComponent)
void collectComponentStyles()
virtual void ExportStyles_(bool bUsed) override
virtual void ExportAutoStyles_() override
virtual void ExportFontDecls_() override
virtual void SAL_CALL setSourceDocument(const css::uno::Reference< css::lang::XComponent > &xDoc) override
Reference< XReportDefinition > m_xReportDefinition
ORptExport(const Reference< XComponentContext > &_rxContext, OUString const &implementationName, SvXMLExportFlags nExportFlag)
void exportContainer(const Reference< XSection > &_xSection)
::std::map< Reference< XPropertySet >,TGrid > TSectionsGrid
virtual void ExportContent_() override
TGroupFunctionMap m_aGroupFunctionMap
virtual XMLShapeExport * CreateShapeExport() override
static OUString convertFormula(const OUString &_sFormula)
void exportSection(const Reference< XSection > &_xProp, bool bHeader=false)
rtl::Reference< XMLPropertyHandlerFactory > m_xPropHdlFactory
void exportGroupsExpressionAsFunction(const Reference< XGroups > &_xGroups)
virtual SvXMLAutoStylePoolP * CreateAutoStylePool() override
void exportFormatConditions(const Reference< XReportControlModel > &_xReportElement)
TSectionsGrid m_aSectionsGrid
TPropertyStyleMap m_aAutoStyleNames
void exportShapes(const Reference< XSection > &_xSection, bool _bAddParagraph=true)
void exportGroup(const Reference< XReportDefinition > &_xReportDefinition, sal_Int32 _nPos, bool _bExportAutoStyle=false)
void exportReportAttributes(const Reference< XReportDefinition > &_xReport)
<element name="office:report">
void exportReport(const Reference< XReportDefinition > &_xReportDefinition)
virtual void ExportMasterStyles_() override
rtl::Reference< SvXMLExportPropertyMapper > m_xParaPropMapper
void exportSectionAutoStyle(const Reference< XSection > &_xProp)
void exportReportComponentAutoStyles(const Reference< XSection > &_xProp)
TGridStyleMap m_aRowStyleNames
void exportMasterDetailFields(const Reference< XReportComponent > &_xReportComponent)
void exportStyleName(XPropertySet *_xProp, comphelper::AttributeList &_rAtt, const OUString &_sName)
void exportParagraph(const Reference< XReportControlModel > &_xReportElement)
bool exportFormula(enum ::xmloff::token::XMLTokenEnum eName, const OUString &_sFormula)
void collectStyleNames(XmlStyleFamily _nFamily, const ::std::vector< sal_Int32 > &_aSize, std::vector< OUString > &_rStyleNames)
void exportAutoStyle(XPropertySet *_xProp, const Reference< XFormattedField > &_xParentFormattedField=Reference< XFormattedField >())
::std::vector< TCell > TRow
TGridStyleMap m_aColumnStyleNames
rtl::Reference< SvXMLExportPropertyMapper > m_xTableStylesExportPropertySetMapper
void exportReportElement(const Reference< XReportControlModel > &_xReportElement)
void exportFunctions(const Reference< XIndexAccess > &_xFunctions)
void exportFunction(const Reference< XFunction > &_xFunction)
<ref name="rpt-function">
virtual void SetBodyAttributes() override
void exportTableColumns(const Reference< XSection > &_xSection)
rtl::Reference< SvXMLExportPropertyMapper > m_xColumnStylesExportPropertySetMapper
static const SvXMLEnumMapEntry< sal_Int16 > * GetReportPrintOptions()
static css::uno::Reference< css::beans::XPropertySet > createBorderPropertySet()
static const SvXMLEnumMapEntry< sal_Int16 > * GetKeepTogetherOptions()
static const SvXMLEnumMapEntry< sal_Int32 > * GetCommandTypeOptions()
static const SvXMLEnumMapEntry< sal_Int16 > * GetImageScaleOptions()
static const XMLPropertyMapEntry * GetColumnStyleProps()
static const SvXMLEnumMapEntry< sal_Int16 > * GetForceNewPageOptions()
static const XMLPropertyMapEntry * GetRowStyleProps()
static const XMLPropertyMapEntry * GetTableStyleProps()
static rtl::Reference< XMLPropertySetMapper > GetCellStylePropertyMap(bool _bOldFormat, bool bForExport)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_ROW_STYLES_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_TABLE_CELL_STYLES_PREFIX
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
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.
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ODBFullExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports all.
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports only settings.
static void lcl_adjustColumnSpanOverRows(ORptExport::TSectionsGrid &_rGrid)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptContentExportHelper_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Exports only content.
static void lcl_calculate(const ::std::vector< sal_Int32 > &_aPosX, const ::std::vector< sal_Int32 > &_aPosY, ORptExport::TGrid &_rColumns)
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.
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * reportdesign_ORptExport_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
XML_NUMBER_COLUMNS_SPANNED
XML_CONDITIONAL_PRINT_EXPRESSION
XML_PRINT_REPEATED_VALUES
XML_PRINT_WHEN_GROUP_CHANGE
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
constexpr OUStringLiteral PROPERTY_BORDERTOP
constexpr OUStringLiteral PROPERTY_RIGHTMARGIN
constexpr OUStringLiteral PROPERTY_BORDERLEFT
constexpr OUStringLiteral PROPERTY_BORDERBOTTOM
constexpr OUStringLiteral SERVICE_IMAGECONTROL
constexpr OUStringLiteral SERVICE_FIXEDTEXT
constexpr OUStringLiteral SERVICE_FORMATTEDFIELD
constexpr OUStringLiteral PROPERTY_LEFTMARGIN
constexpr OUStringLiteral PROPERTY_BORDERRIGHT
constexpr OUStringLiteral PROPERTY_PAPERSIZE
Reference< XModel > xModel
#define DEFAULT_LINE_WIDTH
#define CTF_RPT_NUMBERFORMAT
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