Kaydet (Commit) 00b6e5da authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

oooimprovement6: #i97340# disable show data button when no file exists

üst bac4d759
......@@ -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 SvxEmptyPage ----------------------------------------------------
SvxEmptyPage::SvxEmptyPage( Window* pParent ) :
......@@ -262,11 +275,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);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment