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
a3832b6d
Commit
a3832b6d
authored
Apr 17, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented adding a paragraph elements to the new class CBlockLevelSdt.
parent
c97557f1
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
212 additions
and
198 deletions
+212
-198
word/Editor/Document.js
word/Editor/Document.js
+13
-13
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+173
-171
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+8
-0
word/Editor/DrawingsController.js
word/Editor/DrawingsController.js
+1
-1
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+1
-1
word/Editor/HeaderFooter.js
word/Editor/HeaderFooter.js
+1
-1
word/Editor/HeaderFooterController.js
word/Editor/HeaderFooterController.js
+1
-1
word/Editor/ParagraphContent.js
word/Editor/ParagraphContent.js
+0
-8
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+12
-0
word/api.js
word/api.js
+2
-2
No files found.
word/Editor/Document.js
View file @
a3832b6d
...
...
@@ -4052,7 +4052,7 @@ CDocument.prototype.AddInlineTable = function(Cols, Rows)
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateRulersState
();
};
CDocument
.
prototype
.
Add
_
DropCap
=
function
(
bInText
)
CDocument
.
prototype
.
AddDropCap
=
function
(
bInText
)
{
// Определим параграф, к которому мы будем добавлять буквицу
var
Pos
=
-
1
;
...
...
@@ -4106,7 +4106,7 @@ CDocument.prototype.Add_DropCap = function(bInText)
this
.
Document_UpdateRulersState
();
}
};
CDocument
.
prototype
.
Remove
_
DropCap
=
function
(
bDropCap
)
CDocument
.
prototype
.
RemoveDropCap
=
function
(
bDropCap
)
{
var
Pos
=
-
1
;
...
...
@@ -4247,7 +4247,7 @@ CDocument.prototype.Remove_DropCap = function(bDropCap)
}
}
};
CDocument
.
prototype
.
Check_
FramePrLastParagraph
=
function
()
CDocument
.
prototype
.
private_Check
FramePrLastParagraph
=
function
()
{
var
Count
=
this
.
Content
.
length
;
if
(
Count
<=
0
)
...
...
@@ -7469,7 +7469,7 @@ CDocument.prototype.Internal_Content_Remove = function(Position, Count, bCorrect
this
.
Check_SectionLastParagraph
();
// Проверим не является ли рамкой последний параграф
this
.
Check_
FramePrLastParagraph
();
this
.
private_Check
FramePrLastParagraph
();
// Запоминаем, что нам нужно произвести переиндексацию элементов
this
.
private_ReindexContent
(
Position
);
...
...
@@ -11708,7 +11708,7 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate)
{
// Просто перерисовываем нужные страницы
var
StartPage
=
this
.
Content
[
StartPos
].
Get_StartPage_Absolute
();
var
EndPage
=
this
.
Content
[
EndPos
].
Get_StartPage_Absolute
()
+
this
.
Content
[
EndPos
].
Pages
.
length
-
1
;
var
EndPage
=
this
.
Content
[
EndPos
].
Get_StartPage_Absolute
()
+
this
.
Content
[
EndPos
].
GetPagesCount
()
-
1
;
this
.
ReDraw
(
StartPage
,
EndPage
);
}
}
...
...
@@ -11771,8 +11771,8 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate)
{
this
.
Add_NewParagraph
(
undefined
,
true
);
var
CurPos
=
this
.
CurPos
.
ContentPos
-
1
;
this
.
Content
[
CurPos
].
Cursor_MoveToStartPos
(
);
this
.
Content
[
CurPos
].
Add
(
ParaItem
);
this
.
Content
[
CurPos
].
MoveCursorToStartPos
(
false
);
this
.
Content
[
CurPos
].
Add
ToParagraph
(
ParaItem
);
this
.
Content
[
CurPos
].
Clear_Formatting
();
}
}
...
...
@@ -11784,15 +11784,15 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate)
var
CurPos
=
this
.
CurPos
.
ContentPos
;
if
(
oCurElement
&&
type_Paragraph
===
oCurElement
.
Get_Type
()
&&
oCurElement
.
IsColumnBreakOnLeft
())
{
oCurElement
.
Add
(
ParaItem
);
oCurElement
.
Add
ToParagraph
(
ParaItem
);
}
else
{
this
.
Add_NewParagraph
(
undefined
,
true
);
CurPos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
CurPos
].
Cursor_MoveToStartPos
(
);
this
.
Content
[
CurPos
].
Add
(
ParaItem
);
this
.
Content
[
CurPos
].
MoveCursorToStartPos
(
false
);
this
.
Content
[
CurPos
].
Add
ToParagraph
(
ParaItem
);
}
}
else
...
...
@@ -11800,8 +11800,8 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate)
this
.
Add_NewParagraph
(
undefined
,
true
);
this
.
Add_NewParagraph
(
undefined
,
true
);
var
CurPos
=
this
.
CurPos
.
ContentPos
-
1
;
this
.
Content
[
CurPos
].
Cursor_MoveToStartPos
(
);
this
.
Content
[
CurPos
].
Add
(
ParaItem
);
this
.
Content
[
CurPos
].
MoveCursorToStartPos
(
false
);
this
.
Content
[
CurPos
].
Add
ToParagraph
(
ParaItem
);
this
.
Content
[
CurPos
].
Clear_Formatting
();
}
}
...
...
@@ -11822,7 +11822,7 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate)
}
else
{
Item
.
Add
(
ParaItem
);
Item
.
Add
ToParagraph
(
ParaItem
);
if
(
false
!=
bRecalculate
&&
type_Paragraph
==
Item
.
GetType
())
{
...
...
word/Editor/DocumentContent.js
View file @
a3832b6d
This diff is collapsed.
Click to expand it.
word/Editor/DocumentContentElementBase.js
View file @
a3832b6d
...
...
@@ -425,6 +425,10 @@ CDocumentContentElementBase.prototype.Is_Empty = function()
{
return
true
;
};
CDocumentContentElementBase
.
prototype
.
Add
=
function
(
oParaItem
)
{
// TODO: Данную функцию нужно заменить на AddToParagraph
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -531,6 +535,10 @@ CDocumentContentElementBase.prototype.IsEmpty = function()
{
return
this
.
Is_Empty
();
};
CDocumentContentElementBase
.
prototype
.
AddToParagraph
=
function
(
oItem
)
{
return
this
.
Add
(
oItem
);
};
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
...
...
word/Editor/DrawingsController.js
View file @
a3832b6d
...
...
@@ -67,7 +67,7 @@ CDrawingsController.prototype.ClearParagraphFormatting = function()
};
CDrawingsController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
if
(
para_NewLine
===
oItem
.
Type
&&
true
===
oItem
.
Is
_
PageOrColumnBreak
())
if
(
para_NewLine
===
oItem
.
Type
&&
true
===
oItem
.
IsPageOrColumnBreak
())
return
;
this
.
DrawingObjects
.
paragraphAdd
(
oItem
,
bRecalculate
);
...
...
word/Editor/Footnotes.js
View file @
a3832b6d
...
...
@@ -1409,7 +1409,7 @@ CFootnotesController.prototype.ClearParagraphFormatting = function()
};
CFootnotesController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
if
(
para_NewLine
===
oItem
.
Type
&&
true
===
oItem
.
Is
_
PageOrColumnBreak
())
if
(
para_NewLine
===
oItem
.
Type
&&
true
===
oItem
.
IsPageOrColumnBreak
())
return
;
if
(
oItem
instanceof
ParaTextPr
)
...
...
word/Editor/HeaderFooter.js
View file @
a3832b6d
...
...
@@ -1870,7 +1870,7 @@ CHeaderFooterController.prototype =
Paragraph_Add
:
function
(
ParaItem
,
bRecalculate
)
{
if
(
para_NewLine
===
ParaItem
.
Type
&&
true
===
ParaItem
.
Is
_
PageOrColumnBreak
())
if
(
para_NewLine
===
ParaItem
.
Type
&&
true
===
ParaItem
.
IsPageOrColumnBreak
())
return
;
if
(
null
!=
this
.
CurHdrFtr
)
...
...
word/Editor/HeaderFooterController.js
View file @
a3832b6d
...
...
@@ -70,7 +70,7 @@ CHdrFtrController.prototype.ClearParagraphFormatting = function()
};
CHdrFtrController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
if
(
para_NewLine
===
oItem
.
Type
&&
true
===
oItem
.
Is
_
PageOrColumnBreak
())
if
(
para_NewLine
===
oItem
.
Type
&&
true
===
oItem
.
IsPageOrColumnBreak
())
return
;
this
.
HdrFtr
.
Paragraph_Add
(
oItem
,
bRecalculate
);
...
...
word/Editor/ParagraphContent.js
View file @
a3832b6d
...
...
@@ -1099,14 +1099,6 @@ ParaNewLine.prototype =
if
(
break_Page
===
this
.
BreakType
||
break_Column
===
this
.
BreakType
)
this
.
Flags
=
{
NewLine
:
Reader
.
GetBool
()
};
},
Is_PageOrColumnBreak
:
function
()
{
if
(
break_Page
===
this
.
BreakType
||
break_Column
===
this
.
BreakType
)
return
true
;
return
false
;
}
};
ParaNewLine
.
prototype
.
IsPageOrColumnBreak
=
function
()
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
a3832b6d
...
...
@@ -335,6 +335,10 @@ CBlockLevelSdt.prototype.Is_Empty = function()
{
return
this
.
Content
.
Is_Empty
();
};
CBlockLevelSdt
.
prototype
.
Add
=
function
(
oParaItem
)
{
return
this
.
Content
.
Paragraph_Add
(
oParaItem
);
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt
.
prototype
.
Is_HdrFtr
=
function
(
bReturnHdrFtr
)
{
...
...
@@ -434,6 +438,14 @@ CBlockLevelSdt.prototype.Refresh_RecalcData2 = function(CurPage)
{
this
.
Parent
.
Refresh_RecalcData2
(
this
.
Index
,
CurPage
);
};
CBlockLevelSdt
.
prototype
.
Check_AutoFit
=
function
()
{
return
this
.
Parent
.
Check_AutoFit
();
};
CBlockLevelSdt
.
prototype
.
Is_InTable
=
function
(
bReturnTopTable
)
{
return
this
.
Parent
.
Is_InTable
(
bReturnTopTable
);
};
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
...
...
word/api.js
View file @
a3832b6d
...
...
@@ -1412,12 +1412,12 @@ background-repeat: no-repeat;\
asc_docs_api
.
prototype
.
asc_addDropCap
=
function
(
bInText
)
{
this
.
WordControl
.
m_oLogicDocument
.
Add
_
DropCap
(
bInText
);
this
.
WordControl
.
m_oLogicDocument
.
AddDropCap
(
bInText
);
};
asc_docs_api
.
prototype
.
removeDropcap
=
function
(
bDropCap
)
{
this
.
WordControl
.
m_oLogicDocument
.
Remove
_
DropCap
(
bDropCap
);
this
.
WordControl
.
m_oLogicDocument
.
RemoveDropCap
(
bDropCap
);
};
asc_docs_api
.
prototype
.
get_TextProps
=
function
()
...
...
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