Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
43f7bc96
Kaydet (Commit)
43f7bc96
authored
Tem 18, 2013
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
n#825976: handle TOC \h field for illustrations tables in writerfilter
Change-Id: I9ebc91d5f0e706dc1e316e0aa8494af7aec4da4e
üst
675a50a2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
39 deletions
+63
-39
DomainMapper_Impl.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
+63
-39
No files found.
writerfilter/source/dmapper/DomainMapper_Impl.cxx
Dosyayı görüntüle @
43f7bc96
...
@@ -2513,6 +2513,53 @@ void DomainMapper_Impl::handleAuthor
...
@@ -2513,6 +2513,53 @@ void DomainMapper_Impl::handleAuthor
#undef SET_DATE
#undef SET_DATE
}
}
uno
::
Sequence
<
beans
::
PropertyValues
>
lcl_createTOXLevelHyperlinks
(
bool
bHyperlinks
,
OUString
sChapterNoSeparator
,
uno
::
Sequence
<
beans
::
PropertyValues
>
aLevel
,
PropertyNameSupplier
&
rPropNameSupplier
)
{
//create a copy of the level and add two new entries - hyperlink start and end
bool
bChapterNoSeparator
=
!
sChapterNoSeparator
.
isEmpty
();
sal_Int32
nAdd
=
(
bHyperlinks
&&
bChapterNoSeparator
)
?
4
:
2
;
uno
::
Sequence
<
beans
::
PropertyValues
>
aNewLevel
(
aLevel
.
getLength
()
+
nAdd
);
beans
::
PropertyValues
*
pNewLevel
=
aNewLevel
.
getArray
();
if
(
bHyperlinks
)
{
beans
::
PropertyValues
aHyperlink
(
1
);
aHyperlink
[
0
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TYPE
);
aHyperlink
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_HYPERLINK_START
);
pNewLevel
[
0
]
=
aHyperlink
;
aHyperlink
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_HYPERLINK_END
);
pNewLevel
[
aNewLevel
.
getLength
()
-
1
]
=
aHyperlink
;
}
if
(
bChapterNoSeparator
)
{
beans
::
PropertyValues
aChapterNo
(
2
);
aChapterNo
[
0
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TYPE
);
aChapterNo
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_CHAPTER_INFO
);
aChapterNo
[
1
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_CHAPTER_FORMAT
);
//todo: is ChapterFormat::Number correct?
aChapterNo
[
1
].
Value
<<=
(
sal_Int16
)
text
::
ChapterFormat
::
NUMBER
;
pNewLevel
[
aNewLevel
.
getLength
()
-
(
bHyperlinks
?
4
:
2
)
]
=
aChapterNo
;
beans
::
PropertyValues
aChapterSeparator
(
2
);
aChapterSeparator
[
0
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TYPE
);
aChapterSeparator
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TEXT
);
aChapterSeparator
[
1
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TEXT
);
aChapterSeparator
[
1
].
Value
<<=
sChapterNoSeparator
;
pNewLevel
[
aNewLevel
.
getLength
()
-
(
bHyperlinks
?
3
:
1
)]
=
aChapterSeparator
;
}
//copy the 'old' entries except the last (page no)
for
(
sal_Int32
nToken
=
0
;
nToken
<
aLevel
.
getLength
()
-
1
;
++
nToken
)
{
pNewLevel
[
nToken
+
1
]
=
aLevel
[
nToken
];
}
//copy page no entry (last or last but one depending on bHyperlinks
sal_Int32
nPageNo
=
aNewLevel
.
getLength
()
-
(
bHyperlinks
?
2
:
3
);
pNewLevel
[
nPageNo
]
=
aLevel
[
aLevel
.
getLength
()
-
1
];
return
aNewLevel
;
}
void
DomainMapper_Impl
::
handleToc
void
DomainMapper_Impl
::
handleToc
(
FieldContextPtr
pContext
,
(
FieldContextPtr
pContext
,
PropertyNameSupplier
&
rPropNameSupplier
,
PropertyNameSupplier
&
rPropNameSupplier
,
...
@@ -2684,46 +2731,10 @@ void DomainMapper_Impl::handleToc
...
@@ -2684,46 +2731,10 @@ void DomainMapper_Impl::handleToc
{
{
uno
::
Sequence
<
beans
::
PropertyValues
>
aLevel
;
uno
::
Sequence
<
beans
::
PropertyValues
>
aLevel
;
xLevelFormats
->
getByIndex
(
nLevel
)
>>=
aLevel
;
xLevelFormats
->
getByIndex
(
nLevel
)
>>=
aLevel
;
//create a copy of the level and add two new entries - hyperlink start and end
bool
bChapterNoSeparator
=
!
sChapterNoSeparator
.
isEmpty
();
sal_Int32
nAdd
=
(
bHyperlinks
&&
bChapterNoSeparator
)
?
4
:
2
;
uno
::
Sequence
<
beans
::
PropertyValues
>
aNewLevel
(
aLevel
.
getLength
()
+
nAdd
);
beans
::
PropertyValues
*
pNewLevel
=
aNewLevel
.
getArray
();
if
(
bHyperlinks
)
{
beans
::
PropertyValues
aHyperlink
(
1
);
aHyperlink
[
0
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TYPE
);
aHyperlink
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_HYPERLINK_START
);
pNewLevel
[
0
]
=
aHyperlink
;
aHyperlink
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_HYPERLINK_END
);
pNewLevel
[
aNewLevel
.
getLength
()
-
1
]
=
aHyperlink
;
}
if
(
bChapterNoSeparator
)
{
beans
::
PropertyValues
aChapterNo
(
2
);
aChapterNo
[
0
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TYPE
);
aChapterNo
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_CHAPTER_INFO
);
aChapterNo
[
1
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_CHAPTER_FORMAT
);
//todo: is ChapterFormat::Number correct?
aChapterNo
[
1
].
Value
<<=
(
sal_Int16
)
text
::
ChapterFormat
::
NUMBER
;
pNewLevel
[
aNewLevel
.
getLength
()
-
(
bHyperlinks
?
4
:
2
)
]
=
aChapterNo
;
beans
::
PropertyValues
aChapterSeparator
(
2
);
aChapterSeparator
[
0
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TYPE
);
aChapterSeparator
[
0
].
Value
<<=
rPropNameSupplier
.
GetName
(
PROP_TOKEN_TEXT
);
aChapterSeparator
[
1
].
Name
=
rPropNameSupplier
.
GetName
(
PROP_TEXT
);
aChapterSeparator
[
1
].
Value
<<=
sChapterNoSeparator
;
pNewLevel
[
aNewLevel
.
getLength
()
-
(
bHyperlinks
?
3
:
1
)]
=
aChapterSeparator
;
}
//copy the 'old' entries except the last (page no)
for
(
sal_Int32
nToken
=
0
;
nToken
<
aLevel
.
getLength
()
-
1
;
++
nToken
)
{
pNewLevel
[
nToken
+
1
]
=
aLevel
[
nToken
];
}
//copy page no entry (last or last but one depending on bHyperlinks
sal_Int32
nPageNo
=
aNewLevel
.
getLength
()
-
(
bHyperlinks
?
2
:
3
);
pNewLevel
[
nPageNo
]
=
aLevel
[
aLevel
.
getLength
()
-
1
];
uno
::
Sequence
<
beans
::
PropertyValues
>
aNewLevel
=
lcl_createTOXLevelHyperlinks
(
bHyperlinks
,
sChapterNoSeparator
,
aLevel
,
rPropNameSupplier
);
xLevelFormats
->
replaceByIndex
(
nLevel
,
uno
::
makeAny
(
aNewLevel
)
);
xLevelFormats
->
replaceByIndex
(
nLevel
,
uno
::
makeAny
(
aNewLevel
)
);
}
}
}
}
...
@@ -2733,6 +2744,19 @@ void DomainMapper_Impl::handleToc
...
@@ -2733,6 +2744,19 @@ void DomainMapper_Impl::handleToc
if
(
!
sFigureSequence
.
isEmpty
())
if
(
!
sFigureSequence
.
isEmpty
())
xTOC
->
setPropertyValue
(
rPropNameSupplier
.
GetName
(
PROP_LABEL_CATEGORY
),
xTOC
->
setPropertyValue
(
rPropNameSupplier
.
GetName
(
PROP_LABEL_CATEGORY
),
uno
::
makeAny
(
sFigureSequence
));
uno
::
makeAny
(
sFigureSequence
));
if
(
bHyperlinks
)
{
uno
::
Reference
<
container
::
XIndexReplace
>
xLevelFormats
;
xTOC
->
getPropertyValue
(
rPropNameSupplier
.
GetName
(
PROP_LEVEL_FORMAT
))
>>=
xLevelFormats
;
uno
::
Sequence
<
beans
::
PropertyValues
>
aLevel
;
xLevelFormats
->
getByIndex
(
1
)
>>=
aLevel
;
uno
::
Sequence
<
beans
::
PropertyValues
>
aNewLevel
=
lcl_createTOXLevelHyperlinks
(
bHyperlinks
,
sChapterNoSeparator
,
aLevel
,
rPropNameSupplier
);
xLevelFormats
->
replaceByIndex
(
1
,
uno
::
makeAny
(
aNewLevel
)
);
}
}
}
pContext
->
SetTOC
(
xTOC
);
pContext
->
SetTOC
(
xTOC
);
}
}
...
...
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