View | Details | Raw Unified | Return to issue 107512
Collapse All | Expand All

(-)sfx2/source/doc/docfile.cxx (-11 / +21 lines)
Lines 356-361 public: Link Here
356
    sal_Bool m_bVersionsAlreadyLoaded: 1;
356
    sal_Bool m_bVersionsAlreadyLoaded: 1;
357
    sal_Bool m_bLocked: 1;
357
    sal_Bool m_bLocked: 1;
358
    sal_Bool m_bGotDateTime: 1;
358
    sal_Bool m_bGotDateTime: 1;
359
    sal_Bool m_bTriedToCreateLogRing: 1; // whether we already attempted to create m_xLogRing
359
360
360
    uno::Reference < embed::XStorage > xStorage;
361
    uno::Reference < embed::XStorage > xStorage;
361
362
Lines 404-409 public: Link Here
404
405
405
    SfxMedium_Impl( SfxMedium* pAntiImplP );
406
    SfxMedium_Impl( SfxMedium* pAntiImplP );
406
    ~SfxMedium_Impl();
407
    ~SfxMedium_Impl();
408
409
    void CreateLogRing();
407
};
410
};
408
411
409
void SfxMedium::DataAvailable_Impl()
412
void SfxMedium::DataAvailable_Impl()
Lines 451-456 SfxMedium_Impl::SfxMedium_Impl( SfxMedium* pAntiImplP ) Link Here
451
    m_bVersionsAlreadyLoaded( sal_False ),
454
    m_bVersionsAlreadyLoaded( sal_False ),
452
    m_bLocked( sal_False ),
455
    m_bLocked( sal_False ),
453
    m_bGotDateTime( sal_False ),
456
    m_bGotDateTime( sal_False ),
457
    m_bTriedToCreateLogRing( sal_False ),
454
    pAntiImpl( pAntiImplP ),
458
    pAntiImpl( pAntiImplP ),
455
    nFileVersion( 0 ),
459
    nFileVersion( 0 ),
456
    pOrigFilter( 0 ),
460
    pOrigFilter( 0 ),
Lines 474-479 SfxMedium_Impl::~SfxMedium_Impl() Link Here
474
        delete pTempFile;
478
        delete pTempFile;
