Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Thu, 2011-11-10 at 01:41 +0100, Andreas Säger wrote:
Am 10.11.2011 01:02, drew wrote:
On Wed, 2011-11-09 at 17:55 -0500, Andrew Douglas Pitonyak wrote:

    sNames = oLibs.getElementNames()
    For i = UBound(sNames) To LBound(sNames) Step -1
      oLibs.removeLibrary(sNames(i))
    Next
End Sub


      sNames = oLibs.getElementNames()
      For i = UBound(sNames) To LBound(sNames) Step -1
        if sNames(i)<>"Standard" then
      oLibs.removeLibrary(sNames(i))
      ThisComponent.setModified(True)
      endif
      Next

  End Sub




--

Howdy Andreas,

Cool - now back to something Andrew noted - what about places where the
embedded macros might called from. Not sure how to find everywhere, but
we can enhance that basic procedure to clear out any document event
handlers.

Sub RemoveAllContainedLibs
   Dim sNames
   Dim oLibs
   Dim i%
   Dim EmptyEventProps(1) as new com.sun.star.beans.PropertyValue
 
   oLibs = ThisComponent.BasicLibraries
   sNames = oLibs.getElementNames()
   For i = UBound(sNames) To LBound(sNames) Step -1
     oLibs.removeLibrary(sNames(i))
   Next
   oLibs = ThisComponent.DialogLibraries
   sNames = oLibs.getElementNames()
   For i = UBound(sNames) To LBound(sNames) Step -1
     oLibs.removeLibrary(sNames(i))
   Next
   '
   ' clear all document event handlers
   For i = UBound(ThisComponent.Events.elementNames) To LBound(ThisComponent.Events.elementNames) 
Step -1
         ThisComponent.Events.ReplaceByName(ThisComponent.Events.ElementNames(i), EmptyEventProps())
   next
   '
   ' force dirty flag on document
   ThisComponent.setModified(True)

End Sub




-- 
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.