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
47cd63a0
Commit
47cd63a0
authored
Mar 22, 2016
by
Sergey Luzyanin
Committed by
Alexander.Trofimov
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
increase & decrease font size in chart lables.
parent
e8a2256b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
45 deletions
+78
-45
Common/Drawings/CommonController.js
Common/Drawings/CommonController.js
+18
-3
Common/Drawings/DrawingObjectsHandlers.js
Common/Drawings/DrawingObjectsHandlers.js
+1
-1
Common/Drawings/Format/ChartSpace.js
Common/Drawings/Format/ChartSpace.js
+59
-41
No files found.
Common/Drawings/CommonController.js
View file @
47cd63a0
...
...
@@ -1019,7 +1019,7 @@ DrawingObjectsController.prototype =
}
if
(
f
===
CDocumentContent
.
prototype
.
Paragraph_IncDecFontSize
)
{
arr
[
i
].
paragraphIncDecFontSize
(
args
[
0
]);
}
}
else
if
(
arr
[
i
].
getDocContent
)
...
...
@@ -1114,14 +1114,29 @@ DrawingObjectsController.prototype =
}
else
if
(
this
.
selection
.
groupSelection
.
selection
.
chartSelection
)
{
applyToChartSelection
(
this
.
selection
.
groupSelection
.
selection
.
chartSelection
);
if
(
f
===
CDocumentContent
.
prototype
.
Paragraph_IncDecFontSize
)
{
this
.
selection
.
groupSelection
.
selection
.
chartSelection
.
paragraphIncDecFontSize
(
args
[
0
]);
}
else
{
applyToChartSelection
(
this
.
selection
.
groupSelection
.
selection
.
chartSelection
);
}
}
else
applyToArrayDrawings
(
this
.
selection
.
groupSelection
.
selectedObjects
);
}
else
if
(
this
.
selection
.
chartSelection
)
{
applyToChartSelection
(
this
.
selection
.
chartSelection
);
if
(
f
===
CDocumentContent
.
prototype
.
Paragraph_IncDecFontSize
)
{
this
.
selection
.
chartSelection
.
paragraphIncDecFontSize
(
args
[
0
]);
}
else
{
applyToChartSelection
(
this
.
selection
.
chartSelection
);
}
}
else
{
...
...
Common/Drawings/DrawingObjectsHandlers.js
View file @
47cd63a0
...
...
@@ -375,7 +375,7 @@ function handleChart(drawing, drawingObjectsController, e, x, y, group, pageInde
selector
.
resetSelection
();
selector
.
selectObject
(
drawing
,
pageIndex
);
selector
.
selection
.
chartSelection
=
drawing
;
drawing
.
selection
.
axisLbls
=
oLabels
;
drawing
.
selection
.
axisLbls
=
oLabels
.
axis
;
drawingObjectsController
.
updateSelectionState
();
drawingObjectsController
.
updateOverlay
();
return
true
;
...
...
Common/Drawings/Format/ChartSpace.js
View file @
47cd63a0
...
...
@@ -366,6 +366,31 @@ function CheckObjectTextPr(oElement, oTextPr, oDrawingDocument)
}
}
function
CheckIncDecFontSize
(
oElement
,
bIncrease
,
oDrawingDocument
,
nDefaultSize
)
{
if
(
oElement
)
{
if
(
!
oElement
.
txPr
)
{
oElement
.
setTxPr
(
CreateTextBodyFromString
(
""
,
oDrawingDocument
,
oElement
));
}
var
oParaPr
=
oElement
.
txPr
.
content
.
Content
[
0
].
Pr
.
Copy
();
oElement
.
txPr
.
content
.
Content
[
0
].
Set_DocumentIndex
(
0
);
var
oCopyTextPr
;
if
(
oParaPr
.
DefaultRunPr
)
{
oCopyTextPr
=
oParaPr
.
DefaultRunPr
.
Copy
();
}
else
{
oCopyTextPr
=
new
CTextPr
();
}
oCopyTextPr
.
FontSize
=
FontSize_IncreaseDecreaseValue
(
bIncrease
,
isRealNumber
(
oCopyTextPr
.
FontSize
)
?
oCopyTextPr
.
FontSize
:
nDefaultSize
);
oParaPr
.
DefaultRunPr
=
oCopyTextPr
;
oElement
.
txPr
.
content
.
Content
[
0
].
Set_Pr
(
oParaPr
);
}
}
function
CChartSpace
()
{
this
.
chart
=
null
;
...
...
@@ -495,7 +520,8 @@ CChartSpace.prototype =
}
else
if
(
this
.
selection
.
axisLbls
)
{
drawingDocument
.
DrawTrack
(
TYPE_TRACK_SHAPE
,
this
.
transform
,
this
.
selection
.
axisLbls
.
x
,
this
.
selection
.
axisLbls
.
y
,
this
.
selection
.
axisLbls
.
extX
,
this
.
selection
.
axisLbls
.
extY
,
false
,
false
);
var
oLabels
=
this
.
selection
.
axisLbls
.
labels
drawingDocument
.
DrawTrack
(
TYPE_TRACK_SHAPE
,
this
.
transform
,
oLabels
.
x
,
oLabels
.
y
,
oLabels
.
extX
,
oLabels
.
extY
,
false
,
false
);
}
}
},
...
...
@@ -706,13 +732,10 @@ CChartSpace.prototype =
{
return
this
.
selection
.
textSelection
.
txBody
.
content
.
Get_Paragraph_TextPr
();
}
else
if
(
this
.
selection
.
axisLbls
)
else
if
(
this
.
selection
.
axisLbls
&&
this
.
selection
.
axisLbls
.
labels
)
{
if
(
this
.
selection
.
axisLbls
.
axis
)
{
return
GetTextPrFormArrObjects
(
this
.
selection
.
axisLbls
.
arrLabels
,
true
);
return
GetTextPrFormArrObjects
(
this
.
selection
.
axisLbls
.
labels
.
arrLabels
,
true
);
}
}
else
if
(
isRealNumber
(
this
.
selection
.
dataLbls
))
{
var
ser
=
this
.
chart
.
plotArea
.
chart
.
series
[
this
.
selection
.
dataLbls
];
...
...
@@ -740,33 +763,21 @@ CChartSpace.prototype =
return
new
CTextPr
();
},
paragraphAdd
:
function
(
paraItem
,
bRecalculate
)
applyLabelsFunction
:
function
(
fCallback
,
value
)
{
var
content
;
if
(
paraItem
.
Type
===
para_TextPr
)
if
(
this
.
selection
.
title
)
{
var
_paraItem
;
if
(
paraItem
.
Value
.
Unifill
&&
paraItem
.
Value
.
Unifill
.
checkWordMods
())
{
_paraItem
=
paraItem
.
Copy
();
_paraItem
.
Value
.
Unifill
.
convertToPPTXMods
();
}
else
{
_paraItem
=
paraItem
;
}
if
(
this
.
selection
.
title
&&
!
this
.
selection
.
textSelection
)
{
CheckObjectTextPr
(
this
.
selection
.
title
,
_paraItem
.
Value
,
this
.
getDrawingDocument
());
fCallback
(
this
.
selection
.
title
,
value
,
this
.
getDrawingDocument
(),
18
);
}
else
if
(
this
.
selection
.
legend
)
{
if
(
!
isRealNumber
(
this
.
selection
.
legendEntry
))
{
CheckObjectTextPr
(
this
.
selection
.
legend
,
paraItem
.
Value
,
this
.
getDrawingDocument
()
);
fCallback
(
this
.
selection
.
legend
,
value
,
this
.
getDrawingDocument
(),
10
);
for
(
var
i
=
0
;
i
<
this
.
selection
.
legend
.
legendEntryes
.
length
;
++
i
)
{
CheckObjectTextPr
(
this
.
selection
.
legend
.
legendEntryes
[
i
],
paraItem
.
Value
,
this
.
getDrawingDocument
()
);
fCallback
(
this
.
selection
.
legend
.
legendEntryes
[
i
],
value
,
this
.
getDrawingDocument
(),
10
);
}
}
else
...
...
@@ -780,22 +791,14 @@ CChartSpace.prototype =
}
if
(
entry
)
{
CheckObjectTextPr
(
entry
,
paraItem
.
Value
,
this
.
getDrawingDocument
()
);
fCallback
(
entry
,
value
,
this
.
getDrawingDocument
(),
10
);
}
}
}
else
if
(
this
.
selection
.
textSelection
)
{
this
.
selection
.
textSelection
.
checkDocContent
();
this
.
selection
.
textSelection
.
paragraphAdd
(
_paraItem
,
bRecalculate
);
}
else
if
(
this
.
selection
.
axisLbls
)
{
if
(
this
.
selection
.
axisLbls
.
axis
)
{
CheckObjectTextPr
(
this
.
selection
.
axisLbls
.
axis
,
paraItem
.
Value
,
this
.
getDrawingDocument
());
fCallback
(
this
.
selection
.
axisLbls
,
value
,
this
.
getDrawingDocument
(),
10
);
}
}
else
if
(
isRealNumber
(
this
.
selection
.
dataLbls
))
{
var
ser
=
this
.
chart
.
plotArea
.
chart
.
series
[
this
.
selection
.
dataLbls
];
...
...
@@ -817,14 +820,13 @@ CChartSpace.prototype =
}
if
(
!
isRealNumber
(
this
.
selection
.
dataLbl
))
{
CheckObjectTextPr
(
ser
.
dLbls
,
paraItem
.
Value
,
this
.
getDrawingDocument
());
fCallback
(
ser
.
dLbls
,
value
,
this
.
getDrawingDocument
(),
10
);
for
(
var
i
=
0
;
i
<
pts
.
length
;
++
i
)
{
var
dLbl
=
ser
.
dLbls
.
findDLblByIdx
(
pts
[
i
].
idx
);
if
(
dLbl
)
{
CheckObjectTextPr
(
dLbl
,
paraItem
.
Value
,
this
.
getDrawingDocument
()
);
fCallback
(
dLbl
,
value
,
this
.
getDrawingDocument
(),
10
);
}
}
}
...
...
@@ -840,23 +842,39 @@ CChartSpace.prototype =
dLbl
.
setIdx
(
pt
.
idx
);
ser
.
dLbls
.
addDLbl
(
dLbl
);
}
CheckObjectTextPr
(
dLbl
,
paraItem
.
Value
,
this
.
getDrawingDocument
()
);
fCallback
(
dLbl
,
value
,
this
.
getDrawingDocument
(),
10
);
}
}
}
}
else
},
paragraphIncDecFontSize
:
function
(
bIncrease
)
{
//TODO: другие случаи будут обработаны в след. версиях
this
.
applyLabelsFunction
(
CheckIncDecFontSize
,
bIncrease
);
},
paragraphAdd
:
function
(
paraItem
,
bRecalculate
)
{
if
(
paraItem
.
Type
===
para_TextPr
)
{
var
_paraItem
;
if
(
paraItem
.
Value
.
Unifill
&&
paraItem
.
Value
.
Unifill
.
checkWordMods
())
{
_paraItem
=
paraItem
.
Copy
();
_paraItem
.
Value
.
Unifill
.
convertToPPTXMods
();
}
}
else
{
_paraItem
=
paraItem
;
}
if
(
this
.
selection
.
textSelection
)
{
this
.
selection
.
textSelection
.
checkDocContent
();
this
.
selection
.
textSelection
.
paragraphAdd
(
paraItem
,
bRecalculate
);
return
;
}
this
.
applyLabelsFunction
(
CheckObjectTextPr
,
_paraItem
.
Value
);
}
},
...
...
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