LibreOffice Module reportdesign (master)  1
ReportDefinition.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 <sal/config.h>
21 
22 #include <vector>
23 #include <string_view>
24 
25 #include <officecfg/Office/Common.hxx>
26 #include <ReportDefinition.hxx>
27 
28 #include <Functions.hxx>
29 #include <Groups.hxx>
30 #include <ReportComponent.hxx>
31 #include <ReportHelperImpl.hxx>
32 #include <RptDef.hxx>
33 #include <RptModel.hxx>
34 #include <Section.hxx>
35 #include <Tools.hxx>
36 #include <UndoEnv.hxx>
37 #include <strings.hrc>
38 #include <core_resource.hxx>
39 #include <strings.hxx>
40 
41 #include <com/sun/star/beans/PropertyAttribute.hpp>
42 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
43 #include <com/sun/star/chart2/data/DatabaseDataProvider.hpp>
44 #include <com/sun/star/datatransfer/UnsupportedFlavorException.hpp>
45 #include <com/sun/star/document/DocumentProperties.hpp>
46 #include <com/sun/star/document/IndexedPropertyValues.hpp>
47 #include <com/sun/star/document/EventObject.hpp>
48 #include <com/sun/star/document/XEventListener.hpp>
49 #include <com/sun/star/document/XExporter.hpp>
50 #include <com/sun/star/document/XFilter.hpp>
51 #include <com/sun/star/document/XImporter.hpp>
52 #include <com/sun/star/embed/Aspects.hpp>
53 #include <com/sun/star/embed/ElementModes.hpp>
54 #include <com/sun/star/embed/EmbedMapUnits.hpp>
55 #include <com/sun/star/embed/XTransactedObject.hpp>
56 #include <com/sun/star/embed/StorageFactory.hpp>
57 #include <com/sun/star/frame/Desktop.hpp>
58 #include <com/sun/star/io/IOException.hpp>
59 #include <com/sun/star/io/XSeekable.hpp>
60 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
61 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
62 #include <com/sun/star/report/GroupKeepTogether.hpp>
63 #include <com/sun/star/report/ReportPrintOption.hpp>
64 #include <com/sun/star/sdb/CommandType.hpp>
65 #include <com/sun/star/style/GraphicLocation.hpp>
66 #include <com/sun/star/style/NumberingType.hpp>
67 #include <com/sun/star/style/PageStyleLayout.hpp>
68 #include <com/sun/star/style/XStyle.hpp>
69 #include <com/sun/star/table/BorderLine2.hpp>
70 #include <com/sun/star/table/ShadowFormat.hpp>
71 #include <com/sun/star/task/InteractionHandler.hpp>
72 #include <com/sun/star/task/XStatusIndicator.hpp>
73 #include <com/sun/star/ui/UIConfigurationManager.hpp>
74 #include <com/sun/star/util/CloseVetoException.hpp>
75 #include <com/sun/star/util/NumberFormatsSupplier.hpp>
76 #include <com/sun/star/xml/AttributeData.hpp>
77 #include <com/sun/star/xml/sax/Writer.hpp>
78 
89 #include <comphelper/seqstream.hxx>
90 #include <comphelper/sequence.hxx>
93 #include <comphelper/uno3.hxx>
95 #include <connectivity/dbtools.hxx>
96 #include <cppuhelper/exc_hlp.hxx>
97 #include <cppuhelper/implbase.hxx>
100 #include <comphelper/types.hxx>
102 #include <editeng/paperinf.hxx>
103 #include <framework/titlehelper.hxx>
104 #include <svl/itempool.hxx>
105 #include <svl/undo.hxx>
106 #include <svx/svdlayer.hxx>
107 #include <svx/unofill.hxx>
108 #include <svx/xmleohlp.hxx>
109 #include <svx/xmlgrhlp.hxx>
110 #include <tools/diagnose_ex.h>
111 #include <unotools/saveopt.hxx>
112 #include <vcl/svapp.hxx>
113 
114 // page styles
115 constexpr OUStringLiteral SC_UNO_PAGE_LEFTBORDER = u"LeftBorder";
116 constexpr OUStringLiteral SC_UNO_PAGE_RIGHTBORDER = u"RightBorder";
117 constexpr OUStringLiteral SC_UNO_PAGE_BOTTBORDER = u"BottomBorder";
118 constexpr OUStringLiteral SC_UNO_PAGE_TOPBORDER = u"TopBorder";
119 constexpr OUStringLiteral SC_UNO_PAGE_LEFTBRDDIST = u"LeftBorderDistance";
120 constexpr OUStringLiteral SC_UNO_PAGE_RIGHTBRDDIST = u"RightBorderDistance";
121 constexpr OUStringLiteral SC_UNO_PAGE_BOTTBRDDIST = u"BottomBorderDistance";
122 constexpr OUStringLiteral SC_UNO_PAGE_TOPBRDDIST = u"TopBorderDistance";
123 constexpr OUStringLiteral SC_UNO_PAGE_BORDERDIST = u"BorderDistance";
124 constexpr OUStringLiteral SC_UNO_PAGE_SHADOWFORM = u"ShadowFormat";
125 constexpr OUStringLiteral SC_UNO_PAGE_PAPERTRAY = u"PrinterPaperTray";
126 constexpr OUStringLiteral SC_UNO_PAGE_SCALEVAL = u"PageScale";
127 constexpr OUStringLiteral SC_UNO_PAGE_SCALETOPAG = u"ScaleToPages";
128 constexpr OUStringLiteral SC_UNO_PAGE_SCALETOX = u"ScaleToPagesX";
129 constexpr OUStringLiteral SC_UNO_PAGE_SCALETOY = u"ScaleToPagesY";
130 constexpr OUStringLiteral SC_UNO_PAGE_HDRBACKCOL = u"HeaderBackColor";
131 constexpr OUStringLiteral SC_UNO_PAGE_HDRBACKTRAN = u"HeaderBackTransparent";
132 constexpr OUStringLiteral SC_UNO_PAGE_HDRGRFFILT = u"HeaderBackGraphicFilter";
133 constexpr OUStringLiteral SC_UNO_PAGE_HDRGRFLOC = u"HeaderBackGraphicLocation";
134 constexpr OUStringLiteral SC_UNO_PAGE_HDRGRF = u"HeaderBackGraphic";
135 constexpr OUStringLiteral SC_UNO_PAGE_HDRLEFTBOR = u"HeaderLeftBorder";
136 constexpr OUStringLiteral SC_UNO_PAGE_HDRRIGHTBOR = u"HeaderRightBorder";
137 constexpr OUStringLiteral SC_UNO_PAGE_HDRBOTTBOR = u"HeaderBottomBorder";
138 constexpr OUStringLiteral SC_UNO_PAGE_HDRTOPBOR = u"HeaderTopBorder";
139 constexpr OUStringLiteral SC_UNO_PAGE_HDRLEFTBDIS = u"HeaderLeftBorderDistance";
140 constexpr OUStringLiteral SC_UNO_PAGE_HDRRIGHTBDIS = u"HeaderRightBorderDistance";
141 constexpr OUStringLiteral SC_UNO_PAGE_HDRBOTTBDIS = u"HeaderBottomBorderDistance";
142 constexpr OUStringLiteral SC_UNO_PAGE_HDRTOPBDIS = u"HeaderTopBorderDistance";
143 constexpr OUStringLiteral SC_UNO_PAGE_HDRBRDDIST = u"HeaderBorderDistance";
144 constexpr OUStringLiteral SC_UNO_PAGE_HDRSHADOW = u"HeaderShadowFormat";
145 constexpr OUStringLiteral SC_UNO_PAGE_HDRLEFTMAR = u"HeaderLeftMargin";
146 constexpr OUStringLiteral SC_UNO_PAGE_HDRRIGHTMAR = u"HeaderRightMargin";
147 constexpr OUStringLiteral SC_UNO_PAGE_HDRBODYDIST = u"HeaderBodyDistance";
148 constexpr OUStringLiteral SC_UNO_PAGE_HDRHEIGHT = u"HeaderHeight";
149 constexpr OUStringLiteral SC_UNO_PAGE_HDRON = u"HeaderIsOn";
150 constexpr OUStringLiteral SC_UNO_PAGE_HDRDYNAMIC = u"HeaderIsDynamicHeight";
151 constexpr OUStringLiteral SC_UNO_PAGE_HDRSHARED = u"HeaderIsShared";
152 constexpr OUStringLiteral SC_UNO_PAGE_FIRSTHDRSHARED = u"FirstPageHeaderIsShared";
153 constexpr OUStringLiteral SC_UNO_PAGE_FTRBACKCOL = u"FooterBackColor";
154 constexpr OUStringLiteral SC_UNO_PAGE_FTRBACKTRAN = u"FooterBackTransparent";
155 constexpr OUStringLiteral SC_UNO_PAGE_FTRGRFFILT = u"FooterBackGraphicFilter";
156 constexpr OUStringLiteral SC_UNO_PAGE_FTRGRFLOC = u"FooterBackGraphicLocation";
157 constexpr OUStringLiteral SC_UNO_PAGE_FTRGRF = u"FooterBackGraphic";
158 constexpr OUStringLiteral SC_UNO_PAGE_FTRLEFTBOR = u"FooterLeftBorder";
159 constexpr OUStringLiteral SC_UNO_PAGE_FTRRIGHTBOR = u"FooterRightBorder";
160 constexpr OUStringLiteral SC_UNO_PAGE_FTRBOTTBOR = u"FooterBottomBorder";
161 constexpr OUStringLiteral SC_UNO_PAGE_FTRTOPBOR = u"FooterTopBorder";
162 constexpr OUStringLiteral SC_UNO_PAGE_FTRLEFTBDIS = u"FooterLeftBorderDistance";
163 constexpr OUStringLiteral SC_UNO_PAGE_FTRRIGHTBDIS = u"FooterRightBorderDistance";
164 constexpr OUStringLiteral SC_UNO_PAGE_FTRBOTTBDIS = u"FooterBottomBorderDistance";
165 constexpr OUStringLiteral SC_UNO_PAGE_FTRTOPBDIS = u"FooterTopBorderDistance";
166 constexpr OUStringLiteral SC_UNO_PAGE_FTRBRDDIST = u"FooterBorderDistance";
167 constexpr OUStringLiteral SC_UNO_PAGE_FTRSHADOW = u"FooterShadowFormat";
168 constexpr OUStringLiteral SC_UNO_PAGE_FTRLEFTMAR = u"FooterLeftMargin";
169 constexpr OUStringLiteral SC_UNO_PAGE_FTRRIGHTMAR = u"FooterRightMargin";
170 constexpr OUStringLiteral SC_UNO_PAGE_FTRBODYDIST = u"FooterBodyDistance";
171 constexpr OUStringLiteral SC_UNO_PAGE_FTRHEIGHT = u"FooterHeight";
172 constexpr OUStringLiteral SC_UNO_PAGE_FTRON = u"FooterIsOn";
173 constexpr OUStringLiteral SC_UNO_PAGE_FTRDYNAMIC = u"FooterIsDynamicHeight";
174 constexpr OUStringLiteral SC_UNO_PAGE_FTRSHARED = u"FooterIsShared";
175 constexpr OUStringLiteral SC_UNO_PAGE_FIRSTFTRSHARED = u"FirstPageFooterIsShared";
176 
177 namespace reportdesign
178 {
179  using namespace com::sun::star;
180  using namespace rptui;
181 
182 static void lcl_setModelReadOnly(const uno::Reference< embed::XStorage >& _xStorage,std::shared_ptr<rptui::OReportModel> const & _rModel)
183 {
184  uno::Reference<beans::XPropertySet> xProp(_xStorage,uno::UNO_QUERY);
185  sal_Int32 nOpenMode = embed::ElementModes::READ;
186  if ( xProp.is() )
187  xProp->getPropertyValue("OpenMode") >>= nOpenMode;
188 
189  _rModel->SetReadOnly((nOpenMode & embed::ElementModes::WRITE) != embed::ElementModes::WRITE);
190 }
191 static void lcl_stripLoadArguments( utl::MediaDescriptor& _rDescriptor, uno::Sequence< beans::PropertyValue >& _rArgs )
192 {
193  _rDescriptor.erase( "StatusIndicator" );
194  _rDescriptor.erase( "InteractionHandler" );
195  _rDescriptor.erase( "Model" );
196  _rDescriptor >> _rArgs;
197 }
198 
199 static void lcl_extractAndStartStatusIndicator( const utl::MediaDescriptor& _rDescriptor, uno::Reference< task::XStatusIndicator >& _rxStatusIndicator,
200  uno::Sequence< uno::Any >& _rCallArgs )
201 {
202  try
203  {
204  _rxStatusIndicator = _rDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_STATUSINDICATOR(), _rxStatusIndicator );
205  if ( _rxStatusIndicator.is() )
206  {
207  _rxStatusIndicator->start( OUString(), sal_Int32(1000000) );
208 
209  sal_Int32 nLength = _rCallArgs.getLength();
210  _rCallArgs.realloc( nLength + 1 );
211  _rCallArgs[ nLength ] <<= _rxStatusIndicator;
212  }
213  }
214  catch (const uno::Exception&)
215  {
216  TOOLS_WARN_EXCEPTION( "reportdesign", "lcl_extractAndStartStatusIndicator" );
217  }
218 }
219 
220 typedef ::comphelper::OPropertyStateContainer OStyle_PBASE;
221 
222 namespace {
223 
224 class OStyle;
225 
226 }
227 
228 typedef ::comphelper::OPropertyArrayUsageHelper < OStyle
230 typedef ::cppu::WeakImplHelper< style::XStyle, beans::XMultiPropertyStates> TStyleBASE;
231 
232 namespace {
233 
234 class OStyle : public ::comphelper::OMutexAndBroadcastHelper
235  ,public TStyleBASE
236  ,public OStyle_PBASE
237  ,public OStyle_PABASE
238 {
239  awt::Size m_aSize;
240 
241 protected:
242  void getPropertyDefaultByHandle( sal_Int32 _nHandle, uno::Any& _rDefault ) const override;
243  virtual ~OStyle() override {}
244 public:
245  OStyle();
246 
247 
249 
250  // XPropertySet
251  css::uno::Reference<css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
252  ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
253  ::cppu::IPropertyArrayHelper* createArrayHelper( ) const override;
254 
255  // XStyle
256  sal_Bool SAL_CALL isUserDefined( ) override;
257  sal_Bool SAL_CALL isInUse( ) override;
258  OUString SAL_CALL getParentStyle( ) override;
259  void SAL_CALL setParentStyle( const OUString& aParentStyle ) override;
260 
261  // XNamed
262  OUString SAL_CALL getName( ) override;
263  void SAL_CALL setName( const OUString& aName ) override;
264 
265  // XMultiPropertyState
266  uno::Sequence< beans::PropertyState > SAL_CALL getPropertyStates( const uno::Sequence< OUString >& aPropertyNames ) override
267  {
268  return OStyle_PBASE::getPropertyStates(aPropertyNames);
269  }
270  void SAL_CALL setAllPropertiesToDefault( ) override;
271  void SAL_CALL setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames ) override;
272  uno::Sequence< uno::Any > SAL_CALL getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames ) override;
273 };
274 
275 }
276 
277 OStyle::OStyle()
278 :OStyle_PBASE(m_aBHelper)
279 ,m_aSize(21000,29700)
280 {
281  const ::Size aDefaultSize = SvxPaperInfo::GetDefaultPaperSize( MapUnit::Map100thMM );
282  m_aSize.Height = aDefaultSize.Height();
283  m_aSize.Width = aDefaultSize.Width();
284 
285  const sal_Int32 nMargin = 2000;
286  const sal_Int32 nBound = beans::PropertyAttribute::BOUND;
287  const sal_Int32 nMayBeVoid = beans::PropertyAttribute::MAYBEVOID;
288 
289  sal_Int32 i = 0;
290  registerPropertyNoMember( PROPERTY_NAME, ++i, nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString("Default")) );
291 
292  registerPropertyNoMember(PROPERTY_BACKCOLOR, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny(COL_TRANSPARENT));
293 
294  registerPropertyNoMember(PROPERTY_BACKGRAPHICLOCATION, ++i,nBound, cppu::UnoType<style::GraphicLocation>::get(), css::uno::Any(style::GraphicLocation_NONE));
295  registerPropertyNoMember(PROPERTY_BACKTRANSPARENT, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(true));
296  registerPropertyNoMember(SC_UNO_PAGE_BORDERDIST, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
297  registerPropertyNoMember(SC_UNO_PAGE_BOTTBORDER, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
298  registerPropertyNoMember(SC_UNO_PAGE_BOTTBRDDIST, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
299  registerPropertyNoMember(PROPERTY_BOTTOMMARGIN, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::Any(nMargin));
300  registerPropertyNoMember("DisplayName", ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString()));
301  registerPropertyNoMember(SC_UNO_PAGE_FTRBACKCOL, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny(COL_TRANSPARENT));
302  registerPropertyNoMember(SC_UNO_PAGE_FTRGRFFILT, ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString()));
303  registerPropertyNoMember(SC_UNO_PAGE_FTRGRFLOC, ++i,nBound, cppu::UnoType<style::GraphicLocation>::get(), css::uno::Any(style::GraphicLocation_NONE));
304  registerPropertyNoMember(SC_UNO_PAGE_FTRGRF, ++i,nBound|nMayBeVoid, cppu::UnoType<graphic::XGraphic>::get(), css::uno::Any(uno::Reference<graphic::XGraphic>()));
305  registerPropertyNoMember(SC_UNO_PAGE_FTRBACKTRAN, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(true));
306  registerPropertyNoMember(SC_UNO_PAGE_FTRBODYDIST, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
307  registerPropertyNoMember(SC_UNO_PAGE_FTRBRDDIST, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
308  registerPropertyNoMember(SC_UNO_PAGE_FTRBOTTBOR, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
309  registerPropertyNoMember(SC_UNO_PAGE_FTRBOTTBDIS, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
310  registerPropertyNoMember(SC_UNO_PAGE_FTRHEIGHT, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
311  registerPropertyNoMember(SC_UNO_PAGE_FTRDYNAMIC, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(false));
312  registerPropertyNoMember(SC_UNO_PAGE_FTRON, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(false));
313  registerPropertyNoMember(SC_UNO_PAGE_FTRSHARED, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(false));
314  registerPropertyNoMember(SC_UNO_PAGE_FIRSTFTRSHARED, ++i,nBound,cppu::UnoType<bool>::get(), css::uno::Any(false));
315  registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTBOR, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
316  registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTBDIS, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
317  registerPropertyNoMember(SC_UNO_PAGE_FTRLEFTMAR, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
318  registerPropertyNoMember(SC_UNO_PAGE_FTRRIGHTBOR, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
319  registerPropertyNoMember(SC_UNO_PAGE_FTRRIGHTBDIS,++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
320  registerPropertyNoMember(SC_UNO_PAGE_FTRRIGHTMAR, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
321  registerPropertyNoMember(SC_UNO_PAGE_FTRSHADOW, ++i,nBound, cppu::UnoType<table::ShadowFormat>::get(), css::uno::Any(table::ShadowFormat()));
322  registerPropertyNoMember(SC_UNO_PAGE_FTRTOPBOR, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
323  registerPropertyNoMember(SC_UNO_PAGE_FTRTOPBDIS, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
324 
325  registerPropertyNoMember(SC_UNO_PAGE_HDRBACKCOL, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny(COL_TRANSPARENT));
326  registerPropertyNoMember(SC_UNO_PAGE_HDRGRFFILT, ++i,nBound|nMayBeVoid, cppu::UnoType<OUString>::get(), css::uno::Any(OUString()));
327  registerPropertyNoMember(SC_UNO_PAGE_HDRGRFLOC, ++i,nBound|nMayBeVoid, cppu::UnoType<style::GraphicLocation>::get(), css::uno::Any(style::GraphicLocation_NONE));
328  registerPropertyNoMember(SC_UNO_PAGE_HDRGRF, ++i,nBound|nMayBeVoid, cppu::UnoType<graphic::XGraphic>::get(), css::uno::Any(uno::Reference<graphic::XGraphic>()));
329  registerPropertyNoMember(SC_UNO_PAGE_HDRBACKTRAN, ++i,nBound|nMayBeVoid,cppu::UnoType<bool>::get(), css::uno::Any(true));
330  registerPropertyNoMember(SC_UNO_PAGE_HDRBODYDIST, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
331  registerPropertyNoMember(SC_UNO_PAGE_HDRBRDDIST, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
332  registerPropertyNoMember(SC_UNO_PAGE_HDRBOTTBOR, ++i,nBound|nMayBeVoid, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
333  registerPropertyNoMember(SC_UNO_PAGE_HDRBOTTBDIS, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
334  registerPropertyNoMember(SC_UNO_PAGE_HDRHEIGHT, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
335  registerPropertyNoMember(SC_UNO_PAGE_HDRDYNAMIC, ++i,nBound|nMayBeVoid,cppu::UnoType<bool>::get(), css::uno::Any(false));
336  registerPropertyNoMember(SC_UNO_PAGE_HDRON, ++i,nBound|nMayBeVoid,cppu::UnoType<bool>::get(), css::uno::Any(false));
337  registerPropertyNoMember(SC_UNO_PAGE_HDRSHARED, ++i,nBound|nMayBeVoid,cppu::UnoType<bool>::get(), css::uno::Any(false));
338  registerPropertyNoMember(SC_UNO_PAGE_FIRSTHDRSHARED, ++i,nBound|nMayBeVoid,cppu::UnoType<bool>::get(), css::uno::Any(false));
339  registerPropertyNoMember(SC_UNO_PAGE_HDRLEFTBOR, ++i,nBound|nMayBeVoid, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
340  registerPropertyNoMember(SC_UNO_PAGE_HDRLEFTBDIS, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
341  registerPropertyNoMember(SC_UNO_PAGE_HDRLEFTMAR, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
342  registerPropertyNoMember(SC_UNO_PAGE_HDRRIGHTBOR, ++i,nBound|nMayBeVoid, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
343  registerPropertyNoMember(SC_UNO_PAGE_HDRRIGHTBDIS,++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
344  registerPropertyNoMember(SC_UNO_PAGE_HDRRIGHTMAR, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
345  registerPropertyNoMember(SC_UNO_PAGE_HDRSHADOW, ++i,nBound|nMayBeVoid, cppu::UnoType<table::ShadowFormat>::get(), css::uno::Any(table::ShadowFormat()));
346  registerPropertyNoMember(SC_UNO_PAGE_HDRTOPBOR, ++i,nBound|nMayBeVoid, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
347  registerPropertyNoMember(SC_UNO_PAGE_HDRTOPBDIS, ++i,nBound|nMayBeVoid, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
348 
349  registerProperty(PROPERTY_HEIGHT, ++i,nBound,&m_aSize.Height, ::cppu::UnoType<sal_Int32>::get() );
350  registerPropertyNoMember(PROPERTY_ISLANDSCAPE, ++i,nBound, cppu::UnoType<bool>::get(), css::uno::Any(false));
351  registerPropertyNoMember(SC_UNO_PAGE_LEFTBORDER, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
352  registerPropertyNoMember(SC_UNO_PAGE_LEFTBRDDIST, ++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
353  registerPropertyNoMember(PROPERTY_LEFTMARGIN, ++i,beans::PropertyAttribute::BOUND, ::cppu::UnoType<sal_Int32>::get(), css::uno::Any(nMargin));
354  registerPropertyNoMember(PROPERTY_NUMBERINGTYPE, ++i,nBound, cppu::UnoType<sal_Int16>::get(), css::uno::Any(style::NumberingType::ARABIC));
355  registerPropertyNoMember(SC_UNO_PAGE_SCALEVAL, ++i,nBound, cppu::UnoType<sal_Int16>::get(), css::uno::makeAny<sal_Int16>(0));
356  registerPropertyNoMember(PROPERTY_PAGESTYLELAYOUT, ++i,nBound, cppu::UnoType<style::PageStyleLayout>::get(), css::uno::Any(style::PageStyleLayout_ALL));
357  registerPropertyNoMember(SC_UNO_PAGE_PAPERTRAY, ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString("[From printer settings]")));
358  registerPropertyNoMember(SC_UNO_PAGE_RIGHTBORDER, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
359  registerPropertyNoMember(SC_UNO_PAGE_RIGHTBRDDIST,++i,nBound, cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
360  registerPropertyNoMember(PROPERTY_RIGHTMARGIN, ++i,beans::PropertyAttribute::BOUND,::cppu::UnoType<sal_Int32>::get(), css::uno::Any(nMargin));
361  registerPropertyNoMember(SC_UNO_PAGE_SCALETOPAG, ++i,nBound, cppu::UnoType<sal_Int16>::get(), css::uno::makeAny<sal_Int16>(0));
362  registerPropertyNoMember(SC_UNO_PAGE_SCALETOX, ++i,nBound, cppu::UnoType<sal_Int16>::get(), css::uno::makeAny<sal_Int16>(0));
363  registerPropertyNoMember(SC_UNO_PAGE_SCALETOY, ++i,nBound, cppu::UnoType<sal_Int16>::get(), css::uno::makeAny<sal_Int16>(0));
364  registerPropertyNoMember(SC_UNO_PAGE_SHADOWFORM, ++i,nBound, cppu::UnoType<table::ShadowFormat>::get(), css::uno::Any(table::ShadowFormat()));
365  registerProperty(PROPERTY_PAPERSIZE, ++i,beans::PropertyAttribute::BOUND,&m_aSize, cppu::UnoType<awt::Size>::get() );
366  registerPropertyNoMember(SC_UNO_PAGE_TOPBORDER, ++i,nBound, cppu::UnoType<table::BorderLine2>::get(), css::uno::Any(table::BorderLine2()));
367  registerPropertyNoMember(SC_UNO_PAGE_TOPBRDDIST, ++i,nBound,::cppu::UnoType<sal_Int32>::get(), css::uno::makeAny<sal_Int32>(0));
368  registerPropertyNoMember(PROPERTY_TOPMARGIN, ++i,nBound,::cppu::UnoType<sal_Int32>::get(), css::uno::Any(nMargin));
369  registerPropertyNoMember("UserDefinedAttributes", ++i,nBound, cppu::UnoType<container::XNameContainer>::get(), css::uno::Any(comphelper::NameContainer_createInstance(cppu::UnoType<xml::AttributeData>::get())));
370  registerProperty(PROPERTY_WIDTH, ++i,nBound,&m_aSize.Width, cppu::UnoType<sal_Int32>::get() );
371  registerPropertyNoMember("PrinterName", ++i,nBound, cppu::UnoType<OUString>::get(), css::uno::Any(OUString()));
372  registerPropertyNoMember("PrinterSetup", ++i,nBound,cppu::UnoType<uno::Sequence<sal_Int8>>::get(), css::uno::Any(uno::Sequence<sal_Int8>()));
373 
374 
375 }
376 
377 IMPLEMENT_FORWARD_XINTERFACE2(OStyle,TStyleBASE,OStyle_PBASE)
378 
379 uno::Reference< beans::XPropertySetInfo> SAL_CALL OStyle::getPropertySetInfo()
380 {
381  return createPropertySetInfo( getInfoHelper() );
382 }
383 
384 void OStyle::getPropertyDefaultByHandle( sal_Int32 /*_nHandle*/, uno::Any& /*_rDefault*/ ) const
385 {
386 }
387 
388 ::cppu::IPropertyArrayHelper& OStyle::getInfoHelper()
389 {
390  return *getArrayHelper();
391 }
392 
393 ::cppu::IPropertyArrayHelper* OStyle::createArrayHelper( ) const
394 {
395  uno::Sequence< beans::Property > aProps;
396  describeProperties(aProps);
397  return new ::cppu::OPropertyArrayHelper(aProps);
398 }
399 
400 // XStyle
401 sal_Bool SAL_CALL OStyle::isUserDefined( )
402 {
403  return false;
404 }
405 
406 sal_Bool SAL_CALL OStyle::isInUse( )
407 {
408  return true;
409 }
410 
411 OUString SAL_CALL OStyle::getParentStyle( )
412 {
413  return OUString();
414 }
415 
416 void SAL_CALL OStyle::setParentStyle( const OUString& /*aParentStyle*/ )
417 {
418 }
419 
420 // XNamed
421 OUString SAL_CALL OStyle::getName( )
422 {
423  OUString sName;
424  getPropertyValue(PROPERTY_NAME) >>= sName;
425  return sName;
426 }
427 
428 void SAL_CALL OStyle::setName( const OUString& aName )
429 {
430  setPropertyValue(PROPERTY_NAME,uno::makeAny(aName));
431 }
432 
433 void SAL_CALL OStyle::setAllPropertiesToDefault( )
434 {
435 }
436 
437 void SAL_CALL OStyle::setPropertiesToDefault( const uno::Sequence< OUString >& aPropertyNames )
438 {
439  for(const OUString& rName : aPropertyNames)
440  setPropertyToDefault(rName);
441 }
442 
443 uno::Sequence< uno::Any > SAL_CALL OStyle::getPropertyDefaults( const uno::Sequence< OUString >& aPropertyNames )
444 {
445  uno::Sequence< uno::Any > aRet(aPropertyNames.getLength());
446  std::transform(aPropertyNames.begin(), aPropertyNames.end(), aRet.getArray(),
447  [this](const OUString& rName) -> uno::Any { return getPropertyDefault(rName); });
448  return aRet;
449 }
450 
452 {
453  uno::WeakReference< uno::XInterface > m_xParent;
459  ::std::vector< uno::Reference< frame::XController> > m_aControllers;
460  uno::Sequence< beans::PropertyValue > m_aArgs;
461 
462  uno::Reference< report::XGroups > m_xGroups;
463  uno::Reference< report::XSection> m_xReportHeader;
464  uno::Reference< report::XSection> m_xReportFooter;
465  uno::Reference< report::XSection> m_xPageHeader;
466  uno::Reference< report::XSection> m_xPageFooter;
467  uno::Reference< report::XSection> m_xDetail;
468  uno::Reference< embed::XStorage > m_xStorage;
469  uno::Reference< frame::XController > m_xCurrentController;
470  uno::Reference< container::XIndexAccess > m_xViewData;
471  uno::Reference< container::XNameAccess > m_xStyles;
472  uno::Reference< container::XNameAccess> m_xXMLNamespaceMap;
473  uno::Reference< container::XNameAccess> m_xGradientTable;
474  uno::Reference< container::XNameAccess> m_xHatchTable;
475  uno::Reference< container::XNameAccess> m_xBitmapTable;
476  uno::Reference< container::XNameAccess> m_xTransparencyGradientTable;
477  uno::Reference< container::XNameAccess> m_xDashTable;
478  uno::Reference< container::XNameAccess> m_xMarkerTable;
479  uno::Reference< report::XFunctions > m_xFunctions;
480  uno::Reference< ui::XUIConfigurationManager2> m_xUIConfigurationManager;
481  uno::Reference< util::XNumberFormatsSupplier> m_xNumberFormatsSupplier;
482  uno::Reference< sdbc::XConnection> m_xActiveConnection;
483  uno::Reference< frame::XTitle > m_xTitleHelper;
484  uno::Reference< frame::XUntitledNumbers > m_xNumberedControllers;
485  uno::Reference< document::XDocumentProperties > m_xDocumentProperties;
486 
487  std::shared_ptr< ::comphelper::EmbeddedObjectContainer>
489  std::shared_ptr<rptui::OReportModel> m_pReportModel;
491  OUString m_sCaption;
492  OUString m_sCommand;
493  OUString m_sFilter;
494  OUString m_sMimeType;
495  OUString m_sIdentifier;
497  awt::Size m_aVisualAreaSize;
498  ::sal_Int64 m_nAspect;
499  ::sal_Int16 m_nGroupKeepTogether;
500  ::sal_Int16 m_nPageHeaderOption;
501  ::sal_Int16 m_nPageFooterOption;
502  ::sal_Int32 m_nCommandType;
507 
508  explicit OReportDefinitionImpl(::osl::Mutex& _aMutex)
509  :m_aStorageChangeListeners(_aMutex)
510  ,m_aCloseListener(_aMutex)
511  ,m_aModifyListeners(_aMutex)
512  ,m_aLegacyEventListeners(_aMutex)
513  ,m_aDocEventListeners(_aMutex)
515  ,m_sIdentifier(SERVICE_REPORTDEFINITION)
516  // default visual area is 8 x 7 cm
517  ,m_aVisualAreaSize( 8000, 7000 )
518  ,m_nAspect(embed::Aspects::MSOLE_CONTENT)
519  ,m_nGroupKeepTogether(0)
520  ,m_nPageHeaderOption(0)
521  ,m_nPageFooterOption(0)
522  ,m_nCommandType(sdb::CommandType::TABLE)
523  ,m_bControllersLocked(false)
524  ,m_bModified(false)
525  ,m_bEscapeProcessing(true)
526  ,m_bSetModifiedEnabled( true )
527  {}
528 };
529 
530 OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext)
531 : ::cppu::BaseMutex(),
533  ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()),
534  ::comphelper::IEmbeddedHelper(),
535  m_aProps(std::make_shared<OReportComponentProperties>(_xContext)),
536  m_pImpl(std::make_shared<OReportDefinitionImpl>(m_aMutex))
537 {
538  m_aProps->m_sName = RptResId(RID_STR_REPORT);
539  osl_atomic_increment(&m_refCount);
540  {
541  init();
542  m_pImpl->m_xGroups = new OGroups(this,m_aProps->m_xContext);
543  m_pImpl->m_xDetail = OSection::createOSection(this,m_aProps->m_xContext);
544  m_pImpl->m_xDetail->setName(RptResId(RID_STR_DETAIL));
545  }
546  osl_atomic_decrement( &m_refCount );
547 }
548 
550  uno::Reference< uno::XComponentContext > const & _xContext,
551  const uno::Reference< lang::XMultiServiceFactory>& _xFactory,
552  uno::Reference< drawing::XShape >& _xShape)
553 : ::cppu::BaseMutex(),
555  ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()),
556  ::comphelper::IEmbeddedHelper(),
557  m_aProps(std::make_shared<OReportComponentProperties>(_xContext)),
558  m_pImpl(std::make_shared<OReportDefinitionImpl>(m_aMutex))
559 {
560  m_aProps->m_sName = RptResId(RID_STR_REPORT);
561  m_aProps->m_xFactory = _xFactory;
562  osl_atomic_increment(&m_refCount);
563  {
564  m_aProps->setShape(_xShape,this,m_refCount);
565  init();
566  m_pImpl->m_xGroups = new OGroups(this,m_aProps->m_xContext);
567  m_pImpl->m_xDetail = OSection::createOSection(this,m_aProps->m_xContext);
568  m_pImpl->m_xDetail->setName(RptResId(RID_STR_DETAIL));
569  }
570  osl_atomic_decrement( &m_refCount );
571 }
572 
574 {
575  if ( !ReportDefinitionBase::rBHelper.bInDispose && !ReportDefinitionBase::rBHelper.bDisposed )
576  {
577  acquire();
578  dispose();
579  }
580 }
581 
583 void OReportDefinition::init()
584 {
585  try
586  {
587  m_pImpl->m_pReportModel = std::make_shared<OReportModel>(this);
588  m_pImpl->m_pReportModel->GetItemPool().FreezeIdRanges();
589  m_pImpl->m_pReportModel->SetScaleUnit( MapUnit::Map100thMM );
590  SdrLayerAdmin& rAdmin = m_pImpl->m_pReportModel->GetLayerAdmin();
591  rAdmin.NewLayer("front", sal_uInt8(RPT_LAYER_FRONT));
592  rAdmin.NewLayer("back", sal_uInt8(RPT_LAYER_BACK));
593  rAdmin.NewLayer("HiddenLayer", sal_uInt8(RPT_LAYER_HIDDEN));
594 
595  m_pImpl->m_pUndoManager = new ::dbaui::UndoManager( *this, m_aMutex );
596  m_pImpl->m_pReportModel->SetSdrUndoManager( &m_pImpl->m_pUndoManager->GetSfxUndoManager() );
597 
598  m_pImpl->m_xFunctions = new OFunctions(this,m_aProps->m_xContext);
599  if ( !m_pImpl->m_xStorage.is() )
601 
602  uno::Reference<beans::XPropertySet> xStorProps(m_pImpl->m_xStorage,uno::UNO_QUERY);
603  if ( xStorProps.is())
604  {
605  OUString sMediaType;
606  xStorProps->getPropertyValue("MediaType") >>= sMediaType;
607  if ( sMediaType.isEmpty() )
608  xStorProps->setPropertyValue("MediaType",uno::makeAny<OUString>(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII));
609  }
610  m_pImpl->m_pObjectContainer = std::make_shared<comphelper::EmbeddedObjectContainer>(m_pImpl->m_xStorage , static_cast<cppu::OWeakObject*>(this) );
611  }
612  catch (const uno::Exception&)
613  {
614  DBG_UNHANDLED_EXCEPTION("reportdesign");
615  }
616 }
617 
619 {
621  cppu::WeakComponentImplHelperBase::dispose();
622 }
623 
625 {
626  notifyEvent("OnUnload");
627 
628  uno::Reference< frame::XModel > xHoldAlive( this );
629 
630  lang::EventObject aDisposeEvent( static_cast< ::cppu::OWeakObject* >( this ) );
631  m_pImpl->m_aModifyListeners.disposeAndClear( aDisposeEvent );
632  m_pImpl->m_aCloseListener.disposeAndClear( aDisposeEvent );
633  m_pImpl->m_aLegacyEventListeners.disposeAndClear( aDisposeEvent );
634  m_pImpl->m_aDocEventListeners.disposeAndClear( aDisposeEvent );
635  m_pImpl->m_aStorageChangeListeners.disposeAndClear( aDisposeEvent );
636 
637  // SYNCHRONIZED --->
638  {
639  SolarMutexGuard aSolarGuard;
640  osl::MutexGuard aGuard(m_aMutex);
641 
642  m_pImpl->m_aControllers.clear();
643 
644  ::comphelper::disposeComponent(m_pImpl->m_xGroups);
645  m_pImpl->m_xReportHeader.clear();
646  m_pImpl->m_xReportFooter.clear();
647  m_pImpl->m_xPageHeader.clear();
648  m_pImpl->m_xPageFooter.clear();
649  m_pImpl->m_xDetail.clear();
650  ::comphelper::disposeComponent(m_pImpl->m_xFunctions);
651 
652  //::comphelper::disposeComponent(m_pImpl->m_xStorage);
653  // don't dispose, this currently is the task of either the ref count going to
654  // 0, or of the embedded object (if we're embedded, which is the only possible
655  // case so far)
656  // #i78366#
657  m_pImpl->m_xStorage.clear();
658  m_pImpl->m_xViewData.clear();
659  m_pImpl->m_xCurrentController.clear();
660  m_pImpl->m_xNumberFormatsSupplier.clear();
661  m_pImpl->m_xStyles.clear();
662  m_pImpl->m_xXMLNamespaceMap.clear();
663  m_pImpl->m_xGradientTable.clear();
664  m_pImpl->m_xHatchTable.clear();
665  m_pImpl->m_xBitmapTable.clear();
666  m_pImpl->m_xTransparencyGradientTable.clear();
667  m_pImpl->m_xDashTable.clear();
668  m_pImpl->m_xMarkerTable.clear();
669  m_pImpl->m_xUIConfigurationManager.clear();
670  m_pImpl->m_pReportModel.reset();
671  m_pImpl->m_pObjectContainer.reset();
672  m_pImpl->m_aArgs.realloc(0);
673  m_pImpl->m_xTitleHelper.clear();
674  m_pImpl->m_xNumberedControllers.clear();
675  }
676  // <--- SYNCHRONIZED
677 }
678 
679 
681 {
682  return "com.sun.star.comp.report.OReportDefinition";
683 }
684 
686 {
688 }
689 
691 {
692  uno::Sequence< OUString > aServices { SERVICE_REPORTDEFINITION };
693 
694  return aServices;
695 }
696 
697 uno::Sequence< OUString > SAL_CALL OReportDefinition::getSupportedServiceNames( )
698 {
699  // first collect the services which are supported by our aggregate
700  uno::Sequence< OUString > aSupported;
701  if ( m_aProps->m_xServiceInfo.is() )
702  aSupported = m_aProps->m_xServiceInfo->getSupportedServiceNames();
703 
704  // append our own service, if necessary
705  if ( ::comphelper::findValue( aSupported, SERVICE_REPORTDEFINITION ) == -1 )
706  {
707  sal_Int32 nLen = aSupported.getLength();
708  aSupported.realloc( nLen + 1 );
709  aSupported[ nLen ] = SERVICE_REPORTDEFINITION;
710  }
711 
712  // outta here
713  return aSupported;
714 }
715 
716 sal_Bool SAL_CALL OReportDefinition::supportsService( const OUString& _rServiceName )
717 {
718  return cppu::supportsService(this, _rServiceName);
719 }
720 
721 uno::Any SAL_CALL OReportDefinition::queryInterface( const uno::Type& _rType )
722 {
723  uno::Any aReturn = ReportDefinitionBase::queryInterface(_rType);
724  if ( !aReturn.hasValue() )
726 
727  return aReturn.hasValue() ? aReturn : (m_aProps->m_xProxy.is() ? m_aProps->m_xProxy->queryAggregation(_rType) : aReturn);
728 }
729 uno::Sequence< uno::Type > SAL_CALL OReportDefinition::getTypes( )
730 {
731  if ( m_aProps->m_xTypeProvider.is() )
732  return ::comphelper::concatSequences(
733  ReportDefinitionBase::getTypes(),
734  m_aProps->m_xTypeProvider->getTypes()
735  );
736  return ReportDefinitionBase::getTypes();
737 }
738 
739 uno::Reference< uno::XInterface > OReportDefinition::create(uno::Reference< uno::XComponentContext > const & xContext)
740 {
741  return *(new OReportDefinition(xContext));
742 }
743 
744 // XReportDefinition
745 OUString SAL_CALL OReportDefinition::getCaption()
746 {
747  ::osl::MutexGuard aGuard(m_aMutex);
748  return m_pImpl->m_sCaption;
749 }
750 
751 void SAL_CALL OReportDefinition::setCaption( const OUString& _caption )
752 {
753  set(PROPERTY_CAPTION,_caption,m_pImpl->m_sCaption);
754 }
755 
757 {
758  ::osl::MutexGuard aGuard(m_aMutex);
759  return m_pImpl->m_nGroupKeepTogether;
760 }
761 
762 void SAL_CALL OReportDefinition::setGroupKeepTogether( ::sal_Int16 _groupkeeptogether )
763 {
764  if ( _groupkeeptogether < report::GroupKeepTogether::PER_PAGE || _groupkeeptogether > report::GroupKeepTogether::PER_COLUMN )
765  throwIllegallArgumentException("css::report::GroupKeepTogether"
766  ,*this
767  ,1);
768  set(PROPERTY_GROUPKEEPTOGETHER,_groupkeeptogether,m_pImpl->m_nGroupKeepTogether);
769 }
770 
772 {
773  ::osl::MutexGuard aGuard(m_aMutex);
774  return m_pImpl->m_nPageHeaderOption;
775 }
776 
777 void SAL_CALL OReportDefinition::setPageHeaderOption( ::sal_Int16 _pageheaderoption )
778 {
779  if ( _pageheaderoption < report::ReportPrintOption::ALL_PAGES || _pageheaderoption > report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER )
780  throwIllegallArgumentException("css::report::ReportPrintOption"
781  ,*this
782  ,1);
783  set(PROPERTY_PAGEHEADEROPTION,_pageheaderoption,m_pImpl->m_nPageHeaderOption);
784 }
785 
787 {
788  ::osl::MutexGuard aGuard(m_aMutex);
789  return m_pImpl->m_nPageFooterOption;
790 }
791 
792 void SAL_CALL OReportDefinition::setPageFooterOption( ::sal_Int16 _pagefooteroption )
793 {
794  if ( _pagefooteroption < report::ReportPrintOption::ALL_PAGES || _pagefooteroption > report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER )
795  throwIllegallArgumentException("css::report::ReportPrintOption"
796  ,*this
797  ,1);
798  set(PROPERTY_PAGEFOOTEROPTION,_pagefooteroption,m_pImpl->m_nPageFooterOption);
799 }
800 
801 OUString SAL_CALL OReportDefinition::getCommand()
802 {
803  ::osl::MutexGuard aGuard(m_aMutex);
804  return m_pImpl->m_sCommand;
805 }
806 
807 void SAL_CALL OReportDefinition::setCommand( const OUString& _command )
808 {
809  set(PROPERTY_COMMAND,_command,m_pImpl->m_sCommand);
810 }
811 
812 ::sal_Int32 SAL_CALL OReportDefinition::getCommandType()
813 {
814  ::osl::MutexGuard aGuard(m_aMutex);
815  return m_pImpl->m_nCommandType;
816 }
817 
818 void SAL_CALL OReportDefinition::setCommandType( ::sal_Int32 _commandtype )
819 {
820  if ( _commandtype < sdb::CommandType::TABLE || _commandtype > sdb::CommandType::COMMAND )
821  throwIllegallArgumentException("css::sdb::CommandType"
822  ,*this
823  ,1);
824  set(PROPERTY_COMMANDTYPE,_commandtype,m_pImpl->m_nCommandType);
825 }
826 
827 OUString SAL_CALL OReportDefinition::getFilter()
828 {
829  ::osl::MutexGuard aGuard(m_aMutex);
830  return m_pImpl->m_sFilter;
831 }
832 
833 void SAL_CALL OReportDefinition::setFilter( const OUString& _filter )
834 {
835  set(PROPERTY_FILTER,_filter,m_pImpl->m_sFilter);
836 }
837 
839 {
840  ::osl::MutexGuard aGuard(m_aMutex);
841  return m_pImpl->m_bEscapeProcessing;
842 }
843 
844 void SAL_CALL OReportDefinition::setEscapeProcessing( sal_Bool _escapeprocessing )
845 {
846  set(PROPERTY_ESCAPEPROCESSING,_escapeprocessing,m_pImpl->m_bEscapeProcessing);
847 }
848 
850 {
851  ::osl::MutexGuard aGuard(m_aMutex);
852  return m_pImpl->m_xReportHeader.is();
853 }
854 
855 void SAL_CALL OReportDefinition::setReportHeaderOn( sal_Bool _reportheaderon )
856 {
857  if ( bool(_reportheaderon) != m_pImpl->m_xReportHeader.is() )
858  {
859  setSection(PROPERTY_REPORTHEADERON,_reportheaderon,RptResId(RID_STR_REPORT_HEADER),m_pImpl->m_xReportHeader);
860  }
861 }
862 
864 {
865  ::osl::MutexGuard aGuard(m_aMutex);
866  return m_pImpl->m_xReportFooter.is();
867 }
868 
869 void SAL_CALL OReportDefinition::setReportFooterOn( sal_Bool _reportfooteron )
870 {
871  if ( bool(_reportfooteron) != m_pImpl->m_xReportFooter.is() )
872  {
873  setSection(PROPERTY_REPORTFOOTERON,_reportfooteron,RptResId(RID_STR_REPORT_FOOTER),m_pImpl->m_xReportFooter);
874  }
875 }
876 
878 {
879  ::osl::MutexGuard aGuard(m_aMutex);
880  return m_pImpl->m_xPageHeader.is();
881 }
882 
883 void SAL_CALL OReportDefinition::setPageHeaderOn( sal_Bool _pageheaderon )
884 {
885  if ( bool(_pageheaderon) != m_pImpl->m_xPageHeader.is() )
886  {
887  setSection(PROPERTY_PAGEHEADERON,_pageheaderon,RptResId(RID_STR_PAGE_HEADER),m_pImpl->m_xPageHeader);
888  }
889 }
890 
892 {
893  ::osl::MutexGuard aGuard(m_aMutex);
894  return m_pImpl->m_xPageFooter.is();
895 }
896 
897 void SAL_CALL OReportDefinition::setPageFooterOn( sal_Bool _pagefooteron )
898 {
899  if ( bool(_pagefooteron) != m_pImpl->m_xPageFooter.is() )
900  {
901  setSection(PROPERTY_PAGEFOOTERON,_pagefooteron,RptResId(RID_STR_PAGE_FOOTER),m_pImpl->m_xPageFooter);
902  }
903 }
904 
905 uno::Reference< report::XGroups > SAL_CALL OReportDefinition::getGroups()
906 {
907  ::osl::MutexGuard aGuard(m_aMutex);
908  return m_pImpl->m_xGroups;
909 }
910 
911 uno::Reference< report::XSection > SAL_CALL OReportDefinition::getReportHeader()
912 {
913  ::osl::MutexGuard aGuard(m_aMutex);
914  if ( !m_pImpl->m_xReportHeader.is() )
915  throw container::NoSuchElementException();
916  return m_pImpl->m_xReportHeader;
917 }
918 
919 uno::Reference< report::XSection > SAL_CALL OReportDefinition::getPageHeader()
920 {
921  ::osl::MutexGuard aGuard(m_aMutex);
922  if ( !m_pImpl->m_xPageHeader.is() )
923  throw container::NoSuchElementException();
924  return m_pImpl->m_xPageHeader;
925 }
926 
927 uno::Reference< report::XSection > SAL_CALL OReportDefinition::getDetail()
928 {
929  ::osl::MutexGuard aGuard(m_aMutex);
930  return m_pImpl->m_xDetail;
931 }
932 
933 uno::Reference< report::XSection > SAL_CALL OReportDefinition::getPageFooter()
934 {
935  ::osl::MutexGuard aGuard(m_aMutex);
936  if ( !m_pImpl->m_xPageFooter.is() )
937  throw container::NoSuchElementException();
938  return m_pImpl->m_xPageFooter;
939 }
940 
941 uno::Reference< report::XSection > SAL_CALL OReportDefinition::getReportFooter()
942 {
943  ::osl::MutexGuard aGuard(m_aMutex);
944  if ( !m_pImpl->m_xReportFooter.is() )
945  throw container::NoSuchElementException();
946  return m_pImpl->m_xReportFooter;
947 }
948 
949 uno::Reference< document::XEventBroadcaster > SAL_CALL OReportDefinition::getEventBroadcaster( )
950 {
951  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
952  return this;
953 }
954 
955 // XReportComponent
958 REPORTCOMPONENT_IMPL2(OReportDefinition,*m_aProps)
959 
960 uno::Reference< beans::XPropertySetInfo > SAL_CALL OReportDefinition::getPropertySetInfo( )
961 {
963 }
964 
965 void SAL_CALL OReportDefinition::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue )
966 {
967  ReportDefinitionPropertySet::setPropertyValue( aPropertyName, aValue );
968 }
969 
970 uno::Any SAL_CALL OReportDefinition::getPropertyValue( const OUString& PropertyName )
971 {
972  return ReportDefinitionPropertySet::getPropertyValue( PropertyName);
973 }
974 
975 void SAL_CALL OReportDefinition::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener )
976 {
977  ReportDefinitionPropertySet::addPropertyChangeListener( aPropertyName, xListener );
978 }
979 
980 void SAL_CALL OReportDefinition::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener )
981 {
983 }
984 
985 void SAL_CALL OReportDefinition::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
986 {
988 }
989 
990 void SAL_CALL OReportDefinition::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener )
991 {
993 }
994 
995 // XChild
996 uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::getParent( )
997 {
998  ::osl::MutexGuard aGuard(m_aMutex);
999  uno::Reference< container::XChild > xChild;
1000  comphelper::query_aggregation(m_aProps->m_xProxy,xChild);
1001  if ( xChild.is() )
1002  return xChild->getParent();
1003  return m_pImpl->m_xParent;
1004 }
1005 
1006 void SAL_CALL OReportDefinition::setParent( const uno::Reference< uno::XInterface >& Parent )
1007 {
1008  ::osl::MutexGuard aGuard(m_aMutex);
1009  m_aProps->m_xParent = uno::Reference< container::XChild >(Parent,uno::UNO_QUERY);
1010  m_pImpl->m_xParent = Parent;
1011  uno::Reference< container::XChild > xChild;
1012  comphelper::query_aggregation(m_aProps->m_xProxy,xChild);
1013  if ( xChild.is() )
1014  xChild->setParent(Parent);
1015 }
1016 
1017 // XCloneable
1018 uno::Reference< util::XCloneable > SAL_CALL OReportDefinition::createClone( )
1019 {
1020  OSL_FAIL("Not yet implemented correctly");
1021  uno::Reference< report::XReportComponent> xSource = this;
1022  uno::Reference< report::XReportDefinition> xSet(cloneObject(xSource,m_aProps->m_xFactory,SERVICE_REPORTDEFINITION),uno::UNO_QUERY_THROW);
1023  return xSet;
1024 }
1025 
1026 void OReportDefinition::setSection( const OUString& _sProperty
1027  ,bool _bOn
1028  ,const OUString& _sName
1029  ,uno::Reference< report::XSection>& _member)
1030 {
1031  BoundListeners l;
1032  {
1033  ::osl::MutexGuard aGuard(m_aMutex);
1034  prepareSet(_sProperty, uno::makeAny(_member), uno::makeAny(_bOn), &l);
1035 
1036  // create section if needed
1037  if ( _bOn && !_member.is() )
1038  _member = OSection::createOSection(this, getContext(), _sProperty == PROPERTY_PAGEHEADERON || _sProperty == PROPERTY_PAGEFOOTERON);
1039  else if ( !_bOn )
1040  ::comphelper::disposeComponent(_member);
1041 
1042  if ( _member.is() )
1043  _member->setName(_sName);
1044  }
1045  l.notify();
1046 }
1047 
1048 // XCloseBroadcaster
1049 void SAL_CALL OReportDefinition::addCloseListener( const uno::Reference< util::XCloseListener >& _xListener )
1050 {
1051  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1052  if ( _xListener.is() )
1053  m_pImpl->m_aCloseListener.addInterface(_xListener);
1054 }
1055 
1056 void SAL_CALL OReportDefinition::removeCloseListener( const uno::Reference< util::XCloseListener >& _xListener )
1057 {
1058  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1059  m_pImpl->m_aCloseListener.removeInterface(_xListener);
1060 }
1061 
1062 // XCloseable
1063 void SAL_CALL OReportDefinition::close(sal_Bool bDeliverOwnership)
1064 {
1065  SolarMutexGuard aSolarGuard;
1066 
1067  ::osl::ResettableMutexGuard aGuard(m_aMutex);
1068  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1069  // notify our container listeners
1070  lang::EventObject aEvt( static_cast< ::cppu::OWeakObject* >( this ) );
1071  aGuard.clear();
1072  m_pImpl->m_aCloseListener.forEach<util::XCloseListener>(
1073  [&aEvt, &bDeliverOwnership] (uno::Reference<util::XCloseListener> const& xListener) {
1074  return xListener->queryClosing(aEvt, bDeliverOwnership);
1075  });
1076  aGuard.reset();
1077 
1078 
1079  ::std::vector< uno::Reference< frame::XController> > aCopy = m_pImpl->m_aControllers;
1080  for (auto& rxController : aCopy)
1081  {
1082  if ( rxController.is() )
1083  {
1084  try
1085  {
1086  uno::Reference< util::XCloseable> xFrame( rxController->getFrame(), uno::UNO_QUERY );
1087  if ( xFrame.is() )
1088  xFrame->close( bDeliverOwnership );
1089  }
1090  catch (const util::CloseVetoException&) { throw; }
1091  catch (const uno::Exception&)
1092  {
1093  TOOLS_WARN_EXCEPTION( "reportdesign", "ODatabaseDocument::impl_closeControllerFrames" );
1094  }
1095  }
1096  }
1097 
1098  aGuard.clear();
1099  m_pImpl->m_aCloseListener.notifyEach(&util::XCloseListener::notifyClosing,aEvt);
1100  aGuard.reset();
1101 
1102  dispose();
1103 }
1104 
1105 // XModel
1106 sal_Bool SAL_CALL OReportDefinition::attachResource( const OUString& /*_rURL*/, const uno::Sequence< beans::PropertyValue >& _aArguments )
1107 {
1108  // LLA: we had a deadlock problem in our context, so we get the SolarMutex earlier.
1109  SolarMutexGuard aSolarGuard;
1110 
1111  ::osl::MutexGuard aGuard(m_aMutex);
1112  ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
1113  utl::MediaDescriptor aDescriptor( _aArguments );
1114 
1115  m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( false );
1116  try
1117  {
1118  fillArgs(aDescriptor);
1119  m_pImpl->m_pReportModel->SetModified(false);
1120  }
1121  catch (...)
1122  {
1123  m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true );
1124  throw;
1125  }
1126  m_pImpl->m_pUndoManager->GetSfxUndoManager().EnableUndo( true );
1127  return true;
1128 }
1129 
1131 {
1132  uno::Sequence<beans::PropertyValue> aComponentData;
1133  aComponentData = _aDescriptor.getUnpackedValueOrDefault("ComponentData",aComponentData);
1134  if ( aComponentData.hasElements() && (!m_pImpl->m_xActiveConnection.is() || !m_pImpl->m_xNumberFormatsSupplier.is()) )
1135  {
1136  ::comphelper::SequenceAsHashMap aComponentDataMap( aComponentData );
1137  m_pImpl->m_xActiveConnection = aComponentDataMap.getUnpackedValueOrDefault("ActiveConnection",m_pImpl->m_xActiveConnection);
1138  m_pImpl->m_xNumberFormatsSupplier = dbtools::getNumberFormats(m_pImpl->m_xActiveConnection);
1139  }
1140  if ( !m_pImpl->m_xNumberFormatsSupplier.is() )
1141  {
1142  m_pImpl->m_xNumberFormatsSupplier.set( util::NumberFormatsSupplier::createWithDefaultLocale( m_aProps->m_xContext ) );
1143  }
1144  lcl_stripLoadArguments( _aDescriptor, m_pImpl->m_aArgs );
1145  OUString sCaption;
1146  sCaption = _aDescriptor.getUnpackedValueOrDefault("DocumentTitle",sCaption);
1147  setCaption(sCaption);
1148 }
1149 
1150 OUString SAL_CALL OReportDefinition::getURL( )
1151 {
1152  return OUString();
1153 }
1154 
1155 uno::Sequence< beans::PropertyValue > SAL_CALL OReportDefinition::getArgs( )
1156 {
1157  ::osl::MutexGuard aGuard(m_aMutex);
1158  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1159  return m_pImpl->m_aArgs;
1160 }
1161 
1162 void SAL_CALL OReportDefinition::connectController( const uno::Reference< frame::XController >& _xController )
1163 {
1164  ::osl::MutexGuard aGuard(m_aMutex);
1165  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1166  m_pImpl->m_aControllers.push_back(_xController);
1167  if ( _xController.is() && m_pImpl->m_xViewData.is() )
1168  {
1169  sal_Int32 nCount = m_pImpl->m_xViewData->getCount();
1170  if (nCount)
1171  _xController->restoreViewData(m_pImpl->m_xViewData->getByIndex(nCount - 1));
1172  }
1173 }
1174 
1175 void SAL_CALL OReportDefinition::disconnectController( const uno::Reference< frame::XController >& _xController )
1176 {
1177  ::osl::MutexGuard aGuard(m_aMutex);
1178  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1179  ::std::vector< uno::Reference< frame::XController> >::iterator aFind = ::std::find(m_pImpl->m_aControllers.begin(),m_pImpl->m_aControllers.end(),_xController);
1180  if ( aFind != m_pImpl->m_aControllers.end() )
1181  m_pImpl->m_aControllers.erase(aFind);
1182  if ( m_pImpl->m_xCurrentController == _xController )
1183  m_pImpl->m_xCurrentController.clear();
1184 }
1185 
1187 {
1188  ::osl::MutexGuard aGuard(m_aMutex);
1189  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1190  m_pImpl->m_bControllersLocked = true;
1191 }
1192 
1194 {
1195  ::osl::MutexGuard aGuard(m_aMutex);
1196  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1197  m_pImpl->m_bControllersLocked = false;
1198 }
1199 
1201 {
1202  ::osl::MutexGuard aGuard(m_aMutex);
1203  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1204  return m_pImpl->m_bControllersLocked;
1205 }
1206 
1207 uno::Reference< frame::XController > SAL_CALL OReportDefinition::getCurrentController( )
1208 {
1209  ::osl::MutexGuard aGuard(m_aMutex);
1210  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1211  return m_pImpl->m_xCurrentController;
1212 }
1213 
1214 void SAL_CALL OReportDefinition::setCurrentController( const uno::Reference< frame::XController >& _xController )
1215 {
1216  ::osl::MutexGuard aGuard(m_aMutex);
1217  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1218  if ( ::std::find(m_pImpl->m_aControllers.begin(),m_pImpl->m_aControllers.end(),_xController) == m_pImpl->m_aControllers.end() )
1219  throw container::NoSuchElementException();
1220  m_pImpl->m_xCurrentController = _xController;
1221 }
1222 
1223 uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::getCurrentSelection( )
1224 {
1225  return uno::Reference< uno::XInterface >();
1226 }
1227 
1228 void OReportDefinition::impl_loadFromStorage_nolck_throw( const uno::Reference< embed::XStorage >& _xStorageToLoadFrom,
1229  const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor )
1230 {
1231  m_pImpl->m_xStorage = _xStorageToLoadFrom;
1232 
1233  utl::MediaDescriptor aDescriptor( _aMediaDescriptor );
1234  fillArgs(aDescriptor);
1235  aDescriptor.createItemIfMissing("Storage",uno::makeAny(_xStorageToLoadFrom));
1236 
1237  uno::Sequence< uno::Any > aDelegatorArguments(_aMediaDescriptor.getLength());
1238  uno::Any* pIter = aDelegatorArguments.getArray();
1239  uno::Any* pEnd = pIter + aDelegatorArguments.getLength();
1240  for(sal_Int32 i = 0;pIter != pEnd;++pIter,++i)
1241  {
1242  *pIter <<= _aMediaDescriptor[i];
1243  }
1244  sal_Int32 nPos = aDelegatorArguments.getLength();
1245  aDelegatorArguments.realloc(nPos+1);
1246  beans::PropertyValue aPropVal;
1247  aPropVal.Name = "Storage";
1248  aPropVal.Value <<= _xStorageToLoadFrom;
1249  aDelegatorArguments[nPos] <<= aPropVal;
1250 
1251  rptui::OXUndoEnvironment& rEnv = m_pImpl->m_pReportModel->GetUndoEnv();
1253  {
1254  uno::Reference< document::XFilter > xFilter(
1255  m_aProps->m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext("com.sun.star.comp.report.OReportFilter",aDelegatorArguments,m_aProps->m_xContext),
1256  uno::UNO_QUERY_THROW );
1257 
1258  uno::Reference< document::XImporter> xImporter(xFilter,uno::UNO_QUERY_THROW);
1259  uno::Reference<XComponent> xComponent(static_cast<OWeakObject*>(this),uno::UNO_QUERY);
1260  xImporter->setTargetDocument(xComponent);
1261 
1262  utl::MediaDescriptor aTemp;
1263  aTemp << aDelegatorArguments;
1264  xFilter->filter(aTemp.getAsConstPropertyValueList());
1265 
1266  lcl_setModelReadOnly(m_pImpl->m_xStorage,m_pImpl->m_pReportModel);
1267  m_pImpl->m_pObjectContainer->SwitchPersistence(m_pImpl->m_xStorage);
1268  }
1269 }
1270 
1271 // XStorageBasedDocument
1272 void SAL_CALL OReportDefinition::loadFromStorage( const uno::Reference< embed::XStorage >& _xStorageToLoadFrom
1273  , const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor )
1274 {
1275  ::osl::MutexGuard aGuard(m_aMutex);
1276  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1277 
1278  impl_loadFromStorage_nolck_throw( _xStorageToLoadFrom, _aMediaDescriptor );
1279 }
1280 
1281 void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XStorage >& _xStorageToSaveTo, const uno::Sequence< beans::PropertyValue >& _aMediaDescriptor )
1282 {
1283  if ( !_xStorageToSaveTo.is() )
1284  throw lang::IllegalArgumentException(RptResId(RID_STR_ARGUMENT_IS_NULL),*this,1);
1285 
1286  SolarMutexGuard aSolarGuard;
1287  ::osl::MutexGuard aGuard(m_aMutex);
1288  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1289  // create XStatusIndicator
1290  uno::Reference<task::XStatusIndicator> xStatusIndicator;
1291  uno::Sequence< uno::Any > aDelegatorArguments;
1292  utl::MediaDescriptor aDescriptor( _aMediaDescriptor );
1293  lcl_extractAndStartStatusIndicator( aDescriptor, xStatusIndicator, aDelegatorArguments );
1294 
1295  // properties
1296  uno::Sequence < beans::PropertyValue > aProps;
1297 
1298  // export sub streams for package, else full stream into a file
1299  uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY);
1300  if ( xProp.is() )
1301  {
1302  static constexpr OUStringLiteral sPropName = u"MediaType";
1303  OUString sOldMediaType;
1304  xProp->getPropertyValue(sPropName) >>= sOldMediaType;
1305  if ( !xProp->getPropertyValue(sPropName).hasValue() || sOldMediaType.isEmpty() || MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII != sOldMediaType )
1306  xProp->setPropertyValue( sPropName, uno::makeAny<OUString>(MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII) );
1307  }
1308 
1310  comphelper::PropertyMapEntry const aExportInfoMap[] =
1311  {
1312  { OUString("UsePrettyPrinting") , 0, cppu::UnoType<sal_Bool>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
1313  { OUString("StreamName") , 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
1314  { OUString("StreamRelPath") , 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
1315  { OUString("BaseURI") , 0, cppu::UnoType<OUString>::get(), beans::PropertyAttribute::MAYBEVOID, 0 },
1316  { OUString(), 0, css::uno::Type(), 0, 0 }
1317  };
1318  uno::Reference< beans::XPropertySet > xInfoSet( comphelper::GenericPropertySet_CreateInstance( new comphelper::PropertySetInfo( aExportInfoMap ) ) );
1319 
1320  xInfoSet->setPropertyValue("UsePrettyPrinting", uno::makeAny(officecfg::Office::Common::Save::Document::PrettyPrinting::get()));
1321  if ( officecfg::Office::Common::Save::URL::FileSystem::get() )
1322  {
1323  const OUString sVal( aDescriptor.getUnpackedValueOrDefault(utl::MediaDescriptor::PROP_DOCUMENTBASEURL(),OUString()) );
1324  xInfoSet->setPropertyValue("BaseURI", uno::makeAny(sVal));
1325  }
1326  const OUString sHierarchicalDocumentName( aDescriptor.getUnpackedValueOrDefault("HierarchicalDocumentName",OUString()) );
1327  xInfoSet->setPropertyValue("StreamRelPath", uno::makeAny(sHierarchicalDocumentName));
1328 
1329 
1330  sal_Int32 nArgsLen = aDelegatorArguments.getLength();
1331  aDelegatorArguments.realloc(nArgsLen+1);
1332  aDelegatorArguments[nArgsLen++] <<= xInfoSet;
1333 
1334  uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
1335  uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
1336  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper = SvXMLGraphicHelper::Create(_xStorageToSaveTo,SvXMLGraphicHelperMode::Write);
1337  xGraphicStorageHandler = xGraphicHelper.get();
1338  xGraphicHelper.clear();
1339  xObjectResolver = SvXMLEmbeddedObjectHelper::Create( _xStorageToSaveTo,*this, SvXMLEmbeddedObjectHelperMode::Write ).get();
1340 
1341  aDelegatorArguments.realloc(nArgsLen+2);
1342  aDelegatorArguments[nArgsLen++] <<= xGraphicStorageHandler;
1343  aDelegatorArguments[nArgsLen++] <<= xObjectResolver;
1344 
1345  uno::Reference<XComponent> xCom(static_cast<OWeakObject*>(this),uno::UNO_QUERY);
1346  // Try to write to settings.xml, meta.xml, and styles.xml; only really care about success of
1347  // write to content.xml (keeping logic of commit 94ccba3eebc83b58e74e18f0e028c6a995ce6aa6)
1348  xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("settings.xml")));
1349  WriteThroughComponent(xCom, "settings.xml", "com.sun.star.comp.report.XMLSettingsExporter",
1350  aDelegatorArguments, aProps, _xStorageToSaveTo);
1351 
1352  xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("meta.xml")));
1353  WriteThroughComponent(xCom, "meta.xml", "com.sun.star.comp.report.XMLMetaExporter",
1354  aDelegatorArguments, aProps, _xStorageToSaveTo);
1355 
1356  xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("styles.xml")));
1357  WriteThroughComponent(xCom, "styles.xml", "com.sun.star.comp.report.XMLStylesExporter",
1358  aDelegatorArguments, aProps, _xStorageToSaveTo);
1359 
1360  xInfoSet->setPropertyValue("StreamName", uno::makeAny(OUString("content.xml")));
1361  bool bOk = WriteThroughComponent(xCom, "content.xml", "com.sun.star.comp.report.ExportFilter",
1362  aDelegatorArguments, aProps, _xStorageToSaveTo);
1363 
1364  uno::Any aImage;
1365  uno::Reference< embed::XVisualObject > xCurrentController(getCurrentController(),uno::UNO_QUERY);
1366  if ( xCurrentController.is() )
1367  {
1368  xCurrentController->setVisualAreaSize(m_pImpl->m_nAspect,m_pImpl->m_aVisualAreaSize);
1369  aImage = xCurrentController->getPreferredVisualRepresentation( m_pImpl->m_nAspect ).Data;
1370  }
1371  if ( aImage.hasValue() )
1372  {
1373  uno::Sequence<sal_Int8> aSeq;
1374  aImage >>= aSeq;
1375  uno::Reference<io::XInputStream> xStream = new ::comphelper::SequenceInputStream( aSeq );
1376  m_pImpl->m_pObjectContainer->InsertGraphicStreamDirectly(xStream, "report", "image/png");
1377  }
1378 
1379  if (bOk)
1380  {
1381  bool bPersist = false;
1382  if ( _xStorageToSaveTo == m_pImpl->m_xStorage )
1383  bPersist = m_pImpl->m_pObjectContainer->StoreChildren(true,false);
1384  else
1385  bPersist = m_pImpl->m_pObjectContainer->StoreAsChildren(true,true,_xStorageToSaveTo);
1386 
1387  if( bPersist )
1388  m_pImpl->m_pObjectContainer->SetPersistentEntries(m_pImpl->m_xStorage);
1389  try
1390  {
1391  uno::Reference<embed::XTransactedObject> xTransact(_xStorageToSaveTo,uno::UNO_QUERY);
1392  if ( xTransact.is() )
1393  xTransact->commit();
1394  }
1395  catch (const uno::Exception&)
1396  {
1397  TOOLS_WARN_EXCEPTION( "reportdesign", "Could not commit report storage!");
1398  throw io::IOException();
1399  }
1400 
1401  if ( _xStorageToSaveTo == m_pImpl->m_xStorage )
1402  setModified(false);
1403  }
1404  if ( xStatusIndicator.is() )
1405  xStatusIndicator->end();
1406 }
1407 
1409  const uno::Reference< embed::XStorage >& xStorage)
1410 {
1411  if (!xStorage.is())
1412  throw lang::IllegalArgumentException(RptResId(RID_STR_ARGUMENT_IS_NULL),*this,1);
1413  {
1414  ::osl::MutexGuard aGuard(m_aMutex);
1415  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1416  m_pImpl->m_xStorage = xStorage;
1417  lcl_setModelReadOnly(m_pImpl->m_xStorage,m_pImpl->m_pReportModel);
1418  m_pImpl->m_pObjectContainer->SwitchPersistence(m_pImpl->m_xStorage);
1419  }
1420  // notify our container listeners
1421  m_pImpl->m_aStorageChangeListeners.forEach<document::XStorageChangeListener>(
1422  [this, &xStorage] (uno::Reference<document::XStorageChangeListener> const& xListener) {
1423  return xListener->notifyStorageChange(static_cast<OWeakObject*>(this), xStorage);
1424  });
1425 }
1426 
1427 uno::Reference< embed::XStorage > SAL_CALL OReportDefinition::getDocumentStorage( )
1428 {
1429  ::osl::MutexGuard aGuard(m_aMutex);
1430  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1431  return m_pImpl->m_xStorage;
1432 }
1433 
1434 void SAL_CALL OReportDefinition::addStorageChangeListener( const uno::Reference< document::XStorageChangeListener >& xListener )
1435 {
1436  ::osl::MutexGuard aGuard(m_aMutex);
1437  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1438  if ( xListener.is() )
1439  m_pImpl->m_aStorageChangeListeners.addInterface(xListener);
1440 }
1441 
1442 void SAL_CALL OReportDefinition::removeStorageChangeListener( const uno::Reference< document::XStorageChangeListener >& xListener )
1443 {
1444  ::osl::MutexGuard aGuard(m_aMutex);
1445  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1446  m_pImpl->m_aStorageChangeListeners.removeInterface(xListener);
1447 }
1448 
1450  const uno::Reference<lang::XComponent> & xComponent,
1451  const char* pStreamName,
1452  const char* pServiceName,
1453  const uno::Sequence<uno::Any> & rArguments,
1454  const uno::Sequence<beans::PropertyValue> & rMediaDesc,
1455  const uno::Reference<embed::XStorage>& _xStorageToSaveTo)
1456 {
1457  OSL_ENSURE( nullptr != pStreamName, "Need stream name!" );
1458  OSL_ENSURE( nullptr != pServiceName, "Need service name!" );
1459 
1460  // open stream
1461  OUString sStreamName = OUString::createFromAscii( pStreamName );
1462  uno::Reference<io::XStream> xStream = _xStorageToSaveTo->openStreamElement( sStreamName,embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
1463  if ( !xStream.is() )
1464  return false;
1465  uno::Reference<io::XOutputStream> xOutputStream = xStream->getOutputStream();
1466  OSL_ENSURE(xOutputStream.is(), "Can't create output stream in package!");
1467  if ( ! xOutputStream.is() )
1468  return false;
1469 
1470  uno::Reference<beans::XPropertySet> xStreamProp(xOutputStream,uno::UNO_QUERY);
1471  OSL_ENSURE(xStreamProp.is(),"No valid property set for the output stream!");
1472 
1473  uno::Reference<io::XSeekable> xSeek(xStreamProp,uno::UNO_QUERY);
1474  if ( xSeek.is() )
1475  {
1476  xSeek->seek(0);
1477  }
1478 
1479  xStreamProp->setPropertyValue( "MediaType", uno::Any(OUString("text/xml")) );
1480 
1481  // encrypt all streams
1482  xStreamProp->setPropertyValue( "UseCommonStoragePasswordEncryption",
1483  uno::makeAny( true ) );
1484 
1485  // set buffer and create outputstream
1486 
1487  // write the stuff
1488  bool bRet = WriteThroughComponent(
1489  xOutputStream, xComponent,
1490  pServiceName, rArguments, rMediaDesc );
1491  // finally, commit stream.
1492  return bRet;
1493 }
1494 
1496  const uno::Reference<io::XOutputStream> & xOutputStream,
1497  const uno::Reference<lang::XComponent> & xComponent,
1498  const char* pServiceName,
1499  const uno::Sequence<uno::Any> & rArguments,
1500  const uno::Sequence<beans::PropertyValue> & rMediaDesc)
1501 {
1502  OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
1503  OSL_ENSURE( xComponent.is(), "Need component!" );
1504  OSL_ENSURE( nullptr != pServiceName, "Need component name!" );
1505 
1506  // get component
1507  uno::Reference< xml::sax::XWriter > xSaxWriter(
1508  xml::sax::Writer::create(m_aProps->m_xContext) );
1509 
1510  // connect XML writer to output stream
1511  xSaxWriter->setOutputStream( xOutputStream );
1512 
1513  // prepare arguments (prepend doc handler to given arguments)
1514  uno::Sequence<uno::Any> aArgs( 1 + rArguments.getLength() );
1515  auto pArgs = aArgs.getArray();
1516  *pArgs <<= xSaxWriter;
1517  std::copy(rArguments.begin(), rArguments.end(), std::next(pArgs));
1518 
1519  // get filter component
1520  uno::Reference< document::XExporter > xExporter(
1521  m_aProps->m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
1522  OUString::createFromAscii(pServiceName), aArgs,m_aProps->m_xContext), uno::UNO_QUERY);
1523  OSL_ENSURE( xExporter.is(),
1524  "can't instantiate export filter component" );
1525  if( !xExporter.is() )
1526  return false;
1527 
1528  // connect model and filter
1529  xExporter->setSourceDocument( xComponent );
1530 
1531  // filter!
1532  uno::Reference<document::XFilter> xFilter( xExporter, uno::UNO_QUERY );
1533  return xFilter->filter( rMediaDesc );
1534 }
1535 
1536 // XLoadable
1538 {
1539  setPageHeaderOn( true );
1540  setPageFooterOn( true );
1541 }
1542 
1543 void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue >& _rArguments )
1544 {
1545  ::osl::MutexGuard aGuard(m_aMutex);
1546  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1547 
1548  // TODO: this code is pretty similar to what happens in ODatabaseModelImpl::getOrCreateRootStorage,
1549  // perhaps we can share code here.
1550 
1552 
1553  // the source for the to-be-created storage: either a URL, or a stream
1554  uno::Reference< io::XInputStream > xStream;
1555  OUString sURL;
1556 
1557  if ( aArguments.has( "Stream" ) )
1558  {
1559  aArguments.get_ensureType( "Stream", xStream );
1560  aArguments.remove( "Stream" );
1561  }
1562  else if ( aArguments.has( "InputStream" ) )
1563  {
1564  aArguments.get_ensureType( "InputStream", xStream );
1565  aArguments.remove( "InputStream" );
1566  }
1567 
1568  if ( aArguments.has( "FileName" ) )
1569  {
1570  aArguments.get_ensureType( "FileName", sURL );
1571  aArguments.remove( "FileName" );
1572  }
1573  else if ( aArguments.has( "URL" ) )
1574  {
1575  aArguments.get_ensureType( "URL", sURL );
1576  aArguments.remove( "URL" );
1577  }
1578 
1579  uno::Any aStorageSource;
1580  if ( xStream.is() )
1581  aStorageSource <<= xStream;
1582  else if ( !sURL.isEmpty() )
1583  aStorageSource <<= sURL;
1584  else
1585  throw lang::IllegalArgumentException(
1586  "No input source (URL or InputStream) found.",
1587  // TODO: resource
1588  *this,
1589  1
1590  );
1591 
1592  uno::Reference< lang::XSingleServiceFactory > xStorageFactory( embed::StorageFactory::create( m_aProps->m_xContext ) );
1593 
1594  // open read-write per default, unless told otherwise in the MediaDescriptor
1595  uno::Reference< embed::XStorage > xDocumentStorage;
1596  const sal_Int32 nOpenModes[2] = {
1597  embed::ElementModes::READWRITE,
1598  embed::ElementModes::READ
1599  };
1600  size_t nFirstOpenMode = 0;
1601  if ( aArguments.has( "ReadOnly" ) )
1602  {
1603  bool bReadOnly = false;
1604  aArguments.get_ensureType( "ReadOnly", bReadOnly );
1605  nFirstOpenMode = bReadOnly ? 1 : 0;
1606  }
1607  const size_t nLastOpenMode = SAL_N_ELEMENTS( nOpenModes ) - 1;
1608  for ( size_t i=nFirstOpenMode; i <= nLastOpenMode; ++i )
1609  {
1610  uno::Sequence< uno::Any > aStorageCreationArgs(2);
1611  aStorageCreationArgs[0] = aStorageSource;
1612  aStorageCreationArgs[1] <<= nOpenModes[i];
1613 
1614  try
1615  {
1616  xDocumentStorage.set( xStorageFactory->createInstanceWithArguments( aStorageCreationArgs ), uno::UNO_QUERY_THROW );
1617  }
1618  catch (const uno::Exception&)
1619  {
1620  if ( i == nLastOpenMode )
1621  {
1622  css::uno::Any anyEx = cppu::getCaughtException();
1623  throw lang::WrappedTargetException(
1624  "An error occurred while creating the document storage.",
1625  // TODO: resource
1626  *this,
1627  anyEx
1628  );
1629  }
1630  }
1631  }
1632 
1633  if ( !xDocumentStorage.is() )
1634  {
1635  throw uno::RuntimeException();
1636  }
1637 
1638  if (!aArguments.has("DocumentBaseURL") && !sURL.isEmpty())
1639  {
1640  aArguments.put("DocumentBaseURL", sURL);
1641  }
1642 
1643  impl_loadFromStorage_nolck_throw( xDocumentStorage, aArguments.getPropertyValues() );
1644  // TODO: do we need to take ownership of the storage? In opposite to loadFromStorage, we created the storage
1645  // ourself here, and perhaps this means we're also responsible for it ...?
1646 }
1647 
1648 // XVisualObject
1649 void SAL_CALL OReportDefinition::setVisualAreaSize( ::sal_Int64 _nAspect, const awt::Size& _aSize )
1650 {
1651  ::osl::MutexGuard aGuard(m_aMutex);
1652  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1653  bool bChanged =
1654  (m_pImpl->m_aVisualAreaSize.Width != _aSize.Width ||
1655  m_pImpl->m_aVisualAreaSize.Height != _aSize.Height);
1656  m_pImpl->m_aVisualAreaSize = _aSize;
1657  if( bChanged )
1658  setModified( true );
1659  m_pImpl->m_nAspect = _nAspect;
1660 }
1661 
1662 awt::Size SAL_CALL OReportDefinition::getVisualAreaSize( ::sal_Int64 /*_nAspect*/ )
1663 {
1664  ::osl::MutexGuard aGuard(m_aMutex);
1665  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1666  return m_pImpl->m_aVisualAreaSize;
1667 }
1668 
1669 embed::VisualRepresentation SAL_CALL OReportDefinition::getPreferredVisualRepresentation( ::sal_Int64 /*_nAspect*/ )
1670 {
1671  ::osl::MutexGuard aGuard(m_aMutex);
1672  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1673  embed::VisualRepresentation aResult;
1674  OUString sMimeType;
1675  uno::Reference<io::XInputStream> xStream = m_pImpl->m_pObjectContainer->GetGraphicStream("report", &sMimeType);
1676  if ( xStream.is() )
1677  {
1678  uno::Sequence<sal_Int8> aSeq;
1679  xStream->readBytes(aSeq,xStream->available());
1680  xStream->closeInput();
1681  aResult.Data <<= aSeq;
1682  aResult.Flavor.MimeType = sMimeType;
1683  aResult.Flavor.DataType = cppu::UnoType<decltype(aSeq)>::get();
1684  }
1685 
1686  return aResult;
1687 }
1688 
1689 ::sal_Int32 SAL_CALL OReportDefinition::getMapUnit( ::sal_Int64 /*nAspect*/ )
1690 {
1691  return embed::EmbedMapUnits::ONE_100TH_MM;
1692 }
1693 
1694 // XModifiable
1696 {
1697  ::osl::MutexGuard aGuard( m_aMutex );
1698  ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
1699 
1700  const bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
1701  m_pImpl->m_bSetModifiedEnabled = false;
1702  return bWasEnabled;
1703 }
1704 
1706 {
1707  ::osl::MutexGuard aGuard( m_aMutex );
1708  ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
1709 
1710  const bool bWasEnabled = m_pImpl->m_bSetModifiedEnabled;
1711  m_pImpl->m_bSetModifiedEnabled = true;
1712  return bWasEnabled;
1713 }
1714 
1716 {
1717  ::osl::MutexGuard aGuard( m_aMutex );
1718  ::connectivity::checkDisposed( ReportDefinitionBase::rBHelper.bDisposed );
1719 
1720  return m_pImpl->m_bSetModifiedEnabled;
1721 }
1722 
1723 // XModifiable
1725 {
1726  ::osl::MutexGuard aGuard(m_aMutex);
1727  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1728  return m_pImpl->m_bModified;
1729 }
1730 
1731 void SAL_CALL OReportDefinition::setModified( sal_Bool _bModified )
1732 {
1733  osl::ClearableMutexGuard aGuard(m_aMutex);
1734  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1735 
1736  if ( !m_pImpl->m_bSetModifiedEnabled )
1737  return;
1738 
1739  if ( m_pImpl->m_pReportModel->IsReadOnly() && _bModified )
1740  throw beans::PropertyVetoException();
1741  if ( m_pImpl->m_bModified != bool(_bModified) )
1742  {
1743  m_pImpl->m_bModified = _bModified;
1744  if ( m_pImpl->m_pReportModel->IsChanged() != bool(_bModified) )
1745  m_pImpl->m_pReportModel->SetChanged(_bModified);
1746 
1747  lang::EventObject aEvent(*this);
1748  aGuard.clear();
1749  m_pImpl->m_aModifyListeners.notifyEach(&util::XModifyListener::modified,aEvent);
1750  notifyEvent("OnModifyChanged");
1751  }
1752 }
1753 
1754 // XModifyBroadcaster
1755 void SAL_CALL OReportDefinition::addModifyListener( const uno::Reference< util::XModifyListener >& _xListener )
1756 {
1757  ::osl::MutexGuard aGuard(m_aMutex);
1758  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1759  if ( _xListener.is() )
1760  m_pImpl->m_aModifyListeners.addInterface(_xListener);
1761 }
1762 
1763 void SAL_CALL OReportDefinition::removeModifyListener( const uno::Reference< util::XModifyListener >& _xListener )
1764 {
1765  ::osl::MutexGuard aGuard(m_aMutex);
1766  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1767  m_pImpl->m_aModifyListeners.removeInterface(_xListener);
1768 }
1769 
1770 void OReportDefinition::notifyEvent(const OUString& _sEventName)
1771 {
1772  try
1773  {
1774  osl::ClearableMutexGuard aGuard(m_aMutex);
1775  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1776  document::EventObject aEvt(*this, _sEventName);
1777  aGuard.clear();
1778  m_pImpl->m_aLegacyEventListeners.notifyEach(&document::XEventListener::notifyEvent,aEvt);
1779  }
1780  catch (const uno::Exception&)
1781  {
1782  }
1783 
1784  notifyDocumentEvent(_sEventName, nullptr, css::uno::Any());
1785 }
1786 
1787 // document::XDocumentEventBroadcaster
1788 void SAL_CALL OReportDefinition::notifyDocumentEvent( const OUString& rEventName, const uno::Reference< frame::XController2 >& rViewController, const uno::Any& rSupplement )
1789 {
1790  try
1791  {
1792  osl::ClearableMutexGuard aGuard(m_aMutex);
1793  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1794  document::DocumentEvent aEvt(*this, rEventName, rViewController, rSupplement);
1795  aGuard.clear();
1796  m_pImpl->m_aDocEventListeners.notifyEach(&document::XDocumentEventListener::documentEventOccured,aEvt);
1797  }
1798  catch (const uno::Exception&)
1799  {
1800  }
1801 }
1802 
1803 void SAL_CALL OReportDefinition::addDocumentEventListener( const uno::Reference< document::XDocumentEventListener >& rListener )
1804 {
1805  ::osl::MutexGuard aGuard(m_aMutex);
1806  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1807  if ( rListener.is() )
1808  m_pImpl->m_aDocEventListeners.addInterface(rListener);
1809 }
1810 
1811 void SAL_CALL OReportDefinition::removeDocumentEventListener( const uno::Reference< document::XDocumentEventListener >& rListener )
1812 {
1813  ::osl::MutexGuard aGuard(m_aMutex);
1814  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1815  m_pImpl->m_aDocEventListeners.removeInterface(rListener);
1816 }
1817 
1818 // document::XEventBroadcaster
1819 void SAL_CALL OReportDefinition::addEventListener(const uno::Reference< document::XEventListener >& _xListener )
1820 {
1821  ::osl::MutexGuard aGuard(m_aMutex);
1822  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1823  if ( _xListener.is() )
1824  m_pImpl->m_aLegacyEventListeners.addInterface(_xListener);
1825 }
1826 
1827 void SAL_CALL OReportDefinition::removeEventListener( const uno::Reference< document::XEventListener >& _xListener )
1828 {
1829  ::osl::MutexGuard aGuard(m_aMutex);
1830  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1831  m_pImpl->m_aLegacyEventListeners.removeInterface(_xListener);
1832 }
1833 
1834 // document::XViewDataSupplier
1835 uno::Reference< container::XIndexAccess > SAL_CALL OReportDefinition::getViewData( )
1836 {
1837  ::osl::MutexGuard aGuard(m_aMutex);
1838  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1839  if ( !m_pImpl->m_xViewData.is() )
1840  {
1841  m_pImpl->m_xViewData = document::IndexedPropertyValues::create(m_aProps->m_xContext);
1842  uno::Reference< container::XIndexContainer > xContainer(m_pImpl->m_xViewData,uno::UNO_QUERY);
1843  for (const auto& rxController : m_pImpl->m_aControllers)
1844  {
1845  if ( rxController.is() )
1846  {
1847  try
1848  {
1849  xContainer->insertByIndex(xContainer->getCount(), rxController->getViewData());
1850  }
1851  catch (const uno::Exception&)
1852  {
1853  }
1854  }
1855  }
1856 
1857  }
1858  return m_pImpl->m_xViewData;
1859 }
1860 
1861 void SAL_CALL OReportDefinition::setViewData( const uno::Reference< container::XIndexAccess >& Data )
1862 {
1863  ::osl::MutexGuard aGuard(m_aMutex);
1864  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1865  m_pImpl->m_xViewData = Data;
1866 }
1867 
1868 uno::Reference< report::XFunctions > SAL_CALL OReportDefinition::getFunctions()
1869 {
1870  ::osl::MutexGuard aGuard(m_aMutex);
1871  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1872  return m_pImpl->m_xFunctions;
1873 }
1874 
1875 uno::Reference< ui::XUIConfigurationManager > SAL_CALL OReportDefinition::getUIConfigurationManager( )
1876 {
1877  return uno::Reference< ui::XUIConfigurationManager >( getUIConfigurationManager2(), uno::UNO_QUERY_THROW );
1878 }
1879 
1880 uno::Reference< ui::XUIConfigurationManager2 > OReportDefinition::getUIConfigurationManager2( )
1881 {
1882  ::osl::MutexGuard aGuard(m_aMutex);
1883  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1884 
1885  if ( !m_pImpl->m_xUIConfigurationManager.is() )
1886  {
1887  m_pImpl->m_xUIConfigurationManager = ui::UIConfigurationManager::create(m_aProps->m_xContext);
1888 
1889  uno::Reference< embed::XStorage > xConfigStorage;
1890  // initialize ui configuration manager with document substorage
1891  m_pImpl->m_xUIConfigurationManager->setStorage( xConfigStorage );
1892  }
1893 
1894  return m_pImpl->m_xUIConfigurationManager;
1895 }
1896 
1897 uno::Reference< embed::XStorage > SAL_CALL OReportDefinition::getDocumentSubStorage( const OUString& aStorageName, sal_Int32 nMode )
1898 {
1899  ::osl::MutexGuard aGuard(m_aMutex);
1900  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1901  return m_pImpl->m_xStorage->openStorageElement(aStorageName, nMode);
1902 }
1903 
1904 uno::Sequence< OUString > SAL_CALL OReportDefinition::getDocumentSubStoragesNames( )
1905 {
1906  ::osl::MutexGuard aGuard(m_aMutex);
1907  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1908  uno::Reference<container::XNameAccess> xNameAccess = m_pImpl->m_xStorage;
1909  return xNameAccess.is() ? xNameAccess->getElementNames() : uno::Sequence< OUString >();
1910 }
1911 
1913 {
1914  ::osl::MutexGuard aGuard(m_aMutex);
1915  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1916  return m_pImpl->m_sMimeType;
1917 }
1918 
1919 void SAL_CALL OReportDefinition::setMimeType( const OUString& _mimetype )
1920 {
1921  ::osl::MutexGuard aGuard(m_aMutex);
1922  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1923  const uno::Sequence< OUString > aList = getAvailableMimeTypes();
1924  if ( ::std::find(aList.begin(), aList.end(), _mimetype) == aList.end() )
1925  throwIllegallArgumentException("getAvailableMimeTypes()"
1926  ,*this
1927  ,1);
1928  set(PROPERTY_MIMETYPE,_mimetype,m_pImpl->m_sMimeType);
1929 }
1930 
1931 uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableMimeTypes( )
1932 {
1934 }
1935 
1936 // css::XUnoTunnel
1937 sal_Int64 SAL_CALL OReportDefinition::getSomething( const uno::Sequence< sal_Int8 >& rId )
1938 {
1939  sal_Int64 nRet = 0;
1940  if (comphelper::isUnoTunnelId<OReportDefinition>(rId) )
1941  nRet = comphelper::getSomething_cast(this);
1942  else
1943  {
1944  uno::Reference< lang::XUnoTunnel> xUnoTunnel(m_pImpl->m_xNumberFormatsSupplier,uno::UNO_QUERY);
1945  if ( xUnoTunnel.is() )
1946  nRet = xUnoTunnel->getSomething(rId);
1947  }
1948  if ( !nRet )
1949  {
1950  uno::Reference< lang::XUnoTunnel> xTunnel;
1951  ::comphelper::query_aggregation(m_aProps->m_xProxy,xTunnel);
1952  if ( xTunnel.is() )
1953  nRet = xTunnel->getSomething(rId);
1954  }
1955 
1956  return nRet;
1957 }
1958 
1959 uno::Sequence< sal_Int8 > SAL_CALL OReportDefinition::getImplementationId( )
1960 {
1961  return css::uno::Sequence<sal_Int8>();
1962 }
1963 
1964 uno::Sequence< sal_Int8 > OReportDefinition::getUnoTunnelId()
1965 {
1966  static const comphelper::UnoIdInit implId;
1967  return implId.getSeq();
1968 }
1969 
1970 uno::Reference< uno::XComponentContext > OReportDefinition::getContext()
1971 {
1972  ::osl::MutexGuard aGuard(m_aMutex);
1973  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1974  return m_aProps->m_xContext;
1975 }
1976 
1977 std::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel(const uno::Reference< report::XReportDefinition >& _xReportDefinition)
1978 {
1979  std::shared_ptr<rptui::OReportModel> pReportModel;
1980  auto pReportDefinition = comphelper::getFromUnoTunnel<OReportDefinition>(_xReportDefinition);
1981  if (pReportDefinition)
1982  pReportModel = pReportDefinition->m_pImpl->m_pReportModel;
1983  return pReportModel;
1984 }
1985 
1987 {
1988  OSL_ENSURE(m_pImpl->m_pReportModel, "No SdrModel in ReportDesign, should not happen");
1989  return *m_pImpl->m_pReportModel;
1990 }
1991 
1992 uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstanceWithArguments( const OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& _aArgs)
1993 {
1994  ::osl::MutexGuard aGuard(m_aMutex);
1995  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
1996 
1997  uno::Reference< uno::XInterface > xRet;
1998  if ( aServiceSpecifier.startsWith( "com.sun.star.document.ImportEmbeddedObjectResolver") )
1999  {
2000  uno::Reference< embed::XStorage > xStorage;
2001  for(const uno::Any& rArg : _aArgs)
2002  {
2003  beans::NamedValue aValue;
2004  rArg >>= aValue;
2005  if ( aValue.Name == "Storage" )
2006  aValue.Value >>= xStorage;
2007  }
2008  m_pImpl->m_pObjectContainer->SwitchPersistence(xStorage);
2009  xRet = static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( xStorage,*this, SvXMLEmbeddedObjectHelperMode::Read ).get());
2010  }
2011  return xRet;
2012 }
2013 
2014 uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstance( const OUString& aServiceSpecifier )
2015 {
2016  ::osl::MutexGuard aGuard(m_aMutex);
2017  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2018  uno::Reference< drawing::XShape > xShape;
2019  if ( aServiceSpecifier.startsWith( "com.sun.star.report." ) )
2020  {
2021  if ( aServiceSpecifier == SERVICE_SHAPE )
2022  xShape.set(SvxUnoDrawMSFactory::createInstance("com.sun.star.drawing.CustomShape"),uno::UNO_QUERY_THROW);
2023  else if ( aServiceSpecifier == SERVICE_FORMATTEDFIELD
2024  || aServiceSpecifier == SERVICE_FIXEDTEXT
2025  || aServiceSpecifier == SERVICE_FIXEDLINE
2026  || aServiceSpecifier == SERVICE_IMAGECONTROL )
2027  xShape.set(SvxUnoDrawMSFactory::createInstance("com.sun.star.drawing.ControlShape"),uno::UNO_QUERY_THROW);
2028  else
2029  xShape.set(SvxUnoDrawMSFactory::createInstance("com.sun.star.drawing.OLE2Shape"),uno::UNO_QUERY_THROW);
2030  }
2031  else if ( aServiceSpecifier.startsWith( "com.sun.star.form.component." ) )
2032  {
2033  xShape.set(m_aProps->m_xContext->getServiceManager()->createInstanceWithContext(aServiceSpecifier,m_aProps->m_xContext),uno::UNO_QUERY);
2034  }
2035  else if ( aServiceSpecifier == "com.sun.star.style.PageStyle" ||
2036  aServiceSpecifier == "com.sun.star.style.FrameStyle" ||
2037  aServiceSpecifier == "com.sun.star.style.GraphicStyle"
2038  )
2039  {
2040  uno::Reference< style::XStyle> xStyle = new OStyle();
2041  xStyle->setName("Default");
2042  return xStyle;
2043  }
2044  else if ( aServiceSpecifier == "com.sun.star.document.Settings" )
2045  {
2046  uno::Reference<beans::XPropertySet> xProp = new OStyle();
2047 
2048  return xProp;
2049  }
2050  else if ( aServiceSpecifier == "com.sun.star.drawing.Defaults" )
2051  {
2052  uno::Reference<beans::XPropertySet> xProp = new OStyle();
2053  return xProp;
2054  }
2055  else if ( aServiceSpecifier == "com.sun.star.drawing.GradientTable" )
2056  {
2057  if ( !m_pImpl->m_xGradientTable.is() )
2058  m_pImpl->m_xGradientTable.set(SvxUnoGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
2059  return m_pImpl->m_xGradientTable;
2060  }
2061  else if ( aServiceSpecifier == "com.sun.star.drawing.HatchTable" )
2062  {
2063  if ( !m_pImpl->m_xHatchTable.is() )
2064  m_pImpl->m_xHatchTable.set(SvxUnoHatchTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
2065  return m_pImpl->m_xHatchTable;
2066  }
2067  else if ( aServiceSpecifier == "com.sun.star.drawing.BitmapTable" )
2068  {
2069  if ( !m_pImpl->m_xBitmapTable.is() )
2070  m_pImpl->m_xBitmapTable.set(SvxUnoBitmapTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
2071  return m_pImpl->m_xBitmapTable;
2072  }
2073  else if ( aServiceSpecifier == "com.sun.star.drawing.TransparencyGradientTable" )
2074  {
2075  if ( !m_pImpl->m_xTransparencyGradientTable.is() )
2076  m_pImpl->m_xTransparencyGradientTable.set(SvxUnoTransGradientTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
2077  return m_pImpl->m_xTransparencyGradientTable;
2078  }
2079  else if ( aServiceSpecifier == "com.sun.star.drawing.DashTable" )
2080  {
2081  if ( !m_pImpl->m_xDashTable.is() )
2082  m_pImpl->m_xDashTable.set(SvxUnoDashTable_createInstance(m_pImpl->m_pReportModel.get()),uno::UNO_QUERY);
2083  return m_pImpl->m_xDashTable;
2084  }
2085  else if( aServiceSpecifier == "com.sun.star.drawing.MarkerTable" )
2086  {
2087  if( !m_pImpl->m_xMarkerTable.is() )
2088  m_pImpl->m_xMarkerTable.set(SvxUnoMarkerTable_createInstance( m_pImpl->m_pReportModel.get() ),uno::UNO_QUERY);
2089  return m_pImpl->m_xMarkerTable;
2090  }
2091  else if ( aServiceSpecifier == "com.sun.star.document.ImportEmbeddedObjectResolver" )
2092  return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, SvXMLEmbeddedObjectHelperMode::Read ).get());
2093  else if ( aServiceSpecifier == "com.sun.star.document.ExportEmbeddedObjectResolver" )
2094  return static_cast< ::cppu::OWeakObject* >(SvXMLEmbeddedObjectHelper::Create( m_pImpl->m_xStorage,*this, SvXMLEmbeddedObjectHelperMode::Write ).get());
2095  else if (aServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler")
2096  {
2097  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,SvXMLGraphicHelperMode::Write);
2098  uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(xGraphicHelper.get()));
2099  return xRet;
2100  }
2101  else if (aServiceSpecifier == "com.sun.star.document.ExportGraphicStorageHandler")
2102  {
2103  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper = SvXMLGraphicHelper::Create(m_pImpl->m_xStorage,SvXMLGraphicHelperMode::Write);
2104  uno::Reference< uno::XInterface> xRet(static_cast< ::cppu::OWeakObject* >(xGraphicHelper.get()));
2105  return xRet;
2106  }
2107  else if ( aServiceSpecifier == "com.sun.star.chart2.data.DataProvider" )
2108  {
2109  uno::Reference<chart2::data::XDatabaseDataProvider> xDataProvider(chart2::data::DatabaseDataProvider::createWithConnection( m_aProps->m_xContext, m_pImpl->m_xActiveConnection ));
2110  xDataProvider->setRowLimit(10);
2111  uno::Reference< container::XChild > xChild(xDataProvider,uno::UNO_QUERY);
2112  if ( xChild.is() )
2113  xChild->setParent(*this);
2114  return uno::Reference< uno::XInterface >(xDataProvider,uno::UNO_QUERY);
2115  }
2116  else if ( aServiceSpecifier == "com.sun.star.xml.NamespaceMap" )
2117  {
2118  if ( !m_pImpl->m_xXMLNamespaceMap.is() )
2120  return m_pImpl->m_xXMLNamespaceMap;
2121  }
2122  else
2123  xShape.set(SvxUnoDrawMSFactory::createInstance( aServiceSpecifier ),uno::UNO_QUERY_THROW);
2124 
2125  return m_pImpl->m_pReportModel->createShape(aServiceSpecifier,xShape);
2126 }
2127 
2128 uno::Sequence< OUString > SAL_CALL OReportDefinition::getAvailableServiceNames()
2129 {
2130  static const std::u16string_view aSvxComponentServiceNameList[] =
2131  {
2132  u"com.sun.star.form.component.FixedText",
2133  u"com.sun.star.form.component.DatabaseImageControl",
2134  u"com.sun.star.style.PageStyle",
2135  u"com.sun.star.style.GraphicStyle",
2136  u"com.sun.star.style.FrameStyle",
2137  u"com.sun.star.drawing.Defaults",
2138  u"com.sun.star.document.ImportEmbeddedObjectResolver",
2139  u"com.sun.star.document.ExportEmbeddedObjectResolver",
2140  u"com.sun.star.document.ImportGraphicStorageHandler",
2141  u"com.sun.star.document.ExportGraphicStorageHandler",
2142  u"com.sun.star.chart2.data.DataProvider",
2143  u"com.sun.star.xml.NamespaceMap",
2144  u"com.sun.star.document.Settings",
2145  u"com.sun.star.drawing.GradientTable",
2146  u"com.sun.star.drawing.HatchTable",
2147  u"com.sun.star.drawing.BitmapTable",
2148  u"com.sun.star.drawing.TransparencyGradientTable",
2149  u"com.sun.star.drawing.DashTable",
2150  u"com.sun.star.drawing.MarkerTable"
2151  };
2152 
2153  static const sal_uInt16 nSvxComponentServiceNameListCount = SAL_N_ELEMENTS(aSvxComponentServiceNameList);
2154 
2155  uno::Sequence< OUString > aSeq( nSvxComponentServiceNameListCount );
2156  OUString* pStrings = aSeq.getArray();
2157  for( sal_uInt16 nIdx = 0; nIdx < nSvxComponentServiceNameListCount; nIdx++ )
2158  pStrings[nIdx] = aSvxComponentServiceNameList[nIdx];
2159 
2160  uno::Sequence< OUString > aParentSeq( SvxUnoDrawMSFactory::getAvailableServiceNames() );
2161  return comphelper::concatSequences( aParentSeq, aSeq );
2162 }
2163 
2164 // XShape
2165 awt::Point SAL_CALL OReportDefinition::getPosition( )
2166 {
2167  ::osl::MutexGuard aGuard(m_aMutex);
2168  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2169  if ( m_aProps->m_xShape.is() )
2170  return m_aProps->m_xShape->getPosition();
2171  return awt::Point(m_aProps->m_nPosX,m_aProps->m_nPosY);
2172 }
2173 
2174 void SAL_CALL OReportDefinition::setPosition( const awt::Point& aPosition )
2175 {
2176  ::osl::MutexGuard aGuard(m_aMutex);
2177  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2178  if ( m_aProps->m_xShape.is() )
2179  m_aProps->m_xShape->setPosition(aPosition);
2180  set(PROPERTY_POSITIONX,aPosition.X,m_aProps->m_nPosX);
2181  set(PROPERTY_POSITIONY,aPosition.Y,m_aProps->m_nPosY);
2182 }
2183 
2184 awt::Size SAL_CALL OReportDefinition::getSize( )
2185 {
2186  ::osl::MutexGuard aGuard(m_aMutex);
2187  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2188  if ( m_aProps->m_xShape.is() )
2189  return m_aProps->m_xShape->getSize();
2190  return awt::Size(m_aProps->m_nWidth,m_aProps->m_nHeight);
2191 }
2192 
2193 void SAL_CALL OReportDefinition::setSize( const awt::Size& aSize )
2194 {
2195  ::osl::MutexGuard aGuard(m_aMutex);
2196  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2197  if ( m_aProps->m_xShape.is() )
2198  m_aProps->m_xShape->setSize(aSize);
2199  set(PROPERTY_WIDTH,aSize.Width,m_aProps->m_nWidth);
2200  set(PROPERTY_HEIGHT,aSize.Height,m_aProps->m_nHeight);
2201 }
2202 
2203 
2204 // XShapeDescriptor
2206 {
2207  ::osl::MutexGuard aGuard(m_aMutex);
2208  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2209  if ( m_aProps->m_xShape.is() )
2210  return m_aProps->m_xShape->getShapeType();
2211  return "com.sun.star.drawing.OLE2Shape";
2212 }
2213 
2214 typedef ::cppu::WeakImplHelper< container::XNameContainer,
2215  container::XIndexAccess
2217 
2218 namespace {
2219 
2220 class OStylesHelper:
2221  public cppu::BaseMutex, public TStylesBASE
2222 {
2223  typedef ::std::map< OUString, uno::Any , ::comphelper::UStringMixLess> TStyleElements;
2224  TStyleElements m_aElements;
2225  ::std::vector<TStyleElements::iterator> m_aElementsPos;
2227 
2228 protected:
2229  virtual ~OStylesHelper() override {}
2230 public:
2231  explicit OStylesHelper(const uno::Type& rType = cppu::UnoType<container::XElementAccess>::get());
2232  OStylesHelper(const OStylesHelper&) = delete;
2233  OStylesHelper& operator=(const OStylesHelper&) = delete;
2234 
2235  // XNameContainer
2236  virtual void SAL_CALL insertByName( const OUString& aName, const uno::Any& aElement ) override;
2237  virtual void SAL_CALL removeByName( const OUString& Name ) override;
2238 
2239  // XNameReplace
2240  virtual void SAL_CALL replaceByName( const OUString& aName, const uno::Any& aElement ) override;
2241 
2242  // container::XElementAccess
2243  virtual uno::Type SAL_CALL getElementType( ) override;
2244  virtual sal_Bool SAL_CALL hasElements( ) override;
2245  // container::XIndexAccess
2246  virtual sal_Int32 SAL_CALL getCount( ) override;
2247  virtual uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
2248 
2249  // container::XNameAccess
2250  virtual uno::Any SAL_CALL getByName( const OUString& aName ) override;
2251  virtual uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
2252  virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
2253 };
2254 
2255 }
2256 
2257 OStylesHelper::OStylesHelper(const uno::Type& rType)
2258  : cppu::BaseMutex()
2259  , m_aType(rType)
2260 {
2261 }
2262 ;
2263 
2264 // container::XElementAccess
2265 uno::Type SAL_CALL OStylesHelper::getElementType( )
2266 {
2267  return m_aType;
2268 }
2269 
2270 sal_Bool SAL_CALL OStylesHelper::hasElements( )
2271 {
2272  ::osl::MutexGuard aGuard(m_aMutex);
2273  return !m_aElementsPos.empty();
2274 }
2275 
2276 // container::XIndexAccess
2277 sal_Int32 SAL_CALL OStylesHelper::getCount( )
2278 {
2279  ::osl::MutexGuard aGuard(m_aMutex);
2280  return m_aElementsPos.size();
2281 }
2282 
2283 uno::Any SAL_CALL OStylesHelper::getByIndex( sal_Int32 Index )
2284 {
2285  ::osl::MutexGuard aGuard(m_aMutex);
2286  if ( Index < 0 || Index >= static_cast<sal_Int32>(m_aElementsPos.size()) )
2287  throw lang::IndexOutOfBoundsException();
2288  return m_aElementsPos[Index]->second;
2289 }
2290 
2291 // container::XNameAccess
2292 uno::Any SAL_CALL OStylesHelper::getByName( const OUString& aName )
2293 {
2294  ::osl::MutexGuard aGuard(m_aMutex);
2295  TStyleElements::const_iterator aFind = m_aElements.find(aName);
2296  if ( aFind == m_aElements.end() )
2297  throw container::NoSuchElementException();
2298  return aFind->second;
2299 }
2300 
2301 uno::Sequence< OUString > SAL_CALL OStylesHelper::getElementNames( )
2302 {
2303  ::osl::MutexGuard aGuard(m_aMutex);
2304  uno::Sequence< OUString > aNameList(m_aElementsPos.size());
2305 
2306  OUString* pStringArray = aNameList.getArray();
2307  for(const auto& rIter : m_aElementsPos)
2308  {
2309  *pStringArray = rIter->first;
2310  ++pStringArray;
2311  }
2312 
2313  return aNameList;
2314 }
2315 
2316 sal_Bool SAL_CALL OStylesHelper::hasByName( const OUString& aName )
2317 {
2318  ::osl::MutexGuard aGuard(m_aMutex);
2319  return m_aElements.find(aName) != m_aElements.end();
2320 }
2321 
2322 // XNameContainer
2323 void SAL_CALL OStylesHelper::insertByName( const OUString& aName, const uno::Any& aElement )
2324 {
2325  ::osl::MutexGuard aGuard(m_aMutex);
2326  if ( m_aElements.find(aName) != m_aElements.end() )
2327  throw container::ElementExistException();
2328 
2329  if ( !aElement.isExtractableTo(m_aType) )
2330  throw lang::IllegalArgumentException();
2331 
2332  m_aElementsPos.push_back(m_aElements.emplace(aName,aElement).first);
2333 }
2334 
2335 void SAL_CALL OStylesHelper::removeByName( const OUString& aName )
2336 {
2337  ::osl::MutexGuard aGuard(m_aMutex);
2338  TStyleElements::const_iterator aFind = m_aElements.find(aName);
2339  if ( aFind != m_aElements.end() )
2340  throw container::NoSuchElementException();
2341  m_aElementsPos.erase(::std::find(m_aElementsPos.begin(),m_aElementsPos.end(),aFind));
2342  m_aElements.erase(aFind);
2343 }
2344 
2345 // XNameReplace
2346 void SAL_CALL OStylesHelper::replaceByName( const OUString& aName, const uno::Any& aElement )
2347 {
2348  ::osl::MutexGuard aGuard(m_aMutex);
2349  TStyleElements::iterator aFind = m_aElements.find(aName);
2350  if ( aFind == m_aElements.end() )
2351  throw container::NoSuchElementException();
2352  if ( !aElement.isExtractableTo(m_aType) )
2353  throw lang::IllegalArgumentException();
2354  aFind->second = aElement;
2355 }
2356 
2357 uno::Reference< container::XNameAccess > SAL_CALL OReportDefinition::getStyleFamilies( )
2358 {
2359  ::osl::MutexGuard aGuard(m_aMutex);
2360  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2361  if ( !m_pImpl->m_xStyles.is() )
2362  {
2363  m_pImpl->m_xStyles = new OStylesHelper();
2364  uno::Reference< container::XNameContainer> xStyles(m_pImpl->m_xStyles,uno::UNO_QUERY);
2365 
2366  uno::Reference< container::XNameContainer> xPageStyles = new OStylesHelper(cppu::UnoType<style::XStyle>::get());
2367  xStyles->insertByName("PageStyles",uno::makeAny(xPageStyles));
2368  uno::Reference< style::XStyle> xPageStyle(createInstance("com.sun.star.style.PageStyle"),uno::UNO_QUERY);
2369  xPageStyles->insertByName(xPageStyle->getName(),uno::makeAny(xPageStyle));
2370 
2371  uno::Reference< container::XNameContainer> xFrameStyles = new OStylesHelper(cppu::UnoType<style::XStyle>::get());
2372  xStyles->insertByName("FrameStyles",uno::makeAny(xFrameStyles));
2373  uno::Reference< style::XStyle> xFrameStyle(createInstance("com.sun.star.style.FrameStyle"),uno::UNO_QUERY);
2374  xFrameStyles->insertByName(xFrameStyle->getName(),uno::makeAny(xFrameStyle));
2375 
2376  uno::Reference< container::XNameContainer> xGraphicStyles = new OStylesHelper(cppu::UnoType<style::XStyle>::get());
2377  xStyles->insertByName("graphics",uno::makeAny(xGraphicStyles));
2378  uno::Reference< style::XStyle> xGraphicStyle(createInstance("com.sun.star.style.GraphicStyle"),uno::UNO_QUERY);
2379  xGraphicStyles->insertByName(xGraphicStyle->getName(),uno::makeAny(xGraphicStyle));
2380  }
2381  return m_pImpl->m_xStyles;
2382 }
2383 OUString SAL_CALL OReportDefinition::getIdentifier( )
2384 {
2385  ::osl::MutexGuard aGuard(m_aMutex);
2386  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2387  return m_pImpl->m_sIdentifier;
2388 }
2389 
2390 void SAL_CALL OReportDefinition::setIdentifier( const OUString& Identifier )
2391 {
2392  ::osl::MutexGuard aGuard(m_aMutex);
2393  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2394  m_pImpl->m_sIdentifier = Identifier;
2395 }
2396 
2397 // XNumberFormatsSupplier
2398 uno::Reference< beans::XPropertySet > SAL_CALL OReportDefinition::getNumberFormatSettings( )
2399 {
2400  ::osl::MutexGuard aGuard(m_aMutex);
2401  if ( m_pImpl->m_xNumberFormatsSupplier.is() )
2402  return m_pImpl->m_xNumberFormatsSupplier->getNumberFormatSettings();
2403  return uno::Reference< beans::XPropertySet >();
2404 }
2405 
2406 uno::Reference< util::XNumberFormats > SAL_CALL OReportDefinition::getNumberFormats( )
2407 {
2408  ::osl::MutexGuard aGuard(m_aMutex);
2409  if ( m_pImpl->m_xNumberFormatsSupplier.is() )
2410  return m_pImpl->m_xNumberFormatsSupplier->getNumberFormats();
2411  return uno::Reference< util::XNumberFormats >();
2412 }
2413 
2414 ::comphelper::EmbeddedObjectContainer& OReportDefinition::getEmbeddedObjectContainer() const
2415 {
2416  return *m_pImpl->m_pObjectContainer;
2417 }
2418 
2419 uno::Reference< embed::XStorage > OReportDefinition::getStorage() const
2420 {
2421  return m_pImpl->m_xStorage;
2422 }
2423 
2424 uno::Reference< task::XInteractionHandler > OReportDefinition::getInteractionHandler() const
2425 {
2426  uno::Reference< task::XInteractionHandler > xRet(
2427  task::InteractionHandler::createWithParent(m_aProps->m_xContext, nullptr), uno::UNO_QUERY_THROW);
2428  return xRet;
2429 }
2430 
2431 uno::Reference< sdbc::XConnection > SAL_CALL OReportDefinition::getActiveConnection()
2432 {
2433  ::osl::MutexGuard aGuard(m_aMutex);
2434  return m_pImpl->m_xActiveConnection;
2435 }
2436 
2437 void SAL_CALL OReportDefinition::setActiveConnection( const uno::Reference< sdbc::XConnection >& _activeconnection )
2438 {
2439  if ( !_activeconnection.is() )
2440  throw lang::IllegalArgumentException();
2441  set(PROPERTY_ACTIVECONNECTION,_activeconnection,m_pImpl->m_xActiveConnection);
2442 }
2443 
2444 OUString SAL_CALL OReportDefinition::getDataSourceName()
2445 {
2446  osl::MutexGuard g(m_aMutex);
2447  return m_pImpl->m_sDataSourceName;
2448 }
2449 
2450 void SAL_CALL OReportDefinition::setDataSourceName(const OUString& the_value)
2451 {
2452  set(PROPERTY_DATASOURCENAME,the_value,m_pImpl->m_sDataSourceName);
2453 }
2454 
2455 bool OReportDefinition::isEnableSetModified() const
2456 {
2457  return true;
2458 }
2459 
2460 OUString OReportDefinition::getDocumentBaseURL() const
2461 {
2462  // TODO: should this be in getURL()? not sure...
2463  uno::Reference<frame::XModel> const xParent(
2464  const_cast<OReportDefinition*>(this)->getParent(), uno::UNO_QUERY);
2465  if (xParent.is())
2466  {
2467  return xParent->getURL();
2468  }
2469 
2470  ::osl::MutexGuard aGuard(m_aMutex);
2471  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2472  for (beans::PropertyValue const& it : std::as_const(m_pImpl->m_aArgs))
2473  {
2474  if (it.Name == "DocumentBaseURL")
2475  return it.Value.get<OUString>();
2476  }
2477 
2478  return OUString();
2479 }
2480 
2481 uno::Reference< frame::XTitle > OReportDefinition::impl_getTitleHelper_throw()
2482 {
2483  SolarMutexGuard aSolarGuard;
2484 
2485  ::osl::MutexGuard aGuard(m_aMutex);
2486  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2487 
2488  if ( ! m_pImpl->m_xTitleHelper.is ())
2489  {
2490  uno::Reference< frame::XDesktop2 > xDesktop = frame::Desktop::create(m_aProps->m_xContext);
2491  uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW);
2492 
2493  rtl::Reference<::framework::TitleHelper> pHelper = new ::framework::TitleHelper( m_aProps->m_xContext );
2494  m_pImpl->m_xTitleHelper = pHelper;
2495  pHelper->setOwner (xThis );
2496  pHelper->connectWithUntitledNumbers (uno::Reference<frame::XUntitledNumbers>(xDesktop, uno::UNO_QUERY_THROW));
2497  }
2498 
2499  return m_pImpl->m_xTitleHelper;
2500 }
2501 
2502 uno::Reference< frame::XUntitledNumbers > OReportDefinition::impl_getUntitledHelper_throw()
2503 {
2504  SolarMutexGuard aSolarGuard;
2505 
2506  ::osl::MutexGuard aGuard(m_aMutex);
2507  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2508 
2509  if ( ! m_pImpl->m_xNumberedControllers.is ())
2510  {
2511  uno::Reference< frame::XModel > xThis(static_cast< frame::XModel* >(this), uno::UNO_QUERY_THROW);
2512  rtl::Reference<::comphelper::NumberedCollection> pHelper = new ::comphelper::NumberedCollection();
2513  m_pImpl->m_xNumberedControllers = pHelper;
2514 
2515  pHelper->setOwner (xThis);
2516  pHelper->setUntitledPrefix (" : ");
2517  }
2518 
2519  return m_pImpl->m_xNumberedControllers;
2520 }
2521 
2522 // css.frame.XTitle
2523 OUString SAL_CALL OReportDefinition::getTitle()
2524 {
2525  // SYNCHRONIZED ->
2526  SolarMutexGuard aSolarGuard;
2527 
2528  ::osl::MutexGuard aGuard(m_aMutex);
2529  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2530 
2531  return impl_getTitleHelper_throw()->getTitle ();
2532 }
2533 
2534 // css.frame.XTitle
2535 void SAL_CALL OReportDefinition::setTitle( const OUString& sTitle )
2536 {
2537  // SYNCHRONIZED ->
2538  SolarMutexGuard aSolarGuard;
2539 
2540  ::osl::MutexGuard aGuard(m_aMutex);
2541  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2542 
2543  impl_getTitleHelper_throw()->setTitle (sTitle);
2544 }
2545 
2546 // css.frame.XTitleChangeBroadcaster
2547 void SAL_CALL OReportDefinition::addTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener )
2548 {
2549  // SYNCHRONIZED ->
2550  SolarMutexGuard aSolarGuard;
2551 
2552  ::osl::MutexGuard aGuard(m_aMutex);
2553  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2554 
2555  uno::Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), uno::UNO_QUERY);
2556  if (xBroadcaster.is ())
2557  xBroadcaster->addTitleChangeListener (xListener);
2558 }
2559 
2560 // css.frame.XTitleChangeBroadcaster
2561 void SAL_CALL OReportDefinition::removeTitleChangeListener( const uno::Reference< frame::XTitleChangeListener >& xListener )
2562 {
2563  // SYNCHRONIZED ->
2564  SolarMutexGuard aSolarGuard;
2565 
2566  ::osl::MutexGuard aGuard(m_aMutex);
2567  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2568 
2569  uno::Reference< frame::XTitleChangeBroadcaster > xBroadcaster(impl_getTitleHelper_throw(), uno::UNO_QUERY);
2570  if (xBroadcaster.is ())
2571  xBroadcaster->removeTitleChangeListener (xListener);
2572 }
2573 
2574 // css.frame.XUntitledNumbers
2575 ::sal_Int32 SAL_CALL OReportDefinition::leaseNumber( const uno::Reference< uno::XInterface >& xComponent )
2576 {
2577  // object already disposed?
2578  SolarMutexGuard aSolarGuard;
2579  ::osl::MutexGuard aGuard(m_aMutex);
2580  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2581 
2582  return impl_getUntitledHelper_throw()->leaseNumber (xComponent);
2583 }
2584 
2585 // css.frame.XUntitledNumbers
2586 void SAL_CALL OReportDefinition::releaseNumber( ::sal_Int32 nNumber )
2587 {
2588  // object already disposed?
2589  SolarMutexGuard aSolarGuard;
2590  ::osl::MutexGuard aGuard(m_aMutex);
2591  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2592 
2593  impl_getUntitledHelper_throw()->releaseNumber (nNumber);
2594 }
2595 
2596 // css.frame.XUntitledNumbers
2597 void SAL_CALL OReportDefinition::releaseNumberForComponent( const uno::Reference< uno::XInterface >& xComponent )
2598 {
2599  // object already disposed?
2600  SolarMutexGuard aSolarGuard;
2601  ::osl::MutexGuard aGuard(m_aMutex);
2602  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2603 
2604  impl_getUntitledHelper_throw()->releaseNumberForComponent (xComponent);
2605 }
2606 
2607 // css.frame.XUntitledNumbers
2608 OUString SAL_CALL OReportDefinition::getUntitledPrefix()
2609 {
2610  // object already disposed?
2611  SolarMutexGuard aSolarGuard;
2612  ::osl::MutexGuard aGuard(m_aMutex);
2613  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2614 
2615  return impl_getUntitledHelper_throw()->getUntitledPrefix ();
2616 }
2617 
2618 uno::Reference< document::XDocumentProperties > SAL_CALL OReportDefinition::getDocumentProperties( )
2619 {
2620  ::osl::MutexGuard aGuard(m_aMutex);
2621  ::connectivity::checkDisposed(ReportDefinitionBase::rBHelper.bDisposed);
2622  if ( !m_pImpl->m_xDocumentProperties.is() )
2623  {
2624  m_pImpl->m_xDocumentProperties.set(document::DocumentProperties::create(m_aProps->m_xContext));
2625  }
2626  return m_pImpl->m_xDocumentProperties;
2627 }
2628 
2629 uno::Any SAL_CALL OReportDefinition::getTransferData( const datatransfer::DataFlavor& aFlavor )
2630 {
2631  uno::Any aResult;
2632  if( !isDataFlavorSupported( aFlavor ) )
2633  {
2634  throw datatransfer::UnsupportedFlavorException(aFlavor.MimeType, static_cast< ::cppu::OWeakObject* >( this ));
2635  }
2636 
2637  try
2638  {
2639  aResult = getPreferredVisualRepresentation(0).Data;
2640  }
2641  catch (const uno::Exception &)
2642  {
2643  DBG_UNHANDLED_EXCEPTION("reportdesign");
2644  }
2645 
2646 
2647  return aResult;
2648 }
2649 
2650 uno::Sequence< datatransfer::DataFlavor > SAL_CALL OReportDefinition::getTransferDataFlavors( )
2651 {
2652  return { { "image/png", "PNG", cppu::UnoType<uno::Sequence< sal_Int8 >>::get() } };
2653 }
2654 
2655 sal_Bool SAL_CALL OReportDefinition::isDataFlavorSupported( const datatransfer::DataFlavor& aFlavor )
2656 {
2657  return aFlavor.MimeType == "image/png";
2658 }
2659 
2660 
2661 uno::Reference< document::XUndoManager > SAL_CALL OReportDefinition::getUndoManager( )
2662 {
2663  ::osl::MutexGuard aGuard( m_aMutex );
2664  return m_pImpl->m_pUndoManager;
2665 }
2666 
2667 }// namespace reportdesign
2668 
2669 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
uno::Reference< container::XNameAccess > m_xXMLNamespaceMap
constexpr OUStringLiteral SC_UNO_PAGE_FIRSTHDRSHARED
IMPLEMENT_FORWARD_XINTERFACE2(ChildWindowPane, ChildWindowPaneInterfaceBase, Pane)
static const OUString & PROP_DOCUMENTBASEURL()
virtual void SAL_CALL notifyDocumentEvent(const OUString &rEventName, const css::uno::Reference< css::frame::XController2 > &rViewController, const css::uno::Any &rSupplement) override
virtual OUString SAL_CALL getImplementationName() override
virtual sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
virtual void SAL_CALL storeToStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aMediaDescriptor) override
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentStorage() override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
#define PROPERTY_BACKGRAPHICLOCATION
Definition: strings.hxx:60
#define PROPERTY_PAGESTYLELAYOUT
Definition: strings.hxx:214
virtual void SAL_CALL setModified(sal_Bool bModified) override
bool hasValue()
Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope...
Definition: UndoEnv.hxx:64
virtual sal_Bool SAL_CALL isSetModifiedEnabled() override
virtual void SAL_CALL setCaption(const OUString &_caption) override
::comphelper::OInterfaceContainerHelper2 m_aDocEventListeners
COMPHELPER_DLLPUBLIC css::uno::Reference< css::container::XNameContainer > NameContainer_createInstance(const css::uno::Type &aType)
constexpr OUStringLiteral SC_UNO_PAGE_FTRLEFTMAR
constexpr SdrLayerID RPT_LAYER_BACK(1)
static const OUString & PROP_STATUSINDICATOR()
uno::Reference< util::XNumberFormatsSupplier > m_xNumberFormatsSupplier
virtual OUString SAL_CALL getFilter() override
#define PROPERTY_RIGHTMARGIN
Definition: strings.hxx:105
css::uno::Reference< css::ui::XUIConfigurationManager2 > getUIConfigurationManager2()
static css::uno::Reference< css::uno::XInterface > create(css::uno::Reference< css::uno::XComponentContext > const &xContext)
virtual ::sal_Int32 SAL_CALL getMapUnit(::sal_Int64 nAspect) override
::std::vector< uno::Reference< frame::XController > > m_aControllers
virtual css::uno::Reference< css::document::XEventBroadcaster > SAL_CALL getEventBroadcaster() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL initNew() override
constexpr OUStringLiteral SC_UNO_PAGE_SHADOWFORM
virtual void SAL_CALL dispose() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() SAL_OVERRIDE
std::shared_ptr< rptui::OReportModel > m_pReportModel
virtual void SAL_CALL addCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getArgs() override
constexpr OUStringLiteral SC_UNO_PAGE_FTRSHADOW
virtual css::uno::Reference< css::report::XSection > SAL_CALL getReportFooter() override
#define PROPERTY_ISLANDSCAPE
Definition: strings.hxx:215
uno::Sequence< beans::Property > m_aProps
#define SERVICE_IMAGECONTROL
Definition: strings.hxx:24
uno::Reference< report::XSection > m_xDetail
virtual void SAL_CALL removeDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &rListener) override
virtual css::embed::VisualRepresentation SAL_CALL getPreferredVisualRepresentation(::sal_Int64 nAspect) override
::comphelper::OInterfaceContainerHelper2 m_aLegacyEventListeners
static void lcl_extractAndStartStatusIndicator(const utl::MediaDescriptor &_rDescriptor, uno::Reference< task::XStatusIndicator > &_rxStatusIndicator, uno::Sequence< uno::Any > &_rCallArgs)
sal_Int32 findValue(const css::uno::Sequence< T1 > &_rList, const T2 &_rValue)
virtual ::sal_Int16 SAL_CALL getPageFooterOption() override
static void lcl_setModelReadOnly(const uno::Reference< embed::XStorage > &_xStorage, std::shared_ptr< rptui::OReportModel > const &_rModel)
::comphelper::OPropertyStateContainer OStyle_PBASE
virtual sal_Bool SAL_CALL attachResource(const OUString &URL, const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRTOPBDIS
constexpr OUStringLiteral SC_UNO_PAGE_SCALETOPAG
virtual sal_Bool SAL_CALL enableSetModified() override
constexpr OUStringLiteral SC_UNO_PAGE_HDRRIGHTMAR
Reference< XFrame > xFrame
constexpr OUStringLiteral SC_UNO_PAGE_SCALEVAL
virtual void SAL_CALL removeCloseListener(const css::uno::Reference< css::util::XCloseListener > &Listener) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getCurrentSelection() override
virtual sal_Bool SAL_CALL hasControllersLocked() override
uno::Reference< container::XNameAccess > m_xHatchTable
exports com.sun.star. embed
::comphelper::OInterfaceContainerHelper2 m_aModifyListeners
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
virtual void SAL_CALL lockControllers() override
#define PROPERTY_NUMBERINGTYPE
Definition: strings.hxx:213
constexpr OUStringLiteral SC_UNO_PAGE_FTRHEIGHT
virtual void SAL_CALL switchToStorage(const css::uno::Reference< css::embed::XStorage > &xStorage) override
uno::Reference< container::XNameAccess > m_xTransparencyGradientTable
constexpr OUStringLiteral SC_UNO_PAGE_FTRTOPBOR
constexpr OUStringLiteral SC_UNO_PAGE_BORDERDIST
constexpr OUStringLiteral SC_UNO_PAGE_BOTTBRDDIST
::cppu::WeakImplHelper< style::XStyle, beans::XMultiPropertyStates > TStyleBASE
uno::Reference< embed::XStorage > m_xStorage
mutable::osl::Mutex m_aMutex
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRGRF
#define PROPERTY_POSITIONY
Definition: strings.hxx:75
constexpr OUStringLiteral SC_UNO_PAGE_FTRRIGHTMAR
constexpr OUStringLiteral SC_UNO_PAGE_LEFTBORDER
void throwIllegallArgumentException(const OUString &_sTypeName, const uno::Reference< uno::XInterface > &ExceptionContext_, sal_Int16 ArgumentPosition_)
Definition: Tools.cxx:43
constexpr OUStringLiteral SC_UNO_PAGE_HDRSHADOW
std::shared_ptr< T > make_shared(Args &&...args)
virtual sal_Bool SAL_CALL isModified() override
virtual void SAL_CALL setCommand(const OUString &_command) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRGRFLOC
uno::Reference< report::XGroups > m_xGroups
Reference< XNumberFormatsSupplier > getNumberFormats(const Reference< XConnection > &_rxConn, bool _bAlloweDefault, const Reference< XComponentContext > &_rxContext)
bool bReadOnly
virtual void SAL_CALL removePropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
#define PROPERTY_WIDTH
Definition: strings.hxx:73
constexpr OUStringLiteral SC_UNO_PAGE_FTRBACKCOL
#define PROPERTY_DATASOURCENAME
Definition: strings.hxx:194
SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoMarkerTable_createInstance(SdrModel *pModel)
uno::Reference< report::XSection > m_xPageHeader
virtual OUString SAL_CALL getCaption() override
virtual void SAL_CALL load(const css::uno::Sequence< css::beans::PropertyValue > &lArguments) override
virtual OUString SAL_CALL getShapeType() override
#define PROPERTY_PAGEFOOTEROPTION
Definition: strings.hxx:65
constexpr OUStringLiteral SC_UNO_PAGE_FTRBOTTBDIS
virtual css::uno::Reference< css::report::XSection > SAL_CALL getPageFooter() override
#define PROPERTY_GROUPKEEPTOGETHER
Definition: strings.hxx:63
constexpr OUStringLiteral SC_UNO_PAGE_FTRDYNAMIC
virtual void SAL_CALL setPageFooterOn(sal_Bool _pagefooteron) override
Sequence< PropertyValue > aArguments
#define PROPERTY_PAGEHEADERON
Definition: strings.hxx:69
void setSection(const OUString &_sProperty, bool _bOn, const OUString &_sName, css::uno::Reference< css::report::XSection > &_member)
constexpr OUStringLiteral SC_UNO_PAGE_LEFTBRDDIST
Reference< XInputStream > xStream
uno::Reference< container::XNameAccess > m_xBitmapTable
css::uno::Reference< css::uno::XComponentContext > getContext()
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
Any SAL_CALL getCaughtException()
void impl_loadFromStorage_nolck_throw(const css::uno::Reference< css::embed::XStorage > &_rxStorage, const css::uno::Sequence< css::beans::PropertyValue > &_rArguments)
loads the report definition from the given storage our mutex is locked
uno::Type m_aType
#define PROPERTY_LEFTMARGIN
Definition: strings.hxx:104
TStyleElements m_aElements
virtual void SAL_CALL setReportHeaderOn(sal_Bool _reportheaderon) override
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
constexpr OUStringLiteral SC_UNO_PAGE_HDRBACKTRAN
int nCount
#define PROPERTY_COMMANDTYPE
Definition: strings.hxx:66
constexpr OUStringLiteral SC_UNO_PAGE_HDRBOTTBDIS
uno::Sequence< beans::PropertyValue > m_aArgs
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL close(sal_Bool DeliverOwnership) override
constexpr OUStringLiteral SC_UNO_PAGE_SCALETOX
std::mutex m_aMutex
virtual css::uno::Sequence< OUString > SAL_CALL getDocumentSubStoragesNames() override
constexpr OUStringLiteral SC_UNO_PAGE_SCALETOY
constexpr SdrLayerID RPT_LAYER_FRONT(0)
virtual void SAL_CALL setCommandType(::sal_Int32 _commandtype) override
#define REPORTCOMPONENT_IMPL(clazz, arg)
virtual void SAL_CALL disconnectController(const css::uno::Reference< css::frame::XController > &Controller) override
virtual OUString SAL_CALL getCommand() override
virtual void SAL_CALL setPropertyValue(rtl::OUString const &propertyName, css::uno::Any const &value) SAL_OVERRIDE
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
sal_Int64 getSomething_cast(void *p)
const char * sName
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
::std::vector< TStyleElements::iterator > m_aElementsPos
SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoTransGradientTable_createInstance(SdrModel *pModel)
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
constexpr OUStringLiteral SC_UNO_PAGE_HDRLEFTBDIS
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
constexpr OUStringLiteral SC_UNO_PAGE_FTRGRFLOC
constexpr OUStringLiteral SC_UNO_PAGE_HDRON
constexpr OUStringLiteral SC_UNO_PAGE_RIGHTBRDDIST
#define SAL_N_ELEMENTS(arr)
const css::uno::Sequence< sal_Int8 > & getSeq() const
constexpr OUStringLiteral SC_UNO_PAGE_FTRBRDDIST
constexpr OUStringLiteral SC_UNO_PAGE_FTRON
constexpr OUStringLiteral SC_UNO_PAGE_FTRBOTTBOR
#define PROPERTY_REPORTFOOTERON
Definition: strings.hxx:68
static Size GetDefaultPaperSize(MapUnit eUnit=MapUnit::MapTwip)
#define SERVICE_FIXEDLINE
Definition: strings.hxx:29
virtual void SAL_CALL addStorageChangeListener(const css::uno::Reference< css::document::XStorageChangeListener > &xListener) override
virtual ::sal_Int32 SAL_CALL getCommandType() override
#define DBG_UNHANDLED_EXCEPTION(...)
#define PROPERTY_NAME
Definition: strings.hxx:36
static css::uno::Reference< css::embed::XStorage > GetTemporaryStorage(const css::uno::Reference< css::uno::XComponentContext > &rxContext=css::uno::Reference< css::uno::XComponentContext >())
TValueType getUnpackedValueOrDefault(const OUString &sKey, const TValueType &aDefault) const
virtual css::uno::Reference< css::ui::XUIConfigurationManager > SAL_CALL getUIConfigurationManager() override
#define SERVICE_FORMATTEDFIELD
Definition: strings.hxx:23
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral SC_UNO_PAGE_FTRTOPBDIS
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
static css::uno::Reference< css::report::XSection > createOSection(const css::uno::Reference< css::report::XReportDefinition > &_xParent, const css::uno::Reference< css::uno::XComponentContext > &context, bool _bPageSection=false)
virtual void SAL_CALL setPageFooterOption(::sal_Int16 _pagefooteroption) override
virtual void SAL_CALL removeStorageChangeListener(const css::uno::Reference< css::document::XStorageChangeListener > &xListener) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRDYNAMIC
OUString RptResId(TranslateId aId)
int i
constexpr OUStringLiteral SC_UNO_PAGE_FTRRIGHTBOR
#define PROPERTY_PAPERSIZE
Definition: strings.hxx:62
constexpr OUStringLiteral SC_UNO_PAGE_FTRLEFTBDIS
constexpr OUStringLiteral SC_UNO_PAGE_HDRGRFFILT
#define REPORTCOMPONENT_IMPL2(clazz, arg)
virtual void SAL_CALL setViewData(const css::uno::Reference< css::container::XIndexAccess > &Data) override
bool get_ensureType(const char *_pAsciiValueName, VALUE_TYPE &_out_rValue) const
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
bool query_aggregation(const css::uno::Reference< css::uno::XAggregation > &_rxAggregate, css::uno::Reference< iface > &_rxOut)
Mutex aLock
cppu::PartialWeakComponentImplHelper< css::report::XReportDefinition, css::document::XEventBroadcaster, css::document::XDocumentEventBroadcaster, css::lang::XServiceInfo, css::frame::XModule, css::lang::XUnoTunnel, css::util::XNumberFormatsSupplier, css::frame::XTitle, css::frame::XTitleChangeBroadcaster, css::frame::XUntitledNumbers, css::document::XDocumentPropertiesSupplier, css::datatransfer::XTransferable, css::document::XUndoManagerSupplier, SvxUnoDrawMSFactory > ReportDefinitionBase
#define PROPERTY_TOPMARGIN
Definition: strings.hxx:106
static rtl::Reference< SvXMLEmbeddedObjectHelper > Create(const css::uno::Reference< css::embed::XStorage > &,::comphelper::IEmbeddedHelper &rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode)
virtual css::uno::Reference< css::report::XSection > SAL_CALL getDetail() override
virtual sal_Bool SAL_CALL getPageHeaderOn() override
COMPHELPER_DLLPUBLIC css::uno::Reference< css::beans::XPropertySet > GenericPropertySet_CreateInstance(PropertySetInfo *pInfo)
uno::Reference< container::XIndexAccess > m_xViewData
virtual void SAL_CALL setEscapeProcessing(sal_Bool _escapeprocessing) override
uno::Reference< container::XNameAccess > m_xStyles
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
virtual sal_Bool SAL_CALL getReportHeaderOn() override
SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoGradientTable_createInstance(SdrModel *pModel)
SdrLayer * NewLayer(const OUString &rName, sal_uInt16 nPos=0xFFFF)
constexpr OUStringLiteral SC_UNO_PAGE_FIRSTFTRSHARED
bool remove(const char *_pAsciiValueName)
uno::Reference< frame::XUntitledNumbers > m_xNumberedControllers
uno::Reference< report::XFunctions > m_xFunctions
#define PROPERTY_BACKTRANSPARENT
Definition: strings.hxx:39
float u
implementation of a
Definition: Functions.hxx:38
unsigned char sal_Bool
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getViewData() override
virtual ::sal_Int16 SAL_CALL getPageHeaderOption() override
virtual ::sal_Int16 SAL_CALL getGroupKeepTogether() override
css::uno::Type const & get()
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
constexpr OUStringLiteral SC_UNO_PAGE_PAPERTRAY
uno::Reference< uno::XInterface > SvxUnoBitmapTable_createInstance(SdrModel *pModel)
uno::Reference< report::XSection > m_xReportHeader
virtual css::uno::Reference< css::report::XSection > SAL_CALL getReportHeader() override
uno::Reference< container::XNameAccess > m_xMarkerTable
#define PROPERTY_FILTER
Definition: strings.hxx:189
::comphelper::OPropertyArrayUsageHelper< OStyle > OStyle_PABASE
virtual void SAL_CALL addPropertyChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XPropertyChangeListener > const &listener) SAL_OVERRIDE
bool setPropertyValue(uno::Sequence< beans::PropertyValue > &aProp, const OUString &aName, const uno::Any &aValue)
virtual sal_Bool SAL_CALL getEscapeProcessing() override
constexpr OUStringLiteral SC_UNO_PAGE_RIGHTBORDER
uno::Reference< frame::XController > m_xCurrentController
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
::comphelper::OInterfaceContainerHelper2 m_aCloseListener
uno::Reference< container::XNameAccess > m_xGradientTable
::comphelper::OInterfaceContainerHelper2 m_aStorageChangeListeners
virtual void SAL_CALL setPageHeaderOption(::sal_Int16 _pageheaderoption) override
constexpr OUStringLiteral SC_UNO_PAGE_BOTTBORDER
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableMimeTypes() override
#define PROPERTY_POSITIONX
Definition: strings.hxx:74
#define IMPLEMENT_FORWARD_REFCOUNT(classname, refcountbase)
void fillArgs(utl::MediaDescriptor &_aDescriptor)
static void lcl_stripLoadArguments(utl::MediaDescriptor &_rDescriptor, uno::Sequence< beans::PropertyValue > &_rArgs)
virtual css::uno::Reference< css::report::XFunctions > SAL_CALL getFunctions() override
static std::shared_ptr< rptui::OReportModel > getSdrModel(const css::uno::Reference< css::report::XReportDefinition > &_xReportDefinition)
#define MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII
virtual css::uno::Reference< css::report::XSection > SAL_CALL getPageHeader() override
#define PROPERTY_MIMETYPE
Definition: strings.hxx:199
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
void prepareSet(rtl::OUString const &propertyName, css::uno::Any const &oldValue, css::uno::Any const &newValue, BoundListeners *boundListeners)
#define PROPERTY_REPORTHEADERON
Definition: strings.hxx:67
constexpr OUStringLiteral SC_UNO_PAGE_HDRRIGHTBDIS
css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRTOPBOR
virtual void SAL_CALL setFilter(const OUString &_filter) override
OReportDefinition(const OReportDefinition &)=delete
constexpr OUStringLiteral SC_UNO_PAGE_FTRGRFFILT
SVXCORE_DLLPUBLIC css::uno::Reference< css::uno::XInterface > SvxUnoHatchTable_createInstance(SdrModel *pModel)
virtual css::uno::Reference< css::report::XGroups > SAL_CALL getGroups() override
constexpr SdrLayerID RPT_LAYER_HIDDEN(2)
constexpr OUStringLiteral sMediaType
constexpr OUStringLiteral SC_UNO_PAGE_HDRRIGHTBOR
void notifyEvent(const OUString &_sEventName)
virtual void SAL_CALL unlockControllers() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
unsigned char sal_uInt8
constexpr OUStringLiteral SC_UNO_PAGE_FTRRIGHTBDIS
constexpr OUStringLiteral SC_UNO_PAGE_HDRBOTTBOR
#define SERVICE_REPORTDEFINITION
Definition: strings.hxx:27
constexpr OUStringLiteral SC_UNO_PAGE_TOPBRDDIST
constexpr OUStringLiteral SC_UNO_PAGE_HDRBACKCOL
static css::uno::Sequence< OUString > getSupportedServiceNames_Static()
virtual void SAL_CALL setMimeType(const OUString &_mimetype) override
virtual sal_Bool SAL_CALL disableSetModified() override
#define PROPERTY_CAPTION
Definition: strings.hxx:58
uno::Reference< util::XCloneable > cloneObject(const uno::Reference< report::XReportComponent > &_xReportComponent, const uno::Reference< lang::XMultiServiceFactory > &_xFactory, const OUString &_sServiceName)
Definition: Tools.cxx:53
constexpr OUStringLiteral SC_UNO_PAGE_HDRLEFTBOR
#define PROPERTY_HEIGHT
Definition: strings.hxx:37
uno::Reference< uno::XInterface > SvxUnoDashTable_createInstance(SdrModel *pModel)
bool put(const char *_pAsciiValueName, const VALUE_TYPE &_rValue)
virtual css::uno::Any SAL_CALL getPropertyValue(rtl::OUString const &propertyName) SAL_OVERRIDE
static OUString getImplementationName_Static()
#define REPORTCOMPONENT_MASTERDETAIL(clazz, arg)
virtual OUString SAL_CALL getURL() override
Sequence< sal_Int8 > aSeq
uno::Reference< container::XNameAccess > m_xDashTable
TABLE
std::shared_ptr< ::comphelper::EmbeddedObjectContainer > m_pObjectContainer
#define PROPERTY_BOTTOMMARGIN
Definition: strings.hxx:107
uno::Reference< report::XSection > m_xPageFooter
constexpr OUStringLiteral SC_UNO_PAGE_FTRBACKTRAN
bool has(const char *_pAsciiValueName) const
FILE * init(int, char **)
#define MIMETYPE_OASIS_OPENDOCUMENT_REPORT_ASCII
awt::Size m_aSize
constexpr OUStringLiteral SC_UNO_PAGE_HDRHEIGHT
constexpr OUStringLiteral SC_UNO_PAGE_FTRBODYDIST
virtual void SAL_CALL setPageHeaderOn(sal_Bool _pageheaderon) override
constexpr OUStringLiteral SC_UNO_PAGE_FTRGRF
virtual void SAL_CALL addVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
constexpr OUStringLiteral SC_UNO_PAGE_HDRSHARED
virtual sal_Bool SAL_CALL getPageFooterOn() override
#define PROPERTY_PAGEHEADEROPTION
Definition: strings.hxx:64
::rtl::Reference< ::dbaui::UndoManager > m_pUndoManager
virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates(const css::uno::Sequence< OUString > &aPropertyName) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
#define MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII
constexpr OUStringLiteral SC_UNO_PAGE_HDRLEFTMAR
std::shared_ptr< OReportComponentProperties > m_aProps
virtual void SAL_CALL removeVetoableChangeListener(rtl::OUString const &propertyName, css::uno::Reference< css::beans::XVetoableChangeListener > const &listener) SAL_OVERRIDE
virtual OUString SAL_CALL getMimeType() override
OReportDefinitionImpl(::osl::Mutex &_aMutex)
uno::WeakReference< uno::XInterface > m_xParent
sal_Int32 nLength
static rtl::Reference< SvXMLGraphicHelper > Create(const css::uno::Reference< css::embed::XStorage > &rXMLStorage, SvXMLGraphicHelperMode eCreateMode)
uno::Reference< report::XSection > m_xReportFooter
virtual SdrModel & getSdrModelFromUnoModel() const override
abstract SdrModel provider
virtual void SAL_CALL disposing() override
this function is called upon disposing the component
#define PROPERTY_BACKCOLOR
Definition: strings.hxx:38
bool WriteThroughComponent(const css::uno::Reference< css::lang::XComponent > &xComponent, const char *pStreamName, const char *pServiceName, const css::uno::Sequence< css::uno::Any > &rArguments, const css::uno::Sequence< css::beans::PropertyValue > &rMediaDesc, const css::uno::Reference< css::embed::XStorage > &_xStorageToSaveTo)
write a single XML stream into the package
virtual void SAL_CALL setGroupKeepTogether(::sal_Int16 _groupkeeptogether) override
virtual void SAL_CALL connectController(const css::uno::Reference< css::frame::XController > &Controller) override
virtual void SAL_CALL loadFromStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, const css::uno::Sequence< css::beans::PropertyValue > &aMediaDescriptor) override
virtual void SAL_CALL setVisualAreaSize(::sal_Int64 nAspect, const css::awt::Size &aSize) override
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
virtual void SAL_CALL setReportFooterOn(sal_Bool _reportfooteron) override
#define PROPERTY_ACTIVECONNECTION
Definition: strings.hxx:193
constexpr OUStringLiteral SC_UNO_PAGE_FTRSHARED
virtual void SAL_CALL setCurrentController(const css::uno::Reference< css::frame::XController > &Controller) override
virtual css::uno::Reference< css::embed::XStorage > SAL_CALL getDocumentSubStorage(const OUString &aStorageName, sal_Int32 nMode) override
uno::Reference< document::XDocumentProperties > m_xDocumentProperties
#define PROPERTY_COMMAND
Definition: strings.hxx:59
static css::uno::Sequence< sal_Int8 > getUnoTunnelId()
uno::Reference< ui::XUIConfigurationManager2 > m_xUIConfigurationManager
::cppu::PropertySetMixin< css::report::XReportDefinition > ReportDefinitionPropertySet
constexpr OUStringLiteral SC_UNO_PAGE_TOPBORDER
void set(const OUString &_sProperty, const T &Value, T &_member)
struct _ADOIndex Index
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRBODYDIST
virtual css::uno::Reference< css::frame::XController > SAL_CALL getCurrentController() override
uno::Reference< sdbc::XConnection > m_xActiveConnection
uno::Reference< frame::XTitle > m_xTitleHelper
virtual css::awt::Size SAL_CALL getVisualAreaSize(::sal_Int64 nAspect) override
virtual sal_Bool SAL_CALL getReportFooterOn() override
std::shared_ptr< OReportDefinitionImpl > m_pImpl
constexpr OUStringLiteral SC_UNO_PAGE_FTRLEFTBOR
AnyEventRef aEvent
#define PROPERTY_ESCAPEPROCESSING
Definition: strings.hxx:190
#define PROPERTY_PAGEFOOTERON
Definition: strings.hxx:70
#define SERVICE_SHAPE
Definition: strings.hxx:28
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
sal_uInt16 nPos
OCollection OGroups
virtual css::uno::Any SAL_CALL queryInterface(css::uno::Type const &type) SAL_OVERRIDE
void set(css::uno::UnoInterfaceReference const &value)
::cppu::WeakImplHelper< container::XNameContainer, container::XIndexAccess > TStylesBASE
#define SERVICE_FIXEDTEXT
Definition: strings.hxx:22
constexpr OUStringLiteral sHierarchicalDocumentName
#define DECLARE_XINTERFACE()
virtual void SAL_CALL addDocumentEventListener(const css::uno::Reference< css::document::XDocumentEventListener > &rListener) override
constexpr OUStringLiteral SC_UNO_PAGE_HDRBRDDIST