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
147b74be
Kaydet (Commit)
147b74be
authored
Kas 12, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ifd88084d18df73ee18c497d0e4fd05acc3402ddf
üst
51e4d1dc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
orcusinterface.hxx
sc/source/filter/inc/orcusinterface.hxx
+2
-2
interface.cxx
sc/source/filter/orcus/interface.cxx
+14
-14
No files found.
sc/source/filter/inc/orcusinterface.hxx
Dosyayı görüntüle @
147b74be
...
...
@@ -25,7 +25,7 @@
#define __ORCUS_STATIC_LIB
#include <orcus/spreadsheet/import_interface.hpp>
#include <
boost/ptr_container/ptr_vector.hpp
>
#include <
memory
>
#include <map>
#include <unordered_map>
#include <vector>
...
...
@@ -455,7 +455,7 @@ class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory
StringCellCaches
maStringCells
;
ScOrcusGlobalSettings
maGlobalSettings
;
ScOrcusSharedStrings
maSharedStrings
;
boost
::
ptr_vector
<
ScOrcusSheet
>
maSheets
;
std
::
vector
<
std
::
unique_ptr
<
ScOrcusSheet
>
>
maSheets
;
ScOrcusStyles
maStyles
;
int
mnProgress
;
...
...
sc/source/filter/orcus/interface.cxx
Dosyayı görüntüle @
147b74be
...
...
@@ -34,6 +34,7 @@
#include <formula/token.hxx>
#include <tools/datetime.hxx>
#include <svl/sharedstringpool.hxx>
#include <o3tl/make_unique.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
...
...
@@ -74,18 +75,18 @@ orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::append_sheet(const char
return
nullptr
;
SCTAB
nTab
=
maDoc
.
getSheetCount
()
-
1
;
maSheets
.
push_back
(
new
ScOrcusSheet
(
maDoc
,
nTab
,
*
this
));
return
&
maSheets
.
back
();
maSheets
.
push_back
(
o3tl
::
make_unique
<
ScOrcusSheet
>
(
maDoc
,
nTab
,
*
this
));
return
maSheets
.
back
().
get
();
}
class
FindSheetByIndex
:
std
::
unary_function
<
ScOrcusSheet
,
bool
>
class
FindSheetByIndex
:
std
::
unary_function
<
std
::
unique_ptr
<
ScOrcusSheet
>
,
bool
>
{
SCTAB
mnTab
;
public
:
explicit
FindSheetByIndex
(
SCTAB
nTab
)
:
mnTab
(
nTab
)
{}
bool
operator
()
(
const
ScOrcusSheet
&
rSheet
)
const
bool
operator
()
(
const
std
::
unique_ptr
<
ScOrcusSheet
>
&
rSheet
)
const
{
return
rSheet
.
getIndex
()
==
mnTab
;
return
rSheet
->
getIndex
()
==
mnTab
;
}
};
...
...
@@ -98,33 +99,32 @@ orcus::spreadsheet::iface::import_sheet* ScOrcusFactory::get_sheet(const char* s
return
nullptr
;
// See if we already have an orcus sheet instance by that index.
boost
::
ptr_vector
<
ScOrcusSheet
>::
iterator
it
=
std
::
vector
<
std
::
unique_ptr
<
ScOrcusSheet
>
>::
iterator
it
=
std
::
find_if
(
maSheets
.
begin
(),
maSheets
.
end
(),
FindSheetByIndex
(
nTab
));
if
(
it
!=
maSheets
.
end
())
// We already have one. Return it.
return
&
(
*
it
);
return
it
->
get
(
);
// Create a new orcus sheet instance for this.
maSheets
.
push_back
(
new
ScOrcusSheet
(
maDoc
,
nTab
,
*
this
));
return
&
maSheets
.
back
();
maSheets
.
push_back
(
o3tl
::
make_unique
<
ScOrcusSheet
>
(
maDoc
,
nTab
,
*
this
));
return
maSheets
.
back
().
get
();
}
orcus
::
spreadsheet
::
iface
::
import_sheet
*
ScOrcusFactory
::
get_sheet
(
orcus
::
spreadsheet
::
sheet_t
sheet_index
)
{
SCTAB
nTab
=
static_cast
<
SCTAB
>
(
sheet_index
);
// See if we already have an orcus sheet instance by that index.
boost
::
ptr_vector
<
ScOrcusSheet
>::
iterator
it
=
std
::
vector
<
std
::
unique_ptr
<
ScOrcusSheet
>
>::
iterator
it
=
std
::
find_if
(
maSheets
.
begin
(),
maSheets
.
end
(),
FindSheetByIndex
(
nTab
));
if
(
it
!=
maSheets
.
end
())
// We already have one. Return it.
return
&
(
*
it
);
return
it
->
get
(
);
// Create a new orcus sheet instance for this.
maSheets
.
push_back
(
new
ScOrcusSheet
(
maDoc
,
nTab
,
*
this
));
return
&
maSheets
.
back
();
maSheets
.
push_back
(
o3tl
::
make_unique
<
ScOrcusSheet
>
(
maDoc
,
nTab
,
*
this
));
return
maSheets
.
back
().
get
();
}
orcus
::
spreadsheet
::
iface
::
import_global_settings
*
ScOrcusFactory
::
get_global_settings
()
...
...
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