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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
39 deletions
+40
-39
linkuno.cxx
sc/source/ui/unoobj/linkuno.cxx
+40
-39
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 )
...
@@ -418,27 +418,29 @@ void ScSheetLinksObj::Notify( SfxBroadcaster&, const SfxHint& rHint )
ScSheetLinkObj
*
ScSheetLinksObj
::
GetObjectByIndex_Impl
(
sal_Int32
nIndex
)
ScSheetLinkObj
*
ScSheetLinksObj
::
GetObjectByIndex_Impl
(
sal_Int32
nIndex
)
{
{
if
(
pDocShell
)
if
(
!
pDocShell
)
{
return
NULL
;
sal_Int32
nCount
=
0
;
ScStrCollection
aNames
;
// um doppelte wegzulassen
typedef
boost
::
unordered_set
<
rtl
::
OUString
,
rtl
::
OUStringHash
>
StrSetType
;
StrSetType
aNames
;
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
nTab
++
)
sal_Int32
nCount
=
0
;
if
(
pDoc
->
IsLinked
(
nTab
)
)
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
++
nTab
)
{
{
String
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
!
pDoc
->
IsLinked
(
nTab
))
StrData
*
pData
=
new
StrData
(
aLinkDoc
);
continue
;
if
(
aNames
.
Insert
(
pData
))
rtl
::
OUString
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
aNames
.
insert
(
aLinkDoc
).
second
)
{
{
if
(
nCount
==
nIndex
)
// unique document name.
if
(
nCount
==
nIndex
)
return
new
ScSheetLinkObj
(
pDocShell
,
aLinkDoc
);
return
new
ScSheetLinkObj
(
pDocShell
,
aLinkDoc
);
++
nCount
;
++
nCount
;
}
}
else
delete
pData
;
}
}
}
return
NULL
;
// kein Dokument oder Index zu gross
return
NULL
;
// kein Dokument oder Index zu gross
}
}
...
@@ -478,23 +480,25 @@ uno::Reference<container::XEnumeration> SAL_CALL ScSheetLinksObj::createEnumerat
...
@@ -478,23 +480,25 @@ uno::Reference<container::XEnumeration> SAL_CALL ScSheetLinksObj::createEnumerat
sal_Int32
SAL_CALL
ScSheetLinksObj
::
getCount
()
throw
(
uno
::
RuntimeException
)
sal_Int32
SAL_CALL
ScSheetLinksObj
::
getCount
()
throw
(
uno
::
RuntimeException
)
{
{
typedef
boost
::
unordered_set
<
rtl
::
OUString
,
rtl
::
OUStringHash
>
StrSetType
;
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
if
(
!
pDocShell
)
return
0
;
sal_Int32
nCount
=
0
;
sal_Int32
nCount
=
0
;
if
(
pDocShell
)
{
StrSetType
aNames
;
ScStrCollection
aNames
;
// um doppelte wegzulassen
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
nTab
++
)
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
++
nTab
)
if
(
pDoc
->
IsLinked
(
nTab
))
{
{
String
aLinkDoc
(
pDoc
->
GetLinkDoc
(
nTab
));
if
(
!
pDoc
->
IsLinked
(
nTab
))
StrData
*
pData
=
new
StrData
(
aLinkDoc
);
continue
;
if
(
aNames
.
Insert
(
pData
))
rtl
::
OUString
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
aNames
.
insert
(
aLinkDoc
).
second
)
++
nCount
;
++
nCount
;
else
delete
pData
;
}
}
}
return
nCount
;
return
nCount
;
}
}
...
@@ -562,36 +566,33 @@ sal_Bool SAL_CALL ScSheetLinksObj::hasByName( const rtl::OUString& aName )
...
@@ -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
)
uno
::
Sequence
<
rtl
::
OUString
>
SAL_CALL
ScSheetLinksObj
::
getElementNames
()
throw
(
uno
::
RuntimeException
)
{
{
typedef
boost
::
unordered_set
<
rtl
::
OUString
,
rtl
::
OUStringHash
>
StrSetType
;
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
// Name ist der Dateiname
// Name ist der Dateiname
if
(
pDocShell
)
if
(
!
pDocShell
)
{
return
uno
::
Sequence
<
rtl
::
OUString
>
();
ScStrCollection
aNames
;
// um doppelte wegzulassen
StrSetType
aNames
;
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
ScDocument
*
pDoc
=
pDocShell
->
GetDocument
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
SCTAB
nTabCount
=
pDoc
->
GetTableCount
();
String
aName
;
sal_Int32
nLinkCount
=
getCount
();
sal_Int32
nLinkCount
=
getCount
();
uno
::
Sequence
<
rtl
::
OUString
>
aSeq
(
nLinkCount
);
uno
::
Sequence
<
rtl
::
OUString
>
aSeq
(
nLinkCount
);
rtl
::
OUString
*
pAry
=
aSeq
.
getArray
();
rtl
::
OUString
*
pAry
=
aSeq
.
getArray
();
sal_uInt16
nPos
=
0
;
sal_uInt16
nPos
=
0
;
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
nTab
++
)
for
(
SCTAB
nTab
=
0
;
nTab
<
nTabCount
;
++
nTab
)
{
if
(
pDoc
->
IsLinked
(
nTab
))
{
{
String
aLinkDoc
(
pDoc
->
GetLinkDoc
(
nTab
));
if
(
!
pDoc
->
IsLinked
(
nTab
))
StrData
*
pData
=
new
StrData
(
aLinkDoc
);
continue
;
if
(
aNames
.
Insert
(
pData
))
rtl
::
OUString
aLinkDoc
=
pDoc
->
GetLinkDoc
(
nTab
);
if
(
aNames
.
insert
(
aLinkDoc
).
second
)
pAry
[
nPos
++
]
=
aLinkDoc
;
pAry
[
nPos
++
]
=
aLinkDoc
;
else
delete
pData
;
}
}
}
OSL_ENSURE
(
nPos
==
nLinkCount
,
"verzaehlt"
);
OSL_ENSURE
(
nPos
==
nLinkCount
,
"verzaehlt"
);
return
aSeq
;
return
aSeq
;
}
return
uno
::
Sequence
<
rtl
::
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