sfx2/source/doc/doctemplates.cxx            |   16 ++++++++++++++++
 svtools/source/misc/templatefoldercache.cxx |   22 ++++++++++++++++++++++
 2 files changed, 38 insertions(+)

New commits:
commit 7450e8fa17ddc87ac12b2bc08e075629b506b263
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Apr 22 15:32:51 2025 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Apr 22 15:44:39 2025 +0200

    Some more SAL_INFO around SfxDocTplService initialization
    
    (for allo#493)
    
    Change-Id: I15f19397d94ac7513df4384aa627e7eeee60c80d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184443
    Tested-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>

diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 23257dbc5949..c857244dfafd 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -401,34 +401,45 @@ void SfxDocTplService_Impl::init_Impl()
     // entry if necessary
 
     maRootURL = ( TEMPLATE_ROOT_URL "/" ) + 
LanguageTag::convertToBcp47(maLocale);
+    SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl <" << maRootURL << 
">");
 
     const OUString aTemplVersPropName( TEMPLATE_VERSION  );
     const OUString aTemplVers( TEMPLATE_VERSION_VALUE  );
     if ( Content::create( maRootURL, maCmdEnv, 
comphelper::getProcessComponentContext(), maRootContent ) )
     {
+        SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl A");
         uno::Any aValue;
         OUString aPropValue;
         if ( getProperty( maRootContent, aTemplVersPropName, aValue )
           && ( aValue >>= aPropValue )
           && aPropValue == aTemplVers )
         {
+            SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl B");
             bIsInitialized = true;
         }
         else
+        {
+            SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl C");
             removeContent( maRootContent );
+        }
     }
 
     if ( !bIsInitialized )
     {
+        SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl D");
         if ( createFolder( maRootURL, true, false, maRootContent )
           && setProperty( maRootContent, aTemplVersPropName, uno::makeAny( 
aTemplVers ) ) )
+        {
+            SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl E");
             bIsInitialized = true;
+        }
 
         bNeedsUpdate = true;
     }
 
     if ( bIsInitialized )
     {
+        SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl F");
         try {
             m_xDocProps.set(document::DocumentProperties::create(
                         ::comphelper::getProcessComponentContext()));
@@ -445,6 +456,7 @@ void SfxDocTplService_Impl::init_Impl()
 
         if ( bNeedsUpdate )
         {
+            SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl G");
             aGuard.clear();
             SolarMutexClearableGuard aSolarGuard;
 
@@ -459,8 +471,11 @@ void SfxDocTplService_Impl::init_Impl()
             pWin.disposeAndClear();
         }
         else if ( needsUpdate() )
+        {
+            SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl H");
             // the UI should be shown only on the first update
             update();
+        }
     }
     else
     {
@@ -468,6 +483,7 @@ void SfxDocTplService_Impl::init_Impl()
     }
 
     mbIsInitialized = bIsInitialized;
+    SAL_INFO("sfx.doc", "SfxDocTplService_Impl::init_Impl: " << 
mbIsInitialized);
 }
 
 
diff --git a/svtools/source/misc/templatefoldercache.cxx 
b/svtools/source/misc/templatefoldercache.cxx
index 87bf5694875c..35c651012f77 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -208,15 +208,25 @@ namespace svt
                 return true;
                     // this is not strictly true, in case only one is invalid 
- but this is a heavy error anyway
             }
