Commits

ihi  committed cad6e04

CWS-TOOLING: integrate CWS mav53_DEV300
2009-06-29 13:42:56 +0200 hbrinkm r273471 : #i101593# switched off optimization in table layout, that caused frames to be layouted incorrectly
2009-06-25 12:29:11 +0200 cd r273376 : #i101774# Don't rely on initialize call for VistaFilePicker
2009-06-25 11:48:33 +0200 tl r273373 : #i101420# Gnome accessibility fix
2009-06-24 18:16:49 +0200 od r273361 : #i97309 method <XMLTextParagraphExport::exportListChange(..)>
- export text:start-value at correct list item.
2009-06-23 14:11:44 +0200 b_michaelsen r273281 : #i103032#: cutting of URL-parameters for usage tracking
2009-06-22 11:49:12 +0200 b_michaelsen r273207 : #i102805#: Added usage tracking to SfxToolboxControl
2009-06-22 11:46:00 +0200 b_michaelsen r273205 : whitespace fixes
2009-06-05 14:21:12 +0200 mav r272683 : #i101741# check the file date only in document file locking context

  • Participants
  • Parent commits 1c01475

Comments (0)

Files changed (13)

File comphelper/inc/comphelper/uieventslogger.hxx

 #include <rtl/ustring.hxx>
 
 
-namespace comphelper 
+namespace comphelper
 {
     // this class is part of the OOo Improvement Program Core
     class COMPHELPER_DLLPUBLIC UiEventsLogger
         public:
             static sal_Bool isEnabled();
             static sal_Int32 getSessionLogEventCount();
-            static void appendDispatchOrigin( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args, const ::rtl::OUString& originapp, const ::rtl::OUString& originwidget); 
+            static void appendDispatchOrigin( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args, const ::rtl::OUString& originapp, const ::rtl::OUString& originwidget);
             static ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue> purgeDispatchOrigin(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args);
             static void logDispatch(const ::com::sun::star::util::URL& url, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& args);
             static void logVcl(const ::rtl::OUString& parent_id, sal_Int32 window_type, const ::rtl::OUString& id, const ::rtl::OUString& method, const ::rtl::OUString& param);

File comphelper/source/misc/uieventslogger.cxx

     };
 }
 
-namespace comphelper 
+namespace comphelper
 {
     // declaration of implementation
     class UiEventsLogger_Impl;
             //typedefs and friends
             friend class UiEventsLogger;
             typedef UiEventsLogger_Impl* ptr;
-            
+
             // instance methods and data
             UiEventsLogger_Impl();
             void initializeLogger();
             Reference<XCsvLogFormatter> m_Formatter;
             map<OUString, OUString> m_OriginAppAbbr;
             map<OUString, OUString> m_OriginWidgetAbbr;
-            
+
 
             // static methods and data
             static ptr getInstance();
         args[old_length+1].Name = UiEventsLogger_Impl::LOGORIGINWIDGET;
         args[old_length+1].Value = static_cast<Any>(originwidget);
     }
-    
+
     Sequence<PropertyValue> UiEventsLogger::purgeDispatchOrigin(
         const Sequence<PropertyValue>& args)
     {
                 && args[source_idx].Name != UiEventsLogger_Impl::LOGORIGINWIDGET)
                 result[target_idx++] = args[source_idx];
         result.realloc(target_idx);
-        return result; 
+        return result;
     }
 
     void UiEventsLogger::logDispatch(
         {
             UiEventsLogger_Impl::instance->disposing();
             delete UiEventsLogger_Impl::instance;
-            UiEventsLogger_Impl::instance = NULL; 
+            UiEventsLogger_Impl::instance = NULL;
         }
     }
 
         }
         else
             logdata[2] = UNKNOWN_ORIGIN;
-        logdata[3] = url.Complete;
         if(url.Complete.match(URL_FILE))
             logdata[3] = URL_FILE;
