Issue 16179 - saving of a new basic library not possible while OO is runing ...
Summary: saving of a new basic library not possible while OO is runing ...
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: AOO PleaseHelp
Assignee: ab
QA Contact: issues@udk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-28 09:52 UTC by Oliver Brinzing
Modified: 2009-02-05 16:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Oliver Brinzing 2003-06-28 09:52:48 UTC
Hi,

I have a problem with the saving of a new basic library while OO is runing.

Oliver

' This will create a new Library in \user\basic\ with the files:
'
' Mylib\Module1.xba
' Mylib\script.xlb
' Mylib\dialog.xlb
'
' It seems, that the files are written to harddisk only at the time,
' OO is closed, cause I cannot find the files in the Windows-Explorer/
' with the SimpleFileAccess ...
'
' How can I force saving directly after creating ???

Sub CreateLibrary

    Dim oLib as Object
    Dim oLibContainer as Object
    Dim sLib as String
    
    Dim oFileAccess as Variant
    Dim oSettings as Object
    Dim oPathSettings as Object
    Dim mFolder() as String
    Dim sPath as String
    Dim sMsg as String
    Dim i as Integer

    sLib = "MyLib"

    oLibContainer = Globalscope.BasicLibraries
    If oLibContainer.hasByName(sLib) Then
        oLibContainer.removeLibrary(sLib)
    EndIf

    oLib = oLibContainer.createLibrary(sLib)
    oLib.insertByName("Module1", "REM *** TEST ***")
    
    oLibContainer = Globalscope.DialogLibraries
    If oLibContainer.hasByName(sLib) Then
        oLibContainer.removeLibrary(sLib)
    EndIf

    oLib = oLibContainer.createLibrary(sLib)

    ' try to get office path ...
    oSettings = createUnoService("com.sun.star.frame.Settings")
    oPathSettings = oSettings.getByName("PathSettings")
    sPath = oPathSettings.getPropertyValue("Basic")
    sPath = Mid(sPath, InStr(1, sPath, ";")+1, Len(sPath)) & "/" & sLib & "/"
    
    ' try to get the files ...
    oFileAccess = createUnoService("com.sun.star.ucb.SimpleFileAccess")
    If oFileAccess.exists(sPath) and oFileAccess.IsFolder(sPath) Then
        sMsg = ""
        mFolder() = oFileAccess.getFolderContents(sPath, False)
        for i = lbound(mFolder()) to uBound(mFolder())
            sMsg = sMsg & mFolder(i) & Chr(13)
        next i
        msgBox sMsg
    Else
        msgBox "Can't find files in " & sPath
    EndIf
End Sub
Comment 1 kay.ramme 2003-06-30 08:03:20 UTC
Andreas, please help.
Comment 2 ab 2003-07-03 12:31:26 UTC
Unfortunately the saving is not (yet) part of the library container API.
Currently all new or changed libraries are stored automatically when
the office is terminated. Maybe this problem will also be adressed in
the context of the scripting framework developement.
Comment 3 Oliver Brinzing 2006-02-17 13:41:50 UTC
Hi,

it seems this issue has been fixed in oo 2.0 ...
at least i can not verify it with oo 2.0.2. rc

(you can't use the above script to verify this, cause
 oSettings = createUnoService("com.sun.star.frame.Settings"
 return *null* with oo 2.0.2. (it's marked as deprecated)

but it's still in so 7.0 pu 6 ...
cause i do not think one will fix it for so 7.0, 

it should be closed ...  :-) 

Oliver
Comment 4 ab 2009-02-05 15:56:40 UTC
Ok, I will close it
-> WORKSFORME
Comment 5 ab 2009-02-05 16:02:56 UTC
CLOSED