Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
da8609e8
Commit
da8609e8
authored
Aug 22, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Search and replace function was added to API for plugins.
parent
348f2ef8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
5 deletions
+25
-5
word/Editor/Search.js
word/Editor/Search.js
+5
-5
word/api.js
word/api.js
+20
-0
No files found.
word/Editor/Search.js
View file @
da8609e8
...
...
@@ -286,7 +286,7 @@ CDocument.prototype.Search_Select = function(Id)
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateRulersState
();
};
CDocument
.
prototype
.
Search_Replace
=
function
(
NewStr
,
bAll
,
Id
)
CDocument
.
prototype
.
Search_Replace
=
function
(
NewStr
,
bAll
,
Id
,
bInterfaceEvent
)
{
var
bResult
=
false
;
...
...
@@ -340,13 +340,13 @@ CDocument.prototype.Search_Replace = function(NewStr, bAll, Id)
bResult
=
true
;
if
(
true
===
bAll
)
editor
.
sync_ReplaceAllCallback
(
AllCount
,
AllCount
);
if
(
true
===
bAll
&&
false
!==
bInterfaceEvent
)
editor
.
sync_ReplaceAllCallback
(
AllCount
,
AllCount
);
}
else
{
if
(
true
===
bAll
)
editor
.
sync_ReplaceAllCallback
(
0
,
AllCount
);
if
(
true
===
bAll
&&
false
!==
bInterfaceEvent
)
editor
.
sync_ReplaceAllCallback
(
0
,
AllCount
);
}
this
.
Document_UpdateInterfaceState
();
...
...
word/api.js
View file @
da8609e8
...
...
@@ -8255,6 +8255,26 @@ background-repeat: no-repeat;\
{
return
this
.
asc_GetCurrentContentControl
();
};
/**
* Find and replace text.
* @param {Object} oProperties The properties for find and replace.
* @param {string} oProperties.searchString Search string.
* @param {string} oProperties.replaceString Replacement string.
* @param {string} [oProperties.matchCase=true]
*
*/
window
[
"
asc_docs_api
"
].
prototype
[
"
pluginMethod_SearchAndReplace
"
]
=
function
(
oProperties
)
{
var
sSearch
=
oProperties
[
"
searchString
"
];
var
sReplace
=
oProperties
[
"
replaceString
"
];
var
isMatchCase
=
undefined
!==
oProperties
[
"
matchCase
"
]
?
oProperties
.
matchCase
:
true
;
var
oSearchEngine
=
this
.
WordControl
.
m_oLogicDocument
.
Search
(
sSearch
,
{
MatchCase
:
isMatchCase
});
if
(
!
oSearchEngine
)
return
;
this
.
WordControl
.
m_oLogicDocument
.
Search_Replace
(
sReplace
,
true
,
null
,
false
);
};
/********************************************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment