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
6d6ff5db
Kaydet (Commit)
6d6ff5db
authored
Ock 23, 2011
tarafından
Joseph Powers
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove DECLARE_LIST( CfgStackList, CfgStackData* )
üst
5759fc6c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
23 deletions
+36
-23
cfgmerge.hxx
l10ntools/inc/cfgmerge.hxx
+19
-7
cfgmerge.cxx
l10ntools/source/cfgmerge.cxx
+17
-16
No files found.
l10ntools/inc/cfgmerge.hxx
Dosyayı görüntüle @
6d6ff5db
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include <tools/string.hxx>
#include <tools/string.hxx>
#include <tools/list.hxx>
#include <tools/list.hxx>
#include <hash_map>
#include <hash_map>
#include <vector>
typedef
std
::
hash_map
<
ByteString
,
ByteString
,
hashByteString
,
equalByteString
>
typedef
std
::
hash_map
<
ByteString
,
ByteString
,
hashByteString
,
equalByteString
>
ByteStringHashMap
;
ByteStringHashMap
;
...
@@ -69,21 +70,32 @@ public:
...
@@ -69,21 +70,32 @@ public:
// class CfgStack
// class CfgStack
//
//
DECLARE_LIST
(
CfgStackList
,
CfgStackData
*
)
typedef
::
std
::
vector
<
CfgStackData
*
>
CfgStackList
;
class
CfgStack
:
public
CfgStackList
class
CfgStack
{
{
private
:
CfgStackList
maList
;
public
:
public
:
CfgStack
()
:
CfgStackList
(
10
,
10
)
{}
CfgStack
()
{}
~
CfgStack
();
~
CfgStack
();
ULONG
Push
(
CfgStackData
*
pStackData
);
size_t
Push
(
CfgStackData
*
pStackData
);
CfgStackData
*
Push
(
const
ByteString
&
rTag
,
const
ByteString
&
rId
);
CfgStackData
*
Push
(
const
ByteString
&
rTag
,
const
ByteString
&
rId
);
CfgStackData
*
Pop
()
{
return
Remove
(
Count
()
-
1
);
}
CfgStackData
*
Pop
()
{
if
(
maList
.
empty
()
)
return
NULL
;
CfgStackData
*
temp
=
maList
.
back
();
maList
.
pop_back
();
return
temp
;
}
CfgStackData
*
GetStackData
(
size_t
nPos
=
LIST_APPEND
);
CfgStackData
*
GetStackData
(
ULONG
nPos
=
LIST_APPEND
);
ByteString
GetAccessPath
(
size_t
nPos
=
LIST_APPEND
);
ByteString
GetAccessPath
(
ULONG
nPos
=
LIST_APPEND
);
size_t
size
()
const
{
return
maList
.
size
();
}
};
};
//
//
...
...
l10ntools/source/cfgmerge.cxx
Dosyayı görüntüle @
6d6ff5db
...
@@ -298,7 +298,7 @@ int GetError()
...
@@ -298,7 +298,7 @@ int GetError()
CfgStackData
*
CfgStack
::
Push
(
const
ByteString
&
rTag
,
const
ByteString
&
rId
)
CfgStackData
*
CfgStack
::
Push
(
const
ByteString
&
rTag
,
const
ByteString
&
rId
)
{
{
CfgStackData
*
pD
=
new
CfgStackData
(
rTag
,
rId
);
CfgStackData
*
pD
=
new
CfgStackData
(
rTag
,
rId
);
Insert
(
pD
,
LIST_APPEN
D
);
maList
.
push_back
(
p
D
);
return
pD
;
return
pD
;
}
}
...
@@ -310,19 +310,20 @@ CfgStackData* CfgStack::Push( const ByteString &rTag, const ByteString &rId )
...
@@ -310,19 +310,20 @@ CfgStackData* CfgStack::Push( const ByteString &rTag, const ByteString &rId )
CfgStack
::~
CfgStack
()
CfgStack
::~
CfgStack
()
/*****************************************************************************/
/*****************************************************************************/
{
{
for
(
ULONG
i
=
0
;
i
<
Count
();
i
++
)
for
(
size_t
i
=
0
,
n
=
maList
.
size
();
i
<
n
;
i
++
)
delete
GetObject
(
i
);
delete
maList
[
i
];
maList
.
clear
();
}
}
/*****************************************************************************/
/*****************************************************************************/
ByteString
CfgStack
::
GetAccessPath
(
ULONG
nPos
)
ByteString
CfgStack
::
GetAccessPath
(
size_t
nPos
)
/*****************************************************************************/
/*****************************************************************************/
{
{
if
(
nPos
==
LIST_APPEND
)
if
(
nPos
==
LIST_APPEND
)
nPos
=
Count
()
-
1
;
nPos
=
maList
.
size
()
-
1
;
ByteString
sReturn
;
ByteString
sReturn
;
for
(
ULONG
i
=
0
;
i
<=
nPos
;
i
++
)
{
for
(
size_t
i
=
0
;
i
<=
nPos
;
i
++
)
{
if
(
i
)
if
(
i
)
sReturn
+=
"."
;
sReturn
+=
"."
;
sReturn
+=
GetStackData
(
i
)
->
GetIdentifier
();
sReturn
+=
GetStackData
(
i
)
->
GetIdentifier
();
...
@@ -332,13 +333,13 @@ ByteString CfgStack::GetAccessPath( ULONG nPos )
...
@@ -332,13 +333,13 @@ ByteString CfgStack::GetAccessPath( ULONG nPos )
}
}
/*****************************************************************************/
/*****************************************************************************/
CfgStackData
*
CfgStack
::
GetStackData
(
ULONG
nPos
)
CfgStackData
*
CfgStack
::
GetStackData
(
size_t
nPos
)
/*****************************************************************************/
/*****************************************************************************/
{
{
if
(
nPos
==
LIST_APPEND
)
if
(
nPos
==
LIST_APPEND
)
nPos
=
Count
()
-
1
;
nPos
=
maList
.
size
()
-
1
;
return
GetObject
(
nPos
)
;
return
maList
[
nPos
]
;
}
}
//
//
...
@@ -662,12 +663,12 @@ void CfgExport::WorkOnRessourceEnd()
...
@@ -662,12 +663,12 @@ void CfgExport::WorkOnRessourceEnd()
ByteString
sLocalId
=
pStackData
->
sIdentifier
;
ByteString
sLocalId
=
pStackData
->
sIdentifier
;
ByteString
sGroupId
;
ByteString
sGroupId
;
if
(
aStack
.
Count
()
==
1
)
{
if
(
aStack
.
size
()
==
1
)
{
sGroupId
=
sLocalId
;
sGroupId
=
sLocalId
;
sLocalId
=
""
;
sLocalId
=
""
;
}
}
else
{
else
{
sGroupId
=
aStack
.
GetAccessPath
(
aStack
.
Count
()
-
2
);
sGroupId
=
aStack
.
GetAccessPath
(
aStack
.
size
()
-
2
);
}
}
ByteString
sTimeStamp
(
Export
::
GetTimeStamp
());
ByteString
sTimeStamp
(
Export
::
GetTimeStamp
());
...
@@ -760,12 +761,12 @@ void CfgMerge::WorkOnText(
...
@@ -760,12 +761,12 @@ void CfgMerge::WorkOnText(
if
(
!
pResData
)
{
if
(
!
pResData
)
{
ByteString
sLocalId
=
pStackData
->
sIdentifier
;
ByteString
sLocalId
=
pStackData
->
sIdentifier
;
ByteString
sGroupId
;
ByteString
sGroupId
;
if
(
aStack
.
Count
()
==
1
)
{
if
(
aStack
.
size
()
==
1
)
{
sGroupId
=
sLocalId
;
sGroupId
=
sLocalId
;
sLocalId
=
""
;
sLocalId
=
""
;
}
}
else
{
else
{
sGroupId
=
aStack
.
GetAccessPath
(
aStack
.
Count
()
-
2
);
sGroupId
=
aStack
.
GetAccessPath
(
aStack
.
size
()
-
2
);
}
}
ByteString
sPlatform
(
""
);
ByteString
sPlatform
(
""
);
...
@@ -806,10 +807,10 @@ void CfgMerge::Output( const ByteString& rOutput )
...
@@ -806,10 +807,10 @@ void CfgMerge::Output( const ByteString& rOutput )
pOutputStream
->
Write
(
rOutput
.
GetBuffer
(),
rOutput
.
Len
());
pOutputStream
->
Write
(
rOutput
.
GetBuffer
(),
rOutput
.
Len
());
}
}
ULONG
CfgStack
::
Push
(
CfgStackData
*
pStackData
)
size_t
CfgStack
::
Push
(
CfgStackData
*
pStackData
)
{
{
Insert
(
pStackData
,
LIST_APPEND
);
maList
.
push_back
(
pStackData
);
return
Count
()
-
1
;
return
maList
.
size
()
-
1
;
}
}
/*****************************************************************************/
/*****************************************************************************/
...
...
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