Lines 84-92
Link Here
|
84 |
} |
84 |
} |
85 |
|
85 |
|
86 |
|
86 |
|
87 |
sal_uInt32 SwXMLWriter::_Write( SfxMedium* pTargetMedium ) |
87 |
sal_uInt32 SwXMLWriter::_Write( const uno::Reference < task::XStatusIndicator >& xStatusIndicator, const rtl::OUString& aDocHierarchicalName ) |
88 |
{ |
88 |
{ |
89 |
DBG_ASSERT( pTargetMedium, "No medium is provided!" ); |
|
|
90 |
// Get service factory |
89 |
// Get service factory |
91 |
uno::Reference< lang::XMultiServiceFactory > xServiceFactory = |
90 |
uno::Reference< lang::XMultiServiceFactory > xServiceFactory = |
92 |
comphelper::getProcessServiceFactory(); |
91 |
comphelper::getProcessServiceFactory(); |
Lines 187-236
Link Here
|
187 |
xInfoSet->setPropertyValue( sTargetStorage, Any( xStg ) ); |
186 |
xInfoSet->setPropertyValue( sTargetStorage, Any( xStg ) ); |
188 |
|
187 |
|
189 |
// create XStatusIndicator |
188 |
// create XStatusIndicator |
190 |
uno::Reference<task::XStatusIndicator> xStatusIndicator; |
189 |
// uno::Reference<task::XStatusIndicator> xStatusIndicator; |
191 |
|
190 |
|
192 |
uno::Any aAny; |
191 |
uno::Any aAny; |
193 |
if (bShowProgress) |
192 |
if (bShowProgress) |
194 |
{ |
193 |
{ |
195 |
// retrieve status indicator from the medium MediaDescriptor |
|
|
196 |
if ( pTargetMedium ) |
197 |
{ |
198 |
const SfxUnoAnyItem* pStatusBarItem = static_cast<const SfxUnoAnyItem*>( |
199 |
pTargetMedium->GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) ); |
200 |
|
201 |
if ( pStatusBarItem ) |
202 |
pStatusBarItem->GetValue() >>= xStatusIndicator; |
203 |
} |
204 |
|
205 |
// try |
206 |
// { |
207 |
// uno::Reference<frame::XModel> xModel( pDoc->GetDocShell()->GetModel()); |
208 |
// if (xModel.is()) |
209 |
// { |
210 |
// uno::Sequence< beans::PropertyValue > xMediaDescr |
211 |
// uno::Reference<frame::XController> xController( |
212 |
// xModel->getCurrentController()); |
213 |
// if( xController.is()) |
214 |
// { |
215 |
// uno::Reference<frame::XFrame> xFrame( xController->getFrame()); |
216 |
// if( xFrame.is()) |
217 |
// { |
218 |
// uno::Reference<task::XStatusIndicatorFactory> xFactory( |
219 |
// xFrame, uno::UNO_QUERY ); |
220 |
// if( xFactory.is()) |
221 |
// { |
222 |
// xStatusIndicator = |
223 |
// xFactory->createStatusIndicator(); |
224 |
// } |
225 |
// } |
226 |
// } |
227 |
// } |
228 |
// } |
229 |
// catch( const RuntimeException& ) |
230 |
// { |
231 |
// xStatusIndicator = 0; |
232 |
// } |
233 |
|
234 |
// set progress range and start status indicator |
194 |
// set progress range and start status indicator |
235 |
sal_Int32 nProgressRange(1000000); |
195 |
sal_Int32 nProgressRange(1000000); |
236 |
if (xStatusIndicator.is()) |
196 |
if (xStatusIndicator.is()) |
Lines 246-251
Link Here
|
246 |
OUString sProgressMax(RTL_CONSTASCII_USTRINGPARAM("ProgressMax")); |
206 |
OUString sProgressMax(RTL_CONSTASCII_USTRINGPARAM("ProgressMax")); |
247 |
xInfoSet->setPropertyValue(sProgressMax, aAny); |
207 |
xInfoSet->setPropertyValue(sProgressMax, aAny); |
248 |
} |
208 |
} |
|
|
209 |
|
249 |
SvtSaveOptions aSaveOpt; |
210 |
SvtSaveOptions aSaveOpt; |
250 |
OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")); |
211 |
OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting")); |
251 |
sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() ); |
212 |
sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() ); |
Lines 270-290
Link Here
|
270 |
if( pDoc->GetDocPersist()->IsEmbedded() ) |
231 |
if( pDoc->GetDocPersist()->IsEmbedded() ) |
271 |
{ |
232 |
{ |
272 |
OUString aName; |
233 |
OUString aName; |
273 |
if ( pTargetMedium && pTargetMedium->GetItemSet() ) |
234 |
if ( aDocHierarchicalName.getLength() ) |
274 |
{ |
235 |
aName = aDocHierarchicalName; |
275 |
const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>( |
|
|
276 |
pTargetMedium->GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) ); |
277 |
if ( pDocHierarchItem ) |
278 |
aName = pDocHierarchItem->GetValue(); |
279 |
} |
280 |
else |
236 |
else |
281 |
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "dummyObjectName" ) ); |
237 |
aName = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "dummyObjectName" ) ); |
282 |
|
238 |
|
283 |
if( aName.getLength() ) |
239 |
sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")); |
284 |
{ |
240 |
xInfoSet->setPropertyValue( sPropName, makeAny( aName ) ); |
285 |
sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath")); |
|
|
286 |
xInfoSet->setPropertyValue( sPropName, makeAny( aName ) ); |
287 |
} |
288 |
} |
241 |
} |
289 |
|
242 |
|
290 |
if( bBlock ) |
243 |
if( bBlock ) |
Lines 540-551
Link Here
|
540 |
|
493 |
|
541 |
sal_uLong SwXMLWriter::WriteStorage() |
494 |
sal_uLong SwXMLWriter::WriteStorage() |
542 |
{ |
495 |
{ |
543 |
return _Write(); |
496 |
return _Write( uno::Reference < task::XStatusIndicator >(), ::rtl::OUString() ); |
544 |
} |
497 |
} |
545 |
|
498 |
|
546 |
sal_uLong SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium ) |
499 |
sal_uLong SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium ) |
547 |
{ |
500 |
{ |
548 |
return _Write( &aTargetMedium ); |
501 |
uno::Reference < task::XStatusIndicator > xStatusIndicator; |
|
|
502 |
rtl::OUString aName; |
503 |
const SfxUnoAnyItem* pStatusBarItem = static_cast<const SfxUnoAnyItem*>( |
504 |
aTargetMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) ); |
505 |
if ( pStatusBarItem ) |
506 |
pStatusBarItem->GetValue() >>= xStatusIndicator; |
507 |
const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>( |
508 |
aTargetMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) ); |
509 |
if ( pDocHierarchItem ) |
510 |
aName = pDocHierarchItem->GetValue(); |
511 |
|
512 |
return _Write( xStatusIndicator, aName ); |
549 |
} |
513 |
} |
550 |
|
514 |
|
551 |
sal_uLong SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed, |
515 |
sal_uLong SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed, |