To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=105683


User brinzing changed the following:

                What    |Old value                 |New value
================================================================================
                      CC|''                        |'brinzing'
--------------------------------------------------------------------------------




------- Additional comments from [email protected] Wed Oct  7 17:04:20 
+0000 2009 -------
IMHO it would be a good idea to have an option to remove unused numberformats
during save, even if the maximum value is not reached.
Maybe this could be an optional feature in Tools - Options ?

AFAIK there is no API to check whether a numberformat is used or not. we can
only check whether a cellstyle is used or not ... but this will not help here. a
numberformat can be removed via api but this can damage the spread- 
sheet document, for example:

Sub removeUserDefinedNumerFormats()

        Dim oLocale as New com.sun.star.lang.Locale
        Dim oKey as Object
        Dim nFormat as Integer
        Dim nSeq() as Long
        Dim s as String
        Dim i as Integer
        
        Dim oDocument as Object
        oDocument = ThisComponent

        nFormat = com.sun.star.util.NumberFormat.DEFINED
        nSeq() = oDocument.getNumberFormats().queryKeys(nFormat, 
                                                                               
                          oLocale, False)

        For i = 0 To uBound(nSeq())
                oKey = oDocument.getNumberFormats().getByKey(nSeq(i))
                s = s & oKey.FormatString & " "  & oKey.Comment &  " " & 
                                                                      
oKey.UserDefined & Chr(13)
                oDocument.getNumberFormats().removeByKey(nSeq(i))
        Next i

        MsgBox s
End Sub

will remove all user defined numberformats. so another option would be
to implement isUsed() for numberformats.

I have a couple of spreadsheets with a huge number of unused numberformats and
don't know how to remove them ... cause i see
no easy way to verify the cleaned document ... Edit - Document compare
will not help here too ...


---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to