+        else
+            logdata[3] = url.Main;
         m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata));
         m_SessionLogEventCount++;
     }
         logdata[0] = ETYPE_ROTATED;
         m_Logger->log(LogLevel::INFO, m_Formatter->formatMultiColumn(logdata));
     }
-    
+
     void UiEventsLogger_Impl::logVcl(
         const OUString& parent_id,
         sal_Int32 window_type,
     {
         FileBase::RC result = File::move(getCurrentPath(), getRotatedPath());
         if(result!=FileBase::E_None && result!=FileBase::E_NOENT)
-            m_Active = false; 
+            m_Active = false;
     }
 
     void UiEventsLogger_Impl::hotRotate()
             sm->createInstanceWithArguments(CSSL_FILEHANDLER, init_args);
         m_LogHandler = Reference<XLogHandler>(temp, UNO_QUERY);
     }
-    
+
     void UiEventsLogger_Impl::checkIdleTimeout()
     {
         TimeValue now;
             hotRotate();
         m_LastLogEventTime = now;
     }
-    
+
     OUString UiEventsLogger_Impl::getCurrentPath()
     {
         OUStringBuffer current_path(m_LogPath);
     void UiEventsLogger_Impl::initializeLogger()
     {
         Reference<XMultiServiceFactory> sm = getProcessServiceFactory();
-       
+
         // getting the Core Uno proxy object 
         // It will call disposing and make sure we clear all our references
         {
                 return;
             }
             xDesktop->addTerminateListener(xCore);
-        } 
+        }
         // getting the LoggerPool
         Reference<XLoggerPool> pool;
         {
                 sm->createInstance(CSSL_LOGGERPOOL);
             pool = Reference<XLoggerPool>(temp, UNO_QUERY);
         }
-            
+
         // getting the Logger
         m_Logger = pool->getNamedLogger(LOGGERNAME);
-        
+
         // getting the FileHandler
         prepareLogHandler();
 
         else
             m_Active = false;
     }
-    
+
     // private static UiEventsLogger_Impl 
     bool UiEventsLogger_Impl::shouldActivate()
     {
         return getEnabledFromCfg() && getEnabledFromCoreController();
-    } 
+    }
 
     OUString UiEventsLogger_Impl::getLogPathFromCfg()
     {
             CFG_LOGGING, CFG_OOOIMPROVEMENT, CFG_LOGPATH,
             ConfigurationHelper::E_READONLY
         ) >>= result;
-        
+
         Reference<XStringSubstitution> path_sub(
             sm->createInstance(CSSU_PATHSUB),
             UNO_QUERY);

File fpicker/source/win32/filepicker/VistaFilePicker.cxx

     , m_rDialog             (new VistaFilePickerImpl())
     , m_aAsyncExecute       (m_rDialog                )
     , m_nFilePickerThreadId (0                        )
+	, m_bInitialized		(false					  )
 {
 }
 
 ::sal_Int16 SAL_CALL VistaFilePicker::execute()
     throw(css::uno::RuntimeException)
 {
+	bool bInitialized(false);
+	{
+		osl::MutexGuard aGuard(m_aMutex);
+		bInitialized = m_bInitialized;
+	}
+
+	if ( !bInitialized )
+	{
+		sal_Int16 nTemplateDescription = css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE;
+		css::uno::Sequence < css::uno::Any > aInitArguments(1);
+		aInitArguments[0] <<= nTemplateDescription;
+		initialize(aInitArguments);
+	}
+
     RequestRef rRequest(new Request());
     rRequest->setRequest (VistaFilePickerImpl::E_SHOW_DIALOG_MODAL);
 	
     if ( ! m_aAsyncExecute.isRunning())
         m_aAsyncExecute.create();
     m_aAsyncExecute.triggerRequestThreadAware(rRequest, AsyncRequests::NON_BLOCKED);
+	
+	{
+		osl::MutexGuard aGuard(m_aMutex);
+		m_bInitialized = true;
+	}
 }
 
 //------------------------------------------------------------------------------------

