LibreOffice Module dbaccess (master) 1
subcomponentrecovery.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21
22#include <sdbcoretools.hxx>
23#include "storagexmlstream.hxx"
25#include "settingsimport.hxx"
26
27#include <com/sun/star/embed/ElementModes.hpp>
28#include <com/sun/star/frame/ModuleManager.hpp>
29#include <com/sun/star/document/XStorageBasedDocument.hpp>
30#include <com/sun/star/ucb/XCommandProcessor.hpp>
31#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
32#include <com/sun/star/sdb/XFormDocumentsSupplier.hpp>
33#include <com/sun/star/sdb/XReportDocumentsSupplier.hpp>
34#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
35
40#include <sal/log.hxx>
43
44#include <stack>
45
46namespace dbaccess
47{
48
49 using css::uno::Reference;
50 using css::uno::UNO_QUERY;
51 using css::uno::UNO_QUERY_THROW;
52 using css::uno::UNO_SET_THROW;
53 using css::uno::Exception;
54 using css::uno::Any;
55 using css::uno::Sequence;
56 using css::uno::XComponentContext;
57 using css::embed::XStorage;
58 using css::sdb::application::XDatabaseDocumentUI;
59 using css::beans::Pair;
60 using css::frame::ModuleManager;
61 using css::frame::XModuleManager2;
62 using css::lang::XComponent;
63 using css::frame::XModel;
64 using css::frame::XController;
65 using css::beans::XPropertySet;
66 using css::beans::PropertyValue;
67 using css::document::XStorageBasedDocument;
68 using css::ucb::XCommandProcessor;
69 using css::container::XHierarchicalNameAccess;
70 using css::sdb::XFormDocumentsSupplier;
71 using css::sdb::XReportDocumentsSupplier;
72 using css::xml::sax::XLocator;
73 using css::xml::sax::XDocumentHandler;
74 using css::xml::sax::XAttributeList;
75
76 namespace ElementModes = css::embed::ElementModes;
77 namespace DatabaseObject = css::sdb::application::DatabaseObject;
78
79 // helper
80 namespace
81 {
82 OUString lcl_getComponentStorageBaseName( const SubComponentType i_eType )
83 {
84 switch ( i_eType )
85 {
86 case FORM:
87 return "form";
88 case REPORT:
89 return "report";
90 case TABLE:
91 return "table";
92 case QUERY:
93 return "query";
94 default:
95 break;
96 }
97
98 OSL_FAIL( "lcl_getComponentStorageBaseName: unimplemented case!" );
99 return OUString();
100 }
101
102 SubComponentType lcl_databaseObjectToSubComponentType( const sal_Int32 i_nObjectType )
103 {
104 switch ( i_nObjectType )
105 {
106 case DatabaseObject::TABLE: return TABLE;
107 case DatabaseObject::QUERY: return QUERY;
108 case DatabaseObject::FORM: return FORM;
109 case DatabaseObject::REPORT:return REPORT;
110 default:
111 break;
112 }
113 return UNKNOWN;
114 }
115
116 bool lcl_determineReadOnly( const Reference< XComponent >& i_rComponent )
117 {
118 Reference< XModel > xDocument( i_rComponent, UNO_QUERY );
119 if ( !xDocument.is() )
120 {
121 Reference< XController > xController( i_rComponent, UNO_QUERY_THROW );
122 xDocument = xController->getModel();
123 }
124
125 if ( !xDocument.is() )
126 return false;
127
128 ::comphelper::NamedValueCollection aDocArgs( xDocument->getArgs() );
129 return aDocArgs.getOrDefault( "ReadOnly", false );
130 }
131
132 Reference< XCommandProcessor > lcl_getSubComponentDef_nothrow( const Reference< XDatabaseDocumentUI >& i_rAppUI,
133 const SubComponentType i_eType, const OUString& i_rName )
134 {
135 Reference< XController > xController( i_rAppUI, UNO_QUERY_THROW );
136 ENSURE_OR_RETURN( ( i_eType == FORM ) || ( i_eType == REPORT ), "lcl_getSubComponentDef_nothrow: illegal controller", nullptr );
137
138 Reference< XCommandProcessor > xCommandProcessor;
139 try
140 {
141 Reference< XHierarchicalNameAccess > xDefinitionContainer;
142 if ( i_eType == FORM )
143 {
144 Reference< XFormDocumentsSupplier > xSuppForms( xController->getModel(), UNO_QUERY_THROW );
145 xDefinitionContainer.set( xSuppForms->getFormDocuments(), UNO_QUERY_THROW );
146 }
147 else
148 {
149 Reference< XReportDocumentsSupplier > xSuppReports( xController->getModel(), UNO_QUERY_THROW );
150 xDefinitionContainer.set( xSuppReports->getReportDocuments(), UNO_QUERY_THROW );
151 }
152 xCommandProcessor.set( xDefinitionContainer->getByHierarchicalName( i_rName ), UNO_QUERY_THROW );
153 }
154 catch( const Exception& )
155 {
156 DBG_UNHANDLED_EXCEPTION("dbaccess");
157 }
158 return xCommandProcessor;
159 }
160
161 constexpr OUStringLiteral sSettingsStreamName = u"settings.xml";
162 constexpr OUStringLiteral sCurrentQueryDesignName = u"ooo:current-query-design";
163 }
164
165 namespace {
166
167 // SettingsExportContext
168 class SettingsExportContext : public ::xmloff::XMLSettingsExportContext
169 {
170 public:
171 SettingsExportContext( const Reference<XComponentContext>& i_rContext, StorageXMLOutputStream& i_rDelegator )
172 :m_rContext( i_rContext )
173 ,m_rDelegator( i_rDelegator )
174 ,m_aNamespace( ::xmloff::token::GetXMLToken( ::xmloff::token::XML_NP_CONFIG ) )
175 {
176 }
177
178 virtual ~SettingsExportContext()
179 {
180 }
181
182 public:
183 virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, const OUString& i_rValue ) override;
184 virtual void AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, enum ::xmloff::token::XMLTokenEnum i_eValue ) override;
185 virtual void StartElement( enum ::xmloff::token::XMLTokenEnum i_eName ) override;
186 virtual void EndElement ( const bool i_bIgnoreWhitespace ) override;
187 virtual void Characters( const OUString& i_rCharacters ) override;
188
189 virtual css::uno::Reference< css::uno::XComponentContext >
190 GetComponentContext() const override;
191
192 private:
193 OUString impl_prefix( const ::xmloff::token::XMLTokenEnum i_eToken )
194 {
195 return m_aNamespace + ":" + ::xmloff::token::GetXMLToken( i_eToken );
196 }
197
198 private:
199 const Reference<XComponentContext>& m_rContext;
200 StorageXMLOutputStream& m_rDelegator;
201 const OUString m_aNamespace;
202 };
203
204 }
205
206 void SettingsExportContext::AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, const OUString& i_rValue )
207 {
208 m_rDelegator.addAttribute( impl_prefix( i_eName ), i_rValue );
209 }
210
211 void SettingsExportContext::AddAttribute( enum ::xmloff::token::XMLTokenEnum i_eName, enum ::xmloff::token::XMLTokenEnum i_eValue )
212 {
213 m_rDelegator.addAttribute( impl_prefix( i_eName ), ::xmloff::token::GetXMLToken( i_eValue ) );
214 }
215
216 void SettingsExportContext::StartElement( enum ::xmloff::token::XMLTokenEnum i_eName )
217 {
219
220 m_rDelegator.startElement( impl_prefix( i_eName ) );
221 }
222
223 void SettingsExportContext::EndElement( const bool i_bIgnoreWhitespace )
224 {
225 if ( i_bIgnoreWhitespace )
228 }
229
230 void SettingsExportContext::Characters( const OUString& i_rCharacters )
231 {
232 m_rDelegator.characters( i_rCharacters );
233 }
234
235 Reference< css::uno::XComponentContext > SettingsExportContext::GetComponentContext() const
236 {
237 return m_rContext;
238 }
239
240 // SettingsDocumentHandler
241 typedef ::cppu::WeakImplHelper< XDocumentHandler
243
244 namespace {
245
246 class SettingsDocumentHandler : public SettingsDocumentHandler_Base
247 {
248 public:
249 SettingsDocumentHandler()
250 {
251 }
252
253 protected:
254 virtual ~SettingsDocumentHandler() override
255 {
256 }
257
258 public:
259 // XDocumentHandler
260 virtual void SAL_CALL startDocument( ) override;
261 virtual void SAL_CALL endDocument( ) override;
262 virtual void SAL_CALL startElement( const OUString& aName, const Reference< XAttributeList >& xAttribs ) override;
263 virtual void SAL_CALL endElement( const OUString& aName ) override;
264 virtual void SAL_CALL characters( const OUString& aChars ) override;
265 virtual void SAL_CALL ignorableWhitespace( const OUString& aWhitespaces ) override;
266 virtual void SAL_CALL processingInstruction( const OUString& aTarget, const OUString& aData ) override;
267 virtual void SAL_CALL setDocumentLocator( const Reference< XLocator >& xLocator ) override;
268
269 const ::comphelper::NamedValueCollection& getSettings() const { return m_aSettings; }
270
271 private:
272 std::stack< ::rtl::Reference< SettingsImport > > m_aStates;
274 };
275
276 }
277
278 void SAL_CALL SettingsDocumentHandler::startDocument( )
279 {
280 }
281
282 void SAL_CALL SettingsDocumentHandler::endDocument( )
283 {
284 }
285
286 void SAL_CALL SettingsDocumentHandler::startElement( const OUString& i_Name, const Reference< XAttributeList >& i_Attribs )
287 {
289
290 if ( m_aStates.empty() )
291 {
292 if ( i_Name == "office:settings" )
293 {
294 pNewState = new OfficeSettingsImport( m_aSettings );
295 }
296 else
297 {
298 OSL_FAIL( "SettingsDocumentHandler::startElement: invalid settings file!" );
299 // Yes, that's not correct. Somebody could, in theory, give us a document which starts with "foo:settings",
300 // where "foo" is mapped to the proper namespace URL.
301 // However, there's no need to bother with this. The "recovery" sub storage we're recovering from is
302 // not part of ODF, so we can impose any format restrictions on it ...
303 }
304 }
305 else
306 {
307 ::rtl::Reference< SettingsImport > pCurrentState( m_aStates.top() );
308 pNewState = pCurrentState->nextState( i_Name );
309 }
310
311 ENSURE_OR_THROW( pNewState.is(), "no new state - aborting import" );
312 pNewState->startElement( i_Attribs );
313
314 m_aStates.push( pNewState );
315 }
316
317 void SAL_CALL SettingsDocumentHandler::endElement( const OUString& )
318 {
319 ENSURE_OR_THROW( !m_aStates.empty(), "no active element" );
320
321 ::rtl::Reference< SettingsImport > pCurrentState( m_aStates.top() );
322 pCurrentState->endElement();
323 m_aStates.pop();
324 }
325
326 void SAL_CALL SettingsDocumentHandler::characters( const OUString& i_Chars )
327 {
328 ENSURE_OR_THROW( !m_aStates.empty(), "no active element" );
329
330 ::rtl::Reference< SettingsImport > pCurrentState( m_aStates.top() );
331 pCurrentState->characters( i_Chars );
332 }
333
334 void SAL_CALL SettingsDocumentHandler::ignorableWhitespace( const OUString& )
335 {
336 // ignore them - that's why they're called "ignorable"
337 }
338
339 void SAL_CALL SettingsDocumentHandler::processingInstruction( const OUString&, const OUString& )
340 {
341 OSL_FAIL( "SettingsDocumentHandler::processingInstruction: unexpected ..." );
342 }
343
344 void SAL_CALL SettingsDocumentHandler::setDocumentLocator( const Reference< XLocator >& ) {}
345
346 // SubComponentRecovery
348 {
349 switch ( i_eType )
350 {
351 case FORM:
352 return "forms";
353 case REPORT:
354 return "reports";
355 case TABLE:
356 return "tables";
357 case QUERY:
358 return "queries";
359 case RELATION_DESIGN:
360 return "relations";
361 default:
362 break;
363 }
364
365 OSL_FAIL( "SubComponentRecovery::getComponentsStorageName: unimplemented case!" );
366 return OUString();
367 }
368
369 void SubComponentRecovery::saveToRecoveryStorage( const Reference< XStorage >& i_rRecoveryStorage,
370 MapCompTypeToCompDescs& io_mapCompDescs )
371 {
372 if ( m_eType == UNKNOWN )
373 // quite fatal, but has already been reported (as assertion) before
374 return;
375
376 // open the sub storage for the given kind of components
377 const OUString& rStorageName( getComponentsStorageName( m_eType ) );
378 const Reference< XStorage > xComponentsStorage( i_rRecoveryStorage->openStorageElement(
379 rStorageName, ElementModes::READWRITE ), UNO_SET_THROW );
380
381 // find a free sub storage name, and create Yet Another Sub Storage
382 const OUString& rBaseName( lcl_getComponentStorageBaseName( m_eType ) );
383 const OUString sStorName = ::dbtools::createUniqueName( xComponentsStorage, rBaseName );
384 const Reference< XStorage > xObjectStor( xComponentsStorage->openStorageElement(
385 sStorName, ElementModes::READWRITE ), UNO_SET_THROW );
386
387 switch ( m_eType )
388 {
389 case FORM:
390 case REPORT:
391 impl_saveSubDocument_throw( xObjectStor );
392 break;
393
394 case QUERY:
395 impl_saveQueryDesign_throw( xObjectStor );
396 break;
397
398 default:
399 // TODO
400 OSL_FAIL( "SubComponentRecoverys::saveToRecoveryStorage: unimplemented case!" );
401 break;
402 }
403
404 // commit the storage(s)
406 tools::stor::commitStorageIfWriteable( xComponentsStorage );
407
408 // remember the relationship from the component name to the storage name
409 MapStringToCompDesc& rMapCompDescs = io_mapCompDescs[ m_eType ];
410 OSL_ENSURE( rMapCompDescs.find( sStorName ) == rMapCompDescs.end(),
411 "SubComponentRecoverys::saveToRecoveryStorage: object name already used!" );
412 rMapCompDescs[ sStorName ] = m_aCompDesc;
413 }
414
416 {
417 // ask the controller
418 Pair< sal_Int32, OUString > aComponentIdentity = m_xDocumentUI->identifySubComponent( m_xComponent );
419 m_eType = lcl_databaseObjectToSubComponentType( aComponentIdentity.First );
420 m_aCompDesc.sName = aComponentIdentity.Second;
421
422 // what the controller didn't give us is the information whether this is in edit mode or not ...
423 Reference< XModuleManager2 > xModuleManager( ModuleManager::create(m_rContext) );
424 const OUString sModuleIdentifier = xModuleManager->identify( m_xComponent );
425
426 switch ( m_eType )
427 {
428 case TABLE:
429 m_aCompDesc.bForEditing = sModuleIdentifier == "com.sun.star.sdb.TableDesign";
430 break;
431
432 case QUERY:
433 m_aCompDesc.bForEditing = sModuleIdentifier == "com.sun.star.sdb.QueryDesign";
434 break;
435
436 case REPORT:
437 if ( sModuleIdentifier == "com.sun.star.report.ReportDefinition" )
438 {
439 // it's an SRB report designer
441 break;
442 }
443 [[fallthrough]];
444
445 case FORM:
446 m_aCompDesc.bForEditing = !lcl_determineReadOnly( m_xComponent );
447 break;
448
449 default:
450 if ( sModuleIdentifier == "com.sun.star.sdb.RelationDesign" )
451 {
454 }
455 else
456 {
457 OSL_FAIL( "SubComponentRecovery::impl_identifyComponent_throw: couldn't classify the given sub component!" );
458 }
459 break;
460 }
461
462 SAL_WARN_IF( m_eType == UNKNOWN, "dbaccess",
463 "SubComponentRecovery::impl_identifyComponent_throw: couldn't classify the component!" );
464 }
465
466 void SubComponentRecovery::impl_saveQueryDesign_throw( const Reference< XStorage >& i_rObjectStorage )
467 {
468 ENSURE_OR_THROW( m_eType == QUERY, "illegal sub component type" );
469 ENSURE_OR_THROW( i_rObjectStorage.is(), "illegal storage" );
470
471 // retrieve the current query design (which might differ from what we can retrieve as ActiveCommand property, since
472 // the latter is updated only upon successful save of the design)
473 Reference< XPropertySet > xDesignerProps( m_xComponent, UNO_QUERY_THROW );
474 Sequence< PropertyValue > aCurrentQueryDesign;
475 OSL_VERIFY( xDesignerProps->getPropertyValue( "CurrentQueryDesign" ) >>= aCurrentQueryDesign );
476
477 // write the query design
478 StorageXMLOutputStream aDesignOutput( m_rContext, i_rObjectStorage, sSettingsStreamName );
479 SettingsExportContext aSettingsExportContext( m_rContext, aDesignOutput );
480
481 static constexpr OUStringLiteral sWhitespace( u" " );
482
483 aDesignOutput.startElement( "office:settings" );
484 aDesignOutput.ignorableWhitespace( sWhitespace );
485
486 XMLSettingsExportHelper aSettingsExporter( aSettingsExportContext );
487 aSettingsExporter.exportAllSettings( aCurrentQueryDesign, sCurrentQueryDesignName );
488
489 aDesignOutput.ignorableWhitespace( sWhitespace );
490 aDesignOutput.endElement();
491 aDesignOutput.close();
492 }
493
494 void SubComponentRecovery::impl_saveSubDocument_throw( const Reference< XStorage >& i_rObjectStorage )
495 {
496 ENSURE_OR_THROW( ( m_eType == FORM ) || ( m_eType == REPORT ), "illegal sub component type" );
497 ENSURE_OR_THROW( i_rObjectStorage.is(), "illegal storage" );
498
499 // store the document into the storage
500 Reference< XStorageBasedDocument > xStorageDocument( m_xComponent, UNO_QUERY_THROW );
501 xStorageDocument->storeToStorage( i_rObjectStorage, Sequence< PropertyValue >() );
502 }
503
504 Reference< XComponent > SubComponentRecovery::impl_recoverSubDocument_throw( const Reference< XStorage >& i_rRecoveryStorage,
505 const OUString& i_rComponentName, const bool i_bForEditing )
506 {
507 Reference< XComponent > xSubComponent;
508 Reference< XCommandProcessor > xDocDefinition;
509
511 aLoadArgs.put( "RecoveryStorage", i_rRecoveryStorage );
512
513 // load/create the sub component hidden. We'll show it when the main app window is shown.
514 aLoadArgs.put( "Hidden", true );
515
516 if ( !i_rComponentName.isEmpty() )
517 {
518 xDocDefinition = lcl_getSubComponentDef_nothrow( m_xDocumentUI, m_eType, i_rComponentName );
519 xSubComponent.set( m_xDocumentUI->loadComponentWithArguments(
520 m_eType,
521 i_rComponentName,
522 i_bForEditing,
523 aLoadArgs.getPropertyValues()
524 ),
525 UNO_SET_THROW
526 );
527 }
528 else
529 {
530 Reference< XComponent > xDocDefComponent;
531 xSubComponent.set( m_xDocumentUI->createComponentWithArguments(
532 m_eType,
533 aLoadArgs.getPropertyValues(),
534 xDocDefComponent
535 ),
536 UNO_SET_THROW
537 );
538
539 xDocDefinition.set( xDocDefComponent, UNO_QUERY );
540 OSL_ENSURE( xDocDefinition.is(), "DatabaseDocumentRecovery::recoverSubDocuments: loaded a form/report, but don't have a document definition?!" );
541 }
542
543 if ( xDocDefinition.is() )
544 {
545 Reference< XController > xController( m_xDocumentUI, UNO_QUERY_THROW );
546 rtl::Reference( new SubComponentLoader( xController, xDocDefinition ) );
547 }
548
549 return xSubComponent;
550 }
551
552 Reference< XComponent > SubComponentRecovery::impl_recoverQueryDesign_throw( const Reference< XStorage >& i_rRecoveryStorage,
553 const OUString& i_rComponentName, const bool i_bForEditing )
554 {
555 Reference< XComponent > xSubComponent;
556
557 // first read the settings query design settings from the storage
558 StorageXMLInputStream aDesignInput( m_rContext, i_rRecoveryStorage, sSettingsStreamName );
559
560 ::rtl::Reference< SettingsDocumentHandler > pDocHandler( new SettingsDocumentHandler );
561 aDesignInput.import( pDocHandler );
562
563 const ::comphelper::NamedValueCollection& rSettings( pDocHandler->getSettings() );
564 const Any& aCurrentQueryDesign = rSettings.get( sCurrentQueryDesignName );
565#if OSL_DEBUG_LEVEL > 0
566 Sequence< PropertyValue > aQueryDesignLayout;
567 OSL_VERIFY( aCurrentQueryDesign >>= aQueryDesignLayout );
568#endif
569
570 // then load the query designer
572 aLoadArgs.put( "CurrentQueryDesign", aCurrentQueryDesign );
573 aLoadArgs.put( "Hidden", true );
574
575 if ( !i_rComponentName.isEmpty() )
576 {
577 xSubComponent.set( m_xDocumentUI->loadComponentWithArguments(
578 m_eType,
579 i_rComponentName,
580 i_bForEditing,
581 aLoadArgs.getPropertyValues()
582 ),
583 UNO_SET_THROW
584 );
585 }
586 else
587 {
588 Reference< XComponent > xDummy;
589 xSubComponent.set( m_xDocumentUI->createComponentWithArguments(
590 m_eType,
591 aLoadArgs.getPropertyValues(),
592 xDummy
593 ),
594 UNO_SET_THROW
595 );
596 }
597
598 Reference< XController > xController( m_xDocumentUI, UNO_QUERY_THROW );
599 rtl::Reference( new SubComponentLoader( xController, xSubComponent ) );
600
601 return xSubComponent;
602 }
603
604 Reference< XComponent > SubComponentRecovery::recoverFromStorage( const Reference< XStorage >& i_rRecoveryStorage,
605 const OUString& i_rComponentName, const bool i_bForEditing )
606 {
607 Reference< XComponent > xSubComponent;
608 switch ( m_eType )
609 {
610 case FORM:
611 case REPORT:
612 xSubComponent = impl_recoverSubDocument_throw( i_rRecoveryStorage, i_rComponentName, i_bForEditing );
613 break;
614 case QUERY:
615 xSubComponent = impl_recoverQueryDesign_throw( i_rRecoveryStorage, i_rComponentName, i_bForEditing );
616 break;
617 default:
618 OSL_FAIL( "SubComponentRecovery::recoverFromStorage: unimplemented case!" );
619 break;
620 }
621 return xSubComponent;
622 }
623
624} // namespace dbaccess
625
626/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void exportAllSettings(const css::uno::Sequence< css::beans::PropertyValue > &aProps, const OUString &rName) const
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
void import(const css::uno::Reference< css::xml::sax::XDocumentHandler > &i_rHandler)
void startElement(const OUString &i_rElementName)
void characters(const OUString &i_rCharacters) const
void addAttribute(const OUString &i_rName, const OUString &i_rValue) const
void ignorableWhitespace(const OUString &i_rWhitespace) const
is a helper class which loads/opens a given sub component as soon as the main application window beco...
void impl_saveSubDocument_throw(const css::uno::Reference< css::embed::XStorage > &i_rObjectStorage)
css::uno::Reference< css::lang::XComponent > impl_recoverQueryDesign_throw(const css::uno::Reference< css::embed::XStorage > &i_rRecoveryStorage, const OUString &i_rComponentName, const bool i_bForEditing)
const css::uno::Reference< css::uno::XComponentContext > & m_rContext
css::uno::Reference< css::lang::XComponent > recoverFromStorage(const css::uno::Reference< css::embed::XStorage > &i_rRecoveryStorage, const OUString &i_rComponentName, const bool i_bForEditing)
css::uno::Reference< css::lang::XComponent > impl_recoverSubDocument_throw(const css::uno::Reference< css::embed::XStorage > &i_rRecoveryStorage, const OUString &i_rComponentName, const bool i_bForEditing)
const css::uno::Reference< css::lang::XComponent > m_xComponent
static OUString getComponentsStorageName(const SubComponentType i_eType)
void saveToRecoveryStorage(const css::uno::Reference< css::embed::XStorage > &i_rRecoveryStorage, MapCompTypeToCompDescs &io_mapCompDescs)
css::uno::Reference< css::sdb::application::XDatabaseDocumentUI > m_xDocumentUI
void impl_saveQueryDesign_throw(const css::uno::Reference< css::embed::XStorage > &i_rObjectStorage)
#define ENSURE_OR_THROW(c, m)
#define ENSURE_OR_RETURN(c, m, r)
#define DBG_UNHANDLED_EXCEPTION(...)
float u
OUString aName
#define SAL_WARN_IF(condition, area, stream)
constexpr OUStringLiteral aData
bool commitStorageIfWriteable(const css::uno::Reference< css::embed::XStorage > &_rxStorage)
commits a given storage if it's not readonly
std::unordered_map< OUString, SubComponentDescriptor > MapStringToCompDesc
std::map< SubComponentType, MapStringToCompDesc > MapCompTypeToCompDescs
::cppu::WeakImplHelper< XDocumentHandler > SettingsDocumentHandler_Base
XML_NP_CONFIG
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
Reference< XController > xController
the controller of the sub component. Must not be <NULL>
::comphelper::NamedValueCollection m_aSettings
StorageXMLOutputStream & m_rDelegator
const OUString m_aNamespace
const Reference< XComponentContext > & m_rContext
std::stack< ::rtl::Reference< SettingsImport > > m_aStates