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
ea35a682
Kaydet (Commit)
ea35a682
authored
Nis 11, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use getCells()
Change-Id: Ib3e115b7b96d0536db6917e84cfac7816176b296
üst
b845d236
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
21 deletions
+22
-21
unotbl.cxx
sw/source/core/unocore/unotbl.cxx
+22
-21
No files found.
sw/source/core/unocore/unotbl.cxx
Dosyayı görüntüle @
ea35a682
...
@@ -3674,13 +3674,13 @@ void SAL_CALL SwXCellRange::setDataArray(const uno::Sequence< uno::Sequence< uno
...
@@ -3674,13 +3674,13 @@ void SAL_CALL SwXCellRange::setDataArray(const uno::Sequence< uno::Sequence< uno
if
(
!
pFmt
)
if
(
!
pFmt
)
return
;
return
;
if
(
rArray
.
getLength
()
!=
nRowCount
)
if
(
rArray
.
getLength
()
!=
nRowCount
)
throw
uno
::
RuntimeException
(
"Row count mismatch
"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
throw
uno
::
RuntimeException
(
"Row count mismatch
. expected: "
+
OUString
::
number
(
nRowCount
)
+
" got: "
+
OUString
::
number
(
rArray
.
getLength
())
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
auto
vCells
(
getCells
());
auto
vCells
(
getCells
());
auto
pCurrentCell
(
vCells
.
begin
());
auto
pCurrentCell
(
vCells
.
begin
());
for
(
const
auto
&
rColSeq
:
rArray
)
for
(
const
auto
&
rColSeq
:
rArray
)
{
{
if
(
rColSeq
.
getLength
()
!=
nColCount
)
if
(
rColSeq
.
getLength
()
!=
nColCount
)
throw
uno
::
RuntimeException
(
"Column count mismatch
"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
throw
uno
::
RuntimeException
(
"Column count mismatch
. expected: "
+
OUString
::
number
(
nColCount
)
+
" got: "
+
OUString
::
number
(
rColSeq
.
getLength
())
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
for
(
const
auto
&
aValue
:
rColSeq
)
for
(
const
auto
&
aValue
:
rColSeq
)
{
{
auto
pCell
(
static_cast
<
SwXCell
*>
(
pCurrentCell
->
get
()));
auto
pCell
(
static_cast
<
SwXCell
*>
(
pCurrentCell
->
get
()));
...
@@ -3706,16 +3706,16 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno:
...
@@ -3706,16 +3706,16 @@ uno::Sequence< uno::Sequence< double > > SwXCellRange::getData(void) throw( uno:
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
if
(
m_bFirstColumnAsLabel
||
m_bFirstRowAsLabel
)
if
(
m_bFirstColumnAsLabel
||
m_bFirstRowAsLabel
)
{
{
uno
::
Reference
<
chart
::
XChartDataArray
>
xDataRange
(
getCellRangeByPosition
(
m_bFirst
RowAsLabel
?
1
:
0
,
m_bFirstColumn
AsLabel
?
1
:
0
,
uno
::
Reference
<
chart
::
XChartDataArray
>
xDataRange
(
getCellRangeByPosition
(
m_bFirst
ColumnAsLabel
?
1
:
0
,
m_bFirstRow
AsLabel
?
1
:
0
,
n
RowCount
,
nColCount
),
uno
::
UNO_QUERY
);
n
ColCount
-
1
,
nRowCount
-
1
),
uno
::
UNO_QUERY
);
return
xDataRange
->
getData
();
return
xDataRange
->
getData
();
}
}
uno
::
Sequence
<
uno
::
Sequence
<
double
>
>
vRows
(
n
Col
Count
);
uno
::
Sequence
<
uno
::
Sequence
<
double
>
>
vRows
(
n
Row
Count
);
auto
vCells
(
getCells
());
auto
vCells
(
getCells
());
auto
pCurrentCell
(
vCells
.
begin
());
auto
pCurrentCell
(
vCells
.
begin
());
for
(
auto
&
rRow
:
vRows
)
for
(
auto
&
rRow
:
vRows
)
{
{
rRow
=
uno
::
Sequence
<
double
>
(
n
Row
Count
);
rRow
=
uno
::
Sequence
<
double
>
(
n
Col
Count
);
for
(
auto
&
rValue
:
rRow
)
for
(
auto
&
rValue
:
rRow
)
{
{
rValue
=
(
*
pCurrentCell
)
->
getValue
();
rValue
=
(
*
pCurrentCell
)
->
getValue
();
...
@@ -3733,24 +3733,25 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData
...
@@ -3733,24 +3733,25 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData
const
sal_uInt16
nColCount
=
getColumnCount
();
const
sal_uInt16
nColCount
=
getColumnCount
();
if
(
!
nRowCount
||
!
nColCount
)
if
(
!
nRowCount
||
!
nColCount
)
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
if
(
m_bFirstColumnAsLabel
||
m_bFirstRowAsLabel
)
{
uno
::
Reference
<
chart
::
XChartDataArray
>
xDataRange
(
getCellRangeByPosition
(
m_bFirstColumnAsLabel
?
1
:
0
,
m_bFirstRowAsLabel
?
1
:
0
,
nColCount
-
1
,
nRowCount
-
1
),
uno
::
UNO_QUERY
);
return
xDataRange
->
setData
(
rData
);
}
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
const
sal_uInt16
nRowStart
=
m_bFirstRowAsLabel
?
1
:
0
;
if
(
rData
.
getLength
()
!=
nRowCount
)
if
(
rData
.
getLength
()
<
nRowCount
-
nRowStart
)
throw
uno
::
RuntimeException
(
"Row count mismatch. expected: "
+
OUString
::
number
(
nRowCount
)
+
" got: "
+
OUString
::
number
(
rData
.
getLength
()),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
throw
uno
::
RuntimeException
(
"Illegal arguments"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
auto
vCells
(
getCells
(
));
const
uno
::
Sequence
<
double
>*
pRowArray
=
rData
.
getConstArray
(
);
auto
pCurrentCell
(
vCells
.
begin
()
);
for
(
sal_uInt16
nRow
=
nRowStart
;
nRow
<
nRowCount
;
++
nRow
)
for
(
const
auto
&
rRow
:
rData
)
{
{
const
uno
::
Sequence
<
double
>&
rColSeq
=
pRowArray
[
nRow
-
nRowStart
];
if
(
rRow
.
getLength
()
!=
nColCount
)
const
sal_uInt16
nColStart
=
m_bFirstColumnAsLabel
?
1
:
0
;
throw
uno
::
RuntimeException
(
"Column count mismatch. expected: "
+
OUString
::
number
(
nColCount
)
+
" got: "
+
OUString
::
number
(
rRow
.
getLength
()),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
if
(
rColSeq
.
getLength
()
<
nColCount
-
nColStart
)
for
(
const
auto
&
rValue
:
rRow
)
throw
uno
::
RuntimeException
(
"Illegal arguments"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
const
double
*
pColArray
=
rColSeq
.
getConstArray
();
for
(
sal_uInt16
nCol
=
nColStart
;
nCol
<
nColCount
;
nCol
++
)
{
{
uno
::
Reference
<
table
::
XCell
>
xCell
=
getCellByPosition
(
nCol
,
nRow
);
uno
::
Reference
<
table
::
XCell
>
(
*
pCurrentCell
,
uno
::
UNO_QUERY
)
->
setValue
(
rValue
);
if
(
!
xCell
.
is
())
++
pCurrentCell
;
throw
uno
::
RuntimeException
(
"Illegal arguments"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
xCell
->
setValue
(
pColArray
[
nCol
-
nColStart
]);
}
}
}
}
}
}
...
...
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