File fpicker/source/win32/filepicker/VistaFilePicker.hxx

     
         //---------------------------------------------------------------------
         oslThreadIdentifier m_nFilePickerThreadId;
+
+        bool m_bInitialized;
 }; 
 
 } // namespace vista

File fpicker/source/win32/filepicker/asyncrequests.cxx

     {
         TimeValue aTime;
         aTime.Seconds = (nMilliSeconds / 1000);
-        aTime.Nanosec = (nMilliSeconds % 1000);
+        aTime.Nanosec = (nMilliSeconds % 1000) * 1000000;
         aCondition.wait(&aTime);
     }
 

File sfx2/inc/sfx2/docfile.hxx

 #endif
 
     void                CheckFileDate( const ::com::sun::star::util::DateTime& aInitDate );
-    ::com::sun::star::util::DateTime GetInitFileDate();
+    sal_Bool            DocNeedsFileDateCheck();
+    ::com::sun::star::util::DateTime GetInitFileDate( sal_Bool bIgnoreOldValue );
 
     ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContent > GetContent() const;
 	const String&       GetPhysicalName() const;

File sfx2/source/doc/docfile.cxx

 //------------------------------------------------------------------
 void SfxMedium::CheckFileDate( const util::DateTime& aInitDate )
 {
-    GetInitFileDate();
+    GetInitFileDate( sal_True );
     if ( pImp->m_aDateTime.Seconds != aInitDate.Seconds
       || pImp->m_aDateTime.Minutes != aInitDate.Minutes
       || pImp->m_aDateTime.Hours != aInitDate.Hours
 }
 
 //------------------------------------------------------------------
-util::DateTime SfxMedium::GetInitFileDate()
+sal_Bool SfxMedium::DocNeedsFileDateCheck()
 {
-    if ( !pImp->m_bGotDateTime && GetContent().is() )
+    return ( !IsReadOnly() && ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) );
+}
+
+//------------------------------------------------------------------
+util::DateTime SfxMedium::GetInitFileDate( sal_Bool bIgnoreOldValue )
+{
+    if ( ( bIgnoreOldValue || !pImp->m_bGotDateTime ) && GetContent().is() )
     {
         try
         {
 
     sal_Bool bResult = ( GetError() == SVSTREAM_OK );
 
-    if ( bResult )
-    {
-        pImp->m_bGotDateTime = sal_False;
-        GetInitFileDate();
-    }
+    if ( bResult && DocNeedsFileDateCheck() )
+        GetInitFileDate( sal_True );
 
     // remove truncation mode from the flags
     nStorOpenMode &= (~STREAM_TRUNC);
             GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, sal_True ) );
     }
 
+    // when the file is locked, get the current file date
+    if ( bResult && DocNeedsFileDateCheck() )
+        GetInitFileDate( sal_True );
+
     return bResult;
 }
 
                 pInStream = utl::UcbStreamHelper::CreateStream( pImp->xInputStream );
         }
 
-        GetInitFileDate();
-
         pImp->bDownloadDone = sal_True;
         pImp->aDoneLink.ClearPendingCall();
         pImp->aDoneLink.Call( (void*) GetError() );

File sfx2/source/doc/objstor.cxx

 		bStoreToSameLocation = sal_True;
         AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Save" ) ) );
 
-        rMedium.CheckFileDate( pMedium->GetInitFileDate() );
+        if ( pMedium->DocNeedsFileDateCheck() )
+            rMedium.CheckFileDate( pMedium->GetInitFileDate( sal_False ) );
 
         if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED )
         {
 				InvalidateName();
 			SetModified(sal_False); // nur bei gesetztem Medium zur"ucksetzen
             Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) );
+
+            // this is the end of the saving process, it is possible that the file was changed
+            // between medium commit and this step ( attributes change and so on )
+            // so get the file date again
+            if ( pNewMed->DocNeedsFileDateCheck() )
+                pNewMed->GetInitFileDate( sal_True );
 		}
 	}
 

