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