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
ef13ab6f
Kaydet (Commit)
ef13ab6f
authored
Mar 31, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
also refactor description setter
Change-Id: I69deac6d830f63aea94f3512ab4156217fbc7b27
üst
bd00847f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
32 deletions
+20
-32
unotbl.hxx
sw/inc/unotbl.hxx
+1
-0
unotbl.cxx
sw/source/core/unocore/unotbl.cxx
+19
-32
No files found.
sw/inc/unotbl.hxx
Dosyayı görüntüle @
ef13ab6f
...
@@ -467,6 +467,7 @@ class SwXCellRange : public cppu::WeakImplHelper7
...
@@ -467,6 +467,7 @@ class SwXCellRange : public cppu::WeakImplHelper7
bool
m_bFirstColumnAsLabel
;
bool
m_bFirstColumnAsLabel
;
std
::
tuple
<
sal_uInt32
,
sal_uInt32
,
sal_uInt32
,
sal_uInt32
>
getLabelCoordinates
(
bool
bRow
);
std
::
tuple
<
sal_uInt32
,
sal_uInt32
,
sal_uInt32
,
sal_uInt32
>
getLabelCoordinates
(
bool
bRow
);
css
::
uno
::
Sequence
<
OUString
>
getLabelDescriptions
(
bool
bRow
);
css
::
uno
::
Sequence
<
OUString
>
getLabelDescriptions
(
bool
bRow
);
void
setLabelDescriptions
(
const
css
::
uno
::
Sequence
<
OUString
>&
rDesc
,
bool
bRow
);
public
:
public
:
SwXCellRange
(
SwUnoCrsr
*
pCrsr
,
SwFrmFmt
&
rFrmFmt
,
SwRangeDescriptor
&
rDesc
);
SwXCellRange
(
SwUnoCrsr
*
pCrsr
,
SwFrmFmt
&
rFrmFmt
,
SwRangeDescriptor
&
rDesc
);
...
...
sw/source/core/unocore/unotbl.cxx
Dosyayı görüntüle @
ef13ab6f
...
@@ -4006,44 +4006,31 @@ uno::Sequence<OUString> SwXCellRange::getColumnDescriptions(void)
...
@@ -4006,44 +4006,31 @@ uno::Sequence<OUString> SwXCellRange::getColumnDescriptions(void)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
return
getLabelDescriptions
(
false
);
}
{
return
getLabelDescriptions
(
false
);
}
void
SwXCellRange
::
setRowDescriptions
(
const
uno
::
Sequence
<
OUString
>&
rRowDesc
)
void
SwXCellRange
::
setLabelDescriptions
(
const
uno
::
Sequence
<
OUString
>&
rDesc
,
bool
bRow
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
{
SolarMutexGuard
aGuard
;
SolarMutexGuard
aGuard
;
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
const
sal_uInt16
nRowCount
=
getRowCount
();
if
(
!
(
bRow
?
m_bFirstColumnAsLabel
:
m_bFirstRowAsLabel
))
if
(
!
m_bFirstColumnAsLabel
)
return
;
// if there are no labels we cannot set descriptions
const
OUString
*
pArray
=
rRowDesc
.
getConstArray
();
const
sal_uInt16
nStart
=
m_bFirstColumnAsLabel
?
1
:
0
;
if
(
!
nRowCount
||
rRowDesc
.
getLength
()
+
nStart
<
nRowCount
)
throw
uno
::
RuntimeException
(
"Illegal arguments"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
for
(
sal_uInt16
i
=
nStart
;
i
<
nRowCount
;
i
++
)
{
uno
::
Reference
<
text
::
XText
>
xCell
(
getCellByPosition
(
0
,
i
),
uno
::
UNO_QUERY_THROW
);
xCell
->
setString
(
pArray
[
i
-
nStart
]);
}
}
void
SwXCellRange
::
setColumnDescriptions
(
const
uno
::
Sequence
<
OUString
>&
rColumnDesc
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
SolarMutexGuard
aGuard
;
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
const
sal_uInt16
nColumnCount
=
getColumnCount
();
if
(
!
m_bFirstRowAsLabel
)
return
;
// if there are no labels we cannot set descriptions
return
;
// if there are no labels we cannot set descriptions
const
sal_uInt16
nStart
=
m_bFirstRowAsLabel
?
1
:
0
;
sal_uInt32
nLeft
,
nTop
,
nRight
,
nBottom
;
if
(
!
nColumnCount
||
rColumnDesc
.
getLength
()
+
nStart
<
nColumnCount
)
std
::
tie
(
nLeft
,
nTop
,
nRight
,
nBottom
)
=
getLabelCoordinates
(
bRow
);
throw
uno
::
RuntimeException
(
"Illegal arguments"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
if
(
!
nRight
&&
!
nBottom
)
const
OUString
*
pArray
=
rColumnDesc
.
getConstArray
();
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
for
(
sal_uInt16
i
=
nStart
;
i
<
nColumnCount
;
i
++
)
auto
xLabelRange
(
getCellRangeByPosition
(
nLeft
,
nTop
,
nRight
,
nBottom
));
{
auto
vCells
(
static_cast
<
SwXCellRange
*>
(
xLabelRange
.
get
())
->
getCells
());
uno
::
Reference
<
text
::
XText
>
xCell
(
getCellByPosition
(
i
,
0
),
uno
::
UNO_QUERY_THROW
);
if
(
rDesc
.
getLength
()
!=
vCells
.
size
())
xCell
->
setString
(
pArray
[
i
-
nStart
]);
throw
uno
::
RuntimeException
(
"Too few or too many descriptions"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
}
auto
pDescIterator
(
rDesc
.
begin
());
for
(
auto
xCell
:
vCells
)
uno
::
Reference
<
text
::
XText
>
(
xCell
,
uno
::
UNO_QUERY_THROW
)
->
setString
(
*
pDescIterator
++
);
}
}
void
SwXCellRange
::
setRowDescriptions
(
const
uno
::
Sequence
<
OUString
>&
rRowDesc
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
setLabelDescriptions
(
rRowDesc
,
true
);
}
void
SwXCellRange
::
setColumnDescriptions
(
const
uno
::
Sequence
<
OUString
>&
rColumnDesc
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
setLabelDescriptions
(
rColumnDesc
,
false
);
}
void
SAL_CALL
SwXCellRange
::
addChartDataChangeEventListener
(
void
SAL_CALL
SwXCellRange
::
addChartDataChangeEventListener
(
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
xListener
)
const
uno
::
Reference
<
chart
::
XChartDataChangeEventListener
>
&
xListener
)
...
...
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