Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
6b130720
Commit
6b130720
authored
Feb 10, 2014
by
Victor Yacovlev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DocBook: figure captions are numered
parent
e71e5899
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
21 deletions
+33
-21
share/kumir2/translations/DocBookViewer_ru.ts
share/kumir2/translations/DocBookViewer_ru.ts
+22
-17
src/shared/docbookviewer/contentview.cpp
src/shared/docbookviewer/contentview.cpp
+10
-3
src/shared/docbookviewer/contentview.h
src/shared/docbookviewer/contentview.h
+1
-1
No files found.
share/kumir2/translations/DocBookViewer_ru.ts
View file @
6b130720
...
...
@@ -4,9 +4,9 @@
<
context
>
<
name
>
DocBookViewer
::
ContentView
<
/name
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
477
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
490
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
339
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
511
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
524
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
403
"
/>
<
source
>
Table
&
amp
;
nbsp
;
%
1
.
<
/source
>
<
translation
>
Таблица
&
amp
;
nbsp
;
%
1
.
<
/translation
>
<
/message
>
...
...
@@ -15,49 +15,54 @@
<
translation
type
=
"
obsolete
"
>
Контекст
:
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
6
33
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
6
67
"
/>
<
source
>
See
%
1
for
more
details
.
<
/source
>
<
translation
>
Подробное
описание
см
.
в
%
1
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
6
53
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
672
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
338
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
6
87
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
706
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
402
"
/>
<
source
>
Example
&
amp
;
nbsp
;
%
1
.
<
/source
>
<
translation
>
Пример
&
amp
;
nbsp
;
%
1
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
693
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
727
"
/>
<
source
>
Algorithm
<
/source
>
<
translation
>
Алгоритм
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
7
24
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
7
58
"
/>
<
source
>
Synopsis
:
<
/source
>
<
translation
>
Синтаксис
:
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1186
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
992
"
/>
<
source
>
Figure
&
amp
;
nbsp
;
%
1
<
/source
>
<
translation
>
Рисунок
&
amp
;
nbsp
;
%
1
.
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1227
"
/>
<
source
>
(
see
&
amp
;
nbsp
;
&
lt
;
a
href
=&
quot
;
%
1
&
quot
;
&
gt
;
%
2
&
lt
;
/a>
)
</
source
>
<
translation
>
(
см
.
&
amp
;
nbsp
;
&
lt
;
a
href
=&
quot
;
%
1
&
quot
;
&
gt
;
%
2
&
lt
;
/a>
)
</
translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
293
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
334
"
/>
<
source
>
List
of
examples
in
&
quot
;
%
1
&
quot
;
<
/source
>
<
translation
>
Список
примеров
в
&
quot
;
%
1
&
quot
;
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
296
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
1
337
"
/>
<
source
>
List
of
tables
in
&
quot
;
%
1
&
quot
;
<
/source
>
<
translation
>
Список
таблиц
в
&
quot
;
%
1
&
quot
;
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
13
00
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
13
41
"
/>
<
source
>
List
of
Standard
Library
algorithms
<
/source
>
<
translation
>
Список
встроенных
алгоритмов
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
13
02
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/contentview.cpp
"
line
=
"
13
43
"
/>
<
source
>
List
of
algorithms
of
module
&
quot
;
%
1
&
quot
;
<
/source
>
<
translation
>
Список
алгоритмов
исполнителя
&
quot
;
%
1
&
quot
;
<
/translation
>
<
/message
>
...
...
@@ -230,17 +235,17 @@
<
translation
type
=
"
obsolete
"
>
Искать
:
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/sidepanel.cpp
"
line
=
"
23
0
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/sidepanel.cpp
"
line
=
"
23
1
"
/>
<
source
>
List
of
examples
in
&
quot
;
%
1
&
quot
;
<
/source
>
<
translation
>
Список
примеров
в
&
quot
;
%
1
&
quot
;
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/sidepanel.cpp
"
line
=
"
25
8
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/sidepanel.cpp
"
line
=
"
25
9
"
/>
<
source
>
List
of
tables
in
&
quot
;
%
1
&
quot
;
<
/source
>
<
translation
>
Список
таблиц
в
&
quot
;
%
1
&
quot
;
<
/translation
>
<
/message
>
<
message
>
<
location
filename
=
"
../../../src/shared/docbookviewer/sidepanel.cpp
"
line
=
"
27
8
"
/>
<
location
filename
=
"
../../../src/shared/docbookviewer/sidepanel.cpp
"
line
=
"
27
9
"
/>
<
source
>
Standard
Library
functions
<
/source
>
<
translation
>
Встроенные
алгоритмы
<
/translation
>
<
/message
>
...
...
src/shared/docbookviewer/contentview.cpp
View file @
6b130720
...
...
@@ -277,7 +277,7 @@ QString ContentView::renderElement(ModelPtr data) const
return
renderMediaObject
(
data
);
}
else
if
(
data
==
DocBookModel
::
Caption
)
{
return
renderCaption
(
data
);
return
renderCaption
(
data
,
QString
()
);
}
else
if
(
data
==
DocBookModel
::
InlineMediaObject
)
{
return
renderInlineMediaObject
(
data
);
...
...
@@ -984,17 +984,24 @@ QString ContentView::renderMediaObject(ModelPtr data) const
result
+=
"<div align='center' width='100%' padding='10'>"
+
renderElement
(
mediaObject
);
if
(
caption
)
{
result
+=
renderCaption
(
caption
);
const
QString
index
=
chapterNumber
(
data
)
>
0
?
QString
(
"%1.%2"
)
.
arg
(
chapterNumber
(
data
))
.
arg
(
elementNumber
(
data
))
:
QString
::
number
(
elementNumber
(
data
));
const
QString
prefix
=
"<b>"
+
tr
(
"Figure %1 "
).
arg
(
index
)
+
"</b>"
;
result
+=
renderCaption
(
caption
,
prefix
);
}
result
+=
"</div>
\n
"
;
}
return
result
;
}
QString
ContentView
::
renderCaption
(
ModelPtr
data
)
const
QString
ContentView
::
renderCaption
(
ModelPtr
data
,
const
QString
&
captionPrefix
)
const
{
QString
result
;
result
+=
"<div align='center' width='100%'>"
;
result
+=
captionPrefix
;
result
+=
renderChilds
(
data
);
result
+=
"</div>"
;
return
result
;
...
...
src/shared/docbookviewer/contentview.h
View file @
6b130720
...
...
@@ -70,7 +70,7 @@ private:
QString
renderRow
(
ModelPtr
data
)
const
;
QString
renderEntry
(
ModelPtr
data
)
const
;
QString
renderCaption
(
ModelPtr
data
)
const
;
QString
renderCaption
(
ModelPtr
data
,
const
QString
&
captionPrefix
)
const
;
QString
renderMediaObject
(
ModelPtr
data
)
const
;
QString
renderInlineMediaObject
(
ModelPtr
data
)
const
;
QString
renderImageObject
(
ModelPtr
data
)
const
;
...
...
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