From 44ded43131ec97966de4ab664803b77b533fa662 Mon Sep 17 00:00:00 2001 From: Georgy Litvinov Date: Tue, 24 Mar 2020 15:04:42 +0100 Subject: [PATCH] Reset search settings after cleaning --- Redaction/Clean.xba | 56 ++++++++++++++++++++++++++++++++++++++++++++- description.xml | 2 +- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/Redaction/Clean.xba b/Redaction/Clean.xba index e123d78..5a5e3ee 100644 --- a/Redaction/Clean.xba +++ b/Redaction/Clean.xba @@ -1,6 +1,6 @@ -Sub mark35 +Sub mark36 End Sub @@ -672,6 +672,7 @@ End Sub Private Sub replaceBaseWithStandard replaceParaStyle("Базовый","Основной текст") replaceParaStyle("Default Style","Text Body") + resetSearchSettings() End Sub Private Sub replaceParaStyle(oldStyleName,newStyleName) @@ -727,6 +728,58 @@ Private Sub replaceParaStyle(oldStyleName,newStyleName) dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args1()) End Sub +Private Sub resetSearchSettings() + Dim document as Object + Dim dispatcher as object + document = ThisComponent.CurrentController.Frame + dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") + dim args3(21) as new com.sun.star.beans.PropertyValue + args3(0).Name = "SearchItem.StyleFamily" + args3(0).Value = 2 + args3(1).Name = "SearchItem.CellType" + args3(1).Value = 0 + args3(2).Name = "SearchItem.RowDirection" + args3(2).Value = true + args3(3).Name = "SearchItem.AllTables" + args3(3).Value = false + args3(4).Name = "SearchItem.SearchFiltered" + args3(4).Value = false + args3(5).Name = "SearchItem.Backward" + args3(5).Value = false + args3(6).Name = "SearchItem.Pattern" + args3(6).Value = false + args3(7).Name = "SearchItem.Content" + args3(7).Value = false + args3(8).Name = "SearchItem.AsianOptions" + args3(8).Value = false + args3(9).Name = "SearchItem.AlgorithmType" + args3(9).Value = 0 + args3(10).Name = "SearchItem.SearchFlags" + args3(10).Value = 65536 + args3(11).Name = "SearchItem.SearchString" + args3(11).Value = "" + args3(12).Name = "SearchItem.ReplaceString" + args3(12).Value = "" + args3(13).Name = "SearchItem.Locale" + args3(13).Value = 255 + args3(14).Name = "SearchItem.ChangedChars" + args3(14).Value = 2 + args3(15).Name = "SearchItem.DeletedChars" + args3(15).Value = 2 + args3(16).Name = "SearchItem.InsertedChars" + args3(16).Value = 2 + args3(17).Name = "SearchItem.TransliterateFlags" + args3(17).Value = 1280 + args3(18).Name = "SearchItem.Command" + args3(18).Value = 3 + args3(19).Name = "SearchItem.SearchFormatted" + args3(19).Value = false + args3(20).Name = "SearchItem.AlgorithmType2" + args3(20).Value = 1 + args3(21).Name = "Quiet" + args3(21).Value = true + dispatcher.executeDispatch(document, ".uno:ExecuteSearch", "", 0, args3()) +End Sub Private Sub doNotTrack Dim dispatcher As Object Dim document As Object @@ -752,6 +805,7 @@ Private Sub removeDirectFormatting Dim endNoteText As Object Dim oViewCursor As Object Dim oTextCursor As Object + Dim footNotes As Object dispatcher = createUnoService("com.sun.star.frame.DispatchHelper") document = ThisComponent.CurrentController.Frame oViewCursor = ThisComponent.CurrentController.getViewCursor() diff --git a/description.xml b/description.xml index aa37af2..219c862 100644 --- a/description.xml +++ b/description.xml @@ -3,7 +3,7 @@ xmlns:dep="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink"> - + Cleaning and validation documents for publishing in html and epub with pagination