diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-09-22 14:35:32 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2010-09-22 14:35:32 +0200 |
commit | 4ce3539fbfbf42c906ac1b76110f440c96a253a0 (patch) | |
tree | 68bf40db7af8e8f4c9256449ba5ea0c6c34277a5 /cui | |
parent | ed301187b6293430b4b2e7e1ac966462c4497067 (diff) | |
parent | 09cfcedc6eae7af61e047a956d672702f1313c6d (diff) |
dba34a: pulled DEV300.m88
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optimprove2.cxx | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/cui/source/options/optimprove2.cxx b/cui/source/options/optimprove2.cxx index 562280426..9a49fa2e6 100644 --- a/cui/source/options/optimprove2.cxx +++ b/cui/source/options/optimprove2.cxx @@ -52,6 +52,7 @@ #include <comphelper/synchronousdispatch.hxx> #include <comphelper/uieventslogger.hxx> #include <tools/testtoolloader.hxx> +#include <osl/file.hxx> #define C2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s)) @@ -61,6 +62,18 @@ namespace uno = ::com::sun::star::uno; namespace util = ::com::sun::star::util; using namespace com::sun::star::system; + +namespace +{ + bool lcl_doesLogfileExist(const ::rtl::OUString& sLogPath) + { + ::rtl::OUString sLogFile( sLogPath ); + sLogFile += C2S("/Current.csv"); + ::osl::File aLogFile(sLogFile); + return aLogFile.open(osl_File_OpenFlag_Read) == ::osl::FileBase::E_None; + } +} + // class SvxImprovementOptionsPage --------------------------------------- SvxImprovementOptionsPage::SvxImprovementOptionsPage( Window* pParent, const SfxItemSet& rSet ) : @@ -143,7 +156,10 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG ) uno::Reference< lang::XComponent > xDoc = ::comphelper::SynchronousDispatch::dispatch( xDesktop, sLogFile, C2S("_default"), 0, aArgs ); if ( xDoc.is() ) + { + dynamic_cast<Dialog*>(GetParent())->EndDialog( RET_CANCEL ); return 1; + } } return 0; @@ -244,11 +260,13 @@ void SvxImprovementOptionsPage::Reset( const SfxItemSet& /*rSet*/ ) if ( xSubst.is() ) sPath = xSubst->substituteVariables( sPath, sal_False ); m_sLogPath = sPath; + m_aShowDataPB.Enable(lcl_doesLogfileExist(m_sLogPath)); } } } catch( uno::Exception& ) { + m_aShowDataPB.Enable(false); } } |