File sfx2/source/toolbox/tbxitem.cxx

 
 void SfxToolBoxControl::Select( BOOL /*bMod1*/ )
 {
+    if(::comphelper::UiEventsLogger::isEnabled()) //#i88653# #i102805#
+    {
+        ::rtl::OUString sAppName;
+        try
+        {
+            static ::rtl::OUString our_aModuleManagerName = ::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager");
+            ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceManager =
+                ::comphelper::getProcessServiceFactory();
+            ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModuleManager > xModuleManager(
+                xServiceManager->createInstance(our_aModuleManagerName)
+                , ::com::sun::star::uno::UNO_QUERY_THROW);
+            sAppName = xModuleManager->identify(m_xFrame);
+        } catch(::com::sun::star::uno::Exception&) {}
+        Sequence<PropertyValue> vSource;
+        ::comphelper::UiEventsLogger::appendDispatchOrigin(vSource, sAppName, ::rtl::OUString::createFromAscii("SfxToolBoxControl"));
+        URL aURL;
+        aURL.Complete = m_aCommandURL;
+        ::comphelper::UiEventsLogger::logDispatch(aURL, vSource);
+    }
     svt::ToolboxController::execute( pImpl->nSelectModifier );
 }
 

File svtools/source/contnr/fileview.cxx

 	::rtl::OUString sRet = SvHeaderTabListBox::GetAccessibleObjectDescription( _eType, _nPos );
     if ( ::svt::BBTYPE_TABLECELL == _eType )
 	{
-		sal_Int32 nRow = _nPos / GetColumnCount();
-		SvLBoxEntry* pEntry = GetEntry( nRow );
+        sal_Int32 nRow = -1;
+        const sal_uInt16 nColumnCount = GetColumnCount();
+        if (nColumnCount > 0)
+            nRow = _nPos / nColumnCount;
+        SvLBoxEntry* pEntry = GetEntry( nRow );
 		if ( pEntry )
 		{
 			SvtContentEntry* pData = (SvtContentEntry*)pEntry->GetUserData();

File svtools/source/contnr/svtabbx.cxx

 
     if ( !AreChildrenTransient() )
     {
+        const sal_uInt16 nColumnCount = GetColumnCount();
+
         // first call? -> initial list
         if ( m_aAccessibleChildren.empty() )
         {
-            sal_Int32 nCount = ( GetRowCount() + 1 ) * GetColumnCount();
+            sal_Int32 nCount = ( GetRowCount() + 1 ) * nColumnCount;
             m_aAccessibleChildren.assign( nCount, Reference< XAccessible >() );
         }
 
 	// first call? -> initial list
 	if ( m_aAccessibleChildren.empty() )
     {
-        sal_Int32 nCount = AreChildrenTransient() ? GetColumnCount()
-                                                  : ( GetRowCount() + 1 ) * GetColumnCount();
+        const sal_uInt16 nColumnCount = GetColumnCount();
+        sal_Int32 nCount = AreChildrenTransient() ? 
+                nColumnCount : ( GetRowCount() + 1 ) * nColumnCount;
         m_aAccessibleChildren.assign( nCount, Reference< XAccessible >() );
     }
 
 			if ( _nPos >= 0 )
 			{
 				sal_uInt16 nColumnCount = GetColumnCount();
-				sal_Int32 nRow = _nPos / nColumnCount;
-				sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
-                aRetText = GetCellText( nRow, nColumn );
-			}
+                if (nColumnCount > 0)
+                {
+                    sal_Int32 nRow = _nPos / nColumnCount;
+                    sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
+                    aRetText = GetCellText( nRow, nColumn );
+                }
+            }
 			break;
 		}
         case ::svt::BBTYPE_CHECKBOXCELL:
         static const String sVar2( RTL_CONSTASCII_USTRINGPARAM( "%2" ) );
 
         sal_uInt16 nColumnCount = GetColumnCount();
-        sal_Int32 nRow = _nPos / nColumnCount;
-        sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
+        if (nColumnCount > 0)
+        {
+            sal_Int32 nRow = _nPos / nColumnCount;
+            sal_uInt16 nColumn  = static_cast< sal_uInt16 >( _nPos % nColumnCount );
 
-        String aText( SvtResId( STR_SVT_ACC_DESC_TABLISTBOX ) );
-        aText.SearchAndReplace( sVar1, String::CreateFromInt32( nRow ) );
-        String sColHeader = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( nColumn ) );
-        if ( sColHeader.Len() == 0 )
-            sColHeader = String::CreateFromInt32( nColumn );
-        aText.SearchAndReplace( sVar2, sColHeader );
-        aRetText = aText;
+            String aText( SvtResId( STR_SVT_ACC_DESC_TABLISTBOX ) );
+            aText.SearchAndReplace( sVar1, String::CreateFromInt32( nRow ) );
+            String sColHeader = m_pImpl->m_pHeaderBar->GetItemText( m_pImpl->m_pHeaderBar->GetItemId( nColumn ) );
+            if ( sColHeader.Len() == 0 )
+                sColHeader = String::CreateFromInt32( nColumn );
+            aText.SearchAndReplace( sVar2, sColHeader );
+            aRetText = aText;
+        }
     }
 
 	return aRetText;

