devexpress-richedit 24.2.8-build-25149-0115 → 25.1.2-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.css +1 -1
- package/dist/dx.richedit.d.ts +11 -3
- package/dist/dx.richedit.js +2494 -2002
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/_constants.d.ts +1 -0
- package/lib/client/_constants.js +3 -0
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +11 -0
- package/lib/client/client-rich-edit.js +5 -3
- package/lib/client/commands/commands.js +12 -0
- package/lib/client/i-rich-constructor-settings.d.ts +2 -0
- package/lib/client/model-api/api-utils/parameter-checker.d.ts +1 -1
- package/lib/client/model-api/api-utils/parameter-checker.js +2 -2
- package/lib/client/public/commands/enum.d.ts +3 -1
- package/lib/client/public/commands/enum.js +2 -0
- package/lib/client/public/options.d.ts +2 -0
- package/lib/client/public/options.js +2 -0
- package/lib/client/public/rich-edit.d.ts +4 -0
- package/lib/client/public/rich-edit.js +21 -0
- package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -1
- package/lib/client/settings.js +4 -0
- package/lib/client/utils/focus-helper.js +5 -22
- package/lib/common/canvas/canvas-manager.d.ts +2 -0
- package/lib/common/canvas/canvas-manager.js +34 -20
- package/lib/common/canvas/canvas-scroll-info.d.ts +6 -3
- package/lib/common/canvas/canvas-scroll-info.js +9 -4
- package/lib/common/canvas/canvas-scroll-manager.d.ts +4 -1
- package/lib/common/canvas/canvas-scroll-manager.js +28 -20
- package/lib/common/canvas/canvas-size-info.d.ts +3 -2
- package/lib/common/canvas/canvas-size-info.js +4 -6
- package/lib/common/canvas/renderes/canvas-listener/print-layout-view-canvas-listener.js +2 -2
- package/lib/common/canvas/renderes/common/document-renderer.d.ts +5 -2
- package/lib/common/canvas/renderes/common/document-renderer.js +5 -0
- package/lib/common/canvas/renderes/view-manager.d.ts +9 -1
- package/lib/common/canvas/renderes/view-manager.js +27 -2
- package/lib/common/commands/client-command.d.ts +3 -1
- package/lib/common/commands/client-command.js +2 -0
- package/lib/common/commands/command-manager.js +4 -0
- package/lib/common/commands/layout/apply-style-command.d.ts +2 -2
- package/lib/common/commands/layout/apply-style-command.js +4 -3
- package/lib/common/commands/layout/change-zoom-level-command.d.ts +10 -0
- package/lib/common/commands/layout/change-zoom-level-command.js +30 -0
- package/lib/common/commands/layout/toggle-allow-zoom-command.d.ts +7 -0
- package/lib/common/commands/layout/toggle-allow-zoom-command.js +17 -0
- package/lib/common/commands/ruler/ruler-table-column-separators-command.d.ts +9 -2
- package/lib/common/commands/ruler/ruler-table-column-separators-command.js +24 -15
- package/lib/common/commands/toc/set-paragraph-level-command.js +1 -1
- package/lib/common/formats/rtf/import/table/normalization/apply-use-values.d.ts +6 -0
- package/lib/common/formats/rtf/import/table/normalization/apply-use-values.js +90 -0
- package/lib/common/formats/rtf/import/table/table-converter.js +7 -2
- package/lib/common/input-controller.js +4 -0
- package/lib/common/interfaces/i-zoom-level-holder.d.ts +3 -0
- package/lib/common/interfaces/i-zoom-level-holder.js +1 -0
- package/lib/common/layout/document-layout.d.ts +2 -0
- package/lib/common/layout/document-layout.js +4 -0
- package/lib/common/layout-formatter/formatter/base-formatter.js +2 -1
- package/lib/common/model/borders/border-info.js +1 -1
- package/lib/common/model/changes/change.d.ts +2 -1
- package/lib/common/model/changes/enums.d.ts +2 -1
- package/lib/common/model/changes/enums.js +1 -0
- package/lib/common/model/changes/model/zoom-level.d.ts +8 -0
- package/lib/common/model/changes/model/zoom-level.js +8 -0
- package/lib/common/model/character/character-properties.d.ts +1 -1
- package/lib/common/model/character/character-properties.js +2 -14
- package/lib/common/model/creator/creator.js +6 -0
- package/lib/common/model/history/items/character-properties-history-items.d.ts +1 -2
- package/lib/common/model/history/items/character-properties-history-items.js +2 -3
- package/lib/common/model/json/enums/json-control-enums.d.ts +2 -1
- package/lib/common/model/json/enums/json-control-enums.js +1 -0
- package/lib/common/model/json/exporters/json-control-options-converter.js +2 -0
- package/lib/common/model/json/importers/json-importer.js +2 -0
- package/lib/common/model/manipulators/character-properties-manipulator.js +2 -2
- package/lib/common/model/manipulators/i-properties-manipulator.d.ts +1 -1
- package/lib/common/model/manipulators/model-manipulator.d.ts +2 -1
- package/lib/common/model/manipulators/model-manipulator.js +4 -0
- package/lib/common/model/options/control.d.ts +1 -0
- package/lib/common/model/options/control.js +1 -0
- package/lib/common/model/paragraph/paragraph-style.d.ts +9 -4
- package/lib/common/model/paragraph/paragraph-style.js +20 -14
- package/lib/common/model/rich-utils.d.ts +2 -0
- package/lib/common/model/rich-utils.js +2 -0
- package/lib/common/mouse-handler/resize-box-helper.js +2 -2
- package/lib/common/rich-edit-core.d.ts +0 -1
- package/lib/common/rich-edit-core.js +17 -22
- package/lib/common/ui/ruler/controls/base.d.ts +7 -2
- package/lib/common/ui/ruler/controls/base.js +11 -3
- package/lib/common/ui/ruler/controls/column.d.ts +17 -5
- package/lib/common/ui/ruler/controls/column.js +37 -21
- package/lib/common/ui/ruler/controls/divisions.d.ts +18 -5
- package/lib/common/ui/ruler/controls/divisions.js +41 -13
- package/lib/common/ui/ruler/controls/indent/first-line.js +2 -2
- package/lib/common/ui/ruler/controls/indent/left.js +2 -2
- package/lib/common/ui/ruler/controls/indent/right.js +2 -2
- package/lib/common/ui/ruler/controls/margin/base.js +3 -3
- package/lib/common/ui/ruler/controls/owner.d.ts +2 -0
- package/lib/common/ui/ruler/controls/owner.js +4 -0
- package/lib/common/ui/ruler/controls/ruler.js +8 -4
- package/lib/common/ui/ruler/controls/tab/tab-info.d.ts +15 -0
- package/lib/common/ui/ruler/controls/tab/tab-info.js +19 -0
- package/lib/common/ui/ruler/controls/tab/tab.d.ts +3 -3
- package/lib/common/ui/ruler/controls/tab/tab.js +10 -11
- package/lib/common/ui/ruler/controls/table.js +5 -4
- package/lib/common/ui/ruler/controls/vertical-line.js +1 -2
- package/lib/common/ui/ruler/controls/zoomable-value.d.ts +8 -0
- package/lib/common/ui/ruler/controls/zoomable-value.js +15 -0
- package/lib/common/ui/ruler/manager.d.ts +6 -2
- package/lib/common/ui/ruler/manager.js +13 -4
- package/lib/common/ui/ruler/model-data.d.ts +1 -0
- package/lib/common/ui/ruler/model-data.js +1 -0
- package/lib/common/ui/ruler/ruler.js +2 -0
- package/lib/common/utils/mixed-size.d.ts +27 -0
- package/lib/common/utils/mixed-size.js +91 -0
- package/lib/common/view-settings/views-settings.d.ts +2 -0
- package/lib/common/view-settings/views-settings.js +3 -0
- package/package.json +7 -7
@@ -1,6 +1,7 @@
|
|
1
1
|
import { IControlHeightProvider } from './i-control-height-provider';
|
2
2
|
import { LayoutPage } from '../layout/main-structures/layout-page';
|
3
3
|
import { RenderPageVertivalInfo } from '../view-settings/views-settings';
|
4
|
+
import { IZoomLevelHolder } from '../interfaces/i-zoom-level-holder';
|
4
5
|
export declare class CanvasSizeInfo implements IControlHeightProvider {
|
5
6
|
topSpacing: number;
|
6
7
|
betweenPageSpacing: number;
|
@@ -8,11 +9,11 @@ export declare class CanvasSizeInfo implements IControlHeightProvider {
|
|
8
9
|
scrollYVisible: boolean;
|
9
10
|
private visibleAreaSize;
|
10
11
|
private scrollWidth;
|
12
|
+
private zoomLevelHolder;
|
11
13
|
pageVerticalInfo: RenderPageVertivalInfo;
|
12
|
-
constructor();
|
14
|
+
constructor(zoomLevelHolder: IZoomLevelHolder);
|
13
15
|
isInitialized(): boolean;
|
14
16
|
initialize(page: HTMLElement, canvas: HTMLDivElement): void;
|
15
|
-
findPageIndexByOffsetY(pages: LayoutPage[], offsetY: number): number;
|
16
17
|
getPageOffsetY(layoutPage: LayoutPage): number;
|
17
18
|
private setVisibleAreaSize;
|
18
19
|
getVisibleAreaWidth(includeScrollBars: boolean): number;
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import { RenderPageVertivalInfo } from '../view-settings/views-settings';
|
2
2
|
import { Size } from '@devexpress/utils/lib/geometry/size';
|
3
|
-
import { SearchUtils } from '@devexpress/utils/lib/utils/search';
|
4
3
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
5
4
|
import { SizeUtils } from '../utils/size-utils';
|
6
5
|
export class CanvasSizeInfo {
|
7
|
-
constructor() {
|
6
|
+
constructor(zoomLevelHolder) {
|
8
7
|
this.topSpacing = -1;
|
9
8
|
this.betweenPageSpacing = 1;
|
10
9
|
this.visibleAreaSize = new Size(-1, -1);
|
11
10
|
this.scrollWidth = -1;
|
12
11
|
this.pageVerticalInfo = new RenderPageVertivalInfo();
|
12
|
+
this.zoomLevelHolder = zoomLevelHolder;
|
13
13
|
this.scrollWidth = DomUtils.getVerticalScrollBarWidth();
|
14
14
|
}
|
15
15
|
isInitialized() {
|
@@ -21,11 +21,9 @@ export class CanvasSizeInfo {
|
|
21
21
|
this.betweenPageSpacing = this.pageVerticalInfo.betweenPageSpacing;
|
22
22
|
this.setVisibleAreaSize(SizeUtils.getClientWidth(canvas), SizeUtils.getClientHeight(canvas));
|
23
23
|
}
|
24
|
-
findPageIndexByOffsetY(pages, offsetY) {
|
25
|
-
return Math.max(0, SearchUtils.normedInterpolationIndexOf(pages, (p) => this.getPageOffsetY(p), offsetY));
|
26
|
-
}
|
27
24
|
getPageOffsetY(layoutPage) {
|
28
|
-
|
25
|
+
const pageOffsetY = layoutPage.y + (this.topSpacing + layoutPage.index * this.betweenPageSpacing);
|
26
|
+
return pageOffsetY * this.zoomLevelHolder.zoomLevel;
|
29
27
|
}
|
30
28
|
setVisibleAreaSize(width, height) {
|
31
29
|
this.visibleAreaSize.width = width;
|
@@ -74,9 +74,9 @@ export class PrintLayoutViewCanvasListener extends CanvasListener {
|
|
74
74
|
Log.paramsHolder.visualizerManager.show(DebugVisualizerType.LayoutBounds, this.layout, p.index); }));
|
75
75
|
}
|
76
76
|
updateVisiblePages() {
|
77
|
-
|
78
|
-
this.viewManager.scroll.updatePageIndexesInfo(pages);
|
77
|
+
this.viewManager.scroll.updatePageIndexesInfo(this.layout);
|
79
78
|
const renderInterval = this.viewManager.scroll.renderPageIndexInterval();
|
79
|
+
const pages = this.layout.pages;
|
80
80
|
for (let pageIndex of this.handledPageIndexes)
|
81
81
|
if (!renderInterval.contains(pageIndex)) {
|
82
82
|
const page = pages[pageIndex];
|
@@ -25,8 +25,10 @@ import { Size } from '@devexpress/utils/lib/geometry/size';
|
|
25
25
|
import { CanvasManager } from '../../canvas-manager';
|
26
26
|
import { ViewManager } from '../view-manager';
|
27
27
|
import { IRichEditControl } from '../../../interfaces/i-rich-edit-core';
|
28
|
+
import { IModelChangesListener } from '../../../interfaces/model-changes-listener';
|
29
|
+
import { ModelChange } from '../../../model/changes/change';
|
28
30
|
export type GetSomeCanvasElementContainer = (node: Node) => Node;
|
29
|
-
export declare class SimpleViewCanvasSizeManager {
|
31
|
+
export declare class SimpleViewCanvasSizeManager implements IModelChangesListener {
|
30
32
|
protected canvasManager: CanvasManager;
|
31
33
|
protected size: Size;
|
32
34
|
private control;
|
@@ -36,7 +38,8 @@ export declare class SimpleViewCanvasSizeManager {
|
|
36
38
|
private resizeFrameId;
|
37
39
|
constructor(canvasManager: CanvasManager, control: IRichEditControl);
|
38
40
|
dispose(): void;
|
39
|
-
|
41
|
+
modelChanged(change: ModelChange): void;
|
42
|
+
changeSize(force: boolean): void;
|
40
43
|
setViewMode(val: boolean): void;
|
41
44
|
private changeSizeCore;
|
42
45
|
}
|
@@ -28,6 +28,7 @@ import { CanvasUtils } from '../../utils';
|
|
28
28
|
import { ScrollState } from '../../../scroll/model-states';
|
29
29
|
import { isDefined } from '@devexpress/utils/lib/utils/common';
|
30
30
|
import { StringUtils } from '@devexpress/utils/lib/utils/string';
|
31
|
+
import { ModelChangeType } from '../../../model/changes/enums';
|
31
32
|
export class SimpleViewCanvasSizeManager {
|
32
33
|
constructor(canvasManager, control) {
|
33
34
|
this.size = new Size(0, 0);
|
@@ -52,6 +53,10 @@ export class SimpleViewCanvasSizeManager {
|
|
52
53
|
this.resizeFrameId = null;
|
53
54
|
this.resizeObserver.disconnect();
|
54
55
|
}
|
56
|
+
modelChanged(change) {
|
57
|
+
if (change.type == ModelChangeType.ZoomLevelChanged && this.control.innerClientProperties.viewsSettings.isSimpleView)
|
58
|
+
this.changeSize(true);
|
59
|
+
}
|
55
60
|
changeSize(force) {
|
56
61
|
const curr = new Size(this.canvasManager.getCanvasWidth(), this.canvasManager.controlHeightProvider.getVisibleAreaHeight(false));
|
57
62
|
if (force || !curr.equals(this.size)) {
|
@@ -24,7 +24,10 @@ import { MisspelledSelectionRenderer } from './selection-renderers/misspelled-se
|
|
24
24
|
import { RangePermissionRenderer } from './selection-renderers/range-permission-renderer';
|
25
25
|
import { SearchSelectionRenderer } from './selection-renderers/search-selection-renderer';
|
26
26
|
import { SelectionRenderer } from './selection-renderers/selection-renderer';
|
27
|
-
|
27
|
+
import { IZoomLevelHolder } from '../../interfaces/i-zoom-level-holder';
|
28
|
+
import { IModelChangesListener } from '../../interfaces/model-changes-listener';
|
29
|
+
import { ModelChange } from '../../model/changes/change';
|
30
|
+
export declare class ViewManager implements ILayoutChangesListener, IZoomLevelHolder, IModelChangesListener {
|
28
31
|
private renderers;
|
29
32
|
get renderer(): DocumentRenderer;
|
30
33
|
get printLayoutRenderer(): DocumentRenderer;
|
@@ -56,6 +59,7 @@ export declare class ViewManager implements ILayoutChangesListener {
|
|
56
59
|
readonly control: IRichEditControl;
|
57
60
|
constructor(control: IRichEditControl, canvas: HTMLDivElement, eventManager: IEventManager, stringResources: StringResources, horizontalRuler: IRulerControl, inputController: InputController, innerClientProperties: InnerClientProperties, readOnlyPropertyHolder: IReadOnlyPropertyHolder, layoutFormatterManagerHolder: ILayoutFormatterManagerHolder, internalApi: IInternalApi, fieldOptions: FieldsSettings);
|
58
61
|
dispose(): void;
|
62
|
+
modelChanged(change: ModelChange): void;
|
59
63
|
adjust(force: boolean): void;
|
60
64
|
NotifyPagesReady(pageChanges: PageChange[]): void;
|
61
65
|
NotifyFullyFormatted(_pageCount: number): void;
|
@@ -67,4 +71,8 @@ export declare class ViewManager implements ILayoutChangesListener {
|
|
67
71
|
setWorkSession(layout: DocumentLayout, layoutSelection: LayoutSelection, imageCache: ImageCache): void;
|
68
72
|
closeDocument(): void;
|
69
73
|
ensureFirstPageIsRendered(): void;
|
74
|
+
get zoomLevel(): number;
|
75
|
+
set zoomLevel(value: number);
|
76
|
+
get allowZoom(): boolean;
|
77
|
+
set allowZoom(value: boolean);
|
70
78
|
}
|
@@ -24,13 +24,17 @@ import { MisspelledSelectionRenderer } from './selection-renderers/misspelled-se
|
|
24
24
|
import { RangePermissionRenderer } from './selection-renderers/range-permission-renderer';
|
25
25
|
import { SearchSelectionRenderer } from './selection-renderers/search-selection-renderer';
|
26
26
|
import { SelectionRenderer } from './selection-renderers/selection-renderer';
|
27
|
+
import { ControlOptions, DocumentCapability } from '../../model/options/control';
|
28
|
+
import { RichEditClientCommand } from '../../commands/client-command';
|
29
|
+
import { ZoomLevelChange } from '../../model/changes/model/zoom-level';
|
30
|
+
import { ModelChangeType } from '../../model/changes/enums';
|
27
31
|
export class ViewManager {
|
28
32
|
get renderer() { return this.renderers[this.innerClientProperties.viewsSettings.viewType]; }
|
29
33
|
get printLayoutRenderer() { return this.renderers[ViewType.PrintLayout]; }
|
30
34
|
get canvasListener() { return this.canvasListeners[this.innerClientProperties.viewsSettings.viewType]; }
|
31
35
|
constructor(control, canvas, eventManager, stringResources, horizontalRuler, inputController, innerClientProperties, readOnlyPropertyHolder, layoutFormatterManagerHolder, internalApi, fieldOptions) {
|
32
36
|
this.cache = [];
|
33
|
-
this.sizes = new CanvasSizeInfo();
|
37
|
+
this.sizes = new CanvasSizeInfo(this);
|
34
38
|
this.control = control;
|
35
39
|
this.readOnlyPropertyHolder = readOnlyPropertyHolder;
|
36
40
|
this.layoutFormatterManagerHolder = layoutFormatterManagerHolder;
|
@@ -65,6 +69,13 @@ export class ViewManager {
|
|
65
69
|
this.selection.dispose();
|
66
70
|
this.pagesContainer = null;
|
67
71
|
}
|
72
|
+
modelChanged(change) {
|
73
|
+
if (change.type == ModelChangeType.ZoomLevelChanged) {
|
74
|
+
this.canvas.scrollTop = this.canvas.scrollTop / change.prevZoomLevel * change.zoomLevel;
|
75
|
+
this.pagesContainer.style.zoom = change.zoomLevel.toString();
|
76
|
+
this.sizes.updateSize(this.canvas);
|
77
|
+
}
|
78
|
+
}
|
68
79
|
adjust(force) {
|
69
80
|
if ((force || !this.sizes.isInitialized()) && this.cache.length > 0) {
|
70
81
|
const firstRenderedPageIndex = Math.min(this.cache.length, Math.max(0, ListUtils.indexBy(this.layout.pages, (page) => page.flags.get(LayoutPageFlags.ContentRendered))));
|
@@ -102,7 +113,9 @@ export class ViewManager {
|
|
102
113
|
const pageInfo = layoutSelection.selectionInfo.pageInfos[pageIndex];
|
103
114
|
const item = pageInfo.oldItems[0];
|
104
115
|
const layoutPage = this.layout.pages[pageIndex];
|
105
|
-
|
116
|
+
const x = layoutPage.x + this.cache[pageIndex].page.offsetLeft + item.x;
|
117
|
+
const y = this.sizes.getPageOffsetY(layoutPage) + item.y;
|
118
|
+
this.inputController.setPosition(x, y);
|
106
119
|
}
|
107
120
|
}
|
108
121
|
NotifySearchSelectionLayoutChanged() {
|
@@ -128,6 +141,7 @@ export class ViewManager {
|
|
128
141
|
}
|
129
142
|
addTopLevelContainers() {
|
130
143
|
this.pagesContainer = DocumentRenderer.renderContainer(RendererClassNames.PAGES);
|
144
|
+
this.pagesContainer.style.zoom = this.zoomLevel.toString();
|
131
145
|
this.serviceContainer = DocumentRenderer.renderContainer(RendererClassNames.TOP_LEVEL_SERVICE_CONTAINER);
|
132
146
|
DocumentRenderer.insertInContainer(this.canvas, 0, this.pagesContainer, (node) => node);
|
133
147
|
this.canvas.appendChild(this.serviceContainer);
|
@@ -164,4 +178,15 @@ export class ViewManager {
|
|
164
178
|
firstPage.flags.set(LayoutPageFlags.ContentRendered, true);
|
165
179
|
}
|
166
180
|
}
|
181
|
+
get zoomLevel() { return this.innerClientProperties.viewsSettings.zoomLevel; }
|
182
|
+
set zoomLevel(value) {
|
183
|
+
const prevZoomLevel = this.zoomLevel;
|
184
|
+
this.innerClientProperties.viewsSettings.zoomLevel = value;
|
185
|
+
this.control.modelManager.modelManipulator.notifyModelChanged(new ZoomLevelChange(this.zoomLevel, prevZoomLevel));
|
186
|
+
}
|
187
|
+
get allowZoom() { return ControlOptions.isEnabled(this.control.modelManager.richOptions.control.allowZoom); }
|
188
|
+
set allowZoom(value) {
|
189
|
+
this.control.modelManager.richOptions.control.allowZoom = value ? DocumentCapability.Enabled : DocumentCapability.Hidden;
|
190
|
+
this.control.barHolder.forceUpdate({ [RichEditClientCommand.ChangeZoomLevel]: true });
|
191
|
+
}
|
167
192
|
}
|
@@ -421,4 +421,6 @@ export var RichEditClientCommand;
|
|
421
421
|
RichEditClientCommand[RichEditClientCommand["NoSpellingSuggestions"] = 457] = "NoSpellingSuggestions";
|
422
422
|
RichEditClientCommand[RichEditClientCommand["GetHtml"] = 458] = "GetHtml";
|
423
423
|
RichEditClientCommand[RichEditClientCommand["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
|
424
|
+
RichEditClientCommand[RichEditClientCommand["ChangeZoomLevel"] = 460] = "ChangeZoomLevel";
|
425
|
+
RichEditClientCommand[RichEditClientCommand["ToggleAllowZoom"] = 461] = "ToggleAllowZoom";
|
424
426
|
})(RichEditClientCommand || (RichEditClientCommand = {}));
|
@@ -67,6 +67,8 @@ import { GoToNextHeaderFooterCommand, GoToPreviousHeaderFooterCommand } from './
|
|
67
67
|
import { InsertFooterCommand, InsertHeaderCommand } from './header-footer/insert-header-footer-commands';
|
68
68
|
import { LinkHeaderFooterToPreviousCommand } from './header-footer/link-header-footer-commands';
|
69
69
|
import { ApplyStyleCommand } from './layout/apply-style-command';
|
70
|
+
import { ToggleAllowZoomCommand } from './layout/toggle-allow-zoom-command';
|
71
|
+
import { ChangeZoomLevelCommand } from './layout/change-zoom-level-command';
|
70
72
|
import { ClearFormattingCommand } from './layout/clear-formatting-command';
|
71
73
|
import { ChangeViewTypeCommand, SwitchToPrintLayoutViewCommand, SwitchToSimpleViewCommand } from './layout/switch-view-command';
|
72
74
|
import { ToggleFullScreenCommand } from './layout/toggle-full-screen-command';
|
@@ -555,6 +557,8 @@ export class CommandManager {
|
|
555
557
|
this.createCommand(control, RichEditClientCommand.ChangeViewType, ChangeViewTypeCommand);
|
556
558
|
this.createCommand(control, RichEditClientCommand.SwitchToSimpleView, SwitchToSimpleViewCommand);
|
557
559
|
this.createCommand(control, RichEditClientCommand.SwitchToPrintLayoutView, SwitchToPrintLayoutViewCommand);
|
560
|
+
this.createCommand(control, RichEditClientCommand.ChangeZoomLevel, ChangeZoomLevelCommand);
|
561
|
+
this.createCommand(control, RichEditClientCommand.ToggleAllowZoom, ToggleAllowZoomCommand);
|
558
562
|
this.createCommand(control, RichEditClientCommand.ShowErrorLoadPictureMessage, ShowLoadPictureErrorDialogCommand);
|
559
563
|
this.assingCommand(RichEditClientCommand.PrintDocumentOnClient, new PrintDocumentOnClient(control, printNonce));
|
560
564
|
}
|
@@ -6,7 +6,7 @@ import { CommandBase, CommandSimpleOptions } from '../command-base';
|
|
6
6
|
import { ApplyStyleCommandState } from '../command-states';
|
7
7
|
export interface IApplyStyleCommandParams {
|
8
8
|
styleName: string;
|
9
|
-
|
9
|
+
keepDirectFormatting?: boolean;
|
10
10
|
}
|
11
11
|
export declare class ApplyStyleCommand extends CommandBase<ApplyStyleCommandState> {
|
12
12
|
getState(): ApplyStyleCommandState;
|
@@ -14,7 +14,7 @@ export declare class ApplyStyleCommand extends CommandBase<ApplyStyleCommandStat
|
|
14
14
|
DEPRECATEDConvertOptionsParameter(parameter: string | IApplyStyleCommandParams): IApplyStyleCommandParams;
|
15
15
|
executeCore(state: ApplyStyleCommandState, options: CommandSimpleOptions<IApplyStyleCommandParams>): boolean;
|
16
16
|
applyCharacterStyle(subDocumentInterval: SubDocumentInterval, style: CharacterStyle, isPresetStyle: boolean): void;
|
17
|
-
applyParagraphStyle(subDocumentInterval: SubDocumentInterval, style: ParagraphStyle, isPresetStyle: boolean,
|
17
|
+
applyParagraphStyle(subDocumentInterval: SubDocumentInterval, style: ParagraphStyle, isPresetStyle: boolean, keepDirectFormatting?: boolean): void;
|
18
18
|
applyParagraphLinkedStyle(subDocumentInterval: SubDocumentInterval, style: ParagraphStyle, isPresetStyle: boolean): void;
|
19
19
|
private addLinkedCharacterStyle;
|
20
20
|
calculateAffectedParagraphCount(subDocumentInterval: SubDocumentInterval): number;
|
@@ -70,7 +70,7 @@ export class ApplyStyleCommand extends CommandBase {
|
|
70
70
|
paragraphStyle = StylesManager.getPresetParagraphStyleByName(styleName).clone();
|
71
71
|
isPresetStyle = true;
|
72
72
|
}
|
73
|
-
this.applyParagraphStyle(subDocumentInterval, paragraphStyle, isPresetStyle, parameter.
|
73
|
+
this.applyParagraphStyle(subDocumentInterval, paragraphStyle, isPresetStyle, parameter.keepDirectFormatting);
|
74
74
|
}
|
75
75
|
else if (!StylesManager.isParagraphStyle(parameter.styleName) && state.characterStyleChangeEnabled) {
|
76
76
|
const styleName = StylesManager.getStyleNameWithoutPrefix(parameter.styleName);
|
@@ -105,7 +105,7 @@ export class ApplyStyleCommand extends CommandBase {
|
|
105
105
|
this.modelManipulator.style.applyCharacterStyle(subDocumentInterval, characterStyle, false);
|
106
106
|
}
|
107
107
|
}
|
108
|
-
applyParagraphStyle(subDocumentInterval, style, isPresetStyle,
|
108
|
+
applyParagraphStyle(subDocumentInterval, style, isPresetStyle, keepDirectFormatting = false) {
|
109
109
|
const count = this.calculateAffectedParagraphCount(subDocumentInterval);
|
110
110
|
if (count > 0 && ControlOptions.isEnabled(this.control.modelManager.richOptions.control.paragraphStyle)) {
|
111
111
|
const { interval, subDocument } = subDocumentInterval;
|
@@ -118,7 +118,8 @@ export class ApplyStyleCommand extends CommandBase {
|
|
118
118
|
style = isPresetStyle ? modelManipulator.model.stylesManager.addParagraphStyle(style) : style;
|
119
119
|
this.history.addAndRedo(new ApplyParagraphStyleHistoryItem(modelManipulator, paragraphSubDocumentInterval, style));
|
120
120
|
this.history.addAndRedo(new ParagraphUseValueHistoryItem(modelManipulator, paragraphSubDocumentInterval, 0));
|
121
|
-
|
121
|
+
if (!keepDirectFormatting)
|
122
|
+
this.history.addAndRedo(new FontUseValueHistoryItem(modelManipulator, paragraphSubDocumentInterval, 0));
|
122
123
|
this.history.addAndRedo(new AddParagraphToListHistoryItem(modelManipulator, subDocument, paragraphIndex, NumberingList.NumberingListNotSettedIndex, -1));
|
123
124
|
}
|
124
125
|
}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { CommandBase, CommandSimpleOptions } from '../command-base';
|
2
|
+
import { SimpleCommandState } from '../command-states';
|
3
|
+
export declare class ChangeZoomLevelCommand extends CommandBase<SimpleCommandState> {
|
4
|
+
getState(): SimpleCommandState;
|
5
|
+
executeCore(_state: SimpleCommandState, options: CommandSimpleOptions<number>): boolean;
|
6
|
+
isEnabledInReadOnlyMode(): boolean;
|
7
|
+
isEnabled(): boolean;
|
8
|
+
DEPRECATEDConvertOptionsParameter(parameter: any): number;
|
9
|
+
private isZoomLevelValueCorrect;
|
10
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { isNumber } from '@devexpress/utils/lib/utils/common';
|
2
|
+
import { CommandBase } from '../command-base';
|
3
|
+
import { SimpleCommandState } from '../command-states';
|
4
|
+
import { RichUtils } from '../../model/rich-utils';
|
5
|
+
export class ChangeZoomLevelCommand extends CommandBase {
|
6
|
+
getState() {
|
7
|
+
const state = new SimpleCommandState(this.isEnabled(), this.control.viewManager.zoomLevel);
|
8
|
+
state.visible = this.control.viewManager.allowZoom;
|
9
|
+
return state;
|
10
|
+
}
|
11
|
+
executeCore(_state, options) {
|
12
|
+
if (options.param == this.control.viewManager.zoomLevel)
|
13
|
+
return false;
|
14
|
+
this.control.viewManager.zoomLevel = options.param;
|
15
|
+
return true;
|
16
|
+
}
|
17
|
+
isEnabledInReadOnlyMode() {
|
18
|
+
return true;
|
19
|
+
}
|
20
|
+
isEnabled() {
|
21
|
+
return this.control.viewManager.allowZoom;
|
22
|
+
}
|
23
|
+
DEPRECATEDConvertOptionsParameter(parameter) {
|
24
|
+
const res = typeof parameter == "string" ? parseFloat(parameter) : parameter;
|
25
|
+
return this.isZoomLevelValueCorrect(res) ? res : this.control.viewManager.zoomLevel;
|
26
|
+
}
|
27
|
+
isZoomLevelValueCorrect(size) {
|
28
|
+
return isNumber(size) && !isNaN(size) && size >= RichUtils.minZoomLevel && size <= RichUtils.maxZoomLevel;
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { CommandBase, CommandSimpleOptions } from '../command-base';
|
2
|
+
import { SimpleCommandState } from '../command-states';
|
3
|
+
export declare class ToggleAllowZoomCommand extends CommandBase<SimpleCommandState> {
|
4
|
+
getState(): SimpleCommandState;
|
5
|
+
executeCore(_state: SimpleCommandState, options: CommandSimpleOptions<boolean>): boolean;
|
6
|
+
isEnabledInReadOnlyMode(): boolean;
|
7
|
+
}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { CommandBase } from '../command-base';
|
2
|
+
import { SimpleCommandState } from '../command-states';
|
3
|
+
export class ToggleAllowZoomCommand extends CommandBase {
|
4
|
+
getState() {
|
5
|
+
return new SimpleCommandState(this.isEnabled(), this.control.viewManager.allowZoom);
|
6
|
+
}
|
7
|
+
executeCore(_state, options) {
|
8
|
+
const allowZoom = this.control.viewManager.allowZoom;
|
9
|
+
if (options.param === allowZoom)
|
10
|
+
return false;
|
11
|
+
this.control.viewManager.allowZoom = !allowZoom;
|
12
|
+
return true;
|
13
|
+
}
|
14
|
+
isEnabledInReadOnlyMode() {
|
15
|
+
return true;
|
16
|
+
}
|
17
|
+
}
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import { CommandBase, CommandOptions, ICommandOptions } from '../command-base';
|
2
2
|
import { SimpleCommandState } from '../command-states';
|
3
|
+
import { IZoomLevelHolder } from '../../interfaces/i-zoom-level-holder';
|
3
4
|
export declare class TableColumnSeparatorStruct {
|
5
|
+
zoomLevelHolder: IZoomLevelHolder;
|
4
6
|
index: number;
|
5
7
|
tableIndex: number;
|
6
8
|
cellSpacing: number;
|
@@ -9,14 +11,19 @@ export declare class TableColumnSeparatorStruct {
|
|
9
11
|
items: TableColumnSeparatorItem[];
|
10
12
|
get currItem(): TableColumnSeparatorItem;
|
11
13
|
get hasItems(): boolean;
|
14
|
+
constructor(zoomLevelHolder: IZoomLevelHolder);
|
12
15
|
createItem(position: number, marginLeft: number, marginRight: number): void;
|
13
16
|
clone(): TableColumnSeparatorStruct;
|
14
17
|
}
|
15
18
|
export declare class TableColumnSeparatorItem {
|
16
|
-
|
19
|
+
zoomLevelHolder: IZoomLevelHolder;
|
20
|
+
private zoomablePosition;
|
21
|
+
get position(): number;
|
22
|
+
get originalPosition(): number;
|
23
|
+
set position(value: number);
|
17
24
|
leftMargin: number;
|
18
25
|
rightMargin: number;
|
19
|
-
constructor(position: number, leftMargin: number, rightMargin: number);
|
26
|
+
constructor(position: number, leftMargin: number, rightMargin: number, zoomLevelHolder: IZoomLevelHolder);
|
20
27
|
clone(): TableColumnSeparatorItem;
|
21
28
|
}
|
22
29
|
export declare class RulerTableColumnSeparatorsCommand extends CommandBase<SimpleCommandState> {
|
@@ -8,8 +8,16 @@ import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
|
8
8
|
import { SearchUtils } from '@devexpress/utils/lib/utils/search';
|
9
9
|
import { CommandBase } from '../command-base';
|
10
10
|
import { SimpleCommandState } from '../command-states';
|
11
|
+
import { RulerValue } from '../../ui/ruler/controls/zoomable-value';
|
11
12
|
export class TableColumnSeparatorStruct {
|
12
|
-
|
13
|
+
get currItem() {
|
14
|
+
return this.items[this.index];
|
15
|
+
}
|
16
|
+
get hasItems() {
|
17
|
+
return this.items.length > 0;
|
18
|
+
}
|
19
|
+
constructor(zoomLevelHolder) {
|
20
|
+
this.zoomLevelHolder = zoomLevelHolder;
|
13
21
|
this.index = 0;
|
14
22
|
this.tableIndex = 0;
|
15
23
|
this.cellSpacing = 0;
|
@@ -17,17 +25,11 @@ export class TableColumnSeparatorStruct {
|
|
17
25
|
this.maxValue = -1;
|
18
26
|
this.items = [];
|
19
27
|
}
|
20
|
-
get currItem() {
|
21
|
-
return this.items[this.index];
|
22
|
-
}
|
23
|
-
get hasItems() {
|
24
|
-
return this.items.length > 0;
|
25
|
-
}
|
26
28
|
createItem(position, marginLeft, marginRight) {
|
27
|
-
this.items.push(new TableColumnSeparatorItem(position, marginLeft, marginRight));
|
29
|
+
this.items.push(new TableColumnSeparatorItem(position, marginLeft, marginRight, this.zoomLevelHolder));
|
28
30
|
}
|
29
31
|
clone() {
|
30
|
-
const result = new TableColumnSeparatorStruct();
|
32
|
+
const result = new TableColumnSeparatorStruct(this.zoomLevelHolder);
|
31
33
|
result.index = this.index;
|
32
34
|
result.tableIndex = this.tableIndex;
|
33
35
|
result.minValue = this.minValue;
|
@@ -37,13 +39,20 @@ export class TableColumnSeparatorStruct {
|
|
37
39
|
}
|
38
40
|
}
|
39
41
|
export class TableColumnSeparatorItem {
|
40
|
-
|
41
|
-
|
42
|
+
get position() { return this.zoomablePosition.value; }
|
43
|
+
;
|
44
|
+
get originalPosition() { return this.zoomablePosition.originalValue; }
|
45
|
+
;
|
46
|
+
set position(value) { this.zoomablePosition.value = value; }
|
47
|
+
;
|
48
|
+
constructor(position, leftMargin, rightMargin, zoomLevelHolder) {
|
49
|
+
this.zoomLevelHolder = zoomLevelHolder;
|
50
|
+
this.zoomablePosition = new RulerValue(position, this.zoomLevelHolder);
|
42
51
|
this.leftMargin = leftMargin;
|
43
52
|
this.rightMargin = rightMargin;
|
44
53
|
}
|
45
54
|
clone() {
|
46
|
-
return new TableColumnSeparatorItem(this.
|
55
|
+
return new TableColumnSeparatorItem(this.originalPosition, this.leftMargin, this.rightMargin, this.zoomLevelHolder);
|
47
56
|
}
|
48
57
|
}
|
49
58
|
export class RulerTableColumnSeparatorsCommand extends CommandBase {
|
@@ -83,7 +92,7 @@ export class RulerTableColumnSeparatorsCommand extends CommandBase {
|
|
83
92
|
}
|
84
93
|
return sellSpacing;
|
85
94
|
};
|
86
|
-
let struct = new TableColumnSeparatorStruct();
|
95
|
+
let struct = new TableColumnSeparatorStruct(this.control.viewManager);
|
87
96
|
if (this.selection.tableInfo.extendedData.numRows) {
|
88
97
|
let layoutPosition = (subDocument.isMain()
|
89
98
|
? new LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, position, DocumentLayoutDetailsLevel.Character)
|
@@ -126,8 +135,8 @@ export class RulerTableColumnSeparatorsCommand extends CommandBase {
|
|
126
135
|
struct.createItem(lastLayoutCell.right, 0, 0);
|
127
136
|
}
|
128
137
|
struct.tableIndex = currLogicGrid.table.index;
|
129
|
-
struct.items = struct.items.sort((a, b) => a.
|
130
|
-
struct.index = SearchUtils.normedInterpolationIndexOf(struct.items, (item) => item.
|
138
|
+
struct.items = struct.items.sort((a, b) => a.originalPosition - b.originalPosition);
|
139
|
+
struct.index = SearchUtils.normedInterpolationIndexOf(struct.items, (item) => item.originalPosition, layoutCell.x);
|
131
140
|
if (currLayoutGrid.parentCell) {
|
132
141
|
struct.minValue = currLayoutGrid.parentCell.x;
|
133
142
|
struct.maxValue = currLayoutGrid.parentCell.right;
|
@@ -22,7 +22,7 @@ export class SetParagraphLevelCommandBase extends CommandBase {
|
|
22
22
|
if (!paragraphStyle)
|
23
23
|
paragraphStyle = StylesManager.getPresetParagraphStyleByName(styleName);
|
24
24
|
if (paragraphStyle) {
|
25
|
-
const commandOptions = new CommandSimpleOptions(this.control, { styleName: StylesManager.paragraphPrefix + styleName,
|
25
|
+
const commandOptions = new CommandSimpleOptions(this.control, { styleName: StylesManager.paragraphPrefix + styleName, keepDirectFormatting: true });
|
26
26
|
this.commandManager.getCommand(RichEditClientCommand.ChangeStyle).execute(this.commandManager.isPublicApiCall, commandOptions);
|
27
27
|
}
|
28
28
|
else {
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { TableCellProperties } from '../../../../../model/tables/properties/table-cell-properties';
|
2
|
+
import { TableProperties } from '../../../../../model/tables/properties/table-properties';
|
3
|
+
import { TableRowProperties } from '../../../../../model/tables/properties/table-row-properties';
|
4
|
+
export declare function applyTablePropertiesUseValues(props: TableProperties, styleProps: TableProperties): void;
|
5
|
+
export declare function applyTableRowPropertiesUseValues(props: TableRowProperties, styleProps: TableRowProperties): void;
|
6
|
+
export declare function applyTableCellPropertiesUseValues(props: TableCellProperties, styleProps: TableCellProperties): void;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import { TableCellPropertiesMask } from '../../../../../model/tables/properties/table-cell-properties';
|
2
|
+
import { TablePropertiesMask } from '../../../../../model/tables/properties/table-properties';
|
3
|
+
import { TableRowPropertiesMask } from '../../../../../model/tables/properties/table-row-properties';
|
4
|
+
export function applyTablePropertiesUseValues(props, styleProps) {
|
5
|
+
props.mask = TablePropertiesMask.UseNone;
|
6
|
+
if (!props.borders.left.equals(styleProps.borders.left))
|
7
|
+
props.setUseValue(TablePropertiesMask.UseLeftBorder, true);
|
8
|
+
if (!props.borders.top.equals(styleProps.borders.top))
|
9
|
+
props.setUseValue(TablePropertiesMask.UseTopBorder, true);
|
10
|
+
if (!props.borders.right.equals(styleProps.borders.right))
|
11
|
+
props.setUseValue(TablePropertiesMask.UseRightBorder, true);
|
12
|
+
if (!props.borders.bottom.equals(styleProps.borders.bottom))
|
13
|
+
props.setUseValue(TablePropertiesMask.UseBottomBorder, true);
|
14
|
+
if (!props.borders.insideHorizontal.equals(styleProps.borders.insideHorizontal))
|
15
|
+
props.setUseValue(TablePropertiesMask.UseInsideHorizontalBorder, true);
|
16
|
+
if (!props.borders.insideVertical.equals(styleProps.borders.insideVertical))
|
17
|
+
props.setUseValue(TablePropertiesMask.UseInsideVerticalBorder, true);
|
18
|
+
if (!props.cellMargins.left.equals(styleProps.cellMargins.left))
|
19
|
+
props.setUseValue(TablePropertiesMask.UseLeftMargin, true);
|
20
|
+
if (!props.cellMargins.top.equals(styleProps.cellMargins.top))
|
21
|
+
props.setUseValue(TablePropertiesMask.UseTopMargin, true);
|
22
|
+
if (!props.cellMargins.right.equals(styleProps.cellMargins.right))
|
23
|
+
props.setUseValue(TablePropertiesMask.UseRightMargin, true);
|
24
|
+
if (!props.cellMargins.bottom.equals(styleProps.cellMargins.bottom))
|
25
|
+
props.setUseValue(TablePropertiesMask.UseBottomMargin, true);
|
26
|
+
if (!props.cellSpacing.equals(styleProps.cellSpacing))
|
27
|
+
props.setUseValue(TablePropertiesMask.UseCellSpacing, true);
|
28
|
+
if (!props.indent.equals(styleProps.indent))
|
29
|
+
props.setUseValue(TablePropertiesMask.UseTableIndent, true);
|
30
|
+
if (props.tableStyleColumnBandSize != styleProps.tableStyleColumnBandSize)
|
31
|
+
props.setUseValue(TablePropertiesMask.UseTableStyleColBandSize, true);
|
32
|
+
if (props.tableStyleRowBandSize != styleProps.tableStyleRowBandSize)
|
33
|
+
props.setUseValue(TablePropertiesMask.UseTableStyleRowBandSize, true);
|
34
|
+
if (props.avoidDoubleBorders != styleProps.avoidDoubleBorders)
|
35
|
+
props.setUseValue(TablePropertiesMask.UseAvoidDoubleBorders, true);
|
36
|
+
if (props.layoutType != styleProps.layoutType)
|
37
|
+
props.setUseValue(TablePropertiesMask.UseTableLayout, true);
|
38
|
+
if (!props.shadingInfo.equals(styleProps.shadingInfo))
|
39
|
+
props.setUseValue(TablePropertiesMask.UseShadingInfoIndex, true);
|
40
|
+
if (props.tableRowAlignment != styleProps.tableRowAlignment)
|
41
|
+
props.setUseValue(TablePropertiesMask.UseTableAlignment, true);
|
42
|
+
if (props.isTableOverlap != styleProps.isTableOverlap)
|
43
|
+
props.setUseValue(TablePropertiesMask.UseIsTableOverlap, true);
|
44
|
+
}
|
45
|
+
export function applyTableRowPropertiesUseValues(props, styleProps) {
|
46
|
+
props.mask = TableRowPropertiesMask.UseNone;
|
47
|
+
if (!props.cellSpacing.equals(styleProps.cellSpacing))
|
48
|
+
props.setUseValue(TableRowPropertiesMask.UseCellSpacing, true);
|
49
|
+
if (props.cantSplit != styleProps.cantSplit)
|
50
|
+
props.setUseValue(TableRowPropertiesMask.UseCantSplit, true);
|
51
|
+
if (props.hideCellMark != styleProps.hideCellMark)
|
52
|
+
props.setUseValue(TableRowPropertiesMask.UseHideCellMark, true);
|
53
|
+
if (props.tableRowAlignment != styleProps.tableRowAlignment)
|
54
|
+
props.setUseValue(TableRowPropertiesMask.UseTableRowAlignment, true);
|
55
|
+
if (props.header != styleProps.header)
|
56
|
+
props.setUseValue(TableRowPropertiesMask.UseHeader, true);
|
57
|
+
if (props.divId != styleProps.divId)
|
58
|
+
props.setUseValue(TableRowPropertiesMask.UseDivId, true);
|
59
|
+
}
|
60
|
+
export function applyTableCellPropertiesUseValues(props, styleProps) {
|
61
|
+
props.mask = TableCellPropertiesMask.UseNone;
|
62
|
+
if (!props.cellMargins.left.equals(styleProps.cellMargins.left))
|
63
|
+
props.setUseValue(TableCellPropertiesMask.UseLeftMargin, true);
|
64
|
+
if (!props.cellMargins.top.equals(styleProps.cellMargins.top))
|
65
|
+
props.setUseValue(TableCellPropertiesMask.UseTopMargin, true);
|
66
|
+
if (!props.cellMargins.bottom.equals(styleProps.cellMargins.bottom))
|
67
|
+
props.setUseValue(TableCellPropertiesMask.UseBottomMargin, true);
|
68
|
+
if (!props.cellMargins.right.equals(styleProps.cellMargins.right))
|
69
|
+
props.setUseValue(TableCellPropertiesMask.UseRightMargin, true);
|
70
|
+
if (!props.borders.left.equals(styleProps.borders.left))
|
71
|
+
props.setUseValue(TableCellPropertiesMask.UseLeftBorder, true);
|
72
|
+
if (!props.borders.top.equals(styleProps.borders.top))
|
73
|
+
props.setUseValue(TableCellPropertiesMask.UseTopBorder, true);
|
74
|
+
if (!props.borders.bottom.equals(styleProps.borders.bottom))
|
75
|
+
props.setUseValue(TableCellPropertiesMask.UseBottomBorder, true);
|
76
|
+
if (!props.borders.right.equals(styleProps.borders.right))
|
77
|
+
props.setUseValue(TableCellPropertiesMask.UseRightBorder, true);
|
78
|
+
if (props.hideCellMark != styleProps.hideCellMark)
|
79
|
+
props.setUseValue(TableCellPropertiesMask.UseHideCellMark, true);
|
80
|
+
if (props.noWrap != styleProps.noWrap)
|
81
|
+
props.setUseValue(TableCellPropertiesMask.UseNoWrap, true);
|
82
|
+
if (props.fitText != styleProps.fitText)
|
83
|
+
props.setUseValue(TableCellPropertiesMask.UseFitText, true);
|
84
|
+
if (props.textDirection != styleProps.textDirection)
|
85
|
+
props.setUseValue(TableCellPropertiesMask.UseTextDirection, true);
|
86
|
+
if (props.verticalAlignment != styleProps.verticalAlignment)
|
87
|
+
props.setUseValue(TableCellPropertiesMask.UseVerticalAlignment, true);
|
88
|
+
if (!props.shadingInfo.equals(styleProps.shadingInfo))
|
89
|
+
props.setUseValue(TableCellPropertiesMask.UseShadingInfoIndex, true);
|
90
|
+
}
|
@@ -7,6 +7,7 @@ import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
|
7
7
|
import { NumberMapUtils } from '@devexpress/utils/lib/utils/map/number';
|
8
8
|
import { RtfTableColumnsCalculator } from './rtf-table-columns-calculator';
|
9
9
|
import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
10
|
+
import { applyTableCellPropertiesUseValues, applyTablePropertiesUseValues, applyTableRowPropertiesUseValues } from './normalization/apply-use-values';
|
10
11
|
export class RtfTableConverter {
|
11
12
|
constructor(tableReader) {
|
12
13
|
this.rtfCellMap = {};
|
@@ -54,8 +55,9 @@ export class RtfTableConverter {
|
|
54
55
|
tablePreferredWidth.type = TableWidthUnitType.Auto;
|
55
56
|
tablePreferredWidth.value = 0;
|
56
57
|
}
|
57
|
-
|
58
|
-
|
58
|
+
const useMargins = table.properties.coreProperties.getUseValue(TablePropertiesMask.UseLeftMargin) &&
|
59
|
+
table.properties.coreProperties.getUseValue(TablePropertiesMask.UseRightMargin);
|
60
|
+
if (!useMargins && table.properties.useHalfSpace) {
|
59
61
|
const margin = table.properties.halfSpace;
|
60
62
|
table.properties.coreProperties.cellMargins.left.type = TableWidthUnitType.ModelUnits;
|
61
63
|
table.properties.coreProperties.cellMargins.left.value = margin;
|
@@ -99,6 +101,7 @@ export class RtfTableConverter {
|
|
99
101
|
return 0;
|
100
102
|
}
|
101
103
|
convertTableCore(table, rtfTable) {
|
104
|
+
applyTablePropertiesUseValues(table.properties, table.style.baseConditionalStyle.tableProperties);
|
102
105
|
const tableGrid = this.calculateTableGrid(rtfTable);
|
103
106
|
const rows = table.rows;
|
104
107
|
const tableLayoutType = table.properties.layoutType;
|
@@ -201,6 +204,7 @@ export class RtfTableConverter {
|
|
201
204
|
return result;
|
202
205
|
}
|
203
206
|
convertRow(row, rtfRow) {
|
207
|
+
applyTableRowPropertiesUseValues(row.properties, row.parentTable.style.baseConditionalStyle.tableRowProperties);
|
204
208
|
const rtfCells = rtfRow.cells;
|
205
209
|
for (let i = 0; i < rtfCells.length; i++)
|
206
210
|
this.convertCell(row, rtfCells[i]);
|
@@ -209,6 +213,7 @@ export class RtfTableConverter {
|
|
209
213
|
if (rtfCell.properties.horizontalMerging == TableCellMergingState.Restart)
|
210
214
|
this.mergeCells(rtfCell);
|
211
215
|
const cell = rtfCell.createCell(row, this.subDocument);
|
216
|
+
applyTableCellPropertiesUseValues(cell.properties, cell.parentRow.parentTable.style.baseConditionalStyle.tableCellProperties);
|
212
217
|
row.cells.push(cell);
|
213
218
|
this.rtfCellMap[rtfCell.idForParentCellMap] = cell;
|
214
219
|
}
|