You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2014/07/03 15:34:08 UTC

[Issue 125195] New: Can't delete junk styles

https://issues.apache.org/ooo/show_bug.cgi?id=125195

          Issue ID: 125195
        Issue Type: DEFECT
           Summary: Can't delete junk styles
           Product: Writer
           Version: 4.1.0
          Hardware: PC
                OS: Windows 7
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: editing
          Assignee: issues@openoffice.apache.org
          Reporter: daniel.grigoras@movidius.com

I am copying into an ODT template the content of some SXW files, which have
their content copied from DOCX files. The problem is that junk styles have been
copied from the DOCX files and most of these junk styles are locked and I
cannot delete them from the ODT file whatever I do.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #5 from oooforum <oo...@free.fr> ---
(In reply to Darius Daniel Grigoras from comment #0)
> and most of these junk styles are locked and
> I cannot delete them from the ODT file whatever I do.
I use the stylist and have no problem to remove WW8Num##z# styles.
Right click and choose Delete menu

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #6 from Darius Daniel Grigoras <da...@movidius.com> ---
Of course you can delete them now, because the text to which these styles were
applied is deleted, but as long as the text is there (which is confidential),
you cannot delete them.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #11 from Ariel Constenla-Haile <ar...@apache.org> ---
(In reply to Darius Daniel Grigoras from comment #10)
> (In reply to Ariel Constenla-Haile from comment #9)
> 
> > It is possible to delete custom styles even if they are used in the document
> > (you will lose the formatting, though).
> 
> If it's possible to delete styles in use, why can't I delete most of them?

That might be the bug, but we need access to the file in order to reproduce it.

> Can you make a macro that would delete styles with names like the ones
> enumerated bellow? # should be replaced with regex [0-9]
> WW8Num##z###
> WW8Num##z##
> WW8Num##z#
> WW8Num#z###
> WW8Num#z##
> WW8Num#z#
> ####################z#

OpenOffice Basic does not support regex, but that macro can be rewritten in
Python, which does support them.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #4 from Darius Daniel Grigoras <da...@movidius.com> ---
The junk styles are usually just Character and List styles with names of this
pattern: WW8Num##z# (where # stands for different digits, numbers). Others,
fewer in number, have names like this: 79761500416052791121z0

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #3 from Darius Daniel Grigoras <da...@movidius.com> ---
Ok, I have attached a demo file. Even though I've deleted most of the text,
those junk styles are still there and there are lots of them.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #8 from Darius Daniel Grigoras <da...@movidius.com> ---
There are too many junk styles to Search & Replace for. That would be too
time-consuming. Besides that, I can't just search and replace them, as some
formatting would get lost and I would find it harder to reproduce these styles.
Though I admit that I create PDFs for reference.

I reported this as a bug, because I felt that one should be allowed to select
multiple styles in order to delete them and that one should be allowed to
delete them all even if they are in use. That would make things so much easier.
Right now I am manually removing them from styles.xml and content.xml

So my requests are these:
- allow selection of multiple styles
- allow deletion of styles in use

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #9 from Ariel Constenla-Haile <ar...@apache.org> ---
(In reply to Darius Daniel Grigoras from comment #6)
> Of course you can delete them now, because the text to which these styles
> were applied is deleted,

It is possible to delete custom styles even if they are used in the document
(you will lose the formatting, though).

> but as long as the text is there (which is
> confidential), you cannot delete them.

Can you replace all text with X?

(In reply to Darius Daniel Grigoras from comment #8)
> So my requests are these:
> - allow selection of multiple styles
> - allow deletion of styles in use

AFAIK this is possible. Just try with a new Writer document, create a paragraph
style, apply it to a paragraph, go to the Stylist and erase.

You can delete all custom styles that are not being used with a simple macro:

REM  *****  BASIC  *****
Option Explicit
Sub Main
Dim oStyles
Dim oFamily
Dim oStyle
oStyles = ThisComponent.getStyleFamilies()

Dim sStyleFamily$, aElementNames$()
Dim sStyle$, aStyles$()
aElementNames = oStyles.getElementNames()
For Each sStyleFamily In aElementNames
oFamily = oStyles.getByName(sStyleFamily)
aStyles = oFamily.getElementNames()
For Each sStyle In aStyles
oStyle = oFamily.getByName(sStyle)
If oStyle.isUserDefined() AND NOT oStyle.isInUse() Then
oFamily.removeByName(sStyle)
End If
Next
Next
End Sub

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #7 from oooforum <oo...@free.fr> ---
(In reply to Darius Daniel Grigoras from comment #6)
> but as long as the text is there (which is
> confidential), you cannot delete them.
Well, if the style is in use, you couldn't delete it.
So you must reattach text to another style with Search and replace menu before.

Bugzilla is make to report bug not to help.
I also would suggest that in your case using the documentation or the forum
(https://forum.openoffice.org/en/forum/) would have been preferable.

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #2 from Darius Daniel Grigoras <da...@movidius.com> ---
Created attachment 83637
  --> https://issues.apache.org/ooo/attachment.cgi?id=83637&action=edit
Demo file with junk styles

Demo file with junk styles

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

--- Comment #10 from Darius Daniel Grigoras <da...@movidius.com> ---
(In reply to Ariel Constenla-Haile from comment #9)

> It is possible to delete custom styles even if they are used in the document
> (you will lose the formatting, though).

If it's possible to delete styles in use, why can't I delete most of them?

Can you make a macro that would delete styles with names like the ones
enumerated bellow? # should be replaced with regex [0-9]
WW8Num##z###
WW8Num##z##
WW8Num##z#
WW8Num#z###
WW8Num#z##
WW8Num#z#
####################z#

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

Ariel Constenla-Haile <ar...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needmoreinfo

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.

[Issue 125195] Can't delete junk styles

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=125195

oooforum <oo...@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |oooforum@free.fr

--- Comment #1 from oooforum <oo...@free.fr> ---
Could you attach a sample file to reproduce?

-- 
You are receiving this mail because:
You are the assignee for the issue.
You are watching all issue changes.