File sw/source/core/layout/tabfrm.cxx

 
 		if ( !bValidSize || !bValidPrtArea )
 		{
-            const BOOL bOptLower = (Frm().*fnRect->fnGetHeight)() == 0;
+            // HB #i101593# no optimization as it leeds to not layouting certain nested tables
+            // const BOOL bOptLower = (Frm().*fnRect->fnGetHeight)() == 0;
+            const BOOL bOptLower = FALSE; 
 
             const long nOldPrtWidth = (Prt().*fnRect->fnGetWidth)();
             const long nOldFrmWidth = (Frm().*fnRect->fnGetWidth)();

File xmloff/source/text/txtparae.cxx

                 // <text:list-header> or <text:list-item>
                 GetExport().CheckAttrList();
 
-                if ( nListLevelsToBeOpened == 1 &&
-                     rNextInfo.HasStartValue() )
+                // --> OD 2009-06-24 #i97309#
+                // export start value in case of <bRestartNumberingAtContinuedRootList>
+                // at correct list item
+                if ( nListLevelsToBeOpened == 1 )
                 {
-                    OUStringBuffer aBuffer;
-                    aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
-                    GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
-                                  aBuffer.makeStringAndClear() );
+                    if ( rNextInfo.HasStartValue() )
+                    {
+                        OUStringBuffer aBuffer;
+                        aBuffer.append( (sal_Int32)rNextInfo.GetStartValue() );
+                        GetExport().AddAttribute( XML_NAMESPACE_TEXT, XML_START_VALUE,
+                                      aBuffer.makeStringAndClear() );
+                    }
+                    else if ( bRestartNumberingAtContinuedRootList )
+                    {
+                        OUStringBuffer aBuffer;
+                        aBuffer.append( (sal_Int32)nRestartValueForContinuedRootList );
+                        GetExport().AddAttribute( XML_NAMESPACE_TEXT,
+                                                  XML_START_VALUE,
+                                                  aBuffer.makeStringAndClear() );
+                        bRestartNumberingAtContinuedRootList = false;
+                    }
                 }
-                else if ( bRestartNumberingAtContinuedRootList )
-                {
-                    OUStringBuffer aBuffer;
-                    aBuffer.append( (sal_Int32)nRestartValueForContinuedRootList );
-                    GetExport().AddAttribute( XML_NAMESPACE_TEXT,
-                                              XML_START_VALUE,
-                                              aBuffer.makeStringAndClear() );
-                    bRestartNumberingAtContinuedRootList = false;
-                }
+                // <--
 
                 eLName = ( rNextInfo.IsNumbered() || nListLevelsToBeOpened > 1 )
                          ? XML_LIST_ITEM