+            SAL_INFO("svtools.misc", "TemplateContentEqual <" << 
_rLHS->getURL() << "> " << _rLHS->getModDate().Year << "-" << 
_rLHS->getModDate().Month << "-" << _rLHS->getModDate().Day << " " << 
_rLHS->getModDate().Hours << ":" << _rLHS->getModDate().Minutes << ":" << 
_rLHS->getModDate().Seconds << "." << _rLHS->getModDate().NanoSeconds << " " << 
bool(_rLHS->getModDate().IsUTC) << " " << _rLHS->getSubContents().size() << " 
vs. <" << _rRHS->getURL() << "> " << _rRHS->getModDate().Year << "-" << 
_rRHS->getModDate().Month << "-" << _rRHS->getModDate().Day << " " << 
_rRHS->getModDate().Hours << ":" << _rRHS->getModDate().Minutes << ":" << 
_rRHS->getModDate().Seconds << "." << _rRHS->getModDate().NanoSeconds << " " << 
bool(_rRHS->getModDate().IsUTC) << " " << _rRHS->getSubContents().size());
 
             if ( _rLHS->getURL() != _rRHS->getURL() )
+            {
+                SAL_INFO("svtools.misc", "TemplateContentEqual HIT 1 <" << 
_rLHS->getURL() << "> " << _rLHS->getModDate().Year << "-" << 
_rLHS->getModDate().Month << "-" << _rLHS->getModDate().Day << " " << 
_rLHS->getModDate().Hours << ":" << _rLHS->getModDate().Minutes << ":" << 
_rLHS->getModDate().Seconds << "." << _rLHS->getModDate().NanoSeconds << " " << 
bool(_rLHS->getModDate().IsUTC) << " " << _rLHS->getSubContents().size() << " 
vs. <" << _rRHS->getURL() << "> " << _rRHS->getModDate().Year << "-" << 
_rRHS->getModDate().Month << "-" << _rRHS->getModDate().Day << " " << 
_rRHS->getModDate().Hours << ":" << _rRHS->getModDate().Minutes << ":" << 
_rRHS->getModDate().Seconds << "." << _rRHS->getModDate().NanoSeconds << " " << 
bool(_rRHS->getModDate().IsUTC) << " " << _rRHS->getSubContents().size());
                 return false;
+            }
 
             if ( _rLHS->getModDate() != _rRHS->getModDate() )
+            {
+                SAL_INFO("svtools.misc", "TemplateContentEqual HIT 2 <" << 
_rLHS->getURL() << "> " << _rLHS->getModDate().Year << "-" << 
_rLHS->getModDate().Month << "-" << _rLHS->getModDate().Day << " " << 
_rLHS->getModDate().Hours << ":" << _rLHS->getModDate().Minutes << ":" << 
_rLHS->getModDate().Seconds << "." << _rLHS->getModDate().NanoSeconds << " " << 
bool(_rLHS->getModDate().IsUTC) << " " << _rLHS->getSubContents().size() << " 
vs. <" << _rRHS->getURL() << "> " << _rRHS->getModDate().Year << "-" << 
_rRHS->getModDate().Month << "-" << _rRHS->getModDate().Day << " " << 
_rRHS->getModDate().Hours << ":" << _rRHS->getModDate().Minutes << ":" << 
_rRHS->getModDate().Seconds << "." << _rRHS->getModDate().NanoSeconds << " " << 
bool(_rRHS->getModDate().IsUTC) << " " << _rRHS->getSubContents().size());
                 return false;
+            }
 
             if ( _rLHS->getSubContents().size() != 
_rRHS->getSubContents().size() )
+            {
+                SAL_INFO("svtools.misc", "TemplateContentEqual HIT 3 <" << 
_rLHS->getURL() << "> " << _rLHS->getModDate().Year << "-" << 
_rLHS->getModDate().Month << "-" << _rLHS->getModDate().Day << " " << 
_rLHS->getModDate().Hours << ":" << _rLHS->getModDate().Minutes << ":" << 
_rLHS->getModDate().Seconds << "." << _rLHS->getModDate().NanoSeconds << " " << 
bool(_rLHS->getModDate().IsUTC) << " " << _rLHS->getSubContents().size() << " 
vs. <" << _rRHS->getURL() << "> " << _rRHS->getModDate().Year << "-" << 
_rRHS->getModDate().Month << "-" << _rRHS->getModDate().Day << " " << 
_rRHS->getModDate().Hours << ":" << _rRHS->getModDate().Minutes << ":" << 
_rRHS->getModDate().Seconds << "." << _rRHS->getModDate().NanoSeconds << " " << 
bool(_rRHS->getModDate().IsUTC) << " " << _rRHS->getSubContents().size());
                 return false;
+            }
 
             if ( !_rLHS->getSubContents().empty() )
             {   // there are children
@@ -228,7 +238,11 @@ namespace svt
                     *this
                 );
                 if ( aFirstDifferent.first != _rLHS->getSubContents().end() )
