https://bugs.freedesktop.org/show_bug.cgi?id=63265

          Priority: medium
            Bug ID: 63265
          Assignee: [email protected]
           Summary: Slowdown when closing a template file
          Severity: normal
    Classification: Unclassified
                OS: All
          Reporter: [email protected]
          Hardware: Other
            Status: UNCONFIRMED
           Version: 4.0.2.2 release
         Component: BASIC
           Product: LibreOffice

There's a problem with BASIC in LO 4.0.2.2

There's an extension written in BASIC, and there's a template file with styles,
"my_styles.ott", inside that extension's package. This file is loaded into
current text document by the following code:

Dim StylesPath As String : StylesPath = getRootStorage( "MyMacros" ) &
"/styles/my_styles.ott"
Dim oDesktop : oDesktop = createUnoService("com.sun.star.frame.Desktop")
Dim aArgs(1) As New com.sun.star.beans.PropertyValue
aArgs(0).Name    = "AsTemplate"
aArgs(0).Value    = False
aArgs(1).Name    = "Hidden"
aArgs(1).Value    = True
Dim oTemplate : oTemplate = oDesktop.loadComponentFromURL( ConvertToUrl(
StylesPath ), "_blank", 0, aArgs() )
' Loading styles from the template
aArgs(0).Name    = "OverwriteStyles"
aArgs(0).Value    = False
aArgs(1).Name    = "ReadOnly"
aArgs(1).Value    = True
Dim oDoc As Object : oDoc = ThisComponent
oDoc.stylefamilies.loadStylesFromURL( StylesPath, aArgs() )
oDoc.DocumentProperties.Title            = oTemplate.DocumentProperties.Title
oDoc.DocumentProperties.TemplateName    = StylesPath
' Closing the template
oTemplate.Close( false )

If the document is very large, it will take BASIC a long time (up to 45
minutes) to come out of the "oTemplate.Close( false )" call.

This was observed in LO 4 on Windows 7/8 and KUbuntu 12.10.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to