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
878439cc
Kaydet (Commit)
878439cc
authored
Eki 02, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Move this string pool code to svl.
Change-Id: I1379fbc377607be8831133d64db2e14f8c75bff8
üst
6cea7618
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
77 additions
and
25 deletions
+77
-25
stringpool.hxx
include/svl/stringpool.hxx
+34
-0
formulagroup.hxx
sc/inc/formulagroup.hxx
+3
-4
column2.cxx
sc/source/core/data/column2.cxx
+4
-4
formulagroup.cxx
sc/source/core/tool/formulagroup.cxx
+0
-17
Library_svl.mk
svl/Library_svl.mk
+1
-0
stringpool.cxx
svl/source/misc/stringpool.cxx
+35
-0
No files found.
include/svl/stringpool.hxx
0 → 100644
Dosyayı görüntüle @
878439cc
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef SVL_STRINGPOOL_HXX
#define SVL_STRINGPOOL_HXX
#include "svl/svldllapi.h"
#include "rtl/ustring.hxx"
#include <boost/unordered_set.hpp>
namespace
svl
{
class
SVL_DLLPUBLIC
StringPool
{
typedef
boost
::
unordered_set
<
OUString
,
OUStringHash
>
StrHashType
;
StrHashType
maStrPool
;
public
:
StringPool
();
rtl_uString
*
intern
(
const
OUString
&
rStr
);
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/inc/formulagroup.hxx
Dosyayı görüntüle @
878439cc
...
...
@@ -14,6 +14,8 @@
#include "types.hxx"
#include "platforminfo.hxx"
#include "svl/stringpool.hxx"
#include <vector>
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
...
...
@@ -26,17 +28,14 @@ namespace sc {
struct
FormulaGroupContext
:
boost
::
noncopyable
{
typedef
boost
::
unordered_set
<
OUString
,
OUStringHash
>
StrHashType
;
typedef
std
::
vector
<
double
>
NumArrayType
;
typedef
std
::
vector
<
rtl_uString
*>
StrArrayType
;
typedef
boost
::
ptr_vector
<
NumArrayType
>
NumArrayStoreType
;
typedef
boost
::
ptr_vector
<
StrArrayType
>
StrArrayStoreType
;
StrHashType
maStrPool
;
svl
::
StringPool
maStrPool
;
NumArrayStoreType
maNumArrays
;
StrArrayStoreType
maStrArrays
;
rtl_uString
*
intern
(
const
OUString
&
rStr
);
};
/**
...
...
sc/source/core/data/column2.cxx
Dosyayı görüntüle @
878439cc
...
...
@@ -2174,7 +2174,7 @@ bool appendStrings(
getBlockIterators
<
sc
::
string_block
>
(
it
,
nLenRemain
,
itData
,
itDataEnd
);
for
(;
itData
!=
itDataEnd
;
++
itData
)
rArray
.
push_back
(
rCxt
.
intern
(
*
itData
));
rArray
.
push_back
(
rCxt
.
maStrPool
.
intern
(
*
itData
));
}
break
;
case
sc
:
:
element_type_edittext
:
...
...
@@ -2185,7 +2185,7 @@ bool appendStrings(
for
(;
itData
!=
itDataEnd
;
++
itData
)
{
OUString
aStr
=
ScEditUtil
::
GetString
(
**
itData
,
pDoc
);
rArray
.
push_back
(
rCxt
.
intern
(
aStr
));
rArray
.
push_back
(
rCxt
.
maStrPool
.
intern
(
aStr
));
}
}
break
;
...
...
@@ -2210,7 +2210,7 @@ bool appendStrings(
return
false
;
}
rArray
.
push_back
(
rCxt
.
intern
(
aStr
));
rArray
.
push_back
(
rCxt
.
maStrPool
.
intern
(
aStr
));
}
}
break
;
...
...
@@ -2250,7 +2250,7 @@ void copyFirstBlock( sc::FormulaGroupContext& rCxt, size_t nLen, const sc::CellS
const
OUString
*
p
=
&
sc
::
string_block
::
at
(
*
rPos
.
first
->
data
,
rPos
.
second
);
const
OUString
*
pEnd
=
p
+
nLen
;
for
(;
p
!=
pEnd
;
++
p
)
rArray
.
push_back
(
rCxt
.
intern
(
*
p
));
rArray
.
push_back
(
rCxt
.
maStrPool
.
intern
(
*
p
));
}
}
...
...
sc/source/core/tool/formulagroup.cxx
Dosyayı görüntüle @
878439cc
...
...
@@ -38,23 +38,6 @@ extern "C" void compileOpenCLKernels(const OUString*);
namespace
sc
{
rtl_uString
*
FormulaGroupContext
::
intern
(
const
OUString
&
rStr
)
{
StrHashType
::
iterator
it
=
maStrPool
.
find
(
rStr
);
if
(
it
==
maStrPool
.
end
())
{
// Not yet in the pool.
std
::
pair
<
StrHashType
::
iterator
,
bool
>
r
=
maStrPool
.
insert
(
rStr
.
intern
());
if
(
!
r
.
second
)
// Insertion failed.
return
NULL
;
it
=
r
.
first
;
}
return
it
->
pData
;
}
namespace
{
/**
...
...
svl/Library_svl.mk
Dosyayı görüntüle @
878439cc
...
...
@@ -110,6 +110,7 @@ $(eval $(call gb_Library_add_exception_objects,svl,\
svl/source/misc/lockfilecommon \
svl/source/misc/ownlist \
svl/source/misc/sharecontrolfile \
svl/source/misc/stringpool \
svl/source/misc/strmadpt \
svl/source/misc/urihelper \
svl/source/notify/brdcst \
...
...
svl/source/misc/stringpool.cxx
0 → 100644
Dosyayı görüntüle @
878439cc
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "svl/stringpool.hxx"
namespace
svl
{
StringPool
::
StringPool
()
{}
rtl_uString
*
StringPool
::
intern
(
const
OUString
&
rStr
)
{
StrHashType
::
iterator
it
=
maStrPool
.
find
(
rStr
);
if
(
it
==
maStrPool
.
end
())
{
// Not yet in the pool.
std
::
pair
<
StrHashType
::
iterator
,
bool
>
r
=
maStrPool
.
insert
(
rStr
.
intern
());
if
(
!
r
.
second
)
// Insertion failed.
return
NULL
;
it
=
r
.
first
;
}
return
it
->
pData
;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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