+                {
+                    SAL_INFO("svtools.misc", "TemplateContentEqual HIT 4 <" << 
_rLHS->getURL() << "> " << _rLHS->getModDate().Year << "-" << 
_rLHS->getModDate().Month << "-" << _rLHS->getModDate().Day << " " << 
_rLHS->getModDate().Hours << ":" << _rLHS->getModDate().Minutes << ":" << 
_rLHS->getModDate().Seconds << "." << _rLHS->getModDate().NanoSeconds << " " << 
bool(_rLHS->getModDate().IsUTC) << " " << _rLHS->getSubContents().size() << " 
vs. <" << _rRHS->getURL() << "> " << _rRHS->getModDate().Year << "-" << 
_rRHS->getModDate().Month << "-" << _rRHS->getModDate().Day << " " << 
_rRHS->getModDate().Hours << ":" << _rRHS->getModDate().Minutes << ":" << 
_rRHS->getModDate().Seconds << "." << _rRHS->getModDate().NanoSeconds << " " << 
bool(_rRHS->getModDate().IsUTC) << " " << _rRHS->getSubContents().size());
+
                     return false;// the sub contents differ
+                }
             }
 
             return true;
@@ -452,6 +466,7 @@ namespace svt
 
     bool TemplateFolderCacheImpl::equalStates( const TemplateFolderContent& 
_rLHS, const TemplateFolderContent& _rRHS )
     {
+        SAL_INFO("svtools.misc", "TemplateFolderCacheImpl::equalStates " << 
_rLHS.size() << " " << _rRHS.size());
         if ( _rLHS.size() != _rRHS.size() )
             return false;
 
@@ -471,6 +486,7 @@ namespace svt
 
     void TemplateFolderCacheImpl::storeState()
     {
+        SAL_INFO("svtools.misc", "TemplateFolderCacheImpl::storeState");
         if ( !m_bValidCurrentState )
             readCurrentState( );
 
@@ -718,6 +734,7 @@ namespace svt
 
     bool TemplateFolderCacheImpl::needsUpdate()
     {
+        SAL_INFO("svtools.misc", "TemplateFolderCacheImpl::needsUpdate " << 
m_bKnowState << " " << m_bNeedsUpdate);
         if ( m_bKnowState )
             return m_bNeedsUpdate;
 
@@ -726,19 +743,24 @@ namespace svt
 
         if ( readCurrentState() )
         {
+            SAL_INFO("svtools.misc", "TemplateFolderCacheImpl::needsUpdate A");
             // open the stream which contains the cached state of the 
directories
             if ( openCacheStream( true ) )
             {   // opening the stream succeeded
+                SAL_INFO("svtools.misc", "TemplateFolderCacheImpl::needsUpdate 
B");
                 if ( readPreviousState() )
                 {
+                    SAL_INFO("svtools.misc", 
"TemplateFolderCacheImpl::needsUpdate C");
                     m_bNeedsUpdate = !equalStates( m_aPreviousState, 
m_aCurrentState );
                 }
                 else
                 {
+                    SAL_INFO("svtools.misc", 
"TemplateFolderCacheImpl::needsUpdate D");
                     closeCacheStream();
                 }
             }
         }
+        SAL_INFO("svtools.misc", "TemplateFolderCacheImpl::needsUpdate: " << 
m_bNeedsUpdate);
         return m_bNeedsUpdate;
     }
 

Reply via email to