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
8d458a24
Kaydet (Commit)
8d458a24
authored
Eyl 09, 2016
tarafından
David Tardon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use std::unique_ptr
Change-Id: I642486578190ed5e74a917c60153cac084f35fe8
üst
97dbbf72
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
52 deletions
+26
-52
txtlists.hxx
xmloff/inc/txtlists.hxx
+5
-5
txtlists.cxx
xmloff/source/text/txtlists.cxx
+21
-47
No files found.
xmloff/inc/txtlists.hxx
Dosyayı görüntüle @
8d458a24
...
...
@@ -22,6 +22,7 @@
#include <rtl/ustring.hxx>
#include <map>
#include <memory>
#include <stack>
#include <tuple>
#include <vector>
...
...
@@ -37,7 +38,6 @@ class XMLTextListsHelper
{
public
:
XMLTextListsHelper
();
~
XMLTextListsHelper
();
XMLTextListsHelper
(
const
XMLTextListsHelper
&
)
=
delete
;
XMLTextListsHelper
&
operator
=
(
const
XMLTextListsHelper
&
)
=
delete
;
...
...
@@ -136,7 +136,7 @@ class XMLTextListsHelper
// as value
typedef
::
std
::
map
<
OUString
,
::
std
::
pair
<
OUString
,
OUString
>
>
tMapForLists
;
tMapForLists
*
mpProcessedLists
;
std
::
unique_ptr
<
tMapForLists
>
mpProcessedLists
;
OUString
msLastProcessedListId
;
OUString
msListStyleOfLastProcessedList
;
...
...
@@ -144,19 +144,19 @@ class XMLTextListsHelper
map with <ListStyleName> as key and pair( <ListId, ListStyleDefaultListId> )
as value. (#i92811#)
*/
tMapForLists
*
mpMapListIdToListStyleDefaultListId
;
std
::
unique_ptr
<
tMapForLists
>
mpMapListIdToListStyleDefaultListId
;
// container type to build up continue list chain:
// map with <ListId> of master list as key and <ListId> of last list
// continuing the master list as value
typedef
::
std
::
map
<
OUString
,
OUString
>
tMapForContinuingLists
;
tMapForContinuingLists
*
mpContinuingLists
;
std
::
unique_ptr
<
tMapForContinuingLists
>
mpContinuingLists
;
// stack type for opened list elements and its list style:
// vector with pair( <ListId>, <ListStyleName> ) as value
typedef
::
std
::
vector
<
::
std
::
pair
<
OUString
,
OUString
>
>
tStackForLists
;
tStackForLists
*
mpListStack
;
std
::
unique_ptr
<
tStackForLists
>
mpListStack
;
/// to connect numbered-paragraphs that have no list-id attribute:
/// vector of pair of style-name and list-id (indexed by level)
...
...
xmloff/source/text/txtlists.cxx
Dosyayı görüntüle @
8d458a24
...
...
@@ -20,6 +20,9 @@
#include <txtlists.hxx>
#include <comphelper/random.hxx>
#include <o3tl/make_unique.hxx>
#include <tools/date.hxx>
#include <tools/time.hxx>
...
...
@@ -38,41 +41,12 @@ using namespace ::com::sun::star;
XMLTextListsHelper
::
XMLTextListsHelper
()
:
mpProcessedLists
(
nullptr
),
msLastProcessedListId
(),
msListStyleOfLastProcessedList
(),
:
msLastProcessedListId
(),
msListStyleOfLastProcessedList
()
// Inconsistent behavior regarding lists (#i92811#)
mpMapListIdToListStyleDefaultListId
(
nullptr
),
mpContinuingLists
(
nullptr
),
mpListStack
(
nullptr
)
{
}
XMLTextListsHelper
::~
XMLTextListsHelper
()
{
if
(
mpProcessedLists
)
{
mpProcessedLists
->
clear
();
delete
mpProcessedLists
;
}
// Inconsistent behavior regarding lists (#i92811#)#
if
(
mpMapListIdToListStyleDefaultListId
)
{
mpMapListIdToListStyleDefaultListId
->
clear
();
delete
mpMapListIdToListStyleDefaultListId
;
}
if
(
mpContinuingLists
)
{
mpContinuingLists
->
clear
();
delete
mpContinuingLists
;
}
if
(
mpListStack
)
{
mpListStack
->
clear
();
delete
mpListStack
;
}
}
void
XMLTextListsHelper
::
PushListContext
(
XMLTextListBlockContext
*
i_pListBlock
)
{
...
...
@@ -139,9 +113,9 @@ void XMLTextListsHelper::KeepListAsProcessed( const OUString& sListId,
return
;
}
if
(
mpProcessedLists
==
nullptr
)
if
(
!
mpProcessedLists
)
{
mpProcessedLists
=
new
tMapForLists
();
mpProcessedLists
=
o3tl
::
make_unique
<
tMapForLists
>
();
}
::
std
::
pair
<
OUString
,
OUString
>
...
...
@@ -154,9 +128,9 @@ void XMLTextListsHelper::KeepListAsProcessed( const OUString& sListId,
// Inconsistent behavior regarding lists (#i92811#)
if
(
!
sListStyleDefaultListId
.
isEmpty
())
{
if
(
mpMapListIdToListStyleDefaultListId
==
nullptr
)
if
(
!
mpMapListIdToListStyleDefaultListId
)
{
mpMapListIdToListStyleDefaultListId
=
new
tMapForLists
();
mpMapListIdToListStyleDefaultListId
=
o3tl
::
make_unique
<
tMapForLists
>
();
}
if
(
mpMapListIdToListStyleDefaultListId
->
find
(
sListStyleName
)
==
...
...
@@ -172,7 +146,7 @@ void XMLTextListsHelper::KeepListAsProcessed( const OUString& sListId,
bool
XMLTextListsHelper
::
IsListProcessed
(
const
OUString
&
sListId
)
const
{
if
(
mpProcessedLists
==
nullptr
)
if
(
!
mpProcessedLists
)
{
return
false
;
}
...
...
@@ -183,7 +157,7 @@ bool XMLTextListsHelper::IsListProcessed( const OUString& sListId ) const
OUString
XMLTextListsHelper
::
GetListStyleOfProcessedList
(
const
OUString
&
sListId
)
const
{
if
(
mpProcessedLists
!=
nullptr
)
if
(
mpProcessedLists
)
{
tMapForLists
::
const_iterator
aIter
=
mpProcessedLists
->
find
(
sListId
);
if
(
aIter
!=
mpProcessedLists
->
end
()
)
...
...
@@ -198,7 +172,7 @@ OUString XMLTextListsHelper::GetListStyleOfProcessedList(
OUString
XMLTextListsHelper
::
GetContinueListIdOfProcessedList
(
const
OUString
&
sListId
)
const
{
if
(
mpProcessedLists
!=
nullptr
)
if
(
mpProcessedLists
)
{
tMapForLists
::
const_iterator
aIter
=
mpProcessedLists
->
find
(
sListId
);
if
(
aIter
!=
mpProcessedLists
->
end
()
)
...
...
@@ -232,7 +206,7 @@ OUString XMLTextListsHelper::GenerateNewListId() const
}
OUString
sNewListId
(
sTmpStr
);
if
(
mpProcessedLists
!=
nullptr
)
if
(
mpProcessedLists
)
{
long
nHitCount
=
0
;
while
(
mpProcessedLists
->
find
(
sNewListId
)
!=
mpProcessedLists
->
end
()
)
...
...
@@ -255,7 +229,7 @@ OUString XMLTextListsHelper::GetListIdForListBlock( XMLTextListBlockContext& rLi
sListBlockListId
=
rListBlock
.
GetListId
();
}
if
(
mpMapListIdToListStyleDefaultListId
!=
nullptr
)
if
(
mpMapListIdToListStyleDefaultListId
)
{
if
(
!
sListBlockListId
.
isEmpty
()
)
{
...
...
@@ -280,9 +254,9 @@ OUString XMLTextListsHelper::GetListIdForListBlock( XMLTextListBlockContext& rLi
void
XMLTextListsHelper
::
StoreLastContinuingList
(
const
OUString
&
sListId
,
const
OUString
&
sContinuingListId
)
{
if
(
mpContinuingLists
==
nullptr
)
if
(
!
mpContinuingLists
)
{
mpContinuingLists
=
new
tMapForContinuingLists
();
mpContinuingLists
=
o3tl
::
make_unique
<
tMapForContinuingLists
>
();
}
(
*
mpContinuingLists
)[
sListId
]
=
sContinuingListId
;
...
...
@@ -291,7 +265,7 @@ void XMLTextListsHelper::StoreLastContinuingList( const OUString& sListId,
OUString
XMLTextListsHelper
::
GetLastContinuingListId
(
const
OUString
&
sListId
)
const
{
if
(
mpContinuingLists
!=
nullptr
)
if
(
mpContinuingLists
)
{
tMapForContinuingLists
::
const_iterator
aIter
=
mpContinuingLists
->
find
(
sListId
);
...
...
@@ -307,9 +281,9 @@ OUString XMLTextListsHelper::GetLastContinuingListId(
void
XMLTextListsHelper
::
PushListOnStack
(
const
OUString
&
sListId
,
const
OUString
&
sListStyleName
)
{
if
(
mpListStack
==
nullptr
)
if
(
!
mpListStack
)
{
mpListStack
=
new
tStackForLists
();
mpListStack
=
o3tl
::
make_unique
<
tStackForLists
>
();
}
::
std
::
pair
<
OUString
,
OUString
>
aListData
(
sListId
,
sListStyleName
);
...
...
@@ -317,7 +291,7 @@ void XMLTextListsHelper::PushListOnStack( const OUString& sListId,
}
void
XMLTextListsHelper
::
PopListFromStack
()
{
if
(
mpListStack
!=
nullptr
&&
if
(
mpListStack
&&
mpListStack
->
size
()
>
0
)
{
mpListStack
->
pop_back
();
...
...
@@ -326,7 +300,7 @@ void XMLTextListsHelper::PopListFromStack()
bool
XMLTextListsHelper
::
EqualsToTopListStyleOnStack
(
const
OUString
&
sListId
)
const
{
return
mpListStack
!=
nullptr
&&
sListId
==
mpListStack
->
back
().
second
;
return
mpListStack
&&
sListId
==
mpListStack
->
back
().
second
;
}
OUString
...
...
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