Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add load/save CustomXml and dataBinding processing #4808

Open
wants to merge 27 commits into
base: release/v8.2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
773facf
Add CustomXML processing
IgolJack Aug 23, 2023
6f3bf78
Add ability to read/write CustomXML for simple text
IgolJack Aug 31, 2023
5067bf9
Add ContentControl picture processing
IgolJack Aug 31, 2023
8817070
[de] Fix loading image from custom xml
KirillovIlya Sep 5, 2023
8971425
[de] Implement DataBinding class
KirillovIlya Sep 6, 2023
2edc52c
[de] Refactor work with custom xml
KirillovIlya Sep 6, 2023
a877c41
[de] Rework filling the content control with binded data
KirillovIlya Sep 7, 2023
609c9e2
[de] Fix problems with history change for data-binding
KirillovIlya Sep 7, 2023
2fa6950
Merge branch 'develop' into feature/CustomXML
IgolJack Oct 18, 2023
e5fdcc8
Merge branch 'develop' into feature/CustomXML
IgolJack Oct 30, 2023
2849a65
Add process of CustomXML for rich text
IgolJack Nov 1, 2023
46888f9
Update processing of customXML
IgolJack Dec 6, 2023
a5de59b
Merge remote-tracking branch 'origin/release/v8.2.0' into feature/Cus…
IgolJack Aug 2, 2024
54d29c4
Fix write custom xml for rich text content control
IgolJack Aug 2, 2024
1443df6
Merge remote-tracking branch 'origin/release/v8.2.0' into feature/Cus…
IgolJack Aug 5, 2024
3eaed98
[de] Improve CustomXMl processing for ComboBox and DropDownList
IgolJack Aug 6, 2024
ce074cd
[de] Improve CustomXML processing
IgolJack Aug 8, 2024
62a93b5
[de] Add more test for CustomXML processing
IgolJack Aug 8, 2024
287553b
[de] Add test for CustomXML load/save rich text content control
IgolJack Aug 9, 2024
be5194d
Merge remote-tracking branch 'origin/release/v8.2.0' into feature/Cus…
IgolJack Aug 14, 2024
d09a54a
[de] Fix save CustomXML and load for linear content control
IgolJack Aug 15, 2024
24ec4ac
[de] Fix load/save CustomXML by attribute
IgolJack Aug 16, 2024
fcc9e1f
[de] Refactor CustomXml processing
IgolJack Aug 22, 2024
83e9898
[de] Fix getContentByDataBinding method
IgolJack Aug 22, 2024
56694b0
[de] Fix CustomXML checkUrl method
IgolJack Aug 22, 2024
aea24dd
Remove unnecessary code
IgolJack Aug 22, 2024
0af7a72
Remove unnecessary code in DataBinding.recalculateCheckSum
IgolJack Aug 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions common/Drawings/Metafile.js
Original file line number Diff line number Diff line change
Expand Up @@ -837,6 +837,17 @@
this.data[this.pos++] = (c >>> 8) & 0xFF;
}
}
this.WriteCustomStringA = function(text)
{
var encoder = new TextEncoder('utf-8');
var encodedText = encoder.encode(text);

this.WriteULong(encodedText.length);

for (let i = 0; i < encodedText.length; i++) {
this.data[this.pos++] = encodedText[i];
}
}
this.WriteStringA = function(text)
{
var count = text.length;
Expand Down
3 changes: 2 additions & 1 deletion common/HistoryCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2346,7 +2346,8 @@
window['AscDFH'].historyitem_SdtPr_FormPr = window['AscDFH'].historyitem_type_SdtPr | 22;
window['AscDFH'].historyitem_SdtPr_PictureFormPr = window['AscDFH'].historyitem_type_SdtPr | 23;
window['AscDFH'].historyitem_SdtPr_ComplexFormPr = window['AscDFH'].historyitem_type_SdtPr | 24;
window['AscDFH'].historyitem_SdtPr_OForm = window['AscDFH'].historyitem_type_SdtPr | 24;
window['AscDFH'].historyitem_SdtPr_OForm = window['AscDFH'].historyitem_type_SdtPr | 25;
window['AscDFH'].historyitem_SdtPr_DataBinding = window['AscDFH'].historyitem_type_SdtPr | 26;
//------------------------------------------------------------------------------------------------------------------
// Типы изменений в классе CSdtPr
//------------------------------------------------------------------------------------------------------------------
Expand Down
13 changes: 9 additions & 4 deletions configs/word.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"word/api.js",
"word/api_plugins.js",
"common/spell/spell.js",
"common/zlib/zlib.js",
"word/Editor/Table/TableLook.js",
"cell/utils/utils.js",
"pdf/src/defines.js",
Expand Down Expand Up @@ -76,7 +77,7 @@
"common/Drawings/Metafile.js",
"common/libfont/textmeasurer.js",
"common/Drawings/WorkEvents.js",

"word/Editor/History.js",

"common/Shapes/EditorSettings.js",
Expand Down Expand Up @@ -150,13 +151,17 @@
"cell/model/Workbook.js",
"cell/model/Serialize.js",
"cell/model/CellInfo.js",


"word/Editor/custom-xml/custom-xml.js",
"word/Editor/custom-xml/custom-xml-manager.js",
"word/Editor/custom-xml/data-binding.js",

"word/Math/mathTypes.js",
"word/Editor/Styles.js",
"word/Math/math-settings.js",
"word/Editor/StructuredDocumentTags/sdt-settings.js",
"word/Editor/DocumentSettings.js",

"word/Editor/Paragraph/Run/FontClassification.js",
"word/Editor/Paragraph/Run/FontCalculator.js",
"word/Editor/Paragraph/Run/run-composite-input.js",
Expand Down Expand Up @@ -393,7 +398,7 @@
"word/Math/accent.js",
"word/Math/borderBox.js",
"word/Math/mathTrackHandler.js",

"word/Editor/Styles/style-cache.js",
"word/Editor/Styles/FixedFormDefaults.js",
"word/Editor/Styles/default-styles.js",
Expand Down
35 changes: 35 additions & 0 deletions tests/word/customXML/customXML.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Document calculation tests</title>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/qunit/2.16.0/qunit.css" rel="stylesheet" media="screen" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/qunit/2.16.0/qunit.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/xregexp/3.2.0/xregexp-all.min.js"></script>

<script type="text/javascript" src="../../../develop/sdkjs/word/scripts.js"></script>
<script type="text/javascript">
window.sdk_scripts.forEach(function(item){
document.write('<script type="text/javascript" src="' + item + '"><\/script>');
});
</script>

<script type="text/javascript" src="../common/common.js"></script>
<script type="text/javascript" src="../common/editor.js"></script>
<script type="text/javascript" src="../common/document.js"></script>
<script type="text/javascript" src="../common/measurer.js"></script>

<script type="text/javascript" src="customXML.js"></script>
</head>
<body>
<h1 id="qunit-header">Test forms</h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests"></ol>
<div id="qunit-fixture">test markup, will be hidden</div>
</body>
</html>
795 changes: 795 additions & 0 deletions tests/word/customXML/customXML.js

Large diffs are not rendered by default.

Loading
Loading