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
bd00847f
Kaydet (Commit)
bd00847f
authored
Mar 31, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
refactor labels getter on one base
Change-Id: I21a6ea8d76b94e09ae05e63a01d451b776e6ddcd
üst
849bf23a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
29 deletions
+33
-29
unotbl.hxx
sw/inc/unotbl.hxx
+3
-0
unotbl.cxx
sw/source/core/unocore/unotbl.cxx
+30
-29
No files found.
sw/inc/unotbl.hxx
Dosyayı görüntüle @
bd00847f
...
...
@@ -45,6 +45,7 @@
#include <TextCursorHelper.hxx>
#include <unotext.hxx>
#include <frmfmt.hxx>
#include <tuple>
class
SwUnoCrsr
;
class
SwTable
;
...
...
@@ -464,6 +465,8 @@ class SwXCellRange : public cppu::WeakImplHelper7
bool
m_bFirstRowAsLabel
;
bool
m_bFirstColumnAsLabel
;
std
::
tuple
<
sal_uInt32
,
sal_uInt32
,
sal_uInt32
,
sal_uInt32
>
getLabelCoordinates
(
bool
bRow
);
css
::
uno
::
Sequence
<
OUString
>
getLabelDescriptions
(
bool
bRow
);
public
:
SwXCellRange
(
SwUnoCrsr
*
pCrsr
,
SwFrmFmt
&
rFrmFmt
,
SwRangeDescriptor
&
rDesc
);
...
...
sw/source/core/unocore/unotbl.cxx
Dosyayı görüntüle @
bd00847f
...
...
@@ -3963,47 +3963,48 @@ void SwXCellRange::setData(const uno::Sequence< uno::Sequence< double > >& rData
}
}
///@see SwXTextTable::getRowDescriptions (TODO: seems to be copy and paste programming here)
uno
::
Sequence
<
OUString
>
SwXCellRange
::
getRowDescriptions
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
std
::
tuple
<
sal_uInt32
,
sal_uInt32
,
sal_uInt32
,
sal_uInt32
>
SwXCellRange
::
getLabelCoordinates
(
bool
bRow
)
{
sal_uInt32
nLeft
,
nTop
,
nRight
,
nBottom
;
nLeft
=
nTop
=
nRight
=
nBottom
=
0
;
if
(
bRow
)
{
nTop
=
m_bFirstRowAsLabel
?
1
:
0
;
nBottom
=
getRowCount
()
-
1
;
}
else
{
nLeft
=
m_bFirstColumnAsLabel
?
1
:
0
;
nRight
=
getColumnCount
()
-
1
;
}
return
std
::
make_tuple
(
nLeft
,
nTop
,
nRight
,
nBottom
);
}
uno
::
Sequence
<
OUString
>
SwXCellRange
::
getLabelDescriptions
(
bool
bRow
)
{
SolarMutexGuard
aGuard
;
const
sal_uInt16
nRowCount
=
getRowCount
();
if
(
!
nRowCount
)
sal_uInt32
nLeft
,
nTop
,
nRight
,
nBottom
;
std
::
tie
(
nLeft
,
nTop
,
nRight
,
nBottom
)
=
getLabelCoordinates
(
bRow
);
if
(
!
nRight
&&
!
nBottom
)
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
if
(
!
m_bFirstColumnAsLabel
)
if
(
!
(
bRow
?
m_bFirstColumnAsLabel
:
m_bFirstRowAsLabel
)
)
return
{};
// without labels we have no descriptions
uno
::
Reference
<
chart
::
XChartDataArray
>
xRowLabelRange
(
getCellRangeByPosition
(
0
,
m_bFirstRowAsLabel
?
1
:
0
,
0
,
nRowCount
-
1
),
uno
::
UNO_QUERY
);
auto
vCells
(
static_cast
<
SwXCellRange
*>
(
x
Row
LabelRange
.
get
())
->
getCells
());
auto
xLabelRange
(
getCellRangeByPosition
(
nLeft
,
nTop
,
nRight
,
nBottom
)
);
auto
vCells
(
static_cast
<
SwXCellRange
*>
(
xLabelRange
.
get
())
->
getCells
());
uno
::
Sequence
<
OUString
>
vResult
(
vCells
.
size
());
//size_t i = 0;
//for(auto& xCell : vCells)
// vResult[i++] = uno::Reference<text::XText>(xCell, uno::UNO_QUERY_THROW)->getString();
std
::
transform
(
vCells
.
begin
(),
vCells
.
end
(),
vResult
.
begin
(),
[](
uno
::
Reference
<
table
::
XCell
>
xCell
)
->
OUString
{
return
uno
::
Reference
<
text
::
XText
>
(
xCell
,
uno
::
UNO_QUERY_THROW
)
->
getString
();
});
return
vResult
;
}
uno
::
Sequence
<
OUString
>
SwXCellRange
::
getRowDescriptions
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
return
getLabelDescriptions
(
true
);
}
uno
::
Sequence
<
OUString
>
SwXCellRange
::
getColumnDescriptions
(
void
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
{
SolarMutexGuard
aGuard
;
const
sal_uInt16
nColumnCount
=
getColumnCount
();
if
(
!
nColumnCount
)
throw
uno
::
RuntimeException
(
"Table too complex"
,
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
uno
::
Sequence
<
OUString
>
aRet
(
m_bFirstRowAsLabel
?
nColumnCount
-
1
:
nColumnCount
);
lcl_EnsureCoreConnected
(
GetFrmFmt
(),
static_cast
<
cppu
::
OWeakObject
*>
(
this
));
if
(
!
m_bFirstRowAsLabel
)
return
{};
// without labels we have no descriptions
OUString
*
pArray
=
aRet
.
getArray
();
const
sal_uInt16
nStart
=
m_bFirstColumnAsLabel
?
1
:
0
;
for
(
sal_uInt16
i
=
nStart
;
i
<
nColumnCount
;
i
++
)
{
const
uno
::
Reference
<
text
::
XText
>
xCell
(
getCellByPosition
(
i
,
0
),
uno
::
UNO_QUERY_THROW
);
pArray
[
i
-
nStart
]
=
xCell
->
getString
();
}
return
aRet
;
}
{
return
getLabelDescriptions
(
false
);
}
void
SwXCellRange
::
setRowDescriptions
(
const
uno
::
Sequence
<
OUString
>&
rRowDesc
)
throw
(
uno
::
RuntimeException
,
std
::
exception
)
...
...
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