Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
05e17862
Kaydet (Commit)
05e17862
authored
Eyl 17, 2010
tarafından
Hans-Joachim Lankenau
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
CWS-TOOLING: integrate CWS oooimprovement6
üst
88feb417
00b6e5da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
5 deletions
+56
-5
optimprove2.cxx
cui/source/options/optimprove2.cxx
+18
-0
onlogrotate_job.cxx
extensions/source/oooimprovement/onlogrotate_job.cxx
+38
-5
No files found.
cui/source/options/optimprove2.cxx
Dosyayı görüntüle @
05e17862
...
@@ -52,6 +52,7 @@
...
@@ -52,6 +52,7 @@
#include <comphelper/synchronousdispatch.hxx>
#include <comphelper/synchronousdispatch.hxx>
#include <comphelper/uieventslogger.hxx>
#include <comphelper/uieventslogger.hxx>
#include <tools/testtoolloader.hxx>
#include <tools/testtoolloader.hxx>
#include <osl/file.hxx>
#define C2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
#define C2S(s) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
...
@@ -61,6 +62,18 @@ namespace uno = ::com::sun::star::uno;
...
@@ -61,6 +62,18 @@ namespace uno = ::com::sun::star::uno;
namespace
util
=
::
com
::
sun
::
star
::
util
;
namespace
util
=
::
com
::
sun
::
star
::
util
;
using
namespace
com
::
sun
::
star
::
system
;
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 ---------------------------------------
// class SvxImprovementOptionsPage ---------------------------------------
SvxImprovementOptionsPage
::
SvxImprovementOptionsPage
(
Window
*
pParent
,
const
SfxItemSet
&
rSet
)
:
SvxImprovementOptionsPage
::
SvxImprovementOptionsPage
(
Window
*
pParent
,
const
SfxItemSet
&
rSet
)
:
...
@@ -143,7 +156,10 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
...
@@ -143,7 +156,10 @@ IMPL_LINK( SvxImprovementOptionsPage, HandleShowData, PushButton*, EMPTYARG )
uno
::
Reference
<
lang
::
XComponent
>
xDoc
=
::
comphelper
::
SynchronousDispatch
::
dispatch
(
uno
::
Reference
<
lang
::
XComponent
>
xDoc
=
::
comphelper
::
SynchronousDispatch
::
dispatch
(
xDesktop
,
sLogFile
,
C2S
(
"_default"
),
0
,
aArgs
);
xDesktop
,
sLogFile
,
C2S
(
"_default"
),
0
,
aArgs
);
if
(
xDoc
.
is
()
)
if
(
xDoc
.
is
()
)
{
dynamic_cast
<
Dialog
*>
(
GetParent
())
->
EndDialog
(
RET_CANCEL
);
return
1
;
return
1
;
}
}
}
return
0
;
return
0
;
...
@@ -244,11 +260,13 @@ void SvxImprovementOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
...
@@ -244,11 +260,13 @@ void SvxImprovementOptionsPage::Reset( const SfxItemSet& /*rSet*/ )
if
(
xSubst
.
is
()
)
if
(
xSubst
.
is
()
)
sPath
=
xSubst
->
substituteVariables
(
sPath
,
sal_False
);
sPath
=
xSubst
->
substituteVariables
(
sPath
,
sal_False
);
m_sLogPath
=
sPath
;
m_sLogPath
=
sPath
;
m_aShowDataPB
.
Enable
(
lcl_doesLogfileExist
(
m_sLogPath
));
}
}
}
}
}
}
catch
(
uno
::
Exception
&
)
catch
(
uno
::
Exception
&
)
{
{
m_aShowDataPB
.
Enable
(
false
);
}
}
}
}
extensions/source/oooimprovement/onlogrotate_job.cxx
Dosyayı görüntüle @
05e17862
...
@@ -35,15 +35,21 @@
...
@@ -35,15 +35,21 @@
#include "soapsender.hxx"
#include "soapsender.hxx"
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <osl/mutex.hxx>
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
#include <osl/thread.hxx>
#include <osl/time.h>
#include <osl/time.h>
#include <cppuhelper/implbase1.hxx>
#include <memory>
using
namespace
::
com
::
sun
::
star
::
beans
;
using
namespace
::
com
::
sun
::
star
::
beans
;
using
namespace
::
com
::
sun
::
star
::
lang
;
using
namespace
::
com
::
sun
::
star
::
lang
;
using
namespace
::
com
::
sun
::
star
::
task
;
using
namespace
::
com
::
sun
::
star
::
task
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
::
com
::
sun
::
star
::
frame
::
XTerminateListener
;
using
::
com
::
sun
::
star
::
frame
::
XDesktop
;
using
::
com
::
sun
::
star
::
ucb
::
XSimpleFileAccess
;
using
::
com
::
sun
::
star
::
ucb
::
XSimpleFileAccess
;
using
::
rtl
::
OUString
;
using
::
rtl
::
OUString
;
using
::
std
::
vector
;
using
::
std
::
vector
;
...
@@ -102,7 +108,8 @@ namespace
...
@@ -102,7 +108,8 @@ namespace
public
:
public
:
OnLogRotateThread
(
Reference
<
XMultiServiceFactory
>
sf
);
OnLogRotateThread
(
Reference
<
XMultiServiceFactory
>
sf
);
virtual
void
SAL_CALL
run
();
virtual
void
SAL_CALL
run
();
void
disposing
();
OnLogRotateThread
*
disposing
();
private
:
private
:
Reference
<
XMultiServiceFactory
>
m_ServiceFactory
;
Reference
<
XMultiServiceFactory
>
m_ServiceFactory
;
::
osl
::
Mutex
m_ServiceFactoryMutex
;
::
osl
::
Mutex
m_ServiceFactoryMutex
;
...
@@ -135,11 +142,35 @@ namespace
...
@@ -135,11 +142,35 @@ namespace
}
}
}
}
void
OnLogRotateThread
::
disposing
()
OnLogRotateThread
*
OnLogRotateThread
::
disposing
()
{
{
::
osl
::
Guard
<
::
osl
::
Mutex
>
service_factory_guard
(
m_ServiceFactoryMutex
);
::
osl
::
Guard
<
::
osl
::
Mutex
>
service_factory_guard
(
m_ServiceFactoryMutex
);
m_ServiceFactory
.
clear
();
m_ServiceFactory
.
clear
();
return
this
;
}
}
class
OnLogRotateThreadWatcher
:
public
::
cppu
::
WeakImplHelper1
<
XTerminateListener
>
{
public
:
OnLogRotateThreadWatcher
(
Reference
<
XMultiServiceFactory
>
sf
)
:
m_Thread
(
new
OnLogRotateThread
(
sf
))
{
m_Thread
->
create
();
}
virtual
~
OnLogRotateThreadWatcher
()
{
m_Thread
->
disposing
()
->
terminate
();
};
// XTerminateListener
virtual
void
SAL_CALL
queryTermination
(
const
EventObject
&
)
throw
(
RuntimeException
)
{
};
virtual
void
SAL_CALL
notifyTermination
(
const
EventObject
&
)
throw
(
RuntimeException
)
{
m_Thread
->
disposing
()
->
terminate
();
};
// XEventListener
virtual
void
SAL_CALL
disposing
(
const
EventObject
&
)
throw
(
RuntimeException
)
{
m_Thread
->
disposing
()
->
terminate
();
};
private
:
::
std
::
auto_ptr
<
OnLogRotateThread
>
m_Thread
;
};
}
}
namespace
oooimprovement
namespace
oooimprovement
...
@@ -163,9 +194,11 @@ namespace oooimprovement
...
@@ -163,9 +194,11 @@ namespace oooimprovement
const
Reference
<
XJobListener
>&
listener
)
const
Reference
<
XJobListener
>&
listener
)
throw
(
RuntimeException
)
throw
(
RuntimeException
)
{
{
OnLogRotateThread
*
thread
=
new
OnLogRotateThread
(
m_ServiceFactory
);
Reference
<
XDesktop
>
xDesktop
(
thread
->
create
();
m_ServiceFactory
->
createInstance
(
OUString
::
createFromAscii
(
"com.sun.star.frame.Desktop"
)),
UNO_QUERY
);
if
(
xDesktop
.
is
())
xDesktop
->
addTerminateListener
(
Reference
<
XTerminateListener
>
(
new
OnLogRotateThreadWatcher
(
m_ServiceFactory
)));
Any
result
;
Any
result
;
listener
->
jobFinished
(
Reference
<
XAsyncJob
>
(
this
),
result
);
listener
->
jobFinished
(
Reference
<
XAsyncJob
>
(
this
),
result
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment