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
3f806959
Kaydet (Commit)
3f806959
authored
Şub 03, 2012
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More on eliminating ScStrCollection.
üst
cac7f1d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
57 deletions
+58
-57
linkuno.cxx
sc/source/ui/unoobj/linkuno.cxx
+58
-57
No files found.
sc/source/ui/unoobj/linkuno.cxx
Dosyayı görüntüle @
3f806959
...
...
@@ -418,27 +418,29 @@ void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScSheetLinkObj
*
ScSheetLinksObj
::
GetObjectByIndex_Impl
(
sal_Int32
nIndex
)
{
if
(
pDocShell
)
if
(
!
pDocShell
)
return
NULL
;
typedef
boost
::
unordered_set
<
rtl
::
OUString
,
rtl
::
OUStringHash
>
StrSetType
;
StrSetType
aNames
;
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
sal_Int32
nCount
=
0
;
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
++
nTab
)
{
sal_Int32
nCount
=
0
;
ScStrCollection
aNames
;
// um doppelte wegzulassen
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
nTab
++
)
if
(
pDoc
->
IsLinked
(
nTab
))
{
String
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
StrData
*
pData
=
new
StrData
(
aLinkDoc
);
if
(
aNames
.
Insert
(
pData
))
{
if
(
nCount
==
nIndex
)
return
new
ScSheetLinkObj
(
pDocShell
,
aLinkDoc
);
++
nCount
;
}
else
delete
pData
;
}
if
(
!
pDoc
->
IsLinked
(
nTab
))
continue
;
rtl
::
OUString
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
aNames
.
insert
(
aLinkDoc
).
second
)
{
// unique document name.
if
(
nCount
==
nIndex
)
return
new
ScSheetLinkObj
(
pDocShell
,
aLinkDoc
);
++
nCount
;
}
}
return
NULL
;
// kein Dokument oder Index zu gross
}
...
...
@@ -478,23 +480,25 @@ uno::Reference<container::XEnumeration> SAL_CALL ScSheetLinksObj::createEnumerat
sal_Int32
SAL_CALL
ScSheetLinksObj
::
getCount
()
throw
(
uno
::
RuntimeException
)
{
typedef
boost
::
unordered_set
<
rtl
::
OUString
,
rtl
::
OUStringHash
>
StrSetType
;
SolarMutexGuard
aGuard
;
if
(
!
pDocShell
)
return
0
;
sal_Int32
nCount
=
0
;
if
(
pDocShell
)
StrSetType
aNames
;
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
++
nTab
)
{
ScStrCollection
aNames
;
// um doppelte wegzulassen
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
nTab
++
)
if
(
pDoc
->
IsLinked
(
nTab
))
{
String
aLinkDoc
(
pDoc
->
GetLinkDoc
(
nTab
));
StrData
*
pData
=
new
StrData
(
aLinkDoc
);
if
(
aNames
.
Insert
(
pData
))
++
nCount
;
else
delete
pData
;
}
if
(
!
pDoc
->
IsLinked
(
nTab
))
continue
;
rtl
::
OUString
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
aNames
.
insert
(
aLinkDoc
).
second
)
++
nCount
;
}
return
nCount
;
}
...
...
@@ -562,36 +566,33 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const rtl::OUString& aName )
uno
::
Sequence
<
rtl
::
OUString
>
SAL_CALL
ScSheetLinksObj
::
getElementNames
()
throw
(
uno
::
RuntimeException
)
{
typedef
boost
::
unordered_set
<
rtl
::
OUString
,
rtl
::
OUStringHash
>
StrSetType
;
SolarMutexGuard
aGuard
;
// Name ist der Dateiname
if
(
pDocShell
)
if
(
!
pDocShell
)
return
uno
::
Sequence
<
rtl
::
OUString
>
();
StrSetType
aNames
;
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
sal_Int32
nLinkCount
=
getCount
();
uno
::
Sequence
<
rtl
::
OUString
>
aSeq
(
nLinkCount
);
rtl
::
OUString
*
pAry
=
aSeq
.
getArray
();
sal_uInt16
nPos
=
0
;
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
++
nTab
)
{
ScStrCollection
aNames
;
// um doppelte wegzulassen
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
String
aName
;
if
(
!
pDoc
->
IsLinked
(
nTab
))
continue
;
sal_Int32
nLinkCount
=
getCount
();
uno
::
Sequence
<
rtl
::
OUString
>
aSeq
(
nLinkCount
);
rtl
::
OUString
*
pAry
=
aSeq
.
getArray
();
sal_uInt16
nPos
=
0
;
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
nTab
++
)
{
if
(
pDoc
->
IsLinked
(
nTab
))
{
String
aLinkDoc
(
pDoc
->
GetLinkDoc
(
nTab
));
StrData
*
pData
=
new
StrData
(
aLinkDoc
);
if
(
aNames
.
Insert
(
pData
))
pAry
[
nPos
++
]
=
aLinkDoc
;
else
delete
pData
;
}
}
OSL_ENSURE
(
nPos
==
nLinkCount
,
"verzaehlt"
);
return
aSeq
;
rtl
::
OUString
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
aNames
.
insert
(
aLinkDoc
).
second
)
pAry
[
nPos
++
]
=
aLinkDoc
;
}
return
uno
::
Sequence
<
rtl
::
OUString
>
();
OSL_ENSURE
(
nPos
==
nLinkCount
,
"verzaehlt"
);
return
aSeq
;
}
//------------------------------------------------------------------------
...
...
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