| View previous topic :: View next topic |
| Author |
Message |
lx General User

Joined: 15 Apr 2012 Posts: 22
|
Posted: Thu Jun 07, 2012 1:37 am Post subject: Store setting for my extensiion |
|
|
| How to do that? I want store setting(changes) for my extension between user session(after office will closed and open again) |
|
| Back to top |
|
 |
lx General User

Joined: 15 Apr 2012 Posts: 22
|
Posted: Thu Jun 07, 2012 4:16 am Post subject: |
|
|
solution:
store setting in file inside deployed extenssion
function pfi_settings_get_location
pfi_settings_get_location = pfi_extension_location+IDE_SETTINGS_FILE_NAME
end function
function pfi_settings_get_host
_path = pfi_settings_get_location
if not fileexists(_path) then
pfi_settings_get_host = PFD_DEFAULT_HOST
exit function
end if
_fileno = freefile
_line = ""
open _path for input as _fileno
line input #_fileno, _line
close #_fileno
pfi_settings_get_host = _line
end function
sub pfi_settings_set_host(_host)
_path = pfi_settings_get_location
if fileexists(_path) then
kill(_path)
end if
_fileno = freefile
open _path for output as #_fileno
print #_fileno, _host
close #_fileno
end sub
function pfi_extension_location
_provider = getdefaultcontext.getbyname("/singletons/com.sun.star.deployment.PackageInformationProvider")
pfi_extension_location = _provider.getpackagelocation("com.pack")
end function |
|
| Back to top |
|
 |
|