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
5ddcaa86
Kaydet (Commit)
5ddcaa86
authored
Mar 27, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SwPostItField::GetByName: make this available for the layout as well
Change-Id: Ic2a2d759d855cecadb8429541d0a7665a6deaa4b
üst
91aaceb7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
23 deletions
+27
-23
docufld.hxx
sw/inc/docufld.hxx
+4
-0
docufld.cxx
sw/source/core/fields/docufld.cxx
+22
-0
unoportenum.cxx
sw/source/core/unocore/unoportenum.cxx
+1
-23
No files found.
sw/inc/docufld.hxx
Dosyayı görüntüle @
5ddcaa86
...
...
@@ -34,6 +34,7 @@ class SwTxtFld;
class
SwFrm
;
class
OutlinerParaObject
;
class
SwTextAPIObject
;
class
SwFmtFld
;
enum
SwAuthorFormat
{
...
...
@@ -530,6 +531,9 @@ public:
const
String
&
rAuthor
,
const
String
&
rTxt
,
const
String
&
rInitials
,
const
String
&
rName
,
const
DateTime
&
rDate
);
~
SwPostItField
();
/// Looks up a field identified by its unique name (used to get the postit field of a comment fieldmark)
static
const
SwFmtFld
*
GetByName
(
SwDoc
*
pDoc
,
const
OUString
&
rName
);
virtual
String
Expand
()
const
;
virtual
SwField
*
Copy
()
const
;
...
...
sw/source/core/fields/docufld.cxx
Dosyayı görüntüle @
5ddcaa86
...
...
@@ -92,6 +92,7 @@
#include <editeng/outliner.hxx>
#include <editeng/outlobj.hxx>
#include <switerator.hxx>
#include <docary.hxx>
#define URL_DECODE INetURLObject::DECODE_UNAMBIGUOUS
...
...
@@ -1753,6 +1754,27 @@ SwPostItField::~SwPostItField()
}
}
const
SwFmtFld
*
SwPostItField
::
GetByName
(
SwDoc
*
pDoc
,
const
OUString
&
rName
)
{
const
SwFldTypes
*
pFldTypes
=
pDoc
->
GetFldTypes
();
sal_uInt16
nCount
=
pFldTypes
->
size
();
for
(
sal_uInt16
nType
=
0
;
nType
<
nCount
;
++
nType
)
{
const
SwFieldType
*
pCurType
=
(
*
pFldTypes
)[
nType
];
SwIterator
<
SwFmtFld
,
SwFieldType
>
aIter
(
*
pCurType
);
for
(
const
SwFmtFld
*
pCurFldFmt
=
aIter
.
First
();
pCurFldFmt
;
pCurFldFmt
=
aIter
.
Next
())
{
// Ignore the field if it's not an annotation or it doesn't have an anchor.
if
(
pCurFldFmt
->
GetFld
()
->
GetTyp
()
->
Which
()
!=
RES_POSTITFLD
||
!
pCurFldFmt
->
GetTxtFld
())
continue
;
const
SwPostItField
*
pField
=
dynamic_cast
<
const
SwPostItField
*>
(
pCurFldFmt
->
GetFld
());
if
(
pField
->
GetName
()
==
rName
)
return
pCurFldFmt
;
}
}
return
0
;
}
String
SwPostItField
::
Expand
()
const
{
...
...
sw/source/core/unocore/unoportenum.cxx
Dosyayı görüntüle @
5ddcaa86
...
...
@@ -322,28 +322,6 @@ lcl_FillFieldMarkArray(FieldMarks_t & rFieldMarks, SwUnoCrsr const & rUnoCrsr,
}
}
static
const
SwFmtFld
*
lcl_getFieldByName
(
SwDoc
*
pDoc
,
const
OUString
&
rName
)
{
const
SwFldTypes
*
pFldTypes
=
pDoc
->
GetFldTypes
();
sal_uInt16
nCount
=
pFldTypes
->
size
();
for
(
sal_uInt16
nType
=
0
;
nType
<
nCount
;
++
nType
)
{
const
SwFieldType
*
pCurType
=
(
*
pFldTypes
)[
nType
];
SwIterator
<
SwFmtFld
,
SwFieldType
>
aIter
(
*
pCurType
);
for
(
const
SwFmtFld
*
pCurFldFmt
=
aIter
.
First
();
pCurFldFmt
;
pCurFldFmt
=
aIter
.
Next
())
{
// Ignore the field if it's not an annotation or it doesn't have an anchor.
if
(
pCurFldFmt
->
GetFld
()
->
GetTyp
()
->
Which
()
!=
RES_POSTITFLD
||
!
pCurFldFmt
->
GetTxtFld
())
continue
;
const
SwPostItField
*
pField
=
dynamic_cast
<
const
SwPostItField
*>
(
pCurFldFmt
->
GetFld
());
if
(
pField
->
GetName
()
==
rName
)
return
pCurFldFmt
;
}
}
return
0
;
}
static
uno
::
Reference
<
text
::
XTextRange
>
lcl_ExportFieldMark
(
uno
::
Reference
<
text
::
XText
>
const
&
i_xParentText
,
...
...
@@ -380,7 +358,7 @@ lcl_ExportFieldMark(
{
pPortion
->
SetBookmark
(
SwXFieldmark
::
CreateXFieldmark
(
*
pDoc
,
*
pFieldmark
)
);
Reference
<
XTextField
>
xField
;
const
SwFmtFld
*
pField
=
lcl_getField
ByName
(
pDoc
,
pFieldmark
->
GetName
());
const
SwFmtFld
*
pField
=
SwPostItField
::
Get
ByName
(
pDoc
,
pFieldmark
->
GetName
());
if
(
pField
)
xField
=
SwXTextField
::
CreateSwXTextField
(
*
pDoc
,
*
pField
);
pPortion
->
SetTextField
(
xField
);
...
...
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