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
23464204
Kaydet (Commit)
23464204
authored
Tem 17, 2011
tarafından
Troy Rollo
Kaydeden (comit)
Cédric Bosdonnat
Agu 10, 2011
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#33960 - import/export xrefs to numbered paras
üst
7e631b61
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
60 deletions
+65
-60
rtffld.cxx
sw/source/filter/rtf/rtffld.cxx
+21
-29
ww8atr.cxx
sw/source/filter/ww8/ww8atr.cxx
+12
-0
ww8par5.cxx
sw/source/filter/ww8/ww8par5.cxx
+32
-31
No files found.
sw/source/filter/rtf/rtffld.cxx
Dosyayı görüntüle @
23464204
...
@@ -813,8 +813,7 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr )
...
@@ -813,8 +813,7 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr )
case
RTFFLD_REF
:
case
RTFFLD_REF
:
{
{
String
sOrigBkmName
;
String
sOrigBkmName
;
bool
bChapterNr
=
false
;
REFERENCEMARK
eFormat
=
REF_CONTENT
;
bool
bAboveBelow
=
false
;
RtfFieldSwitch
aRFS
(
aSaveStr
);
RtfFieldSwitch
aRFS
(
aSaveStr
);
while
(
!
aRFS
.
IsAtEnd
()
)
while
(
!
aRFS
.
IsAtEnd
()
)
...
@@ -828,42 +827,35 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr )
...
@@ -828,42 +827,35 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr )
sOrigBkmName
=
sParam
;
sOrigBkmName
=
sParam
;
break
;
break
;
/* References to numbers in Word could be either to a numbered
paragraph or to a chapter number. However Word does not seem to
have the capability we do, of refering to the chapter number some
other bookmark is in. As a result, cross-references to chapter
numbers in a word document will be cross-references to a numbered
paragraph, being the chapter heading paragraph. As it happens, our
cross-references to numbered paragraphs will do the right thing
when the target is a numbered chapter heading, so there is no need
for us to use the REF_CHAPTER bookmark format on import.
*/
case
'n'
:
case
'n'
:
eFormat
=
REF_NUMBER_NO_CONTEXT
;
break
;
case
'r'
:
case
'r'
:
eFormat
=
REF_NUMBER
;
break
;
case
'w'
:
case
'w'
:
bChapterNr
=
true
;
// activate flag 'Chapter Number'
eFormat
=
REF_NUMBER_FULL_CONTEXT
;
break
;
break
;
case
'p'
:
case
'p'
:
bAboveBelow
=
true
;
eFormat
=
REF_UPDOWN
;
break
;
break
;
}
}
}
}
if
(
!
bAboveBelow
||
bChapterNr
)
SwGetRefField
aFld
(
{
(
SwGetRefFieldType
*
)
pDoc
->
GetSysFldType
(
RES_GETREFFLD
),
if
(
bChapterNr
)
sOrigBkmName
,
REF_BOOKMARK
,
0
,
eFormat
);
{
pDoc
->
InsertPoolItem
(
*
pPam
,
SwFmtFld
(
aFld
),
0
);
SwGetRefField
aFld
(
(
SwGetRefFieldType
*
)
pDoc
->
GetSysFldType
(
RES_GETREFFLD
),
sOrigBkmName
,
REF_BOOKMARK
,
0
,
REF_CHAPTER
);
pDoc
->
InsertPoolItem
(
*
pPam
,
SwFmtFld
(
aFld
),
0
);
}
else
{
SwGetRefField
aFld
(
(
SwGetRefFieldType
*
)
pDoc
->
GetSysFldType
(
RES_GETREFFLD
),
sOrigBkmName
,
REF_BOOKMARK
,
0
,
REF_CONTENT
);
pDoc
->
InsertPoolItem
(
*
pPam
,
SwFmtFld
(
aFld
),
0
);
}
}
if
(
bAboveBelow
)
{
SwGetRefField
aFld
(
(
SwGetRefFieldType
*
)
pDoc
->
GetSysFldType
(
RES_GETREFFLD
),
sOrigBkmName
,
REF_BOOKMARK
,
0
,
REF_UPDOWN
);
pDoc
->
InsertPoolItem
(
*
pPam
,
SwFmtFld
(
aFld
),
0
);
}
}
}
break
;
break
;
...
...
sw/source/filter/ww8/ww8atr.cxx
Dosyayı görüntüle @
23464204
...
@@ -2830,6 +2830,18 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
...
@@ -2830,6 +2830,18 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField )
sStr
=
FieldString
(
eFld
);
sStr
=
FieldString
(
eFld
);
sStr
+=
GetExport
().
GetBookmarkName
(
nSubType
,
sStr
+=
GetExport
().
GetBookmarkName
(
nSubType
,
&
rRFld
.
GetSetRefName
(),
0
);
&
rRFld
.
GetSetRefName
(),
0
);
switch
(
pFld
->
GetFormat
())
{
case
REF_NUMBER
:
sStr
.
APPEND_CONST_ASC
(
"
\\
r"
);
break
;
case
REF_NUMBER_NO_CONTEXT
:
sStr
.
APPEND_CONST_ASC
(
"
\\
n"
);
break
;
case
REF_NUMBER_FULL_CONTEXT
:
sStr
.
APPEND_CONST_ASC
(
"
\\
w"
);
break
;
}
break
;
break
;
case
REF_FOOTNOTE
:
case
REF_FOOTNOTE
:
case
REF_ENDNOTE
:
case
REF_ENDNOTE
:
...
...
sw/source/filter/ww8/ww8par5.cxx
Dosyayı görüntüle @
23464204
...
@@ -2064,8 +2064,7 @@ eF_ResT SwWW8ImplReader::Read_F_Set( WW8FieldDesc* pF, String& rStr )
...
@@ -2064,8 +2064,7 @@ eF_ResT SwWW8ImplReader::Read_F_Set( WW8FieldDesc* pF, String& rStr )
eF_ResT
SwWW8ImplReader
::
Read_F_Ref
(
WW8FieldDesc
*
,
String
&
rStr
)
eF_ResT
SwWW8ImplReader
::
Read_F_Ref
(
WW8FieldDesc
*
,
String
&
rStr
)
{
// Reference - Field
{
// Reference - Field
String
sOrigBkmName
;
String
sOrigBkmName
;
bool
bChapterNr
=
false
;
REFERENCEMARK
eFormat
=
REF_CONTENT
;
bool
bAboveBelow
=
false
;
long
nRet
;
long
nRet
;
_ReadFieldParams
aReadParam
(
rStr
);
_ReadFieldParams
aReadParam
(
rStr
);
...
@@ -2077,14 +2076,29 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, String& rStr )
...
@@ -2077,14 +2076,29 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, String& rStr )
if
(
!
sOrigBkmName
.
Len
()
)
// get name of bookmark
if
(
!
sOrigBkmName
.
Len
()
)
// get name of bookmark
sOrigBkmName
=
aReadParam
.
GetResult
();
sOrigBkmName
=
aReadParam
.
GetResult
();
break
;
break
;
/* References to numbers in Word could be either to a numbered
paragraph or to a chapter number. However Word does not seem to
have the capability we do, of refering to the chapter number some
other bookmark is in. As a result, cross-references to chapter
numbers in a word document will be cross-references to a numbered
paragraph, being the chapter heading paragraph. As it happens, our
cross-references to numbered paragraphs will do the right thing
when the target is a numbered chapter heading, so there is no need
for us to use the REF_CHAPTER bookmark format on import.
*/
case
'n'
:
case
'n'
:
eFormat
=
REF_NUMBER_NO_CONTEXT
;
break
;
case
'r'
:
case
'r'
:
eFormat
=
REF_NUMBER
;
break
;
case
'w'
:
case
'w'
:
bChapterNr
=
true
;
// activate flag 'Chapter Number'
eFormat
=
REF_NUMBER_FULL_CONTEXT
;
break
;
break
;
case
'p'
:
case
'p'
:
bAboveBelow
=
true
;
eFormat
=
REF_UPDOWN
;
break
;
break
;
case
'h'
:
case
'h'
:
break
;
break
;
...
@@ -2096,36 +2110,23 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, String& rStr )
...
@@ -2096,36 +2110,23 @@ eF_ResT SwWW8ImplReader::Read_F_Ref( WW8FieldDesc*, String& rStr )
String
sBkmName
(
GetMappedBookmark
(
sOrigBkmName
));
String
sBkmName
(
GetMappedBookmark
(
sOrigBkmName
));
if
(
!
bAboveBelow
||
bChapterNr
)
SwGetRefField
aFld
(
(
SwGetRefFieldType
*
)
rDoc
.
GetSysFldType
(
RES_GETREFFLD
),
sBkmName
,
REF_BOOKMARK
,
0
,
eFormat
);
if
(
eFormat
==
REF_CONTENT
)
{
{
if
(
bChapterNr
)
/*
{
If we are just inserting the contents of the bookmark, then it
SwGetRefField
aFld
(
is possible that the bookmark is actually a variable, so we
(
SwGetRefFieldType
*
)
rDoc
.
GetSysFldType
(
RES_GETREFFLD
),
must store it until the end of the document to see if it was,
sBkmName
,
REF_BOOKMARK
,
0
,
REF_CHAPTER
);
in which case we'll turn it into a show variable
rDoc
.
InsertPoolItem
(
*
pPaM
,
SwFmtFld
(
aFld
),
0
);
*/
}
pReffingStck
->
NewAttr
(
*
pPaM
->
GetPoint
(),
SwFmtFld
(
aFld
)
);
else
pReffingStck
->
SetAttr
(
*
pPaM
->
GetPoint
(),
RES_TXTATR_FIELD
);
{
/*
If we are just inserting the contents of the bookmark, then it
is possible that the bookmark is actually a variable, so we
must store it until the end of the document to see if it was,
in which case we'll turn it into a show variable
*/
SwGetRefField
aFld
(
(
SwGetRefFieldType
*
)
rDoc
.
GetSysFldType
(
RES_GETREFFLD
),
sBkmName
,
REF_BOOKMARK
,
0
,
REF_CONTENT
);
pReffingStck
->
NewAttr
(
*
pPaM
->
GetPoint
(),
SwFmtFld
(
aFld
)
);
pReffingStck
->
SetAttr
(
*
pPaM
->
GetPoint
(),
RES_TXTATR_FIELD
);
}
}
}
else
if
(
bAboveBelow
)
{
{
SwGetRefField
aFld
(
(
SwGetRefFieldType
*
)
rDoc
.
GetSysFldType
(
RES_GETREFFLD
),
sBkmName
,
REF_BOOKMARK
,
0
,
REF_UPDOWN
);
rDoc
.
InsertPoolItem
(
*
pPaM
,
SwFmtFld
(
aFld
),
0
);
rDoc
.
InsertPoolItem
(
*
pPaM
,
SwFmtFld
(
aFld
),
0
);
}
}
return
FLD_OK
;
return
FLD_OK
;
...
...
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