475
}
479
}
476
480
481
void SfxMedium_Impl::CreateLogRing()
482
{
483
    if ( !m_bTriedToCreateLogRing && !m_xLogRing.is() )
484
    {
485
        m_bTriedToCreateLogRing = sal_True;
486
        try
487
        {
488
            ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
489
            if ( aContext.is() )
490
                m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
491
        }
492
        catch( uno::Exception& )
493
        {}
494
    }
495
}
496
477
//================================================================
497
//================================================================
478
498
479
#define IMPL_CTOR(rootVal,URLVal)			\
499
#define IMPL_CTOR(rootVal,URLVal)			\
Lines 508-524 sal_uInt32 SfxMedium::GetLastStorageCreationState() Link Here
508
//------------------------------------------------------------------
528
//------------------------------------------------------------------
509
void SfxMedium::AddLog( const ::rtl::OUString& aMessage )
529
void SfxMedium::AddLog( const ::rtl::OUString& aMessage )
510
{
530
{
511
    if ( !pImp->m_xLogRing.is() )
531
    pImp->CreateLogRing();
512
    {
513
        try
514
        {
515
            ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
516
            if ( aContext.is() )
517
                pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
518
        }
519
        catch( uno::Exception& )
520
        {}
521
    }
522
532
523
    if ( pImp->m_xLogRing.is() )
533
    if ( pImp->m_xLogRing.is() )
524
        pImp->m_xLogRing->logString( aMessage );
534
        pImp->m_xLogRing->logString( aMessage );
(-)sfx2/source/doc/objmisc.cxx (-14 / +10 lines)
Lines 2488-2506 void SfxObjectShell_Impl::showBrokenSignatureWarning( const uno::Reference< task Link Here
2488
    }
2488
    }
2489
}
2489
}
2490
2490
2491
void SfxObjectShell::AddLog( const ::rtl::OUString& aMessage )
2491
void SfxObjectShell_Impl::CreateLogRing()
2492
{
2492
{
2493
    if ( !pImp->m_xLogRing.is() )
2493
    if ( !m_bTriedToCreateLogRing && !m_xLogRing.is() )
2494
    {
2494
    {
2495
        m_bTriedToCreateLogRing = sal_True;
2495
        try
2496
        try
2496
        {
2497
        {
2497
            ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
2498
            ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
2498
            if ( aContext.is() )
2499
            if ( aContext.is() )
2499
                pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
2500
                m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
2500
        }
2501
        }
2501
        catch( uno::Exception& )
2502
        catch( uno::Exception& )
2502
        {}
2503
        {}
2503
    }
2504
    }
2505
}
2506
2507
void SfxObjectShell::AddLog( const ::rtl::OUString& aMessage )
2508
{
2509
    pImp->CreateLogRing();
2504
2510
2505
    if ( pImp->m_xLogRing.is() )
2511
    if ( pImp->m_xLogRing.is() )
2506
        pImp->m_xLogRing->logString( aMessage );
2512
        pImp->m_xLogRing->logString( aMessage );
Lines 2526-2542 void WriteStringInStream( const uno::Reference< io::XOutputStream >& xOutStream, Link Here
2526
2532
2527
void SfxObjectShell::StoreLog()
2533
void SfxObjectShell::StoreLog()
2528
{
2534
{
2529
    if ( !pImp->m_xLogRing.is() )
2535
    pImp->CreateLogRing();
2530
    {
2531
        try
2532
        {
2533
            ::comphelper::ComponentContext aContext( ::comphelper::getProcessServiceFactory() );
2534
            if ( aContext.is() )
2535
                pImp->m_xLogRing.set( aContext.getSingleton( "com.sun.star.logging.DocumentIOLogRing" ), UNO_QUERY_THROW );
2536
        }
2537
        catch( uno::Exception& )
2538
        {}
2539
    }
2540
2536
2541
    if ( pImp->m_xLogRing.is() )
2537
    if ( pImp->m_xLogRing.is() )
2542
    {
2538
    {
(-)sfx2/source/doc/objxtor.cxx (+1 lines)
Lines 272-277 SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell ) Link Here
272
    ,bSaveVersionOnClose( sal_False )
272
    ,bSaveVersionOnClose( sal_False )
273
    ,m_bSharedXMLFlag( sal_False )
273
    ,m_bSharedXMLFlag( sal_False )
274
    ,m_bAllowShareControlFileClean( sal_True )
274
    ,m_bAllowShareControlFileClean( sal_True )
275
    ,m_bTriedToCreateLogRing( sal_False )
275
    ,lErr(ERRCODE_NONE)
276
    ,lErr(ERRCODE_NONE)
276
    ,nEventId ( 0)
277
    ,nEventId ( 0)
277
    ,bDoNotTouchDocInfo( sal_False )
278
    ,bDoNotTouchDocInfo( sal_False )
(-)sfx2/source/inc/objshimp.hxx (-1 / +4 lines)
Lines 120-126 struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess Link Here
120
                        bUseUserData:1,
120
                        bUseUserData:1,
121
                        bSaveVersionOnClose:1,
121
                        bSaveVersionOnClose:1,
122
                        m_bSharedXMLFlag:1, // whether the flag should be stored in xml file
122
                        m_bSharedXMLFlag:1, // whether the flag should be stored in xml file
123
                        m_bAllowShareControlFileClean:1; // whether the flag should be stored in xml file
123
                        m_bAllowShareControlFileClean:1, // whether the flag should be stored in xml file
124
                        m_bTriedToCreateLogRing:1; // whether we already attempted to create m_xLogRing
124
125
125
    String              aNewName;  // Der Name, unter dem das Doc gespeichert
126
    String              aNewName;  // Der Name, unter dem das Doc gespeichert
126
                                   // werden soll
127
                                   // werden soll
Lines 192-197 struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess Link Here
192
193
193
    virtual sal_Bool hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor );
194
    virtual sal_Bool hasTrustedScriptingSignature( sal_Bool bAllowUIToAddAuthor );
194
    virtual void showBrokenSignatureWarning( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction ) const;
195
    virtual void showBrokenSignatureWarning( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler >& _rxInteraction ) const;
196
197
    void CreateLogRing();
195
};
198
};
196
199
197
#endif
200
#endif

Return to issue 107512