Hallo,

Sometimes I need to cleanup writerdocs where some parts are accidentily :-) been hard coded by the user.

To clean up the hard coding i uses some basic code i found on the forum and in the Basic Prgrammers Guide

   ParaEnum = thiscomponent.Text.CreateEnumeration
   While ParaEnum.HasMoreElements
       Para = ParaEnum.NextElement

    TextPortEnum = Para.createEnumeration
                   While TextPortEnum.hasmoreElements
                     TextPortion = oextPortEnum.nextElement()
' CLEAN UP**** If oextPortion.getPropertyState("CharFontName") = com.sun.star.beans.PropertyState.DIRECT_VALUE Then
               extPortion.setPropertyToDefault("CharFontName")
            End If
If TextPortion.getPropertyState("CharHeight") = com.sun.star.beans.PropertyState.DIRECT_VALUE Then
              oextPortion.setPropertyToDefault("CharHeight")
End If Wend

this method works fine when a paragraph has more than 1 textportion (text with the same atributes)

when a paragraph has only 1 textportion, the whole pargraph was hardcoded , then the PropertyState indicates that there was no hardcoding (com.sun.star.beans.PropertyState.DIRECT_VALUE = 1)

Is this a issue are am i missing something
Thanks for any hint
Fernand

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to